This commit is contained in:
seb
2026-10-16 13:10:58 +02:00
parent 7bc1da4de6
commit d851c6e1e9
10 changed files with 326 additions and 445 deletions

View File

@@ -327,6 +327,24 @@ const actions = {
void chatAutomat.actions.loadConversations();
},
/**
* Open the chat drawer and append text / prompt to the chat composer.
* @param {string} prompt
*/
insertPrompt(prompt = '') {
chatOpenedThisSession = true;
chatAutomat.setState((prev) => ({
isOpen: true,
sseEstablished: true,
pendingInput: prev.pendingInput ? `${prev.pendingInput}\n\n${prompt}` : prompt,
}));
ensureCompanyEventsConnected();
if (!chatAutomat.state.selectedConversationId && !chatAutomat.state.draftConversation) {
chatAutomat.actions.startDraft();
}
void chatAutomat.actions.loadConversations();
},
/**
* Start an implicit new conversation with the first preset model. Nothing is
* created on the server until the first message is sent.