@shuffleio/shuffle-mcps 0.0.18 → 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.d.mts CHANGED
@@ -5,21 +5,16 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  /**
6
6
  * ShuffleMcpThemeProvider
7
7
  *
8
- * Mirror of Shuffle-Core's theme provider, scoped for the Shuffle-MCPs lib.
9
- * Two jobs:
10
- *
11
- * 1. Pin MUI defaults (`size="small"`) so individual call sites never need to
12
- * thread sizing through.
13
- *
14
- * 2. Bridge the host app's light/dark scheme into MUI:
15
- * - `mode="auto"` (default) — track the `.dark` class on `<html>` and flip
16
- * MUI `palette.mode` accordingly. Tokens (`hsl(var(--…))`) flip with the
17
- * same class so nothing else needs to know about the theme.
18
- * - `mode="light" | "dark"` — pin the wrapped subtree to that scheme. We
19
- * render a `<div className="dark">` (or remove it) so Tailwind dark
20
- * variants and CSS-variable overrides scope to this subtree only —
21
- * useful when embedding MCPs inside a host that doesn't manage `.dark`
22
- * on `<html>`.
8
+ * - Pins MUI defaults (`size="small"`) so call sites never thread sizing.
9
+ * - Bridges the host app's light/dark scheme into MUI (`palette.mode`) and
10
+ * into our HSL token system (the scoped `.dark` class).
11
+ * - Exposes a React Context (`ShuffleMcpThemeContext`) so internal raw
12
+ * components — and views that compose other library components without
13
+ * going through the public wrapped exports — see the resolved mode.
14
+ * - Stamps the scope className onto MUI portaled paper (Drawer, Dialog,
15
+ * Menu, Popover, Tooltip), so portals rendered into <body> still resolve
16
+ * our `hsl(var(--…))` tokens against the pinned theme instead of the
17
+ * host's `<html>`.
23
18
  *
24
19
  * Wrap your MCP usage at any level:
25
20
  *
@@ -33,9 +28,9 @@ interface ShuffleMcpThemeProviderProps {
33
28
  children?: React$1.ReactNode;
34
29
  /**
35
30
  * Color mode for the wrapped subtree.
36
- * - `"dark"` (default) — render exactly like Shuffle Security standalone.
37
- * - `"auto"` — follow the host page's `.dark` class on `<html>`.
38
- * - `"light"` / `"dark"` — pin the subtree to that scheme via a wrapping div.
31
+ * - `"auto"` (default) — follow the host page's `.dark` class on `<html>`.
32
+ * - `"light"` / `"dark"` — pin the subtree (and any portals rendered from
33
+ * within it) to that scheme.
39
34
  */
40
35
  mode?: ShuffleMcpColorMode;
41
36
  }
@@ -765,14 +760,23 @@ interface AgentsViewProps extends ShuffleHostProps {
765
760
  maxWidth?: number;
766
761
  /**
767
762
  * Optional handler for the "Choose LLM" chip. Forwarded to the embedded
768
- * AgentUI. When omitted, AgentUI dispatches its legacy window event
769
- * (handled by the bundled AgentRunDrawer in Shuffle Security). On other
770
- * hosts, pass this prop to wire your own LLM picker — or set
763
+ * AgentUI. When omitted, AgentsView mounts its own internal
764
+ * `AgentRunDrawer` and opens it on the Local LLM tab — so the chip
765
+ * always does *something*, even on hosts that haven't wired a picker.
766
+ * Pass this prop to override with your own LLM picker, or set
771
767
  * `hideChooseLLM` to remove the chip entirely.
772
768
  */
773
769
  onChooseLLM?: () => void;
774
770
  /** Hide the "Choose LLM" chip in the embedded AgentUI. */
775
771
  hideChooseLLM?: boolean;
772
+ /**
773
+ * Content rendered inside the built-in AgentRunDrawer's Local LLM tab
774
+ * when no `onChooseLLM` is provided. Use to plug in your own local LLM
775
+ * config form. When omitted, a minimal built-in placeholder is shown.
776
+ */
777
+ localLLMSlot?: React.ReactNode;
778
+ /** Content for the built-in AgentRunDrawer's Permissions tab. Optional. */
779
+ permissionsSlot?: React.ReactNode;
776
780
  }
777
781
 
