@liforma/client 0.4.5 → 0.4.8

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 (72) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +23 -0
  3. package/dist/next/index.js +23 -4
  4. package/dist/next/index.js.map +1 -1
  5. package/dist/next/next/thumbnail.d.ts +5 -0
  6. package/dist/next/next/thumbnail.d.ts.map +1 -0
  7. package/dist/next/react/thumbnail.d.ts +4 -0
  8. package/dist/next/react/thumbnail.d.ts.map +1 -0
  9. package/dist/next/thumbnail.js +396 -0
  10. package/dist/next/thumbnail.js.map +1 -0
  11. package/dist/next/v2/embed/iframeHost.d.ts +3 -1
  12. package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
  13. package/dist/next/v2/embed/protocol.d.ts +10 -1
  14. package/dist/next/v2/embed/protocol.d.ts.map +1 -1
  15. package/dist/next/v2/experience.d.ts +10 -2
  16. package/dist/next/v2/experience.d.ts.map +1 -1
  17. package/dist/next/v2/experienceEvents.d.ts +2 -0
  18. package/dist/next/v2/experienceEvents.d.ts.map +1 -1
  19. package/dist/next/v2/types/sessionInteraction.d.ts +30 -0
  20. package/dist/next/v2/types/sessionInteraction.d.ts.map +1 -1
  21. package/dist/npm/index.js +23 -4
  22. package/dist/npm/index.js.map +1 -1
  23. package/dist/npm/thumbnail/index.js +231 -0
  24. package/dist/npm/thumbnail/index.js.map +1 -0
  25. package/dist/npm/v2/embed/iframeHost.d.ts +3 -1
  26. package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
  27. package/dist/npm/v2/embed/protocol.d.ts +10 -1
  28. package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
  29. package/dist/npm/v2/experience.d.ts +10 -2
  30. package/dist/npm/v2/experience.d.ts.map +1 -1
  31. package/dist/npm/v2/experienceEvents.d.ts +2 -0
  32. package/dist/npm/v2/experienceEvents.d.ts.map +1 -1
  33. package/dist/npm/v2/index.d.ts +1 -1
  34. package/dist/npm/v2/index.d.ts.map +1 -1
  35. package/dist/npm/v2/npm.d.ts +1 -1
  36. package/dist/npm/v2/npm.d.ts.map +1 -1
  37. package/dist/npm/v2/thumbnail-cdn.d.ts +17 -0
  38. package/dist/npm/v2/thumbnail-cdn.d.ts.map +1 -0
  39. package/dist/npm/v2/types/sessionInteraction.d.ts +30 -0
  40. package/dist/npm/v2/types/sessionInteraction.d.ts.map +1 -1
  41. package/dist/react/component/experienceComponentRuntime.d.ts +1 -0
  42. package/dist/react/component/experienceComponentRuntime.d.ts.map +1 -1
  43. package/dist/react/component/experienceComponentTypes.d.ts +8 -0
  44. package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
  45. package/dist/react/index.js +119 -96
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/react/Experience.d.ts.map +1 -1
  48. package/dist/react/react/thumbnail.d.ts +4 -0
  49. package/dist/react/react/thumbnail.d.ts.map +1 -0
  50. package/dist/react/thumbnail.js +396 -0
  51. package/dist/react/thumbnail.js.map +1 -0
  52. package/dist/react/v2/embed/iframeHost.d.ts +3 -1
  53. package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
  54. package/dist/react/v2/embed/protocol.d.ts +10 -1
  55. package/dist/react/v2/embed/protocol.d.ts.map +1 -1
  56. package/dist/react/v2/experience.d.ts +10 -2
  57. package/dist/react/v2/experience.d.ts.map +1 -1
  58. package/dist/react/v2/experienceEvents.d.ts +2 -0
  59. package/dist/react/v2/experienceEvents.d.ts.map +1 -1
  60. package/dist/react/v2/types/sessionInteraction.d.ts +30 -0
  61. package/dist/react/v2/types/sessionInteraction.d.ts.map +1 -1
  62. package/dist/sdk/v2/client.js +3 -810
  63. package/dist/sdk/v2/client.js.map +1 -1
  64. package/dist/sdk/v2/thumbnail.js +222 -0
  65. package/dist/sdk/v2/thumbnail.js.map +1 -0
  66. package/dist/svelte/Experience.svelte +11 -0
  67. package/dist/svelte/Experience.svelte.d.ts +1 -0
  68. package/dist/svelte/ExperienceThumbnail.svelte +1 -1
  69. package/dist/svelte/ExperienceThumbnail.svelte.d.ts +1 -1
  70. package/dist/svelte/thumbnail.d.ts +2 -0
  71. package/dist/svelte/thumbnail.js +1 -0
  72. package/package.json +24 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # @liforma/client changelog
2
2
 
