agentgui 1.0.768 → 1.0.769

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.768",
3
+ "version": "1.0.769",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
package/static/app.js CHANGED
@@ -827,4 +827,80 @@ document.addEventListener('keydown', (e) => {
827
827
  window.showErrorToast = showErrorToast;
828
828
  })();
829
829
 
830
+ (function initImportButton() {
831
+ const btn = document.getElementById('importConversationBtn');
832
+ if (!btn) return;
833
+ btn.addEventListener('click', () => {
834
+ const input = document.createElement('input');
835
+ input.type = 'file';
836
+ input.accept = '.json';
837
+ input.addEventListener('change', async () => {
838
+ if (!input.files[0]) return;
839
+ try {
840
+ const text = await input.files[0].text();
841
+ const data = JSON.parse(text);
842
+ if (!data.conversation || !data.messages) {
843
+ window.showErrorToast('Import Failed', 'Invalid format. Export a conversation as JSON first.');
844
+ return;
845
+ }
846
+ await window.wsClient.rpc('conv.import', data);
847
+ } catch (e) {
848
+ window.showErrorToast('Import Failed', e.message);
849
+ }
850
+ });
851
+ input.click();
852
+ });
853
+ })();
854
+
855
+ (function initArchivedView() {
856
+ const btn = document.getElementById('viewArchivedBtn');
857
+ if (!btn) return;
858
+ let showing = false;
859
+ btn.addEventListener('click', async () => {
860
+ const list = document.querySelector('[data-conversation-list]');
861
+ if (!list) return;
862
+ if (showing) {
863
+ showing = false;
864
+ btn.textContent = 'Archived';
865
+ if (window.conversationManager) window.conversationManager.render();
866
+ return;
867
+ }
868
+ try {
869
+ const base = window.__BASE_URL || '';
870
+ const resp = await fetch(`${base}/api/conversations/archived`);
871
+ const { conversations } = await resp.json();
872
+ if (!conversations || conversations.length === 0) {
873
+ window.UIDialog?.alert('No archived conversations', 'Archived');
874
+ return;
875
+ }
876
+ showing = true;
877
+ btn.textContent = 'Back';
878
+ list.innerHTML = conversations.map(c => `
879
+ <li class="conversation-item" style="cursor:default;">
880
+ <div class="conversation-item-content">
881
+ <div class="conversation-item-title">${window._escHtml(c.title || 'Untitled')}</div>
882
+ <div class="conversation-item-meta">${new Date(c.created_at).toLocaleDateString()}</div>
883
+ </div>
884
+ <button class="conversation-item-archive" title="Restore" data-restore-conv="${c.id}" style="opacity:1;">
885
+ <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
886
+ <polyline points="1 4 1 10 7 10"></polyline>
887
+ <path d="M3.51 15a9 9 0 1 0 2.13-9.36L1 10"></path>
888
+ </svg>
889
+ </button>
890
+ </li>
891
+ `).join('');
892
+ list.addEventListener('click', async (e) => {
893
+ const restoreBtn = e.target.closest('[data-restore-conv]');
894
+ if (!restoreBtn) return;
895
+ const id = restoreBtn.dataset.restoreConv;
896
+ await fetch(`${base}/api/conversations/${id}/restore`, { method: 'POST' });
897
+ restoreBtn.closest('li').remove();
898
+ if (!list.querySelector('li')) { showing = false; btn.textContent = 'Archived'; if (window.conversationManager) window.conversationManager.render(); }
899
+ }, { once: false });
900
+ } catch (e) {
901
+ window.showErrorToast('Load Failed', e.message);
902
+ }
903
+ });
904
+ })();
905
+
830
906
  window.addEventListener('load', initializeApp);
package/static/index.html CHANGED
@@ -34,6 +34,8 @@
34
34
  <div class="sidebar-header">
35
35
  <h2>History</h2>
36
36
  <div class="sidebar-header-actions">
37
+ <button id="importConversationBtn" class="sidebar-clone-btn" title="Import conversation from JSON">Import</button>
38
+ <button id="viewArchivedBtn" class="sidebar-clone-btn" title="View archived conversations">Archived</button>
37
39
  <button id="deleteAllConversationsBtn" class="sidebar-clone-btn" data-delete-all-conversations title="Delete all conversations and Claude Code artifacts">Clear All</button>
38
40
  <button id="cloneRepoBtn" class="sidebar-clone-btn" data-clone-repo title="Clone a GitHub repo">Clone</button>
39
41
  <button id="newConversationBtn" class="sidebar-new-btn" data-new-conversation title="Start new conversation">+ New</button>