agentgui 1.0.810 → 1.0.812

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/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ ## [Unreleased]
2
+
3
+ ### Fixed
4
+ - Thinking blocks now use theme-aware CSS vars for light/dark backgrounds (`--color-thinking-bg`)
5
+ - All code blocks (renderBlockCode, renderCodeWithHighlight, renderFileRead, renderCommand) now use CSS vars instead of hardcoded dark hex colors
6
+ - Removed hardcoded `#1e293b`, `#e2e8f0`, `#d1d5db` from all inline styles in streaming-renderer.js
7
+ - tool-result-pre text color now adapts to theme via `--color-code-text`
8
+ - Added CSS vars to :root (light) and html.dark for --color-bg-code, --color-code-text, --color-code-border, --color-thinking-bg
9
+ - Thinking block content now renders full markdown (headers, lists, blockquotes, bold, italic, inline code, links)
10
+ - parseAndRenderMarkdown() extended with headers (##/###), ul/ol lists, blockquotes (>), horizontal rules (---)
11
+ - Thinking content dark mode text color set to #c4b5fd (readable purple)
12
+
package/database.js CHANGED
@@ -621,8 +621,9 @@ try {
621
621
  if (mode !== 2) { // 2 = INCREMENTAL
622
622
  console.log('[Migration] Enabling incremental auto_vacuum (one-time VACUUM)...');
623
623
  db.exec('PRAGMA auto_vacuum = INCREMENTAL');
624
- db.exec('VACUUM');
625
- console.log('[Migration] VACUUM complete, auto_vacuum = INCREMENTAL enabled');
624
+ // VACUUM skipped intentionally — full VACUUM on large DBs blocks server startup
625
+ // INCREMENTAL auto_vacuum will apply to new pages going forward
626
+ console.log('[Migration] auto_vacuum = INCREMENTAL enabled (VACUUM skipped)');
626
627
  }
627
628
  } catch (err) {
628
629
  console.error('[Migration] auto_vacuum setup error:', err.message);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.810",
3
+ "version": "1.0.812",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
@@ -5,7 +5,10 @@
5
5
  --color-primary-dark: #1e40af;
6
6
  --color-bg-primary: #ffffff;
7
7
  --color-bg-secondary: #f9fafb;
8
- --color-bg-code: #1f2937;
8
+ --color-bg-code: #f1f5f9;
9
+ --color-code-text: #1e293b;
10
+ --color-code-border: #cbd5e1;
11
+ --color-thinking-bg: #f5f3ff;
9
12
  --color-text-primary: #111827;
10
13
  --color-text-secondary: #6b7280;
11
14
  --color-border: #e5e7eb;
@@ -26,6 +29,10 @@
26
29
  --color-border: #333333;
27
30
  --color-primary: #737373;
28
31
  --color-primary-dark: #525252;
32
+ --color-bg-code: #1e293b;
33
+ --color-code-text: #e2e8f0;
34
+ --color-code-border: #334155;
35
+ --color-thinking-bg: #1e1a2e;
29
36
  }
30
37
 
31
38
  html, body {
@@ -766,7 +773,7 @@
766
773
  padding: 0.5rem 0.75rem;
767
774
  font-size: 0.75rem;
768
775
  font-family: 'Monaco','Menlo','Ubuntu Mono', monospace;
769
- color: #d1d5db;
776
+ color: var(--color-code-text);
770
777
  overflow-x: auto;
771
778
  max-height: 300px;
772
779
  overflow-y: auto;
@@ -1547,11 +1554,11 @@
1547
1554
  .block-thinking {
1548
1555
  margin-bottom: 0;
1549
1556
  border-radius: 0.5rem;
1550
- background: #f5f3ff;
1557
+ background: var(--color-thinking-bg);
1551
1558
  overflow: hidden;
1552
1559
  }
1553
1560
 
1554
- html.dark .block-thinking { }
1561
+ html.dark .block-thinking { background: var(--color-thinking-bg); }
1555
1562
 
1556
1563
  .block-thinking summary {
1557
1564
  padding: 0.375rem 0.75rem;
@@ -1571,14 +1578,24 @@
1571
1578
  .block-thinking summary:hover { }
1572
1579
 
1573
1580
  .block-thinking .thinking-content {
1574
- padding: 0.375rem 0.75rem;
1581
+ padding: 0.375rem 0.75rem 0.75rem;
1575
1582
  font-size: 0.85rem;
1576
1583
  color: #5b21b6;
1577
- white-space: pre-wrap;
1578
- line-height: 1.5;
1584
+ line-height: 1.6;
1579
1585
  }
1586
+ .block-thinking .thinking-content p { margin: 0.25rem 0; }
1587
+ .block-thinking .thinking-content br { display: block; margin: 0.125rem 0; }
1588
+ .block-thinking .thinking-content code { background: rgba(91,33,182,0.1); padding: 0.1rem 0.3rem; border-radius: 0.2rem; font-family: 'Monaco','Menlo','Ubuntu Mono',monospace; font-size: 0.8rem; }
1589
+ .block-thinking .thinking-content strong { font-weight: 700; }
1590
+ .block-thinking .thinking-content em { font-style: italic; opacity: 0.85; }
1591
+ .block-thinking .thinking-content h2, .block-thinking .thinking-content h3 { margin: 0.5rem 0 0.25rem; font-size: 0.9rem; font-weight: 700; }
1592
+ .block-thinking .thinking-content ul, .block-thinking .thinking-content ol { margin: 0.25rem 0 0.25rem 1.25rem; padding: 0; }
1593
+ .block-thinking .thinking-content li { margin: 0.125rem 0; }
1594
+ .block-thinking .thinking-content blockquote { margin: 0.25rem 0 0.25rem 0; padding: 0.25rem 0.75rem; border-left: 3px solid #a78bfa; opacity: 0.85; }
1580
1595
 
1581
1596
  html.dark .block-thinking .thinking-content { color: #c4b5fd; }
1597
+ html.dark .block-thinking .thinking-content code { background: rgba(196,181,253,0.15); }
1598
+ html.dark .block-thinking .thinking-content blockquote { border-left-color: #7c3aed; }
1582
1599
 
1583
1600
  /* --- Tool Use Block --- */
1584
1601
  .block-tool-use {
@@ -461,25 +461,68 @@ class StreamingRenderer {
461
461
  * Parse markdown and render links, code, bold, italic
462
462
  */
463
463
  parseAndRenderMarkdown(text) {
464
- let html = this.escapeHtml(text);
465
-
466
- // Render markdown bold: **text** -> <strong>text</strong>
467
- html = html.replace(/\*\*([^*]+)\*\*/g, '<strong class="font-semibold text-base-content">$1</strong>');
468
-
469
- // Render markdown italic: *text* or _text_
470
- html = html.replace(/\*([^*]+)\*/g, '<em class="italic text-base-content/70">$1</em>');
471
- html = html.replace(/_([^_]+)_/g, '<em class="italic text-base-content/70">$1</em>');
472
-
473
- // Render inline code: `code`
474
- html = html.replace(/`([^`]+)`/g, '<code class="inline-code">$1</code>');
475
-
476
- // Render markdown links: [text](url)
477
- html = html.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" class="link link-primary" target="_blank">$1</a>');
478
-
479
- // Convert line breaks
480
- html = html.replace(/\n/g, '<br>');
464
+ const esc = this.escapeHtml.bind(this);
465
+ const lines = text.split('\n');
466
+ const out = [];
467
+ let i = 0;
468
+ while (i < lines.length) {
469
+ const line = lines[i];
470
+ const trimmed = line.trim();
471
+ if (trimmed.startsWith('### ')) {
472
+ out.push(`<h3 style="margin:0.4rem 0 0.2rem;font-size:0.95rem;font-weight:700">${this._mdInline(esc(trimmed.slice(4)))}</h3>`);
473
+ i++; continue;
474
+ }
475
+ if (trimmed.startsWith('## ')) {
476
+ out.push(`<h2 style="margin:0.5rem 0 0.25rem;font-size:1rem;font-weight:700">${this._mdInline(esc(trimmed.slice(3)))}</h2>`);
477
+ i++; continue;
478
+ }
479
+ if (trimmed.startsWith('# ')) {
480
+ out.push(`<h2 style="margin:0.5rem 0 0.25rem;font-size:1.05rem;font-weight:700">${this._mdInline(esc(trimmed.slice(2)))}</h2>`);
481
+ i++; continue;
482
+ }
483
+ if (trimmed.startsWith('> ')) {
484
+ out.push(`<blockquote style="margin:0.25rem 0;padding:0.2rem 0.75rem;border-left:3px solid currentColor;opacity:0.75">${this._mdInline(esc(trimmed.slice(2)))}</blockquote>`);
485
+ i++; continue;
486
+ }
487
+ if (trimmed === '---' || trimmed === '***' || trimmed === '___') {
488
+ out.push('<hr style="border:none;border-top:1px solid currentColor;opacity:0.2;margin:0.5rem 0">');
489
+ i++; continue;
490
+ }
491
+ if (/^[-*+] /.test(trimmed)) {
492
+ const items = [];
493
+ while (i < lines.length && /^[-*+] /.test(lines[i].trim())) {
494
+ items.push(`<li style="margin:0.1rem 0">${this._mdInline(esc(lines[i].trim().slice(2)))}</li>`);
495
+ i++;
496
+ }
497
+ out.push(`<ul style="margin:0.25rem 0;padding-left:1.25rem">${items.join('')}</ul>`);
498
+ continue;
499
+ }
500
+ if (/^\d+\. /.test(trimmed)) {
501
+ const items = [];
502
+ while (i < lines.length && /^\d+\. /.test(lines[i].trim())) {
503
+ items.push(`<li style="margin:0.1rem 0">${this._mdInline(esc(lines[i].trim().replace(/^\d+\. /, '')))}</li>`);
504
+ i++;
505
+ }
506
+ out.push(`<ol style="margin:0.25rem 0;padding-left:1.25rem">${items.join('')}</ol>`);
507
+ continue;
508
+ }
509
+ if (trimmed === '') {
510
+ out.push('<br>');
511
+ i++; continue;
512
+ }
513
+ out.push(this._mdInline(esc(line)));
514
+ i++;
515
+ }
516
+ return out.join('\n');
517
+ }
481
518
 
482
- return html;
519
+ _mdInline(html) {
520
+ return html
521
+ .replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
522
+ .replace(/\*([^*]+)\*/g, '<em>$1</em>')
523
+ .replace(/_([^_]+)_/g, '<em>$1</em>')
524
+ .replace(/`([^`]+)`/g, '<code class="inline-code">$1</code>')
525
+ .replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2" style="text-decoration:underline;opacity:0.85" target="_blank">$1</a>');
483
526
  }
484
527
 
485
528
  /**
@@ -514,7 +557,7 @@ class StreamingRenderer {
514
557
  });
515
558
  });
516
559
 
517
- const preStyle = "background:#1e293b;padding:1rem;border-radius:0 0 0.375rem 0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;border:1px solid #334155;border-top:none;margin:0";
560
+ const preStyle = "background:var(--color-bg-code);padding:1rem;border-radius:0 0 0.375rem 0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.875rem;line-height:1.6;color:var(--color-code-text);border:1px solid var(--color-code-border);border-top:none;margin:0";
518
561
  const codeContainer = document.createElement('div');
519
562
  codeContainer.innerHTML = `<pre style="${preStyle}"><code class="lazy-hl">${this.escapeHtml(code)}</code></pre>`;
520
563
 
@@ -548,7 +591,7 @@ class StreamingRenderer {
548
591
  + '<span>Thinking Process</span>'
549
592
  + (hasSignature ? '<span style="margin-left:0.5rem;font-size:0.65rem;opacity:0.5;font-weight:400">verified</span>' : '')
550
593
  + '</summary>'
551
- + '<div class="thinking-content">' + this.escapeHtml(thinking) + '</div>'
594
+ + '<div class="thinking-content">' + this.parseAndRenderMarkdown(thinking) + '</div>'
552
595
  + '</details>';
553
596
  return div;
554
597
  }
@@ -847,7 +890,7 @@ class StreamingRenderer {
847
890
  }
848
891
  if (data.length > 500) {
849
892
  const lines = data.split('\n').length;
850
- 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>`;
893
+ 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:var(--color-code-text);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>`;
851
894
  }
852
895
  const looksLikePath = data.startsWith('/') || /^[A-Za-z]:[\\\/]/.test(data);
853
896
  if (looksLikePath && !data.includes(' ') && data.includes('.')) return this.renderFilePath(data);
@@ -1139,7 +1182,7 @@ class StreamingRenderer {
1139
1182
  * Render code with basic syntax highlighting
1140
1183
  */
1141
1184
  static renderCodeWithHighlight(code, esc, flat = false) {
1142
- const preStyle = "background:#1e293b;padding:1rem;border-radius:0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.875rem;line-height:1.6;color:#e2e8f0;border:1px solid #334155;margin:0";
1185
+ const preStyle = "background:var(--color-bg-code);padding:1rem;border-radius:0.375rem;overflow-x:auto;font-family:'Monaco','Menlo','Ubuntu Mono',monospace;font-size:0.875rem;line-height:1.6;color:var(--color-code-text);border:1px solid var(--color-code-border);margin:0";
1143
1186
  const codeHtml = `<pre style="${preStyle}"><code class="lazy-hl">${esc(code)}</code></pre>`;
1144
1187
  if (flat) return codeHtml;
1145
1188
  const lineCount = code.split('\n').length;
@@ -1211,7 +1254,7 @@ class StreamingRenderer {
1211
1254
  return `<div style="max-height:200px;overflow-y:auto">${StreamingRenderer.renderCodeWithHighlight(displayData, esc, true)}${suffix}</div>`;
1212
1255
  }
1213
1256
  if (data.length > 500) {
1214
- 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">${esc(data.substring(0, 1000))}${data.length > 1000 ? '\n... (' + (data.length - 1000) + ' more chars)' : ''}</div>`;
1257
+ 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:var(--color-code-text);padding:0.5rem;border-radius:0.375rem;line-height:1.5">${esc(data.substring(0, 1000))}${data.length > 1000 ? '\n... (' + (data.length - 1000) + ' more chars)' : ''}</div>`;
1215
1258
  }
1216
1259
  const looksLikePath = /^[A-Za-z]:[\\\/]/.test(data) || data.startsWith('/');
1217
1260
  if (looksLikePath && !data.includes(' ') && data.includes('.')) {
@@ -1734,10 +1777,10 @@ class StreamingRenderer {
1734
1777
  }
1735
1778
  }
1736
1779
  if (base64Data) {
1737
- 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>`;
1780
+ 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 var(--color-code-border)" loading="lazy"><div style="font-size:0.7rem;color:var(--color-text-secondary);font-family:'Monaco','Menlo','Ubuntu Mono',monospace;word-break:break-all">${this.escapeHtml(event.path)}</div></div>`;
1738
1781
  } else {
1739
1782
  const contentStr = typeof event.content === 'string' ? event.content : JSON.stringify(event.content, null, 2);
1740
- 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>`;
1783
+ html += `<pre style="background:var(--color-bg-code);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:var(--color-code-text);margin:0.5rem 0 0 0"><code class="lazy-hl">${this.escapeHtml(this.truncateContent(contentStr, 2000))}</code></pre>`;
1741
1784
  }
1742
1785
  }
1743
1786
  body.innerHTML = html;
@@ -1835,7 +1878,7 @@ class StreamingRenderer {
1835
1878
  body.className = 'folded-tool-body';
1836
1879
  let html = `<div class="tool-param-command"><span class="prompt-char">$</span><span class="command-text">${this.escapeHtml(command)}</span></div>`;
1837
1880
  if (output) {
1838
- 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(output, 2000))}</code></pre>`;
1881
+ html += `<pre style="background:var(--color-bg-code);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:var(--color-code-text);margin:0.5rem 0 0 0"><code class="lazy-hl">${this.escapeHtml(this.truncateContent(output, 2000))}</code></pre>`;
1839
1882
  }
1840
1883
  if (exitCode !== null && exitCode !== 0) {
1841
1884
  html += `<div style="margin-top:0.375rem;font-size:0.75rem;color:#ef4444;font-weight:600">Exit code: ${exitCode}</div>`;