@burtson-labs/bandit-engine 2.0.49 → 2.0.51

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 (37) hide show
  1. package/dist/{chat-647M6BRG.mjs → chat-W5IFNEUC.mjs} +5 -4
  2. package/dist/chat-provider.js +29 -14
  3. package/dist/chat-provider.js.map +1 -1
  4. package/dist/chat-provider.mjs +3 -3
  5. package/dist/{chunk-VL3CMSDO.mjs → chunk-EWUUF4GE.mjs} +2 -2
  6. package/dist/{chunk-AXFX2HUK.mjs → chunk-HETIHZ42.mjs} +2 -2
  7. package/dist/{chunk-6WZUQHZT.mjs → chunk-IDH2YOW3.mjs} +30 -15
  8. package/dist/chunk-IDH2YOW3.mjs.map +1 -0
  9. package/dist/{chunk-JCLL7AGP.mjs → chunk-JBXNXSAH.mjs} +2144 -576
  10. package/dist/chunk-JBXNXSAH.mjs.map +1 -0
  11. package/dist/{chunk-TVF45U7B.mjs → chunk-LXD3IV6Z.mjs} +3 -3
  12. package/dist/chunk-N7RMUOFB.mjs +482 -0
  13. package/dist/chunk-N7RMUOFB.mjs.map +1 -0
  14. package/dist/{chunk-HKJTRBWC.mjs → chunk-QFSEZAG6.mjs} +3 -3
  15. package/dist/{chunk-7HXARU5R.mjs → chunk-STMXPFAQ.mjs} +867 -1275
  16. package/dist/chunk-STMXPFAQ.mjs.map +1 -0
  17. package/dist/cli.js +3 -3
  18. package/dist/cli.js.map +1 -1
  19. package/dist/index.js +2088 -455
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +8 -7
  22. package/dist/index.mjs.map +1 -1
  23. package/dist/management/management.js +3397 -1764
  24. package/dist/management/management.js.map +1 -1
  25. package/dist/management/management.mjs +6 -5
  26. package/dist/modals/chat-modal/chat-modal.js +29 -14
  27. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  28. package/dist/modals/chat-modal/chat-modal.mjs +3 -3
  29. package/package.json +3 -3
  30. package/dist/chunk-6WZUQHZT.mjs.map +0 -1
  31. package/dist/chunk-7HXARU5R.mjs.map +0 -1
  32. package/dist/chunk-JCLL7AGP.mjs.map +0 -1
  33. /package/dist/{chat-647M6BRG.mjs.map → chat-W5IFNEUC.mjs.map} +0 -0
  34. /package/dist/{chunk-VL3CMSDO.mjs.map → chunk-EWUUF4GE.mjs.map} +0 -0
  35. /package/dist/{chunk-AXFX2HUK.mjs.map → chunk-HETIHZ42.mjs.map} +0 -0
  36. /package/dist/{chunk-TVF45U7B.mjs.map → chunk-LXD3IV6Z.mjs.map} +0 -0
  37. /package/dist/{chunk-HKJTRBWC.mjs.map → chunk-QFSEZAG6.mjs.map} +0 -0
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  management_default
3
- } from "../chunk-JCLL7AGP.mjs";
4
- import "../chunk-VL3CMSDO.mjs";
3
+ } from "../chunk-JBXNXSAH.mjs";
4
+ import "../chunk-N7RMUOFB.mjs";
5
+ import "../chunk-EWUUF4GE.mjs";
5
6
  import "../chunk-EHNWQ4T3.mjs";
6
- import "../chunk-TVF45U7B.mjs";
7
- import "../chunk-AXFX2HUK.mjs";
8
- import "../chunk-6WZUQHZT.mjs";
7
+ import "../chunk-LXD3IV6Z.mjs";
8
+ import "../chunk-HETIHZ42.mjs";
9
+ import "../chunk-IDH2YOW3.mjs";
9
10
  import "../chunk-7ZDS33S2.mjs";
10
11
  import "../chunk-BENL3EF2.mjs";
11
12
  import "../chunk-KCI46M23.mjs";
@@ -7052,7 +7052,18 @@ async function saveStateToDB(state) {
7052
7052
  await indexedDBService_default.put(DB_NAME2, DB_VERSION, STORE_NAME2, state, storeConfigs2, STORAGE_KEY);
7053
7053
  }
7054
7054
  async function loadStateFromDB() {
7055
- return indexedDBService_default.get(DB_NAME2, DB_VERSION, STORE_NAME2, STORAGE_KEY, storeConfigs2);
7055
+ let timeoutId;
7056
+ const timeoutPromise = new Promise((resolve) => {
7057
+ timeoutId = window.setTimeout(() => resolve(void 0), 1200);
7058
+ });
7059
+ try {
7060
+ const getPromise = indexedDBService_default.get(DB_NAME2, DB_VERSION, STORE_NAME2, STORAGE_KEY, storeConfigs2).catch(() => void 0);
7061
+ return await Promise.race([getPromise, timeoutPromise]);
7062
+ } finally {
7063
+ if (timeoutId !== void 0) {
7064
+ window.clearTimeout(timeoutId);
7065
+ }
7066
+ }
7056
7067
  }
7057
7068
  var useAIQueryStore = (0, import_zustand6.create)((set, get) => ({
7058
7069
  inputValue: "",
@@ -7108,19 +7119,23 @@ var useAIQueryStore = (0, import_zustand6.create)((set, get) => ({
7108
7119
  saveStateToDB(resetState);
7109
7120
  },
7110
7121
  hydrate: async () => {
7111
- const storedState = await loadStateFromDB();
7112
- if (storedState) {
7113
- set({
7114
- inputValue: storedState.inputValue ?? "",
7115
- response: storedState.response ?? "",
7116
- previousQuestion: storedState.previousQuestion ?? "",
7117
- position: storedState.position ?? { x: window.innerWidth / 2 - 300, y: window.innerHeight - 350 },
7118
- componentStatus: "Idle",
7119
- history: storedState.history ?? [],
7120
- apiKey: storedState.apiKey ?? "",
7121
- hydrated: true
7122
- });
7123
- } else {
7122
+ try {
7123
+ const storedState = await loadStateFromDB();
7124
+ if (storedState) {
7125
+ set({
7126
+ inputValue: storedState.inputValue ?? "",
7127
+ response: storedState.response ?? "",
7128
+ previousQuestion: storedState.previousQuestion ?? "",
7129
+ position: storedState.position ?? { x: window.innerWidth / 2 - 300, y: window.innerHeight - 350 },
7130
+ componentStatus: "Idle",
7131
+ history: storedState.history ?? [],
7132
+ apiKey: storedState.apiKey ?? "",
7133
+ hydrated: true
7134
+ });
7135
+ } else {
7136
+ set({ hydrated: true });
7137
+ }
7138
+ } catch {
7124
7139
  set({ hydrated: true });
7125
7140
  }
7126
7141
  }