{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://workspai.dev/schemas/cli-log-event.v1.json",
  "title": "Workspai CLI Log Event",
  "description": "NDJSON stream events emitted on stderr when RAPIDKIT_LOG_FORMAT=json or --log-format json",
  "type": "object",
  "required": [
    "schemaVersion",
    "runId",
    "timestamp",
    "level",
    "event",
    "component",
    "message"
  ],
  "properties": {
    "schemaVersion": {
      "const": "cli-log-event-v1"
    },
    "runId": {
      "type": "string",
      "minLength": 8
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "level": {
      "enum": ["debug", "info", "warn", "error"]
    },
    "event": {
      "enum": ["log", "progress", "run.started", "run.completed", "run.failed"]
    },
    "component": {
      "type": "string",
      "minLength": 1
    },
    "message": {
      "type": "string"
    },
    "command": {
      "type": "array",
      "items": { "type": "string" }
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    }
  },
  "additionalProperties": false
}
