{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://stravica.ai/schemas/inspection/1.0",
  "title": "MigrateInspectionResult",
  "type": "object",
  "required": ["host", "runtimes", "scheduled", "mounts", "daveEnv", "paths", "extensions", "inspectedAt"],
  "properties": {
    "host": {
      "type": "object",
      "required": ["hostname", "os", "osVersion", "arch"],
      "properties": {
        "hostname": { "type": "string" },
        "os": { "type": "string" },
        "osVersion": { "type": "string" },
        "arch": { "type": "string" },
        "chip": { "type": "string" },
        "memory": { "type": "number" }
      }
    },
    "runtimes": {
      "type": "object",
      "required": ["nodeVersion", "pnpmVersion", "gitVersion"],
      "properties": {
        "nodeVersion": { "type": ["string", "null"] },
        "pnpmVersion": { "type": ["string", "null"] },
        "gitVersion": { "type": ["string", "null"] }
      }
    },
    "scheduled": {
      "type": "object",
      "required": ["crontab", "launchdPlists"],
      "properties": {
        "crontab": {
          "type": "array",
          "items": {
            "type": "object",
            "required": ["schedule", "command"],
            "properties": {
              "schedule": { "type": "string" },
              "command": { "type": "string" }
            }
          }
        },
        "launchdPlists": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": { "type": ["string", "null"] },
              "program": { "type": ["string", "null"] },
              "args": {
                "oneOf": [
                  { "type": "array", "items": { "type": "string" } },
                  { "type": "null" }
                ]
              },
              "workingDirectory": { "type": ["string", "null"] },
              "runAtLoad": { "type": "boolean" },
              "keepAlive": { "type": "boolean" }
            }
          }
        }
      }
    },
    "mounts": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["source", "target", "fsType"],
        "properties": {
          "source": { "type": "string" },
          "target": { "type": "string" },
          "fsType": { "type": "string" }
        }
      }
    },
    "daveEnv": {
      "type": "object",
      "required": ["daveRoot", "daveRelevantEnvVars", "pathSegments"],
      "properties": {
        "daveRoot": { "type": ["string", "null"] },
        "daveRelevantEnvVars": { "type": "object" },
        "pathSegments": { "type": "array", "items": { "type": "string" } }
      }
    },
    "paths": {
      "type": "object",
      "required": ["daveRoot", "coreToolsPath", "operatorPath", "layoutVersion"],
      "properties": {
        "daveRoot": { "type": ["string", "null"] },
        "coreToolsPath": { "type": ["string", "null"] },
        "operatorPath": { "type": ["string", "null"] },
        "layoutVersion": {
          "type": "string",
          "enum": ["v1", "v2", "unknown"]
        }
      }
    },
    "extensions": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["name", "path", "hasManifestEntry"],
        "properties": {
          "name": { "type": "string" },
          "path": { "type": "string" },
          "hasManifestEntry": { "type": "boolean" }
        }
      }
    },
    "inspectedAt": { "type": "string" }
  }
}
