@burtson-labs/bandit-engine 2.0.52 → 2.0.53

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/dist/{aiProviderStore-3N3VE6D4.mjs → aiProviderStore-337QNQB3.mjs} +2 -2
  2. package/dist/{chat-YWYLVKXX.mjs → chat-U4SE4JQK.mjs} +6 -6
  3. package/dist/chat-provider.js +17 -9
  4. package/dist/chat-provider.js.map +1 -1
  5. package/dist/chat-provider.mjs +4 -4
  6. package/dist/{chunk-RSSJADDD.mjs → chunk-2BGORTWS.mjs} +4 -4
  7. package/dist/{chunk-QX6CO7TJ.mjs → chunk-557E5VZ2.mjs} +3 -3
  8. package/dist/{chunk-MH7WFWCP.mjs → chunk-AVV7HDGR.mjs} +3 -3
  9. package/dist/{chunk-YZ2HJFPQ.mjs → chunk-EULV5CHD.mjs} +2 -2
  10. package/dist/{chunk-TSQCNHOX.mjs → chunk-GNE4TTSI.mjs} +48 -15
  11. package/dist/chunk-GNE4TTSI.mjs.map +1 -0
  12. package/dist/{chunk-BENL3EF2.mjs → chunk-H3BYFEIE.mjs} +18 -10
  13. package/dist/chunk-H3BYFEIE.mjs.map +1 -0
  14. package/dist/{chunk-M3BEAMCC.mjs → chunk-NZKLKZJT.mjs} +3 -3
  15. package/dist/{chunk-Y5N3NSTU.mjs → chunk-O54PTFJM.mjs} +8 -8
  16. package/dist/{chunk-37PEP5JK.mjs → chunk-UFSEYVRS.mjs} +3 -3
  17. package/dist/cli.js +1 -1
  18. package/dist/cli.js.map +1 -1
  19. package/dist/{gateway-oScD5tvE.d.mts → gateway-C5T5FfCy.d.mts} +32 -0
  20. package/dist/{gateway-oScD5tvE.d.ts → gateway-C5T5FfCy.d.ts} +32 -0
  21. package/dist/index.d.mts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +60 -19
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +9 -9
  26. package/dist/management/management.js +60 -19
  27. package/dist/management/management.js.map +1 -1
  28. package/dist/management/management.mjs +7 -7
  29. package/dist/modals/chat-modal/chat-modal.js +17 -9
  30. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  31. package/dist/modals/chat-modal/chat-modal.mjs +4 -4
  32. package/dist/public-types.d.mts +1 -1
  33. package/dist/public-types.d.ts +1 -1
  34. package/package.json +1 -1
  35. package/dist/chunk-BENL3EF2.mjs.map +0 -1
  36. package/dist/chunk-TSQCNHOX.mjs.map +0 -1
  37. /package/dist/{aiProviderStore-3N3VE6D4.mjs.map → aiProviderStore-337QNQB3.mjs.map} +0 -0
  38. /package/dist/{chat-YWYLVKXX.mjs.map → chat-U4SE4JQK.mjs.map} +0 -0
  39. /package/dist/{chunk-RSSJADDD.mjs.map → chunk-2BGORTWS.mjs.map} +0 -0
  40. /package/dist/{chunk-QX6CO7TJ.mjs.map → chunk-557E5VZ2.mjs.map} +0 -0
  41. /package/dist/{chunk-MH7WFWCP.mjs.map → chunk-AVV7HDGR.mjs.map} +0 -0
  42. /package/dist/{chunk-YZ2HJFPQ.mjs.map → chunk-EULV5CHD.mjs.map} +0 -0
  43. /package/dist/{chunk-M3BEAMCC.mjs.map → chunk-NZKLKZJT.mjs.map} +0 -0
  44. /package/dist/{chunk-Y5N3NSTU.mjs.map → chunk-O54PTFJM.mjs.map} +0 -0
  45. /package/dist/{chunk-37PEP5JK.mjs.map → chunk-UFSEYVRS.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ChatProvider,
3
3
  chat_provider_default
4
- } from "./chunk-MH7WFWCP.mjs";
4
+ } from "./chunk-AVV7HDGR.mjs";
5
5
  import "./chunk-ONQMRE2G.mjs";
6
- import "./chunk-37PEP5JK.mjs";
6
+ import "./chunk-UFSEYVRS.mjs";
7
7
  import "./chunk-EHNWQ4T3.mjs";
8
- import "./chunk-QX6CO7TJ.mjs";
8
+ import "./chunk-557E5VZ2.mjs";
9
9
  import "./chunk-7ZDS33S2.mjs";
