@convai/web-sdk 1.9.0-beta.1 → 1.9.0-beta.2
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/dist/core/AudioManager.d.ts +3 -3
- package/dist/core/AudioManager.js +1 -1
- package/dist/core/CharacterRoster.d.ts +1 -1
- package/dist/core/CharacterVersionManager.d.ts +2 -2
- package/dist/core/CharacterVersionManager.js +1 -1
- package/dist/core/ConnectionStateHandler.d.ts +1 -1
- package/dist/core/ConvaiClient.d.ts +6 -6
- package/dist/core/ConvaiClient.d.ts.map +1 -1
- package/dist/core/ConvaiClient.js +34 -28
- package/dist/core/ConvaiClient.js.map +1 -1
- package/dist/core/MemoryManager.d.ts +1 -1
- package/dist/core/MessageHandler.d.ts +7 -4
- package/dist/core/MessageHandler.d.ts.map +1 -1
- package/dist/core/MessageHandler.js +68 -43
- package/dist/core/MessageHandler.js.map +1 -1
- package/dist/core/SSESession.d.ts +7 -8
- package/dist/core/SSESession.d.ts.map +1 -1
- package/dist/core/SSESession.js +225 -11
- package/dist/core/SSESession.js.map +1 -1
- package/dist/core/ScreenShareManager.d.ts +2 -2
- package/dist/core/ScreenShareManager.js +2 -2
- package/dist/core/VideoManager.d.ts +2 -2
- package/dist/core/VideoManager.js +3 -3
- package/dist/core/connectRequest.d.ts +1 -1
- package/dist/core/contextUpdateRequest.d.ts +1 -1
- package/dist/core/index.d.ts +25 -23
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +19 -18
- package/dist/core/index.js.map +1 -1
- package/dist/core/modelOutput.d.ts +2 -2
- package/dist/core/publishedChat.d.ts +1 -1
- package/dist/core/rosterRequest.d.ts +1 -1
- package/dist/core/rosterRequest.js +1 -1
- package/dist/core/rtviEnvelope.d.ts +6 -0
- package/dist/core/rtviEnvelope.d.ts.map +1 -0
- package/dist/core/rtviEnvelope.js +10 -0
- package/dist/core/rtviEnvelope.js.map +1 -0
- package/dist/core/types.d.ts +27 -9
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/videoSourceState.d.ts +1 -1
- package/dist/core/visionRequest.d.ts +1 -1
- package/dist/embed/ConvaiChatElement.js +2 -2
- package/dist/embed/browser.d.ts +2 -2
- package/dist/embed/browser.js +3 -3
- package/dist/embed/chat-embed-v1.js +14 -14
- package/dist/embed/chat-embed-v1.js.map +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lipsync-helpers/createBlendshapeQueue.d.ts +2 -2
- package/dist/lipsync-helpers/createBlendshapeQueue.js +2 -2
- package/dist/lipsync-helpers/declarativeMapping.d.ts +1 -1
- package/dist/lipsync-helpers/declarativeMapping.js +2 -2
- package/dist/lipsync-helpers/index.d.ts +12 -12
- package/dist/lipsync-helpers/index.js +9 -9
- package/dist/lipsync-helpers/mhaLimitDrivers.js +2 -2
- package/dist/lipsync-helpers/naturalness/processor.d.ts +1 -1
- package/dist/lipsync-helpers/naturalness/processor.js +1 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.d.ts +1 -1
- package/dist/lipsync-helpers/naturalness/profiles/mha.js +1 -1
- package/dist/lipsync-helpers/presetMappers.d.ts +1 -1
- package/dist/react/components/ConvaiWidget.d.ts +11 -2
- package/dist/react/components/ConvaiWidget.d.ts.map +1 -1
- package/dist/react/components/ConvaiWidget.js +7 -7
- package/dist/react/components/ConvaiWidget.js.map +1 -1
- package/dist/react/components/index.d.ts +1 -1
- package/dist/react/components/index.js +1 -1
- package/dist/react/components/rtc-widget/components/AudioSettingsPanel.d.ts +1 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts +4 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/ConviMessage.js +5 -5
- package/dist/react/components/rtc-widget/components/ConviMessage.js.map +1 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +3 -3
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts +7 -0
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js +13 -9
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +1 -1
- package/dist/react/components/rtc-widget/components/MessageBubble.js +1 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +5 -2
- package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/MessageList.js +6 -6
- package/dist/react/components/rtc-widget/components/MessageList.js.map +1 -1
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts +15 -0
- package/dist/react/components/rtc-widget/components/SiteCard.d.ts.map +1 -0
- package/dist/react/components/rtc-widget/components/SiteCard.js +35 -0
- package/dist/react/components/rtc-widget/components/SiteCard.js.map +1 -0
- package/dist/react/components/rtc-widget/components/UserMessage.js +3 -3
- package/dist/react/components/rtc-widget/components/conviComponents/ConviButton.js +4 -4
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +3 -3
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +4 -4
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +3 -3
- package/dist/react/components/rtc-widget/components/conviComponents/VoiceModeOverlay.js +3 -3
- package/dist/react/components/rtc-widget/components/conviComponents/index.d.ts +5 -5
- package/dist/react/components/rtc-widget/components/conviComponents/index.js +5 -5
- package/dist/react/components/rtc-widget/components/index.d.ts +8 -8
- package/dist/react/components/rtc-widget/components/index.js +9 -9
- package/dist/react/components/rtc-widget/index.d.ts +5 -5
- package/dist/react/components/rtc-widget/index.js +3 -3
- package/dist/react/components/rtc-widget/styles/icons.d.ts +1 -1
- package/dist/react/components/rtc-widget/styles/icons.js +1 -1
- package/dist/react/components/rtc-widget/styles/index.d.ts +5 -5
- package/dist/react/components/rtc-widget/styles/index.js +4 -4
- package/dist/react/components/rtc-widget/styles/styledComponents.js +1 -1
- package/dist/react/hooks/index.d.ts +3 -3
- package/dist/react/hooks/index.js +3 -3
- package/dist/react/hooks/useCharacterInfo.js +1 -1
- package/dist/react/hooks/useConvaiClient.d.ts +1 -1
- package/dist/react/hooks/useConvaiClient.js +1 -1
- package/dist/react/index.d.ts +13 -11
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +10 -9
- package/dist/react/index.js.map +1 -1
- package/dist/utils/lightbox.js +2 -2
- package/dist/utils/linkPresentation.d.ts +7 -0
- package/dist/utils/linkPresentation.d.ts.map +1 -1
- package/dist/utils/linkPresentation.js +58 -1
- package/dist/utils/linkPresentation.js.map +1 -1
- package/dist/utils/linkPreview.d.ts +46 -0
- package/dist/utils/linkPreview.d.ts.map +1 -0
- package/dist/utils/linkPreview.js +72 -0
- package/dist/utils/linkPreview.js.map +1 -0
- package/dist/vanilla/AudioRenderer.js +1 -1
- package/dist/vanilla/ConvaiWidget.d.ts +1 -1
- package/dist/vanilla/ConvaiWidget.d.ts.map +1 -1
- package/dist/vanilla/ConvaiWidget.js +76 -9
- package/dist/vanilla/ConvaiWidget.js.map +1 -1
- package/dist/vanilla/WebSocketSession.d.ts +1 -1
- package/dist/vanilla/WebSocketSession.js +1 -1
- package/dist/vanilla/index.d.ts +13 -11
- package/dist/vanilla/index.d.ts.map +1 -1
- package/dist/vanilla/index.js +9 -8
- package/dist/vanilla/index.js.map +1 -1
- package/dist/vanilla/types.d.ts +11 -2
- package/dist/vanilla/types.d.ts.map +1 -1
- package/dist/vanilla/types.js.map +1 -1
- package/dist/vanilla/websocket.d.ts +1 -1
- package/dist/vanilla/websocket.js +2 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RoomEvent } from 'livekit-client';
|
|
2
|
-
import { logger } from '../utils/logger
|
|
2
|
+
import { logger } from '../utils/logger';
|
|
3
3
|
/**
|
|
4
4
|
* AudioRenderer - Manages audio playback for remote participants
|
|
5
5
|
* Automatically creates and attaches audio elements for remote audio tracks
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Vanilla ConvaiWidget - Complete UI widget for Convai conversations
|
|
3
3
|
* Ports the React ConvaiWidget to vanilla TypeScript with DOM manipulation
|
|
4
4
|
*/
|
|
5
|
-
import type { VanillaWidgetOptions, VanillaWidget } from "./types
|
|
5
|
+
import type { VanillaWidgetOptions, VanillaWidget } from "./types";
|
|
6
6
|
/**
|
|
7
7
|
* Create a Convai chat widget in the specified container
|
|
8
8
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConvaiWidget.d.ts","sourceRoot":"","sources":["../../src/vanilla/ConvaiWidget.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EAEd,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ConvaiWidget.d.ts","sourceRoot":"","sources":["../../src/vanilla/ConvaiWidget.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAYH,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EAEd,MAAM,SAAS,CAAC;AAmJjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,oBAAoB,GAC5B,aAAa,CA++Ff;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAE/D"}
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
* Vanilla ConvaiWidget - Complete UI widget for Convai conversations
|
|
3
3
|
* Ports the React ConvaiWidget to vanilla TypeScript with DOM manipulation
|
|
4
4
|
*/
|
|
5
|
-
import { AudioRenderer } from "./AudioRenderer
|
|
6
|
-
import { aeroTheme, injectGlobalStyles, injectKeyframes, } from "./styles
|
|
7
|
-
import { Icons } from "./icons
|
|
8
|
-
import { WidgetEventSubscriptions } from "./WidgetEventSubscriptions
|
|
9
|
-
import { ConvaiClient } from "../core/ConvaiClient
|
|
10
|
-
import { parseInlineMarkdown, compactUrl } from "../utils/inlineMarkdown
|
|
11
|
-
import { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, glyph, presentationStyles as S, toCssText, PREVIEW_TIMEOUT_MS, MAX_CARDS_PER_MESSAGE, } from "../utils/linkPresentation
|
|
12
|
-
import { openLightbox } from "../utils/lightbox
|
|
13
|
-
import {
|
|
5
|
+
import { AudioRenderer } from "./AudioRenderer";
|
|
6
|
+
import { aeroTheme, injectGlobalStyles, injectKeyframes, } from "./styles";
|
|
7
|
+
import { Icons } from "./icons";
|
|
8
|
+
import { WidgetEventSubscriptions } from "./WidgetEventSubscriptions";
|
|
9
|
+
import { ConvaiClient } from "../core/ConvaiClient";
|
|
10
|
+
import { parseInlineMarkdown, compactUrl } from "../utils/inlineMarkdown";
|
|
11
|
+
import { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, glyph, presentationStyles as S, toCssText, PREVIEW_TIMEOUT_MS, MAX_CARDS_PER_MESSAGE, } from "../utils/linkPresentation";
|
|
12
|
+
import { openLightbox } from "../utils/lightbox";
|
|
13
|
+
import { resolveLinkPreviewCached, isCardWorthy, siteNameFor, faviconFor, } from "../utils/linkPreview";
|
|
14
|
+
import { freshPublicationGrantOptions } from "../core/publishedChat";
|
|
14
15
|
/**
|
|
15
16
|
* Positioning declarations for the widget root, keyed by `placement`. The
|
|
16
17
|
* `bottom-right` entry must stay byte-identical to the literals it replaces --
|
|
@@ -2163,6 +2164,61 @@ export function createConvaiWidget(container, options) {
|
|
|
2163
2164
|
focusRing(a);
|
|
2164
2165
|
return a;
|
|
2165
2166
|
};
|
|
2167
|
+
/**
|
|
2168
|
+
* Open Graph card under a plain web link. A comment node holds the place
|
|
2169
|
+
* until the host's resolver settles; it is replaced only when the result
|
|
2170
|
+
* has a title or an image, so nothing flashes for the many links that
|
|
2171
|
+
* resolve to nothing card-worthy. Resolver text becomes text nodes only.
|
|
2172
|
+
*/
|
|
2173
|
+
const siteCard = (href) => {
|
|
2174
|
+
const resolver = options.linkPreviewResolver;
|
|
2175
|
+
const slot = document.createComment("site-card");
|
|
2176
|
+
if (!resolver)
|
|
2177
|
+
return slot;
|
|
2178
|
+
resolveLinkPreviewCached(resolver, href).then((meta) => {
|
|
2179
|
+
if (!isCardWorthy(meta) || !slot.parentNode)
|
|
2180
|
+
return;
|
|
2181
|
+
const a = make("a", "message-site-card", S.siteCard);
|
|
2182
|
+
a.href = href;
|
|
2183
|
+
a.target = "_blank";
|
|
2184
|
+
a.rel = "noopener noreferrer";
|
|
2185
|
+
const header = document.createElement("span");
|
|
2186
|
+
header.style.cssText = toCssText(S.siteHeader);
|
|
2187
|
+
const favicon = faviconFor(meta, href);
|
|
2188
|
+
if (favicon) {
|
|
2189
|
+
const icon = make("img", "message-site-favicon", S.siteFavicon);
|
|
2190
|
+
icon.src = favicon;
|
|
2191
|
+
icon.alt = "";
|
|
2192
|
+
icon.addEventListener("error", () => icon.remove());
|
|
2193
|
+
header.appendChild(icon);
|
|
2194
|
+
}
|
|
2195
|
+
const name = make("span", "message-site-name", S.siteName);
|
|
2196
|
+
name.textContent = siteNameFor(meta, href);
|
|
2197
|
+
header.appendChild(name);
|
|
2198
|
+
a.appendChild(header);
|
|
2199
|
+
if (meta.title) {
|
|
2200
|
+
const t = make("span", "message-site-title", S.siteTitle);
|
|
2201
|
+
t.textContent = meta.title;
|
|
2202
|
+
a.appendChild(t);
|
|
2203
|
+
}
|
|
2204
|
+
if (meta.description) {
|
|
2205
|
+
const d = make("span", "message-site-description", S.siteDescription);
|
|
2206
|
+
d.textContent = meta.description;
|
|
2207
|
+
a.appendChild(d);
|
|
2208
|
+
}
|
|
2209
|
+
if (meta.image) {
|
|
2210
|
+
const img = make("img", "message-site-image", S.siteImage);
|
|
2211
|
+
img.src = meta.image;
|
|
2212
|
+
img.alt = "";
|
|
2213
|
+
img.loading = "lazy";
|
|
2214
|
+
img.addEventListener("error", () => img.remove());
|
|
2215
|
+
a.appendChild(img);
|
|
2216
|
+
}
|
|
2217
|
+
focusRing(a);
|
|
2218
|
+
slot.replaceWith(a);
|
|
2219
|
+
});
|
|
2220
|
+
return slot;
|
|
2221
|
+
};
|
|
2166
2222
|
const unavailable = (src, insecure) => {
|
|
2167
2223
|
const dead = make("span", "message-media-unavailable", S.unavailable);
|
|
2168
2224
|
dead.textContent = `Preview unavailable — ${describeUrl(src)}${insecure ? " (insecure URL)" : ""}`;
|
|
@@ -2284,6 +2340,17 @@ export function createConvaiWidget(container, options) {
|
|
|
2284
2340
|
break;
|
|
2285
2341
|
}
|
|
2286
2342
|
parts.push(anchor(node.href, kind, node.label));
|
|
2343
|
+
// The budget is spent when the card mounts, not when it resolves,
|
|
2344
|
+
// so the cap stays deterministic for a message naming twenty pages.
|
|
2345
|
+
const wantsSiteCard = media &&
|
|
2346
|
+
kind === "web" &&
|
|
2347
|
+
!!options.linkPreviewResolver &&
|
|
2348
|
+
budget.cards < MAX_CARDS_PER_MESSAGE;
|
|
2349
|
+
if (wantsSiteCard) {
|
|
2350
|
+
budget.cards++;
|
|
2351
|
+
parts.push(siteCard(node.href));
|
|
2352
|
+
break;
|
|
2353
|
+
}
|
|
2287
2354
|
const wantsCard = media &&
|
|
2288
2355
|
(kind === "image" || kind === "video" || kind === "document") &&
|
|
2289
2356
|
budget.cards < MAX_CARDS_PER_MESSAGE;
|