@shuffleio/shuffle-mcps 0.0.25 → 0.0.27

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-B4JFC2JU.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 = {
@@ -228,6 +244,13 @@ var API_CONFIG = {
228
244
  var getApiUrl = (endpoint) => {
229
245
  return `${API_CONFIG.baseUrl}${endpoint}`;
230
246
  };
247
+ var getShuffleCoreFormUrl = (refUrl) => {
248
+ if (!refUrl) return refUrl;
249
+ if (/^https?:\/\//i.test(refUrl)) return refUrl;
250
+ const path = refUrl.startsWith("/") ? refUrl : `/${refUrl}`;
251
+ if (isCloud()) return `https://shuffler.io${path}`;
252
+ return `${API_CONFIG.baseUrl}${path}`;
253
+ };
231
254
  var shuffleFetch = (url, init) => {
232
255
  const { headers: extraHeaders, ...rest } = init || {};
233
256
  return fetch(url, {
@@ -317,6 +340,7 @@ export {
317
340
  getTrackedOrgId,
318
341
  API_CONFIG,
319
342
  getApiUrl,
343
+ getShuffleCoreFormUrl,
320
344
  shuffleFetch,
321
345
  getAuthHeader,
322
346
  fetchApps,
package/dist/index.d.mts CHANGED
@@ -475,6 +475,8 @@ interface AgentUIProps {
475
475
  executionId?: string;
476
476
  error?: string;
477
477
  }) => void;
478
+ /** Called whenever the chip set under the prompt changes (add/remove apps). */
479
+ onAppsChange?: (apps: AgentUIApp[]) => void;
478
480
  /** Called whenever the active top-level view changes (start / simple / detailed). */
479
481
  onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
480
482
  /**
@@ -584,14 +586,6 @@ declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string
584
586
  * Called when org changes. Resets region URL to default until next getinfo.
585
587
  */
586
588
  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
589
  declare const setHostBaseUrl: (url: string | undefined | null) => void;
596
590
  /** Get the currently active host override, if any. */
597
591
  declare const getHostBaseUrl: () => string | null;
@@ -816,6 +810,10 @@ interface AgentsViewProps extends ShuffleHostProps {
816
810
  localLLMSlot?: React.ReactNode;
817
811
  /** Content for the built-in AgentRunDrawer's Permissions tab. Optional. */
818
812
  permissionsSlot?: React.ReactNode;
813
+ /** Pre-fill the starter chip row on mount (e.g. from persisted host state). */
814
+ initialApps?: AgentUIApp[];
815
+ /** Called whenever the chip row under the prompt changes. */
816
+ onAppsChange?: (apps: AgentUIApp[]) => void;
819
817
  }
820
818
 
821
819
  interface AgentLocalModel {
package/dist/index.d.ts CHANGED
@@ -475,6 +475,8 @@ interface AgentUIProps {
475
475
  executionId?: string;
476
476
  error?: string;
477
477
  }) => void;
478
+ /** Called whenever the chip set under the prompt changes (add/remove apps). */
479
+ onAppsChange?: (apps: AgentUIApp[]) => void;
478
480
  /** Called whenever the active top-level view changes (start / simple / detailed). */
479
481
  onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
480
482
  /**
@@ -584,14 +586,6 @@ declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string
584
586
  * Called when org changes. Resets region URL to default until next getinfo.
585
587
  */
586
588
  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
589
  declare const setHostBaseUrl: (url: string | undefined | null) => void;
596
590
  /** Get the currently active host override, if any. */
597
591
  declare const getHostBaseUrl: () => string | null;
@@ -816,6 +810,10 @@ interface AgentsViewProps extends ShuffleHostProps {
816
810
  localLLMSlot?: React.ReactNode;
817
811
  /** Content for the built-in AgentRunDrawer's Permissions tab. Optional. */
818
812
  permissionsSlot?: React.ReactNode;
813
+ /** Pre-fill the starter chip row on mount (e.g. from persisted host state). */
814
+ initialApps?: AgentUIApp[];
815
+ /** Called whenever the chip row under the prompt changes. */
816
+ onAppsChange?: (apps: AgentUIApp[]) => void;
819
817
  }
820
818
 
821
819
  interface AgentLocalModel {