{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "eventId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "installId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "cliVersion": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"
        },
        "os": {
          "type": "string",
          "enum": [
            "darwin",
            "linux",
            "other"
          ]
        },
        "nodeMajor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "exclusiveMinimum": 0
        },
        "agent": {
          "type": "string",
          "enum": [
            "claude",
            "codex",
            "opencode",
            "cursor",
            "other",
            "none"
          ]
        },
        "sentAt": {
          "type": "string",
          "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{3})?Z$",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "enum": [
            "new"
          ]
        },
        "projectId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "stack": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "fragments": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "without": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "preset": {
          "type": "string",
          "enum": [
            "default",
            "sandbox"
          ]
        },
        "targetAgents": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "claude",
              "codex",
              "opencode",
              "cursor"
            ]
          }
        },
        "handoff": {
          "type": "string",
          "enum": [
            "inside-agent",
            "launch",
            "print"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "web",
            "docs",
            "skill",
            "cli",
            "other"
          ]
        },
        "origin": {
          "type": "string",
          "enum": [
            "bundled",
            "index",
            "mixed"
          ]
        },
        "nonOfficial": {
          "type": "object",
          "properties": {
            "user": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "project": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "source": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "user",
            "project",
            "source"
          ],
          "additionalProperties": false
        },
        "fingerprint": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        }
      },
      "required": [
        "schemaVersion",
        "eventId",
        "installId",
        "cliVersion",
        "os",
        "nodeMajor",
        "agent",
        "sentAt",
        "type",
        "stack",
        "fragments",
        "without",
        "preset",
        "targetAgents",
        "handoff",
        "nonOfficial"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "eventId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "installId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "cliVersion": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"
        },
        "os": {
          "type": "string",
          "enum": [
            "darwin",
            "linux",
            "other"
          ]
        },
        "nodeMajor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "exclusiveMinimum": 0
        },
        "agent": {
          "type": "string",
          "enum": [
            "claude",
            "codex",
            "opencode",
            "cursor",
            "other",
            "none"
          ]
        },
        "sentAt": {
          "type": "string",
          "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{3})?Z$",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "enum": [
            "add"
          ]
        },
        "projectId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "stack": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "fragments": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "without": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
          }
        },
        "preset": {
          "type": "string",
          "enum": [
            "default",
            "sandbox"
          ]
        },
        "targetAgents": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "claude",
              "codex",
              "opencode",
              "cursor"
            ]
          }
        },
        "handoff": {
          "type": "string",
          "enum": [
            "inside-agent",
            "launch",
            "print"
          ]
        },
        "source": {
          "type": "string",
          "enum": [
            "web",
            "docs",
            "skill",
            "cli",
            "other"
          ]
        },
        "origin": {
          "type": "string",
          "enum": [
            "bundled",
            "index",
            "mixed"
          ]
        },
        "nonOfficial": {
          "type": "object",
          "properties": {
            "user": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "project": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "source": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "user",
            "project",
            "source"
          ],
          "additionalProperties": false
        },
        "fingerprint": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        }
      },
      "required": [
        "schemaVersion",
        "eventId",
        "installId",
        "cliVersion",
        "os",
        "nodeMajor",
        "agent",
        "sentAt",
        "type",
        "stack",
        "fragments",
        "without",
        "preset",
        "targetAgents",
        "handoff",
        "nonOfficial"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "eventId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "installId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "cliVersion": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"
        },
        "os": {
          "type": "string",
          "enum": [
            "darwin",
            "linux",
            "other"
          ]
        },
        "nodeMajor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "exclusiveMinimum": 0
        },
        "agent": {
          "type": "string",
          "enum": [
            "claude",
            "codex",
            "opencode",
            "cursor",
            "other",
            "none"
          ]
        },
        "sentAt": {
          "type": "string",
          "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{3})?Z$",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "enum": [
            "verify"
          ]
        },
        "projectId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "scope": {
          "type": "string",
          "enum": [
            "full",
            "partial"
          ]
        },
        "outcome": {
          "type": "string",
          "enum": [
            "green",
            "partial",
            "failed",
            "changed",
            "interrupted"
          ]
        },
        "tamperCheck": {
          "type": "string",
          "enum": [
            "full",
            "manifest-only"
          ]
        },
        "steps": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
              },
              "phase": {
                "type": "string",
                "enum": [
                  "setup",
                  "check",
                  "serve",
                  "teardown"
                ]
              },
              "layer": {
                "type": "string",
                "enum": [
                  "install",
                  "lint",
                  "typecheck",
                  "test",
                  "build",
                  "serve",
                  "docs",
                  "check"
                ]
              },
              "status": {
                "type": "string",
                "enum": [
                  "passed",
                  "failed",
                  "skipped"
                ]
              },
              "failureKind": {
                "type": "string",
                "enum": [
                  "step",
                  "env",
                  "timeout",
                  "interrupted"
                ]
              },
              "duration": {
                "type": "string",
                "enum": [
                  "5s",
                  "30s",
                  "2m",
                  "10m",
                  "longer"
                ]
              }
            },
            "required": [
              "name",
              "phase",
              "status",
              "duration"
            ],
            "additionalProperties": false
          }
        },
        "stepsChanged": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "secondsSinceScaffold": {
          "type": "number",
          "minimum": 0
        },
        "secondsToFirstTestPass": {
          "type": "number",
          "minimum": 0
        }
      },
      "required": [
        "schemaVersion",
        "eventId",
        "installId",
        "cliVersion",
        "os",
        "nodeMajor",
        "agent",
        "sentAt",
        "type",
        "scope",
        "outcome",
        "tamperCheck",
        "steps",
        "stepsChanged",
        "secondsSinceScaffold"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "eventId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "installId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "cliVersion": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"
        },
        "os": {
          "type": "string",
          "enum": [
            "darwin",
            "linux",
            "other"
          ]
        },
        "nodeMajor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "exclusiveMinimum": 0
        },
        "agent": {
          "type": "string",
          "enum": [
            "claude",
            "codex",
            "opencode",
            "cursor",
            "other",
            "none"
          ]
        },
        "sentAt": {
          "type": "string",
          "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{3})?Z$",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "enum": [
            "show"
          ]
        },
        "kind": {
          "type": "string",
          "enum": [
            "stack",
            "fragment"
          ]
        },
        "id": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        }
      },
      "required": [
        "schemaVersion",
        "eventId",
        "installId",
        "cliVersion",
        "os",
        "nodeMajor",
        "agent",
        "sentAt",
        "type",
        "kind",
        "id"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "number",
          "enum": [
            1
          ]
        },
        "eventId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "installId": {
          "type": "string",
          "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|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$",
          "format": "uuid"
        },
        "cliVersion": {
          "type": "string",
          "pattern": "^(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)$"
        },
        "os": {
          "type": "string",
          "enum": [
            "darwin",
            "linux",
            "other"
          ]
        },
        "nodeMajor": {
          "type": "integer",
          "maximum": 9007199254740991,
          "exclusiveMinimum": 0
        },
        "agent": {
          "type": "string",
          "enum": [
            "claude",
            "codex",
            "opencode",
            "cursor",
            "other",
            "none"
          ]
        },
        "sentAt": {
          "type": "string",
          "pattern": "^\\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\\d|3[01])T(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d{3})?Z$",
          "format": "date-time"
        },
        "type": {
          "type": "string",
          "enum": [
            "error"
          ]
        },
        "command": {
          "type": "string",
          "enum": [
            "new",
            "add"
          ]
        },
        "code": {
          "type": "string",
          "enum": [
            "ComposeConflict",
            "EntryInvalid",
            "TargetNotEmpty",
            "NotFound",
            "BadInput",
            "PermissionDenied",
            "Interrupted",
            "Defect",
            "other"
          ]
        },
        "stack": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        }
      },
      "required": [
        "schemaVersion",
        "eventId",
        "installId",
        "cliVersion",
        "os",
        "nodeMajor",
        "agent",
        "sentAt",
        "type",
        "command",
        "code"
      ],
      "additionalProperties": false
    }
  ]
}
