@convai/web-sdk 1.8.0-beta.6 → 1.8.0-beta.7

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 (86) hide show
  1. package/README.md +285 -1
  2. package/dist/core/ConvaiClient.d.ts +59 -2
  3. package/dist/core/ConvaiClient.d.ts.map +1 -1
  4. package/dist/core/ConvaiClient.js +457 -6
  5. package/dist/core/ConvaiClient.js.map +1 -1
  6. package/dist/core/MessageHandler.d.ts +11 -0
  7. package/dist/core/MessageHandler.d.ts.map +1 -1
  8. package/dist/core/MessageHandler.js +325 -30
  9. package/dist/core/MessageHandler.js.map +1 -1
  10. package/dist/core/SSESession.js +2 -2
  11. package/dist/core/SSESession.js.map +1 -1
  12. package/dist/core/connectRequest.d.ts +38 -3
  13. package/dist/core/connectRequest.d.ts.map +1 -1
  14. package/dist/core/connectRequest.js +57 -11
  15. package/dist/core/connectRequest.js.map +1 -1
  16. package/dist/core/index.d.ts +3 -1
  17. package/dist/core/index.d.ts.map +1 -1
  18. package/dist/core/index.js +2 -1
  19. package/dist/core/index.js.map +1 -1
  20. package/dist/core/logicalTurn.d.ts +4 -1
  21. package/dist/core/logicalTurn.d.ts.map +1 -1
  22. package/dist/core/logicalTurn.js +35 -4
  23. package/dist/core/logicalTurn.js.map +1 -1
  24. package/dist/core/modelOutput.d.ts +40 -0
  25. package/dist/core/modelOutput.d.ts.map +1 -0
  26. package/dist/core/modelOutput.js +187 -0
  27. package/dist/core/modelOutput.js.map +1 -0
  28. package/dist/core/publishedChat.d.ts +9 -0
  29. package/dist/core/publishedChat.d.ts.map +1 -0
  30. package/dist/core/publishedChat.js +13 -0
  31. package/dist/core/publishedChat.js.map +1 -0
  32. package/dist/core/types.d.ts +225 -25
  33. package/dist/core/types.d.ts.map +1 -1
  34. package/dist/core/types.js.map +1 -1
  35. package/dist/embed/ConvaiChatElement.d.ts +27 -0
  36. package/dist/embed/ConvaiChatElement.d.ts.map +1 -0
  37. package/dist/embed/ConvaiChatElement.js +300 -0
  38. package/dist/embed/ConvaiChatElement.js.map +1 -0
  39. package/dist/embed/browser.d.ts +3 -0
  40. package/dist/embed/browser.d.ts.map +1 -0
  41. package/dist/embed/browser.js +5 -0
  42. package/dist/embed/browser.js.map +1 -0
  43. package/dist/embed/chat-embed-v1.js +100 -0
  44. package/dist/embed/chat-embed-v1.js.map +7 -0
  45. package/dist/embed/index.d.ts +9 -0
  46. package/dist/embed/index.d.ts.map +1 -0
  47. package/dist/embed/index.js +9 -0
  48. package/dist/embed/index.js.map +1 -0
  49. package/dist/embed/publicationApi.d.ts +23 -0
  50. package/dist/embed/publicationApi.d.ts.map +1 -0
  51. package/dist/embed/publicationApi.js +141 -0
  52. package/dist/embed/publicationApi.js.map +1 -0
  53. package/dist/react/components/ConvaiWidget.d.ts +11 -1
  54. package/dist/react/components/ConvaiWidget.d.ts.map +1 -1
  55. package/dist/react/components/ConvaiWidget.js +67 -11
  56. package/dist/react/components/ConvaiWidget.js.map +1 -1
  57. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts +1 -1
  58. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +1 -1
  59. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +2 -2
  60. package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +1 -1
  61. package/dist/react/hooks/useConvaiClient.d.ts +2 -0
  62. package/dist/react/hooks/useConvaiClient.d.ts.map +1 -1
  63. package/dist/react/hooks/useConvaiClient.js +8 -0
  64. package/dist/react/hooks/useConvaiClient.js.map +1 -1
  65. package/dist/react/index.d.ts +1 -1
  66. package/dist/react/index.d.ts.map +1 -1
  67. package/dist/react/index.js +1 -1
  68. package/dist/react/index.js.map +1 -1
  69. package/dist/vanilla/ConvaiWidget.d.ts.map +1 -1
  70. package/dist/vanilla/ConvaiWidget.js +153 -32
  71. package/dist/vanilla/ConvaiWidget.js.map +1 -1
  72. package/dist/vanilla/WidgetEventSubscriptions.d.ts +15 -0
  73. package/dist/vanilla/WidgetEventSubscriptions.d.ts.map +1 -0
  74. package/dist/vanilla/WidgetEventSubscriptions.js +37 -0
  75. package/dist/vanilla/WidgetEventSubscriptions.js.map +1 -0
  76. package/dist/vanilla/index.d.ts +1 -1
  77. package/dist/vanilla/index.d.ts.map +1 -1
  78. package/dist/vanilla/index.js +1 -1
  79. package/dist/vanilla/index.js.map +1 -1
  80. package/dist/vanilla/types.d.ts +8 -1
  81. package/dist/vanilla/types.d.ts.map +1 -1
  82. package/dist/vanilla/types.js.map +1 -1
  83. package/dist/version.d.ts +1 -1
  84. package/dist/version.js +1 -1
  85. package/dist/version.js.map +1 -1
  86. package/package.json +19 -6
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Real-time conversational AI characters for the web.**
4
4
 
