@burtson-labs/bandit-engine 2.0.9 → 2.0.11

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 (182) hide show
  1. package/README.md +74 -29
  2. package/dist/{aiProviderStore-YWJHSWFA.mjs → aiProviderStore-3YS2BZU3.mjs} +2 -2
  3. package/dist/chat-ZPJNWIXI.mjs +15 -0
  4. package/dist/chat-provider.js +211 -16
  5. package/dist/chat-provider.js.map +1 -1
  6. package/dist/chat-provider.mjs +6 -6
  7. package/dist/{chunk-CVIOLFMX.mjs → chunk-2ZNIQD26.mjs} +4 -4
  8. package/dist/{chunk-6YRLBITU.mjs → chunk-5UVULH77.mjs} +18 -9
  9. package/dist/chunk-5UVULH77.mjs.map +1 -0
  10. package/dist/{chunk-VSHO7PF2.mjs → chunk-CY227I4F.mjs} +23 -13
  11. package/dist/chunk-CY227I4F.mjs.map +1 -0
  12. package/dist/{chunk-JQ6UNJNW.mjs → chunk-IFN52MQL.mjs} +16 -10
  13. package/dist/{chunk-JQ6UNJNW.mjs.map → chunk-IFN52MQL.mjs.map} +1 -1
  14. package/dist/{chunk-AVC6IZJQ.mjs → chunk-IHJPVIGB.mjs} +179 -2
  15. package/dist/chunk-IHJPVIGB.mjs.map +1 -0
  16. package/dist/{chunk-HHKXWNCG.mjs → chunk-L7UOQ2Y2.mjs} +5 -5
  17. package/dist/{chunk-5E7S7DK3.mjs → chunk-RTQDQ6TC.mjs} +2 -2
  18. package/dist/{chunk-6IHJZCUH.mjs → chunk-UMPVXYVC.mjs} +4 -4
  19. package/dist/{chunk-PXXVEH5M.mjs → chunk-XEG45Q6V.mjs} +4 -4
  20. package/dist/{chunk-QHLKGSMB.mjs → chunk-XUBYA5I7.mjs} +2 -2
  21. package/dist/{chunk-QHLKGSMB.mjs.map → chunk-XUBYA5I7.mjs.map} +1 -1
  22. package/dist/cli/cli.js +14 -1
  23. package/dist/cli/cli.js.map +1 -1
  24. package/dist/{gateway-BXVrH8B-.d.mts → gateway-BiHRHJMM.d.mts} +3 -1
  25. package/dist/{gateway-BXVrH8B-.d.ts → gateway-BiHRHJMM.d.ts} +3 -1
  26. package/dist/index.d.mts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +282 -72
  29. package/dist/index.js.map +1 -1
  30. package/dist/index.mjs +10 -10
  31. package/dist/management/management.js +262 -62
  32. package/dist/management/management.js.map +1 -1
  33. package/dist/management/management.mjs +8 -8
  34. package/dist/modals/chat-modal/chat-modal.js +202 -17
  35. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  36. package/dist/modals/chat-modal/chat-modal.mjs +5 -5
  37. package/dist/{modelStore-CY6SECYD.mjs → modelStore-UMJBDSEF.mjs} +2 -2
  38. package/dist/public-types.d.mts +1 -1
  39. package/dist/public-types.d.ts +1 -1
  40. package/docs/01_quickstart.md +9 -6
  41. package/docs/02_gateway_api.md +55 -12
  42. package/docs/api_reference/assets/search.js +1 -1
  43. package/docs/api_reference/classes/DebugLogger.html +11 -11
  44. package/docs/api_reference/classes/FeatureFlagService.html +13 -13
  45. package/docs/api_reference/classes/NotificationService.html +10 -10
  46. package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
  47. package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
  48. package/docs/api_reference/classes/VectorMigrationService.html +8 -8
  49. package/docs/api_reference/classes/VoiceService.html +2 -2
  50. package/docs/api_reference/enums/TTSState.html +2 -2
  51. package/docs/api_reference/functions/Chat.html +1 -1
  52. package/docs/api_reference/functions/ChatModal.html +1 -1
  53. package/docs/api_reference/functions/ChatProvider.html +1 -1
  54. package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
  55. package/docs/api_reference/functions/FeedbackButton.html +1 -1
  56. package/docs/api_reference/functions/FeedbackModal.html +1 -1
  57. package/docs/api_reference/functions/Management.html +1 -1
  58. package/docs/api_reference/functions/NotificationProvider.html +1 -1
  59. package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
  60. package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
  61. package/docs/api_reference/functions/defineCustomElement.html +1 -1
  62. package/docs/api_reference/functions/getCriticalConfig.html +1 -1
  63. package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
  64. package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
  65. package/docs/api_reference/functions/getSystemConstants.html +1 -1
  66. package/docs/api_reference/functions/getTTSState.html +1 -1
  67. package/docs/api_reference/functions/handleHttpError.html +1 -1
  68. package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
  69. package/docs/api_reference/functions/handleValidationError.html +1 -1
  70. package/docs/api_reference/functions/initializeCoreSystem.html +1 -1
  71. package/docs/api_reference/functions/pauseTTS.html +1 -1
  72. package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
  73. package/docs/api_reference/functions/resumeTTS.html +1 -1
  74. package/docs/api_reference/functions/showInfoNotification.html +1 -1
  75. package/docs/api_reference/functions/showSuccessNotification.html +1 -1
  76. package/docs/api_reference/functions/speakWithStreaming.html +1 -1
  77. package/docs/api_reference/functions/stopTTS.html +1 -1
  78. package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
  79. package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
  80. package/docs/api_reference/functions/useFeatureFlag.html +1 -1
  81. package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
  82. package/docs/api_reference/functions/useFeatures.html +1 -1
  83. package/docs/api_reference/functions/useGatewayHealth.html +1 -1
  84. package/docs/api_reference/functions/useGatewayMemory.html +1 -1
  85. package/docs/api_reference/functions/useGatewayModels.html +1 -1
  86. package/docs/api_reference/functions/useGlobalTTS.html +1 -1
  87. package/docs/api_reference/functions/useNotification.html +1 -1
  88. package/docs/api_reference/functions/useNotificationService.html +1 -1
  89. package/docs/api_reference/functions/useTTS.html +1 -1
  90. package/docs/api_reference/functions/useVectorStore.html +1 -1
  91. package/docs/api_reference/functions/useVoiceStore.html +2 -2
  92. package/docs/api_reference/functions/useVoices.html +1 -1
  93. package/docs/api_reference/functions/validateEnvironment.html +1 -1
  94. package/docs/api_reference/functions/validateSystemIntegrity.html +1 -1
  95. package/docs/api_reference/index.html +34 -15
  96. package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
  97. package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
  98. package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
  99. package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
  100. package/docs/api_reference/interfaces/AIMessage.html +2 -2
  101. package/docs/api_reference/interfaces/AIModel.html +2 -2
  102. package/docs/api_reference/interfaces/AIProviderConfig.html +2 -2
  103. package/docs/api_reference/interfaces/ChatConfig.html +3 -3
  104. package/docs/api_reference/interfaces/ChatModalProps.html +3 -3
  105. package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
  106. package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
  107. package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
  108. package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
  109. package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
  110. package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
  111. package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
  112. package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
  113. package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
  114. package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
  115. package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
  116. package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
  117. package/docs/api_reference/interfaces/GatewayChatRequest.html +2 -2
  118. package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
  119. package/docs/api_reference/interfaces/GatewayContract.html +2 -2
  120. package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
  121. package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
  122. package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
  123. package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
  124. package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
  125. package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
  126. package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
  127. package/docs/api_reference/interfaces/GatewayModel.html +2 -2
  128. package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
  129. package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
  130. package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
  131. package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
  132. package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
  133. package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
  134. package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
  135. package/docs/api_reference/interfaces/PackageSettings.html +4 -2
  136. package/docs/api_reference/interfaces/SearchOptions.html +2 -2
  137. package/docs/api_reference/interfaces/SearchResult.html +2 -2
  138. package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
  139. package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
  140. package/docs/api_reference/interfaces/TTSOptions.html +2 -2
  141. package/docs/api_reference/interfaces/TTSProgress.html +2 -2
  142. package/docs/api_reference/interfaces/TrialUsage.html +2 -2
  143. package/docs/api_reference/interfaces/UploadRequest.html +3 -3
  144. package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
  145. package/docs/api_reference/interfaces/VectorDocument.html +2 -2
  146. package/docs/api_reference/interfaces/VectorMemory.html +2 -2
  147. package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
  148. package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
  149. package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
  150. package/docs/api_reference/interfaces/VoiceState.html +2 -2
  151. package/docs/api_reference/media/02_gateway_api.md +55 -12
  152. package/docs/api_reference/media/README.md +37 -9
  153. package/docs/api_reference/types/FeatureKey.html +1 -1
  154. package/docs/api_reference/types/FeatureMatrix.html +1 -1
  155. package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
  156. package/docs/api_reference/types/LogContext.html +1 -1
  157. package/docs/api_reference/types/SubscriptionTier.html +1 -1
  158. package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
  159. package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
  160. package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
  161. package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -1
  162. package/docs/api_reference/variables/authenticationService.html +1 -1
  163. package/docs/api_reference/variables/debugLogger-1.html +1 -1
  164. package/docs/api_reference/variables/featureFlagService-1.html +1 -1
  165. package/docs/api_reference/variables/notificationService-1.html +1 -1
  166. package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
  167. package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
  168. package/docs/api_reference/variables/voiceService-1.html +1 -1
  169. package/package.json +14 -1
  170. package/dist/chat-OLCX6TBK.mjs +0 -15
  171. package/dist/chunk-6YRLBITU.mjs.map +0 -1
  172. package/dist/chunk-AVC6IZJQ.mjs.map +0 -1
  173. package/dist/chunk-VSHO7PF2.mjs.map +0 -1
  174. package/docs/api_reference/media/README-1.md +0 -23
  175. /package/dist/{aiProviderStore-YWJHSWFA.mjs.map → aiProviderStore-3YS2BZU3.mjs.map} +0 -0
  176. /package/dist/{chat-OLCX6TBK.mjs.map → chat-ZPJNWIXI.mjs.map} +0 -0
  177. /package/dist/{chunk-CVIOLFMX.mjs.map → chunk-2ZNIQD26.mjs.map} +0 -0
  178. /package/dist/{chunk-HHKXWNCG.mjs.map → chunk-L7UOQ2Y2.mjs.map} +0 -0
  179. /package/dist/{chunk-5E7S7DK3.mjs.map → chunk-RTQDQ6TC.mjs.map} +0 -0
  180. /package/dist/{chunk-6IHJZCUH.mjs.map → chunk-UMPVXYVC.mjs.map} +0 -0
  181. /package/dist/{chunk-PXXVEH5M.mjs.map → chunk-XEG45Q6V.mjs.map} +0 -0
  182. /package/dist/{modelStore-CY6SECYD.mjs.map → modelStore-UMJBDSEF.mjs.map} +0 -0
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ChatProvider,
3
3
  chat_provider_default
