@burdenoff/website-sdk 2026.829.8 → 2026.830.1

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.
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-BzXCz2UM.mjs';
1
+ export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-B8xKGid5.mjs';
2
2
 
3
3
  interface UseSpeechInputOptions {
4
4
  /** Receives settled text as it is recognised. Append it to the draft. */
@@ -1,4 +1,4 @@
1
- export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-BzXCz2UM.js';
1
+ export { D as DEFAULT_EXPLORE_EXAMPLE_PROMPTS, E as ExploreChatError, a as ExploreChatErrorKind, b as ExploreChatPhase, F as FALLBACK_EXPLORE_LIMITS, U as UseExploreChatOptions, c as UseExploreChatResult, d as classifyExploreError, u as useExploreChat } from '../use-explore-chat-B8xKGid5.js';
2
2
 
3
3
  interface UseSpeechInputOptions {
4
4
  /** Receives settled text as it is recognised. Append it to the draft. */
@@ -622,7 +622,7 @@ var DEFAULT_EXPLORE_EXAMPLE_PROMPTS = [
622
622
  ];
623
623
  var FALLBACK_WELCOME_TITLE = "Ask anything about our products";
624
624
  var FALLBACK_WELCOME_BODY = "Get straight answers drawn from our product documentation and public pages \u2014 with links back to the exact page each answer came from.";
625
- function buildFallbackCatalog(examplePrompts) {
625
+ function buildFallbackCatalog(examplePrompts, welcome) {
626
626
  return {
627
627
  enabled: true,
628
628
  products: ECOSYSTEM_PRODUCTS.map((p) => ({
@@ -632,8 +632,8 @@ function buildFallbackCatalog(examplePrompts) {
632
632
  website: p.websiteUrl
633
633
  })),
634
634
  examplePrompts: examplePrompts?.length ? examplePrompts : DEFAULT_EXPLORE_EXAMPLE_PROMPTS,
635
- welcomeTitle: FALLBACK_WELCOME_TITLE,
636
- welcomeBody: FALLBACK_WELCOME_BODY,
635
+ welcomeTitle: welcome?.title ?? FALLBACK_WELCOME_TITLE,
636
+ welcomeBody: welcome?.body ?? FALLBACK_WELCOME_BODY,
637
637
  limits: FALLBACK_EXPLORE_LIMITS,
638
638
  captchaRequired: false,
639
639
  recaptchaSiteKey: null
@@ -693,7 +693,15 @@ function classifyExploreError(code, serverMessage) {
693
693
  retryable: true
694
694
  };
695
695
  }
696
- if (c === "TIMEOUT" || c === "TOOL_BUDGET") {
696
+ if (c === "TOOL_BUDGET") {
697
+ return {
698
+ kind: "scope",
699
+ code: c,
700
+ message: "That question spans more of our products than I can look through in one go. Try asking about two or three specific products.",
701
+ retryable: false
702
+ };
703
+ }
704
+ if (c === "TIMEOUT") {
697
705
  return {
698
706
  kind: "timeout",
699
707
  code: c,
@@ -825,6 +833,7 @@ function useExploreChat(options = {}) {
825
833
  pageUrl,
826
834
  locale,
827
835
  examplePrompts,
836
+ fallbackWelcome,
828
837
  pollIntervalMs = DEFAULT_POLL_INTERVAL_MS,
829
838
  pollTimeoutMs = DEFAULT_POLL_TIMEOUT_MS,
830
839
  storageKey = DEFAULT_STORAGE_KEY,
@@ -833,9 +842,13 @@ function useExploreChat(options = {}) {
833
842
  } = options;
834
843
  const client = useWebSDK();
835
844
  const promptKey = JSON.stringify(examplePrompts ?? []);
845
+ const welcomeKey = JSON.stringify(fallbackWelcome ?? null);
836
846
  const fallbackCatalog = react.useMemo(
837
- () => buildFallbackCatalog(JSON.parse(promptKey)),
838
- [promptKey]
847
+ () => buildFallbackCatalog(
848
+ JSON.parse(promptKey),
849
+ JSON.parse(welcomeKey) ?? void 0
850
+ ),
851
+ [promptKey, welcomeKey]
839
852
  );
840
853
  const [catalog, setCatalog] = react.useState(fallbackCatalog);
841
854
  const [messages, setMessages] = react.useState([]);