@shuffleio/shuffle-mcps 0.0.3 → 0.0.5
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/README.md +170 -17
- package/dist/index.cjs +5332 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +341 -5
- package/dist/index.d.ts +341 -5
- package/dist/index.js +5364 -169
- package/dist/index.js.map +1 -1
- package/dist/{singul-GZKBHJNI.css → shuffle-mcp-JQWKQNUP.css} +357 -21
- package/package.json +18 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React$1 from 'react';
|
|
1
|
+
import React$1, { ReactNode } from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Local Singul Library - Helpers
|
|
@@ -83,7 +84,26 @@ interface AppAuthentication {
|
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
86
|
interface ShuffleMCPProps {
|
|
86
|
-
|
|
87
|
+
/**
|
|
88
|
+
* Shuffle API key. Used as the `Authorization: Bearer` header on every
|
|
89
|
+
* request the component makes (`/api/v1/apps/authentication`,
|
|
90
|
+
* `/api/v1/apps`) AND forwarded into the OAuth handoff URL as `&auth=`.
|
|
91
|
+
* This is the canonical credential — pass it once.
|
|
92
|
+
*/
|
|
93
|
+
apiKey?: string;
|
|
94
|
+
/**
|
|
95
|
+
* @deprecated Use `apiKey` instead. Kept for backwards compatibility — if
|
|
96
|
+
* `apiKey` is set, it is used for the redirect handoff too. If you only
|
|
97
|
+
* provide `authToken` it is still forwarded into the auth URL but no API
|
|
98
|
+
* calls will be made.
|
|
99
|
+
*/
|
|
100
|
+
authToken?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Optional Shuffle organization ID. When provided, every API call this
|
|
103
|
+
* component makes (Shuffle backend + Singul gateway) will include an
|
|
104
|
+
* `Org-Id: <orgId>` header so the request is scoped to that org.
|
|
105
|
+
*/
|
|
106
|
+
orgId?: string;
|
|
87
107
|
placeholder?: string;
|
|
88
108
|
layout?: 'list' | 'grid';
|
|
89
109
|
gridColumns?: number | {
|
|
@@ -107,8 +127,6 @@ interface ShuffleMCPProps {
|
|
|
107
127
|
initialFilterQuery?: string;
|
|
108
128
|
/** Number of results per search (default: 15) */
|
|
109
129
|
hitsPerPage?: number;
|
|
110
|
-
/** API key for fetching authenticated apps from the auth endpoint */
|
|
111
|
-
apiKey?: string;
|
|
112
130
|
/** Base URL for backend API calls (default: https://shuffler.io) */
|
|
113
131
|
apiBaseUrl?: string;
|
|
114
132
|
/** Path appended to apiBaseUrl to fetch authenticated apps (default: /api/v1/apps/authentication) */
|
|
@@ -160,4 +178,322 @@ interface ShuffleMCPHandle {
|
|
|
160
178
|
}
|
|
161
179
|
declare const ShuffleMCP: React$1.ForwardRefExoticComponent<ShuffleMCPProps & React$1.RefAttributes<ShuffleMCPHandle>>;
|
|
162
180
|
|
|
163
|
-
|
|
181
|
+
/**
|
|
182
|
+
* AppDetailDrawer — Shows app detail content (header, auth, MCP chat, API viewer)
|
|
183
|
+
* inside a drawer. Used from alluvial diagrams and the app search drawer.
|
|
184
|
+
*
|
|
185
|
+
* Accepts either an app name (fetches data) or pre-loaded app info.
|
|
186
|
+
*/
|
|
187
|
+
/**
|
|
188
|
+
* Singul standard actions catalog, keyed by lowercase category fragment.
|
|
189
|
+
* Mirrors the canonical action names exposed by https://singul.io —
|
|
190
|
+
* each name becomes the `{action}` segment in `POST /api/{action}`.
|
|
191
|
+
* Fields shown here are starter parameters; the full schema lives on
|
|
192
|
+
* the Singul side and is editable in the curl preview below.
|
|
193
|
+
*/
|
|
194
|
+
interface AppDetailDrawerProps {
|
|
195
|
+
open: boolean;
|
|
196
|
+
onClose: () => void;
|
|
197
|
+
/** App name to load */
|
|
198
|
+
appName: string | null;
|
|
199
|
+
/** Anchor side */
|
|
200
|
+
anchor?: 'left' | 'right';
|
|
201
|
+
/** Width in px */
|
|
202
|
+
width?: number;
|
|
203
|
+
/** Called when drawer closes so parent can refresh data */
|
|
204
|
+
onRefresh?: () => void;
|
|
205
|
+
/** When set, replaces the Activate button with "+ Add" and calls this on click */
|
|
206
|
+
onAddToCanvas?: (appInfo: {
|
|
207
|
+
name: string;
|
|
208
|
+
icon: string;
|
|
209
|
+
algoliaId: string | null;
|
|
210
|
+
}) => void;
|
|
211
|
+
/** Whether the current user is authenticated. Defaults to true. */
|
|
212
|
+
isAuthenticated?: boolean;
|
|
213
|
+
/** Host app's currently active org id. If different from the library's tracked org,
|
|
214
|
+
* an `Org-Id` header is injected into the Singul curl preview. */
|
|
215
|
+
activeOrgId?: string | null;
|
|
216
|
+
}
|
|
217
|
+
declare function AppDetailDrawer({ open, onClose, appName, anchor, width, onRefresh, onAddToCanvas, isAuthenticated, activeOrgId, }: AppDetailDrawerProps): react_jsx_runtime.JSX.Element;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* AppSearchDrawer — Reusable drawer for searching apps.
|
|
221
|
+
* Selecting an app opens the AppDetailDrawer for full configuration.
|
|
222
|
+
*/
|
|
223
|
+
interface ConnectionPathApp {
|
|
224
|
+
name: string;
|
|
225
|
+
icon: string;
|
|
226
|
+
hasValidAuth?: boolean;
|
|
227
|
+
isActiveOnly?: boolean;
|
|
228
|
+
}
|
|
229
|
+
interface AppSearchDrawerProps {
|
|
230
|
+
open: boolean;
|
|
231
|
+
onClose: () => void;
|
|
232
|
+
initialQuery?: string;
|
|
233
|
+
title?: string;
|
|
234
|
+
subtitle?: string;
|
|
235
|
+
anchor?: 'left' | 'right';
|
|
236
|
+
width?: number;
|
|
237
|
+
/** Show the Shuffle Pipelines banner above search results */
|
|
238
|
+
showPipelinesBanner?: boolean;
|
|
239
|
+
/** If provided, selecting an app calls this instead of opening AppDetailDrawer */
|
|
240
|
+
onQuickSelect?: (app: {
|
|
241
|
+
name: string;
|
|
242
|
+
icon: string;
|
|
243
|
+
categories: string[];
|
|
244
|
+
id: string | null;
|
|
245
|
+
}) => void;
|
|
246
|
+
/** If provided, called before default behavior. Return true to prevent opening detail drawer. */
|
|
247
|
+
onSelectOverride?: (app: {
|
|
248
|
+
name: string;
|
|
249
|
+
icon: string;
|
|
250
|
+
categories: string[];
|
|
251
|
+
}) => boolean;
|
|
252
|
+
/** Called when the detail drawer closes, with the app name that was being configured */
|
|
253
|
+
onDetailClose?: (appName: string) => void;
|
|
254
|
+
/** When set, replaces Activate with "+ Add" in the detail drawer */
|
|
255
|
+
onAddToCanvas?: (appInfo: {
|
|
256
|
+
name: string;
|
|
257
|
+
icon: string;
|
|
258
|
+
algoliaId: string | null;
|
|
259
|
+
}) => void;
|
|
260
|
+
/** When set, apps matching this category are sorted to the top in user's apps */
|
|
261
|
+
priorityCategory?: string;
|
|
262
|
+
/** Apps currently in the connection path diagram — shown first in the drawer */
|
|
263
|
+
connectionPathApps?: ConnectionPathApp[];
|
|
264
|
+
/** Apps to pin at the top of the ShuffleMCP search results (deduped by name). */
|
|
265
|
+
pinnedApps?: Array<{
|
|
266
|
+
name: string;
|
|
267
|
+
image_url: string;
|
|
268
|
+
categories?: string[];
|
|
269
|
+
objectID?: string;
|
|
270
|
+
}>;
|
|
271
|
+
}
|
|
272
|
+
declare function AppSearchDrawer({ open, onClose, initialQuery, title, subtitle, anchor, width, showPipelinesBanner, onQuickSelect, onSelectOverride, onDetailClose, onAddToCanvas, priorityCategory, connectionPathApps, pinnedApps, }: AppSearchDrawerProps): react_jsx_runtime.JSX.Element;
|
|
273
|
+
|
|
274
|
+
declare function ShufflePipelinesBanner(): react_jsx_runtime.JSX.Element;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* AppTitleHeader — Standalone title/header card for an app.
|
|
278
|
+
*
|
|
279
|
+
* Shows avatar (with valid-auth border), name, Verified/Pending chip,
|
|
280
|
+
* categories, and either an "Activate/Deactivate" or "+ Add" action.
|
|
281
|
+
*
|
|
282
|
+
* Pure presentational component — pass in already-resolved props.
|
|
283
|
+
*/
|
|
284
|
+
interface AppTitleHeaderProps {
|
|
285
|
+
/** Display name of the app (will be capitalized via CSS). */
|
|
286
|
+
name: string;
|
|
287
|
+
/** Image URL for the app icon. */
|
|
288
|
+
image?: string;
|
|
289
|
+
/** Whether at least one valid authentication exists. */
|
|
290
|
+
hasValidAuth?: boolean;
|
|
291
|
+
/** Whether at least one auth entry exists (valid or not). */
|
|
292
|
+
hasAnyAuth?: boolean;
|
|
293
|
+
/** Whether the host is authenticated — controls Verified/Pending chip + Activate button visibility. */
|
|
294
|
+
isAuthenticated?: boolean;
|
|
295
|
+
/** App categories to display as chips. */
|
|
296
|
+
categories?: string[];
|
|
297
|
+
/** Activation state — `null` hides the Activate button. */
|
|
298
|
+
isActivated?: boolean | null;
|
|
299
|
+
/** Whether activation toggle is in-flight. */
|
|
300
|
+
activateLoading?: boolean;
|
|
301
|
+
/** Called when user clicks Activate/Deactivate. */
|
|
302
|
+
onActivateToggle?: () => void;
|
|
303
|
+
/** When provided, replaces the Activate button with "+ Add". */
|
|
304
|
+
onAdd?: () => void;
|
|
305
|
+
}
|
|
306
|
+
declare function AppTitleHeader({ name, image, hasValidAuth, hasAnyAuth, isAuthenticated, categories, isActivated, activateLoading, onActivateToggle, onAdd, }: AppTitleHeaderProps): react_jsx_runtime.JSX.Element;
|
|
307
|
+
|
|
308
|
+
interface AppAuthSectionProps {
|
|
309
|
+
/** Display name (used in copy when no auth exists). */
|
|
310
|
+
displayName: string;
|
|
311
|
+
/** Algolia app object — required to render the AuthCard. */
|
|
312
|
+
algoliaApp: AlgoliaSearchApp | null;
|
|
313
|
+
/** Resolved app id (Algolia objectID). When missing the card is hidden. */
|
|
314
|
+
resolvedAlgoliaId: string | null;
|
|
315
|
+
/** Auth state object from useAppAuth. */
|
|
316
|
+
authState: any;
|
|
317
|
+
/** Whether the card is expanded. */
|
|
318
|
+
expanded: boolean;
|
|
319
|
+
onToggle: () => void;
|
|
320
|
+
/** Number of matching auth entries — drives the subtitle copy. */
|
|
321
|
+
authCount: number;
|
|
322
|
+
/** Whether the host is authenticated (no Cloud session = hide form). */
|
|
323
|
+
isAuthenticated?: boolean;
|
|
324
|
+
/** Auth entries already filtered to this app. */
|
|
325
|
+
matchingEntries: any[];
|
|
326
|
+
onAuthChange: any;
|
|
327
|
+
onTestConnection: (appId: string, authId?: string) => any;
|
|
328
|
+
onSaveAuth: (appId: string, credentials: Record<string, string>) => Promise<boolean>;
|
|
329
|
+
onRefreshAuth: () => void;
|
|
330
|
+
}
|
|
331
|
+
declare function AppAuthSection({ displayName, algoliaApp, resolvedAlgoliaId, authState, expanded, onToggle, authCount, isAuthenticated, matchingEntries, onAuthChange, onTestConnection, onSaveAuth, onRefreshAuth, }: AppAuthSectionProps): react_jsx_runtime.JSX.Element;
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* TryMcpSection — Standalone "Try MCP" block.
|
|
335
|
+
*
|
|
336
|
+
* Wraps the heading + AppMcpChat. Pass in the resolved app props.
|
|
337
|
+
*/
|
|
338
|
+
interface TryMcpSectionProps {
|
|
339
|
+
appName: string;
|
|
340
|
+
/** Image URL used as the chat avatar. */
|
|
341
|
+
appIcon?: string;
|
|
342
|
+
/** Resolved app id (Algolia objectID or Shuffle id). */
|
|
343
|
+
appId: string;
|
|
344
|
+
/** App categories — used to pick suggested actions. */
|
|
345
|
+
categories?: string[];
|
|
346
|
+
}
|
|
347
|
+
declare function TryMcpSection({ appName, appIcon, appId, categories }: TryMcpSectionProps): react_jsx_runtime.JSX.Element;
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* SingulActionsPreview — Standalone "Try individual actions" block.
|
|
351
|
+
*
|
|
352
|
+
* Renders the action picker (grouped by category), curl/python toggle,
|
|
353
|
+
* editable snippet, Play button (calls Shuffle Tools `execute_python` or
|
|
354
|
+
* the http app `curl` action) and a response area that streams in.
|
|
355
|
+
*
|
|
356
|
+
* Self-contained — pass in the app name + categories. Optionally pass
|
|
357
|
+
* `activeOrgId` so multi-org curl previews include the right Org-Id header.
|
|
358
|
+
*/
|
|
359
|
+
declare const SingulActionsPreview: ({ appName, categories, activeOrgId, }: {
|
|
360
|
+
appName: string;
|
|
361
|
+
categories?: string[];
|
|
362
|
+
activeOrgId?: string | null;
|
|
363
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* useAppLookup — Resolve an app's display name, image, categories,
|
|
367
|
+
* canonical Algolia objectID and matching auth entries from just
|
|
368
|
+
* an app name (or id).
|
|
369
|
+
*
|
|
370
|
+
* Used by the standalone section components (Authentication, Try MCP,
|
|
371
|
+
* Try individual actions) so consumers only need to pass `appName`.
|
|
372
|
+
*
|
|
373
|
+
* Resolution order:
|
|
374
|
+
* 1. Algolia `appsearch` index (best-effort, may 429)
|
|
375
|
+
* 2. /api/v1/apps fallback (private + activated apps)
|
|
376
|
+
* 3. /api/v1/apps/:id/config to enrich with auth schema
|
|
377
|
+
*/
|
|
378
|
+
|
|
379
|
+
interface AppLookupResult {
|
|
380
|
+
loading: boolean;
|
|
381
|
+
displayName: string;
|
|
382
|
+
image: string;
|
|
383
|
+
categories: string[];
|
|
384
|
+
/** Canonical Algolia objectID (or Shuffle private app id). */
|
|
385
|
+
algoliaId: string | null;
|
|
386
|
+
/** Synthesized AlgoliaSearchApp suitable for AppAuthCard. */
|
|
387
|
+
algoliaApp: AlgoliaSearchApp | null;
|
|
388
|
+
/** Auth entries matching this app name. */
|
|
389
|
+
matchingEntries: any[];
|
|
390
|
+
hasValidAuth: boolean;
|
|
391
|
+
hasAnyAuth: boolean;
|
|
392
|
+
authCount: number;
|
|
393
|
+
authState: any;
|
|
394
|
+
handleAuthChange: any;
|
|
395
|
+
handleTestConnection: (appId: string, authId?: string) => any;
|
|
396
|
+
handleSaveAuth: (appId: string, credentials: Record<string, string>) => Promise<boolean>;
|
|
397
|
+
refreshAuth: () => void;
|
|
398
|
+
}
|
|
399
|
+
declare function useAppLookup(appName: string | null): AppLookupResult;
|
|
400
|
+
|
|
401
|
+
interface IntegrationStatusProps {
|
|
402
|
+
collapsed: boolean;
|
|
403
|
+
/** When provided, only show integrations whose name is in this list */
|
|
404
|
+
filterApps?: string[];
|
|
405
|
+
/** When provided, the Add button calls this instead of navigating to /onboarding */
|
|
406
|
+
onAddClick?: () => void;
|
|
407
|
+
/** Icon size override (default: 26) */
|
|
408
|
+
iconSize?: number;
|
|
409
|
+
/** When provided, hovering an icon shows a cross-out button that calls this with the app name */
|
|
410
|
+
onDisable?: (name: string) => void;
|
|
411
|
+
/** Set of app names that are currently disabled */
|
|
412
|
+
disabledApps?: Set<string>;
|
|
413
|
+
/** Show all integrations without truncation */
|
|
414
|
+
showAll?: boolean;
|
|
415
|
+
/** Hide the Add Integration button */
|
|
416
|
+
hideAddButton?: boolean;
|
|
417
|
+
/** Hide the "Integrations" section header */
|
|
418
|
+
hideHeader?: boolean;
|
|
419
|
+
/** When set, apps matching this category are sorted to the top */
|
|
420
|
+
priorityCategory?: string;
|
|
421
|
+
}
|
|
422
|
+
/** Fire this event from anywhere to make all IntegrationStatus instances re-fetch. */
|
|
423
|
+
declare const refreshAllIntegrationStatus: () => void;
|
|
424
|
+
declare const IntegrationStatus: ({ collapsed, filterApps, onAddClick, iconSize, onDisable, disabledApps, showAll, hideAddButton, hideHeader, priorityCategory }: IntegrationStatusProps) => react_jsx_runtime.JSX.Element;
|
|
425
|
+
|
|
426
|
+
type AuthStatus = 'pending' | 'testing' | 'connected' | 'error';
|
|
427
|
+
interface AppAuthState {
|
|
428
|
+
systemId: string;
|
|
429
|
+
status: AuthStatus;
|
|
430
|
+
credentials: Record<string, string>;
|
|
431
|
+
errorMessage?: string;
|
|
432
|
+
successMessage?: string;
|
|
433
|
+
warningMessage?: string;
|
|
434
|
+
workflowId?: string;
|
|
435
|
+
executionId?: string;
|
|
436
|
+
errorCode?: number;
|
|
437
|
+
}
|
|
438
|
+
interface ApiAuthEntry {
|
|
439
|
+
id?: string;
|
|
440
|
+
label?: string;
|
|
441
|
+
app: {
|
|
442
|
+
id: string;
|
|
443
|
+
name: string;
|
|
444
|
+
large_image?: string;
|
|
445
|
+
};
|
|
446
|
+
active?: boolean;
|
|
447
|
+
created?: number;
|
|
448
|
+
edited?: number;
|
|
449
|
+
validation?: {
|
|
450
|
+
valid: boolean;
|
|
451
|
+
error?: string;
|
|
452
|
+
last_valid?: number;
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
declare function useAppAuth(): {
|
|
457
|
+
authStates: Record<string, AppAuthState>;
|
|
458
|
+
authenticatedApps: ApiAuthEntry[];
|
|
459
|
+
loading: boolean;
|
|
460
|
+
handleAuthChange: (systemId: string, credentials: Record<string, string>) => void;
|
|
461
|
+
handleTestConnection: (systemId: string, authenticationId?: string) => Promise<void>;
|
|
462
|
+
handleSaveAuth: (appId: string, credentials: Record<string, string>, appName?: string) => Promise<boolean>;
|
|
463
|
+
refreshAuth: () => Promise<void>;
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
interface AppDetailContextType {
|
|
467
|
+
openApp: (appName: string) => void;
|
|
468
|
+
closeApp: () => void;
|
|
469
|
+
currentAppName: string | null;
|
|
470
|
+
isOpen: boolean;
|
|
471
|
+
}
|
|
472
|
+
declare const AppDetailProvider: ({ children }: {
|
|
473
|
+
children: ReactNode;
|
|
474
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
475
|
+
declare const useAppDetail: () => AppDetailContextType;
|
|
476
|
+
|
|
477
|
+
declare const API_CONFIG: {
|
|
478
|
+
readonly baseUrl: string;
|
|
479
|
+
version: string;
|
|
480
|
+
readonly apiKey: string | null;
|
|
481
|
+
setApiKey(key: string | null): void;
|
|
482
|
+
};
|
|
483
|
+
declare const getApiUrl: (endpoint: string) => string;
|
|
484
|
+
declare const getAuthHeader: (overrideOrgId?: string | null) => Record<string, string>;
|
|
485
|
+
|
|
486
|
+
/**
|
|
487
|
+
* Tiny toast facade — library version. The host app can replace this by
|
|
488
|
+
* setting a custom impl via setToastImpl(). Falls back to console.warn.
|
|
489
|
+
*/
|
|
490
|
+
type ToastArg = {
|
|
491
|
+
title?: string;
|
|
492
|
+
description?: string;
|
|
493
|
+
variant?: 'default' | 'destructive';
|
|
494
|
+
};
|
|
495
|
+
type ToastFn = (arg: ToastArg) => void;
|
|
496
|
+
declare function setToastImpl(fn: ToastFn): void;
|
|
497
|
+
declare const toast: ToastFn;
|
|
498
|
+
|
|
499
|
+
export { API_CONFIG, type AlgoliaSearchApp, AppAuthSection, type AppAuthSectionProps, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type CustomStyles, IntegrationStatus, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, ShufflePipelinesBanner, SingulActionsPreview, TryMcpSection, type TryMcpSectionProps, ShuffleMCP as default, getApiUrl, getAuthHeader, refreshAllIntegrationStatus, setToastImpl, toast, useAppAuth, useAppDetail, useAppLookup };
|