@burtson-labs/bandit-engine 2.0.149 → 2.0.151

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.
Files changed (42) hide show
  1. package/dist/{aiProviderStore-FTD277QP.mjs → aiProviderStore-ZQ5VVVKQ.mjs} +2 -2
  2. package/dist/chat-3HV3GM5P.mjs +16 -0
  3. package/dist/chat-provider.js +5 -2
  4. package/dist/chat-provider.js.map +1 -1
  5. package/dist/chat-provider.mjs +5 -5
  6. package/dist/{chunk-P5IJLX6I.mjs → chunk-6STVJJSG.mjs} +4 -2
  7. package/dist/chunk-6STVJJSG.mjs.map +1 -0
  8. package/dist/{chunk-K2JGFKEB.mjs → chunk-CVFFNX7H.mjs} +2 -2
  9. package/dist/{chunk-JQSZNGII.mjs → chunk-DSYE5AHW.mjs} +9 -9
  10. package/dist/{chunk-43MLINPL.mjs → chunk-GWQRTUKF.mjs} +6 -3
  11. package/dist/chunk-GWQRTUKF.mjs.map +1 -0
  12. package/dist/{chunk-PU74BI6Y.mjs → chunk-QLATFSSO.mjs} +5 -5
  13. package/dist/{chunk-F7JXIW6T.mjs → chunk-RRCCSN3N.mjs} +2 -2
  14. package/dist/{chunk-F735W34E.mjs → chunk-TYRYAAP2.mjs} +38 -3
  15. package/dist/chunk-TYRYAAP2.mjs.map +1 -0
  16. package/dist/{chunk-K6IV4LYZ.mjs → chunk-U33KBX3Y.mjs} +4 -4
  17. package/dist/{chunk-NLBZZP3B.mjs → chunk-VLUXQE24.mjs} +3 -3
  18. package/dist/{chunk-ANX33XAO.mjs → chunk-ZRJYLJKZ.mjs} +65 -22
  19. package/dist/chunk-ZRJYLJKZ.mjs.map +1 -0
  20. package/dist/index.js +142 -52
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +10 -10
  23. package/dist/management/management.js +136 -46
  24. package/dist/management/management.js.map +1 -1
  25. package/dist/management/management.mjs +8 -8
  26. package/dist/modals/chat-modal/chat-modal.js +40 -2
  27. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  28. package/dist/modals/chat-modal/chat-modal.mjs +4 -4
  29. package/package.json +1 -1
  30. package/dist/chat-Z4SQGSMN.mjs +0 -16
  31. package/dist/chunk-43MLINPL.mjs.map +0 -1
  32. package/dist/chunk-ANX33XAO.mjs.map +0 -1
  33. package/dist/chunk-F735W34E.mjs.map +0 -1
  34. package/dist/chunk-P5IJLX6I.mjs.map +0 -1
  35. /package/dist/{aiProviderStore-FTD277QP.mjs.map → aiProviderStore-ZQ5VVVKQ.mjs.map} +0 -0
  36. /package/dist/{chat-Z4SQGSMN.mjs.map → chat-3HV3GM5P.mjs.map} +0 -0
  37. /package/dist/{chunk-K2JGFKEB.mjs.map → chunk-CVFFNX7H.mjs.map} +0 -0
  38. /package/dist/{chunk-JQSZNGII.mjs.map → chunk-DSYE5AHW.mjs.map} +0 -0
  39. /package/dist/{chunk-PU74BI6Y.mjs.map → chunk-QLATFSSO.mjs.map} +0 -0
  40. /package/dist/{chunk-F7JXIW6T.mjs.map → chunk-RRCCSN3N.mjs.map} +0 -0
  41. /package/dist/{chunk-K6IV4LYZ.mjs.map → chunk-U33KBX3Y.mjs.map} +0 -0
  42. /package/dist/{chunk-NLBZZP3B.mjs.map → chunk-VLUXQE24.mjs.map} +0 -0
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  management_default
3
- } from "../chunk-JQSZNGII.mjs";
4
- import "../chunk-P5IJLX6I.mjs";
5
- import "../chunk-F7JXIW6T.mjs";
6
- import "../chunk-K2JGFKEB.mjs";
7
- import "../chunk-K6IV4LYZ.mjs";
8
- import "../chunk-F735W34E.mjs";
9
- import "../chunk-NLBZZP3B.mjs";
3
+ } from "../chunk-DSYE5AHW.mjs";
4
+ import "../chunk-6STVJJSG.mjs";
5
+ import "../chunk-RRCCSN3N.mjs";
6
+ import "../chunk-CVFFNX7H.mjs";
7
+ import "../chunk-U33KBX3Y.mjs";
8
+ import "../chunk-TYRYAAP2.mjs";
9
+ import "../chunk-VLUXQE24.mjs";
10
10
  import "../chunk-EORIRPPX.mjs";