778
782
  /**
@@ -1329,6 +1333,15 @@ declare const UsageBar: React$1.FC<UsageBarProps>;
1329
1333
  * No host-app `@/` imports remain inside this folder (assets aside).
1330
1334
  */
1331
1335
 
1336
+ /**
1337
+ * Every exported component accepts an optional `theme` prop:
1338
+ * - `"light"` / `"dark"` — pin the subtree to that scheme
1339
+ * - `"system"` (default) — follow the host page's `.dark` class on `<html>`
1340
+ *
1341
+ * `colorMode` is preserved as a legacy alias (`"auto"` == `"system"`).
1342
+ */
1343
+ type ShuffleTheme = 'light' | 'dark' | 'system';
1344
+
1332
1345
  declare const ShuffleMCP: React$1.ForwardRefExoticComponent<any>;
1333
1346
 
1334
1347
  declare const AppDetailDrawer: React$1.ComponentType<any>;
@@ -1355,4 +1368,4 @@ declare const AgentsView: React$1.ComponentType<any>;
1355
1368
 
1356
1369
  declare const AgentRunDiagnosisBanner: React$1.ComponentType<any>;
1357
1370
 
1358
- export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, type DatastoreDiagnostics, type DatastoreItem, type DatastoreResponse, type DiagnosableRun, type DiagnosisEvidence, EDR_PATTERNS, EMAIL_APP_PATTERNS, FORWARD_TICKETS_WORKFLOW_NAME, type FetchAppsOptions, INGEST_TICKETS_WORKFLOW_NAME, type IngestionCategory, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractValidatedIngestionApps, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAppAuth, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
1371
+ export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, type DatastoreDiagnostics, type DatastoreItem, type DatastoreResponse, type DiagnosableRun, type DiagnosisEvidence, EDR_PATTERNS, EMAIL_APP_PATTERNS, FORWARD_TICKETS_WORKFLOW_NAME, type FetchAppsOptions, INGEST_TICKETS_WORKFLOW_NAME, type IngestionCategory, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractValidatedIngestionApps, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAppAuth, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
package/dist/index.d.ts CHANGED
@@ -5,21 +5,16 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  /**
6
6
  * ShuffleMcpThemeProvider
7
7
  *
8
- * Mirror of Shuffle-Core's theme provider, scoped for the Shuffle-MCPs lib.
9
- * Two jobs:
10
- *
11
- * 1. Pin MUI defaults (`size="small"`) so individual call sites never need to
12
- * thread sizing through.
13
- *
14
- * 2. Bridge the host app's light/dark scheme into MUI:
15
- * - `mode="auto"` (default) — track the `.dark` class on `<html>` and flip
16
- * MUI `palette.mode` accordingly. Tokens (`hsl(var(--…))`) flip with the
17
- * same class so nothing else needs to know about the theme.
18
- * - `mode="light" | "dark"` — pin the wrapped subtree to that scheme. We
19
- * render a `<div className="dark">` (or remove it) so Tailwind dark
20
- * variants and CSS-variable overrides scope to this subtree only —
21
- * useful when embedding MCPs inside a host that doesn't manage `.dark`
22
- * on `<html>`.
8
+ * - Pins MUI defaults (`size="small"`) so call sites never thread sizing.
9
+ * - Bridges the host app's light/dark scheme into MUI (`palette.mode`) and
10
+ * into our HSL token system (the scoped `.dark` class).
11
+ * - Exposes a React Context (`ShuffleMcpThemeContext`) so internal raw
12
+ * components — and views that compose other library components without
13
+ * going through the public wrapped exports — see the resolved mode.
14
+ * - Stamps the scope className onto MUI portaled paper (Drawer, Dialog,
15
+ * Menu, Popover, Tooltip), so portals rendered into <body> still resolve
16
+ * our `hsl(var(--…))` tokens against the pinned theme instead of the
17
+ * host's `<html>`.
23
18
  *
24
19
  * Wrap your MCP usage at any level:
25
20
  *
@@ -33,9 +28,9 @@ interface ShuffleMcpThemeProviderProps {
33
28
  children?: React$1.ReactNode;
34
29
  /**
35
30
  * Color mode for the wrapped subtree.
36
- * - `"dark"` (default) — render exactly like Shuffle Security standalone.
37
- * - `"auto"` — follow the host page's `.dark` class on `<html>`.
38
- * - `"light"` / `"dark"` — pin the subtree to that scheme via a wrapping div.
31
+ * - `"auto"` (default) — follow the host page's `.dark` class on `<html>`.
32
+ * - `"light"` / `"dark"` — pin the subtree (and any portals rendered from
33
+ * within it) to that scheme.
39
34
  */
