@burtson-labs/bandit-engine 2.0.62 → 2.0.64
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/dist/{chat-SN3UNX23.mjs → chat-IGKTUDME.mjs} +4 -4
- package/dist/{chunk-O7JGT7HR.mjs → chunk-DCZLPUMY.mjs} +5 -5
- package/dist/{chunk-SRCCNBHF.mjs → chunk-DPMJELHK.mjs} +2 -2
- package/dist/{chunk-Y4NDNAAR.mjs → chunk-DR4X32D3.mjs} +5 -4
- package/dist/chunk-DR4X32D3.mjs.map +1 -0
- package/dist/{chunk-5WQMMCZQ.mjs → chunk-FXFTA5PZ.mjs} +92 -295
- package/dist/chunk-FXFTA5PZ.mjs.map +1 -0
- package/dist/{chunk-PY7A3J5T.mjs → chunk-HKQSZALO.mjs} +2 -2
- package/dist/index.js +108 -312
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/management/management.js +183 -387
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +4 -4
- package/dist/modals/chat-modal/chat-modal.js +167 -368
- package/dist/modals/chat-modal/chat-modal.js.map +1 -1
- package/dist/modals/chat-modal/chat-modal.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-5WQMMCZQ.mjs.map +0 -1
- package/dist/chunk-Y4NDNAAR.mjs.map +0 -1
- /package/dist/{chat-SN3UNX23.mjs.map → chat-IGKTUDME.mjs.map} +0 -0
- /package/dist/{chunk-O7JGT7HR.mjs.map → chunk-DCZLPUMY.mjs.map} +0 -0
- /package/dist/{chunk-SRCCNBHF.mjs.map → chunk-DPMJELHK.mjs.map} +0 -0
- /package/dist/{chunk-PY7A3J5T.mjs.map → chunk-HKQSZALO.mjs.map} +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
management_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-DCZLPUMY.mjs";
|
|
4
|
+
import "../chunk-DPMJELHK.mjs";
|
|
5
5
|
import "../chunk-VTC6AIWY.mjs";
|
|
6
6
|
import "../chunk-6QTTNYF2.mjs";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-HKQSZALO.mjs";
|
|
8
|
+
import "../chunk-FXFTA5PZ.mjs";
|
|
9
9
|
import "../chunk-EUBVBTB3.mjs";
|
|
10
10
|
import "../chunk-IPMTNREZ.mjs";
|
|
11
11
|
import "../chunk-H3BYFEIE.mjs";
|
|
@@ -11509,7 +11509,6 @@ var import_rehype_raw = __toESM(require("rehype-raw"));
|
|
|
11509
11509
|
var import_rehype_sanitize2 = __toESM(require("rehype-sanitize"));
|
|
11510
11510
|
init_debugLogger();
|
|
11511
11511
|
var import_material8 = require("@mui/material");
|
|
11512
|
-
init_modelStore();
|
|
11513
11512
|
|
|
11514
11513
|
// src/modals/chat-modal/ai-response-action-bar.tsx
|
|
11515
11514
|
var import_react13 = require("react");
|
|
@@ -12409,99 +12408,9 @@ var AiResponseActionsBar = ({ text }) => {
|
|
|
12409
12408
|
};
|
|
12410
12409
|
var ai_response_action_bar_default = AiResponseActionsBar;
|
|
12411
12410
|
|
|
12412
|
-
// src/services/branding/brandingService.ts
|
|
12413
|
-
init_indexedDBService();
|
|
12414
|
-
init_debugLogger();
|
|
12415
|
-
var BrandingService = class {
|
|
12416
|
-
DB_NAME = "banditConfig";
|
|
12417
|
-
DB_VERSION = 1;
|
|
12418
|
-
STORE_NAME = "config";
|
|
12419
|
-
STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
|
|
12420
|
-
async getBranding() {
|
|
12421
|
-
try {
|
|
12422
|
-
const data = await indexedDBService_default.get(
|
|
12423
|
-
this.DB_NAME,
|
|
12424
|
-
this.DB_VERSION,
|
|
12425
|
-
this.STORE_NAME,
|
|
12426
|
-
"main",
|
|
12427
|
-
this.STORE_CONFIGS
|
|
12428
|
-
);
|
|
12429
|
-
if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
|
|
12430
|
-
return {
|
|
12431
|
-
logoBase64: data.branding.logoBase64,
|
|
12432
|
-
hasTransparentLogo: data.branding.hasTransparentLogo,
|
|
12433
|
-
brandingText: data.branding.brandingText
|
|
12434
|
-
};
|
|
12435
|
-
}
|
|
12436
|
-
return null;
|
|
12437
|
-
} catch (error) {
|
|
12438
|
-
throw error;
|
|
12439
|
-
}
|
|
12440
|
-
}
|
|
12441
|
-
async setBrandingFromConfig(config) {
|
|
12442
|
-
try {
|
|
12443
|
-
const existing = await indexedDBService_default.get(
|
|
12444
|
-
this.DB_NAME,
|
|
12445
|
-
this.DB_VERSION,
|
|
12446
|
-
this.STORE_NAME,
|
|
12447
|
-
"main",
|
|
12448
|
-
this.STORE_CONFIGS
|
|
12449
|
-
) || { id: "main" };
|
|
12450
|
-
if (existing.branding?.userSaved) {
|
|
12451
|
-
debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
|
|
12452
|
-
return;
|
|
12453
|
-
}
|
|
12454
|
-
const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
|
|
12455
|
-
if (hasUserBranding) {
|
|
12456
|
-
debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
|
|
12457
|
-
return;
|
|
12458
|
-
}
|
|
12459
|
-
debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
|
|
12460
|
-
const branding = config.branding || {};
|
|
12461
|
-
const updated = {
|
|
12462
|
-
...existing,
|
|
12463
|
-
branding: {
|
|
12464
|
-
...existing.branding,
|
|
12465
|
-
...branding
|
|
12466
|
-
}
|
|
12467
|
-
};
|
|
12468
|
-
await indexedDBService_default.put(
|
|
12469
|
-
this.DB_NAME,
|
|
12470
|
-
this.DB_VERSION,
|
|
12471
|
-
this.STORE_NAME,
|
|
12472
|
-
updated,
|
|
12473
|
-
this.STORE_CONFIGS
|
|
12474
|
-
);
|
|
12475
|
-
} catch (error) {
|
|
12476
|
-
throw error;
|
|
12477
|
-
}
|
|
12478
|
-
}
|
|
12479
|
-
};
|
|
12480
|
-
var brandingService = new BrandingService();
|
|
12481
|
-
var brandingService_default = brandingService;
|
|
12482
|
-
|
|
12483
12411
|
// src/modals/chat-modal/ai-response-text-field.tsx
|
|
12484
12412
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
12485
12413
|
var brainIcon = "https://cdn.burtson.ai/images/brain-icon.png";
|
|
12486
|
-
var avatarFilenames = {
|
|
12487
|
-
"Bandit-Core": "core-avatar.png",
|
|
12488
|
-
"Bandit-Muse": "muse-avatar.png",
|
|
12489
|
-
"Bandit-Logic": "logic-avatar.png",
|
|
12490
|
-
"Bandit-D1VA": "d1va-avatar.png",
|
|
12491
|
-
"Bandit-Exec": "exec-avatar.png",
|
|
12492
|
-
"default": "bandit-head.png"
|
|
12493
|
-
};
|
|
12494
|
-
var banditHead2 = `https://cdn.burtson.ai/images/bandit-head.png`;
|
|
12495
|
-
var resolveAvatar = (selectedModel) => {
|
|
12496
|
-
const model = useModelStore.getState().availableModels.find(
|
|
12497
|
-
(m) => m.name === selectedModel
|
|
12498
|
-
);
|
|
12499
|
-
if (model?.avatarBase64) {
|
|
12500
|
-
return model.avatarBase64;
|
|
12501
|
-
}
|
|
12502
|
-
const avatarFilename = avatarFilenames[selectedModel] || avatarFilenames["default"];
|
|
12503
|
-
return `https://cdn.burtson.ai/avatars/${avatarFilename}`;
|
|
12504
|
-
};
|
|
12505
12414
|
var normalizeTables = (markdown2) => {
|
|
12506
12415
|
const lines = markdown2.split("\n");
|
|
12507
12416
|
const output = [];
|
|
@@ -12847,15 +12756,6 @@ var AIResponseTextField = ({
|
|
|
12847
12756
|
const timeout3 = setTimeout(() => setShowMemoryUpdated(false), 3e3);
|
|
12848
12757
|
return () => clearTimeout(timeout3);
|
|
12849
12758
|
}, [memoryUpdated]);
|
|
12850
|
-
const selectedModel = useModelStore((state) => state.selectedModel);
|
|
12851
|
-
const [userAvatar, setUserAvatar] = (0, import_react14.useState)(banditHead2);
|
|
12852
|
-
(0, import_react14.useEffect)(() => {
|
|
12853
|
-
const fetchBranding = async () => {
|
|
12854
|
-
const branding = await brandingService_default.getBranding();
|
|
12855
|
-
setUserAvatar(branding?.logoBase64 || banditHead2);
|
|
12856
|
-
};
|
|
12857
|
-
fetchBranding();
|
|
12858
|
-
}, []);
|
|
12859
12759
|
const theme = (0, import_styles2.useTheme)();
|
|
12860
12760
|
const chatResponse = theme.palette.chat?.response;
|
|
12861
12761
|
const sanitizeMarkdown = (raw) => {
|
|
@@ -13224,283 +13124,109 @@ ${sourcesMarkdownList.join("\n")}`;
|
|
|
13224
13124
|
alignSelf: "stretch",
|
|
13225
13125
|
display: "flex",
|
|
13226
13126
|
flexDirection: "column",
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
userSelect: "text",
|
|
13232
|
-
border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
|
|
13233
|
-
boxShadow: "0 0 6px rgba(0,0,0,0.3)"
|
|
13127
|
+
color: chatResponse.aiText || theme.palette.text.primary,
|
|
13128
|
+
px: isMobile ? 0.5 : 2,
|
|
13129
|
+
py: 1,
|
|
13130
|
+
userSelect: "text"
|
|
13234
13131
|
},
|
|
13235
13132
|
children: [
|
|
13236
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13133
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", justifyContent: "flex-end", mb: 2.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { maxWidth: { xs: "100%", sm: "85%" }, minWidth: 0 }, children: [
|
|
13134
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13135
|
+
import_material8.Box,
|
|
13136
|
+
{
|
|
13137
|
+
sx: {
|
|
13138
|
+
bgcolor: chatResponse.userBubble || (0, import_styles2.alpha)(theme.palette.common.white, 0.07),
|
|
13139
|
+
borderRadius: "18px",
|
|
13140
|
+
px: 2,
|
|
13141
|
+
py: 1.25,
|
|
13142
|
+
wordBreak: "break-word",
|
|
13143
|
+
whiteSpace: "pre-wrap",
|
|
13144
|
+
overflowWrap: "break-word"
|
|
13245
13145
|
},
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
justifyContent: "flex-end"
|
|
13249
|
-
},
|
|
13250
|
-
children: [
|
|
13251
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13252
|
-
import_material8.Box,
|
|
13146
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13147
|
+
import_material8.Typography,
|
|
13253
13148
|
{
|
|
13254
13149
|
sx: {
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13150
|
+
color: theme.palette.text.primary,
|
|
13151
|
+
lineHeight: 1.5,
|
|
13152
|
+
wordBreak: "break-word",
|
|
13153
|
+
whiteSpace: "pre-wrap"
|
|
13258
13154
|
},
|
|
13259
|
-
children:
|
|
13260
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13261
|
-
import_material8.Avatar,
|
|
13262
|
-
{
|
|
13263
|
-
alt: "You",
|
|
13264
|
-
src: userAvatar,
|
|
13265
|
-
sx: {
|
|
13266
|
-
display: { xs: "none", sm: "flex" },
|
|
13267
|
-
width: { sm: 72 },
|
|
13268
|
-
height: { sm: 72 },
|
|
13269
|
-
bgcolor: chatResponse.userAvatarBackground || (theme.palette.mode === "dark" ? "transparent" : "#eee"),
|
|
13270
|
-
color: "#fff",
|
|
13271
|
-
fontWeight: "bold",
|
|
13272
|
-
fontSize: { sm: "1.1rem" },
|
|
13273
|
-
border: "2px solid #a78bfa",
|
|
13274
|
-
boxShadow: "0 0 8px rgba(167, 139, 250, 0.3)",
|
|
13275
|
-
transform: "scaleX(1)"
|
|
13276
|
-
}
|
|
13277
|
-
}
|
|
13278
|
-
),
|
|
13279
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13280
|
-
import_material8.Typography,
|
|
13281
|
-
{
|
|
13282
|
-
variant: "caption",
|
|
13283
|
-
sx: { color: chatResponse.modelLabel || "#888", mt: 1, fontStyle: "italic" },
|
|
13284
|
-
children: "You said"
|
|
13285
|
-
}
|
|
13286
|
-
)
|
|
13287
|
-
]
|
|
13155
|
+
children: question
|
|
13288
13156
|
}
|
|
13289
|
-
)
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
|
|
13297
|
-
|
|
13298
|
-
|
|
13299
|
-
|
|
13300
|
-
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
|
|
13304
|
-
|
|
13305
|
-
|
|
13306
|
-
overflowWrap: "break-word",
|
|
13307
|
-
mt: { xs: 0.5, sm: 0.25 }
|
|
13308
|
-
},
|
|
13309
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13310
|
-
import_material8.Typography,
|
|
13311
|
-
{
|
|
13312
|
-
sx: {
|
|
13313
|
-
color: chatResponse.userText || "#6C9AC5",
|
|
13314
|
-
fontStyle: "italic",
|
|
13315
|
-
wordBreak: "break-word",
|
|
13316
|
-
whiteSpace: "pre-wrap"
|
|
13317
|
-
},
|
|
13318
|
-
children: question
|
|
13319
|
-
}
|
|
13320
|
-
)
|
|
13321
|
-
}
|
|
13322
|
-
),
|
|
13323
|
-
images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13324
|
-
import_material8.Avatar,
|
|
13325
|
-
{
|
|
13326
|
-
src: img,
|
|
13327
|
-
variant: "rounded",
|
|
13328
|
-
onClick: () => setOpenImage(img),
|
|
13329
|
-
sx: {
|
|
13330
|
-
width: 64,
|
|
13331
|
-
height: 64,
|
|
13332
|
-
borderRadius: 2,
|
|
13333
|
-
cursor: "pointer",
|
|
13334
|
-
"&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
|
|
13335
|
-
}
|
|
13336
|
-
},
|
|
13337
|
-
i
|
|
13338
|
-
)) })
|
|
13339
|
-
] })
|
|
13340
|
-
]
|
|
13341
|
-
}
|
|
13342
|
-
),
|
|
13343
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { borderBottom: `1px solid ${theme.palette.divider}`, my: 2 } }),
|
|
13344
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13345
|
-
import_material8.Box,
|
|
13346
|
-
{
|
|
13347
|
-
sx: {
|
|
13348
|
-
display: "flex",
|
|
13349
|
-
flexDirection: "column",
|
|
13350
|
-
alignItems: {
|
|
13351
|
-
xs: "center",
|
|
13352
|
-
sm: "flex-start"
|
|
13353
|
-
},
|
|
13354
|
-
gap: 2,
|
|
13355
|
-
mb: 2
|
|
13157
|
+
)
|
|
13158
|
+
}
|
|
13159
|
+
),
|
|
13160
|
+
images && images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { display: "flex", gap: 1, mt: 1, flexWrap: "wrap", justifyContent: "flex-end" }, children: images.map((img, i) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13161
|
+
import_material8.Avatar,
|
|
13162
|
+
{
|
|
13163
|
+
src: img,
|
|
13164
|
+
variant: "rounded",
|
|
13165
|
+
onClick: () => setOpenImage(img),
|
|
13166
|
+
sx: {
|
|
13167
|
+
width: 96,
|
|
13168
|
+
height: 96,
|
|
13169
|
+
borderRadius: 2,
|
|
13170
|
+
border: `1px solid ${(0, import_styles2.alpha)(theme.palette.text.primary, 0.25)}`,
|
|
13171
|
+
cursor: "pointer",
|
|
13172
|
+
"&:hover": { boxShadow: `0 0 0 2px ${theme.palette.primary.main}` }
|
|
13173
|
+
}
|
|
13356
13174
|
},
|
|
13357
|
-
|
|
13358
|
-
|
|
13359
|
-
|
|
13360
|
-
|
|
13361
|
-
|
|
13362
|
-
|
|
13363
|
-
|
|
13364
|
-
|
|
13365
|
-
|
|
13366
|
-
|
|
13367
|
-
|
|
13368
|
-
|
|
13369
|
-
|
|
13370
|
-
|
|
13371
|
-
|
|
13372
|
-
|
|
13373
|
-
|
|
13374
|
-
|
|
13375
|
-
|
|
13376
|
-
|
|
13377
|
-
|
|
13378
|
-
|
|
13379
|
-
|
|
13380
|
-
|
|
13381
|
-
|
|
13382
|
-
|
|
13383
|
-
|
|
13384
|
-
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
" says"
|
|
13392
|
-
]
|
|
13393
|
-
}
|
|
13394
|
-
) })
|
|
13395
|
-
]
|
|
13396
|
-
}
|
|
13397
|
-
),
|
|
13398
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13399
|
-
import_material8.Box,
|
|
13400
|
-
{
|
|
13401
|
-
sx: {
|
|
13402
|
-
display: { xs: "flex", sm: "none" },
|
|
13403
|
-
justifyContent: "right",
|
|
13404
|
-
width: "100%",
|
|
13405
|
-
mt: -1,
|
|
13406
|
-
mb: 1
|
|
13407
|
-
},
|
|
13408
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13409
|
-
import_material8.Typography,
|
|
13410
|
-
{
|
|
13411
|
-
variant: "caption",
|
|
13412
|
-
sx: { fontStyle: "italic", color: chatResponse.modelLabel || "#888" },
|
|
13413
|
-
children: [
|
|
13414
|
-
selectedModel,
|
|
13415
|
-
" says"
|
|
13416
|
-
]
|
|
13417
|
-
}
|
|
13418
|
-
)
|
|
13419
|
-
}
|
|
13420
|
-
),
|
|
13421
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%" }, children: [
|
|
13422
|
-
cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13423
|
-
import_material8.Box,
|
|
13424
|
-
{
|
|
13425
|
-
sx: {
|
|
13426
|
-
position: "absolute",
|
|
13427
|
-
top: -24,
|
|
13428
|
-
left: 0,
|
|
13429
|
-
display: "flex",
|
|
13430
|
-
alignItems: "center",
|
|
13431
|
-
gap: 1,
|
|
13432
|
-
pl: 1,
|
|
13433
|
-
zIndex: 1
|
|
13434
|
-
},
|
|
13435
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
|
|
13436
|
-
}
|
|
13437
|
-
),
|
|
13438
|
-
showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13439
|
-
import_material8.Box,
|
|
13440
|
-
{
|
|
13441
|
-
sx: {
|
|
13442
|
-
position: "absolute",
|
|
13443
|
-
top: -24,
|
|
13444
|
-
right: 0,
|
|
13445
|
-
display: "flex",
|
|
13446
|
-
alignItems: "center",
|
|
13447
|
-
gap: 1,
|
|
13448
|
-
pr: 1,
|
|
13449
|
-
animation: "fadeOut 0.3s ease-in 2.7s forwards",
|
|
13450
|
-
zIndex: 1
|
|
13451
|
-
},
|
|
13452
|
-
children: [
|
|
13453
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13454
|
-
"img",
|
|
13455
|
-
{
|
|
13456
|
-
src: brainIcon,
|
|
13457
|
-
alt: "Memory",
|
|
13458
|
-
style: { width: 18, height: 18 }
|
|
13459
|
-
}
|
|
13460
|
-
),
|
|
13461
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13462
|
-
import_material8.Typography,
|
|
13463
|
-
{
|
|
13464
|
-
variant: "caption",
|
|
13465
|
-
sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
|
|
13466
|
-
children: "Bandit added to memory"
|
|
13467
|
-
}
|
|
13468
|
-
)
|
|
13469
|
-
]
|
|
13470
|
-
}
|
|
13471
|
-
),
|
|
13175
|
+
i
|
|
13176
|
+
)) })
|
|
13177
|
+
] }) }),
|
|
13178
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_material8.Box, { sx: { position: "relative", width: "100%", maxWidth: { xs: "100%", sm: "768px" } }, children: [
|
|
13179
|
+
cancelled && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13180
|
+
import_material8.Box,
|
|
13181
|
+
{
|
|
13182
|
+
sx: {
|
|
13183
|
+
position: "absolute",
|
|
13184
|
+
top: -22,
|
|
13185
|
+
left: 0,
|
|
13186
|
+
display: "flex",
|
|
13187
|
+
alignItems: "center",
|
|
13188
|
+
gap: 1,
|
|
13189
|
+
zIndex: 1
|
|
13190
|
+
},
|
|
13191
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { variant: "caption", sx: { fontStyle: "italic", opacity: 0.85 }, children: "Cancelled by you" })
|
|
13192
|
+
}
|
|
13193
|
+
),
|
|
13194
|
+
showMemoryUpdated && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
13195
|
+
import_material8.Box,
|
|
13196
|
+
{
|
|
13197
|
+
sx: {
|
|
13198
|
+
position: "absolute",
|
|
13199
|
+
top: -22,
|
|
13200
|
+
right: 0,
|
|
13201
|
+
display: "flex",
|
|
13202
|
+
alignItems: "center",
|
|
13203
|
+
gap: 1,
|
|
13204
|
+
animation: "fadeOut 0.3s ease-in 2.7s forwards",
|
|
13205
|
+
zIndex: 1
|
|
13206
|
+
},
|
|
13207
|
+
children: [
|
|
13208
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("img", { src: brainIcon, alt: "Memory", style: { width: 16, height: 16 } }),
|
|
13472
13209
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13473
|
-
import_material8.
|
|
13210
|
+
import_material8.Typography,
|
|
13474
13211
|
{
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13478
|
-
px: isMobile ? 1 : 1.5,
|
|
13479
|
-
// Reduced padding on mobile
|
|
13480
|
-
py: 1.25,
|
|
13481
|
-
width: "100%",
|
|
13482
|
-
maxWidth: isMobile ? "100%" : "768px",
|
|
13483
|
-
// Full width on mobile
|
|
13484
|
-
border: "1px solid " + (chatResponse.aiBorder || "#ccc"),
|
|
13485
|
-
wordBreak: "break-word",
|
|
13486
|
-
alignSelf: "flex-start",
|
|
13487
|
-
mt: { xs: 0.5, sm: 0.25 }
|
|
13488
|
-
},
|
|
13489
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13490
|
-
import_react_markdown.default,
|
|
13491
|
-
{
|
|
13492
|
-
remarkPlugins: [import_remark_gfm.default],
|
|
13493
|
-
rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
|
|
13494
|
-
components,
|
|
13495
|
-
children: enrichedMarkdown ?? sanitizeMarkdown(response)
|
|
13496
|
-
}
|
|
13497
|
-
) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
|
|
13212
|
+
variant: "caption",
|
|
13213
|
+
sx: { color: chatResponse.memoryText || "#2e7d32", fontStyle: "italic" },
|
|
13214
|
+
children: "Bandit added to memory"
|
|
13498
13215
|
}
|
|
13499
13216
|
)
|
|
13500
|
-
]
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13217
|
+
]
|
|
13218
|
+
}
|
|
13219
|
+
),
|
|
13220
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { width: "100%", maxWidth: "100%" }, children: typeof response === "string" ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
13221
|
+
import_react_markdown.default,
|
|
13222
|
+
{
|
|
13223
|
+
remarkPlugins: [import_remark_gfm.default],
|
|
13224
|
+
rehypePlugins: [import_rehype_raw.default, [import_rehype_sanitize2.default, markdownSanitizeSchema]],
|
|
13225
|
+
components,
|
|
13226
|
+
children: enrichedMarkdown ?? sanitizeMarkdown(response)
|
|
13227
|
+
}
|
|
13228
|
+
) : import_react14.default.isValidElement(response) ? response : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Typography, { color: "error", children: "\u26A0\uFE0F Invalid AI response" }) })
|
|
13229
|
+
] }),
|
|
13504
13230
|
!!(responseText || typeof response === "string" && response) && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ai_response_action_bar_default, { text: responseText || response }),
|
|
13505
13231
|
displaySourceFiles && displaySourceFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_material8.Box, { sx: { mt: 1.5, display: "flex", gap: 2, flexWrap: "wrap", justifyContent: "flex-start" }, children: displaySourceFiles.map((doc, idx) => {
|
|
13506
13232
|
debugLogger.debug("Rendering DocumentCard in AI response", {
|
|
@@ -18169,6 +17895,79 @@ var useNotificationService = () => {
|
|
|
18169
17895
|
|
|
18170
17896
|
// src/modals/chat-modal/chat-modal.tsx
|
|
18171
17897
|
init_aiProviderStore();
|
|
17898
|
+
|
|
17899
|
+
// src/services/branding/brandingService.ts
|
|
17900
|
+
init_indexedDBService();
|
|
17901
|
+
init_debugLogger();
|
|
17902
|
+
var BrandingService = class {
|
|
17903
|
+
DB_NAME = "banditConfig";
|
|
17904
|
+
DB_VERSION = 1;
|
|
17905
|
+
STORE_NAME = "config";
|
|
17906
|
+
STORE_CONFIGS = [{ name: "config", keyPath: "id" }];
|
|
17907
|
+
async getBranding() {
|
|
17908
|
+
try {
|
|
17909
|
+
const data = await indexedDBService_default.get(
|
|
17910
|
+
this.DB_NAME,
|
|
17911
|
+
this.DB_VERSION,
|
|
17912
|
+
this.STORE_NAME,
|
|
17913
|
+
"main",
|
|
17914
|
+
this.STORE_CONFIGS
|
|
17915
|
+
);
|
|
17916
|
+
if (data?.branding && (data.branding.logoBase64 || data.branding.hasTransparentLogo !== void 0 || data.branding.brandingText)) {
|
|
17917
|
+
return {
|
|
17918
|
+
logoBase64: data.branding.logoBase64,
|
|
17919
|
+
hasTransparentLogo: data.branding.hasTransparentLogo,
|
|
17920
|
+
brandingText: data.branding.brandingText
|
|
17921
|
+
};
|
|
17922
|
+
}
|
|
17923
|
+
return null;
|
|
17924
|
+
} catch (error) {
|
|
17925
|
+
throw error;
|
|
17926
|
+
}
|
|
17927
|
+
}
|
|
17928
|
+
async setBrandingFromConfig(config) {
|
|
17929
|
+
try {
|
|
17930
|
+
const existing = await indexedDBService_default.get(
|
|
17931
|
+
this.DB_NAME,
|
|
17932
|
+
this.DB_VERSION,
|
|
17933
|
+
this.STORE_NAME,
|
|
17934
|
+
"main",
|
|
17935
|
+
this.STORE_CONFIGS
|
|
17936
|
+
) || { id: "main" };
|
|
17937
|
+
if (existing.branding?.userSaved) {
|
|
17938
|
+
debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: User branding detected, blocking CDN config override");
|
|
17939
|
+
return;
|
|
17940
|
+
}
|
|
17941
|
+
const hasUserBranding = existing.branding && (existing.branding.logoBase64 || existing.branding.brandingText || existing.branding.theme || existing.branding.hasTransparentLogo !== void 0);
|
|
17942
|
+
if (hasUserBranding) {
|
|
17943
|
+
debugLogger.debug("\u{1F6E1}\uFE0F BrandingService: Detected user branding data, blocking CDN config override");
|
|
17944
|
+
return;
|
|
17945
|
+
}
|
|
17946
|
+
debugLogger.debug("\u{1F527} BrandingService: No user branding detected, applying CDN config");
|
|
17947
|
+
const branding = config.branding || {};
|
|
17948
|
+
const updated = {
|
|
17949
|
+
...existing,
|
|
17950
|
+
branding: {
|
|
17951
|
+
...existing.branding,
|
|
17952
|
+
...branding
|
|
17953
|
+
}
|
|
17954
|
+
};
|
|
17955
|
+
await indexedDBService_default.put(
|
|
17956
|
+
this.DB_NAME,
|
|
17957
|
+
this.DB_VERSION,
|
|
17958
|
+
this.STORE_NAME,
|
|
17959
|
+
updated,
|
|
17960
|
+
this.STORE_CONFIGS
|
|
17961
|
+
);
|
|
17962
|
+
} catch (error) {
|
|
17963
|
+
throw error;
|
|
17964
|
+
}
|
|
17965
|
+
}
|
|
17966
|
+
};
|
|
17967
|
+
var brandingService = new BrandingService();
|
|
17968
|
+
var brandingService_default = brandingService;
|
|
17969
|
+
|
|
17970
|
+
// src/modals/chat-modal/chat-modal.tsx
|
|
18172
17971
|
init_debugLogger();
|
|
18173
17972
|
|
|
18174
17973
|
// src/theme/banditTheme.ts
|
|
@@ -20540,7 +20339,7 @@ var FULL_SCREEN_THRESHOLD = 100;
|
|
|
20540
20339
|
var MIN_WINDOWED_HEIGHT = 400;
|
|
20541
20340
|
var MAX_WINDOWED_HEIGHT = 600;
|
|
20542
20341
|
var CDN_BASE = "https://cdn.burtson.ai/";
|
|
20543
|
-
var
|
|
20342
|
+
var banditHead2 = `${CDN_BASE}/images/bandit-head.png`;
|
|
20544
20343
|
var modelAvatars = {
|
|
20545
20344
|
"Bandit-Core": `${CDN_BASE}/avatars/core-avatar.png`,
|
|
20546
20345
|
"Bandit-Muse": `${CDN_BASE}/avatars/muse-avatar.png`,
|
|
@@ -20630,7 +20429,7 @@ var ChatModal = ({
|
|
|
20630
20429
|
const provider = useAIProviderStore((state) => state.provider);
|
|
20631
20430
|
const notificationService2 = useNotificationService();
|
|
20632
20431
|
const currentModel = availableModels.find((m) => m.name === selectedModel);
|
|
20633
|
-
const currentAvatar = currentModel?.avatarBase64 || modelAvatars[selectedModel] ||
|
|
20432
|
+
const currentAvatar = currentModel?.avatarBase64 || modelAvatars[selectedModel] || banditHead2;
|
|
20634
20433
|
const removeImage = (index) => {
|
|
20635
20434
|
setPastedImages((prev) => prev.filter((_, i) => i !== index));
|
|
20636
20435
|
};
|
|
@@ -20950,7 +20749,7 @@ var ChatModal = ({
|
|
|
20950
20749
|
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
20951
20750
|
import_material17.Avatar,
|
|
20952
20751
|
{
|
|
20953
|
-
src: model.avatarBase64 || modelAvatars[model.name] ||
|
|
20752
|
+
src: model.avatarBase64 || modelAvatars[model.name] || banditHead2,
|
|
20954
20753
|
alt: model.name,
|
|
20955
20754
|
sx: {
|
|
20956
20755
|
width: 28,
|