@pmate/chat-sdk 0.6.0 → 0.6.1
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/lib/runtime/call.js +14 -2
- package/package.json +2 -3
- package/dist/assets/ChatInput.stories-BQcIQDVE.js +0 -1852
- package/dist/assets/Color-AVL7NMMY-Q9rY0eHd.js +0 -1
- package/dist/assets/DocsRenderer-PQXLIZUC-B5DlnesB.js +0 -1243
- package/dist/assets/client-DTiYOHAb.js +0 -9
- package/dist/assets/iframe-1QrxCBqr.js +0 -1071
- package/dist/assets/iframe-4FbYaDjf.css +0 -1
- package/dist/assets/index-CkqBtKlT.js +0 -1
- package/dist/assets/preload-helper-PPVm8Dsz.js +0 -1
- package/dist/assets/react-18-6BKf31wF.js +0 -1
- package/dist/favicon-wrapper.svg +0 -46
- package/dist/favicon.svg +0 -1
- package/dist/iframe.html +0 -687
- package/dist/index.html +0 -148
- package/dist/index.json +0 -1
- package/dist/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/nunito-sans-bold.woff2 +0 -0
- package/dist/nunito-sans-italic.woff2 +0 -0
- package/dist/nunito-sans-regular.woff2 +0 -0
- package/dist/project.json +0 -1
- package/dist/sb-addons/docs-1/manager-bundle.js +0 -151
- package/dist/sb-addons/docs-1/manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +0 -971
- package/dist/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js.LEGAL.txt +0 -0
- package/dist/sb-common-assets/favicon-wrapper.svg +0 -46
- package/dist/sb-common-assets/favicon.svg +0 -1
- package/dist/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/dist/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/dist/sb-manager/globals-module-info.js +0 -799
- package/dist/sb-manager/globals-runtime.js +0 -69791
- package/dist/sb-manager/globals.js +0 -34
- package/dist/sb-manager/runtime.js +0 -13198
- package/dist/vite-inject-mocker-entry.js +0 -2
package/lib/runtime/call.js
CHANGED
|
@@ -32,8 +32,18 @@ export class CallClient {
|
|
|
32
32
|
ws.onmessage = event => {
|
|
33
33
|
if (this.ws !== ws)
|
|
34
34
|
return;
|
|
35
|
-
this.queue = this.queue.then(async () => {
|
|
36
|
-
|
|
35
|
+
this.queue = this.queue.then(async () => {
|
|
36
|
+
if (this.ws !== ws)
|
|
37
|
+
return;
|
|
38
|
+
const gen = this.generation;
|
|
39
|
+
try {
|
|
40
|
+
await this.receive(JSON.parse(String(event.data)));
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
if (gen === this.generation)
|
|
44
|
+
this.fail("CONNECTION_FAILED");
|
|
45
|
+
}
|
|
46
|
+
});
|
|
37
47
|
};
|
|
38
48
|
ws.onerror = () => { };
|
|
39
49
|
ws.onclose = event => {
|
|
@@ -175,6 +185,8 @@ export class CallClient {
|
|
|
175
185
|
return false;
|
|
176
186
|
}
|
|
177
187
|
this.microphone = stream;
|
|
188
|
+
stream.getAudioTracks().forEach(track => { track.onended = () => { if (gen === this.generation)
|
|
189
|
+
this.fail("MICROPHONE_DENIED"); }; });
|
|
178
190
|
return true;
|
|
179
191
|
}
|
|
180
192
|
armTimeout(ms) { clearTimeout(this.timeout); this.timeout = setTimeout(() => this.fail("CONNECTION_TIMEOUT"), ms); }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pmate/chat-sdk",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Cross-platform PMate chat input components, voice input primitives, and ASR helpers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://github.com/parrot-mate/pmate-mono/tree/main/packages/chat-sdk",
|
|
13
13
|
"files": [
|
|
14
|
-
"lib"
|
|
15
|
-
"dist"
|
|
14
|
+
"lib"
|
|
16
15
|
],
|
|
17
16
|
"exports": {
|
|
18
17
|
".": {
|