@copilotkit/vue 1.59.5-canary.1781104893 → 1.60.0

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.
@@ -1,4 +1,4 @@
1
- import { defineComponent as se, useAttrs as Ge, shallowRef as it, onMounted as Je, onUnmounted as dn, openBlock as R, createBlock as he, resolveDynamicComponent as mt, mergeProps as ge, unref as G, createCommentVNode as Q, inject as Ct, ref as I, watch as L, computed as c, onBeforeUnmount as Me, h as y, nextTick as ft, getCurrentInstance as lt, createElementBlock as j, normalizeStyle as rt, createElementVNode as M, toDisplayString as ke, triggerRef as ot, provide as It, Fragment as Re, renderSlot as T, toValue as _e, renderList as Ke, createVNode as oe, withMemo as pa, createSlots as qe, withCtx as W, normalizeProps as q, guardReactiveProps as J, normalizeClass as ye, createTextVNode as qt, readonly as Ut, withModifiers as Ht, Teleport as fa, useSlots as pn, onScopeDispose as Kt } from "vue";
1
+ import { defineComponent as se, useAttrs as Ge, shallowRef as it, onMounted as Je, onUnmounted as dn, openBlock as R, createBlock as he, resolveDynamicComponent as mt, mergeProps as ge, unref as G, createCommentVNode as Q, inject as Ct, ref as I, watch as L, computed as c, onBeforeUnmount as Me, h as w, nextTick as ft, getCurrentInstance as lt, createElementBlock as j, normalizeStyle as rt, createElementVNode as M, toDisplayString as ke, triggerRef as ot, provide as It, Fragment as Re, renderSlot as T, toValue as _e, renderList as Ke, createVNode as oe, withMemo as pa, createSlots as qe, withCtx as W, normalizeProps as q, guardReactiveProps as J, normalizeClass as ye, createTextVNode as qt, readonly as Ut, withModifiers as Ht, Teleport as fa, useSlots as pn, onScopeDispose as Kt } from "vue";
2
2
  import { z as ce } from "zod";
3
3
  import { randomUUID as pt, A2UI_DEFAULT_GENERATION_GUIDELINES as ga, A2UI_DEFAULT_DESIGN_GUIDELINES as va, createLicenseContextValue as qn, schemaToJsonSchema as ma, DEFAULT_AGENT_ID as ct, partialJSONParse as In, matchesAcceptFilter as en, exceedsMaxSize as ha, formatFileSize as on, getModalityFromMimeType as ba, readFileAsBase64 as ka, generateVideoThumbnail as ya, TranscriptionErrorCode as Xe, getSourceUrl as wt, getDocumentIcon as sn } from "@copilotkit/shared";
4
4
  import { zodToJsonSchema as fn } from "zod-to-json-schema";