10
- import "./chunk-BENL3EF2.mjs";
10
+ import "./chunk-H3BYFEIE.mjs";
11
11
  import "./chunk-KCI46M23.mjs";
12
12
  import "./chunk-BJTO5JO5.mjs";
13
13
  export {
@@ -8,14 +8,14 @@ import {
8
8
  useNotificationService,
9
9
  useTTS,
10
10
  useVoiceStore
11
- } from "./chunk-M3BEAMCC.mjs";
11
+ } from "./chunk-NZKLKZJT.mjs";
12
12
  import {
13
13
  brandingService_default,
14
14
  toTitleCase,
15
15
  useAIQueryStore,
16
16
  useConversationStore,
17
17
  useMemoryStore
18
- } from "./chunk-QX6CO7TJ.mjs";
18
+ } from "./chunk-557E5VZ2.mjs";
19
19
  import {
20
20
  indexedDBService_default,
21
21
  useModelStore,
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-7ZDS33S2.mjs";
25
25
  import {
26
26
  useAIProviderStore
27
- } from "./chunk-BENL3EF2.mjs";
27
+ } from "./chunk-H3BYFEIE.mjs";
28
28
  import {
29
29
  debugLogger
30
30
  } from "./chunk-KCI46M23.mjs";
@@ -2807,4 +2807,4 @@ export {
2807
2807
  MAX_WINDOWED_HEIGHT,
2808
2808
  chat_modal_default
2809
2809
  };
2810
- //# sourceMappingURL=chunk-RSSJADDD.mjs.map
2810
+ //# sourceMappingURL=chunk-2BGORTWS.mjs.map
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-7ZDS33S2.mjs";
6
6
  import {
7
7
  useAIProviderStore
8
- } from "./chunk-BENL3EF2.mjs";
8
+ } from "./chunk-H3BYFEIE.mjs";
9
9
  import {
10
10
  debugLogger
11
11
  } from "./chunk-KCI46M23.mjs";
@@ -4879,7 +4879,7 @@ var useVectorStore = () => {
4879
4879
  const [hasCompatibleProvider, setHasCompatibleProvider] = useState2(false);
4880
4880
  const checkProviderCompatibility = useCallback2(async () => {
4881
4881
  try {
4882
- const { useAIProviderStore: useAIProviderStore2 } = await import("./aiProviderStore-3N3VE6D4.mjs");
4882
+ const { useAIProviderStore: useAIProviderStore2 } = await import("./aiProviderStore-337QNQB3.mjs");
4883
4883
  const aiProviderState = useAIProviderStore2.getState();
4884
4884
  const provider = aiProviderState.provider;
4885
4885
  const config = aiProviderState.config;
@@ -5924,4 +5924,4 @@ export {
5924
5924
  useNotification,
5925
5925
  NotificationProvider
5926
5926
  };
5927
- //# sourceMappingURL=chunk-QX6CO7TJ.mjs.map
5927
+ //# sourceMappingURL=chunk-557E5VZ2.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  aiProviderInitService
6
- } from "./chunk-37PEP5JK.mjs";
6
+ } from "./chunk-UFSEYVRS.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
9
  } from "./chunk-EHNWQ4T3.mjs";
@@ -21,7 +21,7 @@ import {
21
21
  useKnowledgeStore2,
22
22
  useMemoryStore,
23
23
  useProjectStore
24
- } from "./chunk-QX6CO7TJ.mjs";
24
+ } from "./chunk-557E5VZ2.mjs";
25
25
  import {
26
26
  indexedDBService_default,
27
27
  useModelStore,
@@ -188,4 +188,4 @@ export {
188
188
  ChatProvider,
189
189
  chat_provider_default
190
190
  };
191
- //# sourceMappingURL=chunk-MH7WFWCP.mjs.map
191
+ //# sourceMappingURL=chunk-AVV7HDGR.mjs.map
@@ -2,7 +2,7 @@ import {
2
2
  getHighlightTree,
3
3
  markdownSanitizeSchema,
4
4
  renderLowlightChildren
5
- } from "./chunk-M3BEAMCC.mjs";
5
+ } from "./chunk-NZKLKZJT.mjs";
6
6
 
7
7
  // src/components/StreamingMarkdown.tsx
8
8
  import React, { useEffect, useMemo, useRef, useState } from "react";
@@ -479,4 +479,4 @@ var StreamingMarkdown_default = StreamingMarkdown;
479
479
  export {
480
480
  StreamingMarkdown_default
481
481
  };
