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