@pagelines/sdk 1.0.778 → 1.0.779
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 +21 -14
- package/dist/AgentWrap.js.map +1 -1
- package/dist/agent/AgentController.d.ts +11 -0
- package/dist/contract.js +792 -781
- package/dist/contract.js.map +1 -1
- package/dist/sdkClient.d.ts +3 -3
- package/dist/widget.js +1 -1
- package/dist/widget.js.map +1 -1
- package/package.json +1 -1
package/dist/AgentWrap.js
CHANGED
|
@@ -541,8 +541,15 @@ var AgentChatController = class extends i {
|
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
543
|
addOfflineSystemReply() {
|
|
544
|
-
let e = this._agent.displayName.value || "Your assistant", t = this.
|
|
545
|
-
|
|
544
|
+
let e = this._agent.displayName.value || "Your assistant", t = this._agent.state.value.blocker;
|
|
545
|
+
if (t) {
|
|
546
|
+
let e = t.actionUrl.startsWith("pagelines://") ? this.settings.billingUrl : t.actionUrl, n = [`${t.title}.${t.help ? ` ${t.help}` : ""}`, t.actionLabel && e ? `[${t.actionLabel}](${e})` : t.actionLabel || ""].filter(Boolean).join(" "), r = this.sharedMessages.value[this.sharedMessages.value.length - 1];
|
|
547
|
+
if (r?.sender === "system" && r.text === n) return;
|
|
548
|
+
this.addMessage(n, "system");
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
let n = this.chatUnavailableReason ?? `${e} is unavailable`, r = this._agent.state.value.lifecycle === "stopped" || this._agent.desiredStatus.value !== "active", i = this.settings.manageUrl, a = r ? i ? `${n}, so your message can't be answered yet. [Wake ${e}](${i}), then send again.` : `${n}, so your message can't be answered yet. Wake it from the dashboard, then send again.` : `${n}. Give it a moment and send again.`, o = this.sharedMessages.value[this.sharedMessages.value.length - 1];
|
|
552
|
+
o?.sender === "system" && o.text === a || this.addMessage(a, "system");
|
|
546
553
|
}
|
|
547
554
|
async sendComposerMessage() {
|
|
548
555
|
if (!this.canSend.value) return;
|
|
@@ -4074,10 +4081,10 @@ var kr = [
|
|
|
4074
4081
|
return n[e % n.length];
|
|
4075
4082
|
}
|
|
4076
4083
|
function diagramNodeFill(e) {
|
|
4077
|
-
return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500)
|
|
4084
|
+
return t.inverted ? e === "decision" ? "rgba(255, 255, 255, 0.1)" : "rgba(255, 255, 255, 0.06)" : e === "decision" ? "color-mix(in oklch, var(--color-primary-500) 6%, var(--color-theme-0))" : e === "output" ? "color-mix(in oklch, var(--color-theme-900) 5%, var(--color-theme-0))" : "var(--color-theme-0)";
|
|
4078
4085
|
}
|
|
4079
4086
|
function diagramNodeStroke(e) {
|
|
4080
|
-
return
|
|
4087
|
+
return t.inverted ? "rgba(255, 255, 255, 0.22)" : be.value;
|
|
4081
4088
|
}
|
|
4082
4089
|
let _e = p(() => t.inverted ? "rgba(255, 255, 255, 0.95)" : "var(--color-theme-900)"), ve = p(() => t.inverted ? "rgba(255, 255, 255, 0.6)" : "var(--color-theme-500)"), U = p(() => t.inverted ? "rgba(255, 255, 255, 0.45)" : "color-mix(in oklch, var(--color-theme-900) 42%, transparent)"), ye = p(() => t.inverted ? "rgba(255, 255, 255, 0.1)" : "color-mix(in oklch, var(--color-theme-900) 8%, transparent)"), W = p(() => t.inverted ? "rgba(255, 255, 255, 0.24)" : "color-mix(in oklch, var(--color-theme-900) 18%, transparent)"), be = p(() => t.inverted ? "rgba(255, 255, 255, 0.16)" : "color-mix(in oklch, var(--color-theme-300) 55%, transparent)"), G = p(() => t.inverted ? "rgba(255, 255, 255, 0.14)" : "color-mix(in oklch, var(--color-theme-900) 10%, transparent)"), Se = p(() => t.inverted ? "transparent" : "var(--color-theme-0)"), Ce = p(() => t.inverted ? "rgba(255, 255, 255, 0.18)" : "color-mix(in oklch, var(--color-theme-900) 16%, transparent)"), we = p(() => t.inverted ? "rgba(255, 255, 255, 0.12)" : "color-mix(in oklch, var(--color-theme-900) 9%, transparent)");
|
|
4083
4090
|
return (e, r) => o.value ? (j(), _("section", {
|
|
@@ -4312,7 +4319,7 @@ var kr = [
|
|
|
4312
4319
|
key: 1,
|
|
4313
4320
|
width: e.width,
|
|
4314
4321
|
height: e.height,
|
|
4315
|
-
rx: "
|
|
4322
|
+
rx: "9",
|
|
4316
4323
|
"stroke-width": "1",
|
|
4317
4324
|
"vector-effect": "non-scaling-stroke",
|
|
4318
4325
|
style: k({
|
|
@@ -4325,7 +4332,7 @@ var kr = [
|
|
|
4325
4332
|
width: e.width - 16,
|
|
4326
4333
|
height: e.height - 10
|
|
4327
4334
|
}, [v("div", ni, [v("div", {
|
|
4328
|
-
class: "line-clamp-2 text-[13px] font-
|
|
4335
|
+
class: "line-clamp-2 text-[13px] font-medium leading-snug",
|
|
4329
4336
|
style: k({ color: _e.value })
|
|
4330
4337
|
}, I(e.label), 5), e.detail ? (j(), _("div", {
|
|
4331
4338
|
key: 0,
|
|
@@ -4512,7 +4519,7 @@ var kr = [
|
|
|
4512
4519
|
}) : [];
|
|
4513
4520
|
});
|
|
4514
4521
|
return (t, n) => (j(), _("div", {
|
|
4515
|
-
class: "chat-msg-rich break-words text-[14px] leading-
|
|
4522
|
+
class: "chat-msg-rich break-words text-[14px] leading-[1.55] @sm/chat:max-w-[55ch] @sm/chat:text-[15px] @sm/chat:leading-[1.5]",
|
|
4516
4523
|
onErrorCapture: onRichTextAssetError
|
|
4517
4524
|
}, [(j(!0), _(f, null, P(h.value, (t) => (j(), _(f, { key: t.key }, [t.kind === "markdown" ? (j(), _("div", {
|
|
4518
4525
|
key: 0,
|
|
@@ -5395,7 +5402,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5395
5402
|
onKeydown: handleKeydown
|
|
5396
5403
|
}, null, 42, ta)), [[oe, Te.value]]), v("div", ra, [
|
|
5397
5404
|
v("button", {
|
|
5398
|
-
class: T(["-ml-2 flex size-
|
|
5405
|
+
class: T(["-ml-2 flex size-8 items-center justify-center transition-opacity hover:opacity-70 pointer-coarse:size-11", [
|
|
5399
5406
|
Ae.value ? "cursor-pointer" : "cursor-default",
|
|
5400
5407
|
K.value ? "text-theme-500" : "text-white/50",
|
|
5401
5408
|
De.value || ke.value ? "opacity-50 pointer-events-none" : ""
|
|
@@ -5409,7 +5416,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5409
5416
|
v("div", ca, [(Re.value || Be.value) && !We.value ? (j(), _("button", {
|
|
5410
5417
|
key: 0,
|
|
5411
5418
|
"data-test": "messaging-record-audio-btn",
|
|
5412
|
-
class: T(["flex size-
|
|
5419
|
+
class: T(["flex size-8 cursor-pointer items-center justify-center transition-[opacity,transform] duration-200 hover:opacity-70 pointer-coarse:size-11", Be.value ? K.value ? "text-theme-900 scale-110" : "text-white scale-110" : K.value ? "text-theme-500" : "text-white/60"]),
|
|
5413
5420
|
"aria-label": Ue.value,
|
|
5414
5421
|
title: Ue.value,
|
|
5415
5422
|
onPointerdown: o[8] || (o[8] = de((e) => startRecording(), ["prevent"])),
|
|
@@ -5424,7 +5431,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5424
5431
|
}, [v("i", { class: T([Be.value ? "i-tabler-microphone-filled" : "i-tabler-microphone", "size-[18px]"]) }, null, 2), v("span", ua, I(Ue.value), 1)], 42, la)) : h("", !0), We.value && !Ze.value ? (j(), _("button", {
|
|
5425
5432
|
key: 1,
|
|
5426
5433
|
"data-test": "messaging-voice-end-btn",
|
|
5427
|
-
class: T(["flex size-
|
|
5434
|
+
class: T(["flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100"]),
|
|
5428
5435
|
"aria-label": "End voice conversation",
|
|
5429
5436
|
title: "End voice conversation",
|
|
5430
5437
|
onClick: o[16] || (o[16] = (e) => endVoiceConversation())
|
|
@@ -5434,7 +5441,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5434
5441
|
}, null, -1), v("span", { class: "sr-only" }, "End voice conversation", -1)])], 2)) : Ze.value ? (j(), _("button", {
|
|
5435
5442
|
key: 2,
|
|
5436
5443
|
"data-test": "messaging-voice-send-btn",
|
|
5437
|
-
class: T(["flex size-
|
|
5444
|
+
class: T(["flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100"]),
|
|
5438
5445
|
"aria-label": "Send to the call",
|
|
5439
5446
|
title: "Send to the call",
|
|
5440
5447
|
onClick: o[17] || (o[17] = (e) => sendVoiceUserMessage())
|
|
@@ -5444,7 +5451,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5444
5451
|
}, null, -1), v("span", { class: "sr-only" }, "Send to the call", -1)])], 2)) : qe.value ? (j(), _("button", {
|
|
5445
5452
|
key: 3,
|
|
5446
5453
|
"data-test": "messaging-voice-start-btn",
|
|
5447
|
-
class: T(["flex size-
|
|
5454
|
+
class: T(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", [K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800" : "bg-theme-0 text-theme-950 hover:bg-theme-100", Ye.value ? "cursor-not-allowed opacity-40" : "cursor-pointer"]]),
|
|
5448
5455
|
disabled: Ye.value,
|
|
5449
5456
|
"aria-label": Xe.value,
|
|
5450
5457
|
title: Xe.value,
|
|
@@ -5462,7 +5469,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5462
5469
|
}, null, 4)), 64))]), o[33] || (o[33] = v("span", { class: "sr-only" }, "Start voice conversation", -1))], 10, da)) : Be.value ? h("", !0) : (j(), _(f, { key: 4 }, [Fe.value ? (j(), _("button", {
|
|
5463
5470
|
key: 0,
|
|
5464
5471
|
"data-test": "messaging-secondary-stop-btn",
|
|
5465
|
-
class: T(["mr-2 flex size-
|
|
5472
|
+
class: T(["mr-2 flex size-8 cursor-pointer items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", K.value ? "bg-theme-100 text-theme-700 hover:bg-theme-200" : "bg-white/10 text-white/70 hover:bg-white/15"]),
|
|
5466
5473
|
"aria-label": "Stop work",
|
|
5467
5474
|
title: "Stop work",
|
|
5468
5475
|
onClick: o[19] || (o[19] = (t) => e.chatController?.stopChatTurn())
|
|
@@ -5472,7 +5479,7 @@ var di = ["data-voice-state", "data-voice-activity"], fi = { class: "flex flex-1
|
|
|
5472
5479
|
}, null, -1), v("span", { class: "sr-only" }, "Stop work", -1)])], 2)) : h("", !0), v("button", {
|
|
5473
5480
|
"data-test": "messaging-send-btn",
|
|
5474
5481
|
"data-composer-action": Me.value,
|
|
5475
|
-
class: T(["flex size-
|
|
5482
|
+
class: T(["flex size-8 items-center justify-center rounded-full transition-colors duration-150 pointer-coarse:size-11", Ne.value ? K.value ? "bg-theme-900 text-theme-0 hover:bg-theme-800 cursor-pointer" : "bg-theme-0 text-theme-950 hover:bg-theme-100 cursor-pointer" : K.value ? "bg-theme-100 text-theme-400" : "bg-white/10 text-white/30"]),
|
|
5476
5483
|
disabled: !Ne.value,
|
|
5477
5484
|
"aria-label": Le.value,
|
|
5478
5485
|
title: Le.value,
|