@shuffleio/shuffle-mcps 0.0.50 → 0.0.54

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
@@ -1428,7 +1428,7 @@ var buildComponentOverrides = (scopeClassName) => ({
1428
1428
  }
1429
1429
  });
1430
1430
  var ShuffleMcpThemeProvider = ({
1431
- children,
1431
+ children: children2,
1432
1432
  mode = "auto"
1433
1433
  }) => {
1434
1434
  const parent = (0, import_material.useTheme)();
@@ -1460,12 +1460,12 @@ var ShuffleMcpThemeProvider = ({
1460
1460
  if (sameAsParent) {
1461
1461
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: [
1462
1462
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: anchorRef, style: { display: "none" }, "aria-hidden": true }),
1463
- children
1463
+ children2
1464
1464
  ] });
1465
1465
  }
1466
1466
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ShuffleMcpThemeContext.Provider, { value: ctxValue, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.ThemeProvider, { theme: merged, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: scopeClassName, "data-shuffle-mode": resolvedModeAttr, "data-shuffle-mcp-root": true, children: [
1467
1467
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { ref: anchorRef, style: { display: "none" }, "aria-hidden": true }),
1468
- children
1468
+ children2
1469
1469
  ] }) }) });
1470
1470
  };
1471
1471
 
@@ -1483,7 +1483,755 @@ var import_material3 = require("@mui/material");
1483
1483
  var import_react_markdown = __toESM(require("react-markdown"));
1484
1484
  var import_remark_gfm = __toESM(require("remark-gfm"));
1485
1485
  var import_remark_breaks = __toESM(require("remark-breaks"));
