@onereach/step-voice 7.0.26-agenttimeout.5 → 7.0.26-agenttimeout.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.js +12 -12
- package/package.json +1 -1
package/dst/Voice Agent.js
CHANGED
|
@@ -142,34 +142,34 @@ class VoiceAgent extends voice_1.default {
|
|
|
142
142
|
}
|
|
143
143
|
validateToolFeedback(config) {
|
|
144
144
|
if (config == null || typeof config !== 'object')
|
|
145
|
-
return
|
|
145
|
+
return null;
|
|
146
146
|
const cfg = config;
|
|
147
147
|
// If enabled is not boolean true, silently return undefined (disabled case)
|
|
148
148
|
if (typeof cfg.enabled !== 'boolean' || cfg.enabled !== true)
|
|
149
|
-
return
|
|
149
|
+
return null;
|
|
150
150
|
// Validate pre_tool_speech
|
|
151
151
|
const validPreToolSpeech = ['auto', 'static', 'off'];
|
|
152
152
|
if (!validPreToolSpeech.includes(cfg.pre_tool_speech)) {
|
|
153
153
|
this.log.warn('Voice Agent: invalid tool_feedback.pre_tool_speech — feedback config excluded');
|
|
154
|
-
return
|
|
154
|
+
return null;
|
|
155
155
|
}
|
|
156
156
|
// Validate tool_call_sound
|
|
157
157
|
const validToolCallSound = ['typing', 'none'];
|
|
158
158
|
if (!validToolCallSound.includes(cfg.tool_call_sound)) {
|
|
159
159
|
this.log.warn('Voice Agent: invalid tool_feedback.tool_call_sound — feedback config excluded');
|
|
160
|
-
return
|
|
160
|
+
return null;
|
|
161
161
|
}
|
|
162
162
|
// Validate tool_call_sound_behavior
|
|
163
163
|
const validToolCallSoundBehavior = ['always', 'with_pre_speech'];
|
|
164
164
|
if (!validToolCallSoundBehavior.includes(cfg.tool_call_sound_behavior)) {
|
|
165
165
|
this.log.warn('Voice Agent: invalid tool_feedback.tool_call_sound_behavior — feedback config excluded');
|
|
166
|
-
return
|
|
166
|
+
return null;
|
|
167
167
|
}
|
|
168
168
|
// Validate delay_seconds
|
|
169
|
-
const delay = cfg.delay_seconds;
|
|
170
|
-
if (
|
|
169
|
+
const delay = Number(cfg.delay_seconds);
|
|
170
|
+
if (delay <= 0 || delay > 30) {
|
|
171
171
|
this.log.warn('Voice Agent: invalid tool_feedback.delay_seconds — feedback config excluded');
|
|
172
|
-
return
|
|
172
|
+
return null;
|
|
173
173
|
}
|
|
174
174
|
// Validate pre_tool_speech_phrases (only required when mode is 'static')
|
|
175
175
|
const phrases = cfg.pre_tool_speech_phrases;
|
|
@@ -179,7 +179,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
179
179
|
phrases.length > 20 ||
|
|
180
180
|
!phrases.every((p) => typeof p === 'string' && p.trim().length > 0)) {
|
|
181
181
|
this.log.warn('Voice Agent: invalid tool_feedback.pre_tool_speech_phrases — feedback config excluded');
|
|
182
|
-
return
|
|
182
|
+
return null;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
return {
|
|
@@ -218,7 +218,7 @@ class VoiceAgent extends voice_1.default {
|
|
|
218
218
|
const result = {};
|
|
219
219
|
if ('delay_seconds' in raw && raw.delay_seconds != null) {
|
|
220
220
|
const delay = Number(raw.delay_seconds);
|
|
221
|
-
if (
|
|
221
|
+
if (delay <= 0 || delay > 30) {
|
|
222
222
|
this.log.warn(`Voice Agent: invalid feedback.delay_seconds for tool "${toolName}" — per-tool feedback excluded`);
|
|
223
223
|
return null;
|
|
224
224
|
}
|
|
@@ -254,8 +254,8 @@ class VoiceAgent extends voice_1.default {
|
|
|
254
254
|
if (config == null || typeof config !== 'object' || Array.isArray(config))
|
|
255
255
|
return null;
|
|
256
256
|
const cfg = config;
|
|
257
|
-
const timeoutSeconds = cfg.timeout_seconds;
|
|
258
|
-
if (
|
|
257
|
+
const timeoutSeconds = Number(cfg.timeout_seconds);
|
|
258
|
+
if (timeoutSeconds <= 0 || timeoutSeconds > 30) {
|
|
259
259
|
this.log.warn('Voice Agent: invalid soft_timeout.timeout_seconds — soft timeout config excluded');
|
|
260
260
|
return null;
|
|
261
261
|
}
|