{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rye-dev/json-schema/rye-dev-agent-observatory-response-schema.json",
  "title": "AgentObservatoryResponse",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rye-dev-openapi.json#/components/schemas/AgentObservatoryResponse",
  "type": "object",
  "required": [
    "success",
    "observatory"
  ],
  "properties": {
    "success": {
      "type": "boolean"
    },
    "observatory": {
      "type": "object",
      "required": [
        "asOf",
        "totalsToday",
        "topAgent",
        "topTool",
        "series",
        "recent"
      ],
      "properties": {
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "description": "Latest rollup or current date (YYYY-MM-DD, UTC), or null."
        },
        "totalsToday": {
          "type": "object",
          "required": [
            "total",
            "byType"
          ],
          "properties": {
            "total": {
              "type": "integer",
              "minimum": 0
            },
            "byType": {
              "type": "object",
              "additionalProperties": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        },
        "topAgent": {
          "type": [
            "string",
            "null"
          ]
        },
        "topTool": {
          "type": [
            "string",
            "null"
          ]
        },
        "series": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "14-day daily event totals, oldest→newest."
        },
        "recent": {
          "type": "array",
          "description": "Most recent PII-safe agent events, newest first (≤15).",
          "items": {
            "type": "object",
            "required": [
              "eventType",
              "toolName",
              "clientName",
              "clientVersion",
              "uaFamily",
              "at"
            ],
            "properties": {
              "eventType": {
                "type": "string",
                "enum": [
                  "mcp_tool",
                  "llms_txt",
                  "md_mirror",
                  "a2a"
                ]
              },
              "toolName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "clientName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "clientVersion": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "uaFamily": {
                "type": "string"
              },
              "at": {
                "type": "integer",
                "description": "Epoch seconds."
              }
            }
          }
        }
      }
    }
  }
}