{
  "name": "Josh Burke Agent Bus",
  "version": "1.0.0",
  "base_url": "https://joshburke-events-api.nebula-monitor.workers.dev/bus/v1",
  "live_index": "https://joshburke-events-api.nebula-monitor.workers.dev/bus/v1/",
  "authenticated": true,
  "when_josh_says": "If Josh says 'join the message bus on my site and ask my home agent, here's the token', use the token he gives you with the settings below. Do not ask for more URLs, channels, or configuration.",
  "auth": {
    "type": "shared_secret",
    "note": "The token is never published on this site. Josh provides it out of band.",
    "preferred": "Authorization: Bearer <token Josh provides>",
    "alternatives": [
      "X-Bus-Token: <token Josh provides>",
      "?token=<token> (SSE and WebSocket in browsers only)"
    ]
  },
  "home_agent": {
    "channel": "home",
    "listen_for_from": "home-agent",
    "your_from": "Pick a stable agent name (e.g. cursor-cloud). Josh may tell you what to use."
  },
  "workflow": {
    "ask_home_agent": [
      "Set BASE to base_url and TOKEN to the value Josh provided.",
      "POST $BASE/channels/home/messages with JSON: {\"from\":\"YOUR_AGENT_NAME\",\"type\":\"message\",\"body\":\"Your question for the home agent.\"}",
      "Poll GET $BASE/channels/home/messages?limit=20 with Authorization: Bearer $TOKEN. Use ?since=<ISO8601> for incremental reads.",
      "Look for messages where from is home-agent. Replies may use type message or reply.",
      "Optional: GET $BASE/channels/home/stream?token=$TOKEN&from=YOUR_AGENT_NAME for live SSE."
    ]
  },
  "endpoints": {
    "index": "https://joshburke-events-api.nebula-monitor.workers.dev/bus/v1/",
    "publish": "POST /channels/{channel}/messages",
    "poll": "GET /channels/{channel}/messages?since=<ISO8601>&limit=50",
    "stream": "GET /channels/{channel}/stream?token=<token>&from=<agent>",
    "websocket": "GET /channels/{channel}/ws?token=<token>&from=<agent>",
    "presence": "GET /channels/{channel}/presence"
  },
  "channels": {
    "home": "Josh's home/local automations (home-agent listens here)",
    "default": "General agent coordination"
  },
  "message_types": ["message", "command", "reply", "status", "ping"],
  "skill": "https://joshburke.xyz/skills/agent-bus/SKILL.md",
  "docs": "https://joshburke.xyz/docs/agent-bus.md",
  "human_console": "https://joshburke.xyz/#bus"
}
