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.
@@ -134,19 +134,18 @@ class AgentRunner {
134
134
  return;
135
135
  }
136
136
 
137
- const success = code === 0 || (outputs.length > 0 && this.allowNonZeroExit);
138
-
139
- if (success) {
140
- if (jsonBuffer.trim()) {
141
- const parsed = this.parseOutput(jsonBuffer);
142
- if (parsed) {
143
- outputs.push(parsed);
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 wavFile = baseName + '.wav';
65
- if (fs.existsSync(path.join(dir, wavFile))) continue;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.171",
3
+ "version": "1.0.172",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
@@ -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);