@burtson-labs/bandit-engine 2.0.117 → 2.0.118

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.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  chat_default
3
- } from "./chunk-UEWOOLEB.mjs";
3
+ } from "./chunk-RBMHAWU7.mjs";
4
4
  import {
5
5
  chat_provider_default
6
6
  } from "./chunk-VTKRZNLI.mjs";
@@ -10,7 +10,7 @@ import {
10
10
  useGatewayHealth,
11
11
  useGatewayMemory,
12
12
  useGatewayModels
13
- } from "./chunk-3JR3GT5F.mjs";
13
+ } from "./chunk-YLETAU5Y.mjs";
14
14
  import "./chunk-W2EPDR5G.mjs";
15
15
  import "./chunk-HAUDGBUS.mjs";
16
16
  import "./chunk-BN3D45E2.mjs";
@@ -28277,8 +28277,14 @@ var init_chat_app_bar = __esm({
28277
28277
  }
28278
28278
  void triggerSync({ force: true });
28279
28279
  };
28280
- const { hasTTS, hasSTT, isAdmin, getCurrentTier, hasLimitedAdminDashboard } = useFeatures();
28280
+ const { hasTTS, hasSTT, isAdmin, getCurrentTier, hasLimitedAdminDashboard, isSubscribed } = useFeatures();
28281
28281
  const { showVoiceControls, showLimitedAdminPanel } = useFeatureVisibility();
28282
+ const frontierEligible = (() => {
28283
+ if (isAdmin() || isSubscribed()) return true;
28284
+ const tier = String(getCurrentTier());
28285
+ return tier !== "trial" && tier !== "expired" && tier !== "free" && tier !== "basic";
28286
+ })();
28287
+ const plansPath = "/plans";
28282
28288
  const isTTSAvailable = !!packageSettings?.gatewayApiUrl && preferences.ttsEnabled && hasTTS();
28283
28289
  const currentConversation = conversations.find((c) => c.id === currentId);
28284
28290
  const conversationCountDisplay = conversations.length > 99 ? "99+" : conversations.length.toString();
@@ -28657,12 +28663,14 @@ var init_chat_app_bar = __esm({
28657
28663
  engine.thinking && "thinking",
28658
28664
  engine.cloud && "cloud"
28659
28665
  ].filter(Boolean);
28666
+ const isGated = engine.cloud && !frontierEligible;
28660
28667
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(
28661
28668
  import_material47.MenuItem,
28662
28669
  {
28663
28670
  selected: engine.id === resolvedEngineId,
28664
- disabled: !engine.available,
28671
+ disabled: !engine.available || isGated,
28665
28672
  onClick: () => {
28673
+ if (isGated) return;
28666
28674
  useEngineStore.getState().setSelectedEngine(engine.id);
28667
28675
  setEngineAnchorEl(null);
28668
28676
  },
@@ -28674,14 +28682,61 @@ var init_chat_app_bar = __esm({
28674
28682
  py: 1,
28675
28683
  px: 2,
28676
28684
  maxWidth: 360,
28677
- whiteSpace: "normal"
28685
+ whiteSpace: "normal",
28686
+ // Keep gated rows readable (MUI disabled dims to ~38%) so the
28687
+ // upsell stays legible.
28688
+ ...isGated ? { opacity: 1, "&.Mui-disabled": { opacity: 1 } } : {}
28678
28689
  },
28679
28690
  children: [
28680
28691
  /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_material47.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
28681
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: cleanEngineName(engine.displayName) }),
28682
- engine.id === resolvedEngineId && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
28692
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28693
+ LockIcon,
28694
+ {
28695
+ fontSize: "small",
28696
+ sx: { fontSize: "0.95rem", color: theme.palette.text.secondary }
28697
+ }
28698
+ ),
28699
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28700
+ import_material47.Typography,
28701
+ {
28702
+ variant: "body2",
28703
+ sx: {
28704
+ fontWeight: 600,
28705
+ flex: 1,
28706
+ color: isGated ? theme.palette.text.secondary : void 0
28707
+ },
28708
+ children: cleanEngineName(engine.displayName)
28709
+ }
28710
+ ),
28711
+ engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
28683
28712
  ] }),
28684
- /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
28713
+ /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: isGated ? "Premium engine \u2014 available on a paid plan." : engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
28714
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28715
+ import_material47.Button,
28716
+ {
28717
+ size: "small",
28718
+ variant: "text",
28719
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(LockIcon, { sx: { fontSize: "0.85rem" } }),
28720
+ onClick: (e) => {
28721
+ e.stopPropagation();
28722
+ setEngineAnchorEl(null);
28723
+ safeNavigate(plansPath);
28724
+ },
28725
+ sx: {
28726
+ mt: 0.25,
28727
+ px: 0.75,
28728
+ py: 0.1,
28729
+ minWidth: 0,
28730
+ textTransform: "none",
28731
+ fontSize: "0.7rem",
28732
+ fontWeight: 600,
28733
+ color: theme.palette.primary.main,
28734
+ // Re-enable pointer events the disabled MenuItem strips.
28735
+ pointerEvents: "auto"
28736
+ },
28737
+ children: "Upgrade to unlock"
28738
+ }
28739
+ ),
28685
28740
  badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_material47.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
28686
28741
  import_material47.Box,
28687
28742
  {
@@ -44274,7 +44329,9 @@ var Management = () => {
44274
44329
  "platform_admin"
44275
44330
  ]);
44276
44331
  const userRoles = (authenticationService.parseJwtClaims(authenticationService.getToken() ?? "")?.roles ?? []).map((r) => r.toLowerCase());
44277
- const isWorkspaceAdmin = userRoles.some((r) => platformAdminRoles.has(r));
44332
+ const isWorkspaceAdmin = userRoles.some(
44333
+ (r) => platformAdminRoles.has(r) || r.endsWith("-admin")
44334
+ );
44278
44335
  const navTabs = allNavTabs.filter((tab) => {
44279
44336
  if (tab.requiresAdmin && !isWorkspaceAdmin) return false;
44280
44337
  if (tab.requiresFeature === "limitedAdminDashboard") {