1486
- var import_rehype_sanitize = __toESM(require("rehype-sanitize"));
1486
+
1487
+ // node_modules/@ungap/structured-clone/esm/types.js
1488
+ var VOID = -1;
1489
+ var PRIMITIVE = 0;
1490
+ var ARRAY = 1;
1491
+ var OBJECT = 2;
1492
+ var DATE = 3;
1493
+ var REGEXP = 4;
1494
+ var MAP = 5;
1495
+ var SET = 6;
1496
+ var ERROR = 7;
1497
+ var BIGINT = 8;
1498
+
1499
+ // node_modules/@ungap/structured-clone/esm/deserialize.js
1500
+ var { defineProperty } = Object;
1501
+ var env = typeof self === "object" ? self : globalThis;
1502
+ var guard = (name, init) => {
1503
+ switch (name) {
1504
+ case "Function":
1505
+ case "SharedWorker":
1506
+ case "Worker":
1507
+ case "eval":
1508
+ case "setInterval":
1509
+ case "setTimeout":
1510
+ throw new TypeError("unable to deserialize " + name);
1511
+ }
1512
+ return new env[name](init);
1513
+ };
1514
+ var deserializer = ($, _) => {
1515
+ const as = (out, index) => {
1516
+ $.set(index, out);
1517
+ return out;
1518
+ };
1519
+ const unpair = (index) => {
1520
+ if ($.has(index))
1521
+ return $.get(index);
1522
+ const [type, value] = _[index];
1523
+ switch (type) {
1524
+ case PRIMITIVE:
1525
+ case VOID:
1526
+ return as(value, index);
1527
+ case ARRAY: {
1528
+ const arr = as([], index);
1529
+ for (const index2 of value)
1530
+ arr.push(unpair(index2));
1531
+ return arr;
1532
+ }
1533
+ case OBJECT: {
1534
+ const object = as({}, index);
1535
+ for (const [key, index2] of value) {
1536
+ const k = unpair(key), value2 = unpair(index2);
1537
+ if (k === "__proto__") defineProperty(object, k, {
1538
+ value: value2,
1539
+ configurable: true,
1540
+ enumerable: true,
1541
+ writable: true
1542
+ });
1543
+ else object[k] = value2;
1544
+ }
1545
+ return object;
1546
+ }
1547
+ case DATE:
1548
+ return as(new Date(value), index);
1549
+ case REGEXP: {
1550
+ const { source, flags } = value;
1551
+ return as(new RegExp(source, flags), index);
1552
+ }
1553
+ case MAP: {
1554
+ const map = as(/* @__PURE__ */ new Map(), index);
1555
+ for (const [key, index2] of value)
1556
+ map.set(unpair(key), unpair(index2));
1557
+ return map;
1558
+ }
1559
+ case SET: {
1560
+ const set = as(/* @__PURE__ */ new Set(), index);
1561
+ for (const index2 of value)
1562
+ set.add(unpair(index2));
1563
+ return set;
1564
+ }
1565
+ case ERROR: {
1566
+ const { name, message } = value;
1567
+ return as(
1568
+ typeof env[name] === "function" ? guard(name, message) : new Error(message),
1569
+ index
1570
+ );
1571
+ }
1572
+ case BIGINT:
1573
+ return as(BigInt(value), index);
1574
+ case "BigInt":
1575
+ return as(Object(BigInt(value)), index);
1576
+ case "ArrayBuffer":
1577
+ return as(new Uint8Array(value).buffer, value);
1578
+ case "DataView": {
1579
+ const { buffer } = new Uint8Array(value);
1580
+ return as(new DataView(buffer), value);
1581
+ }
1582
+ case "-0":
1583
+ return -0;
1584
+ }
1585
+ return as(guard(type, value), index);
1586
+ };
1587
+ return unpair;
1588
+ };
1589
+ var deserialize = (serialized) => deserializer(/* @__PURE__ */ new Map(), serialized)(0);
1590
+
1591
+ // node_modules/@ungap/structured-clone/esm/serialize.js
1592
+ var EMPTY = "";
1593
+ var { toString } = {};
1594
+ var { keys, is } = Object;
1595
+ var typeOf = (value) => {
1596
+ const type = typeof value;
1597
+ if (type !== "object" || !value)
1598
+ return [PRIMITIVE, type];
1599
+ const asString = toString.call(value).slice(8, -1);
1600
+ switch (asString) {
1601
+ case "Array":
1602
+ return [ARRAY, EMPTY];
1603
+ case "Object":
1604
+ return [OBJECT, EMPTY];
1605
+ case "Date":
1606
+ return [DATE, EMPTY];
1607
+ case "RegExp":
1608
+ return [REGEXP, EMPTY];
1609
+ case "Map":
1610
+ return [MAP, EMPTY];
1611
+ case "Set":
1612
+ return [SET, EMPTY];
1613
+ case "DataView":
1614
+ return [ARRAY, asString];
1615
+ }
1616
+ if (asString.includes("Array"))
1617
+ return [ARRAY, asString];
1618
+ if (value instanceof Error)
1619
+ return [ERROR, value.name || "Error"];
1620
+ return [OBJECT, asString];
1621
+ };
1622
+ var shouldSkip = ([TYPE, type]) => TYPE === PRIMITIVE && (type === "function" || type === "symbol");
1623
+ var serializer = (strict, json, $, _) => {
1624
+ const as = (out, value) => {
1625
+ const index = _.push(out) - 1;
1626
+ $.set(value, index);
1627
+ return index;
1628
+ };
1629
+ const pair = (value) => {
1630
+ if ($.has(value))
1631
+ return $.get(value);
1632
+ let [TYPE, type] = typeOf(value);
1633
+ switch (TYPE) {
1634
+ case PRIMITIVE: {
1635
+ let entry = value;
1636
+ switch (type) {
1637
+ case "bigint":
1638
+ TYPE = BIGINT;
1639
+ entry = value.toString();
1640
+ break;
1641
+ case "number":
1642
+ if (!value && is(value, -0))
1643
+ return _.push(["-0"]) - 1;
1644
+ break;
1645
+ case "function":
1646
+ case "symbol":
1647
+ if (strict)
1648
+ throw new TypeError("unable to serialize " + type);
1649
+ entry = null;
1650
+ break;
1651
+ case "undefined":
1652
+ return as([VOID], value);
1653
+ }
1654
+ return as([TYPE, entry], value);
1655
+ }
1656
+ case ARRAY: {
1657
+ if (type) {
1658
+ let spread = value;
1659
+ if (type === "DataView") {
1660
+ spread = new Uint8Array(value.buffer);
1661
+ } else if (type === "ArrayBuffer") {
1662
+ spread = new Uint8Array(value);
1663
+ }
1664
+ return as([type, [...spread]], value);
1665
+ }
1666
+ const arr = [];
1667
+ const index = as([TYPE, arr], value);
1668
+ for (const entry of value)
1669
+ arr.push(pair(entry));
1670
+ return index;
1671
+ }
1672
+ case OBJECT: {
1673
+ if (type) {
1674
+ switch (type) {
1675
+ case "BigInt":
1676
+ return as([type, value.toString()], value);
1677
+ case "Boolean":
1678
+ case "Number":
1679
+ case "String":
1680
+ return as([type, value.valueOf()], value);
1681
+ }
1682
+ }
1683
+ if (json && "toJSON" in value)
1684
+ return pair(value.toJSON());
1685
+ const entries = [];
1686
+ const index = as([TYPE, entries], value);
1687
+ for (const key of keys(value)) {
1688
+ if (strict || !shouldSkip(typeOf(value[key])))
1689
+ entries.push([pair(key), pair(value[key])]);
1690
+ }
1691
+ return index;
1692
+ }
1693
+ case DATE:
1694
+ return as([TYPE, isNaN(value.getTime()) ? EMPTY : value.toISOString()], value);
1695
+ case REGEXP: {
1696
+ const { source, flags } = value;
1697
+ return as([TYPE, { source, flags }], value);
1698
+ }
1699
+ case MAP: {
1700
+ const entries = [];
1701
+ const index = as([TYPE, entries], value);
1702
+ for (const [key, entry] of value) {
1703
+ if (strict || !(shouldSkip(typeOf(key)) || shouldSkip(typeOf(entry))))
1704
+ entries.push([pair(key), pair(entry)]);
1705
+ }
1706
+ return index;
1707
+ }
1708
+ case SET: {
1709
+ const entries = [];
1710
+ const index = as([TYPE, entries], value);
1711
+ for (const entry of value) {
1712
+ if (strict || !shouldSkip(typeOf(entry)))
1713
+ entries.push(pair(entry));
1714
+ }
1715
+ return index;
1716
+ }
1717
+ }
1718
+ const { message } = value;
1719
+ return as([TYPE, { name: type, message }], value);
1720
+ };
1721
+ return pair;
1722
+ };
1723
+ var serialize = (value, { json, lossy } = {}) => {
1724
+ const _ = [];
1725
+ return serializer(!(json || lossy), !!json, /* @__PURE__ */ new Map(), _)(value), _;
1726
+ };
1727
+
1728
+ // node_modules/@ungap/structured-clone/esm/index.js
1729
+ var esm_default = typeof structuredClone === "function" ? (
1730
+ /* c8 ignore start */
1731
+ (any, options) => options && ("json" in options || "lossy" in options) ? deserialize(serialize(any, options)) : structuredClone(any)
1732
+ ) : (any, options) => deserialize(serialize(any, options));
1733
+
1734
+ // node_modules/unist-util-position/lib/index.js
1735
+ var pointEnd = point("end");
1736
+ var pointStart = point("start");
1737
+ function point(type) {
1738
+ return point2;
1739
+ function point2(node) {
1740
+ const point3 = node && node.position && node.position[type] || {};
1741
+ if (typeof point3.line === "number" && point3.line > 0 && typeof point3.column === "number" && point3.column > 0) {
1742
+ return {
1743
+ line: point3.line,
1744
+ column: point3.column,
1745
+ offset: typeof point3.offset === "number" && point3.offset > -1 ? point3.offset : void 0
1746
+ };
1747
+ }
1748
+ }
1749
+ }
1750
+ function position(node) {
1751
+ const start = pointStart(node);
1752
+ const end = pointEnd(node);
1753
+ if (start && end) {
1754
+ return { start, end };
1755
+ }
1756
+ }
1757
+
1758
+ // node_modules/hast-util-sanitize/lib/schema.js
1759
+ var aria = ["ariaDescribedBy", "ariaLabel", "ariaLabelledBy"];
1760
+ var defaultSchema = {
1761
+ ancestors: {
1762
+ tbody: ["table"],
1763
+ td: ["table"],
1764
+ th: ["table"],
1765
+ thead: ["table"],
1766
+ tfoot: ["table"],
1767
+ tr: ["table"]
1768
+ },
1769
+ attributes: {
1770
+ a: [
1771
+ ...aria,
1772
+ // Note: these 3 are used by GFM footnotes, they do work on all links.
1773
+ "dataFootnoteBackref",
1774
+ "dataFootnoteRef",
1775
+ ["className", "data-footnote-backref"],
1776
+ "href"
1777
+ ],
1778
+ blockquote: ["cite"],
1779
+ // Note: this class is not normally allowed by GH, when manually writing
1780
+ // `code` as HTML in markdown, they adds it some other way.
1781
+ // We can’t do that, so we have to allow it.
1782
+ code: [["className", /^language-./]],
1783
+ del: ["cite"],
1784
+ div: ["itemScope", "itemType"],
1785
+ dl: [...aria],
1786
+ // Note: this is used by GFM footnotes.
1787
+ h2: [["className", "sr-only"]],
1788
+ img: [...aria, "longDesc", "src"],
1789
+ // Note: `input` is not normally allowed by GH, when manually writing
1790
+ // it in markdown, they add it from tasklists some other way.
1791
+ // We can’t do that, so we have to allow it.
1792
+ input: [
1793
+ ["disabled", true],
1794
+ ["type", "checkbox"]
1795
+ ],
1796
+ ins: ["cite"],
1797
+ // Note: this class is not normally allowed by GH, when manually writing
1798
+ // `li` as HTML in markdown, they adds it some other way.
1799
+ // We can’t do that, so we have to allow it.
1800
+ li: [["className", "task-list-item"]],
1801
+ // Note: this class is not normally allowed by GH, when manually writing
1802
+ // `ol` as HTML in markdown, they adds it some other way.
1803
+ // We can’t do that, so we have to allow it.
1804
+ ol: [...aria, ["className", "contains-task-list"]],
1805
+ q: ["cite"],
1806
+ section: ["dataFootnotes", ["className", "footnotes"]],
1807
+ source: ["srcSet"],
1808
+ summary: [...aria],
1809
+ table: [...aria],
1810
+ // Note: this class is not normally allowed by GH, when manually writing
1811
+ // `ol` as HTML in markdown, they adds it some other way.
1812
+ // We can’t do that, so we have to allow it.
1813
+ ul: [...aria, ["className", "contains-task-list"]],
1814
+ "*": [
1815
+ "abbr",
1816
+ "accept",
1817
+ "acceptCharset",
1818
+ "accessKey",
1819
+ "action",
1820
+ "align",
1821
+ "alt",
1822
+ "axis",
1823
+ "border",
1824
+ "cellPadding",
1825
+ "cellSpacing",
1826
+ "char",
1827
+ "charOff",
1828
+ "charSet",
1829
+ "checked",
1830
+ "clear",
1831
+ "colSpan",
1832
+ "color",
1833
+ "cols",
1834
+ "compact",
1835
+ "coords",
1836
+ "dateTime",
1837
+ "dir",
1838
+ // Note: `disabled` is technically allowed on all elements by GH.
1839
+ // But it is useless on everything except `input`.
1840
+ // Because `input`s are normally not allowed, but we allow them for
1841
+ // checkboxes due to tasklists, we allow `disabled` only there.
1842
+ "encType",
1843
+ "frame",
1844
+ "hSpace",
1845
+ "headers",
1846
+ "height",
1847
+ "hrefLang",
1848
+ "htmlFor",
1849
+ "id",
1850
+ "isMap",
1851
+ "itemProp",
1852
+ "label",
1853
+ "lang",
1854
+ "maxLength",
1855
+ "media",
1856
+ "method",
1857
+ "multiple",
1858
+ "name",
1859
+ "noHref",
1860
+ "noShade",
1861
+ "noWrap",
1862
+ "open",
1863
+ "prompt",
1864
+ "readOnly",
1865
+ "rev",
1866
+ "rowSpan",
1867
+ "rows",
1868
+ "rules",
1869
+ "scope",
1870
+ "selected",
1871
+ "shape",
1872
+ "size",
1873
+ "span",
1874
+ "start",
1875
+ "summary",
1876
+ "tabIndex",
1877
+ "title",
1878
+ "useMap",
1879
+ "vAlign",
1880
+ "value",
1881
+ "width"
1882
+ ]
1883
+ },
1884
+ clobber: ["ariaDescribedBy", "ariaLabelledBy", "id", "name"],
1885
+ clobberPrefix: "user-content-",
1886
+ protocols: {
1887
+ cite: ["http", "https"],
1888
+ href: ["http", "https", "irc", "ircs", "mailto", "xmpp"],
1889
+ longDesc: ["http", "https"],
1890
+ src: ["http", "https"]
1891
+ },
1892
+ required: {
1893
+ input: { disabled: true, type: "checkbox" }
1894
+ },
1895
+ strip: ["script"],
1896
+ tagNames: [
1897
+ "a",
1898
+ "b",
1899
+ "blockquote",
1900
+ "br",
1901
+ "code",
1902
+ "dd",
1903
+ "del",
1904
+ "details",
1905
+ "div",
1906
+ "dl",
1907
+ "dt",
1908
+ "em",
1909
+ "h1",
1910
+ "h2",
1911
+ "h3",
1912
+ "h4",
1913
+ "h5",
1914
+ "h6",
1915
+ "hr",
1916
+ "i",
1917
+ "img",
1918
+ // Note: `input` is not normally allowed by GH, when manually writing
1919
+ // it in markdown, they add it from tasklists some other way.
1920
+ // We can’t do that, so we have to allow it.
1921
+ "input",
1922
+ "ins",
1923
+ "kbd",
1924
+ "li",
1925
+ "ol",
1926
+ "p",
1927
+ "picture",
1928
+ "pre",
1929
+ "q",
1930
+ "rp",
1931
+ "rt",
1932
+ "ruby",
1933
+ "s",
1934
+ "samp",
1935
+ "section",
1936
+ "source",
1937
+ "span",
1938
+ "strike",
1939
+ "strong",
1940
+ "sub",
1941
+ "summary",
1942
+ "sup",
1943
+ "table",
1944
+ "tbody",
1945
+ "td",
1946
+ "tfoot",
1947
+ "th",
1948
+ "thead",
1949
+ "tr",
1950
+ "tt",
1951
+ "ul",
1952
+ "var"
1953
+ ]
1954
+ };
1955
+
1956
+ // node_modules/hast-util-sanitize/lib/index.js
1957
+ var own = {}.hasOwnProperty;
1958
+ function sanitize(node, options) {
1959
+ let result = { type: "root", children: [] };
1960
+ const state3 = {
1961
+ schema: options ? { ...defaultSchema, ...options } : defaultSchema,
1962
+ stack: []
1963
+ };
1964
+ const replace = transform(state3, node);
1965
+ if (replace) {
1966
+ if (Array.isArray(replace)) {
1967
+ if (replace.length === 1) {
1968
+ result = replace[0];
1969
+ } else {
1970
+ result.children = replace;
1971
+ }
1972
+ } else {
1973
+ result = replace;
1974
+ }
1975
+ }
1976
+ return result;
1977
+ }
1978
+ function transform(state3, node) {
1979
+ if (node && typeof node === "object") {
1980
+ const unsafe = (
1981
+ /** @type {Record<string, Readonly<unknown>>} */
1982
+ node
1983
+ );
1984
+ const type = typeof unsafe.type === "string" ? unsafe.type : "";
1985
+ switch (type) {
1986
+ case "comment": {
1987
+ return comment(state3, unsafe);
1988
+ }
1989
+ case "doctype": {
1990
+ return doctype(state3, unsafe);
1991
+ }
1992
+ case "element": {
1993
+ return element(state3, unsafe);
1994
+ }
1995
+ case "root": {
1996
+ return root(state3, unsafe);
1997
+ }
1998
+ case "text": {
1999
+ return text(state3, unsafe);
2000
+ }
2001
+ default:
2002
+ }
2003
+ }
2004
+ }
2005
+ function comment(state3, unsafe) {
2006
+ if (state3.schema.allowComments) {
2007
+ const result = typeof unsafe.value === "string" ? unsafe.value : "";
2008
+ const index = result.indexOf("-->");
2009
+ const value = index < 0 ? result : result.slice(0, index);
2010
+ const node = { type: "comment", value };
2011
+ patch(node, unsafe);
2012
+ return node;
2013
+ }
2014
+ }
2015
+ function doctype(state3, unsafe) {
2016
+ if (state3.schema.allowDoctypes) {
2017
+ const node = { type: "doctype" };
2018
+ patch(node, unsafe);
2019
+ return node;
2020
+ }
2021
+ }
2022
+ function element(state3, unsafe) {
2023
+ const name = typeof unsafe.tagName === "string" ? unsafe.tagName : "";
2024
+ state3.stack.push(name);
2025
+ const content = (
2026
+ /** @type {Array<ElementContent>} */
2027
+ children(state3, unsafe.children)
2028
+ );
2029
+ const properties_ = properties(state3, unsafe.properties);
2030
+ state3.stack.pop();
2031
+ let safeElement = false;
2032
+ if (name && name !== "*" && (!state3.schema.tagNames || state3.schema.tagNames.includes(name))) {
2033
+ safeElement = true;
2034
+ if (state3.schema.ancestors && own.call(state3.schema.ancestors, name)) {
2035
+ const ancestors = state3.schema.ancestors[name];
2036
+ let index = -1;
2037
+ safeElement = false;
2038
+ while (++index < ancestors.length) {
2039
+ if (state3.stack.includes(ancestors[index])) {
2040
+ safeElement = true;
2041
+ }
2042
+ }
2043
+ }
2044
+ }
2045
+ if (!safeElement) {
2046
+ return state3.schema.strip && !state3.schema.strip.includes(name) ? content : void 0;
2047
+ }
2048
+ const node = {
2049
+ type: "element",
2050
+ tagName: name,
2051
+ properties: properties_,
2052
+ children: content
2053
+ };
2054
+ patch(node, unsafe);
2055
+ return node;
2056
+ }
2057
+ function root(state3, unsafe) {
2058
+ const content = (
2059
+ /** @type {Array<RootContent>} */
2060
+ children(state3, unsafe.children)
2061
+ );
2062
+ const node = { type: "root", children: content };
2063
+ patch(node, unsafe);
2064
+ return node;
2065
+ }
2066
+ function text(_, unsafe) {
2067
+ const value = typeof unsafe.value === "string" ? unsafe.value : "";
2068
+ const node = { type: "text", value };
2069
+ patch(node, unsafe);
2070
+ return node;
2071
+ }
2072
+ function children(state3, children2) {
2073
+ const results = [];
2074
+ if (Array.isArray(children2)) {
2075
+ const childrenUnknown = (
2076
+ /** @type {Array<Readonly<unknown>>} */
2077
+ children2
2078
+ );
2079
+ let index = -1;
2080
+ while (++index < childrenUnknown.length) {
2081
+ const value = transform(state3, childrenUnknown[index]);
2082
+ if (value) {
2083
+ if (Array.isArray(value)) {
2084
+ results.push(...value);
2085
+ } else {
2086
+ results.push(value);
2087
+ }
2088
+ }
2089
+ }
2090
+ }
2091
+ return results;
2092
+ }
2093
+ function properties(state3, properties2) {
2094
+ const tagName = state3.stack[state3.stack.length - 1];
2095
+ const attributes = state3.schema.attributes;
2096
+ const required = state3.schema.required;
2097
+ const specific = attributes && own.call(attributes, tagName) ? attributes[tagName] : void 0;
2098
+ const defaults = attributes && own.call(attributes, "*") ? attributes["*"] : void 0;
2099
+ const properties_ = (
2100
+ /** @type {Readonly<Record<string, Readonly<unknown>>>} */
2101
+ properties2 && typeof properties2 === "object" ? properties2 : {}
2102
+ );
2103
+ const result = {};
2104
+ let key;
2105
+ for (key in properties_) {
2106
+ if (own.call(properties_, key)) {
2107
+ const unsafe = properties_[key];
2108
+ let safe = propertyValue(
2109
+ state3,
2110
+ findDefinition(specific, key),
2111
+ key,
2112
+ unsafe
2113
+ );
2114
+ if (safe === null || safe === void 0) {
2115
+ safe = propertyValue(state3, findDefinition(defaults, key), key, unsafe);
2116
+ }
2117
+ if (safe !== null && safe !== void 0) {
2118
+ result[key] = safe;
2119
+ }
2120
+ }
2121
+ }
2122
+ if (required && own.call(required, tagName)) {
2123
+ const properties3 = required[tagName];
2124
+ for (key in properties3) {
2125
+ if (own.call(properties3, key) && !own.call(result, key)) {
2126
+ result[key] = properties3[key];
2127
+ }
2128
+ }
2129
+ }
2130
+ return result;
2131
+ }
2132
+ function propertyValue(state3, definition, key, value) {
2133
+ return definition ? Array.isArray(value) ? propertyValueMany(state3, definition, key, value) : propertyValuePrimitive(state3, definition, key, value) : void 0;
2134
+ }
2135
+ function propertyValueMany(state3, definition, key, values) {
2136
+ let index = -1;
2137
+ const result = [];
2138
+ while (++index < values.length) {
2139
+ const value = propertyValuePrimitive(state3, definition, key, values[index]);
2140
+ if (typeof value === "number" || typeof value === "string") {
2141
+ result.push(value);
2142
+ }
2143
+ }
2144
+ return result;
2145
+ }
2146
+ function propertyValuePrimitive(state3, definition, key, value) {
2147
+ if (typeof value !== "boolean" && typeof value !== "number" && typeof value !== "string") {
2148
+ return;
2149
+ }
2150
+ if (!safeProtocol(state3, key, value)) {
2151
+ return;
2152
+ }
2153
+ if (typeof definition === "object" && definition.length > 1) {
2154
+ let ok = false;
2155
+ let index = 0;
2156
+ while (++index < definition.length) {
2157
+ const allowed = definition[index];
2158
+ if (allowed && typeof allowed === "object" && "flags" in allowed) {
2159
+ if (allowed.test(String(value))) {
2160
+ ok = true;
2161
+ break;
2162
+ }
2163
+ } else if (allowed === value) {
2164
+ ok = true;
2165
+ break;
2166
+ }
2167
+ }
2168
+ if (!ok) return;
2169
+ }
2170
+ return state3.schema.clobber && state3.schema.clobberPrefix && state3.schema.clobber.includes(key) ? state3.schema.clobberPrefix + value : value;
2171
+ }
2172
+ function safeProtocol(state3, key, value) {
2173
+ const protocols = state3.schema.protocols && own.call(state3.schema.protocols, key) ? state3.schema.protocols[key] : void 0;
2174
+ if (!protocols || protocols.length === 0) {
2175
+ return true;
2176
+ }
2177
+ const url = String(value);
2178
+ const colon = url.indexOf(":");
2179
+ const questionMark = url.indexOf("?");
2180
+ const numberSign = url.indexOf("#");
2181
+ const slash = url.indexOf("/");
2182
+ if (colon < 0 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
2183
+ slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign) {
2184
+ return true;
2185
+ }
2186
+ let index = -1;
2187
+ while (++index < protocols.length) {
2188
+ const protocol = protocols[index];
2189
+ if (colon === protocol.length && url.slice(0, protocol.length) === protocol) {
2190
+ return true;
2191
+ }
2192
+ }
2193
+ return false;
2194
+ }
2195
+ function patch(node, unsafe) {
2196
+ const cleanPosition = position(
2197
+ // @ts-expect-error: looks like a node.
2198
+ unsafe
2199
+ );
2200
+ if (unsafe.data) {
2201
+ node.data = esm_default(unsafe.data);
2202
+ }
2203
+ if (cleanPosition) node.position = cleanPosition;
2204
+ }
2205
+ function findDefinition(definitions, key) {
2206
+ let dataDefault;
2207
+ let index = -1;
2208
+ if (definitions) {
2209
+ while (++index < definitions.length) {
2210
+ const entry = definitions[index];
2211
+ const name = typeof entry === "string" ? entry : entry[0];
2212
+ if (name === key) {
2213
+ return entry;
2214
+ }
2215
+ if (name === "data*") dataDefault = entry;
2216
+ }
2217
+ }
2218
+ if (key.length > 4 && key.slice(0, 4).toLowerCase() === "data") {
2219
+ return dataDefault;
2220
+ }
2221
+ }
2222
+
2223
+ // node_modules/rehype-sanitize/lib/index.js
2224
+ function rehypeSanitize(options) {
2225
+ return function(tree) {
2226
+ const result = (
2227
+ /** @type {Root} */
2228
+ sanitize(tree, options)
2229
+ );
2230
+ return result;
2231
+ };
2232
+ }
2233
+
2234
+ // components/Markdown.tsx
1487
2235
  var import_react18_json_view = __toESM(require("react18-json-view"));
