CnAiCompanion
The AI Chat Companion shell. Auto-mounts at the end of NcContent's children
(via CnAppRoot) and renders a floating action button (CnAiFloatingButton)
plus a slide-out chat panel (CnAiChatPanel) — gated by an OpenRegister health
probe and the active cnAiContext. No per-app wiring is required; it surfaces
whenever the OpenRegister chat backend is reachable.
Props
| Prop | Type | Required | Default | Notes |
|---|---|---|---|---|
position | String | No | 'bottom-right' | Viewport corner at which the FAB and panel anchor. Forwarded to CnAiFloatingButton. |
chatAppId | String | No | 'openregister' | Backend app id the chat/agent endpoints resolve against (see chatApiBase / DEFAULT_CHAT_APP_ID). Passed through to useAiChatStream so a deployment can point the companion at another backend (e.g. hermiq). |
embedded | Boolean | No | false | Render the chat as a panel of the page (a tab, a card) instead of the launcher hex and its floating window. An embedded chat is always open, has no launcher, and does not take the page's single companion slot, so the floating companion keeps working beside it. |
titled | Boolean | No | false | An embedded chat in a card that draws its title: the panel drops its own titlebar and reports its controls through menu. |
note | String | No | '' | A line above the input, already translated. |
inputPlaceholder | String | No | '' | The input's placeholder, already translated. |
sendLabel | String | No | '' | A label on the send button, already translated. |
openSubjectSession | Boolean | No | false | Open the user's latest session about the page's record (the context's objectUuid) instead of an empty thread, with its pending approvals. No such session, or one about another record, leaves the thread empty. |
approvalWording | Object | No | {} | The approval cards' wording, already translated: titlePrefix, allow, deny. |
Architecture
- Owns the SSE transport via
useAiChatStream. - Reads per-page context via
useAiContext(the reactivecnAiContextprovided byCnAppRoot). - Conversation history is browsed via
CnAiHistoryDialog.
Reference
- Implementation: src/components/CnAiCompanion/CnAiCompanion.vue
- Related: CnAiFloatingButton, CnAiChatPanel, CnAiMessageList, CnAiInput, CnAiHistoryDialog