@liforma/client 0.3.0 → 0.4.1

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 (179) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +14 -1
  3. package/dist/byo/audioCapture.d.ts +24 -0
  4. package/dist/byo/audioCapture.d.ts.map +1 -0
  5. package/dist/byo/index.d.ts +8 -0
  6. package/dist/byo/index.d.ts.map +1 -0
  7. package/dist/byo/index.js +307 -0
  8. package/dist/byo/index.js.map +1 -0
  9. package/dist/byo/mic.d.ts +27 -0
  10. package/dist/byo/mic.d.ts.map +1 -0
  11. package/dist/byo/pcm.d.ts +33 -0
  12. package/dist/byo/pcm.d.ts.map +1 -0
  13. package/dist/byo/pcmCarry.d.ts +17 -0
  14. package/dist/byo/pcmCarry.d.ts.map +1 -0
  15. package/dist/byo/resample.d.ts +18 -0
  16. package/dist/byo/resample.d.ts.map +1 -0
  17. package/dist/byo/turn.d.ts +39 -0
  18. package/dist/byo/turn.d.ts.map +1 -0
  19. package/dist/byo/types.d.ts +74 -0
  20. package/dist/byo/types.d.ts.map +1 -0
  21. package/dist/deepgram/connectDeepgramAgent.d.ts +51 -0
  22. package/dist/deepgram/connectDeepgramAgent.d.ts.map +1 -0
  23. package/dist/deepgram/deepgramAgentMessages.d.ts +31 -0
  24. package/dist/deepgram/deepgramAgentMessages.d.ts.map +1 -0
  25. package/dist/deepgram/index.d.ts +4 -0
  26. package/dist/deepgram/index.d.ts.map +1 -0
  27. package/dist/deepgram/index.js +142 -0
  28. package/dist/deepgram/index.js.map +1 -0
  29. package/dist/elevenlabs/connectElevenLabsAgent.d.ts +23 -0
  30. package/dist/elevenlabs/connectElevenLabsAgent.d.ts.map +1 -0
  31. package/dist/elevenlabs/index.d.ts +4 -0
  32. package/dist/elevenlabs/index.d.ts.map +1 -0
  33. package/dist/elevenlabs/index.js +89 -0
  34. package/dist/elevenlabs/index.js.map +1 -0
  35. package/dist/google/connectGeminiLive.d.ts +34 -0
  36. package/dist/google/connectGeminiLive.d.ts.map +1 -0
  37. package/dist/google/index.d.ts +4 -0
  38. package/dist/google/index.d.ts.map +1 -0
  39. package/dist/google/index.js +98 -0
  40. package/dist/google/index.js.map +1 -0
  41. package/dist/livekit/connectLiveKitAgent.d.ts +46 -0
  42. package/dist/livekit/connectLiveKitAgent.d.ts.map +1 -0
  43. package/dist/livekit/index.d.ts +3 -0
  44. package/dist/livekit/index.d.ts.map +1 -0
  45. package/dist/livekit/index.js +113 -0
  46. package/dist/livekit/index.js.map +1 -0
  47. package/dist/next/byo/audioCapture.d.ts +24 -0
  48. package/dist/next/byo/audioCapture.d.ts.map +1 -0
  49. package/dist/next/byo/pcm.d.ts +33 -0
  50. package/dist/next/byo/pcm.d.ts.map +1 -0
  51. package/dist/next/byo/resample.d.ts +18 -0
  52. package/dist/next/byo/resample.d.ts.map +1 -0
  53. package/dist/next/index.js +1135 -4183
  54. package/dist/next/index.js.map +1 -1
  55. package/dist/next/next/createLiformaSessionRouteHandler.d.ts +3 -1
  56. package/dist/next/next/createLiformaSessionRouteHandler.d.ts.map +1 -1
  57. package/dist/next/v2/api/mintPublicSession.d.ts +21 -15
  58. package/dist/next/v2/api/mintPublicSession.d.ts.map +1 -1
  59. package/dist/next/v2/api/sessionEndpointRequest.d.ts +8 -3
  60. package/dist/next/v2/api/sessionEndpointRequest.d.ts.map +1 -1
  61. package/dist/next/v2/embed/iframeHost.d.ts +24 -1
  62. package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
  63. package/dist/next/v2/embed/protocol.d.ts +61 -1
  64. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  65. package/dist/next/v2/experience.d.ts +66 -46
  66. package/dist/next/v2/experience.d.ts.map +1 -1
  67. package/dist/next/v2/experienceEvents.d.ts +3 -0
  68. package/dist/next/v2/experienceEvents.d.ts.map +1 -1
  69. package/dist/next/v2/speech/captureMediaStreamTrack.d.ts +1 -1
  70. package/dist/next/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
  71. package/dist/next/v2/speech/speechController.d.ts.map +1 -1
  72. package/dist/next/v2/speech/types.d.ts +13 -0
  73. package/dist/next/v2/speech/types.d.ts.map +1 -1
  74. package/dist/next/v2/types/sessionLaunch.d.ts +43 -0
  75. package/dist/next/v2/types/sessionLaunch.d.ts.map +1 -0
  76. package/dist/next/widget/mountExperienceWidget.d.ts.map +1 -1
  77. package/dist/next/widget/styles.d.ts +1 -1
  78. package/dist/next/widget/styles.d.ts.map +1 -1
  79. package/dist/next/widget/types.d.ts +6 -1
  80. package/dist/next/widget/types.d.ts.map +1 -1
  81. package/dist/npm/byo/audioCapture.d.ts +24 -0
  82. package/dist/npm/byo/audioCapture.d.ts.map +1 -0
  83. package/dist/npm/byo/pcm.d.ts +33 -0
  84. package/dist/npm/byo/pcm.d.ts.map +1 -0
  85. package/dist/npm/byo/resample.d.ts +18 -0
  86. package/dist/npm/byo/resample.d.ts.map +1 -0
  87. package/dist/npm/index.js +960 -4011
  88. package/dist/npm/index.js.map +1 -1
  89. package/dist/npm/v2/api/mintPublicSession.d.ts +21 -15
  90. package/dist/npm/v2/api/mintPublicSession.d.ts.map +1 -1
  91. package/dist/npm/v2/api/sessionEndpointRequest.d.ts +8 -3
  92. package/dist/npm/v2/api/sessionEndpointRequest.d.ts.map +1 -1
  93. package/dist/npm/v2/embed/iframeHost.d.ts +24 -1
  94. package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
  95. package/dist/npm/v2/embed/protocol.d.ts +61 -1
  96. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  97. package/dist/npm/v2/experience.d.ts +66 -46
  98. package/dist/npm/v2/experience.d.ts.map +1 -1
  99. package/dist/npm/v2/experienceEvents.d.ts +3 -0
  100. package/dist/npm/v2/experienceEvents.d.ts.map +1 -1
  101. package/dist/npm/v2/index.d.ts +1 -0
  102. package/dist/npm/v2/index.d.ts.map +1 -1
  103. package/dist/npm/v2/liforma-experience.d.ts.map +1 -1
  104. package/dist/npm/v2/npm.d.ts +1 -0
  105. package/dist/npm/v2/npm.d.ts.map +1 -1
  106. package/dist/npm/v2/speech/captureMediaStreamTrack.d.ts +1 -1
  107. package/dist/npm/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
  108. package/dist/npm/v2/speech/speechController.d.ts.map +1 -1
  109. package/dist/npm/v2/speech/types.d.ts +13 -0
  110. package/dist/npm/v2/speech/types.d.ts.map +1 -1
  111. package/dist/npm/v2/types/index.d.ts +2 -0
  112. package/dist/npm/v2/types/index.d.ts.map +1 -1
  113. package/dist/npm/v2/types/sessionLaunch.d.ts +43 -0
  114. package/dist/npm/v2/types/sessionLaunch.d.ts.map +1 -0
  115. package/dist/npm/widget/mountExperienceWidget.d.ts.map +1 -1
  116. package/dist/npm/widget/styles.d.ts +1 -1
  117. package/dist/npm/widget/styles.d.ts.map +1 -1
  118. package/dist/npm/widget/types.d.ts +6 -1
  119. package/dist/npm/widget/types.d.ts.map +1 -1
  120. package/dist/openai/connectOpenAiRealtime.d.ts +41 -0
  121. package/dist/openai/connectOpenAiRealtime.d.ts.map +1 -0
  122. package/dist/openai/connectOpenAiRealtimeWebRtc.d.ts +37 -0
  123. package/dist/openai/connectOpenAiRealtimeWebRtc.d.ts.map +1 -0
  124. package/dist/openai/index.d.ts +5 -0
  125. package/dist/openai/index.d.ts.map +1 -0
  126. package/dist/openai/index.js +282 -0
  127. package/dist/openai/index.js.map +1 -0
  128. package/dist/react/byo/audioCapture.d.ts +24 -0
  129. package/dist/react/byo/audioCapture.d.ts.map +1 -0
  130. package/dist/react/byo/pcm.d.ts +33 -0
  131. package/dist/react/byo/pcm.d.ts.map +1 -0
  132. package/dist/react/byo/resample.d.ts +18 -0
  133. package/dist/react/byo/resample.d.ts.map +1 -0
  134. package/dist/react/component/experienceComponentLaunch.d.ts +1 -0
  135. package/dist/react/component/experienceComponentLaunch.d.ts.map +1 -1
  136. package/dist/react/component/experienceComponentRuntime.d.ts +11 -1
  137. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  138. package/dist/react/component/experienceComponentTypes.d.ts +25 -10
  139. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  140. package/dist/react/index.js +1291 -4327
  141. package/dist/react/index.js.map +1 -1
  142. package/dist/react/react/Experience.d.ts.map +1 -1
  143. package/dist/react/v2/api/mintPublicSession.d.ts +21 -15
  144. package/dist/react/v2/api/mintPublicSession.d.ts.map +1 -1
  145. package/dist/react/v2/api/sessionEndpointRequest.d.ts +8 -3
  146. package/dist/react/v2/api/sessionEndpointRequest.d.ts.map +1 -1
  147. package/dist/react/v2/embed/iframeHost.d.ts +24 -1
  148. package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
  149. package/dist/react/v2/embed/protocol.d.ts +61 -1
  150. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  151. package/dist/react/v2/experience.d.ts +66 -46
  152. package/dist/react/v2/experience.d.ts.map +1 -1
  153. package/dist/react/v2/experienceEvents.d.ts +3 -0
  154. package/dist/react/v2/experienceEvents.d.ts.map +1 -1
  155. package/dist/react/v2/speech/captureMediaStreamTrack.d.ts +1 -1
  156. package/dist/react/v2/speech/captureMediaStreamTrack.d.ts.map +1 -1
  157. package/dist/react/v2/speech/speechController.d.ts.map +1 -1
  158. package/dist/react/v2/speech/types.d.ts +13 -0
  159. package/dist/react/v2/speech/types.d.ts.map +1 -1
  160. package/dist/react/v2/types/sessionLaunch.d.ts +43 -0
  161. package/dist/react/v2/types/sessionLaunch.d.ts.map +1 -0
  162. package/dist/react/widget/mountExperienceWidget.d.ts.map +1 -1
  163. package/dist/react/widget/styles.d.ts +1 -1
  164. package/dist/react/widget/styles.d.ts.map +1 -1
  165. package/dist/react/widget/types.d.ts +6 -1
  166. package/dist/react/widget/types.d.ts.map +1 -1
  167. package/dist/sdk/v2/client.js +33 -69
  168. package/dist/sdk/v2/client.js.map +1 -1
  169. package/dist/svelte/Experience.svelte +54 -38
  170. package/dist/svelte/Experience.svelte.d.ts +2 -1
  171. package/package.json +55 -7
  172. package/dist/next/v2/speechOnlyManifest.d.ts +0 -7
  173. package/dist/next/v2/speechOnlyManifest.d.ts.map +0 -1
  174. package/dist/next/v2/types/sessionManifestSchema.d.ts +0 -183
  175. package/dist/next/v2/types/sessionManifestSchema.d.ts.map +0 -1
  176. package/dist/react/v2/speechOnlyManifest.d.ts +0 -7
  177. package/dist/react/v2/speechOnlyManifest.d.ts.map +0 -1
  178. package/dist/react/v2/types/sessionManifestSchema.d.ts +0 -183
  179. package/dist/react/v2/types/sessionManifestSchema.d.ts.map +0 -1
