@burtson-labs/bandit-engine 2.0.36 → 2.0.38

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 (45) hide show
  1. package/README.md +3 -3
  2. package/dist/{aiProviderStore-UJRDUYOF.mjs → aiProviderStore-XN7GCBHJ.mjs} +2 -2
  3. package/dist/{chat-SZK3EBDO.mjs → chat-5QJNWB7I.mjs} +5 -5
  4. package/dist/chat-provider.js +29 -3
  5. package/dist/chat-provider.js.map +1 -1
  6. package/dist/chat-provider.mjs +4 -4
  7. package/dist/{chunk-2ZZA2IFL.mjs → chunk-3A2527TE.mjs} +3 -3
  8. package/dist/{chunk-FJO5ZWYU.mjs → chunk-CDQYBO3Q.mjs} +26 -8
  9. package/dist/chunk-CDQYBO3Q.mjs.map +1 -0
  10. package/dist/{chunk-PLNFTIGX.mjs → chunk-ECRNIAG6.mjs} +4 -4
  11. package/dist/{chunk-S635Q6OQ.mjs → chunk-EOKIE5HZ.mjs} +24 -3
  12. package/dist/chunk-EOKIE5HZ.mjs.map +1 -0
  13. package/dist/{chunk-G4OXOTNJ.mjs → chunk-JRCDANLN.mjs} +154 -61
  14. package/dist/{chunk-G4OXOTNJ.mjs.map → chunk-JRCDANLN.mjs.map} +1 -1
  15. package/dist/{chunk-ZNNOTDRD.mjs → chunk-QU5S5QQP.mjs} +9 -4
  16. package/dist/chunk-QU5S5QQP.mjs.map +1 -0
  17. package/dist/{chunk-ED5NNDKO.mjs → chunk-QYH2T4L5.mjs} +3 -3
  18. package/dist/{chunk-ZAVV2AT5.mjs → chunk-WO5KFNNW.mjs} +4 -4
  19. package/dist/cli/cli.js +27 -7
  20. package/dist/cli/cli.js.map +1 -1
  21. package/dist/{gateway-Ckf_KusF.d.ts → gateway-B0LJ3-jT.d.mts} +3 -0
  22. package/dist/{gateway-Ckf_KusF.d.mts → gateway-B0LJ3-jT.d.ts} +3 -0
  23. package/dist/index.d.mts +2 -2
  24. package/dist/index.d.ts +2 -2
  25. package/dist/index.js +196 -59
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +8 -8
  28. package/dist/management/management.js +196 -59
  29. package/dist/management/management.js.map +1 -1
  30. package/dist/management/management.mjs +6 -6
  31. package/dist/modals/chat-modal/chat-modal.js +8 -3
  32. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  33. package/dist/modals/chat-modal/chat-modal.mjs +4 -4
  34. package/dist/public-types.d.mts +1 -1
  35. package/dist/public-types.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-FJO5ZWYU.mjs.map +0 -1
  38. package/dist/chunk-S635Q6OQ.mjs.map +0 -1
  39. package/dist/chunk-ZNNOTDRD.mjs.map +0 -1
  40. /package/dist/{aiProviderStore-UJRDUYOF.mjs.map → aiProviderStore-XN7GCBHJ.mjs.map} +0 -0
  41. /package/dist/{chat-SZK3EBDO.mjs.map → chat-5QJNWB7I.mjs.map} +0 -0
  42. /package/dist/{chunk-2ZZA2IFL.mjs.map → chunk-3A2527TE.mjs.map} +0 -0
  43. /package/dist/{chunk-PLNFTIGX.mjs.map → chunk-ECRNIAG6.mjs.map} +0 -0
  44. /package/dist/{chunk-ED5NNDKO.mjs.map → chunk-QYH2T4L5.mjs.map} +0 -0
  45. /package/dist/{chunk-ZAVV2AT5.mjs.map → chunk-WO5KFNNW.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ChatProvider,
3
3
  chat_provider_default
4
- } from "./chunk-2ZZA2IFL.mjs";
4
+ } from "./chunk-3A2527TE.mjs";
5
5
  import "./chunk-ONQMRE2G.mjs";
6
- import "./chunk-S635Q6OQ.mjs";
6
+ import "./chunk-EOKIE5HZ.mjs";
7
7
  import "./chunk-RTQDQ6TC.mjs";
8
- import "./chunk-FJO5ZWYU.mjs";
8
+ import "./chunk-CDQYBO3Q.mjs";
9
9
  import "./chunk-XUBYA5I7.mjs";
10
- import "./chunk-ZNNOTDRD.mjs";
10
+ import "./chunk-QU5S5QQP.mjs";
11
11
  import "./chunk-KCI46M23.mjs";
12
12
  import "./chunk-BJTO5JO5.mjs";
13
13
  export {
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  aiProviderInitService
6
- } from "./chunk-S635Q6OQ.mjs";
6
+ } from "./chunk-EOKIE5HZ.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
9
  } from "./chunk-RTQDQ6TC.mjs";
