@shuffleio/shuffle-mcps 0.0.59 → 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,
@@ -8841,7 +8848,7 @@ function AppDetailDrawer({
8841
8848
  }
8842
8849
 
8843
8850
  // views/ShuffleMCP.tsx
8844
- import "./shuffle-mcp-SHQXQS3F.css";
8851
+ import "./shuffle-mcp-E56K3LGU.css";
8845
8852
 
8846
8853
  // components/SegmentedControl.tsx
8847
8854
  import * as React3 from "react";
@@ -11983,14 +11990,14 @@ import {
11983
11990
  RotateCcw as RestartAltIcon2,
11984
11991
  Clock as ScheduleIcon2,
11985
11992
  Settings as SettingsIcon,
11986
- Send as SendIcon,
11987
11993
  CircleStop as StopCircleIcon,
11988
11994
  ThumbsDown as ThumbDownIcon,
11989
11995
  ThumbsUp as ThumbUpIcon,
11990
11996
  AlertTriangle as WarningIcon,
11991
11997
  Search as SearchIcon,
11992
11998
  Image as ImageIcon2,
11993
- Plus as PlusIcon2
11999
+ Plus as PlusIcon2,
12000
+ Loader2 as Loader2Icon
11994
12001
  } from "lucide-react";
11995
12002
 
11996
12003
  // ../Shuffle-Core/components/WorkflowRunExplorer.tsx
@@ -13046,6 +13053,7 @@ var AgentPresets_default = AgentPresets;
13046
13053
 
13047
13054
  // ../lib/agentTools.ts
13048
13055
  var STORAGE_KEY3 = "agent_tools_config";
13056
+ var DATASTORE_CATEGORY = DATASTORE_CATEGORIES.CONFIGURATION;
13049
13057
  var AGENT_TOOLS_CHANGED_EVENT = "agent-tools-changed";
13050
13058
  var DEFAULT_AGENT = "default";
13051
13059
  var DEFAULT_ACTION_TYPE = "timeline_reply";
@@ -13154,7 +13162,10 @@ var writeCache = (entries, explicitUpdatedAt) => {
13154
13162
  const orgKey = getStorageKey();
13155
13163
  localStorage.setItem(orgKey, serialized);
13156
13164
  if (orgKey !== STORAGE_KEY3) {
13157
- localStorage.setItem(STORAGE_KEY3, serialized);
13165
+ try {
13166
+ localStorage.setItem(STORAGE_KEY3, serialized);
13167
+ } catch {
13168
+ }
13158
13169
  }
13159
13170
  window.dispatchEvent(
13160
13171
  new CustomEvent(AGENT_TOOLS_CHANGED_EVENT, { detail: { updatedAt, entries } })
@@ -16596,6 +16607,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16596
16607
  defaultPresetId: "incident-response",
16597
16608
  sourceCategory: "incidents",
16598
16609
  isBeta: true,
16610
+ buttonLabel: "Ask about this case",
16611
+ headerTitle: "Ask about this case",
16599
16612
  title: (params, _, entityOverride) => {
16600
16613
  const cleanId = formatEntityDisplayId(params.id);
16601
16614
  const entity = entityOverride || getActivePageEntityName();
@@ -16619,6 +16632,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16619
16632
  defaultPresetId: "incident-response",
16620
16633
  sourceCategory: "incidents",
16621
16634
  isBeta: true,
16635
+ buttonLabel: "Ask about this ticket",
16636
+ headerTitle: "Ask about this ticket",
16622
16637
  title: (params, _, entityOverride) => {
16623
16638
  const cleanId = formatEntityDisplayId(params.id);
16624
16639
  const entity = entityOverride || getActivePageEntityName();
@@ -16641,6 +16656,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16641
16656
  defaultPresetId: "incident-response",
16642
16657
  sourceCategory: "incidents",
16643
16658
  isBeta: true,
16659
+ buttonLabel: "Ask about this alert",
16660
+ headerTitle: "Ask about this alert",
16644
16661
  title: (params, _, entityOverride) => {
16645
16662
  const cleanId = formatEntityDisplayId(params.id);
16646
16663
  const entity = entityOverride || getActivePageEntityName();
@@ -16663,6 +16680,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16663
16680
  defaultPresetId: "incident-response",
16664
16681
  sourceCategory: "incidents",
16665
16682
  isBeta: true,
16683
+ buttonLabel: "Ask about incidents",
16684
+ headerTitle: "Ask about incidents",
16666
16685
  title: "How can we help handle incidents?",
16667
16686
  subtitle: "Shuffle Incidents MCP",
16668
16687
  defaultPrompt: "Investigate this incident and recommend next steps: ",
@@ -16678,6 +16697,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16678
16697
  defaultPresetId: "incident-response",
16679
16698
  sourceCategory: "incidents",
16680
16699
  isBeta: true,
16700
+ buttonLabel: "Ask about cases",
16701
+ headerTitle: "Ask about cases",
16681
16702
  title: "How can we help handle cases?",
16682
16703
  subtitle: "Shuffle Incidents MCP",
16683
16704
  defaultPrompt: "Investigate this case and recommend next steps: ",
@@ -16693,6 +16714,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16693
16714
  defaultPresetId: "incident-response",
16694
16715
  sourceCategory: "incidents",
16695
16716
  isBeta: true,
16717
+ buttonLabel: "Ask about tickets",
16718
+ headerTitle: "Ask about tickets",
16696
16719
  title: "How can we help handle tickets?",
16697
16720
  subtitle: "Shuffle Incidents MCP",
16698
16721
  defaultPrompt: "Investigate this ticket and recommend next steps: ",
@@ -16708,6 +16731,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16708
16731
  defaultPresetId: "incident-response",
16709
16732
  sourceCategory: "incidents",
16710
16733
  isBeta: true,
16734
+ buttonLabel: "Ask about alerts",
16735
+ headerTitle: "Ask about alerts",
16711
16736
  title: "How can we help handle alerts?",
16712
16737
  subtitle: "Shuffle Incidents MCP",
16713
16738
  defaultPrompt: "Investigate this alert and recommend next steps: ",
@@ -16728,6 +16753,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16728
16753
  ],
16729
16754
  defaultPresetId: "vulnerability",
16730
16755
  sourceCategory: "vulnerabilities",
16756
+ buttonLabel: "Ask about this vulnerability",
16757
+ headerTitle: "Ask about this vulnerability",
16731
16758
  title: (params, _, entityOverride) => {
16732
16759
  const cleanId = formatEntityDisplayId(params.id);
16733
16760
  const entity = entityOverride || getActivePageEntityName();
@@ -16752,6 +16779,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16752
16779
  ],
16753
16780
  defaultPresetId: "vulnerability",
16754
16781
  sourceCategory: "vulnerabilities",
16782
+ buttonLabel: "Ask about vulnerabilities",
16783
+ headerTitle: "Ask about vulnerabilities",
16755
16784
  title: "How can we help review vulnerabilities?",
16756
16785
  subtitle: () => "Shuffle Vulnerabilities & Shuffle Software and Packages",
16757
16786
  defaultPrompt: "Review my current vulnerabilities and prioritize them by ",
@@ -16768,6 +16797,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16768
16797
  match: "/monitors/:id/terminal",
16769
16798
  defaultApps: [{ name: "shuffle_host_monitors" }],
16770
16799
  defaultPresetId: "host-monitor-control",
16800
+ buttonLabel: "Ask about terminal",
16801
+ headerTitle: "Ask about terminal",
16771
16802
  title: (params, _, entityOverride) => {
16772
16803
  const cleanId = formatEntityDisplayId(params.id);
16773
16804
  const entity = entityOverride || getActivePageEntityName();
@@ -16788,6 +16819,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16788
16819
  match: "/monitors/terminal",
16789
16820
  defaultApps: [{ name: "shuffle_host_monitors" }],
16790
16821
  defaultPresetId: "host-monitor-control",
16822
+ buttonLabel: "Ask about terminal",
16823
+ headerTitle: "Ask about terminal",
16791
16824
  title: "How can we help in the host terminal?",
16792
16825
  subtitle: "Shuffle Host Monitors MCP",
16793
16826
  defaultPrompt: "Run terminal commands on this host to ",
@@ -16801,6 +16834,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16801
16834
  match: "/monitors/response",
16802
16835
  defaultApps: [{ name: "shuffle_host_monitors" }],
16803
16836
  defaultPresetId: "host-monitor-control",
16837
+ buttonLabel: "Ask about host response",
16838
+ headerTitle: "Ask about host response",
16804
16839
  title: "How can we help with host response?",
16805
16840
  subtitle: "Shuffle Host Monitors MCP",
16806
16841
  defaultPrompt: "Take response actions on this host to ",
@@ -16814,6 +16849,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16814
16849
  match: "/monitors/:id",
16815
16850
  defaultApps: [{ name: "shuffle_host_monitors" }],
16816
16851
  defaultPresetId: "host-monitor-control",
16852
+ buttonLabel: "Ask about this host",
16853
+ headerTitle: "Ask about this host",
16817
16854
  title: (params, _, entityOverride) => {
16818
16855
  const cleanId = formatEntityDisplayId(params.id);
16819
16856
  const entity = entityOverride || getActivePageEntityName();
@@ -16834,6 +16871,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16834
16871
  match: (pathname) => pathname.startsWith("/monitors"),
16835
16872
  defaultApps: [{ name: "shuffle_host_monitors" }],
16836
16873
  defaultPresetId: "host-monitor-control",
16874
+ buttonLabel: "Ask about host monitors",
16875
+ headerTitle: "Ask about host monitors",
16837
16876
  title: "How can we help with host monitors?",
16838
16877
  subtitle: "Shuffle Host Monitors MCP",
16839
16878
  defaultPrompt: "Take control of this host and help me with: ",
@@ -16850,6 +16889,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16850
16889
  match: "/workflows/:id",
16851
16890
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
16852
16891
  defaultPresetId: "build-workflows",
16892
+ buttonLabel: "Ask about this workflow",
16893
+ headerTitle: "Ask about this workflow",
16853
16894
  title: (params, _, entityOverride) => {
16854
16895
  const cleanId = formatEntityDisplayId(params.id);
16855
16896
  const entity = entityOverride || getActivePageEntityName();
@@ -16870,6 +16911,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16870
16911
  match: (pathname) => pathname === "/workflows" || pathname.startsWith("/workflows") || pathname.startsWith("/infrastructure/flows"),
16871
16912
  defaultApps: [{ name: "shuffle_workflows_builder" }, { name: "shuffle_apps" }],
16872
16913
  defaultPresetId: "build-workflows",
16914
+ buttonLabel: "Ask about workflows",
16915
+ headerTitle: "Ask about workflows",
16873
16916
  title: "How can we help edit workflows?",
16874
16917
  subtitle: "Shuffle Workflows Builder & Shuffle Apps",
16875
16918
  defaultPrompt: "Edit this Shuffle workflow to ",
@@ -16887,6 +16930,14 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16887
16930
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
16888
16931
  defaultPresetId: "vulnerability",
16889
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
+ },
16890
16941
  title: (params) => {
16891
16942
  const entity = getActivePageEntityName();
16892
16943
  if (entity) return `How can we help with "${entity}"?`;
@@ -16906,6 +16957,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16906
16957
  defaultApps: [{ name: "shuffle_assets" }, { name: "shuffle_vulnerabilities" }],
16907
16958
  defaultPresetId: "vulnerability",
16908
16959
  sourceCategory: "vulnerabilities",
16960
+ buttonLabel: "Ask about assets",
16961
+ headerTitle: "Ask about assets",
16909
16962
  title: "How can we help with assets?",
16910
16963
  subtitle: "Shuffle Assets & Shuffle Vulnerabilities",
16911
16964
  defaultPrompt: "Audit assets and review vulnerabilities for ",
@@ -16920,6 +16973,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16920
16973
  defaultApps: [{ name: "shuffle_software" }, { name: "shuffle_vulnerabilities" }],
16921
16974
  defaultPresetId: "vulnerability",
16922
16975
  sourceCategory: "vulnerabilities",
16976
+ buttonLabel: "Ask about software",
16977
+ headerTitle: "Ask about software",
16923
16978
  title: (params) => {
16924
16979
  const entity = getActivePageEntityName();
16925
16980
  return entity ? `How can we help with "${entity}"?` : "How can we help with software inventory?";
@@ -16937,6 +16992,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16937
16992
  defaultApps: [{ name: "shuffle_packages" }, { name: "shuffle_vulnerabilities" }],
16938
16993
  defaultPresetId: "vulnerability",
16939
16994
  sourceCategory: "vulnerabilities",
16995
+ buttonLabel: "Ask about packages",
16996
+ headerTitle: "Ask about packages",
16940
16997
  title: (params) => {
16941
16998
  const entity = getActivePageEntityName();
16942
16999
  return entity ? `How can we help with "${entity}"?` : "How can we help with packages?";
@@ -16955,6 +17012,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
16955
17012
  match: (pathname) => pathname.startsWith("/detection"),
16956
17013
  defaultApps: [{ name: "shuffle_detection" }],
16957
17014
  defaultPresetId: "detection",
17015
+ buttonLabel: "Ask about detections",
17016
+ headerTitle: "Ask about detections",
16958
17017
  title: "How can we help tune detections?",
16959
17018
  subtitle: "Shuffle Detection MCP",
16960
17019
  defaultPrompt: "Modify my detections to ",
@@ -17113,6 +17172,8 @@ var DEFAULT_AGENT_CONTEXT_RULES = [
17113
17172
  defaultPresetId: null,
17114
17173
  title: "How can we help on this page?",
17115
17174
  subtitle: "General Platform Assistant",
17175
+ buttonLabel: "Ask Shuffle",
17176
+ headerTitle: "Ask Shuffle",
17116
17177
  defaultPrompt: "Help me with the following on this page: ",
17117
17178
  placeholder: "Ask anything about Shuffle, integrations, or workflows...",
17118
17179
  getStorageKey: (params, pathname) => `page_${pathname.replace(/[^a-zA-Z0-9_-]/g, "_")}`,
@@ -17526,7 +17587,14 @@ var RunFinishedSummary = ({
17526
17587
  }) => {
17527
17588
  return /* @__PURE__ */ jsxs24(Fragment12, { children: [
17528
17589
  /* @__PURE__ */ jsxs24(Box22, { sx: { display: "flex", alignItems: "center", gap: 1, flexWrap: "wrap" }, children: [
17529
- 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))" }),
17530
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()}` }),
17531
17599
  showMeta && (decisionCount != null || durationSec != null && durationSec >= 1) && /* @__PURE__ */ jsxs24(Typography19, { sx: { fontSize: "0.75rem", color: "hsl(var(--muted-foreground))" }, children: [
17532
17600
  decisionCount != null ? `${decisionCount} step${decisionCount === 1 ? "" : "s"}` : "",
@@ -17792,14 +17860,14 @@ var TERMINAL_RUN_STATUSES = ["FINISHED", "FAILURE", "ABORTED", "CANCELLED", "CAN
17792
17860
  var resolveRunStatus = (execStatus, agentStatus) => {
17793
17861
  const e = (execStatus || "").toUpperCase();
17794
17862
  const a = (agentStatus || "").toUpperCase();
17795
- if (e === "FINISHED" || a === "FINISHED") return "FINISHED";
17863
+ if (e === "FINISHED" || a === "FINISHED" || e === "SUCCESS" || a === "SUCCESS") return "FINISHED";
17796
17864
  if (e === "FAILURE" || a === "FAILURE") return "FAILURE";
17797
17865
  if (e === "ABORTED" || a === "ABORTED") return "ABORTED";
17798
17866
  if (e === "CANCELLED" || a === "CANCELLED" || e === "CANCELED" || a === "CANCELED") return "CANCELLED";
17799
17867
  if (e === "WAITING" || a === "WAITING") return "WAITING";
17800
17868
  if (e === "PENDING" || a === "PENDING") return "PENDING";
17801
17869
  if (e === "RUNNING" || a === "RUNNING" || e === "EXECUTING" || a === "EXECUTING") return "RUNNING";
17802
- return e || a || "FINISHED";
17870
+ return e || a || "";
17803
17871
  };
17804
17872
  var buildToolName = (apps) => {
17805
17873
  if (!apps.length) return "API";
@@ -19751,6 +19819,12 @@ var AgentUI = ({
19751
19819
  const params = new URLSearchParams(window.location.search);
19752
19820
  eid = params.get("execution_id");
19753
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
+ }
19754
19828
  } else if (contextStorageKey) {
19755
19829
  const saved = getPageContextChoice(contextStorageKey);
19756
19830
  if (saved?.executionId) {
@@ -19993,7 +20067,7 @@ var AgentUI = ({
19993
20067
  }, { replace: true });
19994
20068
  }
19995
20069
  getExecution(eid, auth);
19996
- onRun?.({ input: text2, success: true, executionId: eid });
20070
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
19997
20071
  } else {
19998
20072
  if (contextStorageKey && eid) {
19999
20073
  setPageContextChoice(contextStorageKey, {
@@ -20016,7 +20090,7 @@ var AgentUI = ({
20016
20090
  } else {
20017
20091
  setAgentData({ original_input: text2, status: "FINISHED", message: result.content });
20018
20092
  }
20019
- onRun?.({ input: text2, success: true, executionId: eid });
20093
+ onRun?.({ input: text2, success: true, executionId: eid, authorization: auth });
20020
20094
  }
20021
20095
  }, [chosenApps, executionApps, getExecution, onRun, attachedImages, readUrlParams, setSearchParams, viewMode, selectedPreset, isLoggedIn]);
20022
20096
  const lastSubmittedInputRef = useRef11(null);
@@ -20948,13 +21022,6 @@ var AgentUI = ({
20948
21022
  return !chosen.some((c) => c && (c === target || c.includes(target) || target.includes(c)));
20949
21023
  });
20950
21024
  }, [finishedRunInput, chosenApps]);
20951
- const postRunUnauthedApps = useMemo10(() => {
20952
- if (authAppsLoading) return [];
20953
- return chosenApps.filter((a) => {
20954
- const slug = normalizeAgentAppName(a.name || "");
20955
- return appRequiresAuthentication(slug) && !isAppAuthenticated(a.name || "", a.id || null);
20956
- });
20957
- }, [authAppsLoading, chosenApps, isAppAuthenticated]);
20958
21025
  useEffect18(() => {
20959
21026
  if (cronManualOverrideRef.current) return;
20960
21027
  const m = Math.max(0, Math.min(59, schedMinute));
@@ -21032,7 +21099,22 @@ var AgentUI = ({
21032
21099
  options: [
21033
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 },
21034
21101
  { value: "simple", label: "Simple", disabled: !hasExecution },
21035
- { 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
+ },
21036
21118
  { type: "divider", key: "div" },
21037
21119
  {
21038
21120
  type: "action",
@@ -21058,33 +21140,8 @@ var AgentUI = ({
21058
21140
  }
21059
21141
  }
21060
21142
  }
21061
- // The live run indicator is rendered via the `trailing` slot below so
21062
- // it can use a proper MUI Tooltip while still lining up inside the
21063
- // pill with the other items.
21064
- ],
21065
- trailing: runIsActive && activeTab === "start" ? /* @__PURE__ */ jsxs24(Fragment12, { children: [
21066
- /* @__PURE__ */ jsx31(
21067
- "span",
21068
- {
21069
- "aria-hidden": true,
21070
- style: {
21071
- width: 1,
21072
- height: 18,
21073
- margin: "0 10px",
21074
- background: "hsl(var(--border))",
21075
- alignSelf: "center"
21076
- }
21077
- }
21078
- ),
21079
- /* @__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(
21080
- CircularProgress5,
21081
- {
21082
- size: 14,
21083
- thickness: 5,
21084
- sx: { color: "hsl(var(--muted-foreground))", display: "block" }
21085
- }
21086
- ) }) })
21087
- ] }) : void 0
21143
+ // The live run indicator is rendered in the Detailed tab label above.
21144
+ ]
21088
21145
  }
21089
21146
  )
21090
21147
  }
@@ -21470,7 +21527,7 @@ var AgentUI = ({
21470
21527
  ]
21471
21528
  }
21472
21529
  );
21473
- 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(
21474
21531
  Box22,
21475
21532
  {
21476
21533
  sx: {
@@ -21551,32 +21608,6 @@ var AgentUI = ({
21551
21608
  ]
21552
21609
  }
21553
21610
  ) }),
21554
- 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(
21555
- Box22,
21556
- {
21557
- role: "button",
21558
- onClick: () => setAuthDrawerApp({ name: a.name, id: a.id || null }),
21559
- sx: {
21560
- display: "inline-flex",
21561
- alignItems: "center",
21562
- gap: 0.5,
21563
- px: 1,
21564
- py: 0.25,
21565
- borderRadius: 999,
21566
- border: "1px solid hsl(var(--severity-medium) / 0.55)",
21567
- bgcolor: "hsl(var(--severity-medium) / 0.12)",
21568
- color: "hsl(var(--foreground))",
21569
- fontSize: "0.8rem",
21570
- textTransform: "capitalize",
21571
- cursor: "pointer",
21572
- "&:hover": { bgcolor: "hsl(var(--severity-medium) / 0.2)" }
21573
- },
21574
- children: [
21575
- /* @__PURE__ */ jsx31(WarningIcon, { size: 13, color: "hsl(var(--severity-medium))" }),
21576
- `Authenticate ${(a.name || "").replace(/_/g, " ")}`
21577
- ]
21578
- }
21579
- ) }, `post-auth-${a.id || a.name}`)),
21580
21611
  postRunAppReqs.map((req) => /* @__PURE__ */ jsx31(
21581
21612
  Tooltip14,
21582
21613
  {
@@ -21752,6 +21783,7 @@ var AgentUI = ({
21752
21783
  ] })
21753
21784
  }
21754
21785
  ) : null;
21786
+ const continuationMultiline = continuationText.includes("\n") || continuationText.length > 80;
21755
21787
  const continuationElement = finishDecisionId && !optimisticRunning ? /* @__PURE__ */ jsxs24(Box22, { sx: { width: "100%", maxWidth: 640, mx: "auto" }, children: [
21756
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" }),
21757
21789
  /* @__PURE__ */ jsxs24(
@@ -21766,13 +21798,15 @@ var AgentUI = ({
21766
21798
  },
21767
21799
  sx: {
21768
21800
  display: "flex",
21769
- alignItems: "flex-end",
21801
+ alignItems: continuationMultiline ? "flex-end" : "center",
21770
21802
  gap: 1,
21771
- p: 1.25,
21772
- borderRadius: 999,
21803
+ borderRadius: isPhone ? continuationMultiline ? "20px" : "28px" : "28px",
21773
21804
  border: "1.5px solid hsl(var(--border))",
21774
21805
  bgcolor: "hsl(var(--card))",
21775
- 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",
21776
21810
  "&:focus-within": {
21777
21811
  borderColor: "hsl(var(--primary))",
21778
21812
  boxShadow: "0 0 0 3px hsla(var(--primary) / 0.12)"
@@ -21796,7 +21830,8 @@ var AgentUI = ({
21796
21830
  value: continuationText,
21797
21831
  onChange: (e) => setContinuationText(e.target.value),
21798
21832
  onKeyDown: (e) => {
21799
- 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") {
21800
21835
  e.preventDefault();
21801
21836
  if (continuationText.trim() && !agentRequestLoading) {
21802
21837
  submitQuestions(finishDecisionId, { continue: continuationText }, true);
@@ -21804,24 +21839,44 @@ var AgentUI = ({
21804
21839
  }
21805
21840
  },
21806
21841
  disabled: agentRequestLoading,
21807
- 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
+ }
21808
21861
  }
21809
21862
  ),
21810
- /* @__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(
21811
21864
  IconButton11,
21812
21865
  {
21813
21866
  type: "submit",
21814
21867
  disabled: !continuationText.trim() || agentRequestLoading,
21815
21868
  sx: {
21816
- width: 36,
21817
- height: 36,
21869
+ width: 32,
21870
+ height: 32,
21871
+ flexShrink: 0,
21818
21872
  bgcolor: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary))" : "hsl(var(--muted))",
21819
21873
  color: continuationText.trim() && !agentRequestLoading ? "hsl(var(--primary-foreground))" : "hsl(var(--muted-foreground))",
21820
- "&: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))" }
21821
21876
  },
21822
- 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, {})
21823
21878
  }
21824
- )
21879
+ ) }) })
21825
21880
  ]
21826
21881
  }
21827
21882
  )
@@ -23073,11 +23128,11 @@ var AgentUI = ({
23073
23128
  " \xB7 ",
23074
23129
  execution?.execution_id?.slice(0, 8) || ""
23075
23130
  ] }),
23076
- pendingAuthApps.length > 0 && /* @__PURE__ */ jsxs24(
23131
+ pendingAuthApps.map((a) => /* @__PURE__ */ jsxs24(
23077
23132
  Box22,
23078
23133
  {
23079
23134
  component: "span",
23080
- onClick: () => setAuthDrawerApp({ name: pendingAuthApps[0].appName, id: pendingAuthApps[0].appId }),
23135
+ onClick: () => setAuthDrawerApp({ name: a.appName, id: a.appId }),
23081
23136
  sx: {
23082
23137
  display: "inline-flex",
23083
23138
  alignItems: "center",
@@ -23096,11 +23151,12 @@ var AgentUI = ({
23096
23151
  },
23097
23152
  children: [
23098
23153
  "Missing Auth: ",
23099
- pendingAuthApps.map((a) => formatAppDisplayName(a.appName)).join(", "),
23154
+ formatAppDisplayName(a.appName),
23100
23155
  " \u2014 Connect"
23101
23156
  ]
23102
- }
23103
- )
23157
+ },
23158
+ a.appName
23159
+ ))
23104
23160
  ] })
23105
23161
  ] }),
23106
23162
  /* @__PURE__ */ jsx31(AgentAttachmentsButton_default, { attachments: llmImageAttachments }),
@@ -23280,57 +23336,6 @@ var AgentUI = ({
23280
23336
  }
23281
23337
  }
23282
23338
  ),
23283
- pendingAuthApps.length > 0 && /* @__PURE__ */ jsxs24(
23284
- Box22,
23285
- {
23286
- sx: {
23287
- mb: 2,
23288
- p: 2,
23289
- borderRadius: 2,
23290
- border: "1px solid hsla(var(--severity-medium) / 0.35)",
23291
- bgcolor: "hsla(var(--severity-medium) / 0.08)",
23292
- display: "flex",
23293
- alignItems: "center",
23294
- justifyContent: "space-between",
23295
- gap: 2,
23296
- flexWrap: "wrap"
23297
- },
23298
- children: [
23299
- /* @__PURE__ */ jsxs24(Box22, { sx: { display: "flex", alignItems: "center", gap: 1.5, flex: 1, minWidth: 260 }, children: [
23300
- /* @__PURE__ */ jsx31(LockIcon3, { size: 22, color: "hsl(var(--severity-medium))" }),
23301
- /* @__PURE__ */ jsxs24(Box22, { sx: { flex: 1, minWidth: 0 }, children: [
23302
- /* @__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` }),
23303
- /* @__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.` })
23304
- ] })
23305
- ] }),
23306
- /* @__PURE__ */ jsx31(Box22, { sx: { display: "flex", gap: 1, flexWrap: "wrap" }, children: pendingAuthApps.map(({ appName, appId }) => /* @__PURE__ */ jsxs24(
23307
- Button13,
23308
- {
23309
- variant: "outlined",
23310
- size: "small",
23311
- onClick: () => setAuthDrawerApp({ name: appName, id: appId }),
23312
- sx: {
23313
- borderColor: "hsla(var(--severity-medium) / 0.6)",
23314
- color: "hsl(var(--foreground))",
23315
- textTransform: "none",
23316
- fontSize: "0.75rem",
23317
- fontWeight: 600,
23318
- height: 32,
23319
- "&:hover": {
23320
- bgcolor: "hsla(var(--severity-medium) / 0.15)",
23321
- borderColor: "hsl(var(--severity-medium))"
23322
- }
23323
- },
23324
- children: [
23325
- "Authenticate ",
23326
- formatAppDisplayName(appName)
23327
- ]
23328
- },
23329
- appName
23330
- )) })
23331
- ]
23332
- }
23333
- ),
23334
23339
  viewMode === "simple" && /* @__PURE__ */ jsx31(Box22, { sx: {
23335
23340
  borderRadius: 2,
23336
23341
  border: "1px solid hsl(var(--border))",
@@ -23461,7 +23466,17 @@ var AgentUI = ({
23461
23466
  ) })
23462
23467
  ] })
23463
23468
  ] });
23464
- })() : !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,
23465
23480
  /* @__PURE__ */ jsx31(Box22, { children: /* @__PURE__ */ jsx31(
23466
23481
  Button13,
23467
23482
  {
@@ -24446,7 +24461,7 @@ var LocalLLMConfig = ({ compact, globalUrl, userdata, isLoaded, isLoggedIn, serv
24446
24461
  !compact && (() => {
24447
24462
  const preset = ENDPOINT_PRESETS.find((p) => p.label === effectivePreset);
24448
24463
  const hasProviderDocs = !!preset && (!!preset.apiKeyUrl || !!preset.apiKeyHint);
24449
- 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: [
24450
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.",
24451
24466
  " ",
24452
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" }),
@@ -27427,7 +27442,7 @@ var AskAiButton = ({
27427
27442
  requireSupport = true,
27428
27443
  isBeta = false,
27429
27444
  pathname,
27430
- label = "Ask AI",
27445
+ label = "Ask Shuffle",
27431
27446
  tagLabel,
27432
27447
  contextHint,
27433
27448
  tooltipTitle,
@@ -27450,7 +27465,7 @@ var AskAiButton = ({
27450
27465
  return null;
27451
27466
  }
27452
27467
  const effectiveTagLabel = tagLabel !== void 0 && !(tagLabel === "Support" && isIncidentOrDocs) ? tagLabel : effectiveIsBeta ? "Beta" : "Support";
27453
- 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";
27454
27469
  return /* @__PURE__ */ jsx39(
27455
27470
  Box30,
27456
27471
  {
@@ -27687,12 +27702,13 @@ var AskAiDrawer = ({
27687
27702
  var AskAiDrawer_default = AskAiDrawer;
27688
27703
 
27689
27704
  // components/AskAiSidePanel.tsx
27690
- 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";
27691
27706
  import {
27692
27707
  Box as Box32,
27693
27708
  Button as Button16,
27694
27709
  ButtonBase as ButtonBase4,
27695
27710
  IconButton as IconButton16,
27711
+ Tooltip as Tooltip21,
27696
27712
  Typography as Typography29
27697
27713
  } from "@mui/material";
27698
27714
  import {
@@ -27702,6 +27718,106 @@ import {
27702
27718
  ShieldCheck as ShieldCheck2,
27703
27719
  X as CloseIcon11
27704
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
27705
27821
  import { Fragment as Fragment16, jsx as jsx41, jsxs as jsxs34 } from "react/jsx-runtime";
27706
27822
  import { createElement as createElement3 } from "react";
27707
27823
  var AGENT_DRAWER_OPEN_EVENT = "agent-drawer-open";
@@ -27862,6 +27978,7 @@ var AskAiSidePanel = ({
27862
27978
  const [activeIncidentId, setActiveIncidentId] = useState29(null);
27863
27979
  const [activeIncidentContext, setActiveIncidentContext] = useState29(null);
27864
27980
  const [runResetKey, setRunResetKey] = useState29(0);
27981
+ const [lastRunInfo, setLastRunInfo] = useState29(null);
27865
27982
  useEffect26(() => {
27866
27983
  if (!open) {
27867
27984
  setActiveTaskId(null);
@@ -27907,6 +28024,7 @@ var AskAiSidePanel = ({
27907
28024
  }
27908
28025
  if (detail?.resetExecution) {
27909
28026
  setActiveExecutionId(null);
28027
+ setLastRunInfo(null);
27910
28028
  setRunResetKey((k) => k + 1);
27911
28029
  } else if (detail?.executionId !== void 0) {
27912
28030
  setActiveExecutionId(detail.executionId || null);
@@ -27921,8 +28039,17 @@ var AskAiSidePanel = ({
27921
28039
  }, [handleTabChange]);
27922
28040
  const handleAgentRun = useCallback15(
27923
28041
  (event) => {
27924
- 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) {
27925
28050
  setActiveExecutionId(event.executionId);
28051
+ }
28052
+ if (event.executionId && activeTaskId) {
27926
28053
  if (typeof window !== "undefined") {
27927
28054
  window.dispatchEvent(
27928
28055
  new CustomEvent("shuffle:task_ai_execution", {
@@ -27939,6 +28066,50 @@ var AskAiSidePanel = ({
27939
28066
  [activeTaskId]
27940
28067
  );
27941
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
+ ]);
27942
28113
  const agentUiKey = activeTaskId ? `${context.storageKey}:task:${activeTaskId}:${activeExecutionId || "fresh"}:${runResetKey}` : `${context.storageKey}:${runResetKey}`;
27943
28114
  const effectiveLocalLLMSlot = localLLMSlot ?? /* @__PURE__ */ jsx41(
27944
28115
  LocalLLMConfig_default,
@@ -28012,19 +28183,41 @@ var AskAiSidePanel = ({
28012
28183
  setIsResizing(true);
28013
28184
  const startX = e.clientX;
28014
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
+ }
28015
28192
  const handleMouseMove = (moveEvent) => {
28016
28193
  const deltaX = startX - moveEvent.clientX;
28017
28194
  const maxAllowed = Math.min(MAX_ASK_AI_PANEL_WIDTH, (window.innerWidth || 1200) - 40);
28018
28195
  const nextWidth = Math.round(
28019
28196
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28020
28197
  );
28021
- setPanelWidth(nextWidth);
28022
- if (typeof document !== "undefined") {
28023
- 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
+ });
28024
28209
  }
28025
28210
  };
28026
28211
  const handleMouseUp = (upEvent) => {
28027
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
+ }
28028
28221
  window.removeEventListener("mousemove", handleMouseMove);
28029
28222
  window.removeEventListener("mouseup", handleMouseUp);
28030
28223
  const deltaX = startX - upEvent.clientX;
@@ -28032,9 +28225,16 @@ var AskAiSidePanel = ({
28032
28225
  const finalWidth = Math.round(
28033
28226
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28034
28227
  );
28035
- try {
28036
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28037
- } 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
+ }
28038
28238
  }
28039
28239
  };
28040
28240
  window.addEventListener("mousemove", handleMouseMove);
@@ -28045,6 +28245,8 @@ var AskAiSidePanel = ({
28045
28245
  setIsResizing(true);
28046
28246
  const startX = e.touches[0].clientX;
28047
28247
  const startW = panelWidth;
28248
+ let rafId = null;
28249
+ let currentNextWidth = startW;
28048
28250
  const handleTouchMove = (moveEvent) => {
28049
28251
  if (moveEvent.touches.length !== 1) return;
28050
28252
  const deltaX = startX - moveEvent.touches[0].clientX;
@@ -28052,13 +28254,25 @@ var AskAiSidePanel = ({
28052
28254
  const nextWidth = Math.round(
28053
28255
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28054
28256
  );
28055
- setPanelWidth(nextWidth);
28056
- if (typeof document !== "undefined") {
28057
- 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
+ });
28058
28268
  }
28059
28269
  };
28060
28270
  const handleTouchEnd = (endEvent) => {
28061
28271
  setIsResizing(false);
28272
+ if (rafId) {
28273
+ window.cancelAnimationFrame(rafId);
28274
+ rafId = null;
28275
+ }
28062
28276
  window.removeEventListener("touchmove", handleTouchMove);
28063
28277
  window.removeEventListener("touchend", handleTouchEnd);
28064
28278
  const clientX = endEvent.changedTouches[0]?.clientX ?? startX;
@@ -28067,9 +28281,16 @@ var AskAiSidePanel = ({
28067
28281
  const finalWidth = Math.round(
28068
28282
  Math.max(MIN_ASK_AI_PANEL_WIDTH, Math.min(maxAllowed, startW + deltaX))
28069
28283
  );
28070
- try {
28071
- localStorage.setItem(ASK_AI_PANEL_WIDTH_STORAGE_KEY, String(finalWidth));
28072
- } 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
+ }
28073
28294
  }
28074
28295
  };
28075
28296
  window.addEventListener("touchmove", handleTouchMove, { passive: false });
@@ -28112,6 +28333,18 @@ var AskAiSidePanel = ({
28112
28333
  return null;
28113
28334
  }
28114
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
+ ),
28115
28348
  /* @__PURE__ */ jsx41(
28116
28349
  Box32,
28117
28350
  {
@@ -28133,7 +28366,7 @@ var AskAiSidePanel = ({
28133
28366
  {
28134
28367
  ref: panelRef,
28135
28368
  component: "aside",
28136
- "aria-label": "Ask AI",
28369
+ "aria-label": "Ask Shuffle",
28137
28370
  "aria-hidden": !isVisible,
28138
28371
  className: themeScope?.scopeClassName,
28139
28372
  sx: [
@@ -28170,23 +28403,49 @@ var AskAiSidePanel = ({
28170
28403
  onTouchStart: handleTouchResizeStart,
28171
28404
  role: "separator",
28172
28405
  "aria-orientation": "vertical",
28173
- "aria-label": "Resize Ask AI panel",
28406
+ "aria-label": "Resize Ask Shuffle panel",
28174
28407
  sx: {
28175
28408
  position: "absolute",
28176
28409
  top: 0,
28177
28410
  bottom: 0,
28178
- left: 0,
28179
- width: 8,
28411
+ left: -6,
28412
+ width: 14,
28180
28413
  cursor: "col-resize",
28181
28414
  zIndex: 1300,
28182
28415
  transition: "background-color 0.15s ease",
28183
28416
  userSelect: "none",
28184
- display: { xs: "none", sm: "block" },
28417
+ display: { xs: "none", sm: "flex" },
28418
+ alignItems: "center",
28419
+ justifyContent: "center",
28185
28420
  "&:hover, &:active": {
28186
- 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
+ }
28187
28426
  },
28188
- ...isResizing ? { bgcolor: "hsl(var(--primary) / 0.55)" } : {}
28189
- }
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
+ )
28190
28449
  }
28191
28450
  ),
28192
28451
  /* @__PURE__ */ jsxs34(
@@ -28203,7 +28462,7 @@ var AskAiSidePanel = ({
28203
28462
  flexShrink: 0
28204
28463
  },
28205
28464
  children: [
28206
- /* @__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: [
28207
28466
  /* @__PURE__ */ jsx41(
28208
28467
  Box32,
28209
28468
  {
@@ -28225,13 +28484,17 @@ var AskAiSidePanel = ({
28225
28484
  /* @__PURE__ */ jsx41(
28226
28485
  Typography29,
28227
28486
  {
28487
+ noWrap: true,
28228
28488
  sx: {
28229
28489
  fontWeight: 700,
28230
28490
  fontSize: "0.86rem",
28231
28491
  color: "hsl(var(--foreground))",
28232
- letterSpacing: "-0.01em"
28492
+ letterSpacing: "-0.01em",
28493
+ minWidth: 0,
28494
+ overflow: "hidden",
28495
+ textOverflow: "ellipsis"
28233
28496
  },
28234
- 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"
28235
28498
  }
28236
28499
  ),
28237
28500
  /* @__PURE__ */ jsx41(
@@ -28247,30 +28510,75 @@ var AskAiSidePanel = ({
28247
28510
  borderRadius: "4px",
28248
28511
  bgcolor: isBetaRoute ? "hsla(var(--primary) / 0.12)" : "hsl(var(--muted))",
28249
28512
  color: isBetaRoute ? "hsl(var(--primary))" : "hsl(var(--muted-foreground))",
28250
- 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
28251
28515
  },
28252
28516
  children: isBetaRoute ? "Beta" : isLoggedIn ? isSupport ? "Support" : "Agent" : "Guest"
28253
28517
  }
28254
28518
  )
28255
28519
  ] }),
28256
- /* @__PURE__ */ jsx41(Box32, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: /* @__PURE__ */ jsx41(
28257
- IconButton16,
28258
- {
28259
- onClick: onClose,
28260
- size: "small",
28261
- "aria-label": "Close Ask AI panel",
28262
- sx: {
28263
- color: "hsl(var(--muted-foreground))",
28264
- p: 0.75,
28265
- borderRadius: "8px",
28266
- "&:hover": {
28267
- color: "hsl(var(--foreground))",
28268
- bgcolor: "hsl(var(--muted))"
28269
- }
28270
- },
28271
- children: /* @__PURE__ */ jsx41(CloseIcon11, { size: 16 })
28272
- }
28273
- ) })
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
+ ] })
28274
28582
  ]
28275
28583
  }
28276
28584
  ),
@@ -28568,6 +28876,8 @@ var AskAiSidePanel_default = AskAiSidePanel;
28568
28876
  import { useCallback as useCallback16, useEffect as useEffect27, useMemo as useMemo15, useState as useState30 } from "react";
28569
28877
  import { Fragment as Fragment17, jsx as jsx42, jsxs as jsxs35 } from "react/jsx-runtime";
28570
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";
28571
28881
  var AskAiWidget = ({
28572
28882
  open: controlledOpen,
28573
28883
  onOpenChange,
@@ -28641,12 +28951,29 @@ var AskAiWidget = ({
28641
28951
  window.addEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
28642
28952
  return () => window.removeEventListener(AGENT_DRAWER_OPEN_EVENT2, handleDrawerOpenEvent);
28643
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]);
28644
28971
  useEffect27(() => {
28645
28972
  if (propInitialTab) {
28646
28973
  setActiveTab(propInitialTab);
28647
28974
  }
28648
28975
  }, [propInitialTab]);
28649
- 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";
28650
28977
  const isIncidentOrDocsRoute = currentPath.startsWith("/incidents") || currentPath.startsWith("/incidents-simple") || currentPath.startsWith("/cases") || currentPath.startsWith("/alerts") || currentPath.startsWith("/tickets") || currentPath.startsWith("/docs");
28651
28978
  const isBeta = activeContext.isBeta === true || isIncidentOrDocsRoute;
28652
28979
  const effectiveRequireSupport = isBeta ? false : requireSupport;
@@ -29945,6 +30272,9 @@ var AgentRunDiagnosisBanner2 = withMcpTheme(AgentRunDiagnosisBanner_default, "Ag
29945
30272
  var LocalLLMConfig2 = withMcpTheme(LocalLLMConfig_default, "LocalLLMConfig");
29946
30273
  var AddAppModal2 = withMcpTheme(AddAppModal_default, "AddAppModal");
29947
30274
  export {
30275
+ AGENT_DRAWER_CLOSE_EVENT,
30276
+ AGENT_DRAWER_OPEN_EVENT2 as AGENT_DRAWER_OPEN_EVENT,
30277
+ AGENT_DRAWER_STATE_EVENT,
29948
30278
  AGENT_PRESETS,
29949
30279
  AGENT_PROMPT_PREFIX_CATEGORY,
29950
30280
  API_CONFIG,
@@ -30002,6 +30332,7 @@ export {
30002
30332
  VULN_SCANNER_PATTERNS,
30003
30333
  VideoEmbed,
30004
30334
  applyRegionFromPayload,
30335
+ buildSupportEscalationUrl,
30005
30336
  checkAppNameMatch,
30006
30337
  clearPageContextChoice,
30007
30338
  index_default as default,
@@ -30049,6 +30380,7 @@ export {
30049
30380
  matchRoutePattern,
30050
30381
  mergeConnectedTools,
30051
30382
  normalizeAppName,
30383
+ openSupportEscalation,
30052
30384
  parseRunResult,
30053
30385
  refreshAllIntegrationStatus,
30054
30386
  registerAgentContextRule,
@@ -30058,6 +30390,7 @@ export {
30058
30390
  resolveApp,
30059
30391
  resolveApps,
30060
30392
  resolveConnectedTools,
30393
+ resolveContactUserInfo,
30061
30394
  resolveVideoUrl,
30062
30395
  scheduleAgentRun,
30063
30396
  searchAgentActivity,