482
- //# sourceMappingURL=chunk-YZ2HJFPQ.mjs.map
482
+ //# sourceMappingURL=chunk-EULV5CHD.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  StreamingMarkdown_default
6
- } from "./chunk-YZ2HJFPQ.mjs";
6
+ } from "./chunk-EULV5CHD.mjs";
7
7
  import {
8
8
  useMCPToolsStore
9
9
  } from "./chunk-EHNWQ4T3.mjs";
@@ -19,7 +19,7 @@ import {
19
19
  useNotificationService,
20
20
  useTTS,
21
21
  useVoiceStore
22
- } from "./chunk-M3BEAMCC.mjs";
22
+ } from "./chunk-NZKLKZJT.mjs";
23
23
  import {
24
24
  authenticationService,
25
25
  brandingService_default,
@@ -44,7 +44,7 @@ import {
44
44
  useMemoryStore,
45
45
  useProjectStore,
46
46
  useVectorStore
47
- } from "./chunk-QX6CO7TJ.mjs";
47
+ } from "./chunk-557E5VZ2.mjs";
48
48
  import {
49
49
  indexedDBService_default,
50
50
  useModelStore,
@@ -53,7 +53,7 @@ import {
53
53
  } from "./chunk-7ZDS33S2.mjs";
54
54
  import {
55
55
  useAIProviderStore
56
- } from "./chunk-BENL3EF2.mjs";
56
+ } from "./chunk-H3BYFEIE.mjs";
57
57
  import {
58
58
  debugLogger
59
59
  } from "./chunk-KCI46M23.mjs";
