@pagelines/sdk 1.0.704 → 1.0.706
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 +82 -77
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/AgentController.d.ts +10 -0
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -431,7 +431,7 @@ var AgentChatController = class extends i {
|
|
|
431
431
|
canNotifyOnCompletion: !1,
|
|
432
432
|
lastVisibleProgressAtMs: this.lastVisibleProgressAtMs.value
|
|
433
433
|
});
|
|
434
|
-
})), e(this, "canUseComposer", f(() =>
|
|
434
|
+
})), e(this, "canUseComposer", f(() => this.textState.value.sendBlockedReason !== "agent_deleted" && !this.composerState.value.isUploading && !this.textState.value.isThinking)), e(this, "canAttachFile", f(() => !!this.settings.uploadFileFn)), e(this, "canRecordAudio", f(() => this.canAttachFile.value && this.canUseComposer.value && !this.composerState.value.text.trim() && this.composerState.value.pendingAttachments.length === 0)), e(this, "voiceRecorder", new VoiceRecorderController({
|
|
435
435
|
getCanRecord: () => this.canRecordAudio.value,
|
|
436
436
|
getUploadFn: () => {
|
|
437
437
|
let e = this.settings.uploadFileFn;
|
|
@@ -512,8 +512,8 @@ var AgentChatController = class extends i {
|
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
514
|
addOfflineSystemReply() {
|
|
515
|
-
let e =
|
|
516
|
-
|
|
515
|
+
let e = this._agent.displayName.value || "Your assistant", t = this.chatUnavailableReason ?? `${e} is unavailable`, n = this._agent.state.value.lifecycle === "stopped" || this._agent.desiredStatus.value !== "active", r = this.settings.manageUrl, i = n ? r ? `${t}, so your message can't be answered yet. [Wake ${e}](${r}), then send again.` : `${t}, so your message can't be answered yet. Wake it from the dashboard, then send again.` : `${t}. Give it a moment and send again.`, a = this.sharedMessages.value[this.sharedMessages.value.length - 1];
|
|
516
|
+
a?.sender === "system" && a.text === i || this.addMessage(i, "system");
|
|
517
517
|
}
|
|
518
518
|
async sendComposerMessage() {
|
|
519
519
|
if (!this.canSend.value) return;
|
|
@@ -720,7 +720,7 @@ Current User:
|
|
|
720
720
|
this.addOfflineSystemReply();
|
|
721
721
|
return;
|
|
722
722
|
}
|
|
723
|
-
if (this.textState.value.sendBlockedReason || this.textState.value.isThinking) return;
|
|
723
|
+
if (this.textState.value.sendBlockedReason === "agent_deleted" || this.textState.value.isThinking) return;
|
|
724
724
|
let { sdk: r } = this.settings;
|
|
725
725
|
if (!n && !this._agent.handle.value) {
|
|
726
726
|
this.handleError(/* @__PURE__ */ Error("Agent handle required for chat"));
|
|
@@ -3987,7 +3987,7 @@ var Cr = [
|
|
|
3987
3987
|
function diagramNodeStroke(e) {
|
|
3988
3988
|
return e === "decision" ? t.inverted ? "rgba(255, 255, 255, 0.26)" : "color-mix(in oklch, var(--color-primary-500) 32%, var(--color-theme-300))" : Se.value;
|
|
3989
3989
|
}
|
|
3990
|
-
let ve = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900)
|
|
3990
|
+
let ve = f(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ye = f(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), H = f(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), be = f(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), U = f(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), Se = f(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), W = f(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Ce = f(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = f(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
3991
3991
|
return (e, r) => o.value ? (k(), h("section", {
|
|
3992
3992
|
key: 0,
|
|
3993
3993
|
"data-test": "chat-visual",
|
|
@@ -4422,10 +4422,10 @@ var Cr = [
|
|
|
4422
4422
|
style: { background: "currentcolor" }
|
|
4423
4423
|
}, null, -1), v(" Preparing chart… ", -1)])], 4))], 64))), 128))], 32));
|
|
4424
4424
|
}
|
|
4425
|
-
}), ei = 80, ti = /* @__PURE__ */ x({
|
|
4425
|
+
}), ei = 80, ti = 600, ni = /* @__PURE__ */ x({
|
|
4426
4426
|
__name: "ChatScroller",
|
|
4427
4427
|
setup(e, { expose: t }) {
|
|
4428
|
-
let n = A(), r = A(), i = A(!0), a;
|
|
4428
|
+
let n = A(), r = A(), i = A(!0), a, o = 0;
|
|
4429
4429
|
function scrollToBottom() {
|
|
4430
4430
|
let e = n.value;
|
|
4431
4431
|
e && (e.scrollTop = e.scrollHeight);
|
|
@@ -4434,6 +4434,9 @@ var Cr = [
|
|
|
4434
4434
|
let e = n.value;
|
|
4435
4435
|
e && (i.value = e.scrollHeight - e.scrollTop - e.clientHeight <= ei);
|
|
4436
4436
|
}
|
|
4437
|
+
function markUserGesture() {
|
|
4438
|
+
o = Date.now() + ti;
|
|
4439
|
+
}
|
|
4437
4440
|
function pin() {
|
|
4438
4441
|
i.value = !0, scrollToBottom();
|
|
4439
4442
|
}
|
|
@@ -4441,7 +4444,7 @@ var Cr = [
|
|
|
4441
4444
|
requestAnimationFrame(() => {
|
|
4442
4445
|
scrollToBottom(), requestAnimationFrame(scrollToBottom);
|
|
4443
4446
|
}), r.value && (a = new ResizeObserver(() => {
|
|
4444
|
-
i.value && scrollToBottom();
|
|
4447
|
+
i.value && Date.now() > o && scrollToBottom();
|
|
4445
4448
|
}), a.observe(r.value), n.value && a.observe(n.value));
|
|
4446
4449
|
}), te(() => {
|
|
4447
4450
|
a?.disconnect();
|
|
@@ -4449,31 +4452,33 @@ var Cr = [
|
|
|
4449
4452
|
ref_key: "viewport",
|
|
4450
4453
|
ref: n,
|
|
4451
4454
|
class: C(["overflow-y-auto overflow-x-hidden min-h-0 flex flex-col [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", i.value ? "[overflow-anchor:none]" : ""]),
|
|
4452
|
-
onScrollPassive: onScroll
|
|
4455
|
+
onScrollPassive: onScroll,
|
|
4456
|
+
onWheelPassive: markUserGesture,
|
|
4457
|
+
onTouchstartPassive: markUserGesture
|
|
4453
4458
|
}, [_("div", {
|
|
4454
4459
|
ref_key: "content",
|
|
4455
4460
|
ref: r,
|
|
4456
4461
|
class: "flex-1 flex flex-col"
|
|
4457
4462
|
}, [ie(e.$slots, "default")], 512)], 34));
|
|
4458
4463
|
}
|
|
4459
|
-
}),
|
|
4464
|
+
}), ri = {
|
|
4460
4465
|
key: 0,
|
|
4461
4466
|
class: "pb-4"
|
|
4462
|
-
},
|
|
4467
|
+
}, ii = {
|
|
4463
4468
|
key: 1,
|
|
4464
4469
|
"data-test": "messaging-sdk-header",
|
|
4465
4470
|
class: "shrink-0 border-b border-theme-100 px-4 py-3"
|
|
4466
|
-
},
|
|
4471
|
+
}, ai = { class: "min-w-0 flex-1" }, oi = { class: "truncate text-base font-semibold leading-tight text-theme-900" }, si = { class: "mt-1 truncate text-sm leading-tight text-theme-500" }, ci = {
|
|
4467
4472
|
key: 0,
|
|
4468
4473
|
class: "shrink-0 rounded-full bg-theme-50 px-2.5 py-1 font-mono text-[11px] font-medium text-theme-500"
|
|
4469
|
-
},
|
|
4474
|
+
}, li = {
|
|
4470
4475
|
key: 0,
|
|
4471
4476
|
"data-test": "messaging-empty-state",
|
|
4472
4477
|
class: "flex flex-col items-center justify-center px-4"
|
|
4473
|
-
},
|
|
4478
|
+
}, ui = ["title"], di = {
|
|
4474
4479
|
key: 0,
|
|
4475
4480
|
class: "flex items-center gap-3 py-3 px-2"
|
|
4476
|
-
},
|
|
4481
|
+
}, fi = ["data-journal-outcome"], pi = [
|
|
4477
4482
|
"data-message-id",
|
|
4478
4483
|
"data-message-sender",
|
|
4479
4484
|
"data-conversation-id",
|
|
@@ -4484,7 +4489,7 @@ var Cr = [
|
|
|
4484
4489
|
"data-issue-action-label",
|
|
4485
4490
|
"data-issue-action-url",
|
|
4486
4491
|
"data-streaming"
|
|
4487
|
-
],
|
|
4492
|
+
], mi = { class: "max-w-[85%] min-w-0" }, hi = ["href"], gi = [
|
|
4488
4493
|
"data-message-id",
|
|
4489
4494
|
"data-message-sender",
|
|
4490
4495
|
"data-conversation-id",
|
|
@@ -4493,7 +4498,7 @@ var Cr = [
|
|
|
4493
4498
|
"data-issue-code",
|
|
4494
4499
|
"data-issue-bucket",
|
|
4495
4500
|
"data-streaming"
|
|
4496
|
-
],
|
|
4501
|
+
], _i = [
|
|
4497
4502
|
"data-test",
|
|
4498
4503
|
"data-message-id",
|
|
4499
4504
|
"data-message-sender",
|
|
@@ -4501,51 +4506,51 @@ var Cr = [
|
|
|
4501
4506
|
"data-message-sequence",
|
|
4502
4507
|
"data-system-kind",
|
|
4503
4508
|
"data-streaming"
|
|
4504
|
-
],
|
|
4509
|
+
], vi = ["src", "alt"], yi = ["src"], bi = ["href"], xi = {
|
|
4505
4510
|
key: 0,
|
|
4506
4511
|
"data-test": "messaging-message-text-part"
|
|
4507
|
-
},
|
|
4512
|
+
}, Si = [
|
|
4508
4513
|
"src",
|
|
4509
4514
|
"alt",
|
|
4510
4515
|
"data-attachment-placement"
|
|
4511
|
-
],
|
|
4516
|
+
], Ci = ["src", "data-attachment-placement"], wi = ["href", "data-attachment-placement"], Ti = ["data-journal-outcome"], Ei = {
|
|
4512
4517
|
key: 2,
|
|
4513
4518
|
"data-test": "messaging-tool-activity-tail",
|
|
4514
4519
|
"aria-label": "Assistant is still working",
|
|
4515
4520
|
class: "mb-4 grid h-[17px] w-5 place-items-center"
|
|
4516
|
-
},
|
|
4521
|
+
}, Di = ["data-journal-outcome"], Oi = ["data-working-description"], ki = { class: "truncate" }, Ai = ["data-issue-code"], ji = ["href"], Mi = {
|
|
4517
4522
|
key: 3,
|
|
4518
4523
|
"data-test": "messaging-thinking-indicator",
|
|
4519
4524
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
4520
|
-
},
|
|
4525
|
+
}, Ni = ["src", "alt"], Pi = { class: "max-w-20 truncate" }, Fi = ["onClick"], Ii = {
|
|
4521
4526
|
key: 0,
|
|
4522
4527
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
4523
|
-
},
|
|
4528
|
+
}, Li = ["data-composer-action"], Ri = ["placeholder", "disabled"], zi = { class: "font-mono text-sm tabular-nums" }, Bi = { class: "mt-2.5 flex items-center" }, Vi = [
|
|
4524
4529
|
"disabled",
|
|
4525
4530
|
"aria-label",
|
|
4526
4531
|
"title"
|
|
4527
|
-
],
|
|
4532
|
+
], Hi = {
|
|
4528
4533
|
key: 0,
|
|
4529
4534
|
class: "i-svg-spinners-ring-resize size-5"
|
|
4530
|
-
},
|
|
4535
|
+
}, Ui = {
|
|
4531
4536
|
key: 1,
|
|
4532
4537
|
class: "i-tabler-plus size-5"
|
|
4533
|
-
},
|
|
4538
|
+
}, Wi = { class: "sr-only" }, Gi = { class: "flex items-center gap-2" }, Ki = ["aria-label", "title"], qi = { class: "sr-only" }, Ji = [
|
|
4534
4539
|
"data-composer-action",
|
|
4535
4540
|
"disabled",
|
|
4536
4541
|
"aria-label",
|
|
4537
4542
|
"title"
|
|
4538
|
-
],
|
|
4543
|
+
], Yi = {
|
|
4539
4544
|
key: 0,
|
|
4540
4545
|
class: "i-tabler-player-stop-filled size-3.5"
|
|
4541
|
-
},
|
|
4546
|
+
}, Xi = {
|
|
4542
4547
|
key: 1,
|
|
4543
4548
|
class: "i-tabler-arrow-up size-[17px]"
|
|
4544
|
-
},
|
|
4549
|
+
}, Zi = { class: "sr-only" }, Qi = {
|
|
4545
4550
|
key: 2,
|
|
4546
4551
|
"data-test": "messaging-suggested-prompts",
|
|
4547
4552
|
class: "mt-5 w-full sm:mx-auto sm:max-w-[720px]"
|
|
4548
|
-
},
|
|
4553
|
+
}, $i = { class: "flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center sm:justify-center" }, ea = ["disabled", "onClick"], ta = ["aria-expanded"], na = /* @__PURE__ */ x({
|
|
4549
4554
|
__name: "ElAgentChat",
|
|
4550
4555
|
props: {
|
|
4551
4556
|
chatController: {},
|
|
@@ -4677,7 +4682,7 @@ var Cr = [
|
|
|
4677
4682
|
if (!x.value) return;
|
|
4678
4683
|
let e = B.value, t = e[e.length - 1];
|
|
4679
4684
|
return t?.sender === "agent" || t?.sender === "system" ? t.id : void 0;
|
|
4680
|
-
}), U = f(() => !x.value || he.value || _e.value || P.value.length ? !1 : be.value === void 0), Se = f(() => s.value?.sendBlockedReason), W = f(() => Se.value
|
|
4685
|
+
}), U = f(() => !x.value || he.value || _e.value || P.value.length ? !1 : be.value === void 0), Se = f(() => s.value?.sendBlockedReason), W = f(() => Se.value === "agent_deleted"), Ce = f(() => T.value ? `${e.agent.displayName.value || e.agent.name.value || "Assistant"} is offline` : te.value ? "Connecting..." : Se.value === "agent_deleted" ? "This assistant was deleted" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = f(() => e.chatController?.composerState?.value ?? {
|
|
4681
4686
|
text: "",
|
|
4682
4687
|
pendingAttachments: [],
|
|
4683
4688
|
isUploading: !1
|
|
@@ -4753,17 +4758,17 @@ var Cr = [
|
|
|
4753
4758
|
})}, ${a}`;
|
|
4754
4759
|
}
|
|
4755
4760
|
return (t, s) => (k(), h("div", { class: C(["@container/chat relative flex h-full flex-col", B.value.length === 0 ? "min-h-0 [justify-content:safe_center] overflow-y-auto" : ""]) }, [
|
|
4756
|
-
e.showHeader && !G.value ? (k(), h("div",
|
|
4761
|
+
e.showHeader && !G.value ? (k(), h("div", ri, [b(Pe, {
|
|
4757
4762
|
agent: e.agent,
|
|
4758
4763
|
"is-online": c.value
|
|
4759
|
-
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div",
|
|
4764
|
+
}, null, 8, ["agent", "is-online"])])) : e.showHeader ? (k(), h("div", ii, [_("div", { class: C(["flex items-center gap-3", e.centered ? "max-w-[720px] mx-auto" : ""]) }, [
|
|
4760
4765
|
b(ze, {
|
|
4761
4766
|
agent: e.agent,
|
|
4762
4767
|
"is-light": G.value,
|
|
4763
4768
|
class: "size-10"
|
|
4764
4769
|
}, null, 8, ["agent", "is-light"]),
|
|
4765
|
-
_("div",
|
|
4766
|
-
e.headerMeta ? (k(), h("span",
|
|
4770
|
+
_("div", ai, [_("div", oi, F(e.agent.displayName.value), 1), _("div", si, F(e.agent.title.value || "Assistant"), 1)]),
|
|
4771
|
+
e.headerMeta ? (k(), h("span", ci, F(e.headerMeta), 1)) : m("", !0)
|
|
4767
4772
|
], 2)])) : m("", !0),
|
|
4768
4773
|
te.value ? (k(), h("div", {
|
|
4769
4774
|
key: 2,
|
|
@@ -4772,13 +4777,13 @@ var Cr = [
|
|
|
4772
4777
|
key: 3,
|
|
4773
4778
|
class: C(["flex items-center justify-center gap-1.5 py-2 text-[11px]", Ue.value])
|
|
4774
4779
|
}, [s[20] || (s[20] = _("i", { class: "i-tabler-tool size-3" }, null, -1)), _("span", null, F(e.setupHint), 1)], 2)) : m("", !0),
|
|
4775
|
-
b(
|
|
4780
|
+
b(ni, {
|
|
4776
4781
|
ref_key: "chatScroller",
|
|
4777
4782
|
ref: i,
|
|
4778
4783
|
class: C(B.value.length === 0 ? "flex-none" : "flex-1")
|
|
4779
4784
|
}, {
|
|
4780
|
-
default: ce(() => [_("div", { class: C([B.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 ? B.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
4781
|
-
B.value.length === 0 && !te.value ? (k(), h("div",
|
|
4785
|
+
default: ce(() => [_("div", { class: C([B.value.length === 0 ? "flex flex-col items-center justify-center px-3 py-4" : e.centered ? "pt-20 pb-[120px] px-3 space-y-2" : "pt-4 pb-[120px] px-3 space-y-2", e.centered ? B.value.length === 0 ? "max-w-[900px] mx-auto w-full" : "max-w-[720px] mx-auto w-full" : ""]) }, [
|
|
4786
|
+
B.value.length === 0 && !te.value ? (k(), h("div", li, [ie(t.$slots, "empty-heading", {
|
|
4782
4787
|
agent: e.agent,
|
|
4783
4788
|
isLight: G.value
|
|
4784
4789
|
}, () => [b(ze, {
|
|
@@ -4788,9 +4793,9 @@ var Cr = [
|
|
|
4788
4793
|
}, null, 8, ["agent", "is-light"]), _("div", { class: C(["text-base @sm/chat:text-lg font-semibold", G.value ? "text-theme-900" : "text-white"]) }, F(e.agent.displayName.value), 3)]), e.emptyStateMessage === "" ? m("", !0) : (k(), h(u, { key: 0 }, [_("p", { class: C(["mt-1 text-center text-xs @sm/chat:text-sm", Ue.value]) }, F(e.emptyStateMessage || "Type your message to get started."), 3), _("div", {
|
|
4789
4794
|
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"]),
|
|
4790
4795
|
title: n.value.tooltip
|
|
4791
|
-
}, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10,
|
|
4796
|
+
}, [_("i", { class: C([n.value.icon, "size-3"]) }, null, 2), _("span", null, F(n.value.label), 1)], 10, ui)], 64))])) : m("", !0),
|
|
4792
4797
|
(k(!0), h(u, null, j(B.value, (e, t) => (k(), h(u, { key: e.id }, [
|
|
4793
|
-
shouldShowTimeDivider(B.value, t) ? (k(), h("div",
|
|
4798
|
+
shouldShowTimeDivider(B.value, t) ? (k(), h("div", di, [
|
|
4794
4799
|
_("div", { class: C(["flex-1 h-px", He.value]) }, null, 2),
|
|
4795
4800
|
_("span", { class: C(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", Ue.value]) }, F(shouldShowTimeDivider(B.value, t)), 3),
|
|
4796
4801
|
_("div", { class: C(["flex-1 h-px", He.value]) }, null, 2)
|
|
@@ -4803,7 +4808,7 @@ var Cr = [
|
|
|
4803
4808
|
}, [b(qe, {
|
|
4804
4809
|
model: messageWorkJournal(e),
|
|
4805
4810
|
"is-light": G.value
|
|
4806
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4811
|
+
}, null, 8, ["model", "is-light"])], 8, fi)) : m("", !0),
|
|
4807
4812
|
isSystemExplainerMessage(e) ? (k(), h("div", {
|
|
4808
4813
|
key: 2,
|
|
4809
4814
|
"data-test": "messaging-system-msg",
|
|
@@ -4818,7 +4823,7 @@ var Cr = [
|
|
|
4818
4823
|
"data-issue-action-url": e.issue?.actionUrl,
|
|
4819
4824
|
"data-streaming": e.id === be.value ? "true" : void 0,
|
|
4820
4825
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
4821
|
-
}, [_("div",
|
|
4826
|
+
}, [_("div", mi, [_("div", { class: C(["mb-1 pl-1 text-[11px] font-medium", G.value ? "text-theme-500" : "text-white/45"]) }, " System Message ", 2), _("div", { class: C(["rounded-[20px] rounded-bl-[4px] px-4 py-2.5 border system-msg-content", G.value ? "bg-theme-25 border-theme-200 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p($r, {
|
|
4822
4827
|
key: 0,
|
|
4823
4828
|
text: e.text,
|
|
4824
4829
|
inverted: !G.value,
|
|
@@ -4838,7 +4843,7 @@ var Cr = [
|
|
|
4838
4843
|
"data-test": "messaging-system-msg-action",
|
|
4839
4844
|
class: C(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", G.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
4840
4845
|
onClick: s[1] || (s[1] = z(() => {}, ["stop"]))
|
|
4841
|
-
}, [v(F(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10,
|
|
4846
|
+
}, [v(F(e.issue.actionLabel) + " ", 1), s[21] || (s[21] = _("i", { class: "i-tabler-arrow-right size-3" }, null, -1))], 10, hi)) : m("", !0)], 2)])], 8, pi)) : e.sender === "system" ? (k(), h("div", {
|
|
4842
4847
|
key: 3,
|
|
4843
4848
|
"data-test": "messaging-system-status-msg",
|
|
4844
4849
|
"data-message-id": e.id,
|
|
@@ -4854,7 +4859,7 @@ var Cr = [
|
|
|
4854
4859
|
text: e.text,
|
|
4855
4860
|
inverted: !G.value,
|
|
4856
4861
|
onClick: s[2] || (s[2] = z(() => {}, ["stop"]))
|
|
4857
|
-
}, null, 8, ["text", "inverted"])], 10,
|
|
4862
|
+
}, null, 8, ["text", "inverted"])], 10, gi)) : (k(), h("div", {
|
|
4858
4863
|
key: 4,
|
|
4859
4864
|
"data-test": e.sender === "agent" ? "messaging-assistant-msg" : e.sender === "user" ? "messaging-user-msg" : void 0,
|
|
4860
4865
|
"data-message-id": e.id,
|
|
@@ -4881,14 +4886,14 @@ var Cr = [
|
|
|
4881
4886
|
"data-test": "messaging-attachment",
|
|
4882
4887
|
"data-attachment-placement": "block",
|
|
4883
4888
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4884
|
-
}, null, 8,
|
|
4889
|
+
}, null, 8, vi)) : e.type === "audio" ? (k(), h("audio", {
|
|
4885
4890
|
key: 1,
|
|
4886
4891
|
src: e.src,
|
|
4887
4892
|
controls: "",
|
|
4888
4893
|
"data-test": "messaging-attachment",
|
|
4889
4894
|
"data-attachment-placement": "block",
|
|
4890
4895
|
class: "max-w-full"
|
|
4891
|
-
}, null, 8,
|
|
4896
|
+
}, null, 8, yi)) : (k(), h("a", {
|
|
4892
4897
|
key: 2,
|
|
4893
4898
|
href: e.src,
|
|
4894
4899
|
target: "_blank",
|
|
@@ -4896,11 +4901,11 @@ var Cr = [
|
|
|
4896
4901
|
"data-test": "messaging-attachment",
|
|
4897
4902
|
"data-attachment-placement": "block",
|
|
4898
4903
|
class: C(["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"])
|
|
4899
|
-
}, [s[23] || (s[23] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10,
|
|
4904
|
+
}, [s[23] || (s[23] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(e.filename), 1)], 10, bi))], 64))), 128))], 2)) : m("", !0), messageRenderParts(e).length ? (k(), h("div", {
|
|
4900
4905
|
key: 1,
|
|
4901
4906
|
"data-test": "messaging-message-content",
|
|
4902
4907
|
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")
|
|
4903
|
-
}, [(k(!0), h(u, null, j(messageRenderParts(e), (t) => (k(), h(u, { key: t.key }, [t.kind === "text" && t.text ? (k(), h("div",
|
|
4908
|
+
}, [(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, {
|
|
4904
4909
|
text: t.text,
|
|
4905
4910
|
inverted: e.sender === "user" || !G.value,
|
|
4906
4911
|
streaming: e.id === be.value,
|
|
@@ -4916,14 +4921,14 @@ var Cr = [
|
|
|
4916
4921
|
"data-test": "messaging-attachment",
|
|
4917
4922
|
"data-attachment-placement": t.placement,
|
|
4918
4923
|
class: "my-2 rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
4919
|
-
}, null, 8,
|
|
4924
|
+
}, null, 8, Si)) : t.kind === "attachment" && t.attachment.type === "audio" ? (k(), h("audio", {
|
|
4920
4925
|
key: 2,
|
|
4921
4926
|
src: t.attachment.src,
|
|
4922
4927
|
controls: "",
|
|
4923
4928
|
"data-test": "messaging-attachment",
|
|
4924
4929
|
"data-attachment-placement": t.placement,
|
|
4925
4930
|
class: "my-2 max-w-full"
|
|
4926
|
-
}, null, 8,
|
|
4931
|
+
}, null, 8, Ci)) : t.kind === "attachment" ? (k(), h("a", {
|
|
4927
4932
|
key: 3,
|
|
4928
4933
|
href: t.attachment.src,
|
|
4929
4934
|
target: "_blank",
|
|
@@ -4931,7 +4936,7 @@ var Cr = [
|
|
|
4931
4936
|
"data-test": "messaging-attachment",
|
|
4932
4937
|
"data-attachment-placement": t.placement,
|
|
4933
4938
|
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"])
|
|
4934
|
-
}, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10,
|
|
4939
|
+
}, [s[24] || (s[24] = _("i", { class: "i-tabler-file size-3.5" }, null, -1)), v(" " + F(t.attachment.filename), 1)], 10, wi)) : m("", !0)], 64))), 128))], 2)) : m("", !0)], 2)], 10, _i)),
|
|
4935
4940
|
e.id === ve.value ? (k(), h(u, { key: 5 }, [P.value.length ? (k(!0), h(u, { key: 0 }, j(P.value, (e) => (k(), h(u, { key: e.id }, [e.kind === "work" ? (k(), h("div", {
|
|
4936
4941
|
key: 0,
|
|
4937
4942
|
"data-test": "messaging-tool-activity",
|
|
@@ -4940,7 +4945,7 @@ var Cr = [
|
|
|
4940
4945
|
}, [b(qe, {
|
|
4941
4946
|
model: e.journal,
|
|
4942
4947
|
"is-light": G.value
|
|
4943
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4948
|
+
}, null, 8, ["model", "is-light"])], 8, Ti)) : e.kind === "text" && e.content ? (k(), h("div", {
|
|
4944
4949
|
key: 1,
|
|
4945
4950
|
"data-test": "messaging-live-text-block",
|
|
4946
4951
|
class: C(["mb-4 @sm/chat:pr-[1em] @lg/chat:pr-[2em]", G.value ? "text-theme-800" : "text-white/95"])
|
|
@@ -4953,7 +4958,7 @@ var Cr = [
|
|
|
4953
4958
|
"text",
|
|
4954
4959
|
"inverted",
|
|
4955
4960
|
"streaming"
|
|
4956
|
-
])], 2)) : (k(), h("div",
|
|
4961
|
+
])], 2)) : (k(), h("div", Ei, [b(pe, { class: C(["size-3.5", G.value ? "text-theme-500" : "text-white/70"]) }, null, 8, ["class"])]))], 64))), 128)) : _e.value ? (k(), h("div", {
|
|
4957
4962
|
key: 1,
|
|
4958
4963
|
"data-test": "messaging-tool-activity",
|
|
4959
4964
|
"data-journal-outcome": _e.value.outcome,
|
|
@@ -4961,7 +4966,7 @@ var Cr = [
|
|
|
4961
4966
|
}, [b(qe, {
|
|
4962
4967
|
model: _e.value,
|
|
4963
4968
|
"is-light": G.value
|
|
4964
|
-
}, null, 8, ["model", "is-light"])], 8,
|
|
4969
|
+
}, null, 8, ["model", "is-light"])], 8, Di)) : m("", !0)], 64)) : m("", !0)
|
|
4965
4970
|
], 64))), 128)),
|
|
4966
4971
|
he.value ? (k(), h("div", {
|
|
4967
4972
|
key: 1,
|
|
@@ -4971,7 +4976,7 @@ var Cr = [
|
|
|
4971
4976
|
}, [s[25] || (s[25] = _("i", {
|
|
4972
4977
|
class: "i-tabler-loader-2 size-3.5 shrink-0 animate-spin opacity-70",
|
|
4973
4978
|
"aria-hidden": "true"
|
|
4974
|
-
}, null, -1)), _("span",
|
|
4979
|
+
}, null, -1)), _("span", ki, F(he.value), 1)], 10, Oi)) : m("", !0),
|
|
4975
4980
|
H.value ? (k(), h("div", {
|
|
4976
4981
|
key: 2,
|
|
4977
4982
|
"data-test": "messaging-transient-issue",
|
|
@@ -4988,9 +4993,9 @@ var Cr = [
|
|
|
4988
4993
|
href: H.value.actionUrl,
|
|
4989
4994
|
class: "shrink-0 underline underline-offset-2",
|
|
4990
4995
|
onClick: s[5] || (s[5] = z(() => {}, ["stop"]))
|
|
4991
|
-
}, F(H.value.actionLabel), 9,
|
|
4992
|
-
], 10,
|
|
4993
|
-
U.value ? (k(), h("div",
|
|
4996
|
+
}, F(H.value.actionLabel), 9, ji)) : m("", !0)
|
|
4997
|
+
], 10, Ai)) : m("", !0),
|
|
4998
|
+
U.value ? (k(), h("div", Mi, [_("i", {
|
|
4994
4999
|
class: C(["i-svg-spinners-3-dots-bounce size-7", G.value ? "text-theme-400" : "text-white/50"]),
|
|
4995
5000
|
"aria-hidden": "true"
|
|
4996
5001
|
}, null, 2)])) : m("", !0)
|
|
@@ -5009,13 +5014,13 @@ var Cr = [
|
|
|
5009
5014
|
src: e.src,
|
|
5010
5015
|
alt: e.filename,
|
|
5011
5016
|
class: C(["size-14 rounded-xl object-cover border", G.value ? "border-black/10" : "border-white/20"])
|
|
5012
|
-
}, null, 10,
|
|
5017
|
+
}, null, 10, Ni)) : (k(), h("div", {
|
|
5013
5018
|
key: 1,
|
|
5014
5019
|
class: C(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", G.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
5015
|
-
}, [s[27] || (s[27] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span",
|
|
5020
|
+
}, [s[27] || (s[27] = _("i", { class: "i-tabler-file size-4" }, null, -1)), _("span", Pi, F(e.filename), 1)], 2)), _("button", {
|
|
5016
5021
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
5017
5022
|
onClick: (e) => removeAttachment(t)
|
|
5018
|
-
}, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8,
|
|
5023
|
+
}, [...s[28] || (s[28] = [_("i", { class: "i-tabler-x size-3" }, null, -1)])], 8, Fi)]))), 128)), De.value ? (k(), h("div", Ii, [b(pe, { class: "size-5" })])) : m("", !0)], 2)) : m("", !0),
|
|
5019
5024
|
Ae.value ? (k(), h("input", {
|
|
5020
5025
|
key: 1,
|
|
5021
5026
|
ref_key: "fileInput",
|
|
@@ -5036,7 +5041,7 @@ var Cr = [
|
|
|
5036
5041
|
class: C(["flex min-w-0 items-center gap-2 py-1", G.value ? "text-theme-700" : "text-white/80"])
|
|
5037
5042
|
}, [
|
|
5038
5043
|
s[29] || (s[29] = _("span", { class: "size-2.5 shrink-0 rounded-full bg-red-500" }, null, -1)),
|
|
5039
|
-
_("span",
|
|
5044
|
+
_("span", zi, F(Re.value), 1),
|
|
5040
5045
|
_("span", { class: C(["min-w-0 truncate text-sm", G.value ? "text-theme-400" : "text-white/45"]) }, F(Be.value), 3)
|
|
5041
5046
|
], 2)) : R((k(), h("textarea", {
|
|
5042
5047
|
key: 0,
|
|
@@ -5056,7 +5061,7 @@ var Cr = [
|
|
|
5056
5061
|
onKeydown: handleKeydown,
|
|
5057
5062
|
onFocus: s[7] || (s[7] = (e) => r.value = !0),
|
|
5058
5063
|
onBlur: s[8] || (s[8] = (e) => r.value = !1)
|
|
5059
|
-
}, null, 42,
|
|
5064
|
+
}, null, 42, Ri)), [[I, Te.value]]), _("div", Bi, [
|
|
5060
5065
|
_("button", {
|
|
5061
5066
|
class: C(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70", [
|
|
5062
5067
|
Ae.value ? "cursor-pointer" : "cursor-default",
|
|
@@ -5067,9 +5072,9 @@ var Cr = [
|
|
|
5067
5072
|
"aria-label": Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5068
5073
|
title: Ae.value ? "Attach file" : "File attachments unavailable",
|
|
5069
5074
|
onClick: s[9] || (s[9] = (e) => Ae.value && triggerFileInput())
|
|
5070
|
-
}, [De.value ? (k(), h("i",
|
|
5075
|
+
}, [De.value ? (k(), h("i", Hi)) : (k(), h("i", Ui)), _("span", Wi, F(Ae.value ? "Attach file" : "File attachments unavailable"), 1)], 10, Vi),
|
|
5071
5076
|
s[30] || (s[30] = _("div", { class: "flex-1" }, null, -1)),
|
|
5072
|
-
_("div",
|
|
5077
|
+
_("div", Gi, [Ie.value || Le.value ? (k(), h("button", {
|
|
5073
5078
|
key: 0,
|
|
5074
5079
|
"data-test": "messaging-record-audio-btn",
|
|
5075
5080
|
class: C(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70", Le.value ? G.value ? "text-theme-900 scale-110" : "text-white scale-110" : G.value ? "text-theme-500" : "text-white/60"]),
|
|
@@ -5084,7 +5089,7 @@ var Cr = [
|
|
|
5084
5089
|
s[17] || (s[17] = ue(z((e) => finishRecording({ cancelled: !0 }), ["prevent"]), ["escape"]))
|
|
5085
5090
|
],
|
|
5086
5091
|
onKeyup: [s[14] || (s[14] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["enter"])), s[16] || (s[16] = ue(z((e) => finishRecording({ cancelled: !1 }), ["prevent"]), ["space"]))]
|
|
5087
|
-
}, [_("i", { class: C([Le.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span",
|
|
5092
|
+
}, [_("i", { class: C([Le.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), _("span", qi, F(Ve.value), 1)], 42, Ki)) : m("", !0), Le.value ? m("", !0) : (k(), h("button", {
|
|
5088
5093
|
key: 1,
|
|
5089
5094
|
"data-test": "messaging-send-btn",
|
|
5090
5095
|
"data-composer-action": Me.value,
|
|
@@ -5093,36 +5098,36 @@ var Cr = [
|
|
|
5093
5098
|
"aria-label": Fe.value,
|
|
5094
5099
|
title: Fe.value,
|
|
5095
5100
|
onClick: s[18] || (s[18] = (e) => handleComposerAction())
|
|
5096
|
-
}, [Me.value === "stop" ? (k(), h("i",
|
|
5097
|
-
])], 10,
|
|
5098
|
-
B.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div",
|
|
5101
|
+
}, [Me.value === "stop" ? (k(), h("i", Yi)) : (k(), h("i", Xi)), _("span", Zi, F(Fe.value), 1)], 10, Ji))])
|
|
5102
|
+
])], 10, Li),
|
|
5103
|
+
B.value.length === 0 && e.suggestedPrompts.length > 0 ? (k(), h("div", Qi, [_("div", $i, [(k(!0), h(u, null, j(e.suggestedPrompts, (e, t) => (k(), h("button", {
|
|
5099
5104
|
key: e.id,
|
|
5100
5105
|
type: "button",
|
|
5101
5106
|
disabled: W.value,
|
|
5102
5107
|
"data-test": "messaging-suggested-prompt",
|
|
5103
5108
|
class: C(["w-full rounded-2xl bg-theme-50 px-4 py-3 text-left text-[14.5px] font-medium transition-colors sm:w-auto sm:rounded-full sm:py-2 sm:text-center sm:text-[14px]", [W.value ? "cursor-not-allowed text-theme-300" : "cursor-pointer text-theme-600 hover:bg-theme-100 hover:text-theme-900", !ae.value && t >= 3 ? "max-sm:hidden" : ""]]),
|
|
5104
5109
|
onClick: (t) => sendSuggestedPrompt(e)
|
|
5105
|
-
}, F(e.label), 11,
|
|
5110
|
+
}, F(e.label), 11, ea))), 128)), e.suggestedPrompts.length > 3 ? (k(), h("button", {
|
|
5106
5111
|
key: 0,
|
|
5107
5112
|
type: "button",
|
|
5108
5113
|
"data-test": "messaging-suggested-prompts-more",
|
|
5109
5114
|
"aria-expanded": ae.value,
|
|
5110
5115
|
class: "flex w-full cursor-pointer items-center justify-center gap-1.5 rounded-2xl px-4 py-3 text-[14px] font-medium text-theme-600 ring-1 ring-theme-200 transition-colors hover:bg-theme-50 hover:text-theme-900 sm:hidden",
|
|
5111
5116
|
onClick: s[19] || (s[19] = (e) => ae.value = !ae.value)
|
|
5112
|
-
}, [v(F(ae.value ? "See less" : "See more") + " ", 1), _("i", { class: C(["i-tabler-chevron-down size-4 transition-transform", ae.value ? "rotate-180" : ""]) }, null, 2)], 8,
|
|
5117
|
+
}, [v(F(ae.value ? "See less" : "See more") + " ", 1), _("i", { class: C(["i-tabler-chevron-down size-4 transition-transform", ae.value ? "rotate-180" : ""]) }, null, 2)], 8, ta)) : m("", !0)])])) : m("", !0)
|
|
5113
5118
|
], 2)
|
|
5114
5119
|
], 2));
|
|
5115
5120
|
}
|
|
5116
|
-
}),
|
|
5121
|
+
}), ra = { class: "agent-wrap" }, ia = {
|
|
5117
5122
|
key: 0,
|
|
5118
5123
|
class: "flex items-center justify-center h-full"
|
|
5119
|
-
},
|
|
5124
|
+
}, aa = {
|
|
5120
5125
|
key: 2,
|
|
5121
5126
|
class: "flex h-full flex-col items-center justify-center gap-4 px-6 text-center",
|
|
5122
5127
|
role: "status",
|
|
5123
5128
|
"aria-live": "polite",
|
|
5124
5129
|
"data-test": "agent-unavailable"
|
|
5125
|
-
},
|
|
5130
|
+
}, oa = /* @__PURE__ */ x({
|
|
5126
5131
|
__name: "AgentWrap",
|
|
5127
5132
|
props: {
|
|
5128
5133
|
sdk: {},
|
|
@@ -5218,7 +5223,7 @@ var Cr = [
|
|
|
5218
5223
|
});
|
|
5219
5224
|
}
|
|
5220
5225
|
}
|
|
5221
|
-
return ne(loadAgent), (t, n) => (k(), h("div",
|
|
5226
|
+
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 ? ie(t.$slots, "default", {
|
|
5222
5227
|
sdk: oe(o),
|
|
5223
5228
|
agent: c.value,
|
|
5224
5229
|
context: e.clientContext ?? e.context,
|
|
@@ -5226,7 +5231,7 @@ var Cr = [
|
|
|
5226
5231
|
buttonText: e.buttonText,
|
|
5227
5232
|
buttonIcon: e.buttonIcon,
|
|
5228
5233
|
loading: s.value
|
|
5229
|
-
}, void 0, void 0, 1) : u.value ? (k(), h("div",
|
|
5234
|
+
}, 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", {
|
|
5230
5235
|
type: "button",
|
|
5231
5236
|
class: "min-h-11 rounded-full bg-theme-900 px-5 text-sm font-semibold text-theme-0 transition-colors hover:bg-theme-700",
|
|
5232
5237
|
"data-test": "agent-unavailable-retry",
|
|
@@ -5235,6 +5240,6 @@ var Cr = [
|
|
|
5235
5240
|
}
|
|
5236
5241
|
});
|
|
5237
5242
|
//#endregion
|
|
5238
|
-
export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d, he as f, Pe as i, handleImageError as l, pe as m,
|
|
5243
|
+
export { Oe as a, getAgentAvatarUrl as c, AgentChatController as d, he as f, Pe as i, handleImageError as l, pe as m, na as n, Ee as o, n as p, $r as r, we as s, oa as t, parseButtonTemplate as u };
|
|
5239
5244
|
|
|
5240
5245
|
//# sourceMappingURL=AgentWrap.js.map
|