@burtson-labs/bandit-engine 2.0.52 → 2.0.54

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 (51) hide show
  1. package/README.md +23 -12
  2. package/dist/{aiProviderStore-3N3VE6D4.mjs → aiProviderStore-337QNQB3.mjs} +2 -2
  3. package/dist/{chat-YWYLVKXX.mjs → chat-IDE6Z4Q4.mjs} +6 -6
  4. package/dist/chat-provider.js +17 -9
  5. package/dist/chat-provider.js.map +1 -1
  6. package/dist/chat-provider.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-BENL3EF2.mjs → chunk-H3BYFEIE.mjs} +18 -10
  10. package/dist/chunk-H3BYFEIE.mjs.map +1 -0
  11. package/dist/{chunk-YZ2HJFPQ.mjs → chunk-KM7FUWCM.mjs} +4 -4
  12. package/dist/chunk-KM7FUWCM.mjs.map +1 -0
  13. package/dist/{chunk-M3BEAMCC.mjs → chunk-KNBWR4DS.mjs} +775 -488
  14. package/dist/chunk-KNBWR4DS.mjs.map +1 -0
  15. package/dist/{chunk-Y5N3NSTU.mjs → chunk-NP2OHTTX.mjs} +116 -152
  16. package/dist/chunk-NP2OHTTX.mjs.map +1 -0
  17. package/dist/{chunk-TSQCNHOX.mjs → chunk-TLY6A6XL.mjs} +123 -147
  18. package/dist/chunk-TLY6A6XL.mjs.map +1 -0
  19. package/dist/{chunk-37PEP5JK.mjs → chunk-UFSEYVRS.mjs} +3 -3
  20. package/dist/{chunk-RSSJADDD.mjs → chunk-WL7NV4WJ.mjs} +28 -32
  21. package/dist/chunk-WL7NV4WJ.mjs.map +1 -0
  22. package/dist/index.d.mts +5 -3
  23. package/dist/index.d.ts +5 -3
  24. package/dist/index.js +4097 -4045
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +11 -15
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/management/management.js +4068 -4016
  29. package/dist/management/management.js.map +1 -1
  30. package/dist/management/management.mjs +7 -7
  31. package/dist/modals/chat-modal/chat-modal.js +1401 -1279
  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/{gateway-oScD5tvE.d.mts → public-BzsEWB08.d.mts} +11 -122
  35. package/dist/{gateway-oScD5tvE.d.ts → public-BzsEWB08.d.ts} +11 -122
  36. package/dist/public-types.d.mts +2 -32
  37. package/dist/public-types.d.ts +2 -32
  38. package/package.json +3 -11
  39. package/dist/chunk-BENL3EF2.mjs.map +0 -1
  40. package/dist/chunk-M3BEAMCC.mjs.map +0 -1
  41. package/dist/chunk-RSSJADDD.mjs.map +0 -1
  42. package/dist/chunk-TSQCNHOX.mjs.map +0 -1
  43. package/dist/chunk-Y5N3NSTU.mjs.map +0 -1
  44. package/dist/chunk-YZ2HJFPQ.mjs.map +0 -1
  45. package/dist/cli.js +0 -4084
  46. package/dist/cli.js.map +0 -1
  47. /package/dist/{aiProviderStore-3N3VE6D4.mjs.map → aiProviderStore-337QNQB3.mjs.map} +0 -0
  48. /package/dist/{chat-YWYLVKXX.mjs.map → chat-IDE6Z4Q4.mjs.map} +0 -0
  49. /package/dist/{chunk-QX6CO7TJ.mjs.map → chunk-557E5VZ2.mjs.map} +0 -0
  50. /package/dist/{chunk-MH7WFWCP.mjs.map → chunk-AVV7HDGR.mjs.map} +0 -0
  51. /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 {
@@ -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
@@ -1216,7 +1216,8 @@ var GatewayService = class {
1216
1216
  index: 0,
1217
1217
  delta: {
1218
1218
  role: parsed.message.role,
1219
- content: parsed.message.content
1219
+ content: parsed.message.content,
1220
+ tool_calls: parsed.message.tool_calls
1220
1221
  },
1221
1222
  finish_reason: parsed.done ? parsed.done_reason || "stop" : null
1222
1223
  }]
@@ -2141,6 +2142,7 @@ var GatewayProvider = class {
2141
2142
  }
2142
2143
  }
2143
2144
  }
2145
+ const toolAwareRequest = request;
2144
2146
  const gatewayRequest = {
2145
2147
  model: request.model,
2146
2148
  messages,
@@ -2149,7 +2151,8 @@ var GatewayProvider = class {
2149
2151
  max_tokens: request.maxTokens,
2150
2152
  provider: this.config.provider,
2151
2153
  // Only include top-level images for Ollama (fallback)
2152
- images: this.config.provider === "ollama" ? request.images : void 0
2154
+ images: this.config.provider === "ollama" ? request.images : void 0,
2155
+ tools: toolAwareRequest.tools?.length ? toolAwareRequest.tools : void 0
2153
2156
  };
2154
2157
  debugLogger.debug("Gateway provider chat request", {
2155
2158
  model: request.model,
@@ -2166,13 +2169,18 @@ var GatewayProvider = class {
2166
2169
  }))
2167
2170
  });
2168
2171
  return this.gatewayService.chat(gatewayRequest).pipe(
2169
- map12((response) => ({
2170
- message: {
2171
- content: response.choices?.[0]?.message?.content || response.choices?.[0]?.delta?.content || "",
2172
- role: "assistant"
2173
- },
2174
- done: response.choices?.[0]?.finish_reason === "stop" || response.choices?.[0]?.finish_reason === "length"
2175
- }))
2172
+ map12((response) => {
2173
+ const choice = response.choices?.[0];
2174
+ const toolCalls = choice?.message?.tool_calls ?? choice?.delta?.tool_calls;
2175
+ return {
2176
+ message: {
2177
+ content: choice?.message?.content ?? choice?.delta?.content ?? "",
2178
+ role: "assistant",
2179
+ tool_calls: toolCalls
2180
+ },
2181
+ done: choice?.finish_reason === "stop" || choice?.finish_reason === "length" || choice?.finish_reason === "tool_calls"
2182
+ };
2183
+ })
2176
2184
  );
2177
2185
  }
2178
2186
  generate(request) {
@@ -2950,4 +2958,4 @@ export {
2950
2958
  AIProviderFactory,
2951
2959
  useAIProviderStore
2952
2960
  };
2953
- //# sourceMappingURL=chunk-BENL3EF2.mjs.map
2961
+ //# sourceMappingURL=chunk-H3BYFEIE.mjs.map