@webless/agent 0.6.1 → 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
@@ -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
  }