@burtson-labs/bandit-engine 2.0.73 → 2.0.75

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/index.js CHANGED
@@ -3263,14 +3263,72 @@ var init_knowledgeStore = __esm({
3263
3263
  }
3264
3264
  });
3265
3265
 
3266
+ // src/services/mcp/mcpServersService.ts
3267
+ var gatewayBase, authHeaders, parse, listMcpServers, addMcpServer, updateMcpServer, deleteMcpServer, discoverMcpTools;
3268
+ var init_mcpServersService = __esm({
3269
+ "src/services/mcp/mcpServersService.ts"() {
3270
+ "use strict";
3271
+ init_packageSettingsStore();
3272
+ init_authenticationService();
3273
+ gatewayBase = () => {
3274
+ const settings = usePackageSettingsStore.getState().settings;
3275
+ const url = settings?.gatewayApiUrl?.replace(/\/$/, "");
3276
+ if (!url) throw new Error("Gateway API is not configured.");
3277
+ return url;
3278
+ };
3279
+ authHeaders = () => {
3280
+ const headers = { "Content-Type": "application/json" };
3281
+ const token = authenticationService.getToken();
3282
+ if (token) headers["Authorization"] = `Bearer ${token}`;
3283
+ return headers;
3284
+ };
3285
+ parse = async (res) => {
3286
+ const text = await res.text();
3287
+ const body = text ? JSON.parse(text) : null;
3288
+ if (!res.ok) {
3289
+ const message = body && typeof body === "object" && (body.error || body.message) || `Request failed (${res.status})`;
3290
+ throw new Error(String(message));
3291
+ }
3292
+ return body;
3293
+ };
3294
+ listMcpServers = async () => parse(await fetch(`${gatewayBase()}/mcp/servers`, { headers: authHeaders() }));
3295
+ addMcpServer = async (input) => parse(
3296
+ await fetch(`${gatewayBase()}/mcp/servers`, {
3297
+ method: "POST",
3298
+ headers: authHeaders(),
3299
+ body: JSON.stringify(input)
3300
+ })
3301
+ );
3302
+ updateMcpServer = async (id, input) => parse(
3303
+ await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}`, {
3304
+ method: "PUT",
3305
+ headers: authHeaders(),
3306
+ body: JSON.stringify(input)
3307
+ })
3308
+ );
3309
+ deleteMcpServer = async (id) => {
3310
+ const res = await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}`, {
3311
+ method: "DELETE",
3312
+ headers: authHeaders()
3313
+ });
3314
+ if (!res.ok && res.status !== 204) {
3315
+ throw new Error(`Could not remove the server (${res.status}).`);
3316
+ }
3317
+ };
3318
+ discoverMcpTools = async (id) => parse(await fetch(`${gatewayBase()}/mcp/servers/${encodeURIComponent(id)}/tools`, { headers: authHeaders() }));
3319
+ }
3320
+ });
3321
+
3266
3322
  // src/store/mcpToolsStore.ts
