@shuffleio/shuffle-mcps 0.0.17 → 0.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.
package/dist/index.js CHANGED
@@ -362,21 +362,21 @@ var init_appsCache = __esm({
362
362
  var index_exports = {};
363
363
  __export(index_exports, {
364
364
  API_CONFIG: () => API_CONFIG,
365
- AgentActivityList: () => AgentActivityList_default,
366
- AgentExecutionDrawer: () => AgentExecutionDrawer_default,
365
+ AgentActivityList: () => AgentActivityList2,
366
+ AgentExecutionDrawer: () => AgentExecutionDrawer2,
367
367
  AgentIcon: () => AgentIcon_default,
368
- AgentRunDiagnosisBanner: () => AgentRunDiagnosisBanner_default,
369
- AgentRunDrawer: () => AgentRunDrawer_default,
370
- AgentUI: () => AgentUI_default,
371
- AgentsView: () => AgentsView_default,
372
- AiAgentPromptsEditor: () => AiAgentPromptsEditor_default,
368
+ AgentRunDiagnosisBanner: () => AgentRunDiagnosisBanner2,
369
+ AgentRunDrawer: () => AgentRunDrawer2,
370
+ AgentUI: () => AgentUI2,
371
+ AgentsView: () => AgentsView2,
372
+ AiAgentPromptsEditor: () => AiAgentPromptsEditor2,
373
373
  AppAuthCard: () => AppAuthCard,
374
374
  AppAuthConfig: () => AppAuthConfig,
375
- AppAuthSection: () => AppAuthSection,
376
- AppDetailDrawer: () => AppDetailDrawer,
375
+ AppAuthSection: () => AppAuthSection2,
376
+ AppDetailDrawer: () => AppDetailDrawer2,
377
377
  AppDetailProvider: () => AppDetailProvider,
378
- AppSearchDrawer: () => AppSearchDrawer,
379
- AppTitleHeader: () => AppTitleHeader,
378
+ AppSearchDrawer: () => AppSearchDrawer2,
379
+ AppTitleHeader: () => AppTitleHeader2,
380
380
  CASES_PATTERNS: () => CASES_PATTERNS,
381
381
  COMMUNICATION_PATTERNS_NAMES: () => COMMUNICATION_PATTERNS_NAMES,
382
382
  DATASTORE_CATEGORIES: () => DATASTORE_CATEGORIES,
@@ -386,15 +386,15 @@ __export(index_exports, {
386
386
  INGEST_TICKETS_WORKFLOW_NAME: () => INGEST_TICKETS_WORKFLOW_NAME,
387
387
  IntegrationStatus: () => IntegrationStatus,
388
388
  SIEM_PATTERNS: () => SIEM_PATTERNS,
389
- ShuffleMCP: () => ShuffleMCP,
389
+ ShuffleMCP: () => ShuffleMCP2,
390
390
  ShuffleMcpThemeProvider: () => ShuffleMcpThemeProvider,
391
- ShufflePipelinesBanner: () => ShufflePipelinesBanner_default,
392
- SingulActionsPreview: () => SingulActionsPreview_default,
391
+ ShufflePipelinesBanner: () => ShufflePipelinesBanner2,
392
+ SingulActionsPreview: () => SingulActionsPreview2,
393
393
  THREAT_INTEL_PATTERNS: () => THREAT_INTEL_PATTERNS,
394
- TryMcpSection: () => TryMcpSection,
394
+ TryMcpSection: () => TryMcpSection2,
395
395
  UsageBar: () => UsageBar,
396
396
  VULN_SCANNER_PATTERNS: () => VULN_SCANNER_PATTERNS,
397
- default: () => ShuffleMCP_default,
397
+ default: () => index_default,
398
398
  deleteDatastoreItem: () => deleteDatastoreItem,
399
399
  deleteDatastoreItems: () => deleteDatastoreItems,
400
400
  diagnoseOutputWarning: () => diagnoseOutputWarning,
@@ -449,12 +449,30 @@ __export(index_exports, {
449
449
  });
450
450
  module.exports = __toCommonJS(index_exports);
451
451
  var import_shuffle_mcp2 = require("./shuffle-mcp-CN72CJJQ.css");
452
+ var import_react20 = __toESM(require("react"));
452
453
 
453
454
  // ShuffleMcpThemeProvider.tsx
454
455
  var import_react = __toESM(require("react"));
455
456
  var import_material = require("@mui/material");
456
457
  var import_jsx_runtime = require("react/jsx-runtime");
457
- var componentOverrides = {
458
+ var readHtmlDarkClass = () => {
459
+ if (typeof document === "undefined") return false;
460
+ return document.documentElement.classList.contains("dark");
461
+ };
462
+ var useHtmlDarkClass = (enabled) => {
463
+ const [isDark, setIsDark] = import_react.default.useState(() => enabled ? readHtmlDarkClass() : false);
464
+ import_react.default.useEffect(() => {
465
+ if (!enabled || typeof document === "undefined") return;
466
+ setIsDark(readHtmlDarkClass());
467
+ const observer = new MutationObserver(() => setIsDark(readHtmlDarkClass()));
468
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
469
+ return () => observer.disconnect();
470
+ }, [enabled]);
471
+ return isDark;
472
+ };
473
+ var ShuffleMcpThemeContext = import_react.default.createContext(null);
474
+ var useShuffleMcpTheme = () => import_react.default.useContext(ShuffleMcpThemeContext);
475
+ var buildComponentOverrides = (scopeClassName) => ({
458
476
  MuiTextField: { defaultProps: { size: "small" } },
459
477
  MuiButton: { defaultProps: { size: "small" } },
460
478
  MuiFormControl: { defaultProps: { size: "small" } },
@@ -496,7 +514,15 @@ var componentOverrides = {
496
514
  }
497
515
  }
498
516
  },
517
+ // ---- Portaled surfaces: stamp scopeClassName so HSL tokens resolve ----
518
+ MuiDrawer: {
519
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } }
520
+ },
521
+ MuiDialog: {
522
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } }
523
+ },
499
524
  MuiMenu: {
525
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
500
526
  styleOverrides: {
501
527
  paper: {
502
528
  backgroundColor: "hsl(var(--popover))",
@@ -506,6 +532,7 @@ var componentOverrides = {
506
532
  }
507
533
  },
508
534
  MuiPopover: {
535
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
509
536
  styleOverrides: {
510
537
  paper: {
511
538
  backgroundColor: "hsl(var(--popover))",
@@ -514,32 +541,23 @@ var componentOverrides = {
514
541
  }
515
542
  }
516
543
  },
544
+ MuiTooltip: {
545
+ defaultProps: { slotProps: { tooltip: { className: scopeClassName } } }
546
+ },
517
547
  MuiDivider: {
518
548
  styleOverrides: { root: { borderColor: "hsl(var(--border))" } }
519
549
  }
520
- };
521
- var readHtmlDarkClass = () => {
522
- if (typeof document === "undefined") return false;
523
- return document.documentElement.classList.contains("dark");
524
- };
525
- var useHtmlDarkClass = (enabled) => {
526
- const [isDark, setIsDark] = import_react.default.useState(() => enabled ? readHtmlDarkClass() : false);
527
- import_react.default.useEffect(() => {
528
- if (!enabled || typeof document === "undefined") return;
529
- setIsDark(readHtmlDarkClass());
530
- const observer = new MutationObserver(() => setIsDark(readHtmlDarkClass()));
531
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
532
- return () => observer.disconnect();
533
- }, [enabled]);
534
- return isDark;
535
- };
550
+ });
536
551
  var ShuffleMcpThemeProvider = ({
537
552
  children,
538
553
  mode = "auto"
539
554
  }) => {
540
555
  const parent = (0, import_material.useTheme)();
556
+ const parentCtx = useShuffleMcpTheme();
541
557
  const htmlIsDark = useHtmlDarkClass(mode === "auto");
542
558
  const effectiveDark = mode === "auto" ? htmlIsDark : mode === "dark";
559
+ const sameAsParent = parentCtx !== null && parentCtx.isDark === effectiveDark;
560
+ const scopeClassName = effectiveDark ? "shuffle-mcp-scope dark" : "shuffle-mcp-scope";
543
561
  const merged = import_react.default.useMemo(
544
562
  () => (0, import_material.createTheme)({
545
563
  ...parent,
@@ -549,16 +567,19 @@ var ShuffleMcpThemeProvider = ({
549
567
  },
550
568
  components: {
551
569
  ...parent.components,
552
- ...componentOverrides
570
+ ...buildComponentOverrides(scopeClassName)
553
571
  }
554
572
  }),
555
- [parent, effectiveDark]
573
+ [parent, effectiveDark, scopeClassName]
574
+ );
575
+ const ctxValue = import_react.default.useMemo(
576
+ () => ({ mode, isDark: effectiveDark, scopeClassName }),
577
+ [mode, effectiveDark, scopeClassName]
556
578
  );
557
- const tree = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ThemeProvider, { theme: merged, children });
558
- if (mode === "light" || mode === "dark") {
559
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: mode === "dark" ? "dark" : "", "data-shuffle-mode": mode, children: tree });
579
+ if (sameAsParent) {
580
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShuffleMcpThemeContext.Provider, { value: ctxValue, children });
560
581
  }
561
- return tree;
582
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ThemeProvider, { theme: merged, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: scopeClassName, "data-shuffle-mode": mode, "data-shuffle-mcp-root": true, children }) }) });
562
583
  };
