@shuffleio/shuffle-mcps 0.0.68 → 0.0.69-staging-52bdb60

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 CHANGED
@@ -210,10 +210,11 @@ Reference implementation in production: [`src/Shuffle-MCPs/AppSearchDrawer.tsx`]
210
210
 
211
211
  ### 4. `<AgentUI />` — start + debug agents
212
212
 
213
- A standalone "What do you want to do?" surface for the Shuffle agent. Two modes in one component:
213
+ A standalone "What do you want to do?" surface for the Shuffle agent. Its tabs are:
214
214
 
215
- 1. **Starter** — large hero prompt with attached MCP/app chips. Submits to `/api/v1/agent`.
216
- 2. **Debugger** — compact header + live decision timeline driven by `/api/v1/streams/results`, with question/continuation forms, per-decision raw-JSON inspection, approvals, retries, and reruns.
215
+ 1. **Start** — large hero prompt with attached MCP/app chips. Submits to `/api/v1/agent`.
216
+ 2. **Simple / Detailed** — compact header + live decision timeline driven by `/api/v1/streams/results`, with question/continuation forms, per-decision raw-JSON inspection, approvals, retries, and reruns.
217
+ 3. **Chat** — the same run as a conversation: the user's messages, the steps the agent took (collapsed once done), its questions with one-click replies, credentials to connect, and its answers. The composer starts a run, answers the agent, or continues a finished run.
217
218
 
218
219
  It switches modes automatically when an execution starts, or when `?execution_id=...&authorization=...` is present in the URL.
219
220
 
@@ -250,10 +251,28 @@ Useful props:
250
251
  | `compact` / `hideHeroIcon` / `hideAppPicker` / `hideAttach` | `boolean` | Layout switches for embedding |
251
252
  | `maxWidth` | `number` | Max width of the centered card. Default `900` |
252
253
  | `onRun` | `(info) => void` | Fires whenever a run finishes (success or failure) |
254
+ | `initialView` | `'start' \| 'simple' \| 'detailed' \| 'chat'` | View to open on mount. `'chat'` opens the Chat tab, without the Start form, and keeps the tabs visible before the first run |
255
+ | `workflowId` | `string` | Workflow the agent works on (edit-workflow skill). In Chat it also enables "Revert" and the workflow events below |
253
256
  | `className` / `sx` / `contentSx` | `string` / `SxProps` | Style overrides for the root container and inner content column |
254
257
 