5
- [![npm](https://img.shields.io/badge/npm-1.8.0--beta.5-blue)](https://www.npmjs.com/package/@convai/web-sdk)
5
+ [![npm](https://img.shields.io/badge/npm-1.8.0--beta.7-blue)](https://www.npmjs.com/package/@convai/web-sdk)
6
6
  [![TypeScript](https://img.shields.io/badge/TypeScript-first-3178C6)](https://www.typescriptlang.org/)
7
7
  [![License](https://img.shields.io/badge/license-Apache--2.0-green)](./LICENSE)
8
8
 
@@ -14,6 +14,11 @@ TypeScript-first SDK for embedding Convai AI characters into React and vanilla J
14
14
 
15
15
  Install the beta with `npm install @convai/web-sdk@beta`.
16
16
 
17
+ - **Multi-character rooms** — connect a roster of characters with the `characters` config option (two copies of one character are two independent members), switch who answers with `setInteractionTarget()`, add or remove members live with `updateCharacterRoster()`, and let other participants join the same room with `joinRoom()`. Every transcript line, audio track and readiness event is attributed to a `membershipId`. [Usage below.](#multi-character-rooms-beta)
18
+ - **Agentic actions and canonical model output (v2)** — opt in with `capabilities`, declare client-executed tools in `actionConfig.tools`, consume typed `modelOutput` envelopes, return results with `sendActionResultAndWait()` for a correlated server acknowledgement, and read the raw provider stream through `botLlmTextRaw`. `visionPromptMode: "disabled"` keeps scene context without advertising visual perception. [Usage below.](#agentic-actions-and-canonical-model-output-v2)
19
+ - **Published text chat** — a credential-free, text-only connection for public chat pages: `connectWithPublicationGrant()`, `connectionType: "text"`, and the self-contained `<convai-chat>` browser bundle. [Usage below.](#published-text-chat)
20
+ - **Typed events** — `client.on(event, callback)` infers each callback's payload from the exported `ConvaiEventMap`, so `botReady`, `modelOutput`, `characterStatus` and the rest are checked at compile time. See the [events reference](docs/convai_events.md).
21
+ - **Local transcript lines and usage updates** — `appendMessage()` inserts a line into the transcript without sending anything, and `toggleUsageUpdates(true)` opts into per-turn `usageUpdate` cost breakdowns.
17
22
  - **Character versioning** — connect to a character's editable draft, its promoted latest release, or an immutable tag with the `characterVersion` config option, and list, compare, release, promote, fork and discard versions through `client.characterVersions`. [Usage below.](#character-versioning-beta)
18
23
  - **SSE interaction transport** — text-only streamed interactions through the interaction API, selected by `interactionApiUrl`; the one transport that runs under Node. [Usage below.](#sse-interaction-transport-beta)
19
24
  - **Embeddable vanilla widget** — the vanilla widget runs inside a shadow root, with a character header and a connecting overlay, so it can be dropped into any page.
@@ -43,6 +48,10 @@ Install the beta with `npm install @convai/web-sdk@beta`.
43
48
  - **Dynamic context & vision** — inject text state, scene metadata, and LiveKit video frames mid-session
44
49
  - **Actions & Narrative Design** — typed action decisions with parameterized targets, named triggers, and per-session template keys
45
50
  - **Long-term memory** — persistent cross-session memories scoped to each end user
51
+ - **Multi-character rooms** — a roster of characters in one room, per-member attribution, live roster changes
52
+ - **Agentic actions (v2)** — client-executed tools, canonical model output, acknowledged action results, raw provider stream
53
+ - **Published text chat** — grant-based, credential-free text sessions and a drop-in `<convai-chat>` element
54
+ - **Typed events** — every `client.on` payload typed through `ConvaiEventMap`
46
55
  - **Character versioning** — connect to a draft, latest, or tagged version, and manage releases from the client
47
56
  - **File upload** — send images to the character during a live session
48
57
  - **WebSocket transport** — opt-in alternative to WebRTC for constrained networks
@@ -101,6 +110,114 @@ window.addEventListener("beforeunload", () => {
101
110
  });
102
111
  ```
103
112
 
113
+ ### Published text chat
114
+
115
+ See the [Published text chat guide](./docs/convai_published_chat.md) for
116
+ React and vanilla integrations, lifecycle behavior, and the complete API
117
+ reference.
118
+
119
+ Published chat pages use a short-lived launch grant instead of the publisher's
120
+ API key. Native Web SDK integration is the recommended embed path; an iframe is
121
+ not required. Obtain the grant from the public Character API and pass it to the
122
+ core client:
123
+
124
+ ```ts
125
+ import { ConvaiClient } from '@convai/web-sdk/core';
126
+ import { requestPublishedChatGrant } from '@convai/web-sdk/embed';
127
+
128
+ const launchToken = await requestPublishedChatGrant(
129
+ `${characterApiUrl}/chat-publications/${publicationId}/launch-grants`,
130
+ );
131
+ const client = new ConvaiClient();
132
+ const unsubscribe = client.on('botReady', () => {
133
+ unsubscribe();
134
+ client.sendUserTextMessage('Hello!');
135
+ });
136
+ await client.connectWithPublicationGrant(launchToken);
137
+ ```
138
+
139
+ The grant is single-use and is not retained for reconnect. Request a new grant
140
+ for each new session. The SDK attaches a browser-generated logical attempt ID
141
+ and retries one transient grant exchange with that same ID, so a response lost
142
+ after server-side consumption does not strand the token or create a duplicate
143
+ session. An application performing its own retry may pass the same
144
+ `connectAttemptId` option with the same launch token. Published chat is
145
+ text-only; the server-issued room token does not permit publishing microphone
146
+ or camera tracks.
147
+
148
+ The `@convai/web-sdk/embed` browser element creates its own per-browser
149
+ requester identifier. If a server or SSR integration calls its published-chat
150
+ grant helpers directly, it must pass a caller-scoped requester identifier; do
151
+ not reuse a process-wide identifier across visitors.
152
+
153
+ When using `ConvaiWidget`, provide `requestPublicationGrant` so Reset,
154
+ Disconnect, and later reopen operations mint a new grant instead of attempting
155
+ to reuse the consumed token:
156
+
157
+ ```tsx
158
+ <ConvaiWidget
159
+ convaiClient={client}
160
+ publishedChatDescriptor={{
161
+ display_name: publication.display_name,
162
+ image_url: publication.image_url,
163
+ }}
164
+ requestPublicationGrant={async () => {
165
+ const response = await fetch(`/api/chat/${publicationId}/grant`, {
166
+ method: 'POST',
167
+ });
168
+ if (!response.ok) throw new Error('Unable to relaunch published chat');
169
+ return (await response.json()).launch_token;
170
+ }}
171
+ />
172
+ ```
173
+
174
+ For copy/paste installation without an application build step, deploy the
175
+ versioned browser artifact at `dist/embed/chat-embed-v1.js` and use its native
176
+ custom element:
177
+
178
+ ```html
179
+ <script
180
+ type="module"
181
+ src="https://cdn.jsdelivr.net/npm/@convai/web-sdk@<SDK_VERSION>/dist/embed/chat-embed-v1.js"
182
+ ></script>
183
+ <convai-chat publication-id="PUBLICATION_UUID"></convai-chat>
184
+ ```
185
+
186
+ The element renders directly in the host page with Shadow DOM style isolation,
187
+ automatically mints a fresh grant per connection, and emits `convai-ready`,
188
+ `convai-disconnect`, and `convai-error` DOM events. The production bundle uses
189
+ `https://api.convai.com` and `https://realtime-api.convai.com` only as defaults
190
+ for a hand-written SaaS integration. Platform-generated snippets always emit
191
+ the deployment's public Character API and Core endpoints explicitly, so an
192
+ on-prem or non-production embed never falls through to another deployment and
193
+ still requires no credential:
194
+
195
+ ```html
196
+ <convai-chat
197
+ publication-id="PUBLICATION_UUID"
198
+ publication-api-url="https://character-api.example.com"
199
+ core-url="https://realtime.example.com"
200
+ ></convai-chat>
201
+ ```
202
+
203
+ Replace `<SDK_VERSION>` with the exact published package version. Do not use
204
+ `latest`: generated embed snippets must stay bound to the SDK version validated
205
+ for their target environment.
206
+
207
+ Descriptor and grant endpoints must allow credential-free cross-origin `GET`
208
+ and `POST` requests. The embed never receives a publisher API key, character
209
+ configuration, or reusable launch token.
210
+
211
+ For customer-managed and GovCloud deployments, the repository also builds a
212
+ browser-only image from `deploy/published-chat/Dockerfile`. It serves the exact
213
+ released bundle at `/sdk/chat-embed-v1.js` on port `8080`, plus `/healthz`, and
214
+ contains no API key or cloud identity. The manual `build-onprem` workflow
215
+ requires an immutable semver tag matching `package.json`, refuses to overwrite
216
+ an existing Docker Hub tag, and publishes both amd64 and arm64 images. Pin the
217
+ resulting digest in the deployment repository; do not make an on-prem browser
218
+ depend on jsDelivr, npm availability, GCP workload identity, or the Experience
219
+ application image.
220
+
104
221
  ---
105
222
 
106
223
  ## Documentation
@@ -125,6 +242,9 @@ Full documentation is at **<a href="https://docs.convai.com/api-docs/plugins-and
125
242
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk/websocket-transport-layer" target="_blank" rel="noopener noreferrer">WebSocket Transport</a> | Alternative transport for WebRTC-constrained environments |
126
243
  | <a href="https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/convai-web-sdk" target="_blank" rel="noopener noreferrer">SSE Transport</a> | Text-only interaction transport; the one that runs under Node |
127
244
  | [Character Versioning](docs/convai_character_versioning.md) | Connect to a draft, latest, or tagged version; list, compare, release and promote versions |
245
+ | [Multi-Character Rooms](docs/convai_multi_character.md) | Rosters, `joinRoom`, interaction targets, live roster updates, per-member attribution |
246
+ | [Published Text Chat](docs/convai_published_chat.md) | Grant-based text-only sessions, `<convai-chat>`, lifecycle and API reference |
247
+ | [Events Reference (local)](docs/convai_events.md) | Every event with its typed payload, including the v2 and multi-character events |
128
248
 
129
249
  ---
130
250
 
@@ -136,6 +256,8 @@ Full documentation is at **<a href="https://docs.convai.com/api-docs/plugins-and
136
256
  | `@convai/web-sdk/react` | Same as default (React-explicit alias) |
137
257
  | `@convai/web-sdk/vanilla` | `ConvaiClient`, `createConvaiWidget`, `AudioRenderer` |
138
258
  | `@convai/web-sdk/core` | Framework-agnostic `ConvaiClient`, managers, and all types |
259
+ | `@convai/web-sdk/embed` | Server-safe publication descriptor and grant helpers |
260
+ | `@convai/web-sdk/embed/browser` | Self-contained browser bundle that registers `<convai-chat>` |
139
261
  | `@convai/web-sdk/lipsync-helpers` | Blendshape format utilities and queue helpers |
140
262
  | `@convai/web-sdk/vanilla/websocket` | **Opt-in.** Registers the WebSocket transport. Import alongside `/vanilla` when using `transport: "websocket"`. |
141
263
 
@@ -242,6 +364,55 @@ Full guide: [Character Versioning](docs/convai_character_versioning.md).
242
364
  ---
243
365
 
244
366
 
367
+ ## Multi-character rooms (beta)
368
+
369
+ Pass `characters` instead of `characterId` to open a room with several members.
370
+ `characters[0]` answers first; the same character id may appear more than once
371
+ and each entry is an independent member with its own `membershipId`. Roster
372
+ rooms need the LiveKit transport and a nonblank `endUserId`.
373
+
374
+ ```ts
375
+ const client = new ConvaiClient({
376
+ apiKey: "YOUR_API_KEY",
377
+ endUserId: "player-42",
378
+ characters: [
379
+ { characterId: GUIDE }, // initial active member
380
+ { characterId: ASSESSOR },
381
+ { characterId: GUIDE }, // a second, independent copy of the guide
382
+ ],
383
+ maxNumParticipants: 2,
384
+ });
385
+
386
+ client.on("characterReady", (member) => console.log("ready", member.membershipId));
387
+ client.on("characterStatus", ({ membershipId, status, failureCode }) => {
388
+ if (status === "failed") console.warn(membershipId, failureCode);
389
+ });
390
+
391
+ await client.connect();
392
+
393
+ // Route the next user turns to another member; null closes every gate.
394
+ await client.setInteractionTarget(client.characters[1].membershipId);
395
+
396
+ // Change the roster on a live room.
397
+ await client.updateCharacterRoster({ add: [{ characterId: GUIDE }] });
398
+ await client.updateCharacterRoster({ remove: [client.characters[0].membershipId] });
399
+
400
+ // Another participant joins the same room without sending any topology.
401
+ await other.joinRoom({ roomSessionId: client.roomSession!.roomSessionId, endUserId: "player-7" });
402
+ ```
403
+
404
+ Key points:
405
+
406
+ - `characters` and `characterId` are mutually exclusive, and roster entries take a bare character UUID (no `-draft` / `-1.2` selectors).
407
+ - `provisioningStatus` describes dispatch only; a member is usable when its own `characterReady` arrives.
408
+ - Transcript rows, `characterAudioTrack` events and `botReady` payloads carry `membershipId`, so two copies of one character never merge.
409
+ - Room-topology failures throw `ConvaiRoomError` with `status`, `code`, `requestTraceId` and `isRetryable`; the SDK retries `ROSTER_PROVISIONING_IN_PROGRESS` for you (`rosterProvisioningRetry`).
410
+ - Action protocol v2 and `actionConfig.tools` are single-character only and cannot be combined with a roster.
411
+
412
+ Full reference: [docs/convai_multi_character.md](docs/convai_multi_character.md).
413
+
414
+ ---
415
+
245
416
  ## Vision dynamic context beta
246
417
 
247
418
  Vision dynamic context is the default WebRTC/LiveKit vision path when `enableVideo: true`. Camera, screen, canvas, and custom video tracks can feed unified vision context; set `visionInputConfig.enabled: false` only when you need to keep the video channel while opting out.
@@ -309,6 +480,119 @@ client.on("actionResponse", ({ actions }: ActionResponseEvent) => {
309
480
  });
310
481
  ```
311
482
 
483
+ ### Agentic actions and canonical model output (v2)
484
+
485
+ The v2 protocol is an explicit opt-in. Existing connections continue to receive
486
+ the v1 `actionResponse` contract. A v2 client declares tools at connect time,
487
+ dispatches only Core-validated `items`, and returns one correlated terminal
488
+ result for every `tool_call`.
489
+
490
+ ```ts
491
+ import { ConvaiClient, type ActionResult } from "@convai/web-sdk/core";
492
+
493
+ const client = new ConvaiClient({
494
+ apiKey: "...",
495
+ characterId: "...",
496
+ capabilities: {
497
+ actionProtocolVersion: 2,
498
+ modelOutputVersion: 2,
499
+ },
500
+ actionConfig: {
501
+ actions: [],
502
+ objects: [],
503
+ characters: [],
504
+ tools: [
505
+ {
506
+ name: "search_documents",
507
+ description: "Search the user's approved document collection",
508
+ inputSchema: {
509
+ type: "object",
510
+ properties: { query: { type: "string" } },
511
+ required: ["query"],
512
+ },
513
+ },
514
+ ],
515
+ },
516
+ });
517
+
518
+ client.on("modelOutput", async (output) => {
519
+ for (const item of output.items) {
520
+ if (item.type === "message") renderAssistantText(item.content);
521
+ if (item.type !== "tool_call") continue;
522
+
523
+ let terminalResult: ActionResult;
524
+ try {
525
+ const result = await executeApprovedTool(item.name, item.arguments);
526
+ terminalResult = {
527
+ id: item.id,
528
+ status: "completed",
529
+ output: result,
530
+ };
531
+ } catch (error) {
532
+ terminalResult = {
533
+ id: item.id,
534
+ status: "error",
535
+ error: { message: String(error) },
536
+ };
537
+ }
538
+
539
+ try {
540
+ const ack = await client.sendActionResultAndWait(terminalResult, {
541
+ timeoutMs: 10_000,
542
+ });
543
+ markResultReported(item.id, ack.idempotent);
544
+ } catch (deliveryError) {
545
+ markResultDeliveryUncertain(item.id, deliveryError);
546
+ // If appropriate for your session lifecycle, retry `terminalResult`
547
+ // unchanged. Never execute the tool again merely because its ACK was lost.
548
+ }
549
+ }
550
+ });
551
+ ```
552
+
553
+ ### Parallel raw provider output (v2)
554
+
555
+ Model output v2 may provide a separate diagnostics-only raw stream alongside
556
+ the unchanged `bot-llm-text` chat stream. Each chunk carries Core's stable
557
+ logical-turn correlation id and, on newer Core versions, an invocation id:
558
+
559
+ ```ts
560
+ const client = new ConvaiClient({
561
+ apiKey: "...",
562
+ characterId: "...",
563
+ capabilities: { modelOutputVersion: 2 },
564
+ });
565
+
566
+ client.on("botLlmTextRaw", ({ text, logical_turn_id, output_id }) => {
567
+ appendRawDiagnostics(output_id ?? logical_turn_id, text);
568
+ });
569
+ ```
570
+
571
+ The SDK ignores this channel unless Core negotiated `modelOutputVersion: 2`.
572
+ Raw chunks never enter `chatMessages`, bot output, TTS, speech, or response
573
+ lifecycle state. They are retained for diagnostics and must never be executed
574
+ or reparsed. The ordinary `bot-llm-text` text and cadence remain unchanged. On
575
+ v2 connections, `ChatMessage.outputId` matches the raw event's optional
576
+ `output_id` and the final `modelOutput.output_id`; `logicalTurnId`/
577
+ `logical_turn_id` still groups every invocation in the user turn. Older v2 Core
578
+ omits the invocation id, so applications can fall back to one turn-level raw
579
+ aggregate. Never correlate by arrival order. When v2 is selected, the SDK suppresses the legacy `actionResponse` compatibility
580
+ projection so an application cannot execute the same operation twice.
581
+
582
+ Developer-defined visual output uses data-only `extension` items. Applications
583
+ register a renderer for a specific schema and version; unknown schemas use the
584
+ server-provided text fallback or remain unhandled. The SDK never evaluates code
585
+ from a model output.
586
+
587
+ ```ts
588
+ import { ModelOutputExtensionRegistry } from "@convai/web-sdk/core";
589
+
590
+ const extensions = new ModelOutputExtensionRegistry<HTMLElement>();
591
+ extensions.register("com.example/status-card", 1, ({ payload }) =>
592
+ renderStatusCard(payload),
593
+ );
594
+ ```
595
+
312
596
  ---
313
597
 
314
598
  ## Narrative Design template keys
@@ -1,10 +1,28 @@
1
1
  import { Room } from "livekit-client";
2
- import { ConvaiConfig, ConvaiClientState, ChatMessage, IConvaiClient, AudioControls, VideoControls, ScreenShareControls, DynamicInfo, ContextUpdateOptions, UploadFileOptions, WebSocketSessionFactory, RespondModeUpdateOptions, UpdateSceneMetadataOptions, VisionStatusOptions, VisionTriggerOptions, ConnectionData, SendUserTextMessageOptions, ConvaiCharacterInstance, ConvaiRoomSession, JoinRoomOptions, ActiveCharacterChange, CharacterRosterChange, UpdateCharacterRosterOptions, AppendMessageOptions } from "./types.js";
2
+ import { ConvaiConfig, ConvaiClientState, ChatMessage, IConvaiClient, PublishedChatConnectOptions, AudioControls, VideoControls, ScreenShareControls, DynamicInfo, ContextUpdateOptions, UploadFileOptions, ServerResponse, WebSocketSessionFactory, RespondModeUpdateOptions, UpdateSceneMetadataOptions, VisionStatusOptions, VisionTriggerOptions, ConnectionData, SendUserTextMessageOptions, ConvaiCharacterInstance, ConvaiRoomSession, JoinRoomOptions, ActiveCharacterChange, CharacterRosterChange, UpdateCharacterRosterOptions, AppendMessageOptions, ConvaiEventMap, ActionResult, ActionResultAck, ActionResultAckFailureReason, ActionResultAckOptions } from "./types.js";
3
3
  import { EventEmitter } from "./EventEmitter.js";
4
4
  import { BlendshapeQueue } from "./BlendshapeQueue.js";
5
5
  import { MemoryManager } from "./MemoryManager.js";
6
6
  import { CharacterVersionManager } from "./CharacterVersionManager.js";
7
7
  import { type CharacterVersionSelector } from "./characterReference.js";
8
+ /**
9
+ * Rejection from {@link ConvaiClient.sendActionResultAndWait} after local
10
+ * validation succeeds. Inspect `reason` rather than parsing the message.
11
+ */
12
+ export declare class ActionResultAckError extends Error {
13
+ readonly reason: ActionResultAckFailureReason;
14
+ readonly toolCallId: string;
15
+ readonly errorCode?: string;
16
+ readonly response?: ServerResponse;
17
+ readonly cause?: unknown;
18
+ constructor(message: string, options: {
19
+ reason: ActionResultAckFailureReason;
20
+ toolCallId: string;
21
+ errorCode?: string;
22
+ response?: ServerResponse;
23
+ cause?: unknown;
24
+ });
25
+ }
8
26
  /**
9
27
  * Main Convai client class for managing AI voice assistant connections
10
28
  * Provides complete interface for connecting to Convai's voice assistants,
@@ -58,6 +76,7 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
58
76
  /** Roster commands awaiting their ack, keyed by command id. */
59
77
  private _pendingRosterCommands;
60
78
  private _rosterCommandSeq;
79
+ private _requestTraceId;
61
80
  private _isBotReady;
62
81
  private _participantSid;
63
82
  private _audioSettings;
@@ -74,11 +93,14 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
74
93
  private _sseSession;
75
94
  private _logRtviMessages;
76
95
  private _isDisconnecting;
96
+ private _isPublishedChatSession;
77
97
  private _clientReadyRetryTimer;
78
98
  private _clientReadyTimeoutTimer;
79
99
  private _clientReadyMsgId;
100
+ private _pendingActionResultAcks;
80
101
  private static readonly CLIENT_READY_RETRY_MS;
81
102
  private static readonly CLIENT_READY_TIMEOUT_MS;
103
+ private static readonly ACTION_RESULT_ACK_TIMEOUT_MS;
82
104
  /**
83
105
  * Register the WebSocket transport factory. Called automatically as a side-effect
84
106
  * when you import `@convai/web-sdk/vanilla/websocket` (or the react equivalent).
@@ -95,7 +117,8 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
95
117
  private _memoryManager;
96
118
  constructor(config?: ConvaiConfig);
97
119
  get state(): ConvaiClientState;
98
- get connectionType(): "audio" | "video" | null;
120
+ get connectionType(): "audio" | "video" | "text" | null;
121
+ get isPublishedChatSession(): boolean;
99
122
  get apiKey(): string | null;
100
123
  get authToken(): string | null;
101
124
  get characterId(): string | null;
@@ -112,6 +135,14 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
112
135
  get chatMessages(): ChatMessage[];
113
136
  get userTranscription(): string;
114
137
  get characterSessionId(): string | null;
138
+ /**
139
+ * Subscribe to a client event. Typed against {@link ConvaiEventMap}, so a
140
+ * listener for a known event gets its payload inferred instead of `any`.
141
+ * The plain-string form is kept so existing callers and dynamic event names
142
+ * still build -- which also means a misspelt literal is not a compile error.
143
+ */
144
+ on<E extends keyof ConvaiEventMap>(event: E, callback: (...args: ConvaiEventMap[E]) => void): () => void;
145
+ on(event: string, callback: (...args: any[]) => void): () => void;
115
146
  /**
116
147
  * Server-owned snapshot of a multi-character room, or null for a
117
148
  * single-character session. Carries the room id, epochs and roster.
@@ -132,6 +163,8 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
132
163
  toggleUsageUpdates(enabled: boolean): void;
133
164
  /** Insert a transcript line locally. Nothing is sent; nothing is billed. */
134
165
  appendMessage(message: AppendMessageOptions): ChatMessage;
166
+ /** Trace id of the /connect that produced this session; quote it to backend support. */
167
+ get requestTraceId(): string | null;
135
168
  get isBotReady(): boolean;
136
169
  get audioControls(): AudioControls;
137
170
  get videoControls(): VideoControls;
@@ -159,6 +192,11 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
159
192
  * For WebSocket: sends via PipecatClient.sendClientMessage (wrapped in {t,d} envelope).
160
193
  */
161
194
  private publishMessage;
195
+ /**
196
+ * Publish exactly one message while retaining the transport's local completion
197
+ * signal. Server acceptance is still proved separately by `serverResponse`.
198
+ */
199
+ private publishMessageAndWaitForLocalPublication;
162
200
  /**
163
201
  * Returns true when a message can be sent on the active transport.
164
202
  */
@@ -275,6 +313,14 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
275
313
  */
276
314
  private consumeConnectionData;
277
315
  private cleanupWebSocketSessionAfterConnectFailure;
316
+ /**
317
+ * Connect to a published text-chat revision without publisher credentials.
318
+ *
319
+ * The launch grant is single-use and is never retained for reconnect. This
320
+ * path is LiveKit data-only: it does not enable microphone, camera, TTS,
321
+ * video, or lipsync.
322
+ */
323
+ connectWithPublicationGrant(launchToken: string, options?: PublishedChatConnectOptions): Promise<void>;
278
324
  /**
279
325
  * RTVI client-ready handshake. Server-side gates bot-ready emission on
280
326
  * receipt of client-ready (and re-emits bot-ready on every client-ready),
@@ -303,6 +349,17 @@ export declare class ConvaiClient extends EventEmitter implements IConvaiClient
303
349
  * Send a text message to the character
304
350
  */
305
351
  sendUserTextMessage(text: string, options?: SendUserTextMessageOptions): void;
352
+ /**
353
+ * Return a correlated terminal result for a client-executed tool call.
354
+ */
355
+ sendActionResult(result: ActionResult): void;
356
+ /**
357
+ * Publish one correlated terminal result and wait for Core's exact
358
+ * `server-response` acknowledgement. This method performs one publication;
359
+ * callers own any idempotent retry policy.
360
+ */
361
+ sendActionResultAndWait(result: ActionResult, options?: ActionResultAckOptions): Promise<ActionResultAck>;
362
+ private buildActionResultPayload;
306
363
  /**
307
364
  * Send a trigger message to invoke specific character actions
308
365
  */
@@ -1 +1 @@
1
- {"version":3,"file":"ConvaiClient.d.ts","sourceRoot":"","sources":["../../src/core/ConvaiClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAML,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,WAAW,EAEX,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EACpB,iBAAiB,EAIjB,uBAAuB,EACvB,wBAAwB,EAExB,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,EAGpB,cAAc,EACd,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EAEf,qBAAqB,EACrB,qBAAqB,EACrB,4BAA4B,EAE5B,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAgBjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,sBAAsB,CAAC;AAqC9B;;;;;;;;;;;;;;;;;;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