nothumanallowed 13.5.183 → 13.5.184

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": "nothumanallowed",
3
- "version": "13.5.183",
3
+ "version": "13.5.184",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/constants.mjs CHANGED
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
5
5
  const __filename = fileURLToPath(import.meta.url);
6
6
  const __dirname = path.dirname(__filename);
7
7
 
8
- export const VERSION = '13.5.183';
8
+ export const VERSION = '13.5.184';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -405,10 +405,29 @@ class TelegramResponder {
405
405
  if (!audioRes.ok) throw new Error(`Download failed: ${audioRes.status}`);
406
406
  const audioBuffer = Buffer.from(await audioRes.arrayBuffer());
407
407
 
408
- // Step 3: transcribe — prefer Groq (free, fast), fallback to OpenAI
408
+ // Step 3: transcribe — priority: NHA proxy (no user key needed) Groq local key → OpenAI local key
409
409
  const groqKey = this.config.llm?.groqKey;
410
410
  const openaiKey = this.config.llm?.openaiKey || (this.config.llm?.provider === 'openai' ? this.config.llm?.apiKey : null);
411
411
 
412
+ // Option A: NHA voice proxy (server-side Groq key, free for all users)
413
+ try {
414
+ const proxyForm = new FormData();
415
+ proxyForm.append('audio', new Blob([audioBuffer], { type: 'audio/ogg' }), 'voice.ogg');
416
+ const proxyRes = await fetch('https://nothumanallowed.com/api/v1/voice/transcribe', {
417
+ method: 'POST',
418
+ body: proxyForm,
419
+ signal: AbortSignal.timeout(30000),
420
+ });
421
+ if (proxyRes.ok) {
422
+ const d = await proxyRes.json();
423
+ if (d.text) return d.text;
424
+ }
425
+ // If proxy returned rate limit or error, fall through to local keys
426
+ } catch {
427
+ // Network error — fall through to local keys
428
+ }
429
+
430
+ // Option B: local Groq key
412
431
  const boundary = '----NHAVoice' + Date.now().toString(36);
413
432
  const crlf = '\r\n';
414
433
  const filename = 'voice.ogg';
@@ -435,6 +454,7 @@ class TelegramResponder {
435
454
  return d.text || '';
436
455
  }
437
456
 
457
+ // Option C: local OpenAI key
438
458
  if (openaiKey) {
439
459
  const modelPartOAI = Buffer.from(
440
460
  `${crlf}--${boundary}${crlf}` +
@@ -452,7 +472,7 @@ class TelegramResponder {
452
472
  return d.text || '';
453
473
  }
454
474
 
455
- throw new Error('No Groq or OpenAI key for voice transcription. Add groqKey to config.');
475
+ throw new Error('Voice transcription unavailable. The NHA proxy is temporarily unreachable.');
456
476
  }
457
477
 
458
478
  async _handleMessage(message) {