@@ -20,7 +20,7 @@ import {
20
20
  useKnowledgeStore2,
21
21
  useMemoryStore,
22
22
  useProjectStore
23
- } from "./chunk-FJO5ZWYU.mjs";
23
+ } from "./chunk-CDQYBO3Q.mjs";
24
24
  import {
25
25
  indexedDBService_default,
26
26
  useModelStore,
@@ -157,4 +157,4 @@ export {
157
157
  ChatProvider,
158
158
  chat_provider_default
159
159
  };
160
- //# sourceMappingURL=chunk-2ZZA2IFL.mjs.map
160
+ //# sourceMappingURL=chunk-3A2527TE.mjs.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-XUBYA5I7.mjs";
6
6
  import {
7
7
  useAIProviderStore
8
- } from "./chunk-ZNNOTDRD.mjs";
8
+ } from "./chunk-QU5S5QQP.mjs";
9
9
  import {
10
10
  debugLogger
11
11
  } from "./chunk-KCI46M23.mjs";
@@ -2165,8 +2165,10 @@ Do not:
2165
2165
  - Refer to yourself or use phrases like "As an AI..."
2166
2166
  - Include greetings, explanations, or personality
2167
2167
  - Include jokes, fiction, or quotes
2168
+ - Number, bullet, or otherwise prefix the questions with extra characters
2169
+ - Repeat the same idea phrased differently \u2014 each question must explore a distinct angle or subtopic
2168
2170
 
2169
- Output only ${limit} questions \u2014 one per line.`;
2171
+ Output only ${limit} questions \u2014 one per line, with no leading numbers, bullets, or prefixes.`;
2170
2172
  return prompt.trim();
2171
2173
  };
2172
2174
 
@@ -2215,17 +2217,33 @@ var generateConversationStarters = async (args) => {
2215
2217
  options: { temperature: 1.5, num_predict: 250 }
2216
2218
  });
2217
2219
  const questions$ = data$.pipe(map((d) => {
2218
- const lines = d.response.split("\n").map((line) => line.trim()).filter((line) => {
2219
- return line.length > 10 && !line.toLowerCase().includes("sorry") && !line.toLowerCase().includes("i cannot") && !line.toLowerCase().includes("i can't") && !line.toLowerCase().includes("unable to") && !line.toLowerCase().startsWith("as an ai") && line.includes("?");
2220
+ const sanitizeLine = (line) => {
2221
+ const withoutNumbering = line.replace(/^[0-9]+[.)\-\s:]+/, "").replace(/^[•*+-]\s+/, "");
2222
+ const withoutQuotes = withoutNumbering.replace(/^[“"']+/, "").replace(/[”"']+$/, "");
2223
+ const withoutEmoji = withoutQuotes.replace(/\p{Extended_Pictographic}/gu, "");
2224
+ return withoutEmoji.trim().replace(/\s+/g, " ");
2225
+ };
2226
+ const sanitized = d.response.split("\n").map((line) => sanitizeLine(line.trim())).filter((line) => {
2227
+ const lower = line.toLowerCase();
2228
+ return line.length > 10 && line.includes("?") && !lower.includes("sorry") && !lower.includes("i cannot") && !lower.includes("i can't") && !lower.includes("unable to") && !lower.startsWith("as an ai");
2229
+ }).filter((line) => line.length > 0);
2230
+ const unique = [];
2231
+ const seen = /* @__PURE__ */ new Set();
2232
+ sanitized.forEach((line) => {
2233
+ const key = line.toLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").trim();
2234
+ if (key && !seen.has(key)) {
2235
+ seen.add(key);
2236
+ unique.push(line);
2237
+ }
2220
2238
  });
2221
- return lines;
2239
+ return unique;
2222
2240
  }));
2223
2241
  const starters = await lastValueFrom(questions$);
2224
2242
  if (starters.length === 0) {
2225
2243
  debugLogger.warn("No meaningful conversation starters generated");
2226
2244
  return [];
2227
2245
  }
2228
- return starters;
2246
+ return starters.slice(0, args.limit);
2229
2247
  } catch (err) {
2230
2248
  debugLogger.error("\u274C Failed to generate conversation starters:", { error: err });
2231
2249
  notificationService.handleHttpError(err);
@@ -4634,7 +4652,7 @@ var useVectorStore = () => {
4634
4652
  const [hasCompatibleProvider, setHasCompatibleProvider] = useState2(false);
4635
4653
  const checkProviderCompatibility = useCallback2(async () => {
4636
4654
  try {
4637
- const { useAIProviderStore: useAIProviderStore2 } = await import("./aiProviderStore-UJRDUYOF.mjs");
4655
+ const { useAIProviderStore: useAIProviderStore2 } = await import("./aiProviderStore-XN7GCBHJ.mjs");
4638
4656
  const aiProviderState = useAIProviderStore2.getState();
4639
4657
  const provider = aiProviderState.provider;
4640
4658
  const config = aiProviderState.config;
@@ -5676,4 +5694,4 @@ export {
5676
5694
  useNotification,
5677
5695
  NotificationProvider
5678
5696
  };
5679
- //# sourceMappingURL=chunk-FJO5ZWYU.mjs.map
5697
+ //# sourceMappingURL=chunk-CDQYBO3Q.mjs.map