@decartai/sdk 0.0.46 → 0.0.47

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.
@@ -43,6 +43,9 @@ type RealTimeClientConnectOptions = z.infer<typeof realTimeClientConnectOptionsS
43
43
  type Events = {
44
44
  connectionChange: ConnectionState;
45
45
  error: DecartSDKError;
46
+ generationTick: {
47
+ seconds: number;
48
+ };
46
49
  };
47
50
  type RealTimeClient = {
48
51
  set: (input: SetInput) => Promise<void>;
@@ -116,6 +116,10 @@ const createRealTimeClient = (opts) => {
116
116
  sessionId = msg.session_id;
117
117
  };
118
118
  manager.getWebsocketMessageEmitter().on("sessionId", sessionIdListener);
119
+ const tickListener = (msg) => {
120
+ emitOrBuffer("generationTick", { seconds: msg.seconds });
121
+ };
122
+ manager.getWebsocketMessageEmitter().on("generationTick", tickListener);
119
123
  await manager.connect(inputStream);
120
124
  const methods = realtimeMethods(manager, imageToBase64);
121
125
  if (!isAvatarLive && initialState?.prompt) {
@@ -98,6 +98,11 @@ var WebRTCConnection = class {
98
98
  this.setState("generating");
99
99
  return;
100
100
  }
101
+ if (msg.type === "generation_tick") {
102
+ this.websocketMessagesEmitter.emit("generationTick", msg);
103
+ return;
104
+ }
105
+ if (msg.type === "generation_ended") return;
101
106
  if (msg.type === "session_id") {
102
107
  this.websocketMessagesEmitter.emit("sessionId", msg);
103
108
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decartai/sdk",
3
- "version": "0.0.46",
3
+ "version": "0.0.47",
4
4
  "description": "Decart's JavaScript SDK",
5
5
  "type": "module",
6
6
  "license": "MIT",