1488
2236
  var import_style = require("react18-json-view/src/style.css");
1489
2237
  var import_dark = require("react18-json-view/src/dark.css");
@@ -1662,11 +2410,11 @@ var baseSx = {
1662
2410
  "& img": { maxWidth: "100%", borderRadius: "2px" }
1663
2411
  };
1664
2412
  var defaultComponents = {
1665
- a: ({ href, children, ...props }) => {
2413
+ a: ({ href, children: children2, ...props }) => {
1666
2414
  const isInternal = typeof href === "string" && href.startsWith("/");
1667
2415
  const video = isInternal ? null : resolveVideoUrl(href);
1668
2416
  if (video) {
1669
- const label = typeof children === "string" ? children : void 0;
2417
+ const label = typeof children2 === "string" ? children2 : void 0;
1670
2418
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(VideoEmbed, { video, title: label });
1671
2419
  }
1672
2420
  const resolved = typeof href === "string" ? resolveProductLink(href) : null;
@@ -1679,7 +2427,7 @@ var defaultComponents = {
1679
2427
  ...openExternal ? { target: "_blank", rel: "noopener noreferrer" } : {},
1680
2428
  onClick: (e) => e.stopPropagation(),
1681
2429
  ...props,
1682
- children
2430
+ children: children2
1683
2431
  }
1684
2432
  );
1685
2433
  },
@@ -1697,17 +2445,17 @@ var defaultComponents = {
1697
2445
  }
1698
2446
  );
1699
2447
  },
1700
- pre: ({ children, ...props }) => {
1701
- const child = Array.isArray(children) ? children[0] : children;
2448
+ pre: ({ children: children2, ...props }) => {
2449
+ const child = Array.isArray(children2) ? children2[0] : children2;
1702
2450
  const raw = child?.props?.children;
1703
- const text = Array.isArray(raw) ? raw.join("") : typeof raw === "string" ? raw : "";
1704
- const parsed = tryParseJson(text);
2451
+ const text2 = Array.isArray(raw) ? raw.join("") : typeof raw === "string" ? raw : "";
2452
+ const parsed = tryParseJson(text2);
1705
2453
  if (parsed) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(MarkdownJsonBlock, { src: parsed });
1706
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { ...props, children });
2454
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("pre", { ...props, children: children2 });
1707
2455
  }
1708
2456
  };
1709
2457
  var ShuffleMarkdown = ({
1710
- children,
2458
+ children: children2,
1711
2459
  components,
1712
2460
  remarkPlugins,
1713
2461
  disableBreaks = false,
@@ -1738,7 +2486,7 @@ var ShuffleMarkdown = ({
1738
2486
  }
1739
2487
  return next;
1740
2488
  }, [components]);
1741
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { className, sx: { ...baseSx, ...sx }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_markdown.default, { remarkPlugins: plugins, rehypePlugins: [import_rehype_sanitize.default], components: merged, children: children ?? "" }) });
2489
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Box, { className, sx: { ...baseSx, ...sx }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_markdown.default, { remarkPlugins: plugins, rehypePlugins: [rehypeSanitize], components: merged, children: children2 ?? "" }) });
1742
2490
  };
1743
2491
  var Markdown_default = ShuffleMarkdown;
1744
2492
 
@@ -2865,13 +3613,13 @@ var deleteDatastoreItem = async (key, category, overrideOrgId, options) => {
2865
3613
  }
2866
3614
  return { success: true };
2867
3615
  };
