agentgui 1.0.81 → 1.0.82
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 +1 -1
- package/static/index.html +1 -1
- package/static/js/client.js +39 -0
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -623,7 +623,7 @@
|
|
|
623
623
|
<div class="header-controls">
|
|
624
624
|
<div class="status-badge">
|
|
625
625
|
<div class="status-indicator" data-status="disconnected"></div>
|
|
626
|
-
<span data-status-indicator>Disconnected</span>
|
|
626
|
+
<span id="connectionStatus" data-status-indicator>Disconnected</span>
|
|
627
627
|
</div>
|
|
628
628
|
|
|
629
629
|
<button class="btn btn-primary" data-theme-toggle title="Toggle dark mode">
|
package/static/js/client.js
CHANGED
|
@@ -164,6 +164,9 @@ class AgentGUIClient {
|
|
|
164
164
|
if (themeToggle) {
|
|
165
165
|
themeToggle.addEventListener('click', () => this.toggleTheme());
|
|
166
166
|
}
|
|
167
|
+
|
|
168
|
+
// Listen for new conversation creation
|
|
169
|
+
window.addEventListener('create-new-conversation', () => this.createNewConversation());
|
|
167
170
|
}
|
|
168
171
|
|
|
169
172
|
/**
|
|
@@ -475,6 +478,42 @@ class AgentGUIClient {
|
|
|
475
478
|
localStorage.setItem('theme', isDark ? 'dark' : 'light');
|
|
476
479
|
}
|
|
477
480
|
|
|
481
|
+
/**
|
|
482
|
+
* Create a new empty conversation
|
|
483
|
+
*/
|
|
484
|
+
async createNewConversation() {
|
|
485
|
+
try {
|
|
486
|
+
const agentId = this.ui.agentSelector?.value || 'claude-code';
|
|
487
|
+
const response = await fetch(window.__BASE_URL + '/api/conversations', {
|
|
488
|
+
method: 'POST',
|
|
489
|
+
headers: { 'Content-Type': 'application/json' },
|
|
490
|
+
body: JSON.stringify({
|
|
491
|
+
agentId,
|
|
492
|
+
title: 'New Conversation'
|
|
493
|
+
})
|
|
494
|
+
});
|
|
495
|
+
|
|
496
|
+
if (!response.ok) {
|
|
497
|
+
throw new Error(`Failed to create conversation: ${response.status}`);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
const { conversation } = await response.json();
|
|
501
|
+
this.state.currentConversation = conversation;
|
|
502
|
+
|
|
503
|
+
// Refresh conversation list
|
|
504
|
+
await this.loadConversations();
|
|
505
|
+
|
|
506
|
+
// Clear input for next execution
|
|
507
|
+
if (this.ui.messageInput) {
|
|
508
|
+
this.ui.messageInput.value = '';
|
|
509
|
+
this.ui.messageInput.focus();
|
|
510
|
+
}
|
|
511
|
+
} catch (error) {
|
|
512
|
+
console.error('Failed to create new conversation:', error);
|
|
513
|
+
this.showError(`Failed to create conversation: ${error.message}`);
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
478
517
|
/**
|
|
479
518
|
* Show error message
|
|
480
519
|
*/
|