@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.js CHANGED
@@ -26038,8 +26038,14 @@ var init_chat_app_bar = __esm({
26038
26038
  }
26039
26039
  void triggerSync({ force: true });
26040
26040
  };
26041
- const { hasTTS, hasSTT, isAdmin, getCurrentTier, hasLimitedAdminDashboard } = useFeatures();
26041
+ const { hasTTS, hasSTT, isAdmin, getCurrentTier, hasLimitedAdminDashboard, isSubscribed } = useFeatures();
26042
26042
  const { showVoiceControls, showLimitedAdminPanel } = useFeatureVisibility();
26043
+ const frontierEligible = (() => {
26044
+ if (isAdmin() || isSubscribed()) return true;
26045
+ const tier = String(getCurrentTier());
26046
+ return tier !== "trial" && tier !== "expired" && tier !== "free" && tier !== "basic";
26047
+ })();
26048
+ const plansPath = "/plans";
26043
26049
  const isTTSAvailable = !!packageSettings?.gatewayApiUrl && preferences.ttsEnabled && hasTTS();
26044
26050
  const currentConversation = conversations.find((c) => c.id === currentId);
26045
26051
  const conversationCountDisplay = conversations.length > 99 ? "99+" : conversations.length.toString();
@@ -26418,12 +26424,14 @@ var init_chat_app_bar = __esm({
26418
26424
  engine.thinking && "thinking",
26419
26425
  engine.cloud && "cloud"
26420
26426
  ].filter(Boolean);
26427
+ const isGated = engine.cloud && !frontierEligible;
26421
26428
  return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
26422
26429
  import_material26.MenuItem,
26423
26430
  {
26424
26431
  selected: engine.id === resolvedEngineId,
26425
- disabled: !engine.available,
26432
+ disabled: !engine.available || isGated,
26426
26433
  onClick: () => {
26434
+ if (isGated) return;
26427
26435
  useEngineStore.getState().setSelectedEngine(engine.id);
26428
26436
  setEngineAnchorEl(null);
26429
26437
  },
@@ -26435,14 +26443,61 @@ var init_chat_app_bar = __esm({
26435
26443
  py: 1,
26436
26444
  px: 2,
26437
26445
  maxWidth: 360,
26438
- whiteSpace: "normal"
26446
+ whiteSpace: "normal",
26447
+ // Keep gated rows readable (MUI disabled dims to ~38%) so the
26448
+ // upsell stays legible.
26449
+ ...isGated ? { opacity: 1, "&.Mui-disabled": { opacity: 1 } } : {}
26439
26450
  },
26440
26451
  children: [
26441
26452
  /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_material26.Box, { sx: { display: "flex", alignItems: "center", gap: 1, width: "100%" }, children: [
26442
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.Typography, { variant: "body2", sx: { fontWeight: 600, flex: 1 }, children: cleanEngineName(engine.displayName) }),
26443
- engine.id === resolvedEngineId && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
26453
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
26454
+ LockIcon,
26455
+ {
26456
+ fontSize: "small",
26457
+ sx: { fontSize: "0.95rem", color: theme.palette.text.secondary }
26458
+ }
26459
+ ),
26460
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
26461
+ import_material26.Typography,
26462
+ {
26463
+ variant: "body2",
26464
+ sx: {
26465
+ fontWeight: 600,
26466
+ flex: 1,
26467
+ color: isGated ? theme.palette.text.secondary : void 0
26468
+ },
26469
+ children: cleanEngineName(engine.displayName)
26470
+ }
26471
+ ),
26472
+ engine.id === resolvedEngineId && !isGated && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.Box, { sx: { width: 8, height: 8, borderRadius: "50%", bgcolor: theme.palette.primary.main } })
26444
26473
  ] }),
26445
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.Typography, { variant: "caption", sx: { color: theme.palette.text.secondary }, children: engine.available ? engine.description : engine.unavailableReason || "Unavailable" }),
26474
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.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" }),
26475
+ isGated && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
26476
+ import_material26.Button,
26477
+ {
26478
+ size: "small",
26479
+ variant: "text",
26480
+ startIcon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(LockIcon, { sx: { fontSize: "0.85rem" } }),
26481
+ onClick: (e) => {
26482
+ e.stopPropagation();
26483
+ setEngineAnchorEl(null);
26484
+ safeNavigate(plansPath);
26485
+ },
26486
+ sx: {
26487
+ mt: 0.25,
26488
+ px: 0.75,
26489
+ py: 0.1,
26490
+ minWidth: 0,
26491
+ textTransform: "none",
26492
+ fontSize: "0.7rem",
26493
+ fontWeight: 600,
26494
+ color: theme.palette.primary.main,
26495
+ // Re-enable pointer events the disabled MenuItem strips.
26496
+ pointerEvents: "auto"
26497
+ },
26498
+ children: "Upgrade to unlock"
26499
+ }
26500
+ ),
26446
26501
  badges.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_material26.Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap", mt: 0.25 }, children: badges.map((b) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
26447
26502
  import_material26.Box,
26448
26503
  {
@@ -44934,7 +44989,9 @@ var Management = () => {
44934
44989
  "platform_admin"
44935
44990
  ]);
44936
44991
  const userRoles = (authenticationService.parseJwtClaims(authenticationService.getToken() ?? "")?.roles ?? []).map((r) => r.toLowerCase());
44937
- const isWorkspaceAdmin = userRoles.some((r) => platformAdminRoles.has(r));
44992
+ const isWorkspaceAdmin = userRoles.some(
44993
+ (r) => platformAdminRoles.has(r) || r.endsWith("-admin")
44994
+ );
44938
44995
  const navTabs = allNavTabs.filter((tab) => {
44939
44996
  if (tab.requiresAdmin && !isWorkspaceAdmin) return false;
44940
44997
  if (tab.requiresFeature === "limitedAdminDashboard") {