@liforma/client 0.4.6 → 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.
- package/CHANGELOG.md +24 -0
- package/README.md +23 -0
- package/dist/next/index.js +18 -2
- package/dist/next/index.js.map +1 -1
- package/dist/next/next/thumbnail.d.ts +5 -0
- package/dist/next/next/thumbnail.d.ts.map +1 -0
- package/dist/next/react/thumbnail.d.ts +4 -0
- package/dist/next/react/thumbnail.d.ts.map +1 -0
- package/dist/next/thumbnail.js +396 -0
- package/dist/next/thumbnail.js.map +1 -0
- package/dist/next/v2/embed/iframeHost.d.ts +1 -0
- package/dist/next/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/next/v2/embed/protocol.d.ts +6 -0
- package/dist/next/v2/embed/protocol.d.ts.map +1 -1
- package/dist/next/v2/experience.d.ts +3 -0
- package/dist/next/v2/experience.d.ts.map +1 -1
- package/dist/next/v2/experienceEvents.d.ts +2 -0
- package/dist/next/v2/experienceEvents.d.ts.map +1 -1
- package/dist/npm/index.js +18 -2
- package/dist/npm/index.js.map +1 -1
- package/dist/npm/thumbnail/index.js +231 -0
- package/dist/npm/thumbnail/index.js.map +1 -0
- package/dist/npm/v2/embed/iframeHost.d.ts +1 -0
- package/dist/npm/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/npm/v2/embed/protocol.d.ts +6 -0
- package/dist/npm/v2/embed/protocol.d.ts.map +1 -1
- package/dist/npm/v2/experience.d.ts +3 -0
- package/dist/npm/v2/experience.d.ts.map +1 -1
- package/dist/npm/v2/experienceEvents.d.ts +2 -0
- package/dist/npm/v2/experienceEvents.d.ts.map +1 -1
- package/dist/npm/v2/thumbnail-cdn.d.ts +17 -0
- package/dist/npm/v2/thumbnail-cdn.d.ts.map +1 -0
- package/dist/react/component/experienceComponentTypes.d.ts +3 -0
- package/dist/react/component/experienceComponentTypes.d.ts.map +1 -1
- package/dist/react/index.js +19 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react/react/Experience.d.ts.map +1 -1
- package/dist/react/react/thumbnail.d.ts +4 -0
- package/dist/react/react/thumbnail.d.ts.map +1 -0
- package/dist/react/thumbnail.js +396 -0
- package/dist/react/thumbnail.js.map +1 -0
- package/dist/react/v2/embed/iframeHost.d.ts +1 -0
- package/dist/react/v2/embed/iframeHost.d.ts.map +1 -1
- package/dist/react/v2/embed/protocol.d.ts +6 -0
- package/dist/react/v2/embed/protocol.d.ts.map +1 -1
- package/dist/react/v2/experience.d.ts +3 -0
- package/dist/react/v2/experience.d.ts.map +1 -1
- package/dist/react/v2/experienceEvents.d.ts +2 -0
- package/dist/react/v2/experienceEvents.d.ts.map +1 -1
- package/dist/sdk/v2/client.js +3 -810
- package/dist/sdk/v2/client.js.map +1 -1
- package/dist/sdk/v2/thumbnail.js +222 -0
- package/dist/sdk/v2/thumbnail.js.map +1 -0
- package/dist/svelte/Experience.svelte +9 -0
- package/dist/svelte/Experience.svelte.d.ts +1 -0
- package/dist/svelte/ExperienceThumbnail.svelte +1 -1
- package/dist/svelte/ExperienceThumbnail.svelte.d.ts +1 -1
- package/dist/svelte/thumbnail.d.ts +2 -0
- package/dist/svelte/thumbnail.js +1 -0
- package/package.json +24 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
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
|
+
|
|
3
27
|
## 0.4.6 — 2026-08-30
|
|
4
28
|
|
|
5
29
|
### 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
|
|
package/dist/next/index.js
CHANGED
|
@@ -1424,6 +1424,13 @@ function ft(e) {
|
|
|
1424
1424
|
}
|
|
1425
1425
|
});
|
|
1426
1426
|
},
|
|
1427
|
+
engage() {
|
|
1428
|
+
return C({
|
|
1429
|
+
type: "engage",
|
|
1430
|
+
schemaVersion: 2,
|
|
1431
|
+
payload: { correlationId: Z() }
|
|
1432
|
+
});
|
|
1433
|
+
},
|
|
1427
1434
|
destroy() {
|
|
1428
1435
|
if (!r) {
|
|
1429
1436
|
r = !0, i && s(!1);
|
|
@@ -1497,6 +1504,7 @@ function wt() {
|
|
|
1497
1504
|
return {
|
|
1498
1505
|
ready: /* @__PURE__ */ new Set(),
|
|
1499
1506
|
started: /* @__PURE__ */ new Set(),
|
|
1507
|
+
sessionMinted: /* @__PURE__ */ new Set(),
|
|
1500
1508
|
userTranscript: /* @__PURE__ */ new Set(),
|
|
1501
1509
|
userSpeechStarted: /* @__PURE__ */ new Set(),
|
|
1502
1510
|
userSpeechEnded: /* @__PURE__ */ new Set(),
|
|
@@ -2173,6 +2181,7 @@ var un = class e {
|
|
|
2173
2181
|
eventRegistry = wt();
|
|
2174
2182
|
readyEnvelope = null;
|
|
2175
2183
|
startedEnvelope = null;
|
|
2184
|
+
sessionMintedEnvelope = null;
|
|
2176
2185
|
conversationCache = [];
|
|
2177
2186
|
speech;
|
|
2178
2187
|
constructor(e) {
|
|
@@ -2261,7 +2270,7 @@ var un = class e {
|
|
|
2261
2270
|
}
|
|
2262
2271
|
on(e, t) {
|
|
2263
2272
|
let n = Tt(this.eventRegistry, e, t);
|
|
2264
|
-
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;
|
|
2265
2274
|
}
|
|
2266
2275
|
async attach(e) {
|
|
2267
2276
|
if (this.closed) throw Error("Session has ended.");
|
|
@@ -2377,7 +2386,9 @@ var un = class e {
|
|
|
2377
2386
|
f.postParentHello();
|
|
2378
2387
|
let g = h?.launch ?? (this.bootstrap.kind === "launch" ? this.bootstrap.launch : null), _ = h?.session ?? (this.bootstrap.kind === "launch" ? this.bootstrap.session : void 0);
|
|
2379
2388
|
if (!g) throw f.destroy(), this.iframeHost === f && (this.iframeHost = null), Error("Session Launch response did not include a launch token.");
|
|
2380
|
-
|
|
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, _, {
|
|
2381
2392
|
startButton: e.startButton,
|
|
2382
2393
|
theme: e.theme,
|
|
2383
2394
|
showFeedback: e.showFeedback
|
|
@@ -2423,6 +2434,11 @@ var un = class e {
|
|
|
2423
2434
|
if (!this.iframeHost) throw Error("conversion() requires attach() first.");
|
|
2424
2435
|
await this.iframeHost.conversion(e);
|
|
2425
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
|
+
}
|
|
2426
2442
|
getLastTurn() {
|
|
2427
2443
|
if (this.conversationCache.length === 0) return [];
|
|
2428
2444
|
let e = this.conversationCache[this.conversationCache.length - 1].turnId;
|