3267
- var import_zustand11, healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool, defaultTools, useMCPToolsStore;
3323
+ var import_zustand11, sanitizeMcpToolName, healthCheckTool, webSearchTool, webFetchTool, imageGenerationTool, createFileTool, defaultTools, useMCPToolsStore;
3268
3324
  var init_mcpToolsStore = __esm({
3269
3325
  "src/store/mcpToolsStore.ts"() {
3270
3326
  "use strict";
3271
3327
  import_zustand11 = require("zustand");
3272
3328
  init_indexedDBService();
3273
3329
  init_debugLogger();
3330
+ init_mcpServersService();
3331
+ sanitizeMcpToolName = (raw) => raw.replace(/[^a-zA-Z0-9_]/g, "_").replace(/_+/g, "_").replace(/^_|_$/g, "").slice(0, 60);
3274
3332
  healthCheckTool = {
3275
3333
  id: "health-check",
3276
3334
  name: "check_gateway_health",
@@ -3457,7 +3515,7 @@ var init_mcpToolsStore = __esm({
3457
3515
  try {
3458
3516
  const { tools } = get();
3459
3517
  const storeConfigs6 = [{ name: "config", keyPath: "id" }];
3460
- const customTools = tools.filter((tool) => !tool.isBuiltIn);
3518
+ const customTools = tools.filter((tool) => !tool.isBuiltIn && !tool.mcpServerId);
3461
3519
  await indexedDBService_default.put("banditConfig", 1, "config", {
3462
3520
  id: "mcpTools",
3463
3521
  tools: customTools
@@ -3466,6 +3524,48 @@ var init_mcpToolsStore = __esm({
3466
3524
  } catch (error) {
3467
3525
  debugLogger.error("Failed to save MCP tools to IndexedDB", { error });
3468
3526
  }
3527
+ },
3528
+ // Discover the user's connected MCP servers' tools from the gateway and merge
3529
+ // them into the tool list (so the model can call them). Replaces any prior
3530
+ // MCP-server tools; best-effort — a single unreachable server is skipped.
3531
+ loadMcpServerTools: async () => {
3532
+ let servers;
3533
+ try {
3534
+ servers = await listMcpServers();
3535
+ } catch (error) {
3536
+ debugLogger.warn("Could not list MCP servers", { error: String(error) });
3537
+ return;
3538
+ }
3539
+ const collected = [];
3540
+ for (const server of servers.filter((s) => s.enabled)) {
3541
+ try {
3542
+ const { tools } = await discoverMcpTools(server.id);
3543
+ for (const t of tools) {
3544
+ const fnName = sanitizeMcpToolName(`mcp_${server.name}_${t.name}`);
3545
+ const schema = t.inputSchema && typeof t.inputSchema === "object" && t.inputSchema.type === "object" ? t.inputSchema : { type: "object", properties: {}, required: [] };
3546
+ collected.push({
3547
+ id: `mcp-${server.id}-${t.name}`,
3548
+ name: fnName,
3549
+ description: t.description || `${t.name} (via ${server.name})`,
3550
+ enabled: true,
3551
+ type: "function",
3552
+ function: {
3553
+ name: fnName,
3554
+ description: t.description || `${t.name} \u2014 provided by the ${server.name} MCP server.`,
3555
+ parameters: schema
3556
+ },
3557
+ mcpServerId: server.id,
3558
+ mcpToolName: t.name
3559
+ });
3560
+ }
3561
+ } catch (error) {
3562
+ debugLogger.warn("Failed to discover tools for MCP server", { server: server.name, error: String(error) });
3563
+ }
3564
+ }
3565
+ set((state) => ({
3566
+ tools: [...state.tools.filter((t) => !t.mcpServerId), ...collected]
3567
+ }));
3568
+ debugLogger.info("MCP server tools loaded", { count: collected.length });
3469
3569
  }
3470
3570
  }));
3471
3571
  }
@@ -20150,6 +20250,34 @@ var init_mcpService = __esm({
20150
20250
  error: "Gateway API not configured"
20151
20251
  };
20152
20252
  }
20253
+ if (tool.mcpServerId) {
20254
+ const base2 = settings.gatewayApiUrl.replace(/\/$/, "");
20255
+ const token2 = authenticationService.getToken();
20256
+ const controller2 = new AbortController();
20257
+ const timeoutId2 = setTimeout(() => controller2.abort(), 3e4);
20258
+ try {
20259
+ const res = await fetch(`${base2}/mcp/invoke`, {
20260
+ method: "POST",
20261
+ headers: {
20262
+ "Content-Type": "application/json",
20263
+ ...token2 ? { Authorization: `Bearer ${token2}` } : {}
20264
+ },
20265
+ body: JSON.stringify({
20266
+ serverId: tool.mcpServerId,
20267
+ tool: tool.mcpToolName ?? toolCall.toolName,
20268
+ arguments: toolCall.parameters ?? {}
20269
+ }),
20270
+ signal: controller2.signal
20271
+ });
20272
+ const data2 = await res.json();
20273
+ if (!res.ok) {
20274
+ return { success: false, error: data2?.error || `MCP call failed: ${res.status}`, data: data2 };
20275
+ }
20276
+ return { success: !data2?.isError, data: typeof data2?.output === "string" ? data2.output : data2 };
20277
+ } finally {
20278
+ clearTimeout(timeoutId2);
20279
+ }
20280
+ }
20153
20281
  if (!tool.endpoint) {
20154
20282
  return {
20155
20283
  success: false,
@@ -30869,6 +30997,7 @@ var ChatProvider = (props) => {
30869
30997
  await usePreferencesStore.getState().loadPreferences();
30870
30998
  await useKnowledgeStore.getState().loadDocs();
30871
30999
  await useMCPToolsStore.getState().loadTools();
31000
+ void useMCPToolsStore.getState().loadMcpServerTools();
30872
31001
  await useConversationSyncStore.getState().initialize();
30873
31002
  }
30874
31003
  debugLogger.info("ChatProvider about to call initModels - checking for existing branding first");
@@ -30981,12 +31110,12 @@ var chat_provider_default = ChatProvider;
30981
31110
  init_chat2();
30982
31111
 
30983
31112
  // src/management/management.tsx
30984
- var import_react59 = require("react");
31113
+ var import_react60 = require("react");
30985
31114
  var import_useMediaQuery2 = __toESM(require("@mui/material/useMediaQuery"));
30986
31115
  var import_styles32 = require("@mui/material/styles");
30987
31116
  init_useKnowledgeStore();
30988
31117
  init_indexedDBService();
30989
- var import_material49 = require("@mui/material");
31118
+ var import_material50 = require("@mui/material");
30990
31119
  var import_react_router_dom5 = require("react-router-dom");
30991
31120
 
30992
31121
  // src/modals/chat-modal/chat-modal.tsx
@@ -42745,8 +42874,8 @@ var ProviderTab = () => {
42745
42874
  };
42746
42875
 
42747
42876
  // src/management/components/MCPToolsTabV2.tsx
42748
- var import_react58 = require("react");
42749
- var import_material48 = require("@mui/material");
42877
+ var import_react59 = require("react");
42878
+ var import_material49 = require("@mui/material");
42750
42879
 
42751
42880
  // src/services/mcp/mcpControllerService.ts
42752
42881
  init_packageSettingsStore();
@@ -42772,7 +42901,7 @@ function buildUrl3(path) {
42772
42901
  }
42773
42902
  return path;
42774
42903
  }
42775
- function authHeaders() {
42904
+ function authHeaders2() {
42776
42905
  const headers = { "Content-Type": "application/json" };
42777
42906
  const token = authenticationService.getToken();
42778
42907
  if (token) headers["Authorization"] = `Bearer ${token}`;
@@ -42785,7 +42914,7 @@ async function fetchAvailableMcpTools() {
42785
42914
  }
42786
42915
  const url = buildUrl3("/mcp/tools");
42787
42916
  try {
42788
- const res = await fetch(url, { headers: authHeaders() });
42917
+ const res = await fetch(url, { headers: authHeaders2() });
42789
42918
  const data = await res.json();
42790
42919
  if (!res.ok) {
42791
42920
  throw new Error(data?.error || `Failed to load MCP tools (${res.status})`);
@@ -42809,7 +42938,7 @@ async function fetchMcpHealth() {
42809
42938
  }
42810
42939
  const url = buildUrl3("/mcp/health");
42811
42940
  try {
42812
- const res = await fetch(url, { headers: authHeaders() });
42941
+ const res = await fetch(url, { headers: authHeaders2() });
42813
42942
  const data = await res.json();
42814
42943
  if (!res.ok) {
42815
42944
  throw new Error(data?.error || `Failed to fetch MCP health (${res.status})`);
@@ -42821,18 +42950,230 @@ async function fetchMcpHealth() {
42821
42950
  }
42822
42951
  }
42823
42952
 
42953
+ // src/management/components/McpServersSection.tsx
42954
+ var import_react58 = require("react");
42955
+ var import_material48 = require("@mui/material");
42956
+ init_lucide_icons();
42957
+ init_mcpServersService();
42958
+ init_mcpToolsStore();
42959
+ var import_jsx_runtime48 = require("react/jsx-runtime");
42960
+ var emptyForm = { name: "", url: "", authType: "none", authValue: "", headerName: "" };
42961
+ var McpServersSection = () => {
42962
+ const [servers, setServers] = (0, import_react58.useState)([]);
42963
+ const [loading, setLoading] = (0, import_react58.useState)(false);
42964
+ const [error, setError] = (0, import_react58.useState)(null);
42965
+ const [form, setForm] = (0, import_react58.useState)(emptyForm);
42966
+ const [adding, setAdding] = (0, import_react58.useState)(false);
42967
+ const [showForm, setShowForm] = (0, import_react58.useState)(false);
42968
+ const [tools, setTools] = (0, import_react58.useState)({});
42969
+ const reloadChatTools = useMCPToolsStore((s) => s.loadMcpServerTools);
42970
+ const refresh = (0, import_react58.useCallback)(async () => {
42971
+ setLoading(true);
42972
+ setError(null);
42973
+ try {
42974
+ setServers(await listMcpServers());
42975
+ } catch (e) {
42976
+ setError(e instanceof Error ? e.message : "Could not load MCP servers.");
42977
+ } finally {
42978
+ setLoading(false);
42979
+ }
42980
+ }, []);
42981
+ (0, import_react58.useEffect)(() => {
42982
+ refresh();
42983
+ }, [refresh]);
42984
+ const handleAdd = async () => {
42985
+ if (!form.name.trim() || !form.url.trim()) {
42986
+ setError("Name and URL are required.");
42987
+ return;
42988
+ }
42989
+ setAdding(true);
42990
+ setError(null);
42991
+ try {
42992
+ await addMcpServer({
42993
+ name: form.name.trim(),
42994
+ url: form.url.trim(),
42995
+ authType: form.authType,
42996
+ authValue: form.authType === "none" ? void 0 : form.authValue,
42997
+ headerName: form.authType === "header" ? form.headerName : void 0
42998
+ });
42999
+ setForm(emptyForm);
43000
+ setShowForm(false);
43001
+ await refresh();
43002
+ void reloadChatTools();
43003
+ } catch (e) {
43004
+ setError(e instanceof Error ? e.message : "Could not add the server.");
43005
+ } finally {
43006
+ setAdding(false);
43007
+ }
43008
+ };
43009
+ const handleDelete = async (id) => {
43010
+ setError(null);
43011
+ try {
43012
+ await deleteMcpServer(id);
43013
+ await refresh();
43014
+ void reloadChatTools();
43015
+ } catch (e) {
43016
+ setError(e instanceof Error ? e.message : "Could not remove the server.");
43017
+ }
43018
+ };
43019
+ const handleToggle = async (server) => {
43020
+ setError(null);
43021
+ try {
43022
+ await updateMcpServer(server.id, { enabled: !server.enabled });
43023
+ await refresh();
43024
+ void reloadChatTools();
43025
+ } catch (e) {
43026
+ setError(e instanceof Error ? e.message : "Could not update the server.");
43027
+ }
43028
+ };
43029
+ const handleDiscover = async (id) => {
43030
+ setTools((prev) => ({ ...prev, [id]: "loading" }));
43031
+ try {
43032
+ const { tools: discovered } = await discoverMcpTools(id);
43033
+ setTools((prev) => ({ ...prev, [id]: discovered }));
43034
+ } catch (e) {
43035
+ setTools((prev) => ({ ...prev, [id]: { error: e instanceof Error ? e.message : "Could not connect." } }));
43036
+ }
43037
+ };
43038
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Paper, { sx: { p: 2, mb: 2 }, children: [
43039
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 1, gap: 1, flexWrap: "wrap" }, children: [
43040
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
43041
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CloudIcon, {}),
43042
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "subtitle1", sx: { fontWeight: 700 }, children: "MCP Servers" }),
43043
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Chip, { size: "small", label: String(servers.length) })
43044
+ ] }),
43045
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
43046
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.IconButton, { onClick: refresh, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RefreshIcon, {}) }) }),
43047
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Button, { size: "small", variant: "contained", startIcon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(AddIcon, {}), onClick: () => setShowForm((v) => !v), children: "Add server" })
43048
+ ] })
43049
+ ] }),
43050
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: "Connect a remote Model Context Protocol server to give the assistant its tools. The gateway holds the connection and proxies calls \u2014 your browser never talks to the server directly." }),
43051
+ error && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Alert, { severity: "error", sx: { mb: 2 }, onClose: () => setError(null), children: error }),
43052
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Collapse, { in: showForm, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Paper, { variant: "outlined", sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Stack, { spacing: 2, children: [
43053
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43054
+ import_material48.TextField,
43055
+ {
43056
+ label: "Name",
43057
+ size: "small",
43058
+ value: form.name,
43059
+ onChange: (e) => setForm({ ...form, name: e.target.value }),
43060
+ placeholder: "e.g. github",
43061
+ fullWidth: true
43062
+ }
43063
+ ),
43064
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43065
+ import_material48.TextField,
43066
+ {
43067
+ label: "Server URL",
43068
+ size: "small",
43069
+ value: form.url,
43070
+ onChange: (e) => setForm({ ...form, url: e.target.value }),
43071
+ placeholder: "https://mcp.example.com/mcp",
43072
+ fullWidth: true
43073
+ }
43074
+ ),
43075
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
43076
+ import_material48.TextField,
43077
+ {
43078
+ select: true,
43079
+ label: "Auth",
43080
+ size: "small",
43081
+ value: form.authType,
43082
+ onChange: (e) => setForm({ ...form, authType: e.target.value }),
43083
+ sx: { maxWidth: 220 },
43084
+ children: [
43085
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.MenuItem, { value: "none", children: "None" }),
43086
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.MenuItem, { value: "bearer", children: "Bearer token" }),
43087
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.MenuItem, { value: "header", children: "Custom header" })
43088
+ ]
43089
+ }
43090
+ ),
43091
+ form.authType === "header" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43092
+ import_material48.TextField,
43093
+ {
43094
+ label: "Header name",
43095
+ size: "small",
43096
+ value: form.headerName,
43097
+ onChange: (e) => setForm({ ...form, headerName: e.target.value }),
43098
+ placeholder: "X-Api-Key",
43099
+ fullWidth: true
43100
+ }
43101
+ ),
43102
+ form.authType !== "none" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43103
+ import_material48.TextField,
43104
+ {
43105
+ label: form.authType === "bearer" ? "Token" : "Header value",
43106
+ size: "small",
43107
+ type: "password",
43108
+ value: form.authValue,
43109
+ onChange: (e) => setForm({ ...form, authValue: e.target.value }),
43110
+ fullWidth: true
43111
+ }
43112
+ ),
43113
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", gap: 1 }, children: [
43114
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Button, { variant: "contained", onClick: handleAdd, disabled: adding, children: adding ? "Adding\u2026" : "Add server" }),
43115
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43116
+ import_material48.Button,
43117
+ {
43118
+ onClick: () => {
43119
+ setShowForm(false);
43120
+ setForm(emptyForm);
43121
+ },
43122
+ children: "Cancel"
43123
+ }
43124
+ )
43125
+ ] })
43126
+ ] }) }) }),
43127
+ loading && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.LinearProgress, { sx: { mb: 2 } }),
43128
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Stack, { spacing: 1.5, children: [
43129
+ servers.length === 0 && !loading && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", children: "No MCP servers connected yet." }),
43130
+ servers.map((server) => {
43131
+ const toolState = tools[server.id];
43132
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Paper, { variant: "outlined", sx: { p: 1.5 }, children: [
43133
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1 }, children: [
43134
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { minWidth: 0 }, children: [
43135
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "subtitle2", sx: { fontWeight: 700 }, children: server.name }),
43136
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "caption", color: "text.secondary", sx: { wordBreak: "break-all" }, children: server.url })
43137
+ ] }),
43138
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5, flexShrink: 0 }, children: [
43139
+ server.hasAuth && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Chip, { size: "small", label: server.authType }),
43140
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: server.enabled ? "Enabled" : "Disabled", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
43141
+ import_material48.FormControlLabel,
43142
+ {
43143
+ sx: { mr: 0 },
43144
+ control: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Switch, { size: "small", checked: server.enabled, onChange: () => handleToggle(server) }),
43145
+ label: ""
43146
+ }
43147
+ ) }),
43148
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: "Test & list tools", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.IconButton, { size: "small", onClick: () => handleDiscover(server.id), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RefreshIcon, {}) }) }),
43149
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: "Remove", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.IconButton, { size: "small", onClick: () => handleDelete(server.id), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(DeleteIcon, {}) }) })
43150
+ ] })
43151
+ ] }),
43152
+ toolState === "loading" && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { mt: 1, display: "flex", alignItems: "center", gap: 1 }, children: [
43153
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.CircularProgress, { size: 16 }),
43154
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "caption", color: "text.secondary", children: "Connecting\u2026" })
43155
+ ] }),
43156
+ Array.isArray(toolState) && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Box, { sx: { mt: 1, display: "flex", flexWrap: "wrap", gap: 0.5 }, children: toolState.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "caption", color: "text.secondary", children: "Connected \u2014 no tools reported." }) : toolState.map((t) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: t.description || "", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Chip, { size: "small", label: t.name }) }, t.name)) }),
43157
+ toolState && !Array.isArray(toolState) && toolState !== "loading" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Alert, { severity: "warning", sx: { mt: 1 }, children: toolState.error })
43158
+ ] }, server.id);
43159
+ })
43160
+ ] })
43161
+ ] });
43162
+ };
43163
+ var McpServersSection_default = McpServersSection;
43164
+
42824
43165
  // src/management/components/MCPToolsTabV2.tsx
