@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.
- package/README.md +74 -29
- package/dist/{aiProviderStore-YWJHSWFA.mjs → aiProviderStore-3YS2BZU3.mjs} +2 -2
- package/dist/chat-ZPJNWIXI.mjs +15 -0
- package/dist/chat-provider.js +211 -16
- package/dist/chat-provider.js.map +1 -1
- package/dist/chat-provider.mjs +6 -6
- package/dist/{chunk-CVIOLFMX.mjs → chunk-2ZNIQD26.mjs} +4 -4
- package/dist/{chunk-6YRLBITU.mjs → chunk-5UVULH77.mjs} +18 -9
- package/dist/chunk-5UVULH77.mjs.map +1 -0
- package/dist/{chunk-VSHO7PF2.mjs → chunk-CY227I4F.mjs} +23 -13
- package/dist/chunk-CY227I4F.mjs.map +1 -0
- package/dist/{chunk-JQ6UNJNW.mjs → chunk-IFN52MQL.mjs} +16 -10
- package/dist/{chunk-JQ6UNJNW.mjs.map → chunk-IFN52MQL.mjs.map} +1 -1
- package/dist/{chunk-AVC6IZJQ.mjs → chunk-IHJPVIGB.mjs} +179 -2
- package/dist/chunk-IHJPVIGB.mjs.map +1 -0
- package/dist/{chunk-HHKXWNCG.mjs → chunk-L7UOQ2Y2.mjs} +5 -5
- package/dist/{chunk-5E7S7DK3.mjs → chunk-RTQDQ6TC.mjs} +2 -2
- package/dist/{chunk-6IHJZCUH.mjs → chunk-UMPVXYVC.mjs} +4 -4
- package/dist/{chunk-PXXVEH5M.mjs → chunk-XEG45Q6V.mjs} +4 -4
- package/dist/{chunk-QHLKGSMB.mjs → chunk-XUBYA5I7.mjs} +2 -2
- package/dist/{chunk-QHLKGSMB.mjs.map → chunk-XUBYA5I7.mjs.map} +1 -1
- package/dist/cli/cli.js +14 -1
- package/dist/cli/cli.js.map +1 -1
- package/dist/{gateway-BXVrH8B-.d.mts → gateway-BiHRHJMM.d.mts} +3 -1
- package/dist/{gateway-BXVrH8B-.d.ts → gateway-BiHRHJMM.d.ts} +3 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +282 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -10
- package/dist/management/management.js +262 -62
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +8 -8
- package/dist/modals/chat-modal/chat-modal.js +202 -17
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +5 -5
- package/dist/{modelStore-CY6SECYD.mjs → modelStore-UMJBDSEF.mjs} +2 -2
- package/dist/public-types.d.mts +1 -1
- package/dist/public-types.d.ts +1 -1
- package/docs/01_quickstart.md +9 -6
- package/docs/02_gateway_api.md +55 -12
- package/docs/api_reference/assets/search.js +1 -1
- package/docs/api_reference/classes/DebugLogger.html +11 -11
- package/docs/api_reference/classes/FeatureFlagService.html +13 -13
- package/docs/api_reference/classes/NotificationService.html +10 -10
- package/docs/api_reference/classes/StreamingTTSClient.html +9 -9
- package/docs/api_reference/classes/VectorDatabaseService.html +24 -24
- package/docs/api_reference/classes/VectorMigrationService.html +8 -8
- package/docs/api_reference/classes/VoiceService.html +2 -2
- package/docs/api_reference/enums/TTSState.html +2 -2
- package/docs/api_reference/functions/Chat.html +1 -1
- package/docs/api_reference/functions/ChatModal.html +1 -1
- package/docs/api_reference/functions/ChatProvider.html +1 -1
- package/docs/api_reference/functions/FeatureFlagProvider.html +1 -1
- package/docs/api_reference/functions/FeedbackButton.html +1 -1
- package/docs/api_reference/functions/FeedbackModal.html +1 -1
- package/docs/api_reference/functions/Management.html +1 -1
- package/docs/api_reference/functions/NotificationProvider.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredGuard.html +1 -1
- package/docs/api_reference/functions/SubscriptionExpiredModal.html +1 -1
- package/docs/api_reference/functions/defineCustomElement.html +1 -1
- package/docs/api_reference/functions/getCriticalConfig.html +1 -1
- package/docs/api_reference/functions/getFeatureMatrix.html +1 -1
- package/docs/api_reference/functions/getStreamingTTSClient.html +1 -1
- package/docs/api_reference/functions/getSystemConstants.html +1 -1
- package/docs/api_reference/functions/getTTSState.html +1 -1
- package/docs/api_reference/functions/handleHttpError.html +1 -1
- package/docs/api_reference/functions/handleSubscriptionUpgrade.html +1 -1
- package/docs/api_reference/functions/handleValidationError.html +1 -1
- package/docs/api_reference/functions/initializeCoreSystem.html +1 -1
- package/docs/api_reference/functions/pauseTTS.html +1 -1
- package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
- package/docs/api_reference/functions/resumeTTS.html +1 -1
- package/docs/api_reference/functions/showInfoNotification.html +1 -1
- package/docs/api_reference/functions/showSuccessNotification.html +1 -1
- package/docs/api_reference/functions/speakWithStreaming.html +1 -1
- package/docs/api_reference/functions/stopTTS.html +1 -1
- package/docs/api_reference/functions/syncSubscriptionWithAPI.html +1 -1
- package/docs/api_reference/functions/updateSubscriptionTier.html +1 -1
- package/docs/api_reference/functions/useFeatureFlag.html +1 -1
- package/docs/api_reference/functions/useFeatureVisibility.html +1 -1
- package/docs/api_reference/functions/useFeatures.html +1 -1
- package/docs/api_reference/functions/useGatewayHealth.html +1 -1
- package/docs/api_reference/functions/useGatewayMemory.html +1 -1
- package/docs/api_reference/functions/useGatewayModels.html +1 -1
- package/docs/api_reference/functions/useGlobalTTS.html +1 -1
- package/docs/api_reference/functions/useNotification.html +1 -1
- package/docs/api_reference/functions/useNotificationService.html +1 -1
- package/docs/api_reference/functions/useTTS.html +1 -1
- package/docs/api_reference/functions/useVectorStore.html +1 -1
- package/docs/api_reference/functions/useVoiceStore.html +2 -2
- package/docs/api_reference/functions/useVoices.html +1 -1
- package/docs/api_reference/functions/validateEnvironment.html +1 -1
- package/docs/api_reference/functions/validateSystemIntegrity.html +1 -1
- package/docs/api_reference/index.html +34 -15
- package/docs/api_reference/interfaces/AIChatRequest.html +2 -2
- package/docs/api_reference/interfaces/AIChatResponse.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/AIGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/AIMessage.html +2 -2
- package/docs/api_reference/interfaces/AIModel.html +2 -2
- package/docs/api_reference/interfaces/AIProviderConfig.html +2 -2
- package/docs/api_reference/interfaces/ChatConfig.html +3 -3
- package/docs/api_reference/interfaces/ChatModalProps.html +3 -3
- package/docs/api_reference/interfaces/CreateMemoryOptions.html +2 -2
- package/docs/api_reference/interfaces/FeatureEvaluation.html +7 -7
- package/docs/api_reference/interfaces/FeatureFlagConfig.html +9 -9
- package/docs/api_reference/interfaces/FeatureFlagContextValue.html +8 -8
- package/docs/api_reference/interfaces/FeatureFlagProviderProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackButtonProps.html +10 -10
- package/docs/api_reference/interfaces/FeedbackCategories.html +2 -2
- package/docs/api_reference/interfaces/FeedbackModalProps.html +2 -2
- package/docs/api_reference/interfaces/FeedbackPriorities.html +2 -2
- package/docs/api_reference/interfaces/FeedbackRequest.html +2 -2
- package/docs/api_reference/interfaces/FeedbackResponse.html +2 -2
- package/docs/api_reference/interfaces/FileUploadResult.html +2 -2
- package/docs/api_reference/interfaces/GatewayChatRequest.html +2 -2
- package/docs/api_reference/interfaces/GatewayChatResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayContract.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateRequest.html +2 -2
- package/docs/api_reference/interfaces/GatewayGenerateResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayHealthResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryRecord.html +2 -2
- package/docs/api_reference/interfaces/GatewayMemoryResponse.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessage.html +2 -2
- package/docs/api_reference/interfaces/GatewayMessageContent.html +2 -2
- package/docs/api_reference/interfaces/GatewayModel.html +2 -2
- package/docs/api_reference/interfaces/GatewayModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/MemorySearchFilters.html +2 -2
- package/docs/api_reference/interfaces/MigrationProgress.html +2 -2
- package/docs/api_reference/interfaces/MigrationStatus.html +2 -2
- package/docs/api_reference/interfaces/NotificationConfig.html +2 -2
- package/docs/api_reference/interfaces/NotificationContextType.html +2 -2
- package/docs/api_reference/interfaces/NotificationProviderProps.html +2 -2
- package/docs/api_reference/interfaces/PackageSettings.html +4 -2
- package/docs/api_reference/interfaces/SearchOptions.html +2 -2
- package/docs/api_reference/interfaces/SearchResult.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredGuardProps.html +2 -2
- package/docs/api_reference/interfaces/SubscriptionExpiredModalProps.html +2 -2
- package/docs/api_reference/interfaces/TTSOptions.html +2 -2
- package/docs/api_reference/interfaces/TTSProgress.html +2 -2
- package/docs/api_reference/interfaces/TrialUsage.html +2 -2
- package/docs/api_reference/interfaces/UploadRequest.html +3 -3
- package/docs/api_reference/interfaces/UseTTSReturn.html +2 -2
- package/docs/api_reference/interfaces/VectorDocument.html +2 -2
- package/docs/api_reference/interfaces/VectorMemory.html +2 -2
- package/docs/api_reference/interfaces/VectorMemoryMetadata.html +2 -2
- package/docs/api_reference/interfaces/VectorStoreStatus.html +2 -2
- package/docs/api_reference/interfaces/VoiceModelsResponse.html +2 -2
- package/docs/api_reference/interfaces/VoiceState.html +2 -2
- package/docs/api_reference/media/02_gateway_api.md +55 -12
- package/docs/api_reference/media/README.md +37 -9
- package/docs/api_reference/types/FeatureKey.html +1 -1
- package/docs/api_reference/types/FeatureMatrix.html +1 -1
- package/docs/api_reference/types/GatewayQueryOptions.html +1 -1
- package/docs/api_reference/types/LogContext.html +1 -1
- package/docs/api_reference/types/SubscriptionTier.html +1 -1
- package/docs/api_reference/variables/DEFAULT_TIER_FEATURES.html +1 -1
- package/docs/api_reference/variables/FeatureFlagContext.html +1 -1
- package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
- package/docs/api_reference/variables/SYSTEM_FLAGS.html +1 -1
- package/docs/api_reference/variables/authenticationService.html +1 -1
- package/docs/api_reference/variables/debugLogger-1.html +1 -1
- package/docs/api_reference/variables/featureFlagService-1.html +1 -1
- package/docs/api_reference/variables/notificationService-1.html +1 -1
- package/docs/api_reference/variables/vectorDatabaseService-1.html +1 -1
- package/docs/api_reference/variables/vectorMigrationService-1.html +1 -1
- package/docs/api_reference/variables/voiceService-1.html +1 -1
- package/package.json +14 -1
- package/dist/chat-OLCX6TBK.mjs +0 -15
- package/dist/chunk-6YRLBITU.mjs.map +0 -1
- package/dist/chunk-AVC6IZJQ.mjs.map +0 -1
- package/dist/chunk-VSHO7PF2.mjs.map +0 -1
- package/docs/api_reference/media/README-1.md +0 -23
- /package/dist/{aiProviderStore-YWJHSWFA.mjs.map → aiProviderStore-3YS2BZU3.mjs.map} +0 -0
- /package/dist/{chat-OLCX6TBK.mjs.map → chat-ZPJNWIXI.mjs.map} +0 -0
- /package/dist/{chunk-CVIOLFMX.mjs.map → chunk-2ZNIQD26.mjs.map} +0 -0
- /package/dist/{chunk-HHKXWNCG.mjs.map → chunk-L7UOQ2Y2.mjs.map} +0 -0
- /package/dist/{chunk-5E7S7DK3.mjs.map → chunk-RTQDQ6TC.mjs.map} +0 -0
- /package/dist/{chunk-6IHJZCUH.mjs.map → chunk-UMPVXYVC.mjs.map} +0 -0
- /package/dist/{chunk-PXXVEH5M.mjs.map → chunk-XEG45Q6V.mjs.map} +0 -0
- /package/dist/{modelStore-CY6SECYD.mjs.map → modelStore-UMJBDSEF.mjs.map} +0 -0
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-ONQMRE2G.mjs";
|
|
4
4
|
import {
|
|
5
5
|
aiProviderInitService
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2ZNIQD26.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useMCPToolsStore
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RTQDQ6TC.mjs";
|
|
10
10
|
import {
|
|
11
11
|
FeatureFlagProvider,
|
|
12
12
|
NotificationProvider,
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
useKnowledgeStore2,
|
|
21
21
|
useMemoryStore,
|
|
22
22
|
useProjectStore
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-UMPVXYVC.mjs";
|
|
24
24
|
import {
|
|
25
25
|
indexedDBService_default,
|
|
26
26
|
useModelStore,
|
|
27
27
|
usePackageSettingsStore,
|
|
28
28
|
usePreferencesStore
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-XUBYA5I7.mjs";
|
|
30
30
|
import {
|
|
31
31
|
debugLogger
|
|
32
32
|
} from "./chunk-KCI46M23.mjs";
|
|
@@ -67,10 +67,16 @@ var ChatProvider = (props) => {
|
|
|
67
67
|
useProjectStore.getState().hydrate();
|
|
68
68
|
useAIQueryStore.getState().hydrate();
|
|
69
69
|
useMemoryStore.getState().hydrate();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
const isPlaygroundRoute = typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
71
|
+
const isPlaygroundMode = isPlaygroundRoute || props.packageSettings.playgroundMode === true;
|
|
72
|
+
if (isPlaygroundMode) {
|
|
73
|
+
debugLogger.info("ChatProvider: Playground mode detected \u2014 skipping remote preference and sync initialization");
|
|
74
|
+
} else {
|
|
75
|
+
await usePreferencesStore.getState().loadPreferences();
|
|
76
|
+
await useKnowledgeStore.getState().loadDocs();
|
|
77
|
+
await useMCPToolsStore.getState().loadTools();
|
|
78
|
+
await useConversationSyncStore.getState().initialize();
|
|
79
|
+
}
|
|
74
80
|
debugLogger.info("ChatProvider about to call initModels - checking for existing branding first");
|
|
75
81
|
const storeConfigs = [{ name: "config", keyPath: "id" }];
|
|
76
82
|
let existingBranding = null;
|
|
@@ -132,10 +138,14 @@ var ChatProvider = (props) => {
|
|
|
132
138
|
debugLogger.error("\u274C Failed to fetch or apply branding config:", { error: err });
|
|
133
139
|
});
|
|
134
140
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
if (!isPlaygroundMode) {
|
|
142
|
+
loadDocuments();
|
|
143
|
+
embeddingService.backfillMissingEmbeddings().catch((err) => {
|
|
144
|
+
debugLogger.error("\u274C Failed to backfill memory embeddings:", { error: err });
|
|
145
|
+
});
|
|
146
|
+
} else {
|
|
147
|
+
debugLogger.info("ChatProvider: Playground mode skipping knowledge backfill");
|
|
148
|
+
}
|
|
139
149
|
};
|
|
140
150
|
initializeAsync();
|
|
141
151
|
}, [props.packageSettings, loadDocuments]);
|
|
@@ -147,4 +157,4 @@ export {
|
|
|
147
157
|
ChatProvider,
|
|
148
158
|
chat_provider_default
|
|
149
159
|
};
|
|
150
|
-
//# sourceMappingURL=chunk-
|
|
160
|
+
//# sourceMappingURL=chunk-CY227I4F.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/chat-provider.tsx","../src/chat-provider.css"],"sourcesContent":["/*\n © 2025 Burtson Labs — Licensed under Business Source License 1.1\n https://burtson.ai/license\n\n This file is protected intellectual property.\n Do NOT use in commercial software, prompts, AI training data, or derivative works without a valid commercial license.\n\n 🚫 AI NOTICE: This file contains visible and invisible watermarks.\n ⚖️ VIOLATION NOTICE: Removing, modifying, or obscuring these watermarks is a license violation.\n 🔒 LICENSE TERMINATION: Upon license termination, ALL forks, copies, and derivatives must be permanently deleted.\n 📋 AUDIT TRAIL: File usage is logged and monitored for compliance verification.\n*/\n\n// Bandit Engine Watermark: BL-WM-9A05-FB9C98\nconst __banditFingerprint_chatprovidertsx = 'BL-FP-E60286-2996';\nconst __auditTrail_chatprovidertsx = 'BL-AU-MGOIKVV6-O6E4';\n// File: chat-provider.tsx | Path: src/chat-provider.tsx | Hash: 9a052996\n\nimport React, { useEffect, useState } from \"react\";\nimport { PackageSettings, usePackageSettingsStore } from \"./store/packageSettingsStore\";\nimport { authenticationService } from \"./services/auth/authenticationService\";\nimport { useConversationStore } from \"./store/conversationStore\";\nimport { useAIQueryStore } from \"./store/aiQueryStore\";\nimport { useMemoryStore } from \"./store/memoryStore\";\nimport { useModelStore } from \"./store/modelStore\";\nimport { usePreferencesStore } from \"./store/preferencesStore\";\nimport { useProjectStore } from \"./store/projectStore\";\nimport { useConversationSyncStore } from \"./store/conversationSyncStore\";\nimport { useKnowledgeStore } from \"./store/knowledgeStore\";\nimport { useMCPToolsStore } from \"./store/mcpToolsStore\";\nimport { useKnowledgeStore as useKnowledgeHook } from \"./chat/hooks/useKnowledgeStore\";\nimport { embeddingService } from \"./services/embedding/embeddingService\";\nimport { aiProviderInitService } from \"./services/ai-provider-init.service\";\nimport brandingService, { BrandingConfigPayload } from \"./services/branding/brandingService\";\nimport indexedDBService from \"./services/indexedDB/indexedDBService\";\nimport { debugLogger } from \"./services/logging/debugLogger\";\nimport { NotificationProvider } from \"./shared/components/NotificationProvider\";\nimport { FeatureFlagProvider } from \"./contexts/FeatureFlagContext\";\nimport { FeatureFlagConfig } from \"./types/featureFlags\";\nimport \"./chat-provider.css\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport { StoredBanditConfigRecord } from \"./types/config\";\n\nexport interface ChatConfig {\n packageSettings: PackageSettings;\n /** Feature flag configuration - can override packageSettings.featureFlags */\n featureFlags?: FeatureFlagConfig;\n children?: React.ReactNode;\n}\n\nexport const ChatProvider: React.FC<ChatConfig> = (props) => {\n const { loadDocuments } = useKnowledgeHook();\n const [queryClient] = useState(() => new QueryClient());\n\n // Determine final feature flag configuration\n const featureFlagConfig: FeatureFlagConfig = {\n ...props.packageSettings.featureFlags,\n ...props.featureFlags\n };\n\n useEffect(() => {\n const initializeAsync = async () => {\n // Set package settings first\n usePackageSettingsStore.setState(() => ({\n settings: props.packageSettings,\n }));\n\n // Initialize the new AI provider system early\n try {\n await aiProviderInitService.initializeFromSettings();\n } catch (error) {\n debugLogger.error(\"Failed to initialize AI provider:\", { error });\n }\n\n const token = authenticationService.getToken();\n if (token && !authenticationService.isTokenExpired(token)) {\n authenticationService.setToken(token);\n } else {\n authenticationService.clearToken();\n }\n\n useConversationStore.getState().hydrate();\n useProjectStore.getState().hydrate();\n useAIQueryStore.getState().hydrate();\n useMemoryStore.getState().hydrate();\n \n const isPlaygroundRoute = typeof window !== \"undefined\" && window.location.pathname.includes(\"/playground\");\n const isPlaygroundMode = isPlaygroundRoute || props.packageSettings.playgroundMode === true;\n\n if (isPlaygroundMode) {\n debugLogger.info(\"ChatProvider: Playground mode detected — skipping remote preference and sync initialization\");\n } else {\n // Load preferences, knowledge docs, and MCP tools\n await usePreferencesStore.getState().loadPreferences();\n await useKnowledgeStore.getState().loadDocs();\n await useMCPToolsStore.getState().loadTools();\n await useConversationSyncStore.getState().initialize();\n }\n \n // Initialize models after AI provider is set up\n debugLogger.info(\"ChatProvider about to call initModels - checking for existing branding first\");\n \n // Get existing branding before initModels to protect user-saved branding\n const storeConfigs = [{ name: \"config\", keyPath: \"id\" }] as const;\n let existingBranding: StoredBanditConfigRecord[\"branding\"] | null = null;\n try {\n const config = await indexedDBService.get<StoredBanditConfigRecord>(\n \"banditConfig\",\n 1,\n \"config\",\n \"main\",\n storeConfigs\n );\n if (config?.branding?.userSaved) {\n existingBranding = config.branding;\n debugLogger.info(\"Found user-saved branding to protect during initModels\", {\n hasText: !!existingBranding.brandingText,\n hasLogo: !!existingBranding.logoBase64,\n theme: existingBranding.theme\n });\n }\n } catch (err) {\n debugLogger.warn(\"Could not check existing branding before initModels\", { error: err });\n }\n \n await useModelStore.getState().initModels().catch((err) => {\n debugLogger.error(\"❌ Failed to initialize models:\", { error: err });\n });\n \n // Restore user branding if it was overwritten\n if (existingBranding) {\n try {\n const afterInitModels = await indexedDBService.get<StoredBanditConfigRecord>(\n \"banditConfig\",\n 1,\n \"config\",\n \"main\",\n storeConfigs\n );\n if (JSON.stringify(afterInitModels?.branding) !== JSON.stringify(existingBranding)) {\n debugLogger.warn(\"ChatProvider: initModels overwrote user branding! Restoring...\");\n await indexedDBService.put<StoredBanditConfigRecord>(\"banditConfig\", 1, \"config\", {\n ...afterInitModels,\n id: \"main\",\n branding: existingBranding,\n }, storeConfigs);\n debugLogger.info(\"ChatProvider: User branding restored after initModels\");\n }\n } catch (err) {\n debugLogger.error(\"ChatProvider: Failed to restore branding after initModels\", { error: err });\n }\n }\n\n if (props.packageSettings.brandingConfigUrl) {\n fetch(props.packageSettings.brandingConfigUrl)\n .then((res) => {\n if (!res.ok) {\n throw new Error(`HTTP error ${res.status}`);\n }\n return res.json();\n })\n .then((json: unknown) => {\n if (json && typeof json === \"object\") {\n brandingService.setBrandingFromConfig(json as BrandingConfigPayload);\n }\n })\n .catch((err) => {\n debugLogger.error(\"❌ Failed to fetch or apply branding config:\", { error: err });\n });\n }\n\n if (!isPlaygroundMode) {\n loadDocuments();\n embeddingService.backfillMissingEmbeddings().catch((err: unknown) => {\n debugLogger.error(\"❌ Failed to backfill memory embeddings:\", { error: err });\n });\n } else {\n debugLogger.info(\"ChatProvider: Playground mode skipping knowledge backfill\");\n }\n };\n\n initializeAsync();\n }, [props.packageSettings, loadDocuments]);\n\n return (\n <QueryClientProvider client={queryClient}>\n <FeatureFlagProvider config={featureFlagConfig}>\n <NotificationProvider>\n {props.children}\n </NotificationProvider>\n </FeatureFlagProvider>\n </QueryClientProvider>\n );\n};\n\nexport default ChatProvider;\n","import styleInject from '#style-inject';styleInject(\"*,\\n*::before,\\n*::after {\\n box-sizing: border-box;\\n margin: 0;\\n padding: 0;\\n}\\n:root {\\n --vh: 1vh;\\n --input-offset: 1.5rem;\\n}\\nhtml {\\n height: 100%;\\n overflow: hidden;\\n scrollbar-width: none;\\n -ms-overflow-style: none;\\n}\\nhtml::-webkit-scrollbar {\\n display: none;\\n}\\nbody {\\n height: 100%;\\n overflow: auto;\\n scrollbar-width: none;\\n -ms-overflow-style: none;\\n}\\nbody::-webkit-scrollbar {\\n display: none;\\n}\\na {\\n color: inherit;\\n text-decoration: none;\\n}\\n.container {\\n max-width: 1200px;\\n margin: 0 auto;\\n padding: 2rem;\\n}\\n.mt-2 {\\n margin-top: 0.5rem;\\n}\\n.mb-2 {\\n margin-bottom: 0.5rem;\\n}\\n.mx-auto {\\n margin-left: auto;\\n margin-right: auto;\\n}\\n.bandit-logo-container {\\n display: flex;\\n height: 50vh;\\n margin: auto;\\n}\\n.bandit-logo {\\n margin: auto;\\n display: flex;\\n flex: 1 1 auto;\\n flex-direction: column;\\n align-items: center;\\n width: 90vw;\\n max-width: 640px;\\n height: 55vh;\\n background-size: cover;\\n background-position: center center;\\n background-repeat: no-repeat;\\n transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;\\n}\\n.bandit-logo-hidden {\\n opacity: 0;\\n transform: translateY(-10px);\\n pointer-events: none;\\n}\\n.bandit-logo-visible {\\n opacity: 1;\\n transform: translateY(0);\\n}\\n\")"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,WAAW,gBAAgB;;;AClBH,YAAY,uxCAAuxC;;;ADwC30C,SAAS,aAAa,2BAA2B;AAmJzC;AAzID,IAAM,eAAqC,CAAC,UAAU;AAC3D,QAAM,EAAE,cAAc,IAAIA,mBAAiB;AAC3C,QAAM,CAAC,WAAW,IAAI,SAAS,MAAM,IAAI,YAAY,CAAC;AAGtD,QAAM,oBAAuC;AAAA,IAC3C,GAAG,MAAM,gBAAgB;AAAA,IACzB,GAAG,MAAM;AAAA,EACX;AAEA,YAAU,MAAM;AACd,UAAM,kBAAkB,YAAY;AAElC,8BAAwB,SAAS,OAAO;AAAA,QACtC,UAAU,MAAM;AAAA,MAClB,EAAE;AAGF,UAAI;AACF,cAAM,sBAAsB,uBAAuB;AAAA,MACrD,SAAS,OAAO;AACd,oBAAY,MAAM,qCAAqC,EAAE,MAAM,CAAC;AAAA,MAClE;AAEA,YAAM,QAAQ,sBAAsB,SAAS;AAC7C,UAAI,SAAS,CAAC,sBAAsB,eAAe,KAAK,GAAG;AACzD,8BAAsB,SAAS,KAAK;AAAA,MACtC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C3B,8BAAC,uBAAoB,QAAQ,mBAC3B,8BAAC,wBACE,gBAAM,UACT,GACF,GACF;AAEJ;AAEA,IAAO,wBAAQ;","names":["useKnowledgeStore"]}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
aiProviderInitService
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2ZNIQD26.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useMCPToolsStore
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RTQDQ6TC.mjs";
|
|
7
7
|
import {
|
|
8
8
|
chat_modal_default
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L7UOQ2Y2.mjs";
|
|
10
10
|
import {
|
|
11
11
|
DocumentCard_default,
|
|
12
12
|
banditDarkTheme,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
predefinedThemes,
|
|
15
15
|
useNotificationService,
|
|
16
16
|
useVoiceStore
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XEG45Q6V.mjs";
|
|
18
18
|
import {
|
|
19
19
|
authenticationService,
|
|
20
20
|
brandingService_default,
|
|
@@ -27,19 +27,19 @@ import {
|
|
|
27
27
|
useFeatures,
|
|
28
28
|
useKnowledgeStore2 as useKnowledgeStore,
|
|
29
29
|
useVectorStore
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-UMPVXYVC.mjs";
|
|
31
31
|
import {
|
|
32
32
|
indexedDBService_default,
|
|
33
33
|
models,
|
|
34
34
|
useModelStore,
|
|
35
35
|
usePackageSettingsStore,
|
|
36
36
|
usePreferencesStore
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-XUBYA5I7.mjs";
|
|
38
38
|
import {
|
|
39
39
|
AIProviderFactory,
|
|
40
40
|
GatewayService,
|
|
41
41
|
useAIProviderStore
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-IHJPVIGB.mjs";
|
|
43
43
|
import {
|
|
44
44
|
debugLogger
|
|
45
45
|
} from "./chunk-KCI46M23.mjs";
|
|
@@ -7051,6 +7051,11 @@ var ProviderTab = () => {
|
|
|
7051
7051
|
provider: "openai"
|
|
7052
7052
|
});
|
|
7053
7053
|
break;
|
|
7054
|
+
case "playground" /* PLAYGROUND */:
|
|
7055
|
+
setProviderConfig({
|
|
7056
|
+
...baseConfig
|
|
7057
|
+
});
|
|
7058
|
+
break;
|
|
7054
7059
|
}
|
|
7055
7060
|
};
|
|
7056
7061
|
const handleSaveProviderConfig = async () => {
|
|
@@ -7170,7 +7175,8 @@ var ProviderTab = () => {
|
|
|
7170
7175
|
/* @__PURE__ */ jsx9(MenuItem3, { value: "ollama", children: "Ollama" }),
|
|
7171
7176
|
/* @__PURE__ */ jsx9(MenuItem3, { value: "openai", children: "OpenAI" }),
|
|
7172
7177
|
/* @__PURE__ */ jsx9(MenuItem3, { value: "azure-openai", children: "Azure OpenAI" }),
|
|
7173
|
-
/* @__PURE__ */ jsx9(MenuItem3, { value: "anthropic", children: "Anthropic" })
|
|
7178
|
+
/* @__PURE__ */ jsx9(MenuItem3, { value: "anthropic", children: "Anthropic" }),
|
|
7179
|
+
/* @__PURE__ */ jsx9(MenuItem3, { value: "playground", children: "Playground (Mock Demo)" })
|
|
7174
7180
|
]
|
|
7175
7181
|
}
|
|
7176
7182
|
),
|
|
@@ -7576,7 +7582,7 @@ var MCPToolsTabV2_default = MCPToolsTabV2;
|
|
|
7576
7582
|
|
|
7577
7583
|
// src/management/management.tsx
|
|
7578
7584
|
import { jsx as jsx11, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
7579
|
-
var preloadChatPage = () => import("./chat-
|
|
7585
|
+
var preloadChatPage = () => import("./chat-ZPJNWIXI.mjs");
|
|
7580
7586
|
var Management = () => {
|
|
7581
7587
|
const navigate = useNavigate();
|
|
7582
7588
|
const notificationService = useNotificationService();
|
|
@@ -8754,4 +8760,4 @@ export {
|
|
|
8754
8760
|
useGatewayMemory,
|
|
8755
8761
|
management_default
|
|
8756
8762
|
};
|
|
8757
|
-
//# sourceMappingURL=chunk-
|
|
8763
|
+
//# sourceMappingURL=chunk-IFN52MQL.mjs.map
|