@webless/agent 0.10.2 → 0.10.4

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.
@@ -4284,6 +4284,7 @@ function joinLabels(labels) {
4284
4284
  if (labels.length === 2) return `${labels[0]} and ${labels[1]}`;
4285
4285
  return `${labels.slice(0, -1).join(", ")} and ${labels.at(-1) ?? ""}`;
4286
4286
  }
4287
+ var AGENT_SOFT_REVIEW_STATUS = "Reviewing your details to find the best approach";
4287
4288
  function workSummary(steps, failed, brandLabel) {
4288
4289
  const activeTool = [...steps].reverse().find(
4289
4290
  (step) => step.kind === "tool" && step.state === "active"
@@ -4298,7 +4299,7 @@ function workSummary(steps, failed, brandLabel) {
4298
4299
  )}`;
4299
4300
  const active = [...steps].reverse().find((step) => step.state === "active");
4300
4301
  if (active?.kind === "search") return "Searching this site";
4301
- if (active) return "Reviewing your details to find the best approach";
4302
+ if (active) return AGENT_SOFT_REVIEW_STATUS;
4302
4303
  if (failed) return "Couldn\u2019t complete this request";
4303
4304
  const hasError = steps.some((step) => step.state === "error");
4304
4305
  const specialists = steps.filter(
@@ -4392,23 +4393,32 @@ function AgentActivityBubble({
4392
4393
  onRetryStep
4393
4394
  }) {
4394
4395
  const active = steps.some((step) => step.state === "active");
4396
+ const statusText = workSummary(steps, failed, brandLabel);
4397
+ const softReview = statusText === AGENT_SOFT_REVIEW_STATUS;
4395
4398
  const receiptId = steps.map((step) => step.id).join(":");
4396
4399
  const [expandedReceiptId, setExpandedReceiptId] = useState3(
4397
4400
  null
4398
4401
  );
4399
4402
  const detailsOpen = !active && expandedReceiptId === receiptId;
4400
4403
  return /* @__PURE__ */ jsxs2("article", { className: "agent-activity-bubble", children: [
4401
- /* @__PURE__ */ jsxs2("p", { className: "agent-activity-bubble__status", "aria-live": "polite", children: [
4402
- /* @__PURE__ */ jsx2(
4403
- "span",
4404
- {
4405
- className: `agent-activity-bubble__pulse${active ? " is-active" : failed ? " is-error" : ""}`,
4406
- "aria-hidden": "true"
4407
- }
4408
- ),
4409
- workSummary(steps, failed, brandLabel),
4410
- active ? "..." : ""
4411
- ] }),
4404
+ /* @__PURE__ */ jsxs2(
4405
+ "p",
4406
+ {
4407
+ className: `agent-activity-bubble__status${softReview ? " agent-activity-bubble__status--soft" : ""}`,
4408
+ "aria-live": "polite",
4409
+ children: [
4410
+ /* @__PURE__ */ jsx2(
4411
+ "span",
4412
+ {
4413
+ className: `agent-activity-bubble__pulse${active ? " is-active" : failed ? " is-error" : ""}`,
4414
+ "aria-hidden": "true"
4415
+ }
4416
+ ),
4417
+ statusText,
4418
+ active ? "..." : ""
4419
+ ]
4420
+ }
4421
+ ),
4412
4422
  !active ? /* @__PURE__ */ jsxs2("div", { className: "agent-activity-bubble__details", children: [
4413
4423
  /* @__PURE__ */ jsx2(
4414
4424
  "button",
@@ -4623,7 +4633,6 @@ function Composer({
4623
4633
  if (form && form.id !== draft.form?.id) setDraft(createDraft(form));
4624
4634
  const savedForm = allowFormResume && !draft.submitted ? draft.form : null;
4625
4635
  const activeForm = !disabled && draft.expanded ? savedForm : null;
4626
- const hasDraft = Object.values(draft.values).some((value2) => value2.trim());
4627
4636
  const canSend = !disabled && Boolean(value.trim() || activeForm);
4628
4637
  useEffect4(() => {
4629
4638
  if (activeForm) firstFieldRef.current?.focus();
@@ -4739,14 +4748,14 @@ function Composer({
4739
4748
  onSubmit: handleSubmit,
4740
4749
  children: [
4741
4750
  savedForm ? /* @__PURE__ */ jsxs4("div", { className: "composer__resume", children: [
4742
- /* @__PURE__ */ jsx4("span", { children: hasDraft ? "Your details aren\u2019t shared yet" : "Share your details so we can follow up" }),
4751
+ /* @__PURE__ */ jsx4("span", { children: "Share your details and we'll reach out shortly" }),
4743
4752
  !activeForm ? /* @__PURE__ */ jsx4(
4744
4753
  "button",
4745
4754
  {
4746
4755
  type: "button",
4747
4756
  disabled,
4748
4757
  onClick: () => setDraft((current) => ({ ...current, expanded: true })),
4749
- children: hasDraft ? "Resume details" : "Add details"
4758
+ children: "Request follow-up"
4750
4759
  }
4751
4760
  ) : null
4752
4761
  ] }) : null,
@@ -6949,7 +6958,11 @@ function AssistEdgeTab({
6949
6958
  ...brandForeground ? { "--as-visitor-text": brandForeground } : {},
6950
6959
  ...resolvedBorderColor ? { "--as-border": resolvedBorderColor } : {},
6951
6960
  ...fontFamily ? { "--as-font-display": fontFamily } : {},
6952
- ...pill ? { "--as-surface": "#ffffff", "--as-text": "#171717" } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
6961
+ ...pill ? {
6962
+ "--as-surface": "#ffffff",
6963
+ "--as-text": "#171717",
6964
+ backgroundColor: "#ffffff"
6965
+ } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
6953
6966
  ...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
6954
6967
  colorScheme: chromeScheme
6955
6968
  };
@@ -6966,23 +6979,19 @@ function AssistEdgeTab({
6966
6979
  onClick: onOpen,
6967
6980
  children: [
6968
6981
  pill ? /* @__PURE__ */ jsxs17(Fragment5, { children: [
6969
- /* @__PURE__ */ jsxs17(
6982
+ /* @__PURE__ */ jsx18(
6970
6983
  "span",
6971
6984
  {
6972
6985
  className: `assist-edge-tab__mark assist-edge-tab__mark--chip${mobile ? " assist-edge-tab__mark--mobile" : ""}`,
6973
6986
  "aria-hidden": "true",
6974
- children: [
6975
- /* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--light" }),
6976
- /* @__PURE__ */ jsx18("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--cool" }),
6977
- /* @__PURE__ */ jsx18(
6978
- TabMarkIcon,
6979
- {
6980
- customIconUrl,
6981
- logoUrl
6982
- },
6983
- markSourceKey
6984
- )
6985
- ]
6987
+ children: /* @__PURE__ */ jsx18(
6988
+ TabMarkIcon,
6989
+ {
6990
+ customIconUrl,
6991
+ logoUrl
6992
+ },
6993
+ markSourceKey
6994
+ )
6986
6995
  }
6987
6996
  ),
6988
6997
  /* @__PURE__ */ jsxs17("span", { className: "assist-edge-tab__text", children: [
@@ -7432,4 +7441,4 @@ export {
7432
7441
  sendAgentAnswerFeedback,
7433
7442
  AgentWidget
7434
7443
  };
7435
- //# sourceMappingURL=chunk-Q7H4RRS4.js.map
7444
+ //# sourceMappingURL=chunk-74CSWSC5.js.map