42825
43166
  init_mcpToolsStore();
42826
43167
  init_packageSettingsStore();
42827
43168
  init_lucide_icons();
42828
- var import_jsx_runtime48 = require("react/jsx-runtime");
43169
+ var import_jsx_runtime49 = require("react/jsx-runtime");
42829
43170
  var MCPToolsTabV2 = () => {
42830
43171
  const { settings } = usePackageSettingsStore();
42831
43172
  const { tools: localTools, loadTools, toggleTool, addTool, updateTool, isLoaded } = useMCPToolsStore();
42832
- const [loading, setLoading] = (0, import_react58.useState)(true);
42833
- const [error, setError] = (0, import_react58.useState)(null);
42834
- const [tools, setTools] = (0, import_react58.useState)([]);
42835
- const [health, setHealth] = (0, import_react58.useState)(null);
43173
+ const [loading, setLoading] = (0, import_react59.useState)(true);
43174
+ const [error, setError] = (0, import_react59.useState)(null);
43175
+ const [tools, setTools] = (0, import_react59.useState)([]);
43176
+ const [health, setHealth] = (0, import_react59.useState)(null);
42836
43177
  const gatewayConfigured = !!settings?.gatewayApiUrl;
42837
43178
  const refresh = async () => {
42838
43179
  setLoading(true);
@@ -42886,7 +43227,7 @@ var MCPToolsTabV2 = () => {
42886
43227
  setLoading(false);
42887
43228
  }
42888
43229
  };
42889
- (0, import_react58.useEffect)(() => {
43230
+ (0, import_react59.useEffect)(() => {
42890
43231
  if (isLoaded) {
42891
43232
  refresh();
42892
43233
  } else {
@@ -42895,7 +43236,7 @@ var MCPToolsTabV2 = () => {
42895
43236
  });
42896
43237
  }
42897
43238
  }, [isLoaded]);
42898
- const localEnabledMap = (0, import_react58.useMemo)(() => {
43239
+ const localEnabledMap = (0, import_react59.useMemo)(() => {
42899
43240
  const map23 = /* @__PURE__ */ new Map();
42900
43241
  const sortedTools = [...localTools].sort((a, b) => {
42901
43242
  if (a.isBuiltIn && !b.isBuiltIn) return -1;
@@ -42911,17 +43252,18 @@ var MCPToolsTabV2 = () => {
42911
43252
  });
42912
43253
  return map23;
42913
43254
  }, [localTools]);
42914
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { children: [
42915
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2 }, children: [
42916
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "h5", sx: { fontWeight: 600, color: "primary.main" }, children: "Available Tools" }),
42917
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.IconButton, { onClick: refresh, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RefreshIcon, {}) }) }) })
43255
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { children: [
43256
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 2 }, children: [
43257
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "h5", sx: { fontWeight: 600, color: "primary.main" }, children: "Available Tools" }),
43258
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Tooltip, { title: "Refresh", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.IconButton, { onClick: refresh, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(RefreshIcon, {}) }) }) })
42918
43259
  ] }),
