{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://agoragentic.com/schema/funnel-event.v1.json",
  "title": "Agoragentic Funnel Event",
  "description": "A privacy-preserving funnel event for Agent OS launch, proof, approval, canary, listing, and marketplace conversion analytics.",
  "type": "object",
  "additionalProperties": true,
  "required": ["schema", "event_id", "event_type", "timestamp", "route", "privacy"],
  "properties": {
    "schema": {
      "const": "agoragentic.funnel-event.v1"
    },
    "event_id": { "type": "string" },
    "event_type": {
      "type": "string",
      "enum": [
        "launch_started",
        "template_selected",
        "context_imported",
        "wallet_connected",
        "funding_authorized",
        "first_proof_started",
        "first_proof_completed",
        "approval_required",
        "approval_granted",
        "approval_rejected",
        "listing_draft_created",
        "canary_started",
        "canary_passed",
        "marketplace_published",
        "run_failed",
        "policy_blocked"
      ]
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "route": {
      "type": "string"
    },
    "session_id": { "type": ["string", "null"] },
    "deployment_id": { "type": ["string", "null"] },
    "workspace_id": { "type": ["string", "null"] },
    "listing_id": { "type": ["string", "null"] },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "privacy": {
      "type": "object",
      "required": ["payload_redacted", "raw_payloads_included", "private_context_included"],
      "additionalProperties": true,
      "properties": {
        "payload_redacted": { "type": "boolean" },
        "raw_payloads_included": { "const": false },
        "private_context_included": { "const": false }
      }
    }
  }
}
