agentgui 1.0.603 → 1.0.605
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/lib/ws-handlers-util.js +2 -1
- package/package.json +1 -1
- package/static/js/client.js +7 -2
- package/static/js/conversations.js +16 -6
package/lib/ws-handlers-util.js
CHANGED
|
@@ -16,7 +16,8 @@ export function register(router, deps) {
|
|
|
16
16
|
router.handle('folders', (p) => {
|
|
17
17
|
const folderPath = p.path || STARTUP_CWD;
|
|
18
18
|
try {
|
|
19
|
-
const
|
|
19
|
+
const raw = folderPath.startsWith('~') ? folderPath.replace('~', os.homedir()) : folderPath;
|
|
20
|
+
const expanded = path.resolve(raw);
|
|
20
21
|
const entries = fs.readdirSync(expanded, { withFileTypes: true });
|
|
21
22
|
const folders = entries
|
|
22
23
|
.filter(e => e.isDirectory() && !e.name.startsWith('.'))
|
package/package.json
CHANGED
package/static/js/client.js
CHANGED
|
@@ -765,10 +765,15 @@ class AgentGUIClient {
|
|
|
765
765
|
this._serverProcessingEstimate = 0.7 * this._serverProcessingEstimate + 0.3 * serverTime;
|
|
766
766
|
}
|
|
767
767
|
|
|
768
|
-
//
|
|
768
|
+
// Subscribe to the session so blocks are not lost, but skip conversation
|
|
769
|
+
// re-subscribe when resumed=true to prevent infinite loop (server sends
|
|
770
|
+
// streaming_start on subscribe when activeExecutions exists, which would
|
|
771
|
+
// trigger another subscribe here, looping forever)
|
|
769
772
|
if (this.wsManager.isConnected) {
|
|
770
773
|
this.wsManager.subscribeToSession(data.sessionId);
|
|
771
|
-
|
|
774
|
+
if (!data.resumed) {
|
|
775
|
+
this.wsManager.sendMessage({ type: 'subscribe', conversationId: data.conversationId });
|
|
776
|
+
}
|
|
772
777
|
}
|
|
773
778
|
|
|
774
779
|
// If this streaming event is for a different conversation than what we are viewing,
|
|
@@ -191,7 +191,8 @@ class ConversationManager {
|
|
|
191
191
|
|
|
192
192
|
this.folderBrowser.listEl.innerHTML = '';
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
const isAtRoot = dirPath === '~' || dirPath === '/' || dirPath === this.folderBrowser.homePath || /^[A-Za-z]:[\\\/]?$/.test(dirPath);
|
|
195
|
+
if (!isAtRoot) {
|
|
195
196
|
const parentPath = this.getParentPath(dirPath);
|
|
196
197
|
const upItem = document.createElement('li');
|
|
197
198
|
upItem.className = 'folder-list-item';
|
|
@@ -212,7 +213,8 @@ class ConversationManager {
|
|
|
212
213
|
li.addEventListener('click', () => {
|
|
213
214
|
const expandedBase = dirPath === '~' ? this.folderBrowser.homePath : dirPath;
|
|
214
215
|
const separator = expandedBase.includes('\\') ? '\\' : '/';
|
|
215
|
-
const
|
|
216
|
+
const base = expandedBase.replace(/[\/\\]+$/, '');
|
|
217
|
+
const newPath = base + separator + folder.name;
|
|
216
218
|
this.loadFolders(newPath);
|
|
217
219
|
});
|
|
218
220
|
this.folderBrowser.listEl.appendChild(li);
|
|
@@ -244,17 +246,25 @@ class ConversationManager {
|
|
|
244
246
|
|
|
245
247
|
const expanded = dirPath === '~' ? this.folderBrowser.homePath : dirPath;
|
|
246
248
|
const parts = pathSplit(expanded);
|
|
247
|
-
const
|
|
249
|
+
const isWin = expanded.includes('\\') || /^[A-Za-z]:/.test(expanded);
|
|
250
|
+
const separator = isWin ? '\\' : '/';
|
|
251
|
+
const rootPath = isWin && parts[0] && /^[A-Za-z]:$/.test(parts[0]) ? parts[0] + separator : separator;
|
|
248
252
|
|
|
249
253
|
let html = '';
|
|
250
|
-
html += `<span class="folder-breadcrumb-segment" data-path="${
|
|
254
|
+
html += `<span class="folder-breadcrumb-segment" data-path="${this.escapeHtml(rootPath)}">${this.escapeHtml(rootPath)} </span>`;
|
|
251
255
|
|
|
252
256
|
let accumulated = '';
|
|
257
|
+
const isDriveLetter = isWin && parts[0] && /^[A-Za-z]:$/.test(parts[0]);
|
|
253
258
|
for (let i = 0; i < parts.length; i++) {
|
|
254
|
-
|
|
259
|
+
if (i === 0 && isDriveLetter) {
|
|
260
|
+
accumulated = parts[0];
|
|
261
|
+
} else {
|
|
262
|
+
accumulated += separator + parts[i];
|
|
263
|
+
}
|
|
264
|
+
const segPath = (i === 0 && isDriveLetter) ? rootPath : accumulated;
|
|
255
265
|
const isLast = i === parts.length - 1;
|
|
256
266
|
html += `<span class="folder-breadcrumb-separator">${separator}</span>`;
|
|
257
|
-
html += `<span class="folder-breadcrumb-segment${isLast ? '' : ''}" data-path="${this.escapeHtml(
|
|
267
|
+
html += `<span class="folder-breadcrumb-segment${isLast ? '' : ''}" data-path="${this.escapeHtml(segPath)}">${this.escapeHtml(parts[i])}</span>`;
|
|
258
268
|
}
|
|
259
269
|
|
|
260
270
|
this.folderBrowser.breadcrumbEl.innerHTML = html;
|