40
35
  mode?: ShuffleMcpColorMode;
41
36
  }
@@ -765,14 +760,23 @@ interface AgentsViewProps extends ShuffleHostProps {
765
760
  maxWidth?: number;
766
761
  /**
767
762
  * Optional handler for the "Choose LLM" chip. Forwarded to the embedded
768
- * AgentUI. When omitted, AgentUI dispatches its legacy window event
769
- * (handled by the bundled AgentRunDrawer in Shuffle Security). On other
770
- * hosts, pass this prop to wire your own LLM picker — or set
763
+ * AgentUI. When omitted, AgentsView mounts its own internal
764
+ * `AgentRunDrawer` and opens it on the Local LLM tab — so the chip
765
+ * always does *something*, even on hosts that haven't wired a picker.
766
+ * Pass this prop to override with your own LLM picker, or set
771
767
  * `hideChooseLLM` to remove the chip entirely.
772
768
  */
773
769
  onChooseLLM?: () => void;
774
770
  /** Hide the "Choose LLM" chip in the embedded AgentUI. */
775
771
  hideChooseLLM?: boolean;
772
+ /**
773
+ * Content rendered inside the built-in AgentRunDrawer's Local LLM tab
774
+ * when no `onChooseLLM` is provided. Use to plug in your own local LLM
775
+ * config form. When omitted, a minimal built-in placeholder is shown.
776
+ */
777
+ localLLMSlot?: React.ReactNode;
778
+ /** Content for the built-in AgentRunDrawer's Permissions tab. Optional. */
779
+ permissionsSlot?: React.ReactNode;
776
780
  }
777
781
 
778
782
  /**
@@ -1329,6 +1333,15 @@ declare const UsageBar: React$1.FC<UsageBarProps>;
1329
1333
  * No host-app `@/` imports remain inside this folder (assets aside).
1330
1334
  */
1331
1335
 
1336
+ /**
1337
+ * Every exported component accepts an optional `theme` prop:
1338
+ * - `"light"` / `"dark"` — pin the subtree to that scheme
1339
+ * - `"system"` (default) — follow the host page's `.dark` class on `<html>`
1340
+ *
1341
+ * `colorMode` is preserved as a legacy alias (`"auto"` == `"system"`).
1342
+ */
1343
+ type ShuffleTheme = 'light' | 'dark' | 'system';
1344
+
1332
1345
  declare const ShuffleMCP: React$1.ForwardRefExoticComponent<any>;
1333
1346
 
1334
1347
  declare const AppDetailDrawer: React$1.ComponentType<any>;
@@ -1355,4 +1368,4 @@ declare const AgentsView: React$1.ComponentType<any>;
1355
1368
 
1356
1369
  declare const AgentRunDiagnosisBanner: React$1.ComponentType<any>;
1357
1370
 
1358
- export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, type DatastoreDiagnostics, type DatastoreItem, type DatastoreResponse, type DiagnosableRun, type DiagnosisEvidence, EDR_PATTERNS, EMAIL_APP_PATTERNS, FORWARD_TICKETS_WORKFLOW_NAME, type FetchAppsOptions, INGEST_TICKETS_WORKFLOW_NAME, type IngestionCategory, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractValidatedIngestionApps, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAppAuth, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
1371
+ export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, type DatastoreDiagnostics, type DatastoreItem, type DatastoreResponse, type DiagnosableRun, type DiagnosisEvidence, EDR_PATTERNS, EMAIL_APP_PATTERNS, FORWARD_TICKETS_WORKFLOW_NAME, type FetchAppsOptions, INGEST_TICKETS_WORKFLOW_NAME, type IngestionCategory, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractValidatedIngestionApps, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAppAuth, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
package/dist/index.js CHANGED
@@ -455,7 +455,24 @@ var import_react20 = __toESM(require("react"));
455
455
  var import_react = __toESM(require("react"));