3
+ ## 0.4.8 — 2026-08-30
4
+
5
+ ### Added
6
+
7
+ - `@liforma/client/react/thumbnail` and `@liforma/client/next/thumbnail` — gallery components without session / widget code
8
+ - CDN `https://cdn.liforma.ai/sdk/v2/thumbnail.js` — registers `<liforma-experience-thumbnail>` only
9
+
10
+ ### Changed
11
+
12
+ - Package `"sideEffects": false` so bundlers can drop unused barrel exports
13
+ - Docs / snippets default gallery imports to the light thumbnail entries
14
+ - Verify scripts fail if light thumbnail builds contain session SDK markers
15
+
16
+ ## 0.4.7 — 2026-08-30
17
+
18
+ ### Added
19
+
20
+ - `@liforma/client/thumbnail` — thumbnail helpers without the session player
21
+ - `@liforma/client/svelte/thumbnail` — `<ExperienceThumbnail>` without pulling `<Experience>` / widget
22
+
23
+ ### Notes
24
+
25
+ - Gallery hosts should import the thumbnail entry so marketing pages do not hydrate the session SDK
26
+
27
+ ## 0.4.6 — 2026-08-30
28
+
29
+ ### Added
30
+
31
+ - `theme` on `attach` / `<Experience>` for global player chrome tokens (introduction, feedback, panels, shared buttons)
32
+ - Exported types: `PlayerTheme`, `PlayerThemeColors`, `PlayerThemeTypography`, `PlayerThemeButton`
33
+
34
+ ### Notes
35
+
36
+ - Distinct from `startButton` — CTA appearance overrides still win on the start control
37
+ - Presentation only; does not remint
38
+
3
39
  ## 0.4.5 — 2026-08-30
4
40
 
5
41
  ### Added
package/README.md CHANGED
@@ -30,6 +30,24 @@ Optional peers: `svelte` ^5 for the Svelte entry; `react` / `react-dom` ^18 or ^
30
30
  <Experience experienceId="exp_01EXAMPLES_COFFEE_BARISTA" />
31
31
  ```
32
32
 
33
+ Gallery cards — use the light thumbnail entry so landing pages do not load the session SDK:
34
+
35
+ ```svelte
36
+ <script>
37
+ import { ExperienceThumbnail } from '@liforma/client/svelte/thumbnail';
38
+ </script>
39
+ ```
40
+
41
+ ```tsx
42
+ import { ExperienceThumbnail } from '@liforma/client/react/thumbnail';
43
+ // or: import { ExperienceThumbnail } from '@liforma/client/next/thumbnail';
44
+ ```
45
+
46
+ ```html
47
+ <script src="https://cdn.liforma.ai/sdk/v2/thumbnail.js" defer></script>
48
+ <liforma-experience-thumbnail experience-id="exp_…" alt="…"></liforma-experience-thumbnail>
49
+ ```
50
+
33
51
  ### React
34
52
 
35
53
  ```tsx
@@ -79,8 +97,12 @@ export function Demo() {
79
97
  |--------|---------|
80
98
  | `@liforma/client` | JS API (`Experience.startSession`, types) |
81
99
  | `@liforma/client/svelte` | `<Experience />`, `<ExperienceThumbnail />`, `<ExperienceWidget />` |
100
+ | `@liforma/client/svelte/thumbnail` | `<ExperienceThumbnail />` only (prefer for galleries) |
101
+ | `@liforma/client/thumbnail` | Shared thumbnail helpers (no session player) |
82
102
  | `@liforma/client/react` | React components |
103
+ | `@liforma/client/react/thumbnail` | `<ExperienceThumbnail />` only (prefer for galleries) |
83
104
  | `@liforma/client/next` | Next helpers + client components |
105
+ | `@liforma/client/next/thumbnail` | `<ExperienceThumbnail />` only (prefer for galleries) |
84
106
  | `@liforma/client/byo` | Shared BYO primitives (PCM/mic/turn helpers) |
85
107
  | `@liforma/client/elevenlabs` | `connectElevenLabsAgent` (BYO ElevenLabs Agents → avatar) |
86
108
  | `@liforma/client/openai` | `connectOpenAiRealtime` / `connectOpenAiRealtimeWebRtc` (BYO OpenAI Realtime → avatar) |
@@ -88,6 +110,7 @@ export function Demo() {
88
110
  | `@liforma/client/google` | `connectGeminiLive` (BYO Gemini Live → avatar) |
89
111
  | `@liforma/client/livekit` | `connectLiveKitAgent` (BYO LiveKit remote track → avatar) |
90
112
  | CDN `sdk/v2/client.js` | Web components + `window.Liforma` |
113
+ | CDN `sdk/v2/thumbnail.js` | `<liforma-experience-thumbnail>` only |
91
114
 
92
115
  ## Session minting
93
116
 
@@ -972,7 +972,7 @@ function tt(e) {
972
972
  function nt(e, t, n) {
973
973
  let r = e.trim();
974
974
  if (!r) throw Error("createLaunchMessage requires a non-empty launch string.");
975
- let i = n?.startButton, a = n?.showFeedback;
975
+ let i = n?.startButton, a = n?.theme, o = n?.showFeedback;
976
976
  return {
977
977
  type: "launch",
978
978
  schemaVersion: 2,
@@ -980,7 +980,8 @@ function nt(e, t, n) {
980
980
  launch: r,
981
981
  ...t === void 0 ? {} : { session: t },
982
982
  ...i ? { startButton: i } : {},
983
- ...a === void 0 ? {} : { showFeedback: a }
983
+ ...a ? { theme: a } : {},
984
+ ...o === void 0 ? {} : { showFeedback: o }
984
985
  }
985
986
  };
986
987
  }
@@ -1423,6 +1424,13 @@ function ft(e) {
1423
1424
  }
1424
1425
  });
1425
1426
  },
