@elevenlabs/convai-widget-core 0.14.8 → 0.14.9

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.js CHANGED
@@ -25,7 +25,7 @@ var oe = Object.create, se = Object.defineProperty, ce = Object.getOwnPropertyDe
25
25
  }, he = (e, t, n) => (n = e == null ? {} : oe(ue(e)), me(t || !e || !e.__esModule ? se(n, "default", {
26
26
  value: e,
27
27
  enumerable: !0
28
- }) : n, e)), ge = "0.14.8";
28
+ }) : n, e)), ge = "0.14.9";
29
29
  //#endregion
30
30
  //#region src/types/attributes.ts
31
31
  function _e(e) {
@@ -3119,7 +3119,7 @@ function ra() {
3119
3119
  type: "message",
3120
3120
  role: e,
3121
3121
  message: t,
3122
- isText: !1,
3122
+ isText: C.peek() === !0,
3123
3123
  conversationIndex: S.peek(),
3124
3124
  eventId: a
3125
3125
  }];
@@ -3593,25 +3593,33 @@ function Ha(e, t) {
3593
3593
  let e = r.get(t.eventId);
3594
3594
  e && (e.loading--, t.isError ? e.error++ : e.success++);
3595
3595
  }
3596
- for (let i of e) {
3597
- if (i.type === "agent_tool_request" || i.type === "agent_tool_response" || i.type === "message" && i.role === "agent" && !i.message && !(t.showAgentStatus && i.eventId != null && r.has(i.eventId)) || !t.transcriptEnabled && i.type === "message" && !i.isText) continue;
3596
+ let i = !1;
3597
+ for (let a of e) {
3598
+ if (a.type === "agent_tool_request" || a.type === "agent_tool_response") {
3599
+ i = !0;
3600
+ continue;
3601
+ }
3602
+ if (a.type === "message" && a.role === "agent" && !a.message && !(t.showAgentStatus && a.eventId != null && r.has(a.eventId)) || !t.transcriptEnabled && a.type === "message" && !a.isText) continue;
3598
3603
  let e = n[n.length - 1];
3599
- if (i.type === "message" && i.eventId != null && e?.type === "message" && e.eventId === i.eventId && e.role === i.role) {
3600
- n[n.length - 1] = i;
3604
+ if (a.type === "message" && a.eventId != null && e?.type === "message" && e.eventId === a.eventId && e.role === a.role && (!i || !e.message.trim())) {
3605
+ n[n.length - 1] = a;
3601
3606
  continue;
3602
3607
  }
3603
- n.push(i);
3608
+ n.push(a), i = !1;
3604
3609
  }
3605
- if (t.showAgentStatus) for (let e = 0; e < n.length; e++) {
3606
- let t = n[e];
3607
- if (t.type !== "message" || t.role !== "agent" || t.eventId == null) continue;
3608
- let i = r.get(t.eventId);
3609
- if (!i) continue;
3610
- let a = i.loading > 0 ? Va.LOADING : i.error > 0 ? Va.ERROR : Va.SUCCESS;
3611
- n[e] = {
3612
- ...t,
3613
- toolStatus: a
3614
- };
3610
+ if (t.showAgentStatus) {
3611
+ let e = /* @__PURE__ */ new Set();
3612
+ for (let t = 0; t < n.length; t++) {
3613
+ let i = n[t];
3614
+ if (i.type !== "message" || i.role !== "agent" || i.eventId == null || e.has(i.eventId)) continue;
3615
+ let a = r.get(i.eventId);
3616
+ if (!a) continue;
3617
+ let o = a.loading > 0 ? Va.LOADING : a.error > 0 ? Va.ERROR : Va.SUCCESS;
3618
+ n[t] = {
3619
+ ...i,
3620
+ toolStatus: o
3621
+ }, e.add(i.eventId);
3622
+ }
3615
3623
  }
3616
3624
  return t.showTypingIndicator && n.push({
3617
3625
  type: "typing_indicator",
@@ -439,6 +439,55 @@ export declare const AGENTS: {
439
439
  max_files_per_conversation?: number;
440
440
  };
441
441
  };
442
+ readonly markdown_agent_response: {
443
+ readonly text_only: true;
444
+ readonly transcript_enabled: true;
445
+ readonly text_input_enabled: true;
446
+ readonly terms_html: undefined;
447
+ readonly default_expanded: true;
448
+ readonly markdown_link_allowed_hosts: [{
449
+ readonly hostname: "*";
450
+ }];
451
+ readonly first_message: "Agent response";
452
+ readonly variant: import("../types/config").Variant;
453
+ readonly placement: import("../types/config").Placement;
454
+ readonly markdown_link_include_www?: boolean;
455
+ readonly markdown_link_allow_http?: boolean;
456
+ readonly avatar: import("../types/config").AvatarConfig;
457
+ readonly feedback_mode: import("../types/config").FeedbackMode;
458
+ readonly end_feedback?: {
459
+ type: import("../types/config").FeedbackType;
460
+ } | null;
461
+ readonly language: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage;
462
+ readonly supported_language_overrides?: import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage[];
463
+ readonly terms_text?: string | null;
464
+ readonly terms_key?: string;
465
+ readonly mic_muting_enabled: boolean;
466
+ readonly always_expanded: boolean;
467
+ readonly dismissible: boolean;
468
+ readonly strip_audio_tags?: boolean;
469
+ readonly text_contents: Partial<import("../types/config").TextContents>;
470
+ readonly styles?: Partial<import("../types/config").Styles>;
471
+ readonly language_presets: Partial<Record<import("@elevenlabs/types").ConversationConfigOverrideAgentLanguage, {
472
+ text_contents?: Partial<import("../types/config").TextContents>;
473
+ first_message?: string;
474
+ terms_html?: string | null;
475
+ terms_text?: string | null;
476
+ terms_key?: string;
477
+ }>>;
478
+ readonly disable_banner: boolean;
479
+ readonly override_link?: string;
480
+ readonly supports_text_only: boolean;
481
+ readonly use_rtc?: boolean;
482
+ readonly syntax_highlight_theme?: import("../types/config").SyntaxHighlightTheme;
483
+ readonly conversation_mode_toggle_enabled?: boolean;
484
+ readonly show_agent_status?: boolean;
485
+ readonly show_conversation_id?: boolean;
486
+ readonly file_input_config?: {
487
+ enabled?: boolean;
488
+ max_files_per_conversation?: number;
489
+ };
490
+ };
442
491
  readonly tool_call: {
443
492
  readonly text_only: true;
444
493
  readonly transcript_enabled: true;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "0.14.8";
1
+ export declare const PACKAGE_VERSION = "0.14.9";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevenlabs/convai-widget-core",
3
- "version": "0.14.8",
3
+ "version": "0.14.9",
4
4
  "description": "The common library for the Conversational AI Widget.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -60,7 +60,7 @@
60
60
  "remark-parse": "^11.0.0",
61
61
  "remark-rehype": "^11.1.2",
62
62
  "tailwind-merge": "^3.4.0",
63
- "@elevenlabs/client": "1.14.0"
63
+ "@elevenlabs/client": "1.14.1"
64
64
  },
65
65
  "publishConfig": {
66
66
  "access": "public"