agentgui 1.0.540 → 1.0.541

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.540",
3
+ "version": "1.0.541",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -1671,12 +1671,26 @@ class StreamingRenderer {
1671
1671
  let html = '';
1672
1672
  if (event.path) html += this.renderFilePath(event.path);
1673
1673
  if (event.content) {
1674
- const imageInfo = this.detectBase64Image(event.content);
1675
- if (imageInfo) {
1676
- const mimeType = imageInfo.type === 'jpeg' ? 'image/jpeg' : `image/${imageInfo.type}`;
1677
- html += `<div style="padding:0.5rem;display:flex;flex-direction:column;gap:0.5rem"><img src="data:${mimeType};base64,${this.escapeHtml(imageInfo.data)}" style="max-width:100%;max-height:600px;border-radius:0.375rem;border:1px solid #334155" loading="lazy"><div style="font-size:0.7rem;color:#64748b;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;word-break:break-all">${this.escapeHtml(event.path)}</div></div>`;
1674
+ let base64Data = null;
1675
+ let mimeType = event.media_type || 'application/octet-stream';
1676
+ if (typeof event.content === 'string') {
1677
+ const imageInfo = this.detectBase64Image(event.content);
1678
+ if (imageInfo) {
1679
+ base64Data = imageInfo.data;
1680
+ mimeType = imageInfo.type === 'jpeg' ? 'image/jpeg' : `image/${imageInfo.type}`;
1681
+ }
1682
+ } else if (typeof event.content === 'object' && event.content !== null) {
1683
+ if (event.content.source?.type === 'base64' && event.content.source?.data) {
1684
+ base64Data = event.content.source.data;
1685
+ } else if (event.content.type === 'base64' && event.content.data) {
1686
+ base64Data = event.content.data;
1687
+ }
1688
+ }
1689
+ if (base64Data) {
1690
+ html += `<div style="padding:0.5rem;display:flex;flex-direction:column;gap:0.5rem"><img src="data:${mimeType};base64,${this.escapeHtml(base64Data)}" style="max-width:100%;max-height:600px;border-radius:0.375rem;border:1px solid #334155" loading="lazy"><div style="font-size:0.7rem;color:#64748b;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;word-break:break-all">${this.escapeHtml(event.path)}</div></div>`;
1678
1691
  } else {
1679
- html += `<pre style="background:#1e293b;padding:0.75rem;border-radius:0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.75rem;line-height:1.5;color:#e2e8f0;margin:0.5rem 0 0 0"><code class="lazy-hl">${this.escapeHtml(this.truncateContent(event.content, 2000))}</code></pre>`;
1692
+ const contentStr = typeof event.content === 'string' ? event.content : JSON.stringify(event.content, null, 2);
1693
+ html += `<pre style="background:#1e293b;padding:0.75rem;border-radius:0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.75rem;line-height:1.5;color:#e2e8f0;margin:0.5rem 0 0 0"><code class="lazy-hl">${this.escapeHtml(this.truncateContent(contentStr, 2000))}</code></pre>`;
1680
1694
  }
1681
1695
  }
1682
1696
  body.innerHTML = html;