1427
+ engage() {
1428
+ return C({
1429
+ type: "engage",
1430
+ schemaVersion: 2,
1431
+ payload: { correlationId: Z() }
1432
+ });
1433
+ },
1426
1434
  destroy() {
1427
1435
  if (!r) {
1428
1436
  r = !0, i && s(!1);
@@ -1496,6 +1504,7 @@ function wt() {
1496
1504
  return {
1497
1505
  ready: /* @__PURE__ */ new Set(),
1498
1506
  started: /* @__PURE__ */ new Set(),
1507
+ sessionMinted: /* @__PURE__ */ new Set(),
1499
1508
  userTranscript: /* @__PURE__ */ new Set(),
1500
1509
  userSpeechStarted: /* @__PURE__ */ new Set(),
1501
1510
  userSpeechEnded: /* @__PURE__ */ new Set(),
@@ -2172,6 +2181,7 @@ var un = class e {
2172
2181
  eventRegistry = wt();
2173
2182
  readyEnvelope = null;
2174
2183
  startedEnvelope = null;
2184
+ sessionMintedEnvelope = null;
2175
2185
  conversationCache = [];
2176
2186
  speech;
2177
2187
  constructor(e) {
@@ -2260,7 +2270,7 @@ var un = class e {
2260
2270
  }
2261
2271
  on(e, t) {
2262
2272
  let n = Tt(this.eventRegistry, e, t);
2263
- return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), n;
2273
+ return e === "ready" && this.readyEnvelope && queueMicrotask(() => t(this.readyEnvelope)), e === "started" && this.startedEnvelope && queueMicrotask(() => t(this.startedEnvelope)), e === "sessionMinted" && this.sessionMintedEnvelope && queueMicrotask(() => t(this.sessionMintedEnvelope)), n;
2264
2274
  }
2265
2275
  async attach(e) {
2266
2276
  if (this.closed) throw Error("Session has ended.");
@@ -2376,11 +2386,15 @@ var un = class e {
2376
2386
  f.postParentHello();
2377
2387
  let g = h?.launch ?? (this.bootstrap.kind === "launch" ? this.bootstrap.launch : null), _ = h?.session ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
2378
2388
  if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
2379
- return this.launchToken = g, _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && Fe(_), f.postLaunch(g, _, {
2389
+ this.launchToken = g;
2390
+ let v = _ ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
2391
+ return v && !this.sessionMintedEnvelope && (this.resolvedSession = v, this.sessionMintedEnvelope = this.emitWrapped("sessionMinted", { session: v })), _ ? (this.resolvedSession = _, this.bootstrap.kind === "launch" && Fe(_), f.postLaunch(g, _, {
2380
2392
  startButton: e.startButton,
2393
+ theme: e.theme,
2381
2394
  showFeedback: e.showFeedback
2382
2395
  }), u.setValue(_)) : f.postLaunch(g, void 0, {
2383
2396
  startButton: e.startButton,
2397
+ theme: e.theme,
2384
2398
  showFeedback: e.showFeedback
2385
2399
  }), await Promise.race([s, new Promise((e, t) => {
2386
2400
  setTimeout(() => t(/* @__PURE__ */ Error("Timed out waiting for player loading UI.")), 12e4);
@@ -2420,6 +2434,11 @@ var un = class e {
2420
2434
  if (!this.iframeHost) throw Error("conversion() requires attach() first.");
2421
2435
  await this.iframeHost.conversion(e);
2422
2436
  }
2437
+ async engage() {
2438
+ if (this.closed) throw Error("Session has ended.");
2439
+ if (!this.iframeHost) throw Error("engage() requires attach() first.");
2440
+ await this.iframeHost.engage();
2441
+ }
2423
2442
  getLastTurn() {
2424
2443
  if (this.conversationCache.length === 0) return [];
2425
2444
  let e = this.conversationCache[this.conversationCache.length - 1].turnId;