@shuffleio/shuffle-mcps 0.0.58 → 0.0.60

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.js CHANGED
@@ -1119,6 +1119,9 @@ var init_appsCache = __esm({
1119
1119
  // index.ts
1120
1120
  var index_exports = {};
1121
1121
  __export(index_exports, {
1122
+ AGENT_DRAWER_CLOSE_EVENT: () => AGENT_DRAWER_CLOSE_EVENT,
1123
+ AGENT_DRAWER_OPEN_EVENT: () => AGENT_DRAWER_OPEN_EVENT2,
1124
+ AGENT_DRAWER_STATE_EVENT: () => AGENT_DRAWER_STATE_EVENT,
1122
1125
  AGENT_PRESETS: () => AGENT_PRESETS,
1123
1126
  AGENT_PROMPT_PREFIX_CATEGORY: () => AGENT_PROMPT_PREFIX_CATEGORY,
1124
1127
  API_CONFIG: () => API_CONFIG,
@@ -1176,6 +1179,7 @@ __export(index_exports, {
1176
1179
  VULN_SCANNER_PATTERNS: () => VULN_SCANNER_PATTERNS,
1177
1180
  VideoEmbed: () => VideoEmbed,
1178
1181
  applyRegionFromPayload: () => applyRegionFromPayload,
1182
+ buildSupportEscalationUrl: () => buildSupportEscalationUrl,
1179
1183
  checkAppNameMatch: () => checkAppNameMatch,
1180
1184
  clearPageContextChoice: () => clearPageContextChoice,
1181
1185
  default: () => index_default,
@@ -1223,6 +1227,7 @@ __export(index_exports, {
1223
1227
  matchRoutePattern: () => matchRoutePattern,
1224
1228
  mergeConnectedTools: () => mergeConnectedTools,
1225
1229
  normalizeAppName: () => normalizeAppName,
1230
+ openSupportEscalation: () => openSupportEscalation,
1226
1231
  parseRunResult: () => parseRunResult,
1227
1232
  refreshAllIntegrationStatus: () => refreshAllIntegrationStatus,
1228
1233
  registerAgentContextRule: () => registerAgentContextRule,
@@ -1232,6 +1237,7 @@ __export(index_exports, {
1232
1237
  resolveApp: () => resolveApp,
1233
1238
  resolveApps: () => resolveApps,
1234
1239
  resolveConnectedTools: () => resolveConnectedTools,
1240
+ resolveContactUserInfo: () => resolveContactUserInfo,
1235
1241
  resolveVideoUrl: () => resolveVideoUrl,
1236
1242
  scheduleAgentRun: () => scheduleAgentRun,
1237
1243
  searchAgentActivity: () => searchAgentActivity,
@@ -1256,13 +1262,13 @@ __export(index_exports, {
1256
1262
  useSyncHostBaseUrl: () => useSyncHostBaseUrl
1257
1263
  });
1258
1264
  module.exports = __toCommonJS(index_exports);
1259
- var import_shuffle_mcp3 = require("./shuffle-mcp-SHQXQS3F.css");
1265
+ var import_shuffle_mcp3 = require("./shuffle-mcp-E56K3LGU.css");
1260
1266
  var import_react39 = __toESM(require("react"));
1261
1267
 
1262
1268
  // ShuffleMcpThemeProvider.tsx
1263
1269
  var import_react = __toESM(require("react"));
1264
1270
  var import_material = require("@mui/material");
1265
- var import_shuffle_mcp = require("./shuffle-mcp-SHQXQS3F.css");
1271
+ var import_shuffle_mcp = require("./shuffle-mcp-E56K3LGU.css");
1266
1272
  var import_jsx_runtime = require("react/jsx-runtime");
1267
1273
  var readHtmlDarkClass = () => {
1268
1274
  if (typeof document === "undefined") return false;
@@ -2351,18 +2357,22 @@ var jsonBoxSx = {
2351
2357
  border: "1px solid hsl(var(--border))",
2352
2358
  "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" }
2353
2359
  };
2354
- var MarkdownJsonBlock = ({ src }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { sx: jsonBoxSx, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2355
- import_react18_json_view.default,
2356
- {
2357
- src,
2358
- dark: true,
2359
- collapsed: defaultCollapsed,
2360
- collapseStringMode: "word",
2361
- collapseStringsAfterLength: 120,
2362
- enableClipboard: true,
2363
- displaySize: true
2364
- }
2365
- ) });
2360
+ var MarkdownJsonBlock = ({ src }) => {
2361
+ const theme = (0, import_material3.useTheme)();
2362
+ const isDark = theme.palette.mode === "dark";
2363
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { sx: jsonBoxSx, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
2364
+ import_react18_json_view.default,
2365
+ {
2366
+ src,
2367
+ dark: isDark,
2368
+ collapsed: defaultCollapsed,
2369
+ collapseStringMode: "word",
2370
+ collapseStringsAfterLength: 120,
2371
+ enableClipboard: true,
2372
+ displaySize: true
2373
+ }
2374
+ ) });
2375
+ };
2366
2376
  var baseSx = {
2367
2377
  color: "inherit",
2368
2378
  fontSize: "inherit",
@@ -4930,7 +4940,7 @@ var AppAuthCard = ({
4930
4940
  size: "small",
4931
4941
  sx: {
4932
4942
  "& .MuiOutlinedInput-root": {
4933
- backgroundColor: "hsl(var(--background))",
4943
+ backgroundColor: "transparent",
4934
4944
  borderRadius: 1,
4935
4945
  "& fieldset": { borderColor: "hsl(var(--border))" },
4936
4946
  "&:hover fieldset": { borderColor: "hsl(var(--border) / 0.8)" },
@@ -4953,7 +4963,7 @@ var AppAuthCard = ({
4953
4963
  size: "small",
4954
4964
  sx: {
4955
4965
  "& .MuiOutlinedInput-root": {
4956
- backgroundColor: "hsl(var(--background))",
4966
+ backgroundColor: "transparent",
4957
4967
  borderRadius: 1,
4958
4968
  "& fieldset": { borderColor: "hsl(var(--border))" },
4959
4969
  "&:hover fieldset": { borderColor: "hsl(var(--border) / 0.8)" },
@@ -5073,7 +5083,7 @@ var AppAuthCard = ({
5073
5083
  name: `auth-${fieldKey}-${app2.objectID}-${Math.random().toString(36).slice(2, 8)}`,
5074
5084
  sx: {
5075
5085
  "& .MuiOutlinedInput-root": {
5076
- backgroundColor: isSecretField ? "hsl(var(--primary) / 0.06)" : "hsl(var(--muted))",
5086
+ backgroundColor: "transparent",
5077
5087
  borderRadius: 1,
5078
5088
  "& fieldset": {
5079
5089
  borderColor: fieldErrors[fieldKey] ? "hsl(var(--destructive))" : isSecretField ? "hsl(var(--primary) / 0.5)" : "hsl(var(--border))",
@@ -5360,7 +5370,7 @@ var AppAuthCard = ({
5360
5370
  }
5361
5371
  },
5362
5372
  sx: {
5363
- backgroundColor: "hsl(var(--background))",
5373
+ backgroundColor: "transparent",
5364
5374
  borderRadius: 2,
5365
5375
  color: "hsl(var(--foreground))",
5366
5376
  "& .MuiOutlinedInput-notchedOutline": { borderColor: "hsl(var(--border))" },
@@ -5535,7 +5545,7 @@ var AppAuthCard = ({
5535
5545
  !showAddNewForm && selectedAuth && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material5.Box, { sx: {
5536
5546
  mt: 2,
5537
5547
  p: 0,
5538
- backgroundColor: "hsl(var(--muted))",
5548
+ backgroundColor: "transparent",
5539
5549
  borderRadius: 3,
5540
5550
  border: "1px solid hsl(var(--border))",
5541
5551
  overflow: "hidden"
@@ -5547,7 +5557,7 @@ var AppAuthCard = ({
5547
5557
  px: { xs: 2, sm: 2.5 },
5548
5558
  py: 1.5,
5549
5559
  borderBottom: "1px solid hsl(var(--border))",
5550
- backgroundColor: "hsl(var(--background-surface))"
5560
+ backgroundColor: "transparent"
5551
5561
  }, children: [
5552
5562
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material5.Box, { sx: {
5553
5563
  width: 8,
@@ -5585,8 +5595,8 @@ var AppAuthCard = ({
5585
5595
  display: "flex",
5586
5596
  alignItems: "center",
5587
5597
  justifyContent: "center",
5588
- backgroundColor: localTestStatus === "success" || localTestStatus === "pending_validation" ? "hsl(var(--severity-low) / 0.1)" : localTestStatus === "error" ? "hsl(var(--destructive) / 0.1)" : isTested ? "hsl(var(--severity-low) / 0.1)" : isConfigured ? "hsl(var(--severity-medium) / 0.1)" : "hsl(var(--muted-foreground) / 0.1)",
5589
- border: `1px solid ${localTestStatus === "success" || localTestStatus === "pending_validation" ? "hsl(var(--severity-low) / 0.2)" : localTestStatus === "error" ? "hsl(var(--destructive) / 0.2)" : isTested ? "hsl(var(--severity-low) / 0.2)" : isConfigured ? "hsl(var(--severity-medium) / 0.2)" : "hsl(var(--muted-foreground) / 0.2)"}`,
5598
+ backgroundColor: "transparent",
5599
+ border: `1px solid ${localTestStatus === "success" || localTestStatus === "pending_validation" ? "hsl(var(--severity-low) / 0.3)" : localTestStatus === "error" ? "hsl(var(--destructive) / 0.3)" : isTested ? "hsl(var(--severity-low) / 0.3)" : isConfigured ? "hsl(var(--severity-medium) / 0.3)" : "hsl(var(--border))"}`,
5590
5600
  flexShrink: 0
5591
5601
  }, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.CheckCircle2, { size: 20 }) }),
5592
5602
  /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material5.Box, { sx: { minWidth: 0, flex: 1 }, children: [
@@ -5739,9 +5749,9 @@ var AppAuthCard = ({
5739
5749
  {
5740
5750
  severity: "error",
5741
5751
  sx: {
5742
- backgroundColor: "hsl(var(--destructive) / 0.1)",
5752
+ backgroundColor: "transparent",
5743
5753
  color: "hsl(var(--destructive))",
5744
- border: "1px solid hsl(var(--destructive) / 0.2)",
5754
+ border: "1px solid hsl(var(--destructive) / 0.3)",
5745
5755
  borderRadius: 2,
5746
5756
  "& .MuiAlert-icon": { color: "hsl(var(--destructive))" }
5747
5757
  },
@@ -5759,9 +5769,9 @@ var AppAuthCard = ({
5759
5769
  {
5760
5770
  severity: "warning",
5761
5771
  sx: {
5762
- backgroundColor: "hsl(var(--severity-medium) / 0.1)",
5772
+ backgroundColor: "transparent",
5763
5773
  color: "hsl(var(--severity-medium))",
5764
- border: "1px solid hsl(var(--severity-medium) / 0.2)",
5774
+ border: "1px solid hsl(var(--severity-medium) / 0.3)",
5765
5775
  borderRadius: 2,
5766
5776
  "& .MuiAlert-icon": {
5767
5777
  color: "hsl(var(--severity-medium))"
@@ -5780,7 +5790,7 @@ var AppAuthCard = ({
5780
5790
  ] }),
5781
5791
  (apiAuthEntries.length === 0 || showAddNewForm) && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material5.Box, { sx: {
5782
5792
  p: 3,
5783
- backgroundColor: "hsl(var(--background) / 0.4)",
5793
+ backgroundColor: "transparent",
5784
5794
  borderRadius: 2,
5785
5795
  border: "1px solid hsl(var(--border))"
5786
5796
  }, children: [
@@ -5789,9 +5799,9 @@ var AppAuthCard = ({
5789
5799
  {
5790
5800
  severity: "warning",
5791
5801
  sx: {
5792
- backgroundColor: "hsl(var(--severity-medium) / 0.1)",
5802
+ backgroundColor: "transparent",
5793
5803
  color: "hsl(var(--severity-medium))",
5794
- border: "1px solid hsl(var(--severity-medium) / 0.2)",
5804
+ border: "1px solid hsl(var(--severity-medium) / 0.3)",
5795
5805
  borderRadius: 2,
5796
5806
  mb: 2,
5797
5807
  "& .MuiAlert-icon": { color: "hsl(var(--severity-medium))" }
@@ -5811,7 +5821,7 @@ var AppAuthCard = ({
5811
5821
  {
5812
5822
  severity: "error",
5813
5823
  sx: {
5814
- backgroundColor: "hsl(var(--destructive) / 0.1)",
5824
+ backgroundColor: "transparent",
5815
5825
  color: "hsl(var(--destructive))",
5816
5826
  border: "1px solid hsl(var(--destructive) / 0.3)",
5817
5827
  borderRadius: 2
@@ -5823,9 +5833,9 @@ var AppAuthCard = ({
5823
5833
  {
5824
5834
  severity: "info",
5825
5835
  sx: {
5826
- backgroundColor: "hsl(var(--severity-info) / 0.1)",
5836
+ backgroundColor: "transparent",
5827
5837
  color: "hsl(var(--severity-info))",
5828
- border: "1px solid hsl(var(--severity-info) / 0.2)",
5838
+ border: "1px solid hsl(var(--severity-info) / 0.3)",
5829
5839
  borderRadius: 2,
5830
5840
  "& .MuiAlert-icon": { color: "hsl(var(--severity-info))" }
5831
5841
  },
@@ -5843,7 +5853,7 @@ var AppAuthCard = ({
5843
5853
  {
5844
5854
  severity: "error",
5845
5855
  sx: {
5846
- backgroundColor: "hsl(var(--destructive) / 0.1)",
5856
+ backgroundColor: "transparent",
5847
5857
  color: "hsl(var(--destructive))",
5848
5858
  border: "1px solid hsl(var(--destructive) / 0.3)",
5849
5859
  borderRadius: 2
@@ -5859,7 +5869,7 @@ var AppAuthCard = ({
5859
5869
  {
5860
5870
  severity: "error",
5861
5871
  sx: {
5862
- backgroundColor: "hsl(var(--destructive) / 0.1)",
5872
+ backgroundColor: "transparent",
5863
5873
  color: "hsl(var(--destructive))",
5864
5874
  border: "1px solid hsl(var(--destructive) / 0.3)",
5865
5875
  borderRadius: 2
@@ -6210,7 +6220,7 @@ var AppAuthConfig = ({
6210
6220
  {
6211
6221
  severity: "info",
6212
6222
  sx: {
6213
- backgroundColor: "hsl(var(--primary) / 0.1)",
6223
+ backgroundColor: "transparent",
6214
6224
  color: "hsl(var(--primary))",
6215
6225
  border: "1px solid hsl(var(--primary) / 0.3)",
6216
6226
  borderRadius: 2
@@ -8146,6 +8156,8 @@ var SingulActionsPreview = ({
8146
8156
  activeOrgId,
8147
8157
  onAuthenticate
8148
8158
  }) => {
8159
+ const theme = (0, import_material11.useTheme)();
8160
+ const isDark = theme.palette.mode === "dark";
8149
8161
  const defaultCategory = (0, import_react10.useMemo)(() => pickDefaultCategory(categories), [categories]);
8150
8162
  const actions = ALL_ACTIONS;
8151
8163
  const sortedActions = (0, import_react10.useMemo)(() => {
@@ -8639,7 +8651,7 @@ var SingulActionsPreview = ({
8639
8651
  import_react18_json_view2.default,
8640
8652
  {
8641
8653
  src: deepParseJsonStrings(parsedResult),
8642
- dark: true,
8654
+ dark: isDark,
8643
8655
  collapsed: defaultCollapsed,
8644
8656
  collapseStringMode: "word",
8645
8657
  collapseStringsAfterLength: 120,
@@ -9752,6 +9764,7 @@ var useOverlayLayer = (open, options) => {
9752
9764
  return zIndex;
9753
9765
  };
9754
9766
  var useDrawerLayer = (open, base3 = DRAWER_LAYER_BASE) => useOverlayLayer(open, { base: base3 });
9767
+ var isShuffleOwnedOverlay = (el) => el.classList.contains("shuffle-core-scope") || el.classList.contains("shuffle-mcp-scope") || el.querySelector(".shuffle-core-scope, .shuffle-mcp-scope") !== null || el.closest("[data-radix-portal]") !== null;
9755
9768
  var isSurfaceElement = (el) => {
9756
9769
  if (!(el instanceof HTMLElement)) return false;
9757
9770
  return el.classList.contains("MuiDialog-root") || el.classList.contains("MuiDrawer-root") || el.classList.contains("MuiModal-root") && !el.classList.contains("MuiPopover-root") && !el.classList.contains("MuiMenu-root") || el.getAttribute("role") === "dialog" || el.getAttribute("role") === "alertdialog" || Boolean(el.closest("[data-radix-portal]"));
@@ -9779,6 +9792,7 @@ var installGlobalOverlayAutoLayer = () => {
9779
9792
  if (store[AUTO_LAYER_KEY]) return;
9780
9793
  store[AUTO_LAYER_KEY] = true;
9781
9794
  const handleElementOpen = (el) => {
9795
+ if (!isShuffleOwnedOverlay(el)) return;
9782
9796
  if (isSurfaceElement(el)) {
9783
9797
  let layerId = el.dataset.shuffleLayerId;
9784
9798
  if (!layerId) {
@@ -9993,7 +10007,7 @@ function AppDetailDrawer({
9993
10007
  }
9994
10008
 
9995
10009
  // views/ShuffleMCP.tsx
9996
- var import_shuffle_mcp2 = require("./shuffle-mcp-SHQXQS3F.css");
10010
+ var import_shuffle_mcp2 = require("./shuffle-mcp-E56K3LGU.css");
9997
10011
  init_appsCache();
9998
10012
 
9999
10013
  // components/SegmentedControl.tsx
@@ -14116,6 +14130,7 @@ var AgentPresets_default = AgentPresets;
14116
14130
 
14117
14131
  // ../lib/agentTools.ts
14118
14132
  var STORAGE_KEY3 = "agent_tools_config";
14133
+ var DATASTORE_CATEGORY = DATASTORE_CATEGORIES.CONFIGURATION;
14119
14134
  var AGENT_TOOLS_CHANGED_EVENT = "agent-tools-changed";
14120
14135
  var DEFAULT_AGENT = "default";
14121
14136
  var DEFAULT_ACTION_TYPE = "timeline_reply";
@@ -14224,7 +14239,10 @@ var writeCache = (entries, explicitUpdatedAt) => {
14224
14239
  const orgKey = getStorageKey();
14225
14240
  localStorage.setItem(orgKey, serialized);
14226
14241
  if (orgKey !== STORAGE_KEY3) {
14227
- localStorage.setItem(STORAGE_KEY3, serialized);
14242
+ try {
14243
+ localStorage.setItem(STORAGE_KEY3, serialized);
14244
+ } catch {
14245
+ }
14228
14246
  }
14229
14247
  window.dispatchEvent(
14230
14248
  new CustomEvent(AGENT_TOOLS_CHANGED_EVENT, { detail: { updatedAt, entries } })
@@ -17673,6 +17691,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17673
17691
  defaultPresetId: "incident-response",
17674
17692
  sourceCategory: "incidents",
17675
17693
  isBeta: true,
17694
+ buttonLabel: "Ask about this case",
17695
+ headerTitle: "Ask about this case",
17676
17696
  title: (params, _, entityOverride) => {
17677
17697
  const cleanId = formatEntityDisplayId(params.id);
17678
17698
  const entity = entityOverride || getActivePageEntityName();
@@ -17696,6 +17716,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17696
17716
  defaultPresetId: "incident-response",
17697
17717
  sourceCategory: "incidents",
17698
17718
  isBeta: true,
17719
+ buttonLabel: "Ask about this ticket",
17720
+ headerTitle: "Ask about this ticket",
17699
17721
  title: (params, _, entityOverride) => {
17700
17722
  const cleanId = formatEntityDisplayId(params.id);
17701
17723
  const entity = entityOverride || getActivePageEntityName();
@@ -17718,6 +17740,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17718
17740
  defaultPresetId: "incident-response",
17719
17741
  sourceCategory: "incidents",
17720
17742
  isBeta: true,
17743
+ buttonLabel: "Ask about this alert",
17744
+ headerTitle: "Ask about this alert",
17721
17745
  title: (params, _, entityOverride) => {
17722
17746
  const cleanId = formatEntityDisplayId(params.id);
17723
17747
  const entity = entityOverride || getActivePageEntityName();
@@ -17740,6 +17764,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17740
17764
  defaultPresetId: "incident-response",
17741
17765
  sourceCategory: "incidents",
17742
17766
  isBeta: true,
17767
+ buttonLabel: "Ask about incidents",
17768
+ headerTitle: "Ask about incidents",
17743
17769
  title: "How can we help handle incidents?",
17744
17770
  subtitle: "Shuffle Incidents MCP",
17745
17771
  defaultPrompt: "Investigate this incident and recommend next steps: ",
@@ -17755,6 +17781,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17755
17781
  defaultPresetId: "incident-response",
17756
17782
  sourceCategory: "incidents",
17757
17783
  isBeta: true,
17784
+ buttonLabel: "Ask about cases",
17785
+ headerTitle: "Ask about cases",
17758
17786
  title: "How can we help handle cases?",
17759
17787
  subtitle: "Shuffle Incidents MCP",
17760
17788
  defaultPrompt: "Investigate this case and recommend next steps: ",
@@ -17770,6 +17798,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17770
17798
  defaultPresetId: "incident-response",
17771
17799
  sourceCategory: "incidents",
17772
17800
  isBeta: true,
17801
+ buttonLabel: "Ask about tickets",
17802
+ headerTitle: "Ask about tickets",
17773
17803
  title: "How can we help handle tickets?",
17774
17804
  subtitle: "Shuffle Incidents MCP",
17775
17805
  defaultPrompt: "Investigate this ticket and recommend next steps: ",
@@ -17785,6 +17815,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17785
17815
  defaultPresetId: "incident-response",
17786
17816
  sourceCategory: "incidents",
17787
17817
  isBeta: true,
17818
+ buttonLabel: "Ask about alerts",
17819
+ headerTitle: "Ask about alerts",
17788
17820
  title: "How can we help handle alerts?",
17789
17821
  subtitle: "Shuffle Incidents MCP",
17790
17822
  defaultPrompt: "Investigate this alert and recommend next steps: ",
@@ -17805,6 +17837,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17805
17837
  ],
17806
17838
  defaultPresetId: "vulnerability",
17807
17839
  sourceCategory: "vulnerabilities",
17840
+ buttonLabel: "Ask about this vulnerability",
17841
+ headerTitle: "Ask about this vulnerability",
17808
17842
  title: (params, _, entityOverride) => {
17809
17843
  const cleanId = formatEntityDisplayId(params.id);
17810
17844
  const entity = entityOverride || getActivePageEntityName();
@@ -17829,6 +17863,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17829
17863
  ],
17830
17864
  defaultPresetId: "vulnerability",
17831
17865
  sourceCategory: "vulnerabilities",
17866
+ buttonLabel: "Ask about vulnerabilities",
17867
+ headerTitle: "Ask about vulnerabilities",
17832
17868
  title: "How can we help review vulnerabilities?",
17833
17869
  subtitle: () => "Shuffle Vulnerabilities & Shuffle Software and Packages",
17834
17870
  defaultPrompt: "Review my current vulnerabilities and prioritize them by ",
@@ -17845,6 +17881,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17845
17881
  match: "/monitors/:id/terminal",
17846
17882
  defaultApps: [{ name: "shuffle_host_monitors" }],
17847
17883
  defaultPresetId: "host-monitor-control",
17884
+ buttonLabel: "Ask about terminal",
17885
+ headerTitle: "Ask about terminal",
17848
17886
  title: (params, _, entityOverride) => {
17849
17887
  const cleanId = formatEntityDisplayId(params.id);
17850
17888
  const entity = entityOverride || getActivePageEntityName();
@@ -17865,6 +17903,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17865
17903
  match: "/monitors/terminal",
17866
17904
  defaultApps: [{ name: "shuffle_host_monitors" }],
17867
17905
  defaultPresetId: "host-monitor-control",
17906
+ buttonLabel: "Ask about terminal",
17907
+ headerTitle: "Ask about terminal",
17868
17908
  title: "How can we help in the host terminal?",
17869
17909
  subtitle: "Shuffle Host Monitors MCP",
17870
17910
  defaultPrompt: "Run terminal commands on this host to ",
@@ -17878,6 +17918,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17878
17918
  match: "/monitors/response",
17879
17919
  defaultApps: [{ name: "shuffle_host_monitors" }],
17880
17920
  defaultPresetId: "host-monitor-control",
17921
+ buttonLabel: "Ask about host response",
17922
+ headerTitle: "Ask about host response",
17881
17923
  title: "How can we help with host response?",
17882
17924
  subtitle: "Shuffle Host Monitors MCP",
17883
17925
  defaultPrompt: "Take response actions on this host to ",
@@ -17891,6 +17933,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17891
17933
  match: "/monitors/:id",
17892
17934
  defaultApps: [{ name: "shuffle_host_monitors" }],
17893
17935
  defaultPresetId: "host-monitor-control",
17936
+ buttonLabel: "Ask about this host",
17937
+ headerTitle: "Ask about this host",
17894
17938
  title: (params, _, entityOverride) => {
17895
17939
  const cleanId = formatEntityDisplayId(params.id);
17896
17940
  const entity = entityOverride || getActivePageEntityName();
@@ -17911,6 +17955,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17911
17955
  match: (pathname) => pathname.startsWith("/monitors"),
17912
17956
  defaultApps: [{ name: "shuffle_host_monitors" }],
17913
17957
  defaultPresetId: "host-monitor-control",
17958
+ buttonLabel: "Ask about host monitors",
17959
+ headerTitle: "Ask about host monitors",
17914
17960
  title: "How can we help with host monitors?",
17915
17961
  subtitle: "Shuffle Host Monitors MCP",
17916
17962
  defaultPrompt: "Take control of this host and help me with: ",
@@ -17927,6 +17973,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17927
17973
  match: "/workflows/:id",
17928
17974
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
17929
17975
  defaultPresetId: "build-workflows",
17976
+ buttonLabel: "Ask about this workflow",
17977
+ headerTitle: "Ask about this workflow",
17930
17978
  title: (params, _, entityOverride) => {
17931
17979
  const cleanId = formatEntityDisplayId(params.id);
17932
17980
  const entity = entityOverride || getActivePageEntityName();
@@ -17947,6 +17995,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17947
17995
  match: (pathname) => pathname === "/workflows" || pathname.startsWith("/workflows") || pathname.startsWith("/infrastructure/flows"),
17948
17996
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
17949
17997
  defaultPresetId: "build-workflows",
17998
+ buttonLabel: "Ask about workflows",
17999
+ headerTitle: "Ask about workflows",
17950
18000
  title: "How can we help edit workflows?",
17951
18001
  subtitle: "Shuffle Workflows Builder & Shuffle Apps",
17952
18002
  defaultPrompt: "Edit this Shuffle workflow to ",
@@ -17964,6 +18014,14 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17964
18014
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
17965
18015
  defaultPresetId: "vulnerability",
17966
18016
  sourceCategory: "vulnerabilities",
18017
+ buttonLabel: (params) => {
18018
+ const tabName = (params.tab || "assets").replace(/[-_]+/g, " ");
18019
+ return `Ask about ${tabName}`;
18020
+ },
18021
+ headerTitle: (params) => {
18022
+ const tabName = (params.tab || "assets").replace(/[-_]+/g, " ");
18023
+ return `Ask about ${tabName}`;
18024
+ },
17967
18025
  title: (params) => {
17968
18026
  const entity = getActivePageEntityName();
17969
18027
  if (entity) return `How can we help with "${entity}"?`;
@@ -17983,6 +18041,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17983
18041
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
17984
18042
  defaultPresetId: "vulnerability",
17985
18043
  sourceCategory: "vulnerabilities",
18044
+ buttonLabel: "Ask about assets",
18045
+ headerTitle: "Ask about assets",
17986
18046
  title: "How can we help with assets?",
17987
18047
  subtitle: "Shuffle Assets & Shuffle Vulnerabilities",
17988
18048
  defaultPrompt: "Audit assets and review vulnerabilities for ",
@@ -17997,6 +18057,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17997
18057
  defaultApps: [{ name: "shuffle_software" }, { name: "shuffle_vulnerabilities" }],
17998
18058
  defaultPresetId: "vulnerability",
17999
18059
  sourceCategory: "vulnerabilities",
18060
+ buttonLabel: "Ask about software",
18061
+ headerTitle: "Ask about software",
18000
18062
  title: (params) => {
18001
18063
  const entity = getActivePageEntityName();
18002
18064
  return entity ? `How can we help with "${entity}"?` : "How can we help with software inventory?";
@@ -18014,6 +18076,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
18014
18076
  defaultApps: [{ name: "shuffle_packages" }, { name: "shuffle_vulnerabilities" }],
18015
18077
  defaultPresetId: "vulnerability",
18016
18078
  sourceCategory: "vulnerabilities",
18079
+ buttonLabel: "Ask about packages",
18080
+ headerTitle: "Ask about packages",
18017
18081
  title: (params) => {
18018
18082
  const entity = getActivePageEntityName();
18019
18083
  return entity ? `How can we help with "${entity}"?` : "How can we help with packages?";
@@ -18032,6 +18096,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
18032
18096
  match: (pathname) => pathname.startsWith("/detection"),
18033
18097
  defaultApps: [{ name: "shuffle_detection" }],
18034
18098
  defaultPresetId: "detection",
18099
+ buttonLabel: "Ask about detections",
18100
+ headerTitle: "Ask about detections",
18035
18101
  title: "How can we help tune detections?",
18036
18102
  subtitle: "Shuffle Detection MCP",
18037
18103
  defaultPrompt: "Modify my detections to ",
@@ -18190,6 +18256,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
18190
18256
  defaultPresetId: null,
18191
18257
  title: "How can we help on this page?",
18192
18258
  subtitle: "General Platform Assistant",
18259
+ buttonLabel: "Ask Shuffle",
18260
+ headerTitle: "Ask Shuffle",
18193
18261
  defaultPrompt: "Help me with the following on this page: ",
18194
18262
  placeholder: "Ask anything about Shuffle, integrations, or workflows...",
18195
18263
  getStorageKey: (params, pathname) => `page_${pathname.replace(/[^a-zA-Z0-9_-]/g, "_")}`,
@@ -18603,7 +18671,14 @@ var RunFinishedSummary = ({
18603
18671
  }) => {
18604
18672
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
18605
18673
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Box, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
18606
- isRunning ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.CircularProgress, { size: 16, sx: { color: "hsl(var(--primary))" } }) : status === "FINISHED" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.CheckCircle2, { size: 18, color: "hsl(142 70% 45%)" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.AlertCircle, { size: 18, color: "hsl(var(--destructive))" }),
18674
+ isRunning ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18675
+ import_lucide_react15.Loader2,
18676
+ {
18677
+ size: 16,
18678
+ className: "animate-spin",
18679
+ style: { color: "hsl(var(--primary))", flexShrink: 0 }
18680
+ }
18681
+ ) : status === "FINISHED" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.CheckCircle2, { size: 18, color: "hsl(142 70% 45%)" }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.AlertCircle, { size: 18, color: "hsl(var(--destructive))" }),
18607
18682
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.9rem", fontWeight: 600, color: "hsl(var(--foreground))" }, children: isRunning ? "Agent is working\u2026" : status === "FINISHED" ? "Run finished" : `Run ${status.toLowerCase()}` }),
18608
18683
  showMeta && (decisionCount != null || durationSec != null && durationSec >= 1) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Typography, { sx: { fontSize: "0.75rem", color: "hsl(var(--muted-foreground))" }, children: [
18609
18684
  decisionCount != null ? `${decisionCount} step${decisionCount === 1 ? "" : "s"}` : "",
@@ -18869,14 +18944,14 @@ var TERMINAL_RUN_STATUSES = ["FINISHED", "FAILURE", "ABORTED", "CANCELLED", "CAN
18869
18944
  var resolveRunStatus = (execStatus, agentStatus) => {
18870
18945
  const e = (execStatus || "").toUpperCase();
18871
18946
  const a = (agentStatus || "").toUpperCase();
18872
- if (e === "FINISHED" || a === "FINISHED") return "FINISHED";
18947
+ if (e === "FINISHED" || a === "FINISHED" || e === "SUCCESS" || a === "SUCCESS") return "FINISHED";
18873
18948
  if (e === "FAILURE" || a === "FAILURE") return "FAILURE";
18874
18949
  if (e === "ABORTED" || a === "ABORTED") return "ABORTED";
18875
18950
  if (e === "CANCELLED" || a === "CANCELLED" || e === "CANCELED" || a === "CANCELED") return "CANCELLED";
18876
18951
  if (e === "WAITING" || a === "WAITING") return "WAITING";
18877
18952
  if (e === "PENDING" || a === "PENDING") return "PENDING";
18878
18953
  if (e === "RUNNING" || a === "RUNNING" || e === "EXECUTING" || a === "EXECUTING") return "RUNNING";
18879
- return e || a || "FINISHED";
18954
+ return e || a || "";
18880
18955
  };
18881
18956
  var buildToolName = (apps) => {
18882
18957
  if (!apps.length) return "API";
@@ -20828,6 +20903,12 @@ var AgentUI = ({
20828
20903
  const params = new URLSearchParams(window.location.search);
20829
20904
  eid = params.get("execution_id");
20830
20905
  auth = params.get("authorization");
20906
+ if (!eid && typeof window !== "undefined") {
20907
+ const pathMatch = window.location.pathname.match(/\/agents\/([a-zA-Z0-9_.-]+)/);
20908
+ if (pathMatch && pathMatch[1] && pathMatch[1] !== "index") {
20909
+ eid = pathMatch[1];
20910
+ }
20911
+ }
20831
20912
  } else if (contextStorageKey) {
20832
20913
  const saved = getPageContextChoice(contextStorageKey);
20833
20914
  if (saved?.executionId) {
@@ -21070,7 +21151,7 @@ var AgentUI = ({
21070
21151
  }, { replace: true });
21071
21152
  }
21072
21153
  getExecution(eid, auth);
21073
- onRun?.({ input: text2, success: true, executionId: eid });
21154
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
21074
21155
  } else {
21075
21156
  if (contextStorageKey && eid) {
21076
21157
  setPageContextChoice(contextStorageKey, {
@@ -21093,7 +21174,7 @@ var AgentUI = ({
21093
21174
  } else {
21094
21175
  setAgentData({ original_input: text2, status: "FINISHED", message: result.content });
21095
21176
  }
21096
- onRun?.({ input: text2, success: true, executionId: eid });
21177
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
21097
21178
  }
21098
21179
  }, [chosenApps, executionApps, getExecution, onRun, attachedImages, readUrlParams, setSearchParams, viewMode, selectedPreset, isLoggedIn]);
21099
21180
  const lastSubmittedInputRef = (0, import_react24.useRef)(null);
@@ -22025,13 +22106,6 @@ var AgentUI = ({
22025
22106
  return !chosen.some((c) => c && (c === target || c.includes(target) || target.includes(c)));
22026
22107
  });
22027
22108
  }, [finishedRunInput, chosenApps]);
22028
- const postRunUnauthedApps = (0, import_react24.useMemo)(() => {
22029
- if (authAppsLoading) return [];
22030
- return chosenApps.filter((a) => {
22031
- const slug = normalizeAgentAppName(a.name || "");
22032
- return appRequiresAuthentication(slug) && !isAppAuthenticated(a.name || "", a.id || null);
22033
- });
22034
- }, [authAppsLoading, chosenApps, isAppAuthenticated]);
22035
22109
  (0, import_react24.useEffect)(() => {
22036
22110
  if (cronManualOverrideRef.current) return;
22037
22111
  const m = Math.max(0, Math.min(59, schedMinute));
@@ -22109,7 +22183,22 @@ var AgentUI = ({
22109
22183
  options: [
22110
22184
  { value: "start", label: "Start", disabled: disableStartTab, title: disableStartTab ? "Open a new agent run from the /agents page to start a new prompt" : void 0 },
22111
22185
  { value: "simple", label: "Simple", disabled: !hasExecution },
22112
- { value: "detailed", label: "Detailed", disabled: !hasExecution },
22186
+ {
22187
+ value: "detailed",
22188
+ label: runIsActive ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
22189
+ "Detailed",
22190
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22191
+ import_lucide_react15.Loader2,
22192
+ {
22193
+ size: 12,
22194
+ className: "animate-spin",
22195
+ style: { color: "hsl(var(--primary))" }
22196
+ }
22197
+ )
22198
+ ] }) : "Detailed",
22199
+ disabled: !hasExecution,
22200
+ title: runIsActive ? "Current agent run is in progress \u2014 view live detailed timeline" : void 0
22201
+ },
22113
22202
  { type: "divider", key: "div" },
22114
22203
  {
22115
22204
  type: "action",
@@ -22135,33 +22224,8 @@ var AgentUI = ({
22135
22224
  }
22136
22225
  }
22137
22226
  }
22138
- // The live run indicator is rendered via the `trailing` slot below so
22139
- // it can use a proper MUI Tooltip while still lining up inside the
22140
- // pill with the other items.
22141
- ],
22142
- trailing: runIsActive && activeTab === "start" ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
22143
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22144
- "span",
22145
- {
22146
- "aria-hidden": true,
22147
- style: {
22148
- width: 1,
22149
- height: 18,
22150
- margin: "0 10px",
22151
- background: "hsl(var(--border))",
22152
- alignSelf: "center"
22153
- }
22154
- }
22155
- ),
22156
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Tooltip, { title: "Current agent run is still in progress", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { style: { display: "inline-flex", alignItems: "center", paddingRight: 6 }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22157
- import_material26.CircularProgress,
22158
- {
22159
- size: 14,
22160
- thickness: 5,
22161
- sx: { color: "hsl(var(--muted-foreground))", display: "block" }
22162
- }
22163
- ) }) })
22164
- ] }) : void 0
22227
+ // The live run indicator is rendered in the Detailed tab label above.
22228
+ ]
22165
22229
  }
22166
22230
  )
22167
22231
  }
@@ -22547,7 +22611,7 @@ var AgentUI = ({
22547
22611
  ]
22548
22612
  }
22549
22613
  );
22550
- const postRunDiscovery = isEffectiveSupport && (Boolean(postRunScheduleHint) && !scheduleDisabledReason || postRunAppReqs.length > 0 || postRunUnauthedApps.length > 0) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
22614
+ const postRunDiscovery = isEffectiveSupport && (Boolean(postRunScheduleHint) && !scheduleDisabledReason || postRunAppReqs.length > 0) ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
22551
22615
  import_material26.Box,
22552
22616
  {
22553
22617
  sx: {
@@ -22628,32 +22692,6 @@ var AgentUI = ({
22628
22692
  ]
22629
22693
  }
22630
22694
  ) }),
22631
- postRunUnauthedApps.map((a) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Tooltip, { title: `${(a.name || "").replace(/_/g, " ")} is not authenticated yet \u2014 click to set it up`, arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
22632
- import_material26.Box,
22633
- {
22634
- role: "button",
22635
- onClick: () => setAuthDrawerApp({ name: a.name, id: a.id || null }),
22636
- sx: {
22637
- display: "inline-flex",
22638
- alignItems: "center",
22639
- gap: 0.5,
22640
- px: 1,
22641
- py: 0.25,
22642
- borderRadius: 999,
22643
- border: "1px solid hsl(var(--severity-medium) / 0.55)",
22644
- bgcolor: "hsl(var(--severity-medium) / 0.12)",
22645
- color: "hsl(var(--foreground))",
22646
- fontSize: "0.8rem",
22647
- textTransform: "capitalize",
22648
- cursor: "pointer",
22649
- "&:hover": { bgcolor: "hsl(var(--severity-medium) / 0.2)" }
22650
- },
22651
- children: [
22652
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.AlertTriangle, { size: 13, color: "hsl(var(--severity-medium))" }),
22653
- `Authenticate ${(a.name || "").replace(/_/g, " ")}`
22654
- ]
22655
- }
22656
- ) }, `post-auth-${a.id || a.name}`)),
22657
22695
  postRunAppReqs.map((req) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22658
22696
  import_material26.Tooltip,
22659
22697
  {
@@ -22829,6 +22867,7 @@ var AgentUI = ({
22829
22867
  ] })
22830
22868
  }
22831
22869
  ) : null;
22870
+ const continuationMultiline = continuationText.includes("\n") || continuationText.length > 80;
22832
22871
  const continuationElement = finishDecisionId && !optimisticRunning ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Box, { sx: { width: "100%", maxWidth: 640, mx: "auto" }, children: [
22833
22872
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.75rem", color: "hsl(var(--muted-foreground))", mb: 0.75, textAlign: "center" }, children: "Continue this agent run with more details" }),
22834
22873
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
@@ -22843,13 +22882,15 @@ var AgentUI = ({
22843
22882
  },
22844
22883
  sx: {
22845
22884
  display: "flex",
22846
- alignItems: "flex-end",
22885
+ alignItems: continuationMultiline ? "flex-end" : "center",
22847
22886
  gap: 1,
22848
- p: 1.25,
22849
- borderRadius: 999,
22887
+ borderRadius: isPhone ? continuationMultiline ? "20px" : "28px" : "28px",
22850
22888
  border: "1.5px solid hsl(var(--border))",
22851
22889
  bgcolor: "hsl(var(--card))",
22852
- transition: "border-color 0.2s ease, box-shadow 0.2s ease",
22890
+ px: isPhone ? 1.5 : 2.25,
22891
+ py: isPhone ? continuationMultiline ? 1.25 : 1 : 1,
22892
+ boxSizing: "border-box",
22893
+ transition: "border-color 0.15s ease, box-shadow 0.15s ease",
22853
22894
  "&:focus-within": {
22854
22895
  borderColor: "hsl(var(--primary))",
22855
22896
  boxShadow: "0 0 0 3px hsla(var(--primary) / 0.12)"
@@ -22873,7 +22914,8 @@ var AgentUI = ({
22873
22914
  value: continuationText,
22874
22915
  onChange: (e) => setContinuationText(e.target.value),
22875
22916
  onKeyDown: (e) => {
22876
- if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
22917
+ if (e.nativeEvent.isComposing) return;
22918
+ if (e.key === "Enter" && !e.shiftKey || (e.metaKey || e.ctrlKey) && e.key === "Enter") {
22877
22919
  e.preventDefault();
22878
22920
  if (continuationText.trim() && !agentRequestLoading) {
22879
22921
  submitQuestions(finishDecisionId, { continue: continuationText }, true);
@@ -22881,24 +22923,44 @@ var AgentUI = ({
22881
22923
  }
22882
22924
  },
22883
22925
  disabled: agentRequestLoading,
22884
- sx: { fontSize: "0.9rem", color: "hsl(var(--foreground))", px: 2 }
22926
+ sx: {
22927
+ fontSize: "0.9rem",
22928
+ color: "hsl(var(--foreground))",
22929
+ py: 0,
22930
+ flex: "1 1 auto",
22931
+ minWidth: 0,
22932
+ "& .MuiInputBase-input": {
22933
+ pt: "5px",
22934
+ pb: "6px",
22935
+ lineHeight: 1.5
22936
+ },
22937
+ "& textarea::placeholder": {
22938
+ color: "hsl(var(--muted-foreground))",
22939
+ opacity: 0.7,
22940
+ whiteSpace: "nowrap",
22941
+ overflow: "hidden",
22942
+ textOverflow: "ellipsis"
22943
+ }
22944
+ }
22885
22945
  }
22886
22946
  ),
22887
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22947
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Tooltip, { title: submitTooltip === "\u2318+Enter to send" ? "Enter to send, Shift+Enter for new line" : submitTooltip, placement: "top", arrow: true, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
22888
22948
  import_material26.IconButton,
22889
22949
  {
22890
22950
  type: "submit",
22891
22951
  disabled: !continuationText.trim() || agentRequestLoading,
22892
22952
  sx: {
22893
- width: 36,
22894
- height: 36,
22953
+ width: 32,
22954
+ height: 32,
22955
+ flexShrink: 0,
22895
22956
  bgcolor: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary))" : "hsl(var(--muted))",
22896
22957
  color: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary-foreground))" : "hsl(var(--muted-foreground))",
22897
- "&:hover": continuationText.trim() && !agentRequestLoading ? { filter: "brightness(1.1)", bgcolor: "hsl(var(--primary))" } : {}
22958
+ "&:hover": continuationText.trim() && !agentRequestLoading ? { filter: "brightness(1.1)", bgcolor: "hsl(var(--primary))" } : {},
22959
+ "&.Mui-disabled": { bgcolor: "hsl(var(--muted))", color: "hsl(var(--muted-foreground))" }
22898
22960
  },
22899
- children: agentRequestLoading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.CircularProgress, { size: 16, sx: { color: "inherit" } }) : /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Send, { size: 18 })
22961
+ children: agentRequestLoading ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.CircularProgress, { size: 16, sx: { color: "inherit" } }) : submitIcon ?? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Play, {})
22900
22962
  }
22901
- )
22963
+ ) }) })
22902
22964
  ]
22903
22965
  }
22904
22966
  )
@@ -24150,11 +24212,11 @@ var AgentUI = ({
24150
24212
  " \xB7 ",
24151
24213
  execution?.execution_id?.slice(0, 8) || ""
24152
24214
  ] }),
24153
- pendingAuthApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
24215
+ pendingAuthApps.map((a) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
24154
24216
  import_material26.Box,
24155
24217
  {
24156
24218
  component: "span",
24157
- onClick: () => setAuthDrawerApp({ name: pendingAuthApps[0].appName, id: pendingAuthApps[0].appId }),
24219
+ onClick: () => setAuthDrawerApp({ name: a.appName, id: a.appId }),
24158
24220
  sx: {
24159
24221
  display: "inline-flex",
24160
24222
  alignItems: "center",
@@ -24173,11 +24235,12 @@ var AgentUI = ({
24173
24235
  },
24174
24236
  children: [
24175
24237
  "Missing Auth: ",
24176
- pendingAuthApps.map((a) => formatAppDisplayName(a.appName)).join(", "),
24238
+ formatAppDisplayName(a.appName),
24177
24239
  " \u2014 Connect"
24178
24240
  ]
24179
- }
24180
- )
24241
+ },
24242
+ a.appName
24243
+ ))
24181
24244
  ] })
24182
24245
  ] }),
24183
24246
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AgentAttachmentsButton_default, { attachments: llmImageAttachments }),
@@ -24357,57 +24420,6 @@ var AgentUI = ({
24357
24420
  }
24358
24421
  }
24359
24422
  ),
24360
- pendingAuthApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
24361
- import_material26.Box,
24362
- {
24363
- sx: {
24364
- mb: 2,
24365
- p: 2,
24366
- borderRadius: 2,
24367
- border: "1px solid hsla(var(--severity-medium) / 0.35)",
24368
- bgcolor: "hsla(var(--severity-medium) / 0.08)",
24369
- display: "flex",
24370
- alignItems: "center",
24371
- justifyContent: "space-between",
24372
- gap: 2,
24373
- flexWrap: "wrap"
24374
- },
24375
- children: [
24376
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Box, { sx: { display: "flex", alignItems: "center", gap: 1.5, flex: 1, minWidth: 260 }, children: [
24377
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react15.Lock, { size: 22, color: "hsl(var(--severity-medium))" }),
24378
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Box, { sx: { flex: 1, minWidth: 0 }, children: [
24379
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.875rem", fontWeight: 600, color: "hsl(var(--foreground))" }, children: pendingAuthApps.length === 1 ? `${formatAppDisplayName(pendingAuthApps[0].appName)} requires authentication` : `${pendingAuthApps.map((a) => formatAppDisplayName(a.appName)).join(", ")} require authentication` }),
24380
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.78rem", color: "hsl(var(--muted-foreground))" }, children: pendingAuthApps.length === 1 ? `The agent cannot complete steps using ${formatAppDisplayName(pendingAuthApps[0].appName)} and may remain pending until connected.` : `The agent cannot complete steps using these tools and may remain pending until connected.` })
24381
- ] })
24382
- ] }),
24383
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: pendingAuthApps.map(({ appName, appId }) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
24384
- import_material26.Button,
24385
- {
24386
- variant: "outlined",
24387
- size: "small",
24388
- onClick: () => setAuthDrawerApp({ name: appName, id: appId }),
24389
- sx: {
24390
- borderColor: "hsla(var(--severity-medium) / 0.6)",
24391
- color: "hsl(var(--foreground))",
24392
- textTransform: "none",
24393
- fontSize: "0.75rem",
24394
- fontWeight: 600,
24395
- height: 32,
24396
- "&:hover": {
24397
- bgcolor: "hsla(var(--severity-medium) / 0.15)",
24398
- borderColor: "hsl(var(--severity-medium))"
24399
- }
24400
- },
24401
- children: [
24402
- "Authenticate ",
24403
- formatAppDisplayName(appName)
24404
- ]
24405
- },
24406
- appName
24407
- )) })
24408
- ]
24409
- }
24410
- ),
24411
24423
  viewMode === "simple" && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { sx: {
24412
24424
  borderRadius: 2,
24413
24425
  border: "1px solid hsl(var(--border))",
@@ -24538,7 +24550,17 @@ var AgentUI = ({
24538
24550
  ) })
24539
24551
  ] })
24540
24552
  ] });
24541
- })() : !finishAnswer && isRunning ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "Agent is running\u2026" }) : !finishAnswer ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "No final answer returned." }) : null,
24553
+ })() : !finishAnswer && isRunning ? /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_material26.Box, { sx: { display: "flex", alignItems: "center", gap: 1, py: 0.5 }, children: [
24554
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
24555
+ import_lucide_react15.Loader2,
24556
+ {
24557
+ size: 14,
24558
+ className: "animate-spin",
24559
+ style: { color: "hsl(var(--muted-foreground))", flexShrink: 0 }
24560
+ }
24561
+ ),
24562
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "Agent is running\u2026" })
24563
+ ] }) : !finishAnswer ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Typography, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "No final answer returned." }) : null,
24542
24564
  /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
24543
24565
  import_material26.Button,
24544
24566
  {
@@ -25504,7 +25526,7 @@ var LocalLLMConfig = ({ compact, globalUrl, userdata, isLoaded, isLoggedIn, serv
25504
25526
  !compact && (() => {
25505
25527
  const preset = ENDPOINT_PRESETS.find((p) => p.label === effectivePreset);
25506
25528
  const hasProviderDocs = !!preset && (!!preset.apiKeyUrl || !!preset.apiKeyHint);
25507
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Box, { sx: { px: 2.5, py: 2, borderRadius: 2, border: "1px solid hsl(var(--border))", bgcolor: "hsl(var(--muted) / 0.3)" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Typography, { sx: { fontSize: "0.8rem", color: "hsl(var(--muted-foreground))", lineHeight: 1.5 }, children: isShuffleAI ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
25529
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Box, { sx: { px: 2.5, py: 2, borderRadius: 2, border: "1px solid hsl(var(--border))", bgcolor: "transparent" }, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Typography, { sx: { fontSize: "0.8rem", color: "hsl(var(--muted-foreground))", lineHeight: 1.5 }, children: isShuffleAI ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
25508
25530
  "Using Shuffle AI. No configuration is required. Pick another provider above to use your own endpoint. Our models are hosted on GCP, and your data stays within your tenant's region.",
25509
25531
  " ",
25510
25532
  /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_material28.Box, { component: "a", href: "https://shuffler.io/docs/AI#using-self-hosted-ai-models", target: "_blank", rel: "noopener noreferrer", sx: { color: "hsl(var(--primary))", textDecoration: "underline" }, children: "Read the docs" }),
@@ -28446,7 +28468,7 @@ var AskAiButton = ({
28446
28468
  requireSupport = true,
28447
28469
  isBeta = false,
28448
28470
  pathname,
28449
- label = "Ask AI",
28471
+ label = "Ask Shuffle",
28450
28472
  tagLabel,
28451
28473
  contextHint,
28452
28474
  tooltipTitle,
@@ -28469,7 +28491,7 @@ var AskAiButton = ({
28469
28491
  return null;
28470
28492
  }
28471
28493
  const effectiveTagLabel = tagLabel !== void 0 && !(tagLabel === "Support" && isIncidentOrDocs) ? tagLabel : effectiveIsBeta ? "Beta" : "Support";
28472
- const effectiveTooltip = tooltipTitle !== void 0 ? tooltipTitle : label !== "Ask AI" ? label : contextHint ? `Ask AI (${contextHint})` : "Ask AI \u2022 Context-aware assistant";
28494
+ const effectiveTooltip = tooltipTitle !== void 0 ? tooltipTitle : label !== "Ask AI" && label !== "Ask Shuffle" ? label : contextHint ? `Ask Shuffle (${contextHint})` : "Ask Shuffle \u2022 Context-aware assistant";
28473
28495
  return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
28474
28496
  import_material34.Box,
28475
28497
  {
@@ -28709,6 +28731,106 @@ var AskAiDrawer_default = AskAiDrawer;
28709
28731
  var import_react34 = __toESM(require("react"));
28710
28732
  var import_material36 = require("@mui/material");
28711
28733
  var import_lucide_react22 = require("lucide-react");
28734
+
28735
+ // supportEscalation.ts
28736
+ function resolveContactUserInfo(userdata) {
28737
+ let user = userdata;
28738
+ if (!user && typeof window !== "undefined") {
28739
+ try {
28740
+ const raw = localStorage.getItem("shuffle_user_info");
28741
+ if (raw) user = JSON.parse(raw);
28742
+ } catch {
28743
+ }
28744
+ }
28745
+ const name = (user?.name || user?.username || "").trim();
28746
+ let firstName = (user?.firstname || user?.firstName || "").trim();
28747
+ let lastName = (user?.lastname || user?.lastName || "").trim();
28748
+ if (!firstName && name) {
28749
+ const parts = name.split(/\s+/);
28750
+ firstName = parts[0] || "";
28751
+ if (parts.length > 1) {
28752
+ lastName = parts.slice(1).join(" ");
28753
+ }
28754
+ }
28755
+ const email = (user?.email || (user?.username?.includes("@") ? user.username : "") || "").trim();
28756
+ const title = (user?.title || user?.jobtitle || user?.job_title || user?.role || user?.active_org?.role || "").trim();
28757
+ const company = (user?.company || user?.active_org?.name || "").trim();
28758
+ return { firstName, lastName, email, title, company };
28759
+ }
28760
+ function buildSupportEscalationUrl(context) {
28761
+ const { firstName, lastName, email, title, company } = resolveContactUserInfo(context.userdata);
28762
+ const params = new URLSearchParams();
28763
+ if (firstName) params.set("firstName", firstName);
28764
+ if (lastName) params.set("lastName", lastName);
28765
+ if (email) params.set("email", email);
28766
+ if (title) params.set("title", title);
28767
+ if (company) params.set("company", company);
28768
+ params.set("category", (context.category || "support").toLowerCase());
28769
+ let sourceUrl = context.sourceUrl;
28770
+ if (!sourceUrl && typeof window !== "undefined") {
28771
+ sourceUrl = window.location.href;
28772
+ }
28773
+ if (!sourceUrl && context.pathname) {
28774
+ const origin = typeof window !== "undefined" && window.location?.origin ? window.location.origin : "https://shuffler.io";
28775
+ const s = context.search ? context.search.startsWith("?") ? context.search : `?${context.search}` : "";
28776
+ sourceUrl = `${origin}${context.pathname}${s}`;
28777
+ }
28778
+ const execId = context.executionId?.trim();
28779
+ const auth = (context.authorization || execId || "").trim();
28780
+ let runUrl = "";
28781
+ if (execId) {
28782
+ const origin = typeof window !== "undefined" && window.location?.origin ? window.location.origin : "https://shuffler.io";
28783
+ runUrl = `${origin}/agents?execution_id=${encodeURIComponent(execId)}&authorization=${encodeURIComponent(auth)}`;
28784
+ }
28785
+ const lines = ["[Escalated from Ask Shuffle]", ""];
28786
+ if (context.initialQuestion && context.initialQuestion.trim()) {
28787
+ lines.push("User Question:");
28788
+ lines.push(context.initialQuestion.trim(), "");
28789
+ }
28790
+ lines.push("Context & Source:");
28791
+ if (sourceUrl) {
28792
+ lines.push(`- Source URL: ${sourceUrl}${context.entityTitle ? ` (${context.entityTitle})` : ""}`);
28793
+ }
28794
+ if (execId) {
28795
+ lines.push(`- Execution ID: ${execId}`);
28796
+ if (runUrl) {
28797
+ lines.push(`- Agent Run: ${runUrl}`);
28798
+ }
28799
+ }
28800
+ if (context.executionStatus) {
28801
+ lines.push(`- Execution Status: ${context.executionStatus}`);
28802
+ }
28803
+ if (context.error && context.error.trim()) {
28804
+ lines.push("", "Error / Diagnostics:");
28805
+ lines.push(context.error.trim().slice(0, 1e3));
28806
+ }
28807
+ lines.push("", "Additional Notes:");
28808
+ lines.push("");
28809
+ params.set("message", lines.join("\n"));
28810
+ params.set("ref", "ask_shuffle_escalation");
28811
+ if (sourceUrl) {
28812
+ params.set("source_url", sourceUrl);
28813
+ }
28814
+ if (execId) {
28815
+ params.set("execution_id", execId);
28816
+ }
28817
+ if (auth) {
28818
+ params.set("authorization", auth);
28819
+ }
28820
+ if (runUrl) {
28821
+ params.set("run_url", runUrl);
28822
+ }
28823
+ const queryString = params.toString().replace(/\+/g, "%20");
28824
+ return `https://shuffler.io/contact?${queryString}`;
28825
+ }
28826
+ function openSupportEscalation(context) {
28827
+ const url = buildSupportEscalationUrl(context);
28828
+ if (typeof window !== "undefined") {
28829
+ window.open(url, "_blank", "noopener,noreferrer");
28830
+ }
28831
+ }
28832
+
28833
+ // components/AskAiSidePanel.tsx
28712
28834
  var import_jsx_runtime41 = require("react/jsx-runtime");
28713
28835
  var import_react35 = require("react");
28714
28836
  var AGENT_DRAWER_OPEN_EVENT = "agent-drawer-open";
@@ -28869,6 +28991,7 @@ var AskAiSidePanel = ({
28869
28991
  const [activeIncidentId, setActiveIncidentId] = (0, import_react34.useState)(null);
28870
28992
  const [activeIncidentContext, setActiveIncidentContext] = (0, import_react34.useState)(null);
28871
28993
  const [runResetKey, setRunResetKey] = (0, import_react34.useState)(0);
28994
+ const [lastRunInfo, setLastRunInfo] = (0, import_react34.useState)(null);
28872
28995
  (0, import_react34.useEffect)(() => {
28873
28996
  if (!open) {
28874
28997
  setActiveTaskId(null);
@@ -28914,6 +29037,7 @@ var AskAiSidePanel = ({
28914
29037
  }
28915
29038
  if (detail?.resetExecution) {
28916
29039
  setActiveExecutionId(null);
29040
+ setLastRunInfo(null);
28917
29041
  setRunResetKey((k) => k + 1);
28918
29042
  } else if (detail?.executionId !== void 0) {
28919
29043
  setActiveExecutionId(detail.executionId || null);
@@ -28928,8 +29052,17 @@ var AskAiSidePanel = ({
28928
29052
  }, [handleTabChange]);
28929
29053
  const handleAgentRun = (0, import_react34.useCallback)(
28930
29054
  (event) => {
28931
- if (event.executionId && activeTaskId) {
29055
+ setLastRunInfo({
29056
+ input: event.input,
29057
+ executionId: event.executionId,
29058
+ authorization: event.authorization,
29059
+ error: event.error,
29060
+ success: event.success
29061
+ });
29062
+ if (event.executionId) {
28932
29063
  setActiveExecutionId(event.executionId);
29064
+ }
29065
+ if (event.executionId && activeTaskId) {
28933
29066
  if (typeof window !== "undefined") {
28934
29067
  window.dispatchEvent(
28935
29068
  new CustomEvent("shuffle:task_ai_execution", {
@@ -28946,6 +29079,50 @@ var AskAiSidePanel = ({
28946
29079
  [activeTaskId]
28947
29080
  );
28948
29081
  const effectiveStorageKey = activeTaskId ? `${context.storageKey}:task:${activeTaskId}` : context.storageKey;
29082
+ const urlExecutionId = (0, import_react34.useMemo)(() => {
29083
+ if (typeof window === "undefined") return null;
29084
+ const s = search ?? window.location.search;
29085
+ return new URLSearchParams(s).get("execution_id");
29086
+ }, [search]);
29087
+ const urlAuthorization = (0, import_react34.useMemo)(() => {
29088
+ if (typeof window === "undefined") return null;
29089
+ const s = search ?? window.location.search;
29090
+ return new URLSearchParams(s).get("authorization");
29091
+ }, [search]);
29092
+ const hasAgentRun = Boolean(
29093
+ lastRunInfo?.executionId || lastRunInfo?.input || activeExecutionId || urlExecutionId || runResetKey === 0 && effectiveStorageKey && getPageContextChoice(effectiveStorageKey)?.executionId
29094
+ );
29095
+ const handleEscalateToSupport = (0, import_react34.useCallback)(() => {
29096
+ const savedChoice = effectiveStorageKey ? getPageContextChoice(effectiveStorageKey) : null;
29097
+ const execId = lastRunInfo?.executionId || activeExecutionId || urlExecutionId || savedChoice?.executionId;
29098
+ const auth = lastRunInfo?.authorization || urlAuthorization || savedChoice?.authorization;
29099
+ const execStatus = lastRunInfo?.success !== void 0 ? lastRunInfo.success ? "FINISHED" : "FAILED" : savedChoice?.executionStatus || (execId ? "EXECUTING" : void 0);
29100
+ const question = lastRunInfo?.input || effectiveDefaultInput || savedChoice?.draftPrompt;
29101
+ const currentFullUrl = typeof window !== "undefined" ? window.location.href : void 0;
29102
+ openSupportEscalation({
29103
+ userdata,
29104
+ sourceUrl: currentFullUrl,
29105
+ pathname: currentPathname,
29106
+ search: currentSearch,
29107
+ entityTitle,
29108
+ initialQuestion: question,
29109
+ executionId: execId || void 0,
29110
+ authorization: auth || void 0,
29111
+ executionStatus: execStatus,
29112
+ error: lastRunInfo?.error
29113
+ });
29114
+ }, [
29115
+ userdata,
29116
+ currentPathname,
29117
+ currentSearch,
29118
+ entityTitle,
29119
+ lastRunInfo,
29120
+ activeExecutionId,
29121
+ urlExecutionId,
29122
+ urlAuthorization,
29123
+ effectiveDefaultInput,
29124
+ effectiveStorageKey
29125
+ ]);
28949
29126
  const agentUiKey = activeTaskId ? `${context.storageKey}:task:${activeTaskId}:${activeExecutionId || "fresh"}:${runResetKey}` : `${context.storageKey}:${runResetKey}`;
28950
29127
  const effectiveLocalLLMSlot = localLLMSlot ?? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
28951
29128
  LocalLLMConfig_default,
@@ -29019,19 +29196,41 @@ var AskAiSidePanel = ({
29019
29196
  setIsResizing(true);
29020
29197
  const startX = e.clientX;
29021
29198
  const startW = panelWidth;
29199
+ let rafId = null;
29200
+ let currentNextWidth = startW;
29201
+ if (typeof document !== "undefined") {
29202
+ document.body.style.userSelect = "none";
29203
+ document.body.style.cursor = "col-resize";
29204
+ }
29022
29205
  const handleMouseMove = (moveEvent) => {
29023
29206
  const deltaX = startX - moveEvent.clientX;
29024
29207
  const maxAllowed = Math.min(MAX_ASK_AI_PANEL_WIDTH, (window.innerWidth || 1200) - 40);
29025
29208
  const nextWidth = Math.round(
29026
29209
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
29027
29210
  );
29028
- setPanelWidth(nextWidth);
29029
- if (typeof document !== "undefined") {
29030
- document.documentElement.style.setProperty("--ask-ai-panel-width", `${nextWidth}px`);
29211
+ currentNextWidth = nextWidth;
29212
+ if (!rafId) {
29213
+ rafId = window.requestAnimationFrame(() => {
29214
+ rafId = null;
29215
+ if (panelRef.current) {
29216
+ panelRef.current.style.width = `${currentNextWidth}px`;
29217
+ }
29218
+ if (typeof document !== "undefined") {
29219
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${currentNextWidth}px`);
29220
+ }
29221
+ });
29031
29222
  }
29032
29223
  };
29033
29224
  const handleMouseUp = (upEvent) => {
29034
29225
  setIsResizing(false);
29226
+ if (rafId) {
29227
+ window.cancelAnimationFrame(rafId);
29228
+ rafId = null;
29229
+ }
29230
+ if (typeof document !== "undefined") {
29231
+ document.body.style.userSelect = "";
29232
+ document.body.style.cursor = "";
29233
+ }
29035
29234
  window.removeEventListener("mousemove", handleMouseMove);
29036
29235
  window.removeEventListener("mouseup", handleMouseUp);
29037
29236
  const deltaX = startX - upEvent.clientX;
@@ -29039,9 +29238,16 @@ var AskAiSidePanel = ({
29039
29238
  const finalWidth = Math.round(
29040
29239
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
29041
29240
  );
29042
- try {
29043
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
29044
- } catch {
29241
+ setPanelWidth(finalWidth);
29242
+ if (panelRef.current) {
29243
+ panelRef.current.style.width = "";
29244
+ }
29245
+ if (typeof document !== "undefined") {
29246
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${finalWidth}px`);
29247
+ try {
29248
+ localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
29249
+ } catch {
29250
+ }
29045
29251
  }
29046
29252
  };
29047
29253
  window.addEventListener("mousemove", handleMouseMove);
@@ -29052,6 +29258,8 @@ var AskAiSidePanel = ({
29052
29258
  setIsResizing(true);
29053
29259
  const startX = e.touches[0].clientX;
29054
29260
  const startW = panelWidth;
29261
+ let rafId = null;
29262
+ let currentNextWidth = startW;
29055
29263
  const handleTouchMove = (moveEvent) => {
29056
29264
  if (moveEvent.touches.length !== 1) return;
29057
29265
  const deltaX = startX - moveEvent.touches[0].clientX;
@@ -29059,13 +29267,25 @@ var AskAiSidePanel = ({
29059
29267
  const nextWidth = Math.round(
29060
29268
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
29061
29269
  );
29062
- setPanelWidth(nextWidth);
29063
- if (typeof document !== "undefined") {
29064
- document.documentElement.style.setProperty("--ask-ai-panel-width", `${nextWidth}px`);
29270
+ currentNextWidth = nextWidth;
29271
+ if (!rafId) {
29272
+ rafId = window.requestAnimationFrame(() => {
29273
+ rafId = null;
29274
+ if (panelRef.current) {
29275
+ panelRef.current.style.width = `${currentNextWidth}px`;
29276
+ }
29277
+ if (typeof document !== "undefined") {
29278
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${currentNextWidth}px`);
29279
+ }
29280
+ });
29065
29281
  }
29066
29282
  };
29067
29283
  const handleTouchEnd = (endEvent) => {
29068
29284
  setIsResizing(false);
29285
+ if (rafId) {
29286
+ window.cancelAnimationFrame(rafId);
29287
+ rafId = null;
29288
+ }
29069
29289
  window.removeEventListener("touchmove", handleTouchMove);
29070
29290
  window.removeEventListener("touchend", handleTouchEnd);
29071
29291
  const clientX = endEvent.changedTouches[0]?.clientX ?? startX;
@@ -29074,9 +29294,16 @@ var AskAiSidePanel = ({
29074
29294
  const finalWidth = Math.round(
29075
29295
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
29076
29296
  );
29077
- try {
29078
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
29079
- } catch {
29297
+ setPanelWidth(finalWidth);
29298
+ if (panelRef.current) {
29299
+ panelRef.current.style.width = "";
29300
+ }
29301
+ if (typeof document !== "undefined") {
29302
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${finalWidth}px`);
29303
+ try {
29304
+ localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
29305
+ } catch {
29306
+ }
29080
29307
  }
29081
29308
  };
29082
29309
  window.addEventListener("touchmove", handleTouchMove, { passive: false });
@@ -29119,6 +29346,18 @@ var AskAiSidePanel = ({
29119
29346
  return null;
29120
29347
  }
29121
29348
  return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
29349
+ isResizing && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29350
+ import_material36.Box,
29351
+ {
29352
+ sx: {
29353
+ position: "fixed",
29354
+ inset: 0,
29355
+ zIndex: 99999,
29356
+ cursor: "col-resize",
29357
+ userSelect: "none"
29358
+ }
29359
+ }
29360
+ ),
29122
29361
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29123
29362
  import_material36.Box,
29124
29363
  {
@@ -29140,7 +29379,7 @@ var AskAiSidePanel = ({
29140
29379
  {
29141
29380
  ref: panelRef,
29142
29381
  component: "aside",
29143
- "aria-label": "Ask AI",
29382
+ "aria-label": "Ask Shuffle",
29144
29383
  "aria-hidden": !isVisible,
29145
29384
  className: themeScope?.scopeClassName,
29146
29385
  sx: [
@@ -29177,23 +29416,49 @@ var AskAiSidePanel = ({
29177
29416
  onTouchStart: handleTouchResizeStart,
29178
29417
  role: "separator",
29179
29418
  "aria-orientation": "vertical",
29180
- "aria-label": "Resize Ask AI panel",
29419
+ "aria-label": "Resize Ask Shuffle panel",
29181
29420
  sx: {
29182
29421
  position: "absolute",
29183
29422
  top: 0,
29184
29423
  bottom: 0,
29185
- left: 0,
29186
- width: 8,
29424
+ left: -6,
29425
+ width: 14,
29187
29426
  cursor: "col-resize",
29188
29427
  zIndex: 1300,
29189
29428
  transition: "background-color 0.15s ease",
29190
29429
  userSelect: "none",
29191
- display: { xs: "none", sm: "block" },
29430
+ display: { xs: "none", sm: "flex" },
29431
+ alignItems: "center",
29432
+ justifyContent: "center",
29192
29433
  "&:hover, &:active": {
29193
- bgcolor: "hsl(var(--primary) / 0.35)"
29434
+ bgcolor: "hsl(var(--primary) / 0.15)",
29435
+ "& .resize-grip": {
29436
+ bgcolor: "hsl(var(--primary))",
29437
+ opacity: 1
29438
+ }
29194
29439
  },
29195
- ...isResizing ? { bgcolor: "hsl(var(--primary) / 0.55)" } : {}
29196
- }
29440
+ ...isResizing ? {
29441
+ bgcolor: "hsl(var(--primary) / 0.2)",
29442
+ "& .resize-grip": {
29443
+ bgcolor: "hsl(var(--primary))",
29444
+ opacity: 1
29445
+ }
29446
+ } : {}
29447
+ },
29448
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29449
+ import_material36.Box,
29450
+ {
29451
+ className: "resize-grip",
29452
+ sx: {
29453
+ width: 3,
29454
+ height: 36,
29455
+ borderRadius: 1.5,
29456
+ bgcolor: "hsl(var(--muted-foreground))",
29457
+ opacity: 0.35,
29458
+ transition: "opacity 0.15s ease, background-color 0.15s ease"
29459
+ }
29460
+ }
29461
+ )
29197
29462
  }
29198
29463
  ),
29199
29464
  /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(
@@ -29210,7 +29475,7 @@ var AskAiSidePanel = ({
29210
29475
  flexShrink: 0
29211
29476
  },
29212
29477
  children: [
29213
- /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material36.Box, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
29478
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material36.Box, { sx: { display: "flex", alignItems: "center", gap: 1, minWidth: 0, flex: 1 }, children: [
29214
29479
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29215
29480
  import_material36.Box,
29216
29481
  {
@@ -29232,13 +29497,17 @@ var AskAiSidePanel = ({
29232
29497
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29233
29498
  import_material36.Typography,
29234
29499
  {
29500
+ noWrap: true,
29235
29501
  sx: {
29236
29502
  fontWeight: 700,
29237
29503
  fontSize: "0.86rem",
29238
29504
  color: "hsl(var(--foreground))",
29239
- letterSpacing: "-0.01em"
29505
+ letterSpacing: "-0.01em",
29506
+ minWidth: 0,
29507
+ overflow: "hidden",
29508
+ textOverflow: "ellipsis"
29240
29509
  },
29241
- children: safeActiveTab === "permissions" ? "Agent Permissions" : safeActiveTab === "localLLM" ? "Local LLM Settings" : (context.headerTitleFn ? context.headerTitleFn(entityTitle) : context.headerTitle) || (context.buttonLabelFn ? context.buttonLabelFn(entityTitle) : context.buttonLabel) || "Ask AI"
29510
+ children: safeActiveTab === "permissions" ? "Agent Permissions" : safeActiveTab === "localLLM" ? "Local LLM Settings" : (context.headerTitleFn ? context.headerTitleFn(entityTitle) : context.headerTitle) || (context.buttonLabelFn ? context.buttonLabelFn(entityTitle) : context.buttonLabel) || "Ask Shuffle"
29242
29511
  }
29243
29512
  ),
29244
29513
  /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
@@ -29254,30 +29523,75 @@ var AskAiSidePanel = ({
29254
29523
  borderRadius: "4px",
29255
29524
  bgcolor: isBetaRoute ? "hsla(var(--primary) / 0.12)" : "hsl(var(--muted))",
29256
29525
  color: isBetaRoute ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))",
29257
- border: isBetaRoute ? "1px solid hsla(var(--primary) / 0.26)" : "1px solid hsl(var(--border))"
29526
+ border: isBetaRoute ? "1px solid hsla(var(--primary) / 0.26)" : "1px solid hsl(var(--border))",
29527
+ flexShrink: 0
29258
29528
  },
29259
29529
  children: isBetaRoute ? "Beta" : isLoggedIn ? isSupport ? "Support" : "Agent" : "Guest"
29260
29530
  }
29261
29531
  )
29262
29532
  ] }),
29263
- /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_material36.Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29264
- import_material36.IconButton,
29265
- {
29266
- onClick: onClose,
29267
- size: "small",
29268
- "aria-label": "Close Ask AI panel",
29269
- sx: {
29270
- color: "hsl(var(--muted-foreground))",
29271
- p: 0.75,
29272
- borderRadius: "8px",
29273
- "&:hover": {
29274
- color: "hsl(var(--foreground))",
29275
- bgcolor: "hsl(var(--muted))"
29276
- }
29277
- },
29278
- children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.X, { size: 16 })
29279
- }
29280
- ) })
29533
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_material36.Box, { sx: { display: "flex", alignItems: "center", gap: 0.75, flexShrink: 0 }, children: [
29534
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29535
+ import_material36.Tooltip,
29536
+ {
29537
+ title: hasAgentRun ? "Talk to support" : "Run an agent first to provide context for support",
29538
+ arrow: true,
29539
+ placement: "bottom",
29540
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { style: { display: "inline-flex", cursor: hasAgentRun ? "pointer" : "not-allowed" }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29541
+ import_material36.Button,
29542
+ {
29543
+ onClick: handleEscalateToSupport,
29544
+ disabled: !hasAgentRun,
29545
+ size: "small",
29546
+ variant: "outlined",
29547
+ sx: {
29548
+ height: 24,
29549
+ minHeight: 24,
29550
+ px: 1,
29551
+ py: 0,
29552
+ fontSize: "0.72rem",
29553
+ fontWeight: 600,
29554
+ textTransform: "none",
29555
+ whiteSpace: "nowrap",
29556
+ borderRadius: "6px",
29557
+ borderColor: "hsl(var(--border))",
29558
+ color: hasAgentRun ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))",
29559
+ bgcolor: "transparent",
29560
+ "&:hover": {
29561
+ borderColor: "hsl(var(--primary))",
29562
+ bgcolor: "hsl(var(--muted))",
29563
+ color: "hsl(var(--primary))"
29564
+ },
29565
+ "&.Mui-disabled": {
29566
+ borderColor: "hsl(var(--border) / 0.5)",
29567
+ color: "hsl(var(--muted-foreground) / 0.6)",
29568
+ opacity: 0.6
29569
+ }
29570
+ },
29571
+ children: "Talk to support"
29572
+ }
29573
+ ) })
29574
+ }
29575
+ ),
29576
+ /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
29577
+ import_material36.IconButton,
29578
+ {
29579
+ onClick: onClose,
29580
+ size: "small",
29581
+ "aria-label": "Close Ask Shuffle panel",
29582
+ sx: {
29583
+ color: "hsl(var(--muted-foreground))",
29584
+ p: 0.75,
29585
+ borderRadius: "8px",
29586
+ "&:hover": {
29587
+ color: "hsl(var(--foreground))",
29588
+ bgcolor: "hsl(var(--muted))"
29589
+ }
29590
+ },
29591
+ children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react22.X, { size: 16 })
29592
+ }
29593
+ )
29594
+ ] })
29281
29595
  ]
29282
29596
  }
29283
29597
  ),
@@ -29575,6 +29889,8 @@ var AskAiSidePanel_default = AskAiSidePanel;
29575
29889
  var import_react36 = require("react");
29576
29890
  var import_jsx_runtime42 = require("react/jsx-runtime");
29577
29891
  var AGENT_DRAWER_OPEN_EVENT2 = "agent-drawer-open";
29892
+ var AGENT_DRAWER_CLOSE_EVENT = "agent-drawer-close";
29893
+ var AGENT_DRAWER_STATE_EVENT = "agent-drawer-state";
29578
29894
  var AskAiWidget = ({
29579
29895
  open: controlledOpen,
29580
29896
  onOpenChange,
@@ -29648,12 +29964,29 @@ var AskAiWidget = ({
29648
29964
  window.addEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
29649
29965
  return () => window.removeEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
29650
29966
  }, [isAgentDisabled, setDrawerOpen]);
29967
+ (0, import_react36.useEffect)(() => {
29968
+ const handleDrawerCloseEvent = () => {
29969
+ setDrawerOpen(false);
29970
+ };
29971
+ window.addEventListener(AGENT_DRAWER_CLOSE_EVENT, handleDrawerCloseEvent);
29972
+ return () => window.removeEventListener(AGENT_DRAWER_CLOSE_EVENT, handleDrawerCloseEvent);
29973
+ }, [setDrawerOpen]);
29974
+ (0, import_react36.useEffect)(() => {
29975
+ if (typeof window === "undefined") return;
29976
+ window.__shuffleAskAiOpen = isDrawerOpen;
29977
+ try {
29978
+ window.dispatchEvent(
29979
+ new CustomEvent(AGENT_DRAWER_STATE_EVENT, { detail: { open: isDrawerOpen } })
29980
+ );
29981
+ } catch {
29982
+ }
29983
+ }, [isDrawerOpen]);
29651
29984
  (0, import_react36.useEffect)(() => {
29652
29985
  if (propInitialTab) {
29653
29986
  setActiveTab(propInitialTab);
29654
29987
  }
29655
29988
  }, [propInitialTab]);
29656
- const effectiveButtonLabel = buttonProps?.label || (activeContext.buttonLabelFn ? activeContext.buttonLabelFn() : activeContext.buttonLabel) || "Ask AI";
29989
+ const effectiveButtonLabel = buttonProps?.label || (activeContext.buttonLabelFn ? activeContext.buttonLabelFn() : activeContext.buttonLabel) || "Ask Shuffle";
29657
29990
  const isIncidentOrDocsRoute = currentPath.startsWith("/incidents") || currentPath.startsWith("/incidents-simple") || currentPath.startsWith("/cases") || currentPath.startsWith("/alerts") || currentPath.startsWith("/tickets") || currentPath.startsWith("/docs");
29658
29991
  const isBeta = activeContext.isBeta === true || isIncidentOrDocsRoute;
29659
29992
  const effectiveRequireSupport = isBeta ? false : requireSupport;
@@ -30947,6 +31280,9 @@ var LocalLLMConfig2 = withMcpTheme(LocalLLMConfig_default, "LocalLLMConfig");
30947
31280
  var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
30948
31281
  // Annotate the CommonJS export names for ESM import in node:
30949
31282
  0 && (module.exports = {
31283
+ AGENT_DRAWER_CLOSE_EVENT,
31284
+ AGENT_DRAWER_OPEN_EVENT,
31285
+ AGENT_DRAWER_STATE_EVENT,
30950
31286
  AGENT_PRESETS,
30951
31287
  AGENT_PROMPT_PREFIX_CATEGORY,
30952
31288
  API_CONFIG,
@@ -31004,6 +31340,7 @@ var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
31004
31340
  VULN_SCANNER_PATTERNS,
31005
31341
  VideoEmbed,
31006
31342
  applyRegionFromPayload,
31343
+ buildSupportEscalationUrl,
31007
31344
  checkAppNameMatch,
31008
31345
  clearPageContextChoice,
31009
31346
  deleteDatastoreItem,
@@ -31050,6 +31387,7 @@ var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
31050
31387
  matchRoutePattern,
31051
31388
  mergeConnectedTools,
31052
31389
  normalizeAppName,
31390
+ openSupportEscalation,
31053
31391
  parseRunResult,
31054
31392
  refreshAllIntegrationStatus,
31055
31393
  registerAgentContextRule,
@@ -31059,6 +31397,7 @@ var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
31059
31397
  resolveApp,
31060
31398
  resolveApps,
31061
31399
  resolveConnectedTools,
31400
+ resolveContactUserInfo,
31062
31401
  resolveVideoUrl,
31063
31402
  scheduleAgentRun,
31064
31403
  searchAgentActivity,