@@ -11,6 +11,7 @@
11
11
  type ExperienceEventName,
12
12
  type ExperienceSession,
13
13
  type ListenOnceOptions,
14
+ type Session,
14
15
  type SessionManifest,
15
16
  type StartSessionOptions,
16
17
  type UtteranceResult
@@ -47,13 +48,17 @@
47
48
  let {
48
49
  experienceId,
49
50
  sessionEndpoint,
50
- manifest,
51
- acceptCredentialExposure = false,
51
+ launch: launchToken,
52
+ session: launchSessionSummary,
53
+ locale,
54
+ secondaryLocale,
55
+ learningLocale,
52
56
  language,
53
57
  mode,
54
58
  responseMode,
55
59
  speechInputMode,
56
60
  startButton,
61
+ closeButton,
57
62
  conversationProcessor,
58
63
  speechOnly = false,
59
64
  fit,
@@ -72,8 +77,10 @@
72
77
  onConversationUpdate,
73
78
  onMessage,
74
79
  onListeningState,
80
+ onActivityChange,
75
81
  onModeChange,
76
82
  onConversationProcessorError,
83
+ onPlayerStatusChange,
77
84
  onStateUpdate,
78
85
  onClose,
79
86
  onError
@@ -87,21 +94,19 @@
87
94
  let activeGeneration: Generation | null = null;
88
95
  const launchIdentities = new WeakMap<object, number>();
89
96
 
90
- const startButtonKey = $derived(stableSerialize(startButton));
91
97
  const launchKey = $derived(
92
98
  stableSerialize([
93
99
  experienceId,
94
100
  sessionEndpoint,
95
- manifest ? identityKey(manifest) : 0,
96
- acceptCredentialExposure,
97
- language,
101
+ launchToken,
102
+ launchSessionSummary ? identityKey(launchSessionSummary) : 0,
103
+ locale ?? language,
104
+ secondaryLocale ?? learningLocale,
98
105
  mode,
99
106
  responseMode,
100
107
  speechInputMode,
101
- startButtonKey,
102
108
  conversationProcessor ? identityKey(conversationProcessor) : 0,
103
109
  speechOnly,
104
- fit,
105
110
  avatarId,
106
111
  locationId,
107
112
  embedBaseUrl,
@@ -190,12 +195,10 @@
190
195
  const id = (options as { readonly experienceId?: string }).experienceId;
191
196
  if (typeof id === 'string' && id.trim()) return id;
192
197
  }
193
- if ('manifest' in options) {
194
- const manifest = (options as { readonly manifest?: unknown }).manifest;
195
- if (manifest && typeof manifest === 'object' && 'experienceId' in manifest) {
196
- const id = (manifest as { readonly experienceId?: unknown }).experienceId;
197
- if (typeof id === 'string' && id.trim()) return id;
198
- }
198
+ if ('session' in options) {
199
+ const id = (options as { readonly session?: { readonly experienceId?: unknown } }).session
200
+ ?.experienceId;
201
+ if (typeof id === 'string' && id.trim()) return id;
199
202
  }
200
203
  return experienceId?.trim() || undefined;
201
204
  }
@@ -268,6 +271,7 @@
268
271
  );
269
272
  subscribe(generation, session, 'message', (event) => onMessage?.(event));
270
273
  subscribe(generation, session, 'listeningState', (event) => onListeningState?.(event));
274
+ subscribe(generation, session, 'activityChange', (event) => onActivityChange?.(event));
271
275
  subscribe(generation, session, 'modeChange', (event) => onModeChange?.(event));
272
276
  subscribe(generation, session, 'conversationProcessorError', (event) =>
273
277
  onConversationProcessorError?.(event)
@@ -276,17 +280,31 @@
276
280
 
277
281
  function buildStartOptions(): StartSessionOptions {
278
282
  const hasSessionEndpoint = Boolean(sessionEndpoint?.trim());
283
+ const hasLaunch = Boolean(launchToken?.trim());
279
284
  if (hasSessionEndpoint && !experienceId?.trim()) {
280
285
  throw new Error('sessionEndpoint requires experienceId.');
281
286
  }
282
- if (!hasSessionEndpoint && !experienceId && !manifest) {
283
- throw new Error('Experience requires experienceId or manifest.');
287
+ if (!hasSessionEndpoint && !hasLaunch && !experienceId) {
288
+ throw new Error('Experience requires experienceId, sessionEndpoint, or launch.');
284
289
  }
285
290
 
291
+ if (hasLaunch && launchToken) {
292
+ return {
293
+ launch: launchToken,
294
+ session: launchSessionSummary,
295
+ embedBaseUrl,
296
+ debug,
297
+ speechOnly,
298
+ conversationProcessor
299
+ };
300
+ }
286
301
  if (hasSessionEndpoint && experienceId && sessionEndpoint) {
287
302
  return {
288
303
  experienceId,
289
304
  sessionEndpoint,
305
+ locale,
306
+ secondaryLocale,
307
+ learningLocale,
290
308
  language,
291
309
  locationId,
292
310
  avatarId,
@@ -296,26 +314,15 @@
296
314
  responseMode,
297
315
  speechInputMode,
298
316
  speechOnly,
299
- fit,
300
- startButton: untrack(() => startButton),
301
- conversationProcessor
302
- };
303
- }
304
- if (manifest) {
305
- return {
306
- manifest,
307
- acceptCredentialExposure,
308
- embedBaseUrl,
309
- debug,
310
- speechOnly,
311
- fit,
312
- startButton: untrack(() => startButton),
313
317
  conversationProcessor
314
318
  };
315
319
  }
316
320
  if (experienceId) {
317
321
  return {
318
322
  experienceId,
323
+ locale,
324
+ secondaryLocale,
325
+ learningLocale,
319
326
  language,
320
327
  locationId,
321
328
  avatarId,
@@ -325,12 +332,10 @@
325
332
  responseMode,
326
333
  speechInputMode,
327
334
  speechOnly,
328
- fit,
329
- startButton: untrack(() => startButton),
330
335
  conversationProcessor
331
336
  };
332
337
  }
333
- throw new Error('Experience requires experienceId or manifest.');
338
+ throw new Error('Experience requires experienceId, sessionEndpoint, or launch.');
334
339
  }
335
340
 
336
341
  function snapshotLaunch(): LaunchSnapshot {
@@ -341,7 +346,7 @@
341
346
  }
342
347
  }
343
348
 
344
- async function launch(
349
+ async function runLaunch(
345
350
  generation: Generation,
346
351
  container: HTMLDivElement,
347
352
  options: StartSessionOptions
@@ -357,9 +362,15 @@
357
362
  subscribeToEvents(generation, session);
358
363
  const player = await session.attach({
359
364
  container,
360
- showClose: Boolean(onClose || returnUrl?.trim()),
361
- onStateUpdate: (state: EmbedState) => {
362
- if (!generation.destroyed) onStateUpdate?.(state);
365
+ fit: untrack(() => fit),
366
+ startButton: untrack(() => startButton),
367
+ closeButton: untrack(() => closeButton),
368
+ returnUrl: untrack(() => returnUrl),
369
+ showClose: Boolean(onClose || returnUrl?.trim() || closeButton),
370
+ onPlayerStatusChange: (state: EmbedState) => {
371
+ if (generation.destroyed) return;
372
+ onPlayerStatusChange?.(state);
373
+ onStateUpdate?.(state);
363
374
  }
364
375
  });
365
376
  assertCurrent(generation);
@@ -437,6 +448,11 @@
437
448
  return withSession((session) => session.listenOnce(options));
438
449
  }
439
450
 
451
+ export function getSession(): Session | null {
452
+ return activeGeneration?.instance?.getSession() ?? null;
453
+ }
454
+
455
+ /** @deprecated Prefer getSession(). */
440
456
  export function getManifest(): SessionManifest | null {
441
457
  return activeGeneration?.instance?.getManifest() ?? null;
442
458
  }
@@ -462,7 +478,7 @@
462
478
  generation.ready.reject(error);
463
479
  generation.started.reject(error);
464
480
  } else {
465
- void launch(generation, container, snapshot.options);
481
+ void runLaunch(generation, container, snapshot.options);
466
482
  }
467
483
 
468
484
  return () => cancelGeneration(generation);
@@ -1,4 +1,4 @@
1
- import { type ExperienceEvents, type ExperienceSession, type ListenOnceOptions, type SessionManifest, type UtteranceResult } from '@liforma/client';
1
+ import { type ExperienceEvents, type ExperienceSession, type ListenOnceOptions, type Session, type SessionManifest, type UtteranceResult } from '@liforma/client';
2
2
  import type { ExperienceProps } from './types';
3
3
  declare const Experience: import("svelte").Component<ExperienceProps, {
4
4
  ready: () => Promise<ExperienceEvents["ready"]>;
@@ -12,6 +12,7 @@ declare const Experience: import("svelte").Component<ExperienceProps, {
12
12
  startListening: () => Promise<void>;
13
13
  stopListening: () => Promise<UtteranceResult>;
14
14
  listenOnce: (options?: ListenOnceOptions) => Promise<UtteranceResult>;
15
+ getSession: () => Session | null;
15
16
  getManifest: () => SessionManifest | null;
16
17
  getConversation: () => ReturnType<ExperienceSession["getConversation"]>;
17
18
  end: () => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liforma/client",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "type": "module",
5
5
  "description": "Liforma browser SDK — Experience sessions, speech API, and Svelte embed component.",
6
6
  "license": "MIT",
@@ -32,6 +32,30 @@
32
32
  "./next": {
33
33
  "types": "./dist/next/next/index.d.ts",
34
34
  "import": "./dist/next/index.js"
35
+ },
36
+ "./byo": {
37
+ "types": "./dist/byo/index.d.ts",
38
+ "import": "./dist/byo/index.js"
39
+ },
40
+ "./elevenlabs": {
41
+ "types": "./dist/elevenlabs/index.d.ts",
42
+ "import": "./dist/elevenlabs/index.js"
43
+ },
44
+ "./openai": {
45
+ "types": "./dist/openai/index.d.ts",
46
+ "import": "./dist/openai/index.js"
47
+ },
48
+ "./deepgram": {
49
+ "types": "./dist/deepgram/index.d.ts",
50
+ "import": "./dist/deepgram/index.js"
51
+ },
52
+ "./google": {
53
+ "types": "./dist/google/index.d.ts",
54
+ "import": "./dist/google/index.js"
55
+ },
56
+ "./livekit": {
57
+ "types": "./dist/livekit/index.d.ts",
58
+ "import": "./dist/livekit/index.js"
35
59
  }
36
60
  },
37
61
  "files": [
@@ -39,15 +63,23 @@
39
63
  "dist/svelte",
40
64
  "dist/react",
41
65
  "dist/next",
66
+ "dist/byo",
67
+ "dist/elevenlabs",
68
+ "dist/openai",
69
+ "dist/deepgram",
70
+ "dist/google",
71
+ "dist/livekit",
42
72
  "dist/sdk",
43
73
  "README.md",
44
74
  "CHANGELOG.md",
45
75
  "LICENSE"
46
76
  ],
47
77
  "peerDependencies": {
48
- "svelte": "^5.0.0",
78
+ "@elevenlabs/client": ">=1.0.0",
79
+ "livekit-client": ">=2.0.0",
49
80
  "react": "^18.0.0 || ^19.0.0",
50
- "react-dom": "^18.0.0 || ^19.0.0"
81
+ "react-dom": "^18.0.0 || ^19.0.0",
82
+ "svelte": "^5.0.0"
51
83
  },
52
84
  "peerDependenciesMeta": {
53
85
  "svelte": {
@@ -58,12 +90,24 @@
58
90
  },
59
91
  "react-dom": {
60
92
  "optional": true
93
+ },
94
+ "@elevenlabs/client": {
95
+ "optional": true
96
+ },
97
+ "livekit-client": {
98
+ "optional": true
61
99
  }
62
100
  },
63
101
  "scripts": {
64
- "build": "npm run build:v2 && npm run build:npm && npm run build:svelte && npm run build:react && npm run build:next && npm run copy:preview",
102
+ "build": "npm run build:v2 && npm run build:npm && npm run build:svelte && npm run build:react && npm run build:next && npm run build:byo && npm run build:elevenlabs && npm run build:openai && npm run build:deepgram && npm run build:google && npm run build:livekit && npm run copy:preview",
65
103
  "build:react": "vite build --config vite.config.react.ts && tsc -p tsconfig.react.json",
66
104
  "build:next": "vite build --config vite.config.next.ts && tsc -p tsconfig.next.json",
105
+ "build:byo": "vite build --config vite.config.byo.ts && tsc -p tsconfig.byo.json",
106
+ "build:elevenlabs": "vite build --config vite.config.elevenlabs.ts && tsc -p tsconfig.elevenlabs.json",
107
+ "build:openai": "vite build --config vite.config.openai.ts && tsc -p tsconfig.openai.json",
108
+ "build:deepgram": "vite build --config vite.config.deepgram.ts && tsc -p tsconfig.deepgram.json",
109
+ "build:google": "vite build --config vite.config.google.ts && tsc -p tsconfig.google.json",
110
+ "build:livekit": "vite build --config vite.config.livekit.ts && tsc -p tsconfig.livekit.json",
67
111
  "copy:preview": "mkdir -p dist/preview && cp preview/v2-embed-test.html dist/preview/ && cp preview/v2-embed-test-redirect.html dist/preview/",
68
112
  "build:v2": "vite build --config vite.config.v2.ts",
69
113
  "build:npm": "vite build --config vite.config.npm.ts && tsc -p tsconfig.npm.json",
@@ -116,8 +160,10 @@
116
160
  "fetch:anime-face-detector": "node scripts/fetch-anime-face-detector.mjs",
117
161
  "fetch:face-parsing": "node scripts/fetch-face-parsing.mjs",
118
162
  "fetch:wav2vec-phoneme-ctc": "node scripts/fetch-wav2vec-phoneme-ctc.mjs",
163
+ "fetch:lf-sta": "node scripts/fetch-wav2vec-phoneme-ctc.mjs",
119
164
  "fetch:supertonic-3": "node scripts/fetch-supertonic-3.mjs",
120
- "fetch:models": "npm run fetch:depth-anything-v2 && npm run fetch:video-depth-anything && npm run fetch:depth-pro && npm run fetch:face-landmarker && npm run fetch:anime-face-detector && npm run fetch:face-parsing && npm run fetch:wav2vec-phoneme-ctc && npm run fetch:supertonic-3",
165
+ "fetch:lf-tts": "node scripts/fetch-supertonic-3.mjs",
166
+ "fetch:models": "npm run fetch:depth-anything-v2 && npm run fetch:video-depth-anything && npm run fetch:depth-pro && npm run fetch:face-landmarker && npm run fetch:anime-face-detector && npm run fetch:face-parsing && npm run fetch:lf-sta && npm run fetch:lf-tts",
121
167
  "locations": "npm run catalogue:locations && npm run build:locations",
122
168
  "configure:cors": "node scripts/configure-r2-cors.mjs",
123
169
  "verify:cors": "node scripts/verify-cdn-cors.mjs",
@@ -132,20 +178,22 @@
132
178
  },
133
179
  "devDependencies": {
134
180
  "@aws-sdk/client-s3": "^3.1000.0",
181
+ "@elevenlabs/client": "^1.17.0",
135
182
  "@sveltejs/package": "^2.5.8",
136
183
  "@sveltejs/vite-plugin-svelte": "^7.0.0",
137
184
  "@testing-library/react": "^16.3.0",
138
185
  "@testing-library/svelte": "^5.4.2",
186
+ "@types/node": "^25.9.3",
139
187
  "@types/react": "^19.1.12",
140
188
  "@types/react-dom": "^19.1.9",
141
189
  "@vitejs/plugin-react": "^5.0.2",
142
- "@types/node": "^25.9.3",
143
190
  "@webgpu/types": "^0.1.70",
144
191
  "dotenv": "^17.2.3",
145
192
  "jsdom": "^30.0.1",
146
- "sharp": "^0.34.2",
193
+ "livekit-client": "^2.21.0",
147
194
  "react": "^19.1.1",
148
195
  "react-dom": "^19.1.1",
196
+ "sharp": "^0.34.2",
149
197
  "svelte": "^5.55.2",
150
198
  "svelte-check": "^4.7.4",
151
199
  "typescript": "^6.0.3",
@@ -1,7 +0,0 @@
1
- import type { SessionManifest } from './types/sessionManifest';
2
- /**
3
- * Strip avatar rendering and location scene assets from a Session Manifest.
4
- * Used when integrators request voice-only mode without authoring a separate experience.
5
- */
6
- export declare function applySpeechOnlyManifest(manifest: SessionManifest): SessionManifest;
7
- //# sourceMappingURL=speechOnlyManifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"speechOnlyManifest.d.ts","sourceRoot":"","sources":["../../../src/v2/speechOnlyManifest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAU/D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,eAAe,CAiBlF"}
@@ -1,183 +0,0 @@
1
- import { z } from 'zod';
2
- import type { SessionManifest } from './sessionManifest';
3
- export declare const sessionManifestSchema: z.ZodObject<{
4
- schemaVersion: z.ZodLiteral<1>;
5
- sessionId: z.ZodString;
6
- experienceId: z.ZodString;
7
- expiresAt: z.ZodString;
8
- sessionToken: z.ZodString;
9
- experience: z.ZodObject<{
10
- title: z.ZodString;
11
- slug: z.ZodString;
12
- mode: z.ZodEnum<{
13
- conversation: "conversation";
14
- presenter: "presenter";
15
- }>;
16
- responseMode: z.ZodEnum<{
17
- manual: "manual";
18
- managed: "managed";
19
- custom: "custom";
20
- }>;
21
- speechInputMode: z.ZodEnum<{
22
- auto: "auto";
23
- manual: "manual";
24
- off: "off";
25
- }>;
26
- startButton: z.ZodOptional<z.ZodObject<{
27
- label: z.ZodOptional<z.ZodString>;
28
- ariaLabel: z.ZodOptional<z.ZodString>;
29
- placement: z.ZodOptional<z.ZodEnum<{
30
- center: "center";
31
- "bottom-center": "bottom-center";
32
- "bottom-left": "bottom-left";
33
- "bottom-right": "bottom-right";
34
- }>>;
35
- variant: z.ZodOptional<z.ZodEnum<{
36
- primary: "primary";
37
- secondary: "secondary";
38
- minimal: "minimal";
39
- }>>;
40
- appearance: z.ZodOptional<z.ZodObject<{
41
- backgroundColor: z.ZodOptional<z.ZodString>;
42
- textColor: z.ZodOptional<z.ZodString>;
43
- borderColor: z.ZodOptional<z.ZodString>;
44
- borderRadiusPx: z.ZodOptional<z.ZodNumber>;
45
- size: z.ZodOptional<z.ZodEnum<{
46
- small: "small";
47
- medium: "medium";
48
- large: "large";
49
- }>>;
50
- shadow: z.ZodOptional<z.ZodEnum<{
51
- strong: "strong";
52
- none: "none";
53
- soft: "soft";
54
- }>>;
55
- }, z.core.$strip>>;
56
- }, z.core.$strip>>;
57
- openingMessage: z.ZodOptional<z.ZodString>;
58
- }, z.core.$strip>;
59
- transport: z.ZodObject<{
60
- type: z.ZodLiteral<"http">;
61
- config: z.ZodObject<{
62
- apiBaseUrl: z.ZodString;
63
- }, z.core.$strip>;
64
- }, z.core.$strip>;
65
- runtime: z.ZodObject<{
66
- cdnBaseUrl: z.ZodString;
67
- input: z.ZodLiteral<"browserStt">;
68
- renderer: z.ZodLiteral<"morph2d">;
69
- }, z.core.$strip>;
70
- pipeline: z.ZodOptional<z.ZodObject<{
71
- stt: z.ZodObject<{
72
- placement: z.ZodEnum<{
73
- browser: "browser";
74
- cloud: "cloud";
75
- }>;
76
- provider: z.ZodString;
77
- model: z.ZodOptional<z.ZodString>;
78
- config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
79
- }, z.core.$strip>;
80
- llm: z.ZodObject<{
81
- placement: z.ZodEnum<{
82
- browser: "browser";
83
- cloud: "cloud";
84
- }>;
85
- provider: z.ZodString;
86
- model: z.ZodOptional<z.ZodString>;
87
- config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
88
- }, z.core.$strip>;
89
- tts: z.ZodObject<{
90
- placement: z.ZodEnum<{
91
- browser: "browser";
92
- cloud: "cloud";
93
- }>;
94
- provider: z.ZodString;
95
- model: z.ZodOptional<z.ZodString>;
96
- config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
- }, z.core.$strip>;
98
- animation: z.ZodObject<{
99
- enabled: z.ZodBoolean;
100
- placement: z.ZodOptional<z.ZodEnum<{
101
- browser: "browser";
102
- cloud: "cloud";
103
- }>>;
104
- source: z.ZodEnum<{
105
- none: "none";
106
- azureViseme: "azureViseme";
107
- speechToAnimation: "speechToAnimation";
108
- }>;
109
- provider: z.ZodOptional<z.ZodString>;
110
- model: z.ZodOptional<z.ZodString>;
111
- config: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
112
- }, z.core.$strip>;
113
- }, z.core.$strip>>;
114
- capabilities: z.ZodArray<z.ZodString>;
115
- characters: z.ZodArray<z.ZodObject<{
116
- characterId: z.ZodString;
117
- displayName: z.ZodString;
118
- avatarId: z.ZodString;
119
- voiceId: z.ZodString;
120
- sttLang: z.ZodString;
121
- agentId: z.ZodString;
122
- appearance: z.ZodOptional<z.ZodObject<{
123
- costume: z.ZodOptional<z.ZodString>;
124
- costumeClothes: z.ZodOptional<z.ZodString>;
125
- hair: z.ZodOptional<z.ZodString>;
126
- }, z.core.$strip>>;
127
- }, z.core.$strip>>;
128
- activeCharacterId: z.ZodString;
129
- location: z.ZodOptional<z.ZodObject<{
130
- locationId: z.ZodString;
131
- title: z.ZodString;
132
- scene: z.ZodOptional<z.ZodObject<{
133
- type: z.ZodLiteral<"image">;
134
- layers: z.ZodArray<z.ZodString>;
135
- assets: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
136
- }, z.core.$strip>>;
137
- placement: z.ZodOptional<z.ZodObject<{
138
- cx: z.ZodNumber;
139
- cy: z.ZodNumber;
140
- scale: z.ZodNumber;
141
- distanceM: z.ZodNumber;
142
- }, z.core.$strip>>;
143
- metersPerDepth: z.ZodOptional<z.ZodNumber>;
144
- hasZoomVariant: z.ZodOptional<z.ZodBoolean>;
145
- }, z.core.$strip>>;
146
- world: z.ZodOptional<z.ZodObject<{
147
- worldId: z.ZodString;
148
- rulesetVersion: z.ZodNumber;
149
- }, z.core.$strip>>;
150
- state: z.ZodObject<{
151
- schemaVersion: z.ZodLiteral<1>;
152
- values: z.ZodRecord<z.ZodString, z.ZodUnknown>;
153
- }, z.core.$strip>;
154
- tools: z.ZodArray<z.ZodUnknown>;
155
- integration: z.ZodOptional<z.ZodObject<{
156
- returnUrl: z.ZodOptional<z.ZodString>;
157
- navigateOnClose: z.ZodOptional<z.ZodBoolean>;
158
- }, z.core.$strip>>;
159
- closeButton: z.ZodOptional<z.ZodNullable<z.ZodObject<{
160
- visible: z.ZodOptional<z.ZodBoolean>;
161
- style: z.ZodOptional<z.ZodEnum<{
162
- text: "text";
163
- icon: "icon";
164
- }>>;
165
- label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
166
- position: z.ZodOptional<z.ZodString>;
167
- }, z.core.$strip>>>;
168
- billing: z.ZodOptional<z.ZodObject<{
169
- payer: z.ZodLiteral<"creator">;
170
- meterId: z.ZodString;
171
- }, z.core.$strip>>;
172
- language: z.ZodOptional<z.ZodEnum<{
173
- en: "en";
174
- es: "es";
175
- }>>;
176
- languagePackRevision: z.ZodOptional<z.ZodString>;
177
- processorId: z.ZodOptional<z.ZodString>;
178
- }, z.core.$strip>;
179
- /** Apply API defaults for interaction modes omitted by older mint paths. */
180
- export declare function normalizeSessionManifestInput(data: unknown): unknown;
181
- export declare function parseSessionManifest(data: unknown): SessionManifest;
182
- export declare function manifestHasSessionCredential(manifest: SessionManifest): boolean;
183
- //# sourceMappingURL=sessionManifestSchema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sessionManifestSchema.d.ts","sourceRoot":"","sources":["../../../../src/v2/types/sessionManifestSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AA0FzD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwEhC,CAAC;AAEH,4EAA4E;AAC5E,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAgBpE;AAWD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,GAAG,eAAe,CAMnE;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAE/E"}
@@ -1,7 +0,0 @@
1
- import type { SessionManifest } from './types/sessionManifest';
2
- /**
3
- * Strip avatar rendering and location scene assets from a Session Manifest.
4
- * Used when integrators request voice-only mode without authoring a separate experience.
5
- */
6
- export declare function applySpeechOnlyManifest(manifest: SessionManifest): SessionManifest;
7
- //# sourceMappingURL=speechOnlyManifest.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"speechOnlyManifest.d.ts","sourceRoot":"","sources":["../../../src/v2/speechOnlyManifest.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAU/D;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,eAAe,CAiBlF"}