@onereach/step-voice 7.0.41-subagents.4 → 7.0.41-subagents.5
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/dst/Voice Agent.js +23 -5
- package/package.json +1 -1
package/dst/Voice Agent.js
CHANGED
|
@@ -333,6 +333,17 @@ class VoiceAgent extends voice_1.default {
|
|
|
333
333
|
}
|
|
334
334
|
result.pre_tool_speech = raw.pre_tool_speech;
|
|
335
335
|
}
|
|
336
|
+
if ('pre_tool_speech_phrases' in raw && raw.pre_tool_speech_phrases != null) {
|
|
337
|
+
const phrases = raw.pre_tool_speech_phrases;
|
|
338
|
+
if (!Array.isArray(phrases) ||
|
|
339
|
+
phrases.length < 1 ||
|
|
340
|
+
phrases.length > 20 ||
|
|
341
|
+
!phrases.every((p) => typeof p === 'string' && p.trim().length > 0)) {
|
|
342
|
+
this.log.warn(`Voice Agent: invalid feedback.pre_tool_speech_phrases for tool "${toolName}" — per-tool feedback excluded`);
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
result.pre_tool_speech_phrases = phrases;
|
|
346
|
+
}
|
|
336
347
|
if ('tool_call_sound' in raw && raw.tool_call_sound != null) {
|
|
337
348
|
const valid = ['typing', 'none'];
|
|
338
349
|
if (!valid.includes(raw.tool_call_sound)) {
|
|
@@ -361,11 +372,19 @@ class VoiceAgent extends voice_1.default {
|
|
|
361
372
|
return null;
|
|
362
373
|
}
|
|
363
374
|
const validModes = ['static', 'auto'];
|
|
364
|
-
|
|
375
|
+
const mode = cfg.mode;
|
|
376
|
+
const result = {
|
|
377
|
+
timeout_seconds: timeoutSeconds,
|
|
378
|
+
phrases: [],
|
|
379
|
+
mode
|
|
380
|
+
};
|
|
381
|
+
if (!validModes.includes(mode)) {
|
|
365
382
|
this.log.warn('Voice Agent: invalid soft_timeout.mode — soft timeout config excluded');
|
|
366
383
|
return null;
|
|
367
384
|
}
|
|
368
|
-
|
|
385
|
+
if (mode === 'auto') {
|
|
386
|
+
return result;
|
|
387
|
+
}
|
|
369
388
|
const phrases = cfg.phrases;
|
|
370
389
|
if (!Array.isArray(phrases) ||
|
|
371
390
|
phrases.length < 1 ||
|
|
@@ -375,9 +394,8 @@ class VoiceAgent extends voice_1.default {
|
|
|
375
394
|
return null;
|
|
376
395
|
}
|
|
377
396
|
return {
|
|
378
|
-
|
|
379
|
-
phrases: phrases
|
|
380
|
-
mode: cfg.mode
|
|
397
|
+
...result,
|
|
398
|
+
phrases: phrases
|
|
381
399
|
};
|
|
382
400
|
}
|
|
383
401
|
validateSystemTools(systemTools) {
|