@webless/agent 0.6.0 → 0.6.2

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
@@ -1802,7 +1802,7 @@ function workSummary(steps, failed, brandLabel) {
1802
1802
  return "Answer ready";
1803
1803
  }
1804
1804
  function stepLabel(step, brandLabel) {
1805
- return step.kind === "planning" ? brandLabel || "Supervisor" : step.label;
1805
+ return step.kind === "planning" ? brandLabel : step.label;
1806
1806
  }
1807
1807
  function stepDetail(step, steps) {
1808
1808
  if (step.kind !== "planning" || step.state !== "completed") {
@@ -1810,11 +1810,11 @@ function stepDetail(step, steps) {
1810
1810
  }
1811
1811
  const specialists = steps.filter((item) => item.kind === "specialist");
1812
1812
  if (specialists.length === 1)
1813
- return `Routed your question to ${specialists[0]?.label}`;
1813
+ return `Brought in ${specialists[0]?.label}`;
1814
1814
  if (specialists.length > 1)
1815
- return `Routed your question to ${specialists.length} specialists`;
1815
+ return `Brought in ${specialists.length} specialists`;
1816
1816
  if (steps.some((item) => item.kind === "search"))
1817
- return "Used built-in Search & Discovery";
1817
+ return "Searched this site";
1818
1818
  return step.detail;
1819
1819
  }
1820
1820
  function SearchIcon() {
@@ -1854,6 +1854,9 @@ function AgentActivityBubble({
1854
1854
  null
1855
1855
  );
1856
1856
  const detailsOpen = active || expandedReceiptId === receiptId;
1857
+ const visibleSteps = steps.filter(
1858
+ (step) => step.kind !== "planning" || Boolean(brandLabel)
1859
+ );
1857
1860
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", { className: "agent-activity-bubble", children: [
1858
1861
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: "agent-activity-bubble__status", "aria-live": "polite", children: [
1859
1862
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -1881,7 +1884,7 @@ function AgentActivityBubble({
1881
1884
  children: "How this answer was made"
1882
1885
  }
1883
1886
  ),
1884
- detailsOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "agent-activity-bubble__steps", children: steps.map((step) => {
1887
+ detailsOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { className: "agent-activity-bubble__steps", children: visibleSteps.map((step) => {
1885
1888
  const detail = stepDetail(step, steps);
1886
1889
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
1887
1890
  "li",
@@ -1911,10 +1914,7 @@ function AgentActivityBubble({
1911
1914
  }
1912
1915
  ),
1913
1916
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "agent-activity-bubble__step-copy", children: [
1914
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "agent-activity-bubble__step-heading", children: [
1915
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: stepLabel(step, brandLabel) }),
1916
- step.kind === "planning" && !brandLabel ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("small", { children: step.kind === "specialist" ? "Specialist" : step.kind === "search" ? "Built-in capability" : "Supervisor" })
1917
- ] }),
1917
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "agent-activity-bubble__step-heading", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("strong", { children: stepLabel(step, brandLabel) }) }),
1918
1918
  detail ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "agent-activity-bubble__step-detail", children: detail }) : null
1919
1919
  ] })
1920
1920
  ]
@@ -2878,6 +2878,7 @@ function AgentWidget({
2878
2878
  defaultCollapsed = true,
2879
2879
  pageShift = true,
2880
2880
  registerPanelController = false,
2881
+ colorScheme = "auto",
2881
2882
  branding
2882
2883
  }) {
2883
2884
  const isMobile = useIsMobile();
@@ -2988,6 +2989,7 @@ function AgentWidget({
2988
2989
  AgentRail,
2989
2990
  {
2990
2991
  theme,
2992
+ colorScheme,
2991
2993
  brandLabel: agentName,
2992
2994
  brandLogoUrl: branding?.logoUrl,
2993
2995
  composerPlaceholder: branding?.composerPlaceholder ?? "Ask a question\u2026",
@@ -3027,6 +3029,7 @@ function AgentWidget({
3027
3029
  mobile: isMobile,
3028
3030
  surfaceColor: branding?.colors?.surface,
3029
3031
  textColor: branding?.colors?.text,
3032
+ colorScheme,
3030
3033
  onOpen: () => setRailCollapsed(false)
3031
3034
  }
3032
3035
  ) : null
@@ -3062,6 +3065,7 @@ function AgentWidget2({
3062
3065
  previewBuildId: manifest.version === "unpublished" ? readUnpublishedPreviewBuildId() : void 0,
3063
3066
  placement: manifest.placement,
3064
3067
  pageShift: manifest.pageShift,
3068
+ colorScheme: manifest.colorScheme,
3065
3069
  branding: manifest.branding,
3066
3070
  defaultCollapsed,
3067
3071
  registerPanelController: true
@@ -3083,6 +3087,10 @@ function normalizeAgentTagManifest(manifest) {
3083
3087
  if (version !== "published" && version !== "unpublished") {
3084
3088
  throw new Error("Agent manifest version must be published or unpublished.");
3085
3089
  }
3090
+ const colorScheme = manifest.colorScheme ?? "auto";
3091
+ if (colorScheme !== "auto" && colorScheme !== "light" && colorScheme !== "dark") {
3092
+ throw new Error("Agent manifest colorScheme must be auto, light, or dark.");
3093
+ }
3086
3094
  const runtime = resolveAgentRuntimeConfig({
3087
3095
  indexId,
3088
3096
  version,
@@ -3100,6 +3108,7 @@ function normalizeAgentTagManifest(manifest) {
3100
3108
  },
3101
3109
  placement: normalizeAgentPlacement(manifest.placement),
3102
3110
  pageShift: manifest.pageShift ?? true,
3111
+ colorScheme,
3103
3112
  ...branding ? { branding } : {}
3104
3113
  };
3105
3114
  }