@@ -233,6 +233,7 @@ var ChatMessages = ({
233
233
  scrollTargetRef,
234
234
  responseStarted,
235
235
  isStreaming,
236
+ isThinking = false,
236
237
  isNetworkSlow = false,
237
238
  showInstantFeedback = true,
238
239
  selectedModel,
@@ -249,6 +250,7 @@ var ChatMessages = ({
249
250
  const isLast = index === lastIndex;
250
251
  const isPlaceholder = entry.answer === "...";
251
252
  const showLoader = isLast && isStreaming && streamBuffer.trim() === "";
253
+ const showThinking = showLoader && isThinking;
252
254
  const content = isLast ? isStreaming ? streamBuffer || "" : isPlaceholder ? "" : entry.answer : entry.answer;
253
255
  const rawSources = entry.sourceFiles;
254
256
  const sourceSummaries = rawSources ? rawSources.filter((doc) => doc && typeof doc.name === "string" && doc.name.trim()).map((doc) => ({ id: doc.id || doc.name, name: doc.name.trim() })) : void 0;
@@ -276,11 +278,27 @@ var ChatMessages = ({
276
278
  pointerEvents: showLoader ? "auto" : "none",
277
279
  zIndex: showLoader ? 1 : 0
278
280
  },
279
- children: /* @__PURE__ */ jsx4(Box2, { sx: { display: "flex", alignItems: "center", minHeight: "40px", pl: 2 }, children: /* @__PURE__ */ jsxs("div", { className: "typing-only", children: [
280
- /* @__PURE__ */ jsx4("span", { className: "dot" }),
281
- /* @__PURE__ */ jsx4("span", { className: "dot" }),
282
- /* @__PURE__ */ jsx4("span", { className: "dot" })
283
- ] }) })
281
+ children: /* @__PURE__ */ jsxs(Box2, { sx: { display: "flex", alignItems: "center", gap: 1, minHeight: "40px", pl: 2 }, children: [
282
+ /* @__PURE__ */ jsxs("div", { className: "typing-only", children: [
283
+ /* @__PURE__ */ jsx4("span", { className: "dot" }),
284
+ /* @__PURE__ */ jsx4("span", { className: "dot" }),
285
+ /* @__PURE__ */ jsx4("span", { className: "dot" })
286
+ ] }),
287
+ showThinking && /* @__PURE__ */ jsx4(
288
+ Box2,
289
+ {
290
+ component: "span",
291
+ sx: {
292
+ fontSize: "0.75rem",
293
+ color: "text.secondary",
294
+ opacity: 0.6,
295
+ fontStyle: "italic",
296
+ userSelect: "none"
297
+ },
298
+ children: "Thinking\u2026"
299
+ }
300
+ )
301
+ ] })
284
302
  }
285
303
  ),
286
304
  /* @__PURE__ */ jsx4(
@@ -2317,6 +2335,7 @@ var useAIProvider = ({
2317
2335
  setIsSubmitting,
2318
2336
  setResponseStarted,
2319
2337
  setIsStreaming,
2338
+ setIsThinking,
2320
2339
  setResponse,
2321
2340
  setPastedImages,
2322
2341
  setPendingMessage,
@@ -2774,6 +2793,12 @@ ${protocol}`;
2774
2793
  let fullMessage = "";
2775
2794
  let latestDisplayMessage = "";
2776
2795
  let sawToolBlock = false;
2796
+ const stripThinking = (text) => {
2797
+ let result = text.replace(/<think>[\s\S]*?<\/think>/g, "");
2798
+ const openIdx = result.indexOf("<think>");
2799
+ if (openIdx !== -1) result = result.slice(0, openIdx);
2800
+ return result.trimStart();
2801
+ };
2777
2802
  const flushNow = () => {
2778
2803
  clearFlushTimer();
2779
2804
  if (!sawToolBlock) {
@@ -2801,13 +2826,16 @@ ${protocol}`;
2801
2826
  }
2802
2827
  const sub = stream.subscribe({
2803
2828
  next: (data) => {
2804
- if (!data?.message?.content) return;
2805
- fullMessage += data.message.content;
2806
- if (/```(?:tool_code|TOOL_CODE)/.test(fullMessage)) {
2829
+ if (!data?.message?.content && !data?.message?.tool_calls) return;
2830
+ if (data.message.content) fullMessage += data.message.content;
2831
+ const inThinkBlock = /<think>/.test(fullMessage) && !/<think>[\s\S]*<\/think>/.test(fullMessage);
2832
+ setIsThinking?.(inThinkBlock);
2833
+ const visibleMessage = stripThinking(fullMessage);
2834
+ if (/```(?:tool_code|TOOL_CODE)/.test(visibleMessage)) {
2807
2835
  sawToolBlock = true;
2808
2836
  clearFlushTimer();
2809
2837
  }
2810
- latestDisplayMessage = fullMessage;
2838
+ latestDisplayMessage = visibleMessage;
2811
2839
  if (!sawToolBlock) {
2812
2840
  scheduleFlush();
2813
2841
  }
@@ -2828,6 +2856,7 @@ ${protocol}`;
2828
2856
  setResponse(partial);
2829
2857
  }
2830
2858
  setStreamBuffer("");
2859
+ setIsThinking?.(false);
2831
2860
  setPendingMessage(null);
2832
2861
  setLogoVisible(false);
2833
2862
  if (onError) {
@@ -2836,7 +2865,8 @@ ${protocol}`;
2836
2865
  },
2837
2866
  complete: async () => {
2838
2867
  try {
2839
- latestDisplayMessage = fullMessage;
2868
+ setIsThinking?.(false);
2869
+ latestDisplayMessage = stripThinking(fullMessage);
2840
2870
  if (!sawToolBlock) {
2841
2871
  flushNow();
2842
2872
  }
@@ -8173,6 +8203,7 @@ var ChatContent = () => {
8173
8203
  const [streamBuffer, setStreamBuffer] = useState14("");
8174
8204
  const [responseStarted, setResponseStarted] = useState14(false);
8175
8205
  const [isStreaming, setIsStreaming] = useState14(false);
8206
+ const [isThinking, setIsThinking] = useState14(false);
8176
8207
  const initialLogoState = history.length === 0;
8177
8208
  const [logoVisible, setLogoVisible] = useState14(initialLogoState);
8178
8209
  const [logoShouldRender, setLogoShouldRender] = useState14(initialLogoState);
@@ -8656,6 +8687,7 @@ var ChatContent = () => {
8656
8687
  overrideComponentStatus: setComponentStatus,
8657
8688
  setIsSubmitting,
8658
8689
  setIsStreaming,
8690
+ setIsThinking,
8659
8691
  setResponseStarted,
8660
8692
  setResponse,
8661
8693
  setStreamBuffer,
@@ -9062,6 +9094,7 @@ var ChatContent = () => {
9062
9094
  chat_messages_default,
9063
9095
  {
9064
9096
  isStreaming,
9097
+ isThinking,
9065
9098
  history,
9066
9099
  pendingMessage,
9067
9100
  streamBuffer,
@@ -9201,4 +9234,4 @@ var chat_default = Chat;
9201
9234
  export {
9202
9235
  chat_default
9203
9236
  };
9204
- //# sourceMappingURL=chunk-TSQCNHOX.mjs.map
9237
+ //# sourceMappingURL=chunk-GNE4TTSI.mjs.map