@tangle-network/sandbox-ui 0.21.0 → 0.21.1
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/chat.d.ts +61 -1
- package/dist/chat.js +13 -3
- package/dist/{chunk-FLWMBK77.js → chunk-LA5GHELP.js} +399 -263
- package/dist/{chunk-76IQLPW2.js → chunk-SOKKTB7W.js} +29 -5
- package/dist/{chunk-666PYT5K.js → chunk-TAAYDQGM.js} +101 -11
- package/dist/dashboard.d.ts +34 -1
- package/dist/dashboard.js +3 -1
- package/dist/globals.css +33 -198
- package/dist/hooks.d.ts +63 -2
- package/dist/hooks.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +16 -4
- package/dist/pages.js +132 -120
- package/dist/styles.css +33 -198
- package/package.json +1 -1
|
@@ -1639,6 +1639,141 @@ function ProfileComparison({
|
|
|
1639
1639
|
] });
|
|
1640
1640
|
}
|
|
1641
1641
|
|
|
1642
|
+
// src/dashboard/metric-area-chart.tsx
|
|
1643
|
+
import * as React5 from "react";
|
|
1644
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1645
|
+
var TONE_VARS = {
|
|
1646
|
+
primary: "var(--brand-primary, hsl(var(--primary)))",
|
|
1647
|
+
success: "var(--status-running, #22c55e)",
|
|
1648
|
+
warning: "var(--status-creating, #eab308)",
|
|
1649
|
+
danger: "var(--status-error, #ef4444)"
|
|
1650
|
+
};
|
|
1651
|
+
function buildSegments(points, width, height, yMax) {
|
|
1652
|
+
if (points.length === 0 || yMax <= 0) return [];
|
|
1653
|
+
const t0 = points[0].at;
|
|
1654
|
+
const t1 = points[points.length - 1].at;
|
|
1655
|
+
const span = Math.max(1, t1 - t0);
|
|
1656
|
+
const x = (at) => points.length === 1 ? width / 2 : (at - t0) / span * width;
|
|
1657
|
+
const y = (v) => height - Math.min(1, Math.max(0, v / yMax)) * height;
|
|
1658
|
+
const segments = [];
|
|
1659
|
+
let run = [];
|
|
1660
|
+
const flush = () => {
|
|
1661
|
+
if (run.length === 0) return;
|
|
1662
|
+
const line = run.map((p, i) => `${i === 0 ? "M" : "L"}${p.px.toFixed(2)},${p.py.toFixed(2)}`).join(" ");
|
|
1663
|
+
const first = run[0];
|
|
1664
|
+
const last = run[run.length - 1];
|
|
1665
|
+
const area = `${line} L${last.px.toFixed(2)},${height} L${first.px.toFixed(2)},${height} Z`;
|
|
1666
|
+
segments.push({ path: line, area });
|
|
1667
|
+
run = [];
|
|
1668
|
+
};
|
|
1669
|
+
for (const point of points) {
|
|
1670
|
+
if (point.value === null) {
|
|
1671
|
+
flush();
|
|
1672
|
+
continue;
|
|
1673
|
+
}
|
|
1674
|
+
run.push({ px: x(point.at), py: y(point.value) });
|
|
1675
|
+
}
|
|
1676
|
+
flush();
|
|
1677
|
+
return segments;
|
|
1678
|
+
}
|
|
1679
|
+
function MetricAreaChart({
|
|
1680
|
+
points,
|
|
1681
|
+
label,
|
|
1682
|
+
formatValue,
|
|
1683
|
+
maxValue,
|
|
1684
|
+
detail,
|
|
1685
|
+
tone = "primary",
|
|
1686
|
+
height = 96,
|
|
1687
|
+
emptyState,
|
|
1688
|
+
className
|
|
1689
|
+
}) {
|
|
1690
|
+
const gradientId = React5.useId();
|
|
1691
|
+
const width = 400;
|
|
1692
|
+
const values = points.map((p) => p.value).filter((v) => v !== null);
|
|
1693
|
+
const latest = values.length > 0 ? values[values.length - 1] : null;
|
|
1694
|
+
const observedMax = values.length > 0 ? Math.max(...values) : 0;
|
|
1695
|
+
const yMax = maxValue ?? (observedMax > 0 ? observedMax * 1.1 : 1);
|
|
1696
|
+
const segments = buildSegments(points, width, height, yMax);
|
|
1697
|
+
const color = TONE_VARS[tone];
|
|
1698
|
+
return /* @__PURE__ */ jsxs12(
|
|
1699
|
+
"div",
|
|
1700
|
+
{
|
|
1701
|
+
className: cn(
|
|
1702
|
+
"rounded-lg border border-border bg-card p-4 shadow-sm",
|
|
1703
|
+
className
|
|
1704
|
+
),
|
|
1705
|
+
"data-testid": `metric-chart-${label.toLowerCase().replace(/\s+/g, "-")}`,
|
|
1706
|
+
children: [
|
|
1707
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-baseline justify-between gap-3", children: [
|
|
1708
|
+
/* @__PURE__ */ jsx13("p", { className: "font-medium text-muted-foreground text-xs uppercase tracking-[0.12em]", children: label }),
|
|
1709
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-right", children: [
|
|
1710
|
+
/* @__PURE__ */ jsx13("span", { className: "font-semibold text-foreground text-xl tabular-nums tracking-tight", children: latest === null ? "\u2014" : formatValue(latest) }),
|
|
1711
|
+
detail && /* @__PURE__ */ jsx13("span", { className: "ml-1.5 text-muted-foreground text-xs", children: detail })
|
|
1712
|
+
] })
|
|
1713
|
+
] }),
|
|
1714
|
+
/* @__PURE__ */ jsx13("div", { className: "mt-3", children: values.length === 0 ? /* @__PURE__ */ jsx13(
|
|
1715
|
+
"div",
|
|
1716
|
+
{
|
|
1717
|
+
className: "flex items-center justify-center text-muted-foreground text-xs",
|
|
1718
|
+
style: { height },
|
|
1719
|
+
children: emptyState ?? "Waiting for samples\u2026"
|
|
1720
|
+
}
|
|
1721
|
+
) : /* @__PURE__ */ jsxs12(
|
|
1722
|
+
"svg",
|
|
1723
|
+
{
|
|
1724
|
+
viewBox: `0 0 ${width} ${height}`,
|
|
1725
|
+
preserveAspectRatio: "none",
|
|
1726
|
+
className: "block w-full",
|
|
1727
|
+
style: { height },
|
|
1728
|
+
role: "img",
|
|
1729
|
+
"aria-label": `${label} chart`,
|
|
1730
|
+
children: [
|
|
1731
|
+
[0.25, 0.5, 0.75].map((fraction) => /* @__PURE__ */ jsx13(
|
|
1732
|
+
"line",
|
|
1733
|
+
{
|
|
1734
|
+
x1: 0,
|
|
1735
|
+
x2: width,
|
|
1736
|
+
y1: height * fraction,
|
|
1737
|
+
y2: height * fraction,
|
|
1738
|
+
stroke: "currentColor",
|
|
1739
|
+
className: "text-border",
|
|
1740
|
+
strokeWidth: 1,
|
|
1741
|
+
strokeDasharray: "3 5",
|
|
1742
|
+
vectorEffect: "non-scaling-stroke"
|
|
1743
|
+
},
|
|
1744
|
+
fraction
|
|
1745
|
+
)),
|
|
1746
|
+
/* @__PURE__ */ jsx13("defs", { children: /* @__PURE__ */ jsxs12("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [
|
|
1747
|
+
/* @__PURE__ */ jsx13("stop", { offset: "0%", stopColor: color, stopOpacity: 0.28 }),
|
|
1748
|
+
/* @__PURE__ */ jsx13("stop", { offset: "100%", stopColor: color, stopOpacity: 0.02 })
|
|
1749
|
+
] }) }),
|
|
1750
|
+
segments.map((segment) => /* @__PURE__ */ jsxs12(React5.Fragment, { children: [
|
|
1751
|
+
/* @__PURE__ */ jsx13("path", { d: segment.area, fill: `url(#${gradientId})` }),
|
|
1752
|
+
/* @__PURE__ */ jsx13(
|
|
1753
|
+
"path",
|
|
1754
|
+
{
|
|
1755
|
+
d: segment.path,
|
|
1756
|
+
fill: "none",
|
|
1757
|
+
stroke: color,
|
|
1758
|
+
strokeWidth: 1.75,
|
|
1759
|
+
vectorEffect: "non-scaling-stroke",
|
|
1760
|
+
strokeLinejoin: "round",
|
|
1761
|
+
strokeLinecap: "round"
|
|
1762
|
+
}
|
|
1763
|
+
)
|
|
1764
|
+
] }, segment.path))
|
|
1765
|
+
]
|
|
1766
|
+
}
|
|
1767
|
+
) }),
|
|
1768
|
+
/* @__PURE__ */ jsxs12("div", { className: "mt-1.5 flex justify-between text-[10px] text-muted-foreground tabular-nums", children: [
|
|
1769
|
+
/* @__PURE__ */ jsx13("span", { children: values.length > 0 ? formatValue(0) : "" }),
|
|
1770
|
+
/* @__PURE__ */ jsx13("span", { children: values.length > 0 ? formatValue(yMax) : "" })
|
|
1771
|
+
] })
|
|
1772
|
+
]
|
|
1773
|
+
}
|
|
1774
|
+
);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1642
1777
|
// src/dashboard/variant-list.tsx
|
|
1643
1778
|
import {
|
|
1644
1779
|
Check as Check3,
|
|
@@ -1652,7 +1787,7 @@ import {
|
|
|
1652
1787
|
} from "lucide-react";
|
|
1653
1788
|
import { Button as Button3 } from "@tangle-network/ui/primitives";
|
|
1654
1789
|
import { Badge as Badge2 } from "@tangle-network/ui/primitives";
|
|
1655
|
-
import { Fragment as
|
|
1790
|
+
import { Fragment as Fragment10, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1656
1791
|
var statusConfig = {
|
|
1657
1792
|
pending: {
|
|
1658
1793
|
icon: Clock3,
|
|
@@ -1736,19 +1871,19 @@ function VariantList({
|
|
|
1736
1871
|
isActioning,
|
|
1737
1872
|
className
|
|
1738
1873
|
}) {
|
|
1739
|
-
return /* @__PURE__ */
|
|
1874
|
+
return /* @__PURE__ */ jsx14("div", { className: `space-y-2 ${className || ""}`, children: variants.map((variant) => {
|
|
1740
1875
|
const status = statusConfig[variant.status];
|
|
1741
1876
|
const StatusIcon = status.icon;
|
|
1742
1877
|
const isSelected = variant.id === selectedId;
|
|
1743
|
-
return /* @__PURE__ */
|
|
1878
|
+
return /* @__PURE__ */ jsxs13(
|
|
1744
1879
|
"div",
|
|
1745
1880
|
{
|
|
1746
1881
|
className: `cursor-pointer rounded-lg border px-3 py-2.5 transition-colors ${isSelected ? "border-primary/30 bg-[var(--accent-surface-soft)]" : "border-border bg-card hover:border-primary/20 hover:bg-muted/50"}`,
|
|
1747
1882
|
onClick: () => onSelect?.(variant.id),
|
|
1748
1883
|
children: [
|
|
1749
|
-
/* @__PURE__ */
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1884
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
|
|
1885
|
+
/* @__PURE__ */ jsxs13(Badge2, { className: `shrink-0 ${status.bg} ${status.border} ${status.color}`, children: [
|
|
1886
|
+
/* @__PURE__ */ jsx14(
|
|
1752
1887
|
StatusIcon,
|
|
1753
1888
|
{
|
|
1754
1889
|
className: `mr-1 h-3 w-3 ${status.animate ? "animate-spin" : ""}`
|
|
@@ -1756,27 +1891,27 @@ function VariantList({
|
|
|
1756
1891
|
),
|
|
1757
1892
|
status.label
|
|
1758
1893
|
] }),
|
|
1759
|
-
/* @__PURE__ */
|
|
1760
|
-
variant.sublabel && /* @__PURE__ */
|
|
1894
|
+
/* @__PURE__ */ jsx14("span", { className: "truncate text-sm font-medium text-foreground", children: variant.label }),
|
|
1895
|
+
variant.sublabel && /* @__PURE__ */ jsxs13("span", { className: "shrink-0 text-xs text-muted-foreground", children: [
|
|
1761
1896
|
"(",
|
|
1762
1897
|
variant.sublabel,
|
|
1763
1898
|
")"
|
|
1764
1899
|
] }),
|
|
1765
|
-
variant.durationMs && /* @__PURE__ */
|
|
1766
|
-
/* @__PURE__ */
|
|
1900
|
+
variant.durationMs && /* @__PURE__ */ jsxs13("span", { className: "flex shrink-0 items-center gap-1 text-xs text-muted-foreground", children: [
|
|
1901
|
+
/* @__PURE__ */ jsx14(Timer, { className: "h-3 w-3" }),
|
|
1767
1902
|
(variant.durationMs / 1e3).toFixed(1),
|
|
1768
1903
|
"s"
|
|
1769
1904
|
] }),
|
|
1770
|
-
/* @__PURE__ */
|
|
1771
|
-
variant.outcome && /* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ jsxs13("div", { className: "ml-auto flex shrink-0 items-center gap-1.5", children: [
|
|
1906
|
+
variant.outcome && /* @__PURE__ */ jsx14(
|
|
1772
1907
|
Badge2,
|
|
1773
1908
|
{
|
|
1774
1909
|
className: `${outcomeConfig[variant.outcome].bg} ${outcomeConfig[variant.outcome].border} ${outcomeConfig[variant.outcome].color}`,
|
|
1775
1910
|
children: outcomeConfig[variant.outcome].label
|
|
1776
1911
|
}
|
|
1777
1912
|
),
|
|
1778
|
-
variant.status === "completed" && variant.outcome === "pending_review" && onAccept && onReject && /* @__PURE__ */
|
|
1779
|
-
/* @__PURE__ */
|
|
1913
|
+
variant.status === "completed" && variant.outcome === "pending_review" && onAccept && onReject && /* @__PURE__ */ jsxs13(Fragment10, { children: [
|
|
1914
|
+
/* @__PURE__ */ jsxs13(
|
|
1780
1915
|
Button3,
|
|
1781
1916
|
{
|
|
1782
1917
|
variant: "outline",
|
|
@@ -1788,12 +1923,12 @@ function VariantList({
|
|
|
1788
1923
|
},
|
|
1789
1924
|
disabled: isActioning === variant.id,
|
|
1790
1925
|
children: [
|
|
1791
|
-
/* @__PURE__ */
|
|
1926
|
+
/* @__PURE__ */ jsx14(Check3, { className: "mr-1 h-3 w-3" }),
|
|
1792
1927
|
"Accept"
|
|
1793
1928
|
]
|
|
1794
1929
|
}
|
|
1795
1930
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ jsxs13(
|
|
1797
1932
|
Button3,
|
|
1798
1933
|
{
|
|
1799
1934
|
variant: "outline",
|
|
@@ -1805,13 +1940,13 @@ function VariantList({
|
|
|
1805
1940
|
},
|
|
1806
1941
|
disabled: isActioning === variant.id,
|
|
1807
1942
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ jsx14(X, { className: "mr-1 h-3 w-3" }),
|
|
1809
1944
|
"Reject"
|
|
1810
1945
|
]
|
|
1811
1946
|
}
|
|
1812
1947
|
)
|
|
1813
1948
|
] }),
|
|
1814
|
-
variant.detailsUrl && /* @__PURE__ */
|
|
1949
|
+
variant.detailsUrl && /* @__PURE__ */ jsx14(
|
|
1815
1950
|
Button3,
|
|
1816
1951
|
{
|
|
1817
1952
|
variant: "ghost",
|
|
@@ -1821,13 +1956,13 @@ function VariantList({
|
|
|
1821
1956
|
e.stopPropagation();
|
|
1822
1957
|
window.open(variant.detailsUrl, "_blank");
|
|
1823
1958
|
},
|
|
1824
|
-
children: /* @__PURE__ */
|
|
1959
|
+
children: /* @__PURE__ */ jsx14(ExternalLink2, { className: "h-3.5 w-3.5" })
|
|
1825
1960
|
}
|
|
1826
1961
|
)
|
|
1827
1962
|
] })
|
|
1828
1963
|
] }),
|
|
1829
|
-
variant.error && /* @__PURE__ */
|
|
1830
|
-
variant.summary && /* @__PURE__ */
|
|
1964
|
+
variant.error && /* @__PURE__ */ jsx14("p", { className: "mt-1.5 text-xs text-[var(--surface-danger-text)]", children: variant.error }),
|
|
1965
|
+
variant.summary && /* @__PURE__ */ jsx14("p", { className: "mt-1.5 line-clamp-2 text-xs text-muted-foreground", children: variant.summary })
|
|
1831
1966
|
]
|
|
1832
1967
|
},
|
|
1833
1968
|
variant.id
|
|
@@ -1838,7 +1973,7 @@ function VariantList({
|
|
|
1838
1973
|
// src/dashboard/system-logs.tsx
|
|
1839
1974
|
import { Terminal as Terminal3 } from "lucide-react";
|
|
1840
1975
|
import { useEffect as useEffect2, useRef as useRef2, useState as useState4 } from "react";
|
|
1841
|
-
import { jsx as
|
|
1976
|
+
import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
1842
1977
|
function SystemLogsViewer({ apiUrl, token, className }) {
|
|
1843
1978
|
const [logs, setLogs] = useState4([]);
|
|
1844
1979
|
const [error, setError] = useState4(null);
|
|
@@ -1891,18 +2026,18 @@ function SystemLogsViewer({ apiUrl, token, className }) {
|
|
|
1891
2026
|
const isAtBottom = scrollHeight - scrollTop - clientHeight < 20;
|
|
1892
2027
|
setIsFollowing((prev) => prev === isAtBottom ? prev : isAtBottom);
|
|
1893
2028
|
};
|
|
1894
|
-
return /* @__PURE__ */
|
|
1895
|
-
/* @__PURE__ */
|
|
1896
|
-
/* @__PURE__ */
|
|
1897
|
-
/* @__PURE__ */
|
|
1898
|
-
/* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsxs14("div", { className: cn("flex flex-col h-full bg-background text-foreground font-mono text-sm leading-relaxed overflow-hidden rounded-lg border border-border", className), children: [
|
|
2030
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex-none flex items-center justify-between border-b border-border bg-muted/50 backdrop-blur-md px-4 py-2", children: [
|
|
2031
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
|
|
2032
|
+
/* @__PURE__ */ jsx15(Terminal3, { className: "h-4 w-4 text-primary animate-pulse" }),
|
|
2033
|
+
/* @__PURE__ */ jsx15("span", { className: "font-bold text-xs uppercase tracking-widest text-muted-foreground", children: "System Traces" })
|
|
1899
2034
|
] }),
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
error && /* @__PURE__ */
|
|
1902
|
-
/* @__PURE__ */
|
|
2035
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-3", children: [
|
|
2036
|
+
error && /* @__PURE__ */ jsxs14("span", { className: "text-destructive text-xs flex items-center gap-1", children: [
|
|
2037
|
+
/* @__PURE__ */ jsx15("span", { className: "w-2 h-2 rounded-full bg-destructive animate-ping" }),
|
|
1903
2038
|
" Error fetching logs"
|
|
1904
2039
|
] }),
|
|
1905
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ jsx15(
|
|
1906
2041
|
"button",
|
|
1907
2042
|
{
|
|
1908
2043
|
onClick: () => {
|
|
@@ -1917,29 +2052,29 @@ function SystemLogsViewer({ apiUrl, token, className }) {
|
|
|
1917
2052
|
)
|
|
1918
2053
|
] })
|
|
1919
2054
|
] }),
|
|
1920
|
-
/* @__PURE__ */
|
|
2055
|
+
/* @__PURE__ */ jsx15(
|
|
1921
2056
|
"div",
|
|
1922
2057
|
{
|
|
1923
2058
|
ref: scrollRef,
|
|
1924
2059
|
onScroll: handleScroll,
|
|
1925
2060
|
className: "flex-1 overflow-y-auto p-4 space-y-1",
|
|
1926
|
-
children: logs.length === 0 && !error ? /* @__PURE__ */
|
|
1927
|
-
/* @__PURE__ */
|
|
2061
|
+
children: logs.length === 0 && !error ? /* @__PURE__ */ jsx15("div", { className: "flex h-full items-center justify-center text-muted-foreground italic", children: "Waiting for orchestrator logs..." }) : logs.map((log, i) => /* @__PURE__ */ jsxs14("div", { className: "break-words", children: [
|
|
2062
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground mr-3 select-none", children: [
|
|
1928
2063
|
"[",
|
|
1929
2064
|
log.timestamp || i.toString().padStart(4, "0"),
|
|
1930
2065
|
"]"
|
|
1931
2066
|
] }),
|
|
1932
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-primary/70 mr-2", children: [
|
|
1933
2068
|
"[",
|
|
1934
2069
|
log.level,
|
|
1935
2070
|
"]"
|
|
1936
2071
|
] }),
|
|
1937
|
-
/* @__PURE__ */
|
|
2072
|
+
/* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground mr-2", children: [
|
|
1938
2073
|
"[",
|
|
1939
2074
|
log.scope,
|
|
1940
2075
|
"]"
|
|
1941
2076
|
] }),
|
|
1942
|
-
/* @__PURE__ */
|
|
2077
|
+
/* @__PURE__ */ jsx15("span", { className: log.level.toUpperCase() === "ERROR" || log.message.toLowerCase().includes("failed") ? "text-destructive" : log.level.toUpperCase() === "WARN" ? "text-warning" : "text-foreground", children: log.message })
|
|
1943
2078
|
] }, `${log.timestamp}-${log.scope}-${i}`))
|
|
1944
2079
|
}
|
|
1945
2080
|
)
|
|
@@ -1950,50 +2085,50 @@ function SystemLogsViewer({ apiUrl, token, className }) {
|
|
|
1950
2085
|
import { Clock as Clock4, Layers, MessageSquare, DollarSign } from "lucide-react";
|
|
1951
2086
|
import { StatCard } from "@tangle-network/ui/primitives";
|
|
1952
2087
|
import { Skeleton as Skeleton2 } from "@tangle-network/ui/primitives";
|
|
1953
|
-
import { jsx as
|
|
2088
|
+
import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1954
2089
|
function UsageSummary({ data, loading = false, className }) {
|
|
1955
2090
|
if (loading || !data) {
|
|
1956
|
-
return /* @__PURE__ */
|
|
2091
|
+
return /* @__PURE__ */ jsx16("div", { className: cn("grid grid-cols-2 gap-4 lg:grid-cols-4", className), children: Array.from({ length: 4 }).map((_, i) => /* @__PURE__ */ jsx16(Skeleton2, { className: "h-28 rounded-xl" }, i)) });
|
|
1957
2092
|
}
|
|
1958
|
-
return /* @__PURE__ */
|
|
1959
|
-
/* @__PURE__ */
|
|
2093
|
+
return /* @__PURE__ */ jsxs15("div", { className: cn("grid grid-cols-2 gap-4 lg:grid-cols-4", className), children: [
|
|
2094
|
+
/* @__PURE__ */ jsx16(
|
|
1960
2095
|
StatCard,
|
|
1961
2096
|
{
|
|
1962
2097
|
variant: "sandbox",
|
|
1963
2098
|
title: "Compute Hours",
|
|
1964
2099
|
value: data.computeHours.toFixed(1),
|
|
1965
2100
|
subtitle: "This billing period",
|
|
1966
|
-
icon: /* @__PURE__ */
|
|
2101
|
+
icon: /* @__PURE__ */ jsx16(Clock4, { className: "h-5 w-5" })
|
|
1967
2102
|
}
|
|
1968
2103
|
),
|
|
1969
|
-
/* @__PURE__ */
|
|
2104
|
+
/* @__PURE__ */ jsx16(
|
|
1970
2105
|
StatCard,
|
|
1971
2106
|
{
|
|
1972
2107
|
variant: "sandbox",
|
|
1973
2108
|
title: "Active Sessions",
|
|
1974
2109
|
value: data.activeSessions,
|
|
1975
2110
|
subtitle: "Currently running",
|
|
1976
|
-
icon: /* @__PURE__ */
|
|
2111
|
+
icon: /* @__PURE__ */ jsx16(Layers, { className: "h-5 w-5" })
|
|
1977
2112
|
}
|
|
1978
2113
|
),
|
|
1979
|
-
/* @__PURE__ */
|
|
2114
|
+
/* @__PURE__ */ jsx16(
|
|
1980
2115
|
StatCard,
|
|
1981
2116
|
{
|
|
1982
2117
|
variant: "sandbox",
|
|
1983
2118
|
title: "Messages Sent",
|
|
1984
2119
|
value: data.messagesSent.toLocaleString(),
|
|
1985
2120
|
subtitle: "Agent interactions",
|
|
1986
|
-
icon: /* @__PURE__ */
|
|
2121
|
+
icon: /* @__PURE__ */ jsx16(MessageSquare, { className: "h-5 w-5" })
|
|
1987
2122
|
}
|
|
1988
2123
|
),
|
|
1989
|
-
/* @__PURE__ */
|
|
2124
|
+
/* @__PURE__ */ jsx16(
|
|
1990
2125
|
StatCard,
|
|
1991
2126
|
{
|
|
1992
2127
|
variant: "sandbox",
|
|
1993
2128
|
title: "Estimated Cost",
|
|
1994
2129
|
value: `$${data.estimatedCost.toFixed(2)}`,
|
|
1995
2130
|
subtitle: "This billing period",
|
|
1996
|
-
icon: /* @__PURE__ */
|
|
2131
|
+
icon: /* @__PURE__ */ jsx16(DollarSign, { className: "h-5 w-5" })
|
|
1997
2132
|
}
|
|
1998
2133
|
)
|
|
1999
2134
|
] });
|
|
@@ -2001,66 +2136,66 @@ function UsageSummary({ data, loading = false, className }) {
|
|
|
2001
2136
|
|
|
2002
2137
|
// src/dashboard/git-panel.tsx
|
|
2003
2138
|
import { GitBranch, GitCommit, FileEdit, FilePlus, File } from "lucide-react";
|
|
2004
|
-
import { jsx as
|
|
2139
|
+
import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2005
2140
|
function GitPanel({ status, log, loading = false, onRefresh, className }) {
|
|
2006
2141
|
if (loading) {
|
|
2007
|
-
return /* @__PURE__ */
|
|
2008
|
-
/* @__PURE__ */
|
|
2142
|
+
return /* @__PURE__ */ jsx17("div", { className: cn("rounded-lg border border-border bg-card p-5", className), children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2143
|
+
/* @__PURE__ */ jsx17("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent" }),
|
|
2009
2144
|
"Loading git info..."
|
|
2010
2145
|
] }) });
|
|
2011
2146
|
}
|
|
2012
2147
|
if (!status) {
|
|
2013
|
-
return /* @__PURE__ */
|
|
2014
|
-
/* @__PURE__ */
|
|
2148
|
+
return /* @__PURE__ */ jsx17("div", { className: cn("rounded-lg border border-border bg-card p-5", className), children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
|
|
2149
|
+
/* @__PURE__ */ jsx17(GitBranch, { className: "h-4 w-4" }),
|
|
2015
2150
|
"No git repository detected"
|
|
2016
2151
|
] }) });
|
|
2017
2152
|
}
|
|
2018
2153
|
const changedCount = status.staged.length + status.modified.length + status.untracked.length;
|
|
2019
|
-
return /* @__PURE__ */
|
|
2020
|
-
/* @__PURE__ */
|
|
2021
|
-
/* @__PURE__ */
|
|
2022
|
-
/* @__PURE__ */
|
|
2023
|
-
/* @__PURE__ */
|
|
2024
|
-
status.isDirty && /* @__PURE__ */
|
|
2154
|
+
return /* @__PURE__ */ jsxs16("div", { className: cn("rounded-lg border border-border bg-card overflow-hidden", className), children: [
|
|
2155
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between border-b border-border bg-muted/30 px-4 py-3", children: [
|
|
2156
|
+
/* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
|
|
2157
|
+
/* @__PURE__ */ jsx17(GitBranch, { className: "h-4 w-4 text-primary" }),
|
|
2158
|
+
/* @__PURE__ */ jsx17("span", { className: "text-sm font-bold text-foreground", children: status.branch }),
|
|
2159
|
+
status.isDirty && /* @__PURE__ */ jsxs16("span", { className: "rounded-full bg-[var(--surface-warning-bg)] px-1.5 py-0.5 text-[10px] font-bold text-[var(--surface-warning-text)]", children: [
|
|
2025
2160
|
changedCount,
|
|
2026
2161
|
" change",
|
|
2027
2162
|
changedCount !== 1 ? "s" : ""
|
|
2028
2163
|
] })
|
|
2029
2164
|
] }),
|
|
2030
|
-
onRefresh && /* @__PURE__ */
|
|
2165
|
+
onRefresh && /* @__PURE__ */ jsx17("button", { type: "button", onClick: onRefresh, className: "text-xs text-muted-foreground hover:text-foreground transition-colors", children: "Refresh" })
|
|
2031
2166
|
] }),
|
|
2032
|
-
changedCount > 0 && /* @__PURE__ */
|
|
2033
|
-
status.staged.map((f) => /* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2167
|
+
changedCount > 0 && /* @__PURE__ */ jsx17("div", { className: "border-b border-border px-4 py-3", children: /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5", children: [
|
|
2168
|
+
status.staged.map((f) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
2169
|
+
/* @__PURE__ */ jsx17(FilePlus, { className: "h-3 w-3 text-[var(--surface-success-text)]" }),
|
|
2170
|
+
/* @__PURE__ */ jsx17("span", { className: "font-mono text-foreground truncate", children: f }),
|
|
2171
|
+
/* @__PURE__ */ jsx17("span", { className: "text-[var(--surface-success-text)] text-[10px] font-bold ml-auto", children: "STAGED" })
|
|
2037
2172
|
] }, `s-${f}`)),
|
|
2038
|
-
status.modified.map((f) => /* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
/* @__PURE__ */
|
|
2173
|
+
status.modified.map((f) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
2174
|
+
/* @__PURE__ */ jsx17(FileEdit, { className: "h-3 w-3 text-[var(--surface-warning-text)]" }),
|
|
2175
|
+
/* @__PURE__ */ jsx17("span", { className: "font-mono text-foreground truncate", children: f })
|
|
2041
2176
|
] }, `m-${f}`)),
|
|
2042
|
-
status.untracked.map((f) => /* @__PURE__ */
|
|
2043
|
-
/* @__PURE__ */
|
|
2044
|
-
/* @__PURE__ */
|
|
2177
|
+
status.untracked.map((f) => /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 text-xs", children: [
|
|
2178
|
+
/* @__PURE__ */ jsx17(File, { className: "h-3 w-3 text-muted-foreground" }),
|
|
2179
|
+
/* @__PURE__ */ jsx17("span", { className: "font-mono text-muted-foreground truncate", children: f })
|
|
2045
2180
|
] }, `u-${f}`))
|
|
2046
2181
|
] }) }),
|
|
2047
|
-
log.length > 0 && /* @__PURE__ */
|
|
2048
|
-
/* @__PURE__ */
|
|
2049
|
-
/* @__PURE__ */
|
|
2050
|
-
/* @__PURE__ */
|
|
2051
|
-
/* @__PURE__ */
|
|
2052
|
-
/* @__PURE__ */
|
|
2053
|
-
/* @__PURE__ */
|
|
2182
|
+
log.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "px-4 py-3", children: [
|
|
2183
|
+
/* @__PURE__ */ jsx17("div", { className: "mb-2 text-[10px] font-bold uppercase tracking-widest text-muted-foreground", children: "Recent Commits" }),
|
|
2184
|
+
/* @__PURE__ */ jsx17("div", { className: "space-y-2", children: log.slice(0, 5).map((commit) => /* @__PURE__ */ jsxs16("div", { className: "flex items-start gap-2 text-xs", children: [
|
|
2185
|
+
/* @__PURE__ */ jsx17(GitCommit, { className: "h-3 w-3 text-muted-foreground mt-0.5 shrink-0" }),
|
|
2186
|
+
/* @__PURE__ */ jsxs16("div", { className: "min-w-0", children: [
|
|
2187
|
+
/* @__PURE__ */ jsx17("span", { className: "font-mono text-primary mr-1.5", children: commit.shortSha }),
|
|
2188
|
+
/* @__PURE__ */ jsx17("span", { className: "text-foreground", children: commit.message })
|
|
2054
2189
|
] })
|
|
2055
2190
|
] }, commit.shortSha)) })
|
|
2056
2191
|
] }),
|
|
2057
|
-
(status.ahead > 0 || status.behind > 0) && /* @__PURE__ */
|
|
2058
|
-
status.ahead > 0 && /* @__PURE__ */
|
|
2192
|
+
(status.ahead > 0 || status.behind > 0) && /* @__PURE__ */ jsxs16("div", { className: "border-t border-border px-4 py-2 flex items-center gap-3 text-xs text-muted-foreground", children: [
|
|
2193
|
+
status.ahead > 0 && /* @__PURE__ */ jsxs16("span", { children: [
|
|
2059
2194
|
"\u2191 ",
|
|
2060
2195
|
status.ahead,
|
|
2061
2196
|
" ahead"
|
|
2062
2197
|
] }),
|
|
2063
|
-
status.behind > 0 && /* @__PURE__ */
|
|
2198
|
+
status.behind > 0 && /* @__PURE__ */ jsxs16("span", { children: [
|
|
2064
2199
|
"\u2193 ",
|
|
2065
2200
|
status.behind,
|
|
2066
2201
|
" behind"
|
|
@@ -2070,14 +2205,14 @@ function GitPanel({ status, log, loading = false, onRefresh, className }) {
|
|
|
2070
2205
|
}
|
|
2071
2206
|
|
|
2072
2207
|
// src/dashboard/ports-list.tsx
|
|
2073
|
-
import * as
|
|
2208
|
+
import * as React7 from "react";
|
|
2074
2209
|
import { Copy as Copy3, Check as Check4, Globe, Plus as Plus4, Trash2 as Trash23 } from "lucide-react";
|
|
2075
|
-
import { jsx as
|
|
2210
|
+
import { jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2076
2211
|
function PortsList({ ports, onExposePort, onRemovePort, isExposing = false, className }) {
|
|
2077
|
-
const [newPort, setNewPort] =
|
|
2078
|
-
const [copiedPort, setCopiedPort] =
|
|
2079
|
-
const copyTimerRef =
|
|
2080
|
-
|
|
2212
|
+
const [newPort, setNewPort] = React7.useState("");
|
|
2213
|
+
const [copiedPort, setCopiedPort] = React7.useState(null);
|
|
2214
|
+
const copyTimerRef = React7.useRef(null);
|
|
2215
|
+
React7.useEffect(() => {
|
|
2081
2216
|
return () => {
|
|
2082
2217
|
if (copyTimerRef.current) clearTimeout(copyTimerRef.current);
|
|
2083
2218
|
};
|
|
@@ -2099,48 +2234,48 @@ function PortsList({ ports, onExposePort, onRemovePort, isExposing = false, clas
|
|
|
2099
2234
|
setNewPort("");
|
|
2100
2235
|
}
|
|
2101
2236
|
};
|
|
2102
|
-
return /* @__PURE__ */
|
|
2103
|
-
ports.length > 0 ? /* @__PURE__ */
|
|
2104
|
-
/* @__PURE__ */
|
|
2105
|
-
/* @__PURE__ */
|
|
2106
|
-
/* @__PURE__ */
|
|
2107
|
-
/* @__PURE__ */
|
|
2108
|
-
/* @__PURE__ */
|
|
2237
|
+
return /* @__PURE__ */ jsxs17("div", { className: cn("space-y-4", className), children: [
|
|
2238
|
+
ports.length > 0 ? /* @__PURE__ */ jsx18("div", { className: "rounded-lg border border-border overflow-hidden", children: /* @__PURE__ */ jsxs17("table", { className: "w-full text-sm", children: [
|
|
2239
|
+
/* @__PURE__ */ jsx18("thead", { className: "bg-muted/30 border-b border-border", children: /* @__PURE__ */ jsxs17("tr", { children: [
|
|
2240
|
+
/* @__PURE__ */ jsx18("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Port" }),
|
|
2241
|
+
/* @__PURE__ */ jsx18("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Public URL" }),
|
|
2242
|
+
/* @__PURE__ */ jsx18("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Status" }),
|
|
2243
|
+
/* @__PURE__ */ jsx18("th", { className: "px-4 py-2.5 text-right text-xs font-medium text-muted-foreground w-20" })
|
|
2109
2244
|
] }) }),
|
|
2110
|
-
/* @__PURE__ */
|
|
2111
|
-
/* @__PURE__ */
|
|
2112
|
-
/* @__PURE__ */
|
|
2245
|
+
/* @__PURE__ */ jsx18("tbody", { className: "divide-y divide-border", children: ports.map((p) => /* @__PURE__ */ jsxs17("tr", { children: [
|
|
2246
|
+
/* @__PURE__ */ jsx18("td", { className: "px-4 py-3 font-mono text-xs text-foreground", children: p.port }),
|
|
2247
|
+
/* @__PURE__ */ jsx18("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsxs17(
|
|
2113
2248
|
"button",
|
|
2114
2249
|
{
|
|
2115
2250
|
type: "button",
|
|
2116
2251
|
onClick: () => handleCopy(p.url, p.port),
|
|
2117
2252
|
className: "flex items-center gap-2 font-mono text-xs text-primary hover:underline cursor-pointer group",
|
|
2118
2253
|
children: [
|
|
2119
|
-
/* @__PURE__ */
|
|
2120
|
-
copiedPort === p.port ? /* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsx18("span", { className: "truncate max-w-[300px]", children: p.url }),
|
|
2255
|
+
copiedPort === p.port ? /* @__PURE__ */ jsx18(Check4, { className: "h-3 w-3 text-[var(--surface-success-text)] shrink-0" }) : /* @__PURE__ */ jsx18(Copy3, { className: "h-3 w-3 opacity-0 group-hover:opacity-100 transition-opacity shrink-0" })
|
|
2121
2256
|
]
|
|
2122
2257
|
}
|
|
2123
2258
|
) }),
|
|
2124
|
-
/* @__PURE__ */
|
|
2259
|
+
/* @__PURE__ */ jsx18("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx18("span", { className: cn(
|
|
2125
2260
|
"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",
|
|
2126
2261
|
p.status === "active" ? "bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : "bg-[var(--surface-warning-bg)] text-[var(--surface-warning-text)]"
|
|
2127
2262
|
), children: p.status }) }),
|
|
2128
|
-
/* @__PURE__ */
|
|
2263
|
+
/* @__PURE__ */ jsx18("td", { className: "px-4 py-3 text-right", children: onRemovePort && /* @__PURE__ */ jsx18(
|
|
2129
2264
|
"button",
|
|
2130
2265
|
{
|
|
2131
2266
|
type: "button",
|
|
2132
2267
|
onClick: () => onRemovePort(p.port),
|
|
2133
2268
|
className: "p-1 text-muted-foreground hover:text-destructive transition-colors rounded",
|
|
2134
|
-
children: /* @__PURE__ */
|
|
2269
|
+
children: /* @__PURE__ */ jsx18(Trash23, { className: "h-3.5 w-3.5" })
|
|
2135
2270
|
}
|
|
2136
2271
|
) })
|
|
2137
2272
|
] }, p.port)) })
|
|
2138
|
-
] }) }) : /* @__PURE__ */
|
|
2139
|
-
/* @__PURE__ */
|
|
2140
|
-
/* @__PURE__ */
|
|
2273
|
+
] }) }) : /* @__PURE__ */ jsxs17("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
|
|
2274
|
+
/* @__PURE__ */ jsx18(Globe, { className: "mx-auto h-8 w-8 text-muted-foreground mb-2" }),
|
|
2275
|
+
/* @__PURE__ */ jsx18("p", { className: "text-sm text-muted-foreground", children: "No ports exposed yet" })
|
|
2141
2276
|
] }),
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
-
/* @__PURE__ */
|
|
2277
|
+
/* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-3", children: [
|
|
2278
|
+
/* @__PURE__ */ jsx18(
|
|
2144
2279
|
"input",
|
|
2145
2280
|
{
|
|
2146
2281
|
type: "number",
|
|
@@ -2153,7 +2288,7 @@ function PortsList({ ports, onExposePort, onRemovePort, isExposing = false, clas
|
|
|
2153
2288
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2154
2289
|
}
|
|
2155
2290
|
),
|
|
2156
|
-
/* @__PURE__ */
|
|
2291
|
+
/* @__PURE__ */ jsxs17(
|
|
2157
2292
|
"button",
|
|
2158
2293
|
{
|
|
2159
2294
|
type: "button",
|
|
@@ -2161,7 +2296,7 @@ function PortsList({ ports, onExposePort, onRemovePort, isExposing = false, clas
|
|
|
2161
2296
|
disabled: !newPort || isExposing,
|
|
2162
2297
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary/20 border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary hover:text-primary-foreground transition-colors disabled:opacity-50",
|
|
2163
2298
|
children: [
|
|
2164
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ jsx18(Plus4, { className: "h-4 w-4" }),
|
|
2165
2300
|
"Expose"
|
|
2166
2301
|
]
|
|
2167
2302
|
}
|
|
@@ -2171,9 +2306,9 @@ function PortsList({ ports, onExposePort, onRemovePort, isExposing = false, clas
|
|
|
2171
2306
|
}
|
|
2172
2307
|
|
|
2173
2308
|
// src/dashboard/process-list.tsx
|
|
2174
|
-
import * as
|
|
2309
|
+
import * as React8 from "react";
|
|
2175
2310
|
import { Activity as Activity3, Plus as Plus5, Skull, Terminal as Terminal4 } from "lucide-react";
|
|
2176
|
-
import { jsx as
|
|
2311
|
+
import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2177
2312
|
function formatUptime(startedAt) {
|
|
2178
2313
|
if (!startedAt) return "-";
|
|
2179
2314
|
const ms = Date.now() - new Date(startedAt).getTime();
|
|
@@ -2183,7 +2318,7 @@ function formatUptime(startedAt) {
|
|
|
2183
2318
|
return `${Math.floor(ms / 36e5)}h ${Math.floor(ms % 36e5 / 6e4)}m`;
|
|
2184
2319
|
}
|
|
2185
2320
|
function ProcessList({ processes, onSpawn, onKill, loading = false, className }) {
|
|
2186
|
-
const [newCommand, setNewCommand] =
|
|
2321
|
+
const [newCommand, setNewCommand] = React8.useState("");
|
|
2187
2322
|
const handleSpawn = () => {
|
|
2188
2323
|
const cmd = newCommand.trim();
|
|
2189
2324
|
if (cmd) {
|
|
@@ -2191,43 +2326,43 @@ function ProcessList({ processes, onSpawn, onKill, loading = false, className })
|
|
|
2191
2326
|
setNewCommand("");
|
|
2192
2327
|
}
|
|
2193
2328
|
};
|
|
2194
|
-
return /* @__PURE__ */
|
|
2195
|
-
loading ? /* @__PURE__ */
|
|
2196
|
-
/* @__PURE__ */
|
|
2197
|
-
/* @__PURE__ */
|
|
2198
|
-
] }) : processes.length > 0 ? /* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2202
|
-
/* @__PURE__ */
|
|
2203
|
-
/* @__PURE__ */
|
|
2204
|
-
/* @__PURE__ */
|
|
2329
|
+
return /* @__PURE__ */ jsxs18("div", { className: cn("space-y-4", className), children: [
|
|
2330
|
+
loading ? /* @__PURE__ */ jsxs18("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
|
|
2331
|
+
/* @__PURE__ */ jsx19(Activity3, { className: "mx-auto h-6 w-6 text-muted-foreground animate-spin mb-2" }),
|
|
2332
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "Loading processes..." })
|
|
2333
|
+
] }) : processes.length > 0 ? /* @__PURE__ */ jsx19("div", { className: "rounded-lg border border-border overflow-hidden", children: /* @__PURE__ */ jsxs18("table", { className: "w-full text-sm", children: [
|
|
2334
|
+
/* @__PURE__ */ jsx19("thead", { className: "bg-muted/30 border-b border-border", children: /* @__PURE__ */ jsxs18("tr", { children: [
|
|
2335
|
+
/* @__PURE__ */ jsx19("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "PID" }),
|
|
2336
|
+
/* @__PURE__ */ jsx19("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Command" }),
|
|
2337
|
+
/* @__PURE__ */ jsx19("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Status" }),
|
|
2338
|
+
/* @__PURE__ */ jsx19("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Uptime" }),
|
|
2339
|
+
/* @__PURE__ */ jsx19("th", { className: "px-4 py-2.5 text-right text-xs font-medium text-muted-foreground w-20" })
|
|
2205
2340
|
] }) }),
|
|
2206
|
-
/* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2208
|
-
/* @__PURE__ */
|
|
2209
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ jsx19("tbody", { className: "divide-y divide-border", children: processes.map((p) => /* @__PURE__ */ jsxs18("tr", { children: [
|
|
2342
|
+
/* @__PURE__ */ jsx19("td", { className: "px-4 py-3 font-mono text-xs text-foreground", children: p.pid }),
|
|
2343
|
+
/* @__PURE__ */ jsx19("td", { className: "px-4 py-3 font-mono text-xs text-foreground truncate max-w-[250px]", children: p.command }),
|
|
2344
|
+
/* @__PURE__ */ jsx19("td", { className: "px-4 py-3", children: /* @__PURE__ */ jsx19("span", { className: cn(
|
|
2210
2345
|
"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",
|
|
2211
2346
|
p.running ? "bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : "bg-muted text-muted-foreground"
|
|
2212
2347
|
), children: p.running ? "running" : `exited (${p.exitCode ?? "?"})` }) }),
|
|
2213
|
-
/* @__PURE__ */
|
|
2214
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx19("td", { className: "px-4 py-3 font-mono text-xs text-muted-foreground", children: formatUptime(p.startedAt) }),
|
|
2349
|
+
/* @__PURE__ */ jsx19("td", { className: "px-4 py-3 text-right", children: p.running && /* @__PURE__ */ jsx19(
|
|
2215
2350
|
"button",
|
|
2216
2351
|
{
|
|
2217
2352
|
type: "button",
|
|
2218
2353
|
onClick: () => onKill(p.pid),
|
|
2219
2354
|
className: "p-1 text-muted-foreground hover:text-destructive transition-colors rounded",
|
|
2220
2355
|
title: "Kill process",
|
|
2221
|
-
children: /* @__PURE__ */
|
|
2356
|
+
children: /* @__PURE__ */ jsx19(Skull, { className: "h-3.5 w-3.5" })
|
|
2222
2357
|
}
|
|
2223
2358
|
) })
|
|
2224
2359
|
] }, `${p.pid}-${p.startedAt ?? p.command}`)) })
|
|
2225
|
-
] }) }) : /* @__PURE__ */
|
|
2226
|
-
/* @__PURE__ */
|
|
2227
|
-
/* @__PURE__ */
|
|
2360
|
+
] }) }) : /* @__PURE__ */ jsxs18("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
|
|
2361
|
+
/* @__PURE__ */ jsx19(Terminal4, { className: "mx-auto h-8 w-8 text-muted-foreground mb-2" }),
|
|
2362
|
+
/* @__PURE__ */ jsx19("p", { className: "text-sm text-muted-foreground", children: "No processes running" })
|
|
2228
2363
|
] }),
|
|
2229
|
-
/* @__PURE__ */
|
|
2230
|
-
/* @__PURE__ */
|
|
2364
|
+
/* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3", children: [
|
|
2365
|
+
/* @__PURE__ */ jsx19(
|
|
2231
2366
|
"input",
|
|
2232
2367
|
{
|
|
2233
2368
|
type: "text",
|
|
@@ -2238,7 +2373,7 @@ function ProcessList({ processes, onSpawn, onKill, loading = false, className })
|
|
|
2238
2373
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2239
2374
|
}
|
|
2240
2375
|
),
|
|
2241
|
-
/* @__PURE__ */
|
|
2376
|
+
/* @__PURE__ */ jsxs18(
|
|
2242
2377
|
"button",
|
|
2243
2378
|
{
|
|
2244
2379
|
type: "button",
|
|
@@ -2246,7 +2381,7 @@ function ProcessList({ processes, onSpawn, onKill, loading = false, className })
|
|
|
2246
2381
|
disabled: !newCommand.trim(),
|
|
2247
2382
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary/20 border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary hover:text-primary-foreground transition-colors disabled:opacity-50",
|
|
2248
2383
|
children: [
|
|
2249
|
-
/* @__PURE__ */
|
|
2384
|
+
/* @__PURE__ */ jsx19(Plus5, { className: "h-4 w-4" }),
|
|
2250
2385
|
"Spawn"
|
|
2251
2386
|
]
|
|
2252
2387
|
}
|
|
@@ -2256,11 +2391,11 @@ function ProcessList({ processes, onSpawn, onKill, loading = false, className })
|
|
|
2256
2391
|
}
|
|
2257
2392
|
|
|
2258
2393
|
// src/dashboard/network-config.tsx
|
|
2259
|
-
import * as
|
|
2394
|
+
import * as React9 from "react";
|
|
2260
2395
|
import { Network as Network2, Plus as Plus6, Trash2 as Trash24, ShieldAlert } from "lucide-react";
|
|
2261
|
-
import { jsx as
|
|
2396
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2262
2397
|
function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
2263
|
-
const [newCidr, setNewCidr] =
|
|
2398
|
+
const [newCidr, setNewCidr] = React9.useState("");
|
|
2264
2399
|
const isValidCidr = (value) => {
|
|
2265
2400
|
const match = value.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\/(\d{1,2})$/);
|
|
2266
2401
|
if (!match) return false;
|
|
@@ -2281,21 +2416,21 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2281
2416
|
}
|
|
2282
2417
|
};
|
|
2283
2418
|
if (loading || !config) {
|
|
2284
|
-
return /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2286
|
-
/* @__PURE__ */
|
|
2419
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("rounded-lg border border-border bg-muted/20 p-6 text-center", className), children: [
|
|
2420
|
+
/* @__PURE__ */ jsx20(Network2, { className: "mx-auto h-6 w-6 text-muted-foreground animate-pulse mb-2" }),
|
|
2421
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: "Loading network configuration..." })
|
|
2287
2422
|
] });
|
|
2288
2423
|
}
|
|
2289
|
-
return /* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
/* @__PURE__ */
|
|
2293
|
-
/* @__PURE__ */
|
|
2294
|
-
/* @__PURE__ */
|
|
2295
|
-
/* @__PURE__ */
|
|
2424
|
+
return /* @__PURE__ */ jsxs19("div", { className: cn("space-y-4", className), children: [
|
|
2425
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between rounded-lg border border-border bg-card px-4 py-3", children: [
|
|
2426
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-3", children: [
|
|
2427
|
+
/* @__PURE__ */ jsx20(ShieldAlert, { className: "h-4 w-4 text-muted-foreground" }),
|
|
2428
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
2429
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm font-medium text-foreground", children: "Block Outbound Traffic" }),
|
|
2430
|
+
/* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground", children: "Prevent the sandbox from making external network requests" })
|
|
2296
2431
|
] })
|
|
2297
2432
|
] }),
|
|
2298
|
-
/* @__PURE__ */
|
|
2433
|
+
/* @__PURE__ */ jsx20(
|
|
2299
2434
|
"button",
|
|
2300
2435
|
{
|
|
2301
2436
|
type: "button",
|
|
@@ -2307,7 +2442,7 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2307
2442
|
"relative inline-flex h-6 w-11 items-center rounded-full transition-colors",
|
|
2308
2443
|
config.blockOutbound ? "bg-destructive" : "bg-muted"
|
|
2309
2444
|
),
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2445
|
+
children: /* @__PURE__ */ jsx20(
|
|
2311
2446
|
"span",
|
|
2312
2447
|
{
|
|
2313
2448
|
className: cn(
|
|
@@ -2319,22 +2454,22 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2319
2454
|
}
|
|
2320
2455
|
)
|
|
2321
2456
|
] }),
|
|
2322
|
-
/* @__PURE__ */
|
|
2323
|
-
/* @__PURE__ */
|
|
2324
|
-
config.allowList.length > 0 ? /* @__PURE__ */
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
2458
|
+
/* @__PURE__ */ jsx20("h4", { className: "text-xs font-medium text-muted-foreground mb-2 uppercase tracking-wider", children: "Allowlist (CIDR)" }),
|
|
2459
|
+
config.allowList.length > 0 ? /* @__PURE__ */ jsx20("div", { className: "space-y-1.5 mb-3", children: config.allowList.map((cidr) => /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between rounded border border-border bg-muted/20 px-3 py-2", children: [
|
|
2460
|
+
/* @__PURE__ */ jsx20("span", { className: "font-mono text-xs text-foreground", children: cidr }),
|
|
2461
|
+
/* @__PURE__ */ jsx20(
|
|
2327
2462
|
"button",
|
|
2328
2463
|
{
|
|
2329
2464
|
type: "button",
|
|
2330
2465
|
onClick: () => handleRemoveCidr(cidr),
|
|
2331
2466
|
className: "p-1 text-muted-foreground hover:text-destructive transition-colors rounded",
|
|
2332
|
-
children: /* @__PURE__ */
|
|
2467
|
+
children: /* @__PURE__ */ jsx20(Trash24, { className: "h-3 w-3" })
|
|
2333
2468
|
}
|
|
2334
2469
|
)
|
|
2335
|
-
] }, cidr)) }) : /* @__PURE__ */
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
/* @__PURE__ */
|
|
2470
|
+
] }, cidr)) }) : /* @__PURE__ */ jsx20("p", { className: "text-xs text-muted-foreground mb-3", children: "No CIDR rules configured. All traffic is allowed." }),
|
|
2471
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-3", children: [
|
|
2472
|
+
/* @__PURE__ */ jsx20(
|
|
2338
2473
|
"input",
|
|
2339
2474
|
{
|
|
2340
2475
|
type: "text",
|
|
@@ -2345,7 +2480,7 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2345
2480
|
className: "flex-1 rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2346
2481
|
}
|
|
2347
2482
|
),
|
|
2348
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ jsxs19(
|
|
2349
2484
|
"button",
|
|
2350
2485
|
{
|
|
2351
2486
|
type: "button",
|
|
@@ -2353,7 +2488,7 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2353
2488
|
disabled: !newCidr.trim(),
|
|
2354
2489
|
className: "inline-flex items-center gap-2 rounded-lg bg-primary/20 border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary hover:text-primary-foreground transition-colors disabled:opacity-50",
|
|
2355
2490
|
children: [
|
|
2356
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx20(Plus6, { className: "h-4 w-4" }),
|
|
2357
2492
|
"Add"
|
|
2358
2493
|
]
|
|
2359
2494
|
}
|
|
@@ -2364,9 +2499,9 @@ function NetworkConfig({ config, onUpdate, loading = false, className }) {
|
|
|
2364
2499
|
}
|
|
2365
2500
|
|
|
2366
2501
|
// src/dashboard/backend-config.tsx
|
|
2367
|
-
import * as
|
|
2502
|
+
import * as React10 from "react";
|
|
2368
2503
|
import { Bot, Plus as Plus7, RefreshCw as RefreshCw2, Trash2 as Trash25, Server, Wrench } from "lucide-react";
|
|
2369
|
-
import { Fragment as
|
|
2504
|
+
import { Fragment as Fragment11, jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
2370
2505
|
function BackendConfig({
|
|
2371
2506
|
status,
|
|
2372
2507
|
mcpServers,
|
|
@@ -2376,10 +2511,10 @@ function BackendConfig({
|
|
|
2376
2511
|
loading = false,
|
|
2377
2512
|
className
|
|
2378
2513
|
}) {
|
|
2379
|
-
const [showAddMcp, setShowAddMcp] =
|
|
2380
|
-
const [mcpName, setMcpName] =
|
|
2381
|
-
const [mcpCommand, setMcpCommand] =
|
|
2382
|
-
const [mcpArgs, setMcpArgs] =
|
|
2514
|
+
const [showAddMcp, setShowAddMcp] = React10.useState(false);
|
|
2515
|
+
const [mcpName, setMcpName] = React10.useState("");
|
|
2516
|
+
const [mcpCommand, setMcpCommand] = React10.useState("");
|
|
2517
|
+
const [mcpArgs, setMcpArgs] = React10.useState("");
|
|
2383
2518
|
const handleAddMcp = () => {
|
|
2384
2519
|
const name = mcpName.trim();
|
|
2385
2520
|
const command = mcpCommand.trim();
|
|
@@ -2396,91 +2531,91 @@ function BackendConfig({
|
|
|
2396
2531
|
}
|
|
2397
2532
|
};
|
|
2398
2533
|
if (loading || !status) {
|
|
2399
|
-
return /* @__PURE__ */
|
|
2400
|
-
/* @__PURE__ */
|
|
2401
|
-
/* @__PURE__ */
|
|
2534
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn("rounded-lg border border-border bg-muted/20 p-6 text-center", className), children: [
|
|
2535
|
+
/* @__PURE__ */ jsx21(Bot, { className: "mx-auto h-6 w-6 text-muted-foreground animate-pulse mb-2" }),
|
|
2536
|
+
/* @__PURE__ */ jsx21("p", { className: "text-sm text-muted-foreground", children: "Loading backend status..." })
|
|
2402
2537
|
] });
|
|
2403
2538
|
}
|
|
2404
|
-
return /* @__PURE__ */
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2408
|
-
/* @__PURE__ */
|
|
2539
|
+
return /* @__PURE__ */ jsxs20("div", { className: cn("space-y-4", className), children: [
|
|
2540
|
+
/* @__PURE__ */ jsxs20("div", { className: "rounded-lg border border-border bg-card overflow-hidden", children: [
|
|
2541
|
+
/* @__PURE__ */ jsxs20("div", { className: "px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between", children: [
|
|
2542
|
+
/* @__PURE__ */ jsx21("h4", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider", children: "Agent Status" }),
|
|
2543
|
+
/* @__PURE__ */ jsxs20(
|
|
2409
2544
|
"button",
|
|
2410
2545
|
{
|
|
2411
2546
|
type: "button",
|
|
2412
2547
|
onClick: onRestart,
|
|
2413
2548
|
className: "inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-foreground hover:bg-muted/80 transition-colors border border-border",
|
|
2414
2549
|
children: [
|
|
2415
|
-
/* @__PURE__ */
|
|
2550
|
+
/* @__PURE__ */ jsx21(RefreshCw2, { className: "h-3 w-3" }),
|
|
2416
2551
|
"Restart"
|
|
2417
2552
|
]
|
|
2418
2553
|
}
|
|
2419
2554
|
)
|
|
2420
2555
|
] }),
|
|
2421
|
-
/* @__PURE__ */
|
|
2422
|
-
/* @__PURE__ */
|
|
2423
|
-
/* @__PURE__ */
|
|
2556
|
+
/* @__PURE__ */ jsx21("div", { className: "p-4", children: /* @__PURE__ */ jsxs20("dl", { className: "grid grid-cols-[100px_1fr] gap-y-3 text-sm", children: [
|
|
2557
|
+
/* @__PURE__ */ jsx21("dt", { className: "text-muted-foreground", children: "Status" }),
|
|
2558
|
+
/* @__PURE__ */ jsx21("dd", { children: /* @__PURE__ */ jsx21("span", { className: cn(
|
|
2424
2559
|
"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider",
|
|
2425
2560
|
status.running ? "bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : "bg-destructive/10 text-destructive"
|
|
2426
2561
|
), children: status.running ? "Running" : "Stopped" }) }),
|
|
2427
|
-
/* @__PURE__ */
|
|
2428
|
-
/* @__PURE__ */
|
|
2429
|
-
status.provider && /* @__PURE__ */
|
|
2430
|
-
/* @__PURE__ */
|
|
2431
|
-
/* @__PURE__ */
|
|
2562
|
+
/* @__PURE__ */ jsx21("dt", { className: "text-muted-foreground", children: "Model" }),
|
|
2563
|
+
/* @__PURE__ */ jsx21("dd", { className: "font-mono text-xs", children: status.model ?? "Default" }),
|
|
2564
|
+
status.provider && /* @__PURE__ */ jsxs20(Fragment11, { children: [
|
|
2565
|
+
/* @__PURE__ */ jsx21("dt", { className: "text-muted-foreground", children: "Provider" }),
|
|
2566
|
+
/* @__PURE__ */ jsx21("dd", { className: "font-mono text-xs", children: status.provider })
|
|
2432
2567
|
] })
|
|
2433
2568
|
] }) })
|
|
2434
2569
|
] }),
|
|
2435
|
-
/* @__PURE__ */
|
|
2436
|
-
/* @__PURE__ */
|
|
2437
|
-
/* @__PURE__ */
|
|
2438
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ jsxs20("div", { className: "rounded-lg border border-border bg-card overflow-hidden", children: [
|
|
2571
|
+
/* @__PURE__ */ jsxs20("div", { className: "px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between", children: [
|
|
2572
|
+
/* @__PURE__ */ jsxs20("h4", { className: "text-xs font-medium text-muted-foreground uppercase tracking-wider flex items-center gap-2", children: [
|
|
2573
|
+
/* @__PURE__ */ jsx21(Wrench, { className: "h-3.5 w-3.5" }),
|
|
2439
2574
|
"MCP Servers"
|
|
2440
2575
|
] }),
|
|
2441
|
-
/* @__PURE__ */
|
|
2576
|
+
/* @__PURE__ */ jsxs20(
|
|
2442
2577
|
"button",
|
|
2443
2578
|
{
|
|
2444
2579
|
type: "button",
|
|
2445
2580
|
onClick: () => setShowAddMcp(!showAddMcp),
|
|
2446
2581
|
className: "inline-flex items-center gap-1.5 rounded-md bg-primary/20 border border-primary/30 px-2.5 py-1 text-xs font-medium text-primary hover:bg-primary hover:text-primary-foreground transition-colors",
|
|
2447
2582
|
children: [
|
|
2448
|
-
/* @__PURE__ */
|
|
2583
|
+
/* @__PURE__ */ jsx21(Plus7, { className: "h-3 w-3" }),
|
|
2449
2584
|
"Add"
|
|
2450
2585
|
]
|
|
2451
2586
|
}
|
|
2452
2587
|
)
|
|
2453
2588
|
] }),
|
|
2454
|
-
mcpServers.length > 0 ? /* @__PURE__ */
|
|
2455
|
-
/* @__PURE__ */
|
|
2456
|
-
/* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2589
|
+
mcpServers.length > 0 ? /* @__PURE__ */ jsx21("div", { className: "divide-y divide-border", children: mcpServers.map((s) => /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between px-4 py-3", children: [
|
|
2590
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
2591
|
+
/* @__PURE__ */ jsx21(Server, { className: "h-3.5 w-3.5 text-muted-foreground shrink-0" }),
|
|
2592
|
+
/* @__PURE__ */ jsxs20("div", { className: "min-w-0", children: [
|
|
2593
|
+
/* @__PURE__ */ jsx21("p", { className: "text-sm font-medium text-foreground truncate", children: s.name }),
|
|
2594
|
+
/* @__PURE__ */ jsxs20("p", { className: "text-xs font-mono text-muted-foreground truncate", children: [
|
|
2460
2595
|
s.command,
|
|
2461
2596
|
" ",
|
|
2462
2597
|
s.args?.join(" ") ?? ""
|
|
2463
2598
|
] })
|
|
2464
2599
|
] })
|
|
2465
2600
|
] }),
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
s.status && /* @__PURE__ */
|
|
2601
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
2602
|
+
s.status && /* @__PURE__ */ jsx21("span", { className: cn(
|
|
2468
2603
|
"inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-bold uppercase",
|
|
2469
2604
|
s.status === "running" ? "bg-[var(--surface-success-bg)] text-[var(--surface-success-text)]" : s.status === "error" ? "bg-destructive/10 text-destructive" : "bg-muted text-muted-foreground"
|
|
2470
2605
|
), children: s.status }),
|
|
2471
|
-
/* @__PURE__ */
|
|
2606
|
+
/* @__PURE__ */ jsx21(
|
|
2472
2607
|
"button",
|
|
2473
2608
|
{
|
|
2474
2609
|
type: "button",
|
|
2475
2610
|
onClick: () => onRemoveMcp(s.name),
|
|
2476
2611
|
className: "p-1 text-muted-foreground hover:text-destructive transition-colors rounded",
|
|
2477
|
-
children: /* @__PURE__ */
|
|
2612
|
+
children: /* @__PURE__ */ jsx21(Trash25, { className: "h-3.5 w-3.5" })
|
|
2478
2613
|
}
|
|
2479
2614
|
)
|
|
2480
2615
|
] })
|
|
2481
|
-
] }, s.name)) }) : /* @__PURE__ */
|
|
2482
|
-
showAddMcp && /* @__PURE__ */
|
|
2483
|
-
/* @__PURE__ */
|
|
2616
|
+
] }, s.name)) }) : /* @__PURE__ */ jsx21("div", { className: "p-4 text-center", children: /* @__PURE__ */ jsx21("p", { className: "text-xs text-muted-foreground", children: "No MCP servers configured" }) }),
|
|
2617
|
+
showAddMcp && /* @__PURE__ */ jsxs20("div", { className: "p-4 border-t border-border bg-muted/10 space-y-2", children: [
|
|
2618
|
+
/* @__PURE__ */ jsx21(
|
|
2484
2619
|
"input",
|
|
2485
2620
|
{
|
|
2486
2621
|
type: "text",
|
|
@@ -2490,7 +2625,7 @@ function BackendConfig({
|
|
|
2490
2625
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2491
2626
|
}
|
|
2492
2627
|
),
|
|
2493
|
-
/* @__PURE__ */
|
|
2628
|
+
/* @__PURE__ */ jsx21(
|
|
2494
2629
|
"input",
|
|
2495
2630
|
{
|
|
2496
2631
|
type: "text",
|
|
@@ -2500,7 +2635,7 @@ function BackendConfig({
|
|
|
2500
2635
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2501
2636
|
}
|
|
2502
2637
|
),
|
|
2503
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ jsx21(
|
|
2504
2639
|
"input",
|
|
2505
2640
|
{
|
|
2506
2641
|
type: "text",
|
|
@@ -2510,8 +2645,8 @@ function BackendConfig({
|
|
|
2510
2645
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm font-mono text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2511
2646
|
}
|
|
2512
2647
|
),
|
|
2513
|
-
/* @__PURE__ */
|
|
2514
|
-
/* @__PURE__ */
|
|
2648
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex justify-end gap-2 pt-1", children: [
|
|
2649
|
+
/* @__PURE__ */ jsx21(
|
|
2515
2650
|
"button",
|
|
2516
2651
|
{
|
|
2517
2652
|
type: "button",
|
|
@@ -2520,7 +2655,7 @@ function BackendConfig({
|
|
|
2520
2655
|
children: "Cancel"
|
|
2521
2656
|
}
|
|
2522
2657
|
),
|
|
2523
|
-
/* @__PURE__ */
|
|
2658
|
+
/* @__PURE__ */ jsx21(
|
|
2524
2659
|
"button",
|
|
2525
2660
|
{
|
|
2526
2661
|
type: "button",
|
|
@@ -2537,9 +2672,9 @@ function BackendConfig({
|
|
|
2537
2672
|
}
|
|
2538
2673
|
|
|
2539
2674
|
// src/dashboard/snapshot-list.tsx
|
|
2540
|
-
import * as
|
|
2675
|
+
import * as React11 from "react";
|
|
2541
2676
|
import { Camera, Clock as Clock5, HardDrive, Plus as Plus8, RotateCcw } from "lucide-react";
|
|
2542
|
-
import { jsx as
|
|
2677
|
+
import { jsx as jsx22, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2543
2678
|
function formatBytes(bytes) {
|
|
2544
2679
|
if (bytes == null || bytes < 0) return "-";
|
|
2545
2680
|
if (bytes === 0) return "0 B";
|
|
@@ -2554,33 +2689,33 @@ function formatDate(dateStr) {
|
|
|
2554
2689
|
return d.toLocaleDateString(void 0, { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
|
2555
2690
|
}
|
|
2556
2691
|
function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loading = false, className }) {
|
|
2557
|
-
const [showCreate, setShowCreate] =
|
|
2558
|
-
const [tags, setTags] =
|
|
2692
|
+
const [showCreate, setShowCreate] = React11.useState(false);
|
|
2693
|
+
const [tags, setTags] = React11.useState("");
|
|
2559
2694
|
const handleCreate = () => {
|
|
2560
2695
|
const tagList = tags.trim() ? tags.trim().split(",").map((t) => t.trim()).filter(Boolean) : void 0;
|
|
2561
2696
|
onCreate(tagList);
|
|
2562
2697
|
setTags("");
|
|
2563
2698
|
setShowCreate(false);
|
|
2564
2699
|
};
|
|
2565
|
-
return /* @__PURE__ */
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2700
|
+
return /* @__PURE__ */ jsxs21("div", { className: cn("space-y-4", className), children: [
|
|
2701
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
2702
|
+
/* @__PURE__ */ jsx22("h3", { className: "text-sm font-bold text-foreground", children: "Snapshots" }),
|
|
2703
|
+
/* @__PURE__ */ jsxs21(
|
|
2569
2704
|
"button",
|
|
2570
2705
|
{
|
|
2571
2706
|
type: "button",
|
|
2572
2707
|
onClick: () => setShowCreate(!showCreate),
|
|
2573
2708
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-primary/20 border border-primary/30 px-3 py-1.5 text-xs font-medium text-primary hover:bg-primary hover:text-primary-foreground transition-colors",
|
|
2574
2709
|
children: [
|
|
2575
|
-
/* @__PURE__ */
|
|
2710
|
+
/* @__PURE__ */ jsx22(Plus8, { className: "h-3.5 w-3.5" }),
|
|
2576
2711
|
"Create Snapshot"
|
|
2577
2712
|
]
|
|
2578
2713
|
}
|
|
2579
2714
|
)
|
|
2580
2715
|
] }),
|
|
2581
|
-
showCreate && /* @__PURE__ */
|
|
2582
|
-
/* @__PURE__ */
|
|
2583
|
-
/* @__PURE__ */
|
|
2716
|
+
showCreate && /* @__PURE__ */ jsxs21("div", { className: "rounded-lg border border-primary/20 bg-primary/5 p-4 space-y-3", children: [
|
|
2717
|
+
/* @__PURE__ */ jsx22("p", { className: "text-sm text-foreground font-medium", children: "Create a new snapshot of the current sandbox state." }),
|
|
2718
|
+
/* @__PURE__ */ jsx22(
|
|
2584
2719
|
"input",
|
|
2585
2720
|
{
|
|
2586
2721
|
type: "text",
|
|
@@ -2591,8 +2726,8 @@ function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loadin
|
|
|
2591
2726
|
className: "w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
2592
2727
|
}
|
|
2593
2728
|
),
|
|
2594
|
-
/* @__PURE__ */
|
|
2595
|
-
/* @__PURE__ */
|
|
2729
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-end gap-2", children: [
|
|
2730
|
+
/* @__PURE__ */ jsx22(
|
|
2596
2731
|
"button",
|
|
2597
2732
|
{
|
|
2598
2733
|
type: "button",
|
|
@@ -2601,44 +2736,44 @@ function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loadin
|
|
|
2601
2736
|
children: "Cancel"
|
|
2602
2737
|
}
|
|
2603
2738
|
),
|
|
2604
|
-
/* @__PURE__ */
|
|
2739
|
+
/* @__PURE__ */ jsxs21(
|
|
2605
2740
|
"button",
|
|
2606
2741
|
{
|
|
2607
2742
|
type: "button",
|
|
2608
2743
|
onClick: handleCreate,
|
|
2609
2744
|
className: "rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 transition-colors",
|
|
2610
2745
|
children: [
|
|
2611
|
-
/* @__PURE__ */
|
|
2746
|
+
/* @__PURE__ */ jsx22(Camera, { className: "h-3 w-3 mr-1.5 inline" }),
|
|
2612
2747
|
"Create"
|
|
2613
2748
|
]
|
|
2614
2749
|
}
|
|
2615
2750
|
)
|
|
2616
2751
|
] })
|
|
2617
2752
|
] }),
|
|
2618
|
-
loading ? /* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2620
|
-
/* @__PURE__ */
|
|
2621
|
-
] }) : snapshots.length > 0 ? /* @__PURE__ */
|
|
2622
|
-
/* @__PURE__ */
|
|
2623
|
-
/* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
/* @__PURE__ */
|
|
2753
|
+
loading ? /* @__PURE__ */ jsxs21("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
|
|
2754
|
+
/* @__PURE__ */ jsx22(Camera, { className: "mx-auto h-6 w-6 text-muted-foreground animate-pulse mb-2" }),
|
|
2755
|
+
/* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground", children: "Loading snapshots..." })
|
|
2756
|
+
] }) : snapshots.length > 0 ? /* @__PURE__ */ jsx22("div", { className: "rounded-lg border border-border overflow-hidden", children: /* @__PURE__ */ jsxs21("table", { className: "w-full text-sm", children: [
|
|
2757
|
+
/* @__PURE__ */ jsx22("thead", { className: "bg-muted/30 border-b border-border", children: /* @__PURE__ */ jsxs21("tr", { children: [
|
|
2758
|
+
/* @__PURE__ */ jsx22("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "ID" }),
|
|
2759
|
+
/* @__PURE__ */ jsx22("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Created" }),
|
|
2760
|
+
/* @__PURE__ */ jsx22("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Size" }),
|
|
2761
|
+
/* @__PURE__ */ jsx22("th", { className: "px-4 py-2.5 text-left text-xs font-medium text-muted-foreground", children: "Tags" }),
|
|
2762
|
+
/* @__PURE__ */ jsx22("th", { className: "px-4 py-2.5 text-right text-xs font-medium text-muted-foreground w-24" })
|
|
2628
2763
|
] }) }),
|
|
2629
|
-
/* @__PURE__ */
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2632
|
-
/* @__PURE__ */
|
|
2764
|
+
/* @__PURE__ */ jsx22("tbody", { className: "divide-y divide-border", children: snapshots.map((s) => /* @__PURE__ */ jsxs21("tr", { children: [
|
|
2765
|
+
/* @__PURE__ */ jsx22("td", { className: "px-4 py-3 font-mono text-xs text-foreground", children: s.id.slice(0, 12) }),
|
|
2766
|
+
/* @__PURE__ */ jsx22("td", { className: "px-4 py-3 text-xs text-muted-foreground", children: /* @__PURE__ */ jsxs21("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
2767
|
+
/* @__PURE__ */ jsx22(Clock5, { className: "h-3 w-3" }),
|
|
2633
2768
|
formatDate(s.createdAt)
|
|
2634
2769
|
] }) }),
|
|
2635
|
-
/* @__PURE__ */
|
|
2636
|
-
/* @__PURE__ */
|
|
2770
|
+
/* @__PURE__ */ jsx22("td", { className: "px-4 py-3 text-xs text-muted-foreground", children: /* @__PURE__ */ jsxs21("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
2771
|
+
/* @__PURE__ */ jsx22(HardDrive, { className: "h-3 w-3" }),
|
|
2637
2772
|
formatBytes(s.sizeBytes)
|
|
2638
2773
|
] }) }),
|
|
2639
|
-
/* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ jsx22("td", { className: "px-4 py-3", children: s.tags?.length ? /* @__PURE__ */ jsx22("div", { className: "flex items-center gap-1 flex-wrap", children: s.tags.map((tag) => /* @__PURE__ */ jsx22("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground border border-border", children: tag }, tag)) }) : /* @__PURE__ */ jsx22("span", { className: "text-xs text-muted-foreground", children: "-" }) }),
|
|
2775
|
+
/* @__PURE__ */ jsx22("td", { className: "px-4 py-3 text-right", children: /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-end gap-2", children: [
|
|
2776
|
+
/* @__PURE__ */ jsxs21(
|
|
2642
2777
|
"button",
|
|
2643
2778
|
{
|
|
2644
2779
|
type: "button",
|
|
@@ -2646,12 +2781,12 @@ function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loadin
|
|
|
2646
2781
|
className: "inline-flex items-center gap-1.5 rounded-md bg-muted px-2.5 py-1 text-xs font-medium text-foreground hover:bg-muted/80 transition-colors border border-border",
|
|
2647
2782
|
title: "Restore to new sandbox",
|
|
2648
2783
|
children: [
|
|
2649
|
-
/* @__PURE__ */
|
|
2784
|
+
/* @__PURE__ */ jsx22(RotateCcw, { className: "h-3 w-3" }),
|
|
2650
2785
|
"Restore"
|
|
2651
2786
|
]
|
|
2652
2787
|
}
|
|
2653
2788
|
),
|
|
2654
|
-
onSaveAsTemplate && /* @__PURE__ */
|
|
2789
|
+
onSaveAsTemplate && /* @__PURE__ */ jsx22(
|
|
2655
2790
|
"button",
|
|
2656
2791
|
{
|
|
2657
2792
|
type: "button",
|
|
@@ -2663,16 +2798,16 @@ function SnapshotList({ snapshots, onCreate, onRestore, onSaveAsTemplate, loadin
|
|
|
2663
2798
|
)
|
|
2664
2799
|
] }) })
|
|
2665
2800
|
] }, s.id)) })
|
|
2666
|
-
] }) }) : /* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2668
|
-
/* @__PURE__ */
|
|
2669
|
-
/* @__PURE__ */
|
|
2801
|
+
] }) }) : /* @__PURE__ */ jsxs21("div", { className: "rounded-lg border border-border bg-muted/20 p-6 text-center", children: [
|
|
2802
|
+
/* @__PURE__ */ jsx22(Camera, { className: "mx-auto h-8 w-8 text-muted-foreground mb-2" }),
|
|
2803
|
+
/* @__PURE__ */ jsx22("p", { className: "text-sm text-muted-foreground", children: "No snapshots yet" }),
|
|
2804
|
+
/* @__PURE__ */ jsx22("p", { className: "text-xs text-muted-foreground mt-1", children: "Create a snapshot to save the current state of your sandbox." })
|
|
2670
2805
|
] })
|
|
2671
2806
|
] });
|
|
2672
2807
|
}
|
|
2673
2808
|
|
|
2674
2809
|
// src/dashboard/promo-banner.tsx
|
|
2675
|
-
import { Fragment as
|
|
2810
|
+
import { Fragment as Fragment12, jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2676
2811
|
function PromoBanner({
|
|
2677
2812
|
title,
|
|
2678
2813
|
description,
|
|
@@ -2687,21 +2822,21 @@ function PromoBanner({
|
|
|
2687
2822
|
"mt-6 inline-flex items-center gap-2 rounded-md border border-white/20 bg-[var(--btn-primary-bg)] px-4 py-2 text-sm font-medium text-[var(--btn-primary-text)] transition-colors",
|
|
2688
2823
|
disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-[var(--btn-primary-hover)]"
|
|
2689
2824
|
);
|
|
2690
|
-
const buttonContent = /* @__PURE__ */
|
|
2825
|
+
const buttonContent = /* @__PURE__ */ jsxs22(Fragment12, { children: [
|
|
2691
2826
|
buttonLabel,
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
/* @__PURE__ */
|
|
2694
|
-
/* @__PURE__ */
|
|
2827
|
+
/* @__PURE__ */ jsxs22("svg", { "aria-hidden": "true", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "h-4 w-4", children: [
|
|
2828
|
+
/* @__PURE__ */ jsx23("path", { d: "M5 12h14" }),
|
|
2829
|
+
/* @__PURE__ */ jsx23("path", { d: "m12 5 7 7-7 7" })
|
|
2695
2830
|
] })
|
|
2696
2831
|
] });
|
|
2697
|
-
return /* @__PURE__ */
|
|
2698
|
-
/* @__PURE__ */
|
|
2699
|
-
/* @__PURE__ */
|
|
2700
|
-
/* @__PURE__ */
|
|
2701
|
-
href && !disabled ? /* @__PURE__ */
|
|
2832
|
+
return /* @__PURE__ */ jsxs22("div", { className: cn("relative overflow-hidden rounded-xl bg-[var(--brand-strong)] p-8 md:flex md:items-center md:justify-between", className), children: [
|
|
2833
|
+
/* @__PURE__ */ jsxs22("div", { className: "relative z-10", children: [
|
|
2834
|
+
/* @__PURE__ */ jsx23("h3", { className: "text-xl font-bold text-[var(--brand-strong-text)]", children: title }),
|
|
2835
|
+
/* @__PURE__ */ jsx23("p", { className: "mt-2 max-w-md text-sm text-[var(--brand-strong-text-muted)]", children: description }),
|
|
2836
|
+
href && !disabled ? /* @__PURE__ */ jsx23("a", { href, target: "_blank", rel: "noopener noreferrer", onClick, className: buttonClasses, children: buttonContent }) : /* @__PURE__ */ jsx23("button", { type: "button", onClick, disabled, className: buttonClasses, children: buttonContent })
|
|
2702
2837
|
] }),
|
|
2703
|
-
icon && /* @__PURE__ */
|
|
2704
|
-
/* @__PURE__ */
|
|
2838
|
+
icon && /* @__PURE__ */ jsx23("div", { className: "relative z-10 mt-6 flex items-center md:mt-0", children: /* @__PURE__ */ jsx23("div", { className: "flex h-16 w-16 items-center justify-center rounded-2xl border border-white/10 bg-white/10", children: icon }) }),
|
|
2839
|
+
/* @__PURE__ */ jsx23("div", { className: "pointer-events-none absolute inset-y-0 right-0 w-1/3 bg-gradient-to-l from-white/5 to-transparent" })
|
|
2705
2840
|
] });
|
|
2706
2841
|
}
|
|
2707
2842
|
|
|
@@ -2740,6 +2875,7 @@ export {
|
|
|
2740
2875
|
DashboardLayout,
|
|
2741
2876
|
ProfileSelector,
|
|
2742
2877
|
ProfileComparison,
|
|
2878
|
+
MetricAreaChart,
|
|
2743
2879
|
VariantList,
|
|
2744
2880
|
SystemLogsViewer,
|
|
2745
2881
|
UsageSummary,
|