42919
- !gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", children: "Gateway API URL isn\u2019t configured. The controller endpoints will be fetched relative to this origin." }) }),
42920
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
42921
- health?.status === "healthy" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HealthAndSafetyIcon, { color: "success" }) : health?.status === "unhealthy" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ErrorOutlineIcon, { color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ErrorOutlineIcon, { color: "disabled" }),
42922
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: "Controller Health" }),
42923
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
42924
- import_material48.Chip,
43260
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(McpServersSection_default, {}),
43261
+ !gatewayConfigured && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "body2", color: "text.secondary", children: "Gateway API URL isn\u2019t configured. The controller endpoints will be fetched relative to this origin." }) }),
43262
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
43263
+ health?.status === "healthy" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(HealthAndSafetyIcon, { color: "success" }) : health?.status === "unhealthy" ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ErrorOutlineIcon, { color: "error" }) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ErrorOutlineIcon, { color: "disabled" }),
43264
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "subtitle1", sx: { fontWeight: 600 }, children: "Controller Health" }),
43265
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43266
+ import_material49.Chip,
42925
43267
  {
42926
43268
  size: "small",
42927
43269
  label: (health?.status || "unknown").toString(),
@@ -42929,11 +43271,11 @@ var MCPToolsTabV2 = () => {
42929
43271
  sx: { ml: 1 }
42930
43272
  }
42931
43273
  ),
42932
- health?.timestamp && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "caption", color: "text.secondary", sx: { ml: 1 }, children: new Date(health.timestamp).toLocaleString() })
43274
+ health?.timestamp && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "caption", color: "text.secondary", sx: { ml: 1 }, children: new Date(health.timestamp).toLocaleString() })
42933
43275
  ] }) }),
42934
- loading && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.LinearProgress, {}) }),
42935
- error && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { color: "error", children: error }) }),
42936
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Stack, { spacing: 2, children: tools.map((tool) => {
43276
+ loading && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.LinearProgress, {}) }),
43277
+ error && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Paper, { sx: { p: 2, mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { color: "error", children: error }) }),
43278
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Stack, { spacing: 2, children: tools.map((tool) => {
42937
43279
  let locallyEnabled = localEnabledMap.get(tool.id);
42938
43280
  if (locallyEnabled === void 0) {
42939
43281
  locallyEnabled = localEnabledMap.get(tool.name);
@@ -42944,17 +43286,17 @@ var MCPToolsTabV2 = () => {
42944
43286
  );
42945
43287
  locallyEnabled = directLookup?.enabled ?? tool.isEnabled;
42946
43288
  }
42947
- return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Paper, { sx: { p: 2 }, children: [
42948
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
42949
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { children: [
42950
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "h6", sx: { fontWeight: 700 }, children: tool.name }),
42951
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: tool.description })
43289
+ return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Paper, { sx: { p: 2 }, children: [
43290
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between" }, children: [
43291
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { children: [
43292
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "h6", sx: { fontWeight: 700 }, children: tool.name }),
43293
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: tool.description })
42952
43294
  ] }),
42953
- /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
42954
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
42955
- import_material48.FormControlLabel,
43295
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
43296
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43297
+ import_material49.FormControlLabel,
42956
43298
  {
42957
- control: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Switch, { checked: !!locallyEnabled, onChange: () => {
43299
+ control: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Switch, { checked: !!locallyEnabled, onChange: () => {
42958
43300
  let local = localTools.find((t) => t.function.name === tool.id);
42959
43301
  if (!local) {
42960
43302
  local = localTools.find((t) => t.function.name === tool.name);
@@ -42974,12 +43316,12 @@ var MCPToolsTabV2 = () => {
42974
43316
  label: locallyEnabled ? "Enabled" : "Disabled"
42975
43317
  }
42976
43318
  ),
42977
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Tooltip, { title: "Controller-driven tools (read-only schema)", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SettingsIcon, { color: "disabled" }) })
43319
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Tooltip, { title: "Controller-driven tools (read-only schema)", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SettingsIcon, { color: "disabled" }) })
42978
43320
  ] })
42979
43321
  ] }),
42980
- !!tool.supportedParameters?.length && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_material48.Box, { sx: { mt: 1.5 }, children: [
42981
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Typography, { variant: "caption", color: "text.secondary", children: "Supported parameters" }),
42982
- /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Box, { sx: { mt: 0.5, display: "flex", flexWrap: "wrap", gap: 1 }, children: tool.supportedParameters.map((p) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_material48.Chip, { size: "small", label: p }, p)) })
43322
+ !!tool.supportedParameters?.length && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.Box, { sx: { mt: 1.5 }, children: [
43323
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Typography, { variant: "caption", color: "text.secondary", children: "Supported parameters" }),
43324
+ /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { sx: { mt: 0.5, display: "flex", flexWrap: "wrap", gap: 1 }, children: tool.supportedParameters.map((p) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Chip, { size: "small", label: p }, p)) })
42983
43325
  ] })
42984
43326
  ] }, tool.id);
42985
43327
  }) })
@@ -43002,7 +43344,7 @@ init_authenticationStore();
43002
43344
  init_useNotificationService();
43003
43345
  init_useFeatures();
43004
43346
  init_lucide_icons();
43005
- var import_jsx_runtime49 = require("react/jsx-runtime");
43347
+ var import_jsx_runtime50 = require("react/jsx-runtime");
43006
43348
  var preloadChatPage = () => Promise.resolve().then(() => (init_chat2(), chat_exports));
