This commit is contained in:
seb
2026-10-04 22:47:26 +02:00
parent 8b401fa50b
commit a90069d340
44 changed files with 994 additions and 268 deletions

View File

@@ -1,3 +1,18 @@
/**
* @file chatAutomat.js
* @description State container for the AI assistant chat drawer, conversation
* list, message history, live SSE streaming tokens, and interactive tool calls.
*
* Upstream Triggers:
* - `authAutomat`: Subscribes to auth state changes — reconnects SSE stream and
* reloads conversations when `'authed'` with a `selectedCompanyId`; calls
* `actions.reset()` on `'anon'` or when company is unselected.
* - Assistant SSE stream (`/api/modelconversation/events`): Emits streaming
* deltas, state changes (`idle` | `busy`), and tool calls (`ask_user`).
* - UI / Drawer: Actions (`toggleChat`, `selectConversation`, `sendMessage`,
* `answerAskUser`, `newConversation`).
*/
import { Automat } from 'react-automat';
import { modelconversation as modelconversationApi } from '../api';
import authAutomat from './authAutomat';