@ducci/jarvis 1.0.89 → 1.0.91

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ducci/jarvis",
3
- "version": "1.0.89",
3
+ "version": "1.0.91",
4
4
  "description": "A fully automated agent system that lives on a server.",
5
5
  "main": "./src/index.js",
6
6
  "type": "module",
@@ -697,6 +697,7 @@ export async function startTelegramChannel(config) {
697
697
  await sendMessage(api, chatId, displayText, result.sessionId);
698
698
  console.log(`[telegram] response sent chat_id=${chatId} slot=${slot} length=${displayText.length}`);
699
699
  // TTS: send audio summary if voice is enabled (config.voiceEnabled checked live, updated by /voice toggle)
700
+ await api.sendMessage(chatId, `[TTS debug] voiceEnabled=${config.voiceEnabled} hasKey=${!!config.fishAudioApiKey}`).catch(() => {});
700
701
  if (config.voiceEnabled && config.fishAudioApiKey) {
701
702
  try {
702
703
  // If the response is a raw JSON blob (format_error recovery), extract the actual text
@@ -716,6 +717,7 @@ export async function startTelegramChannel(config) {
716
717
  }
717
718
  } catch (e) {
718
719
  console.error(`[telegram] TTS error chat_id=${chatId}: ${e.message}`);
720
+ await api.sendMessage(chatId, `[TTS error: ${e.message}]`).catch(() => {});
719
721
  }
720
722
  }
721
723
  } else {
@@ -8,7 +8,6 @@ import { promisify } from 'util';
8
8
  import { writeFile, readFile, unlink } from 'fs/promises';
9
9
  import { tmpdir } from 'os';
10
10
  import { join } from 'path';
11
- import { Readable } from 'stream';
12
11
  const execAsync = promisify(exec);
13
12
 
14
13
  // System prompt for TTS summary generation.
@@ -90,13 +89,7 @@ export async function textToSpeech(text, config) {
90
89
  throw new Error(`fish.audio TTS ${response.status}: ${errText.slice(0, 200)}`);
91
90
  }
92
91
 
93
- // fish.audio streams audio via chunked transfer encoding — arrayBuffer() only
94
- // returns the first chunk. Collect all chunks via a Node.js stream.
95
- const chunks = [];
96
- for await (const chunk of Readable.fromWeb(response.body)) {
97
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
98
- }
99
- return Buffer.concat(chunks);
92
+ return Buffer.from(await response.arrayBuffer());
100
93
  }
101
94
 
102
95
  /**