{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agentweb.us/.well-known/agent-traffic-event.schema.json",
  "title": "AgentWeb Agent Traffic Event",
  "type": "object",
  "required": [
    "event_id",
    "timestamp",
    "session_id",
    "agent_protocol",
    "discovery_surface",
    "task_type",
    "conversion_state",
    "privacy_redactions"
  ],
  "properties": {
    "event_id": { "type": "string" },
    "timestamp": { "type": "string", "format": "date-time" },
    "session_id": { "type": "string" },
    "setup_session_id": { "type": "string" },
    "agent_id": { "type": "string", "description": "Hash or pseudonymous ID; raw identity is not required." },
    "agent_name": { "type": "string" },
    "agent_provider": { "type": "string" },
    "agent_protocol": { "type": "string", "enum": ["a2a", "mcp", "openapi", "direct_api", "human_web", "unknown"] },
    "client_user_agent": { "type": "string" },
    "source_ip_region": { "type": "string", "description": "Coarse location only." },
    "referrer": { "type": "string" },
    "host": { "type": "string", "description": "Host that received the agent-facing event." },
    "discovery_surface": {
      "type": "string",
      "enum": [
        "a2a_agent_card",
        "mcp_registry",
        "openapi_spec",
        "llms_txt",
        "agents_json",
        "web_search",
        "direct_api",
        "human_web",
        "partner_referral",
        "unknown"
      ]
    },
    "entry_url": { "type": "string" },
    "landing_capability": { "type": "string" },
    "task_type": { "type": "string" },
    "business_domain": { "type": "string" },
    "package_quoted": { "type": "string" },
    "scope_requested": { "type": "array", "items": { "type": "string" } },
    "scope_approved": { "type": "array", "items": { "type": "string" } },
    "payment_state": { "type": "string" },
    "payment_provider": { "type": "string" },
    "conversion_state": {
      "type": "string",
      "enum": [
        "discovered",
        "capability_read",
        "scan_requested",
        "scan_completed",
        "quote_requested",
        "quote_returned",
        "payment_started",
        "payment_completed",
        "setup_session_created",
        "scope_approved",
        "install_started",
        "install_completed",
        "verification_completed",
        "map_published",
        "retained_or_returned",
        "failed"
      ]
    },
    "artifact_ids": { "type": "array", "items": { "type": "string" } },
    "failure_class": { "type": "string" },
    "privacy_redactions": { "type": "array", "items": { "type": "string" } }
  }
}
