@simfinity/constellation-client 1.0.5 → 1.0.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/dist/index.cjs CHANGED
@@ -152,27 +152,30 @@ var WebClient = class {
152
152
  handlers.onStreamClosed(`WebSocket closed by peer: ${event.reason}`);
153
153
  };
154
154
  ws.onmessage = async (event) => {
155
- var _a, _b, _c, _d, _e, _f;
155
+ var _a, _b, _c, _d, _e, _f, _g;
156
156
  try {
157
157
  const data = JSON.parse(event.data);
158
158
  switch (data.type) {
159
+ case "session.configured":
160
+ (_a = handlers.onSessionConfigured) == null ? void 0 : _a.call(handlers, data);
161
+ break;
159
162
  case "audio.response.start":
160
- (_a = handlers.onAudioResponseStart) == null ? void 0 : _a.call(handlers);
163
+ (_b = handlers.onAudioResponseStart) == null ? void 0 : _b.call(handlers);
161
164
  break;
162
165
  case "audio.response.append":
163
- (_b = handlers.onAudioResponseChunk) == null ? void 0 : _b.call(handlers, data.data.audioData);
166
+ (_c = handlers.onAudioResponseChunk) == null ? void 0 : _c.call(handlers, data.data.audioData);
164
167
  break;
165
168
  case "audio.response.done":
166
- (_c = handlers.onAudioResponseEnd) == null ? void 0 : _c.call(handlers);
169
+ (_d = handlers.onAudioResponseEnd) == null ? void 0 : _d.call(handlers);
167
170
  break;
168
171
  case "transcript.input":
169
- (_d = handlers.onTranscriptInput) == null ? void 0 : _d.call(handlers, data.data.transcript);
172
+ (_e = handlers.onTranscriptInput) == null ? void 0 : _e.call(handlers, data.data.transcript);
170
173
  break;
171
174
  case "transcript.response":
172
- (_e = handlers.onTranscriptResponse) == null ? void 0 : _e.call(handlers, data.data.transcript);
175
+ (_f = handlers.onTranscriptResponse) == null ? void 0 : _f.call(handlers, data.data.transcript);
173
176
  break;
174
177
  case "technical.error":
175
- (_f = handlers.onTechnicalError) == null ? void 0 : _f.call(handlers, data.data.error);
178
+ (_g = handlers.onTechnicalError) == null ? void 0 : _g.call(handlers, data.data.error);
176
179
  break;
177
180
  default:
178
181
  break;
package/dist/index.js CHANGED
@@ -126,27 +126,30 @@ var WebClient = class {
126
126
  handlers.onStreamClosed(`WebSocket closed by peer: ${event.reason}`);
127
127
  };
128
128
  ws.onmessage = async (event) => {
129
- var _a, _b, _c, _d, _e, _f;
129
+ var _a, _b, _c, _d, _e, _f, _g;
130
130
  try {
131
131
  const data = JSON.parse(event.data);
132
132
  switch (data.type) {
133
+ case "session.configured":
134
+ (_a = handlers.onSessionConfigured) == null ? void 0 : _a.call(handlers, data);
135
+ break;
133
136
  case "audio.response.start":
134
- (_a = handlers.onAudioResponseStart) == null ? void 0 : _a.call(handlers);
137
+ (_b = handlers.onAudioResponseStart) == null ? void 0 : _b.call(handlers);
135
138
  break;
136
139
  case "audio.response.append":
137
- (_b = handlers.onAudioResponseChunk) == null ? void 0 : _b.call(handlers, data.data.audioData);
140
+ (_c = handlers.onAudioResponseChunk) == null ? void 0 : _c.call(handlers, data.data.audioData);
138
141
  break;
139
142
  case "audio.response.done":
140
- (_c = handlers.onAudioResponseEnd) == null ? void 0 : _c.call(handlers);
143
+ (_d = handlers.onAudioResponseEnd) == null ? void 0 : _d.call(handlers);
141
144
  break;
142
145
  case "transcript.input":
143
- (_d = handlers.onTranscriptInput) == null ? void 0 : _d.call(handlers, data.data.transcript);
146
+ (_e = handlers.onTranscriptInput) == null ? void 0 : _e.call(handlers, data.data.transcript);
144
147
  break;
145
148
  case "transcript.response":
146
- (_e = handlers.onTranscriptResponse) == null ? void 0 : _e.call(handlers, data.data.transcript);
149
+ (_f = handlers.onTranscriptResponse) == null ? void 0 : _f.call(handlers, data.data.transcript);
147
150
  break;
148
151
  case "technical.error":
149
- (_f = handlers.onTechnicalError) == null ? void 0 : _f.call(handlers, data.data.error);
152
+ (_g = handlers.onTechnicalError) == null ? void 0 : _g.call(handlers, data.data.error);
150
153
  break;
151
154
  default:
152
155
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simfinity/constellation-client",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {