@webless/agent 0.10.2 → 0.10.3

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/embed.cjs CHANGED
@@ -3790,6 +3790,7 @@ function joinLabels(labels) {
3790
3790
  if (labels.length === 2) return `${labels[0]} and ${labels[1]}`;
3791
3791
  return `${labels.slice(0, -1).join(", ")} and ${labels.at(-1) ?? ""}`;
3792
3792
  }
3793
+ var AGENT_SOFT_REVIEW_STATUS = "Reviewing your details to find the best approach";
3793
3794
  function workSummary(steps, failed, brandLabel) {
3794
3795
  const activeTool = [...steps].reverse().find(
3795
3796
  (step) => step.kind === "tool" && step.state === "active"
@@ -3804,7 +3805,7 @@ function workSummary(steps, failed, brandLabel) {
3804
3805
  )}`;
3805
3806
  const active = [...steps].reverse().find((step) => step.state === "active");
3806
3807
  if (active?.kind === "search") return "Searching this site";
3807
- if (active) return "Reviewing your details to find the best approach";
3808
+ if (active) return AGENT_SOFT_REVIEW_STATUS;
3808
3809
  if (failed) return "Couldn\u2019t complete this request";
3809
3810
  const hasError = steps.some((step) => step.state === "error");
3810
3811
  const specialists = steps.filter(
@@ -3898,23 +3899,32 @@ function AgentActivityBubble({
3898
3899
  onRetryStep
3899
3900
  }) {
3900
3901
  const active = steps.some((step) => step.state === "active");
3902
+ const statusText = workSummary(steps, failed, brandLabel);
3903
+ const softReview = statusText === AGENT_SOFT_REVIEW_STATUS;
3901
3904
  const receiptId = steps.map((step) => step.id).join(":");
3902
3905
  const [expandedReceiptId, setExpandedReceiptId] = (0, import_react5.useState)(
3903
3906
  null
3904
3907
  );
3905
3908
  const detailsOpen = !active && expandedReceiptId === receiptId;
3906
3909
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { className: "agent-activity-bubble", children: [
3907
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "agent-activity-bubble__status", "aria-live": "polite", children: [
3908
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3909
- "span",
3910
- {
3911
- className: `agent-activity-bubble__pulse${active ? " is-active" : failed ? " is-error" : ""}`,
3912
- "aria-hidden": "true"
3913
- }
3914
- ),
3915
- workSummary(steps, failed, brandLabel),
3916
- active ? "..." : ""
3917
- ] }),
3910
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
3911
+ "p",
3912
+ {
3913
+ className: `agent-activity-bubble__status${softReview ? " agent-activity-bubble__status--soft" : ""}`,
3914
+ "aria-live": "polite",
3915
+ children: [
3916
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3917
+ "span",
3918
+ {
3919
+ className: `agent-activity-bubble__pulse${active ? " is-active" : failed ? " is-error" : ""}`,
3920
+ "aria-hidden": "true"
3921
+ }
3922
+ ),
3923
+ statusText,
3924
+ active ? "..." : ""
3925
+ ]
3926
+ }
3927
+ ),
3918
3928
  !active ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "agent-activity-bubble__details", children: [
3919
3929
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3920
3930
  "button",
@@ -4136,7 +4146,6 @@ function Composer({
4136
4146
  if (form && form.id !== draft.form?.id) setDraft(createDraft(form));
4137
4147
  const savedForm = allowFormResume && !draft.submitted ? draft.form : null;
4138
4148
  const activeForm = !disabled && draft.expanded ? savedForm : null;
4139
- const hasDraft = Object.values(draft.values).some((value2) => value2.trim());
4140
4149
  const canSend = !disabled && Boolean(value.trim() || activeForm);
4141
4150
  (0, import_react8.useEffect)(() => {
4142
4151
  if (activeForm) firstFieldRef.current?.focus();
@@ -4252,14 +4261,14 @@ function Composer({
4252
4261
  onSubmit: handleSubmit,
4253
4262
  children: [
4254
4263
  savedForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "composer__resume", children: [
4255
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: hasDraft ? "Your details aren\u2019t shared yet" : "Share your details so we can follow up" }),
4264
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { children: "Share your details and we'll reach out shortly" }),
4256
4265
  !activeForm ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
4257
4266
  "button",
4258
4267
  {
4259
4268
  type: "button",
4260
4269
  disabled,
4261
4270
  onClick: () => setDraft((current) => ({ ...current, expanded: true })),
4262
- children: hasDraft ? "Resume details" : "Add details"
4271
+ children: "Request follow-up"
4263
4272
  }
4264
4273
  ) : null
4265
4274
  ] }) : null,
@@ -7067,7 +7076,11 @@ function AssistEdgeTab({
7067
7076
  ...brandForeground ? { "--as-visitor-text": brandForeground } : {},
7068
7077
  ...resolvedBorderColor ? { "--as-border": resolvedBorderColor } : {},
7069
7078
  ...fontFamily ? { "--as-font-display": fontFamily } : {},
7070
- ...pill ? { "--as-surface": "#ffffff", "--as-text": "#171717" } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
7079
+ ...pill ? {
7080
+ "--as-surface": "#ffffff",
7081
+ "--as-text": "#171717",
7082
+ backgroundColor: "#ffffff"
7083
+ } : resolvedSurfaceColor ? { "--as-surface": resolvedSurfaceColor } : {},
7071
7084
  ...!pill && resolvedTextColor ? { "--as-text": resolvedTextColor } : {},
7072
7085
  colorScheme: chromeScheme
7073
7086
  };
@@ -7084,23 +7097,19 @@ function AssistEdgeTab({
7084
7097
  onClick: onOpen,
7085
7098
  children: [
7086
7099
  pill ? /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
7087
- /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
7100
+ /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7088
7101
  "span",
7089
7102
  {
7090
7103
  className: `assist-edge-tab__mark assist-edge-tab__mark--chip${mobile ? " assist-edge-tab__mark--mobile" : ""}`,
7091
7104
  "aria-hidden": "true",
7092
- children: [
7093
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--light" }),
7094
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "assist-edge-tab__wash assist-edge-tab__wash--cool" }),
7095
- /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7096
- TabMarkIcon,
7097
- {
7098
- customIconUrl,
7099
- logoUrl
7100
- },
7101
- markSourceKey
7102
- )
7103
- ]
7105
+ children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
7106
+ TabMarkIcon,
7107
+ {
7108
+ customIconUrl,
7109
+ logoUrl
7110
+ },
7111
+ markSourceKey
7112
+ )
7104
7113
  }
7105
7114
  ),
7106
7115
  /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("span", { className: "assist-edge-tab__text", children: [