@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.mjs CHANGED
@@ -26,13 +26,13 @@ import {
26
26
  } from "./chunk-7HRNENGV.mjs";
27
27
 
28
28
  // index.ts
29
- import "./shuffle-mcp-SHQXQS3F.css";
29
+ import "./shuffle-mcp-E56K3LGU.css";
30
30
  import React10 from "react";
31
31
 
32
32
  // ShuffleMcpThemeProvider.tsx
33
33
  import React from "react";
34
34
  import { ThemeProvider, createTheme, useTheme as useMuiTheme } from "@mui/material";
35
- import "./shuffle-mcp-SHQXQS3F.css";
35
+ import "./shuffle-mcp-E56K3LGU.css";
36
36
  import { jsx, jsxs } from "react/jsx-runtime";
37
37
  var readHtmlDarkClass = () => {
38
38
  if (typeof document === "undefined") return false;
@@ -249,7 +249,7 @@ import { Drawer } from "@mui/material";
249
249
 
250
250
  // components/Markdown.tsx
251
251
  import { useMemo } from "react";
252
- import { Box as Box2 } from "@mui/material";
252
+ import { Box as Box2, useTheme } from "@mui/material";
253
253
  import ReactMarkdown from "react-markdown";
254
254
  import remarkGfm from "remark-gfm";
255
255
  import remarkBreaks from "remark-breaks";
@@ -1120,18 +1120,22 @@ var jsonBoxSx = {
1120
1120
  border: "1px solid hsl(var(--border))",
1121
1121
  "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" }
1122
1122
  };