456
456
  var import_material = require("@mui/material");
457
457
  var import_jsx_runtime = require("react/jsx-runtime");
458
- 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) => ({
459
476
  MuiTextField: { defaultProps: { size: "small" } },
460
477
  MuiButton: { defaultProps: { size: "small" } },
461
478
  MuiFormControl: { defaultProps: { size: "small" } },
@@ -497,7 +514,15 @@ var componentOverrides = {
497
514
  }
498
515
  }
499
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
+ },
500
524
  MuiMenu: {
525
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
501
526
  styleOverrides: {
502
527
  paper: {
503
528
  backgroundColor: "hsl(var(--popover))",
@@ -507,6 +532,7 @@ var componentOverrides = {
507
532
  }
508
533
  },
509
534
  MuiPopover: {
535
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
510
536
  styleOverrides: {
511
537
  paper: {
512
538
  backgroundColor: "hsl(var(--popover))",
@@ -515,32 +541,23 @@ var componentOverrides = {
515
541
  }
516
542
  }
517
543
  },
544
+ MuiTooltip: {
545
+ defaultProps: { slotProps: { tooltip: { className: scopeClassName } } }
546
+ },
518
547
  MuiDivider: {
519
548
  styleOverrides: { root: { borderColor: "hsl(var(--border))" } }
520
549
  }
521
- };
522
- var readHtmlDarkClass = () => {
523
- if (typeof document === "undefined") return false;
524
- return document.documentElement.classList.contains("dark");
525
- };
526
- var useHtmlDarkClass = (enabled) => {
527
- const [isDark, setIsDark] = import_react.default.useState(() => enabled ? readHtmlDarkClass() : false);
528
- import_react.default.useEffect(() => {
529
- if (!enabled || typeof document === "undefined") return;
530
- setIsDark(readHtmlDarkClass());
531
- const observer = new MutationObserver(() => setIsDark(readHtmlDarkClass()));
532
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
533
- return () => observer.disconnect();
534
- }, [enabled]);
535
- return isDark;
536
- };
550
+ });
537
551
  var ShuffleMcpThemeProvider = ({
538
552
  children,
539
- mode = "dark"
553
+ mode = "auto"
540
554
  }) => {
541
555
  const parent = (0, import_material.useTheme)();
556
+ const parentCtx = useShuffleMcpTheme();
542
557
  const htmlIsDark = useHtmlDarkClass(mode === "auto");
543
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";
544
561
  const merged = import_react.default.useMemo(
545
562
  () => (0, import_material.createTheme)({
546
563
  ...parent,
@@ -550,17 +567,19 @@ var ShuffleMcpThemeProvider = ({
550
567
  },
551
568
  components: {
552
569
  ...parent.components,
553
- ...componentOverrides
570
+ ...buildComponentOverrides(scopeClassName)
554
571
  }
555
572
  }),
556
- [parent, effectiveDark]
573
+ [parent, effectiveDark, scopeClassName]
574
+ );
575
+ const ctxValue = import_react.default.useMemo(
576
+ () => ({ mode, isDark: effectiveDark, scopeClassName }),
577
+ [mode, effectiveDark, scopeClassName]
557
578
  );
558
- const tree = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ThemeProvider, { theme: merged, children });
559
- const scopeClassName = mode === "light" ? "shuffle-mcp-scope" : "shuffle-mcp-scope dark";
560
- if (mode === "light" || mode === "dark") {
561
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: scopeClassName, "data-shuffle-mode": mode, "data-shuffle-mcp-root": true, children: tree });
579
+ if (sameAsParent) {
580
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShuffleMcpThemeContext.Provider, { value: ctxValue, children });
562
581
  }
563
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "shuffle-mcp-scope", "data-shuffle-mode": "auto", "data-shuffle-mcp-root": true, children: 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 }) }) });
564
583
  };
565
584
 
566
585
  // ShuffleMCP.tsx
@@ -12828,7 +12847,19 @@ var AgentExecutionDrawer_default = AgentExecutionDrawer;
12828
12847
  var import_react18 = require("react");
12829
12848
  var import_material20 = require("@mui/material");
12830
12849
  var import_jsx_runtime24 = require("react/jsx-runtime");