4
- } from "./chunk-VSHO7PF2.mjs";
4
+ } from "./chunk-CY227I4F.mjs";
5
5
  import "./chunk-ONQMRE2G.mjs";
6
- import "./chunk-CVIOLFMX.mjs";
7
- import "./chunk-5E7S7DK3.mjs";
8
- import "./chunk-6IHJZCUH.mjs";
9
- import "./chunk-QHLKGSMB.mjs";
10
- import "./chunk-AVC6IZJQ.mjs";
6
+ import "./chunk-2ZNIQD26.mjs";
7
+ import "./chunk-RTQDQ6TC.mjs";
8
+ import "./chunk-UMPVXYVC.mjs";
9
+ import "./chunk-XUBYA5I7.mjs";
10
+ import "./chunk-IHJPVIGB.mjs";
11
11
  import "./chunk-KCI46M23.mjs";
12
12
  import "./chunk-BJTO5JO5.mjs";
13
13
  export {
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  authenticationService
3
- } from "./chunk-6IHJZCUH.mjs";
3
+ } from "./chunk-UMPVXYVC.mjs";
4
4
  import {
5
5
  indexedDBService_default,
6
6
  usePackageSettingsStore
7
- } from "./chunk-QHLKGSMB.mjs";
7
+ } from "./chunk-XUBYA5I7.mjs";
8
8
  import {
9
9
  useAIProviderStore
10
- } from "./chunk-AVC6IZJQ.mjs";
10
+ } from "./chunk-IHJPVIGB.mjs";
11
11
  import {
12
12
  debugLogger
13
13
  } from "./chunk-KCI46M23.mjs";
