@pagelines/sdk 1.0.688 → 1.0.689

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/AgentWrap.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import "./rolldown-runtime.js";
2
2
  import { s as e, t } from "./sdkClient.js";
3
3
  import { Agent as n, CHAT_ISSUE_COPY as r, SettingsObject as i, createLogger as a, getDefaultAvatarUrl as o, isAssistantSilenceControl as s, parseChatVisualFencePayload as c } from "@pagelines/core";
4
- import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as A, renderList as j, renderSlot as ie, resolveDynamicComponent as ae, shallowRef as oe, toDisplayString as P, unref as se, vModelText as F, watch as ce, withCtx as ue, withDirectives as I, withKeys as de, withModifiers as R } from "vue";
4
+ import { Fragment as u, computed as f, createBlock as p, createCommentVNode as m, createElementBlock as h, createElementVNode as _, createTextVNode as v, createVNode as b, defineComponent as x, nextTick as S, normalizeClass as C, normalizeStyle as T, onBeforeUnmount as te, onMounted as ne, onUnmounted as re, openBlock as k, ref as ie, renderList as A, renderSlot as ae, resolveDynamicComponent as oe, shallowRef as j, toDisplayString as P, unref as se, vModelText as F, watch as ce, withCtx as ue, withDirectives as I, withKeys as de, withModifiers as R } from "vue";
5
5
  //#region ui/FSpinner.vue?vue&type=script&setup=true&lang.ts
