@shuffleio/shuffle-mcps 0.0.24 → 0.0.26

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.
@@ -2,7 +2,7 @@ import {
2
2
  fetchApps,
3
3
  fetchAppsViaApiConfig,
4
4
  invalidateAppsCache
5
- } from "./chunk-R3YLER6P.mjs";
5
+ } from "./chunk-R5NT3IQ7.mjs";
6
6
  export {
7
7
  fetchApps,
8
8
  fetchAppsViaApiConfig,
@@ -187,6 +187,7 @@ var resetRegionUrl = () => {
187
187
  }
188
188
  _regionUrl = null;
189
189
  };
190
+ var SHUFFLE_HOST_BASE_URL_EVENT = "shuffle:set-host-base-url";
190
191
  var setHostBaseUrl = (url) => {
191
192
  const next = url ? url.replace(/\/+$/, "") : null;
192
193
  if (next === _hostBaseUrl) return;
@@ -197,7 +198,22 @@ var setHostBaseUrl = (url) => {
197
198
  } catch {
198
199
  }
199
200
  }
201
+ if (typeof window !== "undefined") {
202
+ try {
203
+ window.dispatchEvent(new CustomEvent(SHUFFLE_HOST_BASE_URL_EVENT, { detail: next }));
204
+ } catch {
205
+ }
206
+ }
200
207
  };
208
+ if (typeof window !== "undefined") {
209
+ try {
210
+ window.addEventListener(SHUFFLE_HOST_BASE_URL_EVENT, (e) => {
211
+ const detail = e.detail;
212
+ setHostBaseUrl(detail ?? null);
213
+ });
214
+ } catch {
215
+ }
216
+ }
201
217
  var getHostBaseUrl = () => _hostBaseUrl;
202
218
  var getTrackedOrgId = () => _trackedOrgId;
