open-agents-ai 0.103.61 → 0.103.64

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.
Files changed (3) hide show
  1. package/README.md +105 -7
  2. package/dist/index.js +748 -170
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -56,7 +56,7 @@ The agent uses tools autonomously in a loop — reading errors, fixing code, and
56
56
  - **Live Voice Session** — `/listen` with `/voice` enabled spawns a cloudflared tunnel with a real-time WebSocket audio endpoint. A floating presence UI shows live transcription, connected users, and audio visualization. Echo cancellation prevents TTS feedback loops
57
57
  - **Call Sub-Agent** — each WebSocket caller gets a dedicated AgenticRunner for low-latency voice-to-voice loops, with admin/public access tiers and bidirectional activity sharing with the main agent
58
58
  - **Telegram Voice** — `/voice` enabled via Telegram forwards TTS audio as voice messages alongside text responses. Incoming voice messages are auto-transcribed and handled as text
59
- - **Neural TTS** — hear what the agent is doing via GLaDOS or Overwatch ONNX voices, with personality-driven expressiveness
59
+ - **Neural TTS** — hear what the agent is doing via GLaDOS, Overwatch, Kokoro, or LuxTTS voice clone, with literature-grounded narration engine (sNeuron-TST structure rotation, Moshi ring buffer dedup, UDDETTS emotion-driven prosody, SEST metadata, LuxTTS flow-matching voice cloning)
60
60
  - **Personality Core** — SAC framework-based style control (concise/balanced/verbose/pedagogical) that shapes agent response depth, voice expressiveness, and system prompt behavior
61
61
  - **Human expert speed ratio** — real-time `Exp: Nx` gauge comparing agent speed to a leading human expert, calibrated across 47 tool baselines
62
62
  - **Cost tracking** — real-time token cost estimation for 15+ cloud providers
@@ -526,10 +526,11 @@ The personality system draws on:
526
526
 
527
527
  ## Emotion Engine — Affective State Modulation
528
528
 
529
- The agent stack includes a real-time emotion system that modulates behavior based on an appraisal-based affective model. Built on Russell's circumplex model of affect, the engine maintains a continuous emotional state defined by two axes:
529
+ The agent stack includes a real-time emotion system that modulates behavior based on an appraisal-based affective model. Built on Russell's circumplex model of affect extended with the dominance axis from UDDETTS ADV space ([arXiv:2505.10599](https://arxiv.org/abs/2505.10599)), the engine maintains a continuous emotional state defined by three axes:
530
530
 
531
531
  - **Valence** (-1 to +1): displeasure ↔ pleasure
532
532
  - **Arousal** (0 to 1): calm ↔ energized
533
+ - **Dominance** (0 to 1): submissive/collaborative ↔ dominant/assertive
533
534
 
534
535
  Every agent event (tool success/failure, task completion, errors, context pressure) is appraised and shifts the emotional state, which decays back toward a baseline over ~5 minutes. The emotional state modulates agent behavior across all layers: system prompt behavioral hints, voice narration tone, and decision-making style:
535
536
 
@@ -589,12 +590,93 @@ The emotion system is informed by peer-reviewed and preprint research:
589
590
 
590
591
  ```bash
591
592
  /voice # Toggle on/off (default: GLaDOS)
592
- /voice glados # GLaDOS voice
593
- /voice overwatch # Overwatch voice
593
+ /voice glados # GLaDOS voice (ONNX, ~50MB)
594
+ /voice overwatch # Overwatch voice (ONNX, ~50MB)
595
+ /voice kokoro # Kokoro voice (MLX, macOS Apple Silicon)
596
+ /voice luxtts # LuxTTS voice clone (flow-matching, any platform)
597
+ /voice clone <file> # Set clone reference audio for LuxTTS (wav/mp3/ogg/flac)
598
+ /voice clone glados # Generate clone ref from GLaDOS → LuxTTS
599
+ /voice clone overwatch # Generate clone ref from Overwatch → LuxTTS
594
600
  ```
595
601
 
596
602
  Auto-downloads the ONNX voice model (~50MB) on first use. Install `espeak-ng` for best quality (`apt install espeak-ng` / `brew install espeak-ng`).
597
603
 