12831
- var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, 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
+ }) => {
12832
12863
  useSyncHostBaseUrl(globalUrl);
12833
12864
  const [selectedRun, setSelectedRun] = (0, import_react18.useState)(null);
12834
12865
  const [agentView, setAgentView] = (0, import_react18.useState)("start");
@@ -12838,6 +12869,33 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12838
12869
  key: 0
12839
12870
  });
12840
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]);
12841
12899
  const handleEditWorkflow = (0, import_react18.useCallback)(
12842
12900
  ({ workflowId, name, prompt, apps }) => {
12843
12901
  setEditing({ workflowId, name });
@@ -12918,7 +12976,7 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12918
12976
  apiBaseUrl: globalUrl,
12919
12977
  onViewChange: setAgentView,
12920
12978
  onSchedule,
12921
- onChooseLLM,
12979
+ onChooseLLM: handleChooseLLM,
12922
12980
  hideChooseLLM,
12923
12981
  defaultInput: prefill.input,
12924
12982
  defaultApps: prefill.apps.length > 0 ? prefill.apps : void 0,
@@ -12948,6 +13006,18 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12948
13006
  apiBaseUrl: globalUrl,
12949
13007
  onSchedule
12950
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
+ }
12951
13021
  )
12952
13022
  ] });
12953
13023
  };