43007
43349
  var buildCapabilitiesUrl = (gatewayApiUrl) => {
43008
43350
  const trimmed = gatewayApiUrl.replace(/\/$/, "");
@@ -43015,7 +43357,7 @@ var Management = () => {
43015
43357
  const navigate = (0, import_react_router_dom5.useNavigate)();
43016
43358
  const notificationService2 = useNotificationService();
43017
43359
  const isMobile = (0, import_useMediaQuery2.default)("(max-width:900px)");
43018
- const [sidebarOpen, setSidebarOpen] = (0, import_react59.useState)(false);
43360
+ const [sidebarOpen, setSidebarOpen] = (0, import_react60.useState)(false);
43019
43361
  const getOptimalFabLogo = async () => {
43020
43362
  const banditHead6 = "https://cdn.burtson.ai/images/bandit-head.png";
43021
43363
  try {
@@ -43055,16 +43397,16 @@ var Management = () => {
43055
43397
  hasTransparentLogo,
43056
43398
  setHasTransparentLogo
43057
43399
  } = useModelStore();
43058
- const [modalOpen, setModalOpen] = (0, import_react59.useState)(false);
43400
+ const [modalOpen, setModalOpen] = (0, import_react60.useState)(false);
43059
43401
  const banditHead5 = "https://cdn.burtson.ai/images/bandit-head.png";
43060
- const [fabLogo, setFabLogo] = (0, import_react59.useState)(banditHead5);
43061
- const [tabIndex, setTabIndex] = (0, import_react59.useState)(4);
43062
- const [logoFile, setLogoFile] = (0, import_react59.useState)(null);
43063
- const [logoBase64, setLogoBase64] = (0, import_react59.useState)(null);
43064
- const [brandingText, setBrandingText] = (0, import_react59.useState)("");
43065
- const [theme, setTheme] = (0, import_react59.useState)("bandit-dark");
43066
- const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react59.useState)(null);
43067
- const [presetAvatar, setPresetAvatar] = (0, import_react59.useState)(null);
43402
+ const [fabLogo, setFabLogo] = (0, import_react60.useState)(banditHead5);
43403
+ const [tabIndex, setTabIndex] = (0, import_react60.useState)(4);
43404
+ const [logoFile, setLogoFile] = (0, import_react60.useState)(null);
43405
+ const [logoBase64, setLogoBase64] = (0, import_react60.useState)(null);
43406
+ const [brandingText, setBrandingText] = (0, import_react60.useState)("");
43407
+ const [theme, setTheme] = (0, import_react60.useState)("bandit-dark");
43408
+ const [customAvatarBase64, setCustomAvatarBase64] = (0, import_react60.useState)(null);
43409
+ const [presetAvatar, setPresetAvatar] = (0, import_react60.useState)(null);
43068
43410
  const showSnackbarMessage = (message, severity = "success") => {
43069
43411
  if (severity === "success") {
43070
43412
  notificationService2?.showSuccess(message);
@@ -43072,9 +43414,9 @@ var Management = () => {
43072
43414
  notificationService2?.showError(message);
43073
43415
  }
43074
43416
  };
43075
- const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react59.useState)(false);
43076
- const [brandingLoaded, setBrandingLoaded] = (0, import_react59.useState)(false);
43077
- const [isLoadingBranding, setIsLoadingBranding] = (0, import_react59.useState)(false);
43417
+ const [restoreDialogOpen, setRestoreDialogOpen] = (0, import_react60.useState)(false);
43418
+ const [brandingLoaded, setBrandingLoaded] = (0, import_react60.useState)(false);
43419
+ const [isLoadingBranding, setIsLoadingBranding] = (0, import_react60.useState)(false);
43078
43420
  const { initModels } = useModelStore();
43079
43421
  const { settings: packageSettings } = usePackageSettingsStore();
43080
43422
  const authToken = useAuthenticationStore((state) => state.token);
@@ -43082,8 +43424,8 @@ var Management = () => {
43082
43424
  const { hasAdminDashboard, hasLimitedAdminDashboard, getCurrentTier, hasAdvancedSearch } = useFeatures();
43083
43425
  const { showAdminPanel, showLimitedAdminPanel } = useFeatureVisibility();
43084
43426
  const { provider: currentProvider, config: currentProviderConfig } = useAIProviderStore();
43085
- const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react59.useState)(false);
43086
- const [localSelectedModel, setLocalSelectedModel] = (0, import_react59.useState)({
43427
+ const [seedPacksEnabled, setSeedPacksEnabled] = (0, import_react60.useState)(false);
43428
+ const [localSelectedModel, setLocalSelectedModel] = (0, import_react60.useState)({
43087
43429
  name: "",
43088
43430
  tagline: "",
43089
43431
  systemPrompt: "",
@@ -43096,7 +43438,7 @@ var Management = () => {
43096
43438
  loadDocuments,
43097
43439
  clearAllDocuments
43098
43440
  } = useKnowledgeStore2();
43099
- (0, import_react59.useEffect)(() => {
43441
+ (0, import_react60.useEffect)(() => {
43100
43442
  if (selectedModel) {
43101
43443
  const selected = availableModels.find((m) => m.name === selectedModel);
43102
43444
  if (selected) {
@@ -43120,7 +43462,7 @@ var Management = () => {
43120
43462
  }
43121
43463
  }
43122
43464
  }, [selectedModel, availableModels]);
43123
- const loadBrandingConfig = (0, import_react59.useCallback)(async () => {
43465
+ const loadBrandingConfig = (0, import_react60.useCallback)(async () => {
43124
43466
  if (isLoadingBranding || brandingLoaded) {
43125
43467
  debugLogger.warn("Branding loading already in progress or completed, skipping");
43126
43468
  return;
@@ -43235,15 +43577,15 @@ var Management = () => {
43235
43577
  setTagline,
43236
43578
  setTheme
43237
43579
  ]);
43238
- (0, import_react59.useEffect)(() => {
43580
+ (0, import_react60.useEffect)(() => {
43239
43581
  void loadBrandingConfig();
43240
43582
  }, [loadBrandingConfig]);
43241
43583
  const handleOpenModal = () => setModalOpen(true);
43242
43584
  const handleCloseModal = () => setModalOpen(false);
43243
- (0, import_react59.useEffect)(() => {
43585
+ (0, import_react60.useEffect)(() => {
43244
43586
  getOptimalFabLogo().then(setFabLogo);
43245
43587
  }, []);
43246
- (0, import_react59.useEffect)(() => {
43588
+ (0, import_react60.useEffect)(() => {
43247
43589
  if (logoBase64) {
43248
43590
  setFabLogo(logoBase64);
43249
43591
  } else {
@@ -43690,7 +44032,7 @@ var Management = () => {
43690
44032
  reader.readAsText(file);
43691
44033
  }
43692
44034
  };
43693
- (0, import_react59.useEffect)(() => {
44035
+ (0, import_react60.useEffect)(() => {
43694
44036
  if (localSelectedModel.selectedModel && !availableModels.some((m) => m.name === localSelectedModel.selectedModel)) {
43695
44037
  setLocalSelectedModel((prev) => ({
43696
44038
  ...prev,
@@ -43698,10 +44040,10 @@ var Management = () => {
43698
44040
  }));
43699
44041
  }
43700
44042
  }, [availableModels, localSelectedModel.selectedModel]);
43701
- (0, import_react59.useEffect)(() => {
44043
+ (0, import_react60.useEffect)(() => {
43702
44044
  loadDocuments();
43703
44045
  }, [loadDocuments]);
43704
- (0, import_react59.useEffect)(() => {
44046
+ (0, import_react60.useEffect)(() => {
43705
44047
  const gatewayApiUrl = packageSettings?.gatewayApiUrl;
43706
44048
  if (!gatewayApiUrl || gatewayApiUrl.toLowerCase().startsWith("playground://")) {
43707
44049
  setSeedPacksEnabled(false);
@@ -43744,7 +44086,7 @@ var Management = () => {
43744
44086
  isActive = false;
43745
44087
  };
43746
44088
  }, [packageSettings?.gatewayApiUrl, authToken]);
43747
- const currentTheme = (0, import_react59.useMemo)(() => {
44089
+ const currentTheme = (0, import_react60.useMemo)(() => {
43748
44090
  const baseTheme = predefinedThemes[theme] || banditDarkTheme;
43749
44091
  return (0, import_styles32.createTheme)(baseTheme, {
43750
44092
  components: {
@@ -43774,43 +44116,43 @@ var Management = () => {
43774
44116
  const allNavTabs = [
43775
44117
  {
43776
44118
  label: "Personalities",
43777
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(FaceRetouchingNaturalIcon, {}),
44119
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(FaceRetouchingNaturalIcon, {}),
43778
44120
  requiresFeature: "limitedAdminDashboard"
43779
44121
  // Available to premium+
43780
44122
  },
43781
44123
  {
43782
44124
  label: "Branding",
43783
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BrushIcon, {}),
44125
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(BrushIcon, {}),
43784
44126
  requiresFeature: "limitedAdminDashboard"
43785
44127
  // Available to premium+
43786
44128
  },
43787
44129
  {
43788
44130
  label: "Knowledge",
43789
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(MenuBookIcon, {}),
44131
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MenuBookIcon, {}),
43790
44132
  requiresFeature: "limitedAdminDashboard"
43791
44133
  // Available to premium+
43792
44134
  },
43793
44135
  {
43794
44136
  label: "Storage",
43795
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(StorageIcon, {}),
44137
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(StorageIcon, {}),
43796
44138
  requiresFeature: "limitedAdminDashboard"
43797
44139
  // Available to premium+ (changed from adminDashboardEnabled)
43798
44140
  },
43799
44141
  {
43800
44142
  label: "Preferences",
43801
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(TuneIcon, {}),
44143
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(TuneIcon, {}),
43802
44144
  requiresFeature: "limitedAdminDashboard"
43803
44145
  // Available to premium+
43804
44146
  },
43805
44147
  {
43806
44148
  label: "Provider",
43807
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(CloudIcon, {}),
44149
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CloudIcon, {}),
43808
44150
  requiresFeature: "advancedSearch"
43809
44151
  // Pro/Team users with advanced features
43810
44152
  },
43811
44153
  {
43812
- label: "MCP Tools",
43813
- icon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BuildIcon, {}),
44154
+ label: "Tools",
44155
+ icon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(BuildIcon, {}),
43814
44156
  requiresFeature: "advancedSearch"
43815
44157
  // Pro/Team users with advanced features
43816
44158
  }
@@ -43829,7 +44171,7 @@ var Management = () => {
43829
44171
  });
43830
44172
  const preferredDefaultTabIndex = navTabs.findIndex((tab) => tab.label === "Preferences");
43831
44173
  const defaultTabIndex = preferredDefaultTabIndex >= 0 ? preferredDefaultTabIndex : 0;
43832
- (0, import_react59.useEffect)(() => {
44174
+ (0, import_react60.useEffect)(() => {
43833
44175
  setTabIndex((current) => {
43834
44176
  if (current < 0 || current >= navTabs.length) {
43835
44177
  return defaultTabIndex;
@@ -43839,8 +44181,8 @@ var Management = () => {
43839
44181
  }, [navTabs.length, defaultTabIndex]);
43840
44182
  const mobileQuickTabs = navTabs.slice(0, 5);
43841
44183
  const hasMobileOverflowTabs = navTabs.length > mobileQuickTabs.length;
43842
- const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
43843
- import_material49.Box,
44184
+ const navigationContent = /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44185
+ import_material50.Box,
43844
44186
  {
43845
44187
  sx: {
43846
44188
  display: "flex",
@@ -43850,8 +44192,8 @@ var Management = () => {
43850
44192
  bgcolor: "inherit"
43851
44193
  },
43852
44194
  children: [
43853
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43854
- import_material49.Box,
44195
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44196
+ import_material50.Box,
43855
44197
  {
43856
44198
  sx: {
43857
44199
  height: 6,
@@ -43864,15 +44206,15 @@ var Management = () => {
43864
44206
  }
43865
44207
  }
43866
44208
  ),
43867
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43868
- import_material49.Button,
44209
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Box, { sx: { p: isMobile ? 2.5 : 3, pb: isMobile ? 1.5 : 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44210
+ import_material50.Button,
43869
44211
  {
43870
44212
  onClick: () => {
43871
44213
  if (isMobile) setSidebarOpen(false);
43872
44214
  navigate("/chat");
43873
44215
  },
43874
44216
  onMouseEnter: preloadChatPage,
43875
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ChevronLeftIcon, { sx: { fontSize: 20 } }),
44217
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ChevronLeftIcon, { sx: { fontSize: 20 } }),
43876
44218
  fullWidth: true,
43877
44219
  variant: "outlined",
43878
44220
  sx: {
@@ -43899,9 +44241,9 @@ var Management = () => {
43899
44241
  children: "Back to Chat"
43900
44242
  }
43901
44243
  ) }),
43902
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
43903
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
43904
- import_material49.ListItemButton,
44244
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Divider, { sx: { mx: isMobile ? 2 : 3, mb: 2, opacity: 0.6 } }),
44245
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Box, { sx: { flex: 1, px: isMobile ? 1.5 : 2, pb: 3, overflowY: "auto" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.List, { sx: { px: 0, py: 0 }, children: navTabs.map((tab, idx) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44246
+ import_material50.ListItemButton,
43905
44247
  {
43906
44248
  selected: tabIndex === idx,
43907
44249
  onClick: () => {
@@ -43950,8 +44292,8 @@ var Management = () => {
43950
44292
  }
43951
44293
  },
43952
44294
  children: [
43953
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43954
- import_material49.ListItemIcon,
44295
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44296
+ import_material50.ListItemIcon,
43955
44297
  {
43956
44298
  sx: {
43957
44299
  color: tabIndex === idx ? "primary.main" : "text.secondary",
@@ -43961,8 +44303,8 @@ var Management = () => {
43961
44303
  children: tab.icon
43962
44304
  }
43963
44305
  ),
43964
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43965
- import_material49.ListItemText,
44306
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44307
+ import_material50.ListItemText,
43966
44308
  {
43967
44309
  primary: tab.label,
43968
44310
  primaryTypographyProps: {
@@ -43972,8 +44314,8 @@ var Management = () => {
43972
44314
  }
43973
44315
  }
43974
44316
  ),
43975
- tabIndex === idx && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
43976
- import_material49.Box,
44317
+ tabIndex === idx && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44318
+ import_material50.Box,
43977
44319
  {
43978
44320
  sx: {
43979
44321
  position: "absolute",
@@ -43996,10 +44338,10 @@ var Management = () => {
43996
44338
  }
43997
44339
  );
43998
44340
  if (!brandingLoaded) return null;
43999
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_material49.ThemeProvider, { theme: currentTheme, children: [
44000
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.CssBaseline, {}),
44001
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
44002
- import_material49.Box,
44341
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.ThemeProvider, { theme: currentTheme, children: [
44342
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.CssBaseline, {}),
44343
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44344
+ import_material50.Box,
44003
44345
  {
44004
44346
  display: "flex",
44005
44347
  height: "100vh",
@@ -44011,8 +44353,8 @@ var Management = () => {
44011
44353
  position: "relative"
44012
44354
  },
44013
44355
  children: [
44014
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
44015
- import_material49.Box,
44356
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44357
+ import_material50.Box,
44016
44358
  {
44017
44359
  sx: {
44018
44360
  width: "100%",
@@ -44031,8 +44373,8 @@ var Management = () => {
44031
44373
  boxShadow: "0 2px 8px rgba(0,0,0,0.1)"
44032
44374
  },
44033
44375
  children: [
44034
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44035
- import_material49.Button,
44376
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44377
+ import_material50.Button,
44036
44378
  {
44037
44379
  onClick: () => setSidebarOpen((o) => !o),
44038
44380
  sx: {
@@ -44053,7 +44395,7 @@ var Management = () => {
44053
44395
  transform: sidebarOpen ? "rotate(90deg) scale(0.95)" : "scale(0.95)"
44054
44396
  }
44055
44397
  },
44056
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44398
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44057
44399
  "path",
44058
44400
  {
44059
44401
  d: sidebarOpen ? "M18 6L6 18M6 6L18 18" : "M3 12H21M3 6H21M3 18H21",
@@ -44065,8 +44407,8 @@ var Management = () => {
44065
44407
  ) })
44066
44408
  }
44067
44409
  ),
44068
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44069
- import_material49.Typography,
44410
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44411
+ import_material50.Typography,
44070
44412
  {
44071
44413
  variant: "h6",
44072
44414
  sx: {
@@ -44078,14 +44420,14 @@ var Management = () => {
44078
44420
  children: "Management"
44079
44421
  }
44080
44422
  ),
44081
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_material49.Box, { sx: {
44423
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Box, { sx: {
44082
44424
  px: 2,
44083
44425
  py: 0.5,
44084
44426
  borderRadius: 2,
44085
44427
  bgcolor: (theme2) => theme2.palette.mode === "dark" ? "rgba(25,118,210,0.12)" : "rgba(25,118,210,0.08)",
44086
44428
  border: (theme2) => `1px solid ${theme2.palette.primary.main}20`
44087
- }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44088
- import_material49.Typography,
44429
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44430
+ import_material50.Typography,
44089
44431
  {
44090
44432
  variant: "caption",
44091
44433
  sx: {
@@ -44099,8 +44441,8 @@ var Management = () => {
44099
44441
  ]
44100
44442
  }
44101
44443
  ),
44102
- isMobile && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
44103
- import_material49.Box,
44444
+ isMobile && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44445
+ import_material50.Box,
44104
44446
  {
44105
44447
  sx: {
44106
44448
  width: "100%",
@@ -44117,8 +44459,8 @@ var Management = () => {
44117
44459
  mobileQuickTabs.map((tab) => {
44118
44460
  const quickTabIndex = navTabs.findIndex((navTab) => navTab.label === tab.label);
44119
44461
  const selected = tabIndex === quickTabIndex;
44120
- return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44121
- import_material49.Button,
44462
+ return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44463
+ import_material50.Button,
44122
44464
  {
44123
44465
  size: "small",
44124
44466
  onClick: () => setTabIndex(quickTabIndex),
@@ -44143,8 +44485,8 @@ var Management = () => {
44143
44485
  tab.label
44144
44486
  );
44145
44487
  }),
44146
- hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44147
- import_material49.Button,
44488
+ hasMobileOverflowTabs && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44489
+ import_material50.Button,
44148
44490
  {
44149
44491
  size: "small",
44150
44492
  onClick: () => setSidebarOpen(true),
@@ -44166,8 +44508,8 @@ var Management = () => {
44166
44508
  ]
44167
44509
  }
44168
44510
  ),
44169
- isMobile ? /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44170
- import_material49.SwipeableDrawer,
44511
+ isMobile ? /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44512
+ import_material50.SwipeableDrawer,
44171
44513
  {
44172
44514
  anchor: "bottom",
44173
44515
  open: sidebarOpen,
@@ -44187,8 +44529,8 @@ var Management = () => {
44187
44529
  },
44188
44530
  children: navigationContent
44189
44531
  }
44190
- ) : /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44191
- import_material49.Box,
44532
+ ) : /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44533
+ import_material50.Box,
44192
44534
  {
44193
44535
  sx: {
44194
44536
  width: 280,
@@ -44211,8 +44553,8 @@ var Management = () => {
44211
44553
  children: navigationContent
44212
44554
  }
44213
44555
  ),
44214
- /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
44215
- import_material49.Box,
44556
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44557
+ import_material50.Box,
44216
44558
  {
44217
44559
  sx: {
44218
44560
  flex: 1,
@@ -44231,7 +44573,7 @@ var Management = () => {
44231
44573
  transition: "margin-left 0.2s"
44232
44574
  },
44233
44575
  children: [
44234
- navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44576
+ navTabs[tabIndex]?.label === "Personalities" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44235
44577
  PersonalitiesTab_default,
44236
44578
  {
44237
44579
  availableModels,
@@ -44250,7 +44592,7 @@ var Management = () => {
44250
44592
  showSnackbar: showSnackbarMessage
44251
44593
  }
44252
44594
  ),
44253
- navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44595
+ navTabs[tabIndex]?.label === "Branding" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44254
44596
  BrandingTab_default,
44255
44597
  {
44256
44598
  logoFile,
@@ -44269,7 +44611,7 @@ var Management = () => {
44269
44611
  setLogoBase64
44270
44612
  }
44271
44613
  ),
44272
- navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44614
+ navTabs[tabIndex]?.label === "Knowledge" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44273
44615
  KnowledgeHubTab_default,
44274
44616
  {
44275
44617
  documents,
@@ -44282,8 +44624,8 @@ var Management = () => {
44282
44624
  seedPacksEnabled
44283
44625
  }
44284
44626
  ),
44285
- navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(StorageTab_default, { currentTheme }),
44286
- navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44627
+ navTabs[tabIndex]?.label === "Storage" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(StorageTab_default, { currentTheme }),
44628
+ navTabs[tabIndex]?.label === "Preferences" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44287
44629
  PreferencesTab_default,
44288
44630
  {
44289
44631
  preferences,
@@ -44293,13 +44635,13 @@ var Management = () => {
44293
44635
  showSnackbar: showSnackbarMessage
44294
44636
  }
44295
44637
  ),
44296
- navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ProviderTab, {}),
44297
- navTabs[tabIndex]?.label === "MCP Tools" && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(MCPToolsTabV2_default, {})
44638
+ navTabs[tabIndex]?.label === "Provider" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(ProviderTab, {}),
44639
+ navTabs[tabIndex]?.label === "Tools" && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(MCPToolsTabV2_default, {})
44298
44640
  ]
44299
44641
  }
44300
44642
  ),
44301
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44302
- import_material49.Fab,
44643
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44644
+ import_material50.Fab,
44303
44645
  {
44304
44646
  "aria-label": "AI",
44305
44647
  onClick: handleOpenModal,
@@ -44320,7 +44662,7 @@ var Management = () => {
44320
44662
  boxShadow: theme2.shadows[6],
44321
44663
  zIndex: 2e3
44322
44664
  }),
44323
- children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
44665
+ children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44324
44666
  "img",
44325
44667
  {
44326
44668
  src: fabLogo,
@@ -44334,7 +44676,7 @@ var Management = () => {
44334
44676
  )
44335
44677
  }
44336
44678
  ),
44337
- /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
44679
+ /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(chat_modal_default, { open: modalOpen, onClose: handleCloseModal })
44338
44680
  ]
44339
44681
  }
44340
44682
  )
@@ -44343,7 +44685,7 @@ var Management = () => {
44343
44685
  var management_default = Management;
44344
44686
 
44345
44687
  // src/shared/custom-element.ts
44346
- var import_react60 = __toESM(require("react"));
44688
+ var import_react61 = __toESM(require("react"));
44347
44689
  var import_client = __toESM(require("react-dom/client"));
44348
44690
  function defineCustomElement(name, Component) {
44349
44691
  if (customElements.get(name)) return;
@@ -44371,7 +44713,7 @@ function defineCustomElement(name, Component) {
44371
44713
  if (!this.root) {
44372
44714
  this.root = import_client.default.createRoot(this.mountPoint);
44373
44715
  }
44374
- this.root.render(import_react60.default.createElement(Component, props));
44716
+ this.root.render(import_react61.default.createElement(Component, props));
44375
44717
  }
44376
44718
  }
44377
44719
  customElements.define(name, ReactElement);
@@ -44580,7 +44922,7 @@ var getFeatureMatrix = () => featureFlagService.generateFeatureMatrix();
44580
44922
  init_featureFlags();
44581
44923
 
44582
44924
  // src/hooks/useVoices.ts
44583
- var import_react61 = require("react");
44925
+ var import_react62 = require("react");
44584
44926
  init_voiceStore();
44585
44927
  init_packageSettingsStore();
44586
44928
  init_authenticationStore();
@@ -44600,7 +44942,7 @@ var useVoices = () => {
44600
44942
  } = useVoiceStore();
44601
44943
  const gatewayApiUrl = usePackageSettingsStore((state) => state.settings?.gatewayApiUrl);
44602
44944
  const { token } = useAuthenticationStore();
44603
- (0, import_react61.useEffect)(() => {
44945
+ (0, import_react62.useEffect)(() => {
44604
44946
  const isAuthenticated = authenticationService.isAuthenticated();
44605
44947
  if (gatewayApiUrl && token && isAuthenticated && !isServiceAvailable) {
44606
44948
  debugLogger.debug("Gateway API URL and JWT token available, loading voice models...");
@@ -44635,9 +44977,9 @@ init_useTTS();
44635
44977
  init_streaming_tts();
44636
44978
 
44637
44979
  // src/modals/SubscriptionExpiredModal.tsx
44638
- var import_material50 = require("@mui/material");
44980
+ var import_material51 = require("@mui/material");
44639
44981
  var import_lucide_react12 = require("lucide-react");
44640
- var import_jsx_runtime50 = require("react/jsx-runtime");
44982
+ var import_jsx_runtime51 = require("react/jsx-runtime");
44641
44983
  var SubscriptionExpiredModal = ({
44642
44984
  open,
44643
44985
  onNavigateHome,
@@ -44659,8 +45001,8 @@ var SubscriptionExpiredModal = ({
44659
45001
  window.location.href = "/manage-subscription";
44660
45002
  }
44661
45003
  };
44662
- return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
44663
- import_material50.Dialog,
45004
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
45005
+ import_material51.Dialog,
44664
45006
  {
44665
45007
  open,
44666
45008
  onClose,
@@ -44674,47 +45016,47 @@ var SubscriptionExpiredModal = ({
44674
45016
  }
44675
45017
  },
44676
45018
  children: [
44677
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
44678
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react12.AlertTriangle, { size: 32, color: "warning" }),
44679
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
45019
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.DialogTitle, { sx: { textAlign: "center", pb: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material51.Box, { sx: { display: "flex", alignItems: "center", justifyContent: "center", gap: 1, mb: 1 }, children: [
45020
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.AlertTriangle, { size: 32, color: "warning" }),
45021
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.Typography, { variant: "h5", component: "span", fontWeight: "bold", children: "Subscription Expired" })
44680
45022
  ] }) }),
44681
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.Stack, { spacing: 2, children: [
44682
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Alert, { severity: "warning", sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Typography, { variant: "body2", children: "Your subscription has expired and access to features has been restricted." }) }),
44683
- userEmail && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.Typography, { variant: "body2", color: "text.secondary", sx: { textAlign: "center" }, children: [
45023
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.DialogContent, { sx: { pt: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material51.Stack, { spacing: 2, children: [
45024
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.Alert, { severity: "warning", sx: { mb: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.Typography, { variant: "body2", children: "Your subscription has expired and access to features has been restricted." }) }),
45025
+ userEmail && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material51.Typography, { variant: "body2", color: "text.secondary", sx: { textAlign: "center" }, children: [
44684
45026
  "Account: ",
44685
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: userEmail })
45027
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: userEmail })
44686
45028
  ] }),
44687
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.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." }),
44688
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_material50.Box, { sx: {
45029
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.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." }),
45030
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_material51.Box, { sx: {
44689
45031
  bgcolor: "background.paper",
44690
45032
  border: 1,
44691
45033
  borderColor: "divider",
44692
45034
  borderRadius: 1,
44693
45035
  p: 2,
44694
45036
  mt: 2
44695
- }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.Typography, { variant: "caption", color: "text.secondary", sx: { fontStyle: "italic" }, children: [
44696
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("strong", { children: "What's affected:" }),
45037
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material51.Typography, { variant: "caption", color: "text.secondary", sx: { fontStyle: "italic" }, children: [
45038
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("strong", { children: "What's affected:" }),
44697
45039
  " All premium features including document upload, voice controls, advanced search, and admin dashboard access have been disabled until your subscription is renewed."
44698
45040
  ] }) })
44699
45041
  ] }) }),
44700
- /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_material50.DialogActions, { sx: { px: 3, pb: 3, gap: 1, justifyContent: "center" }, children: [
44701
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44702
- import_material50.Button,
45042
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_material51.DialogActions, { sx: { px: 3, pb: 3, gap: 1, justifyContent: "center" }, children: [
45043
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
45044
+ import_material51.Button,
44703
45045
  {
44704
45046
  onClick: handleNavigateHome,
44705
45047
  variant: "outlined",
44706
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react12.Home, {}),
45048
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.Home, {}),
44707
45049
  size: "large",
44708
45050
  sx: { minWidth: 140 },
44709
45051
  children: "Go Home"
44710
45052
  }
44711
45053
  ),
44712
- /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
44713
- import_material50.Button,
45054
+ /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
45055
+ import_material51.Button,
44714
45056
  {
44715
45057
  onClick: handleManageSubscription,
44716
45058
  variant: "contained",
44717
- startIcon: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react12.CreditCard, {}),
45059
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.CreditCard, {}),
44718
45060
  size: "large",
44719
45061
  color: "primary",
44720
45062
  sx: { minWidth: 140 },
@@ -44728,9 +45070,9 @@ var SubscriptionExpiredModal = ({
44728
45070
  };
44729
45071
 
44730
45072
  // src/guards/SubscriptionExpiredGuard.tsx
44731
- var import_react62 = require("react");
45073
+ var import_react63 = require("react");
44732
45074
  init_useFeatures();
44733
- var import_jsx_runtime51 = require("react/jsx-runtime");
45075
+ var import_jsx_runtime52 = require("react/jsx-runtime");
44734
45076
  var SubscriptionExpiredGuard = ({
44735
45077
  children,
44736
45078
  onNavigateHome,
@@ -44739,9 +45081,9 @@ var SubscriptionExpiredGuard = ({
44739
45081
  allowContinue = false
44740
45082
  }) => {
44741
45083
  const { isExpiredTier, getFullEvaluation } = useFeatures();
44742
- const [showModal, setShowModal] = (0, import_react62.useState)(false);
44743
- const [userDismissed, setUserDismissed] = (0, import_react62.useState)(false);
44744
- (0, import_react62.useEffect)(() => {
45084
+ const [showModal, setShowModal] = (0, import_react63.useState)(false);
45085
+ const [userDismissed, setUserDismissed] = (0, import_react63.useState)(false);
45086
+ (0, import_react63.useEffect)(() => {
44745
45087
  if (isExpiredTier() && !userDismissed) {
44746
45088
  setShowModal(true);
44747
45089
  } else {
@@ -44767,9 +45109,9 @@ var SubscriptionExpiredGuard = ({
44767
45109
  }
44768
45110
  return void 0;
44769
45111
  })() : void 0;
44770
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_jsx_runtime51.Fragment, { children: [
45112
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
44771
45113
  children,
44772
- /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
45114
+ /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
44773
45115
  SubscriptionExpiredModal,
44774
45116
  {
44775
45117
  open: showModal,