Viindoo AI - Editor
Adds a generic AI block embedded component and AI assist Powerbox
command to any Odoo html field rendered by OdooEditor / Wysiwyg.
This module is intentionally Brain-free: it does not depend on
viin_brain and carries no Brain-specific coupling. When installed
alone the backend service is a no-op stub (all calls return an error
state) and the "AI assist" command is hidden until a real backend bridge
is registered.
The backend contract (viin_ai_editor.backend service) is designed to
be overridden by a bridge module (e.g. viin_ai_brain in a later
phase) that wires up real LLM calls through viin_ai_agent.
Security model
- The stub backend never calls any LLM.
- A real backend override MUST route all LLM calls through
viin_ai_agent's wrapper to ensure usage logging, PII redaction,
BYOK enforcement, and untrusted-context isolation.
- Every piece of content returned from the LLM MUST be treated as
untrusted and wrapped with <untrusted_context> before injection
into any prompt (see docs/ai/security.md).
Architecture contract
hostCtx shape passed by the AI block to the backend:
{
res_model: string // Odoo model name, e.g. 'sale.order'
res_id: number // record id or null for new records
field: string // html field name, e.g. 'description'
block_anchor_id: string // UUID of the <span data-embedded="ai_block"> anchor
}
Backend service interface (viin_ai_editor.backend):
regenerate(hostCtx, prompt) -> Promise<{agent_name, trace_id, confidence, content}>
commitAttribution(hostCtx, {trace_id, confidence, status}) -> Promise<void>
Bundle placement
- AI block state machine + backend service stub -> web.assets_backend
(eager, so the registry is populated before any wysiwyg instance boots).
- AI block OWL component + Powerbox command registration ->
web_editor.backend_assets_wysiwyg (lazy, safe to import wysiwyg).
This software and associated files (the "Software") may only be
used
(executed, modified, executed after modifications) if you have
purchased a
valid license from the authors, typically via Odoo Apps,
or if you
have
received a written agreement from the authors of the
Software (see the
COPYRIGHT file).
You may develop Odoo modules that use the Software as a library
(typically
by depending on it, importing it and using its
resources), but
without
copying any source code or material from the
Software. You may distribute
those modules under the license of your
choice, provided that this
license
is compatible with the terms of
the Odoo Proprietary License (For
example:
LGPL, MIT, or proprietary
licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell
copies of the
Software or modified copies of the Software.
The above copyright notice and this permission notice must be
included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT
SHALL THE
AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE
SOFTWARE.