@streamoji/aitwin 0.6.0 → 0.6.2

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/dist/index.d.ts CHANGED
@@ -82,9 +82,12 @@ export declare type AiTwinProps = {
82
82
  authToken?: string;
83
83
  /** Avatar API base (TTS, session-value, voice). Default: package `DEFAULT_API_BASE`. */
84
84
  apiBase?: string;
85
- /** TTS engine when using `assets` or `avatarId`/`faceId` (default: Cartesia). */
85
+ /** TTS engine when using `assets` or `avatarId`/`faceId` (default: Cartesia). Optional if `voiceId` is packed as `engine:voice`. */
86
86
  ttsEngineId?: TtsEngineId;
87
- /** TTS voice id override (engine-specific). */
87
+ /**
88
+ * TTS voice id. May be a bare id (`eve`, Cartesia UUID) or packed
89
+ * `ttsEngineId:voiceId` (e.g. `visemetts:eve`).
90
+ */
88
91
  voiceId?: string;
89
92
  /** API speakingRate (default: 0.85). */
90
93
  speakingRate?: number;
@@ -410,6 +413,15 @@ export declare function normalizeStreamEmotion(raw: string | undefined | null, f
410
413
  /** Oculus viseme ids for Talking Lady stills and pair transitions (15 standard). */
411
414
  export declare const OCULUS_VISEME_IDS: readonly ["aa", "CH", "DD", "E", "FF", "I", "O", "PP", "RR", "SS", "TH", "U", "kk", "nn", "sil"];
412
415
 
416
+ /**
417
+ * `voiceId` may be a bare id (`eve`) or packed `engine:voice` (`visemetts:eve`).
418
+ * Cartesia UUIDs have no colon, so they stay a plain voice id.
419
+ */
420
+ export declare function parsePackedVoiceId(raw?: string): {
421
+ ttsEngineId?: TtsEngineId;
422
+ voiceId?: string;
423
+ };
424
+
413
425
  export declare const PLAYBACK_SAMPLE_RATE = 16000;
414
426
 
415
427
  declare type RawVisemeTransition = {
@@ -510,6 +522,12 @@ export declare const SPEAKING_RATE_MAX = 1.5;
510
522
 
511
523
  export declare const SPEAKING_RATE_MIN = 0.5;
512
524
 
525
+ /** Merge explicit `ttsEngineId` with a possibly packed `voiceId`. Packed engine wins only if engine is omitted. */
526
+ export declare function splitVoiceIdSpec(ttsEngineId?: TtsEngineId, voiceId?: string): {
527
+ ttsEngineId?: TtsEngineId;
528
+ voiceId?: string;
529
+ };
530
+
513
531
  export declare const TTS_ENGINE_CARTESIA = "eng_c9b1e6d4";
514
532
 
515
533
  /** Opaque TTS engine ids — must match backend TTS_ENGINE_MAP in main.py. */
@@ -517,7 +535,10 @@ export declare const TTS_ENGINE_GOOGLE = "eng_a7f2b9c1";
517
535
 
518
536
  export declare const TTS_ENGINE_INWORLD = "eng_d4e8f3a2";
519
537
 
520
- export declare type TtsEngineId = typeof TTS_ENGINE_GOOGLE | typeof TTS_ENGINE_INWORLD | typeof TTS_ENGINE_CARTESIA;
538
+ /** streamoji-ai-avatar viseme TTS (`POST /avatar_ttsWithPoses`). */
539
+ export declare const TTS_ENGINE_VISEMETTS = "visemetts";
540
+
541
+ export declare type TtsEngineId = typeof TTS_ENGINE_GOOGLE | typeof TTS_ENGINE_INWORLD | typeof TTS_ENGINE_CARTESIA | typeof TTS_ENGINE_VISEMETTS;
521
542
 
522
543
  /** Runtime face bundle URLs (R2 custom-faces or local /twins/…). */
523
544
  export declare type TwinAssetUrls = {
@@ -538,6 +559,9 @@ export declare const VISEME_TEST_CARTESIA_VOICE_ID = "f786b574-daa5-4673-aa0c-cb
538
559
 
539
560
  export declare const VISEME_TEST_SPEAKING_RATE = 0.85;
540
561
 
562
+ /** Default `voice_id` for visemetts (see streamoji-ai-avatar sample curl). */
563
+ export declare const VISEME_TEST_VISEMETTS_VOICE_ID = "eve";
564
+
541
565
  /** Viseme-test page: fixed female voice + speech speed for /avatar_ttsWithPoses. */
542
566
  export declare const VISEME_TEST_VOICE_ID = "Olivia";
543
567
 
@@ -554,7 +578,9 @@ export declare interface VisemeQueueItem {
554
578
  export declare type VoiceConnectOptions = {
555
579
  /** Same JWT as SSE `Authorization: Bearer` (same as `authToken` prop on `<AiTwin>`). */
556
580
  authToken?: string;
557
- /** Cartesia voice UUID override (optional). */
581
+ /** Pipecat `/ws/voice` TTS engine (`visemetts` or Cartesia id). Default Cartesia. */
582
+ ttsEngineId?: TtsEngineId;
583
+ /** Cartesia voice UUID, or visemetts name (e.g. `eve`). */
558
584
  voiceId?: string;
559
585
  /** Persona / knowledge context id (from getAiTwin `knowledgeContextId`). */
560
586
  personaId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamoji/aitwin",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Embeddable React AI twin face with TTS lipsync",
5
5
  "type": "module",
6
6
  "main": "./dist/aitwin.cjs",