@@ -256,4 +256,4 @@ var aiProviderInitService = AIProviderInitService.getInstance();
256
256
  export {
257
257
  aiProviderInitService
258
258
  };
259
- //# sourceMappingURL=chunk-CVIOLFMX.mjs.map
259
+ //# sourceMappingURL=chunk-2ZNIQD26.mjs.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-ONQMRE2G.mjs";
4
4
  import {
5
5
  useMCPToolsStore
6
- } from "./chunk-5E7S7DK3.mjs";
6
+ } from "./chunk-RTQDQ6TC.mjs";
7
7
  import {
8
8
  FeedbackButton,
9
9
  FeedbackModal,
@@ -19,7 +19,7 @@ import {
19
19
  useNotificationService,
20
20
  useTTS,
21
21
  useVoiceStore
22
- } from "./chunk-PXXVEH5M.mjs";
22
+ } from "./chunk-XEG45Q6V.mjs";
23
23
  import {
24
24
  authenticationService,
25
25
  brandingService_default,
@@ -43,16 +43,16 @@ import {
43
43
  useMemoryStore,
44
44
  useProjectStore,
45
45
  useVectorStore
46
- } from "./chunk-6IHJZCUH.mjs";
46
+ } from "./chunk-UMPVXYVC.mjs";
47
47
  import {
48
48
  indexedDBService_default,
49
49
  useModelStore,
50
50
  usePackageSettingsStore,
51
51
  usePreferencesStore
52
- } from "./chunk-QHLKGSMB.mjs";
52
+ } from "./chunk-XUBYA5I7.mjs";
53
53
  import {
54
54
  useAIProviderStore
55
- } from "./chunk-AVC6IZJQ.mjs";
55
+ } from "./chunk-IHJPVIGB.mjs";
56
56
  import {
57
57
  debugLogger
58
58
  } from "./chunk-KCI46M23.mjs";
