{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ponolens.com/developers/protocol-v1.schema.json",
  "title": "PonoLens Developer Event v1 Beta",
  "description": "Beta schema for the loopback-only, Report Only developer endpoint in the PonoLens desktop app.",
  "type": "object",
  "additionalProperties": false,
  "required": ["schema", "integration", "event", "sessionId", "occurredAt", "data"],
  "properties": {
    "schema": { "const": "ponolens.event.v1" },
    "integration": { "type": "string", "minLength": 2, "maxLength": 80 },
    "event": { "enum": ["prompt.submitted", "tool.before_use", "command.before_run", "file.changed", "session.started", "session.ended"] },
    "sessionId": { "type": "string", "minLength": 1, "maxLength": 200 },
    "occurredAt": { "type": "string", "format": "date-time" },
    "data": {
      "type": "object",
      "description": "Event-specific values. Command output, model output, credentials, screenshots, environment dumps, and token maps are not accepted.",
      "additionalProperties": false,
      "properties": {
        "content": { "type": "string", "maxLength": 100000 },
        "destination": { "type": "string", "maxLength": 500 },
        "cwd": { "type": "string", "maxLength": 2000 },
        "toolName": { "type": "string", "maxLength": 200 },
        "toolInput": { "type": "string", "maxLength": 50000 },
        "command": { "type": "string", "maxLength": 20000 },
        "path": { "type": "string", "maxLength": 4000 },
        "changeType": { "type": "string", "maxLength": 40 },
        "model": { "type": "string", "maxLength": 200 },
        "provider": { "type": "string", "maxLength": 200 }
      }
    }
  }
}