604
+ ### LuxTTS Voice Cloning
605
+
606
+ [LuxTTS](https://github.com/ysharma3501/LuxTTS) is a flow-matching voice cloning TTS engine that synthesizes speech in any voice from a short reference audio clip. It runs locally via a dedicated Python venv (`~/.open-agents/voice/luxtts-venv/`) and downloads the model (~1.2GB) from HuggingFace on first use.
607
+
608
+ **Setup** (automatic on `/voice luxtts`):
609
+ 1. Creates isolated venv with PyTorch (CPU)
610
+ 2. Clones LuxTTS repo + installs deps (lhotse, LinaCodec, piper_phonemize)
611
+ 3. Downloads YatharthS/LuxTTS model via huggingface_hub
612
+ 4. Auto-detects CUDA/MPS/CPU device
613
+
614
+ **Voice cloning workflow**:
615
+ - Drop an audio file into the terminal while LuxTTS is active → auto-sets as clone reference
616
+ - `/voice clone glados` or `/voice clone overwatch` → generates a synthetic reference from the ONNX voice
617
+ - Custom voice: `/voice clone /path/to/voice-sample.wav` (min ~3 seconds of speech)
618
+
619
+ **Emotion passthrough**: LuxTTS receives the same ADV-driven prosody as ONNX voices:
620
+ - **Speed** → LuxTTS native `speed` parameter (arousal-driven)
621
+ - **Pitch** → post-synthesis resampling via `resamplePitch()` (valence+arousal tanh curve)
622
+ - **Volume** → WAV sample scaling (dominance-driven)
623
+
624
+ Output: 48kHz WAV, compatible with Telegram voice messages and WebSocket streaming.
625
+
626
+ ### Narration Engine Architecture
627
+
628
+ The voice narration system produces **zero static phrase pools** — every spoken sentence is dynamically composed from live tool state, session metrics, and emotion coordinates. The architecture is grounded in 2024-2026 TTS and emotion research:
629
+
630
+ **Composable sentence anatomy**: `[emotion_interjection] [verb] [object] [flow_context]`
631
+
632
+ - **verb**: extracted from tool type via `extractToolVerb()` — returns `[terse, expanded, past_tense]` triple (past tense defined at source, no regex reverse-engineering)
633
+ - **object**: extracted from tool args via `extractToolObject()` — the file, command, pattern, or URL being acted on
634
+ - **flow_context**: error recovery framing, same-file continuity, cross-tool content threading (carries result digests forward)
635
+
636
+ **Sentence structure rotation** ([sNeuron-TST, EMNLP 2024](https://arxiv.org/abs/2410.00593)): Static sentence patterns always activate the same style-specific neurons in TTS models, producing monotone output. The engine cycles through 4 syntactic frames per call:
637
+
638
+ | Pattern | Frame | Example |
639
+ |---------|-------|---------|
640
+ | 0 | SVO standard | "Looking at voice.ts" |
641
+ | 1 | Object-first | "voice.ts, reading it" |
642
+ | 2 | Contextual opener | "Moving to voice.ts" |
643
+ | 3 | Gerund-led | "Taking a deeper look at voice.ts now" |
644
+
645
+ **Ring buffer deduplication** ([Moshi inner monologue, arXiv:2410.00037](https://arxiv.org/abs/2410.00037)): A sliding window of the last 8 utterances catches near-duplicates via Jaccard word-level similarity (threshold 0.7). When a near-duplicate is detected, **DITTO adaptive rotation** ([arXiv:2206.02369](https://arxiv.org/abs/2206.02369), NeurIPS 2022) advances the structure pattern by 2 positions to break self-reinforcing repetition loops.
646
+
647
+ **State-computed emotion interjections**: Instead of word pools, emotion interjections are computed from real session metrics. The emotion quadrant (from ADV coordinates) determines *which* metrics to surface:
648
+
649
+ | Quadrant | Metrics Surfaced | Example |
650
+ |----------|-----------------|---------|
651
+ | Excited (Q1) | Success streaks, throughput | "12 clean operations." |
652
+ | Stressed (Q2) | Error counts, attempt numbers | "3 consecutive errors now." |
653
+ | Calm (Q3) | Stability, zero-error runs | "28 operations, zero errors." |
654
+ | Subdued (Q4) | Complexity, file count | "6 files in play." |
655
+
656
+ ### Emotion-Driven Prosody (SEST)
657
+
658
+ The voice engine modulates **three prosodic dimensions** from the emotion state — text vocabulary stays factual, emotion is expressed through *how* it sounds, not *what* it says ([EmoShift, arXiv:2601.22873](https://arxiv.org/abs/2601.22873)):
659
+
660
+ | Dimension | Source | Effect | Range |
661
+ |-----------|--------|--------|-------|
662
+ | **Pitch** | Valence (50%) + Arousal (30%) + Dominance (20%) | Happy/energized = higher, sad/calm = lower | [-0.10, +0.10] normal, [-0.16, +0.16] stark |
663
+ | **Speed** | Arousal (primary) + Dominance (secondary) | High arousal = faster, high dominance = more deliberate | [0.85x, 1.15x] |
664
+ | **Volume** | Speaker role | Primary = 100%, subordinate (sub-agent) = 55% | [0.55, 1.0] |
665
+
666
+ Pitch and speed use **nonlinear tanh squashing** ([UDDETTS, arXiv:2505.10599](https://arxiv.org/abs/2505.10599)) — moderate emotions get amplified for expressiveness, extreme emotions saturate gracefully instead of clipping.
667
+
668
+ Each narration also emits a **ProsodyHint** metadata object following the RLAIF-SPA SEST schema ([arXiv:2510.14628](https://arxiv.org/abs/2510.14628)) — Structure/Emotion/Speed/Tone — which downstream consumers (WebSocket voice sessions, Telegram TTS) can use independently:
669
+
670
+ ```typescript
671
+ interface ProsodyHint {
672
+ structure: number; // Sentence pattern index (0-3)
673
+ emotion: { valence, arousal, dominance };
674
+ speed: number; // Speech rate factor
675
+ tone: number; // Pitch bias factor
676
+ quadrant: number; // Emotion quadrant (1-4)
677
+ }
678
+ ```
679
+
598
680
  ### Personality-Aware Voice
599
681
 
600
682
  Voice output adapts to the active personality style — the same tool call sounds different depending on the `/style` preset:
@@ -602,11 +684,27 @@ Voice output adapts to the active personality style — the same tool call sound
602
684
  | Style | Example (file_read) | Example (npm test) |
603
685
  |-------|--------------------|--------------------|
604
686
  | **concise** | "Reading app.ts" | "Running tests" |
605
- | **balanced** | "Let me take a look at app.ts" | "Let's run the tests and see how we're doing" |
606
- | **verbose** | "Alright, let's crack open app.ts and see what we're working with" | "Alright, moment of truth, let's see if the tests pass" |
687
+ | **balanced** | "Looking at app.ts" | "Running tests, checking results" |
688
+ | **verbose** | "Taking a deeper look at app.ts now" | "Running the test suite, 8 clean operations so far" |
607
689
 
608
690
  Task completion, tool failures, and all TTS announcements follow the same personality tier. Set the style with `/style verbose` and the voice output becomes conversational rather than robotic.
609
691
 
692
+ ### Voice Narration Research Foundations
693
+
694
+ The narration engine is informed by peer-reviewed and preprint research:
695
+
696
+ 1. **sNeuron-TST** — Style-specific neurons in text style transfer ([arXiv:2410.00593](https://arxiv.org/abs/2410.00593), EMNLP 2024). Static sentence patterns activate the same neurons monotonically; structure rotation prevents this.
697
+
698
+ 2. **Moshi Inner Monologue** — Streaming LLM with self-tracking ring buffer ([arXiv:2410.00037](https://arxiv.org/abs/2410.00037), 2024). Prevents repetition loops in streaming speech via recent-output awareness.
699
+
700
+ 3. **DITTO** — Pseudo-repetition penalization ([arXiv:2206.02369](https://arxiv.org/abs/2206.02369), NeurIPS 2022). Repetition is self-reinforcing at the sentence level; active disruption of recurring patterns is necessary.
701
+
702
+ 4. **UDDETTS** — ADV emotion space with nonlinear quantification ([arXiv:2505.10599](https://arxiv.org/abs/2505.10599), 2025). Three-axis (arousal/dominance/valence) dimensional emotion conditioning for TTS, with tanh-based mapping to acoustic features.
703
+
704
+ 5. **EmoShift** — Lightweight activation steering for per-sentence emotion ([arXiv:2601.22873](https://arxiv.org/abs/2601.22873), ICASSP 2026). Emotion expressed through prosody modulation (pitch, rate, emphasis), not vocabulary changes.
705
+
706
+ 6. **RLAIF-SPA** — SEST schema for prosody annotation ([arXiv:2510.14628](https://arxiv.org/abs/2510.14628), 2025). Structure/Emotion/Speed/Tone 4-dimension metadata framework for emotional speech synthesis.
707
+
610
708
  ### Live Voice Session
611
709
 
612
710
  When both `/voice` and `/listen` are enabled, the system spawns a **live voice session** — a real-time bidirectional audio endpoint exposed through a cloudflared tunnel:
@@ -933,7 +1031,7 @@ The TUI features an animated multilingual phrase carousel, live metrics bar with
933
1031
  | `/compact` | Force context compaction now (default strategy) |
934
1032
  | `/compact <strategy>` | Compact with strategy: `aggressive`, `decisions`, `errors`, `summary`, `structured` |
935
1033
  | **Audio & Vision** | |
936
- | `/voice [model]` | Toggle TTS voice (GLaDOS, Overwatch) |
1034
+ | `/voice [model]` | Toggle TTS voice (GLaDOS, Overwatch, Kokoro, LuxTTS) |
937
1035
  | `/listen [mode]` | Toggle live microphone transcription |
938
1036
  | `/dream [mode]` | Start dream mode (default, deep, lucid) |
939
1037
  | **Display & Behavior** | |