@exotel-npm-dev/exotel-ai-assist 1.2.2 → 1.2.3

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.
@@ -1811,7 +1811,7 @@ class ExotelAIAssistController extends EventEmitter {
1811
1811
  this.emit("streamState", state);
1812
1812
  if (state === "connected" || state === "throttled") {
1813
1813
  this._fireReady();
1814
- } else if (state === "disconnected" && this.readyFired) {
1814
+ } else if ((state === "connection_timeout" || state === "disconnected") && this.readyFired) {
1815
1815
  this.readyFired = false;
1816
1816
  this.emit("onReady", false);
1817
1817
  }
package/dist/index.js CHANGED
@@ -21229,7 +21229,7 @@ class ExotelAIAssistController extends EventEmitter {
21229
21229
  this.emit("streamState", state);
21230
21230
  if (state === "connected" || state === "throttled") {
21231
21231
  this._fireReady();
21232
- } else if (state === "disconnected" && this.readyFired) {
21232
+ } else if ((state === "connection_timeout" || state === "disconnected") && this.readyFired) {
21233
21233
  this.readyFired = false;
21234
21234
  this.emit("onReady", false);
21235
21235
  }
@@ -21899,7 +21899,7 @@ function ExotelAIAssist(_a) {
21899
21899
  warningBannerMessage: "AI Assist couldn't join this call \u2014 capacity is full. It should be ready for your next call."
21900
21900
  });
21901
21901
  }
21902
- if (streamState === "disconnected") {
21902
+ if (streamState === "connection_timeout") {
21903
21903
  return jsxRuntimeExports.jsx(EmptyState, {
21904
21904
  title: "AI Assist is currently inactive",
21905
21905
  subtitle: "we were unable to establish a connection."
@@ -6515,7 +6515,7 @@ class ExotelAIAssistController extends EventEmitter {
6515
6515
  this.emit("streamState", state);
6516
6516
  if (state === "connected" || state === "throttled") {
6517
6517
  this._fireReady();
6518
- } else if (state === "disconnected" && this.readyFired) {
6518
+ } else if ((state === "connection_timeout" || state === "disconnected") && this.readyFired) {
6519
6519
  this.readyFired = false;
6520
6520
  this.emit("onReady", false);
6521
6521
  }
@@ -7185,7 +7185,7 @@ function ExotelAIAssist(_a) {
7185
7185
  warningBannerMessage: "AI Assist couldn't join this call \u2014 capacity is full. It should be ready for your next call."
7186
7186
  });
7187
7187
  }
7188
- if (streamState === "disconnected") {
7188
+ if (streamState === "connection_timeout") {
7189
7189
  return jsxRuntime.jsx(EmptyState, {
7190
7190
  title: "AI Assist is currently inactive",
7191
7191
  subtitle: "we were unable to establish a connection."
@@ -38,7 +38,7 @@ export type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnect
38
38
  * - `throttled` – capacity full; the bot cannot join this call
39
39
  * - `pending` – stream is pending
40
40
  */
41
- export type StreamState = "connected" | "throttled" | "pending" | "disconnected";
41
+ export type StreamState = "connected" | "throttled" | "pending" | "disconnected" | 'connection_timeout';
42
42
  /** Feature-flag config received from the AI Assist backend. */
43
43
  export interface BotConfig {
44
44
  sentiment: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exotel-npm-dev/exotel-ai-assist",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "AI-powered real-time suggestions, transcript, and sentiment for agent calls",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
@@ -41,7 +41,7 @@ export function ExotelAIAssist({ className, onReady, ...params }: ExotelAIAssist
41
41
  />
42
42
  );
43
43
  }
44
- if (streamState === "disconnected") {
44
+ if (streamState === "connection_timeout") {
45
45
  return <EmptyState title="AI Assist is currently inactive" subtitle="we were unable to establish a connection." />;
46
46
  }
47
47
  return null;
@@ -225,7 +225,7 @@ export class ExotelAIAssistController extends EventEmitter<ControllerEvents> {
225
225
  if (!event) continue;
226
226
 
227
227
  if (event.event_type === "transcript" && event.value) {
228
- const transcripts = Array.isArray(event?.value) ? event.value : event?.transcript ?? []
228
+ const transcripts = Array.isArray(event?.value) ? event.value : (event?.transcript ?? []);
229
229
  const lines: TranscriptLine[] = transcripts.map((msg) => {
230
230
  const first = msg.transcript_segments?.[0];
231
231
  const last = msg.transcript_segments?.[msg.transcript_segments.length - 1];
@@ -264,7 +264,7 @@ export class ExotelAIAssistController extends EventEmitter<ControllerEvents> {
264
264
  this.emit("streamState", state);
265
265
  if (state === "connected" || state === "throttled") {
266
266
  this._fireReady();
267
- } else if (state === "disconnected" && this.readyFired) {
267
+ } else if ((state === "connection_timeout" || state === "disconnected") && this.readyFired) {
268
268
  this.readyFired = false;
269
269
  this.emit("onReady", false);
270
270
  }
@@ -43,7 +43,7 @@ export type ConnectionStatus = "idle" | "connecting" | "connected" | "disconnect
43
43
  * - `throttled` – capacity full; the bot cannot join this call
44
44
  * - `pending` – stream is pending
45
45
  */
46
- export type StreamState = "connected" | "throttled" | "pending" | "disconnected";
46
+ export type StreamState = "connected" | "throttled" | "pending" | "disconnected" | 'connection_timeout';
47
47
 
48
48
  // ---------------------------------------------------------------------------
49
49
  // Internal-only backend response types