NAiOSOmni Email
omnichat-emailv0.6.0Add an email channel (IMAP/SMTP) to NAiOSOmni. Your inbox appears as another channel within the unified Inbox, with AI auto-reply, vertical agents, and all the capabilities of NAiOSOmni.
Description
Plugin attached to NAiOSOmni: registers a new driver 'email-imap' in the ChannelRegistry of NAiOSOmni so that any IMAP/SMTP account (Gmail with app-password, IONOS, personal, corporate Outlook) can connect as a channel. Incoming emails appear in the unified Inbox, grouped by sender (peer = email address). Email specifics (subject, message-id, threading, cc/bcc, html body, attachments) are serialized in media_meta JSON without modifying the schema of NAiOSOmni. Responses are sent via SMTP with correct threading (In-Reply-To + Subject: Re:). HTML body is served by 'view original' from the publicRouter of the plugin itself (auth-checked).
Features (3)
Your IMAP inbox appears alongside WhatsApp and Telegram in the unified Inbox.
Compatible with Gmail (app-password), IONOS, personal, corporate Outlook. Google/Microsoft OAuth in phase 2.
Responses maintain In-Reply-To + Subject: Re: so that the recipient's client threads them correctly.
Changelog
- PHASE 10 · HUMAN-IN-THE-LOOP + tool integration RAG
- DRAFT MODE — toggle per-channel in the General tab (only email-imap). When ON, AI auto-replies are NOT sent: they are saved with status='draft' for review. Special bubble with dashed amber border + 3 actions: Send (real SMTP now) / Edit (loads text into composer + discards) / Discard (cleans DB + files). PATCH /channels/:id/draft-mode to activate/deactivate
- Draft endpoints: GET /api/drafts/:msgId (fetch for composer), POST /api/drafts/:msgId/send (promotes to real send), DELETE /api/drafts/:msgId (cleans with attachment deletion on disk)
- Inbox renderer: detects status='draft', shows header 🤖 AI Draft pending + differently styled bubble + action row with 3 buttons. No changes in chat drivers (WA/TG do not emit status='draft')
- TOOL search_inbox for agents — registered in TOOLS of OmniChat via mutation of the exported object (no changes in core). OpenAI tool schema with params {query, top_k}. ctx.invokePlugin delegates to the plugin's searchInbox() which calls the EmbeddingsStore. Agents can now semantically query the inbox when a client requests it
- Public method searchInbox(args) in the plugin: generates embedding of the query, executes cosine search, returns top-K formatted for LLM (no buffers, scores with 2 decimals, truncated snippet)