@@ -13180,10 +13250,15 @@ var UsageBar = ({
13180
13250
  };
13181
13251
 
13182
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
+ };
13183
13258
  var withMcpTheme = (Inner, displayName) => {
13184
- const Wrapped = ({ colorMode, ...rest }) => import_react20.default.createElement(
13259
+ const Wrapped = ({ theme, colorMode, ...rest }) => import_react20.default.createElement(
13185
13260
  ShuffleMcpThemeProvider,
13186
- { mode: colorMode },
13261
+ { mode: resolveMode(theme, colorMode) },
13187
13262
  import_react20.default.createElement(Inner, { ...rest })
13188
13263
  );
13189
13264
  Wrapped.displayName = `ShuffleMCPs(${displayName})`;
@@ -13191,9 +13266,9 @@ var withMcpTheme = (Inner, displayName) => {
13191
13266
  };
13192
13267
  var withMcpThemeRef = (Inner, displayName) => {
13193
13268
  const Wrapped = import_react20.default.forwardRef(
13194
- ({ colorMode, ...rest }, ref) => import_react20.default.createElement(
13269
+ ({ theme, colorMode, ...rest }, ref) => import_react20.default.createElement(
13195
13270
  ShuffleMcpThemeProvider,
13196
- { mode: colorMode },
13271
+ { mode: resolveMode(theme, colorMode) },
13197
13272
  import_react20.default.createElement(Inner, { ...rest, ref })
13198
13273
  )
13199
13274
  );
package/dist/index.mjs CHANGED
@@ -26,7 +26,24 @@ import React5 from "react";
26
26
  import React from "react";
27
27
  import { ThemeProvider, createTheme, useTheme as useMuiTheme } from "@mui/material";
28
28
  import { jsx } from "react/jsx-runtime";
29
- var componentOverrides = {
29
+ var readHtmlDarkClass = () => {
30
+ if (typeof document === "undefined") return false;
31
+ return document.documentElement.classList.contains("dark");
32
+ };
33
+ var useHtmlDarkClass = (enabled) => {
34
+ const [isDark, setIsDark] = React.useState(() => enabled ? readHtmlDarkClass() : false);
35
+ React.useEffect(() => {
36
+ if (!enabled || typeof document === "undefined") return;
37
+ setIsDark(readHtmlDarkClass());
38
+ const observer = new MutationObserver(() => setIsDark(readHtmlDarkClass()));
39
+ observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
40
+ return () => observer.disconnect();
41
+ }, [enabled]);
42
+ return isDark;
43
+ };
44
+ var ShuffleMcpThemeContext = React.createContext(null);
45
+ var useShuffleMcpTheme = () => React.useContext(ShuffleMcpThemeContext);
46
+ var buildComponentOverrides = (scopeClassName) => ({
30
47
  MuiTextField: { defaultProps: { size: "small" } },
31
48
  MuiButton: { defaultProps: { size: "small" } },
32
49
  MuiFormControl: { defaultProps: { size: "small" } },
@@ -68,7 +85,15 @@ var componentOverrides = {
68
85
  }
69
86
  }
70
87
  },
88
+ // ---- Portaled surfaces: stamp scopeClassName so HSL tokens resolve ----
89
+ MuiDrawer: {
90
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } }
91
+ },
92
+ MuiDialog: {
93
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } }
94
+ },
71
95
  MuiMenu: {
96
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
72
97
  styleOverrides: {
73
98
  paper: {
74
99
  backgroundColor: "hsl(var(--popover))",
@@ -78,6 +103,7 @@ var componentOverrides = {
78
103
  }
79
104
  },
80
105
  MuiPopover: {
106
+ defaultProps: { slotProps: { paper: { className: scopeClassName } } },
81
107
  styleOverrides: {
82
108
  paper: {
83
109
  backgroundColor: "hsl(var(--popover))",
@@ -86,32 +112,23 @@ var componentOverrides = {
86
112
  }
87
113
  }
88
114
  },
115
+ MuiTooltip: {
116
+ defaultProps: { slotProps: { tooltip: { className: scopeClassName } } }
117
+ },
89
118
  MuiDivider: {
90
119
  styleOverrides: { root: { borderColor: "hsl(var(--border))" } }
91
120
  }
92
- };
93
- var readHtmlDarkClass = () => {
94
- if (typeof document === "undefined") return false;
95
- return document.documentElement.classList.contains("dark");
96
- };
97
- var useHtmlDarkClass = (enabled) => {
98
- const [isDark, setIsDark] = React.useState(() => enabled ? readHtmlDarkClass() : false);
99
- React.useEffect(() => {
100
- if (!enabled || typeof document === "undefined") return;
101
- setIsDark(readHtmlDarkClass());
102
- const observer = new MutationObserver(() => setIsDark(readHtmlDarkClass()));
103
- observer.observe(document.documentElement, { attributes: true, attributeFilter: ["class"] });
104
- return () => observer.disconnect();
105
- }, [enabled]);
106
- return isDark;
107
- };
121
+ });
108
122
  var ShuffleMcpThemeProvider = ({
109
123
  children,
110
- mode = "dark"
124
+ mode = "auto"
111
125
  }) => {
112
126
  const parent = useMuiTheme();
127
+ const parentCtx = useShuffleMcpTheme();
113
128
  const htmlIsDark = useHtmlDarkClass(mode === "auto");
114
129
  const effectiveDark = mode === "auto" ? htmlIsDark : mode === "dark";
130
+ const sameAsParent = parentCtx !== null && parentCtx.isDark === effectiveDark;
131
+ const scopeClassName = effectiveDark ? "shuffle-mcp-scope dark" : "shuffle-mcp-scope";
115
132
  const merged = React.useMemo(
116
133
  () => createTheme({
117
134
  ...parent,
@@ -121,17 +138,19 @@ var ShuffleMcpThemeProvider = ({
121
138
  },
122
139
  components: {
123
140
  ...parent.components,
124
- ...componentOverrides
141
+ ...buildComponentOverrides(scopeClassName)
125
142
  }
126
143
  }),
127
- [parent, effectiveDark]
144
+ [parent, effectiveDark, scopeClassName]
145
+ );
146
+ const ctxValue = React.useMemo(
147
+ () => ({ mode, isDark: effectiveDark, scopeClassName }),
148
+ [mode, effectiveDark, scopeClassName]
128
149
  );
129
- const tree = /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children });
130
- const scopeClassName = mode === "light" ? "shuffle-mcp-scope" : "shuffle-mcp-scope dark";
131
- if (mode === "light" || mode === "dark") {
132
- return /* @__PURE__ */ jsx("div", { className: scopeClassName, "data-shuffle-mode": mode, "data-shuffle-mcp-root": true, children: tree });
150
+ if (sameAsParent) {
151
+ return /* @__PURE__ */ jsx(ShuffleMcpThemeContext.Provider, { value: ctxValue, children });
133
152
  }
134
- return /* @__PURE__ */ jsx("div", { className: "shuffle-mcp-scope", "data-shuffle-mode": "auto", "data-shuffle-mcp-root": true, children: tree });
153
+ return /* @__PURE__ */ jsx(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children: /* @__PURE__ */ jsx("div", { className: scopeClassName, "data-shuffle-mode": mode, "data-shuffle-mcp-root": true, children }) }) });
135
154
  };
