@burtson-labs/bandit-engine 2.0.161 → 2.0.163
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 +7 -22
- package/dist/aiProviderStore-PEGSX4PK.mjs +9 -0
- package/dist/chat-MRDQ2WRJ.mjs +16 -0
- package/dist/chat-provider.js +86 -31
- package/dist/chat-provider.js.map +1 -1
- package/dist/chat-provider.mjs +7 -7
- package/dist/{chunk-QXITTH2X.mjs → chunk-5KBTOCQZ.mjs} +4 -4
- package/dist/chunk-5KBTOCQZ.mjs.map +1 -0
- package/dist/{chunk-B3HAQC6F.mjs → chunk-CQJGUYRW.mjs} +69 -26
- package/dist/chunk-CQJGUYRW.mjs.map +1 -0
- package/dist/{chunk-TTAORNWI.mjs → chunk-F32P7Q5O.mjs} +122 -232
- package/dist/chunk-F32P7Q5O.mjs.map +1 -0
- package/dist/{chunk-XC7HDKFW.mjs → chunk-HSGQXL4N.mjs} +11 -11
- package/dist/chunk-HSGQXL4N.mjs.map +1 -0
- package/dist/{chunk-QPXG4A5C.mjs → chunk-IZX2J65Q.mjs} +2 -2
- package/dist/chunk-IZX2J65Q.mjs.map +1 -0
- package/dist/{chunk-MIDYEQOS.mjs → chunk-J6SWNO7Z.mjs} +20 -35
- package/dist/chunk-J6SWNO7Z.mjs.map +1 -0
- package/dist/{chunk-PFKKGJAQ.mjs → chunk-O6P37PFR.mjs} +4 -4
- package/dist/chunk-O6P37PFR.mjs.map +1 -0
- package/dist/{chunk-KCI46M23.mjs → chunk-OCVZVBQQ.mjs} +1 -1
- package/dist/chunk-OCVZVBQQ.mjs.map +1 -0
- package/dist/{chunk-IXIM7BNO.mjs → chunk-P4C5IRM5.mjs} +1 -1
- package/dist/chunk-P4C5IRM5.mjs.map +1 -0
- package/dist/{chunk-WQEBTH2R.mjs → chunk-TY5VL3SG.mjs} +3 -3
- package/dist/chunk-TY5VL3SG.mjs.map +1 -0
- package/dist/{chunk-X65A3NED.mjs → chunk-URZSIL7X.mjs} +7 -7
- package/dist/chunk-URZSIL7X.mjs.map +1 -0
- package/dist/{chunk-FSRMNQRN.mjs → chunk-VBHI4TJC.mjs} +6 -6
- package/dist/chunk-VBHI4TJC.mjs.map +1 -0
- package/dist/{chunk-EOMOOMUC.mjs → chunk-WLNZL6SP.mjs} +5 -16
- package/dist/chunk-WLNZL6SP.mjs.map +1 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +660 -759
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +15 -31
- package/dist/index.mjs.map +1 -1
- package/dist/management/management.js +300 -383
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +10 -10
- package/dist/{memoryUtils-33TZKHSQ.mjs → memoryUtils-2FVXDSS6.mjs} +1 -1
- package/dist/memoryUtils-2FVXDSS6.mjs.map +1 -0
- package/dist/modals/chat-modal/chat-modal.js +86 -31
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +6 -6
- package/dist/modelStore-7XYYDCNC.mjs +9 -0
- package/dist/shared/custom-element.js.map +1 -1
- package/dist/shared/custom-element.mjs +1 -1
- package/docs/05_contributing.md +1 -1
- package/docs/api_reference/assets/navigation.js +1 -1
- 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/InterestsEditor.html +5 -0
- 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 +2 -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 +2 -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 +2 -1
- package/docs/api_reference/functions/isWorkspaceAdminRole.html +6 -0
- package/docs/api_reference/functions/pauseTTS.html +1 -1
- package/docs/api_reference/functions/previewTierUpgrade.html +1 -1
- package/docs/api_reference/functions/resolveManagementSections.html +2 -0
- 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/useManagementAccess.html +2 -0
- 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 +2 -1
- package/docs/api_reference/functions/validateSystemIntegrity.html +2 -1
- package/docs/api_reference/index.html +219 -155
- 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 +5 -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 +3 -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/ManagementAccess.html +5 -0
- package/docs/api_reference/interfaces/ManagementAccessInput.html +5 -0
- package/docs/api_reference/interfaces/ManagementLink.html +7 -0
- package/docs/api_reference/interfaces/ManagementProps.html +22 -0
- package/docs/api_reference/interfaces/ManagementSectionDef.html +10 -0
- 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 +11 -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/PROTECTION-NOTICE.md +6 -55
- package/docs/api_reference/media/README.md +20 -1
- package/docs/api_reference/modules.html +18 -6
- 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/ManagementRequest.html +1 -0
- package/docs/api_reference/types/ManagementSectionId.html +2 -0
- 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/MANAGEMENT_SECTIONS.html +1 -0
- package/docs/api_reference/variables/OSS_DEFAULT_FEATURES.html +1 -1
- package/docs/api_reference/variables/SYSTEM_FLAGS.html +2 -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 +1 -1
- package/dist/aiProviderStore-BNZGM6QU.mjs +0 -9
- package/dist/chat-3JAV77HO.mjs +0 -16
- package/dist/chunk-B3HAQC6F.mjs.map +0 -1
- package/dist/chunk-EOMOOMUC.mjs.map +0 -1
- package/dist/chunk-FSRMNQRN.mjs.map +0 -1
- package/dist/chunk-IXIM7BNO.mjs.map +0 -1
- package/dist/chunk-KCI46M23.mjs.map +0 -1
- package/dist/chunk-MIDYEQOS.mjs.map +0 -1
- package/dist/chunk-PFKKGJAQ.mjs.map +0 -1
- package/dist/chunk-QPXG4A5C.mjs.map +0 -1
- package/dist/chunk-QXITTH2X.mjs.map +0 -1
- package/dist/chunk-TTAORNWI.mjs.map +0 -1
- package/dist/chunk-WQEBTH2R.mjs.map +0 -1
- package/dist/chunk-X65A3NED.mjs.map +0 -1
- package/dist/chunk-XC7HDKFW.mjs.map +0 -1
- package/dist/memoryUtils-33TZKHSQ.mjs.map +0 -1
- package/dist/modelStore-FGUGOWTL.mjs +0 -9
- package/docs/api_reference/media/PROTECTION-README.md +0 -39
- /package/dist/{aiProviderStore-BNZGM6QU.mjs.map → aiProviderStore-PEGSX4PK.mjs.map} +0 -0
- /package/dist/{chat-3JAV77HO.mjs.map → chat-MRDQ2WRJ.mjs.map} +0 -0
- /package/dist/{modelStore-FGUGOWTL.mjs.map → modelStore-7XYYDCNC.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -3724,6 +3724,40 @@ var init_common_types = __esm({
|
|
|
3724
3724
|
}
|
|
3725
3725
|
});
|
|
3726
3726
|
|
|
3727
|
+
// src/services/stream/streamLineParser.ts
|
|
3728
|
+
var SKIP, StreamLineParser;
|
|
3729
|
+
var init_streamLineParser = __esm({
|
|
3730
|
+
"src/services/stream/streamLineParser.ts"() {
|
|
3731
|
+
"use strict";
|
|
3732
|
+
SKIP = { kind: "skip" };
|
|
3733
|
+
StreamLineParser = class {
|
|
3734
|
+
/** Set by `event: ping` until the frame's blank-line terminator. */
|
|
3735
|
+
inHeartbeatFrame = false;
|
|
3736
|
+
next(rawLine) {
|
|
3737
|
+
const line = rawLine.trim();
|
|
3738
|
+
if (!line) {
|
|
3739
|
+
this.inHeartbeatFrame = false;
|
|
3740
|
+
return SKIP;
|
|
3741
|
+
}
|
|
3742
|
+
if (line.startsWith(":")) return SKIP;
|
|
3743
|
+
if (line.startsWith("event:")) {
|
|
3744
|
+
this.inHeartbeatFrame = line.slice(6).trim().toLowerCase() === "ping";
|
|
3745
|
+
return SKIP;
|
|
3746
|
+
}
|
|
3747
|
+
if (line.startsWith("id:") || line.startsWith("retry:")) return SKIP;
|
|
3748
|
+
if (line.startsWith("data:")) {
|
|
3749
|
+
if (this.inHeartbeatFrame) return SKIP;
|
|
3750
|
+
const data = line.slice(5).trim();
|
|
3751
|
+
if (!data) return SKIP;
|
|
3752
|
+
if (data === "[DONE]") return { kind: "done" };
|
|
3753
|
+
return { kind: "json", text: data };
|
|
3754
|
+
}
|
|
3755
|
+
return { kind: "json", text: line };
|
|
3756
|
+
}
|
|
3757
|
+
};
|
|
3758
|
+
}
|
|
3759
|
+
});
|
|
3760
|
+
|
|
3727
3761
|
// src/services/ollama/ollama.service.ts
|
|
3728
3762
|
var import_rxjs, handleError, parseResponseBody, OllamaService;
|
|
3729
3763
|
var init_ollama_service = __esm({
|
|
@@ -3731,6 +3765,7 @@ var init_ollama_service = __esm({
|
|
|
3731
3765
|
"use strict";
|
|
3732
3766
|
import_rxjs = require("rxjs");
|
|
3733
3767
|
init_debugLogger();
|
|
3768
|
+
init_streamLineParser();
|
|
3734
3769
|
handleError = () => (obs) => obs.pipe(
|
|
3735
3770
|
(0, import_rxjs.switchMap)(
|
|
3736
3771
|
(response) => response.ok ? (0, import_rxjs.of)(response) : (0, import_rxjs.throwError)(() => new Error(`Request failed: ${response.status} ${response.statusText}`))
|
|
@@ -3821,13 +3856,15 @@ var init_ollama_service = __esm({
|
|
|
3821
3856
|
this._throwErrorIfNotOk(url, response);
|
|
3822
3857
|
const reader = response.body?.getReader();
|
|
3823
3858
|
const decoder = new TextDecoder();
|
|
3859
|
+
const lineParser = new StreamLineParser();
|
|
3824
3860
|
let buffer = "";
|
|
3825
3861
|
const read = () => {
|
|
3826
3862
|
reader?.read().then(({ done, value }) => {
|
|
3827
3863
|
if (done) {
|
|
3828
|
-
|
|
3864
|
+
const tail = lineParser.next(buffer);
|
|
3865
|
+
if (tail.kind === "json") {
|
|
3829
3866
|
try {
|
|
3830
|
-
observer.next(JSON.parse(
|
|
3867
|
+
observer.next(JSON.parse(tail.text));
|
|
3831
3868
|
} catch (err) {
|
|
3832
3869
|
observer.error(err);
|
|
3833
3870
|
debugLogger.error("Final chunk parsing error (generate):", { buffer });
|
|
@@ -3840,9 +3877,10 @@ var init_ollama_service = __esm({
|
|
|
3840
3877
|
const lines = buffer.split("\n");
|
|
3841
3878
|
buffer = lines.pop() ?? "";
|
|
3842
3879
|
for (const line of lines) {
|
|
3843
|
-
|
|
3880
|
+
const classified = lineParser.next(line);
|
|
3881
|
+
if (classified.kind === "json") {
|
|
3844
3882
|
try {
|
|
3845
|
-
observer.next(JSON.parse(
|
|
3883
|
+
observer.next(JSON.parse(classified.text));
|
|
3846
3884
|
} catch (err) {
|
|
3847
3885
|
observer.error(err);
|
|
3848
3886
|
debugLogger.error("Error parsing JSON line (generate):", { line });
|
|
@@ -3872,13 +3910,15 @@ var init_ollama_service = __esm({
|
|
|
3872
3910
|
this._throwErrorIfNotOk(url, response);
|
|
3873
3911
|
const reader = response.body?.getReader();
|
|
3874
3912
|
const decoder = new TextDecoder();
|
|
3913
|
+
const lineParser = new StreamLineParser();
|
|
3875
3914
|
let buffer = "";
|
|
3876
3915
|
const read = () => {
|
|
3877
3916
|
reader?.read().then(({ done, value }) => {
|
|
3878
3917
|
if (done) {
|
|
3879
|
-
|
|
3918
|
+
const tail = lineParser.next(buffer);
|
|
3919
|
+
if (tail.kind === "json") {
|
|
3880
3920
|
try {
|
|
3881
|
-
observer.next(JSON.parse(
|
|
3921
|
+
observer.next(JSON.parse(tail.text));
|
|
3882
3922
|
} catch (err) {
|
|
3883
3923
|
observer.error(err);
|
|
3884
3924
|
debugLogger.error("Final chunk parsing error (chat):", { buffer });
|
|
@@ -3891,9 +3931,10 @@ var init_ollama_service = __esm({
|
|
|
3891
3931
|
const lines = buffer.split("\n");
|
|
3892
3932
|
buffer = lines.pop() ?? "";
|
|
3893
3933
|
for (const line of lines) {
|
|
3894
|
-
|
|
3934
|
+
const classified = lineParser.next(line);
|
|
3935
|
+
if (classified.kind === "json") {
|
|
3895
3936
|
try {
|
|
3896
|
-
observer.next(JSON.parse(
|
|
3937
|
+
observer.next(JSON.parse(classified.text));
|
|
3897
3938
|
} catch (err) {
|
|
3898
3939
|
observer.error(err);
|
|
3899
3940
|
debugLogger.error("Error parsing JSON line (chat):", { line });
|
|
@@ -4787,6 +4828,7 @@ var init_gateway_service = __esm({
|
|
|
4787
4828
|
"src/services/gateway/gateway.service.ts"() {
|
|
4788
4829
|
"use strict";
|
|
4789
4830
|
import_axios = __toESM(require("axios"));
|
|
4831
|
+
init_streamLineParser();
|
|
4790
4832
|
import_rxjs6 = require("rxjs");
|
|
4791
4833
|
init_debugLogger();
|
|
4792
4834
|
init_authenticationService();
|
|
@@ -4968,13 +5010,15 @@ var init_gateway_service = __esm({
|
|
|
4968
5010
|
const handleStreamingResponse = async (response) => {
|
|
4969
5011
|
const reader = response.body?.getReader();
|
|
4970
5012
|
const decoder = new TextDecoder();
|
|
5013
|
+
const lineParser = new StreamLineParser();
|
|
4971
5014
|
let buffer = "";
|
|
4972
5015
|
const read = () => {
|
|
4973
5016
|
reader?.read().then(({ done, value }) => {
|
|
4974
5017
|
if (done) {
|
|
4975
|
-
|
|
5018
|
+
const tail = lineParser.next(buffer);
|
|
5019
|
+
if (tail.kind === "json") {
|
|
4976
5020
|
try {
|
|
4977
|
-
const finalResponse = JSON.parse(
|
|
5021
|
+
const finalResponse = JSON.parse(tail.text);
|
|
4978
5022
|
observer.next(finalResponse);
|
|
4979
5023
|
} catch (err) {
|
|
4980
5024
|
debugLogger.error("GatewayService chat final chunk parsing error", { buffer, error: err });
|
|
@@ -4988,16 +5032,14 @@ var init_gateway_service = __esm({
|
|
|
4988
5032
|
const lines = buffer.split("\n");
|
|
4989
5033
|
buffer = lines.pop() ?? "";
|
|
4990
5034
|
for (const line of lines) {
|
|
4991
|
-
const
|
|
4992
|
-
if (
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
}
|
|
5000
|
-
}
|
|
5035
|
+
const classified = lineParser.next(line);
|
|
5036
|
+
if (classified.kind === "done") {
|
|
5037
|
+
observer.complete();
|
|
5038
|
+
return;
|
|
5039
|
+
}
|
|
5040
|
+
if (classified.kind === "json") {
|
|
5041
|
+
const trimmed = line.trim();
|
|
5042
|
+
const data = classified.text;
|
|
5001
5043
|
try {
|
|
5002
5044
|
const parsed = JSON.parse(data);
|
|
5003
5045
|
if (request.provider === "ollama" && parsed.message) {
|
|
@@ -5164,13 +5206,15 @@ var init_gateway_service = __esm({
|
|
|
5164
5206
|
}
|
|
5165
5207
|
const reader = response.body?.getReader();
|
|
5166
5208
|
const decoder = new TextDecoder();
|
|
5209
|
+
const lineParser = new StreamLineParser();
|
|
5167
5210
|
let buffer = "";
|
|
5168
5211
|
const read = () => {
|
|
5169
5212
|
reader?.read().then(({ done, value }) => {
|
|
5170
5213
|
if (done) {
|
|
5171
|
-
|
|
5214
|
+
const tail = lineParser.next(buffer);
|
|
5215
|
+
if (tail.kind === "json") {
|
|
5172
5216
|
try {
|
|
5173
|
-
observer.next(JSON.parse(
|
|
5217
|
+
observer.next(JSON.parse(tail.text));
|
|
5174
5218
|
} catch (err) {
|
|
5175
5219
|
observer.error(err);
|
|
5176
5220
|
debugLogger.error("Final chunk parsing error (gateway generate):", { buffer });
|
|
@@ -5183,9 +5227,14 @@ var init_gateway_service = __esm({
|
|
|
5183
5227
|
const lines = buffer.split("\n");
|
|
5184
5228
|
buffer = lines.pop() ?? "";
|
|
5185
5229
|
for (const line of lines) {
|
|
5186
|
-
|
|
5230
|
+
const classified = lineParser.next(line);
|
|
5231
|
+
if (classified.kind === "done") {
|
|
5232
|
+
observer.complete();
|
|
5233
|
+
return;
|
|
5234
|
+
}
|
|
5235
|
+
if (classified.kind === "json") {
|
|
5187
5236
|
try {
|
|
5188
|
-
observer.next(JSON.parse(
|
|
5237
|
+
observer.next(JSON.parse(classified.text));
|
|
5189
5238
|
} catch (err) {
|
|
5190
5239
|
observer.error(err);
|
|
5191
5240
|
debugLogger.error("Error parsing JSON line (gateway generate):", { line });
|
|
@@ -6856,13 +6905,12 @@ var init_aiProviderStore = __esm({
|
|
|
6856
6905
|
});
|
|
6857
6906
|
|
|
6858
6907
|
// src/util.ts
|
|
6859
|
-
var toTitleCase,
|
|
6908
|
+
var toTitleCase, generateSeed, fetchAndConvertToBase64, detectTransparency, banditHead, modelAvatars, resolveAvatar;
|
|
6860
6909
|
var init_util = __esm({
|
|
6861
6910
|
"src/util.ts"() {
|
|
6862
6911
|
"use strict";
|
|
6863
6912
|
init_debugLogger();
|
|
6864
6913
|
toTitleCase = (str) => str.toLowerCase().split(" ").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
|
|
6865
|
-
randomRange = (min, max) => Math.floor(Math.random() * (max - min + 1)) + min;
|
|
6866
6914
|
generateSeed = () => Math.floor(Math.random() * 1e4);
|
|
6867
6915
|
fetchAndConvertToBase64 = async (src) => {
|
|
6868
6916
|
const response = await fetch(src);
|
|
@@ -6922,30 +6970,12 @@ var init_util = __esm({
|
|
|
6922
6970
|
});
|
|
6923
6971
|
|
|
6924
6972
|
// src/prompts/getStableQuestionPrompt.ts
|
|
6925
|
-
var TOPICS,
|
|
6973
|
+
var TOPICS, getStableQuestionPrompt;
|
|
6926
6974
|
var init_getStableQuestionPrompt = __esm({
|
|
6927
6975
|
"src/prompts/getStableQuestionPrompt.ts"() {
|
|
6928
6976
|
"use strict";
|
|
6929
6977
|
init_util();
|
|
6930
6978
|
TOPICS = ["everyday life", "finance", "sports", "travel", "technology", "politics", "health", "food", "entertainment", "education", "science", "history", "art", "music", "literature", "philosophy", "psychology", "sociology", "environmental issues", "current events"];
|
|
6931
|
-
getRandomTopicOfInterest = () => {
|
|
6932
|
-
const minIndex = 0;
|
|
6933
|
-
const maxIndex = TOPICS.length - 1;
|
|
6934
|
-
const randomIndex = randomRange(minIndex, maxIndex);
|
|
6935
|
-
const randomTopic = TOPICS[randomIndex];
|
|
6936
|
-
return randomTopic;
|
|
6937
|
-
};
|
|
6938
|
-
pickDistinctRandomTopics = (count) => {
|
|
6939
|
-
const pool = [...TOPICS];
|
|
6940
|
-
const picked = [];
|
|
6941
|
-
const n = Math.min(Math.max(count, 0), pool.length);
|
|
6942
|
-
for (let i = 0; i < n; i++) {
|
|
6943
|
-
const idx = randomRange(0, pool.length - 1);
|
|
6944
|
-
picked.push(pool[idx]);
|
|
6945
|
-
pool.splice(idx, 1);
|
|
6946
|
-
}
|
|
6947
|
-
return picked;
|
|
6948
|
-
};
|
|
6949
6979
|
getStableQuestionPrompt = (args) => {
|
|
6950
6980
|
const { limit, topicOfInterest, modelSystemPrompt, interests, knowledgeTopics, webSearchAvailable } = args;
|
|
6951
6981
|
if (limit < 1 || limit > 10) {
|
|
@@ -9991,9 +10021,17 @@ var init_useVectorStore = __esm({
|
|
|
9991
10021
|
const hasAnyAdvancedFeatures = isAdvancedVectorFeaturesEnabled;
|
|
9992
10022
|
const hasVectorAccess = features.isAdmin() || features.hasAdvancedSearch() || features.hasAdvancedMemories();
|
|
9993
10023
|
const [hasCompatibleProvider, setHasCompatibleProvider] = (0, import_react3.useState)(false);
|
|
10024
|
+
const mountedRef = (0, import_react3.useRef)(true);
|
|
10025
|
+
(0, import_react3.useEffect)(() => {
|
|
10026
|
+
mountedRef.current = true;
|
|
10027
|
+
return () => {
|
|
10028
|
+
mountedRef.current = false;
|
|
10029
|
+
};
|
|
10030
|
+
}, []);
|
|
9994
10031
|
const checkProviderCompatibility = (0, import_react3.useCallback)(async () => {
|
|
9995
10032
|
try {
|
|
9996
10033
|
const { useAIProviderStore: useAIProviderStore2 } = await Promise.resolve().then(() => (init_aiProviderStore(), aiProviderStore_exports));
|
|
10034
|
+
if (!mountedRef.current) return false;
|
|
9997
10035
|
const aiProviderState = useAIProviderStore2.getState();
|
|
9998
10036
|
const provider = aiProviderState.provider;
|
|
9999
10037
|
const config = aiProviderState.config;
|
|
@@ -10010,7 +10048,7 @@ var init_useVectorStore = __esm({
|
|
|
10010
10048
|
return isCompatible;
|
|
10011
10049
|
} catch (error) {
|
|
10012
10050
|
debugLogger.warn("Could not check AI provider for vector compatibility", { error });
|
|
10013
|
-
setHasCompatibleProvider(false);
|
|
10051
|
+
if (mountedRef.current) setHasCompatibleProvider(false);
|
|
10014
10052
|
return false;
|
|
10015
10053
|
}
|
|
10016
10054
|
}, []);
|
|
@@ -10018,12 +10056,10 @@ var init_useVectorStore = __esm({
|
|
|
10018
10056
|
checkProviderCompatibility();
|
|
10019
10057
|
}, [checkProviderCompatibility]);
|
|
10020
10058
|
(0, import_react3.useEffect)(() => {
|
|
10021
|
-
const
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
};
|
|
10026
|
-
checkOnProviderChange();
|
|
10059
|
+
const timer = setTimeout(() => {
|
|
10060
|
+
void checkProviderCompatibility();
|
|
10061
|
+
}, 100);
|
|
10062
|
+
return () => clearTimeout(timer);
|
|
10027
10063
|
}, [authStore.token, checkProviderCompatibility]);
|
|
10028
10064
|
(0, import_react3.useEffect)(() => {
|
|
10029
10065
|
const interval = setInterval(() => {
|
|
@@ -11422,16 +11458,6 @@ function appBarTokens(theme) {
|
|
|
11422
11458
|
menuText: s.control.foreground
|
|
11423
11459
|
};
|
|
11424
11460
|
}
|
|
11425
|
-
function suggestionTokens(theme) {
|
|
11426
|
-
const s = chatTokens(theme);
|
|
11427
|
-
return {
|
|
11428
|
-
background: s.surface.subtle,
|
|
11429
|
-
text: s.conversation.assistant.foreground,
|
|
11430
|
-
border: s.conversation.border,
|
|
11431
|
-
hoverBackground: s.surface.interactive,
|
|
11432
|
-
hoverBorder: theme.palette.divider
|
|
11433
|
-
};
|
|
11434
|
-
}
|
|
11435
11461
|
function responseTokens(theme) {
|
|
11436
11462
|
const s = chatTokens(theme);
|
|
11437
11463
|
return {
|
|
@@ -27902,203 +27928,84 @@ Respond with just the title and nothing else.
|
|
|
27902
27928
|
});
|
|
27903
27929
|
|
|
27904
27930
|
// src/chat/query-suggestion-picker.tsx
|
|
27905
|
-
|
|
27931
|
+
function QuerySuggestionPicker({ onSend, onSelect }) {
|
|
27932
|
+
const [ideas, setIdeas] = (0, import_react50.useState)([]);
|
|
27933
|
+
const [generating, setGenerating] = (0, import_react50.useState)(false);
|
|
27934
|
+
const [message, setMessage] = (0, import_react50.useState)("");
|
|
27935
|
+
const mounted = (0, import_react50.useRef)(false);
|
|
27936
|
+
const generatingRef = (0, import_react50.useRef)(false);
|
|
27937
|
+
(0, import_react50.useEffect)(() => {
|
|
27938
|
+
mounted.current = true;
|
|
27939
|
+
return () => {
|
|
27940
|
+
mounted.current = false;
|
|
27941
|
+
};
|
|
27942
|
+
}, []);
|
|
27943
|
+
const select = (prompt) => {
|
|
27944
|
+
if (onSelect) onSelect(prompt);
|
|
27945
|
+
else void Promise.resolve(onSend(prompt, [])).catch(() => {
|
|
27946
|
+
});
|
|
27947
|
+
};
|
|
27948
|
+
const generateIdeas = async () => {
|
|
27949
|
+
if (generatingRef.current) return;
|
|
27950
|
+
generatingRef.current = true;
|
|
27951
|
+
setGenerating(true);
|
|
27952
|
+
setMessage("");
|
|
27953
|
+
try {
|
|
27954
|
+
const prefs = usePreferencesStore.getState().preferences;
|
|
27955
|
+
const interests = (prefs.interests ?? []).filter((value) => value?.trim());
|
|
27956
|
+
const prompts = await generateConversationStarters({
|
|
27957
|
+
limit: 3,
|
|
27958
|
+
topicOfInterest: interests.join(", ") || "practical writing, learning, and decisions",
|
|
27959
|
+
interests,
|
|
27960
|
+
modelSystemPrompt: useModelStore.getState().getCurrentModel()?.systemPrompt,
|
|
27961
|
+
knowledgeTopics: prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((doc) => doc.name).filter(Boolean).slice(0, 12) : void 0,
|
|
27962
|
+
webSearchAvailable: useMCPToolsStore.getState().getEnabledTools().some((tool) => tool.name === "web_search")
|
|
27963
|
+
});
|
|
27964
|
+
if (!mounted.current) return;
|
|
27965
|
+
const next = prompts.filter((prompt) => typeof prompt === "string" && prompt.trim()).slice(0, 3);
|
|
27966
|
+
setIdeas(next);
|
|
27967
|
+
setMessage(next.length ? "New ideas are ready. Choose one to get started." : "Ideas are unavailable right now. You can still use a starter or write your own.");
|
|
27968
|
+
} catch {
|
|
27969
|
+
if (mounted.current) setMessage("Ideas are unavailable right now. You can still use a starter or write your own.");
|
|
27970
|
+
} finally {
|
|
27971
|
+
generatingRef.current = false;
|
|
27972
|
+
if (mounted.current) setGenerating(false);
|
|
27973
|
+
}
|
|
27974
|
+
};
|
|
27975
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "section", "aria-label": "Start with a task", sx: { width: "100%", px: { xs: 2, sm: 3 } }, children: [
|
|
27976
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: [
|
|
27977
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "body2", sx: { fontWeight: 600 }, children: "What would move your work forward?" }),
|
|
27978
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Button, { size: "small", startIcon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_react51.Refresh, { size: 14 }), disabled: generating, onClick: () => void generateIdeas(), sx: { flexShrink: 0 }, children: generating ? "Finding ideas\u2026" : "Suggest ideas" })
|
|
27979
|
+
] }),
|
|
27980
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { sx: { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "repeat(3, minmax(0, 1fr))" }, gap: 1 }, children: (ideas.length ? ideas.map((prompt) => ({ title: prompt, detail: "", icon: import_react51.ArrowRight, prompt })) : STARTERS).map(({ title, detail, icon: Icon, prompt }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Button, { variant: "outlined", onClick: () => select(prompt), sx: { display: "flex", alignItems: "flex-start", justifyContent: "flex-start", gap: 1.2, textAlign: "left", textTransform: "none", p: { xs: 1.5, sm: 2 }, height: "100%", color: "text.primary", borderColor: "divider" }, children: [
|
|
27981
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Box, { component: "span", sx: { display: "flex", color: "primary.main", mt: 0.25 }, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Icon, { size: 18 }) }),
|
|
27982
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_material31.Box, { component: "span", children: [
|
|
27983
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "body2", sx: { display: "block", fontWeight: 550, lineHeight: 1.45 }, children: title }),
|
|
27984
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { component: "span", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 0.5, lineHeight: 1.5 }, children: detail })
|
|
27985
|
+
] })
|
|
27986
|
+
] }, title)) }),
|
|
27987
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1.25 }, children: onSelect ? "Choose a starting point, then make it your own before sending." : "Choose a starting point or write your own message." }),
|
|
27988
|
+
message && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_material31.Typography, { role: "status", variant: "caption", sx: { display: "block", color: "text.secondary", mt: 1 }, children: message })
|
|
27989
|
+
] });
|
|
27990
|
+
}
|
|
27991
|
+
var import_react50, import_material31, import_react51, import_jsx_runtime32, STARTERS;
|
|
27906
27992
|
var init_query_suggestion_picker = __esm({
|
|
27907
27993
|
"src/chat/query-suggestion-picker.tsx"() {
|
|
27908
27994
|
"use strict";
|
|
27909
27995
|
import_react50 = require("react");
|
|
27910
27996
|
import_material31 = require("@mui/material");
|
|
27911
|
-
|
|
27912
|
-
import_react_markdown3 = __toESM(require("react-markdown"));
|
|
27913
|
-
import_remark_gfm3 = __toESM(require("remark-gfm"));
|
|
27914
|
-
import_rehype_raw3 = __toESM(require("rehype-raw"));
|
|
27997
|
+
import_react51 = require("@burtson-labs/icons/react");
|
|
27915
27998
|
init_prompts();
|
|
27916
|
-
init_getStableQuestionPrompt();
|
|
27917
27999
|
init_modelStore();
|
|
27918
28000
|
init_preferencesStore();
|
|
27919
28001
|
init_knowledgeStore();
|
|
27920
28002
|
init_mcpToolsStore();
|
|
27921
|
-
init_chat_tokens();
|
|
27922
28003
|
import_jsx_runtime32 = require("react/jsx-runtime");
|
|
27923
|
-
|
|
27924
|
-
|
|
27925
|
-
|
|
27926
|
-
|
|
27927
|
-
|
|
27928
|
-
return inline ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { ...rest, children });
|
|
27929
|
-
}
|
|
27930
|
-
};
|
|
27931
|
-
QuerySuggestionPicker = ({
|
|
27932
|
-
onSend,
|
|
27933
|
-
inputHeight
|
|
27934
|
-
}) => {
|
|
27935
|
-
const hasGenerated = (0, import_react50.useRef)(false);
|
|
27936
|
-
const [hasSentPrompt, setHasSentPrompt] = (0, import_react50.useState)(false);
|
|
27937
|
-
const [examplePrompts, setExamplePrompts] = (0, import_react50.useState)([]);
|
|
27938
|
-
const [visiblePrompts, setVisiblePrompts] = (0, import_react50.useState)([]);
|
|
27939
|
-
const scrollRef = (0, import_react50.useRef)(null);
|
|
27940
|
-
const theme = (0, import_styles21.useTheme)();
|
|
27941
|
-
const isMobile = (0, import_material31.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
27942
|
-
const { background, text, border, hoverBackground, hoverBorder } = suggestionTokens(theme);
|
|
27943
|
-
const { getCurrentModel, isLoading } = useModelStore();
|
|
27944
|
-
(0, import_react50.useEffect)(() => {
|
|
27945
|
-
if (hasGenerated.current || isLoading) return;
|
|
27946
|
-
hasGenerated.current = true;
|
|
27947
|
-
const currentModel = getCurrentModel();
|
|
27948
|
-
const prefs = usePreferencesStore.getState().preferences;
|
|
27949
|
-
const interests = (prefs.interests ?? []).filter((i) => i && i.trim());
|
|
27950
|
-
const randomTopics = pickDistinctRandomTopics(interests.length ? 3 : 5);
|
|
27951
|
-
const topicOfInterest = Array.from(/* @__PURE__ */ new Set([...interests, ...randomTopics])).join(", ") || getRandomTopicOfInterest();
|
|
27952
|
-
const webSearchAvailable = useMCPToolsStore.getState().getEnabledTools().some((t) => t.name === "web_search");
|
|
27953
|
-
const knowledgeTopics = prefs.useKnowledgeForStarters ? useKnowledgeStore.getState().docs.map((d) => d.name).filter((n) => n && n.trim()).slice(0, 12) : void 0;
|
|
27954
|
-
const args = {
|
|
27955
|
-
limit: 9,
|
|
27956
|
-
topicOfInterest,
|
|
27957
|
-
modelSystemPrompt: currentModel?.systemPrompt,
|
|
27958
|
-
interests,
|
|
27959
|
-
knowledgeTopics,
|
|
27960
|
-
webSearchAvailable
|
|
27961
|
-
};
|
|
27962
|
-
generateConversationStarters(args).then((prompts) => {
|
|
27963
|
-
if (prompts.length > 0) {
|
|
27964
|
-
setExamplePrompts(prompts);
|
|
27965
|
-
setVisiblePrompts(prompts.slice(0, 3));
|
|
27966
|
-
} else {
|
|
27967
|
-
setExamplePrompts([]);
|
|
27968
|
-
setVisiblePrompts([]);
|
|
27969
|
-
hasGenerated.current = false;
|
|
27970
|
-
}
|
|
27971
|
-
}).catch((error) => {
|
|
27972
|
-
setExamplePrompts([]);
|
|
27973
|
-
setVisiblePrompts([]);
|
|
27974
|
-
hasGenerated.current = false;
|
|
27975
|
-
});
|
|
27976
|
-
}, [getCurrentModel, isLoading]);
|
|
27977
|
-
(0, import_react50.useEffect)(() => {
|
|
27978
|
-
if (!isLoading) {
|
|
27979
|
-
hasGenerated.current = false;
|
|
27980
|
-
}
|
|
27981
|
-
}, [isLoading]);
|
|
27982
|
-
(0, import_react50.useEffect)(() => {
|
|
27983
|
-
if (hasSentPrompt || examplePrompts.length === 0) return;
|
|
27984
|
-
const interval = setInterval(() => {
|
|
27985
|
-
setExamplePrompts((prev) => {
|
|
27986
|
-
if (prev.length < 3) return prev;
|
|
27987
|
-
const shuffled = [...prev].sort(() => 0.5 - Math.random());
|
|
27988
|
-
setVisiblePrompts((current) => [shuffled[0], current[1], current[2]]);
|
|
27989
|
-
setTimeout(() => {
|
|
27990
|
-
setVisiblePrompts((current) => [shuffled[0], shuffled[1], current[2]]);
|
|
27991
|
-
}, 400);
|
|
27992
|
-
setTimeout(() => {
|
|
27993
|
-
setVisiblePrompts(shuffled.slice(0, 3));
|
|
27994
|
-
}, 800);
|
|
27995
|
-
return shuffled;
|
|
27996
|
-
});
|
|
27997
|
-
}, 12e3);
|
|
27998
|
-
return () => clearInterval(interval);
|
|
27999
|
-
}, [hasSentPrompt, examplePrompts.length]);
|
|
28000
|
-
const displayPrompts = isMobile ? visiblePrompts.slice(0, Math.min(visiblePrompts.length, 6)) : visiblePrompts;
|
|
28001
|
-
return displayPrompts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28002
|
-
import_material31.Box,
|
|
28003
|
-
{
|
|
28004
|
-
ref: scrollRef,
|
|
28005
|
-
sx: {
|
|
28006
|
-
zIndex: 1200,
|
|
28007
|
-
width: "100%",
|
|
28008
|
-
display: "flex",
|
|
28009
|
-
flexDirection: "row",
|
|
28010
|
-
gap: isMobile ? 0.8 : 1,
|
|
28011
|
-
px: isMobile ? 1.5 : 2,
|
|
28012
|
-
overflowX: isMobile ? "auto" : "visible",
|
|
28013
|
-
scrollSnapType: isMobile ? "x mandatory" : "none",
|
|
28014
|
-
WebkitOverflowScrolling: "touch",
|
|
28015
|
-
pb: isMobile ? 0.4 : 0,
|
|
28016
|
-
"&::-webkit-scrollbar": { display: "none" }
|
|
28017
|
-
},
|
|
28018
|
-
children: displayPrompts.map((prompt, i) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28019
|
-
import_material31.Box,
|
|
28020
|
-
{
|
|
28021
|
-
component: "button",
|
|
28022
|
-
type: "button",
|
|
28023
|
-
sx: {
|
|
28024
|
-
appearance: "none",
|
|
28025
|
-
font: "inherit",
|
|
28026
|
-
textAlign: "inherit",
|
|
28027
|
-
"&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 },
|
|
28028
|
-
px: isMobile ? 1.4 : 2,
|
|
28029
|
-
py: isMobile ? 1.2 : 2,
|
|
28030
|
-
flex: isMobile ? "0 0 85%" : 1,
|
|
28031
|
-
minWidth: isMobile ? "85%" : "auto",
|
|
28032
|
-
display: "flex",
|
|
28033
|
-
alignItems: "flex-start",
|
|
28034
|
-
gap: isMobile ? 0.9 : 1,
|
|
28035
|
-
backgroundColor: background,
|
|
28036
|
-
borderRadius: 2,
|
|
28037
|
-
fontSize: isMobile ? "0.875rem" : "0.9rem",
|
|
28038
|
-
color: text,
|
|
28039
|
-
userSelect: "none",
|
|
28040
|
-
cursor: "pointer",
|
|
28041
|
-
border: `1px solid ${border || (0, import_styles21.alpha)(text, 0.12)}`,
|
|
28042
|
-
boxShadow: theme.palette.mode === "dark" ? "0 4px 18px rgba(0,0,0,0.25)" : "0 6px 20px rgba(15,23,42,0.12)",
|
|
28043
|
-
scrollSnapAlign: isMobile ? "start" : "none",
|
|
28044
|
-
transition: "transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease",
|
|
28045
|
-
"&:hover": {
|
|
28046
|
-
backgroundColor: hoverBackground,
|
|
28047
|
-
borderColor: hoverBorder,
|
|
28048
|
-
transform: "translateY(-2px)",
|
|
28049
|
-
boxShadow: theme.palette.mode === "dark" ? "0 6px 22px rgba(0,0,0,0.28)" : "0 8px 24px rgba(15,23,42,0.14)"
|
|
28050
|
-
},
|
|
28051
|
-
"&:active": {
|
|
28052
|
-
transform: "translateY(0) scale(0.98)"
|
|
28053
|
-
}
|
|
28054
|
-
},
|
|
28055
|
-
onClick: () => {
|
|
28056
|
-
void Promise.resolve(onSend(prompt, [])).catch(() => {
|
|
28057
|
-
});
|
|
28058
|
-
setHasSentPrompt(true);
|
|
28059
|
-
},
|
|
28060
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28061
|
-
import_material31.Box,
|
|
28062
|
-
{
|
|
28063
|
-
sx: {
|
|
28064
|
-
flex: 1,
|
|
28065
|
-
lineHeight: 1.4,
|
|
28066
|
-
fontWeight: isMobile ? 500 : 400,
|
|
28067
|
-
textAlign: isMobile ? "left" : "center",
|
|
28068
|
-
...isMobile && { hyphens: "auto", wordBreak: "break-word" },
|
|
28069
|
-
"& code": {
|
|
28070
|
-
borderRadius: 4,
|
|
28071
|
-
fontSize: "0.92em",
|
|
28072
|
-
fontFamily: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace",
|
|
28073
|
-
backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.06),
|
|
28074
|
-
border: `1px solid ${(0, import_styles21.alpha)(theme.palette.text.primary, 0.15)}`,
|
|
28075
|
-
padding: "0.15em 0.35em"
|
|
28076
|
-
},
|
|
28077
|
-
"& mark": {
|
|
28078
|
-
display: "inline-block",
|
|
28079
|
-
backgroundColor: theme.palette.mode === "dark" ? (0, import_styles21.alpha)(theme.palette.common.white, 0.06) : (0, import_styles21.alpha)(theme.palette.text.primary, 0.12),
|
|
28080
|
-
color: theme.palette.mode === "dark" ? theme.palette.common.white : theme.palette.text.primary,
|
|
28081
|
-
borderRadius: 4,
|
|
28082
|
-
padding: "0.1em 0.25em"
|
|
28083
|
-
}
|
|
28084
|
-
},
|
|
28085
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
28086
|
-
import_react_markdown3.default,
|
|
28087
|
-
{
|
|
28088
|
-
remarkPlugins: [import_remark_gfm3.default],
|
|
28089
|
-
rehypePlugins: [import_rehype_raw3.default],
|
|
28090
|
-
components: markdownComponents,
|
|
28091
|
-
children: prompt
|
|
28092
|
-
}
|
|
28093
|
-
)
|
|
28094
|
-
}
|
|
28095
|
-
)
|
|
28096
|
-
},
|
|
28097
|
-
`${i}-${prompt}`
|
|
28098
|
-
))
|
|
28099
|
-
}
|
|
28100
|
-
) });
|
|
28101
|
-
};
|
|
28004
|
+
STARTERS = [
|
|
28005
|
+
{ title: "Make sense of something", detail: "Find the important parts and the open questions.", icon: import_react51.FileText, prompt: "Help me understand the material I share next. Summarize the key points, distinguish facts from assumptions, and call out what is missing." },
|
|
28006
|
+
{ title: "Think through a decision", detail: "Compare options against what matters to you.", icon: import_react51.ListChecks, prompt: "Help me work through a decision. Ask me for the options, constraints, and what matters most, then compare the tradeoffs." },
|
|
28007
|
+
{ title: "Create a useful first draft", detail: "Turn a rough idea into something you can use.", icon: import_react51.PenLine, prompt: "Help me turn an idea into a useful first draft. Ask me what I am making, who it is for, and what a good result looks like." }
|
|
28008
|
+
];
|
|
28102
28009
|
}
|
|
28103
28010
|
});
|
|
28104
28011
|
|
|
@@ -28370,12 +28277,12 @@ function burtsonThemeOptions(modeOrConfig = "dark") {
|
|
|
28370
28277
|
}
|
|
28371
28278
|
};
|
|
28372
28279
|
}
|
|
28373
|
-
var
|
|
28280
|
+
var import_styles21, px;
|
|
28374
28281
|
var init_mui = __esm({
|
|
28375
28282
|
"../../node_modules/@burtson-labs/ui/dist/mui/index.js"() {
|
|
28376
28283
|
"use strict";
|
|
28377
28284
|
init_tokens();
|
|
28378
|
-
|
|
28285
|
+
import_styles21 = require("@mui/material/styles");
|
|
28379
28286
|
px = (rem) => Math.round(parseFloat(rem) * 16);
|
|
28380
28287
|
}
|
|
28381
28288
|
});
|
|
@@ -28643,7 +28550,7 @@ function createBanditTheme(config = {}, ...overrides) {
|
|
|
28643
28550
|
semantics,
|
|
28644
28551
|
cssVars
|
|
28645
28552
|
};
|
|
28646
|
-
return (0,
|
|
28553
|
+
return (0, import_styles22.createTheme)(
|
|
28647
28554
|
base,
|
|
28648
28555
|
{
|
|
28649
28556
|
palette: {
|
|
@@ -28681,11 +28588,11 @@ function createBanditTheme(config = {}, ...overrides) {
|
|
|
28681
28588
|
...overrides
|
|
28682
28589
|
);
|
|
28683
28590
|
}
|
|
28684
|
-
var
|
|
28591
|
+
var import_styles22;
|
|
28685
28592
|
var init_createBanditTheme = __esm({
|
|
28686
28593
|
"../bandit-themes/src/createBanditTheme.ts"() {
|
|
28687
28594
|
"use strict";
|
|
28688
|
-
|
|
28595
|
+
import_styles22 = require("@mui/material/styles");
|
|
28689
28596
|
init_mui();
|
|
28690
28597
|
init_tokens();
|
|
28691
28598
|
init_semantic();
|
|
@@ -28702,9 +28609,9 @@ function BanditThemeProvider({
|
|
|
28702
28609
|
style,
|
|
28703
28610
|
children
|
|
28704
28611
|
}) {
|
|
28705
|
-
const resolved =
|
|
28612
|
+
const resolved = React25.useMemo(() => theme ?? createBanditTheme(config), [theme, config]);
|
|
28706
28613
|
const { cssVars, mode } = resolved.bandit;
|
|
28707
|
-
|
|
28614
|
+
React25.useLayoutEffect(() => {
|
|
28708
28615
|
if (scope !== "document" || typeof document === "undefined") return;
|
|
28709
28616
|
const root = document.documentElement;
|
|
28710
28617
|
const previous = /* @__PURE__ */ new Map();
|
|
@@ -28729,7 +28636,7 @@ function BanditThemeProvider({
|
|
|
28729
28636
|
};
|
|
28730
28637
|
}, [scope, cssVars, mode]);
|
|
28731
28638
|
if (scope === "element") {
|
|
28732
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28733
28640
|
"div",
|
|
28734
28641
|
{
|
|
28735
28642
|
className: [mode === "dark" ? "dark" : "light", className].filter(Boolean).join(" "),
|
|
@@ -28739,14 +28646,14 @@ function BanditThemeProvider({
|
|
|
28739
28646
|
}
|
|
28740
28647
|
) });
|
|
28741
28648
|
}
|
|
28742
|
-
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
28649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_styles23.ThemeProvider, { theme: resolved, children });
|
|
28743
28650
|
}
|
|
28744
|
-
var
|
|
28651
|
+
var import_styles23, React25, import_jsx_runtime33;
|
|
28745
28652
|
var init_provider = __esm({
|
|
28746
28653
|
"../bandit-themes/src/provider.tsx"() {
|
|
28747
28654
|
"use strict";
|
|
28748
|
-
|
|
28749
|
-
|
|
28655
|
+
import_styles23 = require("@mui/material/styles");
|
|
28656
|
+
React25 = __toESM(require("react"));
|
|
28750
28657
|
init_createBanditTheme();
|
|
28751
28658
|
import_jsx_runtime33 = require("react/jsx-runtime");
|
|
28752
28659
|
}
|
|
@@ -28883,7 +28790,7 @@ function TenantPreview({
|
|
|
28883
28790
|
title = "Preview",
|
|
28884
28791
|
renderBody
|
|
28885
28792
|
}) {
|
|
28886
|
-
const pageMode = (0,
|
|
28793
|
+
const pageMode = (0, import_styles24.useTheme)().palette.mode;
|
|
28887
28794
|
const shown = modes ?? (pageMode === "light" ? ["light", "dark"] : ["dark", "light"]);
|
|
28888
28795
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_Stack.default, { spacing: 1.5, role: "group", "aria-label": "Branding preview", children: [
|
|
28889
28796
|
title !== null && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_Typography.default, { component: "h3", variant: "subtitle2", sx: { fontWeight: 600 }, children: title }),
|
|
@@ -28923,7 +28830,7 @@ function PreviewPane({
|
|
|
28923
28830
|
density,
|
|
28924
28831
|
renderBody
|
|
28925
28832
|
}) {
|
|
28926
|
-
const theme =
|
|
28833
|
+
const theme = React26.useMemo(
|
|
28927
28834
|
() => createBanditTheme({
|
|
28928
28835
|
mode,
|
|
28929
28836
|
skin,
|
|
@@ -28974,7 +28881,7 @@ function PreviewPane({
|
|
|
28974
28881
|
}
|
|
28975
28882
|
) });
|
|
28976
28883
|
}
|
|
28977
|
-
var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography,
|
|
28884
|
+
var import_Avatar, import_Box, import_Button, import_Paper, import_Stack, import_Typography, import_styles24, React26, import_jsx_runtime34;
|
|
28978
28885
|
var init_TenantPreview = __esm({
|
|
28979
28886
|
"../bandit-themes/src/TenantPreview.tsx"() {
|
|
28980
28887
|
"use strict";
|
|
@@ -28984,8 +28891,8 @@ var init_TenantPreview = __esm({
|
|
|
28984
28891
|
import_Paper = __toESM(require("@mui/material/Paper"));
|
|
28985
28892
|
import_Stack = __toESM(require("@mui/material/Stack"));
|
|
28986
28893
|
import_Typography = __toESM(require("@mui/material/Typography"));
|
|
28987
|
-
|
|
28988
|
-
|
|
28894
|
+
import_styles24 = require("@mui/material/styles");
|
|
28895
|
+
React26 = __toESM(require("react"));
|
|
28989
28896
|
init_createBanditTheme();
|
|
28990
28897
|
init_provider();
|
|
28991
28898
|
import_jsx_runtime34 = require("react/jsx-runtime");
|
|
@@ -29098,14 +29005,14 @@ var init_UnderReview = __esm({
|
|
|
29098
29005
|
});
|
|
29099
29006
|
|
|
29100
29007
|
// src/components/feedback/FeedbackPulse.tsx
|
|
29101
|
-
var
|
|
29008
|
+
var import_react52, import_material33, import_styles25, import_react53, import_jsx_runtime36, STORAGE_KEY3, COOLDOWN_DAYS, MIN_SESSION_MS, MIN_MESSAGES_SENT, CHECK_INTERVAL_MS, readLastInteraction, recordInteraction, FeedbackPulse, FeedbackPulse_default;
|
|
29102
29009
|
var init_FeedbackPulse = __esm({
|
|
29103
29010
|
"src/components/feedback/FeedbackPulse.tsx"() {
|
|
29104
29011
|
"use strict";
|
|
29105
|
-
|
|
29012
|
+
import_react52 = require("react");
|
|
29106
29013
|
import_material33 = require("@mui/material");
|
|
29107
|
-
|
|
29108
|
-
|
|
29014
|
+
import_styles25 = require("@mui/material/styles");
|
|
29015
|
+
import_react53 = require("@burtson-labs/icons/react");
|
|
29109
29016
|
init_conversationStore();
|
|
29110
29017
|
init_FeedbackModal();
|
|
29111
29018
|
init_debugLogger();
|
|
@@ -29130,22 +29037,22 @@ var init_FeedbackPulse = __esm({
|
|
|
29130
29037
|
debugLogger.info("FeedbackPulse: interaction recorded", { outcome });
|
|
29131
29038
|
};
|
|
29132
29039
|
FeedbackPulse = ({ isMobile, feedbackEmail }) => {
|
|
29133
|
-
const theme = (0,
|
|
29134
|
-
const [visible, setVisible] = (0,
|
|
29135
|
-
const [thanked, setThanked] = (0,
|
|
29136
|
-
const [modalOpen, setModalOpen] = (0,
|
|
29137
|
-
const mountedAtRef = (0,
|
|
29138
|
-
const baselineMessagesRef = (0,
|
|
29040
|
+
const theme = (0, import_styles25.useTheme)();
|
|
29041
|
+
const [visible, setVisible] = (0, import_react52.useState)(false);
|
|
29042
|
+
const [thanked, setThanked] = (0, import_react52.useState)(false);
|
|
29043
|
+
const [modalOpen, setModalOpen] = (0, import_react52.useState)(false);
|
|
29044
|
+
const mountedAtRef = (0, import_react52.useRef)(Date.now());
|
|
29045
|
+
const baselineMessagesRef = (0, import_react52.useRef)(null);
|
|
29139
29046
|
const totalMessages = useConversationStore(
|
|
29140
29047
|
(s) => s.conversations.reduce((n, c) => n + c.history.length, 0)
|
|
29141
29048
|
);
|
|
29142
29049
|
const hydrated = useConversationStore((s) => s._hasHydrated);
|
|
29143
|
-
(0,
|
|
29050
|
+
(0, import_react52.useEffect)(() => {
|
|
29144
29051
|
if (hydrated && baselineMessagesRef.current === null) {
|
|
29145
29052
|
baselineMessagesRef.current = totalMessages;
|
|
29146
29053
|
}
|
|
29147
29054
|
}, [hydrated, totalMessages]);
|
|
29148
|
-
(0,
|
|
29055
|
+
(0, import_react52.useEffect)(() => {
|
|
29149
29056
|
const cooldownMs = COOLDOWN_DAYS * 24 * 60 * 60 * 1e3;
|
|
29150
29057
|
const forced = typeof window !== "undefined" && new URLSearchParams(window.location.search).has("feedbackPulse");
|
|
29151
29058
|
const check = () => {
|
|
@@ -29204,7 +29111,7 @@ var init_FeedbackPulse = __esm({
|
|
|
29204
29111
|
color: theme.palette.text.secondary,
|
|
29205
29112
|
transition: "background-color 0.15s ease, transform 0.1s ease",
|
|
29206
29113
|
"&:hover": {
|
|
29207
|
-
bgcolor: (0,
|
|
29114
|
+
bgcolor: (0, import_styles25.alpha)(theme.palette.text.primary, 0.06),
|
|
29208
29115
|
color: theme.palette.text.primary
|
|
29209
29116
|
},
|
|
29210
29117
|
"&:active": { transform: "scale(0.96)" }
|
|
@@ -29233,17 +29140,17 @@ var init_FeedbackPulse = __esm({
|
|
|
29233
29140
|
borderRadius: 3,
|
|
29234
29141
|
border: `1px solid ${theme.palette.divider}`,
|
|
29235
29142
|
bgcolor: theme.palette.background.paper,
|
|
29236
|
-
boxShadow: `0 12px 40px ${(0,
|
|
29143
|
+
boxShadow: `0 12px 40px ${(0, import_styles25.alpha)(theme.palette.common.black, theme.palette.mode === "dark" ? 0.5 : 0.18)}`
|
|
29237
29144
|
},
|
|
29238
29145
|
children: thanked ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { sx: { textAlign: "center", py: 1.5, fontWeight: 600 }, children: "Thanks for the feedback!" }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
29239
29146
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", alignItems: "center", mb: 0.5 }, children: [
|
|
29240
29147
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: "How's Bandit doing?" }),
|
|
29241
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29148
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_material33.IconButton, { size: "small", onClick: dismiss, "aria-label": "Dismiss feedback prompt", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.X, { size: 16 }) })
|
|
29242
29149
|
] }),
|
|
29243
29150
|
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_material33.Box, { sx: { display: "flex", justifyContent: "space-evenly" }, children: [
|
|
29244
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29245
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29246
|
-
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
29151
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Smile, { size: 22, color: theme.palette.success.main }), "Good", "good"),
|
|
29152
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Meh, { size: 22, color: theme.palette.warning.main }), "Fine", "fine"),
|
|
29153
|
+
choice(/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_react53.Frown, { size: 22, color: theme.palette.error.main }), "Bad", "bad")
|
|
29247
29154
|
] })
|
|
29248
29155
|
] })
|
|
29249
29156
|
}
|
|
@@ -29263,16 +29170,16 @@ var init_FeedbackPulse = __esm({
|
|
|
29263
29170
|
});
|
|
29264
29171
|
|
|
29265
29172
|
// src/hooks/useNotificationService.ts
|
|
29266
|
-
var
|
|
29173
|
+
var import_react54, useNotificationService;
|
|
29267
29174
|
var init_useNotificationService = __esm({
|
|
29268
29175
|
"src/hooks/useNotificationService.ts"() {
|
|
29269
29176
|
"use strict";
|
|
29270
|
-
|
|
29177
|
+
import_react54 = require("react");
|
|
29271
29178
|
init_NotificationProvider();
|
|
29272
29179
|
init_notificationService();
|
|
29273
29180
|
useNotificationService = () => {
|
|
29274
29181
|
const notificationContext = useNotification();
|
|
29275
|
-
(0,
|
|
29182
|
+
(0, import_react54.useEffect)(() => {
|
|
29276
29183
|
notificationService.setContext(notificationContext);
|
|
29277
29184
|
}, [notificationContext]);
|
|
29278
29185
|
return {
|
|
@@ -29379,11 +29286,11 @@ var init_ConnectionStatus = __esm({
|
|
|
29379
29286
|
});
|
|
29380
29287
|
|
|
29381
29288
|
// src/hooks/useVoiceMode.ts
|
|
29382
|
-
var
|
|
29289
|
+
var import_react55, RMS_BASELINE, RMS_NORMALIZER, computeRms, pickSupportedMimeType, useVoiceMode;
|
|
29383
29290
|
var init_useVoiceMode = __esm({
|
|
29384
29291
|
"src/hooks/useVoiceMode.ts"() {
|
|
29385
29292
|
"use strict";
|
|
29386
|
-
|
|
29293
|
+
import_react55 = require("react");
|
|
29387
29294
|
init_stt_client();
|
|
29388
29295
|
init_debugLogger();
|
|
29389
29296
|
init_voiceModeStore();
|
|
@@ -29416,11 +29323,11 @@ var init_useVoiceMode = __esm({
|
|
|
29416
29323
|
const setError = useVoiceModeStore((state) => state.setError);
|
|
29417
29324
|
const resetTransientState = useVoiceModeStore((state) => state.resetTransientState);
|
|
29418
29325
|
const setLastTranscript = useVoiceModeStore((state) => state.setLastTranscript);
|
|
29419
|
-
const configRef = (0,
|
|
29420
|
-
(0,
|
|
29326
|
+
const configRef = (0, import_react55.useRef)(config);
|
|
29327
|
+
(0, import_react55.useEffect)(() => {
|
|
29421
29328
|
configRef.current = config;
|
|
29422
29329
|
}, [config]);
|
|
29423
|
-
(0,
|
|
29330
|
+
(0, import_react55.useEffect)(() => {
|
|
29424
29331
|
if (!enabled) {
|
|
29425
29332
|
return () => void 0;
|
|
29426
29333
|
}
|
|
@@ -29681,15 +29588,15 @@ var chat_exports = {};
|
|
|
29681
29588
|
__export(chat_exports, {
|
|
29682
29589
|
default: () => chat_default
|
|
29683
29590
|
});
|
|
29684
|
-
var
|
|
29591
|
+
var import_react56, import_material35, import_styles26, import_react_router_dom5, import_react57, import_jsx_runtime38, ChatContent, Chat, chat_default;
|
|
29685
29592
|
var init_chat2 = __esm({
|
|
29686
29593
|
"src/chat/chat.tsx"() {
|
|
29687
29594
|
"use strict";
|
|
29688
|
-
|
|
29595
|
+
import_react56 = require("react");
|
|
29689
29596
|
init_custom_logo();
|
|
29690
29597
|
init_indexedDBService();
|
|
29691
29598
|
import_material35 = require("@mui/material");
|
|
29692
|
-
|
|
29599
|
+
import_styles26 = require("@mui/material/styles");
|
|
29693
29600
|
init_chat_tokens();
|
|
29694
29601
|
init_chat_skeleton();
|
|
29695
29602
|
init_aiQueryStore();
|
|
@@ -29731,7 +29638,7 @@ var init_chat2 = __esm({
|
|
|
29731
29638
|
init_FeatureFlagContext();
|
|
29732
29639
|
init_knowledgeStore();
|
|
29733
29640
|
init_icons();
|
|
29734
|
-
|
|
29641
|
+
import_react57 = require("@burtson-labs/icons/react");
|
|
29735
29642
|
import_jsx_runtime38 = require("react/jsx-runtime");
|
|
29736
29643
|
ChatContent = () => {
|
|
29737
29644
|
const packageSettings = usePackageSettingsStore((state) => state.settings);
|
|
@@ -29741,8 +29648,8 @@ var init_chat2 = __esm({
|
|
|
29741
29648
|
const ossMode = isOSSMode() || !packageSettings?.featureFlags?.subscriptionType;
|
|
29742
29649
|
const playgroundBypassAccess = packageSettings?.playgroundBypassAuth || typeof window !== "undefined" && window.location.pathname.includes("/playground");
|
|
29743
29650
|
const notificationService2 = useNotificationService();
|
|
29744
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
29745
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
29651
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react56.useState)(null);
|
|
29652
|
+
const [themeLoading, setThemeLoading] = (0, import_react56.useState)(true);
|
|
29746
29653
|
const token = authenticationService.getToken();
|
|
29747
29654
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
29748
29655
|
const baseTheme = registry_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
@@ -29769,12 +29676,12 @@ var init_chat2 = __esm({
|
|
|
29769
29676
|
} = useVoiceStore();
|
|
29770
29677
|
const isVoiceModeEnabled = useVoiceModeStore((state) => state.enabled);
|
|
29771
29678
|
const canvasOpen = useCanvasStore((state) => state.open);
|
|
29772
|
-
const previousVoiceModeEnabledRef = (0,
|
|
29773
|
-
const historyRef = (0,
|
|
29774
|
-
(0,
|
|
29679
|
+
const previousVoiceModeEnabledRef = (0, import_react56.useRef)(isVoiceModeEnabled);
|
|
29680
|
+
const historyRef = (0, import_react56.useRef)(history);
|
|
29681
|
+
(0, import_react56.useEffect)(() => {
|
|
29775
29682
|
historyRef.current = history;
|
|
29776
29683
|
}, [history]);
|
|
29777
|
-
(0,
|
|
29684
|
+
(0, import_react56.useEffect)(() => {
|
|
29778
29685
|
if (!hydrated) return;
|
|
29779
29686
|
const params = new URLSearchParams(window.location.search);
|
|
29780
29687
|
const title = params.get("title") || "";
|
|
@@ -29790,7 +29697,7 @@ var init_chat2 = __esm({
|
|
|
29790
29697
|
stop: ttsStop,
|
|
29791
29698
|
isAvailable: isTTSAvailable
|
|
29792
29699
|
} = useTTS();
|
|
29793
|
-
(0,
|
|
29700
|
+
(0, import_react56.useEffect)(() => {
|
|
29794
29701
|
const timer = setTimeout(() => {
|
|
29795
29702
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29796
29703
|
if (!initialized || availableVoices.length === 0) {
|
|
@@ -29804,7 +29711,7 @@ var init_chat2 = __esm({
|
|
|
29804
29711
|
}, 500);
|
|
29805
29712
|
return () => clearTimeout(timer);
|
|
29806
29713
|
}, [initialized, availableVoices.length, loadVoicesFromAPI, token]);
|
|
29807
|
-
(0,
|
|
29714
|
+
(0, import_react56.useEffect)(() => {
|
|
29808
29715
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
29809
29716
|
if (packageSettings?.gatewayApiUrl && availableVoices.length === 0 && !initialized) {
|
|
29810
29717
|
if (token && isAuthenticated) {
|
|
@@ -29816,22 +29723,22 @@ var init_chat2 = __esm({
|
|
|
29816
29723
|
}
|
|
29817
29724
|
}, [packageSettings?.gatewayApiUrl, availableVoices.length, initialized, loadVoicesFromAPI, token]);
|
|
29818
29725
|
const provider = useAIProviderStore((state) => state.provider);
|
|
29819
|
-
const inputRef = (0,
|
|
29820
|
-
const [pastedImages, setPastedImages] = (0,
|
|
29821
|
-
const inputContainerRef = (0,
|
|
29822
|
-
const [inputHeight, setInputHeight] = (0,
|
|
29823
|
-
const [isSubmitting, setIsSubmitting] = (0,
|
|
29824
|
-
const [pendingMessage, setPendingMessage] = (0,
|
|
29726
|
+
const inputRef = (0, import_react56.useRef)(null);
|
|
29727
|
+
const [pastedImages, setPastedImages] = (0, import_react56.useState)([]);
|
|
29728
|
+
const inputContainerRef = (0, import_react56.useRef)(null);
|
|
29729
|
+
const [inputHeight, setInputHeight] = (0, import_react56.useState)(80);
|
|
29730
|
+
const [isSubmitting, setIsSubmitting] = (0, import_react56.useState)(false);
|
|
29731
|
+
const [pendingMessage, setPendingMessage] = (0, import_react56.useState)(null);
|
|
29825
29732
|
const { conversations, currentId, _hasHydrated, hydrate, toggleIncognito } = useConversationStore();
|
|
29826
29733
|
const isTemporaryChat = Boolean(conversations.find((c) => c.id === currentId)?.incognito);
|
|
29827
|
-
const [isMobile, setIsMobile] = (0,
|
|
29828
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
29829
|
-
const [mobileConversationsOpen, setMobileConversationsOpen] = (0,
|
|
29830
|
-
const cardSwipeStartXRef = (0,
|
|
29831
|
-
const dragStartRef = (0,
|
|
29832
|
-
const [drawerDragX, setDrawerDragX] = (0,
|
|
29833
|
-
const [drawerSettling, setDrawerSettling] = (0,
|
|
29834
|
-
const [drawerSwap, setDrawerSwap] = (0,
|
|
29734
|
+
const [isMobile, setIsMobile] = (0, import_react56.useState)(false);
|
|
29735
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react56.useState)(false);
|
|
29736
|
+
const [mobileConversationsOpen, setMobileConversationsOpen] = (0, import_react56.useState)(false);
|
|
29737
|
+
const cardSwipeStartXRef = (0, import_react56.useRef)(null);
|
|
29738
|
+
const dragStartRef = (0, import_react56.useRef)(null);
|
|
29739
|
+
const [drawerDragX, setDrawerDragX] = (0, import_react56.useState)(null);
|
|
29740
|
+
const [drawerSettling, setDrawerSettling] = (0, import_react56.useState)(false);
|
|
29741
|
+
const [drawerSwap, setDrawerSwap] = (0, import_react56.useState)(false);
|
|
29835
29742
|
const drawerOpenOffset = () => (typeof window === "undefined" ? 360 : Math.min(window.innerWidth - 56, 360)) - 12;
|
|
29836
29743
|
const drawerDragStart = (e) => {
|
|
29837
29744
|
const t = e.touches[0];
|
|
@@ -29891,7 +29798,7 @@ var init_chat2 = __esm({
|
|
|
29891
29798
|
translate: `${drawerDragX}px 0`,
|
|
29892
29799
|
transition: drawerSettling ? "translate 0.22s cubic-bezier(0.2, 0.8, 0.2, 1)" : "none"
|
|
29893
29800
|
} : void 0;
|
|
29894
|
-
(0,
|
|
29801
|
+
(0, import_react56.useEffect)(() => {
|
|
29895
29802
|
if (typeof document === "undefined") return;
|
|
29896
29803
|
const meta = document.querySelector('meta[name="theme-color"]');
|
|
29897
29804
|
if (!meta) return;
|
|
@@ -29909,36 +29816,36 @@ var init_chat2 = __esm({
|
|
|
29909
29816
|
const chatContainerEl = chatContainerRef.current;
|
|
29910
29817
|
const scrollTargetEl = scrollTargetRef.current;
|
|
29911
29818
|
const { isSlowConnection, connectionQuality, trackRequestStart, trackRequestEnd } = useNetworkStatus();
|
|
29912
|
-
const [showScrollToBottom, setShowScrollToBottom] = (0,
|
|
29913
|
-
const [streamBuffer, setStreamBuffer] = (0,
|
|
29914
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
29915
|
-
const [isStreaming, setIsStreaming] = (0,
|
|
29916
|
-
const [isThinking, setIsThinking] = (0,
|
|
29819
|
+
const [showScrollToBottom, setShowScrollToBottom] = (0, import_react56.useState)(false);
|
|
29820
|
+
const [streamBuffer, setStreamBuffer] = (0, import_react56.useState)("");
|
|
29821
|
+
const [responseStarted, setResponseStarted] = (0, import_react56.useState)(false);
|
|
29822
|
+
const [isStreaming, setIsStreaming] = (0, import_react56.useState)(false);
|
|
29823
|
+
const [isThinking, setIsThinking] = (0, import_react56.useState)(false);
|
|
29917
29824
|
const initialLogoState = history.length === 0;
|
|
29918
|
-
const [logoVisible, setLogoVisible] = (0,
|
|
29919
|
-
const [logoShouldRender, setLogoShouldRender] = (0,
|
|
29920
|
-
const streamingGraceUntilRef = (0,
|
|
29825
|
+
const [logoVisible, setLogoVisible] = (0, import_react56.useState)(initialLogoState);
|
|
29826
|
+
const [logoShouldRender, setLogoShouldRender] = (0, import_react56.useState)(initialLogoState);
|
|
29827
|
+
const streamingGraceUntilRef = (0, import_react56.useRef)(0);
|
|
29921
29828
|
const GRACE_MS = 450;
|
|
29922
29829
|
const GRACE_OFFSET_DESKTOP = 28;
|
|
29923
29830
|
const GRACE_OFFSET_MOBILE = 20;
|
|
29924
|
-
const followStreamRef = (0,
|
|
29925
|
-
const lastSpokenResponseRef = (0,
|
|
29926
|
-
const previousConversationIdRef = (0,
|
|
29927
|
-
const logoFadeTimeoutRef = (0,
|
|
29928
|
-
const [branding, setBranding] = (0,
|
|
29929
|
-
const [brandingLoading, setBrandingLoading] = (0,
|
|
29930
|
-
const isBrandingLoadInProgressRef = (0,
|
|
29831
|
+
const followStreamRef = (0, import_react56.useRef)(true);
|
|
29832
|
+
const lastSpokenResponseRef = (0, import_react56.useRef)(null);
|
|
29833
|
+
const previousConversationIdRef = (0, import_react56.useRef)(null);
|
|
29834
|
+
const logoFadeTimeoutRef = (0, import_react56.useRef)(null);
|
|
29835
|
+
const [branding, setBranding] = (0, import_react56.useState)(null);
|
|
29836
|
+
const [brandingLoading, setBrandingLoading] = (0, import_react56.useState)(true);
|
|
29837
|
+
const isBrandingLoadInProgressRef = (0, import_react56.useRef)(false);
|
|
29931
29838
|
const logoOnly = history.length === 0 && !brandingLoading;
|
|
29932
29839
|
const knowledgeDocs = useKnowledgeStore((s) => s.docs);
|
|
29933
29840
|
const knowledgeLoaded = useKnowledgeStore((s) => s.isLoaded);
|
|
29934
|
-
const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0,
|
|
29841
|
+
const [knowledgeNudgeDismissed, setKnowledgeNudgeDismissed] = (0, import_react56.useState)(() => {
|
|
29935
29842
|
try {
|
|
29936
29843
|
return localStorage.getItem("bandit.knowledgeNudge.dismissed") === "true";
|
|
29937
29844
|
} catch {
|
|
29938
29845
|
return false;
|
|
29939
29846
|
}
|
|
29940
29847
|
});
|
|
29941
|
-
const dismissKnowledgeNudge = (0,
|
|
29848
|
+
const dismissKnowledgeNudge = (0, import_react56.useCallback)(() => {
|
|
29942
29849
|
setKnowledgeNudgeDismissed(true);
|
|
29943
29850
|
try {
|
|
29944
29851
|
localStorage.setItem("bandit.knowledgeNudge.dismissed", "true");
|
|
@@ -29952,7 +29859,7 @@ var init_chat2 = __esm({
|
|
|
29952
29859
|
window.location.assign(to);
|
|
29953
29860
|
}
|
|
29954
29861
|
};
|
|
29955
|
-
(0,
|
|
29862
|
+
(0, import_react56.useEffect)(() => {
|
|
29956
29863
|
const isEmptyConversation = (history?.length ?? 0) === 0;
|
|
29957
29864
|
const isSending = Boolean(pendingMessage);
|
|
29958
29865
|
const shouldShowLogo = isEmptyConversation && !isSending;
|
|
@@ -29982,7 +29889,7 @@ var init_chat2 = __esm({
|
|
|
29982
29889
|
}, 500);
|
|
29983
29890
|
}
|
|
29984
29891
|
}, [history, pendingMessage]);
|
|
29985
|
-
(0,
|
|
29892
|
+
(0, import_react56.useEffect)(() => {
|
|
29986
29893
|
if (!brandingLoading && !themeLoading) {
|
|
29987
29894
|
return;
|
|
29988
29895
|
}
|
|
@@ -29998,18 +29905,18 @@ var init_chat2 = __esm({
|
|
|
29998
29905
|
}, 2500);
|
|
29999
29906
|
return () => window.clearTimeout(timeoutId);
|
|
30000
29907
|
}, [brandingLoading, themeLoading, selectedTheme]);
|
|
30001
|
-
(0,
|
|
29908
|
+
(0, import_react56.useEffect)(() => () => {
|
|
30002
29909
|
if (logoFadeTimeoutRef.current) {
|
|
30003
29910
|
window.clearTimeout(logoFadeTimeoutRef.current);
|
|
30004
29911
|
logoFadeTimeoutRef.current = null;
|
|
30005
29912
|
}
|
|
30006
29913
|
}, []);
|
|
30007
|
-
(0,
|
|
29914
|
+
(0, import_react56.useEffect)(() => {
|
|
30008
29915
|
if (isStreaming && streamBuffer.trim() === "") {
|
|
30009
29916
|
streamingGraceUntilRef.current = Date.now() + GRACE_MS;
|
|
30010
29917
|
}
|
|
30011
29918
|
}, [isStreaming, streamBuffer]);
|
|
30012
|
-
(0,
|
|
29919
|
+
(0, import_react56.useEffect)(() => {
|
|
30013
29920
|
if (!isStreaming) return;
|
|
30014
29921
|
const container = chatContainerRef.current;
|
|
30015
29922
|
if (!container) return;
|
|
@@ -30020,13 +29927,13 @@ var init_chat2 = __esm({
|
|
|
30020
29927
|
container.scrollTo({ top: targetTop, behavior: "smooth" });
|
|
30021
29928
|
}
|
|
30022
29929
|
}, [streamBuffer, isStreaming, isMobile, chatContainerRef]);
|
|
30023
|
-
(0,
|
|
29930
|
+
(0, import_react56.useEffect)(() => {
|
|
30024
29931
|
if (!_hasHydrated) {
|
|
30025
29932
|
debugLogger.info("Chat component triggering conversation store hydration");
|
|
30026
29933
|
hydrate();
|
|
30027
29934
|
}
|
|
30028
29935
|
}, [_hasHydrated, hydrate]);
|
|
30029
|
-
(0,
|
|
29936
|
+
(0, import_react56.useEffect)(() => {
|
|
30030
29937
|
const loadBrandingAndTheme = async () => {
|
|
30031
29938
|
if (isBrandingLoadInProgressRef.current) {
|
|
30032
29939
|
debugLogger.warn("Branding loading already in progress, skipping");
|
|
@@ -30215,7 +30122,7 @@ var init_chat2 = __esm({
|
|
|
30215
30122
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
30216
30123
|
};
|
|
30217
30124
|
}, []);
|
|
30218
|
-
(0,
|
|
30125
|
+
(0, import_react56.useEffect)(() => {
|
|
30219
30126
|
if (!chatContainerEl) return;
|
|
30220
30127
|
const blurInputOnTouchScroll = () => {
|
|
30221
30128
|
if (document.activeElement === inputRef.current) inputRef.current?.blur();
|
|
@@ -30223,13 +30130,13 @@ var init_chat2 = __esm({
|
|
|
30223
30130
|
chatContainerEl.addEventListener("touchmove", blurInputOnTouchScroll, { passive: true });
|
|
30224
30131
|
return () => chatContainerEl.removeEventListener("touchmove", blurInputOnTouchScroll);
|
|
30225
30132
|
}, [chatContainerEl]);
|
|
30226
|
-
(0,
|
|
30133
|
+
(0, import_react56.useEffect)(() => {
|
|
30227
30134
|
const handleResize = () => setIsMobile(window.innerWidth <= 768);
|
|
30228
30135
|
handleResize();
|
|
30229
30136
|
window.addEventListener("resize", handleResize);
|
|
30230
30137
|
return () => window.removeEventListener("resize", handleResize);
|
|
30231
30138
|
}, []);
|
|
30232
|
-
(0,
|
|
30139
|
+
(0, import_react56.useEffect)(() => {
|
|
30233
30140
|
const setViewportHeight = () => {
|
|
30234
30141
|
document.documentElement.style.setProperty(
|
|
30235
30142
|
"--vh",
|
|
@@ -30240,7 +30147,7 @@ var init_chat2 = __esm({
|
|
|
30240
30147
|
window.addEventListener("resize", setViewportHeight);
|
|
30241
30148
|
return () => window.removeEventListener("resize", setViewportHeight);
|
|
30242
30149
|
}, []);
|
|
30243
|
-
(0,
|
|
30150
|
+
(0, import_react56.useEffect)(() => {
|
|
30244
30151
|
if (!chatContainerEl) return;
|
|
30245
30152
|
let rafId = null;
|
|
30246
30153
|
const update = () => {
|
|
@@ -30259,7 +30166,7 @@ var init_chat2 = __esm({
|
|
|
30259
30166
|
chatContainerEl.removeEventListener(SCROLL_STATE_CHANGED_EVENT, update);
|
|
30260
30167
|
};
|
|
30261
30168
|
}, [chatContainerEl, getScrollState]);
|
|
30262
|
-
(0,
|
|
30169
|
+
(0, import_react56.useEffect)(() => {
|
|
30263
30170
|
if (!chatContainerEl) return;
|
|
30264
30171
|
let observer = null;
|
|
30265
30172
|
let rafId = null;
|
|
@@ -30294,7 +30201,7 @@ var init_chat2 = __esm({
|
|
|
30294
30201
|
if (observer) observer.disconnect();
|
|
30295
30202
|
};
|
|
30296
30203
|
}, [chatContainerEl, scrollTargetEl, scrollTargetRef, getScrollState, inputHeight, history.length]);
|
|
30297
|
-
(0,
|
|
30204
|
+
(0, import_react56.useEffect)(() => {
|
|
30298
30205
|
const isTransitioning = isStreaming || streamBuffer.trim() === "";
|
|
30299
30206
|
const delay = isTransitioning ? 400 : 100;
|
|
30300
30207
|
const timer = setTimeout(() => {
|
|
@@ -30303,7 +30210,7 @@ var init_chat2 = __esm({
|
|
|
30303
30210
|
}, delay);
|
|
30304
30211
|
return () => clearTimeout(timer);
|
|
30305
30212
|
}, [history, streamBuffer, getScrollState, isStreaming]);
|
|
30306
|
-
(0,
|
|
30213
|
+
(0, import_react56.useLayoutEffect)(() => {
|
|
30307
30214
|
const scrollState = getScrollState();
|
|
30308
30215
|
const now = Date.now();
|
|
30309
30216
|
if (isStreaming && scrollState.shouldAutoScroll && followStreamRef.current) {
|
|
@@ -30337,7 +30244,7 @@ var init_chat2 = __esm({
|
|
|
30337
30244
|
return () => clearTimeout(scrollTimer);
|
|
30338
30245
|
}
|
|
30339
30246
|
}, [history, isStreaming, scrollToBottom, getScrollState, isMobile, chatContainerRef]);
|
|
30340
|
-
(0,
|
|
30247
|
+
(0, import_react56.useEffect)(() => {
|
|
30341
30248
|
const observer = new ResizeObserver(() => {
|
|
30342
30249
|
if (inputContainerRef.current)
|
|
30343
30250
|
setInputHeight(inputContainerRef.current.offsetHeight);
|
|
@@ -30348,7 +30255,7 @@ var init_chat2 = __esm({
|
|
|
30348
30255
|
}
|
|
30349
30256
|
return () => observer.disconnect();
|
|
30350
30257
|
}, []);
|
|
30351
|
-
(0,
|
|
30258
|
+
(0, import_react56.useEffect)(() => {
|
|
30352
30259
|
if (!hydrated || !_hasHydrated) return;
|
|
30353
30260
|
if (currentId === null) {
|
|
30354
30261
|
useAIQueryStore.setState({ history: [] });
|
|
@@ -30397,7 +30304,7 @@ var init_chat2 = __esm({
|
|
|
30397
30304
|
setResponse,
|
|
30398
30305
|
setComponentStatus
|
|
30399
30306
|
]);
|
|
30400
|
-
(0,
|
|
30307
|
+
(0, import_react56.useEffect)(() => {
|
|
30401
30308
|
debugLogger.info("Chat component conversation state", {
|
|
30402
30309
|
hasHydrated: _hasHydrated,
|
|
30403
30310
|
conversationCount: conversations.length,
|
|
@@ -30406,7 +30313,7 @@ var init_chat2 = __esm({
|
|
|
30406
30313
|
storeState: "main-chat"
|
|
30407
30314
|
});
|
|
30408
30315
|
}, [_hasHydrated, conversations, currentId]);
|
|
30409
|
-
(0,
|
|
30316
|
+
(0, import_react56.useEffect)(() => {
|
|
30410
30317
|
if (!_hasHydrated || !chatContainerEl) return;
|
|
30411
30318
|
let rafId = null;
|
|
30412
30319
|
const sync = () => {
|
|
@@ -30420,8 +30327,8 @@ var init_chat2 = __esm({
|
|
|
30420
30327
|
if (rafId) cancelAnimationFrame(rafId);
|
|
30421
30328
|
};
|
|
30422
30329
|
}, [_hasHydrated, chatContainerEl, getScrollState, history.length]);
|
|
30423
|
-
const sendAckRef = (0,
|
|
30424
|
-
const settleSendAck = (0,
|
|
30330
|
+
const sendAckRef = (0, import_react56.useRef)(null);
|
|
30331
|
+
const settleSendAck = (0, import_react56.useCallback)((outcome) => {
|
|
30425
30332
|
const ack = sendAckRef.current;
|
|
30426
30333
|
if (!ack) return;
|
|
30427
30334
|
sendAckRef.current = null;
|
|
@@ -30450,7 +30357,7 @@ var init_chat2 = __esm({
|
|
|
30450
30357
|
notificationService2?.handleHttpError(error);
|
|
30451
30358
|
}
|
|
30452
30359
|
});
|
|
30453
|
-
const handleStop = (0,
|
|
30360
|
+
const handleStop = (0, import_react56.useCallback)(() => {
|
|
30454
30361
|
try {
|
|
30455
30362
|
aiProvider.cancel();
|
|
30456
30363
|
} catch (error) {
|
|
@@ -30459,7 +30366,7 @@ var init_chat2 = __esm({
|
|
|
30459
30366
|
});
|
|
30460
30367
|
}
|
|
30461
30368
|
}, [aiProvider]);
|
|
30462
|
-
const handleVoiceInterrupt = (0,
|
|
30369
|
+
const handleVoiceInterrupt = (0, import_react56.useCallback)(() => {
|
|
30463
30370
|
try {
|
|
30464
30371
|
ttsStop();
|
|
30465
30372
|
} catch (error) {
|
|
@@ -30478,7 +30385,7 @@ var init_chat2 = __esm({
|
|
|
30478
30385
|
handleStop();
|
|
30479
30386
|
}
|
|
30480
30387
|
}, [ttsStop, isStreaming, handleStop]);
|
|
30481
|
-
const handleSend = (0,
|
|
30388
|
+
const handleSend = (0, import_react56.useCallback)(
|
|
30482
30389
|
(question, images, displayQuestion) => {
|
|
30483
30390
|
sendAckRef.current?.resolve();
|
|
30484
30391
|
const acknowledged = new Promise((resolve, reject) => {
|
|
@@ -30615,7 +30522,7 @@ var init_chat2 = __esm({
|
|
|
30615
30522
|
trackRequestStart
|
|
30616
30523
|
]
|
|
30617
30524
|
);
|
|
30618
|
-
const handleVoiceTranscription = (0,
|
|
30525
|
+
const handleVoiceTranscription = (0, import_react56.useCallback)(
|
|
30619
30526
|
(text) => {
|
|
30620
30527
|
const cleaned = text.trim();
|
|
30621
30528
|
if (!cleaned) {
|
|
@@ -30633,7 +30540,7 @@ var init_chat2 = __esm({
|
|
|
30633
30540
|
onInterrupt: handleVoiceInterrupt,
|
|
30634
30541
|
onError: (message) => notificationService2?.showError?.(message)
|
|
30635
30542
|
});
|
|
30636
|
-
(0,
|
|
30543
|
+
(0, import_react56.useEffect)(() => {
|
|
30637
30544
|
const previouslyEnabled = previousVoiceModeEnabledRef.current;
|
|
30638
30545
|
previousVoiceModeEnabledRef.current = isVoiceModeEnabled;
|
|
30639
30546
|
if (!previouslyEnabled && isVoiceModeEnabled) {
|
|
@@ -30658,7 +30565,7 @@ var init_chat2 = __esm({
|
|
|
30658
30565
|
}
|
|
30659
30566
|
}
|
|
30660
30567
|
}, [isVoiceModeEnabled, ttsStop]);
|
|
30661
|
-
(0,
|
|
30568
|
+
(0, import_react56.useEffect)(() => {
|
|
30662
30569
|
if (!isVoiceModeEnabled || !isStreaming) {
|
|
30663
30570
|
return;
|
|
30664
30571
|
}
|
|
@@ -30678,7 +30585,7 @@ var init_chat2 = __esm({
|
|
|
30678
30585
|
}
|
|
30679
30586
|
lastSpokenResponseRef.current = null;
|
|
30680
30587
|
}, [isStreaming, isVoiceModeEnabled, ttsStop]);
|
|
30681
|
-
(0,
|
|
30588
|
+
(0, import_react56.useEffect)(() => {
|
|
30682
30589
|
if (!isVoiceModeEnabled) {
|
|
30683
30590
|
lastSpokenResponseRef.current = null;
|
|
30684
30591
|
return;
|
|
@@ -30719,13 +30626,13 @@ var init_chat2 = __esm({
|
|
|
30719
30626
|
cancelled = true;
|
|
30720
30627
|
};
|
|
30721
30628
|
}, [history, isStreaming, isVoiceModeEnabled, isTTSAvailable, ttsSpeak]);
|
|
30722
|
-
const handleModelChange = (0,
|
|
30629
|
+
const handleModelChange = (0, import_react56.useCallback)(
|
|
30723
30630
|
(modelId) => {
|
|
30724
30631
|
setSelectedModel(modelId);
|
|
30725
30632
|
},
|
|
30726
30633
|
[setSelectedModel]
|
|
30727
30634
|
);
|
|
30728
|
-
const handleVoiceChange = (0,
|
|
30635
|
+
const handleVoiceChange = (0, import_react56.useCallback)(async (voiceId) => {
|
|
30729
30636
|
ttsStop();
|
|
30730
30637
|
stopTTS();
|
|
30731
30638
|
setSelectedVoice(voiceId);
|
|
@@ -30899,7 +30806,7 @@ var init_chat2 = __esm({
|
|
|
30899
30806
|
whiteSpace: "nowrap"
|
|
30900
30807
|
}),
|
|
30901
30808
|
children: [
|
|
30902
|
-
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
30809
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react57.Ghost, { size: 14, "aria-hidden": true }),
|
|
30903
30810
|
"Temporary chat",
|
|
30904
30811
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
30905
30812
|
import_material35.Box,
|
|
@@ -30929,7 +30836,7 @@ var init_chat2 = __esm({
|
|
|
30929
30836
|
"@media (pointer: coarse)": { "&::after": { content: '""', position: "absolute", inset: -11 } },
|
|
30930
30837
|
"&:hover": {
|
|
30931
30838
|
opacity: 1,
|
|
30932
|
-
bgcolor: (0,
|
|
30839
|
+
bgcolor: (0, import_styles26.alpha)(theme.palette.getContrastText(theme.palette.text.primary), 0.16)
|
|
30933
30840
|
}
|
|
30934
30841
|
}),
|
|
30935
30842
|
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_x.X, { fontSize: "inherit", "aria-hidden": true })
|
|
@@ -31115,7 +31022,17 @@ var init_chat2 = __esm({
|
|
|
31115
31022
|
},
|
|
31116
31023
|
children: [
|
|
31117
31024
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { flex: "1 1 auto" } }),
|
|
31118
|
-
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
31025
|
+
history.length === 0 && componentStatus !== "Loading" && !pendingMessage && preferences.chatSuggestionsEnabled && /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_material35.Box, { sx: { marginBottom: "20px", width: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
31026
|
+
QuerySuggestionPicker,
|
|
31027
|
+
{
|
|
31028
|
+
onSend: handleSend,
|
|
31029
|
+
onSelect: (prompt) => {
|
|
31030
|
+
setInputValue(prompt);
|
|
31031
|
+
inputRef.current?.focus();
|
|
31032
|
+
},
|
|
31033
|
+
inputHeight
|
|
31034
|
+
}
|
|
31035
|
+
) }),
|
|
31119
31036
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(rate_limit_prompt_default, {}),
|
|
31120
31037
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(ask_user_card_default, {}),
|
|
31121
31038
|
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
@@ -31711,7 +31628,7 @@ var chat_provider_default = ChatProvider;
|
|
|
31711
31628
|
init_chat2();
|
|
31712
31629
|
|
|
31713
31630
|
// src/management/management.tsx
|
|
31714
|
-
var
|
|
31631
|
+
var import_react85 = require("react");
|
|
31715
31632
|
var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
|
|
31716
31633
|
init_useKnowledgeStore();
|
|
31717
31634
|
init_indexedDBService();
|
|
@@ -31719,22 +31636,22 @@ var import_material60 = require("@mui/material");
|
|
|
31719
31636
|
var import_react_router_dom7 = require("react-router-dom");
|
|
31720
31637
|
|
|
31721
31638
|
// src/modals/chat-modal/chat-modal.tsx
|
|
31722
|
-
var
|
|
31639
|
+
var import_react66 = require("react");
|
|
31723
31640
|
var import_material43 = require("@mui/material");
|
|
31724
31641
|
var import_react_router_dom6 = require("react-router-dom");
|
|
31725
31642
|
|
|
31726
31643
|
// src/modals/chat-modal/draggable-box.tsx
|
|
31727
|
-
var
|
|
31644
|
+
var import_react58 = __toESM(require("react"));
|
|
31728
31645
|
var import_material36 = require("@mui/material");
|
|
31729
31646
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
31730
31647
|
var SCROLLABLE_THRESHOLD = 200;
|
|
31731
|
-
var DraggableBox =
|
|
31648
|
+
var DraggableBox = import_react58.default.forwardRef(
|
|
31732
31649
|
({ children, fullScreen, position, setPosition, onDrag, onScrollThresholdExceeded }, ref) => {
|
|
31733
31650
|
const theme = (0, import_material36.useTheme)();
|
|
31734
|
-
const [transitionProps, setTransitionProps] = (0,
|
|
31735
|
-
const [isDragging, setIsDragging] = (0,
|
|
31736
|
-
const [isHovering, setIsHovering] = (0,
|
|
31737
|
-
(0,
|
|
31651
|
+
const [transitionProps, setTransitionProps] = (0, import_react58.useState)("all");
|
|
31652
|
+
const [isDragging, setIsDragging] = (0, import_react58.useState)(false);
|
|
31653
|
+
const [isHovering, setIsHovering] = (0, import_react58.useState)(false);
|
|
31654
|
+
(0, import_react58.useEffect)(() => {
|
|
31738
31655
|
if (ref && typeof ref !== "function" && ref.current && !fullScreen) {
|
|
31739
31656
|
const modal = ref.current;
|
|
31740
31657
|
const contentHeight = modal.scrollHeight;
|
|
@@ -31810,7 +31727,7 @@ var DraggableBox = import_react57.default.forwardRef(
|
|
|
31810
31727
|
var draggable_box_default = DraggableBox;
|
|
31811
31728
|
|
|
31812
31729
|
// src/modals/chat-modal/modal-header.tsx
|
|
31813
|
-
var
|
|
31730
|
+
var import_react59 = require("react");
|
|
31814
31731
|
var import_material37 = require("@mui/material");
|
|
31815
31732
|
init_icons();
|
|
31816
31733
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
@@ -31830,7 +31747,7 @@ var ModalHeader = ({
|
|
|
31830
31747
|
const theme = (0, import_material37.useTheme)();
|
|
31831
31748
|
const isMobile = (0, import_material37.useMediaQuery)((theme2) => theme2.breakpoints.down("sm"));
|
|
31832
31749
|
const displayLogo = logo && logo !== banditaiLogo ? logo : banditHead3;
|
|
31833
|
-
const [isHovering, setIsHovering] = (0,
|
|
31750
|
+
const [isHovering, setIsHovering] = (0, import_react59.useState)(false);
|
|
31834
31751
|
const buttonStyles = {
|
|
31835
31752
|
transition: "all 0.15s ease-out",
|
|
31836
31753
|
borderRadius: "8px",
|
|
@@ -32028,7 +31945,7 @@ var ModalHeader = ({
|
|
|
32028
31945
|
var modal_header_default = ModalHeader;
|
|
32029
31946
|
|
|
32030
31947
|
// src/modals/chat-modal/query-input.tsx
|
|
32031
|
-
var
|
|
31948
|
+
var import_react60 = require("react");
|
|
32032
31949
|
var import_material38 = require("@mui/material");
|
|
32033
31950
|
init_icons();
|
|
32034
31951
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
@@ -32046,7 +31963,7 @@ var QueryInput = ({
|
|
|
32046
31963
|
// Destructure endAdornment
|
|
32047
31964
|
}) => {
|
|
32048
31965
|
const theme = (0, import_material38.useTheme)();
|
|
32049
|
-
const inputRef = (0,
|
|
31966
|
+
const inputRef = (0, import_react60.useRef)(null);
|
|
32050
31967
|
const handleSend = (e, payload) => {
|
|
32051
31968
|
onSend(e, payload);
|
|
32052
31969
|
};
|
|
@@ -32113,7 +32030,7 @@ init_ai_response_text_field();
|
|
|
32113
32030
|
init_indexedDBService();
|
|
32114
32031
|
|
|
32115
32032
|
// src/modals/chat-modal/chat-drawer.tsx
|
|
32116
|
-
var
|
|
32033
|
+
var import_react61 = __toESM(require("react"));
|
|
32117
32034
|
var import_material39 = require("@mui/material");
|
|
32118
32035
|
init_aiQueryStore();
|
|
32119
32036
|
init_conversationStore();
|
|
@@ -32149,23 +32066,23 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32149
32066
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
32150
32067
|
const provider = useAIProviderStore((state) => state.provider);
|
|
32151
32068
|
const { selectedModel, availableModels } = useModelStore();
|
|
32152
|
-
const [searchTerm, setSearchTerm] = (0,
|
|
32153
|
-
const [expandedItems, setExpandedItems] = (0,
|
|
32154
|
-
const [expandedConversations, setExpandedConversations] = (0,
|
|
32155
|
-
const [confirmClearOpen, setConfirmClearOpen] = (0,
|
|
32156
|
-
const [infoDialogOpen, setInfoDialogOpen] = (0,
|
|
32157
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
32158
|
-
const [contextMode, setContextMode] = (0,
|
|
32159
|
-
const [expandedSections, setExpandedSections] = (0,
|
|
32160
|
-
const [audioSub, setAudioSub] = (0,
|
|
32161
|
-
const [isContextSwitching, setIsContextSwitching] = (0,
|
|
32162
|
-
const [isDrawerLoading, setIsDrawerLoading] = (0,
|
|
32163
|
-
(0,
|
|
32069
|
+
const [searchTerm, setSearchTerm] = (0, import_react61.useState)("");
|
|
32070
|
+
const [expandedItems, setExpandedItems] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
|
|
32071
|
+
const [expandedConversations, setExpandedConversations] = (0, import_react61.useState)(/* @__PURE__ */ new Set());
|
|
32072
|
+
const [confirmClearOpen, setConfirmClearOpen] = (0, import_react61.useState)(false);
|
|
32073
|
+
const [infoDialogOpen, setInfoDialogOpen] = (0, import_react61.useState)(false);
|
|
32074
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react61.useState)(false);
|
|
32075
|
+
const [contextMode, setContextMode] = (0, import_react61.useState)("local");
|
|
32076
|
+
const [expandedSections, setExpandedSections] = (0, import_react61.useState)(/* @__PURE__ */ new Set(["history", "voice"]));
|
|
32077
|
+
const [audioSub, setAudioSub] = (0, import_react61.useState)(new import_rxjs22.Subscription());
|
|
32078
|
+
const [isContextSwitching, setIsContextSwitching] = (0, import_react61.useState)(false);
|
|
32079
|
+
const [isDrawerLoading, setIsDrawerLoading] = (0, import_react61.useState)(false);
|
|
32080
|
+
(0, import_react61.useEffect)(() => {
|
|
32164
32081
|
if (drawerOpen && !_hasHydrated) {
|
|
32165
32082
|
hydrate();
|
|
32166
32083
|
}
|
|
32167
32084
|
}, [drawerOpen, _hasHydrated, hydrate]);
|
|
32168
|
-
(0,
|
|
32085
|
+
(0, import_react61.useEffect)(() => {
|
|
32169
32086
|
if (!drawerOpen) {
|
|
32170
32087
|
setIsDrawerLoading(false);
|
|
32171
32088
|
const cleanupTimer = setTimeout(() => {
|
|
@@ -32176,7 +32093,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32176
32093
|
return () => clearTimeout(cleanupTimer);
|
|
32177
32094
|
}
|
|
32178
32095
|
}, [drawerOpen]);
|
|
32179
|
-
(0,
|
|
32096
|
+
(0, import_react61.useEffect)(() => {
|
|
32180
32097
|
return () => {
|
|
32181
32098
|
audioSub.unsubscribe();
|
|
32182
32099
|
};
|
|
@@ -32223,7 +32140,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32223
32140
|
const currentConversation = conversations.find((c) => c.id === currentId);
|
|
32224
32141
|
const isInitialLoading = !_hasHydrated && contextMode === "main";
|
|
32225
32142
|
const isContentLoading = isContextSwitching || isInitialLoading;
|
|
32226
|
-
(0,
|
|
32143
|
+
(0, import_react61.useEffect)(() => {
|
|
32227
32144
|
if (drawerOpen) {
|
|
32228
32145
|
const debugTimer = setTimeout(() => {
|
|
32229
32146
|
debugLogger.debug("Chat drawer loading states", {
|
|
@@ -32238,7 +32155,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32238
32155
|
return () => clearTimeout(debugTimer);
|
|
32239
32156
|
}
|
|
32240
32157
|
}, [drawerOpen, _hasHydrated, isDrawerLoading, isContentLoading, contextMode]);
|
|
32241
|
-
(0,
|
|
32158
|
+
(0, import_react61.useEffect)(() => {
|
|
32242
32159
|
debugLogger.debug("Chat drawer voice availability check", {
|
|
32243
32160
|
isServiceAvailable,
|
|
32244
32161
|
ttsEnabled: preferences.ttsEnabled,
|
|
@@ -32249,14 +32166,14 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32249
32166
|
storeState: "modal-chat-drawer-voice"
|
|
32250
32167
|
});
|
|
32251
32168
|
}, [isServiceAvailable, preferences.ttsEnabled, packageSettings?.gatewayApiUrl, isVoiceAvailable, availableVoices.length, selectedVoice]);
|
|
32252
|
-
const activeHistory = (0,
|
|
32169
|
+
const activeHistory = (0, import_react61.useMemo)(() => {
|
|
32253
32170
|
if (contextMode === "local") {
|
|
32254
32171
|
return history;
|
|
32255
32172
|
}
|
|
32256
32173
|
return currentConversation?.history ?? [];
|
|
32257
32174
|
}, [contextMode, history, currentConversation]);
|
|
32258
32175
|
const effectiveContextMode = contextMode === "main" && (!currentConversation || currentConversation.history.length === 0) ? "local" : contextMode;
|
|
32259
|
-
(0,
|
|
32176
|
+
(0, import_react61.useEffect)(() => {
|
|
32260
32177
|
debugLogger.debug("Chat drawer context state", {
|
|
32261
32178
|
contextMode,
|
|
32262
32179
|
effectiveContextMode,
|
|
@@ -32269,13 +32186,13 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
32269
32186
|
storeState: "modal-chat-drawer"
|
|
32270
32187
|
});
|
|
32271
32188
|
}, [contextMode, effectiveContextMode, conversations.length, currentId, currentConversation, history.length, _hasHydrated]);
|
|
32272
|
-
const filteredHistory = (0,
|
|
32189
|
+
const filteredHistory = (0, import_react61.useMemo)(() => {
|
|
32273
32190
|
const filtered = activeHistory.filter(
|
|
32274
32191
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
32275
32192
|
);
|
|
32276
32193
|
return filtered.slice(-20);
|
|
32277
32194
|
}, [activeHistory, searchTerm]);
|
|
32278
|
-
const filteredConversations = (0,
|
|
32195
|
+
const filteredConversations = (0, import_react61.useMemo)(() => {
|
|
32279
32196
|
const filtered = conversations.filter(
|
|
32280
32197
|
(conversation) => conversation.name.toLowerCase().includes(searchTerm.toLowerCase()) || conversation.history.some(
|
|
32281
32198
|
(entry) => entry.question.toLowerCase().includes(searchTerm.toLowerCase()) || entry.answer.toLowerCase().includes(searchTerm.toLowerCase())
|
|
@@ -33161,7 +33078,7 @@ var AIQueriesDrawer = ({ drawerOpen, onClose, onClearComplete, onNavigateToMain
|
|
|
33161
33078
|
}
|
|
33162
33079
|
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material39.List, { sx: { p: 0 }, children: [...filteredHistory].reverse().map((entry, index) => {
|
|
33163
33080
|
const isExpanded = expandedItems.has(index);
|
|
33164
|
-
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
33081
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_react61.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
33165
33082
|
import_material39.ListItem,
|
|
33166
33083
|
{
|
|
33167
33084
|
sx: {
|
|
@@ -33638,9 +33555,9 @@ var GenericLoader = ({
|
|
|
33638
33555
|
var generic_loader_default = GenericLoader;
|
|
33639
33556
|
|
|
33640
33557
|
// src/components/feedback/FeedbackButton.tsx
|
|
33641
|
-
var
|
|
33558
|
+
var import_react62 = require("react");
|
|
33642
33559
|
var import_material41 = require("@mui/material");
|
|
33643
|
-
var
|
|
33560
|
+
var import_react63 = require("@burtson-labs/icons/react");
|
|
33644
33561
|
|
|
33645
33562
|
// src/components/feedback/index.tsx
|
|
33646
33563
|
init_FeedbackModal();
|
|
@@ -33659,7 +33576,7 @@ var FeedbackButton = ({
|
|
|
33659
33576
|
absolute = false
|
|
33660
33577
|
}) => {
|
|
33661
33578
|
const theme = (0, import_material41.useTheme)();
|
|
33662
|
-
const [open, setOpen] = (0,
|
|
33579
|
+
const [open, setOpen] = (0, import_react62.useState)(false);
|
|
33663
33580
|
const handleOpen = () => setOpen(true);
|
|
33664
33581
|
const handleClose = () => setOpen(false);
|
|
33665
33582
|
if (inline) {
|
|
@@ -33668,7 +33585,7 @@ var FeedbackButton = ({
|
|
|
33668
33585
|
import_material41.Button,
|
|
33669
33586
|
{
|
|
33670
33587
|
variant: "outlined",
|
|
33671
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33588
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {}),
|
|
33672
33589
|
onClick: handleOpen,
|
|
33673
33590
|
className,
|
|
33674
33591
|
size,
|
|
@@ -33697,7 +33614,7 @@ var FeedbackButton = ({
|
|
|
33697
33614
|
transform: "translateY(-1px)"
|
|
33698
33615
|
}
|
|
33699
33616
|
},
|
|
33700
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33617
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
|
|
33701
33618
|
}
|
|
33702
33619
|
) }),
|
|
33703
33620
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
@@ -33756,7 +33673,7 @@ var FeedbackButton = ({
|
|
|
33756
33673
|
}
|
|
33757
33674
|
}
|
|
33758
33675
|
},
|
|
33759
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
33676
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_react63.MessageCircle, {})
|
|
33760
33677
|
}
|
|
33761
33678
|
)
|
|
33762
33679
|
}
|
|
@@ -33773,7 +33690,7 @@ var FeedbackButton = ({
|
|
|
33773
33690
|
};
|
|
33774
33691
|
|
|
33775
33692
|
// src/hooks/useAiChat.ts
|
|
33776
|
-
var
|
|
33693
|
+
var import_react64 = require("react");
|
|
33777
33694
|
var import_material42 = require("@mui/material");
|
|
33778
33695
|
init_aiQueryStore();
|
|
33779
33696
|
init_aiProviderStore();
|
|
@@ -33785,10 +33702,10 @@ var useAIChat = () => {
|
|
|
33785
33702
|
const provider = useAIProviderStore((state) => state.provider);
|
|
33786
33703
|
const SYSTEM_PROMPT = useModelStore((state) => state.systemPrompt);
|
|
33787
33704
|
const OLLAMA_MODEL = usePackageSettingsStore((state) => state.settings?.defaultModel || "");
|
|
33788
|
-
const [fullScreen, setFullScreen] = (0,
|
|
33789
|
-
const [drawerOpen, setDrawerOpen] = (0,
|
|
33790
|
-
const [showSettings, setShowSettings] = (0,
|
|
33791
|
-
const [, setAutoFullscreenTriggered] = (0,
|
|
33705
|
+
const [fullScreen, setFullScreen] = (0, import_react64.useState)(isMobile);
|
|
33706
|
+
const [drawerOpen, setDrawerOpen] = (0, import_react64.useState)(false);
|
|
33707
|
+
const [showSettings, setShowSettings] = (0, import_react64.useState)(false);
|
|
33708
|
+
const [, setAutoFullscreenTriggered] = (0, import_react64.useState)(false);
|
|
33792
33709
|
const {
|
|
33793
33710
|
apiKey,
|
|
33794
33711
|
inputValue,
|
|
@@ -33876,7 +33793,7 @@ var useAIChat = () => {
|
|
|
33876
33793
|
}
|
|
33877
33794
|
sendWithAIProvider();
|
|
33878
33795
|
};
|
|
33879
|
-
(0,
|
|
33796
|
+
(0, import_react64.useEffect)(() => {
|
|
33880
33797
|
setFullScreen(isMobile);
|
|
33881
33798
|
}, [isMobile]);
|
|
33882
33799
|
return {
|
|
@@ -33892,12 +33809,12 @@ var useAIChat = () => {
|
|
|
33892
33809
|
var useAiChat_default = useAIChat;
|
|
33893
33810
|
|
|
33894
33811
|
// src/hooks/useDraggable.ts
|
|
33895
|
-
var
|
|
33812
|
+
var import_react65 = require("react");
|
|
33896
33813
|
var useDraggable = () => {
|
|
33897
|
-
const modalRef = (0,
|
|
33898
|
-
const [dragging, setDragging] = (0,
|
|
33899
|
-
const [offset, setOffset] = (0,
|
|
33900
|
-
const [position, setPosition] = (0,
|
|
33814
|
+
const modalRef = (0, import_react65.useRef)(null);
|
|
33815
|
+
const [dragging, setDragging] = (0, import_react65.useState)(false);
|
|
33816
|
+
const [offset, setOffset] = (0, import_react65.useState)({ x: 0, y: 0 });
|
|
33817
|
+
const [position, setPosition] = (0, import_react65.useState)({ x: 0, y: 0 });
|
|
33901
33818
|
const handleHeaderMouseDown = (e) => {
|
|
33902
33819
|
const rect = modalRef.current?.getBoundingClientRect();
|
|
33903
33820
|
if (rect) {
|
|
@@ -33905,7 +33822,7 @@ var useDraggable = () => {
|
|
|
33905
33822
|
setDragging(true);
|
|
33906
33823
|
}
|
|
33907
33824
|
};
|
|
33908
|
-
const handleHeaderMouseMove = (0,
|
|
33825
|
+
const handleHeaderMouseMove = (0, import_react65.useCallback)(
|
|
33909
33826
|
(e) => {
|
|
33910
33827
|
if (dragging) {
|
|
33911
33828
|
setPosition({ x: e.clientX - offset.x, y: e.clientY - offset.y });
|
|
@@ -33916,7 +33833,7 @@ var useDraggable = () => {
|
|
|
33916
33833
|
const handleHeaderMouseUp = () => {
|
|
33917
33834
|
setDragging(false);
|
|
33918
33835
|
};
|
|
33919
|
-
(0,
|
|
33836
|
+
(0, import_react65.useEffect)(() => {
|
|
33920
33837
|
if (dragging) {
|
|
33921
33838
|
document.addEventListener("mousemove", handleHeaderMouseMove);
|
|
33922
33839
|
document.addEventListener("mouseup", handleHeaderMouseUp);
|
|
@@ -33966,7 +33883,7 @@ var modelAvatars3 = {
|
|
|
33966
33883
|
"Bandit-Exec": `${CDN_BASE2}/avatars/exec-avatar.png`
|
|
33967
33884
|
};
|
|
33968
33885
|
var useOptionalNavigate = () => {
|
|
33969
|
-
const hasLoggedRef = (0,
|
|
33886
|
+
const hasLoggedRef = (0, import_react66.useRef)(false);
|
|
33970
33887
|
try {
|
|
33971
33888
|
return (0, import_react_router_dom6.useNavigate)();
|
|
33972
33889
|
} catch (error) {
|
|
@@ -34015,17 +33932,17 @@ var ChatModal = ({
|
|
|
34015
33932
|
handleSend
|
|
34016
33933
|
} = useAiChat_default();
|
|
34017
33934
|
const { modalRef, position, setPosition, handleDrag, handleHeaderMouseDown } = useDraggable_default();
|
|
34018
|
-
const [pastedImages, setPastedImages] = (0,
|
|
34019
|
-
const [responseStarted, setResponseStarted] = (0,
|
|
34020
|
-
const [modalLogo, setModalLogo] = (0,
|
|
34021
|
-
const [modelAnchorEl, setModelAnchorEl] = (0,
|
|
34022
|
-
const [voiceAnchorEl, setVoiceAnchorEl] = (0,
|
|
34023
|
-
const [audioSub, setAudioSub] = (0,
|
|
34024
|
-
const [selectedTheme, setSelectedTheme] = (0,
|
|
34025
|
-
const [themeLoading, setThemeLoading] = (0,
|
|
34026
|
-
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0,
|
|
34027
|
-
const [userHasDragged, setUserHasDragged] = (0,
|
|
34028
|
-
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0,
|
|
33935
|
+
const [pastedImages, setPastedImages] = (0, import_react66.useState)([]);
|
|
33936
|
+
const [responseStarted, setResponseStarted] = (0, import_react66.useState)(false);
|
|
33937
|
+
const [modalLogo, setModalLogo] = (0, import_react66.useState)("https://cdn.burtson.ai/logos/bandit-ai-logo.png");
|
|
33938
|
+
const [modelAnchorEl, setModelAnchorEl] = (0, import_react66.useState)(null);
|
|
33939
|
+
const [voiceAnchorEl, setVoiceAnchorEl] = (0, import_react66.useState)(null);
|
|
33940
|
+
const [audioSub, setAudioSub] = (0, import_react66.useState)(new import_rxjs23.Subscription());
|
|
33941
|
+
const [selectedTheme, setSelectedTheme] = (0, import_react66.useState)(null);
|
|
33942
|
+
const [themeLoading, setThemeLoading] = (0, import_react66.useState)(true);
|
|
33943
|
+
const [autoFullscreenTriggered, setAutoFullscreenTriggered] = (0, import_react66.useState)(false);
|
|
33944
|
+
const [userHasDragged, setUserHasDragged] = (0, import_react66.useState)(false);
|
|
33945
|
+
const [manualFullscreenToggleTime, setManualFullscreenToggleTime] = (0, import_react66.useState)(0);
|
|
34029
33946
|
const handleExitFullscreen = () => {
|
|
34030
33947
|
setPosition({
|
|
34031
33948
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -34071,7 +33988,7 @@ var ChatModal = ({
|
|
|
34071
33988
|
const toTitleCase2 = (str) => {
|
|
34072
33989
|
return str.replace(/\w\S*/g, (txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());
|
|
34073
33990
|
};
|
|
34074
|
-
(0,
|
|
33991
|
+
(0, import_react66.useEffect)(() => {
|
|
34075
33992
|
if (!SYSTEM_PROMPT) {
|
|
34076
33993
|
const defaultModel = availableModels.length > 0 ? availableModels[0] : null;
|
|
34077
33994
|
if (defaultModel) {
|
|
@@ -34079,12 +33996,12 @@ var ChatModal = ({
|
|
|
34079
33996
|
}
|
|
34080
33997
|
}
|
|
34081
33998
|
}, [SYSTEM_PROMPT, availableModels, setSelectedModel]);
|
|
34082
|
-
(0,
|
|
33999
|
+
(0, import_react66.useEffect)(() => {
|
|
34083
34000
|
return () => {
|
|
34084
34001
|
audioSub.unsubscribe();
|
|
34085
34002
|
};
|
|
34086
34003
|
}, [audioSub]);
|
|
34087
|
-
(0,
|
|
34004
|
+
(0, import_react66.useEffect)(() => {
|
|
34088
34005
|
if (open) {
|
|
34089
34006
|
setPosition({
|
|
34090
34007
|
x: Math.max(0, window.innerWidth / 2 - 300),
|
|
@@ -34096,7 +34013,7 @@ var ChatModal = ({
|
|
|
34096
34013
|
getOptimalLogo().then(setModalLogo);
|
|
34097
34014
|
}
|
|
34098
34015
|
}, [open, setPosition]);
|
|
34099
|
-
(0,
|
|
34016
|
+
(0, import_react66.useEffect)(() => {
|
|
34100
34017
|
if (!open) return;
|
|
34101
34018
|
const fetchTheme = async () => {
|
|
34102
34019
|
try {
|
|
@@ -34130,7 +34047,7 @@ var ChatModal = ({
|
|
|
34130
34047
|
window.removeEventListener("bandit-theme-changed", handleThemeChange);
|
|
34131
34048
|
};
|
|
34132
34049
|
}, [open]);
|
|
34133
|
-
(0,
|
|
34050
|
+
(0, import_react66.useLayoutEffect)(() => {
|
|
34134
34051
|
const timeSinceManualToggle = Date.now() - manualFullscreenToggleTime;
|
|
34135
34052
|
const manualToggleRecentlyUsed = timeSinceManualToggle < 5e3;
|
|
34136
34053
|
if (modalRef.current && response && !fullScreen && !autoFullscreenTriggered && !manualToggleRecentlyUsed) {
|
|
@@ -34155,7 +34072,7 @@ var ChatModal = ({
|
|
|
34155
34072
|
setFullScreen,
|
|
34156
34073
|
setAutoFullscreenTriggered
|
|
34157
34074
|
]);
|
|
34158
|
-
(0,
|
|
34075
|
+
(0, import_react66.useEffect)(() => {
|
|
34159
34076
|
const handlePaste = (e) => {
|
|
34160
34077
|
const items = e.clipboardData?.items;
|
|
34161
34078
|
if (items) {
|
|
@@ -34180,7 +34097,7 @@ var ChatModal = ({
|
|
|
34180
34097
|
document.removeEventListener("paste", handlePaste);
|
|
34181
34098
|
};
|
|
34182
34099
|
}, []);
|
|
34183
|
-
(0,
|
|
34100
|
+
(0, import_react66.useEffect)(() => {
|
|
34184
34101
|
if (response && !responseStarted) {
|
|
34185
34102
|
setResponseStarted(true);
|
|
34186
34103
|
}
|
|
@@ -34600,13 +34517,13 @@ var ChatModal = ({
|
|
|
34600
34517
|
var chat_modal_default = ChatModal;
|
|
34601
34518
|
|
|
34602
34519
|
// src/management/components/PersonalitiesTab.tsx
|
|
34603
|
-
var
|
|
34520
|
+
var import_react68 = require("react");
|
|
34604
34521
|
var import_material46 = require("@mui/material");
|
|
34605
34522
|
var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"));
|
|
34606
|
-
var
|
|
34523
|
+
var import_styles28 = require("@mui/material/styles");
|
|
34607
34524
|
|
|
34608
34525
|
// src/components/AvatarCropper.tsx
|
|
34609
|
-
var
|
|
34526
|
+
var import_react67 = require("react");
|
|
34610
34527
|
var import_material44 = require("@mui/material");
|
|
34611
34528
|
init_icons();
|
|
34612
34529
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
@@ -34616,22 +34533,22 @@ var AvatarCropper = ({
|
|
|
34616
34533
|
onCrop,
|
|
34617
34534
|
imageFile
|
|
34618
34535
|
}) => {
|
|
34619
|
-
const canvasRef = (0,
|
|
34620
|
-
const imageRef = (0,
|
|
34621
|
-
const [imageSrc, setImageSrc] = (0,
|
|
34622
|
-
const [cropSettings, setCropSettings] = (0,
|
|
34536
|
+
const canvasRef = (0, import_react67.useRef)(null);
|
|
34537
|
+
const imageRef = (0, import_react67.useRef)(null);
|
|
34538
|
+
const [imageSrc, setImageSrc] = (0, import_react67.useState)("");
|
|
34539
|
+
const [cropSettings, setCropSettings] = (0, import_react67.useState)({
|
|
34623
34540
|
x: 0,
|
|
34624
34541
|
y: 0,
|
|
34625
34542
|
scale: 1,
|
|
34626
34543
|
rotation: 0
|
|
34627
34544
|
});
|
|
34628
|
-
const [isDragging, setIsDragging] = (0,
|
|
34629
|
-
const [dragStart, setDragStart] = (0,
|
|
34630
|
-
const [imageLoaded, setImageLoaded] = (0,
|
|
34631
|
-
const [imageNaturalSize, setImageNaturalSize] = (0,
|
|
34545
|
+
const [isDragging, setIsDragging] = (0, import_react67.useState)(false);
|
|
34546
|
+
const [dragStart, setDragStart] = (0, import_react67.useState)({ x: 0, y: 0 });
|
|
34547
|
+
const [imageLoaded, setImageLoaded] = (0, import_react67.useState)(false);
|
|
34548
|
+
const [imageNaturalSize, setImageNaturalSize] = (0, import_react67.useState)({ width: 0, height: 0 });
|
|
34632
34549
|
const CROP_SIZE = 400;
|
|
34633
34550
|
const OUTPUT_SIZE = 512;
|
|
34634
|
-
(0,
|
|
34551
|
+
(0, import_react67.useEffect)(() => {
|
|
34635
34552
|
if (imageFile && open) {
|
|
34636
34553
|
const reader = new FileReader();
|
|
34637
34554
|
reader.onload = (e) => {
|
|
@@ -34643,7 +34560,7 @@ var AvatarCropper = ({
|
|
|
34643
34560
|
reader.readAsDataURL(imageFile);
|
|
34644
34561
|
}
|
|
34645
34562
|
}, [imageFile, open]);
|
|
34646
|
-
const handleImageLoad = (0,
|
|
34563
|
+
const handleImageLoad = (0, import_react67.useCallback)(() => {
|
|
34647
34564
|
if (imageRef.current) {
|
|
34648
34565
|
const { naturalWidth, naturalHeight } = imageRef.current;
|
|
34649
34566
|
setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
|
|
@@ -34660,7 +34577,7 @@ var AvatarCropper = ({
|
|
|
34660
34577
|
setImageLoaded(true);
|
|
34661
34578
|
}
|
|
34662
34579
|
}, []);
|
|
34663
|
-
const drawCropPreview = (0,
|
|
34580
|
+
const drawCropPreview = (0, import_react67.useCallback)(() => {
|
|
34664
34581
|
const canvas = canvasRef.current;
|
|
34665
34582
|
const image = imageRef.current;
|
|
34666
34583
|
if (!canvas || !image || !imageLoaded) return;
|
|
@@ -34683,14 +34600,14 @@ var AvatarCropper = ({
|
|
|
34683
34600
|
ctx.fill();
|
|
34684
34601
|
ctx.restore();
|
|
34685
34602
|
}, [cropSettings, imageLoaded]);
|
|
34686
|
-
(0,
|
|
34603
|
+
(0, import_react67.useEffect)(() => {
|
|
34687
34604
|
drawCropPreview();
|
|
34688
34605
|
}, [drawCropPreview]);
|
|
34689
|
-
const handleMouseDown = (0,
|
|
34606
|
+
const handleMouseDown = (0, import_react67.useCallback)((e) => {
|
|
34690
34607
|
setIsDragging(true);
|
|
34691
34608
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
34692
34609
|
}, []);
|
|
34693
|
-
const handleMouseMove = (0,
|
|
34610
|
+
const handleMouseMove = (0, import_react67.useCallback)((e) => {
|
|
34694
34611
|
if (!isDragging) return;
|
|
34695
34612
|
const deltaX = e.clientX - dragStart.x;
|
|
34696
34613
|
const deltaY = e.clientY - dragStart.y;
|
|
@@ -34701,16 +34618,16 @@ var AvatarCropper = ({
|
|
|
34701
34618
|
}));
|
|
34702
34619
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
34703
34620
|
}, [isDragging, dragStart]);
|
|
34704
|
-
const handleMouseUp = (0,
|
|
34621
|
+
const handleMouseUp = (0, import_react67.useCallback)(() => {
|
|
34705
34622
|
setIsDragging(false);
|
|
34706
34623
|
}, []);
|
|
34707
|
-
const handleClose = (0,
|
|
34624
|
+
const handleClose = (0, import_react67.useCallback)(() => {
|
|
34708
34625
|
setImageSrc("");
|
|
34709
34626
|
setImageLoaded(false);
|
|
34710
34627
|
setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
|
|
34711
34628
|
onClose();
|
|
34712
34629
|
}, [onClose]);
|
|
34713
|
-
const handleCrop = (0,
|
|
34630
|
+
const handleCrop = (0, import_react67.useCallback)(() => {
|
|
34714
34631
|
const canvas = document.createElement("canvas");
|
|
34715
34632
|
const ctx = canvas.getContext("2d");
|
|
34716
34633
|
const image = imageRef.current;
|
|
@@ -34737,7 +34654,7 @@ var AvatarCropper = ({
|
|
|
34737
34654
|
onCrop(croppedDataUrl);
|
|
34738
34655
|
handleClose();
|
|
34739
34656
|
}, [cropSettings, onCrop, handleClose]);
|
|
34740
|
-
const handleScaleChange = (0,
|
|
34657
|
+
const handleScaleChange = (0, import_react67.useCallback)((value) => {
|
|
34741
34658
|
const minScale2 = Math.max(
|
|
34742
34659
|
CROP_SIZE / imageNaturalSize.width,
|
|
34743
34660
|
CROP_SIZE / imageNaturalSize.height
|
|
@@ -34747,7 +34664,7 @@ var AvatarCropper = ({
|
|
|
34747
34664
|
scale: Math.max(value, minScale2)
|
|
34748
34665
|
}));
|
|
34749
34666
|
}, [imageNaturalSize]);
|
|
34750
|
-
const handleRotation = (0,
|
|
34667
|
+
const handleRotation = (0, import_react67.useCallback)((direction) => {
|
|
34751
34668
|
setCropSettings((prev) => ({
|
|
34752
34669
|
...prev,
|
|
34753
34670
|
rotation: prev.rotation + (direction === "left" ? -90 : 90)
|
|
@@ -34968,7 +34885,7 @@ init_icons();
|
|
|
34968
34885
|
|
|
34969
34886
|
// src/management/shell/parts.tsx
|
|
34970
34887
|
var import_material45 = require("@mui/material");
|
|
34971
|
-
var
|
|
34888
|
+
var import_styles27 = require("@mui/material/styles");
|
|
34972
34889
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
34973
34890
|
function ManagementPageHeader({
|
|
34974
34891
|
title,
|
|
@@ -35162,7 +35079,7 @@ function ManagementEmptyState({
|
|
|
35162
35079
|
placeItems: "center",
|
|
35163
35080
|
borderRadius: "50%",
|
|
35164
35081
|
color: "primary.main",
|
|
35165
|
-
bgcolor: (0,
|
|
35082
|
+
bgcolor: (0, import_styles27.alpha)(theme.palette.primary.main, 0.1),
|
|
35166
35083
|
"& svg": { width: 22, height: 22 }
|
|
35167
35084
|
}),
|
|
35168
35085
|
children: icon
|
|
@@ -35205,15 +35122,15 @@ var PersonalitiesTab = ({
|
|
|
35205
35122
|
showSnackbar,
|
|
35206
35123
|
createRequest
|
|
35207
35124
|
}) => {
|
|
35208
|
-
const theme = (0,
|
|
35125
|
+
const theme = (0, import_styles28.useTheme)();
|
|
35209
35126
|
const isMobile = (0, import_useMediaQuery.default)(theme.breakpoints.down("sm"));
|
|
35210
|
-
const [personalityTabIndex, setPersonalityTabIndex] = (0,
|
|
35211
|
-
const [restoreDialogOpen, setRestoreDialogOpen] = (0,
|
|
35212
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
35213
|
-
const [personalityToDelete, setPersonalityToDelete] = (0,
|
|
35214
|
-
const [clickedChips, setClickedChips] = (0,
|
|
35215
|
-
const [cropperOpen, setCropperOpen] = (0,
|
|
35216
|
-
const [selectedImageFile, setSelectedImageFile] = (0,
|
|
35127
|
+
const [personalityTabIndex, setPersonalityTabIndex] = (0, import_react68.useState)(0);
|
|
35128
|
+
const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react68.useState)(false);
|
|
35129
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react68.useState)(false);
|
|
35130
|
+
const [personalityToDelete, setPersonalityToDelete] = (0, import_react68.useState)(null);
|
|
35131
|
+
const [clickedChips, setClickedChips] = (0, import_react68.useState)(/* @__PURE__ */ new Set());
|
|
35132
|
+
const [cropperOpen, setCropperOpen] = (0, import_react68.useState)(false);
|
|
35133
|
+
const [selectedImageFile, setSelectedImageFile] = (0, import_react68.useState)(null);
|
|
35217
35134
|
const startNewPersonality = () => {
|
|
35218
35135
|
setLocalSelectedModel({
|
|
35219
35136
|
name: "",
|
|
@@ -35225,9 +35142,9 @@ var PersonalitiesTab = ({
|
|
|
35225
35142
|
setPresetAvatar(null);
|
|
35226
35143
|
setPersonalityTabIndex(1);
|
|
35227
35144
|
};
|
|
35228
|
-
const startNewPersonalityRef = (0,
|
|
35145
|
+
const startNewPersonalityRef = (0, import_react68.useRef)(startNewPersonality);
|
|
35229
35146
|
startNewPersonalityRef.current = startNewPersonality;
|
|
35230
|
-
(0,
|
|
35147
|
+
(0, import_react68.useEffect)(() => {
|
|
35231
35148
|
if (createRequest) startNewPersonalityRef.current();
|
|
35232
35149
|
}, [createRequest]);
|
|
35233
35150
|
const promptTemplates = [
|
|
@@ -36106,7 +36023,7 @@ var PersonalitiesTab = ({
|
|
|
36106
36023
|
var PersonalitiesTab_default = PersonalitiesTab;
|
|
36107
36024
|
|
|
36108
36025
|
// src/management/components/PreferencesTab.tsx
|
|
36109
|
-
var
|
|
36026
|
+
var import_react70 = require("react");
|
|
36110
36027
|
init_memory_modal();
|
|
36111
36028
|
var import_material47 = require("@mui/material");
|
|
36112
36029
|
init_preferencesStore();
|
|
@@ -36117,7 +36034,7 @@ init_useFeatures();
|
|
|
36117
36034
|
init_conversationSyncStore();
|
|
36118
36035
|
|
|
36119
36036
|
// src/hooks/useGatewayQueries.ts
|
|
36120
|
-
var
|
|
36037
|
+
var import_react69 = require("react");
|
|
36121
36038
|
var import_rxjs24 = require("rxjs");
|
|
36122
36039
|
var import_react_query2 = require("@tanstack/react-query");
|
|
36123
36040
|
init_packageSettingsStore();
|
|
@@ -36127,7 +36044,7 @@ var useGatewayClient = () => {
|
|
|
36127
36044
|
const settings = usePackageSettingsStore((state) => state.settings);
|
|
36128
36045
|
const gatewayUrl = settings?.gatewayApiUrl;
|
|
36129
36046
|
const feedbackEmail = settings?.feedbackEmail;
|
|
36130
|
-
const service = (0,
|
|
36047
|
+
const service = (0, import_react69.useMemo)(() => {
|
|
36131
36048
|
if (!gatewayUrl) {
|
|
36132
36049
|
return null;
|
|
36133
36050
|
}
|
|
@@ -36198,16 +36115,16 @@ var PreferencesTab = ({
|
|
|
36198
36115
|
}) => {
|
|
36199
36116
|
const theme = (0, import_material47.useTheme)();
|
|
36200
36117
|
const isMobile = (0, import_material47.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
36201
|
-
const [homeUrlStatus, setHomeUrlStatus] = (0,
|
|
36202
|
-
const [homeUrlError, setHomeUrlError] = (0,
|
|
36203
|
-
const [localHomeUrl, setLocalHomeUrl] = (0,
|
|
36204
|
-
const [importStatus, setImportStatus] = (0,
|
|
36205
|
-
const [syncToggleLoading, setSyncToggleLoading] = (0,
|
|
36206
|
-
const [manualSyncLoading, setManualSyncLoading] = (0,
|
|
36207
|
-
const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0,
|
|
36208
|
-
const [memoryModalOpen, setMemoryModalOpen] = (0,
|
|
36209
|
-
const timeoutRef = (0,
|
|
36210
|
-
const fileInputRef = (0,
|
|
36118
|
+
const [homeUrlStatus, setHomeUrlStatus] = (0, import_react70.useState)("idle");
|
|
36119
|
+
const [homeUrlError, setHomeUrlError] = (0, import_react70.useState)("");
|
|
36120
|
+
const [localHomeUrl, setLocalHomeUrl] = (0, import_react70.useState)(preferences.homeUrl || "");
|
|
36121
|
+
const [importStatus, setImportStatus] = (0, import_react70.useState)("idle");
|
|
36122
|
+
const [syncToggleLoading, setSyncToggleLoading] = (0, import_react70.useState)(false);
|
|
36123
|
+
const [manualSyncLoading, setManualSyncLoading] = (0, import_react70.useState)(false);
|
|
36124
|
+
const [advancedVectorToggleLoading, setAdvancedVectorToggleLoading] = (0, import_react70.useState)(false);
|
|
36125
|
+
const [memoryModalOpen, setMemoryModalOpen] = (0, import_react70.useState)(false);
|
|
36126
|
+
const timeoutRef = (0, import_react70.useRef)(null);
|
|
36127
|
+
const fileInputRef = (0, import_react70.useRef)(null);
|
|
36211
36128
|
const { exportPreferences, importPreferences, resetToDefaults } = usePreferencesStore();
|
|
36212
36129
|
const {
|
|
36213
36130
|
isServiceAvailable: isTTSSTTAvailable,
|
|
@@ -36319,7 +36236,7 @@ var PreferencesTab = ({
|
|
|
36319
36236
|
if (!gatewayHealth) return "warning";
|
|
36320
36237
|
return gatewayHealth.status?.toLowerCase() === "healthy" ? "success" : "error";
|
|
36321
36238
|
})();
|
|
36322
|
-
const handleGatewayStatusRefresh = (0,
|
|
36239
|
+
const handleGatewayStatusRefresh = (0, import_react70.useCallback)(() => {
|
|
36323
36240
|
if (!gatewayConfigured) {
|
|
36324
36241
|
return;
|
|
36325
36242
|
}
|
|
@@ -36381,7 +36298,7 @@ var PreferencesTab = ({
|
|
|
36381
36298
|
}
|
|
36382
36299
|
return packageSettings?.homeUrl || "";
|
|
36383
36300
|
};
|
|
36384
|
-
(0,
|
|
36301
|
+
(0, import_react70.useEffect)(() => {
|
|
36385
36302
|
setLocalHomeUrl(preferences.homeUrl || "");
|
|
36386
36303
|
}, [preferences.homeUrl]);
|
|
36387
36304
|
const validateAndSaveHomeUrl = async (url) => {
|
|
@@ -36428,7 +36345,7 @@ var PreferencesTab = ({
|
|
|
36428
36345
|
validateAndSaveHomeUrl(value);
|
|
36429
36346
|
}, 1500);
|
|
36430
36347
|
};
|
|
36431
|
-
(0,
|
|
36348
|
+
(0, import_react70.useEffect)(() => {
|
|
36432
36349
|
return () => {
|
|
36433
36350
|
if (timeoutRef.current) {
|
|
36434
36351
|
clearTimeout(timeoutRef.current);
|
|
@@ -37039,8 +36956,8 @@ var PreferencesTab = ({
|
|
|
37039
36956
|
] }) });
|
|
37040
36957
|
};
|
|
37041
36958
|
var ViewportDiagnostics = () => {
|
|
37042
|
-
const [metrics, setMetrics] = (0,
|
|
37043
|
-
(0,
|
|
36959
|
+
const [metrics, setMetrics] = (0, import_react70.useState)({});
|
|
36960
|
+
(0, import_react70.useEffect)(() => {
|
|
37044
36961
|
const read = () => {
|
|
37045
36962
|
const probe = document.createElement("div");
|
|
37046
36963
|
probe.style.cssText = "position:fixed;top:0;bottom:0;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);visibility:hidden;pointer-events:none;";
|
|
@@ -37074,12 +36991,12 @@ var ViewportDiagnostics = () => {
|
|
|
37074
36991
|
var PreferencesTab_default = PreferencesTab;
|
|
37075
36992
|
|
|
37076
36993
|
// src/management/components/BrandingTab.tsx
|
|
37077
|
-
var
|
|
36994
|
+
var import_react72 = require("react");
|
|
37078
36995
|
var import_material49 = require("@mui/material");
|
|
37079
36996
|
init_src();
|
|
37080
36997
|
|
|
37081
36998
|
// src/components/LogoCropper.tsx
|
|
37082
|
-
var
|
|
36999
|
+
var import_react71 = require("react");
|
|
37083
37000
|
var import_material48 = require("@mui/material");
|
|
37084
37001
|
init_icons();
|
|
37085
37002
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
@@ -37094,25 +37011,25 @@ var LogoCropper = ({
|
|
|
37094
37011
|
onCrop,
|
|
37095
37012
|
imageFile
|
|
37096
37013
|
}) => {
|
|
37097
|
-
const canvasRef = (0,
|
|
37098
|
-
const previewCanvasRef = (0,
|
|
37099
|
-
const imageRef = (0,
|
|
37100
|
-
const [imageSrc, setImageSrc] = (0,
|
|
37101
|
-
const [cropSettings, setCropSettings] = (0,
|
|
37014
|
+
const canvasRef = (0, import_react71.useRef)(null);
|
|
37015
|
+
const previewCanvasRef = (0, import_react71.useRef)(null);
|
|
37016
|
+
const imageRef = (0, import_react71.useRef)(null);
|
|
37017
|
+
const [imageSrc, setImageSrc] = (0, import_react71.useState)("");
|
|
37018
|
+
const [cropSettings, setCropSettings] = (0, import_react71.useState)({
|
|
37102
37019
|
x: 0,
|
|
37103
37020
|
y: 0,
|
|
37104
37021
|
scale: 1,
|
|
37105
37022
|
rotation: 0
|
|
37106
37023
|
});
|
|
37107
|
-
const [isDragging, setIsDragging] = (0,
|
|
37108
|
-
const [dragStart, setDragStart] = (0,
|
|
37109
|
-
const [imageLoaded, setImageLoaded] = (0,
|
|
37110
|
-
const [imageNaturalSize, setImageNaturalSize] = (0,
|
|
37111
|
-
const [aspectRatio, setAspectRatio] = (0,
|
|
37112
|
-
const [cropArea, setCropArea] = (0,
|
|
37024
|
+
const [isDragging, setIsDragging] = (0, import_react71.useState)(false);
|
|
37025
|
+
const [dragStart, setDragStart] = (0, import_react71.useState)({ x: 0, y: 0 });
|
|
37026
|
+
const [imageLoaded, setImageLoaded] = (0, import_react71.useState)(false);
|
|
37027
|
+
const [imageNaturalSize, setImageNaturalSize] = (0, import_react71.useState)({ width: 0, height: 0 });
|
|
37028
|
+
const [aspectRatio, setAspectRatio] = (0, import_react71.useState)("square");
|
|
37029
|
+
const [cropArea, setCropArea] = (0, import_react71.useState)({ width: 400, height: 400 });
|
|
37113
37030
|
const CANVAS_SIZE = 500;
|
|
37114
|
-
const [outputSize, setOutputSize] = (0,
|
|
37115
|
-
const getCropDimensions = (0,
|
|
37031
|
+
const [outputSize, setOutputSize] = (0, import_react71.useState)("large");
|
|
37032
|
+
const getCropDimensions = (0, import_react71.useCallback)(() => {
|
|
37116
37033
|
const maxSize = 380;
|
|
37117
37034
|
switch (aspectRatio) {
|
|
37118
37035
|
case "square":
|
|
@@ -37127,7 +37044,7 @@ var LogoCropper = ({
|
|
|
37127
37044
|
return cropArea;
|
|
37128
37045
|
}
|
|
37129
37046
|
}, [aspectRatio, cropArea]);
|
|
37130
|
-
(0,
|
|
37047
|
+
(0, import_react71.useEffect)(() => {
|
|
37131
37048
|
if (imageFile && open) {
|
|
37132
37049
|
const reader = new FileReader();
|
|
37133
37050
|
reader.onload = (e) => {
|
|
@@ -37139,7 +37056,7 @@ var LogoCropper = ({
|
|
|
37139
37056
|
reader.readAsDataURL(imageFile);
|
|
37140
37057
|
}
|
|
37141
37058
|
}, [imageFile, open]);
|
|
37142
|
-
const handleImageLoad = (0,
|
|
37059
|
+
const handleImageLoad = (0, import_react71.useCallback)(() => {
|
|
37143
37060
|
if (imageRef.current) {
|
|
37144
37061
|
const { naturalWidth, naturalHeight } = imageRef.current;
|
|
37145
37062
|
setImageNaturalSize({ width: naturalWidth, height: naturalHeight });
|
|
@@ -37157,7 +37074,7 @@ var LogoCropper = ({
|
|
|
37157
37074
|
setImageLoaded(true);
|
|
37158
37075
|
}
|
|
37159
37076
|
}, [getCropDimensions]);
|
|
37160
|
-
(0,
|
|
37077
|
+
(0, import_react71.useEffect)(() => {
|
|
37161
37078
|
if (imageLoaded) {
|
|
37162
37079
|
const cropDims = getCropDimensions();
|
|
37163
37080
|
setCropArea(cropDims);
|
|
@@ -37171,7 +37088,7 @@ var LogoCropper = ({
|
|
|
37171
37088
|
}));
|
|
37172
37089
|
}
|
|
37173
37090
|
}, [aspectRatio, imageLoaded, imageNaturalSize, getCropDimensions]);
|
|
37174
|
-
const updatePreview = (0,
|
|
37091
|
+
const updatePreview = (0, import_react71.useCallback)((cropX, cropY, cropDims) => {
|
|
37175
37092
|
const previewCanvas = previewCanvasRef.current;
|
|
37176
37093
|
const mainCanvas = canvasRef.current;
|
|
37177
37094
|
if (!previewCanvas || !mainCanvas) return;
|
|
@@ -37200,7 +37117,7 @@ var LogoCropper = ({
|
|
|
37200
37117
|
previewCtx.lineWidth = 2;
|
|
37201
37118
|
previewCtx.strokeRect(offsetX, offsetY, scaledWidth, scaledHeight);
|
|
37202
37119
|
}, []);
|
|
37203
|
-
const drawCropPreview = (0,
|
|
37120
|
+
const drawCropPreview = (0, import_react71.useCallback)(() => {
|
|
37204
37121
|
const canvas = canvasRef.current;
|
|
37205
37122
|
const image = imageRef.current;
|
|
37206
37123
|
if (!canvas || !image || !imageLoaded) return;
|
|
@@ -37246,14 +37163,14 @@ var LogoCropper = ({
|
|
|
37246
37163
|
ctx.fillRect(cropX + cropDims.width - 1, cropY + cropDims.height - cornerSize + 1, 3, cornerSize);
|
|
37247
37164
|
updatePreview(cropX, cropY, cropDims);
|
|
37248
37165
|
}, [cropSettings, imageLoaded, getCropDimensions, updatePreview]);
|
|
37249
|
-
(0,
|
|
37166
|
+
(0, import_react71.useEffect)(() => {
|
|
37250
37167
|
drawCropPreview();
|
|
37251
37168
|
}, [drawCropPreview]);
|
|
37252
|
-
const handleMouseDown = (0,
|
|
37169
|
+
const handleMouseDown = (0, import_react71.useCallback)((e) => {
|
|
37253
37170
|
setIsDragging(true);
|
|
37254
37171
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
37255
37172
|
}, []);
|
|
37256
|
-
const handleMouseMove = (0,
|
|
37173
|
+
const handleMouseMove = (0, import_react71.useCallback)((e) => {
|
|
37257
37174
|
if (!isDragging) return;
|
|
37258
37175
|
const deltaX = e.clientX - dragStart.x;
|
|
37259
37176
|
const deltaY = e.clientY - dragStart.y;
|
|
@@ -37264,17 +37181,17 @@ var LogoCropper = ({
|
|
|
37264
37181
|
}));
|
|
37265
37182
|
setDragStart({ x: e.clientX, y: e.clientY });
|
|
37266
37183
|
}, [isDragging, dragStart]);
|
|
37267
|
-
const handleMouseUp = (0,
|
|
37184
|
+
const handleMouseUp = (0, import_react71.useCallback)(() => {
|
|
37268
37185
|
setIsDragging(false);
|
|
37269
37186
|
}, []);
|
|
37270
|
-
const handleClose = (0,
|
|
37187
|
+
const handleClose = (0, import_react71.useCallback)(() => {
|
|
37271
37188
|
setImageSrc("");
|
|
37272
37189
|
setImageLoaded(false);
|
|
37273
37190
|
setCropSettings({ x: 0, y: 0, scale: 1, rotation: 0 });
|
|
37274
37191
|
setAspectRatio("square");
|
|
37275
37192
|
onClose();
|
|
37276
37193
|
}, [onClose]);
|
|
37277
|
-
const handleCrop = (0,
|
|
37194
|
+
const handleCrop = (0, import_react71.useCallback)(() => {
|
|
37278
37195
|
const image = imageRef.current;
|
|
37279
37196
|
if (!image) return;
|
|
37280
37197
|
const cropDims = getCropDimensions();
|
|
@@ -37327,7 +37244,7 @@ var LogoCropper = ({
|
|
|
37327
37244
|
setAspectRatio("square");
|
|
37328
37245
|
onClose();
|
|
37329
37246
|
}, [cropSettings, onCrop, getCropDimensions, outputSize, onClose]);
|
|
37330
|
-
const handleScaleChange = (0,
|
|
37247
|
+
const handleScaleChange = (0, import_react71.useCallback)((value) => {
|
|
37331
37248
|
const cropDims = getCropDimensions();
|
|
37332
37249
|
const minScale2 = Math.max(
|
|
37333
37250
|
cropDims.width / imageNaturalSize.width,
|
|
@@ -37338,7 +37255,7 @@ var LogoCropper = ({
|
|
|
37338
37255
|
scale: Math.max(value, minScale2)
|
|
37339
37256
|
}));
|
|
37340
37257
|
}, [imageNaturalSize, getCropDimensions]);
|
|
37341
|
-
const handleRotation = (0,
|
|
37258
|
+
const handleRotation = (0, import_react71.useCallback)((direction) => {
|
|
37342
37259
|
setCropSettings((prev) => ({
|
|
37343
37260
|
...prev,
|
|
37344
37261
|
rotation: prev.rotation + (direction === "left" ? -90 : 90)
|
|
@@ -37624,20 +37541,20 @@ var BrandingTab = ({
|
|
|
37624
37541
|
setLogoFile,
|
|
37625
37542
|
setLogoBase64
|
|
37626
37543
|
}) => {
|
|
37627
|
-
const [dragOver, setDragOver] = (0,
|
|
37628
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
37629
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
37630
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
37631
|
-
const [cropperOpen, setCropperOpen] = (0,
|
|
37632
|
-
const [selectedImageFile, setSelectedImageFile] = (0,
|
|
37633
|
-
const fileInputRef = (0,
|
|
37634
|
-
const importInputRef = (0,
|
|
37544
|
+
const [dragOver, setDragOver] = (0, import_react72.useState)(false);
|
|
37545
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react72.useState)("");
|
|
37546
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react72.useState)(false);
|
|
37547
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react72.useState)("success");
|
|
37548
|
+
const [cropperOpen, setCropperOpen] = (0, import_react72.useState)(false);
|
|
37549
|
+
const [selectedImageFile, setSelectedImageFile] = (0, import_react72.useState)(null);
|
|
37550
|
+
const fileInputRef = (0, import_react72.useRef)(null);
|
|
37551
|
+
const importInputRef = (0, import_react72.useRef)(null);
|
|
37635
37552
|
const pageMode = (0, import_material49.useTheme)().palette.mode;
|
|
37636
37553
|
const choice = parseBrandingTheme(theme);
|
|
37637
37554
|
const setChoice = (next) => setTheme(brandingThemeKey(next));
|
|
37638
37555
|
const currentAccent = choice.accent ?? skins[choice.skin].accent[choice.mode];
|
|
37639
|
-
const [accentDraft, setAccentDraft] = (0,
|
|
37640
|
-
(0,
|
|
37556
|
+
const [accentDraft, setAccentDraft] = (0, import_react72.useState)(currentAccent);
|
|
37557
|
+
(0, import_react72.useEffect)(() => setAccentDraft(currentAccent), [currentAccent]);
|
|
37641
37558
|
const draftValid = isTenantAccent(accentDraft);
|
|
37642
37559
|
const applyCustomAccent = (value) => {
|
|
37643
37560
|
setAccentDraft(value);
|
|
@@ -38007,14 +37924,14 @@ var WelcomePreview = ({
|
|
|
38007
37924
|
var BrandingTab_default = BrandingTab;
|
|
38008
37925
|
|
|
38009
37926
|
// src/management/components/KnowledgeHubTab.tsx
|
|
38010
|
-
var
|
|
37927
|
+
var import_react78 = require("react");
|
|
38011
37928
|
var import_material53 = require("@mui/material");
|
|
38012
37929
|
|
|
38013
37930
|
// src/management/components/KnowledgeTab.tsx
|
|
38014
|
-
var
|
|
37931
|
+
var import_react76 = require("react");
|
|
38015
37932
|
var import_uuid6 = require("uuid");
|
|
38016
37933
|
var import_material51 = require("@mui/material");
|
|
38017
|
-
var
|
|
37934
|
+
var import_styles29 = require("@mui/material/styles");
|
|
38018
37935
|
init_knowledge_file_modal();
|
|
38019
37936
|
init_DocumentCard();
|
|
38020
37937
|
init_useVectorStore();
|
|
@@ -38022,9 +37939,9 @@ init_authenticationStore();
|
|
|
38022
37939
|
init_useFeatures();
|
|
38023
37940
|
|
|
38024
37941
|
// src/components/shared/ProcessingOverlay.tsx
|
|
38025
|
-
var
|
|
37942
|
+
var import_react73 = require("react");
|
|
38026
37943
|
var import_material50 = require("@mui/material");
|
|
38027
|
-
var
|
|
37944
|
+
var import_react74 = require("@burtson-labs/icons/react");
|
|
38028
37945
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
38029
37946
|
var ninjaFloat = import_material50.keyframes`
|
|
38030
37947
|
0%, 100% { transform: translateY(0px) rotate(0deg); }
|
|
@@ -38049,28 +37966,28 @@ var defaultSteps = [
|
|
|
38049
37966
|
id: "upload",
|
|
38050
37967
|
title: "Uploading to Cloud",
|
|
38051
37968
|
description: "Our digital ninjas are securely transferring your file...",
|
|
38052
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37969
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Upload, {}),
|
|
38053
37970
|
duration: 5
|
|
38054
37971
|
},
|
|
38055
37972
|
{
|
|
38056
37973
|
id: "analyze",
|
|
38057
37974
|
title: "AI Analysis",
|
|
38058
37975
|
description: "Advanced AI robots are reading and understanding your content...",
|
|
38059
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37976
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {}),
|
|
38060
37977
|
duration: 15
|
|
38061
37978
|
},
|
|
38062
37979
|
{
|
|
38063
37980
|
id: "embed",
|
|
38064
37981
|
title: "Making It Searchable",
|
|
38065
37982
|
description: "We turn the content into a private, searchable index...",
|
|
38066
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37983
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Cpu, {}),
|
|
38067
37984
|
duration: 10
|
|
38068
37985
|
},
|
|
38069
37986
|
{
|
|
38070
37987
|
id: "optimize",
|
|
38071
37988
|
title: "Optimizing Search",
|
|
38072
37989
|
description: "Organizing everything for quick, reliable answers...",
|
|
38073
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
37990
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Sparkles, {}),
|
|
38074
37991
|
duration: 8
|
|
38075
37992
|
}
|
|
38076
37993
|
];
|
|
@@ -38095,17 +38012,17 @@ var ProcessingOverlay = ({
|
|
|
38095
38012
|
customMessages
|
|
38096
38013
|
}) => {
|
|
38097
38014
|
const theme = (0, import_material50.useTheme)();
|
|
38098
|
-
const [messageIndex, setMessageIndex] = (0,
|
|
38099
|
-
const [sparkles, setSparkles] = (0,
|
|
38015
|
+
const [messageIndex, setMessageIndex] = (0, import_react73.useState)(0);
|
|
38016
|
+
const [sparkles, setSparkles] = (0, import_react73.useState)([]);
|
|
38100
38017
|
const messages = customMessages || cleverMessages;
|
|
38101
|
-
(0,
|
|
38018
|
+
(0, import_react73.useEffect)(() => {
|
|
38102
38019
|
if (!open) return;
|
|
38103
38020
|
const interval = setInterval(() => {
|
|
38104
38021
|
setMessageIndex((prev) => (prev + 1) % messages.length);
|
|
38105
38022
|
}, 3e3);
|
|
38106
38023
|
return () => clearInterval(interval);
|
|
38107
38024
|
}, [open, messages.length]);
|
|
38108
|
-
(0,
|
|
38025
|
+
(0, import_react73.useEffect)(() => {
|
|
38109
38026
|
if (!open) return;
|
|
38110
38027
|
const generateSparkles = () => {
|
|
38111
38028
|
const newSparkles = Array.from({ length: 5 }, (_, i) => ({
|
|
@@ -38216,7 +38133,7 @@ var ProcessingOverlay = ({
|
|
|
38216
38133
|
animation: `${pulse} 3s ease-in-out infinite`,
|
|
38217
38134
|
color: theme.palette.secondary.main
|
|
38218
38135
|
},
|
|
38219
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
38136
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Agent, {})
|
|
38220
38137
|
}
|
|
38221
38138
|
),
|
|
38222
38139
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
@@ -38230,7 +38147,7 @@ var ProcessingOverlay = ({
|
|
|
38230
38147
|
color: theme.palette.primary.main,
|
|
38231
38148
|
animationDelay: "1s"
|
|
38232
38149
|
},
|
|
38233
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
38150
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_react74.Zap, {})
|
|
38234
38151
|
}
|
|
38235
38152
|
)
|
|
38236
38153
|
] }),
|
|
@@ -38317,16 +38234,16 @@ var ProcessingOverlay = ({
|
|
|
38317
38234
|
var ProcessingOverlay_default = ProcessingOverlay;
|
|
38318
38235
|
|
|
38319
38236
|
// src/hooks/useProcessingOverlay.ts
|
|
38320
|
-
var
|
|
38237
|
+
var import_react75 = require("react");
|
|
38321
38238
|
var useProcessingOverlay = () => {
|
|
38322
|
-
const [processingState, setProcessingState] = (0,
|
|
38239
|
+
const [processingState, setProcessingState] = (0, import_react75.useState)({
|
|
38323
38240
|
isVisible: false,
|
|
38324
38241
|
step: "upload",
|
|
38325
38242
|
progress: 0,
|
|
38326
38243
|
title: "Processing...",
|
|
38327
38244
|
customMessages: void 0
|
|
38328
38245
|
});
|
|
38329
|
-
const showProcessing = (0,
|
|
38246
|
+
const showProcessing = (0, import_react75.useCallback)((title = "Processing...", messages) => {
|
|
38330
38247
|
setProcessingState({
|
|
38331
38248
|
isVisible: true,
|
|
38332
38249
|
step: "upload",
|
|
@@ -38335,13 +38252,13 @@ var useProcessingOverlay = () => {
|
|
|
38335
38252
|
customMessages: messages
|
|
38336
38253
|
});
|
|
38337
38254
|
}, []);
|
|
38338
|
-
const hideProcessing = (0,
|
|
38255
|
+
const hideProcessing = (0, import_react75.useCallback)(() => {
|
|
38339
38256
|
setProcessingState((prev) => ({
|
|
38340
38257
|
...prev,
|
|
38341
38258
|
isVisible: false
|
|
38342
38259
|
}));
|
|
38343
38260
|
}, []);
|
|
38344
|
-
const updateProgress = (0,
|
|
38261
|
+
const updateProgress = (0, import_react75.useCallback)((step, progress) => {
|
|
38345
38262
|
setProcessingState((prev) => ({
|
|
38346
38263
|
...prev,
|
|
38347
38264
|
step,
|
|
@@ -38455,27 +38372,27 @@ var KnowledgeTab = ({
|
|
|
38455
38372
|
} = useVectorStore();
|
|
38456
38373
|
const { showProcessing, hideProcessing, updateProgress, processingState } = useProcessingOverlay();
|
|
38457
38374
|
const shouldUseVector = (features.isAdmin() || features.hasAdvancedSearch() || features.hasAdvancedMemories()) && isAdvancedVectorFeaturesEnabled && isVectorEnabled;
|
|
38458
|
-
const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0,
|
|
38459
|
-
const [selectedDoc, setSelectedDoc] = (0,
|
|
38460
|
-
const [vectorDocuments, setVectorDocuments] = (0,
|
|
38461
|
-
const [loadingVectorDocs, setLoadingVectorDocs] = (0,
|
|
38462
|
-
const [vectorLoadError, setVectorLoadError] = (0,
|
|
38463
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
38464
|
-
const [selectedCategory, setSelectedCategory] = (0,
|
|
38465
|
-
const [contentSourceFilter, setContentSourceFilter] = (0,
|
|
38466
|
-
const [viewMode, setViewMode] = (0,
|
|
38467
|
-
const [sortBy, setSortBy] = (0,
|
|
38468
|
-
const [sortOrder, setSortOrder] = (0,
|
|
38469
|
-
const [selectedDocuments, setSelectedDocuments] = (0,
|
|
38470
|
-
const [uploadStatuses, setUploadStatuses] = (0,
|
|
38471
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
38472
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
38473
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
38474
|
-
const [deletingDocuments, setDeletingDocuments] = (0,
|
|
38375
|
+
const [clearDocsDialogOpen, setClearDocsDialogOpen] = (0, import_react76.useState)(false);
|
|
38376
|
+
const [selectedDoc, setSelectedDoc] = (0, import_react76.useState)(null);
|
|
38377
|
+
const [vectorDocuments, setVectorDocuments] = (0, import_react76.useState)([]);
|
|
38378
|
+
const [loadingVectorDocs, setLoadingVectorDocs] = (0, import_react76.useState)(false);
|
|
38379
|
+
const [vectorLoadError, setVectorLoadError] = (0, import_react76.useState)(null);
|
|
38380
|
+
const [searchQuery, setSearchQuery] = (0, import_react76.useState)("");
|
|
38381
|
+
const [selectedCategory, setSelectedCategory] = (0, import_react76.useState)("all");
|
|
38382
|
+
const [contentSourceFilter, setContentSourceFilter] = (0, import_react76.useState)("all");
|
|
38383
|
+
const [viewMode, setViewMode] = (0, import_react76.useState)("grid");
|
|
38384
|
+
const [sortBy, setSortBy] = (0, import_react76.useState)("date");
|
|
38385
|
+
const [sortOrder, setSortOrder] = (0, import_react76.useState)("desc");
|
|
38386
|
+
const [selectedDocuments, setSelectedDocuments] = (0, import_react76.useState)([]);
|
|
38387
|
+
const [uploadStatuses, setUploadStatuses] = (0, import_react76.useState)([]);
|
|
38388
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react76.useState)("");
|
|
38389
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react76.useState)(false);
|
|
38390
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react76.useState)("success");
|
|
38391
|
+
const [deletingDocuments, setDeletingDocuments] = (0, import_react76.useState)(/* @__PURE__ */ new Set());
|
|
38475
38392
|
const hasTeam = !!(authStore.user?.teamSid || authStore.user?.teamId);
|
|
38476
|
-
const [shareWithTeam, setShareWithTeam] = (0,
|
|
38477
|
-
const [dragActive, setDragActive] = (0,
|
|
38478
|
-
const mapVectorDocsToKnowledgeDocs = (0,
|
|
38393
|
+
const [shareWithTeam, setShareWithTeam] = (0, import_react76.useState)(false);
|
|
38394
|
+
const [dragActive, setDragActive] = (0, import_react76.useState)(false);
|
|
38395
|
+
const mapVectorDocsToKnowledgeDocs = (0, import_react76.useCallback)((vectorDocs) => {
|
|
38479
38396
|
return vectorDocs.map((doc) => {
|
|
38480
38397
|
const primaryId = doc.id ?? doc.fileId ?? doc._id;
|
|
38481
38398
|
const docId = typeof primaryId === "string" ? primaryId : primaryId ? JSON.stringify(primaryId) : (0, import_uuid6.v4)();
|
|
@@ -38503,7 +38420,7 @@ var KnowledgeTab = ({
|
|
|
38503
38420
|
};
|
|
38504
38421
|
});
|
|
38505
38422
|
}, []);
|
|
38506
|
-
const loadVectorDocuments = (0,
|
|
38423
|
+
const loadVectorDocuments = (0, import_react76.useCallback)(async () => {
|
|
38507
38424
|
if (!shouldUseVector) {
|
|
38508
38425
|
return;
|
|
38509
38426
|
}
|
|
@@ -38520,12 +38437,12 @@ var KnowledgeTab = ({
|
|
|
38520
38437
|
setLoadingVectorDocs(false);
|
|
38521
38438
|
}
|
|
38522
38439
|
}, [shouldUseVector, getUserDocuments, mapVectorDocsToKnowledgeDocs]);
|
|
38523
|
-
(0,
|
|
38440
|
+
(0, import_react76.useEffect)(() => {
|
|
38524
38441
|
if (shouldUseVector) {
|
|
38525
38442
|
loadVectorDocuments();
|
|
38526
38443
|
}
|
|
38527
38444
|
}, [shouldUseVector, loadVectorDocuments]);
|
|
38528
|
-
const filteredAndSortedDocuments = (0,
|
|
38445
|
+
const filteredAndSortedDocuments = (0, import_react76.useMemo)(() => {
|
|
38529
38446
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38530
38447
|
let filtered = sourceDocuments2;
|
|
38531
38448
|
if (searchQuery) {
|
|
@@ -38575,12 +38492,12 @@ var KnowledgeTab = ({
|
|
|
38575
38492
|
});
|
|
38576
38493
|
return filtered;
|
|
38577
38494
|
}, [documents, vectorDocuments, shouldUseVector, searchQuery, selectedCategory, contentSourceFilter, sortBy, sortOrder]);
|
|
38578
|
-
const categories = (0,
|
|
38495
|
+
const categories = (0, import_react76.useMemo)(() => {
|
|
38579
38496
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38580
38497
|
const cats = new Set(sourceDocuments2.map((doc) => getFileTypeInfo3(doc.name).category));
|
|
38581
38498
|
return Array.from(cats).sort();
|
|
38582
38499
|
}, [documents, vectorDocuments, shouldUseVector]);
|
|
38583
|
-
const statistics = (0,
|
|
38500
|
+
const statistics = (0, import_react76.useMemo)(() => {
|
|
38584
38501
|
const sourceDocuments2 = shouldUseVector ? vectorDocuments : documents;
|
|
38585
38502
|
const totalSize = sourceDocuments2.reduce((sum, doc) => {
|
|
38586
38503
|
if (shouldUseVector && doc.size) {
|
|
@@ -39083,7 +39000,7 @@ var KnowledgeTab = ({
|
|
|
39083
39000
|
borderRadius: 1,
|
|
39084
39001
|
border: "1px dashed",
|
|
39085
39002
|
borderColor: dragActive ? "primary.main" : "divider",
|
|
39086
|
-
bgcolor: dragActive ? (0,
|
|
39003
|
+
bgcolor: dragActive ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.06) : "transparent",
|
|
39087
39004
|
transition: "border-color 0.15s ease, background-color 0.15s ease",
|
|
39088
39005
|
"&:hover, &:focus-visible": { borderColor: "primary.main", outline: "none" }
|
|
39089
39006
|
},
|
|
@@ -39304,7 +39221,7 @@ var KnowledgeTab = ({
|
|
|
39304
39221
|
border: 1,
|
|
39305
39222
|
borderRadius: 1,
|
|
39306
39223
|
borderColor: isSelected ? "primary.main" : "divider",
|
|
39307
|
-
bgcolor: isSelected ? (0,
|
|
39224
|
+
bgcolor: isSelected ? (0, import_styles29.alpha)(muiTheme.palette.primary.main, 0.08) : muiTheme.palette.bandit?.surface.raised ?? "background.paper",
|
|
39308
39225
|
transition: "border-color 0.15s ease, opacity 0.3s ease, transform 0.3s ease",
|
|
39309
39226
|
"&:hover": { borderColor: "primary.main" },
|
|
39310
39227
|
opacity: isDeleting ? 0.3 : 1,
|
|
@@ -39461,7 +39378,7 @@ var KnowledgeTab = ({
|
|
|
39461
39378
|
var KnowledgeTab_default = KnowledgeTab;
|
|
39462
39379
|
|
|
39463
39380
|
// src/management/components/SeedPacksTab.tsx
|
|
39464
|
-
var
|
|
39381
|
+
var import_react77 = require("react");
|
|
39465
39382
|
var import_material52 = require("@mui/material");
|
|
39466
39383
|
init_packageSettingsStore();
|
|
39467
39384
|
init_authenticationStore();
|
|
@@ -39949,47 +39866,47 @@ var SeedPacksTab = () => {
|
|
|
39949
39866
|
const seedPackAdminRoles = /* @__PURE__ */ new Set(["admin", "super-user", "team_admin", "team_owner"]);
|
|
39950
39867
|
const userRoles = authStore.user?.roles ?? [];
|
|
39951
39868
|
const canManage = userRoles.some((role) => seedPackAdminRoles.has(role));
|
|
39952
|
-
const [seedPacks, setSeedPacks] = (0,
|
|
39953
|
-
const [selectedSid, setSelectedSid] = (0,
|
|
39954
|
-
const [selectedSeedPack, setSelectedSeedPack] = (0,
|
|
39955
|
-
const [draft, setDraft] = (0,
|
|
39869
|
+
const [seedPacks, setSeedPacks] = (0, import_react77.useState)([]);
|
|
39870
|
+
const [selectedSid, setSelectedSid] = (0, import_react77.useState)(null);
|
|
39871
|
+
const [selectedSeedPack, setSelectedSeedPack] = (0, import_react77.useState)(null);
|
|
39872
|
+
const [draft, setDraft] = (0, import_react77.useState)({
|
|
39956
39873
|
name: "",
|
|
39957
39874
|
description: "",
|
|
39958
39875
|
content: ""
|
|
39959
39876
|
});
|
|
39960
|
-
const [tagsInput, setTagsInput] = (0,
|
|
39961
|
-
const [importedFiles, setImportedFiles] = (0,
|
|
39962
|
-
const [createImportedFiles, setCreateImportedFiles] = (0,
|
|
39963
|
-
const [previewFile, setPreviewFile] = (0,
|
|
39964
|
-
const fileInputRef = (0,
|
|
39965
|
-
const wikiFolderInputRef = (0,
|
|
39966
|
-
const createFileInputRef = (0,
|
|
39967
|
-
const createWikiFolderInputRef = (0,
|
|
39968
|
-
const [isLoadingList, setIsLoadingList] = (0,
|
|
39969
|
-
const [hasLoadedList, setHasLoadedList] = (0,
|
|
39970
|
-
const [listError, setListError] = (0,
|
|
39971
|
-
const [isLoadingDetail, setIsLoadingDetail] = (0,
|
|
39972
|
-
const [isSaving, setIsSaving] = (0,
|
|
39973
|
-
const [isPublishing, setIsPublishing] = (0,
|
|
39974
|
-
const [isArchiving, setIsArchiving] = (0,
|
|
39975
|
-
const [isDeleting, setIsDeleting] = (0,
|
|
39976
|
-
const [isCreating, setIsCreating] = (0,
|
|
39977
|
-
const [createDialogOpen, setCreateDialogOpen] = (0,
|
|
39978
|
-
const [publishDialogOpen, setPublishDialogOpen] = (0,
|
|
39979
|
-
const [archiveDialogOpen, setArchiveDialogOpen] = (0,
|
|
39980
|
-
const [deleteDialogOpen, setDeleteDialogOpen] = (0,
|
|
39981
|
-
const [newPackName, setNewPackName] = (0,
|
|
39982
|
-
const [newPackDescription, setNewPackDescription] = (0,
|
|
39983
|
-
const [newPackTags, setNewPackTags] = (0,
|
|
39984
|
-
const [snackbarOpen, setSnackbarOpen] = (0,
|
|
39985
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
39986
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
39987
|
-
const parsedTags = (0,
|
|
39988
|
-
const normalizedSelectedTags = (0,
|
|
39877
|
+
const [tagsInput, setTagsInput] = (0, import_react77.useState)("");
|
|
39878
|
+
const [importedFiles, setImportedFiles] = (0, import_react77.useState)([]);
|
|
39879
|
+
const [createImportedFiles, setCreateImportedFiles] = (0, import_react77.useState)([]);
|
|
39880
|
+
const [previewFile, setPreviewFile] = (0, import_react77.useState)(null);
|
|
39881
|
+
const fileInputRef = (0, import_react77.useRef)(null);
|
|
39882
|
+
const wikiFolderInputRef = (0, import_react77.useRef)(null);
|
|
39883
|
+
const createFileInputRef = (0, import_react77.useRef)(null);
|
|
39884
|
+
const createWikiFolderInputRef = (0, import_react77.useRef)(null);
|
|
39885
|
+
const [isLoadingList, setIsLoadingList] = (0, import_react77.useState)(false);
|
|
39886
|
+
const [hasLoadedList, setHasLoadedList] = (0, import_react77.useState)(false);
|
|
39887
|
+
const [listError, setListError] = (0, import_react77.useState)(null);
|
|
39888
|
+
const [isLoadingDetail, setIsLoadingDetail] = (0, import_react77.useState)(false);
|
|
39889
|
+
const [isSaving, setIsSaving] = (0, import_react77.useState)(false);
|
|
39890
|
+
const [isPublishing, setIsPublishing] = (0, import_react77.useState)(false);
|
|
39891
|
+
const [isArchiving, setIsArchiving] = (0, import_react77.useState)(false);
|
|
39892
|
+
const [isDeleting, setIsDeleting] = (0, import_react77.useState)(false);
|
|
39893
|
+
const [isCreating, setIsCreating] = (0, import_react77.useState)(false);
|
|
39894
|
+
const [createDialogOpen, setCreateDialogOpen] = (0, import_react77.useState)(false);
|
|
39895
|
+
const [publishDialogOpen, setPublishDialogOpen] = (0, import_react77.useState)(false);
|
|
39896
|
+
const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react77.useState)(false);
|
|
39897
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = (0, import_react77.useState)(false);
|
|
39898
|
+
const [newPackName, setNewPackName] = (0, import_react77.useState)("");
|
|
39899
|
+
const [newPackDescription, setNewPackDescription] = (0, import_react77.useState)("");
|
|
39900
|
+
const [newPackTags, setNewPackTags] = (0, import_react77.useState)("");
|
|
39901
|
+
const [snackbarOpen, setSnackbarOpen] = (0, import_react77.useState)(false);
|
|
39902
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react77.useState)("");
|
|
39903
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react77.useState)("success");
|
|
39904
|
+
const parsedTags = (0, import_react77.useMemo)(() => parseTags(tagsInput), [tagsInput]);
|
|
39905
|
+
const normalizedSelectedTags = (0, import_react77.useMemo)(
|
|
39989
39906
|
() => normalizeTags(selectedSeedPack?.tags),
|
|
39990
39907
|
[selectedSeedPack?.tags]
|
|
39991
39908
|
);
|
|
39992
|
-
const isDirty = (0,
|
|
39909
|
+
const isDirty = (0, import_react77.useMemo)(() => {
|
|
39993
39910
|
if (!selectedSeedPack) {
|
|
39994
39911
|
return false;
|
|
39995
39912
|
}
|
|
@@ -40000,17 +39917,17 @@ var SeedPacksTab = () => {
|
|
|
40000
39917
|
return nameChanged || descriptionChanged || contentChanged || tagsChanged;
|
|
40001
39918
|
}, [draft, parsedTags, normalizedSelectedTags, selectedSeedPack]);
|
|
40002
39919
|
const isReadOnly = !canManage || selectedSeedPack?.status === "archived";
|
|
40003
|
-
const sortedSeedPacks = (0,
|
|
39920
|
+
const sortedSeedPacks = (0, import_react77.useMemo)(() => {
|
|
40004
39921
|
return [...seedPacks].sort((a, b) => getSeedPackTimestamp(b) - getSeedPackTimestamp(a));
|
|
40005
39922
|
}, [seedPacks]);
|
|
40006
39923
|
const scopeLabel = isTeamScope ? "Team scope" : "Personal scope";
|
|
40007
39924
|
const scopeDescription = isTeamScope ? "Applies to all members of your team." : "Applies only to your account.";
|
|
40008
|
-
const showSnackbar = (0,
|
|
39925
|
+
const showSnackbar = (0, import_react77.useCallback)((message, severity) => {
|
|
40009
39926
|
setSnackbarMessage(message);
|
|
40010
39927
|
setSnackbarSeverity(severity);
|
|
40011
39928
|
setSnackbarOpen(true);
|
|
40012
39929
|
}, []);
|
|
40013
|
-
const hydrateDraft = (0,
|
|
39930
|
+
const hydrateDraft = (0, import_react77.useCallback)((pack) => {
|
|
40014
39931
|
setDraft({
|
|
40015
39932
|
name: pack.name ?? "",
|
|
40016
39933
|
description: pack.description ?? "",
|
|
@@ -40020,14 +39937,14 @@ var SeedPacksTab = () => {
|
|
|
40020
39937
|
setImportedFiles([]);
|
|
40021
39938
|
setPreviewFile(null);
|
|
40022
39939
|
}, []);
|
|
40023
|
-
const resetCreateDialog = (0,
|
|
39940
|
+
const resetCreateDialog = (0, import_react77.useCallback)(() => {
|
|
40024
39941
|
setCreateDialogOpen(false);
|
|
40025
39942
|
setNewPackName("");
|
|
40026
39943
|
setNewPackDescription("");
|
|
40027
39944
|
setNewPackTags("");
|
|
40028
39945
|
setCreateImportedFiles([]);
|
|
40029
39946
|
}, []);
|
|
40030
|
-
const refreshSeedPacks = (0,
|
|
39947
|
+
const refreshSeedPacks = (0, import_react77.useCallback)(
|
|
40031
39948
|
async (nextSelectedSid) => {
|
|
40032
39949
|
if (!gatewayConfigured) {
|
|
40033
39950
|
return;
|
|
@@ -40054,7 +39971,7 @@ var SeedPacksTab = () => {
|
|
|
40054
39971
|
},
|
|
40055
39972
|
[gatewayConfigured, selectedSid]
|
|
40056
39973
|
);
|
|
40057
|
-
const loadSeedPackDetail = (0,
|
|
39974
|
+
const loadSeedPackDetail = (0, import_react77.useCallback)(
|
|
40058
39975
|
async (sid) => {
|
|
40059
39976
|
if (!gatewayConfigured) {
|
|
40060
39977
|
return;
|
|
@@ -40076,15 +39993,15 @@ var SeedPacksTab = () => {
|
|
|
40076
39993
|
},
|
|
40077
39994
|
[gatewayConfigured, hydrateDraft, showSnackbar]
|
|
40078
39995
|
);
|
|
40079
|
-
(0,
|
|
39996
|
+
(0, import_react77.useEffect)(() => {
|
|
40080
39997
|
void refreshSeedPacks();
|
|
40081
39998
|
}, [refreshSeedPacks, authStore.token]);
|
|
40082
|
-
(0,
|
|
39999
|
+
(0, import_react77.useEffect)(() => {
|
|
40083
40000
|
if (selectedSid) {
|
|
40084
40001
|
void loadSeedPackDetail(selectedSid);
|
|
40085
40002
|
}
|
|
40086
40003
|
}, [selectedSid, loadSeedPackDetail]);
|
|
40087
|
-
(0,
|
|
40004
|
+
(0, import_react77.useEffect)(() => {
|
|
40088
40005
|
const setDirectoryUploadAttributes = (input) => {
|
|
40089
40006
|
if (!input) {
|
|
40090
40007
|
return;
|
|
@@ -40100,7 +40017,7 @@ var SeedPacksTab = () => {
|
|
|
40100
40017
|
setSelectedSeedPack(pack);
|
|
40101
40018
|
hydrateDraft(pack);
|
|
40102
40019
|
};
|
|
40103
|
-
const handleImportFiles = (0,
|
|
40020
|
+
const handleImportFiles = (0, import_react77.useCallback)(
|
|
40104
40021
|
async (files, source = "local") => {
|
|
40105
40022
|
if (!files || files.length === 0) {
|
|
40106
40023
|
return;
|
|
@@ -40143,24 +40060,24 @@ ${combined}` : combined;
|
|
|
40143
40060
|
},
|
|
40144
40061
|
[importedFiles, showSnackbar]
|
|
40145
40062
|
);
|
|
40146
|
-
const handleFileInputChange = (0,
|
|
40063
|
+
const handleFileInputChange = (0, import_react77.useCallback)(
|
|
40147
40064
|
async (event) => {
|
|
40148
40065
|
await handleImportFiles(event.target.files, "local");
|
|
40149
40066
|
event.target.value = "";
|
|
40150
40067
|
},
|
|
40151
40068
|
[handleImportFiles]
|
|
40152
40069
|
);
|
|
40153
|
-
const handleWikiFolderInputChange = (0,
|
|
40070
|
+
const handleWikiFolderInputChange = (0, import_react77.useCallback)(
|
|
40154
40071
|
async (event) => {
|
|
40155
40072
|
await handleImportFiles(event.target.files, "azure-wiki");
|
|
40156
40073
|
event.target.value = "";
|
|
40157
40074
|
},
|
|
40158
40075
|
[handleImportFiles]
|
|
40159
40076
|
);
|
|
40160
|
-
const handleRemoveImportedFile = (0,
|
|
40077
|
+
const handleRemoveImportedFile = (0, import_react77.useCallback)((id) => {
|
|
40161
40078
|
setImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
40162
40079
|
}, []);
|
|
40163
|
-
const handleCreateImportFiles = (0,
|
|
40080
|
+
const handleCreateImportFiles = (0, import_react77.useCallback)(
|
|
40164
40081
|
async (files, source = "local") => {
|
|
40165
40082
|
if (!files || files.length === 0) {
|
|
40166
40083
|
return;
|
|
@@ -40181,24 +40098,24 @@ ${combined}` : combined;
|
|
|
40181
40098
|
},
|
|
40182
40099
|
[showSnackbar]
|
|
40183
40100
|
);
|
|
40184
|
-
const handleCreateFileInputChange = (0,
|
|
40101
|
+
const handleCreateFileInputChange = (0, import_react77.useCallback)(
|
|
40185
40102
|
async (event) => {
|
|
40186
40103
|
await handleCreateImportFiles(event.target.files, "local");
|
|
40187
40104
|
event.target.value = "";
|
|
40188
40105
|
},
|
|
40189
40106
|
[handleCreateImportFiles]
|
|
40190
40107
|
);
|
|
40191
|
-
const handleCreateWikiFolderInputChange = (0,
|
|
40108
|
+
const handleCreateWikiFolderInputChange = (0, import_react77.useCallback)(
|
|
40192
40109
|
async (event) => {
|
|
40193
40110
|
await handleCreateImportFiles(event.target.files, "azure-wiki");
|
|
40194
40111
|
event.target.value = "";
|
|
40195
40112
|
},
|
|
40196
40113
|
[handleCreateImportFiles]
|
|
40197
40114
|
);
|
|
40198
|
-
const handleRemoveCreateImportedFile = (0,
|
|
40115
|
+
const handleRemoveCreateImportedFile = (0, import_react77.useCallback)((id) => {
|
|
40199
40116
|
setCreateImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
40200
40117
|
}, []);
|
|
40201
|
-
const buildDraftPayload2 = (0,
|
|
40118
|
+
const buildDraftPayload2 = (0, import_react77.useCallback)(() => {
|
|
40202
40119
|
const name = draft.name.trim();
|
|
40203
40120
|
if (!name) {
|
|
40204
40121
|
showSnackbar("Seed pack name is required.", "error");
|
|
@@ -40212,7 +40129,7 @@ ${combined}` : combined;
|
|
|
40212
40129
|
contentType: "markdown"
|
|
40213
40130
|
};
|
|
40214
40131
|
}, [draft, parsedTags, showSnackbar]);
|
|
40215
|
-
const saveDraft = (0,
|
|
40132
|
+
const saveDraft = (0, import_react77.useCallback)(async () => {
|
|
40216
40133
|
if (!selectedSeedPack) {
|
|
40217
40134
|
return null;
|
|
40218
40135
|
}
|
|
@@ -40927,9 +40844,9 @@ var KnowledgeHubTab = (props) => {
|
|
|
40927
40844
|
const theme = (0, import_material53.useTheme)();
|
|
40928
40845
|
const isMobile = (0, import_material53.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
40929
40846
|
const { seedPacksEnabled = false } = props;
|
|
40930
|
-
const [tabIndex, setTabIndex] = (0,
|
|
40847
|
+
const [tabIndex, setTabIndex] = (0, import_react78.useState)(0);
|
|
40931
40848
|
const effectiveTabIndex = seedPacksEnabled ? tabIndex : 0;
|
|
40932
|
-
(0,
|
|
40849
|
+
(0, import_react78.useEffect)(() => {
|
|
40933
40850
|
if (!seedPacksEnabled && tabIndex !== 0) {
|
|
40934
40851
|
setTabIndex(0);
|
|
40935
40852
|
}
|
|
@@ -40972,7 +40889,7 @@ var KnowledgeHubTab = (props) => {
|
|
|
40972
40889
|
var KnowledgeHubTab_default = KnowledgeHubTab;
|
|
40973
40890
|
|
|
40974
40891
|
// src/management/components/StorageTab.tsx
|
|
40975
|
-
var
|
|
40892
|
+
var import_react79 = require("react");
|
|
40976
40893
|
var import_material54 = require("@mui/material");
|
|
40977
40894
|
init_debugLogger();
|
|
40978
40895
|
init_indexedDBService();
|
|
@@ -41270,21 +41187,21 @@ var clearEntireDatabase = async (dbName) => {
|
|
|
41270
41187
|
};
|
|
41271
41188
|
var StorageTab = ({ currentTheme }) => {
|
|
41272
41189
|
const theme = (0, import_material54.useTheme)();
|
|
41273
|
-
const [storageQuota, setStorageQuota] = (0,
|
|
41190
|
+
const [storageQuota, setStorageQuota] = (0, import_react79.useState)({
|
|
41274
41191
|
used: 0,
|
|
41275
41192
|
quota: 0,
|
|
41276
41193
|
available: 0,
|
|
41277
41194
|
browserQuotaEstimate: 0
|
|
41278
41195
|
});
|
|
41279
|
-
const [storageCategories, setStorageCategories] = (0,
|
|
41280
|
-
const [loading, setLoading] = (0,
|
|
41281
|
-
const [loadError, setLoadError] = (0,
|
|
41282
|
-
const [clearAllDialogOpen, setClearAllDialogOpen] = (0,
|
|
41283
|
-
const [clearCategoryDialog, setClearCategoryDialog] = (0,
|
|
41284
|
-
const [clearing, setClearing] = (0,
|
|
41285
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
41286
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
41287
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
41196
|
+
const [storageCategories, setStorageCategories] = (0, import_react79.useState)([]);
|
|
41197
|
+
const [loading, setLoading] = (0, import_react79.useState)(true);
|
|
41198
|
+
const [loadError, setLoadError] = (0, import_react79.useState)(null);
|
|
41199
|
+
const [clearAllDialogOpen, setClearAllDialogOpen] = (0, import_react79.useState)(false);
|
|
41200
|
+
const [clearCategoryDialog, setClearCategoryDialog] = (0, import_react79.useState)(null);
|
|
41201
|
+
const [clearing, setClearing] = (0, import_react79.useState)(false);
|
|
41202
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react79.useState)("");
|
|
41203
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react79.useState)(false);
|
|
41204
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react79.useState)("success");
|
|
41288
41205
|
const { syncEnabled, isAdvancedVectorFeaturesEnabled } = useConversationSyncStore((state) => ({
|
|
41289
41206
|
syncEnabled: state.syncEnabled,
|
|
41290
41207
|
isAdvancedVectorFeaturesEnabled: state.isAdvancedVectorFeaturesEnabled
|
|
@@ -41335,18 +41252,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
41335
41252
|
setLoading(false);
|
|
41336
41253
|
}
|
|
41337
41254
|
};
|
|
41338
|
-
(0,
|
|
41255
|
+
(0, import_react79.useEffect)(() => {
|
|
41339
41256
|
loadStorageData();
|
|
41340
41257
|
}, []);
|
|
41341
|
-
const totalUsed = (0,
|
|
41258
|
+
const totalUsed = (0, import_react79.useMemo)(() => {
|
|
41342
41259
|
return storageCategories.reduce((sum, cat) => sum + cat.size, 0);
|
|
41343
41260
|
}, [storageCategories]);
|
|
41344
|
-
const usagePercentage = (0,
|
|
41261
|
+
const usagePercentage = (0, import_react79.useMemo)(() => {
|
|
41345
41262
|
if (storageQuota.quota === 0) return 0;
|
|
41346
41263
|
const percentage = Math.min(storageQuota.used / storageQuota.quota * 100, 100);
|
|
41347
41264
|
return percentage > 0 && percentage < 0.1 ? 0.1 : percentage;
|
|
41348
41265
|
}, [storageQuota]);
|
|
41349
|
-
const clearableCategories = (0,
|
|
41266
|
+
const clearableCategories = (0, import_react79.useMemo)(() => {
|
|
41350
41267
|
return storageCategories.filter((cat) => cat.canClear);
|
|
41351
41268
|
}, [storageCategories]);
|
|
41352
41269
|
const handleClearCategory = async (category) => {
|
|
@@ -41939,7 +41856,7 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
41939
41856
|
var StorageTab_default = StorageTab;
|
|
41940
41857
|
|
|
41941
41858
|
// src/management/components/ProviderTab.tsx
|
|
41942
|
-
var
|
|
41859
|
+
var import_react80 = require("react");
|
|
41943
41860
|
var import_material55 = require("@mui/material");
|
|
41944
41861
|
init_icons();
|
|
41945
41862
|
init_aiProviderStore();
|
|
@@ -41952,7 +41869,7 @@ var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
|
41952
41869
|
var ProviderTab = () => {
|
|
41953
41870
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
41954
41871
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
41955
|
-
const getSuggestedModel = (0,
|
|
41872
|
+
const getSuggestedModel = (0, import_react80.useCallback)((type) => {
|
|
41956
41873
|
const configuredDefault = packageSettings?.defaultModel?.trim();
|
|
41957
41874
|
if (configuredDefault) {
|
|
41958
41875
|
return configuredDefault;
|
|
@@ -41968,7 +41885,7 @@ var ProviderTab = () => {
|
|
|
41968
41885
|
return "";
|
|
41969
41886
|
}
|
|
41970
41887
|
}, [packageSettings?.defaultModel]);
|
|
41971
|
-
const applyDefaultModel = (0,
|
|
41888
|
+
const applyDefaultModel = (0, import_react80.useCallback)((config) => {
|
|
41972
41889
|
const normalized = { ...config };
|
|
41973
41890
|
const trimmed = typeof normalized.defaultModel === "string" ? normalized.defaultModel.trim() : void 0;
|
|
41974
41891
|
const requiresModel = normalized.type === "openai" /* OPENAI */ || normalized.type === "xai" /* XAI */ || normalized.type === "bandit" /* BANDIT */;
|
|
@@ -41988,7 +41905,7 @@ var ProviderTab = () => {
|
|
|
41988
41905
|
}
|
|
41989
41906
|
return normalized;
|
|
41990
41907
|
}, [getSuggestedModel]);
|
|
41991
|
-
const sanitizeConfigForSave = (0,
|
|
41908
|
+
const sanitizeConfigForSave = (0, import_react80.useCallback)((config) => {
|
|
41992
41909
|
const sanitized = { ...config };
|
|
41993
41910
|
if (typeof sanitized.defaultModel === "string") {
|
|
41994
41911
|
const trimmed = sanitized.defaultModel.trim();
|
|
@@ -42000,22 +41917,22 @@ var ProviderTab = () => {
|
|
|
42000
41917
|
}
|
|
42001
41918
|
return sanitized;
|
|
42002
41919
|
}, []);
|
|
42003
|
-
const [providerConfig, setProviderConfig] = (0,
|
|
41920
|
+
const [providerConfig, setProviderConfig] = (0, import_react80.useState)({
|
|
42004
41921
|
type: "gateway",
|
|
42005
41922
|
gatewayUrl: packageSettings?.gatewayApiUrl || "",
|
|
42006
41923
|
provider: "bandit"
|
|
42007
41924
|
});
|
|
42008
|
-
const [saveResult, setSaveResult] = (0,
|
|
42009
|
-
const [testResult, setTestResult] = (0,
|
|
42010
|
-
const providerTypeRef = (0,
|
|
42011
|
-
const formRef = (0,
|
|
41925
|
+
const [saveResult, setSaveResult] = (0, import_react80.useState)({ state: "idle" });
|
|
41926
|
+
const [testResult, setTestResult] = (0, import_react80.useState)({ state: "idle" });
|
|
41927
|
+
const providerTypeRef = (0, import_react80.useRef)(null);
|
|
41928
|
+
const formRef = (0, import_react80.useRef)(null);
|
|
42012
41929
|
const revealProviderForm = () => {
|
|
42013
41930
|
formRef.current?.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
42014
41931
|
providerTypeRef.current?.focus();
|
|
42015
41932
|
};
|
|
42016
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
42017
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
42018
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
41933
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react80.useState)("");
|
|
41934
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react80.useState)(false);
|
|
41935
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react80.useState)("success");
|
|
42019
41936
|
const saveProviderConfigToDB = async (config) => {
|
|
42020
41937
|
try {
|
|
42021
41938
|
const { tokenFactory: _tokenFactory, ...persistableConfig } = config;
|
|
@@ -42056,7 +41973,7 @@ var ProviderTab = () => {
|
|
|
42056
41973
|
}
|
|
42057
41974
|
return null;
|
|
42058
41975
|
};
|
|
42059
|
-
const convertAnthropicConfig = (0,
|
|
41976
|
+
const convertAnthropicConfig = (0, import_react80.useCallback)((config) => {
|
|
42060
41977
|
if (!config) return null;
|
|
42061
41978
|
if (config.type !== "anthropic" /* ANTHROPIC */) {
|
|
42062
41979
|
return config;
|
|
@@ -42072,7 +41989,7 @@ var ProviderTab = () => {
|
|
|
42072
41989
|
};
|
|
42073
41990
|
return converted;
|
|
42074
41991
|
}, [packageSettings?.gatewayApiUrl]);
|
|
42075
|
-
(0,
|
|
41992
|
+
(0, import_react80.useEffect)(() => {
|
|
42076
41993
|
const initializeProviderConfig = async () => {
|
|
42077
41994
|
const savedConfig = await loadProviderConfigFromDB();
|
|
42078
41995
|
if (savedConfig) {
|
|
@@ -42548,7 +42465,7 @@ var ProviderTab = () => {
|
|
|
42548
42465
|
};
|
|
42549
42466
|
|
|
42550
42467
|
// src/management/components/MCPToolsTabV2.tsx
|
|
42551
|
-
var
|
|
42468
|
+
var import_react82 = require("react");
|
|
42552
42469
|
var import_material57 = require("@mui/material");
|
|
42553
42470
|
|
|
42554
42471
|
// src/services/mcp/mcpControllerService.ts
|
|
@@ -42625,7 +42542,7 @@ async function fetchMcpHealth() {
|
|
|
42625
42542
|
}
|
|
42626
42543
|
|
|
42627
42544
|
// src/management/components/McpServersSection.tsx
|
|
42628
|
-
var
|
|
42545
|
+
var import_react81 = require("react");
|
|
42629
42546
|
var import_material56 = require("@mui/material");
|
|
42630
42547
|
init_icons();
|
|
42631
42548
|
init_mcpServersService();
|
|
@@ -42696,18 +42613,18 @@ var CATALOG = [
|
|
|
42696
42613
|
];
|
|
42697
42614
|
var errorDetail = (e) => e instanceof Error && e.message ? e.message : void 0;
|
|
42698
42615
|
var McpServersSection = () => {
|
|
42699
|
-
const [servers, setServers] = (0,
|
|
42700
|
-
const [loading, setLoading] = (0,
|
|
42701
|
-
const [error, setError] = (0,
|
|
42702
|
-
const [loadError, setLoadError] = (0,
|
|
42703
|
-
const [form, setForm] = (0,
|
|
42704
|
-
const [activeEntry, setActiveEntry] = (0,
|
|
42705
|
-
const [adding, setAdding] = (0,
|
|
42706
|
-
const [showForm, setShowForm] = (0,
|
|
42707
|
-
const [tools, setTools] = (0,
|
|
42616
|
+
const [servers, setServers] = (0, import_react81.useState)([]);
|
|
42617
|
+
const [loading, setLoading] = (0, import_react81.useState)(false);
|
|
42618
|
+
const [error, setError] = (0, import_react81.useState)(null);
|
|
42619
|
+
const [loadError, setLoadError] = (0, import_react81.useState)(null);
|
|
42620
|
+
const [form, setForm] = (0, import_react81.useState)(emptyForm);
|
|
42621
|
+
const [activeEntry, setActiveEntry] = (0, import_react81.useState)(null);
|
|
42622
|
+
const [adding, setAdding] = (0, import_react81.useState)(false);
|
|
42623
|
+
const [showForm, setShowForm] = (0, import_react81.useState)(false);
|
|
42624
|
+
const [tools, setTools] = (0, import_react81.useState)({});
|
|
42708
42625
|
const reloadChatTools = useMCPToolsStore((s) => s.loadMcpServerTools);
|
|
42709
|
-
const formRef = (0,
|
|
42710
|
-
const refresh = (0,
|
|
42626
|
+
const formRef = (0, import_react81.useRef)(null);
|
|
42627
|
+
const refresh = (0, import_react81.useCallback)(async () => {
|
|
42711
42628
|
setLoading(true);
|
|
42712
42629
|
setLoadError(null);
|
|
42713
42630
|
try {
|
|
@@ -42721,7 +42638,7 @@ var McpServersSection = () => {
|
|
|
42721
42638
|
setLoading(false);
|
|
42722
42639
|
}
|
|
42723
42640
|
}, []);
|
|
42724
|
-
(0,
|
|
42641
|
+
(0, import_react81.useEffect)(() => {
|
|
42725
42642
|
refresh();
|
|
42726
42643
|
}, [refresh]);
|
|
42727
42644
|
const connectedKeys = new Set(servers.map((s) => s.url.replace(/\/+$/, "")));
|
|
@@ -43094,10 +43011,10 @@ var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
|
43094
43011
|
var MCPToolsTabV2 = () => {
|
|
43095
43012
|
const { settings } = usePackageSettingsStore();
|
|
43096
43013
|
const { tools: localTools, loadTools, toggleTool, syncControllerTools, isLoaded, saveState, lastSavedAt, saveTools } = useMCPToolsStore();
|
|
43097
|
-
const [loading, setLoading] = (0,
|
|
43098
|
-
const [error, setError] = (0,
|
|
43099
|
-
const [tools, setTools] = (0,
|
|
43100
|
-
const [health, setHealth] = (0,
|
|
43014
|
+
const [loading, setLoading] = (0, import_react82.useState)(true);
|
|
43015
|
+
const [error, setError] = (0, import_react82.useState)(null);
|
|
43016
|
+
const [tools, setTools] = (0, import_react82.useState)([]);
|
|
43017
|
+
const [health, setHealth] = (0, import_react82.useState)(null);
|
|
43101
43018
|
const gatewayConfigured = !!settings?.gatewayApiUrl;
|
|
43102
43019
|
const refresh = async () => {
|
|
43103
43020
|
setLoading(true);
|
|
@@ -43122,7 +43039,7 @@ var MCPToolsTabV2 = () => {
|
|
|
43122
43039
|
setLoading(false);
|
|
43123
43040
|
}
|
|
43124
43041
|
};
|
|
43125
|
-
(0,
|
|
43042
|
+
(0, import_react82.useEffect)(() => {
|
|
43126
43043
|
if (isLoaded) {
|
|
43127
43044
|
refresh();
|
|
43128
43045
|
} else {
|
|
@@ -43131,7 +43048,7 @@ var MCPToolsTabV2 = () => {
|
|
|
43131
43048
|
});
|
|
43132
43049
|
}
|
|
43133
43050
|
}, [isLoaded]);
|
|
43134
|
-
const localEnabledMap = (0,
|
|
43051
|
+
const localEnabledMap = (0, import_react82.useMemo)(() => {
|
|
43135
43052
|
const map23 = /* @__PURE__ */ new Map();
|
|
43136
43053
|
const sortedTools = [...localTools].sort((a, b) => {
|
|
43137
43054
|
if (a.isBuiltIn && !b.isBuiltIn) return -1;
|
|
@@ -43286,9 +43203,9 @@ init_useNotificationService();
|
|
|
43286
43203
|
init_icons();
|
|
43287
43204
|
|
|
43288
43205
|
// src/management/shell/ManagementShell.tsx
|
|
43289
|
-
var
|
|
43206
|
+
var import_react83 = __toESM(require("react"));
|
|
43290
43207
|
var import_material58 = require("@mui/material");
|
|
43291
|
-
var
|
|
43208
|
+
var import_styles30 = require("@mui/material/styles");
|
|
43292
43209
|
init_icons();
|
|
43293
43210
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
43294
43211
|
var RAIL_WIDTH = 248;
|
|
@@ -43311,17 +43228,17 @@ var railItemSx = (theme, selected) => ({
|
|
|
43311
43228
|
py: 0.375,
|
|
43312
43229
|
mb: 0.25,
|
|
43313
43230
|
color: selected ? theme.palette.text.primary : theme.palette.text.secondary,
|
|
43314
|
-
bgcolor: selected ? (0,
|
|
43231
|
+
bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.16 : 0.1) : "transparent",
|
|
43315
43232
|
boxShadow: selected ? `inset 2px 0 0 ${theme.palette.primary.main}` : "none",
|
|
43316
43233
|
transition: theme.transitions.create(["background-color", "color"], {
|
|
43317
43234
|
duration: theme.transitions.duration.shortest
|
|
43318
43235
|
}),
|
|
43319
43236
|
"&:hover": {
|
|
43320
|
-
bgcolor: selected ? (0,
|
|
43237
|
+
bgcolor: selected ? (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.2 : 0.14) : theme.palette.bandit?.surface.interactiveHover ?? theme.palette.action.hover,
|
|
43321
43238
|
color: theme.palette.text.primary
|
|
43322
43239
|
},
|
|
43323
43240
|
"&.Mui-selected, &.Mui-selected:hover": {
|
|
43324
|
-
bgcolor: (0,
|
|
43241
|
+
bgcolor: (0, import_styles30.alpha)(theme.palette.primary.main, theme.palette.mode === "dark" ? 0.18 : 0.12)
|
|
43325
43242
|
},
|
|
43326
43243
|
"& .MuiListItemIcon-root": {
|
|
43327
43244
|
minWidth: 28,
|
|
@@ -43491,7 +43408,7 @@ function Navigation({
|
|
|
43491
43408
|
}
|
|
43492
43409
|
function ManagementShell(props) {
|
|
43493
43410
|
const { isMobile, children, sections, active: active2, onBackToChat, onBackHover, onOpenCommandPalette } = props;
|
|
43494
|
-
const [sheetOpen, setSheetOpen] =
|
|
43411
|
+
const [sheetOpen, setSheetOpen] = import_react83.default.useState(false);
|
|
43495
43412
|
const current = sections.find((s) => s.id === active2);
|
|
43496
43413
|
if (isMobile) {
|
|
43497
43414
|
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_material58.Box, { sx: { display: "flex", flexDirection: "column", height: "100dvh", bgcolor: "background.default" }, children: [
|
|
@@ -43562,7 +43479,7 @@ function ManagementShell(props) {
|
|
|
43562
43479
|
borderRadius: 2,
|
|
43563
43480
|
mx: "auto",
|
|
43564
43481
|
mt: 1,
|
|
43565
|
-
bgcolor: (0,
|
|
43482
|
+
bgcolor: (0, import_styles30.alpha)(theme.palette.text.primary, 0.2)
|
|
43566
43483
|
})
|
|
43567
43484
|
}
|
|
43568
43485
|
),
|
|
@@ -43601,7 +43518,7 @@ function ManagementShell(props) {
|
|
|
43601
43518
|
|
|
43602
43519
|
// src/management/shell/ManagementOverview.tsx
|
|
43603
43520
|
var import_material59 = require("@mui/material");
|
|
43604
|
-
var
|
|
43521
|
+
var import_styles31 = require("@mui/material/styles");
|
|
43605
43522
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
43606
43523
|
var PROVIDER_LABELS = {
|
|
43607
43524
|
ollama: "Ollama",
|
|
@@ -43637,7 +43554,7 @@ function Tile({
|
|
|
43637
43554
|
transition: theme.transitions.create(["border-color", "background-color"], {
|
|
43638
43555
|
duration: theme.transitions.duration.shortest
|
|
43639
43556
|
}),
|
|
43640
|
-
"&:hover": { borderColor: (0,
|
|
43557
|
+
"&:hover": { borderColor: (0, import_styles31.alpha)(theme.palette.primary.main, 0.5) },
|
|
43641
43558
|
"&:focus-visible": { outline: `2px solid ${theme.palette.primary.main}`, outlineOffset: 2 }
|
|
43642
43559
|
}),
|
|
43643
43560
|
children: [
|
|
@@ -43754,7 +43671,7 @@ function ManagementOverview({
|
|
|
43754
43671
|
}
|
|
43755
43672
|
|
|
43756
43673
|
// src/management/shell/sections.ts
|
|
43757
|
-
var
|
|
43674
|
+
var import_react84 = require("react");
|
|
43758
43675
|
init_useFeatures();
|
|
43759
43676
|
init_authenticationService();
|
|
43760
43677
|
var MANAGEMENT_SECTIONS = [
|
|
@@ -43845,7 +43762,7 @@ function useManagementAccess() {
|
|
|
43845
43762
|
const limited = hasLimitedAdminDashboard();
|
|
43846
43763
|
const full = hasAdminDashboard();
|
|
43847
43764
|
const advanced = hasAdvancedSearch();
|
|
43848
|
-
return (0,
|
|
43765
|
+
return (0, import_react84.useMemo)(() => {
|
|
43849
43766
|
const roles = (token ? authenticationService.parseJwtClaims(token)?.roles : void 0) ?? [];
|
|
43850
43767
|
return {
|
|
43851
43768
|
sections: resolveManagementSections({
|
|
@@ -43923,16 +43840,16 @@ var Management = ({
|
|
|
43923
43840
|
hasTransparentLogo,
|
|
43924
43841
|
setHasTransparentLogo
|
|
43925
43842
|
} = useModelStore();
|
|
43926
|
-
const [modalOpen, setModalOpen] = (0,
|
|
43843
|
+
const [modalOpen, setModalOpen] = (0, import_react85.useState)(false);
|
|
43927
43844
|
const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
43928
|
-
const [fabLogo, setFabLogo] = (0,
|
|
43929
|
-
const [logoFile, setLogoFile] = (0,
|
|
43930
|
-
const [logoBase64, setLogoBase64] = (0,
|
|
43931
|
-
const [brandingText, setBrandingText] = (0,
|
|
43932
|
-
const [headerMode, setHeaderMode] = (0,
|
|
43933
|
-
const [theme, setTheme] = (0,
|
|
43934
|
-
const [customAvatarBase64, setCustomAvatarBase64] = (0,
|
|
43935
|
-
const [presetAvatar, setPresetAvatar] = (0,
|
|
43845
|
+
const [fabLogo, setFabLogo] = (0, import_react85.useState)(banditHead5);
|
|
43846
|
+
const [logoFile, setLogoFile] = (0, import_react85.useState)(null);
|
|
43847
|
+
const [logoBase64, setLogoBase64] = (0, import_react85.useState)(null);
|
|
43848
|
+
const [brandingText, setBrandingText] = (0, import_react85.useState)("");
|
|
43849
|
+
const [headerMode, setHeaderMode] = (0, import_react85.useState)("logo");
|
|
43850
|
+
const [theme, setTheme] = (0, import_react85.useState)("bandit-dark");
|
|
43851
|
+
const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react85.useState)(null);
|
|
43852
|
+
const [presetAvatar, setPresetAvatar] = (0, import_react85.useState)(null);
|
|
43936
43853
|
const showSnackbarMessage = (message, severity = "success") => {
|
|
43937
43854
|
if (severity === "success") {
|
|
43938
43855
|
notificationService2?.showSuccess(message);
|
|
@@ -43940,15 +43857,15 @@ var Management = ({
|
|
|
43940
43857
|
notificationService2?.showError(message);
|
|
43941
43858
|
}
|
|
43942
43859
|
};
|
|
43943
|
-
const [brandingLoaded, setBrandingLoaded] = (0,
|
|
43944
|
-
const [isLoadingBranding, setIsLoadingBranding] = (0,
|
|
43860
|
+
const [brandingLoaded, setBrandingLoaded] = (0, import_react85.useState)(false);
|
|
43861
|
+
const [isLoadingBranding, setIsLoadingBranding] = (0, import_react85.useState)(false);
|
|
43945
43862
|
const { initModels } = useModelStore();
|
|
43946
43863
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
43947
43864
|
const authToken = useAuthenticationStore((state) => state.token);
|
|
43948
43865
|
const { preferences, updatePreference } = usePreferencesStore();
|
|
43949
43866
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
43950
|
-
const [seedPacksEnabled, setSeedPacksEnabled] = (0,
|
|
43951
|
-
const [localSelectedModel, setLocalSelectedModel] = (0,
|
|
43867
|
+
const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react85.useState)(false);
|
|
43868
|
+
const [localSelectedModel, setLocalSelectedModel] = (0, import_react85.useState)({
|
|
43952
43869
|
name: "",
|
|
43953
43870
|
tagline: "",
|
|
43954
43871
|
systemPrompt: "",
|
|
@@ -43961,7 +43878,7 @@ var Management = ({
|
|
|
43961
43878
|
loadDocuments,
|
|
43962
43879
|
clearAllDocuments
|
|
43963
43880
|
} = useKnowledgeStore2();
|
|
43964
|
-
(0,
|
|
43881
|
+
(0, import_react85.useEffect)(() => {
|
|
43965
43882
|
if (selectedModel) {
|
|
43966
43883
|
const selected = availableModels.find((m) => m.name === selectedModel);
|
|
43967
43884
|
if (selected) {
|
|
@@ -43985,7 +43902,7 @@ var Management = ({
|
|
|
43985
43902
|
}
|
|
43986
43903
|
}
|
|
43987
43904
|
}, [selectedModel, availableModels]);
|
|
43988
|
-
const loadBrandingConfig = (0,
|
|
43905
|
+
const loadBrandingConfig = (0, import_react85.useCallback)(async () => {
|
|
43989
43906
|
if (isLoadingBranding || brandingLoaded) {
|
|
43990
43907
|
debugLogger.warn("Branding loading already in progress or completed, skipping");
|
|
43991
43908
|
return;
|
|
@@ -44102,15 +44019,15 @@ var Management = ({
|
|
|
44102
44019
|
setTagline,
|
|
44103
44020
|
setTheme
|
|
44104
44021
|
]);
|
|
44105
|
-
(0,
|
|
44022
|
+
(0, import_react85.useEffect)(() => {
|
|
44106
44023
|
void loadBrandingConfig();
|
|
44107
44024
|
}, [loadBrandingConfig]);
|
|
44108
44025
|
const handleOpenModal = () => setModalOpen(true);
|
|
44109
44026
|
const handleCloseModal = () => setModalOpen(false);
|
|
44110
|
-
(0,
|
|
44027
|
+
(0, import_react85.useEffect)(() => {
|
|
44111
44028
|
getOptimalFabLogo().then(setFabLogo);
|
|
44112
44029
|
}, []);
|
|
44113
|
-
(0,
|
|
44030
|
+
(0, import_react85.useEffect)(() => {
|
|
44114
44031
|
if (logoBase64) {
|
|
44115
44032
|
setFabLogo(logoBase64);
|
|
44116
44033
|
} else {
|
|
@@ -44568,7 +44485,7 @@ var Management = ({
|
|
|
44568
44485
|
reader.readAsText(file);
|
|
44569
44486
|
}
|
|
44570
44487
|
};
|
|
44571
|
-
(0,
|
|
44488
|
+
(0, import_react85.useEffect)(() => {
|
|
44572
44489
|
if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
|
|
44573
44490
|
setLocalSelectedModel((prev) => ({
|
|
44574
44491
|
...prev,
|
|
@@ -44576,10 +44493,10 @@ var Management = ({
|
|
|
44576
44493
|
}));
|
|
44577
44494
|
}
|
|
44578
44495
|
}, [availableModels, localSelectedModel.selectedModel]);
|
|
44579
|
-
(0,
|
|
44496
|
+
(0, import_react85.useEffect)(() => {
|
|
44580
44497
|
loadDocuments();
|
|
44581
44498
|
}, [loadDocuments]);
|
|
44582
|
-
(0,
|
|
44499
|
+
(0, import_react85.useEffect)(() => {
|
|
44583
44500
|
const gatewayApiUrl = packageSettings?.gatewayApiUrl;
|
|
44584
44501
|
if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
|
|
44585
44502
|
setSeedPacksEnabled(false);
|
|
@@ -44622,20 +44539,20 @@ var Management = ({
|
|
|
44622
44539
|
isActive = false;
|
|
44623
44540
|
};
|
|
44624
44541
|
}, [packageSettings?.gatewayApiUrl, authToken]);
|
|
44625
|
-
const currentTheme = (0,
|
|
44626
|
-
(0,
|
|
44542
|
+
const currentTheme = (0, import_react85.useMemo)(() => createBrandingTheme(theme, { density: "compact" }), [theme]);
|
|
44543
|
+
(0, import_react85.useEffect)(() => {
|
|
44627
44544
|
onThemeChange?.(currentTheme);
|
|
44628
44545
|
}, [currentTheme, onThemeChange]);
|
|
44629
44546
|
const access = useManagementAccess();
|
|
44630
|
-
const sections = (0,
|
|
44547
|
+
const sections = (0, import_react85.useMemo)(
|
|
44631
44548
|
() => sectionOverride ? MANAGEMENT_SECTIONS.filter((s) => sectionOverride.includes(s.id)) : access.sections,
|
|
44632
44549
|
[sectionOverride, access.sections]
|
|
44633
44550
|
);
|
|
44634
44551
|
const defaultSection = sections.some((s) => s.id === "overview") ? "overview" : sections.some((s) => s.id === "preferences") ? "preferences" : sections[0]?.id ?? "preferences";
|
|
44635
|
-
const [ownSection, setOwnSection] = (0,
|
|
44552
|
+
const [ownSection, setOwnSection] = (0, import_react85.useState)(null);
|
|
44636
44553
|
const requested = controlledSection ?? ownSection ?? defaultSection;
|
|
44637
44554
|
const active2 = sections.some((s) => s.id === requested) ? requested : defaultSection;
|
|
44638
|
-
const selectSection = (0,
|
|
44555
|
+
const selectSection = (0, import_react85.useCallback)(
|
|
44639
44556
|
(id) => {
|
|
44640
44557
|
setOwnSection(id);
|
|
44641
44558
|
onSectionChange?.(id);
|
|
@@ -44643,9 +44560,9 @@ var Management = ({
|
|
|
44643
44560
|
[onSectionChange]
|
|
44644
44561
|
);
|
|
44645
44562
|
const activeDef = sectionById(active2);
|
|
44646
|
-
const [createPersonalityRequest, setCreatePersonalityRequest] = (0,
|
|
44647
|
-
const [pendingUpload, setPendingUpload] = (0,
|
|
44648
|
-
(0,
|
|
44563
|
+
const [createPersonalityRequest, setCreatePersonalityRequest] = (0, import_react85.useState)(0);
|
|
44564
|
+
const [pendingUpload, setPendingUpload] = (0, import_react85.useState)(0);
|
|
44565
|
+
(0, import_react85.useEffect)(() => {
|
|
44649
44566
|
if (!request) return;
|
|
44650
44567
|
if (request.action === "create-personality") {
|
|
44651
44568
|
selectSection("personalities");
|
|
@@ -44655,10 +44572,10 @@ var Management = ({
|
|
|
44655
44572
|
setPendingUpload(request.id);
|
|
44656
44573
|
}
|
|
44657
44574
|
}, [request?.id]);
|
|
44658
|
-
(0,
|
|
44575
|
+
(0, import_react85.useEffect)(() => {
|
|
44659
44576
|
if (createPersonalityRequest && active2 === "personalities" && brandingLoaded) setCreatePersonalityRequest(0);
|
|
44660
44577
|
}, [createPersonalityRequest, active2, brandingLoaded]);
|
|
44661
|
-
(0,
|
|
44578
|
+
(0, import_react85.useEffect)(() => {
|
|
44662
44579
|
if (!pendingUpload || active2 !== "knowledge" || !brandingLoaded) return;
|
|
44663
44580
|
const frame = requestAnimationFrame(() => {
|
|
44664
44581
|
document.getElementById("file-upload")?.click();
|
|
@@ -44670,9 +44587,9 @@ var Management = ({
|
|
|
44670
44587
|
const prefSavedAt = usePreferencesStore((state) => state.lastSavedAt);
|
|
44671
44588
|
const retryPreferences = usePreferencesStore((state) => state.savePreferences);
|
|
44672
44589
|
const brandingValue = JSON.stringify({ logoBase64, brandingText, headerMode, theme });
|
|
44673
|
-
const [brandingBaseline, setBrandingBaseline] = (0,
|
|
44674
|
-
const [brandingSave, setBrandingSave] = (0,
|
|
44675
|
-
(0,
|
|
44590
|
+
const [brandingBaseline, setBrandingBaseline] = (0, import_react85.useState)(null);
|
|
44591
|
+
const [brandingSave, setBrandingSave] = (0, import_react85.useState)("idle");
|
|
44592
|
+
(0, import_react85.useEffect)(() => {
|
|
44676
44593
|
if (brandingLoaded && brandingBaseline === null) setBrandingBaseline(brandingValue);
|
|
44677
44594
|
}, [brandingLoaded, brandingBaseline, brandingValue]);
|
|
44678
44595
|
const brandingDirty = brandingBaseline !== null && brandingBaseline !== brandingValue;
|
|
@@ -44697,7 +44614,7 @@ var Management = ({
|
|
|
44697
44614
|
(m) => m.name === (localSelectedModel.selectedModel || localSelectedModel.name)
|
|
44698
44615
|
);
|
|
44699
44616
|
const personalityDirty = savedPersonality ? norm(localSelectedModel.name) !== norm(savedPersonality.name) || norm(localSelectedModel.tagline) !== norm(savedPersonality.tagline) || norm(localSelectedModel.systemPrompt) !== norm(savedPersonality.systemPrompt) : Boolean(norm(localSelectedModel.name) || norm(localSelectedModel.tagline) || norm(localSelectedModel.systemPrompt));
|
|
44700
|
-
const [personalitySaving, setPersonalitySaving] = (0,
|
|
44617
|
+
const [personalitySaving, setPersonalitySaving] = (0, import_react85.useState)(false);
|
|
44701
44618
|
const savePersonalityFromBar = async () => {
|
|
44702
44619
|
setPersonalitySaving(true);
|
|
44703
44620
|
try {
|
|
@@ -44909,7 +44826,7 @@ var Management = ({
|
|
|
44909
44826
|
var management_default = Management;
|
|
44910
44827
|
|
|
44911
44828
|
// src/management/components/InterestsEditor.tsx
|
|
44912
|
-
var
|
|
44829
|
+
var import_react86 = require("react");
|
|
44913
44830
|
var import_material61 = require("@mui/material");
|
|
44914
44831
|
init_preferencesStore();
|
|
44915
44832
|
init_getStableQuestionPrompt();
|
|
@@ -44922,7 +44839,7 @@ var InterestsEditor = ({
|
|
|
44922
44839
|
const updatePreference = usePreferencesStore((s) => s.updatePreference);
|
|
44923
44840
|
const loadPreferences = usePreferencesStore((s) => s.loadPreferences);
|
|
44924
44841
|
const isLoaded = usePreferencesStore((s) => s.isLoaded);
|
|
44925
|
-
(0,
|
|
44842
|
+
(0, import_react86.useEffect)(() => {
|
|
44926
44843
|
if (!isLoaded) {
|
|
44927
44844
|
void loadPreferences();
|
|
44928
44845
|
}
|
|
@@ -44954,7 +44871,7 @@ var InterestsEditor = ({
|
|
|
44954
44871
|
var InterestsEditor_default = InterestsEditor;
|
|
44955
44872
|
|
|
44956
44873
|
// src/shared/custom-element.ts
|
|
44957
|
-
var
|
|
44874
|
+
var import_react87 = __toESM(require("react"));
|
|
44958
44875
|
var import_client = __toESM(require("react-dom/client"));
|
|
44959
44876
|
function defineCustomElement(name, Component) {
|
|
44960
44877
|
if (customElements.get(name)) return;
|
|
@@ -44982,7 +44899,7 @@ function defineCustomElement(name, Component) {
|
|
|
44982
44899
|
if (!this.root) {
|
|
44983
44900
|
this.root = import_client.default.createRoot(this.mountPoint);
|
|
44984
44901
|
}
|
|
44985
|
-
this.root.render(
|
|
44902
|
+
this.root.render(import_react87.default.createElement(Component, props));
|
|
44986
44903
|
}
|
|
44987
44904
|
}
|
|
44988
44905
|
customElements.define(name, ReactElement);
|
|
@@ -45191,7 +45108,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
|
|
|
45191
45108
|
init_featureFlags();
|
|
45192
45109
|
|
|
45193
45110
|
// src/hooks/useVoices.ts
|
|
45194
|
-
var
|
|
45111
|
+
var import_react88 = require("react");
|
|
45195
45112
|
init_voiceStore();
|
|
45196
45113
|
init_packageSettingsStore();
|
|
45197
45114
|
init_authenticationStore();
|
|
@@ -45211,7 +45128,7 @@ var useVoices = () => {
|
|
|
45211
45128
|
} = useVoiceStore();
|
|
45212
45129
|
const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
|
|
45213
45130
|
const { token } = useAuthenticationStore();
|
|
45214
|
-
(0,
|
|
45131
|
+
(0, import_react88.useEffect)(() => {
|
|
45215
45132
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
45216
45133
|
if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
|
|
45217
45134
|
debugLogger.debug("Gateway API URL and JWT token available, loading voice models...");
|
|
@@ -45248,7 +45165,7 @@ init_streaming_tts();
|
|
|
45248
45165
|
// src/modals/SubscriptionExpiredModal.tsx
|
|
45249
45166
|
init_storeBuild();
|
|
45250
45167
|
var import_material62 = require("@mui/material");
|
|
45251
|
-
var
|
|
45168
|
+
var import_react89 = require("@burtson-labs/icons/react");
|
|
45252
45169
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
45253
45170
|
var SubscriptionExpiredModal = ({
|
|
45254
45171
|
open,
|
|
@@ -45287,7 +45204,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45287
45204
|
},
|
|
45288
45205
|
children: [
|
|
45289
45206
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
|
|
45290
|
-
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45207
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.AlertTriangle, { size: 32, color: "warning" }),
|
|
45291
45208
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
|
|
45292
45209
|
] }) }),
|
|
45293
45210
|
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_material62.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_material62.Stack, { spacing: 2, children: [
|
|
@@ -45315,7 +45232,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45315
45232
|
{
|
|
45316
45233
|
onClick: handleNavigateHome,
|
|
45317
45234
|
variant: "outlined",
|
|
45318
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45235
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.Home, {}),
|
|
45319
45236
|
size: "large",
|
|
45320
45237
|
sx: { minWidth: 140 },
|
|
45321
45238
|
children: "Go Home"
|
|
@@ -45326,7 +45243,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45326
45243
|
{
|
|
45327
45244
|
onClick: handleManageSubscription,
|
|
45328
45245
|
variant: "contained",
|
|
45329
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
45246
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_react89.CreditCard, {}),
|
|
45330
45247
|
size: "large",
|
|
45331
45248
|
color: "primary",
|
|
45332
45249
|
sx: { minWidth: 140 },
|
|
@@ -45340,7 +45257,7 @@ var SubscriptionExpiredModal = ({
|
|
|
45340
45257
|
};
|
|
45341
45258
|
|
|
45342
45259
|
// src/guards/SubscriptionExpiredGuard.tsx
|
|
45343
|
-
var
|
|
45260
|
+
var import_react90 = require("react");
|
|
45344
45261
|
init_useFeatures();
|
|
45345
45262
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
45346
45263
|
var SubscriptionExpiredGuard = ({
|
|
@@ -45351,9 +45268,9 @@ var SubscriptionExpiredGuard = ({
|
|
|
45351
45268
|
allowContinue = false
|
|
45352
45269
|
}) => {
|
|
45353
45270
|
const { isExpiredTier, getFullEvaluation } = useFeatures();
|
|
45354
|
-
const [showModal, setShowModal] = (0,
|
|
45355
|
-
const [userDismissed, setUserDismissed] = (0,
|
|
45356
|
-
(0,
|
|
45271
|
+
const [showModal, setShowModal] = (0, import_react90.useState)(false);
|
|
45272
|
+
const [userDismissed, setUserDismissed] = (0, import_react90.useState)(false);
|
|
45273
|
+
(0, import_react90.useEffect)(() => {
|
|
45357
45274
|
if (isExpiredTier() && !userDismissed) {
|
|
45358
45275
|
setShowModal(true);
|
|
45359
45276
|
} else {
|
|
@@ -45508,26 +45425,11 @@ var showInfoNotification = (message, context) => {
|
|
|
45508
45425
|
};
|
|
45509
45426
|
|
|
45510
45427
|
// src/core/license-validator.ts
|
|
45511
|
-
var getNodeEnvironment = () => {
|
|
45512
|
-
const globalProcess = globalThis.process;
|
|
45513
|
-
return globalProcess?.env?.NODE_ENV;
|
|
45514
|
-
};
|
|
45515
45428
|
function validateSystemIntegrity() {
|
|
45516
|
-
|
|
45517
|
-
"BL-CORE-2025",
|
|
45518
|
-
"BANDIT-ENGINE-LICENSED",
|
|
45519
|
-
"BURTSON-VALIDATED-SYSTEM"
|
|
45520
|
-
];
|
|
45521
|
-
if (getNodeEnvironment() !== "production") {
|
|
45522
|
-
console.debug("System integrity check passed - Licensed to Burtson Labs");
|
|
45523
|
-
}
|
|
45524
|
-
return licenseMarkers.length > 0;
|
|
45429
|
+
return true;
|
|
45525
45430
|
}
|
|
45526
45431
|
var CORE_SYSTEM_TOKEN = "BL-SYSTEM-1751692562421";
|
|
45527
45432
|
function initializeCoreSystem() {
|
|
45528
|
-
if (!validateSystemIntegrity()) {
|
|
45529
|
-
throw new Error("System integrity check failed - Contact legal@burtson.ai");
|
|
45530
|
-
}
|
|
45531
45433
|
return CORE_SYSTEM_TOKEN;
|
|
45532
45434
|
}
|
|
45533
45435
|
|
|
@@ -45553,8 +45455,7 @@ function getSystemConstants() {
|
|
|
45553
45455
|
|
|
45554
45456
|
// src/utils/critical-helpers.ts
|
|
45555
45457
|
function validateEnvironment() {
|
|
45556
|
-
|
|
45557
|
-
return requiredKeys.every((key) => key.includes("BL") || key.includes("BURTSON"));
|
|
45458
|
+
return false;
|
|
45558
45459
|
}
|
|
45559
45460
|
function getCriticalConfig() {
|
|
45560
45461
|
return {
|