1123
- var MarkdownJsonBlock = ({ src }) => /* @__PURE__ */ jsx3(Box2, { sx: jsonBoxSx, children: /* @__PURE__ */ jsx3(
1124
- JsonView,
1125
- {
1126
- src,
1127
- dark: true,
1128
- collapsed: defaultCollapsed,
1129
- collapseStringMode: "word",
1130
- collapseStringsAfterLength: 120,
1131
- enableClipboard: true,
1132
- displaySize: true
1133
- }
1134
- ) });
1123
+ var MarkdownJsonBlock = ({ src }) => {
1124
+ const theme = useTheme();
1125
+ const isDark = theme.palette.mode === "dark";
1126
+ return /* @__PURE__ */ jsx3(Box2, { sx: jsonBoxSx, children: /* @__PURE__ */ jsx3(
1127
+ JsonView,
1128
+ {
1129
+ src,
1130
+ dark: isDark,
1131
+ collapsed: defaultCollapsed,
1132
+ collapseStringMode: "word",
1133
+ collapseStringsAfterLength: 120,
1134
+ enableClipboard: true,
1135
+ displaySize: true
1136
+ }
1137
+ ) });
1138
+ };
1135
1139
  var baseSx = {
1136
1140
  color: "inherit",
1137
1141
  fontSize: "inherit",
@@ -3737,7 +3741,7 @@ var AppAuthCard = ({
3737
3741
  size: "small",
3738
3742
  sx: {
3739
3743
  "& .MuiOutlinedInput-root": {
3740
- backgroundColor: "hsl(var(--background))",
3744
+ backgroundColor: "transparent",
3741
3745
  borderRadius: 1,
3742
3746
  "& fieldset": { borderColor: "hsl(var(--border))" },
3743
3747
  "&:hover fieldset": { borderColor: "hsl(var(--border) / 0.8)" },
@@ -3760,7 +3764,7 @@ var AppAuthCard = ({
3760
3764
  size: "small",
3761
3765
  sx: {
3762
3766
  "& .MuiOutlinedInput-root": {
3763
- backgroundColor: "hsl(var(--background))",
3767
+ backgroundColor: "transparent",
3764
3768
  borderRadius: 1,
3765
3769
  "& fieldset": { borderColor: "hsl(var(--border))" },
3766
3770
  "&:hover fieldset": { borderColor: "hsl(var(--border) / 0.8)" },
@@ -3880,7 +3884,7 @@ var AppAuthCard = ({
3880
3884
  name: `auth-${fieldKey}-${app2.objectID}-${Math.random().toString(36).slice(2, 8)}`,
3881
3885
  sx: {
3882
3886
  "& .MuiOutlinedInput-root": {
3883
- backgroundColor: isSecretField ? "hsl(var(--primary) / 0.06)" : "hsl(var(--muted))",
3887
+ backgroundColor: "transparent",
3884
3888
  borderRadius: 1,
3885
3889
  "& fieldset": {
3886
3890
  borderColor: fieldErrors[fieldKey] ? "hsl(var(--destructive))" : isSecretField ? "hsl(var(--primary) / 0.5)" : "hsl(var(--border))",
@@ -4167,7 +4171,7 @@ var AppAuthCard = ({
4167
4171
  }
4168
4172
  },
4169
4173
  sx: {
4170
- backgroundColor: "hsl(var(--background))",
4174
+ backgroundColor: "transparent",
4171
4175
  borderRadius: 2,
4172
4176
  color: "hsl(var(--foreground))",
4173
4177
  "& .MuiOutlinedInput-notchedOutline": { borderColor: "hsl(var(--border))" },
@@ -4342,7 +4346,7 @@ var AppAuthCard = ({
4342
4346
  !showAddNewForm && selectedAuth && /* @__PURE__ */ jsxs2(Box3, { sx: {
4343
4347
  mt: 2,
4344
4348
  p: 0,
4345
- backgroundColor: "hsl(var(--muted))",
4349
+ backgroundColor: "transparent",
4346
4350
  borderRadius: 3,
4347
4351
  border: "1px solid hsl(var(--border))",
4348
4352
  overflow: "hidden"
@@ -4354,7 +4358,7 @@ var AppAuthCard = ({
4354
4358
  px: { xs: 2, sm: 2.5 },
4355
4359
  py: 1.5,
4356
4360
  borderBottom: "1px solid hsl(var(--border))",
4357
- backgroundColor: "hsl(var(--background-surface))"
4361
+ backgroundColor: "transparent"
4358
4362
  }, children: [
4359
4363
  /* @__PURE__ */ jsx6(Box3, { sx: {
4360
4364
  width: 8,
@@ -4392,8 +4396,8 @@ var AppAuthCard = ({
4392
4396
  display: "flex",
4393
4397
  alignItems: "center",
4394
4398
  justifyContent: "center",
4395
- 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)",
4396
- 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)"}`,
4399
+ backgroundColor: "transparent",
4400
+ 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))"}`,
4397
4401
  flexShrink: 0
4398
4402
  }, children: /* @__PURE__ */ jsx6(CheckCircleIcon, { size: 20 }) }),
4399
4403
  /* @__PURE__ */ jsxs2(Box3, { sx: { minWidth: 0, flex: 1 }, children: [
@@ -4546,9 +4550,9 @@ var AppAuthCard = ({
4546
4550
  {
4547
4551
  severity: "error",
4548
4552
  sx: {
4549
- backgroundColor: "hsl(var(--destructive) / 0.1)",
4553
+ backgroundColor: "transparent",
4550
4554
  color: "hsl(var(--destructive))",
4551
- border: "1px solid hsl(var(--destructive) / 0.2)",
4555
+ border: "1px solid hsl(var(--destructive) / 0.3)",
4552
4556
  borderRadius: 2,
4553
4557
  "& .MuiAlert-icon": { color: "hsl(var(--destructive))" }
4554
4558
  },
@@ -4566,9 +4570,9 @@ var AppAuthCard = ({
4566
4570
  {
4567
4571
  severity: "warning",
4568
4572
  sx: {
4569
- backgroundColor: "hsl(var(--severity-medium) / 0.1)",
4573
+ backgroundColor: "transparent",
4570
4574
  color: "hsl(var(--severity-medium))",
4571
- border: "1px solid hsl(var(--severity-medium) / 0.2)",
4575
+ border: "1px solid hsl(var(--severity-medium) / 0.3)",
4572
4576
  borderRadius: 2,
4573
4577
  "& .MuiAlert-icon": {
4574
4578
  color: "hsl(var(--severity-medium))"
@@ -4587,7 +4591,7 @@ var AppAuthCard = ({
4587
4591
  ] }),
4588
4592
  (apiAuthEntries.length === 0 || showAddNewForm) && /* @__PURE__ */ jsxs2(Box3, { sx: {
4589
4593
  p: 3,
4590
- backgroundColor: "hsl(var(--background) / 0.4)",
4594
+ backgroundColor: "transparent",
4591
4595
  borderRadius: 2,
4592
4596
  border: "1px solid hsl(var(--border))"
4593
4597
  }, children: [
@@ -4596,9 +4600,9 @@ var AppAuthCard = ({
4596
4600
  {
4597
4601
  severity: "warning",
4598
4602
  sx: {
4599
- backgroundColor: "hsl(var(--severity-medium) / 0.1)",
4603
+ backgroundColor: "transparent",
4600
4604
  color: "hsl(var(--severity-medium))",
4601
- border: "1px solid hsl(var(--severity-medium) / 0.2)",
4605
+ border: "1px solid hsl(var(--severity-medium) / 0.3)",
4602
4606
  borderRadius: 2,
4603
4607
  mb: 2,
4604
4608
  "& .MuiAlert-icon": { color: "hsl(var(--severity-medium))" }
@@ -4618,7 +4622,7 @@ var AppAuthCard = ({
4618
4622
  {
4619
4623
  severity: "error",
4620
4624
  sx: {
4621
- backgroundColor: "hsl(var(--destructive) / 0.1)",
4625
+ backgroundColor: "transparent",
4622
4626
  color: "hsl(var(--destructive))",
4623
4627
  border: "1px solid hsl(var(--destructive) / 0.3)",
4624
4628
  borderRadius: 2
@@ -4630,9 +4634,9 @@ var AppAuthCard = ({
4630
4634
  {
4631
4635
  severity: "info",
4632
4636
  sx: {
4633
- backgroundColor: "hsl(var(--severity-info) / 0.1)",
4637
+ backgroundColor: "transparent",
4634
4638
  color: "hsl(var(--severity-info))",
4635
- border: "1px solid hsl(var(--severity-info) / 0.2)",
4639
+ border: "1px solid hsl(var(--severity-info) / 0.3)",
4636
4640
  borderRadius: 2,
4637
4641
  "& .MuiAlert-icon": { color: "hsl(var(--severity-info))" }
4638
4642
  },
@@ -4650,7 +4654,7 @@ var AppAuthCard = ({
4650
4654
  {
4651
4655
  severity: "error",
4652
4656
  sx: {
4653
- backgroundColor: "hsl(var(--destructive) / 0.1)",
4657
+ backgroundColor: "transparent",
4654
4658
  color: "hsl(var(--destructive))",
4655
4659
  border: "1px solid hsl(var(--destructive) / 0.3)",
4656
4660
  borderRadius: 2
@@ -4666,7 +4670,7 @@ var AppAuthCard = ({
4666
4670
  {
4667
4671
  severity: "error",
4668
4672
  sx: {
4669
- backgroundColor: "hsl(var(--destructive) / 0.1)",
4673
+ backgroundColor: "transparent",
4670
4674
  color: "hsl(var(--destructive))",
4671
4675
  border: "1px solid hsl(var(--destructive) / 0.3)",
4672
4676
  borderRadius: 2
@@ -5017,7 +5021,7 @@ var AppAuthConfig = ({
5017
5021
  {
5018
5022
  severity: "info",
5019
5023
  sx: {
5020
- backgroundColor: "hsl(var(--primary) / 0.1)",
5024
+ backgroundColor: "transparent",
5021
5025
  color: "hsl(var(--primary))",
5022
5026
  border: "1px solid hsl(var(--primary) / 0.3)",
5023
5027
  borderRadius: 2
@@ -6716,7 +6720,8 @@ import {
6716
6720
  TextField as TextField2,
6717
6721
  IconButton as IconButton3,
6718
6722
  Tooltip as Tooltip4,
6719
- Avatar as Avatar4
6723
+ Avatar as Avatar4,
6724
+ useTheme as useTheme2
6720
6725
  } from "@mui/material";
6721
6726
  import {
6722
6727
  Code2,
@@ -6987,6 +6992,8 @@ var SingulActionsPreview = ({
6987
6992
  activeOrgId,
6988
6993
  onAuthenticate
6989
6994
  }) => {
6995
+ const theme = useTheme2();
6996
+ const isDark = theme.palette.mode === "dark";
6990
6997
  const defaultCategory = useMemo4(() => pickDefaultCategory(categories), [categories]);
6991
6998
  const actions = ALL_ACTIONS;
6992
6999
  const sortedActions = useMemo4(() => {
@@ -7480,7 +7487,7 @@ var SingulActionsPreview = ({
7480
7487
  JsonView2,
7481
7488
  {
7482
7489
  src: deepParseJsonStrings(parsedResult),
7483
- dark: true,
7490
+ dark: isDark,
7484
7491
  collapsed: defaultCollapsed,
7485
7492
  collapseStringMode: "word",
7486
7493
  collapseStringsAfterLength: 120,
@@ -8598,6 +8605,7 @@ var useOverlayLayer = (open, options) => {
8598
8605
  return zIndex;
8599
8606
  };
8600
8607
  var useDrawerLayer = (open, base3 = DRAWER_LAYER_BASE) => useOverlayLayer(open, { base: base3 });
8608
+ 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;
8601
8609
  var isSurfaceElement = (el) => {
8602
8610
  if (!(el instanceof HTMLElement)) return false;
8603
8611
  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]"));
@@ -8625,6 +8633,7 @@ var installGlobalOverlayAutoLayer = () => {
8625
8633
  if (store[AUTO_LAYER_KEY]) return;
8626
8634
  store[AUTO_LAYER_KEY] = true;
8627
8635
  const handleElementOpen = (el) => {
8636
+ if (!isShuffleOwnedOverlay(el)) return;
8628
8637
  if (isSurfaceElement(el)) {
8629
8638
  let layerId = el.dataset.shuffleLayerId;
8630
8639
  if (!layerId) {
@@ -8839,7 +8848,7 @@ function AppDetailDrawer({
8839
8848
  }
8840
8849
 
8841
8850
  // views/ShuffleMCP.tsx
8842
- import "./shuffle-mcp-SHQXQS3F.css";
8851
+ import "./shuffle-mcp-E56K3LGU.css";
8843
8852
 
8844
8853
  // components/SegmentedControl.tsx
8845
8854
  import * as React3 from "react";
@@ -11981,14 +11990,14 @@ import {
11981
11990
  RotateCcw as RestartAltIcon2,
11982
11991
  Clock as ScheduleIcon2,
11983
11992
  Settings as SettingsIcon,
11984
- Send as SendIcon,
11985
11993
  CircleStop as StopCircleIcon,
11986
11994
  ThumbsDown as ThumbDownIcon,
11987
11995
  ThumbsUp as ThumbUpIcon,
11988
11996
  AlertTriangle as WarningIcon,
11989
11997
  Search as SearchIcon,
11990
11998
  Image as ImageIcon2,
11991
- Plus as PlusIcon2
11999
+ Plus as PlusIcon2,
12000
+ Loader2 as Loader2Icon
11992
12001
  } from "lucide-react";
11993
12002
 
11994
12003
  // ../Shuffle-Core/components/WorkflowRunExplorer.tsx
@@ -13044,6 +13053,7 @@ var AgentPresets_default = AgentPresets;
13044
13053
 
13045
13054
  // ../lib/agentTools.ts
13046
13055
  var STORAGE_KEY3 = "agent_tools_config";
13056
+ var DATASTORE_CATEGORY = DATASTORE_CATEGORIES.CONFIGURATION;
13047
13057
  var AGENT_TOOLS_CHANGED_EVENT = "agent-tools-changed";
13048
13058
  var DEFAULT_AGENT = "default";
13049
13059
  var DEFAULT_ACTION_TYPE = "timeline_reply";
@@ -13152,7 +13162,10 @@ var writeCache = (entries, explicitUpdatedAt) => {
13152
13162
  const orgKey = getStorageKey();
13153
13163
  localStorage.setItem(orgKey, serialized);
13154
13164
  if (orgKey !== STORAGE_KEY3) {
13155
- localStorage.setItem(STORAGE_KEY3, serialized);
13165
+ try {
13166
+ localStorage.setItem(STORAGE_KEY3, serialized);
13167
+ } catch {
13168
+ }
13156
13169
  }
13157
13170
  window.dispatchEvent(
13158
13171
  new CustomEvent(AGENT_TOOLS_CHANGED_EVENT, { detail: { updatedAt, entries } })
@@ -16594,6 +16607,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16594
16607
  defaultPresetId: "incident-response",
16595
16608
  sourceCategory: "incidents",
16596
16609
  isBeta: true,
16610
+ buttonLabel: "Ask about this case",
16611
+ headerTitle: "Ask about this case",
16597
16612
  title: (params, _, entityOverride) => {
16598
16613
  const cleanId = formatEntityDisplayId(params.id);
16599
16614
  const entity = entityOverride || getActivePageEntityName();
@@ -16617,6 +16632,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16617
16632
  defaultPresetId: "incident-response",
16618
16633
  sourceCategory: "incidents",
16619
16634
  isBeta: true,
16635
+ buttonLabel: "Ask about this ticket",
16636
+ headerTitle: "Ask about this ticket",
16620
16637
  title: (params, _, entityOverride) => {
16621
16638
  const cleanId = formatEntityDisplayId(params.id);
16622
16639
  const entity = entityOverride || getActivePageEntityName();
@@ -16639,6 +16656,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16639
16656
  defaultPresetId: "incident-response",
16640
16657
  sourceCategory: "incidents",
16641
16658
  isBeta: true,
16659
+ buttonLabel: "Ask about this alert",
16660
+ headerTitle: "Ask about this alert",
16642
16661
  title: (params, _, entityOverride) => {
16643
16662
  const cleanId = formatEntityDisplayId(params.id);
16644
16663
  const entity = entityOverride || getActivePageEntityName();
@@ -16661,6 +16680,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16661
16680
  defaultPresetId: "incident-response",
16662
16681
  sourceCategory: "incidents",
16663
16682
  isBeta: true,
16683
+ buttonLabel: "Ask about incidents",
16684
+ headerTitle: "Ask about incidents",
16664
16685
  title: "How can we help handle incidents?",
16665
16686
  subtitle: "Shuffle Incidents MCP",
16666
16687
  defaultPrompt: "Investigate this incident and recommend next steps: ",
@@ -16676,6 +16697,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16676
16697
  defaultPresetId: "incident-response",
16677
16698
  sourceCategory: "incidents",
16678
16699
  isBeta: true,
16700
+ buttonLabel: "Ask about cases",
16701
+ headerTitle: "Ask about cases",
16679
16702
  title: "How can we help handle cases?",
16680
16703
  subtitle: "Shuffle Incidents MCP",
16681
16704
  defaultPrompt: "Investigate this case and recommend next steps: ",
@@ -16691,6 +16714,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16691
16714
  defaultPresetId: "incident-response",
16692
16715
  sourceCategory: "incidents",
16693
16716
  isBeta: true,
16717
+ buttonLabel: "Ask about tickets",
16718
+ headerTitle: "Ask about tickets",
16694
16719
  title: "How can we help handle tickets?",
16695
16720
  subtitle: "Shuffle Incidents MCP",
16696
16721
  defaultPrompt: "Investigate this ticket and recommend next steps: ",
@@ -16706,6 +16731,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16706
16731
  defaultPresetId: "incident-response",
16707
16732
  sourceCategory: "incidents",
16708
16733
  isBeta: true,
16734
+ buttonLabel: "Ask about alerts",
16735
+ headerTitle: "Ask about alerts",
16709
16736
  title: "How can we help handle alerts?",
16710
16737
  subtitle: "Shuffle Incidents MCP",
16711
16738
  defaultPrompt: "Investigate this alert and recommend next steps: ",
@@ -16726,6 +16753,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16726
16753
  ],
16727
16754
  defaultPresetId: "vulnerability",
16728
16755
  sourceCategory: "vulnerabilities",
16756
+ buttonLabel: "Ask about this vulnerability",
16757
+ headerTitle: "Ask about this vulnerability",
16729
16758
  title: (params, _, entityOverride) => {
16730
16759
  const cleanId = formatEntityDisplayId(params.id);
16731
16760
  const entity = entityOverride || getActivePageEntityName();
@@ -16750,6 +16779,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16750
16779
  ],
16751
16780
  defaultPresetId: "vulnerability",
16752
16781
  sourceCategory: "vulnerabilities",
16782
+ buttonLabel: "Ask about vulnerabilities",
16783
+ headerTitle: "Ask about vulnerabilities",
16753
16784
  title: "How can we help review vulnerabilities?",
16754
16785
  subtitle: () => "Shuffle Vulnerabilities & Shuffle Software and Packages",
16755
16786
  defaultPrompt: "Review my current vulnerabilities and prioritize them by ",
@@ -16766,6 +16797,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16766
16797
  match: "/monitors/:id/terminal",
16767
16798
  defaultApps: [{ name: "shuffle_host_monitors" }],
16768
16799
  defaultPresetId: "host-monitor-control",
16800
+ buttonLabel: "Ask about terminal",
16801
+ headerTitle: "Ask about terminal",
16769
16802
  title: (params, _, entityOverride) => {
16770
16803
  const cleanId = formatEntityDisplayId(params.id);
16771
16804
  const entity = entityOverride || getActivePageEntityName();
@@ -16786,6 +16819,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16786
16819
  match: "/monitors/terminal",
16787
16820
  defaultApps: [{ name: "shuffle_host_monitors" }],
16788
16821
  defaultPresetId: "host-monitor-control",
16822
+ buttonLabel: "Ask about terminal",
16823
+ headerTitle: "Ask about terminal",
16789
16824
  title: "How can we help in the host terminal?",
16790
16825
  subtitle: "Shuffle Host Monitors MCP",
16791
16826
  defaultPrompt: "Run terminal commands on this host to ",
@@ -16799,6 +16834,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16799
16834
  match: "/monitors/response",
16800
16835
  defaultApps: [{ name: "shuffle_host_monitors" }],
16801
16836
  defaultPresetId: "host-monitor-control",
16837
+ buttonLabel: "Ask about host response",
16838
+ headerTitle: "Ask about host response",
16802
16839
  title: "How can we help with host response?",
16803
16840
  subtitle: "Shuffle Host Monitors MCP",
16804
16841
  defaultPrompt: "Take response actions on this host to ",
@@ -16812,6 +16849,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16812
16849
  match: "/monitors/:id",
16813
16850
  defaultApps: [{ name: "shuffle_host_monitors" }],
16814
16851
  defaultPresetId: "host-monitor-control",
16852
+ buttonLabel: "Ask about this host",
16853
+ headerTitle: "Ask about this host",
16815
16854
  title: (params, _, entityOverride) => {
16816
16855
  const cleanId = formatEntityDisplayId(params.id);
16817
16856
  const entity = entityOverride || getActivePageEntityName();
@@ -16832,6 +16871,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16832
16871
  match: (pathname) => pathname.startsWith("/monitors"),
16833
16872
  defaultApps: [{ name: "shuffle_host_monitors" }],
16834
16873
  defaultPresetId: "host-monitor-control",
16874
+ buttonLabel: "Ask about host monitors",
16875
+ headerTitle: "Ask about host monitors",
16835
16876
  title: "How can we help with host monitors?",
16836
16877
  subtitle: "Shuffle Host Monitors MCP",
16837
16878
  defaultPrompt: "Take control of this host and help me with: ",
@@ -16848,6 +16889,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16848
16889
  match: "/workflows/:id",
16849
16890
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
16850
16891
  defaultPresetId: "build-workflows",
16892
+ buttonLabel: "Ask about this workflow",
16893
+ headerTitle: "Ask about this workflow",
16851
16894
  title: (params, _, entityOverride) => {
16852
16895
  const cleanId = formatEntityDisplayId(params.id);
16853
16896
  const entity = entityOverride || getActivePageEntityName();
@@ -16868,6 +16911,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16868
16911
  match: (pathname) => pathname === "/workflows" || pathname.startsWith("/workflows") || pathname.startsWith("/infrastructure/flows"),
16869
16912
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
16870
16913
  defaultPresetId: "build-workflows",
16914
+ buttonLabel: "Ask about workflows",
16915
+ headerTitle: "Ask about workflows",
16871
16916
  title: "How can we help edit workflows?",
16872
16917
  subtitle: "Shuffle Workflows Builder & Shuffle Apps",
16873
16918
  defaultPrompt: "Edit this Shuffle workflow to ",
@@ -16885,6 +16930,14 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16885
16930
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
16886
16931
  defaultPresetId: "vulnerability",
16887
16932
  sourceCategory: "vulnerabilities",
16933
+ buttonLabel: (params) => {
16934
+ const tabName = (params.tab || "assets").replace(/[-_]+/g, " ");
16935
+ return `Ask about ${tabName}`;
16936
+ },
16937
+ headerTitle: (params) => {
16938
+ const tabName = (params.tab || "assets").replace(/[-_]+/g, " ");
16939
+ return `Ask about ${tabName}`;
16940
+ },
16888
16941
  title: (params) => {
16889
16942
  const entity = getActivePageEntityName();
16890
16943
  if (entity) return `How can we help with "${entity}"?`;
@@ -16904,6 +16957,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16904
16957
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
16905
16958
  defaultPresetId: "vulnerability",
16906
16959
  sourceCategory: "vulnerabilities",
16960
+ buttonLabel: "Ask about assets",
16961
+ headerTitle: "Ask about assets",
16907
16962
  title: "How can we help with assets?",
16908
16963
  subtitle: "Shuffle Assets & Shuffle Vulnerabilities",
16909
16964
  defaultPrompt: "Audit assets and review vulnerabilities for ",
@@ -16918,6 +16973,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16918
16973
  defaultApps: [{ name: "shuffle_software" }, { name: "shuffle_vulnerabilities" }],
16919
16974
  defaultPresetId: "vulnerability",
16920
16975
  sourceCategory: "vulnerabilities",
16976
+ buttonLabel: "Ask about software",
16977
+ headerTitle: "Ask about software",
16921
16978
  title: (params) => {
16922
16979
  const entity = getActivePageEntityName();
16923
16980
  return entity ? `How can we help with "${entity}"?` : "How can we help with software inventory?";
@@ -16935,6 +16992,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16935
16992
  defaultApps: [{ name: "shuffle_packages" }, { name: "shuffle_vulnerabilities" }],
16936
16993
  defaultPresetId: "vulnerability",
16937
16994
  sourceCategory: "vulnerabilities",
16995
+ buttonLabel: "Ask about packages",
16996
+ headerTitle: "Ask about packages",
16938
16997
  title: (params) => {
16939
16998
  const entity = getActivePageEntityName();
16940
16999
  return entity ? `How can we help with "${entity}"?` : "How can we help with packages?";
@@ -16953,6 +17012,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16953
17012
  match: (pathname) => pathname.startsWith("/detection"),
16954
17013
  defaultApps: [{ name: "shuffle_detection" }],
16955
17014
  defaultPresetId: "detection",
17015
+ buttonLabel: "Ask about detections",
17016
+ headerTitle: "Ask about detections",
16956
17017
  title: "How can we help tune detections?",
16957
17018
  subtitle: "Shuffle Detection MCP",
16958
17019
  defaultPrompt: "Modify my detections to ",
@@ -17111,6 +17172,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17111
17172
  defaultPresetId: null,
17112
17173
  title: "How can we help on this page?",
17113
17174
  subtitle: "General Platform Assistant",
17175
+ buttonLabel: "Ask Shuffle",
17176
+ headerTitle: "Ask Shuffle",
17114
17177
  defaultPrompt: "Help me with the following on this page: ",
17115
17178
  placeholder: "Ask anything about Shuffle, integrations, or workflows...",
17116
17179
  getStorageKey: (params, pathname) => `page_${pathname.replace(/[^a-zA-Z0-9_-]/g, "_")}`,
@@ -17524,7 +17587,14 @@ var RunFinishedSummary = ({
17524
17587
  }) => {
17525
17588
  return /* @__PURE__ */ jsxs24(Fragment12, { children: [
17526
17589
  /* @__PURE__ */ jsxs24(Box22, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
17527
- isRunning ? /* @__PURE__ */ jsx31(CircularProgress5, { size: 16, sx: { color: "hsl(var(--primary))" } }) : status === "FINISHED" ? /* @__PURE__ */ jsx31(CheckCircleIcon3, { size: 18, color: "hsl(142 70% 45%)" }) : /* @__PURE__ */ jsx31(ErrorIcon, { size: 18, color: "hsl(var(--destructive))" }),
17590
+ isRunning ? /* @__PURE__ */ jsx31(
17591
+ Loader2Icon,
17592
+ {
17593
+ size: 16,
17594
+ className: "animate-spin",
17595
+ style: { color: "hsl(var(--primary))", flexShrink: 0 }
17596
+ }
17597
+ ) : status === "FINISHED" ? /* @__PURE__ */ jsx31(CheckCircleIcon3, { size: 18, color: "hsl(142 70% 45%)" }) : /* @__PURE__ */ jsx31(ErrorIcon, { size: 18, color: "hsl(var(--destructive))" }),
17528
17598
  /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.9rem", fontWeight: 600, color: "hsl(var(--foreground))" }, children: isRunning ? "Agent is working\u2026" : status === "FINISHED" ? "Run finished" : `Run ${status.toLowerCase()}` }),
17529
17599
  showMeta && (decisionCount != null || durationSec != null && durationSec >= 1) && /* @__PURE__ */ jsxs24(Typography19, { sx: { fontSize: "0.75rem", color: "hsl(var(--muted-foreground))" }, children: [
17530
17600
  decisionCount != null ? `${decisionCount} step${decisionCount === 1 ? "" : "s"}` : "",
@@ -17790,14 +17860,14 @@ var TERMINAL_RUN_STATUSES = ["FINISHED", "FAILURE", "ABORTED", "CANCELLED", "CAN
17790
17860
  var resolveRunStatus = (execStatus, agentStatus) => {
17791
17861
  const e = (execStatus || "").toUpperCase();
17792
17862
  const a = (agentStatus || "").toUpperCase();
17793
- if (e === "FINISHED" || a === "FINISHED") return "FINISHED";
17863
+ if (e === "FINISHED" || a === "FINISHED" || e === "SUCCESS" || a === "SUCCESS") return "FINISHED";
17794
17864
  if (e === "FAILURE" || a === "FAILURE") return "FAILURE";
17795
17865
  if (e === "ABORTED" || a === "ABORTED") return "ABORTED";
17796
17866
  if (e === "CANCELLED" || a === "CANCELLED" || e === "CANCELED" || a === "CANCELED") return "CANCELLED";
17797
17867
  if (e === "WAITING" || a === "WAITING") return "WAITING";
17798
17868
  if (e === "PENDING" || a === "PENDING") return "PENDING";
17799
17869
  if (e === "RUNNING" || a === "RUNNING" || e === "EXECUTING" || a === "EXECUTING") return "RUNNING";
17800
- return e || a || "FINISHED";
17870
+ return e || a || "";
17801
17871
  };
17802
17872
  var buildToolName = (apps) => {
17803
17873
  if (!apps.length) return "API";
@@ -19749,6 +19819,12 @@ var AgentUI = ({
19749
19819
  const params = new URLSearchParams(window.location.search);
19750
19820
  eid = params.get("execution_id");
19751
19821
  auth = params.get("authorization");
19822
+ if (!eid && typeof window !== "undefined") {
19823
+ const pathMatch = window.location.pathname.match(/\/agents\/([a-zA-Z0-9_.-]+)/);
19824
+ if (pathMatch && pathMatch[1] && pathMatch[1] !== "index") {
19825
+ eid = pathMatch[1];
19826
+ }
19827
+ }
19752
19828
  } else if (contextStorageKey) {
19753
19829
  const saved = getPageContextChoice(contextStorageKey);
19754
19830
  if (saved?.executionId) {
@@ -19991,7 +20067,7 @@ var AgentUI = ({
19991
20067
  }, { replace: true });
19992
20068
  }
19993
20069
  getExecution(eid, auth);
19994
- onRun?.({ input: text2, success: true, executionId: eid });
20070
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
19995
20071
  } else {
19996
20072
  if (contextStorageKey && eid) {
19997
20073
  setPageContextChoice(contextStorageKey, {
@@ -20014,7 +20090,7 @@ var AgentUI = ({
20014
20090
  } else {
20015
20091
  setAgentData({ original_input: text2, status: "FINISHED", message: result.content });
20016
20092
  }
20017
- onRun?.({ input: text2, success: true, executionId: eid });
20093
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
20018
20094
  }
20019
20095
  }, [chosenApps, executionApps, getExecution, onRun, attachedImages, readUrlParams, setSearchParams, viewMode, selectedPreset, isLoggedIn]);
20020
20096
  const lastSubmittedInputRef = useRef11(null);
@@ -20946,13 +21022,6 @@ var AgentUI = ({
20946
21022
  return !chosen.some((c) => c && (c === target || c.includes(target) || target.includes(c)));
20947
21023
  });
20948
21024
  }, [finishedRunInput, chosenApps]);
20949
- const postRunUnauthedApps = useMemo10(() => {
20950
- if (authAppsLoading) return [];
20951
- return chosenApps.filter((a) => {
20952
- const slug = normalizeAgentAppName(a.name || "");
20953
- return appRequiresAuthentication(slug) && !isAppAuthenticated(a.name || "", a.id || null);
20954
- });
20955
- }, [authAppsLoading, chosenApps, isAppAuthenticated]);
20956
21025
  useEffect18(() => {
20957
21026
  if (cronManualOverrideRef.current) return;
20958
21027
  const m = Math.max(0, Math.min(59, schedMinute));
@@ -21030,7 +21099,22 @@ var AgentUI = ({
21030
21099
  options: [
21031
21100
  { value: "start", label: "Start", disabled: disableStartTab, title: disableStartTab ? "Open a new agent run from the /agents page to start a new prompt" : void 0 },
21032
21101
  { value: "simple", label: "Simple", disabled: !hasExecution },
21033
- { value: "detailed", label: "Detailed", disabled: !hasExecution },
21102
+ {
21103
+ value: "detailed",
21104
+ label: runIsActive ? /* @__PURE__ */ jsxs24("span", { style: { display: "inline-flex", alignItems: "center", gap: 6 }, children: [
21105
+ "Detailed",
21106
+ /* @__PURE__ */ jsx31(
21107
+ Loader2Icon,
21108
+ {
21109
+ size: 12,
21110
+ className: "animate-spin",
21111
+ style: { color: "hsl(var(--primary))" }
21112
+ }
21113
+ )
21114
+ ] }) : "Detailed",
21115
+ disabled: !hasExecution,
21116
+ title: runIsActive ? "Current agent run is in progress \u2014 view live detailed timeline" : void 0
21117
+ },
21034
21118
  { type: "divider", key: "div" },
21035
21119
  {
21036
21120
  type: "action",
@@ -21056,33 +21140,8 @@ var AgentUI = ({
21056
21140
  }
21057
21141
  }
21058
21142
  }
21059
- // The live run indicator is rendered via the `trailing` slot below so
21060
- // it can use a proper MUI Tooltip while still lining up inside the
21061
- // pill with the other items.
21062
- ],
21063
- trailing: runIsActive && activeTab === "start" ? /* @__PURE__ */ jsxs24(Fragment12, { children: [
21064
- /* @__PURE__ */ jsx31(
21065
- "span",
21066
- {
21067
- "aria-hidden": true,
21068
- style: {
21069
- width: 1,
21070
- height: 18,
21071
- margin: "0 10px",
21072
- background: "hsl(var(--border))",
21073
- alignSelf: "center"
21074
- }
21075
- }
21076
- ),
21077
- /* @__PURE__ */ jsx31(Tooltip14, { title: "Current agent run is still in progress", arrow: true, children: /* @__PURE__ */ jsx31("span", { style: { display: "inline-flex", alignItems: "center", paddingRight: 6 }, children: /* @__PURE__ */ jsx31(
21078
- CircularProgress5,
21079
- {
21080
- size: 14,
21081
- thickness: 5,
21082
- sx: { color: "hsl(var(--muted-foreground))", display: "block" }
21083
- }
21084
- ) }) })
21085
- ] }) : void 0
21143
+ // The live run indicator is rendered in the Detailed tab label above.
21144
+ ]
21086
21145
  }
21087
21146
  )
21088
21147
  }
@@ -21468,7 +21527,7 @@ var AgentUI = ({
21468
21527
  ]
21469
21528
  }
21470
21529
  );
21471
- const postRunDiscovery = isEffectiveSupport && (Boolean(postRunScheduleHint) && !scheduleDisabledReason || postRunAppReqs.length > 0 || postRunUnauthedApps.length > 0) ? /* @__PURE__ */ jsxs24(
21530
+ const postRunDiscovery = isEffectiveSupport && (Boolean(postRunScheduleHint) && !scheduleDisabledReason || postRunAppReqs.length > 0) ? /* @__PURE__ */ jsxs24(
21472
21531
  Box22,
21473
21532
  {
21474
21533
  sx: {
@@ -21549,32 +21608,6 @@ var AgentUI = ({
21549
21608
  ]
21550
21609
  }
21551
21610
  ) }),
21552
- postRunUnauthedApps.map((a) => /* @__PURE__ */ jsx31(Tooltip14, { title: `${(a.name || "").replace(/_/g, " ")} is not authenticated yet \u2014 click to set it up`, arrow: true, children: /* @__PURE__ */ jsxs24(
21553
- Box22,
21554
- {
21555
- role: "button",
21556
- onClick: () => setAuthDrawerApp({ name: a.name, id: a.id || null }),
21557
- sx: {
21558
- display: "inline-flex",
21559
- alignItems: "center",
21560
- gap: 0.5,
21561
- px: 1,
21562
- py: 0.25,
21563
- borderRadius: 999,
21564
- border: "1px solid hsl(var(--severity-medium) / 0.55)",
21565
- bgcolor: "hsl(var(--severity-medium) / 0.12)",
21566
- color: "hsl(var(--foreground))",
21567
- fontSize: "0.8rem",
21568
- textTransform: "capitalize",
21569
- cursor: "pointer",
21570
- "&:hover": { bgcolor: "hsl(var(--severity-medium) / 0.2)" }
21571
- },
21572
- children: [
21573
- /* @__PURE__ */ jsx31(WarningIcon, { size: 13, color: "hsl(var(--severity-medium))" }),
21574
- `Authenticate ${(a.name || "").replace(/_/g, " ")}`
21575
- ]
21576
- }
21577
- ) }, `post-auth-${a.id || a.name}`)),
21578
21611
  postRunAppReqs.map((req) => /* @__PURE__ */ jsx31(
21579
21612
  Tooltip14,
21580
21613
  {
@@ -21750,6 +21783,7 @@ var AgentUI = ({
21750
21783
  ] })
21751
21784
  }
21752
21785
  ) : null;
21786
+ const continuationMultiline = continuationText.includes("\n") || continuationText.length > 80;
21753
21787
  const continuationElement = finishDecisionId && !optimisticRunning ? /* @__PURE__ */ jsxs24(Box22, { sx: { width: "100%", maxWidth: 640, mx: "auto" }, children: [
21754
21788
  /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.75rem", color: "hsl(var(--muted-foreground))", mb: 0.75, textAlign: "center" }, children: "Continue this agent run with more details" }),
21755
21789
  /* @__PURE__ */ jsxs24(
@@ -21764,13 +21798,15 @@ var AgentUI = ({
21764
21798
  },
21765
21799
  sx: {
21766
21800
  display: "flex",
21767
- alignItems: "flex-end",
21801
+ alignItems: continuationMultiline ? "flex-end" : "center",
21768
21802
  gap: 1,
21769
- p: 1.25,
21770
- borderRadius: 999,
21803
+ borderRadius: isPhone ? continuationMultiline ? "20px" : "28px" : "28px",
21771
21804
  border: "1.5px solid hsl(var(--border))",
21772
21805
  bgcolor: "hsl(var(--card))",
21773
- transition: "border-color 0.2s ease, box-shadow 0.2s ease",
21806
+ px: isPhone ? 1.5 : 2.25,
21807
+ py: isPhone ? continuationMultiline ? 1.25 : 1 : 1,
21808
+ boxSizing: "border-box",
21809
+ transition: "border-color 0.15s ease, box-shadow 0.15s ease",
21774
21810
  "&:focus-within": {
21775
21811
  borderColor: "hsl(var(--primary))",
21776
21812
  boxShadow: "0 0 0 3px hsla(var(--primary) / 0.12)"
@@ -21794,7 +21830,8 @@ var AgentUI = ({
21794
21830
  value: continuationText,
21795
21831
  onChange: (e) => setContinuationText(e.target.value),
21796
21832
  onKeyDown: (e) => {
21797
- if ((e.metaKey || e.ctrlKey) && e.key === "Enter") {
21833
+ if (e.nativeEvent.isComposing) return;
21834
+ if (e.key === "Enter" && !e.shiftKey || (e.metaKey || e.ctrlKey) && e.key === "Enter") {
21798
21835
  e.preventDefault();
21799
21836
  if (continuationText.trim() && !agentRequestLoading) {
21800
21837
  submitQuestions(finishDecisionId, { continue: continuationText }, true);
@@ -21802,24 +21839,44 @@ var AgentUI = ({
21802
21839
  }
21803
21840
  },
21804
21841
  disabled: agentRequestLoading,
21805
- sx: { fontSize: "0.9rem", color: "hsl(var(--foreground))", px: 2 }
21842
+ sx: {
21843
+ fontSize: "0.9rem",
21844
+ color: "hsl(var(--foreground))",
21845
+ py: 0,
21846
+ flex: "1 1 auto",
21847
+ minWidth: 0,
21848
+ "& .MuiInputBase-input": {
21849
+ pt: "5px",
21850
+ pb: "6px",
21851
+ lineHeight: 1.5
21852
+ },
21853
+ "& textarea::placeholder": {
21854
+ color: "hsl(var(--muted-foreground))",
21855
+ opacity: 0.7,
21856
+ whiteSpace: "nowrap",
21857
+ overflow: "hidden",
21858
+ textOverflow: "ellipsis"
21859
+ }
21860
+ }
21806
21861
  }
21807
21862
  ),
21808
- /* @__PURE__ */ jsx31(
21863
+ /* @__PURE__ */ jsx31(Tooltip14, { title: submitTooltip === "\u2318+Enter to send" ? "Enter to send, Shift+Enter for new line" : submitTooltip, placement: "top", arrow: true, children: /* @__PURE__ */ jsx31("span", { children: /* @__PURE__ */ jsx31(
21809
21864
  IconButton11,
21810
21865
  {
21811
21866
  type: "submit",
21812
21867
  disabled: !continuationText.trim() || agentRequestLoading,
21813
21868
  sx: {
21814
- width: 36,
21815
- height: 36,
21869
+ width: 32,
21870
+ height: 32,
21871
+ flexShrink: 0,
21816
21872
  bgcolor: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary))" : "hsl(var(--muted))",
21817
21873
  color: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary-foreground))" : "hsl(var(--muted-foreground))",
21818
- "&:hover": continuationText.trim() && !agentRequestLoading ? { filter: "brightness(1.1)", bgcolor: "hsl(var(--primary))" } : {}
21874
+ "&:hover": continuationText.trim() && !agentRequestLoading ? { filter: "brightness(1.1)", bgcolor: "hsl(var(--primary))" } : {},
21875
+ "&.Mui-disabled": { bgcolor: "hsl(var(--muted))", color: "hsl(var(--muted-foreground))" }
21819
21876
  },
21820
- children: agentRequestLoading ? /* @__PURE__ */ jsx31(CircularProgress5, { size: 16, sx: { color: "inherit" } }) : /* @__PURE__ */ jsx31(SendIcon, { size: 18 })
21877
+ children: agentRequestLoading ? /* @__PURE__ */ jsx31(CircularProgress5, { size: 16, sx: { color: "inherit" } }) : submitIcon ?? /* @__PURE__ */ jsx31(PlayArrowRoundedIcon2, {})
21821
21878
  }
21822
- )
21879
+ ) }) })
21823
21880
  ]
21824
21881
  }
21825
21882
  )
@@ -23071,11 +23128,11 @@ var AgentUI = ({
23071
23128
  " \xB7 ",
23072
23129
  execution?.execution_id?.slice(0, 8) || ""
23073
23130
  ] }),
23074
- pendingAuthApps.length > 0 && /* @__PURE__ */ jsxs24(
23131
+ pendingAuthApps.map((a) => /* @__PURE__ */ jsxs24(
23075
23132
  Box22,
23076
23133
  {
23077
23134
  component: "span",
23078
- onClick: () => setAuthDrawerApp({ name: pendingAuthApps[0].appName, id: pendingAuthApps[0].appId }),
23135
+ onClick: () => setAuthDrawerApp({ name: a.appName, id: a.appId }),
23079
23136
  sx: {
23080
23137
  display: "inline-flex",
23081
23138
  alignItems: "center",
@@ -23094,11 +23151,12 @@ var AgentUI = ({
23094
23151
  },
23095
23152
  children: [
23096
23153
  "Missing Auth: ",
23097
- pendingAuthApps.map((a) => formatAppDisplayName(a.appName)).join(", "),
23154
+ formatAppDisplayName(a.appName),
23098
23155
  " \u2014 Connect"
23099
23156
  ]
23100
- }
23101
- )
23157
+ },
23158
+ a.appName
23159
+ ))
23102
23160
  ] })
23103
23161
  ] }),
23104
23162
  /* @__PURE__ */ jsx31(AgentAttachmentsButton_default, { attachments: llmImageAttachments }),
@@ -23278,57 +23336,6 @@ var AgentUI = ({
23278
23336
  }
23279
23337
  }
23280
23338
  ),
23281
- pendingAuthApps.length > 0 && /* @__PURE__ */ jsxs24(
23282
- Box22,
23283
- {
23284
- sx: {
23285
- mb: 2,
23286
- p: 2,
23287
- borderRadius: 2,
23288
- border: "1px solid hsla(var(--severity-medium) / 0.35)",
23289
- bgcolor: "hsla(var(--severity-medium) / 0.08)",
23290
- display: "flex",
23291
- alignItems: "center",
23292
- justifyContent: "space-between",
23293
- gap: 2,
23294
- flexWrap: "wrap"
23295
- },
23296
- children: [
23297
- /* @__PURE__ */ jsxs24(Box22, { sx: { display: "flex", alignItems: "center", gap: 1.5, flex: 1, minWidth: 260 }, children: [
23298
- /* @__PURE__ */ jsx31(LockIcon3, { size: 22, color: "hsl(var(--severity-medium))" }),
23299
- /* @__PURE__ */ jsxs24(Box22, { sx: { flex: 1, minWidth: 0 }, children: [
23300
- /* @__PURE__ */ jsx31(Typography19, { 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` }),
23301
- /* @__PURE__ */ jsx31(Typography19, { 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.` })
23302
- ] })
23303
- ] }),
23304
- /* @__PURE__ */ jsx31(Box22, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: pendingAuthApps.map(({ appName, appId }) => /* @__PURE__ */ jsxs24(
23305
- Button13,
23306
- {
23307
- variant: "outlined",
23308
- size: "small",
23309
- onClick: () => setAuthDrawerApp({ name: appName, id: appId }),
23310
- sx: {
23311
- borderColor: "hsla(var(--severity-medium) / 0.6)",
23312
- color: "hsl(var(--foreground))",
23313
- textTransform: "none",
23314
- fontSize: "0.75rem",
23315
- fontWeight: 600,
23316
- height: 32,
23317
- "&:hover": {
23318
- bgcolor: "hsla(var(--severity-medium) / 0.15)",
23319
- borderColor: "hsl(var(--severity-medium))"
23320
- }
23321
- },
23322
- children: [
23323
- "Authenticate ",
23324
- formatAppDisplayName(appName)
23325
- ]
23326
- },
23327
- appName
23328
- )) })
23329
- ]
23330
- }
23331
- ),
23332
23339
  viewMode === "simple" && /* @__PURE__ */ jsx31(Box22, { sx: {
23333
23340
  borderRadius: 2,
23334
23341
  border: "1px solid hsl(var(--border))",
@@ -23459,7 +23466,17 @@ var AgentUI = ({
23459
23466
  ) })
23460
23467
  ] })
23461
23468
  ] });
23462
- })() : !finishAnswer && isRunning ? /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "Agent is running\u2026" }) : !finishAnswer ? /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "No final answer returned." }) : null,
23469
+ })() : !finishAnswer && isRunning ? /* @__PURE__ */ jsxs24(Box22, { sx: { display: "flex", alignItems: "center", gap: 1, py: 0.5 }, children: [
23470
+ /* @__PURE__ */ jsx31(
23471
+ Loader2Icon,
23472
+ {
23473
+ size: 14,
23474
+ className: "animate-spin",
23475
+ style: { color: "hsl(var(--muted-foreground))", flexShrink: 0 }
23476
+ }
23477
+ ),
23478
+ /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "Agent is running\u2026" })
23479
+ ] }) : !finishAnswer ? /* @__PURE__ */ jsx31(Typography19, { sx: { fontSize: "0.85rem", color: "hsl(var(--muted-foreground))" }, children: "No final answer returned." }) : null,
23463
23480
  /* @__PURE__ */ jsx31(Box22, { children: /* @__PURE__ */ jsx31(
23464
23481
  Button13,
23465
23482
  {
@@ -24444,7 +24461,7 @@ var LocalLLMConfig = ({ compact, globalUrl, userdata, isLoaded, isLoggedIn, serv
24444
24461
  !compact && (() => {
24445
24462
  const preset = ENDPOINT_PRESETS.find((p) => p.label === effectivePreset);
24446
24463
  const hasProviderDocs = !!preset && (!!preset.apiKeyUrl || !!preset.apiKeyHint);
24447
- return /* @__PURE__ */ jsx33(Box24, { sx: { px: 2.5, py: 2, borderRadius: 2, border: "1px solid hsl(var(--border))", bgcolor: "hsl(var(--muted) / 0.3)" }, children: /* @__PURE__ */ jsx33(Typography21, { sx: { fontSize: "0.8rem", color: "hsl(var(--muted-foreground))", lineHeight: 1.5 }, children: isShuffleAI ? /* @__PURE__ */ jsxs26(Fragment13, { children: [
24464
+ return /* @__PURE__ */ jsx33(Box24, { sx: { px: 2.5, py: 2, borderRadius: 2, border: "1px solid hsl(var(--border))", bgcolor: "transparent" }, children: /* @__PURE__ */ jsx33(Typography21, { sx: { fontSize: "0.8rem", color: "hsl(var(--muted-foreground))", lineHeight: 1.5 }, children: isShuffleAI ? /* @__PURE__ */ jsxs26(Fragment13, { children: [
24448
24465
  "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.",
24449
24466
  " ",
24450
24467
  /* @__PURE__ */ jsx33(Box24, { 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" }),
@@ -27425,7 +27442,7 @@ var AskAiButton = ({
27425
27442
  requireSupport = true,
27426
27443
  isBeta = false,
27427
27444
  pathname,
27428
- label = "Ask AI",
27445
+ label = "Ask Shuffle",
27429
27446
  tagLabel,
27430
27447
  contextHint,
27431
27448
  tooltipTitle,
@@ -27448,7 +27465,7 @@ var AskAiButton = ({
27448
27465
  return null;
27449
27466
  }
27450
27467
  const effectiveTagLabel = tagLabel !== void 0 && !(tagLabel === "Support" && isIncidentOrDocs) ? tagLabel : effectiveIsBeta ? "Beta" : "Support";
27451
- const effectiveTooltip = tooltipTitle !== void 0 ? tooltipTitle : label !== "Ask AI" ? label : contextHint ? `Ask AI (${contextHint})` : "Ask AI \u2022 Context-aware assistant";
27468
+ const effectiveTooltip = tooltipTitle !== void 0 ? tooltipTitle : label !== "Ask AI" && label !== "Ask Shuffle" ? label : contextHint ? `Ask Shuffle (${contextHint})` : "Ask Shuffle \u2022 Context-aware assistant";
27452
27469
  return /* @__PURE__ */ jsx39(
27453
27470
  Box30,
27454
27471
  {
@@ -27685,12 +27702,13 @@ var AskAiDrawer = ({
27685
27702
  var AskAiDrawer_default = AskAiDrawer;
27686
27703
 
27687
27704
  // components/AskAiSidePanel.tsx
27688
- import React8, { useCallback as useCallback15, useEffect as useEffect26, useRef as useRef15, useState as useState29 } from "react";
27705
+ import React8, { useCallback as useCallback15, useEffect as useEffect26, useMemo as useMemo14, useRef as useRef15, useState as useState29 } from "react";
27689
27706
  import {
27690
27707
  Box as Box32,
27691
27708
  Button as Button16,
27692
27709
  ButtonBase as ButtonBase4,
27693
27710
  IconButton as IconButton16,
27711
+ Tooltip as Tooltip21,
27694
27712
  Typography as Typography29
27695
27713
  } from "@mui/material";
27696
27714
  import {
@@ -27700,6 +27718,106 @@ import {
27700
27718
  ShieldCheck as ShieldCheck2,
27701
27719
  X as CloseIcon11
27702
27720
  } from "lucide-react";
27721
+
27722
+ // supportEscalation.ts
27723
+ function resolveContactUserInfo(userdata) {
27724
+ let user = userdata;
27725
+ if (!user && typeof window !== "undefined") {
27726
+ try {
27727
+ const raw = localStorage.getItem("shuffle_user_info");
27728
+ if (raw) user = JSON.parse(raw);
27729
+ } catch {
27730
+ }
27731
+ }
27732
+ const name = (user?.name || user?.username || "").trim();
27733
+ let firstName = (user?.firstname || user?.firstName || "").trim();
27734
+ let lastName = (user?.lastname || user?.lastName || "").trim();
27735
+ if (!firstName && name) {
27736
+ const parts = name.split(/\s+/);
27737
+ firstName = parts[0] || "";
27738
+ if (parts.length > 1) {
27739
+ lastName = parts.slice(1).join(" ");
27740
+ }
27741
+ }
27742
+ const email = (user?.email || (user?.username?.includes("@") ? user.username : "") || "").trim();
27743
+ const title = (user?.title || user?.jobtitle || user?.job_title || user?.role || user?.active_org?.role || "").trim();
27744
+ const company = (user?.company || user?.active_org?.name || "").trim();
27745
+ return { firstName, lastName, email, title, company };
27746
+ }
27747
+ function buildSupportEscalationUrl(context) {
27748
+ const { firstName, lastName, email, title, company } = resolveContactUserInfo(context.userdata);
27749
+ const params = new URLSearchParams();
27750
+ if (firstName) params.set("firstName", firstName);
27751
+ if (lastName) params.set("lastName", lastName);
27752
+ if (email) params.set("email", email);
27753
+ if (title) params.set("title", title);
27754
+ if (company) params.set("company", company);
27755
+ params.set("category", (context.category || "support").toLowerCase());
27756
+ let sourceUrl = context.sourceUrl;
27757
+ if (!sourceUrl && typeof window !== "undefined") {
27758
+ sourceUrl = window.location.href;
27759
+ }
27760
+ if (!sourceUrl && context.pathname) {
27761
+ const origin = typeof window !== "undefined" && window.location?.origin ? window.location.origin : "https://shuffler.io";
27762
+ const s = context.search ? context.search.startsWith("?") ? context.search : `?${context.search}` : "";
27763
+ sourceUrl = `${origin}${context.pathname}${s}`;
27764
+ }
27765
+ const execId = context.executionId?.trim();
27766
+ const auth = (context.authorization || execId || "").trim();
27767
+ let runUrl = "";
27768
+ if (execId) {
27769
+ const origin = typeof window !== "undefined" && window.location?.origin ? window.location.origin : "https://shuffler.io";
27770
+ runUrl = `${origin}/agents?execution_id=${encodeURIComponent(execId)}&authorization=${encodeURIComponent(auth)}`;
27771
+ }
27772
+ const lines = ["[Escalated from Ask Shuffle]", ""];
27773
+ if (context.initialQuestion && context.initialQuestion.trim()) {
27774
+ lines.push("User Question:");
27775
+ lines.push(context.initialQuestion.trim(), "");
27776
+ }
27777
+ lines.push("Context & Source:");
27778
+ if (sourceUrl) {
27779
+ lines.push(`- Source URL: ${sourceUrl}${context.entityTitle ? ` (${context.entityTitle})` : ""}`);
27780
+ }
27781
+ if (execId) {
27782
+ lines.push(`- Execution ID: ${execId}`);
27783
+ if (runUrl) {
27784
+ lines.push(`- Agent Run: ${runUrl}`);
27785
+ }
27786
+ }
27787
+ if (context.executionStatus) {
27788
+ lines.push(`- Execution Status: ${context.executionStatus}`);
27789
+ }
27790
+ if (context.error && context.error.trim()) {
27791
+ lines.push("", "Error / Diagnostics:");
27792
+ lines.push(context.error.trim().slice(0, 1e3));
27793
+ }
27794
+ lines.push("", "Additional Notes:");
27795
+ lines.push("");
27796
+ params.set("message", lines.join("\n"));
27797
+ params.set("ref", "ask_shuffle_escalation");
27798
+ if (sourceUrl) {
27799
+ params.set("source_url", sourceUrl);
27800
+ }
27801
+ if (execId) {
27802
+ params.set("execution_id", execId);
27803
+ }
27804
+ if (auth) {
27805
+ params.set("authorization", auth);
27806
+ }
27807
+ if (runUrl) {
27808
+ params.set("run_url", runUrl);
27809
+ }
27810
+ const queryString = params.toString().replace(/\+/g, "%20");
27811
+ return `https://shuffler.io/contact?${queryString}`;
27812
+ }
27813
+ function openSupportEscalation(context) {
27814
+ const url = buildSupportEscalationUrl(context);
27815
+ if (typeof window !== "undefined") {
27816
+ window.open(url, "_blank", "noopener,noreferrer");
27817
+ }
27818
+ }
27819
+
27820
+ // components/AskAiSidePanel.tsx
27703
27821
  import { Fragment as Fragment16, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
27704
27822
  import { createElement as createElement3 } from "react";
27705
27823
  var AGENT_DRAWER_OPEN_EVENT = "agent-drawer-open";
@@ -27860,6 +27978,7 @@ var AskAiSidePanel = ({
27860
27978
  const [activeIncidentId, setActiveIncidentId] = useState29(null);
27861
27979
  const [activeIncidentContext, setActiveIncidentContext] = useState29(null);
27862
27980
  const [runResetKey, setRunResetKey] = useState29(0);
27981
+ const [lastRunInfo, setLastRunInfo] = useState29(null);
27863
27982
  useEffect26(() => {
27864
27983
  if (!open) {
27865
27984
  setActiveTaskId(null);
@@ -27905,6 +28024,7 @@ var AskAiSidePanel = ({
27905
28024
  }
27906
28025
  if (detail?.resetExecution) {
27907
28026
  setActiveExecutionId(null);
28027
+ setLastRunInfo(null);
27908
28028
  setRunResetKey((k) => k + 1);
27909
28029
  } else if (detail?.executionId !== void 0) {
27910
28030
  setActiveExecutionId(detail.executionId || null);
@@ -27919,8 +28039,17 @@ var AskAiSidePanel = ({
27919
28039
  }, [handleTabChange]);
27920
28040
  const handleAgentRun = useCallback15(
27921
28041
  (event) => {
27922
- if (event.executionId && activeTaskId) {
28042
+ setLastRunInfo({
28043
+ input: event.input,
28044
+ executionId: event.executionId,
28045
+ authorization: event.authorization,
28046
+ error: event.error,
28047
+ success: event.success
28048
+ });
28049
+ if (event.executionId) {
27923
28050
  setActiveExecutionId(event.executionId);
28051
+ }
28052
+ if (event.executionId && activeTaskId) {
27924
28053
  if (typeof window !== "undefined") {
27925
28054
  window.dispatchEvent(
27926
28055
  new CustomEvent("shuffle:task_ai_execution", {
@@ -27937,6 +28066,50 @@ var AskAiSidePanel = ({
27937
28066
  [activeTaskId]
27938
28067
  );
27939
28068
  const effectiveStorageKey = activeTaskId ? `${context.storageKey}:task:${activeTaskId}` : context.storageKey;
28069
+ const urlExecutionId = useMemo14(() => {
28070
+ if (typeof window === "undefined") return null;
28071
+ const s = search ?? window.location.search;
28072
+ return new URLSearchParams(s).get("execution_id");
28073
+ }, [search]);
28074
+ const urlAuthorization = useMemo14(() => {
28075
+ if (typeof window === "undefined") return null;
28076
+ const s = search ?? window.location.search;
28077
+ return new URLSearchParams(s).get("authorization");
28078
+ }, [search]);
28079
+ const hasAgentRun = Boolean(
28080
+ lastRunInfo?.executionId || lastRunInfo?.input || activeExecutionId || urlExecutionId || runResetKey === 0 && effectiveStorageKey && getPageContextChoice(effectiveStorageKey)?.executionId
28081
+ );
28082
+ const handleEscalateToSupport = useCallback15(() => {
28083
+ const savedChoice = effectiveStorageKey ? getPageContextChoice(effectiveStorageKey) : null;
28084
+ const execId = lastRunInfo?.executionId || activeExecutionId || urlExecutionId || savedChoice?.executionId;
28085
+ const auth = lastRunInfo?.authorization || urlAuthorization || savedChoice?.authorization;
28086
+ const execStatus = lastRunInfo?.success !== void 0 ? lastRunInfo.success ? "FINISHED" : "FAILED" : savedChoice?.executionStatus || (execId ? "EXECUTING" : void 0);
28087
+ const question = lastRunInfo?.input || effectiveDefaultInput || savedChoice?.draftPrompt;
28088
+ const currentFullUrl = typeof window !== "undefined" ? window.location.href : void 0;
28089
+ openSupportEscalation({
28090
+ userdata,
28091
+ sourceUrl: currentFullUrl,
28092
+ pathname: currentPathname,
28093
+ search: currentSearch,
28094
+ entityTitle,
28095
+ initialQuestion: question,
28096
+ executionId: execId || void 0,
28097
+ authorization: auth || void 0,
28098
+ executionStatus: execStatus,
28099
+ error: lastRunInfo?.error
28100
+ });
28101
+ }, [
28102
+ userdata,
28103
+ currentPathname,
28104
+ currentSearch,
28105
+ entityTitle,
28106
+ lastRunInfo,
28107
+ activeExecutionId,
28108
+ urlExecutionId,
28109
+ urlAuthorization,
28110
+ effectiveDefaultInput,
28111
+ effectiveStorageKey
28112
+ ]);
27940
28113
  const agentUiKey = activeTaskId ? `${context.storageKey}:task:${activeTaskId}:${activeExecutionId || "fresh"}:${runResetKey}` : `${context.storageKey}:${runResetKey}`;
27941
28114
  const effectiveLocalLLMSlot = localLLMSlot ?? /* @__PURE__ */ jsx41(
27942
28115
  LocalLLMConfig_default,
@@ -28010,19 +28183,41 @@ var AskAiSidePanel = ({
28010
28183
  setIsResizing(true);
28011
28184
  const startX = e.clientX;
28012
28185
  const startW = panelWidth;
28186
+ let rafId = null;
28187
+ let currentNextWidth = startW;
28188
+ if (typeof document !== "undefined") {
28189
+ document.body.style.userSelect = "none";
28190
+ document.body.style.cursor = "col-resize";
28191
+ }
28013
28192
  const handleMouseMove = (moveEvent) => {
28014
28193
  const deltaX = startX - moveEvent.clientX;
28015
28194
  const maxAllowed = Math.min(MAX_ASK_AI_PANEL_WIDTH, (window.innerWidth || 1200) - 40);
28016
28195
  const nextWidth = Math.round(
28017
28196
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28018
28197
  );
28019
- setPanelWidth(nextWidth);
28020
- if (typeof document !== "undefined") {
28021
- document.documentElement.style.setProperty("--ask-ai-panel-width", `${nextWidth}px`);
28198
+ currentNextWidth = nextWidth;
28199
+ if (!rafId) {
28200
+ rafId = window.requestAnimationFrame(() => {
28201
+ rafId = null;
28202
+ if (panelRef.current) {
28203
+ panelRef.current.style.width = `${currentNextWidth}px`;
28204
+ }
28205
+ if (typeof document !== "undefined") {
28206
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${currentNextWidth}px`);
28207
+ }
28208
+ });
28022
28209
  }
28023
28210
  };
28024
28211
  const handleMouseUp = (upEvent) => {
28025
28212
  setIsResizing(false);
28213
+ if (rafId) {
28214
+ window.cancelAnimationFrame(rafId);
28215
+ rafId = null;
28216
+ }
28217
+ if (typeof document !== "undefined") {
28218
+ document.body.style.userSelect = "";
28219
+ document.body.style.cursor = "";
28220
+ }
28026
28221
  window.removeEventListener("mousemove", handleMouseMove);
28027
28222
  window.removeEventListener("mouseup", handleMouseUp);
28028
28223
  const deltaX = startX - upEvent.clientX;
@@ -28030,9 +28225,16 @@ var AskAiSidePanel = ({
28030
28225
  const finalWidth = Math.round(
28031
28226
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28032
28227
  );
28033
- try {
28034
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28035
- } catch {
28228
+ setPanelWidth(finalWidth);
28229
+ if (panelRef.current) {
28230
+ panelRef.current.style.width = "";
28231
+ }
28232
+ if (typeof document !== "undefined") {
28233
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${finalWidth}px`);
28234
+ try {
28235
+ localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28236
+ } catch {
28237
+ }
28036
28238
  }
28037
28239
  };
28038
28240
  window.addEventListener("mousemove", handleMouseMove);
@@ -28043,6 +28245,8 @@ var AskAiSidePanel = ({
28043
28245
  setIsResizing(true);
28044
28246
  const startX = e.touches[0].clientX;
28045
28247
  const startW = panelWidth;
28248
+ let rafId = null;
28249
+ let currentNextWidth = startW;
28046
28250
  const handleTouchMove = (moveEvent) => {
28047
28251
  if (moveEvent.touches.length !== 1) return;
28048
28252
  const deltaX = startX - moveEvent.touches[0].clientX;
@@ -28050,13 +28254,25 @@ var AskAiSidePanel = ({
28050
28254
  const nextWidth = Math.round(
28051
28255
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28052
28256
  );
28053
- setPanelWidth(nextWidth);
28054
- if (typeof document !== "undefined") {
28055
- document.documentElement.style.setProperty("--ask-ai-panel-width", `${nextWidth}px`);
28257
+ currentNextWidth = nextWidth;
28258
+ if (!rafId) {
28259
+ rafId = window.requestAnimationFrame(() => {
28260
+ rafId = null;
28261
+ if (panelRef.current) {
28262
+ panelRef.current.style.width = `${currentNextWidth}px`;
28263
+ }
28264
+ if (typeof document !== "undefined") {
28265
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${currentNextWidth}px`);
28266
+ }
28267
+ });
28056
28268
  }
28057
28269
  };
28058
28270
  const handleTouchEnd = (endEvent) => {
28059
28271
  setIsResizing(false);
28272
+ if (rafId) {
28273
+ window.cancelAnimationFrame(rafId);
28274
+ rafId = null;
28275
+ }
28060
28276
  window.removeEventListener("touchmove", handleTouchMove);
28061
28277
  window.removeEventListener("touchend", handleTouchEnd);
28062
28278
  const clientX = endEvent.changedTouches[0]?.clientX ?? startX;
@@ -28065,9 +28281,16 @@ var AskAiSidePanel = ({
28065
28281
  const finalWidth = Math.round(
28066
28282
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28067
28283
  );
28068
- try {
28069
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28070
- } catch {
28284
+ setPanelWidth(finalWidth);
28285
+ if (panelRef.current) {
28286
+ panelRef.current.style.width = "";
28287
+ }
28288
+ if (typeof document !== "undefined") {
28289
+ document.documentElement.style.setProperty("--ask-ai-panel-width", `${finalWidth}px`);
28290
+ try {
28291
+ localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28292
+ } catch {
28293
+ }
28071
28294
  }
28072
28295
  };
28073
28296
  window.addEventListener("touchmove", handleTouchMove, { passive: false });
@@ -28110,6 +28333,18 @@ var AskAiSidePanel = ({
28110
28333
  return null;
28111
28334
  }
28112
28335
  return /* @__PURE__ */ jsxs34(Fragment16, { children: [
28336
+ isResizing && /* @__PURE__ */ jsx41(
28337
+ Box32,
28338
+ {
28339
+ sx: {
28340
+ position: "fixed",
28341
+ inset: 0,
28342
+ zIndex: 99999,
28343
+ cursor: "col-resize",
28344
+ userSelect: "none"
28345
+ }
28346
+ }
28347
+ ),
28113
28348
  /* @__PURE__ */ jsx41(
28114
28349
  Box32,
28115
28350
  {
@@ -28131,7 +28366,7 @@ var AskAiSidePanel = ({
28131
28366
  {
28132
28367
  ref: panelRef,
28133
28368
  component: "aside",
28134
- "aria-label": "Ask AI",
28369
+ "aria-label": "Ask Shuffle",
28135
28370
  "aria-hidden": !isVisible,
28136
28371
  className: themeScope?.scopeClassName,
28137
28372
  sx: [
@@ -28168,23 +28403,49 @@ var AskAiSidePanel = ({
28168
28403
  onTouchStart: handleTouchResizeStart,
28169
28404
  role: "separator",
28170
28405
  "aria-orientation": "vertical",
28171
- "aria-label": "Resize Ask AI panel",
28406
+ "aria-label": "Resize Ask Shuffle panel",
28172
28407
  sx: {
28173
28408
  position: "absolute",
28174
28409
  top: 0,
28175
28410
  bottom: 0,
28176
- left: 0,
28177
- width: 8,
28411
+ left: -6,
28412
+ width: 14,
28178
28413
  cursor: "col-resize",
28179
28414
  zIndex: 1300,
28180
28415
  transition: "background-color 0.15s ease",
28181
28416
  userSelect: "none",
28182
- display: { xs: "none", sm: "block" },
28417
+ display: { xs: "none", sm: "flex" },
28418
+ alignItems: "center",
28419
+ justifyContent: "center",
28183
28420
  "&:hover, &:active": {
28184
- bgcolor: "hsl(var(--primary) / 0.35)"
28421
+ bgcolor: "hsl(var(--primary) / 0.15)",
28422
+ "& .resize-grip": {
28423
+ bgcolor: "hsl(var(--primary))",
28424
+ opacity: 1
28425
+ }
28185
28426
  },
28186
- ...isResizing ? { bgcolor: "hsl(var(--primary) / 0.55)" } : {}
28187
- }
28427
+ ...isResizing ? {
28428
+ bgcolor: "hsl(var(--primary) / 0.2)",
28429
+ "& .resize-grip": {
28430
+ bgcolor: "hsl(var(--primary))",
28431
+ opacity: 1
28432
+ }
28433
+ } : {}
28434
+ },
28435
+ children: /* @__PURE__ */ jsx41(
28436
+ Box32,
28437
+ {
28438
+ className: "resize-grip",
28439
+ sx: {
28440
+ width: 3,
28441
+ height: 36,
28442
+ borderRadius: 1.5,
28443
+ bgcolor: "hsl(var(--muted-foreground))",
28444
+ opacity: 0.35,
28445
+ transition: "opacity 0.15s ease, background-color 0.15s ease"
28446
+ }
28447
+ }
28448
+ )
28188
28449
  }
28189
28450
  ),
28190
28451
  /* @__PURE__ */ jsxs34(
@@ -28201,7 +28462,7 @@ var AskAiSidePanel = ({
28201
28462
  flexShrink: 0
28202
28463
  },
28203
28464
  children: [
28204
- /* @__PURE__ */ jsxs34(Box32, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
28465
+ /* @__PURE__ */ jsxs34(Box32, { sx: { display: "flex", alignItems: "center", gap: 1, minWidth: 0, flex: 1 }, children: [
28205
28466
  /* @__PURE__ */ jsx41(
28206
28467
  Box32,
28207
28468
  {
@@ -28223,13 +28484,17 @@ var AskAiSidePanel = ({
28223
28484
  /* @__PURE__ */ jsx41(
28224
28485
  Typography29,
28225
28486
  {
28487
+ noWrap: true,
28226
28488
  sx: {
28227
28489
  fontWeight: 700,
28228
28490
  fontSize: "0.86rem",
28229
28491
  color: "hsl(var(--foreground))",
28230
- letterSpacing: "-0.01em"
28492
+ letterSpacing: "-0.01em",
28493
+ minWidth: 0,
28494
+ overflow: "hidden",
28495
+ textOverflow: "ellipsis"
28231
28496
  },
28232
- 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"
28497
+ 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"
28233
28498
  }
28234
28499
  ),
28235
28500
  /* @__PURE__ */ jsx41(
@@ -28245,30 +28510,75 @@ var AskAiSidePanel = ({
28245
28510
  borderRadius: "4px",
28246
28511
  bgcolor: isBetaRoute ? "hsla(var(--primary) / 0.12)" : "hsl(var(--muted))",
28247
28512
  color: isBetaRoute ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))",
28248
- border: isBetaRoute ? "1px solid hsla(var(--primary) / 0.26)" : "1px solid hsl(var(--border))"
28513
+ border: isBetaRoute ? "1px solid hsla(var(--primary) / 0.26)" : "1px solid hsl(var(--border))",
28514
+ flexShrink: 0
28249
28515
  },
28250
28516
  children: isBetaRoute ? "Beta" : isLoggedIn ? isSupport ? "Support" : "Agent" : "Guest"
28251
28517
  }
28252
28518
  )
28253
28519
  ] }),
28254
- /* @__PURE__ */ jsx41(Box32, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ jsx41(
28255
- IconButton16,
28256
- {
28257
- onClick: onClose,
28258
- size: "small",
28259
- "aria-label": "Close Ask AI panel",
28260
- sx: {
28261
- color: "hsl(var(--muted-foreground))",
28262
- p: 0.75,
28263
- borderRadius: "8px",
28264
- "&:hover": {
28265
- color: "hsl(var(--foreground))",
28266
- bgcolor: "hsl(var(--muted))"
28267
- }
28268
- },
28269
- children: /* @__PURE__ */ jsx41(CloseIcon11, { size: 16 })
28270
- }
28271
- ) })
28520
+ /* @__PURE__ */ jsxs34(Box32, { sx: { display: "flex", alignItems: "center", gap: 0.75, flexShrink: 0 }, children: [
28521
+ /* @__PURE__ */ jsx41(
28522
+ Tooltip21,
28523
+ {
28524
+ title: hasAgentRun ? "Talk to support" : "Run an agent first to provide context for support",
28525
+ arrow: true,
28526
+ placement: "bottom",
28527
+ children: /* @__PURE__ */ jsx41("span", { style: { display: "inline-flex", cursor: hasAgentRun ? "pointer" : "not-allowed" }, children: /* @__PURE__ */ jsx41(
28528
+ Button16,
28529
+ {
28530
+ onClick: handleEscalateToSupport,
28531
+ disabled: !hasAgentRun,
28532
+ size: "small",
28533
+ variant: "outlined",
28534
+ sx: {
28535
+ height: 24,
28536
+ minHeight: 24,
28537
+ px: 1,
28538
+ py: 0,
28539
+ fontSize: "0.72rem",
28540
+ fontWeight: 600,
28541
+ textTransform: "none",
28542
+ whiteSpace: "nowrap",
28543
+ borderRadius: "6px",
28544
+ borderColor: "hsl(var(--border))",
28545
+ color: hasAgentRun ? "hsl(var(--foreground))" : "hsl(var(--muted-foreground))",
28546
+ bgcolor: "transparent",
28547
+ "&:hover": {
28548
+ borderColor: "hsl(var(--primary))",
28549
+ bgcolor: "hsl(var(--muted))",
28550
+ color: "hsl(var(--primary))"
28551
+ },
28552
+ "&.Mui-disabled": {
28553
+ borderColor: "hsl(var(--border) / 0.5)",
28554
+ color: "hsl(var(--muted-foreground) / 0.6)",
28555
+ opacity: 0.6
28556
+ }
28557
+ },
28558
+ children: "Talk to support"
28559
+ }
28560
+ ) })
28561
+ }
28562
+ ),
28563
+ /* @__PURE__ */ jsx41(
28564
+ IconButton16,
28565
+ {
28566
+ onClick: onClose,
28567
+ size: "small",
28568
+ "aria-label": "Close Ask Shuffle panel",
28569
+ sx: {
28570
+ color: "hsl(var(--muted-foreground))",
28571
+ p: 0.75,
28572
+ borderRadius: "8px",
28573
+ "&:hover": {
28574
+ color: "hsl(var(--foreground))",
28575
+ bgcolor: "hsl(var(--muted))"
28576
+ }
28577
+ },
28578
+ children: /* @__PURE__ */ jsx41(CloseIcon11, { size: 16 })
28579
+ }
28580
+ )
28581
+ ] })
28272
28582
  ]
28273
28583
  }
28274
28584
  ),
@@ -28566,6 +28876,8 @@ var AskAiSidePanel_default = AskAiSidePanel;
28566
28876
  import { useCallback as useCallback16, useEffect as useEffect27, useMemo as useMemo15, useState as useState30 } from "react";
28567
28877
  import { Fragment as Fragment17, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
28568
28878
  var AGENT_DRAWER_OPEN_EVENT2 = "agent-drawer-open";
28879
+ var AGENT_DRAWER_CLOSE_EVENT = "agent-drawer-close";
28880
+ var AGENT_DRAWER_STATE_EVENT = "agent-drawer-state";
28569
28881
  var AskAiWidget = ({
28570
28882
  open: controlledOpen,
28571
28883
  onOpenChange,
@@ -28639,12 +28951,29 @@ var AskAiWidget = ({
28639
28951
  window.addEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
28640
28952
  return () => window.removeEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
28641
28953
  }, [isAgentDisabled, setDrawerOpen]);
28954
+ useEffect27(() => {
28955
+ const handleDrawerCloseEvent = () => {
28956
+ setDrawerOpen(false);
28957
+ };
28958
+ window.addEventListener(AGENT_DRAWER_CLOSE_EVENT, handleDrawerCloseEvent);
28959
+ return () => window.removeEventListener(AGENT_DRAWER_CLOSE_EVENT, handleDrawerCloseEvent);
28960
+ }, [setDrawerOpen]);
28961
+ useEffect27(() => {
28962
+ if (typeof window === "undefined") return;
28963
+ window.__shuffleAskAiOpen = isDrawerOpen;
28964
+ try {
28965
+ window.dispatchEvent(
28966
+ new CustomEvent(AGENT_DRAWER_STATE_EVENT, { detail: { open: isDrawerOpen } })
28967
+ );
28968
+ } catch {
28969
+ }
28970
+ }, [isDrawerOpen]);
28642
28971
  useEffect27(() => {
28643
28972
  if (propInitialTab) {
28644
28973
  setActiveTab(propInitialTab);
28645
28974
  }
28646
28975
  }, [propInitialTab]);
28647
- const effectiveButtonLabel = buttonProps?.label || (activeContext.buttonLabelFn ? activeContext.buttonLabelFn() : activeContext.buttonLabel) || "Ask AI";
28976
+ const effectiveButtonLabel = buttonProps?.label || (activeContext.buttonLabelFn ? activeContext.buttonLabelFn() : activeContext.buttonLabel) || "Ask Shuffle";
28648
28977
  const isIncidentOrDocsRoute = currentPath.startsWith("/incidents") || currentPath.startsWith("/incidents-simple") || currentPath.startsWith("/cases") || currentPath.startsWith("/alerts") || currentPath.startsWith("/tickets") || currentPath.startsWith("/docs");
28649
28978
  const isBeta = activeContext.isBeta === true || isIncidentOrDocsRoute;
28650
28979
  const effectiveRequireSupport = isBeta ? false : requireSupport;
@@ -29943,6 +30272,9 @@ var AgentRunDiagnosisBanner2 = withMcpTheme(AgentRunDiagnosisBanner_default, "Ag
29943
30272
  var LocalLLMConfig2 = withMcpTheme(LocalLLMConfig_default, "LocalLLMConfig");
29944
30273
  var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
29945
30274
  export {
30275
+ AGENT_DRAWER_CLOSE_EVENT,
30276
+ AGENT_DRAWER_OPEN_EVENT2 as AGENT_DRAWER_OPEN_EVENT,
30277
+ AGENT_DRAWER_STATE_EVENT,
29946
30278
  AGENT_PRESETS,
29947
30279
  AGENT_PROMPT_PREFIX_CATEGORY,
29948
30280
  API_CONFIG,
@@ -30000,6 +30332,7 @@ export {
30000
30332
  VULN_SCANNER_PATTERNS,
30001
30333
  VideoEmbed,
30002
30334
  applyRegionFromPayload,
30335
+ buildSupportEscalationUrl,
30003
30336
  checkAppNameMatch,
30004
30337
  clearPageContextChoice,
30005
30338
  index_default as default,
@@ -30047,6 +30380,7 @@ export {
30047
30380
  matchRoutePattern,
30048
30381
  mergeConnectedTools,
30049
30382
  normalizeAppName,
30383
+ openSupportEscalation,
30050
30384
  parseRunResult,
30051
30385
  refreshAllIntegrationStatus,
30052
30386
  registerAgentContextRule,
@@ -30056,6 +30390,7 @@ export {
30056
30390
  resolveApp,
30057
30391
  resolveApps,
30058
30392
  resolveConnectedTools,
30393
+ resolveContactUserInfo,
30059
30394
  resolveVideoUrl,
30060
30395
  scheduleAgentRun,
30061
30396
  searchAgentActivity,