@burtson-labs/bandit-engine 2.0.34 → 2.0.36

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 (166) hide show
  1. package/README.md +3 -2
  2. package/dist/{aiProviderStore-3YS2BZU3.mjs → aiProviderStore-UJRDUYOF.mjs} +2 -2
  3. package/dist/{chat-2LYIZNWZ.mjs → chat-SZK3EBDO.mjs} +5 -5
  4. package/dist/chat-provider.js +227 -11
  5. package/dist/chat-provider.js.map +1 -1
  6. package/dist/chat-provider.mjs +4 -4
  7. package/dist/{chunk-6PQRG6W4.mjs → chunk-2ZZA2IFL.mjs} +3 -3
  8. package/dist/{chunk-GBANNFRD.mjs → chunk-ED5NNDKO.mjs} +3 -3
  9. package/dist/{chunk-XD5VJCFN.mjs → chunk-FJO5ZWYU.mjs} +3 -3
  10. package/dist/{chunk-XXMCI2WK.mjs → chunk-G4OXOTNJ.mjs} +41 -8
  11. package/dist/{chunk-XXMCI2WK.mjs.map → chunk-G4OXOTNJ.mjs.map} +1 -1
  12. package/dist/{chunk-LG2JCTOE.mjs → chunk-PLNFTIGX.mjs} +4 -4
  13. package/dist/{chunk-7RLN6ZGT.mjs → chunk-S635Q6OQ.mjs} +3 -3
  14. package/dist/{chunk-IGD4KGB5.mjs → chunk-ZAVV2AT5.mjs} +4 -4
  15. package/dist/{chunk-IHJPVIGB.mjs → chunk-ZNNOTDRD.mjs} +208 -1
  16. package/dist/chunk-ZNNOTDRD.mjs.map +1 -0
  17. package/dist/cli/cli.js +1964 -126
  18. package/dist/cli/cli.js.map +1 -1
  19. package/dist/{gateway-BiHRHJMM.d.ts → gateway-Ckf_KusF.d.mts} +4 -4
  20. package/dist/{gateway-BiHRHJMM.d.mts → gateway-Ckf_KusF.d.ts} +4 -4
  21. package/dist/index.d.mts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +318 -69
  24. package/dist/index.js.map +1 -1
  25. package/dist/index.mjs +8 -8
  26. package/dist/management/management.js +316 -67
  27. package/dist/management/management.js.map +1 -1
  28. package/dist/management/management.mjs +6 -6
  29. package/dist/modals/chat-modal/chat-modal.js +236 -20
  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/docs/api_reference/classes/DebugLogger.html +11 -11
  35. package/docs/api_reference/classes/FeatureFlagService.html +13 -13
  36. package/docs/api_reference/classes/NotificationService.html +10 -10
  37. package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
  38. package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
  39. package/docs/api_reference/classes/VectorMigrationService.html +8 -8
  40. package/docs/api_reference/classes/VoiceService.html +2 -2
  41. package/docs/api_reference/enums/TTSState.html +2 -2
  42. package/docs/api_reference/functions/Chat.html +1 -1
  43. package/docs/api_reference/functions/ChatModal.html +1 -1
  44. package/docs/api_reference/functions/ChatProvider.html +1 -1
  45. package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
  46. package/docs/api_reference/functions/FeedbackButton.html +1 -1
  47. package/docs/api_reference/functions/FeedbackModal.html +1 -1
  48. package/docs/api_reference/functions/Management.html +1 -1
  49. package/docs/api_reference/functions/NotificationProvider.html +1 -1
  50. package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
  51. package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
  52. package/docs/api_reference/functions/defineCustomElement.html +1 -1
  53. package/docs/api_reference/functions/getCriticalConfig.html +1 -1
  54. package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
  55. package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
  56. package/docs/api_reference/functions/getSystemConstants.html +1 -1
  57. package/docs/api_reference/functions/getTTSState.html +1 -1
  58. package/docs/api_reference/functions/handleHttpError.html +1 -1
  59. package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
  60. package/docs/api_reference/functions/handleValidationError.html +1 -1
  61. package/docs/api_reference/functions/initializeCoreSystem.html +1 -1
  62. package/docs/api_reference/functions/pauseTTS.html +1 -1
  63. package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
  64. package/docs/api_reference/functions/resumeTTS.html +1 -1
  65. package/docs/api_reference/functions/showInfoNotification.html +1 -1
  66. package/docs/api_reference/functions/showSuccessNotification.html +1 -1
  67. package/docs/api_reference/functions/speakWithStreaming.html +1 -1
  68. package/docs/api_reference/functions/stopTTS.html +1 -1
  69. package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
  70. package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
  71. package/docs/api_reference/functions/useFeatureFlag.html +1 -1
  72. package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
  73. package/docs/api_reference/functions/useFeatures.html +1 -1
  74. package/docs/api_reference/functions/useGatewayHealth.html +1 -1
  75. package/docs/api_reference/functions/useGatewayMemory.html +1 -1
  76. package/docs/api_reference/functions/useGatewayModels.html +1 -1
  77. package/docs/api_reference/functions/useGlobalTTS.html +1 -1
  78. package/docs/api_reference/functions/useNotification.html +1 -1
  79. package/docs/api_reference/functions/useNotificationService.html +1 -1
  80. package/docs/api_reference/functions/useTTS.html +1 -1
  81. package/docs/api_reference/functions/useVectorStore.html +1 -1
  82. package/docs/api_reference/functions/useVoiceStore.html +2 -2
  83. package/docs/api_reference/functions/useVoices.html +1 -1
  84. package/docs/api_reference/functions/validateEnvironment.html +1 -1
  85. package/docs/api_reference/functions/validateSystemIntegrity.html +1 -1
  86. package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
  87. package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
  88. package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
  89. package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
  90. package/docs/api_reference/interfaces/AIMessage.html +2 -2
  91. package/docs/api_reference/interfaces/AIModel.html +2 -2
  92. package/docs/api_reference/interfaces/AIProviderConfig.html +2 -2
  93. package/docs/api_reference/interfaces/ChatConfig.html +3 -3
  94. package/docs/api_reference/interfaces/ChatModalProps.html +3 -3
  95. package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
  96. package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
  97. package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
  98. package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
  99. package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
  100. package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
  101. package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
  102. package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
  103. package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
  104. package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
  105. package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
  106. package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
  107. package/docs/api_reference/interfaces/GatewayChatRequest.html +2 -2
  108. package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
  109. package/docs/api_reference/interfaces/GatewayContract.html +2 -2
  110. package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
  111. package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
  112. package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
  113. package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
  114. package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
  115. package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
  116. package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
  117. package/docs/api_reference/interfaces/GatewayModel.html +2 -2
  118. package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
  119. package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
  120. package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
  121. package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
  122. package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
  123. package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
  124. package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
  125. package/docs/api_reference/interfaces/PackageSettings.html +2 -2
  126. package/docs/api_reference/interfaces/SearchOptions.html +2 -2
  127. package/docs/api_reference/interfaces/SearchResult.html +2 -2
  128. package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
  129. package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
  130. package/docs/api_reference/interfaces/TTSOptions.html +2 -2
  131. package/docs/api_reference/interfaces/TTSProgress.html +2 -2
  132. package/docs/api_reference/interfaces/TrialUsage.html +2 -2
  133. package/docs/api_reference/interfaces/UploadRequest.html +3 -3
  134. package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
  135. package/docs/api_reference/interfaces/VectorDocument.html +2 -2
  136. package/docs/api_reference/interfaces/VectorMemory.html +2 -2
  137. package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
  138. package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
  139. package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
  140. package/docs/api_reference/interfaces/VoiceState.html +2 -2
  141. package/docs/api_reference/types/FeatureKey.html +1 -1
  142. package/docs/api_reference/types/FeatureMatrix.html +1 -1
  143. package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
  144. package/docs/api_reference/types/LogContext.html +1 -1
  145. package/docs/api_reference/types/SubscriptionTier.html +1 -1
  146. package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
  147. package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
  148. package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
  149. package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -1
  150. package/docs/api_reference/variables/authenticationService.html +1 -1
  151. package/docs/api_reference/variables/debugLogger-1.html +1 -1
  152. package/docs/api_reference/variables/featureFlagService-1.html +1 -1
  153. package/docs/api_reference/variables/notificationService-1.html +1 -1
  154. package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
  155. package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
  156. package/docs/api_reference/variables/voiceService-1.html +1 -1
  157. package/package.json +1 -1
  158. package/dist/chunk-IHJPVIGB.mjs.map +0 -1
  159. /package/dist/{aiProviderStore-3YS2BZU3.mjs.map → aiProviderStore-UJRDUYOF.mjs.map} +0 -0
  160. /package/dist/{chat-2LYIZNWZ.mjs.map → chat-SZK3EBDO.mjs.map} +0 -0
  161. /package/dist/{chunk-6PQRG6W4.mjs.map → chunk-2ZZA2IFL.mjs.map} +0 -0
  162. /package/dist/{chunk-GBANNFRD.mjs.map → chunk-ED5NNDKO.mjs.map} +0 -0
  163. /package/dist/{chunk-XD5VJCFN.mjs.map → chunk-FJO5ZWYU.mjs.map} +0 -0
  164. /package/dist/{chunk-LG2JCTOE.mjs.map → chunk-PLNFTIGX.mjs.map} +0 -0
  165. /package/dist/{chunk-7RLN6ZGT.mjs.map → chunk-S635Q6OQ.mjs.map} +0 -0
  166. /package/dist/{chunk-IGD4KGB5.mjs.map → chunk-ZAVV2AT5.mjs.map} +0 -0