136
155
 
137
156
  // ShuffleMCP.tsx
@@ -12539,10 +12558,22 @@ var AgentExecutionDrawer = ({
12539
12558
  var AgentExecutionDrawer_default = AgentExecutionDrawer;
12540
12559
 
12541
12560
  // AgentsView.tsx
12542
- import { useCallback as useCallback10, useState as useState15 } from "react";
12561
+ import { useCallback as useCallback10, useMemo as useMemo7, useState as useState15 } from "react";
12543
12562
  import { Box as Box18, Stack, Typography as Typography17 } from "@mui/material";
12544
12563
  import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
12545
- var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, globalUrl, isLoaded, isLoggedIn, userdata, serverside }) => {
12564
+ var AgentsView = ({
12565
+ onSchedule,
12566
+ maxWidth = 820,
12567
+ onChooseLLM,
12568
+ hideChooseLLM,
12569
+ localLLMSlot,
12570
+ permissionsSlot,
12571
+ globalUrl,
12572
+ isLoaded,
12573
+ isLoggedIn,
12574
+ userdata,
12575
+ serverside
12576
+ }) => {
12546
12577
  useSyncHostBaseUrl(globalUrl);
12547
12578
  const [selectedRun, setSelectedRun] = useState15(null);
12548
12579
  const [agentView, setAgentView] = useState15("start");
@@ -12552,6 +12583,33 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12552
12583
  key: 0
12553
12584
  });
12554
12585
  const [editing, setEditing] = useState15(null);
12586
+ const [builtInDrawer, setBuiltInDrawer] = useState15({
12587
+ open: false,
12588
+ tab: "localLLM"
12589
+ });
12590
+ const effectiveLocalLLMSlot = useMemo7(
12591
+ () => localLLMSlot ?? /* @__PURE__ */ jsxs20(Box18, { sx: { p: 3, color: "hsl(var(--muted-foreground))", fontSize: "0.85rem", lineHeight: 1.6 }, children: [
12592
+ /* @__PURE__ */ jsx24(Typography17, { sx: { fontSize: "0.95rem", fontWeight: 600, color: "hsl(var(--foreground))", mb: 1 }, children: "Local LLM not configured" }),
12593
+ "This host hasn't wired a Local LLM picker yet. Pass an",
12594
+ " ",
12595
+ /* @__PURE__ */ jsx24("code", { style: { fontFamily: "monospace" }, children: "onChooseLLM" }),
12596
+ " handler or a",
12597
+ " ",
12598
+ /* @__PURE__ */ jsx24("code", { style: { fontFamily: "monospace" }, children: "localLLMSlot" }),
12599
+ " to",
12600
+ " ",
12601
+ /* @__PURE__ */ jsx24("code", { style: { fontFamily: "monospace" }, children: "<AgentsView />" }),
12602
+ " to render your own configuration UI here."
12603
+ ] }),
12604
+ [localLLMSlot]
12605
+ );
12606
+ const handleChooseLLM = useCallback10(() => {
12607
+ if (onChooseLLM) {
12608
+ onChooseLLM();
12609
+ return;
12610
+ }
12611
+ setBuiltInDrawer({ open: true, tab: "localLLM" });
12612
+ }, [onChooseLLM]);
12555
12613
  const handleEditWorkflow = useCallback10(
12556
12614
  ({ workflowId, name, prompt, apps }) => {
12557
12615
  setEditing({ workflowId, name });
@@ -12632,7 +12690,7 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12632
12690
  apiBaseUrl: globalUrl,
12633
12691
  onViewChange: setAgentView,
12634
12692
  onSchedule,
12635
- onChooseLLM,
12693
+ onChooseLLM: handleChooseLLM,
12636
12694
  hideChooseLLM,
12637
12695
  defaultInput: prefill.input,
12638
12696
  defaultApps: prefill.apps.length > 0 ? prefill.apps : void 0,
@@ -12662,13 +12720,25 @@ var AgentsView = ({ onSchedule, maxWidth = 820, onChooseLLM, hideChooseLLM, glob
12662
12720
  apiBaseUrl: globalUrl,
12663
12721
  onSchedule
12664
12722
  }
12723
+ ),
12724
+ /* @__PURE__ */ jsx24(
12725
+ AgentRunDrawer_default,
12726
+ {
12727
+ open: builtInDrawer.open,
12728
+ onClose: () => setBuiltInDrawer((s) => ({ ...s, open: false })),
12729
+ initialTab: builtInDrawer.tab,
12730
+ globalUrl,
12731
+ localLLMSlot: effectiveLocalLLMSlot,
12732
+ permissionsSlot,
12733
+ agentUIProps: { onSchedule, apiBaseUrl: globalUrl }
12734
+ }
12665
12735
  )
12666
12736
  ] });
