agentgui 1.0.579 → 1.0.580
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/database.js +0 -10
- package/package.json +1 -1
- package/static/js/client.js +11 -0
package/database.js
CHANGED
|
@@ -1060,19 +1060,9 @@ export const queries = {
|
|
|
1060
1060
|
}
|
|
1061
1061
|
|
|
1062
1062
|
const deleteAllStmt = db.transaction(() => {
|
|
1063
|
-
const allSessionIds = prep('SELECT id FROM sessions').all().map(r => r.id);
|
|
1064
|
-
|
|
1065
1063
|
prep('DELETE FROM stream_updates');
|
|
1066
1064
|
prep('DELETE FROM chunks');
|
|
1067
1065
|
prep('DELETE FROM events');
|
|
1068
|
-
|
|
1069
|
-
if (allSessionIds.length > 0) {
|
|
1070
|
-
const placeholders = allSessionIds.map(() => '?').join(',');
|
|
1071
|
-
db.prepare(`DELETE FROM stream_updates WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
|
|
1072
|
-
db.prepare(`DELETE FROM chunks WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
|
|
1073
|
-
db.prepare(`DELETE FROM events WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1076
1066
|
prep('DELETE FROM sessions');
|
|
1077
1067
|
prep('DELETE FROM messages');
|
|
1078
1068
|
prep('DELETE FROM conversations');
|
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -699,6 +699,9 @@ class AgentGUIClient {
|
|
|
699
699
|
case 'conversation_created':
|
|
700
700
|
this.handleConversationCreated(data);
|
|
701
701
|
break;
|
|
702
|
+
case 'all_conversations_deleted':
|
|
703
|
+
this.handleAllConversationsDeleted(data);
|
|
704
|
+
break;
|
|
702
705
|
case 'message_created':
|
|
703
706
|
this.handleMessageCreated(data);
|
|
704
707
|
break;
|
|
@@ -1300,6 +1303,14 @@ class AgentGUIClient {
|
|
|
1300
1303
|
this.enableControls();
|
|
1301
1304
|
}
|
|
1302
1305
|
|
|
1306
|
+
handleAllConversationsDeleted(data) {
|
|
1307
|
+
this.state.currentConversation = null;
|
|
1308
|
+
window.dispatchEvent(new CustomEvent('conversation-deselected'));
|
|
1309
|
+
if (window.conversationManager) {
|
|
1310
|
+
window.conversationManager.loadConversations();
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1303
1314
|
isHtmlContent(text) {
|
|
1304
1315
|
const htmlPattern = /<(?:div|table|section|article|ul|ol|dl|nav|header|footer|main|aside|figure|details|summary|h[1-6]|p|blockquote|pre|code|span|strong|em|a|img|br|hr|li|td|tr|th|thead|tbody|tfoot)\b[^>]*>/i;
|
|
1305
1316
|
return htmlPattern.test(text);
|