extractEmailFromWSPath extracts the agent email from a WS path like v1/agents/bot@ws.test.dev/ws
(path string)
| 598 | // extractEmailFromWSPath extracts the agent email from a WS path like |
| 599 | // /v1/agents/bot@ws.test.dev/ws |
| 600 | func extractEmailFromWSPath(path string) string { |
| 601 | // Path format: /v1/agents/{email}/ws (the legacy /api/v1 surface is gone). |
| 602 | parts := strings.Split(strings.Trim(path, "/"), "/") |
| 603 | for i, p := range parts { |
| 604 | if p == "agents" && i+1 < len(parts) { |
| 605 | return parts[i+1] |
| 606 | } |
| 607 | } |
| 608 | return "" |
| 609 | } |
| 610 | |
| 611 | // ── Entry point ──────────────────────────────────────────────────── |
| 612 |