agentgui 1.0.124 → 1.0.126
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 +2 -2
- package/static/js/streaming-renderer.js +18 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentgui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.126",
|
|
4
4
|
"description": "Multi-agent ACP client with real-time communication",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "server.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dev": "node server.js --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@anthropic-ai/claude-code": "^1.
|
|
24
|
+
"@anthropic-ai/claude-code": "^2.1.37",
|
|
25
25
|
"better-sqlite3": "^12.6.2",
|
|
26
26
|
"busboy": "^1.6.0",
|
|
27
27
|
"express": "^5.2.1",
|
|
@@ -599,22 +599,21 @@ class StreamingRenderer {
|
|
|
599
599
|
</div>`;
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
-
// Render code
|
|
602
|
+
// Render code with syntax highlighting
|
|
603
603
|
if (input.code) {
|
|
604
|
-
const
|
|
605
|
-
const lineCount =
|
|
604
|
+
const codeLines = input.code.split('\n');
|
|
605
|
+
const lineCount = codeLines.length;
|
|
606
606
|
const truncated = lineCount > 50;
|
|
607
|
-
const
|
|
607
|
+
const displayCode = truncated ? codeLines.slice(0, 50).join('\n') : input.code;
|
|
608
608
|
|
|
609
|
+
const lang = input.runtime || 'javascript';
|
|
609
610
|
html += `<div style="margin-top:0.5rem">
|
|
610
611
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:0.25rem">
|
|
611
|
-
<span style="font-size:0.7rem;font-weight:600;color:#0891b2;text-transform:uppercase"
|
|
612
|
+
<span style="font-size:0.7rem;font-weight:600;color:#0891b2;text-transform:uppercase">${this.escapeHtml(lang)}</span>
|
|
612
613
|
<span style="font-size:0.7rem;color:var(--color-text-secondary)">${lineCount} lines</span>
|
|
613
614
|
</div>
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
${truncated ? `<div style="margin-top:0.5rem;padding-top:0.5rem;border-top:1px solid var(--color-border);font-size:0.7rem;color:var(--color-text-secondary);text-align:center">... ${lineCount - 50} more lines truncated ...</div>` : ''}
|
|
617
|
-
</div>
|
|
615
|
+
${StreamingRenderer.renderCodeWithHighlight(displayCode, this.escapeHtml.bind(this))}
|
|
616
|
+
${truncated ? `<div style="font-size:0.7rem;color:var(--color-text-secondary);text-align:center;padding:0.25rem">... ${lineCount - 50} more lines</div>` : ''}
|
|
618
617
|
</div>`;
|
|
619
618
|
}
|
|
620
619
|
|
|
@@ -635,14 +634,17 @@ class StreamingRenderer {
|
|
|
635
634
|
const truncated = content.length > maxLen;
|
|
636
635
|
const displayContent = truncated ? content.substring(0, maxLen) : content;
|
|
637
636
|
const lineCount = content.split('\n').length;
|
|
638
|
-
|
|
637
|
+
const codeBody = StreamingRenderer.detectCodeContent(displayContent)
|
|
638
|
+
? StreamingRenderer.renderCodeWithHighlight(displayContent, this.escapeHtml.bind(this))
|
|
639
|
+
: `<div class="preview-body">${this.escapeHtml(displayContent)}</div>`;
|
|
640
|
+
return `<div class="tool-param-content-preview" style="margin-top:0.5rem"><div class="preview-header"><span>${this.escapeHtml(label)}</span><span style="font-weight:400">${lineCount} lines${truncated ? ' (truncated)' : ''}</span></div>${codeBody}${truncated ? '<div class="preview-truncated">... ' + (content.length - maxLen) + ' more characters</div>' : ''}</div>`;
|
|
639
641
|
}
|
|
640
642
|
|
|
641
643
|
/**
|
|
642
644
|
* Render params as formatted JSON (default fallback for unknown tools)
|
|
643
645
|
*/
|
|
644
646
|
renderJsonParams(input) {
|
|
645
|
-
return `<div class="tool-params"
|
|
647
|
+
return `<div class="tool-params">${this.renderParametersBeautiful(input)}</div>`;
|
|
646
648
|
}
|
|
647
649
|
|
|
648
650
|
/**
|
|
@@ -712,6 +714,11 @@ class StreamingRenderer {
|
|
|
712
714
|
if (typeof data === 'number') return `<span style="color:#7c3aed;font-weight:600">${data}</span>`;
|
|
713
715
|
|
|
714
716
|
if (typeof data === 'string') {
|
|
717
|
+
if (data.length > 200 && StreamingRenderer.detectCodeContent(data)) {
|
|
718
|
+
const displayData = data.length > 1000 ? data.substring(0, 1000) : data;
|
|
719
|
+
const suffix = data.length > 1000 ? `<div style="font-size:0.7rem;color:var(--color-text-secondary);text-align:center;padding:0.25rem">... ${data.length - 1000} more characters</div>` : '';
|
|
720
|
+
return `<div style="max-height:200px;overflow-y:auto">${StreamingRenderer.renderCodeWithHighlight(displayData, this.escapeHtml.bind(this))}${suffix}</div>`;
|
|
721
|
+
}
|
|
715
722
|
if (data.length > 500) {
|
|
716
723
|
const lines = data.split('\n').length;
|
|
717
724
|
return `<div style="font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.75rem;white-space:pre-wrap;word-break:break-all;max-height:200px;overflow-y:auto;background:var(--color-bg-code);color:#d1d5db;padding:0.5rem;border-radius:0.375rem;line-height:1.5">${this.escapeHtml(data.substring(0, 1000))}${data.length > 1000 ? '\n... (' + (data.length - 1000) + ' more chars, ' + lines + ' lines)' : ''}</div>`;
|