agentgui 1.0.790 → 1.0.792
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
package/static/js/client.js
CHANGED
|
@@ -1379,9 +1379,11 @@ class AgentGUIClient {
|
|
|
1379
1379
|
}
|
|
1380
1380
|
|
|
1381
1381
|
outputEl.querySelectorAll('p.text-secondary').forEach(p => p.remove());
|
|
1382
|
+
const safeRole = this.escapeHtml(data.message.role || 'user');
|
|
1383
|
+
const safeId = this.escapeHtml(data.message.id || '');
|
|
1382
1384
|
const messageHtml = `
|
|
1383
|
-
<div class="message message-${
|
|
1384
|
-
<div class="message-role">${
|
|
1385
|
+
<div class="message message-${safeRole}" data-msg-id="${safeId}">
|
|
1386
|
+
<div class="message-role">${safeRole.charAt(0).toUpperCase() + safeRole.slice(1)}</div>
|
|
1385
1387
|
${this.renderMessageContent(data.message.content)}
|
|
1386
1388
|
<div class="message-timestamp">${new Date(data.message.created_at).toLocaleString()}</div>
|
|
1387
1389
|
</div>
|
|
@@ -1893,7 +1895,9 @@ class AgentGUIClient {
|
|
|
1893
1895
|
const dedupedChunks = chunks.filter(c => !seenSeqs || !seenSeqs.has(c.sequence));
|
|
1894
1896
|
|
|
1895
1897
|
if (dedupedChunks.length > 0) {
|
|
1896
|
-
for (const chunk of dedupedChunks)
|
|
1898
|
+
for (const chunk of dedupedChunks) {
|
|
1899
|
+
try { this.renderChunk(chunk); } catch (chunkErr) { console.warn('Skipping bad chunk:', chunkErr.message); }
|
|
1900
|
+
}
|
|
1897
1901
|
}
|
|
1898
1902
|
} catch (e) {
|
|
1899
1903
|
console.warn('Chunk recovery failed:', e.message);
|
|
@@ -2229,7 +2233,7 @@ class AgentGUIClient {
|
|
|
2229
2233
|
const uDiv = document.createElement('div');
|
|
2230
2234
|
uDiv.className = 'message message-user';
|
|
2231
2235
|
uDiv.setAttribute('data-msg-id', m.id);
|
|
2232
|
-
uDiv.innerHTML = `<div class="message-role">User<button class="msg-edit-btn" data-edit-msg="${m.id}" title="Edit and re-run">✎</button></div>${this.renderMessageContent(m.content)}<div class="message-timestamp">${new Date(m.created_at).toLocaleString()}</div>`;
|
|
2236
|
+
uDiv.innerHTML = `<div class="message-role">User<button class="msg-edit-btn" data-edit-msg="${this.escapeHtml(m.id)}" title="Edit and re-run">✎</button></div>${this.renderMessageContent(m.content)}<div class="message-timestamp">${new Date(m.created_at).toLocaleString()}</div>`;
|
|
2233
2237
|
frag.appendChild(uDiv);
|
|
2234
2238
|
}
|
|
2235
2239
|
const isActive = sid === activeSessionId;
|
|
@@ -2266,7 +2270,7 @@ class AgentGUIClient {
|
|
|
2266
2270
|
const uDiv = document.createElement('div');
|
|
2267
2271
|
uDiv.className = 'message message-user';
|
|
2268
2272
|
uDiv.setAttribute('data-msg-id', m.id);
|
|
2269
|
-
uDiv.innerHTML = `<div class="message-role">User
|
|
2273
|
+
uDiv.innerHTML = `<div class="message-role">User<button class="msg-edit-btn" data-edit-msg="${this.escapeHtml(m.id)}" title="Edit and re-run">✎</button></div>${this.renderMessageContent(m.content)}<div class="message-timestamp">${new Date(m.created_at).toLocaleString()}</div>`;
|
|
2270
2274
|
frag.appendChild(uDiv);
|
|
2271
2275
|
}
|
|
2272
2276
|
messagesContainer.appendChild(frag);
|
|
@@ -1425,7 +1425,7 @@ class StreamingRenderer {
|
|
|
1425
1425
|
div.innerHTML = `
|
|
1426
1426
|
<div style="display:flex;align-items:center;gap:0.5rem;padding:0.25rem 0.5rem;font-size:0.75rem;color:var(--color-text-secondary)">
|
|
1427
1427
|
${statusIcons[status] || statusIcons.pending}
|
|
1428
|
-
<span>${statusLabels[status] || status}</span>
|
|
1428
|
+
<span>${statusLabels[status] || this.escapeHtml(status)}</span>
|
|
1429
1429
|
</div>
|
|
1430
1430
|
`;
|
|
1431
1431
|
return div;
|