agentgui 1.0.171 → 1.0.172
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/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/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);
|