11
- import "../chunk-43MLINPL.mjs";
11
+ import "../chunk-GWQRTUKF.mjs";
12
12
  import "../chunk-KCI46M23.mjs";
13
13
  import "../chunk-BJTO5JO5.mjs";
14
14
  export {
@@ -1601,8 +1601,11 @@ var init_gateway_service = __esm({
1601
1601
  return;
1602
1602
  }
1603
1603
  const data = error.response?.data;
1604
- const code = data?.code;
1605
- if (code !== "FORCE_RELOGIN" && code !== "ACCOUNT_LOCKED") {
1604
+ let code = data?.code;
1605
+ if (status === 401 && !code) {
1606
+ code = "TOKEN_EXPIRED";
1607
+ }
1608
+ if (code !== "FORCE_RELOGIN" && code !== "ACCOUNT_LOCKED" && code !== "TOKEN_EXPIRED") {
1606
1609
  return;
1607
1610
  }
1608
1611
  try {
@@ -11603,6 +11606,40 @@ var import_rehype_sanitize2 = __toESM(require("rehype-sanitize"));
11603
11606
  init_debugLogger();
11604
11607
  var import_material8 = require("@mui/material");
11605
11608
 
11609
+ // src/utils/openFileLink.ts
11610
+ init_debugLogger();
11611
+ var FILE_EXT_RE = /\.(docx|pptx|xlsx|csv|json|md|txt|html|xml|ya?ml|pdf|zip)(?:[?#]|$)/i;
11612
+ var isStandalonePwa = () => typeof window !== "undefined" && (window.matchMedia?.("(display-mode: standalone)").matches || window.navigator.standalone === true);
11613
+ var isFileLink = (href) => Boolean(href && FILE_EXT_RE.test(href));
11614
+ var maybeHandleFileLinkClick = (event, href) => {
11615
+ if (!href || !isStandalonePwa() || !isFileLink(href)) return;
11616
+ event.preventDefault();
11617
+ void (async () => {
11618
+ try {
11619
+ const res = await fetch(href);
11620
+ if (!res.ok) throw new Error(`fetch ${res.status}`);
11621
+ const blob = await res.blob();
11622
+ const rawName = new URL(href, window.location.href).pathname.split("/").pop() || "download";
11623
+ const name = decodeURIComponent(rawName);
11624
+ const file = new File([blob], name, {
11625
+ type: blob.type || "application/octet-stream"
11626
+ });
11627
+ const nav = navigator;
11628
+ if (nav.canShare?.({ files: [file] }) && nav.share) {
11629
+ await nav.share({ files: [file], title: name });
11630
+ return;
11631
+ }
11632
+ window.location.href = URL.createObjectURL(blob);
11633
+ } catch (error) {
11634
+ debugLogger.warn("openFileLink: share flow failed, falling back", {
11635
+ error: error instanceof Error ? error.message : String(error)
11636
+ });
11637
+ if (error?.name === "AbortError") return;
11638
+ window.open(href, "_blank", "noopener");
11639
+ }
11640
+ })();
11641
+ };
11642
+
11606
11643
  // src/modals/chat-modal/ai-response-action-bar.tsx
11607
11644
  var import_react13 = require("react");
11608
11645
 
@@ -12972,6 +13009,7 @@ ${sourcesMarkdownList.join("\n")}`;
12972
13009
  },
12973
13010
  target: "_blank",
12974
13011
  rel: "noopener noreferrer",
13012
+ onClick: (e) => maybeHandleFileLinkClick(e, href),
12975
13013
  children
12976
13014
  }
12977
13015
  );