middleware/auth.ts | Tenant JWT/API key auth for widget/chat routes. |
middleware/admin-auth.ts | Supabase auth + tenant mapping for admin routes. |
routes/chat.ts | Message processing, conversation read, manual escalation. |
routes/admin.ts | Tenant admin operations: stats, tickets, intents, settings, audit. |
services/intent.service.ts | Detects intent and required entities from user messages. |
services/action.service.ts | Executes configured intent actions. |
services/escalation.service.ts | Creates escalation tickets and user-facing escalation text. |
ws/websocket.ts | Real-time chat protocol with optional streaming responses. |