@burtson-labs/bandit-engine 2.0.49 → 2.0.50
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-647M6BRG.mjs → chat-CQWZOJH4.mjs} +3 -2
- package/dist/chunk-KHKWYHXD.mjs +482 -0
- package/dist/chunk-KHKWYHXD.mjs.map +1 -0
- package/dist/{chunk-7HXARU5R.mjs → chunk-Q2N7CCZI.mjs} +825 -1272
- package/dist/chunk-Q2N7CCZI.mjs.map +1 -0
- package/dist/{chunk-JCLL7AGP.mjs → chunk-ZTTGERUG.mjs} +2140 -572
- package/dist/chunk-ZTTGERUG.mjs.map +1 -0
- package/dist/cli.js +3 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.js +2150 -571
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/management/management.js +4838 -3259
- package/dist/management/management.js.map +1 -1
- package/dist/management/management.mjs +2 -1
- package/package.json +3 -3
- package/dist/chunk-7HXARU5R.mjs.map +0 -1
- package/dist/chunk-JCLL7AGP.mjs.map +0 -1
- /package/dist/{chat-647M6BRG.mjs.map → chat-CQWZOJH4.mjs.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -27622,7 +27622,7 @@ var init_under_review = __esm({
|
|
|
27622
27622
|
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("br", {}),
|
|
27623
27623
|
"For more info, please contact ",
|
|
27624
27624
|
" ",
|
|
27625
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("a", { href: "mailto:team@
|
|
27625
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("a", { href: "mailto:team@banditai.ai", style: { color: theme.palette.primary.main, fontWeight: 600 }, children: "team@banditai.ai" })
|
|
27626
27626
|
] })
|
|
27627
27627
|
]
|
|
27628
27628
|
}
|
|
@@ -28158,7 +28158,7 @@ var chat_exports = {};
|
|
|
28158
28158
|
__export(chat_exports, {
|
|
28159
28159
|
default: () => chat_default
|
|
28160
28160
|
});
|
|
28161
|
-
var import_react35, import_material27, import_react_router_dom3, import_jsx_runtime28, ChatContent, Chat, chat_default;
|
|
28161
|
+
var import_react35, import_material27, import_styles29, import_react_router_dom3, import_jsx_runtime28, ChatContent, Chat, chat_default;
|
|
28162
28162
|
var init_chat2 = __esm({
|
|
28163
28163
|
"src/chat/chat.tsx"() {
|
|
28164
28164
|
"use strict";
|
|
@@ -28166,6 +28166,7 @@ var init_chat2 = __esm({
|
|
|
28166
28166
|
init_custom_logo();
|
|
28167
28167
|
init_indexedDBService();
|
|
28168
28168
|
import_material27 = require("@mui/material");
|
|
28169
|
+
import_styles29 = require("@mui/material/styles");
|
|
28169
28170
|
init_aiQueryStore();
|
|
28170
28171
|
init_modelStore();
|
|
28171
28172
|
import_react_router_dom3 = require("react-router-dom");
|
|
@@ -28211,7 +28212,33 @@ var init_chat2 = __esm({
|
|
|
28211
28212
|
const [themeLoading, setThemeLoading] = (0, import_react35.useState)(true);
|
|
28212
28213
|
const token = authenticationService.getToken();
|
|
28213
28214
|
const claims = token ? authenticationService.parseJwtClaims(token) : null;
|
|
28214
|
-
const
|
|
28215
|
+
const baseTheme = themeMap_default[selectedTheme ?? "bandit-dark"] || banditDarkTheme;
|
|
28216
|
+
const banditTheme = (0, import_react35.useMemo)(() => {
|
|
28217
|
+
return (0, import_styles29.createTheme)(baseTheme, {
|
|
28218
|
+
components: {
|
|
28219
|
+
MuiInputBase: {
|
|
28220
|
+
styleOverrides: {
|
|
28221
|
+
input: {
|
|
28222
|
+
outline: "none",
|
|
28223
|
+
boxShadow: "none",
|
|
28224
|
+
"&:focus, &:focus-visible": {
|
|
28225
|
+
outline: "none",
|
|
28226
|
+
boxShadow: "none"
|
|
28227
|
+
}
|
|
28228
|
+
},
|
|
28229
|
+
inputMultiline: {
|
|
28230
|
+
outline: "none",
|
|
28231
|
+
boxShadow: "none",
|
|
28232
|
+
"&:focus, &:focus-visible": {
|
|
28233
|
+
outline: "none",
|
|
28234
|
+
boxShadow: "none"
|
|
28235
|
+
}
|
|
28236
|
+
}
|
|
28237
|
+
}
|
|
28238
|
+
}
|
|
28239
|
+
}
|
|
28240
|
+
});
|
|
28241
|
+
}, [baseTheme]);
|
|
28215
28242
|
const {
|
|
28216
28243
|
inputValue,
|
|
28217
28244
|
setInputValue,
|
|
@@ -29772,12 +29799,12 @@ var chat_provider_default = ChatProvider;
|
|
|
29772
29799
|
init_chat2();
|
|
29773
29800
|
|
|
29774
29801
|
// src/management/management.tsx
|
|
29775
|
-
var
|
|
29802
|
+
var import_react57 = require("react");
|
|
29776
29803
|
var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
|
|
29777
|
-
var
|
|
29804
|
+
var import_styles31 = require("@mui/material/styles");
|
|
29778
29805
|
init_useKnowledgeStore();
|
|
29779
29806
|
init_indexedDBService();
|
|
29780
|
-
var
|
|
29807
|
+
var import_material47 = require("@mui/material");
|
|
29781
29808
|
var import_FaceRetouchingNatural = __toESM(require("@mui/icons-material/FaceRetouchingNatural"));
|
|
29782
29809
|
var import_Brush = __toESM(require("@mui/icons-material/Brush"));
|
|
29783
29810
|
var import_MenuBook = __toESM(require("@mui/icons-material/MenuBook"));
|
|
@@ -32556,7 +32583,7 @@ var chat_modal_default = ChatModal;
|
|
|
32556
32583
|
var import_react44 = require("react");
|
|
32557
32584
|
var import_material36 = require("@mui/material");
|
|
32558
32585
|
var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"));
|
|
32559
|
-
var
|
|
32586
|
+
var import_styles30 = require("@mui/material/styles");
|
|
32560
32587
|
var import_AutoAwesome = __toESM(require("@mui/icons-material/AutoAwesome"));
|
|
32561
32588
|
var import_RocketLaunchOutlined = __toESM(require("@mui/icons-material/RocketLaunchOutlined"));
|
|
32562
32589
|
var import_ViewModuleOutlined = __toESM(require("@mui/icons-material/ViewModuleOutlined"));
|
|
@@ -32942,7 +32969,7 @@ var PersonalitiesTab = ({
|
|
|
32942
32969
|
restoreBanditModels,
|
|
32943
32970
|
showSnackbar
|
|
32944
32971
|
}) => {
|
|
32945
|
-
const theme = (0,
|
|
32972
|
+
const theme = (0, import_styles30.useTheme)();
|
|
32946
32973
|
const isMobile = (0, import_useMediaQuery.default)(theme.breakpoints.down("sm"));
|
|
32947
32974
|
const [personalityTabIndex, setPersonalityTabIndex] = (0, import_react44.useState)(0);
|
|
32948
32975
|
const sectionGap = isMobile ? 2 : 3;
|
|
@@ -36578,6 +36605,12 @@ var BrandingTab = ({
|
|
|
36578
36605
|
};
|
|
36579
36606
|
var BrandingTab_default = BrandingTab;
|
|
36580
36607
|
|
|
36608
|
+
// src/management/components/KnowledgeHubTab.tsx
|
|
36609
|
+
var import_react53 = require("react");
|
|
36610
|
+
var import_material43 = require("@mui/material");
|
|
36611
|
+
var import_Description5 = __toESM(require("@mui/icons-material/Description"));
|
|
36612
|
+
var import_AutoStories = __toESM(require("@mui/icons-material/AutoStories"));
|
|
36613
|
+
|
|
36581
36614
|
// src/management/components/KnowledgeTab.tsx
|
|
36582
36615
|
var import_react51 = require("react");
|
|
36583
36616
|
var import_uuid6 = require("uuid");
|
|
@@ -38300,165 +38333,1630 @@ var KnowledgeTab = ({
|
|
|
38300
38333
|
};
|
|
38301
38334
|
var KnowledgeTab_default = KnowledgeTab;
|
|
38302
38335
|
|
|
38303
|
-
// src/management/components/
|
|
38336
|
+
// src/management/components/SeedPacksTab.tsx
|
|
38304
38337
|
var import_react52 = require("react");
|
|
38305
38338
|
var import_material42 = require("@mui/material");
|
|
38306
|
-
var
|
|
38339
|
+
var import_Add2 = __toESM(require("@mui/icons-material/Add"));
|
|
38340
|
+
var import_Archive = __toESM(require("@mui/icons-material/Archive"));
|
|
38307
38341
|
var import_Delete6 = __toESM(require("@mui/icons-material/Delete"));
|
|
38308
|
-
var import_Refresh3 = __toESM(require("@mui/icons-material/Refresh"));
|
|
38309
|
-
var import_Warning = __toESM(require("@mui/icons-material/Warning"));
|
|
38310
|
-
var import_Info2 = __toESM(require("@mui/icons-material/Info"));
|
|
38311
|
-
var import_CleaningServices = __toESM(require("@mui/icons-material/CleaningServices"));
|
|
38312
38342
|
var import_Description4 = __toESM(require("@mui/icons-material/Description"));
|
|
38343
|
+
var import_Group2 = __toESM(require("@mui/icons-material/Group"));
|
|
38313
38344
|
var import_Person3 = __toESM(require("@mui/icons-material/Person"));
|
|
38314
|
-
var
|
|
38315
|
-
var
|
|
38316
|
-
var
|
|
38317
|
-
var
|
|
38318
|
-
var
|
|
38345
|
+
var import_Publish = __toESM(require("@mui/icons-material/Publish"));
|
|
38346
|
+
var import_Refresh3 = __toESM(require("@mui/icons-material/Refresh"));
|
|
38347
|
+
var import_Save2 = __toESM(require("@mui/icons-material/Save"));
|
|
38348
|
+
var import_Search4 = __toESM(require("@mui/icons-material/Search"));
|
|
38349
|
+
var import_UploadFile2 = __toESM(require("@mui/icons-material/UploadFile"));
|
|
38350
|
+
init_packageSettingsStore();
|
|
38351
|
+
init_authenticationStore();
|
|
38352
|
+
init_StreamingMarkdown();
|
|
38319
38353
|
init_debugLogger();
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38325
|
-
var
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38354
|
+
|
|
38355
|
+
// src/services/seedPacks/seedPackService.ts
|
|
38356
|
+
init_authenticationService();
|
|
38357
|
+
init_packageSettingsStore();
|
|
38358
|
+
init_debugLogger();
|
|
38359
|
+
var HttpResponseError2 = class extends Error {
|
|
38360
|
+
constructor(message, status, payload, code) {
|
|
38361
|
+
super(message);
|
|
38362
|
+
this.status = status;
|
|
38363
|
+
this.payload = payload;
|
|
38364
|
+
this.code = code;
|
|
38365
|
+
this.name = "HttpResponseError";
|
|
38366
|
+
}
|
|
38331
38367
|
};
|
|
38332
|
-
var
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38339
|
-
|
|
38368
|
+
var isRecord5 = (value) => typeof value === "object" && value !== null;
|
|
38369
|
+
var getString2 = (record, key) => {
|
|
38370
|
+
const value = record[key];
|
|
38371
|
+
return typeof value === "string" ? value : void 0;
|
|
38372
|
+
};
|
|
38373
|
+
var getNumber = (record, key) => {
|
|
38374
|
+
const value = record[key];
|
|
38375
|
+
if (typeof value === "number") {
|
|
38376
|
+
return value;
|
|
38377
|
+
}
|
|
38378
|
+
if (typeof value === "string") {
|
|
38379
|
+
const parsed = Number(value);
|
|
38380
|
+
if (!Number.isNaN(parsed)) {
|
|
38381
|
+
return parsed;
|
|
38340
38382
|
}
|
|
38383
|
+
}
|
|
38384
|
+
return void 0;
|
|
38385
|
+
};
|
|
38386
|
+
var getStringArray = (record, key) => {
|
|
38387
|
+
const value = record[key];
|
|
38388
|
+
if (Array.isArray(value)) {
|
|
38389
|
+
return value.filter((item) => typeof item === "string");
|
|
38390
|
+
}
|
|
38391
|
+
if (typeof value === "string") {
|
|
38392
|
+
return value.split(",").map((item) => item.trim()).filter((item) => item.length > 0);
|
|
38393
|
+
}
|
|
38394
|
+
return void 0;
|
|
38395
|
+
};
|
|
38396
|
+
var toSeedPackStatus = (value) => {
|
|
38397
|
+
if (value === "draft" || value === "published" || value === "archived") {
|
|
38398
|
+
return value;
|
|
38399
|
+
}
|
|
38400
|
+
return "draft";
|
|
38401
|
+
};
|
|
38402
|
+
var toSeedPackScope = (value) => {
|
|
38403
|
+
if (value === "team" || value === "user") {
|
|
38404
|
+
return value;
|
|
38405
|
+
}
|
|
38406
|
+
return void 0;
|
|
38407
|
+
};
|
|
38408
|
+
var normalizeSeedPack = (record) => {
|
|
38409
|
+
const sid = getString2(record, "sid") ?? getString2(record, "id") ?? "";
|
|
38410
|
+
return {
|
|
38411
|
+
sid,
|
|
38412
|
+
name: getString2(record, "name") ?? "Untitled Seed Pack",
|
|
38413
|
+
description: getString2(record, "description"),
|
|
38414
|
+
status: toSeedPackStatus(getString2(record, "status")),
|
|
38415
|
+
version: getNumber(record, "version"),
|
|
38416
|
+
contentType: getString2(record, "contentType") ?? "markdown",
|
|
38417
|
+
content: getString2(record, "content"),
|
|
38418
|
+
summary: getString2(record, "summary"),
|
|
38419
|
+
tags: getStringArray(record, "tags"),
|
|
38420
|
+
scopeType: toSeedPackScope(getString2(record, "scopeType")),
|
|
38421
|
+
scopeSid: getString2(record, "scopeSid"),
|
|
38422
|
+
createdBySid: getString2(record, "createdBySid"),
|
|
38423
|
+
updatedBySid: getString2(record, "updatedBySid"),
|
|
38424
|
+
publishedBySid: getString2(record, "publishedBySid"),
|
|
38425
|
+
createdAt: getString2(record, "createdAt"),
|
|
38426
|
+
updatedAt: getString2(record, "updatedAt"),
|
|
38427
|
+
publishedAt: getString2(record, "publishedAt")
|
|
38428
|
+
};
|
|
38429
|
+
};
|
|
38430
|
+
var extractSeedPack = (payload) => {
|
|
38431
|
+
if (!isRecord5(payload)) {
|
|
38432
|
+
return null;
|
|
38433
|
+
}
|
|
38434
|
+
const candidate = isRecord5(payload.seedPack) && payload.seedPack || isRecord5(payload.data) && payload.data || payload;
|
|
38435
|
+
if (!isRecord5(candidate)) {
|
|
38436
|
+
return null;
|
|
38437
|
+
}
|
|
38438
|
+
const pack = normalizeSeedPack(candidate);
|
|
38439
|
+
if (!pack.sid) {
|
|
38440
|
+
return null;
|
|
38441
|
+
}
|
|
38442
|
+
return pack;
|
|
38443
|
+
};
|
|
38444
|
+
var extractSeedPackList = (payload) => {
|
|
38445
|
+
if (Array.isArray(payload)) {
|
|
38446
|
+
return payload.map((item) => isRecord5(item) ? normalizeSeedPack(item) : null).filter((item) => Boolean(item?.sid));
|
|
38447
|
+
}
|
|
38448
|
+
if (!isRecord5(payload)) {
|
|
38449
|
+
return [];
|
|
38450
|
+
}
|
|
38451
|
+
const candidates = [
|
|
38452
|
+
payload.seedPacks,
|
|
38453
|
+
payload.items,
|
|
38454
|
+
payload.results,
|
|
38455
|
+
payload.data
|
|
38456
|
+
];
|
|
38457
|
+
const list = candidates.find(Array.isArray);
|
|
38458
|
+
if (!Array.isArray(list)) {
|
|
38459
|
+
return [];
|
|
38460
|
+
}
|
|
38461
|
+
return list.map((item) => isRecord5(item) ? normalizeSeedPack(item) : null).filter((item) => Boolean(item?.sid));
|
|
38462
|
+
};
|
|
38463
|
+
var buildUrl2 = (path) => {
|
|
38464
|
+
const base = usePackageSettingsStore.getState().settings?.gatewayApiUrl?.replace(/\/$/, "");
|
|
38465
|
+
if (!base) {
|
|
38466
|
+
throw new Error("Gateway API is not configured");
|
|
38467
|
+
}
|
|
38468
|
+
const normalized = path.startsWith("/") ? path : `/${path}`;
|
|
38469
|
+
return `${base}${normalized}`;
|
|
38470
|
+
};
|
|
38471
|
+
var buildHeaders2 = () => {
|
|
38472
|
+
const headers = {
|
|
38473
|
+
"Content-Type": "application/json"
|
|
38474
|
+
};
|
|
38475
|
+
const token = authenticationService.getToken();
|
|
38476
|
+
if (token) {
|
|
38477
|
+
headers.Authorization = `Bearer ${token}`;
|
|
38478
|
+
}
|
|
38479
|
+
return headers;
|
|
38480
|
+
};
|
|
38481
|
+
var handleJsonResponse2 = async (response, fallbackMessage) => {
|
|
38482
|
+
let data = null;
|
|
38483
|
+
try {
|
|
38484
|
+
data = await response.json();
|
|
38341
38485
|
} catch (error) {
|
|
38342
|
-
debugLogger.warn("
|
|
38486
|
+
debugLogger.warn("seedPackService: failed to parse JSON response", { error });
|
|
38343
38487
|
}
|
|
38344
|
-
|
|
38488
|
+
if (!response.ok) {
|
|
38489
|
+
const record = isRecord5(data) ? data : {};
|
|
38490
|
+
const message = getString2(record, "error") || getString2(record, "message") || getString2(record, "detail") || fallbackMessage;
|
|
38491
|
+
const code = getString2(record, "code") || getString2(record, "error_code");
|
|
38492
|
+
throw new HttpResponseError2(message, response.status, data, code);
|
|
38493
|
+
}
|
|
38494
|
+
return data;
|
|
38345
38495
|
};
|
|
38346
|
-
var
|
|
38347
|
-
const
|
|
38496
|
+
var buildDraftPayload = (draft) => {
|
|
38497
|
+
const payload = {
|
|
38498
|
+
name: draft.name,
|
|
38499
|
+
contentType: draft.contentType ?? "markdown"
|
|
38500
|
+
};
|
|
38501
|
+
if (draft.description !== void 0) {
|
|
38502
|
+
payload.description = draft.description;
|
|
38503
|
+
}
|
|
38504
|
+
if (draft.content !== void 0) {
|
|
38505
|
+
payload.content = draft.content;
|
|
38506
|
+
}
|
|
38507
|
+
if (draft.tags) {
|
|
38508
|
+
payload.tags = draft.tags;
|
|
38509
|
+
}
|
|
38510
|
+
return payload;
|
|
38511
|
+
};
|
|
38512
|
+
var listSeedPacks = async () => {
|
|
38513
|
+
const url = buildUrl2("/seed-packs");
|
|
38348
38514
|
try {
|
|
38349
|
-
|
|
38350
|
-
|
|
38351
|
-
|
|
38352
|
-
|
|
38353
|
-
|
|
38354
|
-
|
|
38355
|
-
}
|
|
38356
|
-
|
|
38515
|
+
const response = await fetch(url, { method: "GET", headers: buildHeaders2() });
|
|
38516
|
+
const payload = await handleJsonResponse2(response, "Failed to load seed packs");
|
|
38517
|
+
return extractSeedPackList(payload);
|
|
38518
|
+
} catch (error) {
|
|
38519
|
+
debugLogger.error("seedPackService: failed to list seed packs", {
|
|
38520
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38521
|
+
});
|
|
38522
|
+
throw error;
|
|
38523
|
+
}
|
|
38524
|
+
};
|
|
38525
|
+
var getSeedPack = async (sid) => {
|
|
38526
|
+
const url = buildUrl2(`/seed-packs/${encodeURIComponent(sid)}`);
|
|
38527
|
+
try {
|
|
38528
|
+
const response = await fetch(url, { method: "GET", headers: buildHeaders2() });
|
|
38529
|
+
const payload = await handleJsonResponse2(response, "Failed to load seed pack");
|
|
38530
|
+
const pack = extractSeedPack(payload);
|
|
38531
|
+
if (!pack) {
|
|
38532
|
+
throw new Error("Seed pack response was empty");
|
|
38357
38533
|
}
|
|
38358
|
-
|
|
38359
|
-
|
|
38360
|
-
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
|
|
38364
|
-
|
|
38365
|
-
|
|
38366
|
-
|
|
38367
|
-
|
|
38368
|
-
|
|
38369
|
-
|
|
38370
|
-
|
|
38371
|
-
|
|
38372
|
-
|
|
38534
|
+
return pack;
|
|
38535
|
+
} catch (error) {
|
|
38536
|
+
debugLogger.error("seedPackService: failed to load seed pack", {
|
|
38537
|
+
sid,
|
|
38538
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38539
|
+
});
|
|
38540
|
+
throw error;
|
|
38541
|
+
}
|
|
38542
|
+
};
|
|
38543
|
+
var createSeedPack = async (draft) => {
|
|
38544
|
+
const url = buildUrl2("/seed-packs");
|
|
38545
|
+
try {
|
|
38546
|
+
const response = await fetch(url, {
|
|
38547
|
+
method: "POST",
|
|
38548
|
+
headers: buildHeaders2(),
|
|
38549
|
+
body: JSON.stringify(buildDraftPayload(draft))
|
|
38550
|
+
});
|
|
38551
|
+
const payload = await handleJsonResponse2(response, "Failed to create seed pack");
|
|
38552
|
+
const pack = extractSeedPack(payload);
|
|
38553
|
+
if (!pack) {
|
|
38554
|
+
throw new Error("Seed pack response was empty");
|
|
38373
38555
|
}
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
size: chatSize.size,
|
|
38379
|
-
itemCount: chatSize.count,
|
|
38380
|
-
description: "Conversation history and messages",
|
|
38381
|
-
stores: foundConversationDb ? [`${foundConversationDb}.conversations`] : [],
|
|
38382
|
-
canClear: chatSize.count > 0,
|
|
38383
|
-
clearWarning: "This will permanently delete all your chat conversations and message history."
|
|
38556
|
+
return pack;
|
|
38557
|
+
} catch (error) {
|
|
38558
|
+
debugLogger.error("seedPackService: failed to create seed pack", {
|
|
38559
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38384
38560
|
});
|
|
38385
|
-
|
|
38386
|
-
|
|
38387
|
-
|
|
38388
|
-
|
|
38389
|
-
|
|
38561
|
+
throw error;
|
|
38562
|
+
}
|
|
38563
|
+
};
|
|
38564
|
+
var updateSeedPack = async (sid, draft) => {
|
|
38565
|
+
const url = buildUrl2(`/seed-packs/${encodeURIComponent(sid)}`);
|
|
38566
|
+
try {
|
|
38567
|
+
const response = await fetch(url, {
|
|
38568
|
+
method: "PUT",
|
|
38569
|
+
headers: buildHeaders2(),
|
|
38570
|
+
body: JSON.stringify(buildDraftPayload(draft))
|
|
38390
38571
|
});
|
|
38391
|
-
const
|
|
38392
|
-
|
|
38393
|
-
|
|
38394
|
-
|
|
38395
|
-
try {
|
|
38396
|
-
const result = await estimateStoreSize(dbName, "documents");
|
|
38397
|
-
debugLogger.info(`Knowledge database ${dbName} check result:`, {
|
|
38398
|
-
size: result.size,
|
|
38399
|
-
count: result.count,
|
|
38400
|
-
sizeFormatted: `${(result.size / 1024).toFixed(2)} KB`
|
|
38401
|
-
});
|
|
38402
|
-
if (result.count > 0) {
|
|
38403
|
-
knowledgeSize = result;
|
|
38404
|
-
foundKnowledgeDb = dbName;
|
|
38405
|
-
debugLogger.info(`Found knowledge documents in database: ${dbName}`, {
|
|
38406
|
-
totalSize: result.size,
|
|
38407
|
-
itemCount: result.count
|
|
38408
|
-
});
|
|
38409
|
-
break;
|
|
38410
|
-
}
|
|
38411
|
-
} catch (error) {
|
|
38412
|
-
debugLogger.warn(`Failed to check knowledge in ${dbName}`, { error });
|
|
38413
|
-
}
|
|
38572
|
+
const payload = await handleJsonResponse2(response, "Failed to update seed pack");
|
|
38573
|
+
const pack = extractSeedPack(payload);
|
|
38574
|
+
if (!pack) {
|
|
38575
|
+
throw new Error("Seed pack response was empty");
|
|
38414
38576
|
}
|
|
38415
|
-
|
|
38416
|
-
|
|
38417
|
-
|
|
38418
|
-
|
|
38419
|
-
|
|
38420
|
-
itemCount: knowledgeSize.count,
|
|
38421
|
-
description: "Uploaded documents and their embeddings",
|
|
38422
|
-
stores: foundKnowledgeDb ? [`${foundKnowledgeDb}.documents`] : [],
|
|
38423
|
-
canClear: knowledgeSize.count > 0,
|
|
38424
|
-
clearWarning: "This will remove all uploaded documents and their AI embeddings. You will need to re-upload documents."
|
|
38577
|
+
return pack;
|
|
38578
|
+
} catch (error) {
|
|
38579
|
+
debugLogger.error("seedPackService: failed to update seed pack", {
|
|
38580
|
+
sid,
|
|
38581
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38425
38582
|
});
|
|
38426
|
-
|
|
38427
|
-
|
|
38428
|
-
|
|
38429
|
-
|
|
38430
|
-
|
|
38431
|
-
|
|
38583
|
+
throw error;
|
|
38584
|
+
}
|
|
38585
|
+
};
|
|
38586
|
+
var publishSeedPack = async (sid) => {
|
|
38587
|
+
const url = buildUrl2(`/seed-packs/${encodeURIComponent(sid)}/publish`);
|
|
38588
|
+
try {
|
|
38589
|
+
const response = await fetch(url, { method: "POST", headers: buildHeaders2() });
|
|
38590
|
+
const payload = await handleJsonResponse2(response, "Failed to publish seed pack");
|
|
38591
|
+
const pack = extractSeedPack(payload);
|
|
38592
|
+
if (!pack) {
|
|
38593
|
+
throw new Error("Seed pack response was empty");
|
|
38594
|
+
}
|
|
38595
|
+
return pack;
|
|
38596
|
+
} catch (error) {
|
|
38597
|
+
debugLogger.error("seedPackService: failed to publish seed pack", {
|
|
38598
|
+
sid,
|
|
38599
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38432
38600
|
});
|
|
38433
|
-
|
|
38434
|
-
|
|
38435
|
-
|
|
38436
|
-
|
|
38437
|
-
|
|
38438
|
-
|
|
38439
|
-
|
|
38440
|
-
|
|
38441
|
-
|
|
38442
|
-
|
|
38443
|
-
|
|
38444
|
-
}
|
|
38445
|
-
} catch (error) {
|
|
38446
|
-
debugLogger.warn(`Failed to check memories in ${dbName}`, { error });
|
|
38447
|
-
}
|
|
38601
|
+
throw error;
|
|
38602
|
+
}
|
|
38603
|
+
};
|
|
38604
|
+
var archiveSeedPack = async (sid) => {
|
|
38605
|
+
const url = buildUrl2(`/seed-packs/${encodeURIComponent(sid)}/archive`);
|
|
38606
|
+
try {
|
|
38607
|
+
const response = await fetch(url, { method: "POST", headers: buildHeaders2() });
|
|
38608
|
+
const payload = await handleJsonResponse2(response, "Failed to archive seed pack");
|
|
38609
|
+
const pack = extractSeedPack(payload);
|
|
38610
|
+
if (!pack) {
|
|
38611
|
+
throw new Error("Seed pack response was empty");
|
|
38448
38612
|
}
|
|
38449
|
-
|
|
38450
|
-
|
|
38451
|
-
|
|
38452
|
-
|
|
38453
|
-
|
|
38454
|
-
itemCount: memorySize.count,
|
|
38455
|
-
description: "AI memory entries and learned patterns",
|
|
38456
|
-
stores: foundMemoryDb ? [`${foundMemoryDb}.memories`] : [],
|
|
38457
|
-
canClear: memorySize.count > 0,
|
|
38458
|
-
clearWarning: "This will delete all AI memory entries and learned conversation patterns."
|
|
38613
|
+
return pack;
|
|
38614
|
+
} catch (error) {
|
|
38615
|
+
debugLogger.error("seedPackService: failed to archive seed pack", {
|
|
38616
|
+
sid,
|
|
38617
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38459
38618
|
});
|
|
38460
|
-
|
|
38461
|
-
|
|
38619
|
+
throw error;
|
|
38620
|
+
}
|
|
38621
|
+
};
|
|
38622
|
+
|
|
38623
|
+
// src/management/components/SeedPacksTab.tsx
|
|
38624
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
38625
|
+
var parseTags = (value) => value.split(",").map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
38626
|
+
var normalizeTags = (tags) => (tags ?? []).map((tag) => tag.trim()).filter((tag) => tag.length > 0);
|
|
38627
|
+
var areArraysEqual = (a, b) => {
|
|
38628
|
+
if (a.length !== b.length) {
|
|
38629
|
+
return false;
|
|
38630
|
+
}
|
|
38631
|
+
return a.every((value, index) => value === b[index]);
|
|
38632
|
+
};
|
|
38633
|
+
var formatTimestamp = (value) => {
|
|
38634
|
+
if (!value) {
|
|
38635
|
+
return "Not set";
|
|
38636
|
+
}
|
|
38637
|
+
const parsed = Date.parse(value);
|
|
38638
|
+
if (Number.isNaN(parsed)) {
|
|
38639
|
+
return value;
|
|
38640
|
+
}
|
|
38641
|
+
return new Date(parsed).toLocaleString();
|
|
38642
|
+
};
|
|
38643
|
+
var formatFileSize3 = (bytes) => {
|
|
38644
|
+
if (bytes === 0) return "0 B";
|
|
38645
|
+
const k = 1024;
|
|
38646
|
+
const sizes = ["B", "KB", "MB", "GB"];
|
|
38647
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
38648
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(1)) + " " + sizes[i];
|
|
38649
|
+
};
|
|
38650
|
+
var getPreviewSnippet = (content) => {
|
|
38651
|
+
const trimmed = content.trim();
|
|
38652
|
+
if (!trimmed) {
|
|
38653
|
+
return "No preview available";
|
|
38654
|
+
}
|
|
38655
|
+
return trimmed.length > 120 ? `${trimmed.slice(0, 120)}...` : trimmed;
|
|
38656
|
+
};
|
|
38657
|
+
var mergeMarkdownFiles = (existing, incoming) => {
|
|
38658
|
+
const next = [...existing];
|
|
38659
|
+
incoming.forEach((file) => {
|
|
38660
|
+
const index = next.findIndex((item) => item.name === file.name);
|
|
38661
|
+
if (index >= 0) {
|
|
38662
|
+
next[index] = file;
|
|
38663
|
+
} else {
|
|
38664
|
+
next.push(file);
|
|
38665
|
+
}
|
|
38666
|
+
});
|
|
38667
|
+
return next;
|
|
38668
|
+
};
|
|
38669
|
+
var buildMarkdownContent = (files) => {
|
|
38670
|
+
return files.map((file) => file.content.trim()).filter((content) => content.length > 0).join("\n\n---\n\n");
|
|
38671
|
+
};
|
|
38672
|
+
var readMarkdownFiles = async (files) => {
|
|
38673
|
+
const list = Array.from(files);
|
|
38674
|
+
const markdownFiles = list.filter((file) => file.name.toLowerCase().endsWith(".md"));
|
|
38675
|
+
const imported = await Promise.all(
|
|
38676
|
+
markdownFiles.map(async (file) => ({
|
|
38677
|
+
id: `${file.name}-${file.lastModified}`,
|
|
38678
|
+
name: file.name,
|
|
38679
|
+
size: file.size,
|
|
38680
|
+
content: await file.text(),
|
|
38681
|
+
lastModified: file.lastModified
|
|
38682
|
+
}))
|
|
38683
|
+
);
|
|
38684
|
+
return { imported, skipped: list.length - markdownFiles.length };
|
|
38685
|
+
};
|
|
38686
|
+
var getStatusChip = (status) => {
|
|
38687
|
+
switch (status) {
|
|
38688
|
+
case "published":
|
|
38689
|
+
return { label: "Published", color: "success" };
|
|
38690
|
+
case "archived":
|
|
38691
|
+
return { label: "Archived", color: "default" };
|
|
38692
|
+
case "draft":
|
|
38693
|
+
default:
|
|
38694
|
+
return { label: "Draft", color: "warning" };
|
|
38695
|
+
}
|
|
38696
|
+
};
|
|
38697
|
+
var getSeedPackTimestamp = (pack) => {
|
|
38698
|
+
const candidate = pack.updatedAt ?? pack.publishedAt ?? pack.createdAt;
|
|
38699
|
+
if (!candidate) {
|
|
38700
|
+
return 0;
|
|
38701
|
+
}
|
|
38702
|
+
const parsed = Date.parse(candidate);
|
|
38703
|
+
return Number.isNaN(parsed) ? 0 : parsed;
|
|
38704
|
+
};
|
|
38705
|
+
var SeedPackFileCard = ({ file, onPreview, onRemove, isReadOnly }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38706
|
+
import_material42.Card,
|
|
38707
|
+
{
|
|
38708
|
+
sx: {
|
|
38709
|
+
position: "relative",
|
|
38710
|
+
height: { xs: 240, sm: 260, md: 280 },
|
|
38711
|
+
cursor: "pointer",
|
|
38712
|
+
transition: "all 0.3s ease-in-out",
|
|
38713
|
+
border: "1px solid",
|
|
38714
|
+
borderColor: "divider",
|
|
38715
|
+
bgcolor: "background.paper",
|
|
38716
|
+
display: "flex",
|
|
38717
|
+
flexDirection: "column",
|
|
38718
|
+
"&:hover": {
|
|
38719
|
+
boxShadow: 6,
|
|
38720
|
+
transform: "translateY(-2px)"
|
|
38721
|
+
}
|
|
38722
|
+
},
|
|
38723
|
+
onClick: onPreview,
|
|
38724
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
38725
|
+
import_material42.CardContent,
|
|
38726
|
+
{
|
|
38727
|
+
sx: {
|
|
38728
|
+
p: { xs: 1.5, sm: 2 },
|
|
38729
|
+
height: "100%",
|
|
38730
|
+
display: "flex",
|
|
38731
|
+
flexDirection: "column",
|
|
38732
|
+
overflow: "hidden"
|
|
38733
|
+
},
|
|
38734
|
+
children: [
|
|
38735
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
38736
|
+
import_material42.Box,
|
|
38737
|
+
{
|
|
38738
|
+
sx: {
|
|
38739
|
+
display: "flex",
|
|
38740
|
+
justifyContent: "space-between",
|
|
38741
|
+
alignItems: "flex-start",
|
|
38742
|
+
mb: 1,
|
|
38743
|
+
height: 32
|
|
38744
|
+
},
|
|
38745
|
+
children: [
|
|
38746
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Description4.default, { sx: { fontSize: 32, color: "#388e3c", flexShrink: 0 } }),
|
|
38747
|
+
!isReadOnly && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38748
|
+
import_material42.IconButton,
|
|
38749
|
+
{
|
|
38750
|
+
size: "small",
|
|
38751
|
+
color: "error",
|
|
38752
|
+
onClick: (event) => {
|
|
38753
|
+
event.stopPropagation();
|
|
38754
|
+
onRemove();
|
|
38755
|
+
},
|
|
38756
|
+
sx: { width: 24, height: 24 },
|
|
38757
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Delete6.default, { fontSize: "small" })
|
|
38758
|
+
}
|
|
38759
|
+
)
|
|
38760
|
+
]
|
|
38761
|
+
}
|
|
38762
|
+
),
|
|
38763
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38764
|
+
import_material42.Box,
|
|
38765
|
+
{
|
|
38766
|
+
sx: {
|
|
38767
|
+
mb: 1.5,
|
|
38768
|
+
p: { xs: 1, sm: 1.5 },
|
|
38769
|
+
borderRadius: 1.5,
|
|
38770
|
+
bgcolor: "background.paper",
|
|
38771
|
+
border: "1px solid",
|
|
38772
|
+
borderColor: "divider",
|
|
38773
|
+
overflow: "hidden",
|
|
38774
|
+
position: "relative",
|
|
38775
|
+
height: { xs: 60, sm: 70, md: 80 },
|
|
38776
|
+
display: "flex",
|
|
38777
|
+
alignItems: "center"
|
|
38778
|
+
},
|
|
38779
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38780
|
+
import_material42.Typography,
|
|
38781
|
+
{
|
|
38782
|
+
variant: "body2",
|
|
38783
|
+
sx: {
|
|
38784
|
+
display: "-webkit-box",
|
|
38785
|
+
WebkitLineClamp: 3,
|
|
38786
|
+
WebkitBoxOrient: "vertical",
|
|
38787
|
+
overflow: "hidden",
|
|
38788
|
+
textOverflow: "ellipsis",
|
|
38789
|
+
color: "text.secondary",
|
|
38790
|
+
lineHeight: 1.3,
|
|
38791
|
+
fontSize: "0.8rem"
|
|
38792
|
+
},
|
|
38793
|
+
children: getPreviewSnippet(file.content)
|
|
38794
|
+
}
|
|
38795
|
+
)
|
|
38796
|
+
}
|
|
38797
|
+
),
|
|
38798
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Tooltip, { title: file.name, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38799
|
+
import_material42.Typography,
|
|
38800
|
+
{
|
|
38801
|
+
variant: "body2",
|
|
38802
|
+
sx: {
|
|
38803
|
+
fontWeight: 600,
|
|
38804
|
+
whiteSpace: "nowrap",
|
|
38805
|
+
overflow: "hidden",
|
|
38806
|
+
textOverflow: "ellipsis",
|
|
38807
|
+
mb: 1,
|
|
38808
|
+
color: "text.primary",
|
|
38809
|
+
fontSize: { xs: "0.8rem", sm: "0.875rem" },
|
|
38810
|
+
height: { xs: "1.2rem", sm: "1.3rem" }
|
|
38811
|
+
},
|
|
38812
|
+
children: file.name
|
|
38813
|
+
}
|
|
38814
|
+
) }),
|
|
38815
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
38816
|
+
import_material42.Box,
|
|
38817
|
+
{
|
|
38818
|
+
sx: {
|
|
38819
|
+
display: "flex",
|
|
38820
|
+
justifyContent: "space-between",
|
|
38821
|
+
alignItems: "flex-start",
|
|
38822
|
+
mb: 1,
|
|
38823
|
+
minHeight: 40
|
|
38824
|
+
},
|
|
38825
|
+
children: [
|
|
38826
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", flex: 1, mr: 1 }, children: [
|
|
38827
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38828
|
+
import_material42.Chip,
|
|
38829
|
+
{
|
|
38830
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Person3.default, { sx: { fontSize: "0.9rem !important" } }),
|
|
38831
|
+
label: "Local",
|
|
38832
|
+
size: "small",
|
|
38833
|
+
sx: {
|
|
38834
|
+
bgcolor: "#388e3c20",
|
|
38835
|
+
color: "#388e3c",
|
|
38836
|
+
fontWeight: 700,
|
|
38837
|
+
fontSize: "0.75rem",
|
|
38838
|
+
border: "2px solid #388e3c60",
|
|
38839
|
+
"& .MuiChip-icon": {
|
|
38840
|
+
color: "#388e3c !important"
|
|
38841
|
+
},
|
|
38842
|
+
boxShadow: "0 2px 4px #388e3c20"
|
|
38843
|
+
}
|
|
38844
|
+
}
|
|
38845
|
+
),
|
|
38846
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38847
|
+
import_material42.Chip,
|
|
38848
|
+
{
|
|
38849
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Description4.default, { sx: { fontSize: "0.85rem !important" } }),
|
|
38850
|
+
label: "Markdown",
|
|
38851
|
+
size: "small",
|
|
38852
|
+
sx: {
|
|
38853
|
+
bgcolor: "#388e3c15",
|
|
38854
|
+
color: "#388e3c",
|
|
38855
|
+
fontWeight: 500,
|
|
38856
|
+
fontSize: "0.65rem"
|
|
38857
|
+
}
|
|
38858
|
+
}
|
|
38859
|
+
)
|
|
38860
|
+
] }),
|
|
38861
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "caption", color: "text.secondary", sx: { flexShrink: 0 }, children: formatFileSize3(file.size) })
|
|
38862
|
+
]
|
|
38863
|
+
}
|
|
38864
|
+
),
|
|
38865
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Box, { sx: { mt: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
38866
|
+
import_material42.Button,
|
|
38867
|
+
{
|
|
38868
|
+
variant: "outlined",
|
|
38869
|
+
size: "small",
|
|
38870
|
+
fullWidth: true,
|
|
38871
|
+
sx: {
|
|
38872
|
+
textTransform: "none",
|
|
38873
|
+
height: { xs: 32, sm: 36, md: 40 },
|
|
38874
|
+
flexShrink: 0,
|
|
38875
|
+
borderWidth: 2,
|
|
38876
|
+
fontSize: { xs: "0.75rem", sm: "0.8rem", md: "0.875rem" },
|
|
38877
|
+
fontWeight: 600,
|
|
38878
|
+
"&:hover": {
|
|
38879
|
+
borderWidth: 2,
|
|
38880
|
+
bgcolor: "primary.main",
|
|
38881
|
+
color: "primary.contrastText",
|
|
38882
|
+
transform: "translateY(-1px)",
|
|
38883
|
+
boxShadow: 2
|
|
38884
|
+
}
|
|
38885
|
+
},
|
|
38886
|
+
onClick: (event) => {
|
|
38887
|
+
event.stopPropagation();
|
|
38888
|
+
onPreview();
|
|
38889
|
+
},
|
|
38890
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Search4.default, { sx: { fontSize: { xs: "1rem", sm: "1.1rem" } } }),
|
|
38891
|
+
children: "Preview"
|
|
38892
|
+
}
|
|
38893
|
+
) })
|
|
38894
|
+
]
|
|
38895
|
+
}
|
|
38896
|
+
)
|
|
38897
|
+
}
|
|
38898
|
+
);
|
|
38899
|
+
var SeedPacksTab = () => {
|
|
38900
|
+
const { settings } = usePackageSettingsStore();
|
|
38901
|
+
const authStore = useAuthenticationStore();
|
|
38902
|
+
const gatewayConfigured = Boolean(settings?.gatewayApiUrl);
|
|
38903
|
+
const isTeamScope = Boolean(authStore.user?.teamSid);
|
|
38904
|
+
const seedPackAdminRoles = /* @__PURE__ */ new Set(["admin", "super-user", "team_admin", "team_owner"]);
|
|
38905
|
+
const userRoles = authStore.user?.roles ?? [];
|
|
38906
|
+
const canManage = userRoles.some((role) => seedPackAdminRoles.has(role));
|
|
38907
|
+
const [seedPacks, setSeedPacks] = (0, import_react52.useState)([]);
|
|
38908
|
+
const [selectedSid, setSelectedSid] = (0, import_react52.useState)(null);
|
|
38909
|
+
const [selectedSeedPack, setSelectedSeedPack] = (0, import_react52.useState)(null);
|
|
38910
|
+
const [draft, setDraft] = (0, import_react52.useState)({
|
|
38911
|
+
name: "",
|
|
38912
|
+
description: "",
|
|
38913
|
+
content: ""
|
|
38914
|
+
});
|
|
38915
|
+
const [tagsInput, setTagsInput] = (0, import_react52.useState)("");
|
|
38916
|
+
const [importedFiles, setImportedFiles] = (0, import_react52.useState)([]);
|
|
38917
|
+
const [createImportedFiles, setCreateImportedFiles] = (0, import_react52.useState)([]);
|
|
38918
|
+
const [previewFile, setPreviewFile] = (0, import_react52.useState)(null);
|
|
38919
|
+
const fileInputRef = (0, import_react52.useRef)(null);
|
|
38920
|
+
const createFileInputRef = (0, import_react52.useRef)(null);
|
|
38921
|
+
const [isLoadingList, setIsLoadingList] = (0, import_react52.useState)(false);
|
|
38922
|
+
const [isLoadingDetail, setIsLoadingDetail] = (0, import_react52.useState)(false);
|
|
38923
|
+
const [isSaving, setIsSaving] = (0, import_react52.useState)(false);
|
|
38924
|
+
const [isPublishing, setIsPublishing] = (0, import_react52.useState)(false);
|
|
38925
|
+
const [isArchiving, setIsArchiving] = (0, import_react52.useState)(false);
|
|
38926
|
+
const [isCreating, setIsCreating] = (0, import_react52.useState)(false);
|
|
38927
|
+
const [createDialogOpen, setCreateDialogOpen] = (0, import_react52.useState)(false);
|
|
38928
|
+
const [publishDialogOpen, setPublishDialogOpen] = (0, import_react52.useState)(false);
|
|
38929
|
+
const [archiveDialogOpen, setArchiveDialogOpen] = (0, import_react52.useState)(false);
|
|
38930
|
+
const [newPackName, setNewPackName] = (0, import_react52.useState)("");
|
|
38931
|
+
const [newPackDescription, setNewPackDescription] = (0, import_react52.useState)("");
|
|
38932
|
+
const [newPackTags, setNewPackTags] = (0, import_react52.useState)("");
|
|
38933
|
+
const [snackbarOpen, setSnackbarOpen] = (0, import_react52.useState)(false);
|
|
38934
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react52.useState)("");
|
|
38935
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react52.useState)("success");
|
|
38936
|
+
const parsedTags = (0, import_react52.useMemo)(() => parseTags(tagsInput), [tagsInput]);
|
|
38937
|
+
const normalizedSelectedTags = (0, import_react52.useMemo)(
|
|
38938
|
+
() => normalizeTags(selectedSeedPack?.tags),
|
|
38939
|
+
[selectedSeedPack?.tags]
|
|
38940
|
+
);
|
|
38941
|
+
const isDirty = (0, import_react52.useMemo)(() => {
|
|
38942
|
+
if (!selectedSeedPack) {
|
|
38943
|
+
return false;
|
|
38944
|
+
}
|
|
38945
|
+
const nameChanged = draft.name.trim() !== (selectedSeedPack.name ?? "").trim();
|
|
38946
|
+
const descriptionChanged = draft.description.trim() !== (selectedSeedPack.description ?? "").trim();
|
|
38947
|
+
const contentChanged = draft.content !== (selectedSeedPack.content ?? "");
|
|
38948
|
+
const tagsChanged = !areArraysEqual(parsedTags, normalizedSelectedTags);
|
|
38949
|
+
return nameChanged || descriptionChanged || contentChanged || tagsChanged;
|
|
38950
|
+
}, [draft, parsedTags, normalizedSelectedTags, selectedSeedPack]);
|
|
38951
|
+
const isReadOnly = !canManage || selectedSeedPack?.status === "archived";
|
|
38952
|
+
const sortedSeedPacks = (0, import_react52.useMemo)(() => {
|
|
38953
|
+
return [...seedPacks].sort((a, b) => getSeedPackTimestamp(b) - getSeedPackTimestamp(a));
|
|
38954
|
+
}, [seedPacks]);
|
|
38955
|
+
const scopeLabel = isTeamScope ? "Team scope" : "Personal scope";
|
|
38956
|
+
const scopeDescription = isTeamScope ? "Applies to all members of your team." : "Applies only to your account.";
|
|
38957
|
+
const showSnackbar = (0, import_react52.useCallback)((message, severity) => {
|
|
38958
|
+
setSnackbarMessage(message);
|
|
38959
|
+
setSnackbarSeverity(severity);
|
|
38960
|
+
setSnackbarOpen(true);
|
|
38961
|
+
}, []);
|
|
38962
|
+
const hydrateDraft = (0, import_react52.useCallback)((pack) => {
|
|
38963
|
+
setDraft({
|
|
38964
|
+
name: pack.name ?? "",
|
|
38965
|
+
description: pack.description ?? "",
|
|
38966
|
+
content: pack.content ?? ""
|
|
38967
|
+
});
|
|
38968
|
+
setTagsInput((pack.tags ?? []).join(", "));
|
|
38969
|
+
setImportedFiles([]);
|
|
38970
|
+
setPreviewFile(null);
|
|
38971
|
+
}, []);
|
|
38972
|
+
const resetCreateDialog = (0, import_react52.useCallback)(() => {
|
|
38973
|
+
setCreateDialogOpen(false);
|
|
38974
|
+
setNewPackName("");
|
|
38975
|
+
setNewPackDescription("");
|
|
38976
|
+
setNewPackTags("");
|
|
38977
|
+
setCreateImportedFiles([]);
|
|
38978
|
+
}, []);
|
|
38979
|
+
const refreshSeedPacks = (0, import_react52.useCallback)(
|
|
38980
|
+
async (nextSelectedSid) => {
|
|
38981
|
+
if (!gatewayConfigured) {
|
|
38982
|
+
return;
|
|
38983
|
+
}
|
|
38984
|
+
setIsLoadingList(true);
|
|
38985
|
+
try {
|
|
38986
|
+
const packs = await listSeedPacks();
|
|
38987
|
+
setSeedPacks(packs);
|
|
38988
|
+
const activeSid = nextSelectedSid ?? selectedSid;
|
|
38989
|
+
if (activeSid && !packs.some((pack) => pack.sid === activeSid)) {
|
|
38990
|
+
setSelectedSid(null);
|
|
38991
|
+
setSelectedSeedPack(null);
|
|
38992
|
+
}
|
|
38993
|
+
} catch (error) {
|
|
38994
|
+
showSnackbar("Failed to load seed packs.", "error");
|
|
38995
|
+
debugLogger.error("SeedPacksTab: failed to load seed packs", {
|
|
38996
|
+
error: error instanceof Error ? error.message : String(error)
|
|
38997
|
+
});
|
|
38998
|
+
} finally {
|
|
38999
|
+
setIsLoadingList(false);
|
|
39000
|
+
}
|
|
39001
|
+
},
|
|
39002
|
+
[gatewayConfigured, selectedSid, showSnackbar]
|
|
39003
|
+
);
|
|
39004
|
+
const loadSeedPackDetail = (0, import_react52.useCallback)(
|
|
39005
|
+
async (sid) => {
|
|
39006
|
+
if (!gatewayConfigured) {
|
|
39007
|
+
return;
|
|
39008
|
+
}
|
|
39009
|
+
setIsLoadingDetail(true);
|
|
39010
|
+
try {
|
|
39011
|
+
const pack = await getSeedPack(sid);
|
|
39012
|
+
setSelectedSeedPack(pack);
|
|
39013
|
+
hydrateDraft(pack);
|
|
39014
|
+
} catch (error) {
|
|
39015
|
+
showSnackbar("Failed to load seed pack details.", "error");
|
|
39016
|
+
debugLogger.error("SeedPacksTab: failed to load seed pack details", {
|
|
39017
|
+
sid,
|
|
39018
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39019
|
+
});
|
|
39020
|
+
} finally {
|
|
39021
|
+
setIsLoadingDetail(false);
|
|
39022
|
+
}
|
|
39023
|
+
},
|
|
39024
|
+
[gatewayConfigured, hydrateDraft, showSnackbar]
|
|
39025
|
+
);
|
|
39026
|
+
(0, import_react52.useEffect)(() => {
|
|
39027
|
+
void refreshSeedPacks();
|
|
39028
|
+
}, [refreshSeedPacks, authStore.token]);
|
|
39029
|
+
(0, import_react52.useEffect)(() => {
|
|
39030
|
+
if (selectedSid) {
|
|
39031
|
+
void loadSeedPackDetail(selectedSid);
|
|
39032
|
+
}
|
|
39033
|
+
}, [selectedSid, loadSeedPackDetail]);
|
|
39034
|
+
const handleSelectPack = (pack) => {
|
|
39035
|
+
setSelectedSid(pack.sid);
|
|
39036
|
+
setSelectedSeedPack(pack);
|
|
39037
|
+
hydrateDraft(pack);
|
|
39038
|
+
};
|
|
39039
|
+
const handleImportFiles = (0, import_react52.useCallback)(
|
|
39040
|
+
async (files) => {
|
|
39041
|
+
if (!files || files.length === 0) {
|
|
39042
|
+
return;
|
|
39043
|
+
}
|
|
39044
|
+
const { imported, skipped } = await readMarkdownFiles(files);
|
|
39045
|
+
if (skipped > 0) {
|
|
39046
|
+
showSnackbar("Only .md files are supported for seed packs.", "error");
|
|
39047
|
+
}
|
|
39048
|
+
if (imported.length === 0) {
|
|
39049
|
+
return;
|
|
39050
|
+
}
|
|
39051
|
+
try {
|
|
39052
|
+
const newlyAdded = imported.filter(
|
|
39053
|
+
(file) => !importedFiles.some((existing) => existing.name === file.name)
|
|
39054
|
+
);
|
|
39055
|
+
setImportedFiles((prev) => mergeMarkdownFiles(prev, imported));
|
|
39056
|
+
const combined = buildMarkdownContent(newlyAdded);
|
|
39057
|
+
if (combined.length > 0) {
|
|
39058
|
+
setDraft((prev) => {
|
|
39059
|
+
const current = prev.content.trim();
|
|
39060
|
+
const nextContent = current ? `${current}
|
|
39061
|
+
|
|
39062
|
+
---
|
|
39063
|
+
|
|
39064
|
+
${combined}` : combined;
|
|
39065
|
+
return { ...prev, content: nextContent };
|
|
39066
|
+
});
|
|
39067
|
+
}
|
|
39068
|
+
showSnackbar(
|
|
39069
|
+
`Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} into the editor.`,
|
|
39070
|
+
"success"
|
|
39071
|
+
);
|
|
39072
|
+
} catch (error) {
|
|
39073
|
+
showSnackbar("Failed to import markdown files.", "error");
|
|
39074
|
+
debugLogger.error("SeedPacksTab: failed to import markdown files", {
|
|
39075
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39076
|
+
});
|
|
39077
|
+
}
|
|
39078
|
+
},
|
|
39079
|
+
[importedFiles, showSnackbar]
|
|
39080
|
+
);
|
|
39081
|
+
const handleFileInputChange = (0, import_react52.useCallback)(
|
|
39082
|
+
async (event) => {
|
|
39083
|
+
await handleImportFiles(event.target.files);
|
|
39084
|
+
event.target.value = "";
|
|
39085
|
+
},
|
|
39086
|
+
[handleImportFiles]
|
|
39087
|
+
);
|
|
39088
|
+
const handleRemoveImportedFile = (0, import_react52.useCallback)((id) => {
|
|
39089
|
+
setImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
39090
|
+
}, []);
|
|
39091
|
+
const handleCreateImportFiles = (0, import_react52.useCallback)(
|
|
39092
|
+
async (files) => {
|
|
39093
|
+
if (!files || files.length === 0) {
|
|
39094
|
+
return;
|
|
39095
|
+
}
|
|
39096
|
+
const { imported, skipped } = await readMarkdownFiles(files);
|
|
39097
|
+
if (skipped > 0) {
|
|
39098
|
+
showSnackbar("Only .md files are supported for seed packs.", "error");
|
|
39099
|
+
}
|
|
39100
|
+
if (imported.length === 0) {
|
|
39101
|
+
return;
|
|
39102
|
+
}
|
|
39103
|
+
setCreateImportedFiles((prev) => mergeMarkdownFiles(prev, imported));
|
|
39104
|
+
showSnackbar(
|
|
39105
|
+
`Imported ${imported.length} markdown file${imported.length === 1 ? "" : "s"} for this seed pack.`,
|
|
39106
|
+
"success"
|
|
39107
|
+
);
|
|
39108
|
+
},
|
|
39109
|
+
[showSnackbar]
|
|
39110
|
+
);
|
|
39111
|
+
const handleCreateFileInputChange = (0, import_react52.useCallback)(
|
|
39112
|
+
async (event) => {
|
|
39113
|
+
await handleCreateImportFiles(event.target.files);
|
|
39114
|
+
event.target.value = "";
|
|
39115
|
+
},
|
|
39116
|
+
[handleCreateImportFiles]
|
|
39117
|
+
);
|
|
39118
|
+
const handleRemoveCreateImportedFile = (0, import_react52.useCallback)((id) => {
|
|
39119
|
+
setCreateImportedFiles((prev) => prev.filter((file) => file.id !== id));
|
|
39120
|
+
}, []);
|
|
39121
|
+
const buildDraftPayload2 = (0, import_react52.useCallback)(() => {
|
|
39122
|
+
const name = draft.name.trim();
|
|
39123
|
+
if (!name) {
|
|
39124
|
+
showSnackbar("Seed pack name is required.", "error");
|
|
39125
|
+
return null;
|
|
39126
|
+
}
|
|
39127
|
+
return {
|
|
39128
|
+
name,
|
|
39129
|
+
description: draft.description.trim(),
|
|
39130
|
+
content: draft.content,
|
|
39131
|
+
tags: parsedTags,
|
|
39132
|
+
contentType: "markdown"
|
|
39133
|
+
};
|
|
39134
|
+
}, [draft, parsedTags, showSnackbar]);
|
|
39135
|
+
const saveDraft = (0, import_react52.useCallback)(async () => {
|
|
39136
|
+
if (!selectedSeedPack) {
|
|
39137
|
+
return null;
|
|
39138
|
+
}
|
|
39139
|
+
const payload = buildDraftPayload2();
|
|
39140
|
+
if (!payload) {
|
|
39141
|
+
return null;
|
|
39142
|
+
}
|
|
39143
|
+
setIsSaving(true);
|
|
39144
|
+
try {
|
|
39145
|
+
const updated = await updateSeedPack(selectedSeedPack.sid, payload);
|
|
39146
|
+
setSelectedSeedPack(updated);
|
|
39147
|
+
hydrateDraft(updated);
|
|
39148
|
+
await refreshSeedPacks(updated.sid);
|
|
39149
|
+
return updated;
|
|
39150
|
+
} catch (error) {
|
|
39151
|
+
showSnackbar("Failed to save seed pack.", "error");
|
|
39152
|
+
debugLogger.error("SeedPacksTab: failed to save seed pack", {
|
|
39153
|
+
sid: selectedSeedPack.sid,
|
|
39154
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39155
|
+
});
|
|
39156
|
+
return null;
|
|
39157
|
+
} finally {
|
|
39158
|
+
setIsSaving(false);
|
|
39159
|
+
}
|
|
39160
|
+
}, [selectedSeedPack, buildDraftPayload2, hydrateDraft, refreshSeedPacks, showSnackbar]);
|
|
39161
|
+
const handleSaveDraft = async () => {
|
|
39162
|
+
const updated = await saveDraft();
|
|
39163
|
+
if (updated) {
|
|
39164
|
+
showSnackbar("Seed pack saved.", "success");
|
|
39165
|
+
}
|
|
39166
|
+
};
|
|
39167
|
+
const handleResetDraft = () => {
|
|
39168
|
+
if (selectedSeedPack) {
|
|
39169
|
+
hydrateDraft(selectedSeedPack);
|
|
39170
|
+
}
|
|
39171
|
+
};
|
|
39172
|
+
const handleCreateSeedPack = async () => {
|
|
39173
|
+
const name = newPackName.trim();
|
|
39174
|
+
if (!name) {
|
|
39175
|
+
showSnackbar("Seed pack name is required.", "error");
|
|
39176
|
+
return;
|
|
39177
|
+
}
|
|
39178
|
+
const importedContent = buildMarkdownContent(createImportedFiles);
|
|
39179
|
+
const payload = {
|
|
39180
|
+
name,
|
|
39181
|
+
description: newPackDescription.trim(),
|
|
39182
|
+
tags: parseTags(newPackTags),
|
|
39183
|
+
content: importedContent,
|
|
39184
|
+
contentType: "markdown"
|
|
39185
|
+
};
|
|
39186
|
+
setIsCreating(true);
|
|
39187
|
+
try {
|
|
39188
|
+
const created = await createSeedPack(payload);
|
|
39189
|
+
resetCreateDialog();
|
|
39190
|
+
await refreshSeedPacks(created.sid);
|
|
39191
|
+
setSelectedSid(created.sid);
|
|
39192
|
+
setSelectedSeedPack(created);
|
|
39193
|
+
hydrateDraft(created);
|
|
39194
|
+
if (createImportedFiles.length > 0) {
|
|
39195
|
+
setImportedFiles(createImportedFiles);
|
|
39196
|
+
}
|
|
39197
|
+
setCreateImportedFiles([]);
|
|
39198
|
+
showSnackbar("Seed pack created.", "success");
|
|
39199
|
+
} catch (error) {
|
|
39200
|
+
showSnackbar("Failed to create seed pack.", "error");
|
|
39201
|
+
debugLogger.error("SeedPacksTab: failed to create seed pack", {
|
|
39202
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39203
|
+
});
|
|
39204
|
+
} finally {
|
|
39205
|
+
setIsCreating(false);
|
|
39206
|
+
}
|
|
39207
|
+
};
|
|
39208
|
+
const handlePublish = async () => {
|
|
39209
|
+
if (!selectedSeedPack) {
|
|
39210
|
+
return;
|
|
39211
|
+
}
|
|
39212
|
+
setPublishDialogOpen(false);
|
|
39213
|
+
setIsPublishing(true);
|
|
39214
|
+
try {
|
|
39215
|
+
if (isDirty) {
|
|
39216
|
+
const saved = await saveDraft();
|
|
39217
|
+
if (!saved) {
|
|
39218
|
+
return;
|
|
39219
|
+
}
|
|
39220
|
+
}
|
|
39221
|
+
const published = await publishSeedPack(selectedSeedPack.sid);
|
|
39222
|
+
setSelectedSeedPack(published);
|
|
39223
|
+
hydrateDraft(published);
|
|
39224
|
+
await refreshSeedPacks(published.sid);
|
|
39225
|
+
showSnackbar("Seed pack published.", "success");
|
|
39226
|
+
} catch (error) {
|
|
39227
|
+
showSnackbar("Failed to publish seed pack.", "error");
|
|
39228
|
+
debugLogger.error("SeedPacksTab: failed to publish seed pack", {
|
|
39229
|
+
sid: selectedSeedPack.sid,
|
|
39230
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39231
|
+
});
|
|
39232
|
+
} finally {
|
|
39233
|
+
setIsPublishing(false);
|
|
39234
|
+
}
|
|
39235
|
+
};
|
|
39236
|
+
const handleArchive = async () => {
|
|
39237
|
+
if (!selectedSeedPack) {
|
|
39238
|
+
return;
|
|
39239
|
+
}
|
|
39240
|
+
setArchiveDialogOpen(false);
|
|
39241
|
+
setIsArchiving(true);
|
|
39242
|
+
try {
|
|
39243
|
+
const archived = await archiveSeedPack(selectedSeedPack.sid);
|
|
39244
|
+
setSelectedSeedPack(archived);
|
|
39245
|
+
hydrateDraft(archived);
|
|
39246
|
+
await refreshSeedPacks(archived.sid);
|
|
39247
|
+
showSnackbar("Seed pack archived.", "success");
|
|
39248
|
+
} catch (error) {
|
|
39249
|
+
showSnackbar("Failed to archive seed pack.", "error");
|
|
39250
|
+
debugLogger.error("SeedPacksTab: failed to archive seed pack", {
|
|
39251
|
+
sid: selectedSeedPack.sid,
|
|
39252
|
+
error: error instanceof Error ? error.message : String(error)
|
|
39253
|
+
});
|
|
39254
|
+
} finally {
|
|
39255
|
+
setIsArchiving(false);
|
|
39256
|
+
}
|
|
39257
|
+
};
|
|
39258
|
+
const previewContent = draft.content.trim().length > 0 ? draft.content : "Preview will appear here as you type.";
|
|
39259
|
+
const selectedStatus = selectedSeedPack?.status ?? "draft";
|
|
39260
|
+
const statusChip = getStatusChip(selectedStatus);
|
|
39261
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { p: { xs: 1.5, sm: 3, md: 4 } }, children: [
|
|
39262
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { mb: { xs: 2.5, md: 3 } }, children: [
|
|
39263
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
39264
|
+
import_material42.Stack,
|
|
39265
|
+
{
|
|
39266
|
+
direction: { xs: "column", md: "row" },
|
|
39267
|
+
spacing: { xs: 1.5, md: 2 },
|
|
39268
|
+
alignItems: { xs: "flex-start", md: "center" },
|
|
39269
|
+
justifyContent: "space-between",
|
|
39270
|
+
children: [
|
|
39271
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { children: [
|
|
39272
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39273
|
+
import_material42.Typography,
|
|
39274
|
+
{
|
|
39275
|
+
variant: "h5",
|
|
39276
|
+
color: "text.primary",
|
|
39277
|
+
sx: { mb: 1, fontWeight: 600, fontSize: { xs: "1.55rem", md: "1.8rem" } },
|
|
39278
|
+
children: "Seed Packs"
|
|
39279
|
+
}
|
|
39280
|
+
),
|
|
39281
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body1", color: "text.secondary", children: "Curated internal knowledge that is always available to assistants, without showing up as visible sources." })
|
|
39282
|
+
] }),
|
|
39283
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Stack, { direction: "row", spacing: 1, flexWrap: "wrap", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39284
|
+
import_material42.Chip,
|
|
39285
|
+
{
|
|
39286
|
+
icon: isTeamScope ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Group2.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Person3.default, {}),
|
|
39287
|
+
label: scopeLabel,
|
|
39288
|
+
color: "info",
|
|
39289
|
+
variant: "outlined"
|
|
39290
|
+
}
|
|
39291
|
+
) })
|
|
39292
|
+
]
|
|
39293
|
+
}
|
|
39294
|
+
),
|
|
39295
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "caption", color: "text.secondary", children: scopeDescription })
|
|
39296
|
+
] }),
|
|
39297
|
+
!gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Alert, { severity: "warning", sx: { mb: 2 }, children: "Gateway API is not configured. Seed packs require a gateway URL in package settings." }),
|
|
39298
|
+
gatewayConfigured && !canManage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Alert, { severity: "info", sx: { mb: 2 }, children: "You have view-only access. Admin rights are required to create, publish, or archive team seed packs." }),
|
|
39299
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
39300
|
+
import_material42.Box,
|
|
39301
|
+
{
|
|
39302
|
+
sx: {
|
|
39303
|
+
display: "grid",
|
|
39304
|
+
gridTemplateColumns: { xs: "1fr", md: "320px 1fr" },
|
|
39305
|
+
gap: { xs: 2, md: 3 }
|
|
39306
|
+
},
|
|
39307
|
+
children: [
|
|
39308
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Card, { sx: { height: "fit-content" }, children: [
|
|
39309
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.CardContent, { sx: { pb: 1.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between", children: [
|
|
39310
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: "Packs" }),
|
|
39311
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, children: [
|
|
39312
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39313
|
+
import_material42.Button,
|
|
39314
|
+
{
|
|
39315
|
+
size: "small",
|
|
39316
|
+
variant: "outlined",
|
|
39317
|
+
onClick: () => refreshSeedPacks(),
|
|
39318
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Refresh3.default, {}),
|
|
39319
|
+
disabled: !gatewayConfigured || isLoadingList,
|
|
39320
|
+
children: "Refresh"
|
|
39321
|
+
}
|
|
39322
|
+
),
|
|
39323
|
+
canManage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39324
|
+
import_material42.Button,
|
|
39325
|
+
{
|
|
39326
|
+
size: "small",
|
|
39327
|
+
variant: "contained",
|
|
39328
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Add2.default, {}),
|
|
39329
|
+
onClick: () => setCreateDialogOpen(true),
|
|
39330
|
+
disabled: !gatewayConfigured,
|
|
39331
|
+
children: "New"
|
|
39332
|
+
}
|
|
39333
|
+
)
|
|
39334
|
+
] })
|
|
39335
|
+
] }) }),
|
|
39336
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Divider, {}),
|
|
39337
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { px: 2, pb: 2 }, children: [
|
|
39338
|
+
isLoadingList && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.LinearProgress, { sx: { mb: 2 } }),
|
|
39339
|
+
sortedSeedPacks.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", color: "text.secondary", children: "No seed packs yet. Create one to start sharing internal knowledge." }) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.List, { sx: { px: 0 }, children: sortedSeedPacks.map((pack) => {
|
|
39340
|
+
const status = getStatusChip(pack.status);
|
|
39341
|
+
const tags = normalizeTags(pack.tags);
|
|
39342
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39343
|
+
import_material42.ListItemButton,
|
|
39344
|
+
{
|
|
39345
|
+
selected: pack.sid === selectedSid,
|
|
39346
|
+
onClick: () => handleSelectPack(pack),
|
|
39347
|
+
sx: {
|
|
39348
|
+
mb: 1,
|
|
39349
|
+
borderRadius: 2,
|
|
39350
|
+
alignItems: "flex-start",
|
|
39351
|
+
border: pack.sid === selectedSid ? "1px solid" : "1px solid transparent",
|
|
39352
|
+
borderColor: pack.sid === selectedSid ? "primary.main" : "transparent"
|
|
39353
|
+
},
|
|
39354
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { flex: 1 }, children: [
|
|
39355
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, alignItems: "center", sx: { mb: 0.5 }, children: [
|
|
39356
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: pack.name }),
|
|
39357
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: status.label, color: status.color })
|
|
39358
|
+
] }),
|
|
39359
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Typography, { variant: "caption", color: "text.secondary", children: [
|
|
39360
|
+
pack.version ? `v${pack.version}` : "v0",
|
|
39361
|
+
" | Last published:",
|
|
39362
|
+
" ",
|
|
39363
|
+
formatTimestamp(pack.publishedAt)
|
|
39364
|
+
] }),
|
|
39365
|
+
tags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Stack, { direction: "row", spacing: 0.5, flexWrap: "wrap", sx: { mt: 1 }, children: tags.map((tag) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: tag, variant: "outlined" }, tag)) })
|
|
39366
|
+
] })
|
|
39367
|
+
},
|
|
39368
|
+
pack.sid
|
|
39369
|
+
);
|
|
39370
|
+
}) })
|
|
39371
|
+
] })
|
|
39372
|
+
] }),
|
|
39373
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.CardContent, { children: [
|
|
39374
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, alignItems: "center", justifyContent: "space-between", children: [
|
|
39375
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { children: [
|
|
39376
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "h6", sx: { fontWeight: 600 }, children: selectedSeedPack ? "Seed Pack Editor" : "Seed Pack Details" }),
|
|
39377
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", color: "text.secondary", children: "Draft content stays internal and is never shown as user-facing sources." })
|
|
39378
|
+
] }),
|
|
39379
|
+
selectedSeedPack && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, flexWrap: "wrap", children: [
|
|
39380
|
+
isDirty && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: "Unsaved changes", color: "warning" }),
|
|
39381
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: statusChip.label, color: statusChip.color })
|
|
39382
|
+
] })
|
|
39383
|
+
] }),
|
|
39384
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Divider, { sx: { my: 2 } }),
|
|
39385
|
+
!selectedSeedPack && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { children: [
|
|
39386
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: "Select a seed pack from the list or create a new one to begin editing." }),
|
|
39387
|
+
canManage && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39388
|
+
import_material42.Button,
|
|
39389
|
+
{
|
|
39390
|
+
variant: "contained",
|
|
39391
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Add2.default, {}),
|
|
39392
|
+
onClick: () => setCreateDialogOpen(true),
|
|
39393
|
+
disabled: !gatewayConfigured,
|
|
39394
|
+
children: "Create seed pack"
|
|
39395
|
+
}
|
|
39396
|
+
)
|
|
39397
|
+
] }),
|
|
39398
|
+
selectedSeedPack && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { spacing: 2, children: [
|
|
39399
|
+
isLoadingDetail && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.LinearProgress, {}),
|
|
39400
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39401
|
+
import_material42.TextField,
|
|
39402
|
+
{
|
|
39403
|
+
label: "Name",
|
|
39404
|
+
value: draft.name,
|
|
39405
|
+
onChange: (event) => setDraft((prev) => ({ ...prev, name: event.target.value })),
|
|
39406
|
+
fullWidth: true,
|
|
39407
|
+
disabled: isReadOnly
|
|
39408
|
+
}
|
|
39409
|
+
),
|
|
39410
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39411
|
+
import_material42.TextField,
|
|
39412
|
+
{
|
|
39413
|
+
label: "Description",
|
|
39414
|
+
value: draft.description,
|
|
39415
|
+
onChange: (event) => setDraft((prev) => ({ ...prev, description: event.target.value })),
|
|
39416
|
+
fullWidth: true,
|
|
39417
|
+
multiline: true,
|
|
39418
|
+
minRows: 2,
|
|
39419
|
+
disabled: isReadOnly
|
|
39420
|
+
}
|
|
39421
|
+
),
|
|
39422
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39423
|
+
import_material42.TextField,
|
|
39424
|
+
{
|
|
39425
|
+
label: "Tags (comma separated)",
|
|
39426
|
+
value: tagsInput,
|
|
39427
|
+
onChange: (event) => setTagsInput(event.target.value),
|
|
39428
|
+
fullWidth: true,
|
|
39429
|
+
disabled: isReadOnly
|
|
39430
|
+
}
|
|
39431
|
+
),
|
|
39432
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: "row", spacing: 1, flexWrap: "wrap", children: [
|
|
39433
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: scopeLabel, icon: isTeamScope ? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Group2.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Person3.default, {}) }),
|
|
39434
|
+
selectedSeedPack.version && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: `Version ${selectedSeedPack.version}`, variant: "outlined" }),
|
|
39435
|
+
selectedSeedPack.updatedAt && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Chip, { size: "small", label: `Updated ${formatTimestamp(selectedSeedPack.updatedAt)}`, variant: "outlined" })
|
|
39436
|
+
] }),
|
|
39437
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Alert, { severity: "info", children: "Treat seed pack content as internal knowledge. Do not include instructions that override system or developer messages." }),
|
|
39438
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
39439
|
+
import_material42.Box,
|
|
39440
|
+
{
|
|
39441
|
+
sx: {
|
|
39442
|
+
display: "grid",
|
|
39443
|
+
gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" },
|
|
39444
|
+
gap: 2,
|
|
39445
|
+
alignItems: "start"
|
|
39446
|
+
},
|
|
39447
|
+
children: [
|
|
39448
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { children: [
|
|
39449
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
39450
|
+
import_material42.Stack,
|
|
39451
|
+
{
|
|
39452
|
+
direction: { xs: "column", sm: "row" },
|
|
39453
|
+
spacing: 1,
|
|
39454
|
+
alignItems: { xs: "flex-start", sm: "center" },
|
|
39455
|
+
justifyContent: "space-between",
|
|
39456
|
+
sx: { mb: 1 },
|
|
39457
|
+
children: [
|
|
39458
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "subtitle2", children: "Markdown content" }),
|
|
39459
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39460
|
+
import_material42.Button,
|
|
39461
|
+
{
|
|
39462
|
+
size: "small",
|
|
39463
|
+
variant: "outlined",
|
|
39464
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_UploadFile2.default, {}),
|
|
39465
|
+
onClick: () => fileInputRef.current?.click(),
|
|
39466
|
+
disabled: isReadOnly,
|
|
39467
|
+
children: "Import .md"
|
|
39468
|
+
}
|
|
39469
|
+
),
|
|
39470
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39471
|
+
"input",
|
|
39472
|
+
{
|
|
39473
|
+
ref: fileInputRef,
|
|
39474
|
+
type: "file",
|
|
39475
|
+
accept: ".md",
|
|
39476
|
+
multiple: true,
|
|
39477
|
+
onChange: handleFileInputChange,
|
|
39478
|
+
style: { display: "none" }
|
|
39479
|
+
}
|
|
39480
|
+
)
|
|
39481
|
+
]
|
|
39482
|
+
}
|
|
39483
|
+
),
|
|
39484
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "caption", color: "text.secondary", sx: { mb: 1, display: "block" }, children: "Paste or import markdown files. Imports copy content into the editor." }),
|
|
39485
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39486
|
+
import_material42.TextField,
|
|
39487
|
+
{
|
|
39488
|
+
label: "Content",
|
|
39489
|
+
value: draft.content,
|
|
39490
|
+
onChange: (event) => setDraft((prev) => ({ ...prev, content: event.target.value })),
|
|
39491
|
+
fullWidth: true,
|
|
39492
|
+
multiline: true,
|
|
39493
|
+
minRows: 12,
|
|
39494
|
+
disabled: isReadOnly
|
|
39495
|
+
}
|
|
39496
|
+
),
|
|
39497
|
+
importedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { sx: { mt: 2 }, children: [
|
|
39498
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Imported markdown files" }),
|
|
39499
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39500
|
+
import_material42.Box,
|
|
39501
|
+
{
|
|
39502
|
+
sx: {
|
|
39503
|
+
display: "grid",
|
|
39504
|
+
gridTemplateColumns: {
|
|
39505
|
+
xs: "1fr",
|
|
39506
|
+
sm: "repeat(2, minmax(0, 1fr))",
|
|
39507
|
+
md: "repeat(3, minmax(0, 1fr))"
|
|
39508
|
+
},
|
|
39509
|
+
gap: 2
|
|
39510
|
+
},
|
|
39511
|
+
children: importedFiles.map((file) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39512
|
+
SeedPackFileCard,
|
|
39513
|
+
{
|
|
39514
|
+
file,
|
|
39515
|
+
isReadOnly,
|
|
39516
|
+
onPreview: () => setPreviewFile(file),
|
|
39517
|
+
onRemove: () => handleRemoveImportedFile(file.id)
|
|
39518
|
+
},
|
|
39519
|
+
file.id
|
|
39520
|
+
))
|
|
39521
|
+
}
|
|
39522
|
+
)
|
|
39523
|
+
] })
|
|
39524
|
+
] }),
|
|
39525
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Card, { variant: "outlined", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.CardContent, { children: [
|
|
39526
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Preview" }),
|
|
39527
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(StreamingMarkdown_default, { content: previewContent })
|
|
39528
|
+
] }) })
|
|
39529
|
+
]
|
|
39530
|
+
}
|
|
39531
|
+
),
|
|
39532
|
+
selectedSeedPack.summary && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39533
|
+
import_material42.TextField,
|
|
39534
|
+
{
|
|
39535
|
+
label: "Summary (auto-generated)",
|
|
39536
|
+
value: selectedSeedPack.summary,
|
|
39537
|
+
fullWidth: true,
|
|
39538
|
+
multiline: true,
|
|
39539
|
+
minRows: 3,
|
|
39540
|
+
InputProps: { readOnly: true }
|
|
39541
|
+
}
|
|
39542
|
+
),
|
|
39543
|
+
canManage && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, flexWrap: "wrap", children: [
|
|
39544
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39545
|
+
import_material42.Button,
|
|
39546
|
+
{
|
|
39547
|
+
variant: "outlined",
|
|
39548
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Save2.default, {}),
|
|
39549
|
+
onClick: handleSaveDraft,
|
|
39550
|
+
disabled: isReadOnly || !isDirty || isSaving,
|
|
39551
|
+
children: isSaving ? "Saving..." : "Save draft"
|
|
39552
|
+
}
|
|
39553
|
+
),
|
|
39554
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39555
|
+
import_material42.Button,
|
|
39556
|
+
{
|
|
39557
|
+
variant: "outlined",
|
|
39558
|
+
onClick: handleResetDraft,
|
|
39559
|
+
disabled: !isDirty || isReadOnly,
|
|
39560
|
+
children: "Reset changes"
|
|
39561
|
+
}
|
|
39562
|
+
),
|
|
39563
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39564
|
+
import_material42.Button,
|
|
39565
|
+
{
|
|
39566
|
+
variant: "contained",
|
|
39567
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Publish.default, {}),
|
|
39568
|
+
onClick: () => setPublishDialogOpen(true),
|
|
39569
|
+
disabled: isReadOnly || isPublishing,
|
|
39570
|
+
children: isPublishing ? "Publishing..." : "Publish"
|
|
39571
|
+
}
|
|
39572
|
+
),
|
|
39573
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39574
|
+
import_material42.Button,
|
|
39575
|
+
{
|
|
39576
|
+
variant: "text",
|
|
39577
|
+
color: "error",
|
|
39578
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_Archive.default, {}),
|
|
39579
|
+
onClick: () => setArchiveDialogOpen(true),
|
|
39580
|
+
disabled: isReadOnly || isArchiving,
|
|
39581
|
+
children: isArchiving ? "Archiving..." : "Archive"
|
|
39582
|
+
}
|
|
39583
|
+
)
|
|
39584
|
+
] })
|
|
39585
|
+
] })
|
|
39586
|
+
] }) })
|
|
39587
|
+
]
|
|
39588
|
+
}
|
|
39589
|
+
),
|
|
39590
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Dialog, { open: createDialogOpen, onClose: resetCreateDialog, maxWidth: "sm", fullWidth: true, children: [
|
|
39591
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogTitle, { children: "Create seed pack" }),
|
|
39592
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogContent, { children: [
|
|
39593
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogContentText, { sx: { mb: 2 }, children: [
|
|
39594
|
+
"Seed packs are scoped automatically based on your sign-in. ",
|
|
39595
|
+
scopeLabel,
|
|
39596
|
+
" - ",
|
|
39597
|
+
scopeDescription
|
|
39598
|
+
] }),
|
|
39599
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { spacing: 2, children: [
|
|
39600
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39601
|
+
import_material42.TextField,
|
|
39602
|
+
{
|
|
39603
|
+
label: "Name",
|
|
39604
|
+
value: newPackName,
|
|
39605
|
+
onChange: (event) => setNewPackName(event.target.value),
|
|
39606
|
+
fullWidth: true,
|
|
39607
|
+
autoFocus: true
|
|
39608
|
+
}
|
|
39609
|
+
),
|
|
39610
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39611
|
+
import_material42.TextField,
|
|
39612
|
+
{
|
|
39613
|
+
label: "Description",
|
|
39614
|
+
value: newPackDescription,
|
|
39615
|
+
onChange: (event) => setNewPackDescription(event.target.value),
|
|
39616
|
+
fullWidth: true,
|
|
39617
|
+
multiline: true,
|
|
39618
|
+
minRows: 2
|
|
39619
|
+
}
|
|
39620
|
+
),
|
|
39621
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39622
|
+
import_material42.TextField,
|
|
39623
|
+
{
|
|
39624
|
+
label: "Tags (comma separated)",
|
|
39625
|
+
value: newPackTags,
|
|
39626
|
+
onChange: (event) => setNewPackTags(event.target.value),
|
|
39627
|
+
fullWidth: true
|
|
39628
|
+
}
|
|
39629
|
+
),
|
|
39630
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Divider, {}),
|
|
39631
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Stack, { direction: { xs: "column", sm: "row" }, spacing: 1, alignItems: "center", children: [
|
|
39632
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39633
|
+
import_material42.Button,
|
|
39634
|
+
{
|
|
39635
|
+
size: "small",
|
|
39636
|
+
variant: "outlined",
|
|
39637
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_UploadFile2.default, {}),
|
|
39638
|
+
onClick: () => createFileInputRef.current?.click(),
|
|
39639
|
+
disabled: !canManage,
|
|
39640
|
+
children: "Import .md files"
|
|
39641
|
+
}
|
|
39642
|
+
),
|
|
39643
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "caption", color: "text.secondary", children: "Optional. Files are merged into the draft content." }),
|
|
39644
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39645
|
+
"input",
|
|
39646
|
+
{
|
|
39647
|
+
ref: createFileInputRef,
|
|
39648
|
+
type: "file",
|
|
39649
|
+
accept: ".md",
|
|
39650
|
+
multiple: true,
|
|
39651
|
+
onChange: handleCreateFileInputChange,
|
|
39652
|
+
style: { display: "none" }
|
|
39653
|
+
}
|
|
39654
|
+
)
|
|
39655
|
+
] }),
|
|
39656
|
+
createImportedFiles.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Box, { children: [
|
|
39657
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Typography, { variant: "subtitle2", sx: { mb: 1 }, children: "Imported markdown files" }),
|
|
39658
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39659
|
+
import_material42.Box,
|
|
39660
|
+
{
|
|
39661
|
+
sx: {
|
|
39662
|
+
display: "grid",
|
|
39663
|
+
gridTemplateColumns: {
|
|
39664
|
+
xs: "1fr",
|
|
39665
|
+
sm: "repeat(2, minmax(0, 1fr))"
|
|
39666
|
+
},
|
|
39667
|
+
gap: 2
|
|
39668
|
+
},
|
|
39669
|
+
children: createImportedFiles.map((file) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39670
|
+
SeedPackFileCard,
|
|
39671
|
+
{
|
|
39672
|
+
file,
|
|
39673
|
+
isReadOnly: !canManage,
|
|
39674
|
+
onPreview: () => setPreviewFile(file),
|
|
39675
|
+
onRemove: () => handleRemoveCreateImportedFile(file.id)
|
|
39676
|
+
},
|
|
39677
|
+
file.id
|
|
39678
|
+
))
|
|
39679
|
+
}
|
|
39680
|
+
)
|
|
39681
|
+
] })
|
|
39682
|
+
] })
|
|
39683
|
+
] }),
|
|
39684
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { children: [
|
|
39685
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: resetCreateDialog, children: "Cancel" }),
|
|
39686
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39687
|
+
import_material42.Button,
|
|
39688
|
+
{
|
|
39689
|
+
variant: "contained",
|
|
39690
|
+
onClick: handleCreateSeedPack,
|
|
39691
|
+
disabled: !gatewayConfigured || isCreating,
|
|
39692
|
+
children: isCreating ? "Creating..." : "Create"
|
|
39693
|
+
}
|
|
39694
|
+
)
|
|
39695
|
+
] })
|
|
39696
|
+
] }),
|
|
39697
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Dialog, { open: publishDialogOpen, onClose: () => setPublishDialogOpen(false), maxWidth: "sm", fullWidth: true, children: [
|
|
39698
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogTitle, { children: "Publish seed pack" }),
|
|
39699
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogContent, { children: [
|
|
39700
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogContentText, { children: "Publishing locks a new version and makes it available for internal retrieval. This content is never shown as a user-facing source." }),
|
|
39701
|
+
isDirty && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Alert, { severity: "info", sx: { mt: 2 }, children: "You have unsaved changes. They will be included in the published version." })
|
|
39702
|
+
] }),
|
|
39703
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { children: [
|
|
39704
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: () => setPublishDialogOpen(false), children: "Cancel" }),
|
|
39705
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { variant: "contained", onClick: handlePublish, disabled: isPublishing, children: isPublishing ? "Publishing..." : "Publish" })
|
|
39706
|
+
] })
|
|
39707
|
+
] }),
|
|
39708
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.Dialog, { open: archiveDialogOpen, onClose: () => setArchiveDialogOpen(false), maxWidth: "sm", fullWidth: true, children: [
|
|
39709
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogTitle, { children: "Archive seed pack" }),
|
|
39710
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogContent, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogContentText, { children: "Archiving stops this seed pack from being used in new conversations. You can keep it for reference or audit history." }) }),
|
|
39711
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_material42.DialogActions, { children: [
|
|
39712
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: () => setArchiveDialogOpen(false), children: "Cancel" }),
|
|
39713
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { variant: "contained", color: "error", onClick: handleArchive, disabled: isArchiving, children: isArchiving ? "Archiving..." : "Archive" })
|
|
39714
|
+
] })
|
|
39715
|
+
] }),
|
|
39716
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
39717
|
+
import_material42.Dialog,
|
|
39718
|
+
{
|
|
39719
|
+
open: Boolean(previewFile),
|
|
39720
|
+
onClose: () => setPreviewFile(null),
|
|
39721
|
+
maxWidth: "md",
|
|
39722
|
+
fullWidth: true,
|
|
39723
|
+
children: [
|
|
39724
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogTitle, { children: previewFile?.name ?? "Markdown preview" }),
|
|
39725
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogContent, { dividers: true, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(StreamingMarkdown_default, { content: previewFile?.content ?? "" }) }),
|
|
39726
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Button, { onClick: () => setPreviewFile(null), children: "Close" }) })
|
|
39727
|
+
]
|
|
39728
|
+
}
|
|
39729
|
+
),
|
|
39730
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
39731
|
+
import_material42.Snackbar,
|
|
39732
|
+
{
|
|
39733
|
+
open: snackbarOpen,
|
|
39734
|
+
autoHideDuration: 4e3,
|
|
39735
|
+
onClose: () => setSnackbarOpen(false),
|
|
39736
|
+
anchorOrigin: { vertical: "bottom", horizontal: "center" },
|
|
39737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_material42.Alert, { onClose: () => setSnackbarOpen(false), severity: snackbarSeverity, sx: { width: "100%" }, children: snackbarMessage })
|
|
39738
|
+
}
|
|
39739
|
+
)
|
|
39740
|
+
] });
|
|
39741
|
+
};
|
|
39742
|
+
var SeedPacksTab_default = SeedPacksTab;
|
|
39743
|
+
|
|
39744
|
+
// src/management/components/KnowledgeHubTab.tsx
|
|
39745
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
39746
|
+
var KnowledgeHubTab = (props) => {
|
|
39747
|
+
const theme = (0, import_material43.useTheme)();
|
|
39748
|
+
const isMobile = (0, import_material43.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
39749
|
+
const { seedPacksEnabled = false } = props;
|
|
39750
|
+
const [tabIndex, setTabIndex] = (0, import_react53.useState)(0);
|
|
39751
|
+
const effectiveTabIndex = seedPacksEnabled ? tabIndex : 0;
|
|
39752
|
+
(0, import_react53.useEffect)(() => {
|
|
39753
|
+
if (!seedPacksEnabled && tabIndex !== 0) {
|
|
39754
|
+
setTabIndex(0);
|
|
39755
|
+
}
|
|
39756
|
+
}, [seedPacksEnabled, tabIndex]);
|
|
39757
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_material43.Box, { children: [
|
|
39758
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Box, { sx: { px: { xs: 1.5, sm: 3, md: 4 }, pt: { xs: 1.5, md: 2 } }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
39759
|
+
import_material43.Tabs,
|
|
39760
|
+
{
|
|
39761
|
+
value: effectiveTabIndex,
|
|
39762
|
+
onChange: (_, newValue) => setTabIndex(newValue),
|
|
39763
|
+
variant: isMobile ? "fullWidth" : "standard",
|
|
39764
|
+
sx: {
|
|
39765
|
+
borderBottom: 1,
|
|
39766
|
+
borderColor: "divider",
|
|
39767
|
+
"& .MuiTab-root": {
|
|
39768
|
+
textTransform: "none",
|
|
39769
|
+
fontWeight: 600,
|
|
39770
|
+
fontSize: { xs: "0.95rem", sm: "1rem" },
|
|
39771
|
+
minWidth: { xs: "auto", md: 160 },
|
|
39772
|
+
px: { xs: 1.2, sm: 1.5 }
|
|
39773
|
+
}
|
|
39774
|
+
},
|
|
39775
|
+
children: [
|
|
39776
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
39777
|
+
import_material43.Tab,
|
|
39778
|
+
{
|
|
39779
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_Description5.default, { fontSize: isMobile ? "small" : "medium" }),
|
|
39780
|
+
iconPosition: isMobile ? "top" : "start",
|
|
39781
|
+
label: "Documents"
|
|
39782
|
+
}
|
|
39783
|
+
),
|
|
39784
|
+
seedPacksEnabled && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
39785
|
+
import_material43.Tab,
|
|
39786
|
+
{
|
|
39787
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_AutoStories.default, { fontSize: isMobile ? "small" : "medium" }),
|
|
39788
|
+
iconPosition: isMobile ? "top" : "start",
|
|
39789
|
+
label: "Seed Packs"
|
|
39790
|
+
}
|
|
39791
|
+
)
|
|
39792
|
+
]
|
|
39793
|
+
}
|
|
39794
|
+
) }),
|
|
39795
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Box, { sx: { display: effectiveTabIndex === 0 ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(KnowledgeTab_default, { ...props }) }),
|
|
39796
|
+
seedPacksEnabled && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_material43.Box, { sx: { display: effectiveTabIndex === 1 ? "block" : "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SeedPacksTab_default, {}) })
|
|
39797
|
+
] });
|
|
39798
|
+
};
|
|
39799
|
+
var KnowledgeHubTab_default = KnowledgeHubTab;
|
|
39800
|
+
|
|
39801
|
+
// src/management/components/StorageTab.tsx
|
|
39802
|
+
var import_react54 = require("react");
|
|
39803
|
+
var import_material44 = require("@mui/material");
|
|
39804
|
+
var import_Storage = __toESM(require("@mui/icons-material/Storage"));
|
|
39805
|
+
var import_Delete7 = __toESM(require("@mui/icons-material/Delete"));
|
|
39806
|
+
var import_Refresh4 = __toESM(require("@mui/icons-material/Refresh"));
|
|
39807
|
+
var import_Warning = __toESM(require("@mui/icons-material/Warning"));
|
|
39808
|
+
var import_Info2 = __toESM(require("@mui/icons-material/Info"));
|
|
39809
|
+
var import_CleaningServices = __toESM(require("@mui/icons-material/CleaningServices"));
|
|
39810
|
+
var import_Description6 = __toESM(require("@mui/icons-material/Description"));
|
|
39811
|
+
var import_Person4 = __toESM(require("@mui/icons-material/Person"));
|
|
39812
|
+
var import_Chat = __toESM(require("@mui/icons-material/Chat"));
|
|
39813
|
+
var import_Settings2 = __toESM(require("@mui/icons-material/Settings"));
|
|
39814
|
+
var import_ExpandMore3 = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
39815
|
+
var import_CheckCircle3 = __toESM(require("@mui/icons-material/CheckCircle"));
|
|
39816
|
+
var import_Error3 = __toESM(require("@mui/icons-material/Error"));
|
|
39817
|
+
init_debugLogger();
|
|
39818
|
+
init_indexedDBService();
|
|
39819
|
+
init_conversationSyncStore();
|
|
39820
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
39821
|
+
var DEFAULT_DISPLAY_QUOTA_BYTES = 1024 * 1024 * 1024;
|
|
39822
|
+
var MAX_DISPLAY_QUOTA_BYTES = 5 * 1024 * 1024 * 1024;
|
|
39823
|
+
var formatBytes = (bytes) => {
|
|
39824
|
+
if (bytes === 0) return "0 B";
|
|
39825
|
+
const k = 1024;
|
|
39826
|
+
const sizes = ["B", "KB", "MB", "GB", "TB"];
|
|
39827
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
39828
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + " " + sizes[i];
|
|
39829
|
+
};
|
|
39830
|
+
var getStorageQuota = async () => {
|
|
39831
|
+
try {
|
|
39832
|
+
if ("storage" in navigator && "estimate" in navigator.storage) {
|
|
39833
|
+
const estimate = await navigator.storage.estimate();
|
|
39834
|
+
return {
|
|
39835
|
+
used: estimate.usage || 0,
|
|
39836
|
+
quota: estimate.quota || 0
|
|
39837
|
+
};
|
|
39838
|
+
}
|
|
39839
|
+
} catch (error) {
|
|
39840
|
+
debugLogger.warn("Could not get storage estimate", { error });
|
|
39841
|
+
}
|
|
39842
|
+
return { used: 0, quota: 0 };
|
|
39843
|
+
};
|
|
39844
|
+
var getIndexedDBSize = async () => {
|
|
39845
|
+
const categories = [];
|
|
39846
|
+
try {
|
|
39847
|
+
debugLogger.info("Starting IndexedDB size estimation");
|
|
39848
|
+
try {
|
|
39849
|
+
const databases = await indexedDB.databases();
|
|
39850
|
+
debugLogger.info("Available IndexedDB databases:", {
|
|
39851
|
+
databases: databases.map((db) => ({ name: db.name, version: db.version }))
|
|
39852
|
+
});
|
|
39853
|
+
} catch (error) {
|
|
39854
|
+
debugLogger.warn("Could not list databases", { error });
|
|
39855
|
+
}
|
|
39856
|
+
const conversationDbNames = ["bandit-conversations", "banditConversations", "conversations"];
|
|
39857
|
+
let chatSize = { size: 0, count: 0 };
|
|
39858
|
+
let foundConversationDb = "";
|
|
39859
|
+
for (const dbName of conversationDbNames) {
|
|
39860
|
+
try {
|
|
39861
|
+
const result = await estimateStoreSize(dbName, "conversations");
|
|
39862
|
+
if (result.count > 0) {
|
|
39863
|
+
chatSize = result;
|
|
39864
|
+
foundConversationDb = dbName;
|
|
39865
|
+
debugLogger.info(`Found conversations in database: ${dbName}`);
|
|
39866
|
+
break;
|
|
39867
|
+
}
|
|
39868
|
+
} catch (error) {
|
|
39869
|
+
debugLogger.warn(`Failed to check conversations in ${dbName}`, { error });
|
|
39870
|
+
}
|
|
39871
|
+
}
|
|
39872
|
+
categories.push({
|
|
39873
|
+
name: "Chat History",
|
|
39874
|
+
icon: import_Chat.default,
|
|
39875
|
+
color: "#4caf50",
|
|
39876
|
+
size: chatSize.size,
|
|
39877
|
+
itemCount: chatSize.count,
|
|
39878
|
+
description: "Conversation history and messages",
|
|
39879
|
+
stores: foundConversationDb ? [`${foundConversationDb}.conversations`] : [],
|
|
39880
|
+
canClear: chatSize.count > 0,
|
|
39881
|
+
clearWarning: "This will permanently delete all your chat conversations and message history."
|
|
39882
|
+
});
|
|
39883
|
+
debugLogger.info(`Chat History category created:`, {
|
|
39884
|
+
itemCount: chatSize.count,
|
|
39885
|
+
size: chatSize.size,
|
|
39886
|
+
canClear: chatSize.count > 0,
|
|
39887
|
+
foundDb: foundConversationDb
|
|
39888
|
+
});
|
|
39889
|
+
const knowledgeDbNames = ["bandit-knowledge", "banditKnowledge", "knowledge"];
|
|
39890
|
+
let knowledgeSize = { size: 0, count: 0 };
|
|
39891
|
+
let foundKnowledgeDb = "";
|
|
39892
|
+
for (const dbName of knowledgeDbNames) {
|
|
39893
|
+
try {
|
|
39894
|
+
const result = await estimateStoreSize(dbName, "documents");
|
|
39895
|
+
debugLogger.info(`Knowledge database ${dbName} check result:`, {
|
|
39896
|
+
size: result.size,
|
|
39897
|
+
count: result.count,
|
|
39898
|
+
sizeFormatted: `${(result.size / 1024).toFixed(2)} KB`
|
|
39899
|
+
});
|
|
39900
|
+
if (result.count > 0) {
|
|
39901
|
+
knowledgeSize = result;
|
|
39902
|
+
foundKnowledgeDb = dbName;
|
|
39903
|
+
debugLogger.info(`Found knowledge documents in database: ${dbName}`, {
|
|
39904
|
+
totalSize: result.size,
|
|
39905
|
+
itemCount: result.count
|
|
39906
|
+
});
|
|
39907
|
+
break;
|
|
39908
|
+
}
|
|
39909
|
+
} catch (error) {
|
|
39910
|
+
debugLogger.warn(`Failed to check knowledge in ${dbName}`, { error });
|
|
39911
|
+
}
|
|
39912
|
+
}
|
|
39913
|
+
categories.push({
|
|
39914
|
+
name: "Knowledge Documents",
|
|
39915
|
+
icon: import_Description6.default,
|
|
39916
|
+
color: "#2196f3",
|
|
39917
|
+
size: knowledgeSize.size,
|
|
39918
|
+
itemCount: knowledgeSize.count,
|
|
39919
|
+
description: "Uploaded documents and their embeddings",
|
|
39920
|
+
stores: foundKnowledgeDb ? [`${foundKnowledgeDb}.documents`] : [],
|
|
39921
|
+
canClear: knowledgeSize.count > 0,
|
|
39922
|
+
clearWarning: "This will remove all uploaded documents and their AI embeddings. You will need to re-upload documents."
|
|
39923
|
+
});
|
|
39924
|
+
debugLogger.info(`Knowledge Documents category created:`, {
|
|
39925
|
+
itemCount: knowledgeSize.count,
|
|
39926
|
+
size: knowledgeSize.size,
|
|
39927
|
+
sizeFormatted: `${(knowledgeSize.size / 1024).toFixed(2)} KB`,
|
|
39928
|
+
canClear: knowledgeSize.count > 0,
|
|
39929
|
+
foundDb: foundKnowledgeDb
|
|
39930
|
+
});
|
|
39931
|
+
const memoryDbNames = ["bandit-memory-db", "banditMemories", "bandit-memories"];
|
|
39932
|
+
let memorySize = { size: 0, count: 0 };
|
|
39933
|
+
let foundMemoryDb = "";
|
|
39934
|
+
for (const dbName of memoryDbNames) {
|
|
39935
|
+
try {
|
|
39936
|
+
const result = await estimateStoreSize(dbName, "memories");
|
|
39937
|
+
if (result.count > 0) {
|
|
39938
|
+
memorySize = result;
|
|
39939
|
+
foundMemoryDb = dbName;
|
|
39940
|
+
debugLogger.info(`Found memories in database: ${dbName}`);
|
|
39941
|
+
break;
|
|
39942
|
+
}
|
|
39943
|
+
} catch (error) {
|
|
39944
|
+
debugLogger.warn(`Failed to check memories in ${dbName}`, { error });
|
|
39945
|
+
}
|
|
39946
|
+
}
|
|
39947
|
+
categories.push({
|
|
39948
|
+
name: "AI Memories",
|
|
39949
|
+
icon: import_Person4.default,
|
|
39950
|
+
color: "#ff9800",
|
|
39951
|
+
size: memorySize.size,
|
|
39952
|
+
itemCount: memorySize.count,
|
|
39953
|
+
description: "AI memory entries and learned patterns",
|
|
39954
|
+
stores: foundMemoryDb ? [`${foundMemoryDb}.memories`] : [],
|
|
39955
|
+
canClear: memorySize.count > 0,
|
|
39956
|
+
clearWarning: "This will delete all AI memory entries and learned conversation patterns."
|
|
39957
|
+
});
|
|
39958
|
+
const configDbNames = ["banditConfig", "bandit-config"];
|
|
39959
|
+
let configSize = { size: 0, count: 0 };
|
|
38462
39960
|
let foundConfigDb = "";
|
|
38463
39961
|
for (const dbName of configDbNames) {
|
|
38464
39962
|
try {
|
|
@@ -38503,7 +40001,7 @@ var getIndexedDBSize = async () => {
|
|
|
38503
40001
|
if (querySize.count > 0) {
|
|
38504
40002
|
categories.push({
|
|
38505
40003
|
name: "AI Query Cache",
|
|
38506
|
-
icon:
|
|
40004
|
+
icon: import_Person4.default,
|
|
38507
40005
|
color: "#ff5722",
|
|
38508
40006
|
size: querySize.size,
|
|
38509
40007
|
itemCount: querySize.count,
|
|
@@ -38615,21 +40113,21 @@ var clearEntireDatabase = async (dbName) => {
|
|
|
38615
40113
|
});
|
|
38616
40114
|
};
|
|
38617
40115
|
var StorageTab = ({ currentTheme }) => {
|
|
38618
|
-
const theme = (0,
|
|
38619
|
-
const [storageQuota, setStorageQuota] = (0,
|
|
40116
|
+
const theme = (0, import_material44.useTheme)();
|
|
40117
|
+
const [storageQuota, setStorageQuota] = (0, import_react54.useState)({
|
|
38620
40118
|
used: 0,
|
|
38621
40119
|
quota: 0,
|
|
38622
40120
|
available: 0,
|
|
38623
40121
|
browserQuotaEstimate: 0
|
|
38624
40122
|
});
|
|
38625
|
-
const [storageCategories, setStorageCategories] = (0,
|
|
38626
|
-
const [loading, setLoading] = (0,
|
|
38627
|
-
const [clearAllDialogOpen, setClearAllDialogOpen] = (0,
|
|
38628
|
-
const [clearCategoryDialog, setClearCategoryDialog] = (0,
|
|
38629
|
-
const [clearing, setClearing] = (0,
|
|
38630
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
38631
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
38632
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
40123
|
+
const [storageCategories, setStorageCategories] = (0, import_react54.useState)([]);
|
|
40124
|
+
const [loading, setLoading] = (0, import_react54.useState)(true);
|
|
40125
|
+
const [clearAllDialogOpen, setClearAllDialogOpen] = (0, import_react54.useState)(false);
|
|
40126
|
+
const [clearCategoryDialog, setClearCategoryDialog] = (0, import_react54.useState)(null);
|
|
40127
|
+
const [clearing, setClearing] = (0, import_react54.useState)(false);
|
|
40128
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react54.useState)("");
|
|
40129
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react54.useState)(false);
|
|
40130
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react54.useState)("success");
|
|
38633
40131
|
const { syncEnabled, isAdvancedVectorFeaturesEnabled } = useConversationSyncStore((state) => ({
|
|
38634
40132
|
syncEnabled: state.syncEnabled,
|
|
38635
40133
|
isAdvancedVectorFeaturesEnabled: state.isAdvancedVectorFeaturesEnabled
|
|
@@ -38681,18 +40179,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38681
40179
|
setLoading(false);
|
|
38682
40180
|
}
|
|
38683
40181
|
};
|
|
38684
|
-
(0,
|
|
40182
|
+
(0, import_react54.useEffect)(() => {
|
|
38685
40183
|
loadStorageData();
|
|
38686
40184
|
}, []);
|
|
38687
|
-
const totalUsed = (0,
|
|
40185
|
+
const totalUsed = (0, import_react54.useMemo)(() => {
|
|
38688
40186
|
return storageCategories.reduce((sum, cat) => sum + cat.size, 0);
|
|
38689
40187
|
}, [storageCategories]);
|
|
38690
|
-
const usagePercentage = (0,
|
|
40188
|
+
const usagePercentage = (0, import_react54.useMemo)(() => {
|
|
38691
40189
|
if (storageQuota.quota === 0) return 0;
|
|
38692
40190
|
const percentage = Math.min(storageQuota.used / storageQuota.quota * 100, 100);
|
|
38693
40191
|
return percentage > 0 && percentage < 0.1 ? 0.1 : percentage;
|
|
38694
40192
|
}, [storageQuota]);
|
|
38695
|
-
const clearableCategories = (0,
|
|
40193
|
+
const clearableCategories = (0, import_react54.useMemo)(() => {
|
|
38696
40194
|
return storageCategories.filter((cat) => cat.canClear);
|
|
38697
40195
|
}, [storageCategories]);
|
|
38698
40196
|
const handleClearCategory = async (category) => {
|
|
@@ -38777,13 +40275,13 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38777
40275
|
}
|
|
38778
40276
|
};
|
|
38779
40277
|
if (loading) {
|
|
38780
|
-
return /* @__PURE__ */ (0,
|
|
38781
|
-
/* @__PURE__ */ (0,
|
|
38782
|
-
/* @__PURE__ */ (0,
|
|
40278
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", justifyContent: "center", alignItems: "center", py: 8 }, children: [
|
|
40279
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.CircularProgress, {}),
|
|
40280
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body1", color: "text.secondary", sx: { ml: 2 }, children: "Analyzing storage usage..." })
|
|
38783
40281
|
] });
|
|
38784
40282
|
}
|
|
38785
|
-
return /* @__PURE__ */ (0,
|
|
38786
|
-
/* @__PURE__ */ (0,
|
|
40283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { px: { xs: 2, sm: 4, md: 6 }, pt: 3, pb: 5 }, children: [
|
|
40284
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { mb: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: {
|
|
38787
40285
|
display: "flex",
|
|
38788
40286
|
flexDirection: { xs: "column", sm: "row" },
|
|
38789
40287
|
justifyContent: "space-between",
|
|
@@ -38791,19 +40289,19 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38791
40289
|
gap: { xs: 2, sm: 0 },
|
|
38792
40290
|
mb: 2
|
|
38793
40291
|
}, children: [
|
|
38794
|
-
/* @__PURE__ */ (0,
|
|
38795
|
-
/* @__PURE__ */ (0,
|
|
38796
|
-
/* @__PURE__ */ (0,
|
|
40292
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { flex: 1 }, children: [
|
|
40293
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "h5", color: "text.primary", sx: { mb: 1, fontWeight: 600 }, children: "Storage Management" }),
|
|
40294
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body1", color: "text.secondary", children: "Monitor and manage your local browser storage usage" })
|
|
38797
40295
|
] }),
|
|
38798
|
-
/* @__PURE__ */ (0,
|
|
40296
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: {
|
|
38799
40297
|
display: "flex",
|
|
38800
40298
|
gap: 1,
|
|
38801
40299
|
flexWrap: { xs: "wrap", sm: "nowrap" },
|
|
38802
40300
|
justifyContent: { xs: "stretch", sm: "flex-end" },
|
|
38803
40301
|
width: { xs: "100%", sm: "auto" }
|
|
38804
40302
|
}, children: [
|
|
38805
|
-
/* @__PURE__ */ (0,
|
|
38806
|
-
|
|
40303
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40304
|
+
import_material44.Button,
|
|
38807
40305
|
{
|
|
38808
40306
|
variant: "outlined",
|
|
38809
40307
|
size: "small",
|
|
@@ -38815,22 +40313,22 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38815
40313
|
minHeight: 36
|
|
38816
40314
|
},
|
|
38817
40315
|
children: [
|
|
38818
|
-
/* @__PURE__ */ (0,
|
|
38819
|
-
/* @__PURE__ */ (0,
|
|
40316
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: { xs: "none", sm: "flex" }, alignItems: "center", gap: 1 }, children: [
|
|
40317
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Refresh4.default, { fontSize: "medium" }),
|
|
38820
40318
|
"Refresh"
|
|
38821
40319
|
] }),
|
|
38822
|
-
/* @__PURE__ */ (0,
|
|
40320
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: { xs: "flex", sm: "none" }, alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Refresh4.default, { fontSize: "medium" }) })
|
|
38823
40321
|
]
|
|
38824
40322
|
}
|
|
38825
40323
|
),
|
|
38826
|
-
clearableCategories.length > 0 && /* @__PURE__ */ (0,
|
|
38827
|
-
/* @__PURE__ */ (0,
|
|
38828
|
-
|
|
40324
|
+
clearableCategories.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [
|
|
40325
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40326
|
+
import_material44.Button,
|
|
38829
40327
|
{
|
|
38830
40328
|
variant: "outlined",
|
|
38831
40329
|
color: "error",
|
|
38832
40330
|
size: "small",
|
|
38833
|
-
startIcon: /* @__PURE__ */ (0,
|
|
40331
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_CleaningServices.default, { sx: { display: { xs: "none", sm: "inline-flex" } } }),
|
|
38834
40332
|
onClick: () => setClearAllDialogOpen(true),
|
|
38835
40333
|
sx: {
|
|
38836
40334
|
minWidth: { xs: "auto", sm: "fit-content" },
|
|
@@ -38838,18 +40336,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38838
40336
|
px: { xs: 1, sm: 2 }
|
|
38839
40337
|
},
|
|
38840
40338
|
children: [
|
|
38841
|
-
/* @__PURE__ */ (0,
|
|
38842
|
-
/* @__PURE__ */ (0,
|
|
40339
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: { xs: "none", sm: "inline" } }, children: "Clear All Data" }),
|
|
40340
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: { xs: "inline", sm: "none" } }, children: "Clear All" })
|
|
38843
40341
|
]
|
|
38844
40342
|
}
|
|
38845
40343
|
),
|
|
38846
|
-
/* @__PURE__ */ (0,
|
|
38847
|
-
|
|
40344
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40345
|
+
import_material44.Button,
|
|
38848
40346
|
{
|
|
38849
40347
|
variant: "outlined",
|
|
38850
40348
|
color: "error",
|
|
38851
40349
|
size: "small",
|
|
38852
|
-
startIcon: /* @__PURE__ */ (0,
|
|
40350
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Delete7.default, { sx: { display: { xs: "none", sm: "inline-flex" } } }),
|
|
38853
40351
|
onClick: () => handleNuclearClear(),
|
|
38854
40352
|
sx: {
|
|
38855
40353
|
minWidth: { xs: "auto", sm: "fit-content" },
|
|
@@ -38857,28 +40355,28 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38857
40355
|
px: { xs: 1, sm: 2 }
|
|
38858
40356
|
},
|
|
38859
40357
|
children: [
|
|
38860
|
-
/* @__PURE__ */ (0,
|
|
38861
|
-
/* @__PURE__ */ (0,
|
|
40358
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: { xs: "none", sm: "inline" } }, children: "Nuclear Clear" }),
|
|
40359
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { display: { xs: "inline", sm: "none" } }, children: "Nuclear" })
|
|
38862
40360
|
]
|
|
38863
40361
|
}
|
|
38864
40362
|
)
|
|
38865
40363
|
] })
|
|
38866
40364
|
] })
|
|
38867
40365
|
] }) }),
|
|
38868
|
-
/* @__PURE__ */ (0,
|
|
38869
|
-
/* @__PURE__ */ (0,
|
|
40366
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { mb: 4 }, children: [
|
|
40367
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Card, { sx: { mb: 3 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.CardContent, { sx: {
|
|
38870
40368
|
display: "flex",
|
|
38871
40369
|
flexDirection: "column",
|
|
38872
40370
|
minHeight: 180
|
|
38873
40371
|
}, children: [
|
|
38874
|
-
/* @__PURE__ */ (0,
|
|
38875
|
-
/* @__PURE__ */ (0,
|
|
40372
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "h6", gutterBottom: true, sx: { fontWeight: 600, color: "text.primary" }, children: [
|
|
40373
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Storage.default, { sx: { mr: 1, verticalAlign: "middle" } }),
|
|
38876
40374
|
"Storage Quota"
|
|
38877
40375
|
] }),
|
|
38878
|
-
/* @__PURE__ */ (0,
|
|
38879
|
-
/* @__PURE__ */ (0,
|
|
38880
|
-
/* @__PURE__ */ (0,
|
|
38881
|
-
|
|
40376
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { mb: 2, flex: 1 }, children: [
|
|
40377
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mb: 2 }, children: [
|
|
40378
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40379
|
+
import_material44.Chip,
|
|
38882
40380
|
{
|
|
38883
40381
|
label: `${formatBytes(storageQuota.used)} Used`,
|
|
38884
40382
|
color: "warning",
|
|
@@ -38886,8 +40384,8 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38886
40384
|
variant: "outlined"
|
|
38887
40385
|
}
|
|
38888
40386
|
),
|
|
38889
|
-
/* @__PURE__ */ (0,
|
|
38890
|
-
|
|
40387
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40388
|
+
import_material44.Chip,
|
|
38891
40389
|
{
|
|
38892
40390
|
label: `${formatBytes(storageQuota.available)} Available`,
|
|
38893
40391
|
color: "success",
|
|
@@ -38895,8 +40393,8 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38895
40393
|
variant: "outlined"
|
|
38896
40394
|
}
|
|
38897
40395
|
),
|
|
38898
|
-
/* @__PURE__ */ (0,
|
|
38899
|
-
|
|
40396
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40397
|
+
import_material44.Chip,
|
|
38900
40398
|
{
|
|
38901
40399
|
label: `${formatBytes(storageQuota.quota)} Total`,
|
|
38902
40400
|
color: "info",
|
|
@@ -38904,8 +40402,8 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38904
40402
|
variant: "outlined"
|
|
38905
40403
|
}
|
|
38906
40404
|
),
|
|
38907
|
-
storageQuota.browserQuotaEstimate > 0 && storageQuota.quota > 0 && Math.abs(storageQuota.browserQuotaEstimate - storageQuota.quota) > storageQuota.quota * 0.05 && /* @__PURE__ */ (0,
|
|
38908
|
-
|
|
40405
|
+
storageQuota.browserQuotaEstimate > 0 && storageQuota.quota > 0 && Math.abs(storageQuota.browserQuotaEstimate - storageQuota.quota) > storageQuota.quota * 0.05 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40406
|
+
import_material44.Chip,
|
|
38909
40407
|
{
|
|
38910
40408
|
label: `\u2248${formatBytes(storageQuota.browserQuotaEstimate)} Browser Estimate`,
|
|
38911
40409
|
color: "default",
|
|
@@ -38914,8 +40412,8 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38914
40412
|
}
|
|
38915
40413
|
)
|
|
38916
40414
|
] }),
|
|
38917
|
-
/* @__PURE__ */ (0,
|
|
38918
|
-
|
|
40415
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40416
|
+
import_material44.LinearProgress,
|
|
38919
40417
|
{
|
|
38920
40418
|
variant: "determinate",
|
|
38921
40419
|
value: usagePercentage,
|
|
@@ -38930,38 +40428,38 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38930
40428
|
}
|
|
38931
40429
|
}
|
|
38932
40430
|
),
|
|
38933
|
-
/* @__PURE__ */ (0,
|
|
40431
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "caption", color: "text.secondary", sx: { mt: 0.5, display: "block" }, children: [
|
|
38934
40432
|
usagePercentage.toFixed(1),
|
|
38935
40433
|
"% used"
|
|
38936
40434
|
] })
|
|
38937
40435
|
] }),
|
|
38938
|
-
usagePercentage > 80 && /* @__PURE__ */ (0,
|
|
40436
|
+
usagePercentage > 80 && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Alert, { severity: "warning", sx: { mt: "auto" }, children: "Storage usage is high. Consider clearing unused data." })
|
|
38939
40437
|
] }) }),
|
|
38940
|
-
/* @__PURE__ */ (0,
|
|
40438
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.CardContent, { sx: {
|
|
38941
40439
|
display: "flex",
|
|
38942
40440
|
flexDirection: "column",
|
|
38943
40441
|
minHeight: 140
|
|
38944
40442
|
}, children: [
|
|
38945
|
-
/* @__PURE__ */ (0,
|
|
38946
|
-
/* @__PURE__ */ (0,
|
|
38947
|
-
/* @__PURE__ */ (0,
|
|
38948
|
-
|
|
40443
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "h6", gutterBottom: true, sx: { fontWeight: 600, color: "text.primary" }, children: "Usage Summary" }),
|
|
40444
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mb: 2 }, children: [
|
|
40445
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40446
|
+
import_material44.Chip,
|
|
38949
40447
|
{
|
|
38950
40448
|
label: `${storageCategories.length} Categories`,
|
|
38951
40449
|
color: "primary",
|
|
38952
40450
|
size: "small"
|
|
38953
40451
|
}
|
|
38954
40452
|
),
|
|
38955
|
-
/* @__PURE__ */ (0,
|
|
38956
|
-
|
|
40453
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40454
|
+
import_material44.Chip,
|
|
38957
40455
|
{
|
|
38958
40456
|
label: `${storageCategories.reduce((sum, cat) => sum + cat.itemCount, 0)} Items`,
|
|
38959
40457
|
color: "secondary",
|
|
38960
40458
|
size: "small"
|
|
38961
40459
|
}
|
|
38962
40460
|
),
|
|
38963
|
-
/* @__PURE__ */ (0,
|
|
38964
|
-
|
|
40461
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40462
|
+
import_material44.Chip,
|
|
38965
40463
|
{
|
|
38966
40464
|
label: `${formatBytes(totalUsed)} Used`,
|
|
38967
40465
|
color: "info",
|
|
@@ -38969,11 +40467,11 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38969
40467
|
}
|
|
38970
40468
|
)
|
|
38971
40469
|
] }),
|
|
38972
|
-
/* @__PURE__ */ (0,
|
|
40470
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", color: "text.secondary", sx: { mt: "auto" }, children: usageSummaryMessage })
|
|
38973
40471
|
] }) })
|
|
38974
40472
|
] }),
|
|
38975
|
-
/* @__PURE__ */ (0,
|
|
38976
|
-
/* @__PURE__ */ (0,
|
|
40473
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "h6", gutterBottom: true, sx: { mb: 2, fontWeight: 600, color: "text.primary" }, children: "Storage Categories" }),
|
|
40474
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: {
|
|
38977
40475
|
maxHeight: "60vh",
|
|
38978
40476
|
overflow: "auto",
|
|
38979
40477
|
"&::-webkit-scrollbar": {
|
|
@@ -38981,15 +40479,15 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
38981
40479
|
},
|
|
38982
40480
|
msOverflowStyle: "none",
|
|
38983
40481
|
scrollbarWidth: "none"
|
|
38984
|
-
}, children: storageCategories.length === 0 ? /* @__PURE__ */ (0,
|
|
38985
|
-
/* @__PURE__ */ (0,
|
|
38986
|
-
/* @__PURE__ */ (0,
|
|
38987
|
-
/* @__PURE__ */ (0,
|
|
38988
|
-
/* @__PURE__ */ (0,
|
|
38989
|
-
/* @__PURE__ */ (0,
|
|
40482
|
+
}, children: storageCategories.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Alert, { severity: "info", sx: { mt: 2 }, children: [
|
|
40483
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", children: "No storage data found. This could mean:" }),
|
|
40484
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "body2", component: "ul", sx: { mt: 1, pl: 2 }, children: [
|
|
40485
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: "All databases are empty" }),
|
|
40486
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: "Data is stored under different names" }),
|
|
40487
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("li", { children: "There was an error accessing the databases" })
|
|
38990
40488
|
] }),
|
|
38991
|
-
/* @__PURE__ */ (0,
|
|
38992
|
-
] }) : /* @__PURE__ */ (0,
|
|
40489
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", sx: { mt: 1 }, children: 'Try clicking "Refresh" or check the browser console for more details.' })
|
|
40490
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Stack, { spacing: 2, children: storageCategories.map((category) => {
|
|
38993
40491
|
const IconComponent = category.icon;
|
|
38994
40492
|
const categoryPercentage = storageQuota.quota > 0 ? category.size / storageQuota.quota * 100 : 0;
|
|
38995
40493
|
const categoryRelativePercentage = totalUsed > 0 ? category.size / totalUsed * 100 : 0;
|
|
@@ -39000,18 +40498,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39000
40498
|
categoryPercentage: categoryPercentage.toFixed(2),
|
|
39001
40499
|
categoryRelativePercentage: categoryRelativePercentage.toFixed(2)
|
|
39002
40500
|
});
|
|
39003
|
-
return /* @__PURE__ */ (0,
|
|
39004
|
-
/* @__PURE__ */ (0,
|
|
39005
|
-
|
|
40501
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Accordion, { sx: { bgcolor: "background.paper" }, children: [
|
|
40502
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40503
|
+
import_material44.AccordionSummary,
|
|
39006
40504
|
{
|
|
39007
|
-
expandIcon: /* @__PURE__ */ (0,
|
|
40505
|
+
expandIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_ExpandMore3.default, {}),
|
|
39008
40506
|
"aria-controls": `${category.name}-content`,
|
|
39009
40507
|
id: `${category.name}-header`,
|
|
39010
|
-
children: /* @__PURE__ */ (0,
|
|
39011
|
-
/* @__PURE__ */ (0,
|
|
39012
|
-
/* @__PURE__ */ (0,
|
|
39013
|
-
/* @__PURE__ */ (0,
|
|
39014
|
-
|
|
40508
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", width: "100%", pr: 2 }, children: [
|
|
40509
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(IconComponent, { sx: { color: category.color, mr: 2 } }),
|
|
40510
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { flex: 1 }, children: [
|
|
40511
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40512
|
+
import_material44.Typography,
|
|
39015
40513
|
{
|
|
39016
40514
|
variant: "body1",
|
|
39017
40515
|
style: {
|
|
@@ -39021,18 +40519,18 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39021
40519
|
children: category.name
|
|
39022
40520
|
}
|
|
39023
40521
|
),
|
|
39024
|
-
/* @__PURE__ */ (0,
|
|
39025
|
-
/* @__PURE__ */ (0,
|
|
39026
|
-
/* @__PURE__ */ (0,
|
|
39027
|
-
|
|
40522
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 2, mt: 0.5 }, children: [
|
|
40523
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", color: "text.secondary", children: formatBytes(category.size) }),
|
|
40524
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40525
|
+
import_material44.Chip,
|
|
39028
40526
|
{
|
|
39029
40527
|
label: `${category.itemCount} items`,
|
|
39030
40528
|
size: "small",
|
|
39031
40529
|
variant: "outlined"
|
|
39032
40530
|
}
|
|
39033
40531
|
),
|
|
39034
|
-
/* @__PURE__ */ (0,
|
|
39035
|
-
|
|
40532
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Box, { sx: { flex: 1, mx: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40533
|
+
import_material44.LinearProgress,
|
|
39036
40534
|
{
|
|
39037
40535
|
variant: "determinate",
|
|
39038
40536
|
value: Math.min(categoryRelativePercentage, 100),
|
|
@@ -39047,7 +40545,7 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39047
40545
|
}
|
|
39048
40546
|
}
|
|
39049
40547
|
) }),
|
|
39050
|
-
/* @__PURE__ */ (0,
|
|
40548
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "caption", color: "text.secondary", children: [
|
|
39051
40549
|
categoryRelativePercentage.toFixed(1),
|
|
39052
40550
|
"%"
|
|
39053
40551
|
] })
|
|
@@ -39056,27 +40554,27 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39056
40554
|
] })
|
|
39057
40555
|
}
|
|
39058
40556
|
),
|
|
39059
|
-
/* @__PURE__ */ (0,
|
|
39060
|
-
/* @__PURE__ */ (0,
|
|
39061
|
-
/* @__PURE__ */ (0,
|
|
39062
|
-
/* @__PURE__ */ (0,
|
|
39063
|
-
/* @__PURE__ */ (0,
|
|
39064
|
-
/* @__PURE__ */ (0,
|
|
39065
|
-
|
|
40557
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.AccordionDetails, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { pl: 5 }, children: [
|
|
40558
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", color: "text.secondary", paragraph: true, children: category.description }),
|
|
40559
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "subtitle2", gutterBottom: true, children: "Storage Locations:" }),
|
|
40560
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.List, { dense: true, children: category.stores.map((store) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { sx: { py: 0.5 }, children: [
|
|
40561
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { sx: { minWidth: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Storage.default, { fontSize: "small" }) }),
|
|
40562
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40563
|
+
import_material44.ListItemText,
|
|
39066
40564
|
{
|
|
39067
40565
|
primary: store,
|
|
39068
40566
|
primaryTypographyProps: { variant: "body2", fontFamily: "monospace" }
|
|
39069
40567
|
}
|
|
39070
40568
|
)
|
|
39071
40569
|
] }, store)) }),
|
|
39072
|
-
category.canClear ? /* @__PURE__ */ (0,
|
|
39073
|
-
/* @__PURE__ */ (0,
|
|
39074
|
-
|
|
40570
|
+
category.canClear ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { mt: 2, pt: 2, borderTop: 1, borderColor: "divider" }, children: [
|
|
40571
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40572
|
+
import_material44.Button,
|
|
39075
40573
|
{
|
|
39076
40574
|
variant: "outlined",
|
|
39077
40575
|
color: "error",
|
|
39078
40576
|
size: "small",
|
|
39079
|
-
startIcon: /* @__PURE__ */ (0,
|
|
40577
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Delete7.default, {}),
|
|
39080
40578
|
onClick: () => setClearCategoryDialog(category),
|
|
39081
40579
|
disabled: clearing,
|
|
39082
40580
|
children: [
|
|
@@ -39085,19 +40583,19 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39085
40583
|
]
|
|
39086
40584
|
}
|
|
39087
40585
|
),
|
|
39088
|
-
category.clearWarning && /* @__PURE__ */ (0,
|
|
39089
|
-
] }) : /* @__PURE__ */ (0,
|
|
40586
|
+
category.clearWarning && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Alert, { severity: "warning", sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "caption", children: category.clearWarning }) })
|
|
40587
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Alert, { severity: "info", sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "caption", children: category.itemCount === 0 ? "This category is empty." : "This category cannot be cleared automatically." }) })
|
|
39090
40588
|
] }) })
|
|
39091
40589
|
] }, category.name);
|
|
39092
40590
|
}) }) }),
|
|
39093
|
-
/* @__PURE__ */ (0,
|
|
39094
|
-
/* @__PURE__ */ (0,
|
|
39095
|
-
/* @__PURE__ */ (0,
|
|
40591
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Card, { sx: { mt: 4 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.CardContent, { children: [
|
|
40592
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "h6", gutterBottom: true, sx: { fontWeight: 600, color: "text.primary" }, children: [
|
|
40593
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Info2.default, { sx: { mr: 1, verticalAlign: "middle" } }),
|
|
39096
40594
|
"Storage Tips & Clear Options"
|
|
39097
40595
|
] }),
|
|
39098
|
-
/* @__PURE__ */ (0,
|
|
39099
|
-
/* @__PURE__ */ (0,
|
|
39100
|
-
/* @__PURE__ */ (0,
|
|
40596
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.List, { children: [
|
|
40597
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { children: [
|
|
40598
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
39101
40599
|
import_CheckCircle3.default,
|
|
39102
40600
|
{
|
|
39103
40601
|
sx: {
|
|
@@ -39105,38 +40603,38 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39105
40603
|
}
|
|
39106
40604
|
}
|
|
39107
40605
|
) }),
|
|
39108
|
-
/* @__PURE__ */ (0,
|
|
39109
|
-
|
|
40606
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40607
|
+
import_material44.ListItemText,
|
|
39110
40608
|
{
|
|
39111
40609
|
primary: storageStatusPrimary,
|
|
39112
40610
|
secondary: syncFeaturesActive ? "Some features (conversation sync or advanced vector storage) can sync items to your configured gateway storage." : "With conversation sync and advanced vector storage turned off, everything stays in this browser."
|
|
39113
40611
|
}
|
|
39114
40612
|
)
|
|
39115
40613
|
] }),
|
|
39116
|
-
/* @__PURE__ */ (0,
|
|
39117
|
-
/* @__PURE__ */ (0,
|
|
39118
|
-
/* @__PURE__ */ (0,
|
|
39119
|
-
|
|
40614
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { children: [
|
|
40615
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_CleaningServices.default, { color: "info" }) }),
|
|
40616
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40617
|
+
import_material44.ListItemText,
|
|
39120
40618
|
{
|
|
39121
40619
|
primary: "Clear All Data (Safe)",
|
|
39122
40620
|
secondary: "Deletes all items but keeps database structure intact. App continues working normally."
|
|
39123
40621
|
}
|
|
39124
40622
|
)
|
|
39125
40623
|
] }),
|
|
39126
|
-
/* @__PURE__ */ (0,
|
|
39127
|
-
/* @__PURE__ */ (0,
|
|
39128
|
-
/* @__PURE__ */ (0,
|
|
39129
|
-
|
|
40624
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { children: [
|
|
40625
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Delete7.default, { color: "error" }) }),
|
|
40626
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40627
|
+
import_material44.ListItemText,
|
|
39130
40628
|
{
|
|
39131
40629
|
primary: "Nuclear Clear (Complete Reset)",
|
|
39132
40630
|
secondary: "Completely destroys all databases and forces app reload. Use only for complete reset."
|
|
39133
40631
|
}
|
|
39134
40632
|
)
|
|
39135
40633
|
] }),
|
|
39136
|
-
/* @__PURE__ */ (0,
|
|
39137
|
-
/* @__PURE__ */ (0,
|
|
39138
|
-
/* @__PURE__ */ (0,
|
|
39139
|
-
|
|
40634
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { children: [
|
|
40635
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Warning.default, { color: "warning" }) }),
|
|
40636
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40637
|
+
import_material44.ListItemText,
|
|
39140
40638
|
{
|
|
39141
40639
|
primary: "Backup important data",
|
|
39142
40640
|
secondary: "Export custom models and important documents before clearing storage"
|
|
@@ -39145,38 +40643,38 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39145
40643
|
] })
|
|
39146
40644
|
] })
|
|
39147
40645
|
] }) }),
|
|
39148
|
-
/* @__PURE__ */ (0,
|
|
39149
|
-
|
|
40646
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40647
|
+
import_material44.Dialog,
|
|
39150
40648
|
{
|
|
39151
40649
|
open: !!clearCategoryDialog,
|
|
39152
40650
|
onClose: () => setClearCategoryDialog(null),
|
|
39153
40651
|
maxWidth: "sm",
|
|
39154
40652
|
fullWidth: true,
|
|
39155
40653
|
children: [
|
|
39156
|
-
/* @__PURE__ */ (0,
|
|
39157
|
-
/* @__PURE__ */ (0,
|
|
40654
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.DialogTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
40655
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Warning.default, { color: "warning" }),
|
|
39158
40656
|
"Clear ",
|
|
39159
40657
|
clearCategoryDialog?.name,
|
|
39160
40658
|
"?"
|
|
39161
40659
|
] }) }),
|
|
39162
|
-
/* @__PURE__ */ (0,
|
|
39163
|
-
/* @__PURE__ */ (0,
|
|
40660
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogContent, { children: [
|
|
40661
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogContentText, { children: [
|
|
39164
40662
|
'This will permanently delete all data in the "',
|
|
39165
40663
|
clearCategoryDialog?.name,
|
|
39166
40664
|
'" category.'
|
|
39167
40665
|
] }),
|
|
39168
|
-
clearCategoryDialog?.clearWarning && /* @__PURE__ */ (0,
|
|
39169
|
-
clearCategoryDialog && /* @__PURE__ */ (0,
|
|
39170
|
-
/* @__PURE__ */ (0,
|
|
39171
|
-
/* @__PURE__ */ (0,
|
|
40666
|
+
clearCategoryDialog?.clearWarning && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Alert, { severity: "warning", sx: { mt: 2 }, children: clearCategoryDialog.clearWarning }),
|
|
40667
|
+
clearCategoryDialog && /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { mt: 2, p: 2, bgcolor: "action.hover", borderRadius: 1 }, children: [
|
|
40668
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Typography, { variant: "body2", color: "text.secondary", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("strong", { children: "Will clear:" }) }),
|
|
40669
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "body2", sx: { fontFamily: "monospace", mt: 1 }, children: [
|
|
39172
40670
|
"\u2022 ",
|
|
39173
40671
|
clearCategoryDialog.itemCount,
|
|
39174
40672
|
" items",
|
|
39175
|
-
/* @__PURE__ */ (0,
|
|
40673
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("br", {}),
|
|
39176
40674
|
"\u2022 ",
|
|
39177
40675
|
formatBytes(clearCategoryDialog.size),
|
|
39178
40676
|
" of data",
|
|
39179
|
-
/* @__PURE__ */ (0,
|
|
40677
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("br", {}),
|
|
39180
40678
|
"\u2022 ",
|
|
39181
40679
|
clearCategoryDialog.stores.length,
|
|
39182
40680
|
" storage location",
|
|
@@ -39184,22 +40682,22 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39184
40682
|
] })
|
|
39185
40683
|
] })
|
|
39186
40684
|
] }),
|
|
39187
|
-
/* @__PURE__ */ (0,
|
|
39188
|
-
/* @__PURE__ */ (0,
|
|
39189
|
-
|
|
40685
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogActions, { children: [
|
|
40686
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40687
|
+
import_material44.Button,
|
|
39190
40688
|
{
|
|
39191
40689
|
onClick: () => setClearCategoryDialog(null),
|
|
39192
40690
|
disabled: clearing,
|
|
39193
40691
|
children: "Cancel"
|
|
39194
40692
|
}
|
|
39195
40693
|
),
|
|
39196
|
-
/* @__PURE__ */ (0,
|
|
39197
|
-
|
|
40694
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40695
|
+
import_material44.Button,
|
|
39198
40696
|
{
|
|
39199
40697
|
onClick: () => clearCategoryDialog && handleClearCategory(clearCategoryDialog),
|
|
39200
40698
|
color: "error",
|
|
39201
40699
|
variant: "contained",
|
|
39202
|
-
startIcon: clearing ? /* @__PURE__ */ (0,
|
|
40700
|
+
startIcon: clearing ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.CircularProgress, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Delete7.default, {}),
|
|
39203
40701
|
disabled: clearing,
|
|
39204
40702
|
children: clearing ? "Clearing..." : "Clear Data"
|
|
39205
40703
|
}
|
|
@@ -39208,51 +40706,51 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39208
40706
|
]
|
|
39209
40707
|
}
|
|
39210
40708
|
),
|
|
39211
|
-
/* @__PURE__ */ (0,
|
|
39212
|
-
|
|
40709
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
|
|
40710
|
+
import_material44.Dialog,
|
|
39213
40711
|
{
|
|
39214
40712
|
open: clearAllDialogOpen,
|
|
39215
40713
|
onClose: () => setClearAllDialogOpen(false),
|
|
39216
40714
|
maxWidth: "sm",
|
|
39217
40715
|
fullWidth: true,
|
|
39218
40716
|
children: [
|
|
39219
|
-
/* @__PURE__ */ (0,
|
|
39220
|
-
/* @__PURE__ */ (0,
|
|
40717
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.DialogTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
40718
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_Error3.default, { color: "error" }),
|
|
39221
40719
|
"Clear All Storage Data?"
|
|
39222
40720
|
] }) }),
|
|
39223
|
-
/* @__PURE__ */ (0,
|
|
39224
|
-
/* @__PURE__ */ (0,
|
|
39225
|
-
/* @__PURE__ */ (0,
|
|
39226
|
-
/* @__PURE__ */ (0,
|
|
39227
|
-
/* @__PURE__ */ (0,
|
|
39228
|
-
|
|
40721
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogContent, { children: [
|
|
40722
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.DialogContentText, { children: "This will permanently delete ALL your local data including:" }),
|
|
40723
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.List, { dense: true, sx: { mt: 1 }, children: clearableCategories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.ListItem, { children: [
|
|
40724
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.ListItemIcon, { sx: { minWidth: 32 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(category.icon, { fontSize: "small", sx: { color: category.color } }) }),
|
|
40725
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40726
|
+
import_material44.ListItemText,
|
|
39229
40727
|
{
|
|
39230
40728
|
primary: category.name,
|
|
39231
40729
|
secondary: `${category.itemCount} items \u2022 ${formatBytes(category.size)}`
|
|
39232
40730
|
}
|
|
39233
40731
|
)
|
|
39234
40732
|
] }, category.name)) }),
|
|
39235
|
-
/* @__PURE__ */ (0,
|
|
39236
|
-
/* @__PURE__ */ (0,
|
|
40733
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.Alert, { severity: "error", sx: { mt: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.Typography, { variant: "body2", children: [
|
|
40734
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("strong", { children: "This action cannot be undone!" }),
|
|
39237
40735
|
" Make sure to export any important data before proceeding."
|
|
39238
40736
|
] }) })
|
|
39239
40737
|
] }),
|
|
39240
|
-
/* @__PURE__ */ (0,
|
|
39241
|
-
/* @__PURE__ */ (0,
|
|
39242
|
-
|
|
40738
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_material44.DialogActions, { children: [
|
|
40739
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40740
|
+
import_material44.Button,
|
|
39243
40741
|
{
|
|
39244
40742
|
onClick: () => setClearAllDialogOpen(false),
|
|
39245
40743
|
disabled: clearing,
|
|
39246
40744
|
children: "Cancel"
|
|
39247
40745
|
}
|
|
39248
40746
|
),
|
|
39249
|
-
/* @__PURE__ */ (0,
|
|
39250
|
-
|
|
40747
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40748
|
+
import_material44.Button,
|
|
39251
40749
|
{
|
|
39252
40750
|
onClick: handleClearAll,
|
|
39253
40751
|
color: "error",
|
|
39254
40752
|
variant: "contained",
|
|
39255
|
-
startIcon: clearing ? /* @__PURE__ */ (0,
|
|
40753
|
+
startIcon: clearing ? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_material44.CircularProgress, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_CleaningServices.default, {}),
|
|
39256
40754
|
disabled: clearing,
|
|
39257
40755
|
children: clearing ? "Clearing All..." : "Clear All Data"
|
|
39258
40756
|
}
|
|
@@ -39261,15 +40759,15 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39261
40759
|
]
|
|
39262
40760
|
}
|
|
39263
40761
|
),
|
|
39264
|
-
/* @__PURE__ */ (0,
|
|
39265
|
-
|
|
40762
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40763
|
+
import_material44.Snackbar,
|
|
39266
40764
|
{
|
|
39267
40765
|
open: showSnackbar,
|
|
39268
40766
|
autoHideDuration: 4e3,
|
|
39269
40767
|
onClose: () => setShowSnackbar(false),
|
|
39270
40768
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
39271
|
-
children: /* @__PURE__ */ (0,
|
|
39272
|
-
|
|
40769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
40770
|
+
import_material44.Alert,
|
|
39273
40771
|
{
|
|
39274
40772
|
onClose: () => setShowSnackbar(false),
|
|
39275
40773
|
severity: snackbarSeverity,
|
|
@@ -39285,21 +40783,21 @@ var StorageTab = ({ currentTheme }) => {
|
|
|
39285
40783
|
var StorageTab_default = StorageTab;
|
|
39286
40784
|
|
|
39287
40785
|
// src/management/components/ProviderTab.tsx
|
|
39288
|
-
var
|
|
39289
|
-
var
|
|
40786
|
+
var import_react55 = require("react");
|
|
40787
|
+
var import_material45 = require("@mui/material");
|
|
39290
40788
|
init_aiProviderStore();
|
|
39291
40789
|
init_packageSettingsStore();
|
|
39292
40790
|
init_common_types();
|
|
39293
40791
|
init_ai_provider_factory();
|
|
39294
40792
|
init_debugLogger();
|
|
39295
40793
|
init_indexedDBService();
|
|
39296
|
-
var
|
|
40794
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
39297
40795
|
var ProviderTab = () => {
|
|
39298
40796
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
39299
40797
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
39300
|
-
const theme = (0,
|
|
39301
|
-
const isMobile = (0,
|
|
39302
|
-
const getSuggestedModel = (0,
|
|
40798
|
+
const theme = (0, import_material45.useTheme)();
|
|
40799
|
+
const isMobile = (0, import_material45.useMediaQuery)(theme.breakpoints.down("sm"));
|
|
40800
|
+
const getSuggestedModel = (0, import_react55.useCallback)((type) => {
|
|
39303
40801
|
const configuredDefault = packageSettings?.defaultModel?.trim();
|
|
39304
40802
|
if (configuredDefault) {
|
|
39305
40803
|
return configuredDefault;
|
|
@@ -39315,7 +40813,7 @@ var ProviderTab = () => {
|
|
|
39315
40813
|
return "";
|
|
39316
40814
|
}
|
|
39317
40815
|
}, [packageSettings?.defaultModel]);
|
|
39318
|
-
const applyDefaultModel = (0,
|
|
40816
|
+
const applyDefaultModel = (0, import_react55.useCallback)((config) => {
|
|
39319
40817
|
const normalized = { ...config };
|
|
39320
40818
|
const trimmed = typeof normalized.defaultModel === "string" ? normalized.defaultModel.trim() : void 0;
|
|
39321
40819
|
const requiresModel = normalized.type === "openai" /* OPENAI */ || normalized.type === "xai" /* XAI */ || normalized.type === "bandit" /* BANDIT */;
|
|
@@ -39335,7 +40833,7 @@ var ProviderTab = () => {
|
|
|
39335
40833
|
}
|
|
39336
40834
|
return normalized;
|
|
39337
40835
|
}, [getSuggestedModel]);
|
|
39338
|
-
const sanitizeConfigForSave = (0,
|
|
40836
|
+
const sanitizeConfigForSave = (0, import_react55.useCallback)((config) => {
|
|
39339
40837
|
const sanitized = { ...config };
|
|
39340
40838
|
if (typeof sanitized.defaultModel === "string") {
|
|
39341
40839
|
const trimmed = sanitized.defaultModel.trim();
|
|
@@ -39347,15 +40845,15 @@ var ProviderTab = () => {
|
|
|
39347
40845
|
}
|
|
39348
40846
|
return sanitized;
|
|
39349
40847
|
}, []);
|
|
39350
|
-
const [providerConfig, setProviderConfig] = (0,
|
|
40848
|
+
const [providerConfig, setProviderConfig] = (0, import_react55.useState)({
|
|
39351
40849
|
type: "gateway",
|
|
39352
40850
|
gatewayUrl: packageSettings?.gatewayApiUrl || "",
|
|
39353
40851
|
provider: "bandit"
|
|
39354
40852
|
});
|
|
39355
|
-
const [isProviderConfigOpen, setIsProviderConfigOpen] = (0,
|
|
39356
|
-
const [snackbarMessage, setSnackbarMessage] = (0,
|
|
39357
|
-
const [showSnackbar, setShowSnackbar] = (0,
|
|
39358
|
-
const [snackbarSeverity, setSnackbarSeverity] = (0,
|
|
40853
|
+
const [isProviderConfigOpen, setIsProviderConfigOpen] = (0, import_react55.useState)(false);
|
|
40854
|
+
const [snackbarMessage, setSnackbarMessage] = (0, import_react55.useState)("");
|
|
40855
|
+
const [showSnackbar, setShowSnackbar] = (0, import_react55.useState)(false);
|
|
40856
|
+
const [snackbarSeverity, setSnackbarSeverity] = (0, import_react55.useState)("success");
|
|
39359
40857
|
const saveProviderConfigToDB = async (config) => {
|
|
39360
40858
|
try {
|
|
39361
40859
|
const { tokenFactory: _tokenFactory, ...persistableConfig } = config;
|
|
@@ -39396,7 +40894,7 @@ var ProviderTab = () => {
|
|
|
39396
40894
|
}
|
|
39397
40895
|
return null;
|
|
39398
40896
|
};
|
|
39399
|
-
const convertAnthropicConfig = (0,
|
|
40897
|
+
const convertAnthropicConfig = (0, import_react55.useCallback)((config) => {
|
|
39400
40898
|
if (!config) return null;
|
|
39401
40899
|
if (config.type !== "anthropic" /* ANTHROPIC */) {
|
|
39402
40900
|
return config;
|
|
@@ -39412,7 +40910,7 @@ var ProviderTab = () => {
|
|
|
39412
40910
|
};
|
|
39413
40911
|
return converted;
|
|
39414
40912
|
}, [packageSettings?.gatewayApiUrl]);
|
|
39415
|
-
(0,
|
|
40913
|
+
(0, import_react55.useEffect)(() => {
|
|
39416
40914
|
const initializeProviderConfig = async () => {
|
|
39417
40915
|
const savedConfig = await loadProviderConfigFromDB();
|
|
39418
40916
|
if (savedConfig) {
|
|
@@ -39547,18 +41045,18 @@ var ProviderTab = () => {
|
|
|
39547
41045
|
showMessage("Connection test failed. Please check your configuration.", "error");
|
|
39548
41046
|
}
|
|
39549
41047
|
};
|
|
39550
|
-
return /* @__PURE__ */ (0,
|
|
39551
|
-
/* @__PURE__ */ (0,
|
|
39552
|
-
/* @__PURE__ */ (0,
|
|
39553
|
-
|
|
41048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { p: { xs: 1.5, sm: 3, md: 4 } }, children: [
|
|
41049
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { mb: { xs: 2.5, md: 3 } }, children: [
|
|
41050
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41051
|
+
import_material45.Typography,
|
|
39554
41052
|
{
|
|
39555
41053
|
variant: "h5",
|
|
39556
41054
|
sx: { fontWeight: 600, mb: 1, color: "primary.main", fontSize: { xs: "1.6rem", md: "1.8rem" } },
|
|
39557
41055
|
children: "AI Provider Configuration"
|
|
39558
41056
|
}
|
|
39559
41057
|
),
|
|
39560
|
-
/* @__PURE__ */ (0,
|
|
39561
|
-
|
|
41058
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41059
|
+
import_material45.Typography,
|
|
39562
41060
|
{
|
|
39563
41061
|
variant: "body1",
|
|
39564
41062
|
color: "text.secondary",
|
|
@@ -39567,23 +41065,23 @@ var ProviderTab = () => {
|
|
|
39567
41065
|
children: "Configure your AI provider for chat, generation, and model services. This determines which backend service powers your AI interactions."
|
|
39568
41066
|
}
|
|
39569
41067
|
),
|
|
39570
|
-
/* @__PURE__ */ (0,
|
|
39571
|
-
/* @__PURE__ */ (0,
|
|
39572
|
-
currentProvider ? /* @__PURE__ */ (0,
|
|
39573
|
-
/* @__PURE__ */ (0,
|
|
39574
|
-
|
|
41068
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Paper, { sx: { p: { xs: 1.75, sm: 2.5 }, mb: { xs: 2, md: 3 }, bgcolor: "background.paper", border: "1px solid", borderColor: "divider" }, children: [
|
|
41069
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { mb: 2, fontWeight: 600, color: "text.primary" }, children: "Current Provider" }),
|
|
41070
|
+
currentProvider ? /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
41071
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41072
|
+
import_material45.Chip,
|
|
39575
41073
|
{
|
|
39576
41074
|
label: currentProvider.getProviderType().toUpperCase(),
|
|
39577
41075
|
color: "primary",
|
|
39578
41076
|
variant: "filled"
|
|
39579
41077
|
}
|
|
39580
41078
|
),
|
|
39581
|
-
/* @__PURE__ */ (0,
|
|
39582
|
-
] }) : /* @__PURE__ */ (0,
|
|
41079
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", color: "text.secondary", children: currentProviderConfig?.baseUrl || currentProviderConfig?.gatewayUrl || "No URL configured" })
|
|
41080
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Chip, { label: "No Provider Configured", color: "warning" })
|
|
39583
41081
|
] }),
|
|
39584
|
-
/* @__PURE__ */ (0,
|
|
39585
|
-
/* @__PURE__ */ (0,
|
|
39586
|
-
|
|
41082
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Paper, { sx: { p: { xs: 1.75, sm: 2.5 }, mb: { xs: 2, md: 3 }, bgcolor: "background.paper", border: "1px solid", borderColor: "divider" }, children: [
|
|
41083
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
41084
|
+
import_material45.Box,
|
|
39587
41085
|
{
|
|
39588
41086
|
sx: {
|
|
39589
41087
|
display: "flex",
|
|
@@ -39594,9 +41092,9 @@ var ProviderTab = () => {
|
|
|
39594
41092
|
mb: 3
|
|
39595
41093
|
},
|
|
39596
41094
|
children: [
|
|
39597
|
-
/* @__PURE__ */ (0,
|
|
39598
|
-
/* @__PURE__ */ (0,
|
|
39599
|
-
|
|
41095
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { fontWeight: 600, color: "text.primary" }, children: "Provider Configuration" }),
|
|
41096
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
41097
|
+
import_material45.Button,
|
|
39600
41098
|
{
|
|
39601
41099
|
variant: "outlined",
|
|
39602
41100
|
onClick: () => setIsProviderConfigOpen(!isProviderConfigOpen),
|
|
@@ -39610,9 +41108,9 @@ var ProviderTab = () => {
|
|
|
39610
41108
|
]
|
|
39611
41109
|
}
|
|
39612
41110
|
),
|
|
39613
|
-
isProviderConfigOpen && /* @__PURE__ */ (0,
|
|
39614
|
-
/* @__PURE__ */ (0,
|
|
39615
|
-
|
|
41111
|
+
isProviderConfigOpen && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { mt: 3 }, children: [
|
|
41112
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
41113
|
+
import_material45.TextField,
|
|
39616
41114
|
{
|
|
39617
41115
|
label: "Provider Type",
|
|
39618
41116
|
select: true,
|
|
@@ -39621,19 +41119,19 @@ var ProviderTab = () => {
|
|
|
39621
41119
|
fullWidth: true,
|
|
39622
41120
|
sx: { mb: 3 },
|
|
39623
41121
|
children: [
|
|
39624
|
-
/* @__PURE__ */ (0,
|
|
39625
|
-
/* @__PURE__ */ (0,
|
|
39626
|
-
/* @__PURE__ */ (0,
|
|
39627
|
-
/* @__PURE__ */ (0,
|
|
39628
|
-
/* @__PURE__ */ (0,
|
|
39629
|
-
/* @__PURE__ */ (0,
|
|
39630
|
-
/* @__PURE__ */ (0,
|
|
41122
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "gateway", children: "Gateway (Recommended)" }),
|
|
41123
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "ollama", children: "Ollama" }),
|
|
41124
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "openai", children: "OpenAI" }),
|
|
41125
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "azure-openai", children: "Azure OpenAI" }),
|
|
41126
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "bandit", children: "Bandit AI" }),
|
|
41127
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "xai", children: "xAI" }),
|
|
41128
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "playground", children: "Playground (Mock Demo)" })
|
|
39631
41129
|
]
|
|
39632
41130
|
}
|
|
39633
41131
|
),
|
|
39634
|
-
providerConfig.type === "gateway" && /* @__PURE__ */ (0,
|
|
39635
|
-
/* @__PURE__ */ (0,
|
|
39636
|
-
|
|
41132
|
+
providerConfig.type === "gateway" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
41133
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41134
|
+
import_material45.TextField,
|
|
39637
41135
|
{
|
|
39638
41136
|
label: "Gateway URL",
|
|
39639
41137
|
value: providerConfig.gatewayUrl || "",
|
|
@@ -39643,8 +41141,8 @@ var ProviderTab = () => {
|
|
|
39643
41141
|
placeholder: "https://your-gateway-api.com"
|
|
39644
41142
|
}
|
|
39645
41143
|
),
|
|
39646
|
-
/* @__PURE__ */ (0,
|
|
39647
|
-
|
|
41144
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
41145
|
+
import_material45.TextField,
|
|
39648
41146
|
{
|
|
39649
41147
|
label: "Backend Provider",
|
|
39650
41148
|
select: true,
|
|
@@ -39656,18 +41154,18 @@ var ProviderTab = () => {
|
|
|
39656
41154
|
fullWidth: true,
|
|
39657
41155
|
sx: { mb: 2 },
|
|
39658
41156
|
children: [
|
|
39659
|
-
/* @__PURE__ */ (0,
|
|
39660
|
-
/* @__PURE__ */ (0,
|
|
39661
|
-
/* @__PURE__ */ (0,
|
|
39662
|
-
/* @__PURE__ */ (0,
|
|
39663
|
-
/* @__PURE__ */ (0,
|
|
39664
|
-
/* @__PURE__ */ (0,
|
|
41157
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "openai", children: "OpenAI" }),
|
|
41158
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "azure-openai", children: "Azure OpenAI" }),
|
|
41159
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "anthropic", children: "Anthropic" }),
|
|
41160
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "ollama", children: "Ollama" }),
|
|
41161
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "bandit", children: "Bandit AI" }),
|
|
41162
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.MenuItem, { value: "xai", children: "xAI" })
|
|
39665
41163
|
]
|
|
39666
41164
|
}
|
|
39667
41165
|
)
|
|
39668
41166
|
] }),
|
|
39669
|
-
providerConfig.type === "ollama" && /* @__PURE__ */ (0,
|
|
39670
|
-
|
|
41167
|
+
providerConfig.type === "ollama" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41168
|
+
import_material45.TextField,
|
|
39671
41169
|
{
|
|
39672
41170
|
label: "Ollama URL",
|
|
39673
41171
|
value: providerConfig.baseUrl || "",
|
|
@@ -39676,9 +41174,9 @@ var ProviderTab = () => {
|
|
|
39676
41174
|
placeholder: "http://localhost:11434"
|
|
39677
41175
|
}
|
|
39678
41176
|
),
|
|
39679
|
-
providerConfig.type === "bandit" && /* @__PURE__ */ (0,
|
|
39680
|
-
/* @__PURE__ */ (0,
|
|
39681
|
-
|
|
41177
|
+
providerConfig.type === "bandit" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
41178
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41179
|
+
import_material45.TextField,
|
|
39682
41180
|
{
|
|
39683
41181
|
label: "API Base URL",
|
|
39684
41182
|
value: providerConfig.baseUrl || "",
|
|
@@ -39692,8 +41190,8 @@ var ProviderTab = () => {
|
|
|
39692
41190
|
helperText: "Defaults to https://api.burtson.ai"
|
|
39693
41191
|
}
|
|
39694
41192
|
),
|
|
39695
|
-
/* @__PURE__ */ (0,
|
|
39696
|
-
|
|
41193
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41194
|
+
import_material45.TextField,
|
|
39697
41195
|
{
|
|
39698
41196
|
label: "API Key",
|
|
39699
41197
|
type: "password",
|
|
@@ -39707,8 +41205,8 @@ var ProviderTab = () => {
|
|
|
39707
41205
|
placeholder: "bai_..."
|
|
39708
41206
|
}
|
|
39709
41207
|
),
|
|
39710
|
-
/* @__PURE__ */ (0,
|
|
39711
|
-
|
|
41208
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41209
|
+
import_material45.TextField,
|
|
39712
41210
|
{
|
|
39713
41211
|
label: "Default Model ID",
|
|
39714
41212
|
value: providerConfig.defaultModel || "",
|
|
@@ -39722,9 +41220,9 @@ var ProviderTab = () => {
|
|
|
39722
41220
|
}
|
|
39723
41221
|
)
|
|
39724
41222
|
] }),
|
|
39725
|
-
providerConfig.type === "openai" && /* @__PURE__ */ (0,
|
|
39726
|
-
/* @__PURE__ */ (0,
|
|
39727
|
-
|
|
41223
|
+
providerConfig.type === "openai" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
41224
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41225
|
+
import_material45.TextField,
|
|
39728
41226
|
{
|
|
39729
41227
|
label: "API Base URL",
|
|
39730
41228
|
value: providerConfig.baseUrl || "",
|
|
@@ -39737,8 +41235,8 @@ var ProviderTab = () => {
|
|
|
39737
41235
|
placeholder: "https://api.openai.com/v1"
|
|
39738
41236
|
}
|
|
39739
41237
|
),
|
|
39740
|
-
/* @__PURE__ */ (0,
|
|
39741
|
-
|
|
41238
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41239
|
+
import_material45.TextField,
|
|
39742
41240
|
{
|
|
39743
41241
|
label: "API Key",
|
|
39744
41242
|
type: "password",
|
|
@@ -39752,8 +41250,8 @@ var ProviderTab = () => {
|
|
|
39752
41250
|
placeholder: "sk-..."
|
|
39753
41251
|
}
|
|
39754
41252
|
),
|
|
39755
|
-
/* @__PURE__ */ (0,
|
|
39756
|
-
|
|
41253
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41254
|
+
import_material45.TextField,
|
|
39757
41255
|
{
|
|
39758
41256
|
label: "Default Model ID",
|
|
39759
41257
|
value: providerConfig.defaultModel || "",
|
|
@@ -39767,9 +41265,9 @@ var ProviderTab = () => {
|
|
|
39767
41265
|
}
|
|
39768
41266
|
)
|
|
39769
41267
|
] }),
|
|
39770
|
-
providerConfig.type === "azure-openai" && /* @__PURE__ */ (0,
|
|
39771
|
-
/* @__PURE__ */ (0,
|
|
39772
|
-
|
|
41268
|
+
providerConfig.type === "azure-openai" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
41269
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41270
|
+
import_material45.TextField,
|
|
39773
41271
|
{
|
|
39774
41272
|
label: "Azure Endpoint",
|
|
39775
41273
|
value: providerConfig.baseUrl || "",
|
|
@@ -39779,8 +41277,8 @@ var ProviderTab = () => {
|
|
|
39779
41277
|
placeholder: "https://your-resource.openai.azure.com"
|
|
39780
41278
|
}
|
|
39781
41279
|
),
|
|
39782
|
-
/* @__PURE__ */ (0,
|
|
39783
|
-
|
|
41280
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41281
|
+
import_material45.TextField,
|
|
39784
41282
|
{
|
|
39785
41283
|
label: "API Key",
|
|
39786
41284
|
type: "password",
|
|
@@ -39790,8 +41288,8 @@ var ProviderTab = () => {
|
|
|
39790
41288
|
sx: { mb: 2 }
|
|
39791
41289
|
}
|
|
39792
41290
|
),
|
|
39793
|
-
/* @__PURE__ */ (0,
|
|
39794
|
-
|
|
41291
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41292
|
+
import_material45.TextField,
|
|
39795
41293
|
{
|
|
39796
41294
|
label: "API Version",
|
|
39797
41295
|
value: providerConfig.apiVersion || "",
|
|
@@ -39801,8 +41299,8 @@ var ProviderTab = () => {
|
|
|
39801
41299
|
placeholder: "2024-02-01"
|
|
39802
41300
|
}
|
|
39803
41301
|
),
|
|
39804
|
-
/* @__PURE__ */ (0,
|
|
39805
|
-
|
|
41302
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41303
|
+
import_material45.TextField,
|
|
39806
41304
|
{
|
|
39807
41305
|
label: "Deployment Name",
|
|
39808
41306
|
value: providerConfig.deploymentName || "",
|
|
@@ -39812,9 +41310,9 @@ var ProviderTab = () => {
|
|
|
39812
41310
|
}
|
|
39813
41311
|
)
|
|
39814
41312
|
] }),
|
|
39815
|
-
providerConfig.type === "xai" && /* @__PURE__ */ (0,
|
|
39816
|
-
/* @__PURE__ */ (0,
|
|
39817
|
-
|
|
41313
|
+
providerConfig.type === "xai" && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { children: [
|
|
41314
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41315
|
+
import_material45.TextField,
|
|
39818
41316
|
{
|
|
39819
41317
|
label: "API Base URL",
|
|
39820
41318
|
value: providerConfig.baseUrl || "",
|
|
@@ -39827,8 +41325,8 @@ var ProviderTab = () => {
|
|
|
39827
41325
|
placeholder: "https://api.x.ai/v1"
|
|
39828
41326
|
}
|
|
39829
41327
|
),
|
|
39830
|
-
/* @__PURE__ */ (0,
|
|
39831
|
-
|
|
41328
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41329
|
+
import_material45.TextField,
|
|
39832
41330
|
{
|
|
39833
41331
|
label: "API Key",
|
|
39834
41332
|
type: "password",
|
|
@@ -39842,8 +41340,8 @@ var ProviderTab = () => {
|
|
|
39842
41340
|
placeholder: "xai-..."
|
|
39843
41341
|
}
|
|
39844
41342
|
),
|
|
39845
|
-
/* @__PURE__ */ (0,
|
|
39846
|
-
|
|
41343
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41344
|
+
import_material45.TextField,
|
|
39847
41345
|
{
|
|
39848
41346
|
label: "Default Model ID",
|
|
39849
41347
|
value: providerConfig.defaultModel || "",
|
|
@@ -39857,10 +41355,10 @@ var ProviderTab = () => {
|
|
|
39857
41355
|
}
|
|
39858
41356
|
)
|
|
39859
41357
|
] }),
|
|
39860
|
-
providerConfig.type === "anthropic" && /* @__PURE__ */ (0,
|
|
39861
|
-
/* @__PURE__ */ (0,
|
|
39862
|
-
/* @__PURE__ */ (0,
|
|
39863
|
-
|
|
41358
|
+
providerConfig.type === "anthropic" && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Alert, { severity: "warning", sx: { mt: 2 }, children: "Anthropic is only supported through the Bandit Gateway provider. Please switch to Gateway and select Anthropic as the backend service." }),
|
|
41359
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Box, { sx: { display: "flex", gap: 2, mt: 3 }, children: [
|
|
41360
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41361
|
+
import_material45.Button,
|
|
39864
41362
|
{
|
|
39865
41363
|
variant: "outlined",
|
|
39866
41364
|
onClick: handleTestProviderConnection,
|
|
@@ -39868,8 +41366,8 @@ var ProviderTab = () => {
|
|
|
39868
41366
|
children: "Test Connection"
|
|
39869
41367
|
}
|
|
39870
41368
|
),
|
|
39871
|
-
/* @__PURE__ */ (0,
|
|
39872
|
-
|
|
41369
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41370
|
+
import_material45.Button,
|
|
39873
41371
|
{
|
|
39874
41372
|
variant: "contained",
|
|
39875
41373
|
onClick: handleSaveProviderConfig,
|
|
@@ -39880,20 +41378,20 @@ var ProviderTab = () => {
|
|
|
39880
41378
|
] })
|
|
39881
41379
|
] })
|
|
39882
41380
|
] }),
|
|
39883
|
-
/* @__PURE__ */ (0,
|
|
39884
|
-
/* @__PURE__ */ (0,
|
|
39885
|
-
/* @__PURE__ */ (0,
|
|
41381
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_material45.Paper, { sx: { p: 3, bgcolor: "info.main", color: "info.contrastText", borderRadius: 2 }, children: [
|
|
41382
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "h6", sx: { mb: 1, fontWeight: 600, color: "text.primary" }, children: "\u{1F680} Gateway Provider Recommended" }),
|
|
41383
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_material45.Typography, { variant: "body2", children: "For production deployments, we recommend using the Gateway provider which routes requests through your secure backend API. This approach keeps API keys secure, enables rate limiting, and provides better monitoring capabilities." })
|
|
39886
41384
|
] })
|
|
39887
41385
|
] }),
|
|
39888
|
-
/* @__PURE__ */ (0,
|
|
39889
|
-
|
|
41386
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41387
|
+
import_material45.Snackbar,
|
|
39890
41388
|
{
|
|
39891
41389
|
open: showSnackbar,
|
|
39892
41390
|
autoHideDuration: 6e3,
|
|
39893
41391
|
onClose: () => setShowSnackbar(false),
|
|
39894
41392
|
anchorOrigin: { vertical: "bottom", horizontal: "left" },
|
|
39895
|
-
children: /* @__PURE__ */ (0,
|
|
39896
|
-
|
|
41393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
41394
|
+
import_material45.Alert,
|
|
39897
41395
|
{
|
|
39898
41396
|
onClose: () => setShowSnackbar(false),
|
|
39899
41397
|
severity: snackbarSeverity,
|
|
@@ -39908,9 +41406,9 @@ var ProviderTab = () => {
|
|
|
39908
41406
|
};
|
|
39909
41407
|
|
|
39910
41408
|
// src/management/components/MCPToolsTabV2.tsx
|
|
39911
|
-
var
|
|
39912
|
-
var
|
|
39913
|
-
var
|
|
41409
|
+
var import_react56 = require("react");
|
|
41410
|
+
var import_material46 = require("@mui/material");
|
|
41411
|
+
var import_Refresh5 = __toESM(require("@mui/icons-material/Refresh"));
|
|
39914
41412
|
var import_HealthAndSafety = __toESM(require("@mui/icons-material/HealthAndSafety"));
|
|
39915
41413
|
var import_ErrorOutline3 = __toESM(require("@mui/icons-material/ErrorOutline"));
|
|
39916
41414
|
var import_Settings3 = __toESM(require("@mui/icons-material/Settings"));
|
|
@@ -39927,7 +41425,7 @@ var isPlaygroundMode2 = () => {
|
|
|
39927
41425
|
const gatewayUrl = settings.gatewayApiUrl?.toLowerCase() ?? "";
|
|
39928
41426
|
return Boolean(settings.playgroundMode || gatewayUrl.startsWith("playground://"));
|
|
39929
41427
|
};
|
|
39930
|
-
function
|
|
41428
|
+
function buildUrl3(path) {
|
|
39931
41429
|
if (isPlaygroundMode2()) {
|
|
39932
41430
|
debugLogger.info("MCP controller URL build skipped in playground mode", { path });
|
|
39933
41431
|
return path.startsWith("/") ? path : `/${path}`;
|
|
@@ -39950,7 +41448,7 @@ async function fetchAvailableMcpTools() {
|
|
|
39950
41448
|
debugLogger.info("Skipping remote MCP tool fetch \u2014 playground mode active");
|
|
39951
41449
|
return [];
|
|
39952
41450
|
}
|
|
39953
|
-
const url =
|
|
41451
|
+
const url = buildUrl3("/mcp/tools");
|
|
39954
41452
|
try {
|
|
39955
41453
|
const res = await fetch(url, { headers: authHeaders() });
|
|
39956
41454
|
const data = await res.json();
|
|
@@ -39974,7 +41472,7 @@ async function fetchMcpHealth() {
|
|
|
39974
41472
|
availableTools: []
|
|
39975
41473
|
};
|
|
39976
41474
|
}
|
|
39977
|
-
const url =
|
|
41475
|
+
const url = buildUrl3("/mcp/health");
|
|
39978
41476
|
try {
|
|
39979
41477
|
const res = await fetch(url, { headers: authHeaders() });
|
|
39980
41478
|
const data = await res.json();
|
|
@@ -39991,14 +41489,14 @@ async function fetchMcpHealth() {
|
|
|
39991
41489
|
// src/management/components/MCPToolsTabV2.tsx
|
|
39992
41490
|
init_mcpToolsStore();
|
|
39993
41491
|
init_packageSettingsStore();
|
|
39994
|
-
var
|
|
41492
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
39995
41493
|
var MCPToolsTabV2 = () => {
|
|
39996
41494
|
const { settings } = usePackageSettingsStore();
|
|
39997
41495
|
const { tools: localTools, loadTools, toggleTool, addTool, updateTool, isLoaded } = useMCPToolsStore();
|
|
39998
|
-
const [loading, setLoading] = (0,
|
|
39999
|
-
const [error, setError] = (0,
|
|
40000
|
-
const [tools, setTools] = (0,
|
|
40001
|
-
const [health, setHealth] = (0,
|
|
41496
|
+
const [loading, setLoading] = (0, import_react56.useState)(true);
|
|
41497
|
+
const [error, setError] = (0, import_react56.useState)(null);
|
|
41498
|
+
const [tools, setTools] = (0, import_react56.useState)([]);
|
|
41499
|
+
const [health, setHealth] = (0, import_react56.useState)(null);
|
|
40002
41500
|
const gatewayConfigured = !!settings?.gatewayApiUrl;
|
|
40003
41501
|
const refresh = async () => {
|
|
40004
41502
|
setLoading(true);
|
|
@@ -40052,7 +41550,7 @@ var MCPToolsTabV2 = () => {
|
|
|
40052
41550
|
setLoading(false);
|
|
40053
41551
|
}
|
|
40054
41552
|
};
|
|
40055
|
-
(0,
|
|
41553
|
+
(0, import_react56.useEffect)(() => {
|
|
40056
41554
|
if (isLoaded) {
|
|
40057
41555
|
refresh();
|
|
40058
41556
|
} else {
|
|
@@ -40061,7 +41559,7 @@ var MCPToolsTabV2 = () => {
|
|
|
40061
41559
|
});
|
|
40062
41560
|
}
|
|
40063
41561
|
}, [isLoaded]);
|
|
40064
|
-
const localEnabledMap = (0,
|
|
41562
|
+
const localEnabledMap = (0, import_react56.useMemo)(() => {
|
|
40065
41563
|
const map23 = /* @__PURE__ */ new Map();
|
|
40066
41564
|
const sortedTools = [...localTools].sort((a, b) => {
|
|
40067
41565
|
if (a.isBuiltIn && !b.isBuiltIn) return -1;
|
|
@@ -40077,17 +41575,17 @@ var MCPToolsTabV2 = () => {
|
|
|
40077
41575
|
});
|
|
40078
41576
|
return map23;
|
|
40079
41577
|
}, [localTools]);
|
|
40080
|
-
return /* @__PURE__ */ (0,
|
|
40081
|
-
/* @__PURE__ */ (0,
|
|
40082
|
-
/* @__PURE__ */ (0,
|
|
40083
|
-
/* @__PURE__ */ (0,
|
|
41578
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { children: [
|
|
41579
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2 }, children: [
|
|
41580
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h5", sx: { fontWeight: 600, color: "primary.main" }, children: "Available Tools" }),
|
|
41581
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.IconButton, { onClick: refresh, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_Refresh5.default, {}) }) }) })
|
|
40084
41582
|
] }),
|
|
40085
|
-
!gatewayConfigured && /* @__PURE__ */ (0,
|
|
40086
|
-
/* @__PURE__ */ (0,
|
|
40087
|
-
health?.status === "healthy" ? /* @__PURE__ */ (0,
|
|
40088
|
-
/* @__PURE__ */ (0,
|
|
40089
|
-
/* @__PURE__ */ (0,
|
|
40090
|
-
|
|
41583
|
+
!gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "body2", color: "text.secondary", children: "Gateway API URL isn\u2019t configured. The controller endpoints will be fetched relative to this origin." }) }),
|
|
41584
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
41585
|
+
health?.status === "healthy" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_HealthAndSafety.default, { color: "success" }) : health?.status === "unhealthy" ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_ErrorOutline3.default, { color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_ErrorOutline3.default, { color: "disabled" }),
|
|
41586
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: "Controller Health" }),
|
|
41587
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
41588
|
+
import_material46.Chip,
|
|
40091
41589
|
{
|
|
40092
41590
|
size: "small",
|
|
40093
41591
|
label: (health?.status || "unknown").toString(),
|
|
@@ -40095,11 +41593,11 @@ var MCPToolsTabV2 = () => {
|
|
|
40095
41593
|
sx: { ml: 1 }
|
|
40096
41594
|
}
|
|
40097
41595
|
),
|
|
40098
|
-
health?.timestamp && /* @__PURE__ */ (0,
|
|
41596
|
+
health?.timestamp && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "caption", color: "text.secondary", sx: { ml: 1 }, children: new Date(health.timestamp).toLocaleString() })
|
|
40099
41597
|
] }) }),
|
|
40100
|
-
loading && /* @__PURE__ */ (0,
|
|
40101
|
-
error && /* @__PURE__ */ (0,
|
|
40102
|
-
/* @__PURE__ */ (0,
|
|
41598
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.LinearProgress, {}) }),
|
|
41599
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { color: "error", children: error }) }),
|
|
41600
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Stack, { spacing: 2, children: tools.map((tool) => {
|
|
40103
41601
|
let locallyEnabled = localEnabledMap.get(tool.id);
|
|
40104
41602
|
if (locallyEnabled === void 0) {
|
|
40105
41603
|
locallyEnabled = localEnabledMap.get(tool.name);
|
|
@@ -40110,17 +41608,17 @@ var MCPToolsTabV2 = () => {
|
|
|
40110
41608
|
);
|
|
40111
41609
|
locallyEnabled = directLookup?.enabled ?? tool.isEnabled;
|
|
40112
41610
|
}
|
|
40113
|
-
return /* @__PURE__ */ (0,
|
|
40114
|
-
/* @__PURE__ */ (0,
|
|
40115
|
-
/* @__PURE__ */ (0,
|
|
40116
|
-
/* @__PURE__ */ (0,
|
|
40117
|
-
/* @__PURE__ */ (0,
|
|
41611
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Paper, { sx: { p: 2 }, children: [
|
|
41612
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
|
|
41613
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { children: [
|
|
41614
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "h6", sx: { fontWeight: 700 }, children: tool.name }),
|
|
41615
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: tool.description })
|
|
40118
41616
|
] }),
|
|
40119
|
-
/* @__PURE__ */ (0,
|
|
40120
|
-
/* @__PURE__ */ (0,
|
|
40121
|
-
|
|
41617
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
41618
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
41619
|
+
import_material46.FormControlLabel,
|
|
40122
41620
|
{
|
|
40123
|
-
control: /* @__PURE__ */ (0,
|
|
41621
|
+
control: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Switch, { checked: !!locallyEnabled, onChange: () => {
|
|
40124
41622
|
let local = localTools.find((t) => t.function.name === tool.id);
|
|
40125
41623
|
if (!local) {
|
|
40126
41624
|
local = localTools.find((t) => t.function.name === tool.name);
|
|
@@ -40140,12 +41638,12 @@ var MCPToolsTabV2 = () => {
|
|
|
40140
41638
|
label: locallyEnabled ? "Enabled" : "Disabled"
|
|
40141
41639
|
}
|
|
40142
41640
|
),
|
|
40143
|
-
/* @__PURE__ */ (0,
|
|
41641
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Tooltip, { title: "Controller-driven tools (read-only schema)", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_Settings3.default, { color: "disabled" }) })
|
|
40144
41642
|
] })
|
|
40145
41643
|
] }),
|
|
40146
|
-
!!tool.supportedParameters?.length && /* @__PURE__ */ (0,
|
|
40147
|
-
/* @__PURE__ */ (0,
|
|
40148
|
-
/* @__PURE__ */ (0,
|
|
41644
|
+
!!tool.supportedParameters?.length && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material46.Box, { sx: { mt: 1.5 }, children: [
|
|
41645
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Typography, { variant: "caption", color: "text.secondary", children: "Supported parameters" }),
|
|
41646
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Box, { sx: { mt: 0.5, display: "flex", flexWrap: "wrap", gap: 1 }, children: tool.supportedParameters.map((p) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material46.Chip, { size: "small", label: p }, p)) })
|
|
40149
41647
|
] })
|
|
40150
41648
|
] }, tool.id);
|
|
40151
41649
|
}) })
|
|
@@ -40159,19 +41657,28 @@ init_banditTheme();
|
|
|
40159
41657
|
init_themeMap();
|
|
40160
41658
|
init_util();
|
|
40161
41659
|
init_brandingService();
|
|
41660
|
+
init_authenticationService();
|
|
40162
41661
|
init_debugLogger();
|
|
40163
41662
|
init_packageSettingsStore();
|
|
40164
41663
|
init_preferencesStore();
|
|
40165
41664
|
init_aiProviderStore();
|
|
41665
|
+
init_authenticationStore();
|
|
40166
41666
|
init_useNotificationService();
|
|
40167
41667
|
init_useFeatures();
|
|
40168
|
-
var
|
|
41668
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
40169
41669
|
var preloadChatPage = () => Promise.resolve().then(() => (init_chat2(), chat_exports));
|
|
41670
|
+
var buildCapabilitiesUrl = (gatewayApiUrl) => {
|
|
41671
|
+
const trimmed = gatewayApiUrl.replace(/\/$/, "");
|
|
41672
|
+
if (trimmed.endsWith("/api")) {
|
|
41673
|
+
return `${trimmed}/capabilities`;
|
|
41674
|
+
}
|
|
41675
|
+
return `${trimmed}/api/capabilities`;
|
|
41676
|
+
};
|
|
40170
41677
|
var Management = () => {
|
|
40171
41678
|
const navigate = (0, import_react_router_dom5.useNavigate)();
|
|
40172
41679
|
const notificationService2 = useNotificationService();
|
|
40173
41680
|
const isMobile = (0, import_useMediaQuery2.default)("(max-width:900px)");
|
|
40174
|
-
const [sidebarOpen, setSidebarOpen] = (0,
|
|
41681
|
+
const [sidebarOpen, setSidebarOpen] = (0, import_react57.useState)(false);
|
|
40175
41682
|
const getOptimalFabLogo = async () => {
|
|
40176
41683
|
const banditHead7 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
40177
41684
|
try {
|
|
@@ -40211,16 +41718,16 @@ var Management = () => {
|
|
|
40211
41718
|
hasTransparentLogo,
|
|
40212
41719
|
setHasTransparentLogo
|
|
40213
41720
|
} = useModelStore();
|
|
40214
|
-
const [modalOpen, setModalOpen] = (0,
|
|
41721
|
+
const [modalOpen, setModalOpen] = (0, import_react57.useState)(false);
|
|
40215
41722
|
const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
|
|
40216
|
-
const [fabLogo, setFabLogo] = (0,
|
|
40217
|
-
const [tabIndex, setTabIndex] = (0,
|
|
40218
|
-
const [logoFile, setLogoFile] = (0,
|
|
40219
|
-
const [logoBase64, setLogoBase64] = (0,
|
|
40220
|
-
const [brandingText, setBrandingText] = (0,
|
|
40221
|
-
const [theme, setTheme] = (0,
|
|
40222
|
-
const [customAvatarBase64, setCustomAvatarBase64] = (0,
|
|
40223
|
-
const [presetAvatar, setPresetAvatar] = (0,
|
|
41723
|
+
const [fabLogo, setFabLogo] = (0, import_react57.useState)(banditHead6);
|
|
41724
|
+
const [tabIndex, setTabIndex] = (0, import_react57.useState)(0);
|
|
41725
|
+
const [logoFile, setLogoFile] = (0, import_react57.useState)(null);
|
|
41726
|
+
const [logoBase64, setLogoBase64] = (0, import_react57.useState)(null);
|
|
41727
|
+
const [brandingText, setBrandingText] = (0, import_react57.useState)("");
|
|
41728
|
+
const [theme, setTheme] = (0, import_react57.useState)("bandit-dark");
|
|
41729
|
+
const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react57.useState)(null);
|
|
41730
|
+
const [presetAvatar, setPresetAvatar] = (0, import_react57.useState)(null);
|
|
40224
41731
|
const showSnackbarMessage = (message, severity = "success") => {
|
|
40225
41732
|
if (severity === "success") {
|
|
40226
41733
|
notificationService2?.showSuccess(message);
|
|
@@ -40228,16 +41735,18 @@ var Management = () => {
|
|
|
40228
41735
|
notificationService2?.showError(message);
|
|
40229
41736
|
}
|
|
40230
41737
|
};
|
|
40231
|
-
const [restoreDialogOpen, setRestoreDialogOpen] = (0,
|
|
40232
|
-
const [brandingLoaded, setBrandingLoaded] = (0,
|
|
40233
|
-
const [isLoadingBranding, setIsLoadingBranding] = (0,
|
|
41738
|
+
const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react57.useState)(false);
|
|
41739
|
+
const [brandingLoaded, setBrandingLoaded] = (0, import_react57.useState)(false);
|
|
41740
|
+
const [isLoadingBranding, setIsLoadingBranding] = (0, import_react57.useState)(false);
|
|
40234
41741
|
const { initModels } = useModelStore();
|
|
40235
41742
|
const { settings: packageSettings } = usePackageSettingsStore();
|
|
41743
|
+
const authToken = useAuthenticationStore((state) => state.token);
|
|
40236
41744
|
const { preferences, updatePreference } = usePreferencesStore();
|
|
40237
41745
|
const { hasAdminDashboard, hasLimitedAdminDashboard, getCurrentTier, hasAdvancedSearch } = useFeatures();
|
|
40238
41746
|
const { showAdminPanel, showLimitedAdminPanel } = useFeatureVisibility();
|
|
40239
41747
|
const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
|
|
40240
|
-
const [
|
|
41748
|
+
const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react57.useState)(false);
|
|
41749
|
+
const [localSelectedModel, setLocalSelectedModel] = (0, import_react57.useState)({
|
|
40241
41750
|
name: "",
|
|
40242
41751
|
tagline: "",
|
|
40243
41752
|
systemPrompt: "",
|
|
@@ -40250,7 +41759,7 @@ var Management = () => {
|
|
|
40250
41759
|
loadDocuments,
|
|
40251
41760
|
clearAllDocuments
|
|
40252
41761
|
} = useKnowledgeStore2();
|
|
40253
|
-
(0,
|
|
41762
|
+
(0, import_react57.useEffect)(() => {
|
|
40254
41763
|
if (selectedModel) {
|
|
40255
41764
|
const selected = availableModels.find((m) => m.name === selectedModel);
|
|
40256
41765
|
if (selected) {
|
|
@@ -40274,7 +41783,7 @@ var Management = () => {
|
|
|
40274
41783
|
}
|
|
40275
41784
|
}
|
|
40276
41785
|
}, [selectedModel, availableModels]);
|
|
40277
|
-
const loadBrandingConfig = (0,
|
|
41786
|
+
const loadBrandingConfig = (0, import_react57.useCallback)(async () => {
|
|
40278
41787
|
if (isLoadingBranding || brandingLoaded) {
|
|
40279
41788
|
debugLogger.warn("Branding loading already in progress or completed, skipping");
|
|
40280
41789
|
return;
|
|
@@ -40389,15 +41898,15 @@ var Management = () => {
|
|
|
40389
41898
|
setTagline,
|
|
40390
41899
|
setTheme
|
|
40391
41900
|
]);
|
|
40392
|
-
(0,
|
|
41901
|
+
(0, import_react57.useEffect)(() => {
|
|
40393
41902
|
void loadBrandingConfig();
|
|
40394
41903
|
}, [loadBrandingConfig]);
|
|
40395
41904
|
const handleOpenModal = () => setModalOpen(true);
|
|
40396
41905
|
const handleCloseModal = () => setModalOpen(false);
|
|
40397
|
-
(0,
|
|
41906
|
+
(0, import_react57.useEffect)(() => {
|
|
40398
41907
|
getOptimalFabLogo().then(setFabLogo);
|
|
40399
41908
|
}, []);
|
|
40400
|
-
(0,
|
|
41909
|
+
(0, import_react57.useEffect)(() => {
|
|
40401
41910
|
if (logoBase64) {
|
|
40402
41911
|
setFabLogo(logoBase64);
|
|
40403
41912
|
} else {
|
|
@@ -40844,7 +42353,7 @@ var Management = () => {
|
|
|
40844
42353
|
reader.readAsText(file);
|
|
40845
42354
|
}
|
|
40846
42355
|
};
|
|
40847
|
-
(0,
|
|
42356
|
+
(0, import_react57.useEffect)(() => {
|
|
40848
42357
|
if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
|
|
40849
42358
|
setLocalSelectedModel((prev) => ({
|
|
40850
42359
|
...prev,
|
|
@@ -40852,51 +42361,120 @@ var Management = () => {
|
|
|
40852
42361
|
}));
|
|
40853
42362
|
}
|
|
40854
42363
|
}, [availableModels, localSelectedModel.selectedModel]);
|
|
40855
|
-
(0,
|
|
42364
|
+
(0, import_react57.useEffect)(() => {
|
|
40856
42365
|
loadDocuments();
|
|
40857
42366
|
}, [loadDocuments]);
|
|
40858
|
-
|
|
42367
|
+
(0, import_react57.useEffect)(() => {
|
|
42368
|
+
const gatewayApiUrl = packageSettings?.gatewayApiUrl;
|
|
42369
|
+
if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
|
|
42370
|
+
setSeedPacksEnabled(false);
|
|
42371
|
+
return;
|
|
42372
|
+
}
|
|
42373
|
+
let isActive = true;
|
|
42374
|
+
const loadCapabilities = async () => {
|
|
42375
|
+
try {
|
|
42376
|
+
const token = authToken ?? authenticationService.getToken();
|
|
42377
|
+
const headers = {
|
|
42378
|
+
"Content-Type": "application/json"
|
|
42379
|
+
};
|
|
42380
|
+
if (token) {
|
|
42381
|
+
headers.Authorization = `Bearer ${token}`;
|
|
42382
|
+
}
|
|
42383
|
+
const response = await fetch(buildCapabilitiesUrl(gatewayApiUrl), {
|
|
42384
|
+
method: "GET",
|
|
42385
|
+
headers
|
|
42386
|
+
});
|
|
42387
|
+
if (!response.ok) {
|
|
42388
|
+
throw new Error(`Capabilities request failed: ${response.status}`);
|
|
42389
|
+
}
|
|
42390
|
+
const payload = await response.json();
|
|
42391
|
+
if (!isActive) {
|
|
42392
|
+
return;
|
|
42393
|
+
}
|
|
42394
|
+
setSeedPacksEnabled(Boolean(payload?.seedPacksEnabled));
|
|
42395
|
+
} catch (error) {
|
|
42396
|
+
if (!isActive) {
|
|
42397
|
+
return;
|
|
42398
|
+
}
|
|
42399
|
+
setSeedPacksEnabled(false);
|
|
42400
|
+
debugLogger.warn("Management: failed to load capabilities", {
|
|
42401
|
+
error: error instanceof Error ? error.message : String(error)
|
|
42402
|
+
});
|
|
42403
|
+
}
|
|
42404
|
+
};
|
|
42405
|
+
loadCapabilities();
|
|
42406
|
+
return () => {
|
|
42407
|
+
isActive = false;
|
|
42408
|
+
};
|
|
42409
|
+
}, [packageSettings?.gatewayApiUrl, authToken]);
|
|
42410
|
+
const currentTheme = (0, import_react57.useMemo)(() => {
|
|
42411
|
+
const baseTheme = predefinedThemes[theme] || banditDarkTheme;
|
|
42412
|
+
return (0, import_styles31.createTheme)(baseTheme, {
|
|
42413
|
+
components: {
|
|
42414
|
+
MuiInputBase: {
|
|
42415
|
+
styleOverrides: {
|
|
42416
|
+
input: {
|
|
42417
|
+
outline: "none",
|
|
42418
|
+
boxShadow: "none",
|
|
42419
|
+
"&:focus, &:focus-visible": {
|
|
42420
|
+
outline: "none",
|
|
42421
|
+
boxShadow: "none"
|
|
42422
|
+
}
|
|
42423
|
+
},
|
|
42424
|
+
inputMultiline: {
|
|
42425
|
+
outline: "none",
|
|
42426
|
+
boxShadow: "none",
|
|
42427
|
+
"&:focus, &:focus-visible": {
|
|
42428
|
+
outline: "none",
|
|
42429
|
+
boxShadow: "none"
|
|
42430
|
+
}
|
|
42431
|
+
}
|
|
42432
|
+
}
|
|
42433
|
+
}
|
|
42434
|
+
}
|
|
42435
|
+
});
|
|
42436
|
+
}, [theme]);
|
|
40859
42437
|
if (!brandingLoaded) return null;
|
|
40860
42438
|
const allNavTabs = [
|
|
40861
42439
|
{
|
|
40862
42440
|
label: "Personalities",
|
|
40863
|
-
icon: /* @__PURE__ */ (0,
|
|
42441
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_FaceRetouchingNatural.default, {}),
|
|
40864
42442
|
requiresFeature: "limitedAdminDashboard"
|
|
40865
42443
|
// Available to premium+
|
|
40866
42444
|
},
|
|
40867
42445
|
{
|
|
40868
42446
|
label: "Branding",
|
|
40869
|
-
icon: /* @__PURE__ */ (0,
|
|
42447
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Brush.default, {}),
|
|
40870
42448
|
requiresFeature: "limitedAdminDashboard"
|
|
40871
42449
|
// Available to premium+
|
|
40872
42450
|
},
|
|
40873
42451
|
{
|
|
40874
42452
|
label: "Knowledge",
|
|
40875
|
-
icon: /* @__PURE__ */ (0,
|
|
42453
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_MenuBook.default, {}),
|
|
40876
42454
|
requiresFeature: "limitedAdminDashboard"
|
|
40877
42455
|
// Available to premium+
|
|
40878
42456
|
},
|
|
40879
42457
|
{
|
|
40880
42458
|
label: "Storage",
|
|
40881
|
-
icon: /* @__PURE__ */ (0,
|
|
42459
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Storage2.default, {}),
|
|
40882
42460
|
requiresFeature: "limitedAdminDashboard"
|
|
40883
42461
|
// Available to premium+ (changed from adminDashboardEnabled)
|
|
40884
42462
|
},
|
|
40885
42463
|
{
|
|
40886
42464
|
label: "Preferences",
|
|
40887
|
-
icon: /* @__PURE__ */ (0,
|
|
42465
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Tune.default, {}),
|
|
40888
42466
|
requiresFeature: "limitedAdminDashboard"
|
|
40889
42467
|
// Available to premium+
|
|
40890
42468
|
},
|
|
40891
42469
|
{
|
|
40892
42470
|
label: "Provider",
|
|
40893
|
-
icon: /* @__PURE__ */ (0,
|
|
42471
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Cloud2.default, {}),
|
|
40894
42472
|
requiresFeature: "advancedSearch"
|
|
40895
42473
|
// Pro/Team users with advanced features
|
|
40896
42474
|
},
|
|
40897
42475
|
{
|
|
40898
42476
|
label: "MCP Tools",
|
|
40899
|
-
icon: /* @__PURE__ */ (0,
|
|
42477
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_Build.default, {}),
|
|
40900
42478
|
requiresFeature: "advancedSearch"
|
|
40901
42479
|
// Pro/Team users with advanced features
|
|
40902
42480
|
}
|
|
@@ -40913,8 +42491,8 @@ var Management = () => {
|
|
|
40913
42491
|
}
|
|
40914
42492
|
return true;
|
|
40915
42493
|
});
|
|
40916
|
-
const navigationContent = /* @__PURE__ */ (0,
|
|
40917
|
-
|
|
42494
|
+
const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
42495
|
+
import_material47.Box,
|
|
40918
42496
|
{
|
|
40919
42497
|
sx: {
|
|
40920
42498
|
display: "flex",
|
|
@@ -40924,29 +42502,29 @@ var Management = () => {
|
|
|
40924
42502
|
bgcolor: "inherit"
|
|
40925
42503
|
},
|
|
40926
42504
|
children: [
|
|
40927
|
-
isMobile && /* @__PURE__ */ (0,
|
|
40928
|
-
|
|
42505
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42506
|
+
import_material47.Box,
|
|
40929
42507
|
{
|
|
40930
42508
|
sx: {
|
|
40931
42509
|
height: 6,
|
|
40932
42510
|
width: 56,
|
|
40933
42511
|
borderRadius: 999,
|
|
40934
|
-
bgcolor: (theme2) => (0,
|
|
42512
|
+
bgcolor: (theme2) => (0, import_styles31.alpha)(theme2.palette.text.primary, 0.18),
|
|
40935
42513
|
alignSelf: "center",
|
|
40936
42514
|
mt: 1.25,
|
|
40937
42515
|
mb: 0.75
|
|
40938
42516
|
}
|
|
40939
42517
|
}
|
|
40940
42518
|
),
|
|
40941
|
-
/* @__PURE__ */ (0,
|
|
40942
|
-
|
|
42519
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42520
|
+
import_material47.Button,
|
|
40943
42521
|
{
|
|
40944
42522
|
onClick: () => {
|
|
40945
42523
|
if (isMobile) setSidebarOpen(false);
|
|
40946
42524
|
navigate("/chat");
|
|
40947
42525
|
},
|
|
40948
42526
|
onMouseEnter: preloadChatPage,
|
|
40949
|
-
startIcon: /* @__PURE__ */ (0,
|
|
42527
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_ChevronLeft.default, { sx: { fontSize: 20 } }),
|
|
40950
42528
|
fullWidth: true,
|
|
40951
42529
|
variant: "outlined",
|
|
40952
42530
|
sx: {
|
|
@@ -40973,9 +42551,9 @@ var Management = () => {
|
|
|
40973
42551
|
children: "Back to Chat"
|
|
40974
42552
|
}
|
|
40975
42553
|
) }),
|
|
40976
|
-
/* @__PURE__ */ (0,
|
|
40977
|
-
/* @__PURE__ */ (0,
|
|
40978
|
-
|
|
42554
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
|
|
42555
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
42556
|
+
import_material47.ListItemButton,
|
|
40979
42557
|
{
|
|
40980
42558
|
selected: tabIndex === idx,
|
|
40981
42559
|
onClick: () => {
|
|
@@ -41024,8 +42602,8 @@ var Management = () => {
|
|
|
41024
42602
|
}
|
|
41025
42603
|
},
|
|
41026
42604
|
children: [
|
|
41027
|
-
/* @__PURE__ */ (0,
|
|
41028
|
-
|
|
42605
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42606
|
+
import_material47.ListItemIcon,
|
|
41029
42607
|
{
|
|
41030
42608
|
sx: {
|
|
41031
42609
|
color: tabIndex === idx ? "primary.main" : "text.secondary",
|
|
@@ -41035,8 +42613,8 @@ var Management = () => {
|
|
|
41035
42613
|
children: tab.icon
|
|
41036
42614
|
}
|
|
41037
42615
|
),
|
|
41038
|
-
/* @__PURE__ */ (0,
|
|
41039
|
-
|
|
42616
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42617
|
+
import_material47.ListItemText,
|
|
41040
42618
|
{
|
|
41041
42619
|
primary: tab.label,
|
|
41042
42620
|
primaryTypographyProps: {
|
|
@@ -41046,8 +42624,8 @@ var Management = () => {
|
|
|
41046
42624
|
}
|
|
41047
42625
|
}
|
|
41048
42626
|
),
|
|
41049
|
-
tabIndex === idx && /* @__PURE__ */ (0,
|
|
41050
|
-
|
|
42627
|
+
tabIndex === idx && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42628
|
+
import_material47.Box,
|
|
41051
42629
|
{
|
|
41052
42630
|
sx: {
|
|
41053
42631
|
position: "absolute",
|
|
@@ -41069,10 +42647,10 @@ var Management = () => {
|
|
|
41069
42647
|
]
|
|
41070
42648
|
}
|
|
41071
42649
|
);
|
|
41072
|
-
return /* @__PURE__ */ (0,
|
|
41073
|
-
/* @__PURE__ */ (0,
|
|
41074
|
-
/* @__PURE__ */ (0,
|
|
41075
|
-
|
|
42650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_material47.ThemeProvider, { theme: currentTheme, children: [
|
|
42651
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.CssBaseline, {}),
|
|
42652
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
42653
|
+
import_material47.Box,
|
|
41076
42654
|
{
|
|
41077
42655
|
display: "flex",
|
|
41078
42656
|
height: "100vh",
|
|
@@ -41084,8 +42662,8 @@ var Management = () => {
|
|
|
41084
42662
|
position: "relative"
|
|
41085
42663
|
},
|
|
41086
42664
|
children: [
|
|
41087
|
-
isMobile && /* @__PURE__ */ (0,
|
|
41088
|
-
|
|
42665
|
+
isMobile && /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
42666
|
+
import_material47.Box,
|
|
41089
42667
|
{
|
|
41090
42668
|
sx: {
|
|
41091
42669
|
width: "100%",
|
|
@@ -41104,8 +42682,8 @@ var Management = () => {
|
|
|
41104
42682
|
boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
|
|
41105
42683
|
},
|
|
41106
42684
|
children: [
|
|
41107
|
-
/* @__PURE__ */ (0,
|
|
41108
|
-
|
|
42685
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42686
|
+
import_material47.Button,
|
|
41109
42687
|
{
|
|
41110
42688
|
onClick: () => setSidebarOpen((o) => !o),
|
|
41111
42689
|
sx: {
|
|
@@ -41126,7 +42704,7 @@ var Management = () => {
|
|
|
41126
42704
|
transform: sidebarOpen ? "rotate(90deg) scale(0.95)" : "scale(0.95)"
|
|
41127
42705
|
}
|
|
41128
42706
|
},
|
|
41129
|
-
children: /* @__PURE__ */ (0,
|
|
42707
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
41130
42708
|
"path",
|
|
41131
42709
|
{
|
|
41132
42710
|
d: sidebarOpen ? "M18 6L6 18M6 6L18 18" : "M3 12H21M3 6H21M3 18H21",
|
|
@@ -41138,8 +42716,8 @@ var Management = () => {
|
|
|
41138
42716
|
) })
|
|
41139
42717
|
}
|
|
41140
42718
|
),
|
|
41141
|
-
/* @__PURE__ */ (0,
|
|
41142
|
-
|
|
42719
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42720
|
+
import_material47.Typography,
|
|
41143
42721
|
{
|
|
41144
42722
|
variant: "h6",
|
|
41145
42723
|
sx: {
|
|
@@ -41151,14 +42729,14 @@ var Management = () => {
|
|
|
41151
42729
|
children: "Management"
|
|
41152
42730
|
}
|
|
41153
42731
|
),
|
|
41154
|
-
/* @__PURE__ */ (0,
|
|
42732
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_material47.Box, { sx: {
|
|
41155
42733
|
px: 2,
|
|
41156
42734
|
py: 0.5,
|
|
41157
42735
|
borderRadius: 2,
|
|
41158
42736
|
bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.12)" : "rgba(25,118,210,0.08)",
|
|
41159
42737
|
border: (theme2) => `1px solid ${theme2.palette.primary.main}20`
|
|
41160
|
-
}, children: /* @__PURE__ */ (0,
|
|
41161
|
-
|
|
42738
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42739
|
+
import_material47.Typography,
|
|
41162
42740
|
{
|
|
41163
42741
|
variant: "caption",
|
|
41164
42742
|
sx: {
|
|
@@ -41172,8 +42750,8 @@ var Management = () => {
|
|
|
41172
42750
|
]
|
|
41173
42751
|
}
|
|
41174
42752
|
),
|
|
41175
|
-
isMobile ? /* @__PURE__ */ (0,
|
|
41176
|
-
|
|
42753
|
+
isMobile ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42754
|
+
import_material47.SwipeableDrawer,
|
|
41177
42755
|
{
|
|
41178
42756
|
anchor: "bottom",
|
|
41179
42757
|
open: sidebarOpen,
|
|
@@ -41193,8 +42771,8 @@ var Management = () => {
|
|
|
41193
42771
|
},
|
|
41194
42772
|
children: navigationContent
|
|
41195
42773
|
}
|
|
41196
|
-
) : /* @__PURE__ */ (0,
|
|
41197
|
-
|
|
42774
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42775
|
+
import_material47.Box,
|
|
41198
42776
|
{
|
|
41199
42777
|
sx: {
|
|
41200
42778
|
width: 280,
|
|
@@ -41217,8 +42795,8 @@ var Management = () => {
|
|
|
41217
42795
|
children: navigationContent
|
|
41218
42796
|
}
|
|
41219
42797
|
),
|
|
41220
|
-
/* @__PURE__ */ (0,
|
|
41221
|
-
|
|
42798
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
42799
|
+
import_material47.Box,
|
|
41222
42800
|
{
|
|
41223
42801
|
sx: {
|
|
41224
42802
|
flex: 1,
|
|
@@ -41246,7 +42824,7 @@ var Management = () => {
|
|
|
41246
42824
|
// IE and Edge
|
|
41247
42825
|
},
|
|
41248
42826
|
children: [
|
|
41249
|
-
navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0,
|
|
42827
|
+
navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
41250
42828
|
PersonalitiesTab_default,
|
|
41251
42829
|
{
|
|
41252
42830
|
availableModels,
|
|
@@ -41265,7 +42843,7 @@ var Management = () => {
|
|
|
41265
42843
|
showSnackbar: showSnackbarMessage
|
|
41266
42844
|
}
|
|
41267
42845
|
),
|
|
41268
|
-
navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0,
|
|
42846
|
+
navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
41269
42847
|
BrandingTab_default,
|
|
41270
42848
|
{
|
|
41271
42849
|
logoFile,
|
|
@@ -41284,8 +42862,8 @@ var Management = () => {
|
|
|
41284
42862
|
setLogoBase64
|
|
41285
42863
|
}
|
|
41286
42864
|
),
|
|
41287
|
-
navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0,
|
|
41288
|
-
|
|
42865
|
+
navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42866
|
+
KnowledgeHubTab_default,
|
|
41289
42867
|
{
|
|
41290
42868
|
documents,
|
|
41291
42869
|
addDocuments,
|
|
@@ -41293,11 +42871,12 @@ var Management = () => {
|
|
|
41293
42871
|
loadDocuments,
|
|
41294
42872
|
clearAllDocuments,
|
|
41295
42873
|
currentTheme,
|
|
41296
|
-
isLimitedAdmin: hasLimitedAdminDashboard() && !hasAdminDashboard()
|
|
42874
|
+
isLimitedAdmin: hasLimitedAdminDashboard() && !hasAdminDashboard(),
|
|
42875
|
+
seedPacksEnabled
|
|
41297
42876
|
}
|
|
41298
42877
|
),
|
|
41299
|
-
navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0,
|
|
41300
|
-
navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0,
|
|
42878
|
+
navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(StorageTab_default, { currentTheme }),
|
|
42879
|
+
navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
41301
42880
|
PreferencesTab_default,
|
|
41302
42881
|
{
|
|
41303
42882
|
preferences,
|
|
@@ -41307,13 +42886,13 @@ var Management = () => {
|
|
|
41307
42886
|
showSnackbar: showSnackbarMessage
|
|
41308
42887
|
}
|
|
41309
42888
|
),
|
|
41310
|
-
navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0,
|
|
41311
|
-
navTabs[tabIndex]?.label === "MCP Tools" && /* @__PURE__ */ (0,
|
|
42889
|
+
navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ProviderTab, {}),
|
|
42890
|
+
navTabs[tabIndex]?.label === "MCP Tools" && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(MCPToolsTabV2_default, {})
|
|
41312
42891
|
]
|
|
41313
42892
|
}
|
|
41314
42893
|
),
|
|
41315
|
-
/* @__PURE__ */ (0,
|
|
41316
|
-
|
|
42894
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
42895
|
+
import_material47.Fab,
|
|
41317
42896
|
{
|
|
41318
42897
|
"aria-label": "AI",
|
|
41319
42898
|
onClick: handleOpenModal,
|
|
@@ -41334,7 +42913,7 @@ var Management = () => {
|
|
|
41334
42913
|
boxShadow: theme2.shadows[6],
|
|
41335
42914
|
zIndex: 2e3
|
|
41336
42915
|
}),
|
|
41337
|
-
children: /* @__PURE__ */ (0,
|
|
42916
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
41338
42917
|
"img",
|
|
41339
42918
|
{
|
|
41340
42919
|
src: fabLogo,
|
|
@@ -41348,7 +42927,7 @@ var Management = () => {
|
|
|
41348
42927
|
)
|
|
41349
42928
|
}
|
|
41350
42929
|
),
|
|
41351
|
-
/* @__PURE__ */ (0,
|
|
42930
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
|
|
41352
42931
|
]
|
|
41353
42932
|
}
|
|
41354
42933
|
)
|
|
@@ -41357,7 +42936,7 @@ var Management = () => {
|
|
|
41357
42936
|
var management_default = Management;
|
|
41358
42937
|
|
|
41359
42938
|
// src/shared/custom-element.ts
|
|
41360
|
-
var
|
|
42939
|
+
var import_react58 = __toESM(require("react"));
|
|
41361
42940
|
var import_client = __toESM(require("react-dom/client"));
|
|
41362
42941
|
function defineCustomElement(name, Component) {
|
|
41363
42942
|
if (customElements.get(name)) return;
|
|
@@ -41385,7 +42964,7 @@ function defineCustomElement(name, Component) {
|
|
|
41385
42964
|
if (!this.root) {
|
|
41386
42965
|
this.root = import_client.default.createRoot(this.mountPoint);
|
|
41387
42966
|
}
|
|
41388
|
-
this.root.render(
|
|
42967
|
+
this.root.render(import_react58.default.createElement(Component, props));
|
|
41389
42968
|
}
|
|
41390
42969
|
}
|
|
41391
42970
|
customElements.define(name, ReactElement);
|
|
@@ -41594,7 +43173,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
|
|
|
41594
43173
|
init_featureFlags();
|
|
41595
43174
|
|
|
41596
43175
|
// src/hooks/useVoices.ts
|
|
41597
|
-
var
|
|
43176
|
+
var import_react59 = require("react");
|
|
41598
43177
|
init_voiceStore();
|
|
41599
43178
|
init_packageSettingsStore();
|
|
41600
43179
|
init_authenticationStore();
|
|
@@ -41614,7 +43193,7 @@ var useVoices = () => {
|
|
|
41614
43193
|
} = useVoiceStore();
|
|
41615
43194
|
const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
|
|
41616
43195
|
const { token } = useAuthenticationStore();
|
|
41617
|
-
(0,
|
|
43196
|
+
(0, import_react59.useEffect)(() => {
|
|
41618
43197
|
const isAuthenticated = authenticationService.isAuthenticated();
|
|
41619
43198
|
if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
|
|
41620
43199
|
debugLogger.debug("Gateway API URL and JWT token available, loading voice models...");
|
|
@@ -41649,9 +43228,9 @@ init_useTTS();
|
|
|
41649
43228
|
init_streaming_tts();
|
|
41650
43229
|
|
|
41651
43230
|
// src/modals/SubscriptionExpiredModal.tsx
|
|
41652
|
-
var
|
|
43231
|
+
var import_material48 = require("@mui/material");
|
|
41653
43232
|
var import_icons_material13 = require("@mui/icons-material");
|
|
41654
|
-
var
|
|
43233
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
41655
43234
|
var SubscriptionExpiredModal = ({
|
|
41656
43235
|
open,
|
|
41657
43236
|
onNavigateHome,
|
|
@@ -41673,8 +43252,8 @@ var SubscriptionExpiredModal = ({
|
|
|
41673
43252
|
window.location.href = "/manage-subscription";
|
|
41674
43253
|
}
|
|
41675
43254
|
};
|
|
41676
|
-
return /* @__PURE__ */ (0,
|
|
41677
|
-
|
|
43255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
43256
|
+
import_material48.Dialog,
|
|
41678
43257
|
{
|
|
41679
43258
|
open,
|
|
41680
43259
|
onClose,
|
|
@@ -41688,47 +43267,47 @@ var SubscriptionExpiredModal = ({
|
|
|
41688
43267
|
}
|
|
41689
43268
|
},
|
|
41690
43269
|
children: [
|
|
41691
|
-
/* @__PURE__ */ (0,
|
|
41692
|
-
/* @__PURE__ */ (0,
|
|
41693
|
-
/* @__PURE__ */ (0,
|
|
43270
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
|
|
43271
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons_material13.Warning, { color: "warning", sx: { fontSize: 32 } }),
|
|
43272
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
|
|
41694
43273
|
] }) }),
|
|
41695
|
-
/* @__PURE__ */ (0,
|
|
41696
|
-
/* @__PURE__ */ (0,
|
|
41697
|
-
userEmail && /* @__PURE__ */ (0,
|
|
43274
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Stack, { spacing: 2, children: [
|
|
43275
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Alert, { severity: "warning", sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body2", children: "Your subscription has expired and access to features has been restricted." }) }),
|
|
43276
|
+
userEmail && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Typography, { variant: "body2", color: "text.secondary", sx: { textAlign: "center" }, children: [
|
|
41698
43277
|
"Account: ",
|
|
41699
|
-
/* @__PURE__ */ (0,
|
|
43278
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: userEmail })
|
|
41700
43279
|
] }),
|
|
41701
|
-
/* @__PURE__ */ (0,
|
|
41702
|
-
/* @__PURE__ */ (0,
|
|
43280
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body1", sx: { textAlign: "center", color: "text.secondary" }, children: "To continue using all features, please renew your subscription or return to the main application." }),
|
|
43281
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Box, { sx: {
|
|
41703
43282
|
bgcolor: "background.paper",
|
|
41704
43283
|
border: 1,
|
|
41705
43284
|
borderColor: "divider",
|
|
41706
43285
|
borderRadius: 1,
|
|
41707
43286
|
p: 2,
|
|
41708
43287
|
mt: 2
|
|
41709
|
-
}, children: /* @__PURE__ */ (0,
|
|
41710
|
-
/* @__PURE__ */ (0,
|
|
43288
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Typography, { variant: "caption", color: "text.secondary", sx: { fontStyle: "italic" }, children: [
|
|
43289
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "What's affected:" }),
|
|
41711
43290
|
" All premium features including document upload, voice controls, advanced search, and admin dashboard access have been disabled until your subscription is renewed."
|
|
41712
43291
|
] }) })
|
|
41713
43292
|
] }) }),
|
|
41714
|
-
/* @__PURE__ */ (0,
|
|
41715
|
-
/* @__PURE__ */ (0,
|
|
41716
|
-
|
|
43293
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.DialogActions, { sx: { px: 3, pb: 3, gap: 1, justifyContent: "center" }, children: [
|
|
43294
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
43295
|
+
import_material48.Button,
|
|
41717
43296
|
{
|
|
41718
43297
|
onClick: handleNavigateHome,
|
|
41719
43298
|
variant: "outlined",
|
|
41720
|
-
startIcon: /* @__PURE__ */ (0,
|
|
43299
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons_material13.Home, {}),
|
|
41721
43300
|
size: "large",
|
|
41722
43301
|
sx: { minWidth: 140 },
|
|
41723
43302
|
children: "Go Home"
|
|
41724
43303
|
}
|
|
41725
43304
|
),
|
|
41726
|
-
/* @__PURE__ */ (0,
|
|
41727
|
-
|
|
43305
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
43306
|
+
import_material48.Button,
|
|
41728
43307
|
{
|
|
41729
43308
|
onClick: handleManageSubscription,
|
|
41730
43309
|
variant: "contained",
|
|
41731
|
-
startIcon: /* @__PURE__ */ (0,
|
|
43310
|
+
startIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_icons_material13.CreditCard, {}),
|
|
41732
43311
|
size: "large",
|
|
41733
43312
|
color: "primary",
|
|
41734
43313
|
sx: { minWidth: 140 },
|
|
@@ -41742,9 +43321,9 @@ var SubscriptionExpiredModal = ({
|
|
|
41742
43321
|
};
|
|
41743
43322
|
|
|
41744
43323
|
// src/guards/SubscriptionExpiredGuard.tsx
|
|
41745
|
-
var
|
|
43324
|
+
var import_react60 = require("react");
|
|
41746
43325
|
init_useFeatures();
|
|
41747
|
-
var
|
|
43326
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
41748
43327
|
var SubscriptionExpiredGuard = ({
|
|
41749
43328
|
children,
|
|
41750
43329
|
onNavigateHome,
|
|
@@ -41753,9 +43332,9 @@ var SubscriptionExpiredGuard = ({
|
|
|
41753
43332
|
allowContinue = false
|
|
41754
43333
|
}) => {
|
|
41755
43334
|
const { isExpiredTier, getFullEvaluation } = useFeatures();
|
|
41756
|
-
const [showModal, setShowModal] = (0,
|
|
41757
|
-
const [userDismissed, setUserDismissed] = (0,
|
|
41758
|
-
(0,
|
|
43335
|
+
const [showModal, setShowModal] = (0, import_react60.useState)(false);
|
|
43336
|
+
const [userDismissed, setUserDismissed] = (0, import_react60.useState)(false);
|
|
43337
|
+
(0, import_react60.useEffect)(() => {
|
|
41759
43338
|
if (isExpiredTier() && !userDismissed) {
|
|
41760
43339
|
setShowModal(true);
|
|
41761
43340
|
} else {
|
|
@@ -41781,9 +43360,9 @@ var SubscriptionExpiredGuard = ({
|
|
|
41781
43360
|
}
|
|
41782
43361
|
return void 0;
|
|
41783
43362
|
})() : void 0;
|
|
41784
|
-
return /* @__PURE__ */ (0,
|
|
43363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
|
|
41785
43364
|
children,
|
|
41786
|
-
/* @__PURE__ */ (0,
|
|
43365
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
41787
43366
|
SubscriptionExpiredModal,
|
|
41788
43367
|
{
|
|
41789
43368
|
open: showModal,
|
|
@@ -41810,8 +43389,8 @@ init_useNotificationService();
|
|
|
41810
43389
|
// src/services/http/httpErrorHandler.ts
|
|
41811
43390
|
init_notificationService();
|
|
41812
43391
|
init_debugLogger();
|
|
41813
|
-
var
|
|
41814
|
-
var isHttpErrorLike = (error) =>
|
|
43392
|
+
var isRecord6 = (value) => typeof value === "object" && value !== null;
|
|
43393
|
+
var isHttpErrorLike = (error) => isRecord6(error);
|
|
41815
43394
|
var extractString = (record, key) => {
|
|
41816
43395
|
const value = record[key];
|
|
41817
43396
|
return typeof value === "string" ? value : void 0;
|
|
@@ -41826,7 +43405,7 @@ var normalizeMessages = (value) => {
|
|
|
41826
43405
|
if (Array.isArray(value)) {
|
|
41827
43406
|
return value.flatMap(normalizeMessages);
|
|
41828
43407
|
}
|
|
41829
|
-
if (
|
|
43408
|
+
if (isRecord6(value) && typeof value.message === "string") {
|
|
41830
43409
|
return [value.message];
|
|
41831
43410
|
}
|
|
41832
43411
|
return [];
|
|
@@ -41836,7 +43415,7 @@ var handleHttpError = (error, context) => {
|
|
|
41836
43415
|
if (isHttpErrorLike(error) && error.response) {
|
|
41837
43416
|
const status = error.response.status;
|
|
41838
43417
|
const data = error.response.data;
|
|
41839
|
-
const dataRecord =
|
|
43418
|
+
const dataRecord = isRecord6(data) ? data : {};
|
|
41840
43419
|
const errorMessage = extractString(dataRecord, "message") || extractString(dataRecord, "error") || extractString(dataRecord, "detail");
|
|
41841
43420
|
const errorCode = extractString(dataRecord, "code") || extractString(dataRecord, "error_code");
|
|
41842
43421
|
debugLogger.error(`${contextPrefix}HTTP Error ${status}:`, {
|
|
@@ -41884,7 +43463,7 @@ var handleValidationError = (errors, context) => {
|
|
|
41884
43463
|
notificationService.handleValidationError(messages, `${contextPrefix}Please check your input`);
|
|
41885
43464
|
return;
|
|
41886
43465
|
}
|
|
41887
|
-
} else if (
|
|
43466
|
+
} else if (isRecord6(errors)) {
|
|
41888
43467
|
const collected = [];
|
|
41889
43468
|
Object.values(errors).forEach((value) => {
|
|
41890
43469
|
collected.push(...normalizeMessages(value));
|