agentgui 1.0.79 → 1.0.81
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/.prd +0 -0
- package/package.json +1 -1
- package/static/app.js +115 -2
- package/static/index.html +1 -1
package/.prd
ADDED
|
File without changes
|
package/package.json
CHANGED
package/static/app.js
CHANGED
|
@@ -288,8 +288,11 @@ class GMGUIApp {
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
|
|
291
|
-
async createConversation() {
|
|
292
|
-
|
|
291
|
+
async createConversation(title = 'New Conversation') {
|
|
292
|
+
if (!this.selectedAgent) {
|
|
293
|
+
console.error('[APP] No agent selected');
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
293
296
|
|
|
294
297
|
try {
|
|
295
298
|
const res = await fetch(BASE_URL + '/api/conversations', {
|
|
@@ -299,8 +302,12 @@ class GMGUIApp {
|
|
|
299
302
|
});
|
|
300
303
|
|
|
301
304
|
if (res.ok) {
|
|
305
|
+
const data = await res.json();
|
|
302
306
|
await this.fetchConversations();
|
|
303
307
|
this.renderChatHistory();
|
|
308
|
+
if (data.conversation) {
|
|
309
|
+
this.selectConversation(data.conversation.id);
|
|
310
|
+
}
|
|
304
311
|
}
|
|
305
312
|
} catch (e) {
|
|
306
313
|
console.error('[APP] Error creating conversation:', e);
|
|
@@ -417,4 +424,110 @@ function sendMessage() {
|
|
|
417
424
|
app.sendMessage();
|
|
418
425
|
}
|
|
419
426
|
|
|
427
|
+
function showNewChatModal() {
|
|
428
|
+
const modal = document.getElementById('newChatModal');
|
|
429
|
+
if (modal) {
|
|
430
|
+
modal.style.display = 'flex';
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function closeNewChatModal() {
|
|
435
|
+
const modal = document.getElementById('newChatModal');
|
|
436
|
+
if (modal) {
|
|
437
|
+
modal.style.display = 'none';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function createChatInWorkspace() {
|
|
442
|
+
const title = prompt('Enter a title for the conversation:', 'New Conversation');
|
|
443
|
+
if (title) {
|
|
444
|
+
app.createConversation(title);
|
|
445
|
+
closeNewChatModal();
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
function createChatInFolder() {
|
|
450
|
+
const folderModal = document.getElementById('folderBrowserModal');
|
|
451
|
+
if (folderModal) {
|
|
452
|
+
folderModal.style.display = 'flex';
|
|
453
|
+
closeNewChatModal();
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
function closeFolderBrowser() {
|
|
458
|
+
const modal = document.getElementById('folderBrowserModal');
|
|
459
|
+
if (modal) {
|
|
460
|
+
modal.style.display = 'none';
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
function confirmFolderSelection() {
|
|
465
|
+
const folderPath = document.getElementById('folderPath')?.value;
|
|
466
|
+
if (folderPath) {
|
|
467
|
+
const title = `Chat in ${folderPath}`;
|
|
468
|
+
app.createConversation(title);
|
|
469
|
+
closeFolderBrowser();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
function browseFolders() {
|
|
474
|
+
// Placeholder for folder browsing functionality
|
|
475
|
+
console.log('Folder browsing not yet implemented');
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function toggleSidebar() {
|
|
479
|
+
const sidebar = document.getElementById('sidebar');
|
|
480
|
+
if (sidebar) {
|
|
481
|
+
sidebar.classList.toggle('collapsed');
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function switchTab(tab) {
|
|
486
|
+
if (tab === 'settings') {
|
|
487
|
+
const panel = document.getElementById('settingsPanel');
|
|
488
|
+
if (panel) {
|
|
489
|
+
panel.style.display = 'flex';
|
|
490
|
+
}
|
|
491
|
+
const main = document.querySelector('.main-content');
|
|
492
|
+
if (main) {
|
|
493
|
+
main.style.display = 'none';
|
|
494
|
+
}
|
|
495
|
+
} else if (tab === 'chat') {
|
|
496
|
+
const panel = document.getElementById('settingsPanel');
|
|
497
|
+
if (panel) {
|
|
498
|
+
panel.style.display = 'none';
|
|
499
|
+
}
|
|
500
|
+
const main = document.querySelector('.main-content');
|
|
501
|
+
if (main) {
|
|
502
|
+
main.style.display = 'flex';
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
function triggerFileUpload() {
|
|
508
|
+
const input = document.getElementById('fileInput');
|
|
509
|
+
if (input) {
|
|
510
|
+
input.click();
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function handleFileUpload() {
|
|
515
|
+
console.log('File upload not yet implemented');
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function closeScreenshotModal() {
|
|
519
|
+
const modal = document.getElementById('screenshotModal');
|
|
520
|
+
if (modal) {
|
|
521
|
+
modal.style.display = 'none';
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function sendScreenshot() {
|
|
526
|
+
console.log('Send screenshot not yet implemented');
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
function downloadScreenshot() {
|
|
530
|
+
console.log('Download screenshot not yet implemented');
|
|
531
|
+
}
|
|
532
|
+
|
|
420
533
|
window.addEventListener('load', initializeApp);
|
package/static/index.html
CHANGED
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
<aside class="sidebar" data-sidebar>
|
|
639
639
|
<div class="sidebar-header">
|
|
640
640
|
<h2>History</h2>
|
|
641
|
-
<button class="sidebar-new-btn" data-new-conversation title="Start new conversation">+ New</button>
|
|
641
|
+
<button id="newConversationBtn" class="sidebar-new-btn" data-new-conversation title="Start new conversation">+ New</button>
|
|
642
642
|
</div>
|
|
643
643
|
<ul class="sidebar-list" data-conversation-list>
|
|
644
644
|
<li class="sidebar-empty" data-conversation-empty>No conversations yet</li>
|