2868
- var deleteDatastoreItems = async (keys, category) => {
3616
+ var deleteDatastoreItems = async (keys2, category) => {
2869
3617
  const orgId = await waitForOrgId();
2870
3618
  if (!orgId) {
2871
- return { success: false, deleted: 0, failed: keys, error: "No organization ID found" };
3619
+ return { success: false, deleted: 0, failed: keys2, error: "No organization ID found" };
2872
3620
  }
2873
3621
  const results = await Promise.allSettled(
2874
- keys.map((key) => deleteDatastoreItem(key, category))
3622
+ keys2.map((key) => deleteDatastoreItem(key, category))
2875
3623
  );
2876
3624
  const failed = [];
2877
3625
  let deleted = 0;
@@ -2879,7 +3627,7 @@ var deleteDatastoreItems = async (keys, category) => {
2879
3627
  if (result.status === "fulfilled" && result.value.success) {
2880
3628
  deleted++;
2881
3629
  } else {
2882
- failed.push(keys[index]);
3630
+ failed.push(keys2[index]);
2883
3631
  }
2884
3632
  });
2885
3633
  return {
@@ -5588,7 +6336,7 @@ var fallbackContext = {
5588
6336
  isOpen: false
5589
6337
  };
5590
6338
  var AppDetailContext = (0, import_react6.createContext)(fallbackContext);
5591
- var AppDetailProvider = ({ children }) => {
6339
+ var AppDetailProvider = ({ children: children2 }) => {
5592
6340
  const [currentAppName, setCurrentAppName] = (0, import_react6.useState)(null);
5593
6341
  const openApp = (0, import_react6.useCallback)((appName) => {
5594
6342
  setCurrentAppName(appName);
@@ -5596,7 +6344,7 @@ var AppDetailProvider = ({ children }) => {
5596
6344
  const closeApp = (0, import_react6.useCallback)(() => {
5597
6345
  setCurrentAppName(null);
5598
6346
  }, []);
5599
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AppDetailContext.Provider, { value: { openApp, closeApp, currentAppName, isOpen: currentAppName !== null }, children });
6347
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AppDetailContext.Provider, { value: { openApp, closeApp, currentAppName, isOpen: currentAppName !== null }, children: children2 });
5600
6348
  };
5601
6349
  var useAppDetail = () => {
5602
6350
  return (0, import_react6.useContext)(AppDetailContext);
@@ -6561,14 +7309,14 @@ var DEFAULT_SUGGESTIONS = [
6561
7309
  ];
6562
7310
  function inferCategoryKeysFromName(appName) {
6563
7311
  const name = appName.toLowerCase();
6564
- const keys = [];
6565
- if (THREAT_INTEL_PATTERNS.some((p) => name.includes(p))) keys.push("threat", "intel");
6566
- if (EMAIL_APP_PATTERNS.some((p) => name.includes(p))) keys.push("email");
6567
- if (EDR_PATTERNS.some((p) => name.includes(p))) keys.push("edr", "endpoint");
6568
- if (SIEM_PATTERNS.some((p) => name.includes(p))) keys.push("siem");
6569
- if (CASES_PATTERNS.some((p) => name.includes(p))) keys.push("ticket", "case");
6570
- if (COMMUNICATION_PATTERNS_NAMES.some((p) => name.includes(p))) keys.push("communication");
6571
- return keys;
7312
+ const keys2 = [];
7313
+ if (THREAT_INTEL_PATTERNS.some((p) => name.includes(p))) keys2.push("threat", "intel");
7314
+ if (EMAIL_APP_PATTERNS.some((p) => name.includes(p))) keys2.push("email");
7315
+ if (EDR_PATTERNS.some((p) => name.includes(p))) keys2.push("edr", "endpoint");
7316
+ if (SIEM_PATTERNS.some((p) => name.includes(p))) keys2.push("siem");
7317
+ if (CASES_PATTERNS.some((p) => name.includes(p))) keys2.push("ticket", "case");
7318
+ if (COMMUNICATION_PATTERNS_NAMES.some((p) => name.includes(p))) keys2.push("communication");
7319
+ return keys2;
6572
7320
  }
6573
7321
  function getSuggestions(appName, categories) {
6574
7322
  const matched = [];
@@ -7314,7 +8062,7 @@ function highlightSnippet(code, lang) {
7314
8062
  "try",
7315
8063
  "except"
7316
8064
  ]);
7317
- const wrap = (color, text) => `<span style="color:${color}">${escapeHtml(text)}</span>`;
8065
+ const wrap = (color, text2) => `<span style="color:${color}">${escapeHtml(text2)}</span>`;
7318
8066
  const out = [];
7319
8067
  let i = 0;
7320
8068
  const n = code.length;
@@ -8906,6 +9654,8 @@ function AppDetailDrawer({
8906
9654
  appId,
8907
9655
  anchor = "right",
8908
9656
  width = 520,
9657
+ minWidth = 380,
9658
+ maxWidth = 720,
8909
9659
  onRefresh,
8910
9660
  onAddToCanvas,
8911
9661
  isAuthenticated = true,
@@ -8922,6 +9672,8 @@ function AppDetailDrawer({
8922
9672
  const themeScope = useShuffleMcpTheme();
8923
9673
  const scopeClassName = themeScope?.scopeClassName ?? (theme === "dark" ? "shuffle-mcp-scope dark" : theme === "light" ? "shuffle-mcp-scope" : void 0);
8924
9674
  const drawerWidth = `min(${width}px, 100vw)`;
9675
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
9676
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
8925
9677
  const handleClose = () => {
8926
9678
  onRefresh?.();
8927
9679
  onClose();
@@ -8930,8 +9682,8 @@ function AppDetailDrawer({
8930
9682
  className: scopeClassName,
8931
9683
  sx: {
8932
9684
  width: drawerWidth,
8933
- minWidth: drawerWidth,
8934
- maxWidth: drawerWidth,
9685
+ minWidth: drawerMinWidth,
9686
+ maxWidth: drawerMaxWidth,
8935
9687
  flex: `0 0 ${drawerWidth}`,
8936
9688
  height: "100vh",
8937
9689
  display: "flex",
@@ -8957,8 +9709,8 @@ function AppDetailDrawer({
8957
9709
  "& .MuiDrawer-paper": {
8958
9710
  boxSizing: "border-box",
8959
9711
  width: `${drawerWidth} !important`,
8960
- minWidth: `${drawerWidth} !important`,
8961
- maxWidth: `${drawerWidth} !important`,
9712
+ minWidth: `${drawerMinWidth} !important`,
9713
+ maxWidth: `${drawerMaxWidth} !important`,
8962
9714
  flex: `0 0 ${drawerWidth} !important`
8963
9715
  }
8964
9716
  },
@@ -11127,6 +11879,8 @@ function AppSearchDrawer({
11127
11879
  subtitle = "Search and configure a tool",
11128
11880
  anchor = "right",
11129
11881
  width = 560,
11882
+ minWidth = 400,
11883
+ maxWidth = 720,
11130
11884
  showPipelinesBanner = false,
11131
11885
  onQuickSelect,
11132
11886
  onSelectOverride,
@@ -11173,6 +11927,8 @@ function AppSearchDrawer({
11173
11927
  return () => clearTimeout(t);
11174
11928
  }, [open, highlightAppName, highlightDelayMs]);
11175
11929
  const drawerWidth = `min(${width}px, 100vw)`;
11930
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
11931
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
11176
11932
  const handleClose = () => {
11177
11933
  setDetailAppName(null);
11178
11934
  setDetailAppId(null);
@@ -11254,8 +12010,8 @@ function AppSearchDrawer({
11254
12010
  // looks identical on every host (Shuffle Security, /agents,
11255
12011
  // test page, embedded library, etc.). No breakpoint variance.
11256
12012
  width: drawerWidth,
11257
- minWidth: drawerWidth,
11258
- maxWidth: drawerWidth,
12013
+ minWidth: drawerMinWidth,
12014
+ maxWidth: drawerMaxWidth,
11259
12015
  flex: `0 0 ${drawerWidth}`,
11260
12016
  height: "100vh",
11261
12017
  display: "flex",
@@ -11282,8 +12038,8 @@ function AppSearchDrawer({
11282
12038
  "& .MuiDrawer-paper": {
11283
12039
  boxSizing: "border-box",
11284
12040
  width: `${drawerWidth} !important`,
11285
- minWidth: `${drawerWidth} !important`,
11286
- maxWidth: `${drawerWidth} !important`,
12041
+ minWidth: `${drawerMinWidth} !important`,
12042
+ maxWidth: `${drawerMaxWidth} !important`,
11287
12043
  flex: `0 0 ${drawerWidth} !important`
11288
12044
  }
11289
12045
  },
@@ -12104,6 +12860,37 @@ var resolveShuffleCoreTargetUrl = (destinationUrlOrPath) => {
12104
12860
  const cleanPath = trimmed.startsWith("/") ? trimmed : `/${trimmed}`;
12105
12861
  return `${coreBase}${cleanPath}`;
12106
12862
  };
12863
+ function hasActiveSession() {
12864
+ if (typeof window === "undefined") return false;
12865
+ const token = getSessionToken2();
12866
+ if (token && token.trim().length > 0) return true;
12867
+ try {
12868
+ const cookies = document.cookie || "";
12869
+ if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
12870
+ return true;
12871
+ }
12872
+ const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
12873
+ if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
12874
+ return true;
12875
+ }
12876
+ } catch {
12877
+ }
12878
+ return false;
12879
+ }
12880
+ function directNavigate(targetUrl, popupWindow) {
12881
+ if (popupWindow) {
12882
+ try {
12883
+ popupWindow.location.href = targetUrl;
12884
+ } catch {
12885
+ if (typeof window !== "undefined") {
12886
+ window.location.href = targetUrl;
12887
+ }
12888
+ }
12889
+ } else if (typeof window !== "undefined") {
12890
+ window.location.href = targetUrl;
12891
+ }
12892
+ return true;
12893
+ }
12107
12894
  async function navigateToShuffleCore(destinationUrlOrPath, options) {
12108
12895
  const isNewTab = Boolean(options?.newTab);
12109
12896
  const targetUrl = resolveShuffleCoreTargetUrl(destinationUrlOrPath);
@@ -12130,42 +12917,11 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
12130
12917
  const isSameDomain = Boolean(
12131
12918
  currentRoot && targetRoot && currentRoot === targetRoot
12132
12919
  );
12133
- function hasActiveSession2() {
12134
- if (typeof window === "undefined") return false;
12135
- const token = getSessionToken2();
12136
- if (token && token.trim().length > 0) return true;
12137
- try {
12138
- const cookies = document.cookie || "";
12139
- if (cookies.includes("session=") || cookies.includes("user_id=") || cookies.includes("token=")) {
12140
- return true;
12141
- }
12142
- const userInfo = localStorage.getItem("shuffle_user_info") || localStorage.getItem("user_id");
12143
- if (userInfo && userInfo.trim().length > 0 && userInfo !== "null") {
12144
- return true;
12145
- }
12146
- } catch {
12147
- }
12148
- return false;
12149
- }
12150
- function directNavigate2(targetUrl2, popupWindow2) {
12151
- if (popupWindow2) {
12152
- try {
12153
- popupWindow2.location.href = targetUrl2;
12154
- } catch {
12155
- if (typeof window !== "undefined") {
12156
- window.location.href = targetUrl2;
12157
- }
12158
- }
12159
- } else if (typeof window !== "undefined") {
12160
- window.location.href = targetUrl2;
12161
- }
12162
- return true;
12163
- }
12164
12920
  if (!isCloudDomain3() && !isShuffleBackend || targetHost && currentHost && targetHost === currentHost || isSameDomain) {
12165
- return directNavigate2(targetUrl, popupWindow);
12921
+ return directNavigate(targetUrl, popupWindow);
12166
12922
  }
12167
- if (!hasActiveSession2()) {
12168
- return directNavigate2(targetUrl, popupWindow);
12923
+ if (!hasActiveSession()) {
12924
+ return directNavigate(targetUrl, popupWindow);
12169
12925
  }
12170
12926
  try {
12171
12927
  const isCloud2 = isCloudDomain3() || currentHost.endsWith(".shuffle.security") || currentHost === "shuffle.security";
@@ -12187,14 +12943,14 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
12187
12943
  console.warn(
12188
12944
  `[authHandoff] Handoff ticket request returned ${response.status}, falling back to direct navigation`
12189
12945
  );
12190
- return directNavigate2(targetUrl, popupWindow);
12946
+ return directNavigate(targetUrl, popupWindow);
12191
12947
  }
12192
12948
  const data = await response.json();
12193
12949
  if (!data?.success || !data?.ticket) {
12194
12950
  console.warn(
12195
12951
  `[authHandoff] No ticket returned (${data?.reason || "unknown"}), falling back to direct navigation`
12196
12952
  );
12197
- return directNavigate2(targetUrl, popupWindow);
12953
+ return directNavigate(targetUrl, popupWindow);
12198
12954
  }
12199
12955
  let targetCoreBase = UK_SHUFFLE_CORE_BASE;
12200
12956
  if (!isShuffleBackend && !isCloud2) {
@@ -12244,7 +13000,7 @@ async function navigateToShuffleCore(destinationUrlOrPath, options) {
12244
13000
  "[authHandoff] Error during handoff to Shuffle Core, falling back to direct navigation:",
12245
13001
  err
12246
13002
  );
12247
- return directNavigate2(targetUrl, popupWindow);
13003
+ return directNavigate(targetUrl, popupWindow);
12248
13004
  }
12249
13005
  }
12250
13006
 
@@ -12267,9 +13023,9 @@ var fetchExecution = async (executionId, authorization) => {
12267
13023
  body: JSON.stringify({ execution_id: executionId, authorization: authorization || executionId })
12268
13024
  });
12269
13025
  if (!resp.ok) return null;
12270
- const text = await resp.text();
12271
- if (!text || text === "{}" || text === "null") return null;
12272
- return JSON.parse(text);
13026
+ const text2 = await resp.text();
13027
+ if (!text2 || text2 === "{}" || text2 === "null") return null;
13028
+ return JSON.parse(text2);
12273
13029
  } catch {
12274
13030
  return null;
12275
13031
  }
@@ -12427,12 +13183,12 @@ var matchAgentPromptSuggestions = (input, limit = 8) => {
12427
13183
  const q = (input || "").trim().toLowerCase();
12428
13184
  if (!q) return [];
12429
13185
  const scored = [];
12430
- for (const text of AGENT_PROMPT_SUGGESTIONS) {
12431
- const lower = text.toLowerCase();
13186
+ for (const text2 of AGENT_PROMPT_SUGGESTIONS) {
13187
+ const lower = text2.toLowerCase();
12432
13188
  const idx = lower.indexOf(q);
12433
13189
  if (idx < 0) continue;
12434
- const score = idx === 0 ? -1e3 + text.length : idx * 10 + text.length;
12435
- scored.push({ text, score });
13190
+ const score = idx === 0 ? -1e3 + text2.length : idx * 10 + text2.length;
13191
+ scored.push({ text: text2, score });
12436
13192
  }
12437
13193
  scored.sort((a, b) => a.score - b.score);
12438
13194
  return scored.slice(0, limit).map((s) => s.text);
@@ -12515,11 +13271,11 @@ var RULES = [
12515
13271
  { match: /datastore|cache|prune entries|allowlist/i, reqs: [SHUFFLE_DATASTORE] }
12516
13272
  ];
12517
13273
  var getSuggestionAppRequirements = (suggestion, limit = 3) => {
12518
- const text = suggestion || "";
13274
+ const text2 = suggestion || "";
12519
13275
  const out = [];
12520
13276
  const seen = /* @__PURE__ */ new Set();
12521
13277
  for (const rule of RULES) {
12522
- if (!rule.match.test(text)) continue;
13278
+ if (!rule.match.test(text2)) continue;
12523
13279
  for (const req of rule.reqs) {
12524
13280
  const key = `${req.kind}:${req.value}`;
12525
13281
  if (seen.has(key)) continue;
@@ -12661,8 +13417,8 @@ var AGENT_PRESETS = [
12661
13417
  ];
12662
13418
  var isSupportUser = () => {
12663
13419
  try {
12664
- const keys = ["shuffle_user_info", "userinfo", "user_info"];
12665
- for (const key of keys) {
13420
+ const keys2 = ["shuffle_user_info", "userinfo", "user_info"];
13421
+ for (const key of keys2) {
12666
13422
  const raw = localStorage.getItem(key);
12667
13423
  if (!raw) continue;
12668
13424
  const parsed = JSON.parse(raw) || {};
@@ -13449,8 +14205,8 @@ var import_style4 = require("react18-json-view/src/style.css");
13449
14205
  var import_dark4 = require("react18-json-view/src/dark.css");
13450
14206
 
13451
14207
  // ../components/docs/tocUtils.ts
13452
- var isTocHeading = (text) => {
13453
- const norm4 = text.toLowerCase().replace(/[^a-z0-9]/g, "");
14208
+ var isTocHeading = (text2) => {
14209
+ const norm4 = text2.toLowerCase().replace(/[^a-z0-9]/g, "");
13454
14210
  return norm4 === "tableofcontents" || norm4 === "tableofcontent" || norm4 === "toc";
13455
14211
  };
13456
14212
  var stripMarkdownInline = (value) => value.replace(/!\[[^\]]*\]\([^)]*\)/g, "").replace(/\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/<[^>]+>/g, "").replace(/[`*_~#>]/g, "").replace(/\{#[^}]+\}/g, "").replace(/\s+/g, " ").trim();
@@ -13761,13 +14517,13 @@ var detectImage = (raw) => {
13761
14517
  try {
13762
14518
  const parsed = JSON.parse(s);
13763
14519
  const candidates = Array.isArray(parsed) ? parsed : [parsed];
13764
- const keys = ["image_base64", "imageBase64", "image", "screenshot", "screenshot_base64", "data", "png", "jpeg", "jpg", "b64", "base64"];
14520
+ const keys2 = ["image_base64", "imageBase64", "image", "screenshot", "screenshot_base64", "data", "png", "jpeg", "jpg", "b64", "base64"];
13765
14521
  for (const item of candidates) {
13766
14522
  if (!item || typeof item !== "object") continue;
13767
14523
  const rec = item;
13768
14524
  const cursor2 = toCursor(rec.cursor);
13769
14525
  const screenSize2 = toSize(rec.screen_size ?? rec.screenSize);
13770
- for (const key of keys) {
14526
+ for (const key of keys2) {
13771
14527
  const v = rec[key];
13772
14528
  if (typeof v !== "string") continue;
13773
14529
  const inner = v.trim().replace(/\s+/g, "");
@@ -14334,9 +15090,9 @@ var fmtTime = (h, m) => {
14334
15090
  const mm = m.toString().padStart(2, "0");
14335
15091
  return `${h12}:${mm} ${ampm}`;
14336
15092
  };
14337
- var findTime = (text) => {
15093
+ var findTime = (text2) => {
14338
15094
  const re = /\b(\d{1,2})(?::(\d{2}))?\s*(am|pm|a\.m\.|p\.m\.)\b|\b(\d{1,2}):(\d{2})\b(?!\s*(?:am|pm))/i;
14339
- const m = text.match(re);
15095
+ const m = text2.match(re);
14340
15096
  if (!m) return null;
14341
15097
  if (m[1]) {
14342
15098
  let h = parseInt(m[1], 10);
@@ -14355,10 +15111,10 @@ var findTime = (text) => {
14355
15111
  }
14356
15112
  return null;
14357
15113
  };
14358
- var findDay = (text) => {
15114
+ var findDay = (text2) => {
14359
15115
  for (const [name, d] of Object.entries(DAY_NAMES)) {
14360
15116
  const re = new RegExp(`\\b${name}(s)?\\b`, "i");
14361
- const m = text.match(re);
15117
+ const m = text2.match(re);
14362
15118
  if (m) return { day: d, matched: m[0], plural: Boolean(m[1]) };
14363
15119
  }
14364
15120
  return null;
@@ -14380,10 +15136,10 @@ var onceHint = (target, confidence, matchedText) => ({
14380
15136
  once: true,
14381
15137
  runAt: target.toISOString()
14382
15138
  });
14383
- var findPartOfDay = (text) => {
15139
+ var findPartOfDay = (text2) => {
14384
15140
  for (const [name, h] of Object.entries(PART_OF_DAY)) {
14385
15141
  const re = new RegExp(`\\b${name}\\b`, "i");
14386
- const m = text.match(re);
15142
+ const m = text2.match(re);
14387
15143
  if (m) return { h, matched: m[0] };
14388
15144
  }
14389
15145
  return null;
@@ -14464,18 +15220,18 @@ var quantityValue = (raw) => {
14464
15220
  const key = q.replace(/^an?\s+/, "").split(" ")[0];
14465
15221
  return WORD_NUMBERS[key] ?? null;
14466
15222
  };
14467
- var findRelativeOffset = (text) => {
15223
+ var findRelativeOffset = (text2) => {
14468
15224
  const patterns = [
14469
15225
  new RegExp(`\\b(?:in|after|within|wait)\\s+(${QUANTITY})\\s*(${UNIT})\\b(?!\\s*(?:ago))`, "i"),
14470
15226
  new RegExp(`\\b(${QUANTITY})\\s*(${UNIT})\\s+(?:from\\s+now|from\\s+today|later|out)\\b`, "i")
14471
15227
  ];
14472
15228
  for (const re of patterns) {
14473
- const m = text.match(re);
15229
+ const m = text2.match(re);
14474
15230
  if (!m) continue;
14475
15231
  const qty = quantityValue(m[1]);
14476
15232
  const unit = UNIT_ALIASES[m[2].toLowerCase()];
14477
15233
  if (qty === null || !unit) continue;
14478
- if (/\b(?:every|each)\s*$/i.test(text.slice(0, m.index ?? 0))) continue;
15234
+ if (/\b(?:every|each)\s*$/i.test(text2.slice(0, m.index ?? 0))) continue;
14479
15235
  return {
14480
15236
  ms: qty * UNIT_MS[unit],
14481
15237
  matched: m[0],
@@ -14486,9 +15242,9 @@ var findRelativeOffset = (text) => {
14486
15242
  };
14487
15243
  var parseScheduleHint = (input) => {
14488
15244
  if (!input) return null;
14489
- const text = input.toLowerCase();
15245
+ const text2 = input.toLowerCase();
14490
15246
  const hits = [];
14491
- const everyMin = text.match(/every\s+(\d+)\s*(?:m|min|mins|minute|minutes)\b/);
15247
+ const everyMin = text2.match(/every\s+(\d+)\s*(?:m|min|mins|minute|minutes)\b/);
14492
15248
  if (everyMin) {
14493
15249
  const n = Math.max(1, Math.min(59, parseInt(everyMin[1], 10)));
14494
15250
  return {
@@ -14498,7 +15254,7 @@ var parseScheduleHint = (input) => {
14498
15254
  matchedText: everyMin[0]
14499
15255
  };
14500
15256
  }
14501
- const everyHr = text.match(/every\s+(\d+)\s*(?:h|hr|hrs|hour|hours)\b/);
15257
+ const everyHr = text2.match(/every\s+(\d+)\s*(?:h|hr|hrs|hour|hours)\b/);
14502
15258
  if (everyHr) {
14503
15259
  const n = Math.max(1, Math.min(23, parseInt(everyHr[1], 10)));
14504
15260
  return {
@@ -14508,41 +15264,41 @@ var parseScheduleHint = (input) => {
14508
15264
  matchedText: everyHr[0]
14509
15265
  };
14510
15266
  }
14511
- if (/\bhourly\b|\bevery hour\b/.test(text)) {
15267
+ if (/\bhourly\b|\bevery hour\b/.test(text2)) {
14512
15268
  return { cron: "0 * * * *", label: "Hourly", confidence: "high", matchedText: "hourly" };
14513
15269
  }
14514
- const t = findTime(text);
14515
- const part = !t ? findPartOfDay(text) : null;
15270
+ const t = findTime(text2);
15271
+ const part = !t ? findPartOfDay(text2) : null;
14516
15272
  const hour = t ? t.h : part ? part.h : null;
14517
15273
  const minute = t ? t.m : 0;
14518
15274
  if (t) hits.push(t.matched);
14519
15275
  if (part) hits.push(part.matched);
14520
- const day = findDay(text);
15276
+ const day = findDay(text2);
14521
15277
  if (day) hits.push(day.matched);
14522
- const isDaily = /\b(daily|every\s+day|each\s+day)\b/.test(text);
14523
- const isWeekly = /\b(weekly|every\s+week)\b/.test(text);
14524
- const isWeekdays = /\b(weekday|weekdays|every\s+weekday|workdays?|business\s+days?)\b/.test(text);
14525
- const isMonthly = /\b(monthly|every\s+month)\b/.test(text);
14526
- const hasScheduleWord = /\b(schedule|recurring|recur|repeat|automate|cron)\b/.test(text);
15278
+ const isDaily = /\b(daily|every\s+day|each\s+day)\b/.test(text2);
15279
+ const isWeekly = /\b(weekly|every\s+week)\b/.test(text2);
15280
+ const isWeekdays = /\b(weekday|weekdays|every\s+weekday|workdays?|business\s+days?)\b/.test(text2);
15281
+ const isMonthly = /\b(monthly|every\s+month)\b/.test(text2);
15282
+ const hasScheduleWord = /\b(schedule|recurring|recur|repeat|automate|cron)\b/.test(text2);
14527
15283
  if (isDaily) hits.push("daily");
14528
15284
  if (isWeekly) hits.push("weekly");
14529
15285
  if (isWeekdays) hits.push("weekdays");
14530
15286
  if (isMonthly) hits.push("monthly");
14531
- const recurringDayPhrase = day ? day.plural || new RegExp(`\\b(?:every|each)\\s+(?:other\\s+)?${day.matched}\\b`).test(text) : false;
15287
+ const recurringDayPhrase = day ? day.plural || new RegExp(`\\b(?:every|each)\\s+(?:other\\s+)?${day.matched}\\b`).test(text2) : false;
14532
15288
  const oneOffDayPhrase = Boolean(day) && !recurringDayPhrase;
14533
- if (/\bnext\b/.test(text)) hits.push("next");
14534
- const rel = findRelativeOffset(text);
15289
+ if (/\bnext\b/.test(text2)) hits.push("next");
15290
+ const rel = findRelativeOffset(text2);
14535
15291
  if (rel) {
14536
15292
  const target = new Date(Date.now() + rel.ms);
14537
15293
  if (rel.unitDays && (t || part)) target.setHours(hour ?? 9, minute, 0, 0);
14538
15294
  if (rel.unitDays) target.setSeconds(0, 0);
14539
15295
  return onceHint(target, "high", rel.matched);
14540
15296
  }
14541
- const laterMatch = text.match(/\b(later\s+today|later\s+tonight|later\s+this\s+(?:morning|afternoon|evening)|later|soon|shortly|in\s+a\s+bit|in\s+a\s+while|in\s+a\s+moment)\b/);
15297
+ const laterMatch = text2.match(/\b(later\s+today|later\s+tonight|later\s+this\s+(?:morning|afternoon|evening)|later|soon|shortly|in\s+a\s+bit|in\s+a\s+while|in\s+a\s+moment)\b/);
14542
15298
  if (laterMatch && hour === null) {
14543
15299
  return onceHint(new Date(Date.now() + 2 * 36e5), "medium", laterMatch[0]);
14544
15300
  }
14545
- const endOf = text.match(/\bend\s+of\s+(?:the\s+)?(day|today|week|month)\b/);
15301
+ const endOf = text2.match(/\bend\s+of\s+(?:the\s+)?(day|today|week|month)\b/);
14546
15302
  if (endOf && !isDaily && !isWeekly && !isMonthly) {
14547
15303
  const target = /* @__PURE__ */ new Date();
14548
15304
  const which = endOf[1];
@@ -14559,40 +15315,40 @@ var parseScheduleHint = (input) => {
14559
15315
  }
14560
15316
  return onceHint(target, "medium", endOf[0]);
14561
15317
  }
14562
- const dayAfter = text.match(/\b(?:the\s+)?day\s+after\s+tomorrow\b/);
15318
+ const dayAfter = text2.match(/\b(?:the\s+)?day\s+after\s+tomorrow\b/);
14563
15319
  if (dayAfter) {
14564
15320
  const target = /* @__PURE__ */ new Date();
14565
15321
  target.setDate(target.getDate() + 2);
14566
15322
  target.setHours(hour ?? 9, minute, 0, 0);
14567
15323
  return onceHint(target, "high", dayAfter[0]);
14568
15324
  }
14569
- if (/\btonight\b/.test(text) && !isDaily && !isWeekly) {
15325
+ if (/\btonight\b/.test(text2) && !isDaily && !isWeekly) {
14570
15326
  const h = hour ?? 21;
14571
15327
  const target = /* @__PURE__ */ new Date();
14572
15328
  target.setHours(h, minute, 0, 0);
14573
15329
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
14574
15330
  return onceHint(target, "medium", "tonight");
14575
15331
  }
14576
- if (/\btomorrow\b/.test(text) && !isDaily && !isWeekly) {
15332
+ if (/\btomorrow\b/.test(text2) && !isDaily && !isWeekly) {
14577
15333
  const target = /* @__PURE__ */ new Date();
14578
15334
  target.setDate(target.getDate() + 1);
14579
15335
  target.setHours(hour ?? 9, minute, 0, 0);
14580
15336
  return onceHint(target, "medium", hits.join(" ") || "tomorrow");
14581
15337
  }
14582
- if (/\btoday\b/.test(text) && hour !== null && !isDaily && !isWeekly) {
15338
+ if (/\btoday\b/.test(text2) && hour !== null && !isDaily && !isWeekly) {
14583
15339
  const target = /* @__PURE__ */ new Date();
14584
15340
  target.setHours(hour, minute, 0, 0);
14585
15341
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
14586
15342
  return onceHint(target, "medium", hits.join(" ") || "today");
14587
15343
  }
14588
- const thisPart = text.match(/\bthis\s+(morning|afternoon|evening)\b/);
15344
+ const thisPart = text2.match(/\bthis\s+(morning|afternoon|evening)\b/);
14589
15345
  if (thisPart && !isDaily && !isWeekly) {
14590
15346
  const target = /* @__PURE__ */ new Date();
14591
15347
  target.setHours(hour ?? PART_OF_DAY[thisPart[1]], minute, 0, 0);
14592
15348
  if (target.getTime() <= Date.now()) target.setDate(target.getDate() + 1);
14593
15349
  return onceHint(target, "medium", thisPart[0]);
14594
15350
  }
14595
- const nextSpan = !day ? text.match(/\bnext\s+(week|month)\b/) : null;
15351
+ const nextSpan = !day ? text2.match(/\bnext\s+(week|month)\b/) : null;
14596
15352
  if (nextSpan && !isWeekly && !isMonthly && !isDaily) {
14597
15353
  const target = /* @__PURE__ */ new Date();
14598
15354
  if (nextSpan[1] === "week") target.setDate(target.getDate() + 7);
@@ -14602,7 +15358,7 @@ var parseScheduleHint = (input) => {
14602
15358
  }
14603
15359
  if (day && oneOffDayPhrase && !isWeekly && !isMonthly && !isWeekdays && !isDaily) {
14604
15360
  const target = nextDateForWeekday(day.day, hour ?? 9, minute);
14605
- if (/\bnext\b/.test(text)) {
15361
+ if (/\bnext\b/.test(text2)) {
14606
15362
  const upcomingDelta = Math.round((target.getTime() - Date.now()) / 864e5);
14607
15363
  if (upcomingDelta < 2) target.setDate(target.getDate() + 7);
14608
15364
  }
@@ -14646,7 +15402,7 @@ var parseScheduleHint = (input) => {
14646
15402
  matchedText: hits.join(" ")
14647
15403
  };
14648
15404
  }
14649
- if (isDaily || hour !== null && (isDaily || part || hasScheduleWord || /\bevery\b/.test(text))) {
15405
+ if (isDaily || hour !== null && (isDaily || part || hasScheduleWord || /\bevery\b/.test(text2))) {
14650
15406
  const h = hour ?? 9;
14651
15407
  return {
14652
15408
  cron: `${minute} ${h} * * *`,
@@ -14676,7 +15432,7 @@ var parseScheduleHint = (input) => {
14676
15432
  cron: "0 9 * * *",
14677
15433
  label: "Schedule this prompt",
14678
15434
  confidence: "low",
14679
- matchedText: text.match(/\b(schedule|recurring|recur|repeat|automate|cron)\b/)?.[0] || "schedule"
15435
+ matchedText: text2.match(/\b(schedule|recurring|recur|repeat|automate|cron)\b/)?.[0] || "schedule"
14680
15436
  };
14681
15437
  }
14682
15438
  return null;
@@ -14815,9 +15571,9 @@ var extractDecisionIndex = (path) => {
14815
15571
  const n = Number(m[1]);
14816
15572
  return Number.isFinite(n) ? n : null;
14817
15573
  };
14818
- var isAiAuthText = (text) => {
14819
- if (!text || typeof text !== "string") return false;
14820
- const lower = text.toLowerCase();
15574
+ var isAiAuthText = (text2) => {
15575
+ if (!text2 || typeof text2 !== "string") return false;
15576
+ const lower = text2.toLowerCase();
14821
15577
  const hasAuthSignal = /\b(401|unauthori[sz]ed|invalid[_\s-]*(api[_\s-]*key|credentials?|token|auth|key)|incorrect\s+api\s+key|missing[_\s-]*(api[_\s-]*key|authorization|credentials?)|authentication[_\s-]*(failed|required|error)|ai\s+credentials)\b/.test(
14822
15578
  lower
14823
15579
  ) || /check\s+your\s+ai\s+credentials/.test(lower);
@@ -14833,7 +15589,7 @@ var hasOutputWarning = (run) => {
14833
15589
  return diagnoseOutputWarning(run) !== null;
14834
15590
  };
14835
15591
  var diagnosisHasCtas = (diagnosis) => diagnosis?.kind === "token_limit" || diagnosis?.kind === "ai_auth" || Boolean(diagnosis?.isAiAuth);
14836
- var collectEntries = (root) => {
15592
+ var collectEntries = (root2) => {
14837
15593
  const out = [];
14838
15594
  const walk = (v, path, depth) => {
14839
15595
  if (depth > 8 || v == null) return;
@@ -14852,7 +15608,7 @@ var collectEntries = (root) => {
14852
15608
  }
14853
15609
  }
14854
15610
  };
14855
- walk(root, "", 0);
15611
+ walk(root2, "", 0);
14856
15612
  return out;
14857
15613
  };
14858
15614
  var trimEvidenceValue = (v, max = 180) => {
@@ -15813,7 +16569,7 @@ var collectFromRequest = (req, out) => {
15813
16569
  }
15814
16570
  }
15815
16571
  };
15816
- var collectLlmImageAttachments = (root, maxDepth = 10) => {
16572
+ var collectLlmImageAttachments = (root2, maxDepth = 10) => {
15817
16573
  const found = [];
15818
16574
  const seen = /* @__PURE__ */ new Set();
15819
16575
  const walk = (node, depth) => {
@@ -15850,7 +16606,7 @@ var collectLlmImageAttachments = (root, maxDepth = 10) => {
15850
16606
  }
15851
16607
  for (const value of Object.values(rec)) walk(value, depth + 1);
15852
16608
  };
15853
- walk(root, 0);
16609
+ walk(root2, 0);
15854
16610
  const deduped = [];
15855
16611
  const urls = /* @__PURE__ */ new Set();
15856
16612
  for (const item of found) {
@@ -16073,9 +16829,9 @@ var getActivePageEntityName = () => {
16073
16829
  }
16074
16830
  const titleContainer = document.querySelector('[data-incident-field="title"], [data-case-field="title"]');
16075
16831
  if (titleContainer?.textContent) {
16076
- const text = titleContainer.textContent.trim();
16077
- if (text && text.length > 0 && text.length < 120 && text !== "Enter title..." && text !== "Incident") {
16078
- return text;
16832
+ const text2 = titleContainer.textContent.trim();
16833
+ if (text2 && text2.length > 0 && text2.length < 120 && text2 !== "Enter title..." && text2 !== "Incident") {
16834
+ return text2;
16079
16835
  }
16080
16836
  }
16081
16837
  if (document.title) {
@@ -17116,11 +17872,11 @@ var looksLikeBase64Image = (v) => {
17116
17872
  if (!/^[A-Za-z0-9+/=]+$/.test(s)) return false;
17117
17873
  return B64_IMAGE_PREFIXES.some((p) => s.startsWith(p));
17118
17874
  };
17119
- var scanTextForImage = (text) => {
17120
- if (!text || text.length < 200) return null;
17121
- const dataUri = text.match(/data:image\/[a-z+.-]+;base64,[A-Za-z0-9+/=]{200,}/i);
17875
+ var scanTextForImage = (text2) => {
17876
+ if (!text2 || text2.length < 200) return null;
17877
+ const dataUri = text2.match(/data:image\/[a-z+.-]+;base64,[A-Za-z0-9+/=]{200,}/i);
17122
17878
  if (dataUri) return dataUri[0];
17123
- const bare = text.match(/(?:iVBORw0KGgo|\/9j\/|R0lGOD|UklGR)[A-Za-z0-9+/=]{200,}/);
17879
+ const bare = text2.match(/(?:iVBORw0KGgo|\/9j\/|R0lGOD|UklGR)[A-Za-z0-9+/=]{200,}/);
17124
17880
  return bare ? bare[0] : null;
17125
17881
  };
17126
17882
  var extractScreenshotPayloads = (raw, depth = 0, out = []) => {
@@ -17209,8 +17965,8 @@ var truncateReason = (reason, maxLength = 280) => {
17209
17965
  if (reason.length <= maxLength) return reason;
17210
17966
  return reason.slice(0, maxLength).replace(/\s+\S*$/, "") + "\u2026";
17211
17967
  };
17212
- var FinishAnswerMarkdown = ({ text }) => {
17213
- const wholeJson = (0, import_react23.useMemo)(() => tryParseJsonObject(stripSingleCodeFence(text)), [text]);
17968
+ var FinishAnswerMarkdown = ({ text: text2 }) => {
17969
+ const wholeJson = (0, import_react23.useMemo)(() => tryParseJsonObject(stripSingleCodeFence(text2)), [text2]);
17214
17970
  if (wholeJson !== null) {
17215
17971
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { sx: { "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" } }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react18_json_view4.default, { src: wholeJson, collapsed: defaultCollapsed, enableClipboard: true, displaySize: true, theme: "default" }) });
17216
17972
  }
@@ -17218,8 +17974,8 @@ var FinishAnswerMarkdown = ({ text }) => {
17218
17974
  Markdown_default,
17219
17975
  {
17220
17976
  components: {
17221
- code({ inline, className, children, ...props }) {
17222
- const content = String(children ?? "").replace(/\n$/, "");
17977
+ code({ inline, className, children: children2, ...props }) {
17978
+ const content = String(children2 ?? "").replace(/\n$/, "");
17223
17979
  const isBlock = !inline && (content.includes("\n") || /language-/.test(className || ""));
17224
17980
  if (isBlock) {
17225
17981
  const parsed = tryParseJsonObject(content);
@@ -17227,10 +17983,10 @@ var FinishAnswerMarkdown = ({ text }) => {
17227
17983
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { sx: { my: 1, p: 1.5, borderRadius: 1, bgcolor: "hsl(var(--muted))", "& .json-view": { backgroundColor: "transparent !important", fontSize: "0.82rem" } }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_react18_json_view4.default, { src: parsed, collapsed: defaultCollapsed, enableClipboard: true, displaySize: true, theme: "default" }) });
17228
17984
  }
17229
17985
  }
17230
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { className, ...props, children });
17986
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { className, ...props, children: children2 });
17231
17987
  }
17232
17988
  },
17233
- children: text
17989
+ children: text2
17234
17990
  }
17235
17991
  );
17236
17992
  };
@@ -17244,7 +18000,7 @@ var RunFinishedSummary = ({
17244
18000
  decisionCount,
17245
18001
  durationSec,
17246
18002
  showMeta = false,
17247
- children,
18003
+ children: children2,
17248
18004
  bottomContent
17249
18005
  }) => {
17250
18006
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
@@ -17276,7 +18032,7 @@ var RunFinishedSummary = ({
17276
18032
  }
17277
18033
  )
17278
18034
  ] }),
17279
- children,
18035
+ children2,
17280
18036
  finishAnswer && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_material26.Box, { sx: {
17281
18037
  p: 2,
17282
18038
  borderRadius: 1.5,
@@ -19272,8 +20028,8 @@ var AgentUI = ({
19272
20028
  reason = typeof body?.reason === "string" ? body.reason : "";
19273
20029
  } catch {
19274
20030
  try {
19275
- const text = (await resp.clone().text())?.trim();
19276
- if (text && text.length < 300 && !text.startsWith("<")) reason = text;
20031
+ const text2 = (await resp.clone().text())?.trim();
20032
+ if (text2 && text2.length < 300 && !text2.startsWith("<")) reason = text2;
19277
20033
  } catch {
19278
20034
  }
19279
20035
  }
@@ -19449,8 +20205,8 @@ var AgentUI = ({
19449
20205
  }, intervalMs);
19450
20206
  return () => clearInterval(id);
19451
20207
  }, [execution?.execution_id, execution?.authorization, execution?.status, agentData?.decisions, runComplete, getExecution]);
19452
- const submitInput = (0, import_react23.useCallback)(async (text, presetOverride, appsOverride) => {
19453
- if (!text.trim()) return;
20208
+ const submitInput = (0, import_react23.useCallback)(async (text2, presetOverride, appsOverride) => {
20209
+ if (!text2.trim()) return;
19454
20210
  if (isLoggedIn === false) {
19455
20211
  setError("Authentication required. Please log in to run AI agents.");
19456
20212
  return;
@@ -19458,7 +20214,7 @@ var AgentUI = ({
19458
20214
  if (contextStorageKey) {
19459
20215
  setPageContextChoice(contextStorageKey, { draftPrompt: "" });
19460
20216
  }
19461
- const composed = composeSubmitInput(text);
20217
+ const composed = composeSubmitInput(text2);
19462
20218
  const effectivePreset = presetOverride !== void 0 ? presetOverride : selectedPreset;
19463
20219
  setError(null);
19464
20220
  setAgentRequestLoading(true);
@@ -19564,7 +20320,7 @@ var AgentUI = ({
19564
20320
  setAgentRequestLoading(false);
19565
20321
  if (!result.success) {
19566
20322
  if (contextStorageKey) {
19567
- setPageContextChoice(contextStorageKey, { draftPrompt: text });
20323
+ setPageContextChoice(contextStorageKey, { draftPrompt: text2 });
19568
20324
  }
19569
20325
  setError(result.error || "Agent run failed.");
19570
20326
  activeExecutionIdRef.current = prevActiveExecutionId;
@@ -19580,7 +20336,7 @@ var AgentUI = ({
19580
20336
  if (prevActiveExecutionId) {
19581
20337
  getExecution(prevActiveExecutionId, prevExecution?.authorization);
19582
20338
  }
19583
- onRun?.({ input: text, success: false, error: result.error });
20339
+ onRun?.({ input: text2, success: false, error: result.error });
19584
20340
  return;
19585
20341
  }
19586
20342
  const browserStart = Math.floor(Date.now() / 1e3);
@@ -19610,7 +20366,7 @@ var AgentUI = ({
19610
20366
  }, { replace: true });
19611
20367
  }
19612
20368
  getExecution(eid, auth);
19613
- onRun?.({ input: text, success: true, executionId: eid });
20369
+ onRun?.({ input: text2, success: true, executionId: eid });
19614
20370
  } else {
19615
20371
  if (contextStorageKey && eid) {
19616
20372
  setPageContextChoice(contextStorageKey, {
@@ -19629,11 +20385,11 @@ var AgentUI = ({
19629
20385
  });
19630
20386
  const v = validateJson(raw);
19631
20387
  if (v.valid) {
19632
- setAgentData({ ...v.result, status: "FINISHED", original_input: text });
20388
+ setAgentData({ ...v.result, status: "FINISHED", original_input: text2 });
19633
20389
  } else {
19634
- setAgentData({ original_input: text, status: "FINISHED", message: result.content });
20390
+ setAgentData({ original_input: text2, status: "FINISHED", message: result.content });
19635
20391
  }
19636
- onRun?.({ input: text, success: true, executionId: eid });
20392
+ onRun?.({ input: text2, success: true, executionId: eid });
19637
20393
  }
19638
20394
  }, [chosenApps, executionApps, getExecution, onRun, attachedImages, readUrlParams, setSearchParams, viewMode, selectedPreset, isLoggedIn]);
19639
20395
  const autoSubmittedRef = (0, import_react23.useRef)(false);
@@ -20073,9 +20829,9 @@ var AgentUI = ({
20073
20829
  }
20074
20830
  let outputText = "";
20075
20831
  for (const c of candidates) {
20076
- const text = stringify(c);
20077
- if (text) {
20078
- outputText = text;
20832
+ const text2 = stringify(c);
20833
+ if (text2) {
20834
+ outputText = text2;
20079
20835
  break;
20080
20836
  }
20081
20837
  }
@@ -20520,9 +21276,9 @@ var AgentUI = ({
20520
21276
  return parsed && parsed.once ? null : parsed;
20521
21277
  }, [finishedRunInput]);
20522
21278
  const postRunAppReqs = (0, import_react23.useMemo)(() => {
20523
- const text = (finishedRunInput || "").trim();
20524
- if (text.length < 4) return [];
20525
- const reqs = getSuggestionAppRequirements(text, 4);
21279
+ const text2 = (finishedRunInput || "").trim();
21280
+ if (text2.length < 4) return [];
21281
+ const reqs = getSuggestionAppRequirements(text2, 4);
20526
21282
  const meaningful = reqs.filter((r) => !(r.kind === "app" && r.value === "shuffle_tools"));
20527
21283
  const chosen = chosenApps.map((a) => normalizeAgentAppName(a.name || "").replace(/_/g, " "));
20528
21284
  return meaningful.filter((r) => {
@@ -24073,6 +24829,8 @@ var AgentRunDrawer = ({
24073
24829
  permissionsDisabledTooltip = "Coming soon",
24074
24830
  agentUIProps,
24075
24831
  width = 595,
24832
+ minWidth = 420,
24833
+ maxWidth = 900,
24076
24834
  title = "Agent",
24077
24835
  subtitle = "Run actions and manage permissions",
24078
24836
  className,
@@ -24167,19 +24925,33 @@ var AgentRunDrawer = ({
24167
24925
  clearTimeout(t3);
24168
24926
  };
24169
24927
  }, [open, safeActiveTab]);
24928
+ const drawerWidth = `min(${width}px, 100vw)`;
24929
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
24930
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
24170
24931
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
24171
24932
  import_material29.Drawer,
24172
24933
  {
24173
24934
  anchor: "right",
24174
24935
  open,
24175
24936
  onClose,
24937
+ sx: {
24938
+ "& .MuiDrawer-paper": {
24939
+ boxSizing: "border-box",
24940
+ width: { xs: "100vw", sm: drawerWidth },
24941
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
24942
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth }
24943
+ }
24944
+ },
24176
24945
  slotProps: {
24177
24946
  paper: {
24178
24947
  ref: paperRef,
24179
24948
  className: [themeScope?.scopeClassName, className].filter(Boolean).join(" ") || void 0,
24180
24949
  sx: [
24181
24950
  {
24182
- width: { xs: "100%", sm: width },
24951
+ width: { xs: "100vw", sm: drawerWidth },
24952
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
24953
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth },
24954
+ boxSizing: "border-box",
24183
24955
  background: "linear-gradient(180deg, hsl(var(--card)) 0%, hsl(var(--background)) 100%)",
24184
24956
  borderLeft: "1px solid hsl(var(--border))",
24185
24957
  boxShadow: "-8px 0 32px hsla(0, 0%, 0%, 0.4)",
@@ -25501,17 +26273,17 @@ var AgentActivityList = ({
25501
26273
  }
25502
26274
  const hasPrompt = !!r.execution_argument || !!originalInput || !!agentResult?.result;
25503
26275
  if (!decisions || !hasPrompt) return null;
25504
- const patch = {
26276
+ const patch2 = {
25505
26277
  results,
25506
26278
  execution_argument: r.execution_argument,
25507
26279
  result: agentResult?.result ?? r.result,
25508
26280
  decisions,
25509
26281
  allowed_actions: allowedActions
25510
26282
  };
25511
- if (originalInput && !patch.execution_argument) {
25512
- patch.execution_argument = JSON.stringify({ original_input: originalInput });
26283
+ if (originalInput && !patch2.execution_argument) {
26284
+ patch2.execution_argument = JSON.stringify({ original_input: originalInput });
25513
26285
  }
25514
- return patch;
26286
+ return patch2;
25515
26287
  };
25516
26288
  let pending = {};
25517
26289
  let flushTimer = null;
@@ -25523,8 +26295,8 @@ var AgentActivityList = ({
25523
26295
  if (Object.keys(batch).length === 0) return;
25524
26296
  setEnrichedRuns((prev) => ({ ...prev, ...batch }));
25525
26297
  };
25526
- const queuePatch = (id, patch) => {
25527
- pending[id] = patch;
26298
+ const queuePatch = (id, patch2) => {
26299
+ pending[id] = patch2;
25528
26300
  if (!flushTimer) flushTimer = setTimeout(flush, 250);
25529
26301
  };
25530
26302
  const needsFetch = [];
@@ -25576,17 +26348,17 @@ var AgentActivityList = ({
25576
26348
  } catch {
25577
26349
  }
25578
26350
  }
25579
- const patch = {
26351
+ const patch2 = {
25580
26352
  results: json.results,
25581
26353
  execution_argument: json.execution_argument,
25582
26354
  result: agentResult?.result,
25583
26355
  decisions,
25584
26356
  allowed_actions: allowedActions
25585
26357
  };
25586
- if (originalInput && !patch.execution_argument) {
25587
- patch.execution_argument = JSON.stringify({ original_input: originalInput });
26358
+ if (originalInput && !patch2.execution_argument) {
26359
+ patch2.execution_argument = JSON.stringify({ original_input: originalInput });
25588
26360
  }
25589
- queuePatch(executionId, patch);
26361
+ queuePatch(executionId, patch2);
25590
26362
  } catch {
25591
26363
  }
25592
26364
  };
@@ -25615,8 +26387,8 @@ var AgentActivityList = ({
25615
26387
  };
25616
26388
  }, [runs, apiKey, orgId]);
25617
26389
  const mergedRuns = runs.map((r) => {
25618
- const patch = r.execution_id ? enrichedRuns[r.execution_id] : void 0;
25619
- const merged = patch ? { ...r, ...patch } : r;
26390
+ const patch2 = r.execution_id ? enrichedRuns[r.execution_id] : void 0;
26391
+ const merged = patch2 ? { ...r, ...patch2 } : r;
25620
26392
  return r.execution_id && abortedIds.has(r.execution_id) ? { ...merged, status: "ABORTED" } : merged;
25621
26393
  });
25622
26394
  const loadMore = (0, import_react27.useCallback)(() => {
@@ -25974,6 +26746,8 @@ var AgentExecutionDrawer = ({
25974
26746
  onClose,
25975
26747
  run,
25976
26748
  width = 720,
26749
+ minWidth = 480,
26750
+ maxWidth = 960,
25977
26751
  apiKey,
25978
26752
  apiBaseUrl,
25979
26753
  orgId,
@@ -25984,6 +26758,11 @@ var AgentExecutionDrawer = ({
25984
26758
  topBanner,
25985
26759
  onSchedule,
25986
26760
  isSupport,
26761
+ globalUrl,
26762
+ userdata,
26763
+ isLoaded,
26764
+ isLoggedIn,
26765
+ serverside,
25987
26766
  theme,
25988
26767
  colorMode
25989
26768
  }) => {
@@ -26000,6 +26779,9 @@ var AgentExecutionDrawer = ({
26000
26779
  const statusKey = (run?.status || "").toUpperCase();
26001
26780
  const cfg = STATUS_CONFIG[statusKey] || STATUS_CONFIG.WAITING;
26002
26781
  const duration = run ? formatDuration(run) : "";
26782
+ const drawerWidth = `min(${width}px, 100vw)`;
26783
+ const drawerMinWidth = `min(${minWidth}px, 100vw)`;
26784
+ const drawerMaxWidth = `min(${maxWidth}px, 100vw)`;
26003
26785
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
26004
26786
  import_material31.Drawer,
26005
26787
  {
@@ -26008,14 +26790,24 @@ var AgentExecutionDrawer = ({
26008
26790
  onClose,
26009
26791
  keepMounted: true,
26010
26792
  transitionDuration: { enter: 120, exit: 100 },
26011
- sx: { zIndex: 10011 },
26793
+ sx: {
26794
+ zIndex: 10011,
26795
+ "& .MuiDrawer-paper": {
26796
+ boxSizing: "border-box",
26797
+ width: { xs: "100vw", sm: drawerWidth },
26798
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
26799
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth }
26800
+ }
26801
+ },
26012
26802
  slotProps: {
26013
26803
  paper: {
26014
26804
  className: [themeScope?.scopeClassName, className].filter(Boolean).join(" ") || void 0,
26015
26805
  sx: [
26016
26806
  {
26017
- width: { xs: "100%", sm: width },
26018
- maxWidth: "100vw",
26807
+ width: { xs: "100vw", sm: drawerWidth },
26808
+ minWidth: { xs: "100vw", sm: drawerMinWidth },
26809
+ maxWidth: { xs: "100vw", sm: drawerMaxWidth },
26810
+ boxSizing: "border-box",
26019
26811
  bgcolor: "hsl(var(--background))",
26020
26812
  color: "hsl(var(--foreground))",
26021
26813
  backgroundImage: "none",
@@ -27491,7 +28283,8 @@ var AskAiSidePanel = ({
27491
28283
  right: 0,
27492
28284
  bottom: 0,
27493
28285
  width: { xs: "100%", sm: effectiveWidth },
27494
- maxWidth: "100vw",
28286
+ minWidth: { xs: "100%", sm: MIN_ASK_AI_PANEL_WIDTH },
28287
+ maxWidth: { xs: "100vw", sm: MAX_ASK_AI_PANEL_WIDTH },
27495
28288
  height: "100dvh",
27496
28289
  bgcolor: "hsl(var(--card))",
27497
28290
  borderLeft: "1px solid hsl(var(--border))",