{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/workspace-snapshot.v2.json",
  "title": "Workspai Workspace Snapshot v2",
  "type": "object",
  "required": [
    "schema",
    "name",
    "mode",
    "createdAt",
    "workspaceName",
    "workspacePath",
    "copiedPaths",
    "projects",
    "recoveryScope"
  ],
  "properties": {
    "schema": {
      "const": "rapidkit-workspace-snapshot-v2"
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "mode": {
      "const": "project"
    },
    "reason": {
      "type": "string"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "workspaceName": {
      "type": "string",
      "minLength": 1
    },
    "workspacePath": {
      "type": "string",
      "minLength": 1
    },
    "copiedPaths": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "projects": {
      "type": "array",
      "minItems": 1,
      "maxItems": 1,
      "items": {
        "type": "object",
        "required": [
          "name",
          "relativePath"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1
          },
          "relativePath": {
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false
      }
    },
    "recoveryScope": {
      "type": "object",
      "required": [
        "kind",
        "projectName",
        "relativePath"
      ],
      "properties": {
        "kind": {
          "const": "project"
        },
        "projectName": {
          "type": "string",
          "minLength": 1
        },
        "relativePath": {
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    }
  },
  "additionalProperties": false
}