package/dist/index.js CHANGED
@@ -12,11 +12,11 @@ var __export = (target, all) => {
12
12
  for (var name in all)
13
13
  __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
- var __copyProps = (to, from8, except, desc) => {
16
- if (from8 && typeof from8 === "object" || typeof from8 === "function") {
17
- for (let key of __getOwnPropNames(from8))
15
+ var __copyProps = (to, from9, except, desc) => {
16
+ if (from9 && typeof from9 === "object" || typeof from9 === "function") {
17
+ for (let key of __getOwnPropNames(from9))
18
18
  if (!__hasOwnProp.call(to, key) && key !== except)
19
- __defProp(to, key, { get: () => from8[key], enumerable: !(desc = __getOwnPropDesc(from8, key)) || desc.enumerable });
19
+ __defProp(to, key, { get: () => from9[key], enumerable: !(desc = __getOwnPropDesc(from9, key)) || desc.enumerable });
20
20
  }
21
21
  return to;
22
22
  };
@@ -5587,6 +5587,216 @@ var init_playground_provider = __esm({
5587
5587
  }
5588
5588
  });
5589
5589
 
5590
+ // src/services/ai-provider/providers/xai.provider.ts
5591
+ var import_rxjs9, XAIProvider;
5592
+ var init_xai_provider = __esm({
5593
+ "src/services/ai-provider/providers/xai.provider.ts"() {
5594
+ "use strict";
5595
+ import_rxjs9 = require("rxjs");
5596
+ init_common_types();
5597
+ init_debugLogger();
5598
+ XAIProvider = class {
5599
+ config;
5600
+ baseUrl;
5601
+ constructor(config) {
5602
+ this.config = config;
5603
+ this.baseUrl = config.baseUrl || "https://api.x.ai/v1";
5604
+ }
5605
+ chat(request) {
5606
+ const url = `${this.baseUrl}/chat/completions`;
5607
+ const payload = {
5608
+ model: request.model,
5609
+ messages: request.messages,
5610
+ stream: Boolean(request.stream),
5611
+ temperature: request.temperature,
5612
+ max_tokens: request.maxTokens
5613
+ };
5614
+ if (request.stream) {
5615
+ return this.streamChatRequest(url, payload);
5616
+ } else {
5617
+ return this.nonStreamChatRequest(url, payload);
5618
+ }
5619
+ }
5620
+ generate(request) {
5621
+ const chatRequest = {
5622
+ model: request.model,
5623
+ messages: [{ role: "user", content: request.prompt }],
5624
+ stream: request.stream,
5625
+ options: request.options
5626
+ };
5627
+ return this.chat(chatRequest).pipe(
5628
+ (0, import_rxjs9.map)((response) => ({
5629
+ response: response.message.content,
5630
+ done: response.done
5631
+ }))
5632
+ );
5633
+ }
5634
+ listModels() {
5635
+ const url = `${this.baseUrl}/models`;
5636
+ return (0, import_rxjs9.from)(fetch(url, {
5637
+ headers: this.getHeaders()
5638
+ })).pipe(
5639
+ (0, import_rxjs9.switchMap)((response) => {
5640
+ if (!response.ok) {
5641
+ return (0, import_rxjs9.throwError)(() => new Error(`Failed to list models: ${response.status}`));
5642
+ }
5643
+ return (0, import_rxjs9.from)(response.json());
5644
+ }),
5645
+ (0, import_rxjs9.map)(
5646
+ (data) => data.data.map((model) => ({
5647
+ name: model.id,
5648
+ details: {
5649
+ format: "xai",
5650
+ family: model.object
5651
+ }
5652
+ }))
5653
+ )
5654
+ );
5655
+ }
5656
+ async validateServiceAvailability(args) {
5657
+ try {
5658
+ const controller = new AbortController();
5659
+ const timeoutId = setTimeout(() => controller.abort(), args.timeoutMs);
5660
+ const response = await fetch(`${this.baseUrl}/models`, {
5661
+ headers: this.getHeaders(),
5662
+ signal: controller.signal
5663
+ });
5664
+ clearTimeout(timeoutId);
5665
+ return {
5666
+ url: this.baseUrl,
5667
+ isAvailable: response.ok
5668
+ };
5669
+ } catch (error) {
5670
+ if (args.fallbackUrl) {
5671
+ try {
5672
+ const controller = new AbortController();
5673
+ const timeoutId = setTimeout(() => controller.abort(), args.timeoutMs);
5674
+ const response = await fetch(`${args.fallbackUrl}/models`, {
5675
+ headers: this.getHeaders(),
5676
+ signal: controller.signal
5677
+ });
5678
+ clearTimeout(timeoutId);
5679
+ if (response.ok) {
5680
+ this.baseUrl = args.fallbackUrl;
5681
+ return {
5682
+ url: args.fallbackUrl,
5683
+ isAvailable: true
5684
+ };
5685
+ }
5686
+ } catch (fallbackError) {
5687
+ debugLogger.warn("xAI fallback validation failed", { error: fallbackError });
5688
+ }
5689
+ }
5690
+ return {
5691
+ url: this.baseUrl,
5692
+ isAvailable: false
5693
+ };
5694
+ }
5695
+ }
5696
+ getProviderType() {
5697
+ return "xai" /* XAI */;
5698
+ }
5699
+ getConfig() {
5700
+ return this.config;
5701
+ }
5702
+ streamChatRequest(url, payload) {
5703
+ return new import_rxjs9.Observable((observer) => {
5704
+ const task = fetch(url, {
5705
+ method: "POST",
5706
+ headers: {
5707
+ ...this.getHeaders(),
5708
+ "Content-Type": "application/json"
5709
+ },
5710
+ body: JSON.stringify(payload)
5711
+ });
5712
+ task.then((response) => {
5713
+ if (!response.ok) {
5714
+ observer.error(new Error(`xAI request failed: ${response.status}`));
5715
+ return;
5716
+ }
5717
+ const reader = response.body?.getReader();
5718
+ const decoder = new TextDecoder();
5719
+ let buffer = "";
5720
+ const read = () => {
5721
+ reader?.read().then(({ done, value }) => {
5722
+ if (done) {
5723
+ observer.next({
5724
+ message: { content: "", role: "assistant" },
5725
+ done: true
5726
+ });
5727
+ observer.complete();
5728
+ return;
5729
+ }
5730
+ buffer += decoder.decode(value, { stream: true });
5731
+ const lines = buffer.split("\n");
5732
+ buffer = lines.pop() ?? "";
5733
+ for (const line of lines) {
5734
+ if (line.trim() && line.startsWith("data: ")) {
5735
+ const data = line.slice(6).trim();
5736
+ if (data === "[DONE]") {
5737
+ observer.next({
5738
+ message: { content: "", role: "assistant" },
5739
+ done: true
5740
+ });
5741
+ observer.complete();
5742
+ return;
5743
+ }
5744
+ try {
5745
+ const parsed = JSON.parse(data);
5746
+ const content = parsed.choices?.[0]?.delta?.content ?? "";
5747
+ if (content) {
5748
+ observer.next({
5749
+ message: { content, role: "assistant" },
5750
+ done: false
5751
+ });
5752
+ }
5753
+ } catch (err) {
5754
+ debugLogger.error("Error parsing xAI stream data:", { data, error: err });
5755
+ }
5756
+ }
5757
+ }
5758
+ read();
5759
+ }).catch((err) => observer.error(err));
5760
+ };
5761
+ read();
5762
+ }).catch((err) => observer.error(err));
5763
+ });
5764
+ }
5765
+ nonStreamChatRequest(url, payload) {
5766
+ return (0, import_rxjs9.from)(fetch(url, {
5767
+ method: "POST",
5768
+ headers: {
5769
+ ...this.getHeaders(),
5770
+ "Content-Type": "application/json"
5771
+ },
5772
+ body: JSON.stringify(payload)
5773
+ })).pipe(
5774
+ (0, import_rxjs9.switchMap)((response) => {
5775
+ if (!response.ok) {
5776
+ return (0, import_rxjs9.throwError)(() => new Error(`xAI request failed: ${response.status}`));
5777
+ }
5778
+ return (0, import_rxjs9.from)(response.json());
5779
+ }),
5780
+ (0, import_rxjs9.map)((data) => ({
5781
+ message: {
5782
+ content: data.choices?.[0]?.message?.content ?? "",
5783
+ role: "assistant"
5784
+ },
5785
+ done: true
5786
+ }))
5787
+ );
5788
+ }
5789
+ getHeaders() {
5790
+ const headers = {};
5791
+ if (this.config.apiKey) {
5792
+ headers["Authorization"] = `Bearer ${this.config.apiKey}`;
5793
+ }
5794
+ return headers;
5795
+ }
5796
+ };
5797
+ }
5798
+ });
5799
+
5590
5800
  // src/services/ai-provider/ai-provider.factory.ts
5591
5801
  var AIProviderFactory;
5592
5802
  var init_ai_provider_factory = __esm({
@@ -5599,6 +5809,7 @@ var init_ai_provider_factory = __esm({
5599
5809
  init_anthropic_provider();
5600
5810
  init_gateway_provider();
5601
5811
  init_playground_provider();
5812
+ init_xai_provider();
5602
5813
  AIProviderFactory = class {
5603
5814
  static createProvider(config) {
5604
5815
  switch (config.type) {
@@ -5610,6 +5821,8 @@ var init_ai_provider_factory = __esm({
5610
5821
  return new AzureOpenAIProvider(config);
5611
5822
  case "anthropic" /* ANTHROPIC */:
5612
5823
  return new AnthropicProvider(config);
5824
+ case "xai" /* XAI */:
5825
+ return new XAIProvider(config);
5613
5826
  case "gateway" /* GATEWAY */:
5614
5827
  return new GatewayProvider(config);
5615
5828
  case "playground" /* PLAYGROUND */:
@@ -5624,6 +5837,7 @@ var init_ai_provider_factory = __esm({
5624
5837
  "openai" /* OPENAI */,
5625
5838
  "azure-openai" /* AZURE_OPENAI */,
5626
5839
  "anthropic" /* ANTHROPIC */,
5840
+ "xai" /* XAI */,
5627
5841
  "gateway" /* GATEWAY */,
5628
5842
  "playground" /* PLAYGROUND */
5629
5843
  ];
@@ -5639,6 +5853,8 @@ var init_ai_provider_factory = __esm({
5639
5853
  return !!(config.baseUrl && config.apiKey && config.apiVersion && config.deploymentName);
5640
5854
  case "anthropic" /* ANTHROPIC */:
5641
5855
  return !!config.apiKey;
5856
+ case "xai" /* XAI */:
5857
+ return !!config.apiKey;
5642
5858
  case "gateway" /* GATEWAY */:
5643
5859
  return !!(config.gatewayUrl && config.provider);
5644
5860
  case "playground" /* PLAYGROUND */:
@@ -5997,11 +6213,11 @@ var init_notificationService = __esm({
5997
6213
  });
5998
6214
 
5999
6215
  // src/services/prompts/conversationStarters.ts
6000
- var import_rxjs9, generateConversationStarters;
6216
+ var import_rxjs10, generateConversationStarters;
6001
6217
  var init_conversationStarters = __esm({
6002
6218
  "src/services/prompts/conversationStarters.ts"() {
6003
6219
  "use strict";
6004
- import_rxjs9 = require("rxjs");
6220
+ import_rxjs10 = require("rxjs");
6005
6221
  init_aiProviderStore();
6006
6222
  init_packageSettingsStore();
6007
6223
  init_getStableQuestionPrompt();
@@ -6022,13 +6238,13 @@ var init_conversationStarters = __esm({
6022
6238
  stream: false,
6023
6239
  options: { temperature: 1.5, num_predict: 250 }
6024
6240
  });
6025
- const questions$ = data$.pipe((0, import_rxjs9.map)((d) => {
6241
+ const questions$ = data$.pipe((0, import_rxjs10.map)((d) => {
6026
6242
  const lines = d.response.split("\n").map((line) => line.trim()).filter((line) => {
6027
6243
  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("?");
6028
6244
  });
6029
6245
  return lines;
6030
6246
  }));
6031
- const starters = await (0, import_rxjs9.lastValueFrom)(questions$);
6247
+ const starters = await (0, import_rxjs10.lastValueFrom)(questions$);
6032
6248
  if (starters.length === 0) {
6033
6249
  debugLogger.warn("No meaningful conversation starters generated");
6034
6250
  return [];
@@ -6044,11 +6260,11 @@ var init_conversationStarters = __esm({
6044
6260
  });
6045
6261
 
6046
6262
  // src/services/prompts/moodDetection.ts
6047
- var import_rxjs10, detectMessageMood;
6263
+ var import_rxjs11, detectMessageMood;
6048
6264
  var init_moodDetection = __esm({
6049
6265
  "src/services/prompts/moodDetection.ts"() {
6050
6266
  "use strict";
6051
- import_rxjs10 = require("rxjs");
6267
+ import_rxjs11 = require("rxjs");
6052
6268
  init_aiProviderStore();
6053
6269
  init_packageSettingsStore();
6054
6270
  init_debugLogger();
@@ -6079,8 +6295,8 @@ Response:`;
6079
6295
  options: { temperature: 0.3, num_predict: 10 }
6080
6296
  });
6081
6297
  const chunks$ = response$.pipe(
6082
- (0, import_rxjs10.map)((chunk) => chunk.response.trim().toLowerCase()),
6083
- (0, import_rxjs10.toArray)()
6298
+ (0, import_rxjs11.map)((chunk) => chunk.response.trim().toLowerCase()),
6299
+ (0, import_rxjs11.toArray)()
6084
6300
  );
6085
6301
  const result = await chunks$.toPromise();
6086
6302
  const finalResult = (result || []).join("").trim();
@@ -6097,11 +6313,11 @@ Response:`;
6097
6313
  });
6098
6314
 
6099
6315
  // src/services/prompts/detectUserInterestAndExcitement.ts
6100
- var import_rxjs11, detectUserInterestAndExcitement;
6316
+ var import_rxjs12, detectUserInterestAndExcitement;
6101
6317
  var init_detectUserInterestAndExcitement = __esm({
6102
6318
  "src/services/prompts/detectUserInterestAndExcitement.ts"() {
6103
6319
  "use strict";
6104
- import_rxjs11 = require("rxjs");
6320
+ import_rxjs12 = require("rxjs");
6105
6321
  init_aiProviderStore();
6106
6322
  init_packageSettingsStore();
6107
6323
  init_debugLogger();
@@ -6148,10 +6364,10 @@ var init_detectUserInterestAndExcitement = __esm({
6148
6364
  options: { temperature: 0.1, num_predict: 5 }
6149
6365
  });
6150
6366
  const chunks$ = response$.pipe(
6151
- (0, import_rxjs11.map)((chunk) => chunk.response.trim().toUpperCase()),
6152
- (0, import_rxjs11.toArray)()
6367
+ (0, import_rxjs12.map)((chunk) => chunk.response.trim().toUpperCase()),
6368
+ (0, import_rxjs12.toArray)()
6153
6369
  );
6154
- const result = await (0, import_rxjs11.lastValueFrom)(chunks$);
6370
+ const result = await (0, import_rxjs12.lastValueFrom)(chunks$);
6155
6371
  const decision = result.join("").trim();
6156
6372
  debugLogger.llmDebug("detectUserInterestAndExcitement result", { decision });
6157
6373
  return decision.includes("YES");
@@ -6164,11 +6380,11 @@ var init_detectUserInterestAndExcitement = __esm({
6164
6380
  });
6165
6381
 
6166
6382
  // src/services/prompts/documentSummarization.ts
6167
- var import_rxjs12, summarizeDocument;
6383
+ var import_rxjs13, summarizeDocument;
6168
6384
  var init_documentSummarization = __esm({
6169
6385
  "src/services/prompts/documentSummarization.ts"() {
6170
6386
  "use strict";
6171
- import_rxjs12 = require("rxjs");
6387
+ import_rxjs13 = require("rxjs");
6172
6388
  init_aiProviderStore();
6173
6389
  init_packageSettingsStore();
6174
6390
  init_debugLogger();
@@ -6196,8 +6412,8 @@ ${content.slice(0, 4e3)}
6196
6412
  stream: false,
6197
6413
  options: { temperature: 0.3, num_predict: 100 }
6198
6414
  });
6199
- const summary$ = data$.pipe((0, import_rxjs12.map)((d) => d.response.trim()));
6200
- const summary = await (0, import_rxjs12.lastValueFrom)(summary$);
6415
+ const summary$ = data$.pipe((0, import_rxjs13.map)((d) => d.response.trim()));
6416
+ const summary = await (0, import_rxjs13.lastValueFrom)(summary$);
6201
6417
  debugLogger.ragDebug("summarizeDocument result", { name, summary });
6202
6418
  return summary || `Document summary for ${name}`;
6203
6419
  } catch (error) {
@@ -6209,11 +6425,11 @@ ${content.slice(0, 4e3)}
6209
6425
  });
6210
6426
 
6211
6427
  // src/services/prompts/documentRelevance.ts
6212
- var import_rxjs13, determineRelevantDocuments;
6428
+ var import_rxjs14, determineRelevantDocuments;
6213
6429
  var init_documentRelevance = __esm({
6214
6430
  "src/services/prompts/documentRelevance.ts"() {
6215
6431
  "use strict";
6216
- import_rxjs13 = require("rxjs");
6432
+ import_rxjs14 = require("rxjs");
6217
6433
  init_aiProviderStore();
6218
6434
  init_packageSettingsStore();
6219
6435
  init_debugLogger();
@@ -6254,10 +6470,10 @@ Response:`;
6254
6470
  options: { temperature: 0.2, num_predict: 50 }
6255
6471
  });
6256
6472
  const chunks$ = response$.pipe(
6257
- (0, import_rxjs13.map)((chunk) => chunk.response.trim()),
6258
- (0, import_rxjs13.toArray)()
6473
+ (0, import_rxjs14.map)((chunk) => chunk.response.trim()),
6474
+ (0, import_rxjs14.toArray)()
6259
6475
  );
6260
- const result = await (0, import_rxjs13.lastValueFrom)(chunks$);
6476
+ const result = await (0, import_rxjs14.lastValueFrom)(chunks$);
6261
6477
  const vetResult = result.join("").trim().toLowerCase();
6262
6478
  debugLogger.ragDebug("determineRelevantDocuments result", { vetResult });
6263
6479
  if (vetResult.includes("none") || !vetResult) {
@@ -11645,11 +11861,11 @@ var init_ttsSanitizer = __esm({
11645
11861
  });
11646
11862
 
11647
11863
  // src/services/tts/tts-client.ts
11648
- var import_rxjs14, getOrAppendAuthHeader;
11864
+ var import_rxjs15, getOrAppendAuthHeader;
11649
11865
  var init_tts_client = __esm({
11650
11866
  "src/services/tts/tts-client.ts"() {
11651
11867
  "use strict";
11652
- import_rxjs14 = require("rxjs");
11868
+ import_rxjs15 = require("rxjs");
11653
11869
  init_authenticationService();
11654
11870
  init_voiceStore();
11655
11871
  init_ttsSanitizer();
@@ -11669,11 +11885,11 @@ var init_tts_client = __esm({
11669
11885
  });
11670
11886
 
11671
11887
  // src/services/tts/streaming-tts.ts
11672
- var import_rxjs15, TTSState, StreamingTTSClient, getStreamingTTSClient, speakStream, stopTTS, pauseTTS, resumeTTS, getTTSState;
11888
+ var import_rxjs16, TTSState, StreamingTTSClient, getStreamingTTSClient, speakStream, stopTTS, pauseTTS, resumeTTS, getTTSState;
11673
11889
  var init_streaming_tts = __esm({
11674
11890
  "src/services/tts/streaming-tts.ts"() {
11675
11891
  "use strict";
11676
- import_rxjs15 = require("rxjs");
11892
+ import_rxjs16 = require("rxjs");
11677
11893
  init_debugLogger();
11678
11894
  init_packageSettingsStore();
11679
11895
  init_tts_client();
@@ -11693,8 +11909,8 @@ var init_streaming_tts = __esm({
11693
11909
  // Store event handler references for proper cleanup
11694
11910
  audioHandlers = /* @__PURE__ */ new Map();
11695
11911
  // State management
11696
- stateSubject = new import_rxjs15.BehaviorSubject("IDLE" /* IDLE */);
11697
- progressSubject = new import_rxjs15.Subject();
11912
+ stateSubject = new import_rxjs16.BehaviorSubject("IDLE" /* IDLE */);
11913
+ progressSubject = new import_rxjs16.Subject();
11698
11914
  constructor() {
11699
11915
  }
11700
11916
  static getInstance() {
@@ -11725,7 +11941,7 @@ var init_streaming_tts = __esm({
11725
11941
  * Speak text with simple streaming
11726
11942
  */
11727
11943
  speakStream(text, voice, options = {}) {
11728
- return new import_rxjs15.Observable((subscriber) => {
11944
+ return new import_rxjs16.Observable((subscriber) => {
11729
11945
  this.performSimpleStreaming(text, voice, options, subscriber);
11730
11946
  });
11731
11947
  }
@@ -14254,28 +14470,28 @@ var init_create_audio_blob = __esm({
14254
14470
  });
14255
14471
 
14256
14472
  // src/services/stt/sound-recorder.service.ts
14257
- var import_rxjs16, SoundRecorderService;
14473
+ var import_rxjs17, SoundRecorderService;
14258
14474
  var init_sound_recorder_service = __esm({
14259
14475
  "src/services/stt/sound-recorder.service.ts"() {
14260
14476
  "use strict";
14261
- import_rxjs16 = require("rxjs");
14477
+ import_rxjs17 = require("rxjs");
14262
14478
  init_create_audio_blob();
14263
14479
  SoundRecorderService = class {
14264
14480
  _mediaRecorder;
14265
14481
  start() {
14266
- const mediaStream = (0, import_rxjs16.from)(navigator.mediaDevices.getUserMedia({ audio: true }));
14267
- this._mediaRecorder = mediaStream.pipe((0, import_rxjs16.map)((stream) => {
14482
+ const mediaStream = (0, import_rxjs17.from)(navigator.mediaDevices.getUserMedia({ audio: true }));
14483
+ this._mediaRecorder = mediaStream.pipe((0, import_rxjs17.map)((stream) => {
14268
14484
  const rec = new MediaRecorder(stream);
14269
14485
  rec.start();
14270
14486
  return rec;
14271
- }), (0, import_rxjs16.shareReplay)(1));
14487
+ }), (0, import_rxjs17.shareReplay)(1));
14272
14488
  const dataAvailableEvent = this._mediaRecorder.pipe(
14273
- (0, import_rxjs16.switchMap)((recorder) => (0, import_rxjs16.fromEvent)(recorder, "dataavailable"))
14489
+ (0, import_rxjs17.switchMap)((recorder) => (0, import_rxjs17.fromEvent)(recorder, "dataavailable"))
14274
14490
  );
14275
14491
  const blob = dataAvailableEvent.pipe(
14276
- (0, import_rxjs16.first)(),
14277
- (0, import_rxjs16.map)((event) => createAudioBlob(event.data)),
14278
- (0, import_rxjs16.shareReplay)(1)
14492
+ (0, import_rxjs17.first)(),
14493
+ (0, import_rxjs17.map)((event) => createAudioBlob(event.data)),
14494
+ (0, import_rxjs17.shareReplay)(1)
14279
14495
  );
14280
14496
  return blob;
14281
14497
  }
@@ -14283,7 +14499,7 @@ var init_sound_recorder_service = __esm({
14283
14499
  if (!this._mediaRecorder) {
14284
14500
  return;
14285
14501
  }
14286
- this._mediaRecorder.pipe((0, import_rxjs16.first)()).subscribe((recorder) => {
14502
+ this._mediaRecorder.pipe((0, import_rxjs17.first)()).subscribe((recorder) => {
14287
14503
  recorder.stop();
14288
14504
  });
14289
14505
  }
@@ -14403,7 +14619,7 @@ var init_stt_client = __esm({
14403
14619
  });
14404
14620
 
14405
14621
  // src/services/stt/transcriber.tsx
14406
- var import_react16, import_Mic, import_Check4, import_Close3, import_material10, import_rxjs17, import_jsx_runtime13, initialButtonStyles, Transcriber, transcriber_default;
14622
+ var import_react16, import_Mic, import_Check4, import_Close3, import_material10, import_rxjs18, import_jsx_runtime13, initialButtonStyles, Transcriber, transcriber_default;
14407
14623
  var init_transcriber = __esm({
14408
14624
  "src/services/stt/transcriber.tsx"() {
14409
14625
  "use strict";
@@ -14414,7 +14630,7 @@ var init_transcriber = __esm({
14414
14630
  init_sound_recorder_service();
14415
14631
  init_stt_client();
14416
14632
  import_material10 = require("@mui/material");
14417
- import_rxjs17 = require("rxjs");
14633
+ import_rxjs18 = require("rxjs");
14418
14634
  init_debugLogger();
14419
14635
  import_jsx_runtime13 = require("react/jsx-runtime");
14420
14636
  initialButtonStyles = (badgeBackground, fileText, hoverBadgeBackground) => ({
@@ -14433,14 +14649,14 @@ var init_transcriber = __esm({
14433
14649
  const [status, setStatus] = (0, import_react16.useState)("IDLE");
14434
14650
  const recorderRef = (0, import_react16.useRef)(new SoundRecorderService());
14435
14651
  const [iconButtonStyles] = (0, import_react16.useState)(() => initialButtonStyles(badgeBackground, fileText, hoverBadgeBackground));
14436
- const [recordingSub, setRecordingSub] = (0, import_react16.useState)(() => new import_rxjs17.Subscription());
14652
+ const [recordingSub, setRecordingSub] = (0, import_react16.useState)(() => new import_rxjs18.Subscription());
14437
14653
  const start = () => {
14438
14654
  recordingSub.unsubscribe();
14439
14655
  const recording = recorderRef.current.start();
14440
14656
  const text = recording.pipe(
14441
- (0, import_rxjs17.switchMap)((blob) => {
14657
+ (0, import_rxjs18.switchMap)((blob) => {
14442
14658
  debugLogger.debug("Processing audio blob for transcription");
14443
- return (0, import_rxjs17.from)(STTClient.transcribe(blob));
14659
+ return (0, import_rxjs18.from)(STTClient.transcribe(blob));
14444
14660
  })
14445
14661
  );
14446
14662
  const sub = text.subscribe({
@@ -18054,11 +18270,11 @@ ${sanitize(
18054
18270
  });
18055
18271
 
18056
18272
  // src/chat/hooks/useMemoryEnhancer.tsx
18057
- var import_rxjs18, MEMORY_LIMIT, MIN_MEMORY_WORDS, MERGE_THRESHOLD, REJECT_ECHO_THRESHOLD, REJECT_DUPLICATE_THRESHOLD, CONTEXTUAL_DIVERGENCE_THRESHOLD, normalizeText, isStructurallyDuplicate, isAboutBandit, hasEngagementValue, isMemoryTooShortOrGeneric, isPersonalText, mergeMemory, isVoiceShifted, sanitizeMemory, sanitizeMemoryText, shouldAcceptMemory, isContextuallyDivergent, useMemoryEnhancer;
18273
+ var import_rxjs19, MEMORY_LIMIT, MIN_MEMORY_WORDS, MERGE_THRESHOLD, REJECT_ECHO_THRESHOLD, REJECT_DUPLICATE_THRESHOLD, CONTEXTUAL_DIVERGENCE_THRESHOLD, normalizeText, isStructurallyDuplicate, isAboutBandit, hasEngagementValue, isMemoryTooShortOrGeneric, isPersonalText, mergeMemory, isVoiceShifted, sanitizeMemory, sanitizeMemoryText, shouldAcceptMemory, isContextuallyDivergent, useMemoryEnhancer;
18058
18274
  var init_useMemoryEnhancer = __esm({
18059
18275
  "src/chat/hooks/useMemoryEnhancer.tsx"() {
18060
18276
  "use strict";
18061
- import_rxjs18 = require("rxjs");
18277
+ import_rxjs19 = require("rxjs");
18062
18278
  init_memoryStore();
18063
18279
  init_aiProviderStore();
18064
18280
  init_packageSettingsStore();
@@ -18450,8 +18666,8 @@ var init_useMemoryEnhancer = __esm({
18450
18666
  stream: false,
18451
18667
  options: { temperature: 0.1, num_predict: 150 }
18452
18668
  });
18453
- const suggestion = await (0, import_rxjs18.lastValueFrom)(
18454
- result$.pipe((0, import_rxjs18.map)((chunk) => chunk.response))
18669
+ const suggestion = await (0, import_rxjs19.lastValueFrom)(
18670
+ result$.pipe((0, import_rxjs19.map)((chunk) => chunk.response))
18455
18671
  );
18456
18672
  debugLogger.memoryDebug(`LLM memory suggestion received (${attempt})`, {
18457
18673
  suggestion: typeof suggestion === "string" ? suggestion.slice(0, 200) : suggestion,
@@ -24044,14 +24260,14 @@ var init_chat_app_bar = __esm({
24044
24260
  });
24045
24261
 
24046
24262
  // src/chat/hooks/useConversationNameGenerator.tsx
24047
- var import_rxjs19, import_operators5, useConversationNameGenerator;
24263
+ var import_rxjs20, import_operators5, useConversationNameGenerator;
24048
24264
  var init_useConversationNameGenerator = __esm({
24049
24265
  "src/chat/hooks/useConversationNameGenerator.tsx"() {
24050
24266
  "use strict";
24051
24267
  init_aiProviderStore();
24052
24268
  init_packageSettingsStore();
24053
24269
  init_debugLogger();
24054
- import_rxjs19 = require("rxjs");
24270
+ import_rxjs20 = require("rxjs");
24055
24271
  import_operators5 = require("rxjs/operators");
24056
24272
  init_conversationStore();
24057
24273
  useConversationNameGenerator = () => {
@@ -24087,7 +24303,7 @@ Respond with just the title and nothing else.
24087
24303
  num_predict: 20
24088
24304
  }
24089
24305
  });
24090
- const title = await (0, import_rxjs19.lastValueFrom)(
24306
+ const title = await (0, import_rxjs20.lastValueFrom)(
24091
24307
  result$.pipe((0, import_operators5.map)((d) => d.response?.trim().replace(/["']/g, "")))
24092
24308
  );
24093
24309
  if (title && title.length > 0) {
@@ -29360,7 +29576,7 @@ init_modelStore();
29360
29576
  init_ai_response_text_field();
29361
29577
  init_memory_modal();
29362
29578
  init_streaming_tts();
29363
- var import_rxjs20 = require("rxjs");
29579
+ var import_rxjs21 = require("rxjs");
29364
29580
  init_debugLogger();
29365
29581
  init_util();
29366
29582
  var import_jsx_runtime32 = require("react/jsx-runtime");
@@ -29389,7 +29605,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
29389
29605
  const [memoryModalOpen, setMemoryModalOpen] = (0, import_react39.useState)(false);
29390
29606
  const [contextMode, setContextMode] = (0, import_react39.useState)("local");
29391
29607
  const [expandedSections, setExpandedSections] = (0, import_react39.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
29392
- const [audioSub, setAudioSub] = (0, import_react39.useState)(new import_rxjs20.Subscription());
29608
+ const [audioSub, setAudioSub] = (0, import_react39.useState)(new import_rxjs21.Subscription());
29393
29609
  const [isContextSwitching, setIsContextSwitching] = (0, import_react39.useState)(false);
29394
29610
  const [isDrawerLoading, setIsDrawerLoading] = (0, import_react39.useState)(false);
29395
29611
  (0, import_react39.useEffect)(() => {
@@ -31052,7 +31268,7 @@ init_debugLogger();
31052
31268
  init_banditTheme();
31053
31269
  init_themeMap();
31054
31270
  init_useTTS();
31055
- var import_rxjs21 = require("rxjs");
31271
+ var import_rxjs22 = require("rxjs");
31056
31272
  var import_jsx_runtime34 = require("react/jsx-runtime");
31057
31273
  var FULL_SCREEN_THRESHOLD = 100;
31058
31274
  var CDN_BASE2 = "https://cdn.burtson.ai/";
@@ -31119,7 +31335,7 @@ var ChatModal = ({
31119
31335
  const [modalLogo, setModalLogo] = (0, import_react42.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
31120
31336
  const [modelAnchorEl, setModelAnchorEl] = (0, import_react42.useState)(null);
31121
31337
  const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react42.useState)(null);
31122
- const [audioSub, setAudioSub] = (0, import_react42.useState)(new import_rxjs21.Subscription());
31338
+ const [audioSub, setAudioSub] = (0, import_react42.useState)(new import_rxjs22.Subscription());
31123
31339
  const [selectedTheme, setSelectedTheme] = (0, import_react42.useState)(null);
31124
31340
  const [themeLoading, setThemeLoading] = (0, import_react42.useState)(true);
31125
31341
  const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react42.useState)(false);
@@ -33660,7 +33876,7 @@ init_conversationSyncStore();
33660
33876
 
33661
33877
  // src/hooks/useGatewayQueries.ts
33662
33878
  var import_react45 = require("react");
33663
- var import_rxjs22 = require("rxjs");
33879
+ var import_rxjs23 = require("rxjs");
33664
33880
  var import_react_query2 = require("@tanstack/react-query");
33665
33881
  init_packageSettingsStore();
33666
33882
  init_gateway_service();
@@ -33691,7 +33907,7 @@ var useGatewayHealth = (options) => {
33691
33907
  if (!service) {
33692
33908
  throw new Error("Gateway service is not configured");
33693
33909
  }
33694
- return (0, import_rxjs22.lastValueFrom)(service.getHealth());
33910
+ return (0, import_rxjs23.lastValueFrom)(service.getHealth());
33695
33911
  },
33696
33912
  enabled
33697
33913
  });
@@ -33706,7 +33922,7 @@ var useGatewayModels = (options) => {
33706
33922
  if (!service) {
33707
33923
  throw new Error("Gateway service is not configured");
33708
33924
  }
33709
- return (0, import_rxjs22.lastValueFrom)(service.listModels());
33925
+ return (0, import_rxjs23.lastValueFrom)(service.listModels());
33710
33926
  },
33711
33927
  enabled
33712
33928
  });
@@ -33721,7 +33937,7 @@ var useGatewayMemory = (options) => {
33721
33937
  if (!service) {
33722
33938
  throw new Error("Gateway service is not configured");
33723
33939
  }
33724
- return (0, import_rxjs22.lastValueFrom)(service.getMemory());
33940
+ return (0, import_rxjs23.lastValueFrom)(service.getMemory());
33725
33941
  },
33726
33942
  enabled
33727
33943
  });
@@ -38543,6 +38759,13 @@ var ProviderTab = () => {
38543
38759
  apiKey: ""
38544
38760
  });
38545
38761
  break;
38762
+ case "xai" /* XAI */:
38763
+ setProviderConfig({
38764
+ ...baseConfig,
38765
+ baseUrl: "https://api.x.ai/v1",
38766
+ apiKey: ""
38767
+ });
38768
+ break;
38546
38769
  case "gateway" /* GATEWAY */:
38547
38770
  setProviderConfig({
38548
38771
  ...baseConfig,
@@ -38675,6 +38898,7 @@ var ProviderTab = () => {
38675
38898
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "openai", children: "OpenAI" }),
38676
38899
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "azure-openai", children: "Azure OpenAI" }),
38677
38900
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "anthropic", children: "Anthropic" }),
38901
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "xai", children: "xAI" }),
38678
38902
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "playground", children: "Playground (Mock Demo)" })
38679
38903
  ]
38680
38904
  }
@@ -38707,7 +38931,8 @@ var ProviderTab = () => {
38707
38931
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "openai", children: "OpenAI" }),
38708
38932
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "azure-openai", children: "Azure OpenAI" }),
38709
38933
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "anthropic", children: "Anthropic" }),
38710
- /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "ollama", children: "Ollama" })
38934
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "ollama", children: "Ollama" }),
38935
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.MenuItem, { value: "xai", children: "xAI" })
38711
38936
  ]
38712
38937
  }
38713
38938
  )
@@ -38791,6 +39016,30 @@ var ProviderTab = () => {
38791
39016
  }
38792
39017
  )
38793
39018
  ] }),
39019
+ providerConfig.type === "xai" && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { children: [
39020
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
39021
+ import_material43.TextField,
39022
+ {
39023
+ label: "API Base URL",
39024
+ value: providerConfig.baseUrl || "",
39025
+ onChange: (e) => setProviderConfig({ ...providerConfig, baseUrl: e.target.value }),
39026
+ fullWidth: true,
39027
+ sx: { mb: 2 },
39028
+ placeholder: "https://api.x.ai/v1"
39029
+ }
39030
+ ),
39031
+ /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
39032
+ import_material43.TextField,
39033
+ {
39034
+ label: "API Key",
39035
+ type: "password",
39036
+ value: providerConfig.apiKey || "",
39037
+ onChange: (e) => setProviderConfig({ ...providerConfig, apiKey: e.target.value }),
39038
+ fullWidth: true,
39039
+ placeholder: "xai-..."
39040
+ }
39041
+ )
39042
+ ] }),
38794
39043
  providerConfig.type === "anthropic" && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { children: [
38795
39044
  /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
38796
39045
  import_material43.TextField,
@@ -39019,20 +39268,20 @@ var MCPToolsTabV2 = () => {
39019
39268
  }
39020
39269
  }, [isLoaded]);
39021
39270
  const localEnabledMap = (0, import_react54.useMemo)(() => {
39022
- const map20 = /* @__PURE__ */ new Map();
39271
+ const map21 = /* @__PURE__ */ new Map();
39023
39272
  const sortedTools = [...localTools].sort((a, b) => {
39024
39273
  if (a.isBuiltIn && !b.isBuiltIn) return -1;
39025
39274
  if (!a.isBuiltIn && b.isBuiltIn) return 1;
39026
39275
  return a.id.length - b.id.length;
39027
39276
  });
39028
39277
  sortedTools.forEach((t) => {
39029
- map20.set(t.function.name, t.enabled);
39030
- map20.set(t.id, t.enabled);
39278
+ map21.set(t.function.name, t.enabled);
39279
+ map21.set(t.id, t.enabled);
39031
39280
  if (t.name) {
39032
- map20.set(t.name, t.enabled);
39281
+ map21.set(t.name, t.enabled);
39033
39282
  }
39034
39283
  });
39035
- return map20;
39284
+ return map21;
39036
39285
  }, [localTools]);
39037
39286
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { children: [
39038
39287
  /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2 }, children: [