@onereach/step-voice 7.0.41-subagents.4 → 7.0.41-subagents.6
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.d.ts +5 -0
- package/dst/Voice Agent.js +29 -5
- package/package.json +1 -1
package/dst/Voice Agent.d.ts
CHANGED
|
@@ -24,17 +24,22 @@ interface SoftTimeoutConfig {
|
|
|
24
24
|
phrases: string[];
|
|
25
25
|
mode: SoftTimeoutMode;
|
|
26
26
|
}
|
|
27
|
+
type ToolResponseMode = 'sync' | 'async' | 'none';
|
|
27
28
|
interface Handler {
|
|
28
29
|
name: string;
|
|
29
30
|
description: string;
|
|
30
31
|
parameters: string;
|
|
31
32
|
feedback?: PerToolConfig;
|
|
33
|
+
timeout_seconds?: number | string | null;
|
|
34
|
+
response_mode?: ToolResponseMode | string | null;
|
|
32
35
|
}
|
|
33
36
|
interface SubagentTool {
|
|
34
37
|
name: string;
|
|
35
38
|
description: string;
|
|
36
39
|
parameters: string;
|
|
37
40
|
feedback?: PerToolConfig;
|
|
41
|
+
timeout_seconds?: number | string | null;
|
|
42
|
+
response_mode?: ToolResponseMode | string | null;
|
|
38
43
|
}
|
|
39
44
|
interface AgentServiceConfig {
|
|
40
45
|
provider: string;
|
package/dst/Voice Agent.js
CHANGED
|
@@ -190,6 +190,12 @@ class VoiceAgent extends voice_1.default {
|
|
|
190
190
|
tool.feedback = validatedFeedback;
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
+
if (h.timeout_seconds != null && h.timeout_seconds !== '') {
|
|
194
|
+
tool.timeout_seconds = Number(h.timeout_seconds);
|
|
195
|
+
}
|
|
196
|
+
if (h.response_mode) {
|
|
197
|
+
tool.response_mode = h.response_mode;
|
|
198
|
+
}
|
|
193
199
|
return tool;
|
|
194
200
|
}
|
|
195
201
|
serializeSubagents(subagents) {
|
|
@@ -333,6 +339,17 @@ class VoiceAgent extends voice_1.default {
|
|
|
333
339
|
}
|
|
334
340
|
result.pre_tool_speech = raw.pre_tool_speech;
|
|
335
341
|
}
|
|
342
|
+
if ('pre_tool_speech_phrases' in raw && raw.pre_tool_speech_phrases != null) {
|
|
343
|
+
const phrases = raw.pre_tool_speech_phrases;
|
|
344
|
+
if (!Array.isArray(phrases) ||
|
|
345
|
+
phrases.length < 1 ||
|
|
346
|
+
phrases.length > 20 ||
|
|
347
|
+
!phrases.every((p) => typeof p === 'string' && p.trim().length > 0)) {
|
|
348
|
+
this.log.warn(`Voice Agent: invalid feedback.pre_tool_speech_phrases for tool "${toolName}" — per-tool feedback excluded`);
|
|
349
|
+
return null;
|
|
350
|
+
}
|
|
351
|
+
result.pre_tool_speech_phrases = phrases;
|
|
352
|
+
}
|
|
336
353
|
if ('tool_call_sound' in raw && raw.tool_call_sound != null) {
|
|
337
354
|
const valid = ['typing', 'none'];
|
|
338
355
|
if (!valid.includes(raw.tool_call_sound)) {
|
|
@@ -361,11 +378,19 @@ class VoiceAgent extends voice_1.default {
|
|
|
361
378
|
return null;
|
|
362
379
|
}
|
|
363
380
|
const validModes = ['static', 'auto'];
|
|
364
|
-
|
|
381
|
+
const mode = cfg.mode;
|
|
382
|
+
const result = {
|
|
383
|
+
timeout_seconds: timeoutSeconds,
|
|
384
|
+
phrases: [],
|
|
385
|
+
mode
|
|
386
|
+
};
|
|
387
|
+
if (!validModes.includes(mode)) {
|
|
365
388
|
this.log.warn('Voice Agent: invalid soft_timeout.mode — soft timeout config excluded');
|
|
366
389
|
return null;
|
|
367
390
|
}
|
|
368
|
-
|
|
391
|
+
if (mode === 'auto') {
|
|
392
|
+
return result;
|
|
393
|
+
}
|
|
369
394
|
const phrases = cfg.phrases;
|
|
370
395
|
if (!Array.isArray(phrases) ||
|
|
371
396
|
phrases.length < 1 ||
|
|
@@ -375,9 +400,8 @@ class VoiceAgent extends voice_1.default {
|
|
|
375
400
|
return null;
|
|
376
401
|
}
|
|
377
402
|
return {
|
|
378
|
-
|
|
379
|
-
phrases: phrases
|
|
380
|
-
mode: cfg.mode
|
|
403
|
+
...result,
|
|
404
|
+
phrases: phrases
|
|
381
405
|
};
|
|
382
406
|
}
|
|
383
407
|
validateSystemTools(systemTools) {
|