@shuffleio/shuffle-mcps 0.0.35 → 0.0.37
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/{appsCache-PP55YC62.mjs → appsCache-H7SZLNQW.mjs} +1 -1
- package/dist/{chunk-5B3Q2RHS.mjs → chunk-5ZQ2BL47.mjs} +87 -10
- package/dist/index.d.mts +97 -3
- package/dist/index.d.ts +97 -3
- package/dist/index.js +5328 -3519
- package/dist/index.mjs +4826 -3096
- package/package.json +3 -2
|
@@ -50,6 +50,30 @@ var keyFor = (input, init) => {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var withStoredApiKey = (input, init) => {
|
|
54
|
+
if (typeof window === "undefined") return init;
|
|
55
|
+
let urlStr;
|
|
56
|
+
if (typeof input === "string") urlStr = input;
|
|
57
|
+
else if (input instanceof URL) urlStr = input.toString();
|
|
58
|
+
else if (input && typeof input.url === "string") urlStr = input.url;
|
|
59
|
+
else return init;
|
|
60
|
+
try {
|
|
61
|
+
const url = new URL(urlStr, window.location.href);
|
|
62
|
+
const isKnownShuffleOrigin = allowedOrigins.has(url.origin) || url.origin === window.location.origin || url.hostname === "shuffler.io" || url.hostname.endsWith(".shuffler.io") || url.hostname === "tunnel.schemaless.org";
|
|
63
|
+
if (!url.pathname.startsWith("/api/") || !isKnownShuffleOrigin) return init;
|
|
64
|
+
const apiKey = window.localStorage.getItem("shuffle_api_key");
|
|
65
|
+
if (!apiKey) return init;
|
|
66
|
+
const requestHeaders = typeof Request !== "undefined" && input instanceof Request ? input.headers : void 0;
|
|
67
|
+
const headers = new Headers(requestHeaders);
|
|
68
|
+
if (init?.headers) {
|
|
69
|
+
new Headers(init.headers).forEach((value, name) => headers.set(name, value));
|
|
70
|
+
}
|
|
71
|
+
if (!headers.has("Authorization")) headers.set("Authorization", `Bearer ${apiKey}`);
|
|
72
|
+
return { ...init, headers };
|
|
73
|
+
} catch {
|
|
74
|
+
return init;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
53
77
|
var synthetic503 = (key, retryInMs) => new Response(
|
|
54
78
|
JSON.stringify({
|
|
55
79
|
error: "circuit_breaker_open",
|
|
@@ -75,8 +99,9 @@ var installFetchBreaker = () => {
|
|
|
75
99
|
installed = true;
|
|
76
100
|
const original = window.fetch.bind(window);
|
|
77
101
|
window.fetch = (async (input, init) => {
|
|
78
|
-
const
|
|
79
|
-
|
|
102
|
+
const authenticatedInit = withStoredApiKey(input, init);
|
|
103
|
+
const key = keyFor(input, authenticatedInit);
|
|
104
|
+
if (!key) return original(input, authenticatedInit);
|
|
80
105
|
const entry = getEntry(key);
|
|
81
106
|
const now = Date.now();
|
|
82
107
|
let isProbe = false;
|
|
@@ -110,7 +135,7 @@ var installFetchBreaker = () => {
|
|
|
110
135
|
};
|
|
111
136
|
let response;
|
|
112
137
|
try {
|
|
113
|
-
response = await original(input,
|
|
138
|
+
response = await original(input, authenticatedInit);
|
|
114
139
|
} catch (err) {
|
|
115
140
|
const ts = Date.now();
|
|
116
141
|
entry.failures.push(ts);
|
|
@@ -186,9 +211,54 @@ var getDefaultBaseUrl = () => {
|
|
|
186
211
|
}
|
|
187
212
|
return PROD_BACKEND;
|
|
188
213
|
};
|
|
189
|
-
var
|
|
190
|
-
var
|
|
214
|
+
var REGION_STORAGE_KEY = "shuffle_region_url";
|
|
215
|
+
var readCachedRegion = () => {
|
|
216
|
+
if (typeof window === "undefined") return { url: null, orgId: null };
|
|
217
|
+
try {
|
|
218
|
+
const raw = localStorage.getItem(REGION_STORAGE_KEY);
|
|
219
|
+
if (!raw) return { url: null, orgId: null };
|
|
220
|
+
const parsed = JSON.parse(raw);
|
|
221
|
+
return { url: parsed?.url || null, orgId: parsed?.orgId || null };
|
|
222
|
+
} catch {
|
|
223
|
+
return { url: null, orgId: null };
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
var cached = readCachedRegion();
|
|
227
|
+
var _regionUrl = cached.url;
|
|
228
|
+
var _trackedOrgId = cached.orgId;
|
|
191
229
|
var _hostBaseUrl = null;
|
|
230
|
+
var REGION_EVENT = "shuffle:region-url";
|
|
231
|
+
var _lastBroadcastUrl = cached.url;
|
|
232
|
+
var persistRegion = (url, orgId) => {
|
|
233
|
+
if (typeof window === "undefined") return;
|
|
234
|
+
const changed = url !== _lastBroadcastUrl;
|
|
235
|
+
_lastBroadcastUrl = url;
|
|
236
|
+
try {
|
|
237
|
+
if (url) localStorage.setItem(REGION_STORAGE_KEY, JSON.stringify({ url, orgId }));
|
|
238
|
+
else localStorage.removeItem(REGION_STORAGE_KEY);
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
if (!changed) return;
|
|
242
|
+
try {
|
|
243
|
+
window.dispatchEvent(new CustomEvent(REGION_EVENT, { detail: { url, orgId } }));
|
|
244
|
+
} catch {
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
if (typeof window !== "undefined") {
|
|
248
|
+
const sync = () => {
|
|
249
|
+
const next = readCachedRegion();
|
|
250
|
+
if (next.url !== _regionUrl) {
|
|
251
|
+
_regionUrl = next.url;
|
|
252
|
+
_lastBroadcastUrl = next.url;
|
|
253
|
+
console.log(`[API] Region URL synced to: ${_regionUrl || "default"}`);
|
|
254
|
+
}
|
|
255
|
+
_trackedOrgId = next.orgId;
|
|
256
|
+
};
|
|
257
|
+
window.addEventListener(REGION_EVENT, sync);
|
|
258
|
+
window.addEventListener("storage", (e) => {
|
|
259
|
+
if (e.key === REGION_STORAGE_KEY) sync();
|
|
260
|
+
});
|
|
261
|
+
}
|
|
192
262
|
var isShufflerSubdomain = (url) => {
|
|
193
263
|
try {
|
|
194
264
|
const parsed = new URL(url);
|
|
@@ -198,26 +268,32 @@ var isShufflerSubdomain = (url) => {
|
|
|
198
268
|
}
|
|
199
269
|
};
|
|
200
270
|
var setRegionUrl = (regionUrl, orgId) => {
|
|
201
|
-
if (isDevEnvironment()) {
|
|
202
|
-
_trackedOrgId = orgId || null;
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
271
|
_trackedOrgId = orgId || null;
|
|
206
272
|
if (regionUrl && isShufflerSubdomain(regionUrl)) {
|
|
207
273
|
const normalized = regionUrl.replace(/\/+$/, "");
|
|
208
274
|
if (normalized !== PROD_BACKEND) {
|
|
209
275
|
_regionUrl = normalized;
|
|
276
|
+
persistRegion(_regionUrl, _trackedOrgId);
|
|
210
277
|
console.log(`[API] Region URL set to: ${_regionUrl}`);
|
|
211
278
|
return;
|
|
212
279
|
}
|
|
213
280
|
}
|
|
214
281
|
_regionUrl = null;
|
|
282
|
+
persistRegion(null, _trackedOrgId);
|
|
283
|
+
};
|
|
284
|
+
var applyRegionFromPayload = (payload, orgIdOverride) => {
|
|
285
|
+
if (!payload || typeof payload !== "object") return null;
|
|
286
|
+
const orgId = orgIdOverride ?? payload?.active_org?.id ?? payload?.org_id ?? null;
|
|
287
|
+
const regionUrl = payload?.region_url || payload?.active_org?.region_url || null;
|
|
288
|
+
setRegionUrl(regionUrl, orgId);
|
|
289
|
+
return regionUrl;
|
|
215
290
|
};
|
|
216
291
|
var resetRegionUrl = () => {
|
|
217
292
|
if (_regionUrl) {
|
|
218
293
|
console.log(`[API] Region URL reset to default (org changed)`);
|
|
219
294
|
}
|
|
220
295
|
_regionUrl = null;
|
|
296
|
+
persistRegion(null, null);
|
|
221
297
|
};
|
|
222
298
|
var SHUFFLE_HOST_BASE_URL_EVENT = "shuffle:set-host-base-url";
|
|
223
299
|
var setHostBaseUrl = (url) => {
|
|
@@ -251,7 +327,7 @@ var getTrackedOrgId = () => _trackedOrgId;
|
|
|
251
327
|
var API_CONFIG = {
|
|
252
328
|
// Shuffle backend URL — host override beats region URL beats default.
|
|
253
329
|
get baseUrl() {
|
|
254
|
-
const url = _hostBaseUrl || _regionUrl || getDefaultBaseUrl();
|
|
330
|
+
const url = _hostBaseUrl || (isDevEnvironment() || getEnvVar("VITE_SHUFFLE_API_URL") ? getDefaultBaseUrl() : _regionUrl || getDefaultBaseUrl());
|
|
255
331
|
try {
|
|
256
332
|
registerProtectedOrigin(url);
|
|
257
333
|
} catch {
|
|
@@ -359,6 +435,7 @@ export {
|
|
|
359
435
|
isCloud,
|
|
360
436
|
isOnprem,
|
|
361
437
|
setRegionUrl,
|
|
438
|
+
applyRegionFromPayload,
|
|
362
439
|
resetRegionUrl,
|
|
363
440
|
setHostBaseUrl,
|
|
364
441
|
getHostBaseUrl,
|
package/dist/index.d.mts
CHANGED
|
@@ -374,8 +374,10 @@ interface AgentPresetsProps {
|
|
|
374
374
|
presets?: AgentPreset[];
|
|
375
375
|
/** Ref forwarded to the trigger button so the host can measure its width. */
|
|
376
376
|
chipRef?: React.Ref<HTMLButtonElement>;
|
|
377
|
+
/** Authoritative support flag from the host's getinfo payload. */
|
|
378
|
+
isSupport?: boolean;
|
|
377
379
|
}
|
|
378
|
-
declare const AgentPresets: ({ variant, onSelectPreset, selectedPreset, onRemoveSelected, presets, chipRef }: AgentPresetsProps) => React$1.JSX.Element;
|
|
380
|
+
declare const AgentPresets: ({ variant, onSelectPreset, selectedPreset, onRemoveSelected, presets, chipRef, isSupport }: AgentPresetsProps) => React$1.JSX.Element;
|
|
379
381
|
|
|
380
382
|
/**
|
|
381
383
|
* AgentUI — Standalone "start + debug agents" surface.
|
|
@@ -416,6 +418,20 @@ interface AgentUIProps {
|
|
|
416
418
|
* token to be set on `API_CONFIG`).
|
|
417
419
|
*/
|
|
418
420
|
autoLoadApps?: boolean;
|
|
421
|
+
/** Authoritative support flag from `/api/v1/getinfo`. */
|
|
422
|
+
isSupport?: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Optional per-skill readiness CTAs. Keyed by skill (preset) id. When the
|
|
425
|
+
* matching skill is selected and the host reports it has no real content
|
|
426
|
+
* yet, AgentUI renders a small call-to-action under the prompt.
|
|
427
|
+
*/
|
|
428
|
+
presetCtas?: Record<string, {
|
|
429
|
+
/** When false, nothing is rendered (content exists / still loading). */
|
|
430
|
+
show?: boolean;
|
|
431
|
+
message: string;
|
|
432
|
+
actionLabel: string;
|
|
433
|
+
onAction?: () => void;
|
|
434
|
+
}>;
|
|
419
435
|
/** Hero title above the prompt. */
|
|
420
436
|
title?: string;
|
|
421
437
|
/** Optional subtitle/description shown under the title. */
|
|
@@ -676,9 +692,18 @@ declare const isCloud: () => boolean;
|
|
|
676
692
|
declare const isOnprem: () => boolean;
|
|
677
693
|
/**
|
|
678
694
|
* Set the dynamic region URL from getinfo response.
|
|
679
|
-
*
|
|
695
|
+
* ALWAYS honored for the current org/tenant (including dev/preview) as long as
|
|
696
|
+
* the URL is a valid shuffler.io subdomain different from the default backend.
|
|
697
|
+
* Persisted in localStorage so later page loads do not have to wait on getinfo.
|
|
680
698
|
*/
|
|
681
699
|
declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string | undefined | null) => void;
|
|
700
|
+
/**
|
|
701
|
+
* Single entry point for applying a region from ANY backend response that
|
|
702
|
+
* carries one (`/api/v1/getinfo`, `/api/v1/orgs/{id}/change`, ...). Extracts
|
|
703
|
+
* `region_url` (top-level first, then `active_org`) and routes it through
|
|
704
|
+
* `setRegionUrl`, so setting + broadcasting always happens in one place.
|
|
705
|
+
*/
|
|
706
|
+
declare const applyRegionFromPayload: (payload: any, orgIdOverride?: string | null) => string | null;
|
|
682
707
|
/**
|
|
683
708
|
* Called when org changes. Resets region URL to default until next getinfo.
|
|
684
709
|
*/
|
|
@@ -931,6 +956,8 @@ interface AgentsViewProps extends ShuffleHostProps {
|
|
|
931
956
|
appsStorageKey?: string;
|
|
932
957
|
/** Usecase-backed agent types shown in the activity list filter dropdown. */
|
|
933
958
|
usecaseFilters?: AgentUsecaseFilter[];
|
|
959
|
+
/** Per-skill readiness CTAs forwarded to the embedded AgentUI. */
|
|
960
|
+
presetCtas?: AgentUIProps['presetCtas'];
|
|
934
961
|
}
|
|
935
962
|
|
|
936
963
|
interface AgentLocalModel {
|
|
@@ -949,6 +976,10 @@ interface LocalLLMConfigProps extends ShuffleHostProps {
|
|
|
949
976
|
hasOpenAIAuth?: boolean;
|
|
950
977
|
onSave?: (model: AgentLocalModel) => void;
|
|
951
978
|
onTestResult?: (result: LocalLLMTestResult) => void;
|
|
979
|
+
/** When the panel is rendered inside a drawer, pass the drawer open state
|
|
980
|
+
* so the provider selector can reset to the currently active provider each
|
|
981
|
+
* time the drawer opens. */
|
|
982
|
+
open?: boolean;
|
|
952
983
|
}
|
|
953
984
|
|
|
954
985
|
/**
|
|
@@ -1482,6 +1513,8 @@ declare const DATASTORE_CATEGORIES: {
|
|
|
1482
1513
|
readonly INCIDENTS: "shuffle-security_incidents";
|
|
1483
1514
|
readonly VULNERABILITIES: "shuffle-security_vulnerabilities";
|
|
1484
1515
|
readonly ASSETS: "shuffle-security_assets";
|
|
1516
|
+
readonly PACKAGES: "shuffle-security_packages";
|
|
1517
|
+
readonly SOFTWARE: "shuffle-security_software";
|
|
1485
1518
|
readonly TEMPLATES: "shuffle-security_templates";
|
|
1486
1519
|
readonly CONFIGURATION: "shuffle-security_configuration";
|
|
1487
1520
|
readonly IOCS: "shuffle-security_ioc-config";
|
|
@@ -1613,6 +1646,67 @@ interface UsageBarProps {
|
|
|
1613
1646
|
}
|
|
1614
1647
|
declare const UsageBar: React__default.FC<UsageBarProps>;
|
|
1615
1648
|
|
|
1649
|
+
/**
|
|
1650
|
+
* ShuffleMarkdown — the ONE markdown renderer for the platform.
|
|
1651
|
+
*
|
|
1652
|
+
* Every place that renders user/AI/remote markdown should use this component
|
|
1653
|
+
* (or `InlineMarkdown` for single-line strings) instead of importing
|
|
1654
|
+
* `react-markdown` directly, so plugins, link safety and typography stay
|
|
1655
|
+
* identical everywhere.
|
|
1656
|
+
*
|
|
1657
|
+
* Defaults:
|
|
1658
|
+
* - remark-gfm (tables, strikethrough, task lists, autolinks)
|
|
1659
|
+
* - remark-breaks (single newline = <br>, matches how LLM/agent output reads)
|
|
1660
|
+
* - rehype-sanitize (defense in depth; raw HTML is never enabled)
|
|
1661
|
+
* - external links open in a new tab with noopener/noreferrer
|
|
1662
|
+
* - shared code / table / blockquote styling based on HSL design tokens
|
|
1663
|
+
*/
|
|
1664
|
+
|
|
1665
|
+
/** Standardised JSON tree used inside markdown (same viewer as the rest of the platform). */
|
|
1666
|
+
declare const MarkdownJsonBlock: React__default.FC<{
|
|
1667
|
+
src: object;
|
|
1668
|
+
}>;
|
|
1669
|
+
/**
|
|
1670
|
+
* Deliberately loose (not react-markdown's own `Components` type): that type is a mapped
|
|
1671
|
+
* type over `keyof JSX.IntrinsicElements`, which tsup's declaration bundler (rollup-plugin-dts)
|
|
1672
|
+
* cannot inline into this package's published `.d.ts` without erroring (TS2709).
|
|
1673
|
+
*/
|
|
1674
|
+
type MarkdownComponentOverrides = Record<string, React__default.ElementType>;
|
|
1675
|
+
interface ShuffleMarkdownProps {
|
|
1676
|
+
/** The markdown source. */
|
|
1677
|
+
children?: string | null;
|
|
1678
|
+
/** Component overrides merged on top of the shared defaults. */
|
|
1679
|
+
components?: MarkdownComponentOverrides;
|
|
1680
|
+
/** Extra remark plugins appended to the defaults. */
|
|
1681
|
+
remarkPlugins?: any[];
|
|
1682
|
+
/** Disable remark-breaks (for prose docs where blank lines separate paragraphs). */
|
|
1683
|
+
disableBreaks?: boolean;
|
|
1684
|
+
/** Styling applied to the wrapping Box. */
|
|
1685
|
+
sx?: SxProps<Theme>;
|
|
1686
|
+
className?: string;
|
|
1687
|
+
}
|
|
1688
|
+
declare const ShuffleMarkdown: React__default.FC<ShuffleMarkdownProps>;
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* VideoEmbed — shared inline video player for markdown content.
|
|
1692
|
+
*
|
|
1693
|
+
* Supports YouTube, Loom and direct video files (mp4/webm/ogg).
|
|
1694
|
+
* Rendered as a block-level span so it is valid inside <p> elements.
|
|
1695
|
+
*/
|
|
1696
|
+
|
|
1697
|
+
type VideoKind = 'youtube' | 'loom' | 'file';
|
|
1698
|
+
interface ResolvedVideo {
|
|
1699
|
+
kind: VideoKind;
|
|
1700
|
+
/** Embed URL for iframes, or the direct file URL for <video>. */
|
|
1701
|
+
src: string;
|
|
1702
|
+
}
|
|
1703
|
+
/** Returns embed info when the URL points at a supported video, otherwise null. */
|
|
1704
|
+
declare function resolveVideoUrl(raw?: string | null): ResolvedVideo | null;
|
|
1705
|
+
declare const VideoEmbed: React__default.FC<{
|
|
1706
|
+
video: ResolvedVideo;
|
|
1707
|
+
title?: string;
|
|
1708
|
+
}>;
|
|
1709
|
+
|
|
1616
1710
|
/**
|
|
1617
1711
|
* Local Singul Library — fully self-contained.
|
|
1618
1712
|
* No host-app `@/` imports remain inside this folder (assets aside).
|
|
@@ -1659,4 +1753,4 @@ declare const LocalLLMConfig: React__default.ComponentType<any>;
|
|
|
1659
1753
|
|
|
1660
1754
|
declare const AddAppModal: React__default.ComponentType<any>;
|
|
1661
1755
|
|
|
1662
|
-
export { AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, AddAppModal, type AddAppModalProps, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, 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, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_PROMPT_PREFIX, 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, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
|
|
1756
|
+
export { AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, AddAppModal, type AddAppModalProps, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, 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, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_PROMPT_PREFIX, 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, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, resolveVideoUrl, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
|
package/dist/index.d.ts
CHANGED
|
@@ -374,8 +374,10 @@ interface AgentPresetsProps {
|
|
|
374
374
|
presets?: AgentPreset[];
|
|
375
375
|
/** Ref forwarded to the trigger button so the host can measure its width. */
|
|
376
376
|
chipRef?: React.Ref<HTMLButtonElement>;
|
|
377
|
+
/** Authoritative support flag from the host's getinfo payload. */
|
|
378
|
+
isSupport?: boolean;
|
|
377
379
|
}
|
|
378
|
-
declare const AgentPresets: ({ variant, onSelectPreset, selectedPreset, onRemoveSelected, presets, chipRef }: AgentPresetsProps) => React$1.JSX.Element;
|
|
380
|
+
declare const AgentPresets: ({ variant, onSelectPreset, selectedPreset, onRemoveSelected, presets, chipRef, isSupport }: AgentPresetsProps) => React$1.JSX.Element;
|
|
379
381
|
|
|
380
382
|
/**
|
|
381
383
|
* AgentUI — Standalone "start + debug agents" surface.
|
|
@@ -416,6 +418,20 @@ interface AgentUIProps {
|
|
|
416
418
|
* token to be set on `API_CONFIG`).
|
|
417
419
|
*/
|
|
418
420
|
autoLoadApps?: boolean;
|
|
421
|
+
/** Authoritative support flag from `/api/v1/getinfo`. */
|
|
422
|
+
isSupport?: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Optional per-skill readiness CTAs. Keyed by skill (preset) id. When the
|
|
425
|
+
* matching skill is selected and the host reports it has no real content
|
|
426
|
+
* yet, AgentUI renders a small call-to-action under the prompt.
|
|
427
|
+
*/
|
|
428
|
+
presetCtas?: Record<string, {
|
|
429
|
+
/** When false, nothing is rendered (content exists / still loading). */
|
|
430
|
+
show?: boolean;
|
|
431
|
+
message: string;
|
|
432
|
+
actionLabel: string;
|
|
433
|
+
onAction?: () => void;
|
|
434
|
+
}>;
|
|
419
435
|
/** Hero title above the prompt. */
|
|
420
436
|
title?: string;
|
|
421
437
|
/** Optional subtitle/description shown under the title. */
|
|
@@ -676,9 +692,18 @@ declare const isCloud: () => boolean;
|
|
|
676
692
|
declare const isOnprem: () => boolean;
|
|
677
693
|
/**
|
|
678
694
|
* Set the dynamic region URL from getinfo response.
|
|
679
|
-
*
|
|
695
|
+
* ALWAYS honored for the current org/tenant (including dev/preview) as long as
|
|
696
|
+
* the URL is a valid shuffler.io subdomain different from the default backend.
|
|
697
|
+
* Persisted in localStorage so later page loads do not have to wait on getinfo.
|
|
680
698
|
*/
|
|
681
699
|
declare const setRegionUrl: (regionUrl: string | undefined | null, orgId: string | undefined | null) => void;
|
|
700
|
+
/**
|
|
701
|
+
* Single entry point for applying a region from ANY backend response that
|
|
702
|
+
* carries one (`/api/v1/getinfo`, `/api/v1/orgs/{id}/change`, ...). Extracts
|
|
703
|
+
* `region_url` (top-level first, then `active_org`) and routes it through
|
|
704
|
+
* `setRegionUrl`, so setting + broadcasting always happens in one place.
|
|
705
|
+
*/
|
|
706
|
+
declare const applyRegionFromPayload: (payload: any, orgIdOverride?: string | null) => string | null;
|
|
682
707
|
/**
|
|
683
708
|
* Called when org changes. Resets region URL to default until next getinfo.
|
|
684
709
|
*/
|
|
@@ -931,6 +956,8 @@ interface AgentsViewProps extends ShuffleHostProps {
|
|
|
931
956
|
appsStorageKey?: string;
|
|
932
957
|
/** Usecase-backed agent types shown in the activity list filter dropdown. */
|
|
933
958
|
usecaseFilters?: AgentUsecaseFilter[];
|
|
959
|
+
/** Per-skill readiness CTAs forwarded to the embedded AgentUI. */
|
|
960
|
+
presetCtas?: AgentUIProps['presetCtas'];
|
|
934
961
|
}
|
|
935
962
|
|
|
936
963
|
interface AgentLocalModel {
|
|
@@ -949,6 +976,10 @@ interface LocalLLMConfigProps extends ShuffleHostProps {
|
|
|
949
976
|
hasOpenAIAuth?: boolean;
|
|
950
977
|
onSave?: (model: AgentLocalModel) => void;
|
|
951
978
|
onTestResult?: (result: LocalLLMTestResult) => void;
|
|
979
|
+
/** When the panel is rendered inside a drawer, pass the drawer open state
|
|
980
|
+
* so the provider selector can reset to the currently active provider each
|
|
981
|
+
* time the drawer opens. */
|
|
982
|
+
open?: boolean;
|
|
952
983
|
}
|
|
953
984
|
|
|
954
985
|
/**
|
|
@@ -1482,6 +1513,8 @@ declare const DATASTORE_CATEGORIES: {
|
|
|
1482
1513
|
readonly INCIDENTS: "shuffle-security_incidents";
|
|
1483
1514
|
readonly VULNERABILITIES: "shuffle-security_vulnerabilities";
|
|
1484
1515
|
readonly ASSETS: "shuffle-security_assets";
|
|
1516
|
+
readonly PACKAGES: "shuffle-security_packages";
|
|
1517
|
+
readonly SOFTWARE: "shuffle-security_software";
|
|
1485
1518
|
readonly TEMPLATES: "shuffle-security_templates";
|
|
1486
1519
|
readonly CONFIGURATION: "shuffle-security_configuration";
|
|
1487
1520
|
readonly IOCS: "shuffle-security_ioc-config";
|
|
@@ -1613,6 +1646,67 @@ interface UsageBarProps {
|
|
|
1613
1646
|
}
|
|
1614
1647
|
declare const UsageBar: React__default.FC<UsageBarProps>;
|
|
1615
1648
|
|
|
1649
|
+
/**
|
|
1650
|
+
* ShuffleMarkdown — the ONE markdown renderer for the platform.
|
|
1651
|
+
*
|
|
1652
|
+
* Every place that renders user/AI/remote markdown should use this component
|
|
1653
|
+
* (or `InlineMarkdown` for single-line strings) instead of importing
|
|
1654
|
+
* `react-markdown` directly, so plugins, link safety and typography stay
|
|
1655
|
+
* identical everywhere.
|
|
1656
|
+
*
|
|
1657
|
+
* Defaults:
|
|
1658
|
+
* - remark-gfm (tables, strikethrough, task lists, autolinks)
|
|
1659
|
+
* - remark-breaks (single newline = <br>, matches how LLM/agent output reads)
|
|
1660
|
+
* - rehype-sanitize (defense in depth; raw HTML is never enabled)
|
|
1661
|
+
* - external links open in a new tab with noopener/noreferrer
|
|
1662
|
+
* - shared code / table / blockquote styling based on HSL design tokens
|
|
1663
|
+
*/
|
|
1664
|
+
|
|
1665
|
+
/** Standardised JSON tree used inside markdown (same viewer as the rest of the platform). */
|
|
1666
|
+
declare const MarkdownJsonBlock: React__default.FC<{
|
|
1667
|
+
src: object;
|
|
1668
|
+
}>;
|
|
1669
|
+
/**
|
|
1670
|
+
* Deliberately loose (not react-markdown's own `Components` type): that type is a mapped
|
|
1671
|
+
* type over `keyof JSX.IntrinsicElements`, which tsup's declaration bundler (rollup-plugin-dts)
|
|
1672
|
+
* cannot inline into this package's published `.d.ts` without erroring (TS2709).
|
|
1673
|
+
*/
|
|
1674
|
+
type MarkdownComponentOverrides = Record<string, React__default.ElementType>;
|
|
1675
|
+
interface ShuffleMarkdownProps {
|
|
1676
|
+
/** The markdown source. */
|
|
1677
|
+
children?: string | null;
|
|
1678
|
+
/** Component overrides merged on top of the shared defaults. */
|
|
1679
|
+
components?: MarkdownComponentOverrides;
|
|
1680
|
+
/** Extra remark plugins appended to the defaults. */
|
|
1681
|
+
remarkPlugins?: any[];
|
|
1682
|
+
/** Disable remark-breaks (for prose docs where blank lines separate paragraphs). */
|
|
1683
|
+
disableBreaks?: boolean;
|
|
1684
|
+
/** Styling applied to the wrapping Box. */
|
|
1685
|
+
sx?: SxProps<Theme>;
|
|
1686
|
+
className?: string;
|
|
1687
|
+
}
|
|
1688
|
+
declare const ShuffleMarkdown: React__default.FC<ShuffleMarkdownProps>;
|
|
1689
|
+
|
|
1690
|
+
/**
|
|
1691
|
+
* VideoEmbed — shared inline video player for markdown content.
|
|
1692
|
+
*
|
|
1693
|
+
* Supports YouTube, Loom and direct video files (mp4/webm/ogg).
|
|
1694
|
+
* Rendered as a block-level span so it is valid inside <p> elements.
|
|
1695
|
+
*/
|
|
1696
|
+
|
|
1697
|
+
type VideoKind = 'youtube' | 'loom' | 'file';
|
|
1698
|
+
interface ResolvedVideo {
|
|
1699
|
+
kind: VideoKind;
|
|
1700
|
+
/** Embed URL for iframes, or the direct file URL for <video>. */
|
|
1701
|
+
src: string;
|
|
1702
|
+
}
|
|
1703
|
+
/** Returns embed info when the URL points at a supported video, otherwise null. */
|
|
1704
|
+
declare function resolveVideoUrl(raw?: string | null): ResolvedVideo | null;
|
|
1705
|
+
declare const VideoEmbed: React__default.FC<{
|
|
1706
|
+
video: ResolvedVideo;
|
|
1707
|
+
title?: string;
|
|
1708
|
+
}>;
|
|
1709
|
+
|
|
1616
1710
|
/**
|
|
1617
1711
|
* Local Singul Library — fully self-contained.
|
|
1618
1712
|
* No host-app `@/` imports remain inside this folder (assets aside).
|
|
@@ -1659,4 +1753,4 @@ declare const LocalLLMConfig: React__default.ComponentType<any>;
|
|
|
1659
1753
|
|
|
1660
1754
|
declare const AddAppModal: React__default.ComponentType<any>;
|
|
1661
1755
|
|
|
1662
|
-
export { AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, AddAppModal, type AddAppModalProps, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, 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, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_PROMPT_PREFIX, 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, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
|
|
1756
|
+
export { AGENT_PRESETS, AGENT_PROMPT_PREFIX_CATEGORY, API_CONFIG, AddAppModal, type AddAppModalProps, AgentActivityList, type AgentActivityListProps, type AgentActivityParams, type AgentActivityResponse, type AgentDecision, AgentExecutionDrawer, type AgentExecutionDrawerProps, AgentIcon, type AgentLocalModel, type AgentPreset, AgentPresets, type AgentPresetsProps, AgentPromptPrefixChip, type AgentPromptPrefixChipProps, 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, AppAuthCard, type AppAuthCardProps, AppAuthConfig, AppAuthSection, type AppAuthSectionProps, type AppAuthState, type AppAuthentication$1 as AppAuthentication, AppDetailDrawer, AppDetailProvider, type AppLookupResult, AppSearchDrawer, type AppSelectedEvent, AppTitleHeader, type AppTitleHeaderProps, type AuthStatus, CASES_PATTERNS, COMMUNICATION_PATTERNS_NAMES, type CategoryAutomation, type CategoryConfig, type CustomStyles, DATASTORE_CATEGORIES, DEFAULT_AGENT_PROMPT_PREFIX, 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, ShuffleMarkdown as Markdown, MarkdownJsonBlock, type OutputDiagnosis, type ResolvedApp, SIEM_PATTERNS, type ShuffleHostProps, ShuffleMCP, type ShuffleMCPHandle, type ShuffleMCPProps, ShuffleMarkdown, type ShuffleMcpColorMode, ShuffleMcpThemeProvider, type ShuffleMcpThemeProviderProps, ShufflePipelinesBanner, type ShuffleTheme, SingulActionsPreview, THREAT_INTEL_PATTERNS, TryMcpSection, type TryMcpSectionProps, UsageBar, type UsageBarProps, type UseAgentPromptPrefixOptions, VULN_SCANNER_PATTERNS, type ValidatedIngestionApp, VideoEmbed, applyRegionFromPayload, ShuffleMCP as default, deleteDatastoreItem, deleteDatastoreItems, diagnoseOutputWarning, extractActionAppNames, extractValidatedIngestionApps, extractWorkflowActionAppNames, extractWorkflowAppNames, fetchApps, fetchAppsViaApiConfig, findForwardTicketsWorkflow, findIngestTicketsWorkflow, getApiUrl, getAuthHeader, getDatastoreByCategory, getDatastoreItem, getDatastoreItemPublic, getDatastorePageSize, getFailureInfo, getHostBaseUrl, getIngestionCategory, hasOutputWarning, installFetchBreaker, invalidateAppsCache, invalidateResolvedApps, isCloud, isCloudDomain, isEmailApp, isIngestionApp, isOnprem, isThreatIntelApp, isVulnScannerApp, isWorkflowScheduleStopped, normalizeAppName, parseRunResult, refreshAllIntegrationStatus, registerProtectedOrigin, resetRegionUrl, resolveApp, resolveApps, resolveVideoUrl, scheduleAgentRun, searchAgentActivity, seedResolvedApp, setDatastoreItem, setDatastoreItems, setHostBaseUrl, setRegionUrl, setRuntimeOrgId, setToastImpl, shuffleFetch, toast, useAgentPromptPrefix, useAppAuth, useAppAuthFlow, useAppDetail, useAppDetailOptional, useAppLookup, useSyncHostBaseUrl };
|