@convai/web-sdk 1.9.0-beta.5 → 1.9.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.
- package/README.md +32 -40
- package/dist/core/ConvaiClient.d.ts +36 -1
- package/dist/core/ConvaiClient.d.ts.map +1 -1
- package/dist/core/ConvaiClient.js +91 -1
- package/dist/core/ConvaiClient.js.map +1 -1
- package/dist/core/types.d.ts +64 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/embed/index.d.ts +9 -2
- package/dist/embed/index.d.ts.map +1 -1
- package/dist/embed/index.js +9 -2
- package/dist/embed/index.js.map +1 -1
- package/dist/react/components/ConvaiWidget.d.ts.map +1 -1
- package/dist/react/components/ConvaiWidget.js +6 -19
- package/dist/react/components/ConvaiWidget.js.map +1 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/FloatingVideo.js +1 -2
- package/dist/react/components/rtc-widget/components/FloatingVideo.js.map +1 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js +1 -1
- package/dist/react/components/rtc-widget/components/UserMessage.js.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js +1 -2
- package/dist/react/components/rtc-widget/components/conviComponents/ConviFooter.js.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js +1 -2
- package/dist/react/components/rtc-widget/components/conviComponents/ConviHeader.js.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.d.ts.map +1 -1
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js +1 -3
- package/dist/react/components/rtc-widget/components/conviComponents/SettingsTray.js.map +1 -1
- package/dist/react/hooks/useConvaiClient.d.ts.map +1 -1
- package/dist/react/hooks/useConvaiClient.js +2 -0
- package/dist/react/hooks/useConvaiClient.js.map +1 -1
- package/dist/react/icons.d.ts +38 -0
- package/dist/react/icons.d.ts.map +1 -0
- package/dist/react/icons.js +54 -0
- package/dist/react/icons.js.map +1 -0
- package/dist/vanilla/ConvaiWidget.d.ts.map +1 -1
- package/dist/vanilla/ConvaiWidget.js +4 -10
- package/dist/vanilla/ConvaiWidget.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 +19 -25
- package/dist/embed/ConvaiChatElement.d.ts +0 -103
- package/dist/embed/ConvaiChatElement.d.ts.map +0 -1
- package/dist/embed/ConvaiChatElement.js +0 -679
- package/dist/embed/ConvaiChatElement.js.map +0 -1
- package/dist/embed/browser.d.ts +0 -3
- package/dist/embed/browser.d.ts.map +0 -1
- package/dist/embed/browser.js +0 -5
- package/dist/embed/browser.js.map +0 -1
- package/dist/embed/chat-embed-v1.js +0 -199
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.9.0-beta.
|
|
1
|
+
export declare const SDK_VERSION = "1.9.0-beta.7";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// GENERATED by scripts/sync-version.mjs — do not edit by hand.\n// Regenerated from package.json on every build.\nexport const SDK_VERSION = \"1.9.0-beta.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,+DAA+D;AAC/D,gDAAgD;AAChD,MAAM,CAAC,MAAM,WAAW,GAAG,cAAc,CAAC","sourcesContent":["// GENERATED by scripts/sync-version.mjs — do not edit by hand.\n// Regenerated from package.json on every build.\nexport const SDK_VERSION = \"1.9.0-beta.7\";\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@convai/web-sdk",
|
|
3
|
-
"version": "1.9.0-beta.
|
|
3
|
+
"version": "1.9.0-beta.7",
|
|
4
4
|
"description": "Build web apps with lifelike AI characters. The Convai Web SDK gives you real-time voice, lipsync, emotions, and dynamic context — with first-class support for React and vanilla TypeScript.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -38,12 +38,6 @@
|
|
|
38
38
|
"require": "./dist/embed/index.js",
|
|
39
39
|
"default": "./dist/embed/index.js"
|
|
40
40
|
},
|
|
41
|
-
"./embed/browser": {
|
|
42
|
-
"types": "./dist/embed/browser.d.ts",
|
|
43
|
-
"import": "./dist/embed/chat-embed-v1.js",
|
|
44
|
-
"require": "./dist/embed/chat-embed-v1.js",
|
|
45
|
-
"default": "./dist/embed/chat-embed-v1.js"
|
|
46
|
-
},
|
|
47
41
|
"./react": {
|
|
48
42
|
"types": "./dist/react/index.d.ts",
|
|
49
43
|
"import": "./dist/react/index.js",
|
|
@@ -59,25 +53,22 @@
|
|
|
59
53
|
"./package.json": "./package.json"
|
|
60
54
|
},
|
|
61
55
|
"sideEffects": [
|
|
62
|
-
"./dist/embed/browser.js",
|
|
63
|
-
"./dist/embed/chat-embed-v1.js",
|
|
64
56
|
"./dist/vanilla/websocket.js",
|
|
65
|
-
"./src/embed/browser.ts",
|
|
66
57
|
"./src/vanilla/websocket.ts"
|
|
67
58
|
],
|
|
68
59
|
"publishConfig": {
|
|
69
60
|
"access": "public"
|
|
70
61
|
},
|
|
71
62
|
"scripts": {
|
|
72
|
-
"build": "node scripts/sync-version.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs && pnpm
|
|
73
|
-
"build:fast": "node scripts/sync-version.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs
|
|
74
|
-
"build:prod": "node scripts/sync-version.mjs && NODE_ENV=production tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs && pnpm
|
|
75
|
-
"build:embed": "esbuild src/embed/browser.ts --bundle --format=esm --platform=browser --target=es2020 --outfile=dist/embed/chat-embed-v1.js --minify",
|
|
63
|
+
"build": "node scripts/sync-version.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs && pnpm typecheck:downstream",
|
|
64
|
+
"build:fast": "node scripts/sync-version.mjs && tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs",
|
|
65
|
+
"build:prod": "node scripts/sync-version.mjs && NODE_ENV=production tsc -p tsconfig.build.json && node scripts/fix-dist-extensions.mjs && pnpm typecheck:downstream",
|
|
76
66
|
"dev": "tsc -p tsconfig.build.json --watch",
|
|
77
67
|
"clean": "rimraf dist",
|
|
78
68
|
"fix:ext": "node scripts/fix-dist-extensions.mjs",
|
|
79
69
|
"typecheck": "tsc --noEmit",
|
|
80
70
|
"test": "vitest run",
|
|
71
|
+
"test:scripts": "node --test scripts/sync-docs.test.mjs",
|
|
81
72
|
"test:protocol": "tsc && node --test tests/modelOutput.test.mjs tests/actionResultAck.test.mjs tests/visionPromptMode.test.mjs",
|
|
82
73
|
"typecheck:downstream": "pnpm -r --filter './examples/**' exec tsc -b --noEmit && pnpm -r --filter './doc-tests/**' exec tsc --noEmit",
|
|
83
74
|
"typecheck:all": "pnpm typecheck && pnpm typecheck:downstream",
|
|
@@ -93,7 +84,7 @@
|
|
|
93
84
|
"prerelease:enter": "changeset pre enter beta",
|
|
94
85
|
"prerelease:exit": "changeset pre exit",
|
|
95
86
|
"version:beta": "changeset version",
|
|
96
|
-
"publish:beta": "npm run build:prod && changeset publish
|
|
87
|
+
"publish:beta": "npm run build:prod && changeset publish",
|
|
97
88
|
"example:react": "cd examples/react && pnpm dev",
|
|
98
89
|
"example:react:build": "cd examples/react && pnpm build",
|
|
99
90
|
"example:vanilla": "cd examples/vanilla && pnpm dev",
|
|
@@ -136,27 +127,35 @@
|
|
|
136
127
|
},
|
|
137
128
|
"homepage": "https://github.com/convai/web-sdk#readme",
|
|
138
129
|
"peerDependencies": {
|
|
130
|
+
"@pipecat-ai/client-js": "^1.7.0",
|
|
131
|
+
"@pipecat-ai/websocket-transport": "^1.6.2",
|
|
139
132
|
"react": "^18.0.0 || ^19.0.0",
|
|
140
133
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
141
134
|
},
|
|
135
|
+
"peerDependenciesMeta": {
|
|
136
|
+
"@pipecat-ai/client-js": {
|
|
137
|
+
"optional": true
|
|
138
|
+
},
|
|
139
|
+
"@pipecat-ai/websocket-transport": {
|
|
140
|
+
"optional": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
142
143
|
"dependencies": {
|
|
143
144
|
"@livekit/components-react": "^2.9.3",
|
|
144
|
-
"@livekit/components-styles": "^1.1.4",
|
|
145
|
-
"@pipecat-ai/client-js": "^1.7.0",
|
|
146
|
-
"@pipecat-ai/websocket-transport": "^1.6.2",
|
|
147
145
|
"framer-motion": "^11.18.0",
|
|
148
146
|
"livekit-client": "^2.8.0",
|
|
149
|
-
"react-icons": "^5.4.0",
|
|
150
147
|
"styled-components": "^6.1.15"
|
|
151
148
|
},
|
|
152
149
|
"devDependencies": {
|
|
153
150
|
"@changesets/cli": "^2.29.5",
|
|
151
|
+
"@pipecat-ai/client-js": "^1.7.0",
|
|
152
|
+
"@pipecat-ai/websocket-transport": "^1.6.2",
|
|
154
153
|
"@types/node": "^20.17.13",
|
|
155
154
|
"@types/react": "^18.3.18",
|
|
156
155
|
"@types/react-dom": "^18.3.5",
|
|
157
|
-
"@types/styled-components": "^5.1.34",
|
|
158
156
|
"esbuild": "^0.28.2",
|
|
159
157
|
"happy-dom": "^15.11.7",
|
|
158
|
+
"react-icons": "^5.4.0",
|
|
160
159
|
"rimraf": "^5.0.0",
|
|
161
160
|
"typescript": "^5.7.3",
|
|
162
161
|
"vitest": "^3.2.4"
|
|
@@ -165,10 +164,5 @@
|
|
|
165
164
|
"dist",
|
|
166
165
|
"README.md"
|
|
167
166
|
],
|
|
168
|
-
"pnpm": {
|
|
169
|
-
"onlyBuiltDependencies": [
|
|
170
|
-
"esbuild"
|
|
171
|
-
]
|
|
172
|
-
},
|
|
173
167
|
"packageManager": "pnpm@10.10.0"
|
|
174
168
|
}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
export declare class ConvaiChatElement extends HTMLElement {
|
|
2
|
-
private client;
|
|
3
|
-
private controller;
|
|
4
|
-
private unsubs;
|
|
5
|
-
private mounted;
|
|
6
|
-
private ready;
|
|
7
|
-
private messages;
|
|
8
|
-
private descriptor;
|
|
9
|
-
private failureReported;
|
|
10
|
-
/** A session that could still produce a reply: set when the client is wired
|
|
11
|
-
* up, cleared when it ends. Not a wait flag — see `isAwaitingReply()`. */
|
|
12
|
-
private sessionLive;
|
|
13
|
-
private sessionId;
|
|
14
|
-
private retryVisible;
|
|
15
|
-
connectedCallback(): void;
|
|
16
|
-
disconnectedCallback(): void;
|
|
17
|
-
private requireAttribute;
|
|
18
|
-
private renderShell;
|
|
19
|
-
private start;
|
|
20
|
-
private fail;
|
|
21
|
-
private cleanupClient;
|
|
22
|
-
/**
|
|
23
|
-
* A host that already knows who the character is can seed the header through
|
|
24
|
-
* `display-name` and `image-url`, so the identity paints before the
|
|
25
|
-
* publication descriptor resolves. The fetched descriptor always wins.
|
|
26
|
-
*/
|
|
27
|
-
private displayName;
|
|
28
|
-
/** `null` is a valid descriptor value, so a loaded descriptor without an
|
|
29
|
-
* image clears the seed rather than falling back to it. */
|
|
30
|
-
private imageUrl;
|
|
31
|
-
private renderDescriptor;
|
|
32
|
-
/**
|
|
33
|
-
* The character's own avatar, reused as the icon beside each of its replies.
|
|
34
|
-
* Without an image this is the character's initial on the accent disc, not a
|
|
35
|
-
* bare `<img>` — which the avatar rule would paint as an empty disc.
|
|
36
|
-
*/
|
|
37
|
-
private avatarElement;
|
|
38
|
-
/**
|
|
39
|
-
* Whether the character owes a reply that has produced no text yet — the
|
|
40
|
-
* question the typing indicator asks.
|
|
41
|
-
*
|
|
42
|
-
* Derived from the message list on every render rather than tracked as
|
|
43
|
-
* state, because the list already records every event that starts or ends a
|
|
44
|
-
* wait: a send appends a `user-llm-text` row synchronously
|
|
45
|
-
* (`MessageHandler.addUserTextMessage`), a turn begins as an empty
|
|
46
|
-
* `bot-llm-text` row (`bot-llm-started`), the first token fills that row,
|
|
47
|
-
* and an abstain appends `llm-no-response`. Held as flags instead, each of
|
|
48
|
-
* those events needed its own handler and every one I missed was a bug:
|
|
49
|
-
* dots through an entire reply, no dots for a character-initiated greeting
|
|
50
|
-
* or a follow-up turn, dots forever after an abstain.
|
|
51
|
-
*
|
|
52
|
-
* The scan reads the unfiltered list: the rows that mark a turn's start and
|
|
53
|
-
* its abstain are exactly the ones the transcript hides. An empty bot row
|
|
54
|
-
* means the turn is open only while it is still streaming — `bot-llm-stopped`
|
|
55
|
-
* finalizes the row in place, so an empty finalized row is a turn that ended
|
|
56
|
-
* without text (an interrupt, or a stop before the first token).
|
|
57
|
-
*/
|
|
58
|
-
private isAwaitingReply;
|
|
59
|
-
/**
|
|
60
|
-
* Close the open turn in this element's own copy of the transcript.
|
|
61
|
-
*
|
|
62
|
-
* `sendInterruptMessage()` transmits the interrupt; it does not finalize the
|
|
63
|
-
* empty streaming row, which stays open until a `bot-llm-stopped` frame
|
|
64
|
-
* arrives — delayed, or never, if the acknowledgement is lost. The visitor
|
|
65
|
-
* asked the character to stop, so the wait ends with the click. A later
|
|
66
|
-
* `messagesChange` replaces this array wholesale, so nothing diverges.
|
|
67
|
-
*/
|
|
68
|
-
private finalizeOpenTurn;
|
|
69
|
-
private visibleMessages;
|
|
70
|
-
private renderMessages;
|
|
71
|
-
/** Opening state: who the visitor is talking to, not a bare instruction. */
|
|
72
|
-
private introElement;
|
|
73
|
-
private typingElement;
|
|
74
|
-
private setStatus;
|
|
75
|
-
private setError;
|
|
76
|
-
private setSessionId;
|
|
77
|
-
private updateControls;
|
|
78
|
-
private updateTranscriptControls;
|
|
79
|
-
/** Shows or hides Stop. The typing indicator no longer rides on this. */
|
|
80
|
-
private setResponding;
|
|
81
|
-
/** The session can no longer produce a reply: stop waiting, stop offering
|
|
82
|
-
* Stop, and redraw so the transcript agrees. */
|
|
83
|
-
private endSession;
|
|
84
|
-
/** Same `Author: text` shape the playground's Copy chat produces. */
|
|
85
|
-
private copyTranscript;
|
|
86
|
-
private writeToClipboard;
|
|
87
|
-
/**
|
|
88
|
-
* A published session is bound to the room it connected with: the character
|
|
89
|
-
* session id travels in the connect request, not in each `user_text_message`,
|
|
90
|
-
* so `ConvaiClient.resetSession()` would clear the transcript while the server
|
|
91
|
-
* kept the previous conversation. Reconnecting on a fresh launch grant is the
|
|
92
|
-
* only reset the published flow supports, and `start()` already tears the old
|
|
93
|
-
* client down before requesting one.
|
|
94
|
-
*/
|
|
95
|
-
private resetSession;
|
|
96
|
-
private retryElement;
|
|
97
|
-
/** Held as state, not a one-off append: a typing or message re-render would
|
|
98
|
-
* otherwise clear the only control left after a failed connection. */
|
|
99
|
-
private showRetry;
|
|
100
|
-
private dispatch;
|
|
101
|
-
}
|
|
102
|
-
export declare function defineConvaiChatElement(registry?: CustomElementRegistry): void;
|
|
103
|
-
//# sourceMappingURL=ConvaiChatElement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConvaiChatElement.d.ts","sourceRoot":"","sources":["../../src/embed/ConvaiChatElement.ts"],"names":[],"mappings":"AA6KA,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,OAAO,CAAC,MAAM,CAA6B;IAC3C,OAAO,CAAC,UAAU,CAAgC;IAClD,OAAO,CAAC,MAAM,CAAyB;IACvC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,QAAQ,CAAqB;IACrC,OAAO,CAAC,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