@burtson-labs/bandit-engine 2.0.18 → 2.0.20

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-5UVULH77.mjs";
3
+ } from "./chunk-6V2YMAX2.mjs";
4
4
  import "./chunk-ONQMRE2G.mjs";
5
5
  import "./chunk-RTQDQ6TC.mjs";
6
6
  import "./chunk-XEG45Q6V.mjs";
@@ -12,4 +12,4 @@ import "./chunk-BJTO5JO5.mjs";
12
12
  export {
13
13
  chat_default as default
14
14
  };
15
- //# sourceMappingURL=chat-ZPJNWIXI.mjs.map
15
+ //# sourceMappingURL=chat-2Y72EFJ2.mjs.map
@@ -2364,10 +2364,25 @@ var moodPromptMap = {
2364
2364
  };
2365
2365
 
2366
2366
  // src/services/mcp/mcpService.ts
2367
+ var isPlaygroundMode = () => {
2368
+ const settings = usePackageSettingsStore.getState().settings;
2369
+ if (!settings) {
2370
+ return false;
2371
+ }
2372
+ const gatewayUrl = settings.gatewayApiUrl?.toLowerCase() ?? "";
2373
+ return Boolean(settings.playgroundMode || gatewayUrl.startsWith("playground://"));
2374
+ };
2367
2375
  var executeMCPTool = async (toolCall) => {
2368
2376
  try {
2369
2377
  const { tools } = useMCPToolsStore.getState();
2370
2378
  const { settings } = usePackageSettingsStore.getState();
2379
+ if (isPlaygroundMode()) {
2380
+ debugLogger.info("Skipping MCP tool execution in playground mode", { toolName: toolCall.toolName });
2381
+ return {
2382
+ success: false,
2383
+ error: "MCP tools are disabled while playground mode is active."
2384
+ };
2385
+ }
2371
2386
  const tool = tools.find((t) => t.function.name === toolCall.toolName && t.enabled);
2372
2387
  if (!tool) {
2373
2388
  return {
@@ -2470,6 +2485,9 @@ var getEnabledMCPToolsForAI = () => {
2470
2485
  }));
2471
2486
  };
2472
2487
  var isMCPAvailable = () => {
2488
+ if (isPlaygroundMode()) {
2489
+ return false;
2490
+ }
2473
2491
  const { settings } = usePackageSettingsStore.getState();
2474
2492
  const { tools } = useMCPToolsStore.getState();
2475
2493
  return !!(settings?.gatewayApiUrl && tools.some((t) => t.enabled));
@@ -5496,20 +5514,16 @@ var ConversationDrawer = ({ open, onClose }) => {
5496
5514
  return text.slice(start, end).replace(/\s+/g, " ").trim();
5497
5515
  };
5498
5516
  const projectGroups = useMemo2(() => {
5499
- const groups = [];
5500
- projects.forEach((project) => {
5501
- const projectConversations = getConversationsByProject(project.id).map((conversation) => ({
5517
+ const groups = projects.map((project) => ({
5518
+ id: project.id,
5519
+ name: project.name,
5520
+ color: project.color,
5521
+ conversations: conversations.filter((conversation) => conversation.projectId === project.id).map((conversation) => ({
5502
5522
  ...conversation
5503
- }));
5504
- groups.push({
5505
- id: project.id,
5506
- name: project.name,
5507
- color: project.color,
5508
- conversations: projectConversations,
5509
- collapsed: collapsedProjects.has(project.id)
5510
- });
5511
- });
5512
- const ungroupedConversations = getConversationsByProject(null).map((conversation) => ({
5523
+ })),
5524
+ collapsed: collapsedProjects.has(project.id)
5525
+ }));
5526
+ const ungroupedConversations = conversations.filter((conversation) => !conversation.projectId).map((conversation) => ({
5513
5527
  ...conversation
5514
5528
  }));
5515
5529
  if (ungroupedConversations.length > 0) {
@@ -5518,11 +5532,10 @@ var ConversationDrawer = ({ open, onClose }) => {
5518
5532
  name: "Ungrouped",
5519
5533
  conversations: ungroupedConversations,
5520
5534
  collapsed: false
5521
- // Never collapsed for ungrouped
5522
5535
  });
5523
5536
  }
5524
5537
  return groups.filter((group) => group.conversations.length > 0 || group.id !== null);
5525
- }, [projects, getConversationsByProject, collapsedProjects]);
5538
+ }, [projects, conversations, collapsedProjects]);
5526
5539
  const filteredProjectGroups = useMemo2(() => {
5527
5540
  if (!searchQuery.trim()) return projectGroups;
5528
5541
  const query = searchQuery.toLowerCase();
@@ -7060,6 +7073,9 @@ var ChatAppBar = ({
7060
7073
  const { conversations, currentId, createNewConversation, _hasHydrated } = useConversationStore();
7061
7074
  const { preferences } = usePreferencesStore();
7062
7075
  const { settings: packageSettings } = usePackageSettingsStore();
7076
+ const isPlaygroundRoute = typeof window !== "undefined" && window.location.pathname.includes("/playground");
7077
+ const isPlaygroundMode2 = Boolean(packageSettings?.playgroundMode) || (packageSettings?.gatewayApiUrl ?? "").toLowerCase().startsWith("playground://") || typeof window !== "undefined" && window.location.pathname.startsWith("/playground");
7078
+ const managementPath = isPlaygroundMode2 ? "/playground/management" : "/management";
7063
7079
  const {
7064
7080
  syncEnabled,
7065
7081
  syncStatus,
@@ -7233,10 +7249,10 @@ var ChatAppBar = ({
7233
7249
  showLimitedAdminPanel() && /* @__PURE__ */ jsx14(Tooltip4, { title: "Management & Settings", arrow: true, children: /* @__PURE__ */ jsx14(
7234
7250
  IconButton10,
7235
7251
  {
7236
- onClick: () => safeNavigate("/management"),
7252
+ onClick: () => safeNavigate(managementPath),
7237
7253
  sx: {
7238
7254
  ...pillButtonStyles,
7239
- ...window.location.pathname === "/management" && {
7255
+ ...typeof window !== "undefined" && window.location.pathname === managementPath && {
7240
7256
  bgcolor: theme.palette.primary.main + "20",
7241
7257
  color: theme.palette.primary.main
7242
7258
  }
@@ -9424,4 +9440,4 @@ var chat_default = Chat;
9424
9440
  export {
9425
9441
  chat_default
9426
9442
  };
9427
- //# sourceMappingURL=chunk-5UVULH77.mjs.map
9443
+ //# sourceMappingURL=chunk-6V2YMAX2.mjs.map