@convai/web-sdk 1.9.0-beta.1 → 1.9.0-beta.3
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/ConvaiClient.d.ts.map +1 -1
- package/dist/core/ConvaiClient.js +14 -8
- package/dist/core/ConvaiClient.js.map +1 -1
- package/dist/core/MessageHandler.d.ts +5 -2
- package/dist/core/MessageHandler.d.ts.map +1 -1
- package/dist/core/MessageHandler.js +64 -39
- 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 +224 -10
- package/dist/core/SSESession.js.map +1 -1
- package/dist/core/index.d.ts +2 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +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 +22 -4
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/embed/chat-embed-v1.js +14 -15
- package/dist/react/components/ConvaiWidget.d.ts +9 -0
- package/dist/react/components/ConvaiWidget.d.ts.map +1 -1
- package/dist/react/components/ConvaiWidget.js +2 -2
- package/dist/react/components/ConvaiWidget.js.map +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 +2 -2
- package/dist/react/components/rtc-widget/components/ConviMessage.js.map +1 -1
- 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 +9 -5
- package/dist/react/components/rtc-widget/components/MarkdownRenderer.js.map +1 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts +4 -1
- package/dist/react/components/rtc-widget/components/MessageList.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/MessageList.js +2 -2
- 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/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +1 -0
- package/dist/react/index.js.map +1 -1
- package/dist/utils/linkPresentation.d.ts +7 -0
- package/dist/utils/linkPresentation.d.ts.map +1 -1
- package/dist/utils/linkPresentation.js +57 -0
- 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/ConvaiWidget.d.ts.map +1 -1
- package/dist/vanilla/ConvaiWidget.js +67 -0
- package/dist/vanilla/ConvaiWidget.js.map +1 -1
- package/dist/vanilla/index.d.ts +2 -0
- package/dist/vanilla/index.d.ts.map +1 -1
- package/dist/vanilla/index.js +1 -0
- package/dist/vanilla/index.js.map +1 -1
- package/dist/vanilla/types.d.ts +9 -0
- package/dist/vanilla/types.d.ts.map +1 -1
- package/dist/vanilla/types.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +3 -2
- package/dist/embed/chat-embed-v1.js.map +0 -7
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** A resolve that has not settled by then is treated as nothing to show. */
|
|
2
|
+
export const LINK_PREVIEW_TIMEOUT_MS = 8000;
|
|
3
|
+
/** Distinct URLs remembered per page load. */
|
|
4
|
+
export const LINK_PREVIEW_CACHE_SIZE = 200;
|
|
5
|
+
/** Description, site name and favicon alone are not worth a card. */
|
|
6
|
+
export function isCardWorthy(meta) {
|
|
7
|
+
return !!meta && (!!meta.title || !!meta.image);
|
|
8
|
+
}
|
|
9
|
+
/** Only http(s) may ever reach an `img`. Relative URLs are the resolver's job. */
|
|
10
|
+
export function safeHttpUrl(value) {
|
|
11
|
+
if (!value)
|
|
12
|
+
return undefined;
|
|
13
|
+
try {
|
|
14
|
+
const u = new URL(value);
|
|
15
|
+
return u.protocol === "http:" || u.protocol === "https:" ? u.href : undefined;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return undefined;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function siteNameFor(meta, url) {
|
|
22
|
+
if (meta.siteName)
|
|
23
|
+
return meta.siteName;
|
|
24
|
+
try {
|
|
25
|
+
return new URL(url).hostname.replace(/^www\./, "");
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return url;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Declared icon, else the origin's /favicon.ico. Never a third-party icon service. */
|
|
32
|
+
export function faviconFor(meta, url) {
|
|
33
|
+
const declared = safeHttpUrl(meta.favicon);
|
|
34
|
+
if (declared)
|
|
35
|
+
return declared;
|
|
36
|
+
try {
|
|
37
|
+
return `${new URL(url).origin}/favicon.ico`;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const cache = new Map();
|
|
44
|
+
/**
|
|
45
|
+
* One in-flight or settled promise per URL, shared by every card on the page.
|
|
46
|
+
* Rejections settle to null so a dead host is asked once, and each call gets a
|
|
47
|
+
* signal that fires after LINK_PREVIEW_TIMEOUT_MS.
|
|
48
|
+
*/
|
|
49
|
+
export function resolveLinkPreviewCached(resolver, url) {
|
|
50
|
+
const hit = cache.get(url);
|
|
51
|
+
if (hit)
|
|
52
|
+
return hit;
|
|
53
|
+
const controller = new AbortController();
|
|
54
|
+
const timer = setTimeout(() => controller.abort(), LINK_PREVIEW_TIMEOUT_MS);
|
|
55
|
+
const p = Promise.resolve()
|
|
56
|
+
.then(() => resolver(url, controller.signal))
|
|
57
|
+
.then((meta) => meta ? { ...meta, image: safeHttpUrl(meta.image), favicon: safeHttpUrl(meta.favicon) } : null)
|
|
58
|
+
.catch(() => null)
|
|
59
|
+
.finally(() => clearTimeout(timer));
|
|
60
|
+
if (cache.size >= LINK_PREVIEW_CACHE_SIZE) {
|
|
61
|
+
const oldest = cache.keys().next().value;
|
|
62
|
+
if (oldest !== undefined)
|
|
63
|
+
cache.delete(oldest);
|
|
64
|
+
}
|
|
65
|
+
cache.set(url, p);
|
|
66
|
+
return p;
|
|
67
|
+
}
|
|
68
|
+
/** Test seam. */
|
|
69
|
+
export function resetLinkPreviewCache() {
|
|
70
|
+
cache.clear();
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=linkPreview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkPreview.js","sourceRoot":"","sources":["../../src/utils/linkPreview.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * The site-card contract: what a host hands the renderer for a plain web\n * link, and the one cache both renderers share.\n *\n * The SDK cannot read another origin's HTML, so the Open Graph tags a page\n * declares have to come from somewhere server-side. That somewhere is the\n * host's business; the renderer only needs a function that turns a URL into\n * metadata or null. No resolver, no cards.\n */\nexport interface LinkPreviewMeta {\n /** Final URL after redirects. */\n url: string;\n title?: string;\n description?: string;\n /** Absolute http(s) URL, or dropped. */\n image?: string;\n siteName?: string;\n /** Absolute http(s) URL, or dropped. */\n favicon?: string;\n}\n\n/**\n * Resolve metadata for a web URL, or null when there is nothing to show.\n * Should resolve null for a bad or unknown URL and reject only on transport\n * failure; either way the renderer draws nothing.\n */\nexport type LinkPreviewResolver = (\n url: string,\n signal: AbortSignal,\n) => Promise<LinkPreviewMeta | null>;\n\n/** A resolve that has not settled by then is treated as nothing to show. */\nexport const LINK_PREVIEW_TIMEOUT_MS = 8000;\n/** Distinct URLs remembered per page load. */\nexport const LINK_PREVIEW_CACHE_SIZE = 200;\n\n/** Description, site name and favicon alone are not worth a card. */\nexport function isCardWorthy(meta: LinkPreviewMeta | null | undefined): meta is LinkPreviewMeta {\n return !!meta && (!!meta.title || !!meta.image);\n}\n\n/** Only http(s) may ever reach an `img`. Relative URLs are the resolver's job. */\nexport function safeHttpUrl(value: string | undefined): string | undefined {\n if (!value) return undefined;\n try {\n const u = new URL(value);\n return u.protocol === \"http:\" || u.protocol === \"https:\" ? u.href : undefined;\n } catch {\n return undefined;\n }\n}\n\nexport function siteNameFor(meta: LinkPreviewMeta, url: string): string {\n if (meta.siteName) return meta.siteName;\n try {\n return new URL(url).hostname.replace(/^www\\./, \"\");\n } catch {\n return url;\n }\n}\n\n/** Declared icon, else the origin's /favicon.ico. Never a third-party icon service. */\nexport function faviconFor(meta: LinkPreviewMeta, url: string): string | undefined {\n const declared = safeHttpUrl(meta.favicon);\n if (declared) return declared;\n try {\n return `${new URL(url).origin}/favicon.ico`;\n } catch {\n return undefined;\n }\n}\n\nconst cache = new Map<string, Promise<LinkPreviewMeta | null>>();\n\n/**\n * One in-flight or settled promise per URL, shared by every card on the page.\n * Rejections settle to null so a dead host is asked once, and each call gets a\n * signal that fires after LINK_PREVIEW_TIMEOUT_MS.\n */\nexport function resolveLinkPreviewCached(\n resolver: LinkPreviewResolver,\n url: string,\n): Promise<LinkPreviewMeta | null> {\n const hit = cache.get(url);\n if (hit) return hit;\n\n const controller = new AbortController();\n const timer = setTimeout(() => controller.abort(), LINK_PREVIEW_TIMEOUT_MS);\n const p = Promise.resolve()\n .then(() => resolver(url, controller.signal))\n .then((meta) =>\n meta ? { ...meta, image: safeHttpUrl(meta.image), favicon: safeHttpUrl(meta.favicon) } : null,\n )\n .catch(() => null)\n .finally(() => clearTimeout(timer));\n\n if (cache.size >= LINK_PREVIEW_CACHE_SIZE) {\n const oldest = cache.keys().next().value;\n if (oldest !== undefined) cache.delete(oldest);\n }\n cache.set(url, p);\n return p;\n}\n\n/** Test seam. */\nexport function resetLinkPreviewCache(): void {\n cache.clear();\n}\n"]}
|
|
@@ -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"}
|
|
@@ -10,6 +10,7 @@ import { ConvaiClient } from "../core/ConvaiClient.js";
|
|
|
10
10
|
import { parseInlineMarkdown, compactUrl } from "../utils/inlineMarkdown.js";
|
|
11
11
|
import { linkKindForUrl, describeUrl, fileNameOf, documentBadge, contactLabel, hoverTitle, isMixedContent, glyph, presentationStyles as S, toCssText, PREVIEW_TIMEOUT_MS, MAX_CARDS_PER_MESSAGE, } from "../utils/linkPresentation.js";
|
|
12
12
|
import { openLightbox } from "../utils/lightbox.js";
|
|
13
|
+
import { resolveLinkPreviewCached, isCardWorthy, siteNameFor, faviconFor, } from "../utils/linkPreview.js";
|
|
13
14
|
import { freshPublicationGrantOptions } from "../core/publishedChat.js";
|
|
14
15
|
/**
|
|
15
16
|
* Positioning declarations for the widget root, keyed by `placement`. The
|
|
@@ -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;
|