12667
12737
  };
12668
12738
  var AgentsView_default = AgentsView;
12669
12739
 
12670
12740
  // useAppLookup.ts
12671
- import { useEffect as useEffect14, useMemo as useMemo7, useState as useState16 } from "react";
12741
+ import { useEffect as useEffect14, useMemo as useMemo8, useState as useState16 } from "react";
12672
12742
  var norm3 = (s) => s.toLowerCase().replace(/[\s_\-]+/g, "_");
12673
12743
  function useAppLookup(appName) {
12674
12744
  const [loading, setLoading] = useState16(false);
@@ -12761,13 +12831,13 @@ function useAppLookup(appName) {
12761
12831
  setLoading(false);
12762
12832
  })();
12763
12833
  }, [appName]);
12764
- const matchingEntries = useMemo7(() => {
12834
+ const matchingEntries = useMemo8(() => {
12765
12835
  if (!appName) return [];
12766
12836
  return authenticatedApps.filter(
12767
12837
  (auth) => auth.app?.name && norm3(auth.app.name) === norm3(appName)
12768
12838
  );
12769
12839
  }, [appName, authenticatedApps]);
12770
- const image = useMemo7(() => {
12840
+ const image = useMemo8(() => {
12771
12841
  if (info?.image) return info.image;
12772
12842
  for (const entry of matchingEntries) {
12773
12843
  const img = entry.app?.large_image || entry.large_image;
@@ -12775,7 +12845,7 @@ function useAppLookup(appName) {
12775
12845
  }
12776
12846
  return "";
12777
12847
  }, [info, matchingEntries]);
12778
- const algoliaApp = useMemo7(() => {
12848
+ const algoliaApp = useMemo8(() => {
12779
12849
  if (!appName) return null;
12780
12850
  return {
12781
12851
  objectID: algoliaId || appName,
@@ -12887,10 +12957,15 @@ var UsageBar = ({
12887
12957
  };
12888
12958
 
12889
12959
  // index.ts
12960
+ var resolveMode = (theme, colorMode) => {
12961
+ if (theme === "light" || theme === "dark") return theme;
12962
+ if (theme === "system") return "auto";
12963
+ return colorMode ?? "auto";
12964
+ };
12890
12965
  var withMcpTheme = (Inner, displayName) => {
12891
- const Wrapped = ({ colorMode, ...rest }) => React5.createElement(
12966
+ const Wrapped = ({ theme, colorMode, ...rest }) => React5.createElement(
12892
12967
  ShuffleMcpThemeProvider,
12893
- { mode: colorMode },
12968
+ { mode: resolveMode(theme, colorMode) },
12894
12969
  React5.createElement(Inner, { ...rest })
12895
12970
  );
12896
12971
  Wrapped.displayName = `ShuffleMCPs(${displayName})`;
@@ -12898,9 +12973,9 @@ var withMcpTheme = (Inner, displayName) => {
12898
12973
  };
12899
12974
  var withMcpThemeRef = (Inner, displayName) => {
12900
12975
  const Wrapped = React5.forwardRef(
12901
- ({ colorMode, ...rest }, ref) => React5.createElement(
12976
+ ({ theme, colorMode, ...rest }, ref) => React5.createElement(
12902
12977
  ShuffleMcpThemeProvider,
12903
- { mode: colorMode },
12978
+ { mode: resolveMode(theme, colorMode) },
12904
12979
  React5.createElement(Inner, { ...rest, ref })
12905
12980
  )
12906
12981
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuffleio/shuffle-mcps",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Turn 3,000+ SaaS tools into MCP servers your agents can use. Headless React component for search, selection, and OAuth handoff.",
5
5
  "license": "MIT",
6
6
  "repository": {