@shuffleio/shuffle-mcps 0.0.8 → 0.0.10
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.cjs +3526 -1047
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -16
- package/dist/index.d.ts +190 -16
- package/dist/index.js +3460 -979
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -276,8 +276,26 @@ interface AppSearchDrawerProps {
|
|
|
276
276
|
highlightAppName?: string;
|
|
277
277
|
/** Delay before the highlight kicks in (default 5000ms) */
|
|
278
278
|
highlightDelayMs?: number;
|
|
279
|
+
/** Enable multi-select: clicking apps toggles them in/out of the selection,
|
|
280
|
+
* drawer stays open, and the picker shows checkboxes + a primary-bordered
|
|
281
|
+
* highlight on already-chosen rows. */
|
|
282
|
+
multiSelect?: boolean;
|
|
283
|
+
/** Currently chosen apps (used to highlight rows in multi-select mode).
|
|
284
|
+
* Match is by objectID first, then by normalized name. */
|
|
285
|
+
selectedApps?: Array<{
|
|
286
|
+
name: string;
|
|
287
|
+
id?: string | null;
|
|
288
|
+
icon?: string;
|
|
289
|
+
}>;
|
|
290
|
+
/** Fires whenever the selection changes in multi-select mode. */
|
|
291
|
+
onSelectionChange?: (apps: Array<{
|
|
292
|
+
name: string;
|
|
293
|
+
id: string | null;
|
|
294
|
+
icon: string;
|
|
295
|
+
categories: string[];
|
|
296
|
+
}>) => void;
|
|
279
297
|
}
|
|
280
|
-
declare function AppSearchDrawer({ open, onClose, initialQuery, title, subtitle, anchor, width, showPipelinesBanner, onQuickSelect, onSelectOverride, onDetailClose, onAddToCanvas, priorityCategory, connectionPathApps, pinnedApps, highlightAppName, highlightDelayMs, }: AppSearchDrawerProps): react_jsx_runtime.JSX.Element;
|
|
298
|
+
declare function AppSearchDrawer({ open, onClose, initialQuery, title, subtitle, anchor, width, showPipelinesBanner, onQuickSelect, onSelectOverride, onDetailClose, onAddToCanvas, priorityCategory, connectionPathApps, pinnedApps, highlightAppName, highlightDelayMs, multiSelect, selectedApps, onSelectionChange, }: AppSearchDrawerProps): react_jsx_runtime.JSX.Element;
|
|
281
299
|
|
|
282
300
|
declare function ShufflePipelinesBanner(): react_jsx_runtime.JSX.Element;
|
|
283
301
|
|
|
@@ -354,20 +372,15 @@ interface TryMcpSectionProps {
|
|
|
354
372
|
}
|
|
355
373
|
declare function TryMcpSection({ appName, appIcon, appId, categories }: TryMcpSectionProps): react_jsx_runtime.JSX.Element;
|
|
356
374
|
|
|
357
|
-
|
|
358
|
-
* SingulActionsPreview — Standalone "Try individual actions" block.
|
|
359
|
-
*
|
|
360
|
-
* Renders the action picker (grouped by category), curl/python toggle,
|
|
361
|
-
* editable snippet, Play button (calls Shuffle Tools `execute_python` or
|
|
362
|
-
* the http app `curl` action) and a response area that streams in.
|
|
363
|
-
*
|
|
364
|
-
* Self-contained — pass in the app name + categories. Optionally pass
|
|
365
|
-
* `activeOrgId` so multi-org curl previews include the right Org-Id header.
|
|
366
|
-
*/
|
|
367
|
-
declare const SingulActionsPreview: ({ appName, categories, activeOrgId, }: {
|
|
375
|
+
declare const SingulActionsPreview: ({ appName, appIcon, categories, activeOrgId, onAuthenticate, }: {
|
|
368
376
|
appName: string;
|
|
377
|
+
appIcon?: string;
|
|
369
378
|
categories?: string[];
|
|
370
379
|
activeOrgId?: string | null;
|
|
380
|
+
/** Optional click handler invoked when the user presses the
|
|
381
|
+
* "Authenticate {App}" button surfaced after an
|
|
382
|
+
* `action: "app_authentication"` response. */
|
|
383
|
+
onAuthenticate?: (appName: string) => void;
|
|
371
384
|
}) => react_jsx_runtime.JSX.Element;
|
|
372
385
|
|
|
373
386
|
/**
|
|
@@ -445,6 +458,24 @@ interface AgentUIProps {
|
|
|
445
458
|
submitTooltip?: string;
|
|
446
459
|
/** Custom icon for the submit button. */
|
|
447
460
|
submitIcon?: React$1.ReactNode;
|
|
461
|
+
/**
|
|
462
|
+
* When provided, the submit button + Cmd/Ctrl+Enter call this instead of
|
|
463
|
+
* running the agent. Used for "edit existing scheduled workflow" mode where
|
|
464
|
+
* the same starter UI is reused for editing the prompt + apps.
|
|
465
|
+
*/
|
|
466
|
+
submitOverride?: (info: {
|
|
467
|
+
input: string;
|
|
468
|
+
apps: Array<{
|
|
469
|
+
name: string;
|
|
470
|
+
id?: string;
|
|
471
|
+
icon?: string;
|
|
472
|
+
}>;
|
|
473
|
+
}) => void | Promise<void>;
|
|
474
|
+
/** When set, renders the submit control as a wider labelled button instead of the icon-only send button. */
|
|
475
|
+
submitLabel?: string;
|
|
476
|
+
/** Force-disable the schedule (clock) button. Optional tooltip override. */
|
|
477
|
+
disableSchedule?: boolean;
|
|
478
|
+
disableScheduleTooltip?: string;
|
|
448
479
|
/** Placeholder for the post-finish continuation field. */
|
|
449
480
|
continuationPlaceholder?: string;
|
|
450
481
|
/** Read `?execution_id` & `?authorization` from window URL on mount. */
|
|
@@ -486,6 +517,25 @@ interface AgentUIProps {
|
|
|
486
517
|
}) => void;
|
|
487
518
|
/** Called whenever the active top-level view changes (start / simple / detailed). */
|
|
488
519
|
onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
|
|
520
|
+
/**
|
|
521
|
+
* Called when the user saves a recurring schedule (cron expression) for the
|
|
522
|
+
* current prompt. When omitted, a toast is shown indicating scheduling is
|
|
523
|
+
* not wired up in this embed.
|
|
524
|
+
*/
|
|
525
|
+
onSchedule?: (info: {
|
|
526
|
+
cron: string;
|
|
527
|
+
input: string;
|
|
528
|
+
apps?: Array<{
|
|
529
|
+
name: string;
|
|
530
|
+
id?: string;
|
|
531
|
+
icon?: string;
|
|
532
|
+
}>;
|
|
533
|
+
onStep?: (event: {
|
|
534
|
+
id: 'name' | 'workflow' | 'schedule';
|
|
535
|
+
state: 'active' | 'done' | 'error';
|
|
536
|
+
detail?: string;
|
|
537
|
+
}) => void;
|
|
538
|
+
}) => void | Promise<void>;
|
|
489
539
|
/**
|
|
490
540
|
* Optional Shuffle API key. When provided, all `/api/v1/*` calls made by
|
|
491
541
|
* this component (agent run, polling, app autoload, icon fallback) use it
|
|
@@ -632,9 +682,11 @@ interface AgentActivityParams {
|
|
|
632
682
|
apiBaseUrl?: string;
|
|
633
683
|
/** Optional Shuffle Org ID — sent as the `Org-Id` header. */
|
|
634
684
|
orgId?: string;
|
|
685
|
+
/** Workflow ID to search. Defaults to the synthetic 'AGENT' grouping. */
|
|
686
|
+
workflowId?: string;
|
|
635
687
|
}
|
|
636
688
|
/**
|
|
637
|
-
* Search agent workflow executions (workflow_id = "AGENT").
|
|
689
|
+
* Search agent workflow executions (workflow_id = "AGENT" by default).
|
|
638
690
|
*/
|
|
639
691
|
declare const searchAgentActivity: (params?: AgentActivityParams) => Promise<AgentActivityResponse>;
|
|
640
692
|
|
|
@@ -647,6 +699,16 @@ interface AgentActivityListProps {
|
|
|
647
699
|
orgId?: string;
|
|
648
700
|
/** Called when a run row is clicked. */
|
|
649
701
|
onRunClick?: (run: AgentRun) => void;
|
|
702
|
+
/** Called when "Edit" is clicked on a selected scheduled workflow. */
|
|
703
|
+
onEditWorkflow?: (info: {
|
|
704
|
+
workflowId: string;
|
|
705
|
+
name: string;
|
|
706
|
+
prompt: string;
|
|
707
|
+
apps: Array<{
|
|
708
|
+
name: string;
|
|
709
|
+
id?: string;
|
|
710
|
+
}>;
|
|
711
|
+
}) => void;
|
|
650
712
|
/** Show the search box. Default: true. */
|
|
651
713
|
showSearchBar?: boolean;
|
|
652
714
|
/** Show the status filter chips. Default: true. */
|
|
@@ -666,7 +728,7 @@ interface AgentActivityListProps {
|
|
|
666
728
|
/** Style overrides for each individual run row. */
|
|
667
729
|
rowSx?: SxProps<Theme>;
|
|
668
730
|
}
|
|
669
|
-
declare const AgentActivityList: ({ apiKey, apiBaseUrl, orgId, onRunClick, showSearchBar, showStatusChips, limit, emptyTitle, emptySubtitle, className, sx, toolbarSx, rowSx, }: AgentActivityListProps) => react_jsx_runtime.JSX.Element;
|
|
731
|
+
declare const AgentActivityList: ({ apiKey, apiBaseUrl, orgId, onRunClick, onEditWorkflow, showSearchBar, showStatusChips, limit, emptyTitle, emptySubtitle, className, sx, toolbarSx, rowSx, }: AgentActivityListProps) => react_jsx_runtime.JSX.Element;
|
|
670
732
|
|
|
671
733
|
interface AgentExecutionDrawerProps {
|
|
672
734
|
open: boolean;
|
|
@@ -689,8 +751,79 @@ interface AgentExecutionDrawerProps {
|
|
|
689
751
|
headerSx?: SxProps<Theme>;
|
|
690
752
|
/** Style overrides for the body container that wraps the embedded AgentUI. */
|
|
691
753
|
bodySx?: SxProps<Theme>;
|
|
754
|
+
/** Optional content rendered at the top of the body, before the embedded
|
|
755
|
+
* AgentUI. Use this to inject a shared "Needs attention" / failure
|
|
756
|
+
* diagnosis banner so the drawer mirrors the timeline status pill. */
|
|
757
|
+
topBanner?: React.ReactNode;
|
|
758
|
+
/** Handler for scheduling the loaded agent prompt from the execution view. */
|
|
759
|
+
onSchedule?: AgentUIProps['onSchedule'];
|
|
692
760
|
}
|
|
693
|
-
declare const AgentExecutionDrawer: ({ open, onClose, run, width, apiKey, apiBaseUrl, orgId, className, paperSx, headerSx, bodySx, }: AgentExecutionDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
761
|
+
declare const AgentExecutionDrawer: ({ open, onClose, run, width, apiKey, apiBaseUrl, orgId, className, paperSx, headerSx, bodySx, topBanner, onSchedule, }: AgentExecutionDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Shared diagnosis utilities for an agent execution result.
|
|
765
|
+
*
|
|
766
|
+
* Lives in the Shuffle-MCPs lib so every surface that displays an agent run
|
|
767
|
+
* (AgentUI Simple/Detailed view, AgentExecutionDrawer, the incident-side
|
|
768
|
+
* AgentRunResultViewer, the activity feed status pill, ...) uses the EXACT
|
|
769
|
+
* same logic to decide whether the run "needs review" and what to tell the
|
|
770
|
+
* user about it.
|
|
771
|
+
*
|
|
772
|
+
* Pure logic — no React, no MUI, no project-side imports.
|
|
773
|
+
*/
|
|
774
|
+
/** Minimal run shape the diagnoser needs. Compatible with AgentRun and
|
|
775
|
+
* AgentUI's internal ExecutionData. */
|
|
776
|
+
interface DiagnosableRun {
|
|
777
|
+
status?: string;
|
|
778
|
+
results?: Array<{
|
|
779
|
+
result?: string;
|
|
780
|
+
} | any> | null;
|
|
781
|
+
}
|
|
782
|
+
/** Try to parse the result JSON from results[0].result, unwrapping AGENT-type executions. */
|
|
783
|
+
declare const parseRunResult: (run: DiagnosableRun) => {
|
|
784
|
+
raw: string | null;
|
|
785
|
+
parsed: any | null;
|
|
786
|
+
};
|
|
787
|
+
/** Extract failure info from a failed/aborted run. */
|
|
788
|
+
declare const getFailureInfo: (run: DiagnosableRun) => {
|
|
789
|
+
reason: string;
|
|
790
|
+
} | null;
|
|
791
|
+
/** Detect if the output content hints at an error/failure even if the run
|
|
792
|
+
* status is "finished". Only returns true when `diagnoseOutputWarning`
|
|
793
|
+
* would produce a concrete, actionable diagnosis — never on vague keyword
|
|
794
|
+
* matches alone. */
|
|
795
|
+
declare const hasOutputWarning: (run: DiagnosableRun) => boolean;
|
|
796
|
+
type DiagnosisEvidence = {
|
|
797
|
+
/** Dotted JSON path inside the parsed run result. */
|
|
798
|
+
path: string;
|
|
799
|
+
/** Trimmed snippet of the value at that path. */
|
|
800
|
+
value: string;
|
|
801
|
+
};
|
|
802
|
+
type OutputDiagnosis = {
|
|
803
|
+
kind: 'auth' | 'permission' | 'not_found' | 'rate_limit' | 'network' | 'validation' | 'generic';
|
|
804
|
+
status?: number;
|
|
805
|
+
title: string;
|
|
806
|
+
explanation: string;
|
|
807
|
+
remediation: string;
|
|
808
|
+
snippet?: string;
|
|
809
|
+
evidence: DiagnosisEvidence[];
|
|
810
|
+
};
|
|
811
|
+
declare const diagnoseOutputWarning: (run: DiagnosableRun) => OutputDiagnosis | null;
|
|
812
|
+
|
|
813
|
+
interface Props {
|
|
814
|
+
run: DiagnosableRun | null | undefined;
|
|
815
|
+
/** Outer padding wrapper. Defaults to `{ px: 2.5, pb: 0.5 }`. */
|
|
816
|
+
sx?: Record<string, unknown>;
|
|
817
|
+
/** When provided, the banner becomes clickable and asks the host to jump
|
|
818
|
+
* to the underlying decision (e.g. switch to the detailed timeline,
|
|
819
|
+
* expand that row, scroll to it). */
|
|
820
|
+
onJumpToEvidence?: (decisionIndex: number) => void;
|
|
821
|
+
/** Stable id used to persist dismissals per-execution. Falls back to
|
|
822
|
+
* `run.execution_id` if present. When neither is available, dismiss
|
|
823
|
+
* still works for the current mount but is not persisted. */
|
|
824
|
+
executionId?: string;
|
|
825
|
+
}
|
|
826
|
+
declare const AgentRunDiagnosisBanner: ({ run, sx, onJumpToEvidence, executionId }: Props) => react_jsx_runtime.JSX.Element;
|
|
694
827
|
|
|
695
828
|
/**
|
|
696
829
|
* useAppLookup — Resolve an app's display name, image, categories,
|
|
@@ -728,6 +861,47 @@ interface AppLookupResult {
|
|
|
728
861
|
}
|
|
729
862
|
declare function useAppLookup(appName: string | null): AppLookupResult;
|
|
730
863
|
|
|
864
|
+
/**
|
|
865
|
+
* resolveApp — General-purpose app resolver.
|
|
866
|
+
*
|
|
867
|
+
* Given an app id OR name, look it up across all three known sources and
|
|
868
|
+
* return a unified `{ id, name, image }` triple. Used anywhere we need to
|
|
869
|
+
* render an app chip/icon and only have a free-form identifier (decision
|
|
870
|
+
* `tool`, auth-request `appName`, `app_authentication` payload, etc.).
|
|
871
|
+
*
|
|
872
|
+
* Resolution order (each pass merges in any newly-found fields, so we keep
|
|
873
|
+
* going until id/name/image are all known or all sources are exhausted):
|
|
874
|
+
* 1. /api/v1/apps/authentication — covers user-installed/active apps,
|
|
875
|
+
* including private ones that may not be in the public catalog.
|
|
876
|
+
* 2. /api/v1/apps — covers everything visible to the org (activated
|
|
877
|
+
* and private uploads).
|
|
878
|
+
* 3. Algolia `appsearch` — canonical objectID + public catalog metadata.
|
|
879
|
+
*
|
|
880
|
+
* Results are cached in-memory by normalized key so repeat lookups for the
|
|
881
|
+
* same name/id are free.
|
|
882
|
+
*/
|
|
883
|
+
interface ResolvedApp {
|
|
884
|
+
/** Canonical id — Algolia objectID when known, otherwise Shuffle app id. */
|
|
885
|
+
id: string;
|
|
886
|
+
/** Display name (may be raw slug if no source had a friendly name). */
|
|
887
|
+
name: string;
|
|
888
|
+
/** Best available large image URL. Empty string if not found. */
|
|
889
|
+
image: string;
|
|
890
|
+
/** Categories from whichever source provided them. */
|
|
891
|
+
categories?: string[];
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Resolve an app from id-or-name across auth + apps + Algolia.
|
|
895
|
+
* Returns `null` only if all three sources came back empty.
|
|
896
|
+
*/
|
|
897
|
+
declare function resolveApp(idOrName: string): Promise<ResolvedApp | null>;
|
|
898
|
+
/** Resolve many at once — convenience wrapper. */
|
|
899
|
+
declare function resolveApps(idsOrNames: string[]): Promise<Record<string, ResolvedApp>>;
|
|
900
|
+
/** Seed the cache (e.g. from chosenApps that already carry an icon). */
|
|
901
|
+
declare function seedResolvedApp(idOrName: string, app: Partial<ResolvedApp>): void;
|
|
902
|
+
/** Clear the resolver cache (e.g. on org change). */
|
|
903
|
+
declare function invalidateResolvedApps(): void;
|
|
904
|
+
|
|
731
905
|
interface IntegrationStatusProps {
|
|
732
906
|
collapsed: boolean;
|
|
733
907
|
/** When provided, only show integrations whose name is in this list */
|
|
@@ -830,4 +1004,4 @@ type ToastApi = ((arg: ToastArg, opts?: ToastOptions) => void) & {
|
|
|
830
1004
|
};
|
|
831
1005
|
declare const toast: ToastApi;
|
|
832
1006
|
|
|
833
|
-
export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentRun, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, 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, searchAgentActivity, setToastImpl, toast, useAppAuth, useAppDetail, useAppLookup };
|
|
1007
|
+
export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, type AlgoliaSearchApp, AppAuthSection, type AppAuthSectionProps, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type CustomStyles, type DiagnosableRun, type DiagnosisEvidence, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, ShufflePipelinesBanner, SingulActionsPreview, TryMcpSection, type TryMcpSectionProps, ShuffleMCP as default, diagnoseOutputWarning, getApiUrl, getAuthHeader, getFailureInfo, hasOutputWarning, invalidateResolvedApps, parseRunResult, refreshAllIntegrationStatus, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setToastImpl, toast, useAppAuth, useAppDetail, useAppLookup };
|
package/dist/index.d.ts
CHANGED
|
@@ -276,8 +276,26 @@ interface AppSearchDrawerProps {
|
|
|
276
276
|
highlightAppName?: string;
|
|
277
277
|
/** Delay before the highlight kicks in (default 5000ms) */
|
|
278
278
|
highlightDelayMs?: number;
|
|
279
|
+
/** Enable multi-select: clicking apps toggles them in/out of the selection,
|
|
280
|
+
* drawer stays open, and the picker shows checkboxes + a primary-bordered
|
|
281
|
+
* highlight on already-chosen rows. */
|
|
282
|
+
multiSelect?: boolean;
|
|
283
|
+
/** Currently chosen apps (used to highlight rows in multi-select mode).
|
|
284
|
+
* Match is by objectID first, then by normalized name. */
|
|
285
|
+
selectedApps?: Array<{
|
|
286
|
+
name: string;
|
|
287
|
+
id?: string | null;
|
|
288
|
+
icon?: string;
|
|
289
|
+
}>;
|
|
290
|
+
/** Fires whenever the selection changes in multi-select mode. */
|
|
291
|
+
onSelectionChange?: (apps: Array<{
|
|
292
|
+
name: string;
|
|
293
|
+
id: string | null;
|
|
294
|
+
icon: string;
|
|
295
|
+
categories: string[];
|
|
296
|
+
}>) => void;
|
|
279
297
|
}
|
|
280
|
-
declare function AppSearchDrawer({ open, onClose, initialQuery, title, subtitle, anchor, width, showPipelinesBanner, onQuickSelect, onSelectOverride, onDetailClose, onAddToCanvas, priorityCategory, connectionPathApps, pinnedApps, highlightAppName, highlightDelayMs, }: AppSearchDrawerProps): react_jsx_runtime.JSX.Element;
|
|
298
|
+
declare function AppSearchDrawer({ open, onClose, initialQuery, title, subtitle, anchor, width, showPipelinesBanner, onQuickSelect, onSelectOverride, onDetailClose, onAddToCanvas, priorityCategory, connectionPathApps, pinnedApps, highlightAppName, highlightDelayMs, multiSelect, selectedApps, onSelectionChange, }: AppSearchDrawerProps): react_jsx_runtime.JSX.Element;
|
|
281
299
|
|
|
282
300
|
declare function ShufflePipelinesBanner(): react_jsx_runtime.JSX.Element;
|
|
283
301
|
|
|
@@ -354,20 +372,15 @@ interface TryMcpSectionProps {
|
|
|
354
372
|
}
|
|
355
373
|
declare function TryMcpSection({ appName, appIcon, appId, categories }: TryMcpSectionProps): react_jsx_runtime.JSX.Element;
|
|
356
374
|
|
|
357
|
-
|
|
358
|
-
* SingulActionsPreview — Standalone "Try individual actions" block.
|
|
359
|
-
*
|
|
360
|
-
* Renders the action picker (grouped by category), curl/python toggle,
|
|
361
|
-
* editable snippet, Play button (calls Shuffle Tools `execute_python` or
|
|
362
|
-
* the http app `curl` action) and a response area that streams in.
|
|
363
|
-
*
|
|
364
|
-
* Self-contained — pass in the app name + categories. Optionally pass
|
|
365
|
-
* `activeOrgId` so multi-org curl previews include the right Org-Id header.
|
|
366
|
-
*/
|
|
367
|
-
declare const SingulActionsPreview: ({ appName, categories, activeOrgId, }: {
|
|
375
|
+
declare const SingulActionsPreview: ({ appName, appIcon, categories, activeOrgId, onAuthenticate, }: {
|
|
368
376
|
appName: string;
|
|
377
|
+
appIcon?: string;
|
|
369
378
|
categories?: string[];
|
|
370
379
|
activeOrgId?: string | null;
|
|
380
|
+
/** Optional click handler invoked when the user presses the
|
|
381
|
+
* "Authenticate {App}" button surfaced after an
|
|
382
|
+
* `action: "app_authentication"` response. */
|
|
383
|
+
onAuthenticate?: (appName: string) => void;
|
|
371
384
|
}) => react_jsx_runtime.JSX.Element;
|
|
372
385
|
|
|
373
386
|
/**
|
|
@@ -445,6 +458,24 @@ interface AgentUIProps {
|
|
|
445
458
|
submitTooltip?: string;
|
|
446
459
|
/** Custom icon for the submit button. */
|
|
447
460
|
submitIcon?: React$1.ReactNode;
|
|
461
|
+
/**
|
|
462
|
+
* When provided, the submit button + Cmd/Ctrl+Enter call this instead of
|
|
463
|
+
* running the agent. Used for "edit existing scheduled workflow" mode where
|
|
464
|
+
* the same starter UI is reused for editing the prompt + apps.
|
|
465
|
+
*/
|
|
466
|
+
submitOverride?: (info: {
|
|
467
|
+
input: string;
|
|
468
|
+
apps: Array<{
|
|
469
|
+
name: string;
|
|
470
|
+
id?: string;
|
|
471
|
+
icon?: string;
|
|
472
|
+
}>;
|
|
473
|
+
}) => void | Promise<void>;
|
|
474
|
+
/** When set, renders the submit control as a wider labelled button instead of the icon-only send button. */
|
|
475
|
+
submitLabel?: string;
|
|
476
|
+
/** Force-disable the schedule (clock) button. Optional tooltip override. */
|
|
477
|
+
disableSchedule?: boolean;
|
|
478
|
+
disableScheduleTooltip?: string;
|
|
448
479
|
/** Placeholder for the post-finish continuation field. */
|
|
449
480
|
continuationPlaceholder?: string;
|
|
450
481
|
/** Read `?execution_id` & `?authorization` from window URL on mount. */
|
|
@@ -486,6 +517,25 @@ interface AgentUIProps {
|
|
|
486
517
|
}) => void;
|
|
487
518
|
/** Called whenever the active top-level view changes (start / simple / detailed). */
|
|
488
519
|
onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
|
|
520
|
+
/**
|
|
521
|
+
* Called when the user saves a recurring schedule (cron expression) for the
|
|
522
|
+
* current prompt. When omitted, a toast is shown indicating scheduling is
|
|
523
|
+
* not wired up in this embed.
|
|
524
|
+
*/
|
|
525
|
+
onSchedule?: (info: {
|
|
526
|
+
cron: string;
|
|
527
|
+
input: string;
|
|
528
|
+
apps?: Array<{
|
|
529
|
+
name: string;
|
|
530
|
+
id?: string;
|
|
531
|
+
icon?: string;
|
|
532
|
+
}>;
|
|
533
|
+
onStep?: (event: {
|
|
534
|
+
id: 'name' | 'workflow' | 'schedule';
|
|
535
|
+
state: 'active' | 'done' | 'error';
|
|
536
|
+
detail?: string;
|
|
537
|
+
}) => void;
|
|
538
|
+
}) => void | Promise<void>;
|
|
489
539
|
/**
|
|
490
540
|
* Optional Shuffle API key. When provided, all `/api/v1/*` calls made by
|
|
491
541
|
* this component (agent run, polling, app autoload, icon fallback) use it
|
|
@@ -632,9 +682,11 @@ interface AgentActivityParams {
|
|
|
632
682
|
apiBaseUrl?: string;
|
|
633
683
|
/** Optional Shuffle Org ID — sent as the `Org-Id` header. */
|
|
634
684
|
orgId?: string;
|
|
685
|
+
/** Workflow ID to search. Defaults to the synthetic 'AGENT' grouping. */
|
|
686
|
+
workflowId?: string;
|
|
635
687
|
}
|
|
636
688
|
/**
|
|
637
|
-
* Search agent workflow executions (workflow_id = "AGENT").
|
|
689
|
+
* Search agent workflow executions (workflow_id = "AGENT" by default).
|
|
638
690
|
*/
|
|
639
691
|
declare const searchAgentActivity: (params?: AgentActivityParams) => Promise<AgentActivityResponse>;
|
|
640
692
|
|
|
@@ -647,6 +699,16 @@ interface AgentActivityListProps {
|
|
|
647
699
|
orgId?: string;
|
|
648
700
|
/** Called when a run row is clicked. */
|
|
649
701
|
onRunClick?: (run: AgentRun) => void;
|
|
702
|
+
/** Called when "Edit" is clicked on a selected scheduled workflow. */
|
|
703
|
+
onEditWorkflow?: (info: {
|
|
704
|
+
workflowId: string;
|
|
705
|
+
name: string;
|
|
706
|
+
prompt: string;
|
|
707
|
+
apps: Array<{
|
|
708
|
+
name: string;
|
|
709
|
+
id?: string;
|
|
710
|
+
}>;
|
|
711
|
+
}) => void;
|
|
650
712
|
/** Show the search box. Default: true. */
|
|
651
713
|
showSearchBar?: boolean;
|
|
652
714
|
/** Show the status filter chips. Default: true. */
|
|
@@ -666,7 +728,7 @@ interface AgentActivityListProps {
|
|
|
666
728
|
/** Style overrides for each individual run row. */
|
|
667
729
|
rowSx?: SxProps<Theme>;
|
|
668
730
|
}
|
|
669
|
-
declare const AgentActivityList: ({ apiKey, apiBaseUrl, orgId, onRunClick, showSearchBar, showStatusChips, limit, emptyTitle, emptySubtitle, className, sx, toolbarSx, rowSx, }: AgentActivityListProps) => react_jsx_runtime.JSX.Element;
|
|
731
|
+
declare const AgentActivityList: ({ apiKey, apiBaseUrl, orgId, onRunClick, onEditWorkflow, showSearchBar, showStatusChips, limit, emptyTitle, emptySubtitle, className, sx, toolbarSx, rowSx, }: AgentActivityListProps) => react_jsx_runtime.JSX.Element;
|
|
670
732
|
|
|
671
733
|
interface AgentExecutionDrawerProps {
|
|
672
734
|
open: boolean;
|
|
@@ -689,8 +751,79 @@ interface AgentExecutionDrawerProps {
|
|
|
689
751
|
headerSx?: SxProps<Theme>;
|
|
690
752
|
/** Style overrides for the body container that wraps the embedded AgentUI. */
|
|
691
753
|
bodySx?: SxProps<Theme>;
|
|
754
|
+
/** Optional content rendered at the top of the body, before the embedded
|
|
755
|
+
* AgentUI. Use this to inject a shared "Needs attention" / failure
|
|
756
|
+
* diagnosis banner so the drawer mirrors the timeline status pill. */
|
|
757
|
+
topBanner?: React.ReactNode;
|
|
758
|
+
/** Handler for scheduling the loaded agent prompt from the execution view. */
|
|
759
|
+
onSchedule?: AgentUIProps['onSchedule'];
|
|
692
760
|
}
|
|
693
|
-
declare const AgentExecutionDrawer: ({ open, onClose, run, width, apiKey, apiBaseUrl, orgId, className, paperSx, headerSx, bodySx, }: AgentExecutionDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
761
|
+
declare const AgentExecutionDrawer: ({ open, onClose, run, width, apiKey, apiBaseUrl, orgId, className, paperSx, headerSx, bodySx, topBanner, onSchedule, }: AgentExecutionDrawerProps) => react_jsx_runtime.JSX.Element;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Shared diagnosis utilities for an agent execution result.
|
|
765
|
+
*
|
|
766
|
+
* Lives in the Shuffle-MCPs lib so every surface that displays an agent run
|
|
767
|
+
* (AgentUI Simple/Detailed view, AgentExecutionDrawer, the incident-side
|
|
768
|
+
* AgentRunResultViewer, the activity feed status pill, ...) uses the EXACT
|
|
769
|
+
* same logic to decide whether the run "needs review" and what to tell the
|
|
770
|
+
* user about it.
|
|
771
|
+
*
|
|
772
|
+
* Pure logic — no React, no MUI, no project-side imports.
|
|
773
|
+
*/
|
|
774
|
+
/** Minimal run shape the diagnoser needs. Compatible with AgentRun and
|
|
775
|
+
* AgentUI's internal ExecutionData. */
|
|
776
|
+
interface DiagnosableRun {
|
|
777
|
+
status?: string;
|
|
778
|
+
results?: Array<{
|
|
779
|
+
result?: string;
|
|
780
|
+
} | any> | null;
|
|
781
|
+
}
|
|
782
|
+
/** Try to parse the result JSON from results[0].result, unwrapping AGENT-type executions. */
|
|
783
|
+
declare const parseRunResult: (run: DiagnosableRun) => {
|
|
784
|
+
raw: string | null;
|
|
785
|
+
parsed: any | null;
|
|
786
|
+
};
|
|
787
|
+
/** Extract failure info from a failed/aborted run. */
|
|
788
|
+
declare const getFailureInfo: (run: DiagnosableRun) => {
|
|
789
|
+
reason: string;
|
|
790
|
+
} | null;
|
|
791
|
+
/** Detect if the output content hints at an error/failure even if the run
|
|
792
|
+
* status is "finished". Only returns true when `diagnoseOutputWarning`
|
|
793
|
+
* would produce a concrete, actionable diagnosis — never on vague keyword
|
|
794
|
+
* matches alone. */
|
|
795
|
+
declare const hasOutputWarning: (run: DiagnosableRun) => boolean;
|
|
796
|
+
type DiagnosisEvidence = {
|
|
797
|
+
/** Dotted JSON path inside the parsed run result. */
|
|
798
|
+
path: string;
|
|
799
|
+
/** Trimmed snippet of the value at that path. */
|
|
800
|
+
value: string;
|
|
801
|
+
};
|
|
802
|
+
type OutputDiagnosis = {
|
|
803
|
+
kind: 'auth' | 'permission' | 'not_found' | 'rate_limit' | 'network' | 'validation' | 'generic';
|
|
804
|
+
status?: number;
|
|
805
|
+
title: string;
|
|
806
|
+
explanation: string;
|
|
807
|
+
remediation: string;
|
|
808
|
+
snippet?: string;
|
|
809
|
+
evidence: DiagnosisEvidence[];
|
|
810
|
+
};
|
|
811
|
+
declare const diagnoseOutputWarning: (run: DiagnosableRun) => OutputDiagnosis | null;
|
|
812
|
+
|
|
813
|
+
interface Props {
|
|
814
|
+
run: DiagnosableRun | null | undefined;
|
|
815
|
+
/** Outer padding wrapper. Defaults to `{ px: 2.5, pb: 0.5 }`. */
|
|
816
|
+
sx?: Record<string, unknown>;
|
|
817
|
+
/** When provided, the banner becomes clickable and asks the host to jump
|
|
818
|
+
* to the underlying decision (e.g. switch to the detailed timeline,
|
|
819
|
+
* expand that row, scroll to it). */
|
|
820
|
+
onJumpToEvidence?: (decisionIndex: number) => void;
|
|
821
|
+
/** Stable id used to persist dismissals per-execution. Falls back to
|
|
822
|
+
* `run.execution_id` if present. When neither is available, dismiss
|
|
823
|
+
* still works for the current mount but is not persisted. */
|
|
824
|
+
executionId?: string;
|
|
825
|
+
}
|
|
826
|
+
declare const AgentRunDiagnosisBanner: ({ run, sx, onJumpToEvidence, executionId }: Props) => react_jsx_runtime.JSX.Element;
|
|
694
827
|
|
|
695
828
|
/**
|
|
696
829
|
* useAppLookup — Resolve an app's display name, image, categories,
|
|
@@ -728,6 +861,47 @@ interface AppLookupResult {
|
|
|
728
861
|
}
|
|
729
862
|
declare function useAppLookup(appName: string | null): AppLookupResult;
|
|
730
863
|
|
|
864
|
+
/**
|
|
865
|
+
* resolveApp — General-purpose app resolver.
|
|
866
|
+
*
|
|
867
|
+
* Given an app id OR name, look it up across all three known sources and
|
|
868
|
+
* return a unified `{ id, name, image }` triple. Used anywhere we need to
|
|
869
|
+
* render an app chip/icon and only have a free-form identifier (decision
|
|
870
|
+
* `tool`, auth-request `appName`, `app_authentication` payload, etc.).
|
|
871
|
+
*
|
|
872
|
+
* Resolution order (each pass merges in any newly-found fields, so we keep
|
|
873
|
+
* going until id/name/image are all known or all sources are exhausted):
|
|
874
|
+
* 1. /api/v1/apps/authentication — covers user-installed/active apps,
|
|
875
|
+
* including private ones that may not be in the public catalog.
|
|
876
|
+
* 2. /api/v1/apps — covers everything visible to the org (activated
|
|
877
|
+
* and private uploads).
|
|
878
|
+
* 3. Algolia `appsearch` — canonical objectID + public catalog metadata.
|
|
879
|
+
*
|
|
880
|
+
* Results are cached in-memory by normalized key so repeat lookups for the
|
|
881
|
+
* same name/id are free.
|
|
882
|
+
*/
|
|
883
|
+
interface ResolvedApp {
|
|
884
|
+
/** Canonical id — Algolia objectID when known, otherwise Shuffle app id. */
|
|
885
|
+
id: string;
|
|
886
|
+
/** Display name (may be raw slug if no source had a friendly name). */
|
|
887
|
+
name: string;
|
|
888
|
+
/** Best available large image URL. Empty string if not found. */
|
|
889
|
+
image: string;
|
|
890
|
+
/** Categories from whichever source provided them. */
|
|
891
|
+
categories?: string[];
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Resolve an app from id-or-name across auth + apps + Algolia.
|
|
895
|
+
* Returns `null` only if all three sources came back empty.
|
|
896
|
+
*/
|
|
897
|
+
declare function resolveApp(idOrName: string): Promise<ResolvedApp | null>;
|
|
898
|
+
/** Resolve many at once — convenience wrapper. */
|
|
899
|
+
declare function resolveApps(idsOrNames: string[]): Promise<Record<string, ResolvedApp>>;
|
|
900
|
+
/** Seed the cache (e.g. from chosenApps that already carry an icon). */
|
|
901
|
+
declare function seedResolvedApp(idOrName: string, app: Partial<ResolvedApp>): void;
|
|
902
|
+
/** Clear the resolver cache (e.g. on org change). */
|
|
903
|
+
declare function invalidateResolvedApps(): void;
|
|
904
|
+
|
|
731
905
|
interface IntegrationStatusProps {
|
|
732
906
|
collapsed: boolean;
|
|
733
907
|
/** When provided, only show integrations whose name is in this list */
|
|
@@ -830,4 +1004,4 @@ type ToastApi = ((arg: ToastArg, opts?: ToastOptions) => void) & {
|
|
|
830
1004
|
};
|
|
831
1005
|
declare const toast: ToastApi;
|
|
832
1006
|
|
|
833
|
-
export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentRun, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, 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, searchAgentActivity, setToastImpl, toast, useAppAuth, useAppDetail, useAppLookup };
|
|
1007
|
+
export { API_CONFIG, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, type AlgoliaSearchApp, AppAuthSection, type AppAuthSectionProps, type AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type CustomStyles, type DiagnosableRun, type DiagnosisEvidence, IntegrationStatus, type OutputDiagnosis, type ResolvedApp, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, ShufflePipelinesBanner, SingulActionsPreview, TryMcpSection, type TryMcpSectionProps, ShuffleMCP as default, diagnoseOutputWarning, getApiUrl, getAuthHeader, getFailureInfo, hasOutputWarning, invalidateResolvedApps, parseRunResult, refreshAllIntegrationStatus, resolveApp, resolveApps, searchAgentActivity, seedResolvedApp, setToastImpl, toast, useAppAuth, useAppDetail, useAppLookup };
|