@@ -7828,10 +7828,12 @@ var QuerySuggestionPicker = ({
7828
7828
  } else {
7829
7829
  setExamplePrompts([]);
7830
7830
  setVisiblePrompts([]);
7831
+ hasGenerated.current = false;
7831
7832
  }
7832
7833
  }).catch((error) => {
7833
7834
  setExamplePrompts([]);
7834
7835
  setVisiblePrompts([]);
7836
+ hasGenerated.current = false;
7835
7837
  });
7836
7838
  }, [getCurrentModel, isLoading]);
7837
7839
  useEffect12(() => {
@@ -8362,6 +8364,7 @@ var ChatContent = () => {
8362
8364
  const featureFlag = useFeatureFlag();
8363
8365
  const { isOSSMode } = featureFlag;
8364
8366
  const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
8367
+ const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
8365
8368
  const notificationService = useNotificationService();
8366
8369
  const [selectedTheme, setSelectedTheme] = useState15(null);
8367
8370
  const [themeLoading, setThemeLoading] = useState15(true);
@@ -9195,7 +9198,7 @@ var ChatContent = () => {
9195
9198
  }
9196
9199
  };
9197
9200
  if (!hydrated || brandingLoading || themeLoading) return null;
9198
- const userHasAccess = ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
9201
+ const userHasAccess = playgroundBypassAccess || ossMode || claims?.roles?.includes("super-user") || claims?.roles?.includes("admin");
9199
9202
  if (!userHasAccess) {
9200
9203
  return /* @__PURE__ */ jsxs13(ThemeProvider, { theme: banditTheme, children: [
9201
9204
  /* @__PURE__ */ jsx18(CssBaseline, {}),
@@ -9398,13 +9401,19 @@ var Chat = () => {
9398
9401
  }
9399
9402
  const ossConfigured = !packageSettings.featureFlags?.subscriptionType;
9400
9403
  const allowUnauthenticated = isOSSMode() || ossConfigured;
9404
+ const playgroundBypassAuth = packageSettings.playgroundBypassAuth;
9405
+ const isPlaygroundRoute = typeof window !== "undefined" && window.location.pathname.includes("/playground");
9406
+ const bypassAuth = playgroundBypassAuth || isPlaygroundRoute;
9401
9407
  debugLogger.info("Chat authentication gate", {
9402
9408
  ossConfigured,
9403
9409
  isOSSMode: isOSSMode(),
9404
9410
  tier: featureFlag.getEvaluation()?.tier,
9405
- hasToken: authenticationService.isAuthenticated()
9411
+ hasToken: authenticationService.isAuthenticated(),
9412
+ playgroundBypassAuth,
9413
+ isPlaygroundRoute,
9414
+ bypassAuth
9406
9415
  });
9407
- if (!allowUnauthenticated && !authenticationService.isAuthenticated()) {
9416
+ if (!allowUnauthenticated && !bypassAuth && !authenticationService.isAuthenticated()) {
9408
9417
  debugLogger.debug("User is not authenticated, redirecting to login");
9409
9418
  return /* @__PURE__ */ jsx18(Navigate, { to: "/login", replace: true });
9410
9419
  }
@@ -9415,4 +9424,4 @@ var chat_default = Chat;
9415
9424
  export {
9416
9425
  chat_default
9417
9426
  };
9418
- //# sourceMappingURL=chunk-6YRLBITU.mjs.map
9427
+ //# sourceMappingURL=chunk-5UVULH77.mjs.map