6
6
  var pe = { class: "spinner max-w-sm" }, he = {
7
7
  class: "ring-circular h-full w-full origin-center",
@@ -70,7 +70,7 @@ function recorderMimeType() {
70
70
  }
71
71
  var VoiceRecorderController = class extends i {
72
72
  constructor(t) {
73
- super("VoiceRecorderController", t), e(this, "state", A({
73
+ super("VoiceRecorderController", t), e(this, "state", ie({
74
74
  phase: "idle",
75
75
  elapsedMs: 0
76
76
  })), e(this, "isActive", f(() => this.state.value.phase !== "idle")), e(this, "isBusy", f(() => this.state.value.phase !== "idle")), e(this, "elapsedLabel", f(() => formatVoiceRecordingDuration({ ms: this.state.value.elapsedMs }))), e(this, "statusText", f(() => this.state.value.phase === "preparing" ? "Starting microphone" : this.state.value.phase === "sending" ? "Sending voice message" : "Release to send")), e(this, "recorder", void 0), e(this, "stream", void 0), e(this, "chunks", []), e(this, "timer", void 0), e(this, "startedAt", 0), e(this, "cancelOnStop", !1), e(this, "stopAfterStart", !1), e(this, "startToken", 0);
@@ -401,12 +401,12 @@ var AgentChatController = class extends i {
401
401
  super("AgentChatController", t), e(this, "isTextMode", !1), e(this, "lastMessage", {
402
402
  hash: "",
403
403
  time: 0
404
- }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", oe(Date.now())), e(this, "toolActivityTiming", oe({})), e(this, "lastVisibleProgressAtMs", oe()), e(this, "liveSegments", oe([])), e(this, "liveStreamMessageId", oe(void 0)), e(this, "conversationId", void 0), e(this, "textState", A({
404
+ }), e(this, "isConnecting", !1), e(this, "activeTurnGeneration", 0), e(this, "boundaryTimer", void 0), e(this, "nowMs", j(Date.now())), e(this, "toolActivityTiming", j({})), e(this, "lastVisibleProgressAtMs", j()), e(this, "liveSegments", j([])), e(this, "liveStreamMessageId", j(void 0)), e(this, "conversationId", void 0), e(this, "textState", ie({
405
405
  isActive: !1,
406
406
  isConnected: !1,
407
407
  isThinking: !1,
408
408
  connectionStatus: "disconnected"
409
- })), e(this, "agentMode", A("self")), e(this, "sharedMessages", A([])), e(this, "composerState", A({
409
+ })), e(this, "agentMode", ie("self")), e(this, "sharedMessages", ie([])), e(this, "composerState", ie({
410
410
  text: "",
411
411
  pendingAttachments: [],
412
412
  isUploading: !1
@@ -977,7 +977,7 @@ var we = {
977
977
  key: 0,
978
978
  class: C([e.icon, r.value])
979
979
  }, null, 2)) : m("", !0),
980
- ie(i.$slots, "default"),
980
+ ae(i.$slots, "default"),
981
981
  e.iconAfter ? (k(), h("i", {
982
982
  key: 1,
983
983
  class: C([e.iconAfter, r.value])
@@ -1014,7 +1014,7 @@ var we = {
1014
1014
  },
1015
1015
  emits: ["update:modelValue", "autoSubmit"],
1016
1016
  setup(e, { emit: t }) {
1017
- let n = e, r = t, i = A(null), a = f(() => "0".repeat(n.length));
1017
+ let n = e, r = t, i = ie(null), a = f(() => "0".repeat(n.length));
1018
1018
  ne(() => {
1019
1019
  n.focusFirst && !("ontouchstart" in window) && i.value?.focus();
1020
1020
  });
@@ -1141,7 +1141,7 @@ var we = {
1141
1141
  isLight: { type: Boolean }
1142
1142
  },
1143
1143
  setup(e) {
1144
- let t = e, n = oe(!1);
1144
+ let t = e, n = j(!1);
1145
1145
  function toggle() {
1146
1146
  n.value = !n.value;
1147
1147
  }
@@ -1249,12 +1249,12 @@ var we = {
1249
1249
  class: C(["size-3 shrink-0", n.value ? "i-tabler-chevron-down" : "i-tabler-chevron-right"]),
1250
1250
  "aria-hidden": "true"
1251
1251
  }, null, 2)], 2)], 10, He)) : m("", !0),
1252
- (k(!0), h(u, null, j(o.value, (e, t) => (k(), h("div", {
1252
+ (k(!0), h(u, null, A(o.value, (e, t) => (k(), h("div", {
1253
1253
  key: e.id,
1254
1254
  "data-test": "messaging-tool-activity-row",
1255
1255
  "data-journal-row": e.tone,
1256
1256
  class: C([r.value ? "pl-[22px]" : "", "flex gap-x-2.5"])
1257
- }, [_("div", G, [_("span", Ge, [(k(), p(ae(c.value[e.tone].station.tag), {
1257
+ }, [_("div", G, [_("span", Ge, [(k(), p(oe(c.value[e.tone].station.tag), {
1258
1258
  "data-journal-station": e.tone,
1259
1259
  class: C(c.value[e.tone].station.class)
1260
1260
  }, null, 8, ["data-journal-station", "class"]))]), t === o.value.length - 1 ? m("", !0) : (k(), h("span", {
@@ -1536,25 +1536,25 @@ function createDOMPurify() {
1536
1536
  let e = t.createElement("template");
1537
1537
  e.content && e.content.ownerDocument && (t = e.content.ownerDocument);
1538
1538
  }
1539
- let T, te = "", ne, re = !1, k = 0, A = function _assertNotInTrustedTypesPolicy() {
1539
+ let T, te = "", ne, re = !1, k = 0, ie = function _assertNotInTrustedTypesPolicy() {
1540
1540
  if (k > 0) throw xt("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
1541
- }, j = function _createTrustedHTML(e) {
1542
- A(), k++;
1541
+ }, A = function _createTrustedHTML(e) {
1542
+ ie(), k++;
1543
1543
  try {
1544
1544
  return T.createHTML(e);
1545
1545
  } finally {
1546
1546
  k--;
1547
1547
  }
1548
- }, ie = function _createTrustedScriptURL(e) {
1549
- A(), k++;
1548
+ }, ae = function _createTrustedScriptURL(e) {
1549
+ ie(), k++;
1550
1550
  try {
1551
1551
  return T.createScriptURL(e);
1552
1552
  } finally {
1553
1553
  k--;
1554
1554
  }
1555
- }, ae = function _getDefaultTrustedTypesPolicy() {
1555
+ }, oe = function _getDefaultTrustedTypesPolicy() {
1556
1556
  return re || (ne = Yt(u, r), re = !0), ne;
1557
- }, oe = t, P = oe.implementation, se = oe.createNodeIterator, F = oe.createDocumentFragment, ce = oe.getElementsByTagName, ue = n.importNode, I = Xt();
1557
+ }, j = t, P = j.implementation, se = j.createNodeIterator, F = j.createDocumentFragment, ce = j.getElementsByTagName, ue = n.importNode, I = Xt();
1558
1558
  DOMPurify.isSupported = typeof Je == "function" && typeof v == "function" && P && P.createHTMLDocument !== void 0;
1559
1559
  let de = Nt, R = Pt, pe = Ft, he = It, _e = Lt, ve = zt, ye = Bt, z = Ht, be = Rt, B = null, Se = addToSet({}, [
1560
1560
  ...St,
@@ -1660,11 +1660,11 @@ function createDOMPurify() {
1660
1660
  let t = T;
1661
1661
  T = e.TRUSTED_TYPES_POLICY;
1662
1662
  try {
1663
- te = j("");
1663
+ te = A("");
1664
1664
  } catch (e) {
1665
1665
  throw T = t, e;
1666
1666
  }
1667
- } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = ae()), T && typeof te == "string" && (te = j("")));
1667
+ } else e.TRUSTED_TYPES_POLICY === null ? (T = void 0, te = "") : (T === void 0 && (T = oe()), T && typeof te == "string" && (te = A("")));
1668
1668
  K && K(e), nn = e;
1669
1669
  }, sn = addToSet({}, [
1670
1670
  ...Ct,
@@ -1773,7 +1773,7 @@ function createDOMPurify() {
1773
1773
  r = t && t[0];
1774
1774
  }
1775
1775
  tn === "application/xhtml+xml" && nt === tt && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
1776
- let i = T ? j(e) : e;
1776
+ let i = T ? A(e) : e;
1777
1777
  if (nt === tt) try {
1778
1778
  n = new c().parseFromString(i, tn);
1779
1779
  } catch {}
@@ -1876,8 +1876,8 @@ function createDOMPurify() {
1876
1876
  return !An[ut(e)] && X(z, e);
1877
1877
  }, Mn = function _applyTrustedTypesToAttribute(e, t, n, r) {
1878
1878
  if (T && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
1879
- case "TrustedHTML": return j(r);
1880
- case "TrustedScriptURL": return ie(r);
1879
+ case "TrustedHTML": return A(r);
1880
+ case "TrustedScriptURL": return ae(r);
1881
1881
  }
1882
1882
  return r;
1883
1883
  }, Nn = function _setAttributeValue(e, t, n, r) {
@@ -1990,7 +1990,7 @@ function createDOMPurify() {
1990
1990
  }
1991
1991
  } else if (Tn(e)) r = yn("<!---->"), i = r.ownerDocument.importNode(e, !0), i.nodeType === qt.element && i.nodeName === "BODY" || i.nodeName === "HTML" ? r = i : r.appendChild(i), In(i);
1992
1992
  else {
1993
- if (!Le && !je && !Me && e.indexOf("<") === -1) return T && ze ? j(e) : e;
1993
+ if (!Le && !je && !Me && e.indexOf("<") === -1) return T && ze ? A(e) : e;
1994
1994
  if (r = yn(e), !r) return Le ? null : ze ? te : "";
1995
1995
  }
1996
1996
  r && Ie && pn(r.firstChild);
@@ -2011,7 +2011,7 @@ function createDOMPurify() {
2011
2011
  return (H.shadowroot || H.shadowrootmode) && (o = ue.call(n, o, !0)), o;
2012
2012
  }
2013
2013
  let f = Me ? r.outerHTML : r.innerHTML;
2014
- return Me && B["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), je && (f = xn(f)), T && ze ? j(f) : f;
2014
+ return Me && B["!doctype"] && r.ownerDocument && r.ownerDocument.doctype && r.ownerDocument.doctype.name && X(Vt, r.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + r.ownerDocument.doctype.name + ">\n" + f), je && (f = xn(f)), T && ze ? A(f) : f;
2015
2015
  }, DOMPurify.setConfig = function() {
2016
2016
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2017
2017
  on(e), Ne = !0, Pe = B, Fe = H;
@@ -3696,7 +3696,7 @@ var Cr = [
3696
3696
  inverted: { type: Boolean }
3697
3697
  },
3698
3698
  setup(e) {
3699
- let t = e, n = A(), r = oe(360), i;
3699
+ let t = e, n = ie(), r = j(360), i;
3700
3700
  ne(() => {
3701
3701
  typeof ResizeObserver > "u" || !n.value || (i = new ResizeObserver((e) => {
3702
3702
  let t = e[0]?.contentRect.width;
@@ -3786,7 +3786,7 @@ var Cr = [
3786
3786
  max: a,
3787
3787
  ticks: o
3788
3788
  };
3789
- }), ie = f(() => resolveSharedSeriesFormat({ series: b.value })), ae = f(() => {
3789
+ }), ae = f(() => resolveSharedSeriesFormat({ series: b.value })), oe = f(() => {
3790
3790
  let e = v.value;
3791
3791
  if (!e) return {
3792
3792
  mode: "horizontal",
@@ -3798,7 +3798,7 @@ var Cr = [
3798
3798
  plotWidth: Math.max(200, a.value - 42)
3799
3799
  });
3800
3800
  }), F = f(() => {
3801
- let e = ie.value?.valueFormat, t = !!(ie.value && (e === "currency" || e === "percent" || ie.value.valuePrefix || ie.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = ae.value.mode === "angled";
3801
+ let e = ae.value?.valueFormat, t = !!(ae.value && (e === "currency" || e === "percent" || ae.value.valuePrefix || ae.value.valueSuffix)), n = e === "duration" ? 46 : t ? 38 : 30, r = oe.value.mode === "angled";
3802
3802
  return {
3803
3803
  width: a.value,
3804
3804
  height: 168 + (r ? 36 : 0),
@@ -3884,7 +3884,7 @@ var Cr = [
3884
3884
  if (!e) return [];
3885
3885
  let t = e.data;
3886
3886
  if (!t.length) return [];
3887
- let n = t.length - 1, r = ae.value, i = r.mode === "angled";
3887
+ let n = t.length - 1, r = oe.value, i = r.mode === "angled";
3888
3888
  return r.entries.map(({ index: e, text: r }) => ({
3889
3889
  key: `${e}`,
3890
3890
  label: r,
@@ -4006,7 +4006,7 @@ var Cr = [
4006
4006
  key: 0,
4007
4007
  role: "img",
4008
4008
  "aria-label": o.value.meta.title
4009
- }, [de.value.length ? (k(), h("div", Er, [(k(!0), h(u, null, j(de.value, (e) => (k(), h("div", {
4009
+ }, [de.value.length ? (k(), h("div", Er, [(k(!0), h(u, null, A(de.value, (e) => (k(), h("div", {
4010
4010
  key: e.key,
4011
4011
  "data-test": "chat-visual-horizontal-bar",
4012
4012
  class: "min-w-0"
@@ -4033,7 +4033,7 @@ var Cr = [
4033
4033
  preserveAspectRatio: "xMidYMid meet",
4034
4034
  "aria-hidden": "true"
4035
4035
  }, [
4036
- (k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("line", {
4036
+ (k(!0), h(u, null, A(re.value.ticks, (e) => (k(), h("line", {
4037
4037
  key: `grid-${e}`,
4038
4038
  x1: F.value.left,
4039
4039
  x2: F.value.width - F.value.right,
@@ -4043,7 +4043,7 @@ var Cr = [
4043
4043
  "vector-effect": "non-scaling-stroke",
4044
4044
  style: T({ stroke: e === 0 ? H.value : Se.value })
4045
4045
  }, null, 12, kr))), 128)),
4046
- _("g", null, [(k(!0), h(u, null, j(re.value.ticks, (e) => (k(), h("text", {
4046
+ _("g", null, [(k(!0), h(u, null, A(re.value.ticks, (e) => (k(), h("text", {
4047
4047
  key: `y-${e}`,
4048
4048
  x: F.value.left - 7,
4049
4049
  y: yForValue(e) + 3,
@@ -4052,9 +4052,9 @@ var Cr = [
4052
4052
  style: T({ fill: B.value })
4053
4053
  }, P(se(formatChatVisualTick)({
4054
4054
  value: e,
4055
- shared: ie.value
4055
+ shared: ae.value
4056
4056
  })), 13, Ar))), 128))]),
4057
- v.value.chartType === "bar" ? (k(!0), h(u, { key: 0 }, j(ue.value, (e) => (k(), h("rect", {
4057
+ v.value.chartType === "bar" ? (k(!0), h(u, { key: 0 }, A(ue.value, (e) => (k(), h("rect", {
4058
4058
  key: e.key,
4059
4059
  "data-test": "chat-visual-bar",
4060
4060
  "data-row-index": e.rowIndex,
@@ -4080,7 +4080,7 @@ var Cr = [
4080
4080
  "vector-effect": "non-scaling-stroke",
4081
4081
  style: T({ stroke: seriesColor(ce.value.seriesIndex) })
4082
4082
  }, null, 12, Mr)) : m("", !0),
4083
- (k(!0), h(u, null, j(b.value, (e, t) => (k(), h("g", { key: e.dataKey }, [v.value.chartType === "line" ? (k(), h("path", {
4083
+ (k(!0), h(u, null, A(b.value, (e, t) => (k(), h("g", { key: e.dataKey }, [v.value.chartType === "line" ? (k(), h("path", {
4084
4084
  key: 0,
4085
4085
  d: pathForSeries(e.dataKey),
4086
4086
  fill: "none",
@@ -4089,14 +4089,14 @@ var Cr = [
4089
4089
  "stroke-linejoin": "round",
4090
4090
  "vector-effect": "non-scaling-stroke",
4091
4091
  style: T({ stroke: seriesColor(t) })
4092
- }, null, 12, Nr)) : m("", !0), (k(!0), h(u, null, j(p.value, (n, r) => (k(), h(u, { key: `${e.dataKey}-${r}` }, [v.value.chartType === "scatter" ? (k(), h("circle", {
4092
+ }, null, 12, Nr)) : m("", !0), (k(!0), h(u, null, A(p.value, (n, r) => (k(), h(u, { key: `${e.dataKey}-${r}` }, [v.value.chartType === "scatter" ? (k(), h("circle", {
4093
4093
  key: 0,
4094
4094
  cx: xForIndex(r, p.value.length),
4095
4095
  cy: yForValue(numericValue(n[e.dataKey]) ?? 0),
4096
4096
  r: "2.6",
4097
4097
  style: T({ fill: seriesColor(t) })
4098
4098
  }, null, 12, Pr)) : m("", !0)], 64))), 128))]))), 128)),
4099
- (k(!0), h(u, null, j(pe.value, (e) => (k(), h("circle", {
4099
+ (k(!0), h(u, null, A(pe.value, (e) => (k(), h("circle", {
4100
4100
  key: `marker-${e.key}`,
4101
4101
  cx: e.cx,
4102
4102
  cy: e.cy,
@@ -4104,7 +4104,7 @@ var Cr = [
4104
4104
  style: T({ fill: seriesColor(e.seriesIndex) })
4105
4105
  }, null, 12, Fr))), 128))
4106
4106
  ], 64)),
4107
- (k(!0), h(u, null, j(I.value, (e) => (k(), h("text", {
4107
+ (k(!0), h(u, null, A(I.value, (e) => (k(), h("text", {
4108
4108
  key: e.key,
4109
4109
  x: e.x,
4110
4110
  y: e.angled ? F.value.height - F.value.bottom + 12 : F.value.height - 6,
@@ -4113,7 +4113,7 @@ var Cr = [
4113
4113
  transform: e.angled ? `rotate(${se(-40)} ${e.x} ${F.value.height - F.value.bottom + 12})` : void 0,
4114
4114
  style: T({ fill: B.value })
4115
4115
  }, P(e.label), 13, Ir))), 128))
4116
- ], 12, Or)), R.value.length > 1 || v.value.chartType !== "bar" ? (k(), h("div", Lr, [(k(!0), h(u, null, j(R.value, (e) => (k(), h("div", {
4116
+ ], 12, Or)), R.value.length > 1 || v.value.chartType !== "bar" ? (k(), h("div", Lr, [(k(!0), h(u, null, A(R.value, (e) => (k(), h("div", {
4117
4117
  key: e.key,
4118
4118
  class: "inline-flex items-center gap-1.5 text-[11.5px] leading-none"
4119
4119
  }, [
@@ -4126,7 +4126,7 @@ var Cr = [
4126
4126
  class: "font-semibold tabular-nums",
4127
4127
  style: T({ color: z.value })
4128
4128
  }, P(e.value), 5)
4129
- ]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, j(he.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", zr, [_("span", {
4129
+ ]))), 128))])) : m("", !0)], 8, Tr)) : x.value ? (k(), h("div", Rr, [(k(!0), h(u, null, A(he.value, (e, t) => (k(), h("div", { key: e.key }, [_("div", zr, [_("span", {
4130
4130
  class: "truncate font-medium",
4131
4131
  style: T({ color: z.value })
4132
4132
  }, P(e.name), 5), _("span", Br, [_("span", {
@@ -4155,7 +4155,7 @@ var Cr = [
4155
4155
  role: "img",
4156
4156
  "aria-label": o.value.meta.title
4157
4157
  }, [
4158
- (k(!0), h(u, null, j(_e.value.edges, (e) => (k(), h("line", {
4158
+ (k(!0), h(u, null, A(_e.value.edges, (e) => (k(), h("line", {
4159
4159
  key: e.key,
4160
4160
  "data-test": "chat-visual-diagram-edge",
4161
4161
  "data-from": e.from,
@@ -4169,14 +4169,14 @@ var Cr = [
4169
4169
  "vector-effect": "non-scaling-stroke",
4170
4170
  style: T({ stroke: we.value })
4171
4171
  }, null, 12, Ur))), 128)),
4172
- (k(!0), h(u, null, j(_e.value.edges, (e) => (k(), h("circle", {
4172
+ (k(!0), h(u, null, A(_e.value.edges, (e) => (k(), h("circle", {
4173
4173
  key: `${e.key}-dot`,
4174
4174
  cx: e.x2,
4175
4175
  cy: e.y2,
4176
4176
  r: "2.4",
4177
4177
  style: T({ fill: we.value })
4178
4178
  }, null, 12, Wr))), 128)),
4179
- (k(!0), h(u, null, j(_e.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
4179
+ (k(!0), h(u, null, A(_e.value.edges.filter((e) => e.label), (e) => (k(), h("foreignObject", {
4180
4180
  key: `${e.key}-label`,
4181
4181
  x: e.labelX - 55,
4182
4182
  y: e.labelY - 12,
@@ -4190,7 +4190,7 @@ var Cr = [
4190
4190
  background: t.inverted ? "var(--color-theme-900)" : "var(--color-theme-0)"
4191
4191
  })
4192
4192
  }, P(e.label), 5)], 8, Gr))), 128)),
4193
- (k(!0), h(u, null, j(_e.value.nodes, (e) => (k(), h("g", {
4193
+ (k(!0), h(u, null, A(_e.value.nodes, (e) => (k(), h("g", {
4194
4194
  key: e.id,
4195
4195
  "data-test": "chat-visual-diagram-node",
4196
4196
  "data-node-id": e.id,
@@ -4245,7 +4245,7 @@ var Cr = [
4245
4245
  streaming: { type: Boolean }
4246
4246
  },
4247
4247
  setup(e) {
4248
- let t = e, n = oe(t.text), r;
4248
+ let t = e, n = j(t.text), r;
4249
4249
  ce([() => t.text, () => t.streaming], ([e, i]) => {
4250
4250
  if (!i) {
4251
4251
  r !== void 0 && (cancelAnimationFrame(r), r = void 0), n.value = e;
@@ -4392,7 +4392,7 @@ var Cr = [
4392
4392
  return (t, n) => (k(), h("div", {
4393
4393
  class: "chat-msg-rich break-words text-[14px] leading-relaxed @sm/chat:text-[16px] @sm/chat:leading-relaxed",
4394
4394
  onErrorCapture: onRichTextAssetError
4395
- }, [(k(!0), h(u, null, j(o.value, (t) => (k(), h(u, { key: t.key }, [t.kind === "markdown" ? (k(), h("div", {
4395
+ }, [(k(!0), h(u, null, A(o.value, (t) => (k(), h(u, { key: t.key }, [t.kind === "markdown" ? (k(), h("div", {
4396
4396
  key: 0,
4397
4397
  class: C(["chat-msg-prose", e.inverted ? "chat-msg-prose-invert" : ""]),
4398
4398
  innerHTML: t.html
@@ -4417,7 +4417,7 @@ var Cr = [
4417
4417
  }), ei = 80, ti = /* @__PURE__ */ x({
4418
4418
  __name: "ChatScroller",
4419
4419
  setup(e, { expose: t }) {
4420
- let n = A(), r = A(), i = A(!0), a;
4420
+ let n = ie(), r = ie(), i = ie(!0), a;
4421
4421
  function scrollToBottom() {
4422
4422
  let e = n.value;
4423
4423
  e && (e.scrollTop = e.scrollHeight);
@@ -4446,7 +4446,7 @@ var Cr = [
4446
4446
  ref_key: "content",
4447
4447
  ref: r,
4448
4448
  class: "flex-1 flex flex-col"
4449
- }, [ie(e.$slots, "default")], 512)], 34));
4449
+ }, [ae(e.$slots, "default")], 512)], 34));
4450
4450
  }
4451
4451
  }), ni = {
4452
4452
  key: 0,
@@ -4582,7 +4582,7 @@ var Cr = [
4582
4582
  }, n = f(() => {
4583
4583
  let n = { ...t[e.scope] };
4584
4584
  return e.scope === "org" && e.scopeName && (n.label = e.scopeName, n.tooltip = `Visible to ${e.scopeName} members`), n;
4585
- }), r = A(!1), i = A(), a = A(), o = A();
4585
+ }), r = ie(!1), i = ie(), a = ie(), o = ie();
4586
4586
  function containsMarkdownLink(e) {
4587
4587
  return e ? /\[[^\]]+\]\([^)]+\)/.test(e) : !1;
4588
4588
  }
@@ -4593,17 +4593,17 @@ var Cr = [
4593
4593
  let n = e[t], r = e[t + 1];
4594
4594
  return !r || r.sender !== n.sender;
4595
4595
  }
4596
- let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), ae = A(!1), oe;
4596
+ let s = f(() => e.chatController?.textState.value), c = f(() => s.value?.isConnected ?? !1), x = f(() => s.value?.isThinking ?? !1), T = f(() => s.value?.connectionStatus === "disconnected" && !!s.value?.error), te = f(() => s.value?.connectionStatus !== "connected" && !s.value?.error), oe = ie(!1), j;
4597
4597
  ce(T, (e) => {
4598
- if (clearTimeout(oe), !e) {
4599
- ae.value = !1;
4598
+ if (clearTimeout(j), !e) {
4599
+ oe.value = !1;
4600
4600
  return;
4601
4601
  }
4602
- oe = setTimeout(() => {
4603
- ae.value = !0;
4602
+ j = setTimeout(() => {
4603
+ oe.value = !0;
4604
4604
  }, ta);
4605
- }, { immediate: !0 }), re(() => clearTimeout(oe));
4606
- let se = f(() => T.value && ae.value), pe = f(() => te.value || T.value && !ae.value);
4605
+ }, { immediate: !0 }), re(() => clearTimeout(j));
4606
+ let se = f(() => T.value && oe.value), pe = f(() => te.value || T.value && !oe.value);
4607
4607
  async function retryConnection() {
4608
4608
  await e.chatController?.startTextConversation();
4609
4609
  }
@@ -4797,7 +4797,7 @@ var Cr = [
4797
4797
  class: C(z.value.length === 0 ? "flex-none" : "flex-1")
4798
4798
  }, {
4799
4799
  default: ue(() => [_("div", { class: C([z.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? "max-w-[720px] mx-auto w-full" : ""]) }, [
4800
- z.value.length === 0 && !pe.value && !se.value ? (k(), h("div", li, [ie(t.$slots, "empty-heading", {
4800
+ z.value.length === 0 && !pe.value && !se.value ? (k(), h("div", li, [ae(t.$slots, "empty-heading", {
4801
4801
  agent: e.agent,
4802
4802
  isLight: G.value
4803
4803
  }, () => [b(ze, {
@@ -4808,7 +4808,7 @@ var Cr = [
4808
4808
  class: C(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", G.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
4809
4809
  title: n.value.tooltip
4810
4810
  }, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, P(n.value.label), 1)], 10, ui)], 64))])) : m("", !0),
4811
- (k(!0), h(u, null, j(z.value, (e, t) => (k(), h(u, { key: e.id }, [
4811
+ (k(!0), h(u, null, A(z.value, (e, t) => (k(), h(u, { key: e.id }, [
4812
4812
  shouldShowTimeDivider(z.value, t) ? (k(), h("div", di, [
4813
4813
  _("div", { class: C(["flex-1 h-px", Ge.value]) }, null, 2),
4814
4814
  _("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ke.value]) }, P(shouldShowTimeDivider(z.value, t)), 3),
@@ -4893,7 +4893,7 @@ var Cr = [
4893
4893
  }, [blockAttachmentsForMessage(e).length ? (k(), h("div", {
4894
4894
  key: 0,
4895
4895
  class: C(["mb-1 space-y-1", e.sender === "user" ? "flex flex-col items-end" : ""])
4896
- }, [(k(!0), h(u, null, j(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (k(), h(u, { key: attachmentKey(e, t) }, [e.type === "image" ? (k(), h("img", {
4896
+ }, [(k(!0), h(u, null, A(blockAttachmentsForMessage(e), ({ attachment: e, index: t }) => (k(), h(u, { key: attachmentKey(e, t) }, [e.type === "image" ? (k(), h("img", {
4897
4897
  key: 0,
4898
4898
  src: e.src,
4899
4899
  alt: e.filename,
@@ -4919,7 +4919,7 @@ var Cr = [
4919
4919
  key: 1,
4920
4920
  "data-test": "messaging-message-content",
4921
4921
  class: C(e.sender === "user" ? G.value ? "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-900 text-theme-0 shadow-[0_1px_2px_rgba(5,15,25,0.14)]" : "rounded-[20px] rounded-br-[4px] px-4 py-2.5 bg-theme-0 text-theme-950" : G.value ? "text-theme-800" : "text-white/95")
4922
- }, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", xi, [b($r, {
4922
+ }, [(k(!0), h(u, null, A(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div", xi, [b($r, {
4923
4923
  text: t.text,
4924
4924
  inverted: e.sender === "user" || !G.value,
4925
4925
  streaming: e.id === U.value,
@@ -4951,7 +4951,7 @@ var Cr = [
4951
4951
  "data-attachment-placement": t.placement,
4952
4952
  class: C(["my-2 inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", G.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
4953
4953
  }, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + P(t.attachment.filename), 1)], 10, wi)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, _i)),
4954
- e.id === Se.value ? (k(), h(u, { key: 5 }, [he.value.length ? (k(!0), h(u, { key: 0 }, j(he.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
4954
+ e.id === Se.value ? (k(), h(u, { key: 5 }, [he.value.length ? (k(!0), h(u, { key: 0 }, A(he.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
4955
4955
  key: 0,
4956
4956
  "data-test": "messaging-tool-activity",
4957
4957
  "data-journal-outcome": e.journal.outcome,
@@ -5020,7 +5020,7 @@ var Cr = [
5020
5020
  Ae.value.length > 0 ? (k(), h("div", {
5021
5021
  key: 0,
5022
5022
  class: C(["flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", e.centered ? "max-w-[720px] mx-auto" : ""])
5023
- }, [(k(!0), h(u, null, j(Ae.value, (e, t) => (k(), h("div", {
5023
+ }, [(k(!0), h(u, null, A(Ae.value, (e, t) => (k(), h("div", {
5024
5024
  key: t,
5025
5025
  class: "relative shrink-0 group"
5026
5026
  }, [e.type === "image" ? (k(), h("img", {
@@ -5114,7 +5114,7 @@ var Cr = [
5114
5114
  onClick: s[19] || (s[19] = (e) => handleComposerAction())
5115
5115
  }, [Ie.value === "stop" ? (k(), h("i", Yi)) : (k(), h("i", Xi)), _("span", Zi, P(Re.value), 1)], 10, Ji))])
5116
5116
  ])], 10, Li),
5117
- z.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Qi, [_("div", $i, [(k(!0), h(u, null, j(e.suggestedPrompts, (e) => (k(), h("button", {
5117
+ z.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Qi, [_("div", $i, [(k(!0), h(u, null, A(e.suggestedPrompts, (e) => (k(), h("button", {
5118
5118
  key: e.id,
5119
5119
  type: "button",
5120
5120
  disabled: Ee.value,
@@ -5128,7 +5128,13 @@ var Cr = [
5128
5128
  }), ra = { class: "agent-wrap" }, ia = {
5129
5129
  key: 0,
5130
5130
  class: "flex items-center justify-center h-full"
5131
- }, aa = /* @__PURE__ */ x({
5131
+ }, aa = {
5132
+ key: 2,
5133
+ class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
5134
+ role: "status",
5135
+ "aria-live": "polite",
5136
+ "data-test": "agent-unavailable"
5137
+ }, oa = /* @__PURE__ */ x({
5132
5138
  __name: "AgentWrap",
5133
5139
  props: {
5134
5140
  sdk: {},
@@ -5148,8 +5154,8 @@ var Cr = [
5148
5154
  let r = a("AgentWrap"), i = e, o = i.sdk || t.getInstance({
5149
5155
  isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
5150
5156
  ...i.apiBase && { apiBase: i.apiBase }
5151
- }), s = A(!i.agent), c = oe(i.agent ? new n({ config: i.agent }) : void 0), u = A();
5152
- return ne(async () => {
5157
+ }), s = j(!i.agent), c = j(i.agent ? new n({ config: i.agent }) : void 0), u = j();
5158
+ async function loadAgent() {
5153
5159
  if (i.agent) {
5154
5160
  r.debug("Agent provided via props, skipping fetch", {
5155
5161
  agentId: i.agent.agentId,
@@ -5173,7 +5179,7 @@ var Cr = [
5173
5179
  return;
5174
5180
  }
5175
5181
  try {
5176
- s.value = !0, r.debug("Fetching public agent", { handle: i.handle });
5182
+ s.value = !0, u.value = void 0, r.debug("Fetching public agent", { handle: i.handle });
5177
5183
  let e = await o.user.getPublicAgent({ handle: i.handle });
5178
5184
  e ? (c.value = new n({ config: e }), r.debug("Successfully fetched public agent", {
5179
5185
  agentId: e.agentId,
@@ -5205,7 +5211,7 @@ var Cr = [
5205
5211
  }
5206
5212
  });
5207
5213
  } finally {
5208
- s.value = !1, c.value || r.debug("AgentWrap component will render empty (silent failure)", {
5214
+ s.value = !1, c.value || r.debug("AgentWrap component will render unavailable state", {
5209
5215
  state: {
5210
5216
  loading: s.value,
5211
5217
  hasAgent: !!c.value,
@@ -5223,7 +5229,8 @@ var Cr = [
5223
5229
  }
5224
5230
  });
5225
5231
  }
5226
- }), (t, n) => (k(), h("div", ra, [s.value ? (k(), h("div", ia, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ie(t.$slots, "default", {
5232
+ }
5233
+ return ne(loadAgent), (t, n) => (k(), h("div", ra, [s.value ? (k(), h("div", ia, [_("div", { class: C(["size-6 animate-spin rounded-full border-b-2", i.bare ? "border-theme-400" : "border-white"]) }, null, 2)])) : c.value ? ae(t.$slots, "default", {
5227
5234
  sdk: se(o),
5228
5235
  agent: c.value,
5229
5236
  context: e.clientContext ?? e.context,
@@ -5231,10 +5238,15 @@ var Cr = [
5231
5238
  buttonText: e.buttonText,
5232
5239
  buttonIcon: e.buttonIcon,
5233
5240
  loading: s.value
5234
- }, void 0, void 0, 1) : m("", !0)]));
5241
+ }, void 0, void 0, 1) : u.value ? (k(), h("div", aa, [n[0] || (n[0] = _("p", { class: "text-sm font-medium text-theme-600" }, " This assistant is unavailable right now. ", -1)), _("button", {
5242
+ type: "button",
5243
+ class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
5244
+ "data-test": "agent-unavailable-retry",
5245
+ onClick: loadAgent
5246
+ }, " Try again ")])) : m("", !0)]));
5235
5247
  }
5236
5248
  });
5237
5249
  //#endregion
5238
- export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, na as n, De as o, n as p, $r as r, Te as s, aa as t, parseButtonTemplate as u };
5250
+ export { ke as a, getAgentAvatarUrl as c, AgentChatController as d, ve as f, Pe as i, handleImageError as l, _e as m, na as n, De as o, n as p, $r as r, Te as s, oa as t, parseButtonTemplate as u };
5239
5251
 
5240
5252
  //# sourceMappingURL=AgentWrap.js.map