agentgui 1.0.171 → 1.0.173
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/claude-runner.js +10 -11
- package/lib/speech.js +5 -3
- package/package.json +1 -1
- package/static/index.html +20 -27
- package/static/js/voice.js +1 -1
package/lib/claude-runner.js
CHANGED
|
@@ -134,19 +134,18 @@ class AgentRunner {
|
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
if (parsed.session_id) sessionId = parsed.session_id;
|
|
145
|
-
if (onEvent) {
|
|
146
|
-
try { onEvent(parsed); } catch (e) {}
|
|
147
|
-
}
|
|
137
|
+
if (jsonBuffer.trim()) {
|
|
138
|
+
const parsed = this.parseOutput(jsonBuffer);
|
|
139
|
+
if (parsed) {
|
|
140
|
+
outputs.push(parsed);
|
|
141
|
+
if (parsed.session_id) sessionId = parsed.session_id;
|
|
142
|
+
if (onEvent) {
|
|
143
|
+
try { onEvent(parsed); } catch (e) {}
|
|
148
144
|
}
|
|
149
145
|
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (code === 0 || outputs.length > 0) {
|
|
150
149
|
resolve({ outputs, sessionId });
|
|
151
150
|
} else {
|
|
152
151
|
reject(new Error(`${this.name} exited with code ${code}`));
|
package/lib/speech.js
CHANGED
|
@@ -56,13 +56,14 @@ function scanVoiceDir(dir) {
|
|
|
56
56
|
const voices = [];
|
|
57
57
|
try {
|
|
58
58
|
if (!fs.existsSync(dir)) return voices;
|
|
59
|
+
const listed = new Set();
|
|
59
60
|
for (const file of fs.readdirSync(dir)) {
|
|
60
61
|
const ext = path.extname(file).toLowerCase();
|
|
61
62
|
if (!AUDIO_EXTENSIONS.includes(ext)) continue;
|
|
62
63
|
const baseName = path.basename(file, ext);
|
|
63
64
|
if (ext !== '.wav') {
|
|
64
|
-
const
|
|
65
|
-
if (
|
|
65
|
+
const wavExists = fs.existsSync(path.join(dir, baseName + '.wav'));
|
|
66
|
+
if (wavExists) continue;
|
|
66
67
|
const fullPath = path.join(dir, file);
|
|
67
68
|
if (!pendingConversions.has(fullPath)) {
|
|
68
69
|
pendingConversions.set(fullPath, convertToWav(fullPath).then(result => {
|
|
@@ -70,8 +71,9 @@ function scanVoiceDir(dir) {
|
|
|
70
71
|
return result;
|
|
71
72
|
}));
|
|
72
73
|
}
|
|
73
|
-
continue;
|
|
74
74
|
}
|
|
75
|
+
if (listed.has(baseName)) continue;
|
|
76
|
+
listed.add(baseName);
|
|
75
77
|
const id = 'custom_' + baseName.replace(/[^a-zA-Z0-9_-]/g, '_');
|
|
76
78
|
const name = baseName.replace(/_/g, ' ');
|
|
77
79
|
voices.push({ id, name, gender: 'custom', accent: 'custom', isCustom: true, sourceDir: dir });
|
package/package.json
CHANGED
package/static/index.html
CHANGED
|
@@ -398,7 +398,7 @@
|
|
|
398
398
|
#output {
|
|
399
399
|
display: flex;
|
|
400
400
|
flex-direction: column;
|
|
401
|
-
gap: 0
|
|
401
|
+
gap: 0;
|
|
402
402
|
flex: 1;
|
|
403
403
|
}
|
|
404
404
|
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
|
|
416
416
|
/* --- Messages --- */
|
|
417
417
|
.message {
|
|
418
|
-
margin-bottom: 0.
|
|
418
|
+
margin-bottom: 0.125rem;
|
|
419
419
|
padding: 0.5rem 0.75rem;
|
|
420
420
|
border-radius: 0.75rem;
|
|
421
421
|
max-width: 85%;
|
|
@@ -503,7 +503,7 @@
|
|
|
503
503
|
/* --- Streaming block types --- */
|
|
504
504
|
.streaming-block-system {
|
|
505
505
|
padding: 0.375rem 0.75rem;
|
|
506
|
-
margin: 0.
|
|
506
|
+
margin: 0.0625rem 0;
|
|
507
507
|
background: rgba(59,130,246,0.08);
|
|
508
508
|
border-radius: 0.375rem;
|
|
509
509
|
font-size: 0.8rem;
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
html.dark .tool-input-pre { background: rgba(255,255,255,0.03); }
|
|
559
559
|
|
|
560
560
|
.streaming-block-tool-result {
|
|
561
|
-
margin: 0.
|
|
561
|
+
margin: 0.0625rem 0;
|
|
562
562
|
border-radius: 0.375rem;
|
|
563
563
|
background: var(--color-bg-code);
|
|
564
564
|
overflow: hidden;
|
|
@@ -601,7 +601,7 @@
|
|
|
601
601
|
|
|
602
602
|
.streaming-block-result {
|
|
603
603
|
padding: 0.375rem 0.75rem;
|
|
604
|
-
margin: 0.
|
|
604
|
+
margin: 0.0625rem 0;
|
|
605
605
|
border-radius: 0.375rem;
|
|
606
606
|
background: rgba(16,185,129,0.08);
|
|
607
607
|
font-size: 0.8rem;
|
|
@@ -1149,7 +1149,7 @@
|
|
|
1149
1149
|
|
|
1150
1150
|
/* ===== STREAMING BLOCK STYLES ===== */
|
|
1151
1151
|
.block-text {
|
|
1152
|
-
margin-bottom: 0.
|
|
1152
|
+
margin-bottom: 0.0625rem;
|
|
1153
1153
|
padding: 0.5rem 0.75rem;
|
|
1154
1154
|
background: var(--color-bg-primary);
|
|
1155
1155
|
border-radius: 0.5rem;
|
|
@@ -1171,7 +1171,7 @@
|
|
|
1171
1171
|
}
|
|
1172
1172
|
|
|
1173
1173
|
.block-code {
|
|
1174
|
-
margin-bottom: 0.
|
|
1174
|
+
margin-bottom: 0.0625rem;
|
|
1175
1175
|
border-radius: 0.5rem;
|
|
1176
1176
|
overflow: hidden;
|
|
1177
1177
|
}
|
|
@@ -1218,7 +1218,7 @@
|
|
|
1218
1218
|
}
|
|
1219
1219
|
|
|
1220
1220
|
.block-thinking {
|
|
1221
|
-
margin-bottom: 0.
|
|
1221
|
+
margin-bottom: 0.0625rem;
|
|
1222
1222
|
border-radius: 0.5rem;
|
|
1223
1223
|
background: #f5f3ff;
|
|
1224
1224
|
overflow: hidden;
|
|
@@ -1255,7 +1255,7 @@
|
|
|
1255
1255
|
|
|
1256
1256
|
/* --- Tool Use Block --- */
|
|
1257
1257
|
.block-tool-use {
|
|
1258
|
-
margin-bottom: 0.
|
|
1258
|
+
margin-bottom: 0.0625rem;
|
|
1259
1259
|
border-radius: 0.5rem;
|
|
1260
1260
|
background: #ecfeff;
|
|
1261
1261
|
overflow: hidden;
|
|
@@ -1497,15 +1497,13 @@
|
|
|
1497
1497
|
|
|
1498
1498
|
/* --- Folded Tool Use (compact success-style bar) --- */
|
|
1499
1499
|
.folded-tool {
|
|
1500
|
-
margin: 0.
|
|
1500
|
+
margin: 0.0625rem 0;
|
|
1501
1501
|
border-radius: 0.375rem;
|
|
1502
1502
|
overflow: hidden;
|
|
1503
1503
|
background: #f0fdf4;
|
|
1504
|
-
border: 1px solid #bbf7d0;
|
|
1505
1504
|
}
|
|
1506
1505
|
html.dark .folded-tool {
|
|
1507
1506
|
background: #0a1f0f;
|
|
1508
|
-
border-color: #166534;
|
|
1509
1507
|
}
|
|
1510
1508
|
.folded-tool-bar {
|
|
1511
1509
|
display: flex;
|
|
@@ -1583,11 +1581,9 @@
|
|
|
1583
1581
|
/* --- Error variant of folded-tool --- */
|
|
1584
1582
|
.folded-tool.folded-tool-error {
|
|
1585
1583
|
background: #fef2f2;
|
|
1586
|
-
border-color: #fecaca;
|
|
1587
1584
|
}
|
|
1588
1585
|
html.dark .folded-tool.folded-tool-error {
|
|
1589
1586
|
background: #1c0f0f;
|
|
1590
|
-
border-color: #7f1d1d;
|
|
1591
1587
|
}
|
|
1592
1588
|
.folded-tool-error > .folded-tool-bar {
|
|
1593
1589
|
background: #fee2e2;
|
|
@@ -1611,11 +1607,9 @@
|
|
|
1611
1607
|
/* --- Info variant of folded-tool (system blocks) --- */
|
|
1612
1608
|
.folded-tool.folded-tool-info {
|
|
1613
1609
|
background: #eef2ff;
|
|
1614
|
-
border-color: #c7d2fe;
|
|
1615
1610
|
}
|
|
1616
1611
|
html.dark .folded-tool.folded-tool-info {
|
|
1617
1612
|
background: #15103a;
|
|
1618
|
-
border-color: #3730a3;
|
|
1619
1613
|
}
|
|
1620
1614
|
.folded-tool-info > .folded-tool-bar {
|
|
1621
1615
|
background: #e0e7ff;
|
|
@@ -1687,11 +1681,10 @@
|
|
|
1687
1681
|
|
|
1688
1682
|
/* --- Collapsible Code Summary --- */
|
|
1689
1683
|
.collapsible-code {
|
|
1690
|
-
margin: 0.
|
|
1684
|
+
margin: 0.0625rem 0;
|
|
1691
1685
|
border-radius: 0.375rem;
|
|
1692
1686
|
overflow: hidden;
|
|
1693
1687
|
background: #1e293b;
|
|
1694
|
-
border: 1px solid #334155;
|
|
1695
1688
|
}
|
|
1696
1689
|
.collapsible-code-summary {
|
|
1697
1690
|
display: flex;
|
|
@@ -1743,7 +1736,7 @@
|
|
|
1743
1736
|
|
|
1744
1737
|
/* --- Tool Result Block --- */
|
|
1745
1738
|
.block-tool-result {
|
|
1746
|
-
margin-bottom: 0.
|
|
1739
|
+
margin-bottom: 0.0625rem;
|
|
1747
1740
|
border-radius: 0.5rem;
|
|
1748
1741
|
overflow: hidden;
|
|
1749
1742
|
}
|
|
@@ -1829,7 +1822,7 @@
|
|
|
1829
1822
|
|
|
1830
1823
|
/* --- Result Summary Block --- */
|
|
1831
1824
|
.block-result {
|
|
1832
|
-
margin-bottom: 0.
|
|
1825
|
+
margin-bottom: 0.0625rem;
|
|
1833
1826
|
border-radius: 0.5rem;
|
|
1834
1827
|
overflow: hidden;
|
|
1835
1828
|
}
|
|
@@ -1889,7 +1882,7 @@
|
|
|
1889
1882
|
|
|
1890
1883
|
/* --- System Block --- */
|
|
1891
1884
|
.block-system {
|
|
1892
|
-
margin-bottom: 0.
|
|
1885
|
+
margin-bottom: 0.0625rem;
|
|
1893
1886
|
border-radius: 0.5rem;
|
|
1894
1887
|
background: #eef2ff;
|
|
1895
1888
|
overflow: hidden;
|
|
@@ -1946,7 +1939,7 @@
|
|
|
1946
1939
|
|
|
1947
1940
|
/* --- Bash Block --- */
|
|
1948
1941
|
.block-bash {
|
|
1949
|
-
margin-bottom: 0.
|
|
1942
|
+
margin-bottom: 0.0625rem;
|
|
1950
1943
|
border-radius: 0.5rem;
|
|
1951
1944
|
overflow: hidden;
|
|
1952
1945
|
background: #111827;
|
|
@@ -1980,7 +1973,7 @@
|
|
|
1980
1973
|
|
|
1981
1974
|
/* --- Generic Block --- */
|
|
1982
1975
|
.block-generic {
|
|
1983
|
-
margin-bottom: 0.
|
|
1976
|
+
margin-bottom: 0.0625rem;
|
|
1984
1977
|
padding: 0.5rem 0.75rem;
|
|
1985
1978
|
border-radius: 0.5rem;
|
|
1986
1979
|
background: var(--color-bg-secondary);
|
|
@@ -2023,7 +2016,7 @@
|
|
|
2023
2016
|
|
|
2024
2017
|
/* --- Error Block --- */
|
|
2025
2018
|
.block-error {
|
|
2026
|
-
margin-bottom: 0.
|
|
2019
|
+
margin-bottom: 0.0625rem;
|
|
2027
2020
|
padding: 0.5rem 0.75rem;
|
|
2028
2021
|
border-radius: 0.5rem;
|
|
2029
2022
|
background: #fef2f2;
|
|
@@ -2033,7 +2026,7 @@
|
|
|
2033
2026
|
|
|
2034
2027
|
/* --- Image Block --- */
|
|
2035
2028
|
.block-image {
|
|
2036
|
-
margin-bottom: 0.
|
|
2029
|
+
margin-bottom: 0.0625rem;
|
|
2037
2030
|
border-radius: 0.5rem;
|
|
2038
2031
|
overflow: hidden;
|
|
2039
2032
|
}
|
|
@@ -2043,7 +2036,7 @@
|
|
|
2043
2036
|
|
|
2044
2037
|
/* ===== STREAMING EVENTS ===== */
|
|
2045
2038
|
.event-streaming-start {
|
|
2046
|
-
margin-bottom: 0.
|
|
2039
|
+
margin-bottom: 0.0625rem;
|
|
2047
2040
|
padding: 0.375rem 0.75rem;
|
|
2048
2041
|
background: #eff6ff;
|
|
2049
2042
|
border-radius: 0.5rem;
|
|
@@ -2055,7 +2048,7 @@
|
|
|
2055
2048
|
html.dark .event-streaming-start { background: #0c1a2e; }
|
|
2056
2049
|
|
|
2057
2050
|
.event-streaming-complete {
|
|
2058
|
-
margin-bottom: 0.
|
|
2051
|
+
margin-bottom: 0.0625rem;
|
|
2059
2052
|
padding: 0.375rem 0.75rem;
|
|
2060
2053
|
background: linear-gradient(135deg, #ecfdf5, #f0fdf4);
|
|
2061
2054
|
border-radius: 0.5rem;
|
package/static/js/voice.js
CHANGED
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
selector.value = saved;
|
|
66
66
|
}
|
|
67
67
|
})
|
|
68
|
-
.catch(function() {});
|
|
68
|
+
.catch(function(err) { console.error('[Voice] Failed to load voices:', err); });
|
|
69
69
|
selector.addEventListener('change', function() {
|
|
70
70
|
selectedVoiceId = selector.value;
|
|
71
71
|
localStorage.setItem('voice-selected-id', selectedVoiceId);
|