{
  "type": "object",
  "properties": {
    "action": {
      "type": "string",
      "enum": [
        "publish",
        "get",
        "tree",
        "file",
        "capture_status",
        "capture_retry",
        "capture_cancel",
        "purge",
        "export",
        "search",
        "threads_list",
        "threads_mutate",
        "threads_repair"
      ],
      "description": "Implemented domain action."
    },
    "input": {
      "type": "object",
      "description": "Exact action input including path identities."
    },
    "etag": {
      "type": "string",
      "maxLength": 1024,
      "description": "Exact resource ETag for conditional writes."
    },
    "idempotencyKey": {
      "type": "string",
      "maxLength": 200,
      "description": "Reuse only for the identical operation intent."
    }
  },
  "required": [
    "action",
    "input"
  ],
  "additionalProperties": false,
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "publish"
        },
        "input": {
          "$ref": "#/$defs/publishSourceSnapshotInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "get"
        },
        "input": {
          "$ref": "#/$defs/getSourceSnapshotInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "tree"
        },
        "input": {
          "$ref": "#/$defs/getSourceTreeInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "file"
        },
        "input": {
          "$ref": "#/$defs/getSourceFileInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "capture_status"
        },
        "input": {
          "$ref": "#/$defs/getSourceCaptureInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "capture_retry"
        },
        "input": {
          "$ref": "#/$defs/retrySourceCaptureInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "etag",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "capture_cancel"
        },
        "input": {
          "$ref": "#/$defs/cancelSourceCaptureInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "etag",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "purge"
        },
        "input": {
          "$ref": "#/$defs/purgeSourceSnapshotInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "etag",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "export"
        },
        "input": {
          "$ref": "#/$defs/exportSourceSnapshotInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "search"
        },
        "input": {
          "$ref": "#/$defs/searchSourceSnapshotInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "threads_list"
        },
        "input": {
          "$ref": "#/$defs/listSourceReviewThreadsInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "threads_mutate"
        },
        "input": {
          "$ref": "#/$defs/mutateSourceReviewThreadInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "idempotencyKey"
      ]
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "action": {
          "const": "threads_repair"
        },
        "input": {
          "$ref": "#/$defs/repairSourceReviewThreadsInput"
        },
        "etag": {
          "type": "string",
          "maxLength": 1024
        },
        "idempotencyKey": {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        }
      },
      "required": [
        "action",
        "input",
        "idempotencyKey"
      ]
    }
  ],
  "$defs": {
    "publishSourceSnapshotInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "workspaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "reference": {
          "$ref": "#/$defs/SourceReference"
        },
        "capturePolicy": {
          "type": "string",
          "enum": [
            "selected",
            "full"
          ]
        },
        "selectedPaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
          },
          "maxItems": 1000,
          "minItems": 0
        },
        "collaboration": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "polls": {
              "type": "boolean",
              "default": false
            },
            "consensus": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "enabled": {
                  "type": "boolean",
                  "default": false
                },
                "rule": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "mode": {
                      "enum": [
                        "owner_decides",
                        "no_open_blockers",
                        "n_of_m",
                        "required_reviewers"
                      ]
                    },
                    "agreementThreshold": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000
                    },
                    "minResponseCount": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 1000
                    },
                    "requiredReviewerIds": {
                      "type": "array",
                      "maxItems": 1000,
                      "uniqueItems": true,
                      "items": {
                        "type": "string"
                      }
                    },
                    "delegatedOwnerAgentParticipantId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "requiredReviewerCondition": {
                      "enum": [
                        "all_required_agree",
                        "no_required_objects",
                        "owner_plus_one_required_agrees",
                        "threshold_no_blockers"
                      ]
                    },
                    "objectionPolicy": {
                      "enum": [
                        "block",
                        "owner_decision",
                        "ignore"
                      ]
                    },
                    "countOwnerAgreement": {
                      "type": "boolean"
                    },
                    "countAgentSignals": {
                      "type": "boolean",
                      "default": false
                    },
                    "decisionPollCompletion": {
                      "enum": [
                        "closed",
                        "threshold"
                      ],
                      "default": "closed"
                    }
                  }
                },
                "gate": {
                  "type": "object",
                  "additionalProperties": false,
                  "properties": {
                    "minimumHumanApprovals": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1000
                    },
                    "requiredReviewerIds": {
                      "type": "array",
                      "uniqueItems": true,
                      "maxItems": 1000,
                      "items": {
                        "type": "string"
                      }
                    },
                    "quorum": {
                      "anyOf": [
                        {
                          "type": "null"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "group": {
                              "enum": [
                                "owner",
                                "invited_reviewers",
                                "all_human_reviewers"
                              ]
                            },
                            "minimum": {
                              "type": "integer",
                              "minimum": 1,
                              "maximum": 1000
                            }
                          },
                          "required": [
                            "group",
                            "minimum"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "fileRequirement": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "enum": [
                                "none",
                                "all"
                              ]
                            }
                          },
                          "required": [
                            "mode"
                          ],
                          "additionalProperties": false
                        },
                        {
                          "type": "object",
                          "properties": {
                            "mode": {
                              "const": "selected"
                            },
                            "filePaths": {
                              "type": "array",
                              "maxItems": 10000,
                              "uniqueItems": true,
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "mode",
                            "filePaths"
                          ],
                          "additionalProperties": false
                        }
                      ]
                    },
                    "agentMode": {
                      "enum": [
                        "prepare_only",
                        "wait_before_implementation"
                      ]
                    }
                  }
                }
              }
            }
          }
        }
      },
      "required": [
        "workspaceId",
        "reference",
        "capturePolicy"
      ]
    },
    "SourceReference": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "provider": {
          "type": "string",
          "enum": [
            "github",
            "azure_devops",
            "uploaded"
          ]
        },
        "resource": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "repository"
            },
            "id": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\s]+$"
            }
          },
          "required": [
            "type",
            "id"
          ]
        },
        "commitSha": {
          "type": "string",
          "pattern": "^[a-fA-F0-9]{40}$"
        },
        "uploadId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "provider",
        "resource"
      ]
    },
    "publishSourceSnapshotOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "SourceSnapshot": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "initialWorkspaceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "reference": {
          "$ref": "#/$defs/SourceReference"
        },
        "provenance": {
          "type": "string",
          "enum": [
            "provider_confirmed",
            "uploaded"
          ]
        },
        "capturePolicy": {
          "type": "string",
          "enum": [
            "selected",
            "full"
          ]
        },
        "selectedPaths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 1024,
            "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
          },
          "maxItems": 1000,
          "minItems": 0
        },
        "manifestSha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "version": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "state": {
          "type": "string",
          "enum": [
            "pending",
            "ready",
            "partial",
            "failed",
            "canceled",
            "purged"
          ]
        },
        "completeness": {
          "type": "string",
          "enum": [
            "pending",
            "selected_only",
            "complete",
            "incomplete",
            "purged"
          ]
        },
        "filesProcessed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "bytesProcessed": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "failureCode": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\s]+$"
            },
            {
              "type": "null"
            }
          ]
        },
        "retentionUntil": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
        },
        "createdAt": {
          "type": "string",
          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
        },
        "collaboration": {
          "type": "object",
          "required": [
            "review",
            "settings",
            "permissions",
            "providerSync",
            "revisionKey"
          ],
          "properties": {
            "review": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "draft"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "package"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "guide"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "snapshot"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "preview"
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "kind",
                    "id"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "pr"
                    },
                    "provider": {
                      "enum": [
                        "github",
                        "azure_devops"
                      ]
                    },
                    "owner": {
                      "type": "string"
                    },
                    "repo": {
                      "type": "string"
                    },
                    "projectName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "prNumber": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "required": [
                    "kind",
                    "provider",
                    "owner",
                    "repo",
                    "prNumber"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "kind": {
                      "const": "branch"
                    },
                    "provider": {
                      "enum": [
                        "github",
                        "azure_devops"
                      ]
                    },
                    "owner": {
                      "type": "string"
                    },
                    "repo": {
                      "type": "string"
                    },
                    "projectName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "branchRef": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "kind",
                    "provider",
                    "owner",
                    "repo",
                    "branchRef"
                  ],
                  "additionalProperties": false
                }
              ]
            },
            "settings": {
              "type": "object",
              "required": [
                "version",
                "polls",
                "consensus"
              ],
              "properties": {
                "version": {
                  "type": "integer",
                  "minimum": 0
                },
                "polls": {
                  "type": "boolean"
                },
                "consensus": {
                  "type": "object"
                }
              },
              "additionalProperties": false
            },
            "permissions": {
              "type": "object",
              "properties": {
                "comment": {
                  "type": "boolean"
                },
                "configure": {
                  "type": "boolean"
                },
                "humanSignOff": {
                  "type": "boolean"
                }
              }
            },
            "providerSync": {
              "type": "object",
              "properties": {
                "comments": {
                  "type": "boolean"
                },
                "pollSnapshots": {
                  "type": "boolean"
                },
                "liveVotes": {
                  "const": false
                },
                "decisions": {
                  "const": false
                }
              }
            },
            "revisionKey": {
              "type": [
                "string",
                "null"
              ]
            },
            "filePaths": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "participants": {
              "type": "array",
              "items": {
                "type": "object"
              }
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "id",
        "initialWorkspaceId",
        "reference",
        "provenance",
        "capturePolicy",
        "selectedPaths",
        "manifestSha256",
        "version",
        "state",
        "completeness",
        "filesProcessed",
        "bytesProcessed",
        "failureCode",
        "retentionUntil",
        "createdAt"
      ]
    },
    "getSourceSnapshotInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "getSourceSnapshotOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "getSourceTreeInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^[^\\s]+$"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "path": {
          "type": "string",
          "maxLength": 1024
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "getSourceTreeOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/SourceFile"
              },
              "maxItems": 100,
              "minItems": 0
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096,
                  "pattern": "^[^\\s]+$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "completeness": {
              "type": "string",
              "enum": [
                "pending",
                "selected_only",
                "complete",
                "incomplete"
              ]
            },
            "availability": {
              "type": "string",
              "enum": [
                "available",
                "unavailable"
              ]
            }
          },
          "required": [
            "items",
            "nextCursor",
            "completeness",
            "availability"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "SourceFile": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "blobHash": {
          "type": "string",
          "maxLength": 128
        },
        "kind": {
          "type": "string",
          "enum": [
            "file",
            "directory",
            "submodule"
          ]
        },
        "capture": {
          "type": "string",
          "enum": [
            "retained",
            "uncaptured",
            "unavailable"
          ]
        },
        "content": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 2097152
            },
            {
              "type": "null"
            }
          ]
        },
        "contentTruncated": {
          "type": "boolean"
        },
        "base64": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 25165824
            },
            {
              "type": "null"
            }
          ]
        },
        "bytes": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "sha256": {
          "anyOf": [
            {
              "type": "string",
              "pattern": "^[a-f0-9]{64}$"
            },
            {
              "type": "null"
            }
          ]
        },
        "binary": {
          "type": "boolean"
        },
        "nextLine": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "nextCursor": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096,
              "pattern": "^[^\\s]+$"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "path",
        "blobHash",
        "capture",
        "content",
        "nextCursor"
      ]
    },
    "getSourceFileInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "startLine": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "lineCount": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        }
      },
      "required": [
        "snapshotId",
        "path"
      ]
    },
    "getSourceFileOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceFile"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "getSourceCaptureInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "getSourceCaptureOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "retrySourceCaptureInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "retrySourceCaptureOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "cancelSourceCaptureInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "cancelSourceCaptureOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "purgeSourceSnapshotInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "purgeSourceSnapshotOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "$ref": "#/$defs/SourceSnapshot"
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "exportSourceSnapshotInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^[^\\s]+$"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "required": [
        "snapshotId"
      ]
    },
    "exportSourceSnapshotOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "snapshot": {
              "$ref": "#/$defs/SourceSnapshot"
            },
            "files": {
              "type": "array",
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "path": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 1024,
                    "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
                  },
                  "blobHash": {
                    "type": "string",
                    "maxLength": 128
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "file",
                      "directory",
                      "submodule"
                    ]
                  },
                  "sha256": {
                    "anyOf": [
                      {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "capture": {
                    "type": "string",
                    "enum": [
                      "retained",
                      "uncaptured"
                    ]
                  },
                  "base64": {
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 25165824
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "path",
                  "blobHash",
                  "kind",
                  "sha256",
                  "capture",
                  "base64"
                ]
              },
              "maxItems": 100,
              "minItems": 0
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096,
                  "pattern": "^[^\\s]+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "snapshot",
            "files",
            "nextCursor"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "searchSourceSnapshotInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "query": {
          "type": "string",
          "maxLength": 200
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^[^\\s]+$"
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      },
      "required": [
        "snapshotId",
        "query"
      ]
    },
    "searchSourceSnapshotOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/SourceFile"
              },
              "maxItems": 100,
              "minItems": 0
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096,
                  "pattern": "^[^\\s]+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "items",
            "nextCursor"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "listSourceReviewThreadsInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId",
        "path"
      ]
    },
    "listSourceReviewThreadsOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "items": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/SourceReviewThread"
              },
              "maxItems": 100,
              "minItems": 0
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096,
                  "pattern": "^[^\\s]+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "items",
            "nextCursor"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "SourceReviewThread": {
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "filePath": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "sourceAnchor": {
          "$ref": "#/$defs/SourceReviewAnchor"
        },
        "sourceVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "resolved"
          ]
        },
        "syncMode": {
          "const": "app_only"
        },
        "comments": {
          "type": "array",
          "items": {
            "type": "object"
          },
          "maxItems": 100,
          "minItems": 0
        }
      },
      "required": [
        "id",
        "filePath",
        "sourceAnchor",
        "sourceVersion",
        "status",
        "syncMode",
        "comments"
      ]
    },
    "SourceReviewAnchor": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "repositoryId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "blobHash": {
          "type": "string",
          "maxLength": 128
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "lineStart": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "lineEnd": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "selectedText": {
          "type": "string",
          "maxLength": 65536
        },
        "prefixText": {
          "type": "string",
          "maxLength": 4096
        },
        "suffixText": {
          "type": "string",
          "maxLength": 4096
        },
        "symbolId": {
          "type": "string",
          "maxLength": 200
        },
        "componentId": {
          "type": "string",
          "maxLength": 200
        }
      },
      "required": [
        "snapshotId",
        "repositoryId",
        "path",
        "blobHash",
        "sha256",
        "lineStart",
        "lineEnd",
        "selectedText",
        "prefixText",
        "suffixText"
      ]
    },
    "mutateSourceReviewThreadInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "action": {
          "type": "string",
          "enum": [
            "create",
            "reply",
            "edit",
            "delete",
            "status",
            "reattach"
          ]
        },
        "threadId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "commentId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "path": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024,
          "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.?(?:/|$))[^\\\\\\u0000]+$"
        },
        "lineStart": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "lineEnd": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "blobHash": {
          "type": "string",
          "maxLength": 128
        },
        "sha256": {
          "type": "string",
          "pattern": "^[a-f0-9]{64}$"
        },
        "bodyMarkdown": {
          "type": "string",
          "maxLength": 8192
        },
        "status": {
          "type": "string",
          "enum": [
            "open",
            "resolved"
          ]
        },
        "expectedVersion": {
          "type": "integer",
          "minimum": 1,
          "maximum": 9007199254740991
        },
        "requestDecision": {
          "type": "boolean"
        },
        "poll": {
          "type": "object"
        }
      },
      "required": [
        "snapshotId",
        "action"
      ]
    },
    "mutateSourceReviewThreadOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "threadId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\s]+$"
            },
            "commentId": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[^\\s]+$"
            },
            "deleted": {
              "type": "boolean"
            }
          },
          "required": [
            "threadId"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    },
    "repairSourceReviewThreadsInput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "snapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "sourceSnapshotId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "pattern": "^[^\\s]+$"
        },
        "cursor": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096,
          "pattern": "^[^\\s]+$"
        }
      },
      "required": [
        "snapshotId",
        "sourceSnapshotId"
      ]
    },
    "repairSourceReviewThreadsOutput": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "processed": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            },
            "nextCursor": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 4096,
                  "pattern": "^[^\\s]+$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "processed",
            "nextCursor"
          ]
        },
        "idempotencyReplayed": {
          "type": "boolean"
        }
      },
      "required": [
        "data"
      ]
    }
  }
}