@pmate/chat-sdk 0.4.0 → 0.4.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/index.d.ts CHANGED
@@ -31,3 +31,4 @@ export * from "./voice/Recorder";
31
31
  export * from "./mentions/model";
32
32
  export * from "./hooks/useMentions";
33
33
  export * from "./components/MentionMenu";
34
+ export * from "./runtime/activity";
package/lib/index.js CHANGED
@@ -31,3 +31,4 @@ export * from "./voice/Recorder";
31
31
  export * from "./mentions/model";
32
32
  export * from "./hooks/useMentions";
33
33
  export * from "./components/MentionMenu";
34
+ export * from "./runtime/activity";
@@ -114,7 +114,10 @@ export class ChatActivityPublisher {
114
114
  await this.send({ ...current, seq: this.seq++ });
115
115
  }
116
116
  catch (error) {
117
- this.onError(error);
117
+ try {
118
+ this.onError(error);
119
+ }
120
+ catch { /* Error reporting must not break progress cleanup. */ }
118
121
  }
119
122
  }
120
123
  }
@@ -42,8 +42,11 @@ export class ChatClient {
42
42
  this.client.on(ChatRealtimeEvents.Message, (message) => {
43
43
  this.handleIncoming(message);
44
44
  });
45
- this.client.on(ChatRealtimeEvents.Connected, (connected) => { if (!connected)
46
- this.activities.clear(); });
45
+ this.client.on(ChatRealtimeEvents.Connected, (connected) => { if (!connected) {
46
+ for (const publisher of this.publishers)
47
+ void publisher.stop();
48
+ this.activities.clear();
49
+ } });
47
50
  await this.waitUntilConnected();
48
51
  await this.sendAuth();
49
52
  return this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/chat-sdk",
3
- "version": "0.4.0",
3
+ "version": "0.4.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",