NAiOSOmni Web
omnichat-webv0.1.0Add an embeddable chatbot (chat widget) to NAiOSOmni. Paste a <script> on any website and the visitor chats with your agent; it appears as another channel in the unified Inbox.
Description
Plugin integrated with NAiOSOmni: registers a 'web-widget' driver in the ChannelRegistry so any website can embed a chatbot. The transport is stateless long-polling (resistant to multi-worker Passenger): the visitor POSTs their message and polls for responses from the bot/operator from the database. Everything else (wizard agents, tool-loop, lead capture to CRM, webhooks, inbox, dashboards, sharing) is inherited from the core without schema changes. Web-specific details (visitor_id, source page, user-agent, referrer) go in media_meta JSON; the look & feel, CORS domains, and daily sub-budget go in driver_config.
Features (3)
A <script> on the client's website and the chat bubble appears. Zero dependencies, isolated Shadow DOM.
The wizard agent, tools, lead capture to CRM, and unified inbox are inherited as is.
Stateless long-polling + CORS per domain + rate-limit per IP + daily token sub-budget.
Changelog
- MVP (Phases 0-6) — 'web-widget' driver registered in the NAiOSOmni ChannelRegistry
- Pairing by embed: startPairing() returns the copyable <script> + widget configuration page (branding + CORS domains)
- Public inbound transport: POST /p/omnichat-web/:channelId/message normalizes and emits omnichat.message.received
- Outbound long-polling transport: sendMessage() persists in DB; GET /poll returns new messages from the bot/operator
- Embeddable widget widget.js: vanilla, Shadow DOM, launcher+panel+composer, localStorage persistence, per-channel branding
- 3-layer security: daily sub-budget in DB (PRE-AI) + rate-limit per IP + CORS allowlist per channel
- Inbox: 'web' badge/icon, source page in the thread; basic handoff (status 'an agent will join' + email notice to the owner)