agentgui 1.0.535 → 1.0.536

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 CHANGED
@@ -1038,6 +1038,44 @@ export const queries = {
1038
1038
  }
1039
1039
  },
1040
1040
 
1041
+ deleteAllConversations() {
1042
+ try {
1043
+ const conversations = prep('SELECT id, claudeSessionId FROM conversations').all();
1044
+
1045
+ for (const conv of conversations) {
1046
+ if (conv.claudeSessionId) {
1047
+ this.deleteClaudeSessionFile(conv.claudeSessionId);
1048
+ }
1049
+ }
1050
+
1051
+ const deleteAllStmt = db.transaction(() => {
1052
+ const allSessionIds = prep('SELECT id FROM sessions').all().map(r => r.id);
1053
+
1054
+ prep('DELETE FROM stream_updates');
1055
+ prep('DELETE FROM chunks');
1056
+ prep('DELETE FROM events');
1057
+
1058
+ if (allSessionIds.length > 0) {
1059
+ const placeholders = allSessionIds.map(() => '?').join(',');
1060
+ db.prepare(`DELETE FROM stream_updates WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
1061
+ db.prepare(`DELETE FROM chunks WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
1062
+ db.prepare(`DELETE FROM events WHERE sessionId IN (${placeholders})`).run(...allSessionIds);
1063
+ }
1064
+
1065
+ prep('DELETE FROM sessions');
1066
+ prep('DELETE FROM messages');
1067
+ prep('DELETE FROM conversations');
1068
+ });
1069
+
1070
+ deleteAllStmt();
1071
+ console.log('[deleteAllConversations] Deleted all conversations and associated Claude Code files');
1072
+ return true;
1073
+ } catch (err) {
1074
+ console.error('[deleteAllConversations] Error deleting all conversations:', err.message);
1075
+ return false;
1076
+ }
1077
+ },
1078
+
1041
1079
  cleanup() {
1042
1080
  const thirtyDaysAgo = Date.now() - (30 * 24 * 60 * 60 * 1000);
1043
1081
  const now = Date.now();
@@ -43,6 +43,12 @@ export function register(router, deps) {
43
43
  return { deleted: true };
44
44
  });
45
45
 
46
+ router.handle('conv.del.all', (p) => {
47
+ if (!queries.deleteAllConversations()) fail(500, 'Failed to delete all conversations');
48
+ broadcastSync({ type: 'all_conversations_deleted', timestamp: Date.now() });
49
+ return { deleted: true, message: 'All conversations deleted' };
50
+ });
51
+
46
52
  router.handle('conv.full', (p) => {
47
53
  const conv = queries.getConversation(p.id);
48
54
  if (!conv) notFound();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.535",
3
+ "version": "1.0.536",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/static/index.html CHANGED
@@ -3043,6 +3043,7 @@
3043
3043
  <div class="sidebar-header">
3044
3044
  <h2>History</h2>
3045
3045
  <div class="sidebar-header-actions">
3046
+ <button id="deleteAllConversationsBtn" class="sidebar-clone-btn" data-delete-all-conversations title="Delete all conversations and Claude Code artifacts">Clear All</button>
3046
3047
  <button id="cloneRepoBtn" class="sidebar-clone-btn" data-clone-repo title="Clone a GitHub repo">Clone</button>
3047
3048
  <button id="newConversationBtn" class="sidebar-new-btn" data-new-conversation title="Start new conversation">+ New</button>
3048
3049
  </div>
@@ -47,6 +47,7 @@ class ConversationManager {
47
47
  this.setupWebSocketListener();
48
48
  this.setupFolderBrowser();
49
49
  this.setupCloneUI();
50
+ this.setupDeleteAllButton();
50
51
 
51
52
  this._pollInterval = setInterval(() => this.loadConversations(), 30000);
52
53
 
@@ -245,6 +246,40 @@ class ConversationManager {
245
246
  }));
246
247
  }
247
248
 
249
+ setupDeleteAllButton() {
250
+ this.deleteAllBtn = document.getElementById('deleteAllConversationsBtn');
251
+ if (!this.deleteAllBtn) return;
252
+ this.deleteAllBtn.addEventListener('click', () => this.confirmDeleteAll());
253
+ }
254
+
255
+ async confirmDeleteAll() {
256
+ if (this.conversations.length === 0) {
257
+ window.UIDialog.alert('No conversations to delete', 'Information');
258
+ return;
259
+ }
260
+
261
+ const confirmed = await window.UIDialog.confirm(
262
+ `Delete all ${this.conversations.length} conversation(s) and associated Claude Code artifacts?\n\nThis action cannot be undone.`,
263
+ 'Delete All Conversations'
264
+ );
265
+ if (!confirmed) return;
266
+
267
+ try {
268
+ this.deleteAllBtn.disabled = true;
269
+ await window.wsClient.rpc('conv.del.all', {});
270
+ console.log('[ConversationManager] Deleted all conversations');
271
+ this.conversations = [];
272
+ this.activeId = null;
273
+ window.dispatchEvent(new CustomEvent('conversation-deselected'));
274
+ this.render();
275
+ } catch (err) {
276
+ console.error('[ConversationManager] Delete all error:', err);
277
+ window.UIDialog.alert('Failed to delete all conversations: ' + (err.message || 'Unknown error'), 'Error');
278
+ } finally {
279
+ this.deleteAllBtn.disabled = false;
280
+ }
281
+ }
282
+
248
283
  setupCloneUI() {
249
284
  this.cloneBtn = document.getElementById('cloneRepoBtn');
250
285
  this.cloneBar = document.getElementById('cloneInputBar');