@pagelines/sdk 1.0.703 → 1.0.705

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
@@ -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(() => !this.textState.value.sendBlockedReason && !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({
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 = `${this.chatUnavailableReason ?? "Your assistant is unavailable"}. Give it a moment and send again.`, t = this.sharedMessages.value[this.sharedMessages.value.length - 1];
516
- t?.sender === "system" && t.text === e || this.addMessage(e, "system");
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) 8%, 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)");
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",
@@ -4677,7 +4677,7 @@ var Cr = [
4677
4677
  if (!x.value) return;
4678
4678
  let e = B.value, t = e[e.length - 1];
4679
4679
  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 !== void 0), 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" : Se.value === "account" ? "Open billing to keep chatting" : `Message ${e.agent.displayName.value || e.agent.name.value || "assistant"}`), we = f(() => e.chatController?.composerState?.value ?? {
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 === "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
4681
  text: "",
4682
4682
  pendingAttachments: [],
4683
4683
  isUploading: !1
@@ -4777,7 +4777,7 @@ var Cr = [
4777
4777
  ref: i,
4778
4778
  class: C(B.value.length === 0 ? "flex-none" : "flex-1")
4779
4779
  }, {
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" : ""]) }, [
4780
+ 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" : ""]) }, [
4781
4781
  B.value.length === 0 && !te.value ? (k(), h("div", ci, [ie(t.$slots, "empty-heading", {
4782
4782
  agent: e.agent,
4783
4783
  isLight: G.value
@@ -4818,7 +4818,7 @@ var Cr = [
4818
4818
  "data-issue-action-url": e.issue?.actionUrl,
4819
4819
  "data-streaming": e.id === be.value ? "true" : void 0,
4820
4820
  class: "flex gap-2 items-end justify-start mb-4"
4821
- }, [_("div", pi, [_("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-100 text-theme-700" : "bg-white/[0.08] border-white/10 text-white/85"]) }, [e.text ? (k(), p($r, {
4821
+ }, [_("div", pi, [_("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
4822
  key: 0,
4823
4823
  text: e.text,
4824
4824
  inverted: !G.value,