203
219
  var API_CONFIG = {
package/dist/index.d.mts CHANGED
@@ -584,14 +584,6 @@ declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string
584
584
  * Called when org changes. Resets region URL to default until next getinfo.
585
585
  */
586
586
  declare const resetRegionUrl: () => void;
587
- /**
588
- * Host override — call from a top-level component (or `useSyncHostBaseUrl`)
589
- * with the `globalUrl` injected via `ShuffleHostProps`. When set, this beats
590
- * region URL and the env-based default for ALL fetches that go through
591
- * `getApiUrl()` / `API_CONFIG.baseUrl` / `shuffleFetch`.
592
- *
593
- * Pass `null` / `undefined` / empty string to clear the override.
594
- */
595
587
  declare const setHostBaseUrl: (url: string | undefined | null) => void;
596
588
  /** Get the currently active host override, if any. */
597
589
  declare const getHostBaseUrl: () => string | null;
package/dist/index.d.ts CHANGED
@@ -584,14 +584,6 @@ declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string
584
584
  * Called when org changes. Resets region URL to default until next getinfo.
585
585
  */
586
586
  declare const resetRegionUrl: () => void;
587
- /**
588
- * Host override — call from a top-level component (or `useSyncHostBaseUrl`)
589
- * with the `globalUrl` injected via `ShuffleHostProps`. When set, this beats
590
- * region URL and the env-based default for ALL fetches that go through
591
- * `getApiUrl()` / `API_CONFIG.baseUrl` / `shuffleFetch`.
592
- *
593
- * Pass `null` / `undefined` / empty string to clear the override.
594
- */
595
587
  declare const setHostBaseUrl: (url: string | undefined | null) => void;
596
588
  /** Get the currently active host override, if any. */
597
589
  declare const getHostBaseUrl: () => string | null;
package/dist/index.js CHANGED
@@ -155,7 +155,7 @@ var init_fetchBreaker = __esm({
155
155
  });
156
156
 
157
157
  // api.ts
158
- var DEV_BACKEND, PROD_BACKEND, CLOUD_DOMAINS, getEnvVar, isDevEnvironment, isCloudDomain, isCloud, isOnprem, getDefaultBaseUrl, _regionUrl, _trackedOrgId, _hostBaseUrl, isShufflerSubdomain, setRegionUrl, resetRegionUrl, setHostBaseUrl, getHostBaseUrl, getTrackedOrgId, API_CONFIG, getApiUrl, shuffleFetch, getAuthHeader;
158
+ var DEV_BACKEND, PROD_BACKEND, CLOUD_DOMAINS, getEnvVar, isDevEnvironment, isCloudDomain, isCloud, isOnprem, getDefaultBaseUrl, _regionUrl, _trackedOrgId, _hostBaseUrl, isShufflerSubdomain, setRegionUrl, resetRegionUrl, SHUFFLE_HOST_BASE_URL_EVENT, setHostBaseUrl, getHostBaseUrl, getTrackedOrgId, API_CONFIG, getApiUrl, shuffleFetch, getAuthHeader;
159
159
  var init_api = __esm({
160
160
  "api.ts"() {
161
161
  init_fetchBreaker();
@@ -227,6 +227,7 @@ var init_api = __esm({
227
227
  }
228
228
  _regionUrl = null;
229
229
  };
230
+ SHUFFLE_HOST_BASE_URL_EVENT = "shuffle:set-host-base-url";
230
231
  setHostBaseUrl = (url) => {
231
232
  const next = url ? url.replace(/\/+$/, "") : null;
232
233
  if (next === _hostBaseUrl) return;
@@ -237,7 +238,22 @@ var init_api = __esm({
237
238
  } catch {
238
239
  }
239
240
  }
241
+ if (typeof window !== "undefined") {
242
+ try {
243
+ window.dispatchEvent(new CustomEvent(SHUFFLE_HOST_BASE_URL_EVENT, { detail: next }));
244
+ } catch {
245
+ }
246
+ }
240
247
  };
248
+ if (typeof window !== "undefined") {
249
+ try {
250
+ window.addEventListener(SHUFFLE_HOST_BASE_URL_EVENT, (e) => {
251
+ const detail = e.detail;
252
+ setHostBaseUrl(detail ?? null);
253
+ });
254
+ } catch {
255
+ }
256
+ }
241
257
  getHostBaseUrl = () => _hostBaseUrl;
242
258
  getTrackedOrgId = () => _trackedOrgId;
243
259
  API_CONFIG = {
@@ -450,12 +466,13 @@ __export(index_exports, {
450
466
  useSyncHostBaseUrl: () => useSyncHostBaseUrl
451
467
  });
452
468
  module.exports = __toCommonJS(index_exports);
453
- var import_shuffle_mcp2 = require("./shuffle-mcp-ER33P3W2.css");
469
+ var import_shuffle_mcp3 = require("./shuffle-mcp-ER33P3W2.css");
454
470
  var import_react22 = __toESM(require("react"));
455
471
 
456
472
  // ShuffleMcpThemeProvider.tsx
457
473
  var import_react = __toESM(require("react"));
458
474
  var import_material = require("@mui/material");
475
+ var import_shuffle_mcp = require("./shuffle-mcp-ER33P3W2.css");
459
476
  var import_jsx_runtime = require("react/jsx-runtime");
460
477
  var readHtmlDarkClass = () => {
461
478
  if (typeof document === "undefined") return false;
@@ -6095,7 +6112,7 @@ function AppDetailDrawer({
6095
6112
  }
6096
6113
 
6097
6114
  // views/ShuffleMCP.tsx
6098
- var import_shuffle_mcp = require("./shuffle-mcp-ER33P3W2.css");
6115
+ var import_shuffle_mcp2 = require("./shuffle-mcp-ER33P3W2.css");
6099
6116
  init_appsCache();
6100
6117
 
6101
6118
  // components/SegmentedControl.tsx
@@ -6950,6 +6967,17 @@ function AppSearchDrawer({
6950
6967
  const [detailAppName, setDetailAppName] = (0, import_react13.useState)(null);
6951
6968
  const [detailAppId, setDetailAppId] = (0, import_react13.useState)(null);
6952
6969
  const [highlightActive, setHighlightActive] = (0, import_react13.useState)(false);
6970
+ const [bodyReady, setBodyReady] = (0, import_react13.useState)(false);
6971
+ (0, import_react13.useEffect)(() => {
6972
+ if (!open) {
6973
+ setBodyReady(false);
6974
+ return;
6975
+ }
6976
+ const raf = requestAnimationFrame(() => {
6977
+ requestAnimationFrame(() => setBodyReady(true));
6978
+ });
6979
+ return () => cancelAnimationFrame(raf);
6980
+ }, [open]);
6953
6981
  (0, import_react13.useEffect)(() => {
6954
6982
  setHighlightActive(false);
6955
6983
  if (!open || !highlightAppName) return;
@@ -7147,15 +7175,15 @@ function AppSearchDrawer({
7147
7175
  },
7148
7176
  "& .singul-results-grid": {
7149
7177
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
7150
- gridAutoRows: "88px",
7178
+ gridAutoRows: "78px",
7151
7179
  gap: "12px"
7152
7180
  },
7153
7181
  "& .singul-results-grid .singul-dropdown-item": {
7154
7182
  minWidth: 0,
7155
- minHeight: 88,
7156
- maxHeight: 88,
7157
- height: 88,
7158
- padding: "12px 14px",
7183
+ minHeight: 78,
7184
+ maxHeight: 78,
7185
+ height: 78,
7186
+ padding: "10px 14px",
7159
7187
  alignItems: "center",
7160
7188
  overflow: "hidden"
7161
7189
  },
@@ -7192,7 +7220,7 @@ function AppSearchDrawer({
7192
7220
  exit: { opacity: 0, x: -20 },
7193
7221
  transition: { duration: 0.2 },
7194
7222
  style: { height: "100%", minHeight: 0 },
7195
- children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7223
+ children: bodyReady ? /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
7196
7224
  ShuffleMCP2,
7197
7225
  {
7198
7226
  apiKey: API_CONFIG.apiKey || void 0,
@@ -7243,7 +7271,32 @@ function AppSearchDrawer({
7243
7271
  })),
7244
7272
  customStyles: singulStyles
7245
7273
  }
7246
- )
7274
+ ) : /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_material11.Box, { sx: { display: "flex", flexDirection: "column", gap: 1.5, height: "100%" }, children: [
7275
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material11.Box, { sx: {
7276
+ height: 44,
7277
+ borderRadius: "12px",
7278
+ border: "1px solid hsl(var(--border))",
7279
+ backgroundColor: "hsl(var(--background-elevated))"
7280
+ } }),
7281
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material11.Box, { sx: {
7282
+ display: "grid",
7283
+ gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
7284
+ gap: "12px",
7285
+ mt: 1
7286
+ }, children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material11.Box, { sx: {
7287
+ height: 78,
7288
+ borderRadius: "12px",
7289
+ backgroundColor: "hsl(var(--input))",
7290
+ border: "1px solid hsl(var(--border))",
7291
+ opacity: 0.6,
7292
+ animation: "shufflePulse 1.4s ease-in-out infinite",
7293
+ animationDelay: `${i * 60}ms`,
7294
+ "@keyframes shufflePulse": {
7295
+ "0%, 100%": { opacity: 0.35 },
7296
+ "50%": { opacity: 0.7 }
7297
+ }
7298
+ } }, i)) })
7299
+ ] })
7247
7300
  },
7248
7301
  "search"
7249
7302
  ) })
@@ -12117,11 +12170,13 @@ var LocalLLMConfig = ({ compact, globalUrl, userdata, isLoaded, isLoggedIn, serv
12117
12170
  cancelled = true;
12118
12171
  };
12119
12172
  }, [orgId]);
12120
- const appRunLimit = orgData?.app_execution_limit ?? userdata?.app_execution_limit ?? 0;
12121
- const appRunUsage = (orgData?.app_execution_usage ?? userdata?.app_execution_usage ?? 0) + (orgData?.app_executions_suborgs ?? userdata?.app_executions_suborgs ?? 0);
12122
- const agentTokens = orgData?.sync_features?.agent_tokens ?? userdata?.sync_features?.agent_tokens;
12123
- const agentTokenLimit = Number(agentTokens?.limit) || 0;
12124
- const agentTokenUsage = Number(agentTokens?.usage) || 0;
12173
+ const sync = orgData?.sync_features ?? userdata?.sync_features ?? {};
12174
+ const appExec = sync.app_executions ?? {};
12175
+ const appRunLimit = Number(appExec.limit) || 0;
12176
+ const appRunUsage = Number(appExec.usage) || 0;
12177
+ const agentTokens = sync.agent_tokens ?? {};
12178
+ const agentTokenLimit = Number(agentTokens.limit) || 0;
12179
+ const agentTokenUsage = Number(agentTokens.usage) || 0;
12125
12180
  return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { sx: { display: "flex", flexDirection: "column", gap: 2.5 }, children: [
12126
12181
  /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_material18.Box, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
12127
12182
  /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_material18.Typography, { sx: { fontSize: "0.85rem", fontWeight: 600, color: "hsl(var(--foreground))" }, children: "AI Provider" }),
@@ -12273,7 +12328,6 @@ var AgentRunDrawer = ({
12273
12328
  const effectiveLocalLLMSlot = localLLMSlot ?? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
12274
12329
  LocalLLMConfig_default,
12275
12330
  {
12276
- compact: true,
12277
12331
  globalUrl,
12278
12332
  userdata,
12279
12333
  isLoaded,
@@ -13571,7 +13625,6 @@ var AgentsView = ({
13571
13625
  () => localLLMSlot ?? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13572
13626
  LocalLLMConfig_default,
13573
13627
  {
13574
- compact: true,
13575
13628
  globalUrl,
13576
13629
  userdata,
13577
13630
  isLoaded,
@@ -13588,6 +13641,12 @@ var AgentsView = ({
13588
13641
  onChooseLLM();
13589
13642
  return;
13590
13643
  }
13644
+ if (typeof window !== "undefined" && window.__shuffleAgentDrawerMounted > 0) {
13645
+ window.dispatchEvent(
13646
+ new CustomEvent("agent-drawer-open", { detail: { tab: "localLLM" } })
13647
+ );
13648
+ return;
13649
+ }
13591
13650
  setBuiltInDrawer({ open: true, tab: "localLLM" });
13592
13651
  }, [onChooseLLM]);
13593
13652
  const handleEditWorkflow = (0, import_react20.useCallback)(
package/dist/index.mjs CHANGED
@@ -16,7 +16,7 @@ import {
16
16
  setHostBaseUrl,
17
17
  setRegionUrl,
18
18
  shuffleFetch
19
- } from "./chunk-R3YLER6P.mjs";
19
+ } from "./chunk-R5NT3IQ7.mjs";
20
20
 
21
21
  // index.ts
22
22
  import "./shuffle-mcp-ER33P3W2.css";
@@ -25,6 +25,7 @@ import React5 from "react";
25
25
  // ShuffleMcpThemeProvider.tsx
26
26
  import React from "react";
27
27
  import { ThemeProvider, createTheme, useTheme as useMuiTheme } from "@mui/material";
28
+ import "./shuffle-mcp-ER33P3W2.css";
28
29
  import { jsx, jsxs } from "react/jsx-runtime";
29
30
  var readHtmlDarkClass = () => {
30
31
  if (typeof document === "undefined") return false;
@@ -777,7 +778,7 @@ async function backfillAppImages(dedupedApps) {
777
778
  let missing = dedupedApps.filter((d) => !d.bestImage && !d.app.large_image);
778
779
  if (missing.length === 0) return dedupedApps;
779
780
  try {
780
- const { fetchAppsViaApiConfig: fetchAppsViaApiConfig2 } = await import("./appsCache-CFCVTF7D.mjs");
781
+ const { fetchAppsViaApiConfig: fetchAppsViaApiConfig2 } = await import("./appsCache-VFYHI4NL.mjs");
781
782
  const apps = await fetchAppsViaApiConfig2().catch(() => []);
782
783
  if (Array.isArray(apps) && apps.length > 0) {
783
784
  const byName = /* @__PURE__ */ new Map();
@@ -6586,6 +6587,17 @@ function AppSearchDrawer({
6586
6587
  const [detailAppName, setDetailAppName] = useState10(null);
6587
6588
  const [detailAppId, setDetailAppId] = useState10(null);
6588
6589
  const [highlightActive, setHighlightActive] = useState10(false);
6590
+ const [bodyReady, setBodyReady] = useState10(false);
6591
+ useEffect9(() => {
6592
+ if (!open) {
6593
+ setBodyReady(false);
6594
+ return;
6595
+ }
6596
+ const raf = requestAnimationFrame(() => {
6597
+ requestAnimationFrame(() => setBodyReady(true));
6598
+ });
6599
+ return () => cancelAnimationFrame(raf);
6600
+ }, [open]);
6589
6601
  useEffect9(() => {
6590
6602
  setHighlightActive(false);
6591
6603
  if (!open || !highlightAppName) return;
@@ -6783,15 +6795,15 @@ function AppSearchDrawer({
6783
6795
  },
6784
6796
  "& .singul-results-grid": {
6785
6797
  gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
6786
- gridAutoRows: "88px",
6798
+ gridAutoRows: "78px",
6787
6799
  gap: "12px"
6788
6800
  },
6789
6801
  "& .singul-results-grid .singul-dropdown-item": {
6790
6802
  minWidth: 0,
6791
- minHeight: 88,
6792
- maxHeight: 88,
6793
- height: 88,
6794
- padding: "12px 14px",
6803
+ minHeight: 78,
6804
+ maxHeight: 78,
6805
+ height: 78,
6806
+ padding: "10px 14px",
6795
6807
  alignItems: "center",
6796
6808
  overflow: "hidden"
6797
6809
  },
@@ -6828,7 +6840,7 @@ function AppSearchDrawer({
6828
6840
  exit: { opacity: 0, x: -20 },
6829
6841
  transition: { duration: 0.2 },
6830
6842
  style: { height: "100%", minHeight: 0 },
6831
- children: /* @__PURE__ */ jsx15(
6843
+ children: bodyReady ? /* @__PURE__ */ jsx15(
6832
6844
  ShuffleMCP2,
6833
6845
  {
6834
6846
  apiKey: API_CONFIG.apiKey || void 0,
@@ -6879,7 +6891,32 @@ function AppSearchDrawer({
6879
6891
  })),
6880
6892
  customStyles: singulStyles
6881
6893
  }
6882
- )
6894
+ ) : /* @__PURE__ */ jsxs12(Box9, { sx: { display: "flex", flexDirection: "column", gap: 1.5, height: "100%" }, children: [
6895
+ /* @__PURE__ */ jsx15(Box9, { sx: {
6896
+ height: 44,
6897
+ borderRadius: "12px",
6898
+ border: "1px solid hsl(var(--border))",
6899
+ backgroundColor: "hsl(var(--background-elevated))"
6900
+ } }),
6901
+ /* @__PURE__ */ jsx15(Box9, { sx: {
6902
+ display: "grid",
6903
+ gridTemplateColumns: "repeat(2, minmax(0, 1fr))",
6904
+ gap: "12px",
6905
+ mt: 1
6906
+ }, children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ jsx15(Box9, { sx: {
6907
+ height: 78,
6908
+ borderRadius: "12px",
6909
+ backgroundColor: "hsl(var(--input))",
6910
+ border: "1px solid hsl(var(--border))",
6911
+ opacity: 0.6,
6912
+ animation: "shufflePulse 1.4s ease-in-out infinite",
6913
+ animationDelay: `${i * 60}ms`,
6914
+ "@keyframes shufflePulse": {
6915
+ "0%, 100%": { opacity: 0.35 },
6916
+ "50%": { opacity: 0.7 }
6917
+ }
6918
+ } }, i)) })
6919
+ ] })
6883
6920
  },
6884
6921
  "search"
6885
6922
  ) })
@@ -11808,11 +11845,13 @@ var LocalLLMConfig = ({ compact, globalUrl, userdata, isLoaded, isLoggedIn, serv
11808
11845
  cancelled = true;
11809
11846
  };
11810
11847
  }, [orgId]);
11811
- const appRunLimit = orgData?.app_execution_limit ?? userdata?.app_execution_limit ?? 0;
11812
- const appRunUsage = (orgData?.app_execution_usage ?? userdata?.app_execution_usage ?? 0) + (orgData?.app_executions_suborgs ?? userdata?.app_executions_suborgs ?? 0);
11813
- const agentTokens = orgData?.sync_features?.agent_tokens ?? userdata?.sync_features?.agent_tokens;
11814
- const agentTokenLimit = Number(agentTokens?.limit) || 0;
11815
- const agentTokenUsage = Number(agentTokens?.usage) || 0;
11848
+ const sync = orgData?.sync_features ?? userdata?.sync_features ?? {};
11849
+ const appExec = sync.app_executions ?? {};
11850
+ const appRunLimit = Number(appExec.limit) || 0;
11851
+ const appRunUsage = Number(appExec.usage) || 0;
11852
+ const agentTokens = sync.agent_tokens ?? {};
11853
+ const agentTokenLimit = Number(agentTokens.limit) || 0;
11854
+ const agentTokenUsage = Number(agentTokens.usage) || 0;
11816
11855
  return /* @__PURE__ */ jsxs19(Box16, { sx: { display: "flex", flexDirection: "column", gap: 2.5 }, children: [
11817
11856
  /* @__PURE__ */ jsxs19(Box16, { sx: { display: "flex", flexDirection: "column", gap: 1 }, children: [
11818
11857
  /* @__PURE__ */ jsx22(Typography15, { sx: { fontSize: "0.85rem", fontWeight: 600, color: "hsl(var(--foreground))" }, children: "AI Provider" }),
@@ -11964,7 +12003,6 @@ var AgentRunDrawer = ({
11964
12003
  const effectiveLocalLLMSlot = localLLMSlot ?? /* @__PURE__ */ jsx23(
11965
12004
  LocalLLMConfig_default,
11966
12005
  {
11967
- compact: true,
11968
12006
  globalUrl,
11969
12007
  userdata,
11970
12008
  isLoaded,
@@ -13291,7 +13329,6 @@ var AgentsView = ({
13291
13329
  () => localLLMSlot ?? /* @__PURE__ */ jsx26(
13292
13330
  LocalLLMConfig_default,
13293
13331
  {
13294
- compact: true,
13295
13332
  globalUrl,
13296
13333
  userdata,
13297
13334
  isLoaded,
@@ -13308,6 +13345,12 @@ var AgentsView = ({
13308
13345
  onChooseLLM();
13309
13346
  return;
13310
13347
  }
13348
+ if (typeof window !== "undefined" && window.__shuffleAgentDrawerMounted > 0) {
13349
+ window.dispatchEvent(
13350
+ new CustomEvent("agent-drawer-open", { detail: { tab: "localLLM" } })
13351
+ );
13352
+ return;
13353
+ }
13311
13354
  setBuiltInDrawer({ open: true, tab: "localLLM" });
13312
13355
  }, [onChooseLLM]);
13313
13356
  const handleEditWorkflow = useCallback10(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shuffleio/shuffle-mcps",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
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": {