255
258
  Reference page in production: [`src/pages/dashboard/AgentsPage.tsx`](../pages/dashboard/AgentsPage.tsx) (mounted at [`/agents`](https://shuffle.security/agents)).
256
259
 
260
+ When the Chat tab changes or runs a workflow it sends window events, so a page showing that workflow can keep its canvas in sync. Without a listener the chat still works. Runs the agent starts also get a card in the chat showing each node's status as the engine recorded it.
261
+
262
+ | Event | `detail` | Sent when |
263
+ |---|---|---|
264
+ | `AGENT_WORKFLOW_CHANGED_EVENT` | `{ workflowId, nodeIds, reverted? }` | An agent edit to the workflow finished, or the user reverted the chat's changes |
265
+ | `AGENT_FOCUS_NODE_EVENT` | `{ workflowId, nodeId }` | The user clicked a changed node in the chat |
266
+ | `AGENT_OPEN_EXECUTION_EVENT` | `{ workflowId, executionId, authorization }` | The agent started a workflow run, or the user clicked "Open in debug view" (only sent when `workflowId` is set) |
267
+
268
+ ```tsx
269
+ import { AGENT_WORKFLOW_CHANGED_EVENT } from 'shuffle-mcps';
270
+
271
+ window.addEventListener(AGENT_WORKFLOW_CHANGED_EVENT, (e) => {
272
+ if (e.detail.workflowId === workflow.id) reloadWorkflow();
273
+ });
274
+ ```
275
+
257
276
  ### 5. `<AgentRunDrawer />` — Run Agent side panel
258
277
 
259
278
  Right-side drawer that embeds `<AgentUI />` in compact mode, with optional **Permissions** and **Local LLM** tabs you fill via slots. Zero host-app context required — pass `apiKey` / `apiBaseUrl` / `orgId` through `agentUIProps` to authenticate.
@@ -2,7 +2,7 @@ import {
2
2
  fetchApps,
3
3
  fetchAppsViaApiConfig,
4
4
  invalidateAppsCache
5
- } from "./chunk-V3R4HDJT.mjs";
5
+ } from "./chunk-TAHB4QZU.mjs";
6
6
  export {
7
7
  fetchApps,
8
8
  fetchAppsViaApiConfig,
@@ -612,10 +612,30 @@ var isShuffleCloudDomain = (url) => {
612
612
  return false;
613
613
  }
614
614
  };
615
+ var isOnShufflerIoHost = () => {
616
+ if (typeof window === "undefined") return false;
617
+ const host = window.location.hostname.toLowerCase();
618
+ if (host === "security.shuffler.io") return false;
619
+ return host === "shuffler.io" || host.endsWith(".shuffler.io");
620
+ };
615
621
  var mapCloudRegionUrl = (url) => {
616
622
  if (!url || typeof url !== "string") return "";
617
623
  const trimmed = url.trim();
618
624
  if (!trimmed) return "";
625
+ if (isOnShufflerIoHost()) {
626
+ try {
627
+ const parsed = new URL(/^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(trimmed) ? trimmed : `https://${trimmed}`);
628
+ const h = parsed.hostname.toLowerCase();
629
+ if (h === "shuffle.security" || h === "www.shuffle.security") {
630
+ parsed.hostname = "shuffler.io";
631
+ } else if (h.endsWith(".shuffle.security")) {
632
+ parsed.hostname = `${h.slice(0, -".shuffle.security".length)}.shuffler.io`;
633
+ }
634
+ return parsed.toString().replace(/\/+$/, "");
635
+ } catch {
636
+ return trimmed.replace(/\/+$/, "");
637
+ }
638
+ }
619
639
  const hasScheme = /^[a-zA-Z][a-zA-Z\d+\-.]*:\/\//.test(trimmed);
620
640
  const toParse = hasScheme ? trimmed : `https://${trimmed}`;
621
641
  try {
@@ -675,6 +695,7 @@ var getDefaultBaseUrl = () => {
675
695
  if (customHost) return customHost;
676
696
  return PROD_BACKEND;
677
697
  }
698
+ if (isOnShufflerIoHost()) return window.location.origin;
678
699
  if (isCloudDomain()) return PROD_BACKEND;
679
700
  if (typeof window !== "undefined") {
680
701
  return window.location.origin;
@@ -818,7 +839,9 @@ var resetRegionUrl = () => {
818
839
  var SHUFFLE_HOST_BASE_URL_EVENT = "shuffle:set-host-base-url";
819
840
  var setHostBaseUrl = (url) => {
820
841
  let next = url ? url.replace(/\/+$/, "") : null;
821
- if (next && isShuffleCloudDomain(next) && !isDevEnvironment()) next = null;
842
+ if (next && isShuffleCloudDomain(next) && !isDevEnvironment()) {
843
+ next = isOnShufflerIoHost() ? mapCloudRegionUrl(next) || null : null;
844
+ }
822
845
  if (next === _hostBaseUrl) return;
823
846
  _hostBaseUrl = next;
824
847
  if (next) {
@@ -856,7 +879,13 @@ var clearAuthTokens = () => {
856
879
  var getSessionToken = () => {
857
880
  try {
858
881
  if (typeof localStorage === "undefined") return null;
859
- if (localStorage.getItem(LEGACY_API_KEY_STORAGE_KEY) !== null) {
882
+ const legacy = localStorage.getItem(LEGACY_API_KEY_STORAGE_KEY);
883
+ if (legacy !== null) {
884
+ const current = localStorage.getItem("session_token");
885
+ const legacyValid = legacy.trim().length > 0 && legacy !== "null" && legacy !== "undefined";
886
+ if (legacyValid && (!current || current === "null" || current === "undefined")) {
887
+ localStorage.setItem("session_token", legacy.trim());
888
+ }
860
889
  localStorage.removeItem(LEGACY_API_KEY_STORAGE_KEY);
861
890
  }
862
891
  const stored = localStorage.getItem("session_token");
package/dist/index.d.mts CHANGED
@@ -489,6 +489,8 @@ interface AgentUIApp {
489
489
  /** Optional preview icon URL. */
490
490
  icon?: string;
491
491
  }
492
+ /** Top-level views of AgentUI. */
493
+ type AgentUIView = 'start' | 'simple' | 'detailed' | 'chat';
492
494
  interface AgentUIProps {
493
495
  /** Optional React key to force re-mounting when context changes */
494
496
  key?: React__default.Key;
@@ -617,7 +619,7 @@ interface AgentUIProps {
617
619
  };
618
620
  [k: string]: any;
619
621
  };
620
- /** Called whenever a run finishes (success or failure). */
622
+ /** Called once the request to start a run returns: success with the new execution, or the error it failed to start with. */
621
623
  onRun?: (info: {
622
624
  input: string;
623
625
  success: boolean;
@@ -625,10 +627,32 @@ interface AgentUIProps {
625
627
  authorization?: string;
626
628
  error?: string;
627
629
  }) => void;
630
+ /** Awaited before a run starts or continues, e.g. so the host can save its unsaved changes first. */
631
+ onBeforeRun?: () => void | Promise<void>;
632
+ /**
633
+ * Called when the shown run's status changes. `previousStatus` is the status this
634
+ * same run had before, so it is missing for a run that was just opened or started.
635
+ * `status` is empty once no run is shown (e.g. after stopping one that never started).
636
+ * `waiting` is true while the agent waits for the user (a question or an approval);
637
+ * the run itself still counts as running then.
638
+ */
639
+ onRunStatusChange?: (info: {
640
+ executionId: string;
641
+ status: string;
642
+ previousStatus?: string;
643
+ running: boolean;
644
+ waiting: boolean;
645
+ }) => void;
628
646
  /** Called whenever the chip set under the prompt changes (add/remove apps). */
629
647
  onAppsChange?: (apps: AgentUIApp[]) => void;
630
- /** Called whenever the active top-level view changes (start / simple / detailed). */
631
- onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
648
+ /** Called whenever the active top-level view changes (start / simple / detailed / chat). */
649
+ onViewChange?: (view: AgentUIView) => void;
650
+ /**
651
+ * View to open on mount. 'chat' shows the run as a conversation and lets the
652
+ * user start, answer and continue runs from there. When omitted, the stored
653
+ * Simple/Detailed preference is used (unchanged behaviour).
654
+ */
655
+ initialView?: AgentUIView;
632
656
  /**
633
657
  * Called when the user saves a recurring schedule (cron expression) for the
634
658
  * current prompt. When omitted, a toast is shown indicating scheduling is
@@ -755,6 +779,29 @@ interface AppDetailDrawerRenderProps {
755
779
  /** Set of confirmed live built-in Shuffle services that are always available in the platform */
756
780
  declare const VERIFIED_BUILTIN_APPS: Set<string>;
757
781
 
782
+ /** Sent by the chat when the agent changed a workflow. Hosts showing that
783
+ * workflow can reload it and highlight the nodes. */
784
+ declare const AGENT_WORKFLOW_CHANGED_EVENT = "shuffle:agent_workflow_changed";
785
+ type AgentWorkflowChangedDetail = {
786
+ workflowId: string;
787
+ nodeIds: string[];
788
+ reverted?: boolean;
789
+ };
790
+ /** Sent when the user asks to see a node the agent touched. */
791
+ declare const AGENT_FOCUS_NODE_EVENT = "shuffle:agent_focus_node";
792
+ type AgentFocusNodeDetail = {
793
+ workflowId: string;
794
+ nodeId: string;
795
+ };
796
+ /** Sent when the agent started a workflow run, or the user asks to see it.
797
+ * Hosts showing that workflow can open the run in their own run view. */
798
+ declare const AGENT_OPEN_EXECUTION_EVENT = "shuffle:agent_open_execution";
799
+ type AgentOpenExecutionDetail = {
800
+ workflowId: string;
801
+ executionId: string;
802
+ authorization: string;
803
+ };
804
+
758
805
  interface AgentPromptPrefixChipProps {
759
806
  /** Optional label override. Defaults to "Shuffle Tools MCP". */
760
807
  label?: string;
@@ -971,7 +1018,7 @@ interface PageContextChoice {
971
1018
  executionId?: string | null;
972
1019
  authorization?: string | null;
973
1020
  executionStatus?: string | null;
974
- viewMode?: 'start' | 'simple' | 'detailed' | null;
1021
+ viewMode?: 'start' | 'simple' | 'detailed' | 'chat' | null;
975
1022
  updatedAt: number;
976
1023
  }
977
1024
  /** Match a URL pathname against a route pattern with `:param` segments */
@@ -1085,6 +1132,10 @@ interface AskAiSidePanelProps extends ShuffleHostProps {
1085
1132
  rules?: AgentContextRule[];
1086
1133
  /** Authoritative support user flag */
1087
1134
  isSupport?: boolean;
1135
+ /** Distance in px from the right edge of the screen, for hosts that dock their own panel there. Default 0. */
1136
+ rightOffset?: number;
1137
+ /** Keep the agent mounted while the panel is closed, e.g. so a run in progress is still followed. Default false. */
1138
+ keepMounted?: boolean;
1088
1139
  /** Panel width in pixels. Default: 380 */
1089
1140
  width?: number;
1090
1141
  /** Theme override forwarded to AgentUI */
@@ -1202,15 +1253,6 @@ interface ApiCallViewerProps extends ShuffleHostProps {
1202
1253
 
1203
1254
  /** Check if a URL belongs to a Shuffle Cloud domain (*.shuffler.io or *.shuffle.security) */
1204
1255
  declare const isShuffleCloudDomain: (url?: string | null) => boolean;
1205
- /**
1206
- * Maps legacy shuffler.io cloud URLs to shuffle.security redirect routes.
1207
- *
1208
- * Mapping rules:
1209
- * - shuffler.io / shuffle.security -> https://uk.shuffle.security (default cloud backend)
1210
- * - <subdomain>.shuffler.io -> https://<subdomain>.shuffle.security (e.g. ca, us, eu, au, uk, frankfurt)
1211
- * - <subdomain>.shuffle.security -> preserved as https://<subdomain>.shuffle.security
1212
- * - Self-hosted / on-prem / dev URLs -> preserved as-is
1213
- */
1214
1256
  declare const mapCloudRegionUrl: (url?: string | null) => string;
1215
1257
  /** Check if running on a known Shuffle Cloud domain */
1216
1258
  declare const isCloudDomain: () => boolean;
@@ -2097,6 +2139,7 @@ declare const DATASTORE_CATEGORIES: {
2097
2139
  readonly INFRASTRUCTURE: "shuffle-security_infrastructure";
2098
2140
  readonly USERS: "shuffle-security_users";
2099
2141
  readonly REPORTS: "shuffle-security_reports";
2142
+ readonly DASHBOARDS: "shuffle-security_dashboards";
2100
2143
  readonly LEGACY_ALERTS: "shuffle-security_alerts";
2101
2144
  readonly LEGACY_CASES: "shuffle-security_cases";
2102
2145
  };
@@ -2375,7 +2418,8 @@ declare function openSupportEscalation(context: SupportEscalationContext): void;
2375
2418
  type ShuffleTheme = 'light' | 'dark' | 'system';
2376
2419
  type WithTheme<P> = P & {
2377
2420
  theme?: ShuffleTheme;
2378
- colorMode?: ShuffleMcpColorMode;
2421
+ colorMode?: ShuffleMcpColorMode; /** Backend base URL. On *.shuffler.io hosts it always wins; on Shuffle Cloud elsewhere only self-hosted URLs are honored. */
2422
+ globalUrl?: string;
2379
2423
  };
2380
2424
 
2381
2425
  declare const AiAgentPromptsEditor: React.ComponentType<WithTheme<P>>;
@@ -2413,4 +2457,4 @@ declare const AgentsView: React.ComponentType<WithTheme<P>>;
2413
2457
  declare const AgentRunDiagnosisBanner: React.ComponentType<WithTheme<P>>;
2414
2458
  declare const LocalLLMConfig: React.ComponentType<WithTheme<P>>;
2415
2459
 
2416
- export { AGENT_DRAWER_CLOSE_EVENT, AGENT_DRAWER_OPEN_EVENT, AGENT_DRAWER_STATE_EVENT, AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, ASK_AI_PANEL_WIDTH_STORAGE_KEY, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentContextApp, type AgentContextRule, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, type AgentResolvedContext, 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, type ApiCallConfig, ApiCallViewer, type ApiCallViewerProps, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, type AppDetailDrawerRenderProps, AppDetailProvider, type AppLookupResult, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, AskAiButton, type AskAiButtonProps, AskAiDrawer, type AskAiDrawerProps, AskAiSidePanel, type AskAiSidePanelProps, AskAiWidget, type AskAiWidgetProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type ConnectedToolApp, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_CONTEXT_RULES, DEFAULT_AGENT_PROMPT_PREFIX, DEMO_AGENT_RUNS, 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, LocalLLMConfig, type LocalLLMConfigProps, type LocalLLMTestResult, MAX_ASK_AI_PANEL_WIDTH, MAX_AUTO_ASSIGNED_TOOLS, MIN_ASK_AI_PANEL_WIDTH, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type PageContextChoice, type ResolvedApp, type ResolvedContactUserInfo, SIEM_PATTERNS, type ShuffleHostProps, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, ShufflePipelinesBanner, type ShuffleTheme, type ShuffleTokenStyle, SingulActionsPreview, type SupportEscalationContext, THREAT_INTEL_PATTERNS, type ToolDrawerRenderProps, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VERIFIED_BUILTIN_APPS, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, buildSupportEscalationUrl, clearPageContextChoice, copyToClipboard, darkTokenStyle, AgentsView as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, ensureShuffleMcpStyles, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fallbackCopyText as fallbackCopyToClipboard, fetchApps, fetchAppsViaApiConfig, fetchConnectedTools, filterItemsByCategory, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getActivePageEntityName, getAgentContextRules, getApiUrl, getAuthHeader, getCachedConnectedTools, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, getPageContextChoice, hasOutputWarning, installClipboardPolyfill, installCryptoRandomUuidPolyfill, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isAgentRoute, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isShuffleCloudDomain, isShuffleSecurityBackend, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, lightTokenStyle, mapCloudRegionUrl, matchRoutePattern, mergeConnectedTools, normalizeAppName, openSupportEscalation, parseRunResult, refreshAllIntegrationStatus, registerAgentContextRule, registerProtectedOrigin, resetRegionUrl, resolveAgentContext, resolveApp, resolveApps, resolveConnectedTools, resolveContactUserInfo, resolveVideoUrl, safeRandomUUID, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setCachedConnectedTools, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setPageContextChoice, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useContextAwareAgent, useSyncHostBaseUrl, uuid };
2460
+ export { AGENT_DRAWER_CLOSE_EVENT, AGENT_DRAWER_OPEN_EVENT, AGENT_DRAWER_STATE_EVENT, AGENT_FOCUS_NODE_EVENT, AGENT_OPEN_EXECUTION_EVENT, AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, AGENT_WORKFLOW_CHANGED_EVENT, API_CONFIG, ASK_AI_PANEL_WIDTH_STORAGE_KEY, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentContextApp, type AgentContextRule, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentFocusNodeDetail, AgentIcon, type AgentLocalModel, type AgentOpenExecutionDetail, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, type AgentResolvedContext, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, type AgentUIView, type AgentWorkflowChangedDetail, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, type ApiCallConfig, ApiCallViewer, type ApiCallViewerProps, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, type AppDetailDrawerRenderProps, AppDetailProvider, type AppLookupResult, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, AskAiButton, type AskAiButtonProps, AskAiDrawer, type AskAiDrawerProps, AskAiSidePanel, type AskAiSidePanelProps, AskAiWidget, type AskAiWidgetProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type ConnectedToolApp, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_CONTEXT_RULES, DEFAULT_AGENT_PROMPT_PREFIX, DEMO_AGENT_RUNS, 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, LocalLLMConfig, type LocalLLMConfigProps, type LocalLLMTestResult, MAX_ASK_AI_PANEL_WIDTH, MAX_AUTO_ASSIGNED_TOOLS, MIN_ASK_AI_PANEL_WIDTH, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type PageContextChoice, type ResolvedApp, type ResolvedContactUserInfo, SIEM_PATTERNS, type ShuffleHostProps, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, ShufflePipelinesBanner, type ShuffleTheme, type ShuffleTokenStyle, SingulActionsPreview, type SupportEscalationContext, THREAT_INTEL_PATTERNS, type ToolDrawerRenderProps, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VERIFIED_BUILTIN_APPS, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, buildSupportEscalationUrl, clearPageContextChoice, copyToClipboard, darkTokenStyle, AgentsView as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, ensureShuffleMcpStyles, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fallbackCopyText as fallbackCopyToClipboard, fetchApps, fetchAppsViaApiConfig, fetchConnectedTools, filterItemsByCategory, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getActivePageEntityName, getAgentContextRules, getApiUrl, getAuthHeader, getCachedConnectedTools, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, getPageContextChoice, hasOutputWarning, installClipboardPolyfill, installCryptoRandomUuidPolyfill, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isAgentRoute, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isShuffleCloudDomain, isShuffleSecurityBackend, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, lightTokenStyle, mapCloudRegionUrl, matchRoutePattern, mergeConnectedTools, normalizeAppName, openSupportEscalation, parseRunResult, refreshAllIntegrationStatus, registerAgentContextRule, registerProtectedOrigin, resetRegionUrl, resolveAgentContext, resolveApp, resolveApps, resolveConnectedTools, resolveContactUserInfo, resolveVideoUrl, safeRandomUUID, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setCachedConnectedTools, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setPageContextChoice, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useContextAwareAgent, useSyncHostBaseUrl, uuid };
package/dist/index.d.ts CHANGED
@@ -489,6 +489,8 @@ interface AgentUIApp {
489
489
  /** Optional preview icon URL. */
490
490
  icon?: string;
491
491
  }
492
+ /** Top-level views of AgentUI. */
493
+ type AgentUIView = 'start' | 'simple' | 'detailed' | 'chat';
492
494
  interface AgentUIProps {
493
495
  /** Optional React key to force re-mounting when context changes */
494
496
  key?: React__default.Key;
@@ -617,7 +619,7 @@ interface AgentUIProps {
617
619
  };
618
620
  [k: string]: any;
619
621
  };
620
- /** Called whenever a run finishes (success or failure). */
622
+ /** Called once the request to start a run returns: success with the new execution, or the error it failed to start with. */
621
623
  onRun?: (info: {
622
624
  input: string;
623
625
  success: boolean;
@@ -625,10 +627,32 @@ interface AgentUIProps {
625
627
  authorization?: string;
626
628
  error?: string;
627
629
  }) => void;
630
+ /** Awaited before a run starts or continues, e.g. so the host can save its unsaved changes first. */
631
+ onBeforeRun?: () => void | Promise<void>;
632
+ /**
633
+ * Called when the shown run's status changes. `previousStatus` is the status this
634
+ * same run had before, so it is missing for a run that was just opened or started.
635
+ * `status` is empty once no run is shown (e.g. after stopping one that never started).
636
+ * `waiting` is true while the agent waits for the user (a question or an approval);
637
+ * the run itself still counts as running then.
638
+ */
639
+ onRunStatusChange?: (info: {
640
+ executionId: string;
641
+ status: string;
642
+ previousStatus?: string;
643
+ running: boolean;
644
+ waiting: boolean;
645
+ }) => void;
628
646
  /** Called whenever the chip set under the prompt changes (add/remove apps). */
629
647
  onAppsChange?: (apps: AgentUIApp[]) => void;
630
- /** Called whenever the active top-level view changes (start / simple / detailed). */
631
- onViewChange?: (view: 'start' | 'simple' | 'detailed') => void;
648
+ /** Called whenever the active top-level view changes (start / simple / detailed / chat). */
649
+ onViewChange?: (view: AgentUIView) => void;
650
+ /**
651
+ * View to open on mount. 'chat' shows the run as a conversation and lets the
652
+ * user start, answer and continue runs from there. When omitted, the stored
653
+ * Simple/Detailed preference is used (unchanged behaviour).
654
+ */
655
+ initialView?: AgentUIView;
632
656
  /**
633
657
  * Called when the user saves a recurring schedule (cron expression) for the
634
658
  * current prompt. When omitted, a toast is shown indicating scheduling is
@@ -755,6 +779,29 @@ interface AppDetailDrawerRenderProps {
755
779
  /** Set of confirmed live built-in Shuffle services that are always available in the platform */
756
780
  declare const VERIFIED_BUILTIN_APPS: Set<string>;
757
781
 
782
+ /** Sent by the chat when the agent changed a workflow. Hosts showing that
783
+ * workflow can reload it and highlight the nodes. */
784
+ declare const AGENT_WORKFLOW_CHANGED_EVENT = "shuffle:agent_workflow_changed";
785
+ type AgentWorkflowChangedDetail = {
786
+ workflowId: string;
787
+ nodeIds: string[];
788
+ reverted?: boolean;
789
+ };
790
+ /** Sent when the user asks to see a node the agent touched. */
791
+ declare const AGENT_FOCUS_NODE_EVENT = "shuffle:agent_focus_node";
792
+ type AgentFocusNodeDetail = {
793
+ workflowId: string;
794
+ nodeId: string;
795
+ };
796
+ /** Sent when the agent started a workflow run, or the user asks to see it.
797
+ * Hosts showing that workflow can open the run in their own run view. */
798
+ declare const AGENT_OPEN_EXECUTION_EVENT = "shuffle:agent_open_execution";
799
+ type AgentOpenExecutionDetail = {
800
+ workflowId: string;
801
+ executionId: string;
802
+ authorization: string;
803
+ };
804
+
758
805
  interface AgentPromptPrefixChipProps {
759
806
  /** Optional label override. Defaults to "Shuffle Tools MCP". */
760
807
  label?: string;
@@ -971,7 +1018,7 @@ interface PageContextChoice {
971
1018
  executionId?: string | null;
972
1019
  authorization?: string | null;
973
1020
  executionStatus?: string | null;
974
- viewMode?: 'start' | 'simple' | 'detailed' | null;
1021
+ viewMode?: 'start' | 'simple' | 'detailed' | 'chat' | null;
975
1022
  updatedAt: number;
976
1023
  }
977
1024
  /** Match a URL pathname against a route pattern with `:param` segments */
@@ -1085,6 +1132,10 @@ interface AskAiSidePanelProps extends ShuffleHostProps {
1085
1132
  rules?: AgentContextRule[];
1086
1133
  /** Authoritative support user flag */
1087
1134
  isSupport?: boolean;
1135
+ /** Distance in px from the right edge of the screen, for hosts that dock their own panel there. Default 0. */
1136
+ rightOffset?: number;
1137
+ /** Keep the agent mounted while the panel is closed, e.g. so a run in progress is still followed. Default false. */
1138
+ keepMounted?: boolean;
1088
1139
  /** Panel width in pixels. Default: 380 */
1089
1140
  width?: number;
1090
1141
  /** Theme override forwarded to AgentUI */
@@ -1202,15 +1253,6 @@ interface ApiCallViewerProps extends ShuffleHostProps {
1202
1253
 
1203
1254
  /** Check if a URL belongs to a Shuffle Cloud domain (*.shuffler.io or *.shuffle.security) */
1204
1255
  declare const isShuffleCloudDomain: (url?: string | null) => boolean;
1205
- /**
1206
- * Maps legacy shuffler.io cloud URLs to shuffle.security redirect routes.
1207
- *
1208
- * Mapping rules:
1209
- * - shuffler.io / shuffle.security -> https://uk.shuffle.security (default cloud backend)
1210
- * - <subdomain>.shuffler.io -> https://<subdomain>.shuffle.security (e.g. ca, us, eu, au, uk, frankfurt)
1211
- * - <subdomain>.shuffle.security -> preserved as https://<subdomain>.shuffle.security
1212
- * - Self-hosted / on-prem / dev URLs -> preserved as-is
1213
- */
1214
1256
  declare const mapCloudRegionUrl: (url?: string | null) => string;
1215
1257
  /** Check if running on a known Shuffle Cloud domain */
1216
1258
  declare const isCloudDomain: () => boolean;
@@ -2097,6 +2139,7 @@ declare const DATASTORE_CATEGORIES: {
2097
2139
  readonly INFRASTRUCTURE: "shuffle-security_infrastructure";
2098
2140
  readonly USERS: "shuffle-security_users";
2099
2141
  readonly REPORTS: "shuffle-security_reports";
2142
+ readonly DASHBOARDS: "shuffle-security_dashboards";
2100
2143
  readonly LEGACY_ALERTS: "shuffle-security_alerts";
2101
2144
  readonly LEGACY_CASES: "shuffle-security_cases";
2102
2145
  };
@@ -2375,7 +2418,8 @@ declare function openSupportEscalation(context: SupportEscalationContext): void;
2375
2418
  type ShuffleTheme = 'light' | 'dark' | 'system';
2376
2419
  type WithTheme<P> = P & {
2377
2420
  theme?: ShuffleTheme;
2378
- colorMode?: ShuffleMcpColorMode;
2421
+ colorMode?: ShuffleMcpColorMode; /** Backend base URL. On *.shuffler.io hosts it always wins; on Shuffle Cloud elsewhere only self-hosted URLs are honored. */
2422
+ globalUrl?: string;
2379
2423
  };
2380
2424
 
2381
2425
  declare const AiAgentPromptsEditor: React.ComponentType<WithTheme<P>>;
@@ -2413,4 +2457,4 @@ declare const AgentsView: React.ComponentType<WithTheme<P>>;
2413
2457
  declare const AgentRunDiagnosisBanner: React.ComponentType<WithTheme<P>>;
2414
2458
  declare const LocalLLMConfig: React.ComponentType<WithTheme<P>>;
2415
2459
 
2416
- export { AGENT_DRAWER_CLOSE_EVENT, AGENT_DRAWER_OPEN_EVENT, AGENT_DRAWER_STATE_EVENT, AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, ASK_AI_PANEL_WIDTH_STORAGE_KEY, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentContextApp, type AgentContextRule, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, type AgentResolvedContext, 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, type ApiCallConfig, ApiCallViewer, type ApiCallViewerProps, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, type AppDetailDrawerRenderProps, AppDetailProvider, type AppLookupResult, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, AskAiButton, type AskAiButtonProps, AskAiDrawer, type AskAiDrawerProps, AskAiSidePanel, type AskAiSidePanelProps, AskAiWidget, type AskAiWidgetProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type ConnectedToolApp, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_CONTEXT_RULES, DEFAULT_AGENT_PROMPT_PREFIX, DEMO_AGENT_RUNS, 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, LocalLLMConfig, type LocalLLMConfigProps, type LocalLLMTestResult, MAX_ASK_AI_PANEL_WIDTH, MAX_AUTO_ASSIGNED_TOOLS, MIN_ASK_AI_PANEL_WIDTH, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type PageContextChoice, type ResolvedApp, type ResolvedContactUserInfo, SIEM_PATTERNS, type ShuffleHostProps, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, ShufflePipelinesBanner, type ShuffleTheme, type ShuffleTokenStyle, SingulActionsPreview, type SupportEscalationContext, THREAT_INTEL_PATTERNS, type ToolDrawerRenderProps, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VERIFIED_BUILTIN_APPS, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, buildSupportEscalationUrl, clearPageContextChoice, copyToClipboard, darkTokenStyle, AgentsView as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, ensureShuffleMcpStyles, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fallbackCopyText as fallbackCopyToClipboard, fetchApps, fetchAppsViaApiConfig, fetchConnectedTools, filterItemsByCategory, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getActivePageEntityName, getAgentContextRules, getApiUrl, getAuthHeader, getCachedConnectedTools, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, getPageContextChoice, hasOutputWarning, installClipboardPolyfill, installCryptoRandomUuidPolyfill, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isAgentRoute, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isShuffleCloudDomain, isShuffleSecurityBackend, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, lightTokenStyle, mapCloudRegionUrl, matchRoutePattern, mergeConnectedTools, normalizeAppName, openSupportEscalation, parseRunResult, refreshAllIntegrationStatus, registerAgentContextRule, registerProtectedOrigin, resetRegionUrl, resolveAgentContext, resolveApp, resolveApps, resolveConnectedTools, resolveContactUserInfo, resolveVideoUrl, safeRandomUUID, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setCachedConnectedTools, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setPageContextChoice, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useContextAwareAgent, useSyncHostBaseUrl, uuid };
2460
+ export { AGENT_DRAWER_CLOSE_EVENT, AGENT_DRAWER_OPEN_EVENT, AGENT_DRAWER_STATE_EVENT, AGENT_FOCUS_NODE_EVENT, AGENT_OPEN_EXECUTION_EVENT, AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, AGENT_WORKFLOW_CHANGED_EVENT, API_CONFIG, ASK_AI_PANEL_WIDTH_STORAGE_KEY, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentContextApp, type AgentContextRule, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, type AgentFocusNodeDetail, AgentIcon, type AgentLocalModel, type AgentOpenExecutionDetail, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, type AgentResolvedContext, type AgentRun, AgentRunDiagnosisBanner, AgentRunDrawer, type AgentRunDrawerProps, type AgentRunDrawerTab, type AgentRunResult, AgentUI, type AgentUIApp, type AgentUIProps, type AgentUIView, type AgentWorkflowChangedDetail, AgentsView, type AgentsViewProps, AiAgentPromptsEditor, type AiAgentPromptsEditorProps, type AlgoliaSearchApp, type ApiAuthEntry, type ApiCallConfig, ApiCallViewer, type ApiCallViewerProps, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, type AppDetailDrawerRenderProps, AppDetailProvider, type AppLookupResult, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, AskAiButton, type AskAiButtonProps, AskAiDrawer, type AskAiDrawerProps, AskAiSidePanel, type AskAiSidePanelProps, AskAiWidget, type AskAiWidgetProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type ConnectedToolApp, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_CONTEXT_RULES, DEFAULT_AGENT_PROMPT_PREFIX, DEMO_AGENT_RUNS, 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, LocalLLMConfig, type LocalLLMConfigProps, type LocalLLMTestResult, MAX_ASK_AI_PANEL_WIDTH, MAX_AUTO_ASSIGNED_TOOLS, MIN_ASK_AI_PANEL_WIDTH, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type PageContextChoice, type ResolvedApp, type ResolvedContactUserInfo, SIEM_PATTERNS, type ShuffleHostProps, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, ShufflePipelinesBanner, type ShuffleTheme, type ShuffleTokenStyle, SingulActionsPreview, type SupportEscalationContext, THREAT_INTEL_PATTERNS, type ToolDrawerRenderProps, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VERIFIED_BUILTIN_APPS, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, buildSupportEscalationUrl, clearPageContextChoice, copyToClipboard, darkTokenStyle, AgentsView as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, ensureShuffleMcpStyles, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fallbackCopyText as fallbackCopyToClipboard, fetchApps, fetchAppsViaApiConfig, fetchConnectedTools, filterItemsByCategory, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getActivePageEntityName, getAgentContextRules, getApiUrl, getAuthHeader, getCachedConnectedTools, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, getPageContextChoice, hasOutputWarning, installClipboardPolyfill, installCryptoRandomUuidPolyfill, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isAgentRoute, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isShuffleCloudDomain, isShuffleSecurityBackend, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, lightTokenStyle, mapCloudRegionUrl, matchRoutePattern, mergeConnectedTools, normalizeAppName, openSupportEscalation, parseRunResult, refreshAllIntegrationStatus, registerAgentContextRule, registerProtectedOrigin, resetRegionUrl, resolveAgentContext, resolveApp, resolveApps, resolveConnectedTools, resolveContactUserInfo, resolveVideoUrl, safeRandomUUID, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setCachedConnectedTools, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setPageContextChoice, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useContextAwareAgent, useSyncHostBaseUrl, uuid };