@@ -179,22 +179,22 @@ const wo = se({
179
179
  inProgress: !1,
180
180
  promise: null,
181
181
  resourceUri: null
182
- }), w = (C) => {
182
+ }), k = (C) => {
183
183
  a.value?.contentWindow && a.value.contentWindow.postMessage(C, "*");
184
184
  }, u = (C, m) => {
185
- w({
185
+ k({
186
186
  jsonrpc: "2.0",
187
187
  id: C,
188
188
  result: m
189
189
  });
190
190
  }, d = (C, m, x) => {
191
- w({
191
+ k({
192
192
  jsonrpc: "2.0",
193
193
  id: C,
194
194
  error: { code: m, message: x }
195
195
  });
196
196
  }, g = (C, m) => {
197
- w({
197
+ k({
198
198
  jsonrpc: "2.0",
199
199
  method: C,
200
200
  params: m || {}
@@ -204,7 +204,7 @@ const wo = se({
204
204
  [() => e.agent, () => e.content],
205
205
  ([C, m]) => {
206
206
  s.value = !0, o.value = null, i.value = !1, r.value = {}, l.value = null;
207
- const { resourceUri: x, serverHash: f, serverId: k } = m;
207
+ const { resourceUri: x, serverHash: f, serverId: y } = m;
208
208
  if (p.value.inProgress && p.value.resourceUri === x) {
209
209
  p.value.promise?.then((b) => {
210
210
  b && (l.value = b, s.value = !1);
@@ -226,7 +226,7 @@ const wo = se({
226
226
  forwardedProps: {
227
227
  __proxiedMCPRequest: {
228
228
  serverHash: f,
229
- serverId: k,
229
+ serverId: y,
230
230
  method: "resources/read",
231
231
  params: { uri: x }
232
232
  }
@@ -252,8 +252,8 @@ const wo = se({
252
252
  ([C, m], x, f) => {
253
253
  if (C || !m)
254
254
  return;
255
- const k = t.value;
256
- if (!k)
255
+ const y = t.value;
256
+ if (!y)
257
257
  return;
258
258
  let v = !0, b = null, S = null, O = null;
259
259
  (async () => {
@@ -273,7 +273,7 @@ const wo = se({
273
273
  return;
274
274
  }
275
275
  const Y = l.value?._meta?.ui?.csp?.resourceDomains;
276
- if ($.srcdoc = vo(Y), a.value = $, k.appendChild($), await P, !v) return;
276
+ if ($.srcdoc = vo(Y), a.value = $, y.appendChild($), await P, !v) return;
277
277
  b = async (te) => {
278
278
  if (te.source !== $.contentWindow) return;
279
279
  const K = te.data;
@@ -448,7 +448,7 @@ const wo = se({
448
448
  return Me(() => {
449
449
  const C = e.agent?.threadId || "default";
450
450
  Bt.cancel(C);
451
- }), () => y(
451
+ }), () => w(
452
452
  "div",
453
453
  {
454
454
  ref: t,
@@ -462,12 +462,12 @@ const wo = se({
462
462
  }
463
463
  },
464
464
  [
465
- s.value ? y(
465
+ s.value ? w(
466
466
  "div",
467
467
  { style: { padding: "1rem", color: "#666" } },
468
468
  "Loading..."
469
469
  ) : null,
470
- o.value ? y(
470
+ o.value ? w(
471
471
  "div",
472
472
  { style: { color: "red", padding: "1rem" } },
473
473
  `Error: ${o.value.message}`
@@ -565,7 +565,7 @@ const Rn = "a2ui_operations", Co = se({
565
565
  name: "DefaultA2UILoading",
566
566
  setup() {
567
567
  const e = [0.8, 0.6, 0.4];
568
- return () => y(
568
+ return () => w(
569
569
  "div",
570
570
  {
571
571
  class: "cpk:flex cpk:flex-col cpk:gap-3 cpk:rounded-xl cpk:border cpk:border-gray-100 cpk:bg-gray-50/50 cpk:p-5",
@@ -573,15 +573,15 @@ const Rn = "a2ui_operations", Co = se({
573
573
  "data-testid": "a2ui-loading"
574
574
  },
575
575
  [
576
- y("div", { class: "cpk:flex cpk:items-center cpk:gap-2" }, [
577
- y("div", {
576
+ w("div", { class: "cpk:flex cpk:items-center cpk:gap-2" }, [
577
+ w("div", {
578
578
  class: "cpk:h-3 cpk:w-3 cpk:rounded-full cpk:bg-gray-200",
579
579
  style: {
580
580
  animation: "cpk-a2ui-pulse 1.5s ease-in-out infinite"
581
581
  },
582
582
  "data-testid": "a2ui-loading-dot"
583
583
  }),
584
- y(
584
+ w(
585
585
  "span",
586
586
  {
587
587
  class: "cpk:text-xs cpk:font-medium cpk:text-gray-400"
@@ -589,11 +589,11 @@ const Rn = "a2ui_operations", Co = se({
589
589
  "Generating UI..."
590
590
  )
591
591
  ]),
592
- y(
592
+ w(
593
593
  "div",
594
594
  { class: "cpk:flex cpk:flex-col cpk:gap-2" },
595
595
  e.map(
596
- (n, t) => y("div", {
596
+ (n, t) => w("div", {
597
597
  key: t,
598
598
  class: "cpk:h-3 cpk:rounded cpk:bg-gray-200/70",
599
599
  style: {
@@ -604,7 +604,7 @@ const Rn = "a2ui_operations", Co = se({
604
604
  })
605
605
  )
606
606
  ),
607
- y(
607
+ w(
608
608
  "style",
609
609
  {},
610
610
  `@keyframes cpk-a2ui-pulse {
@@ -636,7 +636,7 @@ function To(e) {
636
636
  const t = c(
637
637
  () => Array.isArray(n.content?.[Rn]) ? n.content[Rn] : []
638
638
  );
639
- return () => t.value.length === 0 ? e.loadingComponent ? y(e.loadingComponent) : y(Co) : y(Ms, {
639
+ return () => t.value.length === 0 ? e.loadingComponent ? w(e.loadingComponent) : w(Co) : w(Ms, {
640
640
  activityType: "a2ui-surface",
641
641
  content: { operations: t.value },
642
642
  message: n.message,
@@ -671,9 +671,9 @@ function So(e, n) {
671
671
  args: p
672
672
  }) => {
673
673
  if (l === "complete") return null;
674
- const w = p, u = w?.items;
674
+ const k = p, u = k?.items;
675
675
  if (Array.isArray(u) && u.length > 0) return null;
676
- const d = w?.components;
676
+ const d = k?.components;
677
677
  return Array.isArray(d) && d.length > 2 ? null : Io(p);
678
678
  }
679
679
  }), r = t.propRenderToolCalls;
@@ -701,7 +701,7 @@ function Io(e) {
701
701
  const u = JSON.stringify(e ?? {}).length;
702
702
  o = Math.round(u / 4), a.lastTime = i, a.lastTokens = o;
703
703
  }
704
- const s = o < 50 ? 0 : o < 200 ? 1 : o < 400 ? 2 : 3, r = () => y("div", {
704
+ const s = o < 50 ? 0 : o < 200 ? 1 : o < 400 ? 2 : 3, r = () => w("div", {
705
705
  style: {
706
706
  width: "7px",
707
707
  height: "7px",
@@ -709,7 +709,7 @@ function Io(e) {
709
709
  backgroundColor: "#d4d4d8",
710
710
  flexShrink: 0
711
711
  }
712
- }), l = () => y("div", { style: { width: "12px" } }), p = (u, d, g, h, C, m) => y("div", {
712
+ }), l = () => w("div", { style: { width: "12px" } }), p = (u, d, g, h, C, m) => w("div", {
713
713
  style: {
714
714
  width: `${u}px`,
715
715
  height: `${d}px`,
@@ -721,7 +721,7 @@ function Io(e) {
721
721
  ...C !== void 0 ? { opacity: C } : {},
722
722
  ...m ? { transition: m } : {}
723
723
  }
724
- }), w = (u, d, g) => y(
724
+ }), k = (u, d, g) => w(
725
725
  "div",
726
726
  {
727
727
  style: {
@@ -734,8 +734,8 @@ function Io(e) {
734
734
  },
735
735
  g
736
736
  );
737
- return y("div", { style: { margin: "12px 0", maxWidth: "320px" } }, [
738
- y(
737
+ return w("div", { style: { margin: "12px 0", maxWidth: "320px" } }, [
738
+ w(
739
739
  "div",
740
740
  {
741
741
  style: {
@@ -750,7 +750,7 @@ function Io(e) {
750
750
  },
751
751
  [
752
752
  // Top bar
753
- y(
753
+ w(
754
754
  "div",
755
755
  {
756
756
  style: {
@@ -761,7 +761,7 @@ function Io(e) {
761
761
  }
762
762
  },
763
763
  [
764
- y("div", { style: { display: "flex", gap: "4px" } }, [
764
+ w("div", { style: { display: "flex", gap: "4px" } }, [
765
765
  r(),
766
766
  r(),
767
767
  r()
@@ -777,38 +777,38 @@ function Io(e) {
777
777
  ]
778
778
  ),
779
779
  // Skeleton lines
780
- y("div", { style: { display: "grid", gap: "7px" } }, [
781
- w(s >= 0, 0, [
780
+ w("div", { style: { display: "grid", gap: "7px" } }, [
781
+ k(s >= 0, 0, [
782
782
  p(36, 7, "rgba(147,197,253,0.7)", 0),
783
783
  p(80, 7, "rgba(219,234,254,0.8)", 0.2)
784
784
  ]),
785
- w(s >= 0, 0.1, [
785
+ k(s >= 0, 0.1, [
786
786
  l(),
787
787
  r(),
788
788
  p(100, 7, "rgba(24,24,27,0.2)", 0.3)
789
789
  ]),
790
- w(s >= 1, 0.15, [
790
+ k(s >= 1, 0.15, [
791
791
  l(),
792
792
  p(48, 7, "rgba(24,24,27,0.15)", 0.1),
793
793
  p(40, 7, "rgba(153,246,228,0.6)", 0.5),
794
794
  p(56, 7, "rgba(147,197,253,0.6)", 0.3)
795
795
  ]),
796
- w(s >= 1, 0.2, [
796
+ k(s >= 1, 0.2, [
797
797
  l(),
798
798
  r(),
799
799
  p(60, 7, "rgba(24,24,27,0.15)", 0.4)
800
800
  ]),
801
- w(s >= 2, 0.25, [
801
+ k(s >= 2, 0.25, [
802
802
  p(40, 7, "rgba(153,246,228,0.5)", 0.2),
803
803
  r(),
804
804
  p(48, 7, "rgba(24,24,27,0.15)", 0.6),
805
805
  p(64, 7, "rgba(147,197,253,0.5)", 0.1)
806
806
  ]),
807
- w(s >= 2, 0.3, [
807
+ k(s >= 2, 0.3, [
808
808
  p(36, 7, "rgba(147,197,253,0.6)", 0.5),
809
809
  p(36, 7, "rgba(24,24,27,0.12)", 0.7)
810
810
  ]),
811
- w(s >= 3, 0.35, [
811
+ k(s >= 3, 0.35, [
812
812
  r(),
813
813
  p(44, 7, "rgba(24,24,27,0.18)", 0.3),
814
814
  r(),
@@ -817,7 +817,7 @@ function Io(e) {
817
817
  ])
818
818
  ]),
819
819
  // Shimmer
820
- y("div", {
820
+ w("div", {
821
821
  style: {
822
822
  pointerEvents: "none",
823
823
  position: "absolute",
@@ -830,7 +830,7 @@ function Io(e) {
830
830
  ]
831
831
  ),
832
832
  // Label
833
- y(
833
+ w(
834
834
  "div",
835
835
  {
836
836
  style: {
@@ -842,7 +842,7 @@ function Io(e) {
842
842
  }
843
843
  },
844
844
  [
845
- y(
845
+ w(
846
846
  "span",
847
847
  {
848
848
  style: {
@@ -854,7 +854,7 @@ function Io(e) {
854
854
  "Building interface"
855
855
  ),
856
856
  ...o > 0 ? [
857
- y(
857
+ w(
858
858
  "span",
859
859
  {
860
860
  style: {
@@ -869,7 +869,7 @@ function Io(e) {
869
869
  ]
870
870
  ),
871
871
  // Keyframe styles
872
- y(
872
+ w(
873
873
  "style",
874
874
  `
875
875
  @keyframes cpk-a2ui-fade {
@@ -902,8 +902,8 @@ function Ee(e, n, t) {
902
902
  let s = null;
903
903
  const r = t ? t() : void 0;
904
904
  function l(p) {
905
- s && s.dispose(), s = new $a(p, e.schema), o.value = s.snapshot, s.subscribe((w) => {
906
- o.value = w;
905
+ s && s.dispose(), s = new $a(p, e.schema), o.value = s.snapshot, s.subscribe((k) => {
906
+ o.value = k;
907
907
  });
908
908
  }
909
909
  return l(i.context), L(
@@ -986,23 +986,23 @@ const Mo = Ee(La, ({ props: e }) => {
986
986
  const n = e.text ?? "", t = { ...Mt(), display: "inline-block" };
987
987
  switch (e.variant) {
988
988
  case "h1":
989
- return y("h1", { style: t }, n);
989
+ return w("h1", { style: t }, n);
990
990
  case "h2":
991
- return y("h2", { style: t }, n);
991
+ return w("h2", { style: t }, n);
992
992
  case "h3":
993
- return y("h3", { style: t }, n);
993
+ return w("h3", { style: t }, n);
994
994
  case "h4":
995
- return y("h4", { style: t }, n);
995
+ return w("h4", { style: t }, n);
996
996
  case "h5":
997
- return y("h5", { style: t }, n);
997
+ return w("h5", { style: t }, n);
998
998
  case "caption":
999
- return y(
999
+ return w(
1000
1000
  "small",
1001
1001
  { style: { ...t, color: "#666", textAlign: "left" } },
1002
1002
  n
1003
1003
  );
1004
1004
  default:
1005
- return y("span", { style: t }, n);
1005
+ return w("span", { style: t }, n);
1006
1006
  }
1007
1007
  }), Fo = Ee(Da, ({ props: e }) => {
1008
1008
  const n = (a) => a === "scaleDown" ? "scale-down" : a || "fill", t = {
@@ -1012,7 +1012,7 @@ const Mo = Ee(La, ({ props: e }) => {
1012
1012
  height: "auto",
1013
1013
  display: "block"
1014
1014
  };
1015
- return e.variant === "icon" ? (t.width = "24px", t.height = "24px") : e.variant === "avatar" ? (t.width = "40px", t.height = "40px", t.borderRadius = "50%") : e.variant === "smallFeature" ? t.maxWidth = "100px" : e.variant === "largeFeature" ? t.maxHeight = "400px" : e.variant === "header" && (t.height = "200px", t.objectFit = "cover"), y("img", { src: e.url, alt: e.description || "", style: t });
1015
+ return e.variant === "icon" ? (t.width = "24px", t.height = "24px") : e.variant === "avatar" ? (t.width = "40px", t.height = "40px", t.borderRadius = "50%") : e.variant === "smallFeature" ? t.maxWidth = "100px" : e.variant === "largeFeature" ? t.maxHeight = "400px" : e.variant === "header" && (t.height = "200px", t.objectFit = "cover"), w("img", { src: e.url, alt: e.description || "", style: t });
1016
1016
  }), Eo = Ee(Ua, ({ props: e }) => {
1017
1017
  const n = typeof e.name == "string" ? e.name : e.name?.path, t = {
1018
1018
  ...Mt(),
@@ -1023,17 +1023,17 @@ const Mo = Ee(La, ({ props: e }) => {
1023
1023
  alignItems: "center",
1024
1024
  justifyContent: "center"
1025
1025
  };
1026
- return y("span", { class: "material-symbols-outlined", style: t }, n);
1026
+ return w("span", { class: "material-symbols-outlined", style: t }, n);
1027
1027
  }), Oo = Ee(Ba, ({ props: e }) => {
1028
1028
  const n = {
1029
1029
  ...Mt(),
1030
1030
  width: "100%",
1031
1031
  aspectRatio: "16/9"
1032
1032
  };
1033
- return y("video", { src: e.url, controls: !0, style: n });
1033
+ return w("video", { src: e.url, controls: !0, style: n });
1034
1034
  }), Lo = Ee(ja, ({ props: e }) => {
1035
1035
  const n = { ...Mt(), width: "100%" };
1036
- return y(
1036
+ return w(
1037
1037
  "div",
1038
1038
  {
1039
1039
  style: {
@@ -1044,15 +1044,15 @@ const Mo = Ee(La, ({ props: e }) => {
1044
1044
  }
1045
1045
  },
1046
1046
  [
1047
- e.description ? y(
1047
+ e.description ? w(
1048
1048
  "span",
1049
1049
  { style: { fontSize: "12px", color: "#666" } },
1050
1050
  e.description
1051
1051
  ) : null,
1052
- y("audio", { src: e.url, controls: !0, style: n })
1052
+ w("audio", { src: e.url, controls: !0, style: n })
1053
1053
  ]
1054
1054
  );
1055
- }), Do = Ee(Na, ({ props: e, buildChild: n }) => y(
1055
+ }), Do = Ee(Na, ({ props: e, buildChild: n }) => w(
1056
1056
  "div",
1057
1057
  {
1058
1058
  style: {
@@ -1066,7 +1066,7 @@ const Mo = Ee(La, ({ props: e }) => {
1066
1066
  }
1067
1067
  },
1068
1068
  hn(e.children, n)
1069
- )), Uo = Ee(Va, ({ props: e, buildChild: n }) => y(
1069
+ )), Uo = Ee(Va, ({ props: e, buildChild: n }) => w(
1070
1070
  "div",
1071
1071
  {
1072
1072
  style: {
@@ -1091,7 +1091,7 @@ const Mo = Ee(La, ({ props: e }) => {
1091
1091
  margin: "0",
1092
1092
  padding: "0"
1093
1093
  };
1094
- return y("div", { style: a }, hn(e.children, n));
1094
+ return w("div", { style: a }, hn(e.children, n));
1095
1095
  }), jo = Ee(za, ({ props: e, buildChild: n }) => {
1096
1096
  const t = {
1097
1097
  ...Ro(),
@@ -1099,12 +1099,12 @@ const Mo = Ee(La, ({ props: e }) => {
1099
1099
  boxShadow: "0 2px 4px rgba(0,0,0,0.1)",
1100
1100
  width: "100%"
1101
1101
  };
1102
- return y("div", { style: t }, [e.child ? n(e.child) : null]);
1102
+ return w("div", { style: t }, [e.child ? n(e.child) : null]);
1103
1103
  }), No = Ee(
1104
1104
  Ha,
1105
1105
  ({ props: e, buildChild: n, state: t }) => {
1106
1106
  const a = e.tabs || [];
1107
- return y(
1107
+ return w(
1108
1108
  "div",
1109
1109
  {
1110
1110
  style: {
@@ -1115,7 +1115,7 @@ const Mo = Ee(La, ({ props: e }) => {
1115
1115
  }
1116
1116
  },
1117
1117
  [
1118
- y(
1118
+ w(
1119
1119
  "div",
1120
1120
  {
1121
1121
  style: {
@@ -1126,7 +1126,7 @@ const Mo = Ee(La, ({ props: e }) => {
1126
1126
  },
1127
1127
  a.map((i, o) => {
1128
1128
  const s = typeof i.title == "string" ? i.title : String(i.title ?? "");
1129
- return y(
1129
+ return w(
1130
1130
  "button",
1131
1131
  {
1132
1132
  key: o,
@@ -1147,7 +1147,7 @@ const Mo = Ee(La, ({ props: e }) => {
1147
1147
  );
1148
1148
  })
1149
1149
  ),
1150
- y("div", { style: { flex: "1" } }, [
1150
+ w("div", { style: { flex: "1" } }, [
1151
1151
  a[t.selectedIndex.value]?.child ? n(a[t.selectedIndex.value].child) : null
1152
1152
  ])
1153
1153
  ]
@@ -1160,11 +1160,11 @@ const Mo = Ee(La, ({ props: e }) => {
1160
1160
  border: "none",
1161
1161
  backgroundColor: "#ccc"
1162
1162
  };
1163
- return n ? (t.width = "1px", t.height = "100%") : (t.width = "100%", t.height = "1px"), y("div", { style: t });
1163
+ return n ? (t.width = "1px", t.height = "100%") : (t.width = "100%", t.height = "1px"), w("div", { style: t });
1164
1164
  }), Po = Ee(
1165
1165
  Wa,
1166
- ({ props: e, buildChild: n, state: t }) => y("div", {}, [
1167
- y(
1166
+ ({ props: e, buildChild: n, state: t }) => w("div", {}, [
1167
+ w(
1168
1168
  "div",
1169
1169
  {
1170
1170
  onClick: () => {
@@ -1174,7 +1174,7 @@ const Mo = Ee(La, ({ props: e }) => {
1174
1174
  },
1175
1175
  [e.trigger ? n(e.trigger) : null]
1176
1176
  ),
1177
- t.isOpen.value ? y(
1177
+ t.isOpen.value ? w(
1178
1178
  "div",
1179
1179
  {
1180
1180
  style: {
@@ -1194,7 +1194,7 @@ const Mo = Ee(La, ({ props: e }) => {
1194
1194
  }
1195
1195
  },
1196
1196
  [
1197
- y(
1197
+ w(
1198
1198
  "div",
1199
1199
  {
1200
1200
  style: {
@@ -1210,11 +1210,11 @@ const Mo = Ee(La, ({ props: e }) => {
1210
1210
  onClick: (a) => a.stopPropagation()
1211
1211
  },
1212
1212
  [
1213
- y(
1213
+ w(
1214
1214
  "div",
1215
1215
  { style: { display: "flex", justifyContent: "flex-end" } },
1216
1216
  [
1217
- y(
1217
+ w(
1218
1218
  "button",
1219
1219
  {
1220
1220
  onClick: () => {
@@ -1232,7 +1232,7 @@ const Mo = Ee(La, ({ props: e }) => {
1232
1232
  )
1233
1233
  ]
1234
1234
  ),
1235
- y("div", { style: { flex: "1" } }, [
1235
+ w("div", { style: { flex: "1" } }, [
1236
1236
  e.content ? n(e.content) : null
1237
1237
  ])
1238
1238
  ]
@@ -1255,7 +1255,7 @@ const Mo = Ee(La, ({ props: e }) => {
1255
1255
  justifyContent: "center",
1256
1256
  boxSizing: "border-box"
1257
1257
  };
1258
- return y(
1258
+ return w(
1259
1259
  "button",
1260
1260
  {
1261
1261
  style: t,
@@ -1274,7 +1274,7 @@ const Mo = Ee(La, ({ props: e }) => {
1274
1274
  borderRadius: Jt,
1275
1275
  boxSizing: "border-box"
1276
1276
  }, s = e.validationErrors && e.validationErrors.length > 0;
1277
- return y(
1277
+ return w(
1278
1278
  "div",
1279
1279
  {
1280
1280
  style: {
@@ -1286,7 +1286,7 @@ const Mo = Ee(La, ({ props: e }) => {
1286
1286
  }
1287
1287
  },
1288
1288
  [
1289
- e.label ? y(
1289
+ e.label ? w(
1290
1290
  "label",
1291
1291
  {
1292
1292
  for: t,
@@ -1294,19 +1294,19 @@ const Mo = Ee(La, ({ props: e }) => {
1294
1294
  },
1295
1295
  e.label
1296
1296
  ) : null,
1297
- a ? y("textarea", {
1297
+ a ? w("textarea", {
1298
1298
  id: t,
1299
1299
  style: o,
1300
1300
  value: e.value || "",
1301
1301
  onInput: (r) => e.setValue(r.target.value)
1302
- }) : y("input", {
1302
+ }) : w("input", {
1303
1303
  id: t,
1304
1304
  type: i,
1305
1305
  style: o,
1306
1306
  value: e.value || "",
1307
1307
  onInput: (r) => e.setValue(r.target.value)
1308
1308
  }),
1309
- s ? y(
1309
+ s ? w(
1310
1310
  "span",
1311
1311
  { style: { fontSize: "12px", color: "red" } },
1312
1312
  e.validationErrors[0]
@@ -1319,7 +1319,7 @@ const Mo = Ee(La, ({ props: e }) => {
1319
1319
  Ga,
1320
1320
  ({ props: e, state: n }) => {
1321
1321
  const t = n.id, a = e.validationErrors && e.validationErrors.length > 0;
1322
- return y(
1322
+ return w(
1323
1323
  "div",
1324
1324
  {
1325
1325
  style: {
@@ -1329,11 +1329,11 @@ const Mo = Ee(La, ({ props: e }) => {
1329
1329
  }
1330
1330
  },
1331
1331
  [
1332
- y(
1332
+ w(
1333
1333
  "div",
1334
1334
  { style: { display: "flex", alignItems: "center", gap: "8px" } },
1335
1335
  [
1336
- y("input", {
1336
+ w("input", {
1337
1337
  id: t,
1338
1338
  type: "checkbox",
1339
1339
  checked: !!e.value,
@@ -1343,7 +1343,7 @@ const Mo = Ee(La, ({ props: e }) => {
1343
1343
  outline: a ? "1px solid red" : "none"
1344
1344
  }
1345
1345
  }),
1346
- e.label ? y(
1346
+ e.label ? w(
1347
1347
  "label",
1348
1348
  {
1349
1349
  for: t,
@@ -1356,7 +1356,7 @@ const Mo = Ee(La, ({ props: e }) => {
1356
1356
  ) : null
1357
1357
  ]
1358
1358
  ),
1359
- a ? y(
1359
+ a ? w(
1360
1360
  "span",
1361
1361
  {
1362
1362
  style: { fontSize: "12px", color: "red", marginTop: "4px" }
@@ -1380,7 +1380,7 @@ const Mo = Ee(La, ({ props: e }) => {
1380
1380
  }, s = (e.options || []).filter(
1381
1381
  (r) => !e.filterable || t.filter.value === "" || String(typeof r.label == "string" ? r.label : "").toLowerCase().includes(t.filter.value.toLowerCase())
1382
1382
  );
1383
- return y(
1383
+ return w(
1384
1384
  "div",
1385
1385
  {
1386
1386
  style: {
@@ -1392,8 +1392,8 @@ const Mo = Ee(La, ({ props: e }) => {
1392
1392
  }
1393
1393
  },
1394
1394
  [
1395
- e.label ? y("strong", { style: { fontSize: "14px" } }, e.label) : null,
1396
- e.filterable ? y("input", {
1395
+ e.label ? w("strong", { style: { fontSize: "14px" } }, e.label) : null,
1396
+ e.filterable ? w("input", {
1397
1397
  type: "text",
1398
1398
  placeholder: "Filter options...",
1399
1399
  value: t.filter.value,
@@ -1406,7 +1406,7 @@ const Mo = Ee(La, ({ props: e }) => {
1406
1406
  borderRadius: Jt
1407
1407
  }
1408
1408
  }) : null,
1409
- y(
1409
+ w(
1410
1410
  "div",
1411
1411
  {
1412
1412
  style: {
@@ -1417,8 +1417,8 @@ const Mo = Ee(La, ({ props: e }) => {
1417
1417
  }
1418
1418
  },
1419
1419
  s.map((r, l) => {
1420
- const p = a.includes(r.value), w = typeof r.label == "string" ? r.label : String(r.label ?? r.value);
1421
- return e.displayStyle === "chips" ? y(
1420
+ const p = a.includes(r.value), k = typeof r.label == "string" ? r.label : String(r.label ?? r.value);
1421
+ return e.displayStyle === "chips" ? w(
1422
1422
  "button",
1423
1423
  {
1424
1424
  key: l,
@@ -1433,8 +1433,8 @@ const Mo = Ee(La, ({ props: e }) => {
1433
1433
  fontSize: "12px"
1434
1434
  }
1435
1435
  },
1436
- w
1437
- ) : y(
1436
+ k
1437
+ ) : w(
1438
1438
  "label",
1439
1439
  {
1440
1440
  key: l,
@@ -1446,13 +1446,13 @@ const Mo = Ee(La, ({ props: e }) => {
1446
1446
  }
1447
1447
  },
1448
1448
  [
1449
- y("input", {
1449
+ w("input", {
1450
1450
  type: i ? "radio" : "checkbox",
1451
1451
  checked: p,
1452
1452
  onChange: () => o(r.value),
1453
1453
  name: i ? `choice-${n.componentModel.id}` : void 0
1454
1454
  }),
1455
- y("span", { style: { fontSize: "14px" } }, w)
1455
+ w("span", { style: { fontSize: "14px" } }, k)
1456
1456
  ]
1457
1457
  );
1458
1458
  })
@@ -1465,7 +1465,7 @@ const Mo = Ee(La, ({ props: e }) => {
1465
1465
  Qa,
1466
1466
  ({ props: e, state: n }) => {
1467
1467
  const t = n.id;
1468
- return y(
1468
+ return w(
1469
1469
  "div",
1470
1470
  {
1471
1471
  style: {
@@ -1477,11 +1477,11 @@ const Mo = Ee(La, ({ props: e }) => {
1477
1477
  }
1478
1478
  },
1479
1479
  [
1480
- y(
1480
+ w(
1481
1481
  "div",
1482
1482
  { style: { display: "flex", justifyContent: "space-between" } },
1483
1483
  [
1484
- e.label ? y(
1484
+ e.label ? w(
1485
1485
  "label",
1486
1486
  {
1487
1487
  for: t,
@@ -1489,14 +1489,14 @@ const Mo = Ee(La, ({ props: e }) => {
1489
1489
  },
1490
1490
  e.label
1491
1491
  ) : null,
1492
- y(
1492
+ w(
1493
1493
  "span",
1494
1494
  { style: { fontSize: "12px", color: "#666" } },
1495
1495
  String(e.value)
1496
1496
  )
1497
1497
  ]
1498
1498
  ),
1499
- y("input", {
1499
+ w("input", {
1500
1500
  id: t,
1501
1501
  type: "range",
1502
1502
  min: e.min ?? 0,
@@ -1522,7 +1522,7 @@ const Mo = Ee(La, ({ props: e }) => {
1522
1522
  borderRadius: Jt,
1523
1523
  boxSizing: "border-box"
1524
1524
  };
1525
- return y(
1525
+ return w(
1526
1526
  "div",
1527
1527
  {
1528
1528
  style: {
@@ -1534,7 +1534,7 @@ const Mo = Ee(La, ({ props: e }) => {
1534
1534
  }
1535
1535
  },
1536
1536
  [
1537
- e.label ? y(
1537
+ e.label ? w(
1538
1538
  "label",
1539
1539
  {
1540
1540
  for: t,
@@ -1542,7 +1542,7 @@ const Mo = Ee(La, ({ props: e }) => {
1542
1542
  },
1543
1543
  e.label
1544
1544
  ) : null,
1545
- y("input", {
1545
+ w("input", {
1546
1546
  id: t,
1547
1547
  type: a,
1548
1548
  style: i,
@@ -1621,7 +1621,7 @@ function Xo(e) {
1621
1621
  {
1622
1622
  properties: {
1623
1623
  component: { const: a },
1624
- ...o.properties ?? {}
1624
+ ...o.properties
1625
1625
  },
1626
1626
  required: ["component", ...o.required ?? []]
1627
1627
  }
@@ -1638,11 +1638,12 @@ function Yo(e, n) {
1638
1638
  [() => e.value, n.enabled, t],
1639
1639
  ([i, o, s], r, l) => {
1640
1640
  if (!o) return;
1641
- const p = i.addContext({
1641
+ const p = i.a2uiAgents, k = i.addContext({
1642
1642
  description: "A2UI catalog capabilities: available catalog IDs and custom component definitions the client can render.",
1643
- value: s
1643
+ value: s,
1644
+ ...p ? { agentIds: p } : {}
1644
1645
  });
1645
- l(() => i.removeContext(p));
1646
+ l(() => i.removeContext(k));
1646
1647
  },
1647
1648
  { immediate: !0 }
1648
1649
  );
@@ -1651,24 +1652,27 @@ function Yo(e, n) {
1651
1652
  [() => e.value, n.enabled, a],
1652
1653
  ([i, o, s], r, l) => {
1653
1654
  if (!o || !s) return;
1654
- const p = [];
1655
- p.push(
1655
+ const p = i.a2uiAgents, k = p ? { agentIds: p } : {}, u = [];
1656
+ u.push(
1656
1657
  i.addContext({
1657
1658
  description: Jo,
1658
- value: s
1659
+ value: s,
1660
+ ...k
1659
1661
  })
1660
- ), p.push(
1662
+ ), u.push(
1661
1663
  i.addContext({
1662
1664
  description: "A2UI generation guidelines — protocol rules, tool arguments, path rules, data model format, and form/two-way-binding instructions.",
1663
- value: ga
1665
+ value: ga,
1666
+ ...k
1664
1667
  })
1665
- ), p.push(
1668
+ ), u.push(
1666
1669
  i.addContext({
1667
1670
  description: "A2UI design guidelines — visual design rules, component hierarchy tips, and action handler patterns.",
1668
- value: va
1671
+ value: va,
1672
+ ...k
1669
1673
  })
1670
1674
  ), l(() => {
1671
- for (const w of p) i.removeContext(w);
1675
+ for (const d of u) i.removeContext(d);
1672
1676
  });
1673
1677
  },
1674
1678
  { immediate: !0 }
@@ -1733,7 +1737,7 @@ const ls = se({
1733
1737
  }
1734
1738
  },
1735
1739
  setup(e) {
1736
- const n = ts(), t = I(null), a = I(e.content), i = I(e.content), o = I(null), s = I(null), r = I(null), l = I(!1), p = I(!1), w = I(0), u = I(!1), d = I([]), g = c(() => {
1740
+ const n = ts(), t = I(null), a = I(e.content), i = I(e.content), o = I(null), s = I(null), r = I(null), l = I(!1), p = I(!1), k = I(0), u = I(!1), d = I([]), g = c(() => {
1737
1741
  const $ = {};
1738
1742
  for (const P of n.value)
1739
1743
  $[P.name] = P.handler;
@@ -1765,20 +1769,20 @@ const ls = se({
1765
1769
  () => a.value.htmlComplete && a.value.html?.length ? a.value.html.join("") : void 0
1766
1770
  ), f = c(
1767
1771
  () => a.value.cssComplete ? a.value.css : void 0
1768
- ), k = c(
1772
+ ), y = c(
1769
1773
  () => !!a.value.cssComplete && !!C.value && C.value.trim().length > 0
1770
1774
  ), v = c(
1771
- () => !!x.value || k.value
1775
+ () => !!x.value || y.value
1772
1776
  ), b = c(
1773
1777
  () => `${a.value.initialHeight ?? 200}px`
1774
1778
  ), S = () => {
1775
1779
  r.value && (r.value.destroy(), r.value = null), p.value = !1;
1776
1780
  }, O = () => {
1777
- s.value && (s.value.destroy(), s.value = null), l.value = !1, d.value = [], w.value = 0, u.value = !1;
1781
+ s.value && (s.value.destroy(), s.value = null), l.value = !1, d.value = [], k.value = 0, u.value = !1;
1778
1782
  };
1779
1783
  L(
1780
1784
  [
1781
- k,
1785
+ y,
1782
1786
  x,
1783
1787
  f,
1784
1788
  C,
@@ -1856,8 +1860,8 @@ const ls = se({
1856
1860
  U && !u.value && (u.value = !0, d.value.unshift(U));
1857
1861
  const H = a.value.jsExpressions;
1858
1862
  if (H?.length) {
1859
- const we = w.value;
1860
- we < H.length && (d.value.push(...H.slice(we)), w.value = H.length);
1863
+ const we = k.value;
1864
+ we < H.length && (d.value.push(...H.slice(we)), k.value = H.length);
1861
1865
  }
1862
1866
  const ae = [...d.value];
1863
1867
  d.value = [];
@@ -1884,10 +1888,10 @@ const ls = se({
1884
1888
  () => a.value.jsExpressions,
1885
1889
  ($) => {
1886
1890
  if (!$?.length) return;
1887
- const P = w.value;
1891
+ const P = k.value;
1888
1892
  if (P >= $.length) return;
1889
1893
  const Y = $.slice(P);
1890
- if (w.value = $.length, l.value && s.value)
1894
+ if (k.value = $.length, l.value && s.value)
1891
1895
  for (const ve of Y)
1892
1896
  s.value.run(ve);
1893
1897
  else
@@ -1899,14 +1903,14 @@ const ls = se({
1899
1903
  () => a.value.generating !== !1
1900
1904
  );
1901
1905
  return L(
1902
- [k, x],
1906
+ [y, x],
1903
1907
  ([$, P]) => {
1904
1908
  P && S(), $ || S();
1905
1909
  },
1906
1910
  { immediate: !0 }
1907
1911
  ), Me(() => {
1908
1912
  o.value !== null && window.clearTimeout(o.value), S(), O();
1909
- }), () => y(
1913
+ }), () => w(
1910
1914
  "div",
1911
1915
  {
1912
1916
  ref: t,
@@ -1925,8 +1929,8 @@ const ls = se({
1925
1929
  }
1926
1930
  },
1927
1931
  [
1928
- v.value ? null : y("div", { "data-testid": "open-generative-ui-placeholder" }, [
1929
- y(
1932
+ v.value ? null : w("div", { "data-testid": "open-generative-ui-placeholder" }, [
1933
+ w(
1930
1934
  "svg",
1931
1935
  {
1932
1936
  width: "48",
@@ -1936,14 +1940,14 @@ const ls = se({
1936
1940
  style: { animation: "ck-spin 1s linear infinite" }
1937
1941
  },
1938
1942
  [
1939
- y("circle", {
1943
+ w("circle", {
1940
1944
  cx: "12",
1941
1945
  cy: "12",
1942
1946
  r: "10",
1943
1947
  stroke: "#e0e0e0",
1944
1948
  "stroke-width": "3"
1945
1949
  }),
1946
- y("path", {
1950
+ w("path", {
1947
1951
  d: "M12 2a10 10 0 0 1 10 10",
1948
1952
  stroke: "#999",
1949
1953
  "stroke-width": "3",
@@ -1951,12 +1955,12 @@ const ls = se({
1951
1955
  })
1952
1956
  ]
1953
1957
  ),
1954
- y(
1958
+ w(
1955
1959
  "style",
1956
1960
  "@keyframes ck-spin { to { transform: rotate(360deg) } }"
1957
1961
  )
1958
1962
  ]),
1959
- D.value ? y("div", {
1963
+ D.value ? w("div", {
1960
1964
  "data-testid": "open-generative-ui-progress-overlay",
1961
1965
  style: {
1962
1966
  position: "absolute",
@@ -1983,7 +1987,7 @@ const ls = se({
1983
1987
  }
1984
1988
  },
1985
1989
  setup(e) {
1986
- return () => y(ls, { content: e.content });
1990
+ return () => w(ls, { content: e.content });
1987
1991
  }
1988
1992
  }), us = se({
1989
1993
  name: "OpenGenerativeUIToolRenderer",
@@ -2015,7 +2019,7 @@ const ls = se({
2015
2019
  const t = e.args.placeholderMessages;
2016
2020
  if (!t?.length) return null;
2017
2021
  const a = t[n.value] ?? t[0];
2018
- return y(
2022
+ return w(
2019
2023
  "div",
2020
2024
  {
2021
2025
  style: { padding: "8px 12px", color: "#999", fontSize: "14px" },
@@ -2125,7 +2129,7 @@ const ps = { style: {
2125
2129
  ...o,
2126
2130
  ...s.value
2127
2131
  })), l = lt(), p = c(() => typeof (l?.vnode.props ?? {}).onDismiss == "function");
2128
- function w() {
2132
+ function k() {
2129
2133
  a("dismiss");
2130
2134
  }
2131
2135
  return Je(() => {
@@ -2161,7 +2165,7 @@ const ps = { style: {
2161
2165
  color: "inherit",
2162
2166
  fontSize: "16px"
2163
2167
  },
2164
- onClick: w
2168
+ onClick: k
2165
2169
  }, " × ")) : Q("", !0)
2166
2170
  ])
2167
2171
  ], 4)) : Q("", !0);
@@ -2257,7 +2261,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2257
2261
  B !== p && console.error(ys);
2258
2262
  }
2259
2263
  );
2260
- const w = c(
2264
+ const k = c(
2261
2265
  () => t.publicApiKey ?? t.publicLicenseKey
2262
2266
  ), u = c(() => ({
2263
2267
  ...t.agents__unsafe_dev_only,
@@ -2268,12 +2272,12 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2268
2272
  () => typeof t.headers == "function" ? t.headers() : t.headers
2269
2273
  ), h = c(() => {
2270
2274
  const B = g.value;
2271
- return !w.value || B[Fn] ? B : { ...B, [Fn]: w.value };
2275
+ return !k.value || B[Fn] ? B : { ...B, [Fn]: k.value };
2272
2276
  }), C = c(
2273
- () => t.runtimeUrl ?? (w.value ? vs : void 0)
2277
+ () => t.runtimeUrl ?? (k.value ? vs : void 0)
2274
2278
  );
2275
2279
  L(
2276
- [C, w, d],
2280
+ [C, k, d],
2277
2281
  ([B, ue, pe]) => {
2278
2282
  if (B || ue || pe) return;
2279
2283
  const $e = "Missing required prop: 'runtimeUrl' or 'publicApiKey' or 'publicLicenseKey'";
@@ -2325,7 +2329,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2325
2329
  });
2326
2330
  }
2327
2331
  return B.push(...m.value.renderToolCalls), B;
2328
- }), k = c(
2332
+ }), y = c(
2329
2333
  () => t.renderCustomMessages ?? []
2330
2334
  ), v = I(!1), b = I(!1), S = I(void 0), O = c(
2331
2335
  () => b.value || !!t.openGenerativeUI
@@ -2380,7 +2384,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2380
2384
  tools: x.value,
2381
2385
  renderToolCalls: f.value,
2382
2386
  renderActivityMessages: ve.value,
2383
- renderCustomMessages: k.value,
2387
+ renderCustomMessages: y.value,
2384
2388
  debug: t.debug
2385
2389
  });
2386
2390
  return te(B), B;
@@ -2434,7 +2438,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2434
2438
  ne.value && E.value.setTools(B);
2435
2439
  }), L([f], ([B]) => {
2436
2440
  ne.value && E.value.setRenderToolCalls(B);
2437
- }), L([k], ([B]) => {
2441
+ }), L([y], ([B]) => {
2438
2442
  ne.value && (E.value.setRenderCustomMessages(B), ot(E));
2439
2443
  }), L([ve], ([B]) => {
2440
2444
  ne.value && (E.value.setRenderActivityMessages(B), ot(E));
@@ -2522,7 +2526,7 @@ PARAMETER ORDER IS CRITICAL — generate parameters in exactly this order:
2522
2526
  );
2523
2527
  It(Yn, X);
2524
2528
  const Z = c(
2525
- () => S.value === "none" && !w.value
2529
+ () => S.value === "none" && !k.value
2526
2530
  ), ee = c(
2527
2531
  () => S.value === "expired"
2528
2532
  ), be = c(
@@ -2617,7 +2621,7 @@ const bn = /* @__PURE__ */ se({
2617
2621
  ...i.value
2618
2622
  })), s = c(
2619
2623
  () => n.agentId ?? a.value?.agentId ?? ct
2620
- ), r = pt(), l = c(() => n.threadId ? n.threadId : a.value?.threadId ? a.value.threadId : r), p = c(() => (n.hasExplicitThreadId !== void 0 ? n.hasExplicitThreadId : !!n.threadId) || !!a.value?.hasExplicitThreadId), w = c(
2624
+ ), r = pt(), l = c(() => n.threadId ? n.threadId : a.value?.threadId ? a.value.threadId : r), p = c(() => (n.hasExplicitThreadId !== void 0 ? n.hasExplicitThreadId : !!n.threadId) || !!a.value?.hasExplicitThreadId), k = c(
2621
2625
  () => n.isModalDefaultOpen !== void 0
2622
2626
  ), u = c(() => n.isModalDefaultOpen ?? !0), d = I(
2623
2627
  a.value?.isModalOpen ?? u.value
@@ -2626,9 +2630,9 @@ const bn = /* @__PURE__ */ se({
2626
2630
  d.value = x;
2627
2631
  }
2628
2632
  const h = c(
2629
- () => w.value ? d.value : a.value?.isModalOpen
2633
+ () => k.value ? d.value : a.value?.isModalOpen
2630
2634
  ), C = c(
2631
- () => w.value ? g : a.value?.setModalOpen
2635
+ () => k.value ? g : a.value?.setModalOpen
2632
2636
  ), m = c(() => ({
2633
2637
  labels: o.value,
2634
2638
  agentId: s.value,
@@ -2673,7 +2677,7 @@ const ea = se({
2673
2677
  });
2674
2678
  function i(o, s) {
2675
2679
  const r = s || e.basePath;
2676
- return y(ea, {
2680
+ return w(ea, {
2677
2681
  key: `${o}-${r}`,
2678
2682
  surface: e.surface,
2679
2683
  id: o,
@@ -2684,7 +2688,7 @@ const ea = se({
2684
2688
  n.value;
2685
2689
  const o = e.surface.componentsModel.get(e.id);
2686
2690
  if (!o)
2687
- return y("div", {
2691
+ return w("div", {
2688
2692
  style: {
2689
2693
  padding: "12px 16px",
2690
2694
  borderRadius: "8px",
@@ -2699,7 +2703,7 @@ const ea = se({
2699
2703
  o.type
2700
2704
  );
2701
2705
  if (!s)
2702
- return y(
2706
+ return w(
2703
2707
  "div",
2704
2708
  { style: { color: "red" } },
2705
2709
  `Unknown component: ${o.type}`
@@ -2709,7 +2713,7 @@ const ea = se({
2709
2713
  e.id,
2710
2714
  e.basePath
2711
2715
  );
2712
- return y(s.render, {
2716
+ return w(s.render, {
2713
2717
  context: r,
2714
2718
  buildChild: i
2715
2719
  });
@@ -2724,7 +2728,7 @@ const ea = se({
2724
2728
  }
2725
2729
  },
2726
2730
  setup(e) {
2727
- return () => y(ea, {
2731
+ return () => w(ea, {
2728
2732
  surface: e.surface,
2729
2733
  id: "root",
2730
2734
  basePath: "/"
@@ -2787,8 +2791,8 @@ const ea = se({
2787
2791
  C.has(x) || C.set(x, []), C.get(x).push(m);
2788
2792
  }
2789
2793
  for (const [m, x] of C) {
2790
- const k = h.model.getSurface(m) ? x.filter((v) => !v?.createSurface) : x;
2791
- h.processMessages(k);
2794
+ const y = h.model.getSurface(m) ? x.filter((v) => !v?.createSurface) : x;
2795
+ h.processMessages(y);
2792
2796
  }
2793
2797
  o.value = null;
2794
2798
  } catch (C) {
@@ -2805,7 +2809,7 @@ const ea = se({
2805
2809
  ), Me(() => {
2806
2810
  a.value = null, s = "";
2807
2811
  });
2808
- const w = c(
2812
+ const k = c(
2809
2813
  () => (n.content.operations ?? []).length > 0
2810
2814
  ), u = c(() => {
2811
2815
  if (i.value, !a.value) return [];
@@ -2820,7 +2824,7 @@ const ea = se({
2820
2824
  }
2821
2825
  return d;
2822
2826
  });
2823
- return (d, g) => w.value ? (R(), j("div", {
2827
+ return (d, g) => k.value ? (R(), j("div", {
2824
2828
  key: 0,
2825
2829
  "data-copilotkit": "",
2826
2830
  "data-activity-type": e.activityType,
@@ -2884,7 +2888,7 @@ const ea = se({
2884
2888
  toolMessage: void 0
2885
2889
  };
2886
2890
  }
2887
- function w(d) {
2891
+ function k(d) {
2888
2892
  const g = o(d.id), h = In(d.function.arguments);
2889
2893
  return g ? {
2890
2894
  name: d.function.name,
@@ -2926,7 +2930,7 @@ const ea = se({
2926
2930
  ], () => (R(), he(mt(u(h)?.render), ge({
2927
2931
  key: 0,
2928
2932
  ref_for: !0
2929
- }, w(h)), null, 16)), g, 0) : Q("", !0)
2933
+ }, k(h)), null, 16)), g, 0) : Q("", !0)
2930
2934
  ])
2931
2935
  ])), 128));
2932
2936
  }
@@ -2957,7 +2961,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
2957
2961
  let l = null;
2958
2962
  const p = c(
2959
2963
  () => s?.vnode.props ?? {}
2960
- ), w = [
2964
+ ), k = [
2961
2965
  "cpk:inline-flex cpk:h-8 cpk:w-8 cpk:items-center cpk:justify-center cpk:rounded-md cpk:p-0",
2962
2966
  "cpk:cursor-pointer cpk:text-[rgb(93,93,93)] cpk:transition-colors cpk:hover:bg-[#E8E8E8]",
2963
2967
  "cpk:hover:text-[rgb(93,93,93)] cpk:dark:text-[rgb(243,243,243)] cpk:dark:hover:bg-[#303030]",
@@ -3051,18 +3055,18 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3051
3055
  class: ["cpk:max-w-full cpk:rounded-lg", X.class].filter(Boolean).join(" "),
3052
3056
  "data-streamdown": "image"
3053
3057
  };
3054
- return delete ee.className, y(
3058
+ return delete ee.className, w(
3055
3059
  "div",
3056
3060
  {
3057
3061
  class: "cpk:group cpk:relative cpk:my-4 cpk:inline-block",
3058
3062
  "data-streamdown": "image-wrapper"
3059
3063
  },
3060
3064
  [
3061
- y("img", ee),
3062
- y("div", {
3065
+ w("img", ee),
3066
+ w("div", {
3063
3067
  class: "cpk:pointer-events-none cpk:absolute cpk:inset-0 cpk:hidden cpk:rounded-lg cpk:bg-black/10 cpk:group-hover:block"
3064
3068
  }),
3065
- y(
3069
+ w(
3066
3070
  "button",
3067
3071
  {
3068
3072
  type: "button",
@@ -3070,7 +3074,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3070
3074
  title: "Download image",
3071
3075
  onClick: Z
3072
3076
  },
3073
- [y(tn, { class: "cpk:size-[14px]" })]
3077
+ [w(tn, { class: "cpk:size-[14px]" })]
3074
3078
  )
3075
3079
  ]
3076
3080
  );
@@ -3127,7 +3131,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3127
3131
  ].filter(Boolean).join(" "),
3128
3132
  "data-streamdown": "table"
3129
3133
  };
3130
- return delete xe.className, y(
3134
+ return delete xe.className, w(
3131
3135
  "div",
3132
3136
  {
3133
3137
  ref: ee,
@@ -3135,12 +3139,12 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3135
3139
  "data-streamdown": "table-wrapper"
3136
3140
  },
3137
3141
  [
3138
- y(
3142
+ w(
3139
3143
  "div",
3140
3144
  { class: "cpk:flex cpk:items-center cpk:justify-end cpk:gap-1" },
3141
3145
  [
3142
- y("div", { class: "cpk:relative" }, [
3143
- y(
3146
+ w("div", { class: "cpk:relative" }, [
3147
+ w(
3144
3148
  "button",
3145
3149
  {
3146
3150
  type: "button",
@@ -3151,11 +3155,11 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3151
3155
  }
3152
3156
  },
3153
3157
  [
3154
- B.value ? y(At, { class: "cpk:size-[14px]" }) : y(zt, { class: "cpk:size-[14px]" })
3158
+ B.value ? w(At, { class: "cpk:size-[14px]" }) : w(zt, { class: "cpk:size-[14px]" })
3155
3159
  ]
3156
3160
  ),
3157
- be.value ? y("div", { class: Un }, [
3158
- y(
3161
+ be.value ? w("div", { class: Un }, [
3162
+ w(
3159
3163
  "button",
3160
3164
  {
3161
3165
  type: "button",
@@ -3165,7 +3169,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3165
3169
  },
3166
3170
  "CSV"
3167
3171
  ),
3168
- y(
3172
+ w(
3169
3173
  "button",
3170
3174
  {
3171
3175
  type: "button",
@@ -3177,8 +3181,8 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3177
3181
  )
3178
3182
  ]) : null
3179
3183
  ]),
3180
- y("div", { class: "cpk:relative" }, [
3181
- y(
3184
+ w("div", { class: "cpk:relative" }, [
3185
+ w(
3182
3186
  "button",
3183
3187
  {
3184
3188
  type: "button",
@@ -3188,10 +3192,10 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3188
3192
  Te.value = !Te.value, be.value = !1;
3189
3193
  }
3190
3194
  },
3191
- [y(tn, { class: "cpk:size-[14px]" })]
3195
+ [w(tn, { class: "cpk:size-[14px]" })]
3192
3196
  ),
3193
- Te.value ? y("div", { class: Un }, [
3194
- y(
3197
+ Te.value ? w("div", { class: Un }, [
3198
+ w(
3195
3199
  "button",
3196
3200
  {
3197
3201
  type: "button",
@@ -3201,7 +3205,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3201
3205
  },
3202
3206
  "CSV"
3203
3207
  ),
3204
- y(
3208
+ w(
3205
3209
  "button",
3206
3210
  {
3207
3211
  type: "button",
@@ -3215,14 +3219,14 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3215
3219
  ])
3216
3220
  ]
3217
3221
  ),
3218
- y("div", { class: "cpk:overflow-x-auto" }, [
3219
- y("table", xe, Z.default ? Z.default() : [])
3222
+ w("div", { class: "cpk:overflow-x-auto" }, [
3223
+ w("table", xe, Z.default ? Z.default() : [])
3220
3224
  ])
3221
3225
  ]
3222
3226
  );
3223
3227
  };
3224
3228
  }
3225
- }), k = {
3229
+ }), y = {
3226
3230
  javascript: "js",
3227
3231
  js: "js",
3228
3232
  typescript: "ts",
@@ -3266,7 +3270,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3266
3270
  };
3267
3271
  return Me(() => {
3268
3272
  Z && clearTimeout(Z);
3269
- }), () => y(
3273
+ }), () => w(
3270
3274
  "button",
3271
3275
  {
3272
3276
  type: "button",
@@ -3276,7 +3280,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3276
3280
  onClick: ee
3277
3281
  },
3278
3282
  [
3279
- X.value ? y(At, { class: "cpk:size-[14px]" }) : y(zt, { class: "cpk:size-[14px]" })
3283
+ X.value ? w(At, { class: "cpk:size-[14px]" }) : w(zt, { class: "cpk:size-[14px]" })
3280
3284
  ]
3281
3285
  );
3282
3286
  }
@@ -3295,10 +3299,10 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3295
3299
  setup(V) {
3296
3300
  const X = () => {
3297
3301
  if (!V.code) return;
3298
- const Z = k[V.language.toLowerCase()] ?? "txt";
3302
+ const Z = y[V.language.toLowerCase()] ?? "txt";
3299
3303
  m(V.code, `file.${Z}`, "text/plain");
3300
3304
  };
3301
- return () => y(
3305
+ return () => w(
3302
3306
  "button",
3303
3307
  {
3304
3308
  type: "button",
@@ -3307,7 +3311,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3307
3311
  "data-streamdown": "code-block-download-button",
3308
3312
  onClick: X
3309
3313
  },
3310
- [y(tn, { class: "cpk:size-[14px]" })]
3314
+ [w(tn, { class: "cpk:size-[14px]" })]
3311
3315
  );
3312
3316
  }
3313
3317
  }), S = {
@@ -3439,7 +3443,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3439
3443
  M("button", {
3440
3444
  "data-testid": "copilot-copy-button",
3441
3445
  type: "button",
3442
- class: ye(G(w)),
3446
+ class: ye(G(k)),
3443
3447
  "aria-label": o.value.assistantMessageToolbarCopyMessageLabel,
3444
3448
  title: o.value.assistantMessageToolbarCopyMessageLabel,
3445
3449
  onClick: F
@@ -3460,7 +3464,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3460
3464
  }, () => [
3461
3465
  M("button", {
3462
3466
  type: "button",
3463
- class: ye(G(w)),
3467
+ class: ye(G(k)),
3464
3468
  "aria-label": o.value.assistantMessageToolbarThumbsUpLabel,
3465
3469
  title: o.value.assistantMessageToolbarThumbsUpLabel,
3466
3470
  onClick: U
@@ -3475,7 +3479,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3475
3479
  }, () => [
3476
3480
  M("button", {
3477
3481
  type: "button",
3478
- class: ye(G(w)),
3482
+ class: ye(G(k)),
3479
3483
  "aria-label": o.value.assistantMessageToolbarThumbsDownLabel,
3480
3484
  title: o.value.assistantMessageToolbarThumbsDownLabel,
3481
3485
  onClick: H
@@ -3490,7 +3494,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3490
3494
  }, () => [
3491
3495
  M("button", {
3492
3496
  type: "button",
3493
- class: ye(G(w)),
3497
+ class: ye(G(k)),
3494
3498
  "aria-label": o.value.assistantMessageToolbarReadAloudLabel,
3495
3499
  title: o.value.assistantMessageToolbarReadAloudLabel,
3496
3500
  onClick: ae
@@ -3505,7 +3509,7 @@ const Os = ["data-message-id"], Ls = { class: "cpk:w-full cpk:bg-transparent cpk
3505
3509
  }, () => [
3506
3510
  M("button", {
3507
3511
  type: "button",
3508
- class: ye(G(w)),
3512
+ class: ye(G(k)),
3509
3513
  "aria-label": o.value.assistantMessageToolbarRegenerateLabel,
3510
3514
  title: o.value.assistantMessageToolbarRegenerateLabel,
3511
3515
  onClick: we
@@ -3530,7 +3534,7 @@ const zs = /* @__PURE__ */ se({
3530
3534
  inheritAttrs: !1,
3531
3535
  __name: "CopilotChatAudioRecorder",
3532
3536
  setup(e, { expose: n }) {
3533
- const t = Ge(), a = I(null), i = I("idle"), o = I(null), s = I(null), r = I(null), l = I(null), p = I(null), w = I([]), u = I([]), d = I(0), g = I(0), h = I(0);
3537
+ const t = Ge(), a = I(null), i = I("idle"), o = I(null), s = I(null), r = I(null), l = I(null), p = I(null), k = I([]), u = I([]), d = I(0), g = I(0), h = I(0);
3534
3538
  function C() {
3535
3539
  p.value !== null && (cancelAnimationFrame(p.value), p.value = null);
3536
3540
  const v = o.value;
@@ -3542,7 +3546,7 @@ const zs = /* @__PURE__ */ se({
3542
3546
  s.value && (s.value.getTracks().forEach((S) => S.stop()), s.value = null);
3543
3547
  const b = l.value;
3544
3548
  b && b.state !== "closed" && b.close().catch(() => {
3545
- }), o.value = null, r.value = null, l.value = null, w.value = [], u.value = [], d.value = 0, g.value = 0, h.value = 0;
3549
+ }), o.value = null, r.value = null, l.value = null, k.value = [], u.value = [], d.value = 0, g.value = 0, h.value = 0;
3546
3550
  }
3547
3551
  async function m() {
3548
3552
  if (i.value !== "idle")
@@ -3555,8 +3559,8 @@ const zs = /* @__PURE__ */ se({
3555
3559
  const S = b.createMediaStreamSource(v), O = b.createAnalyser();
3556
3560
  O.fftSize = 2048, S.connect(O), r.value = O;
3557
3561
  const D = MediaRecorder.isTypeSupported("audio/webm;codecs=opus") ? "audio/webm;codecs=opus" : MediaRecorder.isTypeSupported("audio/webm") ? "audio/webm" : MediaRecorder.isTypeSupported("audio/mp4") ? "audio/mp4" : "", $ = D ? { mimeType: D } : {}, P = new MediaRecorder(v, $);
3558
- o.value = P, w.value = [], P.ondataavailable = (Y) => {
3559
- Y.data.size > 0 && w.value.push(Y.data);
3562
+ o.value = P, k.value = [], P.ondataavailable = (Y) => {
3563
+ Y.data.size > 0 && k.value.push(Y.data);
3560
3564
  }, P.start(100), i.value = "recording";
3561
3565
  } catch (v) {
3562
3566
  throw C(), v instanceof Error && v.name === "NotAllowedError" ? new yt("Microphone permission denied") : v instanceof Error && v.name === "NotFoundError" ? new yt("No microphone found") : new yt(
@@ -3572,7 +3576,7 @@ const zs = /* @__PURE__ */ se({
3572
3576
  return;
3573
3577
  }
3574
3578
  i.value = "processing", S.onstop = () => {
3575
- const O = new Blob(w.value, {
3579
+ const O = new Blob(k.value, {
3576
3580
  type: S.mimeType || "audio/webm"
3577
3581
  });
3578
3582
  C(), i.value = "idle", v(O);
@@ -3589,7 +3593,7 @@ const zs = /* @__PURE__ */ se({
3589
3593
  }
3590
3594
  return Math.sqrt(b / v.length);
3591
3595
  }
3592
- function k() {
3596
+ function y() {
3593
3597
  const v = a.value;
3594
3598
  if (!v)
3595
3599
  return;
@@ -3617,12 +3621,12 @@ const zs = /* @__PURE__ */ se({
3617
3621
  let we = 1;
3618
3622
  H < E ? we = Math.max(0, H / E) : H > S.width - E && (we = Math.max(0, (S.width - H) / E)), b.globalAlpha = h.value * we, b.fillRect(H, ae, D, U);
3619
3623
  }
3620
- p.value = requestAnimationFrame(k);
3624
+ p.value = requestAnimationFrame(y);
3621
3625
  }
3622
3626
  return L(
3623
3627
  i,
3624
3628
  () => {
3625
- p.value !== null && (cancelAnimationFrame(p.value), p.value = null), p.value = requestAnimationFrame(k);
3629
+ p.value !== null && (cancelAnimationFrame(p.value), p.value = null), p.value = requestAnimationFrame(y);
3626
3630
  },
3627
3631
  { immediate: !0 }
3628
3632
  ), Me(() => {
@@ -3709,7 +3713,7 @@ function qs(e, n, t) {
3709
3713
  function wn(e = {}) {
3710
3714
  const n = c(() => _e(e.agentId) ?? ct), t = Oe(), a = c(
3711
3715
  () => _e(e.threadId) ?? t.value?.threadId
3712
- ), { copilotkit: i } = Be(), o = c(() => e.updates ?? _s), s = c(() => i.value.defaultThrottleMs), r = c(() => _e(e.throttleMs)), l = it(null), p = it(null), w = /* @__PURE__ */ new Map(), u = (g, h, C, m) => {
3716
+ ), { copilotkit: i } = Be(), o = c(() => e.updates ?? _s), s = c(() => i.value.defaultThrottleMs), r = c(() => _e(e.throttleMs)), l = it(null), p = it(null), k = /* @__PURE__ */ new Map(), u = (g, h, C, m) => {
3713
3717
  const x = new xa({
3714
3718
  runtimeUrl: h,
3715
3719
  agentId: g,
@@ -3735,14 +3739,14 @@ function wn(e = {}) {
3735
3739
  () => {
3736
3740
  const g = n.value, h = a.value, C = h ? `${g}:${h}` : g, m = i.value, x = m.getAgent(g);
3737
3741
  if (x) {
3738
- w.delete(C), w.delete(g);
3742
+ k.delete(C), k.delete(g);
3739
3743
  const S = h ? qs(x, h, m.headers) : x, O = l.value === S;
3740
3744
  l.value = S, p.value = S, O && ot(l);
3741
3745
  return;
3742
3746
  }
3743
- const f = m.runtimeUrl !== void 0, k = m.runtimeConnectionStatus;
3744
- if (f && (k === Pt.Disconnected || k === Pt.Connecting || k === Pt.Error)) {
3745
- const S = w.get(C);
3747
+ const f = m.runtimeUrl !== void 0, y = m.runtimeConnectionStatus;
3748
+ if (f && (y === Pt.Disconnected || y === Pt.Connecting || y === Pt.Error)) {
3749
+ const S = k.get(C);
3746
3750
  if (S) {
3747
3751
  S.headers = { ...m.headers }, h && (S.threadId = h), l.value = S, p.value = S;
3748
3752
  return;
@@ -3753,7 +3757,7 @@ function wn(e = {}) {
3753
3757
  m.runtimeTransport,
3754
3758
  m.headers
3755
3759
  );
3756
- h && (O.threadId = h), w.set(C, O), l.value = O, p.value = O;
3760
+ h && (O.threadId = h), k.set(C, O), l.value = O, p.value = O;
3757
3761
  return;
3758
3762
  }
3759
3763
  const v = Object.keys(m.agents ?? {}), b = f ? `runtimeUrl=${m.runtimeUrl}` : "no runtimeUrl";
@@ -3780,10 +3784,10 @@ function wn(e = {}) {
3780
3784
  ([g, h], C, m) => {
3781
3785
  const x = h;
3782
3786
  if (!g || x.length === 0) return;
3783
- let f = !0, k = !1;
3787
+ let f = !0, y = !1;
3784
3788
  const v = () => {
3785
- f && (k || (k = !0, queueMicrotask(() => {
3786
- k = !1, f && ot(l);
3789
+ f && (y || (y = !0, queueMicrotask(() => {
3790
+ y = !1, f && ot(l);
3787
3791
  })));
3788
3792
  }, b = {};
3789
3793
  x.includes(
@@ -3821,7 +3825,7 @@ function Ks(e = {}) {
3821
3825
  immediate: !0
3822
3826
  }), L(
3823
3827
  [() => n.value, a],
3824
- (p, w, u) => {
3828
+ (p, k, u) => {
3825
3829
  const d = n.value, g = a.value, h = d.subscribe({
3826
3830
  onSuggestionsChanged: ({ agentId: C, suggestions: m }) => {
3827
3831
  if (C !== g) return;
@@ -3868,12 +3872,12 @@ function Gs(e) {
3868
3872
  }, p = (f) => {
3869
3873
  l(f(s.value));
3870
3874
  };
3871
- async function w(f) {
3872
- const k = o.value, v = k?.accept ?? "*/*", b = k?.maxSize ?? 20 * 1024 * 1024, S = f.filter(
3875
+ async function k(f) {
3876
+ const y = o.value, v = y?.accept ?? "*/*", b = y?.maxSize ?? 20 * 1024 * 1024, S = f.filter(
3873
3877
  (D) => !en(D, v)
3874
3878
  );
3875
3879
  for (const D of S)
3876
- k?.onUploadFailed?.({
3880
+ y?.onUploadFailed?.({
3877
3881
  reason: "invalid-type",
3878
3882
  file: D,
3879
3883
  message: `File "${D.name}" is not accepted. Supported types: ${v}`
@@ -3883,7 +3887,7 @@ function Gs(e) {
3883
3887
  );
3884
3888
  for (const D of O) {
3885
3889
  if (ha(D, b)) {
3886
- k?.onUploadFailed?.({
3890
+ y?.onUploadFailed?.({
3887
3891
  reason: "file-too-large",
3888
3892
  file: D,
3889
3893
  message: `File "${D.name}" exceeds the maximum size of ${on(b)}`
@@ -3904,8 +3908,8 @@ function Gs(e) {
3904
3908
  ]);
3905
3909
  try {
3906
3910
  let Y, ve;
3907
- if (k?.onUpload) {
3908
- const K = await k.onUpload(D), { metadata: E, ...ne } = K;
3911
+ if (y?.onUpload) {
3912
+ const K = await y.onUpload(D), { metadata: E, ...ne } = K;
3909
3913
  Y = ne, ve = E;
3910
3914
  } else
3911
3915
  Y = { type: "data", value: await ka(D), mimeType: D.type };
@@ -3924,7 +3928,7 @@ function Gs(e) {
3924
3928
  } catch (Y) {
3925
3929
  p(
3926
3930
  (ve) => ve.filter((te) => te.id !== P)
3927
- ), console.error(`[CopilotKit] Failed to upload "${D.name}":`, Y), k?.onUploadFailed?.({
3931
+ ), console.error(`[CopilotKit] Failed to upload "${D.name}":`, Y), y?.onUploadFailed?.({
3928
3932
  reason: "upload-failed",
3929
3933
  file: D,
3930
3934
  message: Y instanceof Error ? Y.message : `Failed to upload "${D.name}"`
@@ -3933,8 +3937,8 @@ function Gs(e) {
3933
3937
  }
3934
3938
  }
3935
3939
  async function u(f) {
3936
- const k = f.target;
3937
- k?.files?.length && (await w(Array.from(k.files)), k && (k.value = ""));
3940
+ const y = f.target;
3941
+ y?.files?.length && (await k(Array.from(y.files)), y && (y.value = ""));
3938
3942
  }
3939
3943
  function d(f) {
3940
3944
  r.value && (f.preventDefault(), f.stopPropagation(), t.value = !0);
@@ -3944,26 +3948,26 @@ function Gs(e) {
3944
3948
  }
3945
3949
  async function h(f) {
3946
3950
  if (f.preventDefault(), f.stopPropagation(), t.value = !1, !r.value) return;
3947
- const k = Array.from(f.dataTransfer?.files ?? []);
3948
- k.length > 0 && await w(k);
3951
+ const y = Array.from(f.dataTransfer?.files ?? []);
3952
+ y.length > 0 && await k(y);
3949
3953
  }
3950
3954
  function C(f) {
3951
3955
  p(
3952
- (k) => k.filter((v) => v.id !== f)
3956
+ (y) => y.filter((v) => v.id !== f)
3953
3957
  );
3954
3958
  }
3955
3959
  function m() {
3956
3960
  const f = s.value.filter(
3957
- (k) => k.status === "ready"
3961
+ (y) => y.status === "ready"
3958
3962
  );
3959
3963
  return f.length === 0 || (p(
3960
- (k) => k.filter((v) => v.status !== "ready")
3964
+ (y) => y.filter((v) => v.status !== "ready")
3961
3965
  ), a.value && (a.value.value = "")), f;
3962
3966
  }
3963
3967
  async function x(f) {
3964
3968
  if (!r.value) return;
3965
- const k = f.target;
3966
- if (!k || !i.value?.contains(k)) return;
3969
+ const y = f.target;
3970
+ if (!y || !i.value?.contains(y)) return;
3967
3971
  const v = o.value?.accept ?? "*/*", S = Array.from(f.clipboardData?.items ?? []).filter((D) => {
3968
3972
  if (D.kind !== "file") return !1;
3969
3973
  const $ = D.getAsFile();
@@ -3972,7 +3976,7 @@ function Gs(e) {
3972
3976
  if (S.length === 0) return;
3973
3977
  f.preventDefault();
3974
3978
  const O = S.map((D) => D.getAsFile()).filter((D) => D !== null);
3975
- await w(O);
3979
+ await k(O);
3976
3980
  }
3977
3981
  return Je(() => {
3978
3982
  typeof document < "u" && document.addEventListener("paste", x);
@@ -3984,7 +3988,7 @@ function Gs(e) {
3984
3988
  dragOver: t,
3985
3989
  fileInputRef: a,
3986
3990
  containerRef: i,
3987
- processFiles: w,
3991
+ processFiles: k,
3988
3992
  handleFileUpload: u,
3989
3993
  handleDragOver: d,
3990
3994
  handleDragLeave: g,
@@ -4086,8 +4090,8 @@ function Zs() {
4086
4090
  if (typeof window > "u") return;
4087
4091
  const r = window.visualViewport;
4088
4092
  if (!r) return;
4089
- const l = window.innerHeight, p = r.height, w = Math.max(0, l - p), u = w > 150;
4090
- t.value = w, n.value = u, a.value = p, i.value = l;
4093
+ const l = window.innerHeight, p = r.height, k = Math.max(0, l - p), u = k > 150;
4094
+ t.value = k, n.value = u, a.value = p, i.value = l;
4091
4095
  };
4092
4096
  let s = null;
4093
4097
  return Je(() => {
@@ -4132,15 +4136,15 @@ function ni({
4132
4136
  t,
4133
4137
  () => a
4134
4138
  ],
4135
- ([w, u, d, g, h], C, m) => {
4136
- if (m(p), u === o || (o = u, !w) || !d || !g || !h) return;
4137
- const x = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(w) : w.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, "\\$&"), f = g.querySelector(
4139
+ ([k, u, d, g, h], C, m) => {
4140
+ if (m(p), u === o || (o = u, !k) || !d || !g || !h) return;
4141
+ const x = typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(k) : k.replace(/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g, "\\$&"), f = g.querySelector(
4138
4142
  `[data-message-id="${x}"]`
4139
4143
  );
4140
4144
  if (!f) return;
4141
- const k = d.clientHeight, v = f.getBoundingClientRect().height, b = parseFloat(getComputedStyle(f).paddingTop) || 0, S = Math.max(0, v - b), O = Math.max(
4145
+ const y = d.clientHeight, v = f.getBoundingClientRect().height, b = parseFloat(getComputedStyle(f).paddingTop) || 0, S = Math.max(0, v - b), O = Math.max(
4142
4146
  0,
4143
- k - S - a
4147
+ y - S - a
4144
4148
  );
4145
4149
  h.style.height = `${O}px`, s = O, typeof requestAnimationFrame == "function" && (r = requestAnimationFrame(() => {
4146
4150
  const D = Nn(f, d) + b - a;
@@ -4196,7 +4200,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4196
4200
  },
4197
4201
  emits: ["update:modelValue", "submit-message", "stop", "add-file", "start-transcribe", "cancel-transcribe", "finish-transcribe", "finish-transcribe-with-audio"],
4198
4202
  setup(e, { emit: n }) {
4199
- const t = e, a = n, i = Ge(), o = Oe(), s = lt(), r = I(null), l = I(null), p = I(null), w = I(null), u = I(null), d = I(null), g = I(null), h = I(null), C = I(t.modelValue ?? ""), m = I(!1), x = I("compact"), f = I(null), k = I(0), v = I(null), b = I(!1), S = I({
4203
+ const t = e, a = n, i = Ge(), o = Oe(), s = lt(), r = I(null), l = I(null), p = I(null), k = I(null), u = I(null), d = I(null), g = I(null), h = I(null), C = I(t.modelValue ?? ""), m = I(!1), x = I("compact"), f = I(null), y = I(0), v = I(null), b = I(!1), S = I({
4200
4204
  singleLineHeight: 0,
4201
4205
  maxHeight: 0,
4202
4206
  paddingLeft: 0,
@@ -4343,7 +4347,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4343
4347
  f.value = null;
4344
4348
  }
4345
4349
  function Et(A) {
4346
- Ft(), A.action?.(), f.value = null, k.value = 0, requestAnimationFrame(() => {
4350
+ Ft(), A.action?.(), f.value = null, y.value = 0, requestAnimationFrame(() => {
4347
4351
  l.value?.focus();
4348
4352
  });
4349
4353
  }
@@ -4368,15 +4372,15 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4368
4372
  if (!t.disabled && !(m.value || A.isComposing || A.keyCode === 229)) {
4369
4373
  if (f.value !== null && t.mode === "input") {
4370
4374
  if (A.key === "ArrowDown") {
4371
- le.value.length > 0 && (A.preventDefault(), k.value = k.value < 0 ? 0 : (k.value + 1) % le.value.length);
4375
+ le.value.length > 0 && (A.preventDefault(), y.value = y.value < 0 ? 0 : (y.value + 1) % le.value.length);
4372
4376
  return;
4373
4377
  }
4374
4378
  if (A.key === "ArrowUp") {
4375
- le.value.length > 0 && (A.preventDefault(), k.value < 0 ? k.value = le.value.length - 1 : k.value = k.value <= 0 ? le.value.length - 1 : k.value - 1);
4379
+ le.value.length > 0 && (A.preventDefault(), y.value < 0 ? y.value = le.value.length - 1 : y.value = y.value <= 0 ? le.value.length - 1 : y.value - 1);
4376
4380
  return;
4377
4381
  }
4378
4382
  if (A.key === "Enter") {
4379
- const N = k.value >= 0 ? le.value[k.value] : void 0;
4383
+ const N = y.value >= 0 ? le.value[y.value] : void 0;
4380
4384
  if (N) {
4381
4385
  A.preventDefault(), Et(N);
4382
4386
  return;
@@ -4467,7 +4471,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4467
4471
  )), null;
4468
4472
  }
4469
4473
  function at() {
4470
- const A = p.value, N = w.value, ie = u.value;
4474
+ const A = p.value, N = k.value, ie = u.value;
4471
4475
  if (!A || !N || !ie)
4472
4476
  return P.value = null, null;
4473
4477
  const me = window.getComputedStyle(A), He = parseFloat(me.paddingLeft) || 0, Ce = parseFloat(me.paddingRight) || 0, We = parseFloat(me.columnGap) || 0, ut = A.clientWidth - He - Ce;
@@ -4492,7 +4496,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4492
4496
  return;
4493
4497
  }
4494
4498
  const A = l.value;
4495
- if (!A || !p.value || !w.value || !u.value)
4499
+ if (!A || !p.value || !k.value || !u.value)
4496
4500
  return;
4497
4501
  S.value.singleLineHeight === 0 && Tt();
4498
4502
  const N = Lt(), ie = S.value.singleLineHeight, me = re.value.includes(`
@@ -4551,21 +4555,21 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4551
4555
  }), L(
4552
4556
  [f, () => le.value.length],
4553
4557
  ([A, N]) => {
4554
- A !== null && A !== v.value && N > 0 && (k.value = 0), v.value = A;
4558
+ A !== null && A !== v.value && N > 0 && (y.value = 0), v.value = A;
4555
4559
  },
4556
4560
  { immediate: !0 }
4557
4561
  ), L(
4558
4562
  [f, le],
4559
4563
  () => {
4560
4564
  if (f.value === null) {
4561
- k.value = 0;
4565
+ y.value = 0;
4562
4566
  return;
4563
4567
  }
4564
4568
  if (le.value.length === 0) {
4565
- k.value = -1;
4569
+ y.value = -1;
4566
4570
  return;
4567
4571
  }
4568
- (k.value < 0 || k.value >= le.value.length) && (k.value = 0);
4572
+ (y.value < 0 || y.value >= le.value.length) && (y.value = 0);
4569
4573
  },
4570
4574
  { immediate: !0 }
4571
4575
  ), L(
@@ -4601,7 +4605,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4601
4605
  }
4602
4606
  },
4603
4607
  { immediate: !0 }
4604
- ), L(k, async (A) => {
4608
+ ), L(y, async (A) => {
4605
4609
  if (!Ne.value || A < 0)
4606
4610
  return;
4607
4611
  await ft(), d.value?.querySelector(
@@ -4615,18 +4619,18 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4615
4619
  ), Je(() => {
4616
4620
  if (t.autoFocus && t.mode === "input" && l.value?.focus(), Pe(), typeof ResizeObserver < "u") {
4617
4621
  const A = /* @__PURE__ */ new Set();
4618
- p.value && A.add(p.value), w.value && A.add(w.value), u.value && A.add(u.value), te = new ResizeObserver((N) => {
4622
+ p.value && A.add(p.value), k.value && A.add(k.value), u.value && A.add(u.value), te = new ResizeObserver((N) => {
4619
4623
  const ie = N.some(
4620
4624
  (me) => A.has(me.target)
4621
4625
  );
4622
4626
  bt(ie);
4623
- }), p.value && te.observe(p.value), w.value && te.observe(w.value), u.value && te.observe(u.value), l.value && te.observe(l.value);
4627
+ }), p.value && te.observe(p.value), k.value && te.observe(k.value), u.value && te.observe(u.value), l.value && te.observe(l.value);
4624
4628
  }
4625
4629
  K = (A) => {
4626
4630
  if (!b.value)
4627
4631
  return;
4628
4632
  const N = A.target;
4629
- N && (g.value?.contains(N) || w.value?.contains(N) || gt());
4633
+ N && (g.value?.contains(N) || k.value?.contains(N) || gt());
4630
4634
  }, document.addEventListener("mousedown", K);
4631
4635
  }), Me(() => {
4632
4636
  K && (document.removeEventListener("mousedown", K), K = null), te?.disconnect(), te = null, O.value !== null && (cancelAnimationFrame(O.value), O.value = null);
@@ -4680,7 +4684,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4680
4684
  }, [
4681
4685
  M("div", {
4682
4686
  ref_key: "addButtonContainerRef",
4683
- ref: w,
4687
+ ref: k,
4684
4688
  class: ye([
4685
4689
  "cpk:relative cpk:flex cpk:items-center cpk:col-start-1",
4686
4690
  H.value ? "cpk:row-start-2" : "cpk:row-start-1"
@@ -4790,13 +4794,13 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4790
4794
  type: "button",
4791
4795
  role: "option",
4792
4796
  "data-slash-index": me,
4793
- "aria-selected": me === k.value,
4794
- "data-active": me === k.value ? "true" : void 0,
4797
+ "aria-selected": me === y.value,
4798
+ "data-active": me === y.value ? "true" : void 0,
4795
4799
  class: ye([
4796
4800
  "cpk:w-full cpk:px-3 cpk:py-2 cpk:text-left cpk:text-sm cpk:transition-colors cpk:hover:bg-muted cpk:dark:hover:bg-[#2f2f2f]",
4797
- me === k.value ? "cpk:bg-muted cpk:dark:bg-[#2f2f2f]" : "cpk:bg-transparent"
4801
+ me === y.value ? "cpk:bg-muted cpk:dark:bg-[#2f2f2f]" : "cpk:bg-transparent"
4798
4802
  ]),
4799
- onMouseenter: (He) => k.value = me,
4803
+ onMouseenter: (He) => y.value = me,
4800
4804
  onMousedown: Ht((He) => Et(ie), ["prevent"])
4801
4805
  }, ke(ie.label), 43, pi))), 128))
4802
4806
  ], 512)) : Q("", !0)
@@ -4970,22 +4974,22 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
4970
4974
  const f = m.source.mimeType;
4971
4975
  if (!g(f) && !h(f))
4972
4976
  return;
4973
- const k = C(m.source.value, f);
4974
- o.value = k;
4977
+ const y = C(m.source.value, f);
4978
+ o.value = y;
4975
4979
  },
4976
4980
  { immediate: !0 }
4977
4981
  ), L(s, (m, x, f) => {
4978
4982
  if (!m || typeof document > "u") return;
4979
- const k = (v) => {
4983
+ const y = (v) => {
4980
4984
  v.key === "Escape" && u();
4981
4985
  };
4982
- document.addEventListener("keydown", k), f(() => {
4983
- document.removeEventListener("keydown", k);
4986
+ document.addEventListener("keydown", y), f(() => {
4987
+ document.removeEventListener("keydown", y);
4984
4988
  });
4985
4989
  }), Me(() => {
4986
4990
  o.value && (URL.revokeObjectURL(o.value), o.value = null);
4987
4991
  });
4988
- function w(m) {
4992
+ function k(m) {
4989
4993
  if (typeof document < "u") {
4990
4994
  const x = document;
4991
4995
  if (typeof x.startViewTransition == "function") {
@@ -5011,10 +5015,10 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5011
5015
  }
5012
5016
  function C(m, x) {
5013
5017
  try {
5014
- const f = atob(m), k = new Uint8Array(f.length);
5018
+ const f = atob(m), y = new Uint8Array(f.length);
5015
5019
  for (let b = 0; b < f.length; b += 1)
5016
- k[b] = f.charCodeAt(b);
5017
- const v = new Blob([k], {
5020
+ y[b] = f.charCodeAt(b);
5021
+ const v = new Blob([y], {
5018
5022
  type: x || "application/octet-stream"
5019
5023
  });
5020
5024
  return URL.createObjectURL(v);
@@ -5043,7 +5047,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5043
5047
  type: "button",
5044
5048
  class: "cpk:w-full cpk:h-full cpk:border-none cpk:bg-transparent cpk:p-0 cpk:cursor-pointer",
5045
5049
  "data-testid": "copilot-chat-attachment-image-button",
5046
- onClick: (k) => w(f)
5050
+ onClick: (y) => k(f)
5047
5051
  }, [
5048
5052
  M("img", {
5049
5053
  src: G(wt)(f.source),
@@ -5071,7 +5075,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5071
5075
  class: "cpk:absolute cpk:inset-0 cpk:flex cpk:items-center cpk:justify-center cpk:z-10 cpk:cursor-pointer cpk:bg-black/20 cpk:border-none cpk:p-0",
5072
5076
  "aria-label": "Play video",
5073
5077
  "data-testid": "copilot-chat-attachment-video-play",
5074
- onClick: (k) => w(f)
5078
+ onClick: (y) => k(f)
5075
5079
  }, [...x[2] || (x[2] = [
5076
5080
  M("div", { class: "cpk:w-8 cpk:h-8 cpk:rounded-full cpk:bg-black/60 cpk:flex cpk:items-center cpk:justify-center cpk:text-white cpk:text-xs cpk:font-semibold" }, " ▶ ", -1)
5077
5081
  ])], 8, Ii)
@@ -5092,7 +5096,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5092
5096
  g(f.source.mimeType) || h(f.source.mimeType) ? "cpk:cursor-pointer" : "cpk:cursor-default"
5093
5097
  ]),
5094
5098
  "data-testid": "copilot-chat-attachment-document-button",
5095
- onClick: (k) => (g(f.source.mimeType) || h(f.source.mimeType)) && w(f)
5099
+ onClick: (y) => (g(f.source.mimeType) || h(f.source.mimeType)) && k(f)
5096
5100
  }, [
5097
5101
  M("div", Fi, ke(G(sn)(f.source.mimeType ?? "")), 1),
5098
5102
  M("div", Ei, [
@@ -5105,7 +5109,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5105
5109
  type: "button",
5106
5110
  class: "cpk:absolute cpk:bg-black/60 cpk:text-white cpk:border-none cpk:rounded-full cpk:w-5 cpk:h-5 cpk:flex cpk:items-center cpk:justify-center cpk:cursor-pointer cpk:text-[10px] cpk:z-20 cpk:top-1 cpk:right-1",
5107
5111
  "aria-label": "Remove attachment",
5108
- onClick: (k) => a("remove-attachment", f.id)
5112
+ onClick: (y) => a("remove-attachment", f.id)
5109
5113
  }, " ✕ ", 8, Ui)
5110
5114
  ], 10, ki))), 128))
5111
5115
  ], 2)) : Q("", !0),
@@ -5198,18 +5202,18 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5198
5202
  ), i = c(() => a.value.length > 0), o = c(
5199
5203
  () => n.messages[n.messages.length - 1]?.id === n.message.id
5200
5204
  ), s = c(() => !!(n.isRunning && o.value)), r = I(0), l = I(s.value), p = I(!1);
5201
- let w = null, u = null;
5205
+ let k = null, u = null;
5202
5206
  function d() {
5203
5207
  u && (clearInterval(u), u = null);
5204
5208
  }
5205
5209
  function g() {
5206
- w !== null && (r.value = (Date.now() - w) / 1e3);
5210
+ k !== null && (r.value = (Date.now() - k) / 1e3);
5207
5211
  }
5208
5212
  L(
5209
5213
  s,
5210
5214
  (m) => {
5211
5215
  if (m) {
5212
- w === null && (w = Date.now()), d(), u = setInterval(g, 1e3), p.value = !1, l.value = !0;
5216
+ k === null && (k = Date.now()), d(), u = setInterval(g, 1e3), p.value = !1, l.value = !0;
5213
5217
  return;
5214
5218
  }
5215
5219
  d(), g(), p.value || (l.value = !1);
@@ -5326,7 +5330,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5326
5330
  let l = null;
5327
5331
  const p = c(
5328
5332
  () => s?.vnode.props ?? {}
5329
- ), w = [
5333
+ ), k = [
5330
5334
  "cpk:inline-flex cpk:h-8 cpk:w-8 cpk:items-center cpk:justify-center cpk:rounded-md cpk:p-0",
5331
5335
  "cpk:cursor-pointer cpk:text-[rgb(93,93,93)] cpk:transition-colors cpk:hover:bg-[#E8E8E8]",
5332
5336
  "cpk:hover:text-[rgb(93,93,93)] cpk:dark:text-[rgb(243,243,243)] cpk:dark:hover:bg-[#303030]",
@@ -5349,7 +5353,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5349
5353
  ), x = c(() => t.branchIndex > 0), f = c(
5350
5354
  () => t.branchIndex < t.numberOfBranches - 1
5351
5355
  );
5352
- function k() {
5356
+ function y() {
5353
5357
  l && clearTimeout(l), r.value = !0, l = setTimeout(() => {
5354
5358
  r.value = !1, l = null;
5355
5359
  }, 2e3);
@@ -5357,7 +5361,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5357
5361
  async function v() {
5358
5362
  if (d.value && !(typeof navigator > "u" || typeof navigator.clipboard?.writeText != "function"))
5359
5363
  try {
5360
- await navigator.clipboard.writeText(d.value), k();
5364
+ await navigator.clipboard.writeText(d.value), y();
5361
5365
  } catch ($) {
5362
5366
  console.error("Failed to copy to clipboard:", $);
5363
5367
  }
@@ -5434,7 +5438,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5434
5438
  M("button", {
5435
5439
  "data-testid": "copilot-user-copy-button",
5436
5440
  type: "button",
5437
- class: ye(G(w)),
5441
+ class: ye(G(k)),
5438
5442
  "aria-label": o.value.userMessageToolbarCopyMessageLabel,
5439
5443
  title: o.value.userMessageToolbarCopyMessageLabel,
5440
5444
  onClick: v
@@ -5455,7 +5459,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5455
5459
  }, () => [
5456
5460
  M("button", {
5457
5461
  type: "button",
5458
- class: ye(G(w)),
5462
+ class: ye(G(k)),
5459
5463
  "aria-label": o.value.userMessageToolbarEditMessageLabel,
5460
5464
  title: o.value.userMessageToolbarEditMessageLabel,
5461
5465
  onClick: b
@@ -5475,7 +5479,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5475
5479
  M("div", cr, [
5476
5480
  M("button", {
5477
5481
  type: "button",
5478
- class: ye([G(w), "cpk:h-6 cpk:w-6 cpk:p-0"]),
5482
+ class: ye([G(k), "cpk:h-6 cpk:w-6 cpk:p-0"]),
5479
5483
  disabled: !x.value,
5480
5484
  "aria-label": "Previous branch",
5481
5485
  title: "Previous branch",
@@ -5486,7 +5490,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5486
5490
  M("span", dr, ke(e.branchIndex + 1) + "/" + ke(e.numberOfBranches), 1),
5487
5491
  M("button", {
5488
5492
  type: "button",
5489
- class: ye([G(w), "cpk:h-6 cpk:w-6 cpk:p-0"]),
5493
+ class: ye([G(k), "cpk:h-6 cpk:w-6 cpk:p-0"]),
5490
5494
  disabled: !f.value,
5491
5495
  "aria-label": "Next branch",
5492
5496
  title: "Next branch",
@@ -5512,8 +5516,8 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5512
5516
  const n = e, { copilotkit: t } = Be(), a = Oe(), i = I(0), o = I(null), s = pn(), r = c(() => Object.keys(s)), l = c(
5513
5517
  () => a.value?.agentId ?? ct
5514
5518
  ), p = c(() => {
5515
- const f = l.value, k = t.value.getAgent(f);
5516
- return jn(k, a.value?.threadId) ?? k;
5519
+ const f = l.value, y = t.value.getAgent(f);
5520
+ return jn(y, a.value?.threadId) ?? y;
5517
5521
  });
5518
5522
  L(
5519
5523
  [
@@ -5522,8 +5526,8 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5522
5526
  () => t.value,
5523
5527
  () => t.value.runtimeConnectionStatus
5524
5528
  ],
5525
- ([f, k], v, b) => {
5526
- const S = t.value.getAgent(l.value), O = jn(S, k) ?? S;
5529
+ ([f, y], v, b) => {
5530
+ const S = t.value.getAgent(l.value), O = jn(S, y) ?? S;
5527
5531
  if (!O) return;
5528
5532
  const D = O.subscribe({
5529
5533
  onStateChanged: () => {
@@ -5544,7 +5548,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5544
5548
  { immediate: !0 }
5545
5549
  ), L(
5546
5550
  () => t.value,
5547
- (f, k, v) => {
5551
+ (f, y, v) => {
5548
5552
  o.value = f.interruptState;
5549
5553
  const b = f.subscribe({
5550
5554
  onInterruptStateChanged: ({ interruptState: S }) => {
@@ -5558,56 +5562,56 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5558
5562
  },
5559
5563
  { immediate: !0 }
5560
5564
  );
5561
- function w(f) {
5562
- const k = /* @__PURE__ */ new Map();
5565
+ function k(f) {
5566
+ const y = /* @__PURE__ */ new Map();
5563
5567
  for (const v of f) {
5564
- const b = k.get(v.id);
5568
+ const b = y.get(v.id);
5565
5569
  if (b && v.role === "assistant" && b.role === "assistant") {
5566
5570
  const S = v.content || b.content, O = v.toolCalls ?? b.toolCalls;
5567
- k.set(v.id, {
5571
+ y.set(v.id, {
5568
5572
  ...b,
5569
5573
  ...v,
5570
5574
  content: S,
5571
5575
  toolCalls: O
5572
5576
  });
5573
5577
  } else
5574
- k.set(v.id, v);
5578
+ y.set(v.id, v);
5575
5579
  }
5576
- return [...k.values()];
5580
+ return [...y.values()];
5577
5581
  }
5578
5582
  const u = c(
5579
- () => w(n.messages)
5583
+ () => k(n.messages)
5580
5584
  ), d = c(() => n.messages[n.messages.length - 1]), g = c(
5581
5585
  () => n.isRunning && d.value?.role !== "reasoning"
5582
5586
  );
5583
5587
  L(
5584
5588
  [() => n.messages.length, () => u.value.length],
5585
- ([f, k]) => {
5586
- process.env.NODE_ENV === "development" && k < f && console.warn(
5587
- `CopilotChatMessageView: Deduplicated ${f - k} message(s) with duplicate IDs.`
5589
+ ([f, y]) => {
5590
+ process.env.NODE_ENV === "development" && y < f && console.warn(
5591
+ `CopilotChatMessageView: Deduplicated ${f - y} message(s) with duplicate IDs.`
5588
5592
  );
5589
5593
  },
5590
5594
  { immediate: !0 }
5591
5595
  );
5592
5596
  function h(f) {
5593
5597
  i.value += 0;
5594
- const k = l.value, v = a.value?.threadId ?? "", b = t.value, S = b.getRunIdForMessage(k, v, f.id) ?? b.getRunIdsForThread(k, v).slice(-1)[0], O = S ?? `missing-run-id:${f.id}`, D = p.value ?? b.getAgent(k), $ = S && D ? D.messages.filter(
5595
- (E) => b.getRunIdForMessage(k, v, E.id) === S
5596
- ).map((E) => E.id) : [f.id], P = D ? D.messages.findIndex((E) => E.id === f.id) : -1, Y = P >= 0 ? P : 0, ve = S ? Math.max($.indexOf(f.id), 0) : 0, te = S ? $.length : 1, K = S ? b.getStateByRun(k, v, S) : void 0;
5598
+ const y = l.value, v = a.value?.threadId ?? "", b = t.value, S = b.getRunIdForMessage(y, v, f.id) ?? b.getRunIdsForThread(y, v).slice(-1)[0], O = S ?? `missing-run-id:${f.id}`, D = p.value ?? b.getAgent(y), $ = S && D ? D.messages.filter(
5599
+ (E) => b.getRunIdForMessage(y, v, E.id) === S
5600
+ ).map((E) => E.id) : [f.id], P = D ? D.messages.findIndex((E) => E.id === f.id) : -1, Y = P >= 0 ? P : 0, ve = S ? Math.max($.indexOf(f.id), 0) : 0, te = S ? $.length : 1, K = S ? b.getStateByRun(y, v, S) : void 0;
5597
5601
  return {
5598
5602
  runId: O,
5599
5603
  messageIndex: Y,
5600
5604
  messageIndexInRun: ve,
5601
5605
  numberOfMessagesInRun: te,
5602
- agentId: k,
5606
+ agentId: y,
5603
5607
  stateSnapshot: K
5604
5608
  };
5605
5609
  }
5606
5610
  function C(f) {
5607
5611
  return `activity-${f}`;
5608
5612
  }
5609
- function m(f, k) {
5610
- if (i.value += 0, s[k === "before" ? "message-before" : "message-after"])
5613
+ function m(f, y) {
5614
+ if (i.value += 0, s[y === "before" ? "message-before" : "message-after"])
5611
5615
  return null;
5612
5616
  const b = l.value, O = [...t.value.renderCustomMessages].filter(
5613
5617
  (D) => D.agentId === void 0 || D.agentId === b
@@ -5620,14 +5624,14 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5620
5624
  props: {
5621
5625
  ...h(f),
5622
5626
  message: f,
5623
- position: k
5627
+ position: y
5624
5628
  }
5625
5629
  } : null;
5626
5630
  }
5627
5631
  function x(f) {
5628
5632
  i.value += 0;
5629
- const k = l.value, v = [...t.value.renderActivityMessages].filter(
5630
- (S) => S.activityType === f.activityType && (S.agentId === void 0 || S.agentId === k)
5633
+ const y = l.value, v = [...t.value.renderActivityMessages].filter(
5634
+ (S) => S.activityType === f.activityType && (S.agentId === void 0 || S.agentId === y)
5631
5635
  ).sort((S, O) => {
5632
5636
  const D = S.agentId !== void 0, $ = O.agentId !== void 0;
5633
5637
  return D === $ ? 0 : D ? -1 : 1;
@@ -5644,7 +5648,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5644
5648
  }
5645
5649
  } : null;
5646
5650
  }
5647
- return (f, k) => (R(), j("div", ge({
5651
+ return (f, y) => (R(), j("div", ge({
5648
5652
  "data-copilotkit": "",
5649
5653
  class: "cpk:flex cpk:flex-col"
5650
5654
  }, f.$attrs), [
@@ -5747,7 +5751,7 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5747
5751
  resolve: o.value.resolve
5748
5752
  }) : Q("", !0),
5749
5753
  g.value ? T(f.$slots, "cursor", { key: 1 }, () => [
5750
- k[0] || (k[0] = M("div", {
5754
+ y[0] || (y[0] = M("div", {
5751
5755
  class: "cpk:w-[11px] cpk:h-[11px] cpk:rounded-full cpk:bg-foreground cpk:animate-pulse cpk:ml-1",
5752
5756
  "data-testid": "copilot-loading-cursor"
5753
5757
  }, null, -1))
@@ -5816,15 +5820,15 @@ const ai = { class: "cpk:pointer-events-auto cpk:mx-auto cpk:max-w-3xl cpk:px-4
5816
5820
  function p(u, d) {
5817
5821
  a("select-suggestion", u, d);
5818
5822
  }
5819
- const w = c(() => ({
5823
+ const k = c(() => ({
5820
5824
  suggestions: t.suggestions,
5821
5825
  loadingIndexes: t.loadingIndexes,
5822
5826
  onSelectSuggestion: p,
5823
5827
  containerClass: s.value,
5824
5828
  containerAttrs: r.value
5825
5829
  }));
5826
- return (u, d) => T(u.$slots, "layout", q(J(w.value)), () => [
5827
- T(u.$slots, "container", q(J(w.value)), () => [
5830
+ return (u, d) => T(u.$slots, "layout", q(J(k.value)), () => [
5831
+ T(u.$slots, "container", q(J(k.value)), () => [
5828
5832
  M("div", ge({
5829
5833
  "data-copilotkit": "",
5830
5834
  "data-testid": "copilot-chat-suggestion-view",
@@ -5901,17 +5905,17 @@ const xr = {
5901
5905
  },
5902
5906
  emits: ["submit-message", "stop", "input-change", "select-suggestion", "add-file", "start-transcribe", "cancel-transcribe", "finish-transcribe"],
5903
5907
  setup(e, { emit: n }) {
5904
- const t = e, a = n, i = Oe(), o = c(() => i.value?.labels ?? Ze), s = lt(), r = pn(), l = I(null), p = I(null), w = I(null), u = I(null), d = I(0), g = I(!0), h = c(() => t.inputValue !== void 0), C = I(t.inputValue ?? ""), m = c(() => wr(t.autoScroll)), x = c(
5908
+ const t = e, a = n, i = Oe(), o = c(() => i.value?.labels ?? Ze), s = lt(), r = pn(), l = I(null), p = I(null), k = I(null), u = I(null), d = I(0), g = I(!0), h = c(() => t.inputValue !== void 0), C = I(t.inputValue ?? ""), m = c(() => wr(t.autoScroll)), x = c(
5905
5909
  () => m.value === "pin-to-bottom"
5906
5910
  ), f = c(() => m.value === "pin-to-send");
5907
5911
  ni({
5908
5912
  scrollRef: l,
5909
5913
  contentRef: p,
5910
- spacerRef: w,
5914
+ spacerRef: k,
5911
5915
  topOffset: 16
5912
5916
  });
5913
- const { isKeyboardOpen: k, keyboardHeight: v } = Zs(), b = c(
5914
- () => k.value ? v.value : 0
5917
+ const { isKeyboardOpen: y, keyboardHeight: v } = Zs(), b = c(
5918
+ () => y.value ? v.value : 0
5915
5919
  ), S = c(
5916
5920
  () => h.value ? t.inputValue ?? "" : C.value
5917
5921
  ), O = c(
@@ -6199,7 +6203,7 @@ const xr = {
6199
6203
  f.value ? (R(), j("div", {
6200
6204
  key: 0,
6201
6205
  ref_key: "spacerRef",
6202
- ref: w,
6206
+ ref: k,
6203
6207
  "data-pin-to-send-spacer": "",
6204
6208
  "aria-hidden": "true",
6205
6209
  style: { height: "0px", flex: "0 0 auto" }
@@ -6297,19 +6301,19 @@ const xr = {
6297
6301
  setup(e, { emit: n }) {
6298
6302
  const t = e, a = n, i = Ge(), o = pn(), s = Oe(), { copilotkit: r } = Be(), l = c(
6299
6303
  () => Object.keys(o).filter((_) => _ !== "chat-view")
6300
- ), p = I(pt()), w = I("input"), u = I(t.inputValue ?? ""), d = I(null), g = I(!1), h = I(!1), C = I(!1), m = it(null), x = c(
6304
+ ), p = I(pt()), k = I("input"), u = I(t.inputValue ?? ""), d = I(null), g = I(!1), h = I(!1), C = I(!1), m = it(null), x = c(
6301
6305
  () => t.agentId ?? s.value?.agentId ?? ct
6302
6306
  ), f = c(
6303
6307
  () => t.threadId ?? s.value?.threadId
6304
- ), k = c(
6308
+ ), y = c(
6305
6309
  () => f.value ?? p.value
6306
6310
  ), v = c(
6307
6311
  () => !!t.threadId || !!s.value?.hasExplicitThreadId
6308
6312
  ), b = I(null), S = c(
6309
- () => v.value && b.value !== k.value
6313
+ () => v.value && b.value !== y.value
6310
6314
  ), O = Zn(c(() => t.labels)), D = c(() => O.value), { agent: $ } = wn({
6311
6315
  agentId: x,
6312
- threadId: k,
6316
+ threadId: y,
6313
6317
  throttleMs: c(() => t.throttleMs)
6314
6318
  }), { suggestions: P } = Ks({
6315
6319
  agentId: x
@@ -6344,7 +6348,7 @@ const xr = {
6344
6348
  } = Gs({
6345
6349
  config: c(() => t.attachments)
6346
6350
  }), be = c(
6347
- () => g.value ? "processing" : w.value
6351
+ () => g.value ? "processing" : k.value
6348
6352
  ), Te = I(0), B = c(() => [...$.value?.messages ?? []]), ue = c(() => (Te.value, $.value?.isRunning ?? !1)), pe = c(
6349
6353
  () => ue.value && B.value.length > 0
6350
6354
  ), $e = c(() => {
@@ -6412,7 +6416,7 @@ const xr = {
6412
6416
  h,
6413
6417
  () => r.value,
6414
6418
  () => $.value,
6415
- k,
6419
+ y,
6416
6420
  v
6417
6421
  ],
6418
6422
  ([_, de, fe, Ie, Ve], gt, tt) => {
@@ -6447,7 +6451,7 @@ const xr = {
6447
6451
  }
6448
6452
  tt(() => {
6449
6453
  const Pe = m.value;
6450
- !Pe || Pe !== at || !(C.value || r.value !== Pe.core || $.value !== Pe.agent || k.value !== Pe.threadId) || (Pe.detached = !0, Pe.abortController.abort(), Pe.agent.detachActiveRun?.(), m.value = null);
6454
+ !Pe || Pe !== at || !(C.value || r.value !== Pe.core || $.value !== Pe.agent || y.value !== Pe.threadId) || (Pe.detached = !0, Pe.abortController.abort(), Pe.agent.detachActiveRun?.(), m.value = null);
6451
6455
  });
6452
6456
  },
6453
6457
  { immediate: !0 }
@@ -6468,7 +6472,7 @@ const xr = {
6468
6472
  if (_)
6469
6473
  try {
6470
6474
  const de = m.value;
6471
- de && de.agent === _ && de.threadId === k.value && (de.detached = !0, de.abortController.abort(), m.value = null, await de.agent.detachActiveRun?.()), await r.value.runAgent({ agent: _ });
6475
+ de && de.agent === _ && de.threadId === y.value && (de.detached = !0, de.abortController.abort(), m.value = null, await de.agent.detachActiveRun?.()), await r.value.runAgent({ agent: _ });
6472
6476
  } catch (de) {
6473
6477
  console.error("CopilotChat: runAgent failed", de);
6474
6478
  }
@@ -6543,13 +6547,13 @@ const xr = {
6543
6547
  }, 100);
6544
6548
  }
6545
6549
  function le() {
6546
- d.value = null, w.value = "transcribe", a("start-transcribe");
6550
+ d.value = null, k.value = "transcribe", a("start-transcribe");
6547
6551
  }
6548
6552
  function Ne() {
6549
- d.value = null, w.value = "input", a("cancel-transcribe");
6553
+ d.value = null, k.value = "input", a("cancel-transcribe");
6550
6554
  }
6551
6555
  function Qe() {
6552
- w.value = "input", a("finish-transcribe");
6556
+ k.value = "input", a("finish-transcribe");
6553
6557
  }
6554
6558
  async function Ft(_) {
6555
6559
  if (t.onFinishTranscribeWithAudio) {
@@ -6633,7 +6637,7 @@ const xr = {
6633
6637
  });
6634
6638
  return (_, de) => (R(), he(bn, {
6635
6639
  "agent-id": x.value,
6636
- "thread-id": k.value,
6640
+ "thread-id": y.value,
6637
6641
  "has-explicit-thread-id": v.value,
6638
6642
  labels: D.value
6639
6643
  }, {
@@ -6757,7 +6761,7 @@ const xr = {
6757
6761
  setup(e, { attrs: n }) {
6758
6762
  return () => {
6759
6763
  const { class: t, ...a } = n;
6760
- return y(vn, {
6764
+ return w(vn, {
6761
6765
  ...a,
6762
6766
  class: ["cpk:h-6 cpk:w-6", t],
6763
6767
  strokeWidth: 1.75
@@ -6770,7 +6774,7 @@ const xr = {
6770
6774
  setup(e, { attrs: n }) {
6771
6775
  return () => {
6772
6776
  const { class: t, ...a } = n;
6773
- return y(po, {
6777
+ return w(po, {
6774
6778
  ...a,
6775
6779
  class: ["cpk:h-6 cpk:w-6", t],
6776
6780
  strokeWidth: 1.75,
@@ -6799,7 +6803,7 @@ const xr = {
6799
6803
  ]), p = c(() => {
6800
6804
  const { class: h, onClick: C, ...m } = t;
6801
6805
  return m;
6802
- }), w = Object.freeze({
6806
+ }), k = Object.freeze({
6803
6807
  transition: "opacity 120ms ease-out, transform 260ms cubic-bezier(0.22, 1, 0.36, 1)"
6804
6808
  });
6805
6809
  function u(h) {
@@ -6837,7 +6841,7 @@ const xr = {
6837
6841
  "data-slot": "chat-toggle-button-open-icon",
6838
6842
  class: ye(Pn),
6839
6843
  style: rt({
6840
- ...G(w),
6844
+ ...G(k),
6841
6845
  opacity: s.value ? 0 : 1,
6842
6846
  transform: `scale(${s.value ? 0.75 : 1}) rotate(${s.value ? 90 : 0}deg)`
6843
6847
  })
@@ -6858,7 +6862,7 @@ const xr = {
6858
6862
  "data-slot": "chat-toggle-button-close-icon",
6859
6863
  class: ye(Pn),
6860
6864
  style: rt({
6861
- ...G(w),
6865
+ ...G(k),
6862
6866
  opacity: s.value ? 1 : 0,
6863
6867
  transform: `scale(${s.value ? 1 : 0.75}) rotate(${s.value ? 0 : -90}deg)`
6864
6868
  })
@@ -6889,7 +6893,7 @@ const xr = {
6889
6893
  type: o,
6890
6894
  ...s
6891
6895
  } = t;
6892
- return y(
6896
+ return w(
6893
6897
  "button",
6894
6898
  {
6895
6899
  ...s,
@@ -6901,7 +6905,7 @@ const xr = {
6901
6905
  ],
6902
6906
  "aria-label": a.value
6903
6907
  },
6904
- n.default ? n.default() : [y(vn, { class: "cpk:h-4 cpk:w-4", "aria-hidden": !0 })]
6908
+ n.default ? n.default() : [w(vn, { class: "cpk:h-4 cpk:w-4", "aria-hidden": !0 })]
6905
6909
  );
6906
6910
  };
6907
6911
  }
@@ -6911,7 +6915,7 @@ const xr = {
6911
6915
  setup(e, { attrs: n, slots: t }) {
6912
6916
  return () => {
6913
6917
  const { class: a, ...i } = n;
6914
- return y(
6918
+ return w(
6915
6919
  "div",
6916
6920
  {
6917
6921
  ...i,
@@ -7015,14 +7019,14 @@ const xr = {
7015
7019
  setup(e, { emit: n }) {
7016
7020
  const t = e, a = n, i = Ge(), o = Oe(), s = lt(), r = c(
7017
7021
  () => s?.vnode.props ?? {}
7018
- ), l = I(null), p = I(o.value?.isModalOpen ?? !1), w = I(!1);
7022
+ ), l = I(null), p = I(o.value?.isModalOpen ?? !1), k = I(!1);
7019
7023
  let u, d;
7020
7024
  const g = c(() => o.value?.isModalOpen ?? !1), h = c(() => o.value?.labels ?? Ze), C = c(() => h.value.modalHeaderTitle), m = c(() => v("onStop")), x = c(
7021
- () => g.value && !w.value ? "cpk:pointer-events-auto cpk:translate-y-0 cpk:opacity-100 cpk:md:scale-100" : "cpk:pointer-events-none cpk:translate-y-4 cpk:opacity-0 cpk:md:translate-y-5 cpk:md:scale-[0.95]"
7025
+ () => g.value && !k.value ? "cpk:pointer-events-auto cpk:translate-y-0 cpk:opacity-100 cpk:md:scale-100" : "cpk:pointer-events-none cpk:translate-y-4 cpk:opacity-0 cpk:md:translate-y-5 cpk:md:scale-[0.95]"
7022
7026
  ), f = c(
7023
7027
  () => ({
7024
- "--copilot-popup-width": k(t.width, Qr),
7025
- "--copilot-popup-height": k(
7028
+ "--copilot-popup-width": y(t.width, Qr),
7029
+ "--copilot-popup-height": y(
7026
7030
  t.height,
7027
7031
  Xr
7028
7032
  ),
@@ -7038,7 +7042,7 @@ const xr = {
7038
7042
  paddingRight: "env(safe-area-inset-right)"
7039
7043
  })
7040
7044
  );
7041
- function k(F, U) {
7045
+ function y(F, U) {
7042
7046
  return typeof F == "number" && Number.isFinite(F) ? `${F}px` : typeof F == "string" && F.trim().length > 0 ? F : `${U}px`;
7043
7047
  }
7044
7048
  function v(F) {
@@ -7093,11 +7097,11 @@ const xr = {
7093
7097
  g,
7094
7098
  (F) => {
7095
7099
  if (u && (clearTimeout(u), u = void 0), F) {
7096
- p.value = !0, w.value = !1;
7100
+ p.value = !0, k.value = !1;
7097
7101
  return;
7098
7102
  }
7099
- p.value && (w.value = !0, u = setTimeout(() => {
7100
- p.value = !1, w.value = !1, u = void 0;
7103
+ p.value && (k.value = !0, u = setTimeout(() => {
7104
+ p.value = !1, k.value = !1, u = void 0;
7101
7105
  }, zn));
7102
7106
  },
7103
7107
  { immediate: !0 }
@@ -7306,14 +7310,14 @@ const xr = {
7306
7310
  onSelectSuggestion: (d, g) => a("select-suggestion", d, g)
7307
7311
  };
7308
7312
  return r("onAddFile") && (u.onAddFile = () => a("add-file")), r("onStartTranscribe") && (u.onStartTranscribe = () => a("start-transcribe")), r("onCancelTranscribe") && (u.onCancelTranscribe = () => a("cancel-transcribe")), r("onFinishTranscribe") && (u.onFinishTranscribe = () => a("finish-transcribe")), u;
7309
- }), w = c(() => ({
7313
+ }), k = c(() => ({
7310
7314
  ...i,
7311
7315
  ...l.value,
7312
7316
  ...p.value
7313
7317
  }));
7314
7318
  return (u, d) => (R(), he(bn, { "is-modal-default-open": e.defaultOpen }, {
7315
7319
  default: W(() => [
7316
- oe(Yr, q(J(w.value)), qe({ _: 2 }, [
7320
+ oe(Yr, q(J(k.value)), qe({ _: 2 }, [
7317
7321
  u.$slots.header ? {
7318
7322
  name: "header",
7319
7323
  fn: W((g) => [
@@ -7511,7 +7515,7 @@ const xr = {
7511
7515
  ), l = I(null), p = I(
7512
7516
  t.width ?? il
7513
7517
  );
7514
- let w = null;
7518
+ let k = null;
7515
7519
  const u = c(() => o.value?.isModalOpen ?? !1), d = c(
7516
7520
  () => t.width ?? p.value
7517
7521
  ), g = c(
@@ -7525,7 +7529,7 @@ const xr = {
7525
7529
  ]), C = c(() => {
7526
7530
  const { class: U, ...H } = i;
7527
7531
  return H;
7528
- }), m = c(() => k("onStop")), x = c(
7532
+ }), m = c(() => y("onStop")), x = c(
7529
7533
  () => ({
7530
7534
  "--sidebar-width": v(d.value),
7531
7535
  paddingTop: "env(safe-area-inset-top)",
@@ -7541,7 +7545,7 @@ const xr = {
7541
7545
  }
7542
7546
  `
7543
7547
  );
7544
- function k(U) {
7548
+ function y(U) {
7545
7549
  const H = r.value[U];
7546
7550
  return Array.isArray(H) ? H.length > 0 : !!H;
7547
7551
  }
@@ -7596,7 +7600,7 @@ const xr = {
7596
7600
  onInputChange: ve,
7597
7601
  onSelectSuggestion: te
7598
7602
  };
7599
- return m.value && (U.onStop = Y), k("onAddFile") && (U.onAddFile = K), k("onStartTranscribe") && (U.onStartTranscribe = E), k("onCancelTranscribe") && (U.onCancelTranscribe = ne), k("onFinishTranscribe") && (U.onFinishTranscribe = re), U;
7603
+ return m.value && (U.onStop = Y), y("onAddFile") && (U.onAddFile = K), y("onStartTranscribe") && (U.onStartTranscribe = E), y("onCancelTranscribe") && (U.onCancelTranscribe = ne), y("onFinishTranscribe") && (U.onFinishTranscribe = re), U;
7600
7604
  });
7601
7605
  return L(
7602
7606
  () => t.width,
@@ -7608,11 +7612,11 @@ const xr = {
7608
7612
  S();
7609
7613
  }
7610
7614
  ), Je(async () => {
7611
- await ft(), S(), !(t.width !== void 0 || !l.value || typeof ResizeObserver > "u") && (w = new ResizeObserver(() => {
7615
+ await ft(), S(), !(t.width !== void 0 || !l.value || typeof ResizeObserver > "u") && (k = new ResizeObserver(() => {
7612
7616
  S();
7613
- }), w.observe(l.value));
7617
+ }), k.observe(l.value));
7614
7618
  }), Me(() => {
7615
- w?.disconnect(), w = null;
7619
+ k?.disconnect(), k = null;
7616
7620
  }), (U, H) => (R(), j(Re, null, [
7617
7621
  u.value ? (R(), he(mt("style"), { key: 0 }, {
7618
7622
  default: W(() => [
@@ -7758,13 +7762,13 @@ const xr = {
7758
7762
  }), l = c(() => ({
7759
7763
  ...i,
7760
7764
  ...r.value,
7761
- ...w.value
7765
+ ...k.value
7762
7766
  }));
7763
7767
  function p(u) {
7764
7768
  const d = s.value[u];
7765
7769
  return Array.isArray(d) ? d.length > 0 : !!d;
7766
7770
  }
7767
- const w = c(() => {
7771
+ const k = c(() => {
7768
7772
  const u = {
7769
7773
  onSubmitMessage: (d) => a("submit-message", d),
7770
7774
  onStop: () => a("stop"),
@@ -8294,7 +8298,7 @@ ${e.description}` : t;
8294
8298
  parameters: e.parameters,
8295
8299
  render: ({ args: i }) => {
8296
8300
  const o = e.render;
8297
- return y(
8301
+ return w(
8298
8302
  o,
8299
8303
  i
8300
8304
  );
@@ -8318,7 +8322,7 @@ function hl(e, n) {
8318
8322
  () => {
8319
8323
  const i = (s) => typeof e.render == "function" ? e.render(
8320
8324
  s
8321
- ) : y(e.render, s), o = e.name === "*" && !e.parameters ? ln({
8325
+ ) : w(e.render, s), o = e.name === "*" && !e.parameters ? ln({
8322
8326
  name: "*",
8323
8327
  render: (s) => i({
8324
8328
  ...s,
@@ -8419,7 +8423,7 @@ const kl = se({
8419
8423
  const n = I(!1);
8420
8424
  return () => {
8421
8425
  const t = e.status === "inProgress" || e.status === "executing", a = e.status === "complete", i = t ? "Running" : a ? "Done" : e.status;
8422
- return y(
8426
+ return w(
8423
8427
  "div",
8424
8428
  {
8425
8429
  "data-testid": "copilot-tool-render",
@@ -8431,7 +8435,7 @@ const kl = se({
8431
8435
  style: { marginTop: "8px", paddingBottom: "8px" }
8432
8436
  },
8433
8437
  [
8434
- y(
8438
+ w(
8435
8439
  "div",
8436
8440
  {
8437
8441
  style: {
@@ -8442,7 +8446,7 @@ const kl = se({
8442
8446
  }
8443
8447
  },
8444
8448
  [
8445
- y(
8449
+ w(
8446
8450
  "button",
8447
8451
  {
8448
8452
  type: "button",
@@ -8465,7 +8469,7 @@ const kl = se({
8465
8469
  }
8466
8470
  },
8467
8471
  [
8468
- y(
8472
+ w(
8469
8473
  "span",
8470
8474
  {
8471
8475
  "data-testid": "copilot-tool-render-name",
@@ -8473,19 +8477,19 @@ const kl = se({
8473
8477
  },
8474
8478
  e.name
8475
8479
  ),
8476
- y(
8480
+ w(
8477
8481
  "span",
8478
8482
  { "data-testid": "copilot-tool-render-status" },
8479
8483
  i
8480
8484
  )
8481
8485
  ]
8482
8486
  ),
8483
- n.value ? y("div", { style: { marginTop: "12px" } }, [
8484
- y("div", "Arguments"),
8485
- y("pre", _n(e.parameters ?? {})),
8486
- e.result !== void 0 ? y("div", [
8487
- y("div", "Result"),
8488
- y(
8487
+ n.value ? w("div", { style: { marginTop: "12px" } }, [
8488
+ w("div", "Arguments"),
8489
+ w("pre", _n(e.parameters ?? {})),
8490
+ e.result !== void 0 ? w("div", [
8491
+ w("div", "Result"),
8492
+ w(
8489
8493
  "pre",
8490
8494
  typeof e.result == "string" ? e.result : _n(e.result)
8491
8495
  )
@@ -8531,7 +8535,7 @@ function Gl(e, n) {
8531
8535
  const i = t;
8532
8536
  a = ((o) => {
8533
8537
  const s = an(o);
8534
- return y(i, {
8538
+ return w(i, {
8535
8539
  name: s.name,
8536
8540
  toolCallId: s.toolCallId,
8537
8541
  parameters: s.parameters,
@@ -8542,7 +8546,7 @@ function Gl(e, n) {
8542
8546
  } else
8543
8547
  a = ((i) => {
8544
8548
  const o = an(i);
8545
- return y(kl, {
8549
+ return w(kl, {
8546
8550
  name: o.name,
8547
8551
  toolCallId: o.toolCallId,
8548
8552
  parameters: o.parameters,
@@ -8568,22 +8572,22 @@ function Jl(e, n) {
8568
8572
  }),
8569
8573
  render: (l) => {
8570
8574
  const p = e.render;
8571
- return l.status === "inProgress" ? y(p, {
8575
+ return l.status === "inProgress" ? w(p, {
8572
8576
  ...l,
8573
8577
  name: e.name,
8574
8578
  description: e.description || "",
8575
8579
  respond: void 0
8576
- }) : l.status === "executing" ? y(p, {
8580
+ }) : l.status === "executing" ? w(p, {
8577
8581
  ...l,
8578
8582
  name: e.name,
8579
8583
  description: e.description || "",
8580
8584
  respond: i
8581
- }) : l.status === "complete" ? y(p, {
8585
+ }) : l.status === "complete" ? w(p, {
8582
8586
  ...l,
8583
8587
  name: e.name,
8584
8588
  description: e.description || "",
8585
8589
  respond: void 0
8586
- }) : y(p, l);
8590
+ }) : w(p, l);
8587
8591
  }
8588
8592
  };
8589
8593
  ua(r, n), Kt(() => {
@@ -8619,10 +8623,10 @@ function Ql(e, n) {
8619
8623
  if (!r.value) return o.value;
8620
8624
  const m = r.value.consumerAgentId;
8621
8625
  return !m || m === "*" ? o.value : m;
8622
- }), w = c(
8626
+ }), k = c(
8623
8627
  () => s.value === void 0 || s.value === "*"
8624
8628
  ), u = I(!1), d = I(null), g = I(null), h = () => {
8625
- if (!u.value || !w.value)
8629
+ if (!u.value || !k.value)
8626
8630
  return;
8627
8631
  if (Object.values(t.value.agents ?? {}).some(
8628
8632
  (x) => !!x.agentId && x.isRunning
@@ -8635,12 +8639,12 @@ function Ql(e, n) {
8635
8639
  u.value = !1, C();
8636
8640
  }, C = () => {
8637
8641
  if (r.value) {
8638
- if (w.value) {
8642
+ if (k.value) {
8639
8643
  let m = !1;
8640
8644
  const x = Object.values(t.value.agents ?? {});
8641
8645
  for (const f of x) {
8642
- const k = f.agentId;
8643
- k && (f.isRunning ? m = !0 : t.value.reloadSuggestions(k));
8646
+ const y = f.agentId;
8647
+ y && (f.isRunning ? m = !0 : t.value.reloadSuggestions(y));
8644
8648
  }
8645
8649
  u.value = m, m && d.value === null && (d.value = setTimeout(() => {
8646
8650
  d.value = null, h();
@@ -8652,11 +8656,11 @@ function Ql(e, n) {
8652
8656
  };
8653
8657
  L(
8654
8658
  [() => t.value, l],
8655
- ([m, x], f, k) => {
8659
+ ([m, x], f, y) => {
8656
8660
  if (!x || !r.value)
8657
8661
  return;
8658
8662
  const v = t.value, b = r.value, S = v.addSuggestionsConfig(b);
8659
- C(), k(() => v.removeSuggestionsConfig(S));
8663
+ C(), y(() => v.removeSuggestionsConfig(S));
8660
8664
  },
8661
8665
  { immediate: !0 }
8662
8666
  ), L(
@@ -8684,8 +8688,8 @@ function Ql(e, n) {
8684
8688
  },
8685
8689
  { immediate: !0 }
8686
8690
  ), L(
8687
- [() => t.value, w],
8688
- ([m, x], f, k) => {
8691
+ [() => t.value, k],
8692
+ ([m, x], f, y) => {
8689
8693
  if (!x)
8690
8694
  return;
8691
8695
  const v = Object.values(m.agents ?? {}).filter((b) => !!b).map(
@@ -8697,7 +8701,7 @@ function Ql(e, n) {
8697
8701
  onRunErrorEvent: h
8698
8702
  })
8699
8703
  );
8700
- k(() => {
8704
+ y(() => {
8701
8705
  for (const b of v)
8702
8706
  b.unsubscribe();
8703
8707
  });
@@ -8727,22 +8731,22 @@ function Xl(e = {}) {
8727
8731
  a.value = null, i.value = null;
8728
8732
  return;
8729
8733
  }
8730
- let w = null;
8734
+ let k = null;
8731
8735
  const u = r.subscribe({
8732
8736
  onCustomEvent: ({ event: d }) => {
8733
- d.name === xl && (w = {
8737
+ d.name === xl && (k = {
8734
8738
  name: d.name,
8735
8739
  value: d.value
8736
8740
  });
8737
8741
  },
8738
8742
  onRunStartedEvent: () => {
8739
- w = null, a.value = null;
8743
+ k = null, a.value = null;
8740
8744
  },
8741
8745
  onRunFinalized: () => {
8742
- w && (a.value = w, w = null);
8746
+ k && (a.value = k, k = null);
8743
8747
  },
8744
8748
  onRunFailed: () => {
8745
- w = null;
8749
+ k = null;
8746
8750
  }
8747
8751
  });
8748
8752
  p(() => u.unsubscribe());
@@ -8761,10 +8765,10 @@ function Xl(e = {}) {
8761
8765
  interruptEvent: p
8762
8766
  }
8763
8767
  }
8764
- }).catch((w) => {
8768
+ }).catch((k) => {
8765
8769
  console.error(
8766
8770
  "[CopilotKit] useInterrupt: failed to resume agent:",
8767
- w
8771
+ k
8768
8772
  );
8769
8773
  });
8770
8774
  };
@@ -8779,13 +8783,13 @@ function Xl(e = {}) {
8779
8783
  i.value = null;
8780
8784
  return;
8781
8785
  }
8782
- const w = e.handler;
8783
- if (!w) {
8786
+ const k = e.handler;
8787
+ if (!k) {
8784
8788
  i.value = null;
8785
8789
  return;
8786
8790
  }
8787
8791
  let u = !1;
8788
- const d = w({
8792
+ const d = k({
8789
8793
  event: r,
8790
8794
  resolve: o
8791
8795
  });
@@ -8806,7 +8810,7 @@ function Xl(e = {}) {
8806
8810
  });
8807
8811
  return L(
8808
8812
  [() => n.value, s, () => e.renderInChat !== !1],
8809
- ([r, l, p], w, u) => {
8813
+ ([r, l, p], k, u) => {
8810
8814
  if (!p)
8811
8815
  return;
8812
8816
  r.setInterruptState(
@@ -8847,8 +8851,8 @@ function Yl(e) {
8847
8851
  ([x], [f]) => x.localeCompare(f)
8848
8852
  )
8849
8853
  )
8850
- ), r = I([]), l = I(!1), p = I(null), w = I(!1), u = I(!1);
8851
- St(t, Ta, r), St(t, Sa, l), St(t, Ia, p), St(t, Aa, w), St(
8854
+ ), r = I([]), l = I(!1), p = I(null), k = I(!1), u = I(!1);
8855
+ St(t, Ta, r), St(t, Sa, l), St(t, Ia, p), St(t, Aa, k), St(
8852
8856
  t,
8853
8857
  Ra,
8854
8858
  u
@@ -8866,7 +8870,7 @@ function Yl(e) {
8866
8870
  i,
8867
8871
  o
8868
8872
  ],
8869
- ([x, f, , k, v, b, S]) => {
8873
+ ([x, f, , y, v, b, S]) => {
8870
8874
  if (!x) {
8871
8875
  t.setContext(null);
8872
8876
  return;
@@ -8876,7 +8880,7 @@ function Yl(e) {
8876
8880
  const O = {
8877
8881
  runtimeUrl: x,
8878
8882
  headers: { ...n.value.headers },
8879
- wsUrl: k,
8883
+ wsUrl: y,
8880
8884
  agentId: v,
8881
8885
  includeArchived: b,
8882
8886
  limit: S
@@ -8897,10 +8901,10 @@ function Yl(e) {
8897
8901
  return {
8898
8902
  threads: c(
8899
8903
  () => r.value.map(
8900
- ({ id: x, agentId: f, name: k, archived: v, createdAt: b, updatedAt: S, lastRunAt: O }) => ({
8904
+ ({ id: x, agentId: f, name: y, archived: v, createdAt: b, updatedAt: S, lastRunAt: O }) => ({
8901
8905
  id: x,
8902
8906
  agentId: f,
8903
- name: k,
8907
+ name: y,
8904
8908
  archived: v,
8905
8909
  createdAt: b,
8906
8910
  updatedAt: S,
@@ -8910,7 +8914,7 @@ function Yl(e) {
8910
8914
  ),
8911
8915
  isLoading: C,
8912
8916
  error: m,
8913
- hasMoreThreads: w,
8917
+ hasMoreThreads: k,
8914
8918
  isFetchingMoreThreads: u,
8915
8919
  fetchMoreThreads: () => t.fetchNextPage(),
8916
8920
  renameThread: (x, f) => t.renameThread(x, f),
@@ -8939,7 +8943,7 @@ function ec() {
8939
8943
  });
8940
8944
  if (!l.length)
8941
8945
  return null;
8942
- const { message: p, position: w } = a, u = r.getRunIdForMessage(o, s, p.id) ?? r.getRunIdsForThread(o, s).slice(-1)[0], d = u ?? `missing-run-id:${p.id}`, g = r.getAgent(o);
8946
+ const { message: p, position: k } = a, u = r.getRunIdForMessage(o, s, p.id) ?? r.getRunIdsForThread(o, s).slice(-1)[0], d = u ?? `missing-run-id:${p.id}`, g = r.getAgent(o);
8943
8947
  if (!g)
8944
8948
  return null;
8945
8949
  const h = u ? g.messages.filter(
@@ -8950,15 +8954,15 @@ function ec() {
8950
8954
  C < 0 && console.warn(
8951
8955
  `[CopilotKit] useRenderCustomMessages: message "${p.id}" not found in agent "${o}" messages`
8952
8956
  );
8953
- const m = Math.max(0, C), x = u ? Math.max(h.indexOf(p.id), 0) : 0, f = u ? h.length : 1, k = u ? r.getStateByRun(o, s, u) : void 0, v = {
8957
+ const m = Math.max(0, C), x = u ? Math.max(h.indexOf(p.id), 0) : 0, f = u ? h.length : 1, y = u ? r.getStateByRun(o, s, u) : void 0, v = {
8954
8958
  message: p,
8955
- position: w,
8959
+ position: k,
8956
8960
  runId: d,
8957
8961
  messageIndex: m,
8958
8962
  messageIndexInRun: x,
8959
8963
  numberOfMessagesInRun: f,
8960
8964
  agentId: o,
8961
- stateSnapshot: k
8965
+ stateSnapshot: y
8962
8966
  };
8963
8967
  for (const b of l)
8964
8968
  if (b.render)
@@ -9076,4 +9080,4 @@ export {
9076
9080
  Vl as y,
9077
9081
  Wl as z
9078
9082
  };
9079
- //# sourceMappingURL=use-render-activity-message-CCdCVec7.js.map
9083
+ //# sourceMappingURL=use-render-activity-message-Dw44JCPl.js.map