563
584
 
564
585
  // ShuffleMCP.tsx
@@ -5948,19 +5969,32 @@ init_appsCache();
5948
5969
  var React2 = __toESM(require("react"));
5949
5970
  var import_framer_motion7 = require("framer-motion");
5950
5971
  var import_jsx_runtime13 = require("react/jsx-runtime");
5951
- var cn = (...inputs) => inputs.filter(Boolean).join(" ");
5952
- var sizeClasses = {
5972
+ var SIZE = {
5953
5973
  sm: {
5954
- container: "p-0.5 text-[11px]",
5955
- item: "px-2.5 py-1 gap-1.5",
5956
- count: "min-w-[16px] h-[16px] px-1 text-[10px]",
5957
- divider: "h-4 mx-0.5"
5974
+ containerPadding: "2px",
5975
+ fontSize: "11px",
5976
+ itemPaddingY: "4px",
5977
+ itemPaddingX: "10px",
5978
+ itemGap: "6px",
5979
+ countMin: "16px",
5980
+ countH: "16px",
5981
+ countPx: "4px",
5982
+ countFs: "10px",
5983
+ dividerH: "16px",
5984
+ dividerMx: "2px"
5958
5985
  },
5959
5986
  md: {
5960
- container: "p-1 text-xs",
5961
- item: "px-3 py-1.5 gap-1.5",
5962
- count: "min-w-[18px] h-[18px] px-1.5 text-[10px]",
5963
- divider: "h-5 mx-1"
5987
+ containerPadding: "4px",
5988
+ fontSize: "12px",
5989
+ itemPaddingY: "6px",
5990
+ itemPaddingX: "12px",
5991
+ itemGap: "6px",
5992
+ countMin: "18px",
5993
+ countH: "18px",
5994
+ countPx: "6px",
5995
+ countFs: "10px",
5996
+ dividerH: "20px",
5997
+ dividerMx: "4px"
5964
5998
  }
5965
5999
  };
5966
6000
  var uid = 0;
@@ -5984,25 +6018,36 @@ function SegmentedControl({
5984
6018
  }) {
5985
6019
  const autoId = useUniqueId("segmented");
5986
6020
  const groupId = layoutId ?? autoId;
5987
- const s = sizeClasses[size];
6021
+ const s = SIZE[size];
5988
6022
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_framer_motion7.LayoutGroup, { id: groupId, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
5989
6023
  "div",
5990
6024
  {
5991
6025
  role: "tablist",
5992
6026
  "aria-label": ariaLabel,
5993
- className: cn(
5994
- "inline-flex items-center gap-0.5 rounded-full",
5995
- variant === "outline" ? "border border-border bg-transparent" : "border border-transparent bg-muted/40",
5996
- s.container,
5997
- className
5998
- ),
6027
+ className,
6028
+ style: {
6029
+ display: "inline-flex",
6030
+ alignItems: "center",
6031
+ gap: "2px",
6032
+ borderRadius: 9999,
6033
+ padding: s.containerPadding,
6034
+ fontSize: s.fontSize,
6035
+ border: variant === "outline" ? "1px solid hsl(var(--border))" : "1px solid transparent",
6036
+ background: variant === "outline" ? "transparent" : "hsl(var(--muted) / 0.4)"
6037
+ },
5999
6038
  children: options.map((opt, i) => {
6000
6039
  if (opt.type === "divider") {
6001
6040
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6002
6041
  "span",
6003
6042
  {
6004
6043
  "aria-hidden": true,
6005
- className: cn("w-px bg-border self-center", s.divider)
6044
+ style: {
6045
+ width: 1,
6046
+ height: s.dividerH,
6047
+ margin: `0 ${s.dividerMx}`,
6048
+ background: "hsl(var(--border))",
6049
+ alignSelf: "center"
6050
+ }
6006
6051
  },
6007
6052
  opt.key ?? `divider-${i}`
6008
6053
  );
@@ -6024,20 +6069,46 @@ function SegmentedControl({
6024
6069
  if (isAction) opt.onClick();
6025
6070
  else onChange(opt.value);
6026
6071
  },
6027
- className: cn(
6028
- "relative inline-flex items-center rounded-full font-medium",
6029
- "transition-colors duration-300",
6030
- "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
6031
- s.item,
6032
- active ? "text-foreground" : "text-muted-foreground hover:text-foreground",
6033
- opt.disabled && "opacity-50 cursor-not-allowed"
6034
- ),
6072
+ style: {
6073
+ position: "relative",
6074
+ display: "inline-flex",
6075
+ alignItems: "center",
6076
+ gap: s.itemGap,
6077
+ padding: `${s.itemPaddingY} ${s.itemPaddingX}`,
6078
+ borderRadius: 9999,
6079
+ fontWeight: 500,
6080
+ fontSize: s.fontSize,
6081
+ background: "transparent",
6082
+ border: "none",
6083
+ cursor: opt.disabled ? "not-allowed" : "pointer",
6084
+ color: active ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))",
6085
+ opacity: opt.disabled ? 0.5 : 1,
6086
+ transition: "color 200ms ease",
6087
+ outline: "none",
6088
+ fontFamily: "inherit"
6089
+ },
6090
+ onMouseEnter: (e) => {
6091
+ if (!active && !opt.disabled) {
6092
+ e.currentTarget.style.color = "hsl(var(--foreground))";
6093
+ }
6094
+ },
6095
+ onMouseLeave: (e) => {
6096
+ if (!active && !opt.disabled) {
6097
+ e.currentTarget.style.color = "hsl(var(--muted-foreground))";
6098
+ }
6099
+ },
6035
6100
  children: [
6036
6101
  active && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6037
6102
  import_framer_motion7.motion.span,
6038
6103
  {
6039
6104
  layoutId: `${groupId}-pill`,
6040
- className: "absolute inset-0 rounded-full bg-muted border border-border",
6105
+ style: {
6106
+ position: "absolute",
6107
+ inset: 0,
6108
+ borderRadius: 9999,
6109
+ background: "hsl(var(--muted))",
6110
+ border: "1px solid hsl(var(--border))"
6111
+ },
6041
6112
  initial: false,
6042
6113
  transition: {
6043
6114
  type: "spring",
@@ -6046,15 +6117,39 @@ function SegmentedControl({
6046
6117
  }
6047
6118
  }
6048
6119
  ),
6049
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "relative z-10 inline-flex items-center gap-1.5", children: opt.label }),
6120
+ /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6121
+ "span",
6122
+ {
6123
+ style: {
6124
+ position: "relative",
6125
+ zIndex: 1,
6126
+ display: "inline-flex",
6127
+ alignItems: "center",
6128
+ gap: s.itemGap
6129
+ },
6130
+ children: opt.label
6131
+ }
6132
+ ),
6050
6133
  !isAction && typeof opt.count === "number" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
6051
6134
  "span",
6052
6135
  {
6053
- className: cn(
6054
- "relative z-10 inline-flex items-center justify-center rounded-md font-semibold tabular-nums border border-border/60",
6055
- s.count,
6056
- active ? "bg-transparent text-foreground" : "bg-transparent text-muted-foreground"
6057
- ),
6136
+ style: {
6137
+ position: "relative",
6138
+ zIndex: 1,
6139
+ display: "inline-flex",
6140
+ alignItems: "center",
6141
+ justifyContent: "center",
6142
+ minWidth: s.countMin,
6143
+ height: s.countH,
6144
+ padding: `0 ${s.countPx}`,
6145
+ fontSize: s.countFs,
6146
+ fontWeight: 600,
6147
+ fontVariantNumeric: "tabular-nums",
6148
+ borderRadius: 6,
6149
+ border: "1px solid hsl(var(--border) / 0.6)",
6150
+ color: active ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))",
6151
+ background: "transparent"
6152
+ },
6058
6153
  children: opt.count
6059
6154
  }
6060
6155
  )
@@ -6615,7 +6710,6 @@ var ShuffleMCP = import_react12.default.forwardRef(({
6615
6710
  );
6616
6711
  });
6617
6712
  ShuffleMCP.displayName = "ShuffleMCP";
6618
- var ShuffleMCP_default = ShuffleMCP;
6619
6713
 
6620
6714
  // AppSearchDrawer.tsx
6621
6715
  var import_react13 = require("react");
@@ -6958,7 +7052,7 @@ function AppSearchDrawer({
6958
7052
  transition: { duration: 0.2 },
6959
7053
  style: { height: "100%", minHeight: 0 },
6960
7054
  children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
6961
- ShuffleMCP,
7055
+ ShuffleMCP2,
6962
7056
  {
6963
7057
  apiKey: API_CONFIG.apiKey || void 0,
6964
7058
  apiBaseUrl: API_CONFIG.baseUrl,
@@ -7007,7 +7101,7 @@ function AppSearchDrawer({
7007
7101
  }
7008
7102
  ),
7009
7103
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7010
- AppDetailDrawer,
7104
+ AppDetailDrawer2,
7011
7105
  {
7012
7106
  open: open && detailAppName !== null,
7013
7107
  onClose: () => {
@@ -9007,6 +9101,8 @@ var AgentUI = ({
9007
9101
  appPickerLabel = "Select Apps",
9008
9102
  appPickerTitle = "Select Apps",
9009
9103
  appPickerSubtitle = "Pick the tools the agent is allowed to use for this run",
9104
+ onChooseLLM,
9105
+ hideChooseLLM = false,
9010
9106
  submitTooltip = "\u2318+Enter to send",
9011
9107
  submitIcon,
9012
9108
  submitOverride,
@@ -10859,15 +10955,25 @@ var AgentUI = ({
10859
10955
  bgcolor: "hsl(var(--card))",
10860
10956
  maxWidth: "100%"
10861
10957
  }, children: [
10862
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Tooltip, { title: "Configure the local LLM used for this agent", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10958
+ !hideChooseLLM && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_material16.Tooltip, { title: "Configure the local LLM used for this agent", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
10863
10959
  import_material16.Box,
10864
10960
  {
10865
10961
  component: "button",
10866
10962
  type: "button",
10867
10963
  onClick: () => {
10868
- if (typeof window !== "undefined") {
10869
- window.dispatchEvent(
10870
- new CustomEvent("agent-drawer-open", { detail: { tab: "localLLM" } })
10964
+ if (onChooseLLM) {
10965
+ onChooseLLM();
10966
+ return;
10967
+ }
10968
+ if (typeof window === "undefined") return;
10969
+ const evt = new CustomEvent("agent-drawer-open", {
10970
+ detail: { tab: "localLLM" },
10971
+ cancelable: true
10972
+ });
10973
+ const handled = window.dispatchEvent(evt);
10974
+ if (handled && !window.__shuffleAgentDrawerMounted) {
10975
+ console.warn(
10976
+ '[AgentUI] "Choose LLM" was clicked but no host handler is wired. Pass an `onChooseLLM` prop, mount the bundled `AgentRunDrawer`, or set `hideChooseLLM` to remove the chip.'
10871
10977
  );
10872
10978
  }
10873
10979
  },
@@ -11630,6 +11736,13 @@ var AgentRunDrawer = ({
11630
11736
  if (open && !prevOpenRef.current) setActiveTab(initialTab);
11631
11737
  prevOpenRef.current = open;
11632
11738
  }, [open, initialTab]);
11739
+ (0, import_react16.useEffect)(() => {
11740
+ if (typeof window === "undefined") return;
11741
+ window.__shuffleAgentDrawerMounted = (window.__shuffleAgentDrawerMounted || 0) + 1;
11742
+ return () => {
11743
+ window.__shuffleAgentDrawerMounted = Math.max(0, (window.__shuffleAgentDrawerMounted || 1) - 1);
11744
+ };
11745
+ }, []);
11633
11746
  const visibleTabs = TAB_ORDER.filter((t) => {
11634
11747
  if (t === "run") return true;
11635
11748
  if (t === "permissions") return !!permissionsSlot;
@@ -12734,7 +12847,19 @@ var AgentExecutionDrawer_default = AgentExecutionDrawer;
12734
12847
  var import_react18 = require("react");
12735
12848
  var import_material20 = require("@mui/material");
12736
12849
  var import_jsx_runtime24 = require("react/jsx-runtime");
12737
- var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn, userdata, serverside }) => {
12850
+ var AgentsView = ({
12851
+ onSchedule,
12852
+ maxWidth = 820,
12853
+ onChooseLLM,
12854
+ hideChooseLLM,
12855
+ localLLMSlot,
12856
+ permissionsSlot,
12857
+ globalUrl,
12858
+ isLoaded,
12859
+ isLoggedIn,
12860
+ userdata,
12861
+ serverside
12862
+ }) => {
12738
12863
  useSyncHostBaseUrl(globalUrl);
12739
12864
  const [selectedRun, setSelectedRun] = (0, import_react18.useState)(null);
12740
12865
  const [agentView, setAgentView] = (0, import_react18.useState)("start");
@@ -12744,6 +12869,33 @@ var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn,
12744
12869
  key: 0
12745
12870
  });
12746
12871
  const [editing, setEditing] = (0, import_react18.useState)(null);
12872
+ const [builtInDrawer, setBuiltInDrawer] = (0, import_react18.useState)({
12873
+ open: false,
12874
+ tab: "localLLM"
12875
+ });
12876
+ const effectiveLocalLLMSlot = (0, import_react18.useMemo)(
12877
+ () => localLLMSlot ?? /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Box, { sx: { p: 3, color: "hsl(var(--muted-foreground))", fontSize: "0.85rem", lineHeight: 1.6 }, children: [
12878
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.Typography, { sx: { fontSize: "0.95rem", fontWeight: 600, color: "hsl(var(--foreground))", mb: 1 }, children: "Local LLM not configured" }),
12879
+ "This host hasn't wired a Local LLM picker yet. Pass an",
12880
+ " ",
12881
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { style: { fontFamily: "monospace" }, children: "onChooseLLM" }),
12882
+ " handler or a",
12883
+ " ",
12884
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { style: { fontFamily: "monospace" }, children: "localLLMSlot" }),
12885
+ " to",
12886
+ " ",
12887
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("code", { style: { fontFamily: "monospace" }, children: "<AgentsView />" }),
12888
+ " to render your own configuration UI here."
12889
+ ] }),
12890
+ [localLLMSlot]
12891
+ );
12892
+ const handleChooseLLM = (0, import_react18.useCallback)(() => {
12893
+ if (onChooseLLM) {
12894
+ onChooseLLM();
12895
+ return;
12896
+ }
12897
+ setBuiltInDrawer({ open: true, tab: "localLLM" });
12898
+ }, [onChooseLLM]);
12747
12899
  const handleEditWorkflow = (0, import_react18.useCallback)(
12748
12900
  ({ workflowId, name, prompt, apps }) => {
12749
12901
  setEditing({ workflowId, name });
@@ -12776,8 +12928,8 @@ var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn,
12776
12928
  },
12777
12929
  [editing]
12778
12930
  );
12779
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Box, { sx: { minHeight: "100vh", width: "100%", px: { xs: 2, md: 4 }, pt: "5vh", pb: 6 }, children: [
12780
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Stack, { spacing: 6, sx: { maxWidth, mx: "auto" }, children: [
12931
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Box, { sx: { minHeight: "100%", width: "100%", px: { xs: 2, md: 4 }, pt: { xs: 3, md: "5vh" }, pb: 6, boxSizing: "border-box" }, children: [
12932
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_material20.Stack, { spacing: 6, sx: { maxWidth, mx: "auto", width: "100%" }, children: [
12781
12933
  editing && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
12782
12934
  import_material20.Box,
12783
12935
  {
@@ -12824,6 +12976,8 @@ var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn,
12824
12976
  apiBaseUrl: globalUrl,
12825
12977
  onViewChange: setAgentView,
12826
12978
  onSchedule,
12979
+ onChooseLLM: handleChooseLLM,
12980
+ hideChooseLLM,
12827
12981
  defaultInput: prefill.input,
12828
12982
  defaultApps: prefill.apps.length > 0 ? prefill.apps : void 0,
12829
12983
  submitOverride: editing ? handleSaveEdit : void 0,
@@ -12834,7 +12988,7 @@ var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn,
12834
12988
  },
12835
12989
  prefill.key
12836
12990
  ),
12837
- agentView === "start" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.Box, { sx: { pt: "12vh" }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
12991
+ agentView === "start" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_material20.Box, { sx: { pt: { xs: 4, md: "8vh" } }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
12838
12992
  AgentActivityList_default,
12839
12993
  {
12840
12994
  apiBaseUrl: globalUrl,
@@ -12852,6 +13006,18 @@ var AgentsView = ({ onSchedule, maxWidth = 820, globalUrl, isLoaded, isLoggedIn,
12852
13006
  apiBaseUrl: globalUrl,
12853
13007
  onSchedule
12854
13008
  }
13009
+ ),
13010
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13011
+ AgentRunDrawer_default,
13012
+ {
13013
+ open: builtInDrawer.open,
13014
+ onClose: () => setBuiltInDrawer((s) => ({ ...s, open: false })),
13015
+ initialTab: builtInDrawer.tab,
13016
+ globalUrl,
13017
+ localLLMSlot: effectiveLocalLLMSlot,
13018
+ permissionsSlot,
13019
+ agentUIProps: { onSchedule, apiBaseUrl: globalUrl }
13020
+ }
12855
13021
  )
12856
13022
  ] });
12857
13023
  };
@@ -13082,6 +13248,49 @@ var UsageBar = ({
13082
13248
  ) })
13083
13249
  ] }) });
13084
13250
  };
13251
+
13252
+ // index.ts
13253
+ var resolveMode = (theme, colorMode) => {
13254
+ if (theme === "light" || theme === "dark") return theme;
13255
+ if (theme === "system") return "auto";
13256
+ return colorMode ?? "auto";
13257
+ };
13258
+ var withMcpTheme = (Inner, displayName) => {
13259
+ const Wrapped = ({ theme, colorMode, ...rest }) => import_react20.default.createElement(
13260
+ ShuffleMcpThemeProvider,
13261
+ { mode: resolveMode(theme, colorMode) },
13262
+ import_react20.default.createElement(Inner, { ...rest })
13263
+ );
13264
+ Wrapped.displayName = `ShuffleMCPs(${displayName})`;
13265
+ return Wrapped;
13266
+ };
13267
+ var withMcpThemeRef = (Inner, displayName) => {
13268
+ const Wrapped = import_react20.default.forwardRef(
13269
+ ({ theme, colorMode, ...rest }, ref) => import_react20.default.createElement(
13270
+ ShuffleMcpThemeProvider,
13271
+ { mode: resolveMode(theme, colorMode) },
13272
+ import_react20.default.createElement(Inner, { ...rest, ref })
13273
+ )
13274
+ );
13275
+ Wrapped.displayName = `ShuffleMCPs(${displayName})`;
13276
+ return Wrapped;
13277
+ };
13278
+ var ShuffleMCP2 = withMcpThemeRef(ShuffleMCP, "ShuffleMCP");
13279
+ var index_default = ShuffleMCP2;
13280
+ var AppDetailDrawer2 = withMcpTheme(AppDetailDrawer, "AppDetailDrawer");
13281
+ var AppSearchDrawer2 = withMcpTheme(AppSearchDrawer, "AppSearchDrawer");
13282
+ var AiAgentPromptsEditor2 = withMcpTheme(AiAgentPromptsEditor_default, "AiAgentPromptsEditor");
13283
+ var ShufflePipelinesBanner2 = withMcpTheme(ShufflePipelinesBanner_default, "ShufflePipelinesBanner");
13284
+ var AppTitleHeader2 = withMcpTheme(AppTitleHeader, "AppTitleHeader");
13285
+ var AppAuthSection2 = withMcpTheme(AppAuthSection, "AppAuthSection");
13286
+ var TryMcpSection2 = withMcpTheme(TryMcpSection, "TryMcpSection");
13287
+ var SingulActionsPreview2 = withMcpTheme(SingulActionsPreview_default, "SingulActionsPreview");
13288
+ var AgentUI2 = withMcpTheme(AgentUI_default, "AgentUI");
13289
+ var AgentRunDrawer2 = withMcpTheme(AgentRunDrawer_default, "AgentRunDrawer");
13290
+ var AgentActivityList2 = withMcpTheme(AgentActivityList_default, "AgentActivityList");
13291
+ var AgentExecutionDrawer2 = withMcpTheme(AgentExecutionDrawer_default, "AgentExecutionDrawer");
13292
+ var AgentsView2 = withMcpTheme(AgentsView_default, "AgentsView");
13293
+ var AgentRunDiagnosisBanner2 = withMcpTheme(AgentRunDiagnosisBanner_default, "AgentRunDiagnosisBanner");
13085
13294
  // Annotate the CommonJS export names for ESM import in node:
13086
13295
  0 && (module.exports = {
13087
13296
  API_CONFIG,