@ouro.bot/cli 0.1.0-alpha.567 → 0.1.0-alpha.568

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/changelog.json CHANGED
@@ -1,6 +1,13 @@
1
1
  {
2
2
  "_note": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.568",
6
+ "changes": [
7
+ "Twilio phone recordings that Whisper.cpp reports as empty speech now route through an agent-authored voice reprompt instead of failing the Twilio audio stream.",
8
+ "Real STT infrastructure failures still surface as bridge errors, preserving a clear distinction between silence and broken transcription."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.567",
6
13
  "changes": [
@@ -247,6 +247,35 @@ function isNoSpeechTranscript(text) {
247
247
  || normalized === "[NO_SPEECH]"
248
248
  || normalized === "NO_SPEECH";
249
249
  }
250
+ function isNoSpeechTranscriptionError(error) {
251
+ const normalized = errorMessage(error).toLowerCase();
252
+ return normalized.includes("empty whisper.cpp transcript")
253
+ || normalized.includes("voice transcript text is empty");
254
+ }
255
+ function buildNoSpeechTranscript(utteranceId) {
256
+ return (0, transcript_1.buildVoiceTranscript)({
257
+ utteranceId: `${utteranceId}-nospeech`,
258
+ text: noSpeechPrompt(),
259
+ source: "loopback",
260
+ });
261
+ }
262
+ async function transcribeRecordingOrNoSpeech(options) {
263
+ try {
264
+ const transcript = await options.transcriber.transcribe({
265
+ utteranceId: options.utteranceId,
266
+ audioPath: options.inputPath,
267
+ });
268
+ return isNoSpeechTranscript(transcript.text)
269
+ ? buildNoSpeechTranscript(options.utteranceId)
270
+ : transcript;
271
+ }
272
+ catch (error) {
273
+ if (isNoSpeechTranscriptionError(error)) {
274
+ return buildNoSpeechTranscript(options.utteranceId);
275
+ }
276
+ throw error;
277
+ }
278
+ }
250
279
  function parseRecordingParams(params) {
251
280
  const callSid = params.CallSid?.trim();
252
281
  const recordingSid = params.RecordingSid?.trim();
@@ -664,17 +693,11 @@ async function handleRecording(options, basePath, params, jobs) {
664
693
  authToken: options.twilioAuthToken?.trim() || undefined,
665
694
  });
666
695
  await fs.writeFile(inputPath, audio);
667
- const transcript = await options.transcriber.transcribe({
696
+ const turnTranscript = await transcribeRecordingOrNoSpeech({
697
+ transcriber: options.transcriber,
668
698
  utteranceId,
669
- audioPath: inputPath,
699
+ inputPath,
670
700
  });
671
- const turnTranscript = isNoSpeechTranscript(transcript.text)
672
- ? (0, transcript_1.buildVoiceTranscript)({
673
- utteranceId: `${utteranceId}-nospeech`,
674
- text: noSpeechPrompt(),
675
- source: "loopback",
676
- })
677
- : transcript;
678
701
  return (0, turn_1.runVoiceLoopbackTurn)({
679
702
  agentName: options.agentName,
680
703
  friendId,
@@ -697,11 +720,12 @@ async function handleRecording(options, basePath, params, jobs) {
697
720
  authToken: options.twilioAuthToken?.trim() || undefined,
698
721
  });
699
722
  await fs.writeFile(inputPath, audio);
700
- const transcript = await options.transcriber.transcribe({
723
+ const transcript = await transcribeRecordingOrNoSpeech({
724
+ transcriber: options.transcriber,
701
725
  utteranceId,
702
- audioPath: inputPath,
726
+ inputPath,
703
727
  });
704
- if (isNoSpeechTranscript(transcript.text)) {
728
+ if (transcript.utteranceId === `${utteranceId}-nospeech`) {
705
729
  return await runPhonePromptTurn({
706
730
  bridgeOptions: options,
707
731
  basePath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.567",
3
+ "version": "0.1.0-alpha.568",
4
4
  "main": "dist/heart/daemon/ouro-entry.js",
5
5
  "bin": {
6
6
  "cli": "dist/heart/daemon/ouro-bot-entry.js",