@tscircuit/runframe 0.0.584 → 0.0.586

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/runner.js CHANGED
@@ -4,6 +4,12 @@ import {
4
4
  Button,
5
5
  CadViewer,
6
6
  CircuitJsonPreview,
7
+ Dialog,
8
+ DialogContent,
9
+ DialogDescription,
10
+ DialogFooter,
11
+ DialogHeader,
12
+ DialogTitle,
7
13
  DropdownMenu,
8
14
  DropdownMenuContent,
9
15
  DropdownMenuItem,
@@ -22,13 +28,15 @@ import {
22
28
  buttonVariants,
23
29
  cn,
24
30
  debug_default,
31
+ getRegistryKy,
32
+ hasRegistryToken,
25
33
  linkify,
26
34
  registryKy,
27
35
  toast,
28
36
  useOrderDialog,
29
37
  useOrderDialogCli,
30
38
  useRunFrameStore
31
- } from "./chunk-EN6ZVHVR.js";
39
+ } from "./chunk-B4J62OKU.js";
32
40
 
33
41
  // lib/components/RunFrame/RunFrame.tsx
34
42
  import { createCircuitWebWorker } from "@tscircuit/eval/worker";
@@ -727,7 +735,7 @@ function useLocalStorageState(key, initialValue) {
727
735
  }
728
736
 
729
737
  // lib/components/RunFrameForCli/LeftHeader.tsx
730
- import { useEffect as useEffect8, useMemo as useMemo2, useState as useState6 } from "react";
738
+ import { useEffect as useEffect10, useMemo as useMemo3, useState as useState9 } from "react";
731
739
 
732
740
  // lib/components/RunFrameForCli/SelectSnippetDialog.tsx
733
741
  import { useState as useState4 } from "react";
