@streamoji/aitwin 0.6.3 → 0.6.5
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/README.md +1 -1
- package/dist/aitwin.cjs +6 -6
- package/dist/aitwin.js +520 -505
- package/dist/index.d.ts +24 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -49,7 +49,9 @@ export declare type AiTwinHandle = {
|
|
|
49
49
|
/** Mute/unmute bot audio output (TTS + voice). */
|
|
50
50
|
setMuted: (muted: boolean) => void;
|
|
51
51
|
isMuted: () => boolean;
|
|
52
|
-
/**
|
|
52
|
+
/** Brain id from getAiTwin (for /avatarReply and /ws/voice). */
|
|
53
|
+
getBrainId: () => string | null;
|
|
54
|
+
/** @deprecated Use `getBrainId`. */
|
|
53
55
|
getPersonaId: () => string | null;
|
|
54
56
|
};
|
|
55
57
|
|
|
@@ -153,7 +155,9 @@ export declare type AiTwinRecord = {
|
|
|
153
155
|
voiceId?: string;
|
|
154
156
|
/** Bearer JWT for TTS / voice WebSocket (same as `getAuthToken`). */
|
|
155
157
|
authToken?: string;
|
|
156
|
-
/**
|
|
158
|
+
/** Redis brain id. Passed as `brainId` on `/ws/voice` and `/avatarReply`. */
|
|
159
|
+
brainId?: string;
|
|
160
|
+
/** @deprecated Use `brainId`. */
|
|
157
161
|
knowledgeContextId?: string;
|
|
158
162
|
gender?: string;
|
|
159
163
|
createdAt?: string;
|
|
@@ -228,9 +232,11 @@ export declare type AiTwinWidgetProps = {
|
|
|
228
232
|
*/
|
|
229
233
|
float?: boolean;
|
|
230
234
|
/**
|
|
231
|
-
*
|
|
232
|
-
* When omitted, uses getAiTwin `
|
|
235
|
+
* Brain id for /avatarReply (Text mode).
|
|
236
|
+
* When omitted, uses getAiTwin `brainId` if available.
|
|
233
237
|
*/
|
|
238
|
+
brainId?: string;
|
|
239
|
+
/** @deprecated Use `brainId`. */
|
|
234
240
|
personaId?: string;
|
|
235
241
|
/**
|
|
236
242
|
* Optional poster shown (blurred) on `<AiTwin>` while sil/atlas/idle assets load.
|
|
@@ -346,6 +352,8 @@ export declare type FetchAvatarReplyOptions = {
|
|
|
346
352
|
message: string;
|
|
347
353
|
authToken: string;
|
|
348
354
|
apiBase?: string;
|
|
355
|
+
brainId?: string;
|
|
356
|
+
/** @deprecated Use `brainId`. */
|
|
349
357
|
personaId?: string;
|
|
350
358
|
history?: AvatarReplyMessage[];
|
|
351
359
|
/** Called as soon as spokenText arrives on the SSE stream. */
|
|
@@ -506,6 +514,9 @@ export declare type RealtimeVoiceOptions = VoiceConnectOptions & {
|
|
|
506
514
|
/** Resolve optional `avatarId` / `faceId` props (same R2 custom-faces hex id). */
|
|
507
515
|
export declare function resolveDirectFaceId(avatarId?: string, faceId?: string): string | undefined;
|
|
508
516
|
|
|
517
|
+
/** Canonical `brainId`, then legacy `knowledgeContextId`, then extra fallbacks. */
|
|
518
|
+
export declare function resolveTwinBrainId(source?: TwinBrainFields | string | null, ...fallbacks: Array<string | null | undefined>): string | undefined;
|
|
519
|
+
|
|
509
520
|
/** Pick the active viseme at playback offset (latest vtime wins on overlap). */
|
|
510
521
|
export declare function resolveVisemeAtTime(queue: VisemeQueueItem[], elapsedMs: number): string;
|
|
511
522
|
|
|
@@ -830,6 +841,12 @@ export declare type TwinAssetUrls = {
|
|
|
830
841
|
encrypted: boolean;
|
|
831
842
|
};
|
|
832
843
|
|
|
844
|
+
declare type TwinBrainFields = {
|
|
845
|
+
brainId?: string | null;
|
|
846
|
+
/** @deprecated Use `brainId`. Older getAiTwin responses still send this. */
|
|
847
|
+
knowledgeContextId?: string | null;
|
|
848
|
+
};
|
|
849
|
+
|
|
833
850
|
export declare const VISEME_IDS: readonly ["aa", "E", "I", "O", "U", "PP", "FF", "DD", "SS", "TH", "CH", "RR", "kk", "nn"];
|
|
834
851
|
|
|
835
852
|
/** Minimum gap (ms) between consecutive vtimes to keep a skippable viseme. */
|
|
@@ -868,7 +885,9 @@ export declare type VoiceConnectOptions = {
|
|
|
868
885
|
* Sent as `language` on `/ws/voice` and redirected `/avatar_ttsWithPoses` calls.
|
|
869
886
|
*/
|
|
870
887
|
language?: TtsLanguage;
|
|
871
|
-
/**
|
|
888
|
+
/** Redis brain id (from getAiTwin `brainId`). Sent as `brainId` on `/ws/voice`. */
|
|
889
|
+
brainId?: string;
|
|
890
|
+
/** @deprecated Use `brainId`. */
|
|
872
891
|
personaId?: string;
|
|
873
892
|
speakingRate?: number;
|
|
874
893
|
/** Default true — server streams TTS + avatar messages. */
|