@@ -1489,6 +1497,210 @@ var exportAndDownload = async ({
1489
1497
  throw new Error(`Unsupported export type: "${exportName}"`);
1490
1498
  };
1491
1499
 
1500
+ // lib/components/AiReviewDialog/AiReviewDialog.tsx
1501
+ import { useState as useState8 } from "react";
1502
+
1503
+ // lib/components/AiReviewDialog/ListAiReviewsView.tsx
1504
+ import { useEffect as useEffect8, useState as useState6 } from "react";
1505
+ import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1506
+ var AiReviewListView = ({
1507
+ packageName,
1508
+ onSelectReview
1509
+ }) => {
1510
+ const fsMap = useRunFrameStore((s) => s.fsMap);
1511
+ const circuitJson = useRunFrameStore((s) => s.circuitJson);
1512
+ const [reviews, setReviews] = useState6([]);
1513
+ const [loading, setLoading] = useState6(false);
1514
+ const [creating, setCreating] = useState6(false);
1515
+ useEffect8(() => {
1516
+ if (!packageName || !hasRegistryToken()) return;
1517
+ setLoading(true);
1518
+ registryKy.get("ai_reviews/list", { searchParams: { package_name: packageName } }).json().then((data) => setReviews(data.ai_reviews)).catch((err) => {
1519
+ console.error("Failed to load AI reviews", err);
1520
+ toast.error("Failed to load AI reviews");
1521
+ }).finally(() => setLoading(false));
1522
+ }, [packageName]);
1523
+ const requestReview = async () => {
1524
+ if (!circuitJson) {
1525
+ toast.error("Need Circuit JSON to Request AI Review");
1526
+ return;
1527
+ }
1528
+ if (!hasRegistryToken()) {
1529
+ toast.error("Missing registry token");
1530
+ return;
1531
+ }
1532
+ setCreating(true);
1533
+ try {
1534
+ const { ai_review } = await registryKy.post("ai_reviews/create", {
1535
+ json: {
1536
+ package_name: packageName ?? "unknown",
1537
+ fs_map: Object.fromEntries(fsMap),
1538
+ circuit_json: circuitJson
1539
+ }
1540
+ }).json();
1541
+ setReviews((r) => [ai_review, ...r]);
1542
+ onSelectReview(ai_review);
1543
+ toast.success("AI review requested");
1544
+ } catch (err) {
1545
+ console.error("Failed to create AI review", err);
1546
+ toast.error("Failed to request AI review");
1547
+ } finally {
1548
+ setCreating(false);
1549
+ }
1550
+ };
1551
+ return /* @__PURE__ */ jsxs5(Fragment2, { children: [
1552
+ /* @__PURE__ */ jsxs5(DialogHeader, { children: [
1553
+ /* @__PURE__ */ jsx8(DialogTitle, { children: "AI Review" }),
1554
+ /* @__PURE__ */ jsx8(DialogDescription, { children: "Select an AI review or request a new one." })
1555
+ ] }),
1556
+ /* @__PURE__ */ jsx8("div", { className: "rf-flex rf-gap-4 rf-mt-4", children: /* @__PURE__ */ jsx8("div", { className: "rf-w-48 rf-h-64 rf-overflow-y-auto rf-border rf-rounded rf-p-2 rf-flex-shrink-0", children: loading ? /* @__PURE__ */ jsx8("div", { className: "rf-text-sm", children: "Loading..." }) : reviews.length > 0 ? reviews.map((review) => /* @__PURE__ */ jsx8(
1557
+ "div",
1558
+ {
1559
+ className: "rf-text-sm rf-p-2 rf-cursor-pointer rf-rounded hover:rf-bg-zinc-100",
1560
+ onClick: () => onSelectReview(review),
1561
+ children: new Date(review.created_at || "").toLocaleString()
1562
+ },
1563
+ review.ai_review_id
1564
+ )) : /* @__PURE__ */ jsx8("div", { className: "rf-text-sm rf-text-muted-foreground", children: "No AI reviews found." }) }) }),
1565
+ /* @__PURE__ */ jsx8(DialogFooter, { className: "rf-mt-4", children: /* @__PURE__ */ jsx8(Button, { onClick: requestReview, disabled: creating, children: creating ? "Requesting..." : "Review my Board" }) })
1566
+ ] });
1567
+ };
1568
+
1569
+ // lib/components/AiReviewDialog/ViewAiReviewView.tsx
1570
+ import { useEffect as useEffect9, useMemo as useMemo2, useState as useState7 } from "react";
1571
+ import { marked } from "marked";
1572
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
1573
+ var AiReviewViewView = ({
1574
+ review,
1575
+ onBack
1576
+ }) => {
1577
+ const [aiReviewText, setAiReviewText] = useState7(
1578
+ review.ai_review_text ?? null
1579
+ );
1580
+ const registryKy2 = getRegistryKy();
1581
+ const aiReviewId = review.ai_review_id;
1582
+ useEffect9(() => {
1583
+ if (!aiReviewId) return;
1584
+ let timeout;
1585
+ async function loadAiReviewText() {
1586
+ try {
1587
+ const response = await registryKy2.get(
1588
+ "ai_reviews/get",
1589
+ {
1590
+ searchParams: { ai_review_id: aiReviewId }
1591
+ }
1592
+ );
1593
+ const { ai_review: newAiReview } = await response.json();
1594
+ if (newAiReview.ai_review_text) {
1595
+ setAiReviewText(newAiReview.ai_review_text);
1596
+ return;
1597
+ }
1598
+ } catch (e) {
1599
+ console.error("Failed to load AI review text", e);
1600
+ }
1601
+ timeout = setTimeout(loadAiReviewText, 1e3);
1602
+ }
1603
+ timeout = setTimeout(loadAiReviewText, 1e3);
1604
+ return () => clearTimeout(timeout);
1605
+ }, [aiReviewId]);
1606
+ const html = useMemo2(
1607
+ () => marked.parse(review.ai_review_text || ""),
1608
+ [review.ai_review_text]
1609
+ );
1610
+ return /* @__PURE__ */ jsxs6(Fragment3, { children: [
1611
+ /* @__PURE__ */ jsxs6(DialogHeader, { className: "rf-flex rf-flex-row rf-items-center rf-justify-between", children: [
1612
+ /* @__PURE__ */ jsx9(Button, { variant: "ghost", size: "sm", onClick: onBack, children: "Back" }),
1613
+ /* @__PURE__ */ jsx9(DialogTitle, { children: "AI Review" })
1614
+ ] }),
1615
+ aiReviewText ? /* @__PURE__ */ jsx9(
1616
+ "div",
1617
+ {
1618
+ className: "rf-h-64 rf-overflow-y-auto rf-prose rf-max-w-none rf-mt-2",
1619
+ dangerouslySetInnerHTML: { __html: html }
1620
+ }
1621
+ ) : /* @__PURE__ */ jsx9("div", { className: "rf-h-64 rf-overflow-y-auto rf-prose rf-max-w-none rf-mt-2", children: /* @__PURE__ */ jsxs6("div", { className: "rf-flex rf-items-center rf-justify-center rf-h-full", children: [
1622
+ /* @__PURE__ */ jsxs6(
1623
+ "svg",
1624
+ {
1625
+ className: "rf-animate-spin rf-h-6 rf-w-6 rf-text-zinc-400 rf-mr-2",
1626
+ xmlns: "http://www.w3.org/2000/svg",
1627
+ fill: "none",
1628
+ viewBox: "0 0 24 24",
1629
+ "aria-hidden": "true",
1630
+ children: [
1631
+ /* @__PURE__ */ jsx9(
1632
+ "circle",
1633
+ {
1634
+ className: "rf-opacity-25",
1635
+ cx: "12",
1636
+ cy: "12",
1637
+ r: "10",
1638
+ stroke: "currentColor",
1639
+ strokeWidth: "4"
1640
+ }
1641
+ ),
1642
+ /* @__PURE__ */ jsx9(
1643
+ "path",
1644
+ {
1645
+ className: "rf-opacity-75",
1646
+ fill: "currentColor",
1647
+ d: "M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
1648
+ }
1649
+ )
1650
+ ]
1651
+ }
1652
+ ),
1653
+ /* @__PURE__ */ jsx9("span", { children: "Loading..." })
1654
+ ] }) })
1655
+ ] });
1656
+ };
1657
+
1658
+ // lib/components/AiReviewDialog/AiReviewDialog.tsx
1659
+ import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
1660
+ var AiReviewDialog = ({
1661
+ isOpen,
1662
+ onClose,
1663
+ packageName
1664
+ }) => {
1665
+ const [stage, setStage] = useState8(
1666
+ "list_reviews"
1667
+ );
1668
+ const [selectedReview, setSelectedReview] = useState8(null);
1669
+ const handleSelect = (review) => {
1670
+ setSelectedReview(review);
1671
+ setStage("view_review");
1672
+ };
1673
+ return /* @__PURE__ */ jsx10(
1674
+ Dialog,
1675
+ {
1676
+ open: isOpen,
1677
+ onOpenChange: (open) => {
1678
+ if (!open) {
1679
+ setStage("list_reviews");
1680
+ setSelectedReview(null);
1681
+ onClose();
1682
+ }
1683
+ },
1684
+ children: /* @__PURE__ */ jsxs7(DialogContent, { className: "rf-max-w-2xl", children: [
1685
+ stage === "list_reviews" && /* @__PURE__ */ jsx10(
1686
+ AiReviewListView,
1687
+ {
1688
+ packageName,
1689
+ onSelectReview: handleSelect
1690
+ }
1691
+ ),
1692
+ stage === "view_review" && selectedReview && /* @__PURE__ */ jsx10(
1693
+ AiReviewViewView,
1694
+ {
1695
+ review: selectedReview,
1696
+ onBack: () => setStage("list_reviews")
1697
+ }
1698
+ )
1699
+ ] })
1700
+ }
1701
+ );
1702
+ };
1703
+
1492
1704
  // lib/components/RunFrameForCli/LeftHeader.tsx
1493
1705
  import { Toaster } from "react-hot-toast";
1494
1706
 
@@ -1530,30 +1742,30 @@ var importComponentFromJlcpcb = async (jlcpcbPartNumber) => {
1530
1742
  };
1531
1743
 
1532
1744
  // lib/components/RunFrameForCli/LeftHeader.tsx
1533
- import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
1745
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
1534
1746
  var RunframeCliLeftHeader = (props) => {
1535
1747
  const lastRunEvalVersion = useRunnerStore((s) => s.lastRunEvalVersion);
1536
- const [snippetName, setSnippetName] = useState6(null);
1537
- const [hasUnsavedChanges, setHasUnsavedChanges] = useState6(false);
1538
- const [hasNeverBeenSaved, setHasNeverBeenSaved] = useState6(true);
1539
- const [isSaving, setIsSaving] = useState6(false);
1540
- const [requestToSaveSentAt, setRequestToSaveSentAt] = useState6(
1748
+ const [snippetName, setSnippetName] = useState9(null);
1749
+ const [hasUnsavedChanges, setHasUnsavedChanges] = useState9(false);
1750
+ const [hasNeverBeenSaved, setHasNeverBeenSaved] = useState9(true);
1751
+ const [isSaving, setIsSaving] = useState9(false);
1752
+ const [requestToSaveSentAt, setRequestToSaveSentAt] = useState9(
1541
1753
  null
1542
1754
  );
1543
- const [availableSnippets, setAvailableSnippets] = useState6(
1755
+ const [availableSnippets, setAvailableSnippets] = useState9(
1544
1756
  null
1545
1757
  );
1546
- const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState6(false);
1547
- const [notificationMessage, setNotificationMessage] = useState6(
1758
+ const [isSelectSnippetDialogOpen, setIsSelectSnippetDialogOpen] = useState9(false);
1759
+ const [notificationMessage, setNotificationMessage] = useState9(
1548
1760
  null
1549
1761
  );
1550
- const [errorMessage, setErrorMessage] = useState6(null);
1551
- const [isError, setIsError] = useState6(false);
1552
- const [isExporting, setisExporting] = useState6(false);
1762
+ const [errorMessage, setErrorMessage] = useState9(null);
1763
+ const [isError, setIsError] = useState9(false);
1764
+ const [isExporting, setisExporting] = useState9(false);
1553
1765
  const orderDialog = useOrderDialogCli();
1554
1766
  const pushEvent = useRunFrameStore((state) => state.pushEvent);
1555
1767
  const recentEvents = useRunFrameStore((state) => state.recentEvents);
1556
- const firstRenderTime = useMemo2(() => Date.now(), []);
1768
+ const firstRenderTime = useMemo3(() => Date.now(), []);
1557
1769
  useEventHandler((event) => {
1558
1770
  if (new Date(event.created_at).valueOf() < firstRenderTime + 500) return;
1559
1771
  if (event.event_type === "FILE_UPDATED") {
@@ -1578,7 +1790,7 @@ var RunframeCliLeftHeader = (props) => {
1578
1790
  setisExporting(false);
1579
1791
  }
1580
1792
  });
1581
- useEffect8(() => {
1793
+ useEffect10(() => {
1582
1794
  if (!isSaving || requestToSaveSentAt === null) return;
1583
1795
  const eventsSinceRequestToSave = recentEvents.filter(
1584
1796
  (event) => new Date(event.created_at).valueOf() > requestToSaveSentAt
@@ -1620,12 +1832,13 @@ var RunframeCliLeftHeader = (props) => {
1620
1832
  });
1621
1833
  };
1622
1834
  const circuitJson = useRunFrameStore((state) => state.circuitJson);
1623
- const [isImportDialogOpen, setIsImportDialogOpen] = useState6(false);
1624
- return /* @__PURE__ */ jsxs5(Fragment2, { children: [
1625
- /* @__PURE__ */ jsxs5(DropdownMenu, { children: [
1626
- /* @__PURE__ */ jsx8(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx8("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
1627
- /* @__PURE__ */ jsxs5(DropdownMenuContent, { children: [
1628
- /* @__PURE__ */ jsx8(
1835
+ const [isImportDialogOpen, setIsImportDialogOpen] = useState9(false);
1836
+ const [isAiReviewDialogOpen, setIsAiReviewDialogOpen] = useState9(false);
1837
+ return /* @__PURE__ */ jsxs8(Fragment4, { children: [
1838
+ /* @__PURE__ */ jsxs8(DropdownMenu, { children: [
1839
+ /* @__PURE__ */ jsx11(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx11("div", { className: "rf-whitespace-nowrap rf-text-xs font-medium rf-p-2 rf-mx-1 rf-cursor-pointer rf-relative", children: "File" }) }),
1840
+ /* @__PURE__ */ jsxs8(DropdownMenuContent, { children: [
1841
+ /* @__PURE__ */ jsx11(
1629
1842
  DropdownMenuItem,
1630
1843
  {
1631
1844
  className: "rf-text-xs",
@@ -1634,7 +1847,7 @@ var RunframeCliLeftHeader = (props) => {
1634
1847
  children: isSaving ? "Saving..." : "Push"
1635
1848
  }
1636
1849
  ),
1637
- parseInt(window.location.port) > 5e3 && /* @__PURE__ */ jsx8(
1850
+ parseInt(window.location.port) > 5e3 && /* @__PURE__ */ jsx11(
1638
1851
  DropdownMenuItem,
1639
1852
  {
1640
1853
  className: "rf-text-xs",
@@ -1644,7 +1857,7 @@ var RunframeCliLeftHeader = (props) => {
1644
1857
  children: "Order"
1645
1858
  }
1646
1859
  ),
1647
- /* @__PURE__ */ jsx8(
1860
+ /* @__PURE__ */ jsx11(
1648
1861
  DropdownMenuItem,
1649
1862
  {
1650
1863
  className: "rf-text-xs",
@@ -1653,8 +1866,22 @@ var RunframeCliLeftHeader = (props) => {
1653
1866
  children: "Import"
1654
1867
  }
1655
1868
  ),
1656
- /* @__PURE__ */ jsxs5(DropdownMenuSub, { children: [
1657
- /* @__PURE__ */ jsx8(
1869
+ /* @__PURE__ */ jsx11(
1870
+ DropdownMenuItem,
1871
+ {
1872
+ className: "rf-text-xs",
1873
+ onSelect: () => {
1874
+ if (!hasRegistryToken()) {
1875
+ toast.error("Requires tscircuit token");
1876
+ return;
1877
+ }
1878
+ setIsAiReviewDialogOpen(true);
1879
+ },
1880
+ children: "AI Review"
1881
+ }
1882
+ ),
1883
+ /* @__PURE__ */ jsxs8(DropdownMenuSub, { children: [
1884
+ /* @__PURE__ */ jsx11(
1658
1885
  DropdownMenuSubTrigger,
1659
1886
  {
1660
1887
  className: "rf-text-xs",
@@ -1662,7 +1889,7 @@ var RunframeCliLeftHeader = (props) => {
1662
1889
  children: isExporting ? "Exporting..." : "Export"
1663
1890
  }
1664
1891
  ),
1665
- /* @__PURE__ */ jsx8(DropdownMenuPortal, { children: /* @__PURE__ */ jsx8(DropdownMenuSubContent, { children: availableExports.map((exp, i) => /* @__PURE__ */ jsx8(
1892
+ /* @__PURE__ */ jsx11(DropdownMenuPortal, { children: /* @__PURE__ */ jsx11(DropdownMenuSubContent, { children: availableExports.map((exp, i) => /* @__PURE__ */ jsx11(
1666
1893
  DropdownMenuItem,
1667
1894
  {
1668
1895
  onSelect: () => {
@@ -1677,16 +1904,16 @@ var RunframeCliLeftHeader = (props) => {
1677
1904
  });
1678
1905
  },
1679
1906
  disabled: isExporting,
1680
- children: /* @__PURE__ */ jsx8("span", { className: "rf-text-xs", children: exp.name })
1907
+ children: /* @__PURE__ */ jsx11("span", { className: "rf-text-xs", children: exp.name })
1681
1908
  },
1682
1909
  i
1683
1910
  )) }) })
1684
1911
  ] }),
1685
- /* @__PURE__ */ jsxs5(DropdownMenuSub, { children: [
1686
- /* @__PURE__ */ jsx8(DropdownMenuSubTrigger, { className: "rf-text-xs", children: "Advanced" }),
1687
- /* @__PURE__ */ jsx8(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs5(DropdownMenuSubContent, { children: [
1688
- /* @__PURE__ */ jsx8(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs5("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
1689
- /* @__PURE__ */ jsx8(
1912
+ /* @__PURE__ */ jsxs8(DropdownMenuSub, { children: [
1913
+ /* @__PURE__ */ jsx11(DropdownMenuSubTrigger, { className: "rf-text-xs", children: "Advanced" }),
1914
+ /* @__PURE__ */ jsx11(DropdownMenuPortal, { children: /* @__PURE__ */ jsxs8(DropdownMenuSubContent, { children: [
1915
+ /* @__PURE__ */ jsx11(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs8("div", { className: "rf-flex rf-items-center rf-gap-2", children: [
1916
+ /* @__PURE__ */ jsx11(
1690
1917
  Checkbox,
1691
1918
  {
1692
1919
  id: "load-latest-eval",
@@ -1696,7 +1923,7 @@ var RunframeCliLeftHeader = (props) => {
1696
1923
  }
1697
1924
  }
1698
1925
  ),
1699
- /* @__PURE__ */ jsx8(
1926
+ /* @__PURE__ */ jsx11(
1700
1927
  "label",
1701
1928
  {
1702
1929
  htmlFor: "load-latest-eval",
@@ -1705,31 +1932,31 @@ var RunframeCliLeftHeader = (props) => {
1705
1932
  }
1706
1933
  )
1707
1934
  ] }) }),
1708
- lastRunEvalVersion && /* @__PURE__ */ jsx8(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx8("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs5("span", { className: "rf-text-xs", children: [
1935
+ lastRunEvalVersion && /* @__PURE__ */ jsx11(DropdownMenuItem, { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx11("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsxs8("span", { className: "rf-text-xs", children: [
1709
1936
  "@tscircuit/eval@",
1710
1937
  lastRunEvalVersion
1711
1938
  ] }) }) }),
1712
- /* @__PURE__ */ jsx8(
1939
+ /* @__PURE__ */ jsx11(
1713
1940
  DropdownMenuItem,
1714
1941
  {
1715
1942
  className: "rf-flex rf-items-center rf-gap-2",
1716
1943
  onClick: () => {
1717
1944
  window.open("/api/admin", "_blank");
1718
1945
  },
1719
- children: /* @__PURE__ */ jsx8("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx8("span", { className: "rf-text-xs", children: "CLI Admin Panel" }) })
1946
+ children: /* @__PURE__ */ jsx11("div", { className: "rf-flex rf-items-center rf-gap-2", children: /* @__PURE__ */ jsx11("span", { className: "rf-text-xs", children: "CLI Admin Panel" }) })
1720
1947
  }
1721
1948
  )
1722
1949
  ] }) })
1723
1950
  ] })
1724
1951
  ] }),
1725
- /* @__PURE__ */ jsx8(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */ jsxs5(AlertDialogContent, { children: [
1726
- /* @__PURE__ */ jsxs5(AlertDialogHeader, { children: [
1727
- /* @__PURE__ */ jsx8(AlertDialogTitle, { children: "Error Saving Snippet" }),
1728
- /* @__PURE__ */ jsx8(AlertDialogDescription, { children: errorMessage })
1952
+ /* @__PURE__ */ jsx11(AlertDialog, { open: isError, onOpenChange: setIsError, children: /* @__PURE__ */ jsxs8(AlertDialogContent, { children: [
1953
+ /* @__PURE__ */ jsxs8(AlertDialogHeader, { children: [
1954
+ /* @__PURE__ */ jsx11(AlertDialogTitle, { children: "Error Saving Snippet" }),
1955
+ /* @__PURE__ */ jsx11(AlertDialogDescription, { children: errorMessage })
1729
1956
  ] }),
1730
- /* @__PURE__ */ jsx8(AlertDialogFooter, { children: /* @__PURE__ */ jsx8(AlertDialogCancel, { onClick: () => setIsError(false), children: "Dismiss" }) })
1957
+ /* @__PURE__ */ jsx11(AlertDialogFooter, { children: /* @__PURE__ */ jsx11(AlertDialogCancel, { onClick: () => setIsError(false), children: "Dismiss" }) })
1731
1958
  ] }) }),
1732
- /* @__PURE__ */ jsx8(
1959
+ /* @__PURE__ */ jsx11(
1733
1960
  SelectSnippetDialog,
1734
1961
  {
1735
1962
  snippetNames: availableSnippets ?? [],
@@ -1748,7 +1975,7 @@ var RunframeCliLeftHeader = (props) => {
1748
1975
  }
1749
1976
  )
1750
1977
  ] }),
1751
- /* @__PURE__ */ jsx8(
1978
+ /* @__PURE__ */ jsx11(
1752
1979
  ImportComponentDialog,
1753
1980
  {
1754
1981
  isOpen: isImportDialogOpen,
@@ -1781,8 +2008,24 @@ var RunframeCliLeftHeader = (props) => {
1781
2008
  }
1782
2009
  }
1783
2010
  ),
1784
- /* @__PURE__ */ jsx8(Toaster, { position: "top-center", reverseOrder: false }),
1785
- /* @__PURE__ */ jsx8(
2011
+ /* @__PURE__ */ jsx11(
2012
+ AiReviewDialog,
2013
+ {
2014
+ isOpen: isAiReviewDialogOpen,
2015
+ onClose: () => setIsAiReviewDialogOpen(false),
2016
+ packageName: snippetName
2017
+ }
2018
+ ),
2019
+ /* @__PURE__ */ jsx11(
2020
+ Toaster,
2021
+ {
2022
+ position: "top-center",
2023
+ reverseOrder: false,
2024
+ containerStyle: { zIndex: 1e5 },
2025
+ toastOptions: { style: { zIndex: 1e5 } }
2026
+ }
2027
+ ),
2028
+ /* @__PURE__ */ jsx11(
1786
2029
  orderDialog.OrderDialog,
1787
2030
  {
1788
2031
  isOpen: orderDialog.isOpen,
@@ -1795,21 +2038,21 @@ var RunframeCliLeftHeader = (props) => {
1795
2038
  };
1796
2039
 
1797
2040
  // lib/components/RunFrameForCli/RunFrameForCli.tsx
1798
- import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
2041
+ import { jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
1799
2042
  var RunFrameForCli = (props) => {
1800
2043
  const [shouldLoadLatestEval, setLoadLatestEval] = useLocalStorageState(
1801
2044
  "load-latest-eval",
1802
2045
  true
1803
2046
  );
1804
- return /* @__PURE__ */ jsx9(
2047
+ return /* @__PURE__ */ jsx12(
1805
2048
  RunFrameWithApi,
1806
2049
  {
1807
2050
  debug: props.debug,
1808
2051
  forceLatestEvalVersion: shouldLoadLatestEval,
1809
2052
  defaultToFullScreen: true,
1810
2053
  showToggleFullScreen: false,
1811
- leftHeaderContent: /* @__PURE__ */ jsxs6("div", { className: "rf-flex rf-items-center rf-justify-between", children: [
1812
- /* @__PURE__ */ jsx9(
2054
+ leftHeaderContent: /* @__PURE__ */ jsxs9("div", { className: "rf-flex rf-items-center rf-justify-between", children: [
2055
+ /* @__PURE__ */ jsx12(
1813
2056
  RunframeCliLeftHeader,
1814
2057
  {
1815
2058
  shouldLoadLatestEval,