@lace-cloud/canvas 0.6.5 → 0.7.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/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { Toast as Toast2 } from "@lace-cloud/ui/feedback";
4
4
 
5
5
  // src/App.tsx
6
6
  import { ReactFlowProvider } from "@xyflow/react";
7
- import { useCallback as useCallback20, useEffect as useEffect16, useState as useState23 } from "react";
7
+ import { useCallback as useCallback21, useEffect as useEffect17, useState as useState24 } from "react";
8
8
 
9
9
  // src/Canvas.tsx
10
10
  import "./Canvas-IXCFWQNP.css";
@@ -19,7 +19,7 @@ import {
19
19
  useNodesInitialized,
20
20
  useReactFlow
21
21
  } from "@xyflow/react";
22
- import { useCallback as useCallback19, useEffect as useEffect14, useRef as useRef8, useState as useState22 } from "react";
22
+ import { useCallback as useCallback20, useEffect as useEffect15, useRef as useRef8, useState as useState23 } from "react";
23
23
 
24
24
  // src/components/ActionBar.tsx
25
25
  import { Panel } from "@xyflow/react";
@@ -44,6 +44,7 @@ var MapOffIcon = () => /* @__PURE__ */ jsxs("svg", { className: "lace-action-bar
44
44
  ] });
45
45
  var SettingsIcon = () => /* @__PURE__ */ jsx("svg", { className: "lace-action-bar__icon", viewBox: ICON_VIEWBOX, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6a3.6 3.6 0 110-7.2 3.6 3.6 0 010 7.2z" }) });
46
46
  var PolicyIcon = () => /* @__PURE__ */ jsx("svg", { className: "lace-action-bar__icon", viewBox: ICON_VIEWBOX, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm-2 16l-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9l-8 8z" }) });
47
+ var RegistryIcon = () => /* @__PURE__ */ jsx("svg", { className: "lace-action-bar__icon", viewBox: ICON_VIEWBOX, "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M20.54 5.23l-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5L6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" }) });
47
48
  function ActionBar({
48
49
  readOnly = false,
49
50
  isGenerating,
@@ -54,6 +55,7 @@ function ActionBar({
54
55
  onGenerate,
55
56
  onOpenSettings,
56
57
  onOpenPolicy,
58
+ onOpenRegistry,
57
59
  showMiniMap,
58
60
  onToggleMiniMap
59
61
  }) {
@@ -140,6 +142,17 @@ function ActionBar({
140
142
  children: /* @__PURE__ */ jsx(PolicyIcon, {})
141
143
  }
142
144
  ) : null,
145
+ !readOnly && onOpenRegistry ? /* @__PURE__ */ jsx(
146
+ "button",
147
+ {
148
+ type: "button",
149
+ className: "lace-action-bar__icon-btn",
150
+ onClick: onOpenRegistry,
151
+ title: "Add module from registry",
152
+ "aria-label": "Add module from registry",
153
+ children: /* @__PURE__ */ jsx(RegistryIcon, {})
154
+ }
155
+ ) : null,
143
156
  /* @__PURE__ */ jsx(
144
157
  "button",
145
158
  {
@@ -1523,24 +1536,147 @@ function PredicateRow({ predicate }) {
1523
1536
  );
1524
1537
  }
1525
1538
 
1539
+ // src/components/panels/RegistryBrowser.tsx
1540
+ import { Button as Button2, Input as Input2, Panel as Panel5, Spinner } from "@lace-cloud/ui";
1541
+ import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo3, useState as useState6 } from "react";
1542
+ import "./RegistryBrowser-3G22I4EO.css";
1543
+ import { jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1544
+ function RegistryBrowser({
1545
+ registryBaseUrl,
1546
+ apiToken,
1547
+ engine,
1548
+ showToast,
1549
+ onClose
1550
+ }) {
1551
+ const { readOnly } = useCanvas();
1552
+ const [modules, setModules] = useState6([]);
1553
+ const [loading, setLoading] = useState6(true);
1554
+ const [error, setError] = useState6(null);
1555
+ const [search, setSearch] = useState6("");
1556
+ const [placing, setPlacing] = useState6(null);
1557
+ useEffect5(() => {
1558
+ let cancelled = false;
1559
+ async function load() {
1560
+ try {
1561
+ setLoading(true);
1562
+ setError(null);
1563
+ const url = `${registryBaseUrl.replace(/\/$/, "")}/api/v1/registry?axis=module&group_by_identity=true`;
1564
+ const res = await fetch(url, {
1565
+ headers: {
1566
+ authorization: `Bearer ${apiToken}`,
1567
+ "content-type": "application/json"
1568
+ }
1569
+ });
1570
+ if (!res.ok) {
1571
+ throw new Error(`Registry returned ${res.status}`);
1572
+ }
1573
+ const body = await res.json();
1574
+ if (!body.success || !body.data?.manifests) {
1575
+ throw new Error(body.error ?? "Failed to load registry modules");
1576
+ }
1577
+ if (!cancelled) {
1578
+ setModules(body.data.manifests);
1579
+ }
1580
+ } catch (err) {
1581
+ if (!cancelled) {
1582
+ setError(err.message);
1583
+ }
1584
+ } finally {
1585
+ if (!cancelled) {
1586
+ setLoading(false);
1587
+ }
1588
+ }
1589
+ }
1590
+ load();
1591
+ return () => {
1592
+ cancelled = true;
1593
+ };
1594
+ }, [registryBaseUrl, apiToken]);
1595
+ const filtered = useMemo3(() => {
1596
+ if (!search.trim()) return modules;
1597
+ const q = search.toLowerCase();
1598
+ return modules.filter(
1599
+ (m) => m.name.toLowerCase().includes(q) || m.author.toLowerCase().includes(q) || (m.description ?? "").toLowerCase().includes(q)
1600
+ );
1601
+ }, [modules, search]);
1602
+ const handlePlace = useCallback4(
1603
+ async (mod) => {
1604
+ if (readOnly) return;
1605
+ setPlacing(mod.id);
1606
+ try {
1607
+ const result = await engine.placeModule({
1608
+ name: mod.name,
1609
+ system: mod.author,
1610
+ version: mod.version,
1611
+ organization: mod.author
1612
+ });
1613
+ if (!result.success) {
1614
+ showToast(result.errors[0]?.message ?? "Failed to place module", "error");
1615
+ } else {
1616
+ onClose();
1617
+ }
1618
+ } catch (err) {
1619
+ showToast(`Error: ${err.message}`, "error");
1620
+ } finally {
1621
+ setPlacing(null);
1622
+ }
1623
+ },
1624
+ [engine, onClose, readOnly, showToast]
1625
+ );
1626
+ return /* @__PURE__ */ jsx9(Panel5, { title: "Registry", width: 380, onClose, scrollable: true, children: /* @__PURE__ */ jsxs9("div", { className: "lace-registry-browser", children: [
1627
+ /* @__PURE__ */ jsx9("div", { className: "lace-registry-browser__search", children: /* @__PURE__ */ jsx9(
1628
+ Input2,
1629
+ {
1630
+ value: search,
1631
+ onChange: (e) => setSearch(e.target.value),
1632
+ placeholder: "Search modules...",
1633
+ id: "registry-search"
1634
+ }
1635
+ ) }),
1636
+ loading ? /* @__PURE__ */ jsxs9("div", { className: "lace-registry-browser__state", children: [
1637
+ /* @__PURE__ */ jsx9(Spinner, {}),
1638
+ /* @__PURE__ */ jsx9("span", { children: "Loading registry..." })
1639
+ ] }) : error ? /* @__PURE__ */ jsx9("div", { className: "lace-registry-browser__state lace-registry-browser__state--error", children: /* @__PURE__ */ jsx9("span", { children: error }) }) : filtered.length === 0 ? /* @__PURE__ */ jsx9("div", { className: "lace-registry-browser__state lace-registry-browser__state--empty", children: modules.length === 0 ? "No modules found in the registry." : "No modules match your search." }) : /* @__PURE__ */ jsx9("ul", { className: "lace-registry-browser__list", children: filtered.map((mod) => /* @__PURE__ */ jsxs9("li", { className: "lace-registry-browser__item", children: [
1640
+ /* @__PURE__ */ jsxs9("div", { className: "lace-registry-browser__item-info", children: [
1641
+ /* @__PURE__ */ jsx9("div", { className: "lace-registry-browser__item-name", children: mod.display_name ?? mod.name }),
1642
+ /* @__PURE__ */ jsxs9("div", { className: "lace-registry-browser__item-author", children: [
1643
+ "by ",
1644
+ mod.author
1645
+ ] }),
1646
+ mod.description ? /* @__PURE__ */ jsx9("div", { className: "lace-registry-browser__item-desc", children: mod.description }) : null
1647
+ ] }),
1648
+ !readOnly ? /* @__PURE__ */ jsx9(
1649
+ Button2,
1650
+ {
1651
+ variant: "primary",
1652
+ size: "sm",
1653
+ onClick: () => handlePlace(mod),
1654
+ disabled: placing === mod.id,
1655
+ children: placing === mod.id ? "Placing..." : "Place"
1656
+ }
1657
+ ) : null
1658
+ ] }, mod.id)) })
1659
+ ] }) });
1660
+ }
1661
+
1526
1662
  // src/components/panels/UnifiedSettingsPanel.tsx
1527
- import { Panel as Panel11 } from "@lace-cloud/ui";
1528
- import { useEffect as useEffect7, useState as useState13 } from "react";
1663
+ import { Panel as Panel12 } from "@lace-cloud/ui";
1664
+ import { useEffect as useEffect8, useState as useState14 } from "react";
1529
1665
 
1530
1666
  // src/components/panels/EnvironmentsPanel.tsx
1531
- import { Input as Input2, Panel as Panel5 } from "@lace-cloud/ui";
1532
- import { useCallback as useCallback5, useState as useState7 } from "react";
1667
+ import { Input as Input3, Panel as Panel6 } from "@lace-cloud/ui";
1668
+ import { useCallback as useCallback6, useState as useState8 } from "react";
1533
1669
 
1534
1670
  // src/hooks/useSaveState.ts
1535
- import { useCallback as useCallback4, useEffect as useEffect5, useRef as useRef3, useState as useState6 } from "react";
1671
+ import { useCallback as useCallback5, useEffect as useEffect6, useRef as useRef3, useState as useState7 } from "react";
1536
1672
  function useSaveState(saveFn) {
1537
- const [status, setStatus] = useState6("idle");
1673
+ const [status, setStatus] = useState7("idle");
1538
1674
  const mountedRef = useRef3(true);
1539
1675
  const resetTimerRef = useRef3(null);
1540
- const safeSetStatus = useCallback4((next) => {
1676
+ const safeSetStatus = useCallback5((next) => {
1541
1677
  if (mountedRef.current) setStatus(next);
1542
1678
  }, []);
1543
- const scheduleReset = useCallback4(
1679
+ const scheduleReset = useCallback5(
1544
1680
  (delay) => {
1545
1681
  if (resetTimerRef.current !== null) clearTimeout(resetTimerRef.current);
1546
1682
  resetTimerRef.current = setTimeout(() => {
@@ -1550,7 +1686,7 @@ function useSaveState(saveFn) {
1550
1686
  },
1551
1687
  [safeSetStatus]
1552
1688
  );
1553
- const handleSave = useCallback4(async () => {
1689
+ const handleSave = useCallback5(async () => {
1554
1690
  safeSetStatus("saving");
1555
1691
  try {
1556
1692
  await saveFn();
@@ -1561,7 +1697,7 @@ function useSaveState(saveFn) {
1561
1697
  scheduleReset(2e3);
1562
1698
  }
1563
1699
  }, [saveFn, safeSetStatus, scheduleReset]);
1564
- useEffect5(() => {
1700
+ useEffect6(() => {
1565
1701
  return () => {
1566
1702
  mountedRef.current = false;
1567
1703
  if (resetTimerRef.current !== null) {
@@ -1590,8 +1726,8 @@ function findDuplicateIndices(items, keyFn) {
1590
1726
  }
1591
1727
 
1592
1728
  // src/components/SaveButton.tsx
1593
- import { Button as Button2 } from "@lace-cloud/ui";
1594
- import { jsx as jsx9 } from "react/jsx-runtime";
1729
+ import { Button as Button3 } from "@lace-cloud/ui";
1730
+ import { jsx as jsx10 } from "react/jsx-runtime";
1595
1731
  var variantByStatus = {
1596
1732
  idle: "primary",
1597
1733
  saving: "primary",
@@ -1604,8 +1740,8 @@ var labelByStatus = {
1604
1740
  error: "Save failed \u2014 try again"
1605
1741
  };
1606
1742
  function SaveButton({ status, label, onClick, disabled, disabledTitle }) {
1607
- return /* @__PURE__ */ jsx9(
1608
- Button2,
1743
+ return /* @__PURE__ */ jsx10(
1744
+ Button3,
1609
1745
  {
1610
1746
  variant: variantByStatus[status],
1611
1747
  fullWidth: true,
@@ -1620,7 +1756,7 @@ function SaveButton({ status, label, onClick, disabled, disabledTitle }) {
1620
1756
 
1621
1757
  // src/components/panels/EnvironmentsPanel.tsx
1622
1758
  import "./panels-shared-5HTOXZUS.css";
1623
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1759
+ import { Fragment as Fragment4, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1624
1760
  function toEnvRows(envs) {
1625
1761
  if (!envs) return [];
1626
1762
  return Object.entries(envs).map(([name, vars]) => ({
@@ -1651,8 +1787,8 @@ function fromEnvRows(rows) {
1651
1787
  return result;
1652
1788
  }
1653
1789
  function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1654
- const [envRows, setEnvRows] = useState7(() => toEnvRows(environments));
1655
- const addEnv = useCallback5(() => {
1790
+ const [envRows, setEnvRows] = useState8(() => toEnvRows(environments));
1791
+ const addEnv = useCallback6(() => {
1656
1792
  setEnvRows((prev) => [
1657
1793
  ...prev,
1658
1794
  {
@@ -1662,27 +1798,27 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1662
1798
  }
1663
1799
  ]);
1664
1800
  }, []);
1665
- const removeEnv = useCallback5((index) => {
1801
+ const removeEnv = useCallback6((index) => {
1666
1802
  setEnvRows((prev) => prev.filter((_, i) => i !== index));
1667
1803
  }, []);
1668
- const updateEnvName = useCallback5((index, name) => {
1804
+ const updateEnvName = useCallback6((index, name) => {
1669
1805
  setEnvRows((prev) => prev.map((r, i) => i === index ? { ...r, name } : r));
1670
1806
  }, []);
1671
- const addEnvVar = useCallback5((envIndex) => {
1807
+ const addEnvVar = useCallback6((envIndex) => {
1672
1808
  setEnvRows(
1673
1809
  (prev) => prev.map(
1674
1810
  (r, i) => i === envIndex ? { ...r, vars: [...r.vars, { id: crypto.randomUUID(), key: "", value: "" }] } : r
1675
1811
  )
1676
1812
  );
1677
1813
  }, []);
1678
- const removeEnvVar = useCallback5((envIndex, varIndex) => {
1814
+ const removeEnvVar = useCallback6((envIndex, varIndex) => {
1679
1815
  setEnvRows(
1680
1816
  (prev) => prev.map(
1681
1817
  (r, i) => i === envIndex ? { ...r, vars: r.vars.filter((_, vi) => vi !== varIndex) } : r
1682
1818
  )
1683
1819
  );
1684
1820
  }, []);
1685
- const updateEnvVar = useCallback5(
1821
+ const updateEnvVar = useCallback6(
1686
1822
  (envIndex, varIndex, field, value) => {
1687
1823
  setEnvRows(
1688
1824
  (prev) => prev.map(
@@ -1703,16 +1839,16 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1703
1839
  });
1704
1840
  const hasDuplicates = envNameDupes.size > 0 || Object.keys(envVarDupes).length > 0;
1705
1841
  const { status: saveStatus, handleSave } = useSaveState(
1706
- useCallback5(async () => {
1842
+ useCallback6(async () => {
1707
1843
  if (hasDuplicates) return;
1708
1844
  await onSave(fromEnvRows(envRows));
1709
1845
  }, [onSave, envRows, hasDuplicates])
1710
1846
  );
1711
- return /* @__PURE__ */ jsxs9(Fragment4, { children: [
1712
- envRows.map((env, ei) => /* @__PURE__ */ jsxs9("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
1713
- /* @__PURE__ */ jsxs9("div", { className: "lace-panel-row-actions", children: [
1714
- /* @__PURE__ */ jsx10(
1715
- Input2,
1847
+ return /* @__PURE__ */ jsxs10(Fragment4, { children: [
1848
+ envRows.map((env, ei) => /* @__PURE__ */ jsxs10("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
1849
+ /* @__PURE__ */ jsxs10("div", { className: "lace-panel-row-actions", children: [
1850
+ /* @__PURE__ */ jsx11(
1851
+ Input3,
1716
1852
  {
1717
1853
  value: env.name,
1718
1854
  onChange: (e) => updateEnvName(ei, e.target.value),
@@ -1722,7 +1858,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1722
1858
  readOnly
1723
1859
  }
1724
1860
  ),
1725
- !readOnly && /* @__PURE__ */ jsx10(
1861
+ !readOnly && /* @__PURE__ */ jsx11(
1726
1862
  "button",
1727
1863
  {
1728
1864
  type: "button",
@@ -1733,11 +1869,11 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1733
1869
  }
1734
1870
  )
1735
1871
  ] }),
1736
- envNameDupes.has(ei) && /* @__PURE__ */ jsx10("div", { className: "lace-panel-row-error", children: "Duplicate environment name" }),
1737
- /* @__PURE__ */ jsx10("div", { className: "lace-panel-row-sublabel", children: "Variable overrides" }),
1738
- env.vars.map((v, vi) => /* @__PURE__ */ jsxs9("div", { className: "lace-panel-row-actions", children: [
1739
- /* @__PURE__ */ jsx10(
1740
- Input2,
1872
+ envNameDupes.has(ei) && /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-error", children: "Duplicate environment name" }),
1873
+ /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-sublabel", children: "Variable overrides" }),
1874
+ env.vars.map((v, vi) => /* @__PURE__ */ jsxs10("div", { className: "lace-panel-row-actions", children: [
1875
+ /* @__PURE__ */ jsx11(
1876
+ Input3,
1741
1877
  {
1742
1878
  value: v.key,
1743
1879
  onChange: (e) => updateEnvVar(ei, vi, "key", e.target.value),
@@ -1748,8 +1884,8 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1748
1884
  readOnly
1749
1885
  }
1750
1886
  ),
1751
- /* @__PURE__ */ jsx10(
1752
- Input2,
1887
+ /* @__PURE__ */ jsx11(
1888
+ Input3,
1753
1889
  {
1754
1890
  value: v.value,
1755
1891
  onChange: (e) => updateEnvVar(ei, vi, "value", e.target.value),
@@ -1758,7 +1894,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1758
1894
  readOnly
1759
1895
  }
1760
1896
  ),
1761
- !readOnly && /* @__PURE__ */ jsx10(
1897
+ !readOnly && /* @__PURE__ */ jsx11(
1762
1898
  "button",
1763
1899
  {
1764
1900
  type: "button",
@@ -1769,7 +1905,7 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1769
1905
  }
1770
1906
  )
1771
1907
  ] }, v.id)),
1772
- !readOnly && /* @__PURE__ */ jsx10(
1908
+ !readOnly && /* @__PURE__ */ jsx11(
1773
1909
  "button",
1774
1910
  {
1775
1911
  type: "button",
@@ -1779,9 +1915,9 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1779
1915
  }
1780
1916
  )
1781
1917
  ] }, env.id)),
1782
- !readOnly && /* @__PURE__ */ jsxs9(Fragment4, { children: [
1783
- /* @__PURE__ */ jsx10("button", { type: "button", onClick: addEnv, className: "lace-panel-add-btn", children: "+ Add environment" }),
1784
- /* @__PURE__ */ jsx10(
1918
+ !readOnly && /* @__PURE__ */ jsxs10(Fragment4, { children: [
1919
+ /* @__PURE__ */ jsx11("button", { type: "button", onClick: addEnv, className: "lace-panel-add-btn", children: "+ Add environment" }),
1920
+ /* @__PURE__ */ jsx11(
1785
1921
  SaveButton,
1786
1922
  {
1787
1923
  status: saveStatus,
@@ -1791,19 +1927,19 @@ function EnvironmentsContent({ environments, readOnly = false, onSave }) {
1791
1927
  disabledTitle: "Fix duplicate names before saving"
1792
1928
  }
1793
1929
  ),
1794
- hasDuplicates && /* @__PURE__ */ jsx10("div", { className: "lace-panel-row-error", children: "Fix duplicate environment or variable names before saving." })
1930
+ hasDuplicates && /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-error", children: "Fix duplicate environment or variable names before saving." })
1795
1931
  ] })
1796
1932
  ] });
1797
1933
  }
1798
1934
  function EnvironmentsPanel({ environments, onSave, onClose }) {
1799
- return /* @__PURE__ */ jsx10(Panel5, { title: "Environments", onClose, children: /* @__PURE__ */ jsx10(EnvironmentsContent, { environments, onSave }) });
1935
+ return /* @__PURE__ */ jsx11(Panel6, { title: "Environments", onClose, children: /* @__PURE__ */ jsx11(EnvironmentsContent, { environments, onSave }) });
1800
1936
  }
1801
1937
 
1802
1938
  // src/components/panels/LocalsPanel.tsx
1803
- import { Input as Input3, ModeToggle as ModeToggle2, Panel as Panel6, Textarea as Textarea2 } from "@lace-cloud/ui";
1804
- import { useCallback as useCallback6, useState as useState8 } from "react";
1939
+ import { Input as Input4, ModeToggle as ModeToggle2, Panel as Panel7, Textarea as Textarea2 } from "@lace-cloud/ui";
1940
+ import { useCallback as useCallback7, useState as useState9 } from "react";
1805
1941
  import "./panels-shared-5HTOXZUS.css";
1806
- import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1942
+ import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1807
1943
  function toRows(locals) {
1808
1944
  if (!locals) return [];
1809
1945
  return locals.map((l) => ({
@@ -1826,41 +1962,41 @@ var BINDING_MODE_ITEMS = [
1826
1962
  { value: "expression", label: "Expression" }
1827
1963
  ];
1828
1964
  function LocalsContent({ locals, readOnly = false, onSave }) {
1829
- const [rows, setRows] = useState8(() => toRows(locals));
1830
- const addLocal = useCallback6(() => {
1965
+ const [rows, setRows] = useState9(() => toRows(locals));
1966
+ const addLocal = useCallback7(() => {
1831
1967
  setRows((prev) => [
1832
1968
  ...prev,
1833
1969
  { id: crypto.randomUUID(), name: "", mode: "literal", litValue: "", exprValue: "" }
1834
1970
  ]);
1835
1971
  }, []);
1836
- const removeLocal = useCallback6((index) => {
1972
+ const removeLocal = useCallback7((index) => {
1837
1973
  setRows((prev) => prev.filter((_, i) => i !== index));
1838
1974
  }, []);
1839
- const updateName = useCallback6((index, name) => {
1975
+ const updateName = useCallback7((index, name) => {
1840
1976
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, name } : r));
1841
1977
  }, []);
1842
- const switchMode = useCallback6((index, mode) => {
1978
+ const switchMode = useCallback7((index, mode) => {
1843
1979
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, mode } : r));
1844
1980
  }, []);
1845
- const updateLitValue = useCallback6((index, litValue) => {
1981
+ const updateLitValue = useCallback7((index, litValue) => {
1846
1982
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, litValue } : r));
1847
1983
  }, []);
1848
- const updateExprValue = useCallback6((index, exprValue) => {
1984
+ const updateExprValue = useCallback7((index, exprValue) => {
1849
1985
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, exprValue } : r));
1850
1986
  }, []);
1851
1987
  const nameDupes = findDuplicateIndices(rows, (r) => r.name);
1852
1988
  const hasErrors = nameDupes.size > 0;
1853
1989
  const { status: saveStatus, handleSave } = useSaveState(
1854
- useCallback6(async () => {
1990
+ useCallback7(async () => {
1855
1991
  if (hasErrors) return;
1856
1992
  await onSave(fromRows(rows));
1857
1993
  }, [onSave, rows, hasErrors])
1858
1994
  );
1859
- return /* @__PURE__ */ jsxs10(Fragment5, { children: [
1860
- rows.map((row, i) => /* @__PURE__ */ jsxs10("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
1861
- /* @__PURE__ */ jsxs10("div", { className: "lace-panel-row-actions", children: [
1862
- /* @__PURE__ */ jsx11(
1863
- Input3,
1995
+ return /* @__PURE__ */ jsxs11(Fragment5, { children: [
1996
+ rows.map((row, i) => /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
1997
+ /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-actions", children: [
1998
+ /* @__PURE__ */ jsx12(
1999
+ Input4,
1864
2000
  {
1865
2001
  value: row.name,
1866
2002
  onChange: (e) => updateName(i, e.target.value),
@@ -1871,7 +2007,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1871
2007
  readOnly
1872
2008
  }
1873
2009
  ),
1874
- !readOnly && /* @__PURE__ */ jsx11(
2010
+ !readOnly && /* @__PURE__ */ jsx12(
1875
2011
  "button",
1876
2012
  {
1877
2013
  type: "button",
@@ -1882,8 +2018,8 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1882
2018
  }
1883
2019
  )
1884
2020
  ] }),
1885
- nameDupes.has(i) && /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
1886
- /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx11(
2021
+ nameDupes.has(i) && /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
2022
+ /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx12(
1887
2023
  ModeToggle2,
1888
2024
  {
1889
2025
  value: row.mode,
@@ -1892,7 +2028,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1892
2028
  "aria-label": "Local binding mode"
1893
2029
  }
1894
2030
  ) }),
1895
- /* @__PURE__ */ jsx11("div", { className: "lace-panel-row-content", children: row.mode === "literal" ? /* @__PURE__ */ jsx11(
2031
+ /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-content", children: row.mode === "literal" ? /* @__PURE__ */ jsx12(
1896
2032
  Textarea2,
1897
2033
  {
1898
2034
  value: row.litValue,
@@ -1903,7 +2039,7 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1903
2039
  mono: true,
1904
2040
  readOnly
1905
2041
  }
1906
- ) : /* @__PURE__ */ jsx11(
2042
+ ) : /* @__PURE__ */ jsx12(
1907
2043
  Textarea2,
1908
2044
  {
1909
2045
  value: row.exprValue,
@@ -1916,9 +2052,9 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1916
2052
  }
1917
2053
  ) })
1918
2054
  ] }, row.id)),
1919
- !readOnly && /* @__PURE__ */ jsxs10(Fragment5, { children: [
1920
- /* @__PURE__ */ jsx11("button", { type: "button", onClick: addLocal, className: "lace-panel-add-btn", children: "+ Add local" }),
1921
- /* @__PURE__ */ jsx11(
2055
+ !readOnly && /* @__PURE__ */ jsxs11(Fragment5, { children: [
2056
+ /* @__PURE__ */ jsx12("button", { type: "button", onClick: addLocal, className: "lace-panel-add-btn", children: "+ Add local" }),
2057
+ /* @__PURE__ */ jsx12(
1922
2058
  SaveButton,
1923
2059
  {
1924
2060
  status: saveStatus,
@@ -1932,14 +2068,14 @@ function LocalsContent({ locals, readOnly = false, onSave }) {
1932
2068
  ] });
1933
2069
  }
1934
2070
  function LocalsPanel({ locals, onSave, onClose }) {
1935
- return /* @__PURE__ */ jsx11(Panel6, { title: "Locals", onClose, children: /* @__PURE__ */ jsx11(LocalsContent, { locals, onSave }) });
2071
+ return /* @__PURE__ */ jsx12(Panel7, { title: "Locals", onClose, children: /* @__PURE__ */ jsx12(LocalsContent, { locals, onSave }) });
1936
2072
  }
1937
2073
 
1938
2074
  // src/components/panels/ModuleInterfacePanel.tsx
1939
- import { Input as Input4, Panel as Panel7, Textarea as Textarea3 } from "@lace-cloud/ui";
1940
- import { useCallback as useCallback7, useMemo as useMemo3, useState as useState9 } from "react";
2075
+ import { Input as Input5, Panel as Panel8, Textarea as Textarea3 } from "@lace-cloud/ui";
2076
+ import { useCallback as useCallback8, useMemo as useMemo4, useState as useState10 } from "react";
1941
2077
  import "./panels-shared-5HTOXZUS.css";
1942
- import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
2078
+ import { Fragment as Fragment6, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
1943
2079
  function variablesToRows(variables) {
1944
2080
  return variables.map((v) => ({
1945
2081
  id: crypto.randomUUID(),
@@ -1991,25 +2127,25 @@ function ModuleInterfaceContent({
1991
2127
  onSaveVariables,
1992
2128
  onSaveExports
1993
2129
  }) {
1994
- const [variables, setVariables] = useState9(
2130
+ const [variables, setVariables] = useState10(
1995
2131
  () => variablesToRows(settings.variables)
1996
2132
  );
1997
- const [outputs, setOutputs] = useState9(
2133
+ const [outputs, setOutputs] = useState10(
1998
2134
  () => buildOutputRows(view, settings.exports)
1999
2135
  );
2000
- const updateVariable = useCallback7(
2136
+ const updateVariable = useCallback8(
2001
2137
  (index, field, value) => {
2002
2138
  setVariables((prev) => prev.map((v, i) => i === index ? { ...v, [field]: value } : v));
2003
2139
  },
2004
2140
  []
2005
2141
  );
2006
- const toggleExposed = useCallback7((index) => {
2142
+ const toggleExposed = useCallback8((index) => {
2007
2143
  setOutputs((prev) => prev.map((o, i) => i === index ? { ...o, exposed: !o.exposed } : o));
2008
2144
  }, []);
2009
- const updateExposedName = useCallback7((index, value) => {
2145
+ const updateExposedName = useCallback8((index, value) => {
2010
2146
  setOutputs((prev) => prev.map((o, i) => i === index ? { ...o, exposed_name: value } : o));
2011
2147
  }, []);
2012
- const exposedNameCollisions = useMemo3(() => {
2148
+ const exposedNameCollisions = useMemo4(() => {
2013
2149
  const counts = /* @__PURE__ */ new Map();
2014
2150
  for (const o of outputs) {
2015
2151
  if (!o.exposed) continue;
@@ -2031,7 +2167,7 @@ function ModuleInterfaceContent({
2031
2167
  }, [outputs]);
2032
2168
  const hasErrors = exposedNameCollisions.size > 0;
2033
2169
  const { status: saveStatus, handleSave } = useSaveState(
2034
- useCallback7(async () => {
2170
+ useCallback8(async () => {
2035
2171
  if (hasErrors) return;
2036
2172
  const variableDefs = variables.filter((v) => v.name.trim()).map((v) => ({
2037
2173
  name: v.name.trim(),
@@ -2062,18 +2198,18 @@ function ModuleInterfaceContent({
2062
2198
  await onSaveExports(exportDefs, outputDefs);
2063
2199
  }, [variables, outputs, hasErrors, onSaveVariables, onSaveExports])
2064
2200
  );
2065
- return /* @__PURE__ */ jsxs11(Fragment6, { children: [
2066
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-hint", children: "The composition's public surface \u2014 what the registry sees when this module is published." }),
2067
- /* @__PURE__ */ jsx12("h4", { className: "lace-panel-section-title", children: "Inputs" }),
2068
- variables.length === 0 ? /* @__PURE__ */ jsxs11("div", { className: "lace-panel-hint", children: [
2201
+ return /* @__PURE__ */ jsxs12(Fragment6, { children: [
2202
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-hint", children: "The composition's public surface \u2014 what the registry sees when this module is published." }),
2203
+ /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Inputs" }),
2204
+ variables.length === 0 ? /* @__PURE__ */ jsxs12("div", { className: "lace-panel-hint", children: [
2069
2205
  "No variables yet. They'll auto-derive on the next Generate from any ",
2070
- /* @__PURE__ */ jsx12("code", { children: "var.xxx" }),
2206
+ /* @__PURE__ */ jsx13("code", { children: "var.xxx" }),
2071
2207
  " ",
2072
2208
  "references in child input bindings."
2073
- ] }) : variables.map((v, i) => /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2074
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx12(Input4, { value: v.name, placeholder: "Variable name", fullWidth: true, mono: true, readOnly: true }) }),
2075
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx12(
2076
- Input4,
2209
+ ] }) : variables.map((v, i) => /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2210
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx13(Input5, { value: v.name, placeholder: "Variable name", fullWidth: true, mono: true, readOnly: true }) }),
2211
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx13(
2212
+ Input5,
2077
2213
  {
2078
2214
  value: v.type,
2079
2215
  onChange: (e) => updateVariable(i, "type", e.target.value),
@@ -2083,7 +2219,7 @@ function ModuleInterfaceContent({
2083
2219
  readOnly
2084
2220
  }
2085
2221
  ) }),
2086
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx12(
2222
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx13(
2087
2223
  Textarea3,
2088
2224
  {
2089
2225
  value: v.description,
@@ -2094,8 +2230,8 @@ function ModuleInterfaceContent({
2094
2230
  readOnly
2095
2231
  }
2096
2232
  ) }),
2097
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsxs11("label", { className: "lace-panel-checkbox-row", children: [
2098
- /* @__PURE__ */ jsx12(
2233
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsxs12("label", { className: "lace-panel-checkbox-row", children: [
2234
+ /* @__PURE__ */ jsx13(
2099
2235
  "input",
2100
2236
  {
2101
2237
  type: "checkbox",
@@ -2104,13 +2240,13 @@ function ModuleInterfaceContent({
2104
2240
  disabled: readOnly
2105
2241
  }
2106
2242
  ),
2107
- /* @__PURE__ */ jsx12("span", { children: "Required" })
2243
+ /* @__PURE__ */ jsx13("span", { children: "Required" })
2108
2244
  ] }) })
2109
2245
  ] }, v.id)),
2110
- /* @__PURE__ */ jsx12("h4", { className: "lace-panel-section-title", children: "Outputs" }),
2111
- outputs.length === 0 ? /* @__PURE__ */ jsx12("div", { className: "lace-panel-hint", children: "No child outputs available yet. Drop a module onto the canvas to see its outputs here." }) : outputs.map((o, i) => /* @__PURE__ */ jsxs11("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2112
- /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsxs11("label", { className: "lace-panel-checkbox-row", children: [
2113
- /* @__PURE__ */ jsx12(
2246
+ /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Outputs" }),
2247
+ outputs.length === 0 ? /* @__PURE__ */ jsx13("div", { className: "lace-panel-hint", children: "No child outputs available yet. Drop a module onto the canvas to see its outputs here." }) : outputs.map((o, i) => /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2248
+ /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsxs12("label", { className: "lace-panel-checkbox-row", children: [
2249
+ /* @__PURE__ */ jsx13(
2114
2250
  "input",
2115
2251
  {
2116
2252
  type: "checkbox",
@@ -2119,14 +2255,14 @@ function ModuleInterfaceContent({
2119
2255
  disabled: readOnly
2120
2256
  }
2121
2257
  ),
2122
- /* @__PURE__ */ jsxs11("span", { className: "lace-panel-checkbox-row__source", children: [
2258
+ /* @__PURE__ */ jsxs12("span", { className: "lace-panel-checkbox-row__source", children: [
2123
2259
  o.source_instance,
2124
2260
  ".",
2125
2261
  o.source_output
2126
2262
  ] })
2127
2263
  ] }) }),
2128
- o.exposed ? /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx12(
2129
- Input4,
2264
+ o.exposed ? /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx13(
2265
+ Input5,
2130
2266
  {
2131
2267
  value: o.exposed_name,
2132
2268
  onChange: (e) => updateExposedName(i, e.target.value),
@@ -2137,9 +2273,9 @@ function ModuleInterfaceContent({
2137
2273
  error: exposedNameCollisions.has(i)
2138
2274
  }
2139
2275
  ) }) : null,
2140
- exposedNameCollisions.has(i) ? /* @__PURE__ */ jsx12("div", { className: "lace-panel-row-error", children: "Exposed name must be unique and non-empty." }) : null
2276
+ exposedNameCollisions.has(i) ? /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-error", children: "Exposed name must be unique and non-empty." }) : null
2141
2277
  ] }, o.id)),
2142
- !readOnly && /* @__PURE__ */ jsx12(
2278
+ !readOnly && /* @__PURE__ */ jsx13(
2143
2279
  SaveButton,
2144
2280
  {
2145
2281
  status: saveStatus,
@@ -2153,10 +2289,10 @@ function ModuleInterfaceContent({
2153
2289
  }
2154
2290
 
2155
2291
  // src/components/panels/ModuleMetadataPanel.tsx
2156
- import { Input as Input5, Panel as Panel8, Textarea as Textarea4 } from "@lace-cloud/ui";
2157
- import { useCallback as useCallback8, useEffect as useEffect6, useState as useState10 } from "react";
2292
+ import { Input as Input6, Panel as Panel9, Textarea as Textarea4 } from "@lace-cloud/ui";
2293
+ import { useCallback as useCallback9, useEffect as useEffect7, useState as useState11 } from "react";
2158
2294
  import "./panels-shared-5HTOXZUS.css";
2159
- import { Fragment as Fragment7, jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
2295
+ import { Fragment as Fragment7, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
2160
2296
  var ID_PATTERN = /^[a-z0-9_-]+\/[a-z0-9_-]+\/[a-z0-9_-]+$/;
2161
2297
  var NAME_PATTERN = /^[a-z][a-z0-9_-]*$/;
2162
2298
  var SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[A-Za-z0-9.-]+)?(?:\+[A-Za-z0-9.-]+)?$/;
@@ -2186,11 +2322,11 @@ function authorsFromRows(rows) {
2186
2322
  });
2187
2323
  }
2188
2324
  function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2189
- const [loading, setLoading] = useState10(true);
2190
- const [meta, setMeta] = useState10(emptyMetadata);
2191
- const [authors, setAuthors] = useState10([]);
2192
- const [categoriesInput, setCategoriesInput] = useState10("");
2193
- useEffect6(() => {
2325
+ const [loading, setLoading] = useState11(true);
2326
+ const [meta, setMeta] = useState11(emptyMetadata);
2327
+ const [authors, setAuthors] = useState11([]);
2328
+ const [categoriesInput, setCategoriesInput] = useState11("");
2329
+ useEffect7(() => {
2194
2330
  let cancelled = false;
2195
2331
  setLoading(true);
2196
2332
  engine.getModuleMetadata().then(({ metadata }) => {
@@ -2205,19 +2341,19 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2205
2341
  cancelled = true;
2206
2342
  };
2207
2343
  }, [engine]);
2208
- const updateField = useCallback8(
2344
+ const updateField = useCallback9(
2209
2345
  (key, value) => {
2210
2346
  setMeta((prev) => ({ ...prev, [key]: value }));
2211
2347
  },
2212
2348
  []
2213
2349
  );
2214
- const addAuthor = useCallback8(() => {
2350
+ const addAuthor = useCallback9(() => {
2215
2351
  setAuthors((prev) => [...prev, { id: crypto.randomUUID(), name: "", email: "" }]);
2216
2352
  }, []);
2217
- const removeAuthor = useCallback8((index) => {
2353
+ const removeAuthor = useCallback9((index) => {
2218
2354
  setAuthors((prev) => prev.filter((_, i) => i !== index));
2219
2355
  }, []);
2220
- const updateAuthor = useCallback8((index, field, value) => {
2356
+ const updateAuthor = useCallback9((index, field, value) => {
2221
2357
  setAuthors((prev) => prev.map((a, i) => i === index ? { ...a, [field]: value } : a));
2222
2358
  }, []);
2223
2359
  const idError = meta.id.trim() && !ID_PATTERN.test(meta.id.trim());
@@ -2225,7 +2361,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2225
2361
  const versionError = meta.version.trim() && !SEMVER_PATTERN.test(meta.version.trim());
2226
2362
  const hasErrors = Boolean(idError || nameError || versionError);
2227
2363
  const { status: saveStatus, handleSave } = useSaveState(
2228
- useCallback8(async () => {
2364
+ useCallback9(async () => {
2229
2365
  if (hasErrors) return;
2230
2366
  const categories = categoriesInput.split(",").map((c) => c.trim()).filter(Boolean);
2231
2367
  const payload = {
@@ -2244,21 +2380,21 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2244
2380
  }, [engine, meta, authors, categoriesInput, hasErrors, onSaved])
2245
2381
  );
2246
2382
  if (loading) {
2247
- return /* @__PURE__ */ jsx13("div", { className: "lace-panel-hint", children: "Loading module metadata\u2026" });
2383
+ return /* @__PURE__ */ jsx14("div", { className: "lace-panel-hint", children: "Loading module metadata\u2026" });
2248
2384
  }
2249
- return /* @__PURE__ */ jsxs12(Fragment7, { children: [
2250
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-hint", children: [
2385
+ return /* @__PURE__ */ jsxs13(Fragment7, { children: [
2386
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-hint", children: [
2251
2387
  "Saved as ",
2252
- /* @__PURE__ */ jsx13("code", { children: "module.yaml" }),
2388
+ /* @__PURE__ */ jsx14("code", { children: "module.yaml" }),
2253
2389
  " at the composition's root, alongside the generated Terraform. Once filled in, the directory is publish-ready via",
2254
- /* @__PURE__ */ jsx13("code", { children: " lace registry register --axis module" }),
2390
+ /* @__PURE__ */ jsx14("code", { children: " lace registry register --axis module" }),
2255
2391
  "."
2256
2392
  ] }),
2257
- /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Identity" }),
2258
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-field", children: [
2259
- /* @__PURE__ */ jsx13("label", { className: "lace-panel-row-label", htmlFor: "module-id-input", children: "ID" }),
2260
- /* @__PURE__ */ jsx13(
2261
- Input5,
2393
+ /* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Identity" }),
2394
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-field", children: [
2395
+ /* @__PURE__ */ jsx14("label", { className: "lace-panel-row-label", htmlFor: "module-id-input", children: "ID" }),
2396
+ /* @__PURE__ */ jsx14(
2397
+ Input6,
2262
2398
  {
2263
2399
  id: "module-id-input",
2264
2400
  value: meta.id,
@@ -2270,16 +2406,16 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2270
2406
  error: Boolean(idError)
2271
2407
  }
2272
2408
  ),
2273
- idError ? /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-error", children: [
2409
+ idError ? /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-error", children: [
2274
2410
  "Expected ",
2275
- /* @__PURE__ */ jsx13("code", { children: "<system>/<service>/<name>" }),
2411
+ /* @__PURE__ */ jsx14("code", { children: "<system>/<service>/<name>" }),
2276
2412
  " (lowercase, hyphens or underscores)."
2277
2413
  ] }) : null
2278
2414
  ] }),
2279
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-field", children: [
2280
- /* @__PURE__ */ jsx13("label", { className: "lace-panel-row-label", htmlFor: "module-name-input", children: "Name" }),
2281
- /* @__PURE__ */ jsx13(
2282
- Input5,
2415
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-field", children: [
2416
+ /* @__PURE__ */ jsx14("label", { className: "lace-panel-row-label", htmlFor: "module-name-input", children: "Name" }),
2417
+ /* @__PURE__ */ jsx14(
2418
+ Input6,
2283
2419
  {
2284
2420
  id: "module-name-input",
2285
2421
  value: meta.name,
@@ -2291,12 +2427,12 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2291
2427
  error: Boolean(nameError)
2292
2428
  }
2293
2429
  ),
2294
- nameError ? /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-error", children: "Expected kebab-case (lowercase letters, digits, hyphens or underscores; must start with a letter)." }) : null
2430
+ nameError ? /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-error", children: "Expected kebab-case (lowercase letters, digits, hyphens or underscores; must start with a letter)." }) : null
2295
2431
  ] }),
2296
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-field", children: [
2297
- /* @__PURE__ */ jsx13("label", { className: "lace-panel-row-label", htmlFor: "module-system-input", children: "System" }),
2298
- /* @__PURE__ */ jsx13(
2299
- Input5,
2432
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-field", children: [
2433
+ /* @__PURE__ */ jsx14("label", { className: "lace-panel-row-label", htmlFor: "module-system-input", children: "System" }),
2434
+ /* @__PURE__ */ jsx14(
2435
+ Input6,
2300
2436
  {
2301
2437
  id: "module-system-input",
2302
2438
  value: meta.system,
@@ -2308,10 +2444,10 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2308
2444
  }
2309
2445
  )
2310
2446
  ] }),
2311
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-field", children: [
2312
- /* @__PURE__ */ jsx13("label", { className: "lace-panel-row-label", htmlFor: "module-version-input", children: "Version" }),
2313
- /* @__PURE__ */ jsx13(
2314
- Input5,
2447
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-field", children: [
2448
+ /* @__PURE__ */ jsx14("label", { className: "lace-panel-row-label", htmlFor: "module-version-input", children: "Version" }),
2449
+ /* @__PURE__ */ jsx14(
2450
+ Input6,
2315
2451
  {
2316
2452
  id: "module-version-input",
2317
2453
  value: meta.version,
@@ -2323,10 +2459,10 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2323
2459
  error: Boolean(versionError)
2324
2460
  }
2325
2461
  ),
2326
- versionError ? /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-error", children: "Expected semver (e.g. 1.0.0)." }) : null
2462
+ versionError ? /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-error", children: "Expected semver (e.g. 1.0.0)." }) : null
2327
2463
  ] }),
2328
- /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Description" }),
2329
- /* @__PURE__ */ jsx13("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx13(
2464
+ /* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Description" }),
2465
+ /* @__PURE__ */ jsx14("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx14(
2330
2466
  Textarea4,
2331
2467
  {
2332
2468
  value: meta.description ?? "",
@@ -2337,9 +2473,9 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2337
2473
  readOnly
2338
2474
  }
2339
2475
  ) }),
2340
- /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Categories" }),
2341
- /* @__PURE__ */ jsx13("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx13(
2342
- Input5,
2476
+ /* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Categories" }),
2477
+ /* @__PURE__ */ jsx14("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx14(
2478
+ Input6,
2343
2479
  {
2344
2480
  value: categoriesInput,
2345
2481
  onChange: (e) => setCategoriesInput(e.target.value),
@@ -2348,11 +2484,11 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2348
2484
  readOnly
2349
2485
  }
2350
2486
  ) }),
2351
- /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Authors" }),
2352
- authors.map((a, i) => /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2353
- /* @__PURE__ */ jsxs12("div", { className: "lace-panel-row-actions", children: [
2354
- /* @__PURE__ */ jsx13(
2355
- Input5,
2487
+ /* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Authors" }),
2488
+ authors.map((a, i) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2489
+ /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-actions", children: [
2490
+ /* @__PURE__ */ jsx14(
2491
+ Input6,
2356
2492
  {
2357
2493
  value: a.name,
2358
2494
  onChange: (e) => updateAuthor(i, "name", e.target.value),
@@ -2361,7 +2497,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2361
2497
  readOnly
2362
2498
  }
2363
2499
  ),
2364
- !readOnly && /* @__PURE__ */ jsx13(
2500
+ !readOnly && /* @__PURE__ */ jsx14(
2365
2501
  "button",
2366
2502
  {
2367
2503
  type: "button",
@@ -2372,8 +2508,8 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2372
2508
  }
2373
2509
  )
2374
2510
  ] }),
2375
- /* @__PURE__ */ jsx13("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx13(
2376
- Input5,
2511
+ /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx14(
2512
+ Input6,
2377
2513
  {
2378
2514
  value: a.email,
2379
2515
  onChange: (e) => updateAuthor(i, "email", e.target.value),
@@ -2383,9 +2519,9 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2383
2519
  }
2384
2520
  ) })
2385
2521
  ] }, a.id)),
2386
- !readOnly && /* @__PURE__ */ jsx13("button", { type: "button", onClick: addAuthor, className: "lace-panel-add-btn", children: "+ Add author" }),
2387
- /* @__PURE__ */ jsx13("h4", { className: "lace-panel-section-title", children: "Example" }),
2388
- /* @__PURE__ */ jsx13("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx13(
2522
+ !readOnly && /* @__PURE__ */ jsx14("button", { type: "button", onClick: addAuthor, className: "lace-panel-add-btn", children: "+ Add author" }),
2523
+ /* @__PURE__ */ jsx14("h4", { className: "lace-panel-section-title", children: "Example" }),
2524
+ /* @__PURE__ */ jsx14("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx14(
2389
2525
  Textarea4,
2390
2526
  {
2391
2527
  value: meta.example ?? "",
@@ -2397,7 +2533,7 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2397
2533
  readOnly
2398
2534
  }
2399
2535
  ) }),
2400
- !readOnly && /* @__PURE__ */ jsx13(
2536
+ !readOnly && /* @__PURE__ */ jsx14(
2401
2537
  SaveButton,
2402
2538
  {
2403
2539
  status: saveStatus,
@@ -2414,10 +2550,10 @@ function ModuleMetadataContent({ engine, readOnly = false, onSaved }) {
2414
2550
  import "./panels-shared-5HTOXZUS.css";
2415
2551
 
2416
2552
  // src/components/panels/ProvidersPanel.tsx
2417
- import { Input as Input6, Panel as Panel9 } from "@lace-cloud/ui";
2418
- import { useCallback as useCallback9, useState as useState11 } from "react";
2553
+ import { Input as Input7, Panel as Panel10 } from "@lace-cloud/ui";
2554
+ import { useCallback as useCallback10, useState as useState12 } from "react";
2419
2555
  import "./panels-shared-5HTOXZUS.css";
2420
- import { Fragment as Fragment8, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
2556
+ import { Fragment as Fragment8, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
2421
2557
  function toRows2(providers) {
2422
2558
  if (!providers || providers.length === 0) return [];
2423
2559
  return providers.map((p) => ({
@@ -2447,8 +2583,8 @@ function fromRows2(rows) {
2447
2583
  });
2448
2584
  }
2449
2585
  function ProvidersContent({ providers, readOnly = false, onSave }) {
2450
- const [rows, setRows] = useState11(() => toRows2(providers));
2451
- const addProvider = useCallback9(() => {
2586
+ const [rows, setRows] = useState12(() => toRows2(providers));
2587
+ const addProvider = useCallback10(() => {
2452
2588
  setRows((prev) => [
2453
2589
  ...prev,
2454
2590
  {
@@ -2459,13 +2595,13 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2459
2595
  }
2460
2596
  ]);
2461
2597
  }, []);
2462
- const removeProvider = useCallback9((index) => {
2598
+ const removeProvider = useCallback10((index) => {
2463
2599
  setRows((prev) => prev.filter((_, i) => i !== index));
2464
2600
  }, []);
2465
- const updateField = useCallback9((index, field, value) => {
2601
+ const updateField = useCallback10((index, field, value) => {
2466
2602
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, [field]: value } : r));
2467
2603
  }, []);
2468
- const addConfigEntry = useCallback9((providerIndex) => {
2604
+ const addConfigEntry = useCallback10((providerIndex) => {
2469
2605
  setRows(
2470
2606
  (prev) => prev.map(
2471
2607
  (r, i) => i === providerIndex ? {
@@ -2475,14 +2611,14 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2475
2611
  )
2476
2612
  );
2477
2613
  }, []);
2478
- const removeConfigEntry = useCallback9((providerIndex, entryIndex) => {
2614
+ const removeConfigEntry = useCallback10((providerIndex, entryIndex) => {
2479
2615
  setRows(
2480
2616
  (prev) => prev.map(
2481
2617
  (r, i) => i === providerIndex ? { ...r, configEntries: r.configEntries.filter((_, ei) => ei !== entryIndex) } : r
2482
2618
  )
2483
2619
  );
2484
2620
  }, []);
2485
- const updateConfigEntry = useCallback9(
2621
+ const updateConfigEntry = useCallback10(
2486
2622
  (providerIndex, entryIndex, field, value) => {
2487
2623
  setRows(
2488
2624
  (prev) => prev.map(
@@ -2498,15 +2634,15 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2498
2634
  []
2499
2635
  );
2500
2636
  const { status: saveStatus, handleSave } = useSaveState(
2501
- useCallback9(async () => {
2637
+ useCallback10(async () => {
2502
2638
  await onSave(fromRows2(rows));
2503
2639
  }, [onSave, rows])
2504
2640
  );
2505
- return /* @__PURE__ */ jsxs13(Fragment8, { children: [
2506
- rows.map((row, pi) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2507
- /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-actions", children: [
2508
- /* @__PURE__ */ jsx14(
2509
- Input6,
2641
+ return /* @__PURE__ */ jsxs14(Fragment8, { children: [
2642
+ rows.map((row, pi) => /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2643
+ /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-actions", children: [
2644
+ /* @__PURE__ */ jsx15(
2645
+ Input7,
2510
2646
  {
2511
2647
  value: row.name,
2512
2648
  onChange: (e) => updateField(pi, "name", e.target.value),
@@ -2515,8 +2651,8 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2515
2651
  readOnly
2516
2652
  }
2517
2653
  ),
2518
- /* @__PURE__ */ jsx14(
2519
- Input6,
2654
+ /* @__PURE__ */ jsx15(
2655
+ Input7,
2520
2656
  {
2521
2657
  value: row.alias,
2522
2658
  onChange: (e) => updateField(pi, "alias", e.target.value),
@@ -2525,7 +2661,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2525
2661
  readOnly
2526
2662
  }
2527
2663
  ),
2528
- !readOnly && /* @__PURE__ */ jsx14(
2664
+ !readOnly && /* @__PURE__ */ jsx15(
2529
2665
  "button",
2530
2666
  {
2531
2667
  type: "button",
@@ -2536,10 +2672,10 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2536
2672
  }
2537
2673
  )
2538
2674
  ] }),
2539
- /* @__PURE__ */ jsx14("div", { className: "lace-panel-row-sublabel", children: "Config" }),
2540
- row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs13("div", { className: "lace-panel-row-actions", children: [
2541
- /* @__PURE__ */ jsx14(
2542
- Input6,
2675
+ /* @__PURE__ */ jsx15("div", { className: "lace-panel-row-sublabel", children: "Config" }),
2676
+ row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-actions", children: [
2677
+ /* @__PURE__ */ jsx15(
2678
+ Input7,
2543
2679
  {
2544
2680
  value: entry.key,
2545
2681
  onChange: (e) => updateConfigEntry(pi, ei, "key", e.target.value),
@@ -2548,8 +2684,8 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2548
2684
  readOnly
2549
2685
  }
2550
2686
  ),
2551
- /* @__PURE__ */ jsx14(
2552
- Input6,
2687
+ /* @__PURE__ */ jsx15(
2688
+ Input7,
2553
2689
  {
2554
2690
  value: entry.value,
2555
2691
  onChange: (e) => updateConfigEntry(pi, ei, "value", e.target.value),
@@ -2558,7 +2694,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2558
2694
  readOnly
2559
2695
  }
2560
2696
  ),
2561
- !readOnly && /* @__PURE__ */ jsx14(
2697
+ !readOnly && /* @__PURE__ */ jsx15(
2562
2698
  "button",
2563
2699
  {
2564
2700
  type: "button",
@@ -2569,7 +2705,7 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2569
2705
  }
2570
2706
  )
2571
2707
  ] }, entry.id)),
2572
- !readOnly && /* @__PURE__ */ jsx14(
2708
+ !readOnly && /* @__PURE__ */ jsx15(
2573
2709
  "button",
2574
2710
  {
2575
2711
  type: "button",
@@ -2579,24 +2715,24 @@ function ProvidersContent({ providers, readOnly = false, onSave }) {
2579
2715
  }
2580
2716
  )
2581
2717
  ] }, row.id)),
2582
- !readOnly && /* @__PURE__ */ jsxs13(Fragment8, { children: [
2583
- /* @__PURE__ */ jsx14("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
2584
- /* @__PURE__ */ jsx14(SaveButton, { status: saveStatus, label: "Save providers", onClick: handleSave })
2718
+ !readOnly && /* @__PURE__ */ jsxs14(Fragment8, { children: [
2719
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
2720
+ /* @__PURE__ */ jsx15(SaveButton, { status: saveStatus, label: "Save providers", onClick: handleSave })
2585
2721
  ] })
2586
2722
  ] });
2587
2723
  }
2588
2724
  function ProvidersPanel({ providers, onSave, onClose }) {
2589
- return /* @__PURE__ */ jsx14(Panel9, { title: "Providers", onClose, children: /* @__PURE__ */ jsx14(ProvidersContent, { providers, onSave }) });
2725
+ return /* @__PURE__ */ jsx15(Panel10, { title: "Providers", onClose, children: /* @__PURE__ */ jsx15(ProvidersContent, { providers, onSave }) });
2590
2726
  }
2591
2727
 
2592
2728
  // src/components/panels/TerraformConfigPanel.tsx
2593
- import { Input as Input7, Panel as Panel10 } from "@lace-cloud/ui";
2594
- import { useCallback as useCallback10, useState as useState12 } from "react";
2729
+ import { Input as Input8, Panel as Panel11 } from "@lace-cloud/ui";
2730
+ import { useCallback as useCallback11, useState as useState13 } from "react";
2595
2731
  import "./panels-shared-5HTOXZUS.css";
2596
- import { Fragment as Fragment9, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
2732
+ import { Fragment as Fragment9, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2597
2733
  function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2598
- const [requiredVersion, setRequiredVersion] = useState12(terraform?.required_version ?? "");
2599
- const [providers, setProviders] = useState12(() => {
2734
+ const [requiredVersion, setRequiredVersion] = useState13(terraform?.required_version ?? "");
2735
+ const [providers, setProviders] = useState13(() => {
2600
2736
  if (!terraform?.required_providers) return [];
2601
2737
  return terraform.required_providers.map((req) => ({
2602
2738
  id: crypto.randomUUID(),
@@ -2605,23 +2741,23 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2605
2741
  version: req.version ?? ""
2606
2742
  }));
2607
2743
  });
2608
- const addProvider = useCallback10(() => {
2744
+ const addProvider = useCallback11(() => {
2609
2745
  setProviders((prev) => [
2610
2746
  ...prev,
2611
2747
  { id: crypto.randomUUID(), name: "", source: "", version: "" }
2612
2748
  ]);
2613
2749
  }, []);
2614
- const removeProvider = useCallback10((index) => {
2750
+ const removeProvider = useCallback11((index) => {
2615
2751
  setProviders((prev) => prev.filter((_, i) => i !== index));
2616
2752
  }, []);
2617
- const updateProvider = useCallback10(
2753
+ const updateProvider = useCallback11(
2618
2754
  (index, field, value) => {
2619
2755
  setProviders((prev) => prev.map((p, i) => i === index ? { ...p, [field]: value } : p));
2620
2756
  },
2621
2757
  []
2622
2758
  );
2623
2759
  const { status: saveStatus, handleSave } = useSaveState(
2624
- useCallback10(async () => {
2760
+ useCallback11(async () => {
2625
2761
  const block = {
2626
2762
  required_version: requiredVersion.trim() || "",
2627
2763
  required_providers: providers.filter((p) => p.name.trim()).map((p) => ({
@@ -2633,10 +2769,10 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2633
2769
  await onSave(block);
2634
2770
  }, [onSave, requiredVersion, providers])
2635
2771
  );
2636
- return /* @__PURE__ */ jsxs14(Fragment9, { children: [
2637
- /* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Required Version" }),
2638
- /* @__PURE__ */ jsx15("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx15(
2639
- Input7,
2772
+ return /* @__PURE__ */ jsxs15(Fragment9, { children: [
2773
+ /* @__PURE__ */ jsx16("h4", { className: "lace-panel-section-title", children: "Required Version" }),
2774
+ /* @__PURE__ */ jsx16("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx16(
2775
+ Input8,
2640
2776
  {
2641
2777
  value: requiredVersion,
2642
2778
  onChange: (e) => setRequiredVersion(e.target.value),
@@ -2645,11 +2781,11 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2645
2781
  readOnly
2646
2782
  }
2647
2783
  ) }),
2648
- /* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
2649
- providers.map((p, i) => /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2650
- /* @__PURE__ */ jsxs14("div", { className: "lace-panel-row-actions", children: [
2651
- /* @__PURE__ */ jsx15(
2652
- Input7,
2784
+ /* @__PURE__ */ jsx16("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
2785
+ providers.map((p, i) => /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
2786
+ /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions", children: [
2787
+ /* @__PURE__ */ jsx16(
2788
+ Input8,
2653
2789
  {
2654
2790
  value: p.name,
2655
2791
  onChange: (e) => updateProvider(i, "name", e.target.value),
@@ -2658,7 +2794,7 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2658
2794
  readOnly
2659
2795
  }
2660
2796
  ),
2661
- !readOnly && /* @__PURE__ */ jsx15(
2797
+ !readOnly && /* @__PURE__ */ jsx16(
2662
2798
  "button",
2663
2799
  {
2664
2800
  type: "button",
@@ -2668,8 +2804,8 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2668
2804
  }
2669
2805
  )
2670
2806
  ] }),
2671
- /* @__PURE__ */ jsx15("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx15(
2672
- Input7,
2807
+ /* @__PURE__ */ jsx16("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx16(
2808
+ Input8,
2673
2809
  {
2674
2810
  value: p.source,
2675
2811
  onChange: (e) => updateProvider(i, "source", e.target.value),
@@ -2678,8 +2814,8 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2678
2814
  readOnly
2679
2815
  }
2680
2816
  ) }),
2681
- /* @__PURE__ */ jsx15("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx15(
2682
- Input7,
2817
+ /* @__PURE__ */ jsx16("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx16(
2818
+ Input8,
2683
2819
  {
2684
2820
  value: p.version,
2685
2821
  onChange: (e) => updateProvider(i, "version", e.target.value),
@@ -2689,23 +2825,23 @@ function TerraformConfigContent({ terraform, readOnly = false, onSave }) {
2689
2825
  }
2690
2826
  ) })
2691
2827
  ] }, p.id)),
2692
- !readOnly && /* @__PURE__ */ jsx15("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
2693
- /* @__PURE__ */ jsx15("h4", { className: "lace-panel-section-title", children: "Backend" }),
2694
- /* @__PURE__ */ jsx15("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
2695
- !readOnly && /* @__PURE__ */ jsx15(SaveButton, { status: saveStatus, label: "Save configuration", onClick: handleSave })
2828
+ !readOnly && /* @__PURE__ */ jsx16("button", { type: "button", onClick: addProvider, className: "lace-panel-add-btn", children: "+ Add provider" }),
2829
+ /* @__PURE__ */ jsx16("h4", { className: "lace-panel-section-title", children: "Backend" }),
2830
+ /* @__PURE__ */ jsx16("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
2831
+ !readOnly && /* @__PURE__ */ jsx16(SaveButton, { status: saveStatus, label: "Save configuration", onClick: handleSave })
2696
2832
  ] });
2697
2833
  }
2698
2834
  function TerraformConfigPanel({ terraform, onSave, onClose }) {
2699
- return /* @__PURE__ */ jsx15(Panel10, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx15(TerraformConfigContent, { terraform, onSave }) });
2835
+ return /* @__PURE__ */ jsx16(Panel11, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx16(TerraformConfigContent, { terraform, onSave }) });
2700
2836
  }
2701
2837
 
2702
2838
  // src/components/panels/UnifiedSettingsPanel.tsx
2703
- import { jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
2839
+ import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
2704
2840
  function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2705
2841
  const { state, readOnly } = useCanvas();
2706
- const [settings, setSettings] = useState13(null);
2707
- const [loading, setLoading] = useState13(true);
2708
- useEffect7(() => {
2842
+ const [settings, setSettings] = useState14(null);
2843
+ const [loading, setLoading] = useState14(true);
2844
+ useEffect8(() => {
2709
2845
  let cancelled = false;
2710
2846
  setLoading(true);
2711
2847
  engine.querySettings().then((result) => {
@@ -2718,11 +2854,11 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2718
2854
  };
2719
2855
  }, [engine]);
2720
2856
  if (loading || !settings) {
2721
- return /* @__PURE__ */ jsx16(Panel11, { title: "Settings", scrollable: false, onClose, children: /* @__PURE__ */ jsx16("div", { className: "lace-panel-hint", children: "Loading settings..." }) });
2857
+ return /* @__PURE__ */ jsx17(Panel12, { title: "Settings", scrollable: false, onClose, children: /* @__PURE__ */ jsx17("div", { className: "lace-panel-hint", children: "Loading settings..." }) });
2722
2858
  }
2723
- return /* @__PURE__ */ jsxs15(Panel11, { title: "Settings", scrollable: false, onClose, children: [
2724
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Module", defaultOpen: true, children: /* @__PURE__ */ jsx16(ModuleMetadataContent, { engine, readOnly, onSaved }) }),
2725
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Interface", children: /* @__PURE__ */ jsx16(
2859
+ return /* @__PURE__ */ jsxs16(Panel12, { title: "Settings", scrollable: false, onClose, children: [
2860
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Module", defaultOpen: true, children: /* @__PURE__ */ jsx17(ModuleMetadataContent, { engine, readOnly, onSaved }) }),
2861
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Interface", children: /* @__PURE__ */ jsx17(
2726
2862
  ModuleInterfaceContent,
2727
2863
  {
2728
2864
  settings,
@@ -2738,7 +2874,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2738
2874
  }
2739
2875
  }
2740
2876
  ) }),
2741
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Terraform Config", children: /* @__PURE__ */ jsx16(
2877
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Terraform Config", children: /* @__PURE__ */ jsx17(
2742
2878
  TerraformConfigContent,
2743
2879
  {
2744
2880
  terraform: settings.terraform,
@@ -2756,7 +2892,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2756
2892
  }
2757
2893
  }
2758
2894
  ) }),
2759
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Providers", children: /* @__PURE__ */ jsx16(
2895
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Providers", children: /* @__PURE__ */ jsx17(
2760
2896
  ProvidersContent,
2761
2897
  {
2762
2898
  providers: settings.providers,
@@ -2773,7 +2909,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2773
2909
  }
2774
2910
  }
2775
2911
  ) }),
2776
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Locals", children: /* @__PURE__ */ jsx16(
2912
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Locals", children: /* @__PURE__ */ jsx17(
2777
2913
  LocalsContent,
2778
2914
  {
2779
2915
  locals: settings.locals,
@@ -2796,7 +2932,7 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2796
2932
  }
2797
2933
  }
2798
2934
  ) }),
2799
- /* @__PURE__ */ jsx16(AccordionSection, { title: "Environments", children: /* @__PURE__ */ jsx16(
2935
+ /* @__PURE__ */ jsx17(AccordionSection, { title: "Environments", children: /* @__PURE__ */ jsx17(
2800
2936
  EnvironmentsContent,
2801
2937
  {
2802
2938
  environments: settings.environments,
@@ -2811,13 +2947,13 @@ function UnifiedSettingsPanel({ engine, onClose, onSaved }) {
2811
2947
  }
2812
2948
 
2813
2949
  // src/components/SlidePanel.tsx
2814
- import { useEffect as useEffect8, useRef as useRef4, useState as useState14 } from "react";
2815
- import { jsx as jsx17 } from "react/jsx-runtime";
2950
+ import { useEffect as useEffect9, useRef as useRef4, useState as useState15 } from "react";
2951
+ import { jsx as jsx18 } from "react/jsx-runtime";
2816
2952
  function SlidePanel({ open, zIndex = 20, children }) {
2817
- const [mounted, setMounted] = useState14(open);
2818
- const [visible, setVisible] = useState14(false);
2953
+ const [mounted, setMounted] = useState15(open);
2954
+ const [visible, setVisible] = useState15(false);
2819
2955
  const timeoutRef = useRef4();
2820
- useEffect8(() => {
2956
+ useEffect9(() => {
2821
2957
  clearTimeout(timeoutRef.current);
2822
2958
  if (open) {
2823
2959
  setMounted(true);
@@ -2829,7 +2965,7 @@ function SlidePanel({ open, zIndex = 20, children }) {
2829
2965
  return () => clearTimeout(timeoutRef.current);
2830
2966
  }, [open]);
2831
2967
  if (!mounted) return null;
2832
- return /* @__PURE__ */ jsx17(
2968
+ return /* @__PURE__ */ jsx18(
2833
2969
  "div",
2834
2970
  {
2835
2971
  className: "slide-panel",
@@ -2840,9 +2976,9 @@ function SlidePanel({ open, zIndex = 20, children }) {
2840
2976
  }
2841
2977
 
2842
2978
  // src/components/ValidationErrorBanner.tsx
2843
- import { useState as useState15 } from "react";
2979
+ import { useState as useState16 } from "react";
2844
2980
  import "./ValidationErrorBanner-G6TBGMK7.css";
2845
- import { Fragment as Fragment10, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2981
+ import { Fragment as Fragment10, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
2846
2982
  function ValidationErrorDialog({
2847
2983
  diagnostics,
2848
2984
  nodeIds,
@@ -2850,7 +2986,7 @@ function ValidationErrorDialog({
2850
2986
  onOpenFile,
2851
2987
  onClose
2852
2988
  }) {
2853
- return /* @__PURE__ */ jsx18(
2989
+ return /* @__PURE__ */ jsx19(
2854
2990
  "div",
2855
2991
  {
2856
2992
  className: "lace-error-dialog-backdrop",
@@ -2859,7 +2995,7 @@ function ValidationErrorDialog({
2859
2995
  if (e.key === "Escape") onClose();
2860
2996
  },
2861
2997
  role: "presentation",
2862
- children: /* @__PURE__ */ jsxs16(
2998
+ children: /* @__PURE__ */ jsxs17(
2863
2999
  "div",
2864
3000
  {
2865
3001
  className: "lace-error-dialog",
@@ -2869,13 +3005,13 @@ function ValidationErrorDialog({
2869
3005
  onClick: (e) => e.stopPropagation(),
2870
3006
  onKeyDown: (e) => e.stopPropagation(),
2871
3007
  children: [
2872
- /* @__PURE__ */ jsxs16("header", { className: "lace-error-dialog__header", children: [
2873
- /* @__PURE__ */ jsxs16("h2", { id: "lace-error-dialog-title", className: "lace-error-dialog__title", children: [
3008
+ /* @__PURE__ */ jsxs17("header", { className: "lace-error-dialog__header", children: [
3009
+ /* @__PURE__ */ jsxs17("h2", { id: "lace-error-dialog-title", className: "lace-error-dialog__title", children: [
2874
3010
  "Terraform Validation Errors (",
2875
3011
  diagnostics.length,
2876
3012
  ")"
2877
3013
  ] }),
2878
- /* @__PURE__ */ jsx18(
3014
+ /* @__PURE__ */ jsx19(
2879
3015
  "button",
2880
3016
  {
2881
3017
  type: "button",
@@ -2887,7 +3023,7 @@ function ValidationErrorDialog({
2887
3023
  }
2888
3024
  )
2889
3025
  ] }),
2890
- /* @__PURE__ */ jsx18("div", { className: "lace-error-dialog__list", children: diagnostics.map((d, i) => {
3026
+ /* @__PURE__ */ jsx19("div", { className: "lace-error-dialog__list", children: diagnostics.map((d, i) => {
2891
3027
  const nodeId = extractNodeId(d, nodeIds);
2892
3028
  const hasFileLink = !!d.file;
2893
3029
  return (
@@ -2895,9 +3031,9 @@ function ValidationErrorDialog({
2895
3031
  // no reordering, no editing, no per-row state. Index keys
2896
3032
  // are stable for the lifetime of this render.
2897
3033
  // biome-ignore lint/suspicious/noArrayIndexKey: immutable diagnostic snapshot, no row state
2898
- /* @__PURE__ */ jsxs16("div", { className: "lace-error-dialog__item", children: [
2899
- /* @__PURE__ */ jsx18("div", { className: "lace-error-dialog__item-message", children: d.message }),
2900
- hasFileLink && /* @__PURE__ */ jsxs16(
3034
+ /* @__PURE__ */ jsxs17("div", { className: "lace-error-dialog__item", children: [
3035
+ /* @__PURE__ */ jsx19("div", { className: "lace-error-dialog__item-message", children: d.message }),
3036
+ hasFileLink && /* @__PURE__ */ jsxs17(
2901
3037
  "button",
2902
3038
  {
2903
3039
  type: "button",
@@ -2911,7 +3047,7 @@ function ValidationErrorDialog({
2911
3047
  ]
2912
3048
  }
2913
3049
  ),
2914
- nodeId && /* @__PURE__ */ jsx18(
3050
+ nodeId && /* @__PURE__ */ jsx19(
2915
3051
  "button",
2916
3052
  {
2917
3053
  type: "button",
@@ -2936,11 +3072,11 @@ function ValidationErrorBanner({
2936
3072
  onOpenFile,
2937
3073
  onDismiss
2938
3074
  }) {
2939
- const [dialogOpen, setDialogOpen] = useState15(false);
3075
+ const [dialogOpen, setDialogOpen] = useState16(false);
2940
3076
  if (diagnostics.length === 0) return null;
2941
- return /* @__PURE__ */ jsxs16(Fragment10, { children: [
2942
- /* @__PURE__ */ jsxs16("div", { className: "lace-error-banner", role: "status", children: [
2943
- /* @__PURE__ */ jsx18(
3077
+ return /* @__PURE__ */ jsxs17(Fragment10, { children: [
3078
+ /* @__PURE__ */ jsxs17("div", { className: "lace-error-banner", role: "status", children: [
3079
+ /* @__PURE__ */ jsx19(
2944
3080
  "svg",
2945
3081
  {
2946
3082
  className: "lace-error-banner__icon",
@@ -2949,11 +3085,11 @@ function ValidationErrorBanner({
2949
3085
  viewBox: "0 0 16 16",
2950
3086
  fill: "currentColor",
2951
3087
  "aria-hidden": "true",
2952
- children: /* @__PURE__ */ jsx18("path", { d: "M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 3.5c.28 0 .5.22.5.5v3a.5.5 0 0 1-1 0V5c0-.28.22-.5.5-.5zm0 6a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z" })
3088
+ children: /* @__PURE__ */ jsx19("path", { d: "M8 1a7 7 0 1 0 0 14A7 7 0 0 0 8 1zm0 3.5c.28 0 .5.22.5.5v3a.5.5 0 0 1-1 0V5c0-.28.22-.5.5-.5zm0 6a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z" })
2953
3089
  }
2954
3090
  ),
2955
- /* @__PURE__ */ jsx18("span", { className: "lace-error-banner__message", children: "Terraform validation failed" }),
2956
- /* @__PURE__ */ jsx18(
3091
+ /* @__PURE__ */ jsx19("span", { className: "lace-error-banner__message", children: "Terraform validation failed" }),
3092
+ /* @__PURE__ */ jsx19(
2957
3093
  "button",
2958
3094
  {
2959
3095
  type: "button",
@@ -2962,7 +3098,7 @@ function ValidationErrorBanner({
2962
3098
  children: "View details"
2963
3099
  }
2964
3100
  ),
2965
- /* @__PURE__ */ jsx18(
3101
+ /* @__PURE__ */ jsx19(
2966
3102
  "button",
2967
3103
  {
2968
3104
  type: "button",
@@ -2974,7 +3110,7 @@ function ValidationErrorBanner({
2974
3110
  }
2975
3111
  )
2976
3112
  ] }),
2977
- dialogOpen && /* @__PURE__ */ jsx18(
3113
+ dialogOpen && /* @__PURE__ */ jsx19(
2978
3114
  ValidationErrorDialog,
2979
3115
  {
2980
3116
  diagnostics,
@@ -3006,11 +3142,11 @@ function extractNodeId(d, nodeIds) {
3006
3142
  }
3007
3143
 
3008
3144
  // src/hooks/useClipboard.ts
3009
- import { useCallback as useCallback11, useEffect as useEffect9, useRef as useRef5 } from "react";
3145
+ import { useCallback as useCallback12, useEffect as useEffect10, useRef as useRef5 } from "react";
3010
3146
  function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getContextMenuNodeId, dismissContextMenu, readOnly) {
3011
3147
  const clipboardRef = useRef5([]);
3012
3148
  const isCutRef = useRef5(false);
3013
- const onCopy = useCallback11(() => {
3149
+ const onCopy = useCallback12(() => {
3014
3150
  const selected = getSelectedIds();
3015
3151
  const ctx = getContextMenuNodeId();
3016
3152
  const ids = ctx && !selected.includes(ctx) ? [...selected, ctx] : selected;
@@ -3024,7 +3160,7 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
3024
3160
  const count = selected.length > 0 ? selected.length : ids.length;
3025
3161
  showToast(`Copied ${count} node${count > 1 ? "s" : ""}`, "success");
3026
3162
  }, [getSelectedIds, getContextMenuNodeId, dismissContextMenu, showToast]);
3027
- const onCut = useCallback11(() => {
3163
+ const onCut = useCallback12(() => {
3028
3164
  const selected = getSelectedIds();
3029
3165
  const ctx = getContextMenuNodeId();
3030
3166
  const ids = ctx && !selected.includes(ctx) ? [...selected, ctx] : selected;
@@ -3038,7 +3174,7 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
3038
3174
  const count = selected.length > 0 ? selected.length : ids.length;
3039
3175
  showToast(`Cut ${count} node${count > 1 ? "s" : ""}`, "success");
3040
3176
  }, [getSelectedIds, getContextMenuNodeId, dismissContextMenu, showToast]);
3041
- const onPaste = useCallback11(async () => {
3177
+ const onPaste = useCallback12(async () => {
3042
3178
  dismissContextMenu();
3043
3179
  if (!engine || clipboardRef.current.length === 0) {
3044
3180
  showToast("Clipboard empty \u2014 copy a node first", "error");
@@ -3075,7 +3211,7 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
3075
3211
  showToast("Paste failed \u2014 try again", "error");
3076
3212
  }
3077
3213
  }, [engine, view, showToast, selectNodes, dismissContextMenu]);
3078
- useEffect9(() => {
3214
+ useEffect10(() => {
3079
3215
  if (readOnly) return;
3080
3216
  window.__canvasCopy = onCopy;
3081
3217
  window.__canvasCut = onCut;
@@ -3090,10 +3226,10 @@ function useClipboard(engine, view, showToast, getSelectedIds, selectNodes, getC
3090
3226
  }
3091
3227
 
3092
3228
  // src/hooks/useContextMenu.ts
3093
- import { useCallback as useCallback12, useEffect as useEffect10, useState as useState16 } from "react";
3229
+ import { useCallback as useCallback13, useEffect as useEffect11, useState as useState17 } from "react";
3094
3230
  function useContextMenu() {
3095
- const [contextMenu, setContextMenu] = useState16(null);
3096
- useEffect10(() => {
3231
+ const [contextMenu, setContextMenu] = useState17(null);
3232
+ useEffect11(() => {
3097
3233
  const handler = (e) => {
3098
3234
  const { instanceId, groupId, selectedCount, x, y } = e.detail;
3099
3235
  setContextMenu({
@@ -3107,17 +3243,17 @@ function useContextMenu() {
3107
3243
  window.addEventListener(CANVAS_EVENTS.CONTEXT_MENU, handler);
3108
3244
  return () => window.removeEventListener(CANVAS_EVENTS.CONTEXT_MENU, handler);
3109
3245
  }, []);
3110
- const dismissContextMenu = useCallback12(() => {
3246
+ const dismissContextMenu = useCallback13(() => {
3111
3247
  setContextMenu(null);
3112
3248
  }, []);
3113
3249
  return { contextMenu, dismissContextMenu };
3114
3250
  }
3115
3251
 
3116
3252
  // src/hooks/useEdgeInspector.ts
3117
- import { useCallback as useCallback13, useState as useState17 } from "react";
3253
+ import { useCallback as useCallback14, useState as useState18 } from "react";
3118
3254
  function useEdgeInspector(engine) {
3119
- const [selectedEdge, setSelectedEdge] = useState17(null);
3120
- const onEdgeClick = useCallback13((_e, edge) => {
3255
+ const [selectedEdge, setSelectedEdge] = useState18(null);
3256
+ const onEdgeClick = useCallback14((_e, edge) => {
3121
3257
  const sourceOutput = edge.data?.source_output ?? "";
3122
3258
  const targetInput = edge.data?.target_input ?? "";
3123
3259
  if (!sourceOutput || !targetInput) return;
@@ -3129,17 +3265,17 @@ function useEdgeInspector(engine) {
3129
3265
  targetInput
3130
3266
  });
3131
3267
  }, []);
3132
- const onDeleteSelectedEdge = useCallback13(async () => {
3268
+ const onDeleteSelectedEdge = useCallback14(async () => {
3133
3269
  if (!engine || !selectedEdge) return;
3134
3270
  await engine.disconnect(selectedEdge.target, selectedEdge.targetInput);
3135
3271
  setSelectedEdge(null);
3136
3272
  }, [engine, selectedEdge]);
3137
- const clearSelectedEdge = useCallback13(() => setSelectedEdge(null), []);
3273
+ const clearSelectedEdge = useCallback14(() => setSelectedEdge(null), []);
3138
3274
  return { selectedEdge, onEdgeClick, onDeleteSelectedEdge, clearSelectedEdge };
3139
3275
  }
3140
3276
 
3141
3277
  // src/hooks/useGenerationStatus.ts
3142
- import { useCallback as useCallback14, useEffect as useEffect11, useMemo as useMemo4, useState as useState18 } from "react";
3278
+ import { useCallback as useCallback15, useEffect as useEffect12, useMemo as useMemo5, useState as useState19 } from "react";
3143
3279
  var PHASE_LABELS = {
3144
3280
  generating: "Generating Terraform...",
3145
3281
  formatting: "Formatting...",
@@ -3147,10 +3283,10 @@ var PHASE_LABELS = {
3147
3283
  };
3148
3284
  function useGenerationStatus(showToast) {
3149
3285
  const engine = useEngine();
3150
- const [generating, setGenerating] = useState18(false);
3151
- const [validationErrors, setValidationErrors] = useState18([]);
3152
- const [errorBannerDismissed, setErrorBannerDismissed] = useState18(false);
3153
- useEffect11(() => {
3286
+ const [generating, setGenerating] = useState19(false);
3287
+ const [validationErrors, setValidationErrors] = useState19([]);
3288
+ const [errorBannerDismissed, setErrorBannerDismissed] = useState19(false);
3289
+ useEffect12(() => {
3154
3290
  return engine.onEvent((event) => {
3155
3291
  switch (event.type) {
3156
3292
  case "generateProgress":
@@ -3184,14 +3320,14 @@ function useGenerationStatus(showToast) {
3184
3320
  }
3185
3321
  });
3186
3322
  }, [engine, showToast]);
3187
- const erroredNodeIds = useMemo4(() => {
3323
+ const erroredNodeIds = useMemo5(() => {
3188
3324
  const ids = /* @__PURE__ */ new Set();
3189
3325
  for (const d of validationErrors) {
3190
3326
  if (d.instance_id) ids.add(d.instance_id);
3191
3327
  }
3192
3328
  return ids;
3193
3329
  }, [validationErrors]);
3194
- const dismissErrorBanner = useCallback14(() => setErrorBannerDismissed(true), []);
3330
+ const dismissErrorBanner = useCallback15(() => setErrorBannerDismissed(true), []);
3195
3331
  return {
3196
3332
  generating,
3197
3333
  validationErrors,
@@ -3202,7 +3338,7 @@ function useGenerationStatus(showToast) {
3202
3338
  }
3203
3339
 
3204
3340
  // src/hooks/useGroupLogic.ts
3205
- import { useMemo as useMemo5 } from "react";
3341
+ import { useMemo as useMemo6 } from "react";
3206
3342
  var GROUP_PADDING_X = 40;
3207
3343
  var GROUP_PADDING_TOP = 60;
3208
3344
  var GROUP_PADDING_BOTTOM = 20;
@@ -3259,7 +3395,7 @@ function toAbsolutePositions(draggedNode, draggedNodes, allRfNodes, groups) {
3259
3395
  return positions;
3260
3396
  }
3261
3397
  function useGroupLogic(nodes, edges, groups, newNodeIds, erroredNodeIds) {
3262
- return useMemo5(() => {
3398
+ return useMemo6(() => {
3263
3399
  if (groups.length === 0) {
3264
3400
  return {
3265
3401
  rfNodes: nodes.map((n) => ({
@@ -3541,12 +3677,12 @@ function computeCollapsedGroup(group, allEdges, nodeToGroup, nodeMap) {
3541
3677
  }
3542
3678
 
3543
3679
  // src/hooks/useNewNodeTracking.ts
3544
- import { useCallback as useCallback15, useEffect as useEffect12, useRef as useRef6, useState as useState19 } from "react";
3680
+ import { useCallback as useCallback16, useEffect as useEffect13, useRef as useRef6, useState as useState20 } from "react";
3545
3681
  function useNewNodeTracking(view) {
3546
- const [newNodeIds, setNewNodeIds] = useState19(/* @__PURE__ */ new Set());
3682
+ const [newNodeIds, setNewNodeIds] = useState20(/* @__PURE__ */ new Set());
3547
3683
  const prevNodeIdsRef = useRef6(/* @__PURE__ */ new Set());
3548
3684
  const sessionLoadedRef = useRef6(false);
3549
- useEffect12(() => {
3685
+ useEffect13(() => {
3550
3686
  if (!view) return;
3551
3687
  const currentIds = new Set(view.nodes.map((n) => n.id));
3552
3688
  if (!sessionLoadedRef.current) {
@@ -3563,7 +3699,7 @@ function useNewNodeTracking(view) {
3563
3699
  });
3564
3700
  prevNodeIdsRef.current = currentIds;
3565
3701
  }, [view]);
3566
- const clearNew = useCallback15((...ids) => {
3702
+ const clearNew = useCallback16((...ids) => {
3567
3703
  setNewNodeIds((s) => {
3568
3704
  const next = new Set(s);
3569
3705
  let changed = false;
@@ -3577,18 +3713,18 @@ function useNewNodeTracking(view) {
3577
3713
  }
3578
3714
 
3579
3715
  // src/hooks/usePolicyResolution.ts
3580
- import { useCallback as useCallback16, useEffect as useEffect13, useState as useState20 } from "react";
3716
+ import { useCallback as useCallback17, useEffect as useEffect14, useState as useState21 } from "react";
3581
3717
  function usePolicyResolution() {
3582
3718
  const engine = useEngine();
3583
- const [resolution, setResolution] = useState20(null);
3584
- useEffect13(() => {
3719
+ const [resolution, setResolution] = useState21(null);
3720
+ useEffect14(() => {
3585
3721
  return engine.onEvent((event) => {
3586
3722
  if (event.type === "policyResolution") {
3587
3723
  setResolution(event.resolution);
3588
3724
  }
3589
3725
  });
3590
3726
  }, [engine]);
3591
- const onPreview = useCallback16(
3727
+ const onPreview = useCallback17(
3592
3728
  (delta, signal) => {
3593
3729
  return engine.previewPolicyResolution(delta, signal);
3594
3730
  },
@@ -3598,32 +3734,32 @@ function usePolicyResolution() {
3598
3734
  }
3599
3735
 
3600
3736
  // src/hooks/useToast.ts
3601
- import { useCallback as useCallback17, useState as useState21 } from "react";
3737
+ import { useCallback as useCallback18, useState as useState22 } from "react";
3602
3738
  var TOAST_BRIEF = 1500;
3603
3739
  var TOAST_INFO = 3e3;
3604
3740
  function useToast() {
3605
- const [toast, setToast] = useState21(null);
3606
- const showToast = useCallback17((message, type, duration) => {
3741
+ const [toast, setToast] = useState22(null);
3742
+ const showToast = useCallback18((message, type, duration) => {
3607
3743
  setToast({ message, type });
3608
3744
  if (type === "progress") return;
3609
3745
  if (duration === Number.POSITIVE_INFINITY) return;
3610
3746
  const ms = duration ?? (type === "error" ? TOAST_INFO : TOAST_BRIEF);
3611
3747
  setTimeout(() => setToast(null), ms);
3612
3748
  }, []);
3613
- const clearToast = useCallback17(() => setToast(null), []);
3749
+ const clearToast = useCallback18(() => setToast(null), []);
3614
3750
  return { toast, showToast, clearToast };
3615
3751
  }
3616
3752
 
3617
3753
  // src/hooks/useUndoRedo.ts
3618
- import { useCallback as useCallback18, useRef as useRef7 } from "react";
3754
+ import { useCallback as useCallback19, useRef as useRef7 } from "react";
3619
3755
  function useUndoRedo(engine, canUndo, canRedo) {
3620
3756
  const forcePositionsRef = useRef7(false);
3621
- const onUndo = useCallback18(async () => {
3757
+ const onUndo = useCallback19(async () => {
3622
3758
  if (!engine || !canUndo) return;
3623
3759
  forcePositionsRef.current = true;
3624
3760
  await engine.undo();
3625
3761
  }, [engine, canUndo]);
3626
- const onRedo = useCallback18(async () => {
3762
+ const onRedo = useCallback19(async () => {
3627
3763
  if (!engine || !canRedo) return;
3628
3764
  forcePositionsRef.current = true;
3629
3765
  await engine.redo();
@@ -3650,7 +3786,7 @@ function applyLocalGroupCollapseOverrides(view, overrides, readOnly) {
3650
3786
  }
3651
3787
 
3652
3788
  // src/Canvas.tsx
3653
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
3789
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
3654
3790
  var nodeTypes = {
3655
3791
  moduleNode: ModuleNode_default,
3656
3792
  groupNode: GroupNode_default
@@ -3674,6 +3810,7 @@ function CompositeEditor({
3674
3810
  onGenerate,
3675
3811
  onOpenSettings,
3676
3812
  onOpenPolicy,
3813
+ onOpenRegistry,
3677
3814
  showMiniMap,
3678
3815
  onToggleMiniMap,
3679
3816
  registerGoToNode,
@@ -3687,12 +3824,12 @@ function CompositeEditor({
3687
3824
  const nodesInitialized = xyflowInitialized || view.nodes.length === 0;
3688
3825
  const selectedIdsRef = useRef8([]);
3689
3826
  const pendingSelectIdsRef = useRef8(null);
3690
- useEffect14(() => {
3827
+ useEffect15(() => {
3691
3828
  if (view.nodes.length > 0) {
3692
3829
  requestAnimationFrame(() => fitView({ padding: 0.2, duration: 300 }));
3693
3830
  }
3694
3831
  }, []);
3695
- useEffect14(() => {
3832
+ useEffect15(() => {
3696
3833
  registerGoToNode((nodeId) => {
3697
3834
  const n = getNode(nodeId);
3698
3835
  if (!n) return;
@@ -3710,7 +3847,7 @@ function CompositeEditor({
3710
3847
  );
3711
3848
  });
3712
3849
  }, [registerGoToNode, getNode, fitBounds]);
3713
- useEffect14(() => {
3850
+ useEffect15(() => {
3714
3851
  if (!viewportIntent) return;
3715
3852
  requestAnimationFrame(() => {
3716
3853
  if (viewportIntent.kind === "fit-all") {
@@ -3740,17 +3877,17 @@ function CompositeEditor({
3740
3877
  }, [fitBounds, fitView, getNode, view.nodes.length, viewportIntent, viewportIntentSeq]);
3741
3878
  const groupLogic = useGroupLogic(view.nodes, view.edges, view.groups, newNodeIds, erroredNodeIds);
3742
3879
  const rfEdgesFromView = groupLogic.rfEdges;
3743
- const [rfEdges, setRfEdges] = useState22(rfEdgesFromView);
3744
- useEffect14(() => {
3880
+ const [rfEdges, setRfEdges] = useState23(rfEdgesFromView);
3881
+ useEffect15(() => {
3745
3882
  setRfEdges(rfEdgesFromView);
3746
3883
  }, [rfEdgesFromView]);
3747
- const onEdgesChange = useCallback19((changes) => {
3884
+ const onEdgesChange = useCallback20((changes) => {
3748
3885
  setRfEdges((prev) => applyEdgeChanges(changes, prev));
3749
3886
  }, []);
3750
3887
  const rfNodesFromView = groupLogic.rfNodes;
3751
- const [rfNodes, setRfNodes] = useState22(rfNodesFromView);
3888
+ const [rfNodes, setRfNodes] = useState23(rfNodesFromView);
3752
3889
  const prevGroupKeyRef = useRef8("");
3753
- useEffect14(() => {
3890
+ useEffect15(() => {
3754
3891
  const force = forcePositionsRef.current;
3755
3892
  forcePositionsRef.current = false;
3756
3893
  const pending = pendingSelectIdsRef.current;
@@ -3772,22 +3909,22 @@ function CompositeEditor({
3772
3909
  });
3773
3910
  });
3774
3911
  }, [rfNodesFromView, forcePositionsRef, view.groups]);
3775
- const onNodesChange = useCallback19((changes) => {
3912
+ const onNodesChange = useCallback20((changes) => {
3776
3913
  setRfNodes((prev) => {
3777
3914
  const next = applyNodeChanges(changes, prev);
3778
3915
  selectedIdsRef.current = next.filter((n) => n.selected).map((n) => n.id);
3779
3916
  return next;
3780
3917
  });
3781
3918
  }, []);
3782
- useEffect14(() => {
3919
+ useEffect15(() => {
3783
3920
  registerGetSelectedIds(() => selectedIdsRef.current);
3784
3921
  }, [registerGetSelectedIds]);
3785
- useEffect14(() => {
3922
+ useEffect15(() => {
3786
3923
  registerSelectNodes((ids) => {
3787
3924
  pendingSelectIdsRef.current = ids;
3788
3925
  });
3789
3926
  }, [registerSelectNodes]);
3790
- const onNodeDragStop = useCallback19(
3927
+ const onNodeDragStop = useCallback20(
3791
3928
  (_e, draggedNode, draggedNodes) => {
3792
3929
  const positions = toAbsolutePositions(draggedNode, draggedNodes, rfNodes, view.groups);
3793
3930
  if (Object.keys(positions).length > 0) {
@@ -3807,7 +3944,7 @@ function CompositeEditor({
3807
3944
  },
3808
3945
  animated: false
3809
3946
  };
3810
- return /* @__PURE__ */ jsxs17(
3947
+ return /* @__PURE__ */ jsxs18(
3811
3948
  ReactFlow,
3812
3949
  {
3813
3950
  nodes: rfNodes,
@@ -3878,7 +4015,7 @@ function CompositeEditor({
3878
4015
  proOptions: { hideAttribution: true },
3879
4016
  style: { background: "var(--lace-color-bg-canvas)" },
3880
4017
  children: [
3881
- showMiniMap ? /* @__PURE__ */ jsx19(
4018
+ showMiniMap ? /* @__PURE__ */ jsx20(
3882
4019
  MiniMap,
3883
4020
  {
3884
4021
  position: "bottom-left",
@@ -3893,8 +4030,8 @@ function CompositeEditor({
3893
4030
  nodeColor: "var(--lace-color-accent)"
3894
4031
  }
3895
4032
  ) : null,
3896
- /* @__PURE__ */ jsx19(Controls, { position: "bottom-right", showInteractive: false, style: { bottom: 20, right: 20 } }),
3897
- /* @__PURE__ */ jsx19(
4033
+ /* @__PURE__ */ jsx20(Controls, { position: "bottom-right", showInteractive: false, style: { bottom: 20, right: 20 } }),
4034
+ /* @__PURE__ */ jsx20(
3898
4035
  ActionBar,
3899
4036
  {
3900
4037
  readOnly,
@@ -3906,29 +4043,34 @@ function CompositeEditor({
3906
4043
  onGenerate,
3907
4044
  onOpenSettings,
3908
4045
  onOpenPolicy,
4046
+ onOpenRegistry,
3909
4047
  showMiniMap,
3910
4048
  onToggleMiniMap
3911
4049
  }
3912
4050
  ),
3913
- /* @__PURE__ */ jsxs17("svg", { children: [
3914
- /* @__PURE__ */ jsx19("defs", { children: /* @__PURE__ */ jsx19("pattern", { id: "grid", width: "20", height: "20", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx19("circle", { cx: "1", cy: "1", r: "0.5", fill: gridColor }) }) }),
3915
- /* @__PURE__ */ jsx19("rect", { width: "100%", height: "100%", fill: "url(#grid)" })
4051
+ /* @__PURE__ */ jsxs18("svg", { children: [
4052
+ /* @__PURE__ */ jsx20("defs", { children: /* @__PURE__ */ jsx20("pattern", { id: "grid", width: "20", height: "20", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx20("circle", { cx: "1", cy: "1", r: "0.5", fill: gridColor }) }) }),
4053
+ /* @__PURE__ */ jsx20("rect", { width: "100%", height: "100%", fill: "url(#grid)" })
3916
4054
  ] }),
3917
- nodesInitialized ? /* @__PURE__ */ jsx19("div", { hidden: true, "data-rendered": "" }) : null
4055
+ nodesInitialized ? /* @__PURE__ */ jsx20("div", { hidden: true, "data-rendered": "" }) : null
3918
4056
  ]
3919
4057
  }
3920
4058
  );
3921
4059
  }
3922
- function Canvas() {
4060
+ function Canvas({ registryBaseUrl, apiToken } = {}) {
3923
4061
  const { state, readOnly, localGroupCollapseOverrides } = useCanvas();
3924
4062
  const engine = useEngine();
3925
4063
  const viewRef = useRef8(state.view);
3926
4064
  viewRef.current = state.view;
3927
- const [configTarget, setConfigTarget] = useState22(null);
3928
- const [settingsOpen, setSettingsOpen] = useState22(false);
3929
- const [policyOpen, setPolicyOpen] = useState22(false);
3930
- const [showMiniMap, setShowMiniMap] = useState22(false);
3931
- const toggleMiniMap = useCallback19(() => setShowMiniMap((v) => !v), []);
4065
+ const [configTarget, setConfigTarget] = useState23(null);
4066
+ const [settingsOpen, setSettingsOpen] = useState23(false);
4067
+ const [policyOpen, setPolicyOpen] = useState23(false);
4068
+ const [showMiniMap, setShowMiniMap] = useState23(false);
4069
+ const toggleMiniMap = useCallback20(() => setShowMiniMap((v) => !v), []);
4070
+ const [registryOpen, setRegistryOpen] = useState23(false);
4071
+ const openRegistry = useCallback20(() => setRegistryOpen(true), []);
4072
+ const closeRegistry = useCallback20(() => setRegistryOpen(false), []);
4073
+ const canBrowseRegistry = !!(registryBaseUrl && apiToken);
3932
4074
  const { toast, showToast } = useToast();
3933
4075
  const { contextMenu, dismissContextMenu } = useContextMenu();
3934
4076
  const { forcePositionsRef, onUndo, onRedo } = useUndoRedo(
@@ -3941,28 +4083,28 @@ function Canvas() {
3941
4083
  const { generating, validationErrors, erroredNodeIds, errorBannerDismissed, dismissErrorBanner } = useGenerationStatus(showToast);
3942
4084
  const { newNodeIds, clearNew } = useNewNodeTracking(state.view);
3943
4085
  const goToNodeRef = useRef8(null);
3944
- const registerGoToNode = useCallback19((fn) => {
4086
+ const registerGoToNode = useCallback20((fn) => {
3945
4087
  goToNodeRef.current = fn;
3946
4088
  }, []);
3947
4089
  const getSelectedIdsRef = useRef8(null);
3948
- const registerGetSelectedIds = useCallback19((fn) => {
4090
+ const registerGetSelectedIds = useCallback20((fn) => {
3949
4091
  getSelectedIdsRef.current = fn;
3950
4092
  }, []);
3951
4093
  const selectNodesRef = useRef8(null);
3952
- const registerSelectNodes = useCallback19((fn) => {
4094
+ const registerSelectNodes = useCallback20((fn) => {
3953
4095
  selectNodesRef.current = fn;
3954
4096
  }, []);
3955
4097
  const { onCopy, onCut, onPaste } = useClipboard(
3956
4098
  engine,
3957
4099
  state.view,
3958
4100
  showToast,
3959
- useCallback19(() => getSelectedIdsRef.current?.() ?? [], []),
3960
- useCallback19((ids) => selectNodesRef.current?.(ids), []),
3961
- useCallback19(() => contextMenu?.nodeId ?? null, [contextMenu]),
4101
+ useCallback20(() => getSelectedIdsRef.current?.() ?? [], []),
4102
+ useCallback20((ids) => selectNodesRef.current?.(ids), []),
4103
+ useCallback20(() => contextMenu?.nodeId ?? null, [contextMenu]),
3962
4104
  dismissContextMenu,
3963
4105
  readOnly
3964
4106
  );
3965
- useEffect14(() => {
4107
+ useEffect15(() => {
3966
4108
  const handler = (e) => {
3967
4109
  const detail = e.detail;
3968
4110
  if (detail?.instanceId) setConfigTarget(detail.instanceId);
@@ -3970,34 +4112,34 @@ function Canvas() {
3970
4112
  window.addEventListener(CANVAS_EVENTS.OPEN_NODE_CONFIG, handler);
3971
4113
  return () => window.removeEventListener(CANVAS_EVENTS.OPEN_NODE_CONFIG, handler);
3972
4114
  }, []);
3973
- useEffect14(() => {
4115
+ useEffect15(() => {
3974
4116
  if (!configTarget) return;
3975
4117
  const stillPresent = state.view?.nodes.some((n) => n.id === configTarget);
3976
4118
  if (!stillPresent) setConfigTarget(null);
3977
4119
  }, [configTarget, state.view]);
3978
- const onSave = useCallback19(async () => {
4120
+ const onSave = useCallback20(async () => {
3979
4121
  if (!engine) return;
3980
4122
  await engine.sessionSave();
3981
4123
  showToast("Saved", "success");
3982
4124
  }, [engine, showToast]);
3983
- const onGenerate = useCallback19(() => {
4125
+ const onGenerate = useCallback20(() => {
3984
4126
  window.dispatchEvent(new CustomEvent(CANVAS_EVENTS.GENERATE));
3985
4127
  }, []);
3986
- useEffect14(() => {
4128
+ useEffect15(() => {
3987
4129
  if (readOnly) return;
3988
4130
  window.__canvasUndo = onUndo;
3989
4131
  return () => {
3990
4132
  window.__canvasUndo = void 0;
3991
4133
  };
3992
4134
  }, [onUndo, readOnly]);
3993
- const onDragStop = useCallback19(
4135
+ const onDragStop = useCallback20(
3994
4136
  async (positions) => {
3995
4137
  if (!engine || readOnly) return;
3996
4138
  await engine.syncLayout(positions);
3997
4139
  },
3998
4140
  [engine, readOnly]
3999
4141
  );
4000
- const onConnect = useCallback19(
4142
+ const onConnect = useCallback20(
4001
4143
  async (conn) => {
4002
4144
  if (!conn.source || !conn.target || !engine) return;
4003
4145
  const srcName = parseHandleId(conn.sourceHandle, "out");
@@ -4041,7 +4183,7 @@ function Canvas() {
4041
4183
  },
4042
4184
  [engine, showToast]
4043
4185
  );
4044
- const onEdgesDelete = useCallback19(
4186
+ const onEdgesDelete = useCallback20(
4045
4187
  async (edges) => {
4046
4188
  if (!engine) return;
4047
4189
  for (const edge of edges) {
@@ -4057,7 +4199,7 @@ function Canvas() {
4057
4199
  },
4058
4200
  [engine, showToast]
4059
4201
  );
4060
- const onNodesDelete = useCallback19(
4202
+ const onNodesDelete = useCallback20(
4061
4203
  async (nodes) => {
4062
4204
  if (!engine) return;
4063
4205
  for (const node of nodes) {
@@ -4072,7 +4214,7 @@ function Canvas() {
4072
4214
  },
4073
4215
  [engine, showToast]
4074
4216
  );
4075
- const onClearGraph = useCallback19(async () => {
4217
+ const onClearGraph = useCallback20(async () => {
4076
4218
  if (!engine || !state.view) return;
4077
4219
  for (const node of state.view.nodes) {
4078
4220
  const result = await engine.deleteInstance(node.id);
@@ -4082,14 +4224,14 @@ function Canvas() {
4082
4224
  }
4083
4225
  }
4084
4226
  }, [engine, state.view, showToast]);
4085
- const onOpenSettings = useCallback19(() => {
4227
+ const onOpenSettings = useCallback20(() => {
4086
4228
  setSettingsOpen(true);
4087
4229
  setConfigTarget(null);
4088
4230
  }, []);
4089
- const onOpenPolicy = useCallback19(() => {
4231
+ const onOpenPolicy = useCallback20(() => {
4090
4232
  setPolicyOpen(true);
4091
4233
  }, []);
4092
- const onGroupSelected = useCallback19(async () => {
4234
+ const onGroupSelected = useCallback20(async () => {
4093
4235
  const ids = getSelectedIdsRef.current?.() ?? [];
4094
4236
  if (ids.length < 2 || !engine) return;
4095
4237
  try {
@@ -4104,7 +4246,7 @@ function Canvas() {
4104
4246
  showToast(`Failed to create group: ${err.message}`, "error");
4105
4247
  }
4106
4248
  }, [engine, dismissContextMenu, showToast]);
4107
- const onUngroup = useCallback19(
4249
+ const onUngroup = useCallback20(
4108
4250
  async (groupId) => {
4109
4251
  if (!engine) return;
4110
4252
  try {
@@ -4121,7 +4263,7 @@ function Canvas() {
4121
4263
  [engine, dismissContextMenu, showToast]
4122
4264
  );
4123
4265
  if (state.loading || !state.view) {
4124
- return /* @__PURE__ */ jsx19(
4266
+ return /* @__PURE__ */ jsx20(
4125
4267
  "div",
4126
4268
  {
4127
4269
  style: {
@@ -4141,13 +4283,13 @@ function Canvas() {
4141
4283
  localGroupCollapseOverrides,
4142
4284
  readOnly
4143
4285
  );
4144
- return /* @__PURE__ */ jsxs17(
4286
+ return /* @__PURE__ */ jsxs18(
4145
4287
  "div",
4146
4288
  {
4147
4289
  style: { position: "relative", display: "flex", flexDirection: "column", height: "100vh" },
4148
4290
  children: [
4149
- /* @__PURE__ */ jsx19(Toast, { toast }),
4150
- /* @__PURE__ */ jsx19(
4291
+ /* @__PURE__ */ jsx20(Toast, { toast }),
4292
+ /* @__PURE__ */ jsx20(
4151
4293
  ContextMenu,
4152
4294
  {
4153
4295
  contextMenu,
@@ -4159,7 +4301,7 @@ function Canvas() {
4159
4301
  onDismiss: dismissContextMenu
4160
4302
  }
4161
4303
  ),
4162
- !errorBannerDismissed && validationErrors.length > 0 && !toast && /* @__PURE__ */ jsx19(
4304
+ !errorBannerDismissed && validationErrors.length > 0 && !toast && /* @__PURE__ */ jsx20(
4163
4305
  ValidationErrorBanner,
4164
4306
  {
4165
4307
  diagnostics: validationErrors,
@@ -4171,8 +4313,8 @@ function Canvas() {
4171
4313
  onDismiss: dismissErrorBanner
4172
4314
  }
4173
4315
  ),
4174
- /* @__PURE__ */ jsxs17("div", { style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
4175
- /* @__PURE__ */ jsx19(
4316
+ /* @__PURE__ */ jsxs18("div", { style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
4317
+ /* @__PURE__ */ jsx20(
4176
4318
  CompositeEditor,
4177
4319
  {
4178
4320
  view,
@@ -4193,6 +4335,7 @@ function Canvas() {
4193
4335
  onGenerate,
4194
4336
  onOpenSettings,
4195
4337
  onOpenPolicy: readOnly ? void 0 : onOpenPolicy,
4338
+ onOpenRegistry: canBrowseRegistry ? openRegistry : void 0,
4196
4339
  showMiniMap,
4197
4340
  onToggleMiniMap: toggleMiniMap,
4198
4341
  registerGoToNode,
@@ -4202,7 +4345,7 @@ function Canvas() {
4202
4345
  viewportIntentSeq: state.viewportIntentSeq
4203
4346
  }
4204
4347
  ),
4205
- /* @__PURE__ */ jsx19(SlidePanel, { open: !!configTarget, children: configTarget && /* @__PURE__ */ jsx19(
4348
+ /* @__PURE__ */ jsx20(SlidePanel, { open: !!configTarget, children: configTarget && /* @__PURE__ */ jsx20(
4206
4349
  ModuleConfigPanel,
4207
4350
  {
4208
4351
  instance_id: configTarget,
@@ -4211,7 +4354,7 @@ function Canvas() {
4211
4354
  onModified: clearNew
4212
4355
  }
4213
4356
  ) }),
4214
- /* @__PURE__ */ jsx19(SlidePanel, { open: !!selectedEdge, zIndex: 40, children: selectedEdge && /* @__PURE__ */ jsx19(
4357
+ /* @__PURE__ */ jsx20(SlidePanel, { open: !!selectedEdge, zIndex: 40, children: selectedEdge && /* @__PURE__ */ jsx20(
4215
4358
  EdgeInspectorPanel,
4216
4359
  {
4217
4360
  source: selectedEdge.source,
@@ -4222,7 +4365,7 @@ function Canvas() {
4222
4365
  onClose: clearSelectedEdge
4223
4366
  }
4224
4367
  ) }),
4225
- /* @__PURE__ */ jsx19(SlidePanel, { open: settingsOpen, children: settingsOpen && /* @__PURE__ */ jsx19(
4368
+ /* @__PURE__ */ jsx20(SlidePanel, { open: settingsOpen, children: settingsOpen && /* @__PURE__ */ jsx20(
4226
4369
  UnifiedSettingsPanel,
4227
4370
  {
4228
4371
  engine,
@@ -4230,13 +4373,23 @@ function Canvas() {
4230
4373
  onSaved: () => showToast("Settings saved", "success")
4231
4374
  }
4232
4375
  ) }),
4233
- !readOnly && /* @__PURE__ */ jsx19(SlidePanel, { open: policyOpen, children: policyOpen && /* @__PURE__ */ jsx19(
4376
+ !readOnly && /* @__PURE__ */ jsx20(SlidePanel, { open: policyOpen, children: policyOpen && /* @__PURE__ */ jsx20(
4234
4377
  PolicySidebar,
4235
4378
  {
4236
4379
  resolution: policyResolution,
4237
4380
  onPreview: previewPolicy,
4238
4381
  onClose: () => setPolicyOpen(false)
4239
4382
  }
4383
+ ) }),
4384
+ canBrowseRegistry && /* @__PURE__ */ jsx20(SlidePanel, { open: registryOpen, children: registryOpen && /* @__PURE__ */ jsx20(
4385
+ RegistryBrowser,
4386
+ {
4387
+ engine,
4388
+ registryBaseUrl,
4389
+ apiToken,
4390
+ showToast,
4391
+ onClose: closeRegistry
4392
+ }
4240
4393
  ) })
4241
4394
  ] })
4242
4395
  ]
@@ -4247,12 +4400,12 @@ function Canvas() {
4247
4400
  // src/components/ErrorBoundary.tsx
4248
4401
  import React from "react";
4249
4402
  import "./ErrorBoundary-IXSIVZFH.css";
4250
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
4403
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4251
4404
  function ErrorState({ message }) {
4252
- return /* @__PURE__ */ jsxs18("div", { className: "lace-error-state", role: "alert", children: [
4253
- /* @__PURE__ */ jsx20("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
4254
- /* @__PURE__ */ jsx20("pre", { className: "lace-error-state__message", children: message }),
4255
- /* @__PURE__ */ jsx20(
4405
+ return /* @__PURE__ */ jsxs19("div", { className: "lace-error-state", role: "alert", children: [
4406
+ /* @__PURE__ */ jsx21("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
4407
+ /* @__PURE__ */ jsx21("pre", { className: "lace-error-state__message", children: message }),
4408
+ /* @__PURE__ */ jsx21(
4256
4409
  "button",
4257
4410
  {
4258
4411
  type: "button",
@@ -4273,21 +4426,21 @@ var ErrorBoundary = class extends React.Component {
4273
4426
  }
4274
4427
  render() {
4275
4428
  if (this.state.error) {
4276
- return /* @__PURE__ */ jsx20(ErrorState, { message: this.state.error.message });
4429
+ return /* @__PURE__ */ jsx21(ErrorState, { message: this.state.error.message });
4277
4430
  }
4278
4431
  return this.props.children;
4279
4432
  }
4280
4433
  };
4281
4434
 
4282
4435
  // src/hooks/useWindowEvent.ts
4283
- import { useEffect as useEffect15, useRef as useRef9 } from "react";
4436
+ import { useEffect as useEffect16, useRef as useRef9 } from "react";
4284
4437
  function useWindowEvent(eventName, handler, options) {
4285
4438
  const enabled = options?.enabled ?? true;
4286
4439
  const handlerRef = useRef9(handler);
4287
- useEffect15(() => {
4440
+ useEffect16(() => {
4288
4441
  handlerRef.current = handler;
4289
4442
  });
4290
- useEffect15(() => {
4443
+ useEffect16(() => {
4291
4444
  if (!enabled) return;
4292
4445
  const dispatch = (e) => handlerRef.current(e);
4293
4446
  window.addEventListener(eventName, dispatch);
@@ -4296,20 +4449,26 @@ function useWindowEvent(eventName, handler, options) {
4296
4449
  }
4297
4450
 
4298
4451
  // src/App.tsx
4299
- import { jsx as jsx21 } from "react/jsx-runtime";
4300
- function App({ engine, hostBridge, readOnly = false }) {
4301
- const [state, setState] = useState23({
4452
+ import { jsx as jsx22 } from "react/jsx-runtime";
4453
+ function App({
4454
+ engine,
4455
+ hostBridge,
4456
+ readOnly = false,
4457
+ registryBaseUrl,
4458
+ apiToken
4459
+ }) {
4460
+ const [state, setState] = useState24({
4302
4461
  view: null,
4303
4462
  loading: true,
4304
4463
  generation: 0,
4305
4464
  viewportIntent: null,
4306
4465
  viewportIntentSeq: 0
4307
4466
  });
4308
- const [localGroupCollapseOverrides, setLocalGroupCollapseOverrides] = useState23({});
4309
- const toggleLocalGroupCollapse = useCallback20((groupId, currentCollapsed) => {
4467
+ const [localGroupCollapseOverrides, setLocalGroupCollapseOverrides] = useState24({});
4468
+ const toggleLocalGroupCollapse = useCallback21((groupId, currentCollapsed) => {
4310
4469
  setLocalGroupCollapseOverrides((prev) => ({ ...prev, [groupId]: !currentCollapsed }));
4311
4470
  }, []);
4312
- useEffect16(() => {
4471
+ useEffect17(() => {
4313
4472
  return engine.onEvent((event) => {
4314
4473
  if (event.type === "stateUpdated") {
4315
4474
  setState((prev) => ({
@@ -4323,7 +4482,7 @@ function App({ engine, hostBridge, readOnly = false }) {
4323
4482
  });
4324
4483
  }, [engine]);
4325
4484
  const isDirty = state.view?.is_dirty;
4326
- useEffect16(() => {
4485
+ useEffect17(() => {
4327
4486
  if (isDirty === void 0) return;
4328
4487
  if (isDirty) hostBridge.markDirty();
4329
4488
  else hostBridge.markClean();
@@ -4336,10 +4495,10 @@ function App({ engine, hostBridge, readOnly = false }) {
4336
4495
  const { relativePath, line, column } = e.detail;
4337
4496
  hostBridge.openFile(relativePath, line, column);
4338
4497
  });
4339
- useEffect16(() => {
4498
+ useEffect17(() => {
4340
4499
  hostBridge.signalReady();
4341
4500
  }, [hostBridge]);
4342
- return /* @__PURE__ */ jsx21(ErrorBoundary, { children: /* @__PURE__ */ jsx21(
4501
+ return /* @__PURE__ */ jsx22(ErrorBoundary, { children: /* @__PURE__ */ jsx22(
4343
4502
  CanvasContext.Provider,
4344
4503
  {
4345
4504
  value: {
@@ -4349,7 +4508,7 @@ function App({ engine, hostBridge, readOnly = false }) {
4349
4508
  localGroupCollapseOverrides,
4350
4509
  toggleLocalGroupCollapse
4351
4510
  },
4352
- children: /* @__PURE__ */ jsx21(ReactFlowProvider, { children: /* @__PURE__ */ jsx21(Canvas, {}) })
4511
+ children: /* @__PURE__ */ jsx22(ReactFlowProvider, { children: /* @__PURE__ */ jsx22(Canvas, { registryBaseUrl, apiToken }) })
4353
4512
  }
4354
4513
  ) });
4355
4514
  }
@@ -5222,7 +5381,8 @@ function createBaseModule() {
5222
5381
  locals: [],
5223
5382
  exports: void 0,
5224
5383
  terraform: void 0,
5225
- providers: []
5384
+ providers: [],
5385
+ top_level_blocks: []
5226
5386
  };
5227
5387
  }
5228
5388
  var Module = {
@@ -5257,6 +5417,9 @@ var Module = {
5257
5417
  for (const v of message.providers) {
5258
5418
  ProviderConfig.encode(v, writer.uint32(82).fork()).join();
5259
5419
  }
5420
+ for (const v of message.top_level_blocks) {
5421
+ Block.encode(v, writer.uint32(90).fork()).join();
5422
+ }
5260
5423
  return writer;
5261
5424
  },
5262
5425
  decode(input, length) {
@@ -5336,6 +5499,13 @@ var Module = {
5336
5499
  message.providers.push(ProviderConfig.decode(reader, reader.uint32()));
5337
5500
  continue;
5338
5501
  }
5502
+ case 11: {
5503
+ if (tag !== 90) {
5504
+ break;
5505
+ }
5506
+ message.top_level_blocks.push(Block.decode(reader, reader.uint32()));
5507
+ continue;
5508
+ }
5339
5509
  }
5340
5510
  if ((tag & 7) === 4 || tag === 0) {
5341
5511
  break;
@@ -5355,7 +5525,8 @@ var Module = {
5355
5525
  locals: globalThis.Array.isArray(object?.locals) ? object.locals.map((e) => Local.fromJSON(e)) : [],
5356
5526
  exports: isSet2(object.exports) ? Exports.fromJSON(object.exports) : void 0,
5357
5527
  terraform: isSet2(object.terraform) ? TerraformBlock.fromJSON(object.terraform) : void 0,
5358
- providers: globalThis.Array.isArray(object?.providers) ? object.providers.map((e) => ProviderConfig.fromJSON(e)) : []
5528
+ providers: globalThis.Array.isArray(object?.providers) ? object.providers.map((e) => ProviderConfig.fromJSON(e)) : [],
5529
+ top_level_blocks: globalThis.Array.isArray(object?.topLevelBlocks) ? object.topLevelBlocks.map((e) => Block.fromJSON(e)) : globalThis.Array.isArray(object?.top_level_blocks) ? object.top_level_blocks.map((e) => Block.fromJSON(e)) : []
5359
5530
  };
5360
5531
  },
5361
5532
  toJSON(message) {
@@ -5390,6 +5561,9 @@ var Module = {
5390
5561
  if (message.providers?.length) {
5391
5562
  obj.providers = message.providers.map((e) => ProviderConfig.toJSON(e));
5392
5563
  }
5564
+ if (message.top_level_blocks?.length) {
5565
+ obj.topLevelBlocks = message.top_level_blocks.map((e) => Block.toJSON(e));
5566
+ }
5393
5567
  return obj;
5394
5568
  },
5395
5569
  create(base) {
@@ -5407,6 +5581,7 @@ var Module = {
5407
5581
  message.exports = object.exports !== void 0 && object.exports !== null ? Exports.fromPartial(object.exports) : void 0;
5408
5582
  message.terraform = object.terraform !== void 0 && object.terraform !== null ? TerraformBlock.fromPartial(object.terraform) : void 0;
5409
5583
  message.providers = object.providers?.map((e) => ProviderConfig.fromPartial(e)) || [];
5584
+ message.top_level_blocks = object.top_level_blocks?.map((e) => Block.fromPartial(e)) || [];
5410
5585
  return message;
5411
5586
  }
5412
5587
  };
@@ -5479,7 +5654,16 @@ var Interface = {
5479
5654
  }
5480
5655
  };
5481
5656
  function createBaseInputDef() {
5482
- return { name: "", type: "", required: false, description: "", default_value: void 0, validation: void 0 };
5657
+ return {
5658
+ name: "",
5659
+ type: "",
5660
+ required: false,
5661
+ description: "",
5662
+ default_value: void 0,
5663
+ validation: void 0,
5664
+ sensitive: false,
5665
+ nullable: void 0
5666
+ };
5483
5667
  }
5484
5668
  var InputDef = {
5485
5669
  encode(message, writer = new BinaryWriter3()) {
@@ -5501,6 +5685,12 @@ var InputDef = {
5501
5685
  if (message.validation !== void 0) {
5502
5686
  ValidationBlock.encode(message.validation, writer.uint32(50).fork()).join();
5503
5687
  }
5688
+ if (message.sensitive !== false) {
5689
+ writer.uint32(56).bool(message.sensitive);
5690
+ }
5691
+ if (message.nullable !== void 0) {
5692
+ writer.uint32(64).bool(message.nullable);
5693
+ }
5504
5694
  return writer;
5505
5695
  },
5506
5696
  decode(input, length) {
@@ -5552,6 +5742,20 @@ var InputDef = {
5552
5742
  message.validation = ValidationBlock.decode(reader, reader.uint32());
5553
5743
  continue;
5554
5744
  }
5745
+ case 7: {
5746
+ if (tag !== 56) {
5747
+ break;
5748
+ }
5749
+ message.sensitive = reader.bool();
5750
+ continue;
5751
+ }
5752
+ case 8: {
5753
+ if (tag !== 64) {
5754
+ break;
5755
+ }
5756
+ message.nullable = reader.bool();
5757
+ continue;
5758
+ }
5555
5759
  }
5556
5760
  if ((tag & 7) === 4 || tag === 0) {
5557
5761
  break;
@@ -5567,7 +5771,9 @@ var InputDef = {
5567
5771
  required: isSet2(object.required) ? globalThis.Boolean(object.required) : false,
5568
5772
  description: isSet2(object.description) ? globalThis.String(object.description) : "",
5569
5773
  default_value: isSet2(object?.defaultValue) ? object.defaultValue : isSet2(object?.default_value) ? object.default_value : void 0,
5570
- validation: isSet2(object.validation) ? ValidationBlock.fromJSON(object.validation) : void 0
5774
+ validation: isSet2(object.validation) ? ValidationBlock.fromJSON(object.validation) : void 0,
5775
+ sensitive: isSet2(object.sensitive) ? globalThis.Boolean(object.sensitive) : false,
5776
+ nullable: isSet2(object.nullable) ? globalThis.Boolean(object.nullable) : void 0
5571
5777
  };
5572
5778
  },
5573
5779
  toJSON(message) {
@@ -5590,6 +5796,12 @@ var InputDef = {
5590
5796
  if (message.validation !== void 0) {
5591
5797
  obj.validation = ValidationBlock.toJSON(message.validation);
5592
5798
  }
5799
+ if (message.sensitive !== false) {
5800
+ obj.sensitive = message.sensitive;
5801
+ }
5802
+ if (message.nullable !== void 0) {
5803
+ obj.nullable = message.nullable;
5804
+ }
5593
5805
  return obj;
5594
5806
  },
5595
5807
  create(base) {
@@ -5603,6 +5815,8 @@ var InputDef = {
5603
5815
  message.description = object.description ?? "";
5604
5816
  message.default_value = object.default_value ?? void 0;
5605
5817
  message.validation = object.validation !== void 0 && object.validation !== null ? ValidationBlock.fromPartial(object.validation) : void 0;
5818
+ message.sensitive = object.sensitive ?? false;
5819
+ message.nullable = object.nullable ?? void 0;
5606
5820
  return message;
5607
5821
  }
5608
5822
  };
@@ -6143,7 +6357,17 @@ var Use_InputsEntry = {
6143
6357
  }
6144
6358
  };
6145
6359
  function createBaseResource() {
6146
- return { id: "", kind: "", type: "", inputs: {}, depends_on: [] };
6360
+ return {
6361
+ id: "",
6362
+ kind: "",
6363
+ type: "",
6364
+ inputs: {},
6365
+ depends_on: [],
6366
+ blocks: [],
6367
+ count: void 0,
6368
+ for_each: void 0,
6369
+ provider_ref: ""
6370
+ };
6147
6371
  }
6148
6372
  var Resource = {
6149
6373
  encode(message, writer = new BinaryWriter3()) {
@@ -6162,6 +6386,18 @@ var Resource = {
6162
6386
  for (const v of message.depends_on) {
6163
6387
  writer.uint32(42).string(v);
6164
6388
  }
6389
+ for (const v of message.blocks) {
6390
+ Block.encode(v, writer.uint32(50).fork()).join();
6391
+ }
6392
+ if (message.count !== void 0) {
6393
+ Binding.encode(message.count, writer.uint32(58).fork()).join();
6394
+ }
6395
+ if (message.for_each !== void 0) {
6396
+ Binding.encode(message.for_each, writer.uint32(66).fork()).join();
6397
+ }
6398
+ if (message.provider_ref !== "") {
6399
+ writer.uint32(74).string(message.provider_ref);
6400
+ }
6165
6401
  return writer;
6166
6402
  },
6167
6403
  decode(input, length) {
@@ -6209,6 +6445,34 @@ var Resource = {
6209
6445
  message.depends_on.push(reader.string());
6210
6446
  continue;
6211
6447
  }
6448
+ case 6: {
6449
+ if (tag !== 50) {
6450
+ break;
6451
+ }
6452
+ message.blocks.push(Block.decode(reader, reader.uint32()));
6453
+ continue;
6454
+ }
6455
+ case 7: {
6456
+ if (tag !== 58) {
6457
+ break;
6458
+ }
6459
+ message.count = Binding.decode(reader, reader.uint32());
6460
+ continue;
6461
+ }
6462
+ case 8: {
6463
+ if (tag !== 66) {
6464
+ break;
6465
+ }
6466
+ message.for_each = Binding.decode(reader, reader.uint32());
6467
+ continue;
6468
+ }
6469
+ case 9: {
6470
+ if (tag !== 74) {
6471
+ break;
6472
+ }
6473
+ message.provider_ref = reader.string();
6474
+ continue;
6475
+ }
6212
6476
  }
6213
6477
  if ((tag & 7) === 4 || tag === 0) {
6214
6478
  break;
@@ -6229,7 +6493,11 @@ var Resource = {
6229
6493
  },
6230
6494
  {}
6231
6495
  ) : {},
6232
- depends_on: globalThis.Array.isArray(object?.dependsOn) ? object.dependsOn.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.depends_on) ? object.depends_on.map((e) => globalThis.String(e)) : []
6496
+ depends_on: globalThis.Array.isArray(object?.dependsOn) ? object.dependsOn.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.depends_on) ? object.depends_on.map((e) => globalThis.String(e)) : [],
6497
+ blocks: globalThis.Array.isArray(object?.blocks) ? object.blocks.map((e) => Block.fromJSON(e)) : [],
6498
+ count: isSet2(object.count) ? Binding.fromJSON(object.count) : void 0,
6499
+ for_each: isSet2(object.forEach) ? Binding.fromJSON(object.forEach) : isSet2(object.for_each) ? Binding.fromJSON(object.for_each) : void 0,
6500
+ provider_ref: isSet2(object.providerRef) ? globalThis.String(object.providerRef) : isSet2(object.provider_ref) ? globalThis.String(object.provider_ref) : ""
6233
6501
  };
6234
6502
  },
6235
6503
  toJSON(message) {
@@ -6255,6 +6523,18 @@ var Resource = {
6255
6523
  if (message.depends_on?.length) {
6256
6524
  obj.dependsOn = message.depends_on;
6257
6525
  }
6526
+ if (message.blocks?.length) {
6527
+ obj.blocks = message.blocks.map((e) => Block.toJSON(e));
6528
+ }
6529
+ if (message.count !== void 0) {
6530
+ obj.count = Binding.toJSON(message.count);
6531
+ }
6532
+ if (message.for_each !== void 0) {
6533
+ obj.forEach = Binding.toJSON(message.for_each);
6534
+ }
6535
+ if (message.provider_ref !== "") {
6536
+ obj.providerRef = message.provider_ref;
6537
+ }
6258
6538
  return obj;
6259
6539
  },
6260
6540
  create(base) {
@@ -6275,6 +6555,10 @@ var Resource = {
6275
6555
  {}
6276
6556
  );
6277
6557
  message.depends_on = object.depends_on?.map((e) => e) || [];
6558
+ message.blocks = object.blocks?.map((e) => Block.fromPartial(e)) || [];
6559
+ message.count = object.count !== void 0 && object.count !== null ? Binding.fromPartial(object.count) : void 0;
6560
+ message.for_each = object.for_each !== void 0 && object.for_each !== null ? Binding.fromPartial(object.for_each) : void 0;
6561
+ message.provider_ref = object.provider_ref ?? "";
6278
6562
  return message;
6279
6563
  }
6280
6564
  };
@@ -6346,6 +6630,172 @@ var Resource_InputsEntry = {
6346
6630
  return message;
6347
6631
  }
6348
6632
  };
6633
+ function createBaseBlock() {
6634
+ return { type: "", labels: [], attributes: [], blocks: [] };
6635
+ }
6636
+ var Block = {
6637
+ encode(message, writer = new BinaryWriter3()) {
6638
+ if (message.type !== "") {
6639
+ writer.uint32(10).string(message.type);
6640
+ }
6641
+ for (const v of message.labels) {
6642
+ writer.uint32(18).string(v);
6643
+ }
6644
+ for (const v of message.attributes) {
6645
+ NamedBinding.encode(v, writer.uint32(26).fork()).join();
6646
+ }
6647
+ for (const v of message.blocks) {
6648
+ Block.encode(v, writer.uint32(34).fork()).join();
6649
+ }
6650
+ return writer;
6651
+ },
6652
+ decode(input, length) {
6653
+ const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6654
+ const end = length === void 0 ? reader.len : reader.pos + length;
6655
+ const message = createBaseBlock();
6656
+ while (reader.pos < end) {
6657
+ const tag = reader.uint32();
6658
+ switch (tag >>> 3) {
6659
+ case 1: {
6660
+ if (tag !== 10) {
6661
+ break;
6662
+ }
6663
+ message.type = reader.string();
6664
+ continue;
6665
+ }
6666
+ case 2: {
6667
+ if (tag !== 18) {
6668
+ break;
6669
+ }
6670
+ message.labels.push(reader.string());
6671
+ continue;
6672
+ }
6673
+ case 3: {
6674
+ if (tag !== 26) {
6675
+ break;
6676
+ }
6677
+ message.attributes.push(NamedBinding.decode(reader, reader.uint32()));
6678
+ continue;
6679
+ }
6680
+ case 4: {
6681
+ if (tag !== 34) {
6682
+ break;
6683
+ }
6684
+ message.blocks.push(Block.decode(reader, reader.uint32()));
6685
+ continue;
6686
+ }
6687
+ }
6688
+ if ((tag & 7) === 4 || tag === 0) {
6689
+ break;
6690
+ }
6691
+ reader.skip(tag & 7);
6692
+ }
6693
+ return message;
6694
+ },
6695
+ fromJSON(object) {
6696
+ return {
6697
+ type: isSet2(object.type) ? globalThis.String(object.type) : "",
6698
+ labels: globalThis.Array.isArray(object?.labels) ? object.labels.map((e) => globalThis.String(e)) : [],
6699
+ attributes: globalThis.Array.isArray(object?.attributes) ? object.attributes.map((e) => NamedBinding.fromJSON(e)) : [],
6700
+ blocks: globalThis.Array.isArray(object?.blocks) ? object.blocks.map((e) => Block.fromJSON(e)) : []
6701
+ };
6702
+ },
6703
+ toJSON(message) {
6704
+ const obj = {};
6705
+ if (message.type !== "") {
6706
+ obj.type = message.type;
6707
+ }
6708
+ if (message.labels?.length) {
6709
+ obj.labels = message.labels;
6710
+ }
6711
+ if (message.attributes?.length) {
6712
+ obj.attributes = message.attributes.map((e) => NamedBinding.toJSON(e));
6713
+ }
6714
+ if (message.blocks?.length) {
6715
+ obj.blocks = message.blocks.map((e) => Block.toJSON(e));
6716
+ }
6717
+ return obj;
6718
+ },
6719
+ create(base) {
6720
+ return Block.fromPartial(base ?? {});
6721
+ },
6722
+ fromPartial(object) {
6723
+ const message = createBaseBlock();
6724
+ message.type = object.type ?? "";
6725
+ message.labels = object.labels?.map((e) => e) || [];
6726
+ message.attributes = object.attributes?.map((e) => NamedBinding.fromPartial(e)) || [];
6727
+ message.blocks = object.blocks?.map((e) => Block.fromPartial(e)) || [];
6728
+ return message;
6729
+ }
6730
+ };
6731
+ function createBaseNamedBinding() {
6732
+ return { name: "", value: void 0 };
6733
+ }
6734
+ var NamedBinding = {
6735
+ encode(message, writer = new BinaryWriter3()) {
6736
+ if (message.name !== "") {
6737
+ writer.uint32(10).string(message.name);
6738
+ }
6739
+ if (message.value !== void 0) {
6740
+ Binding.encode(message.value, writer.uint32(18).fork()).join();
6741
+ }
6742
+ return writer;
6743
+ },
6744
+ decode(input, length) {
6745
+ const reader = input instanceof BinaryReader3 ? input : new BinaryReader3(input);
6746
+ const end = length === void 0 ? reader.len : reader.pos + length;
6747
+ const message = createBaseNamedBinding();
6748
+ while (reader.pos < end) {
6749
+ const tag = reader.uint32();
6750
+ switch (tag >>> 3) {
6751
+ case 1: {
6752
+ if (tag !== 10) {
6753
+ break;
6754
+ }
6755
+ message.name = reader.string();
6756
+ continue;
6757
+ }
6758
+ case 2: {
6759
+ if (tag !== 18) {
6760
+ break;
6761
+ }
6762
+ message.value = Binding.decode(reader, reader.uint32());
6763
+ continue;
6764
+ }
6765
+ }
6766
+ if ((tag & 7) === 4 || tag === 0) {
6767
+ break;
6768
+ }
6769
+ reader.skip(tag & 7);
6770
+ }
6771
+ return message;
6772
+ },
6773
+ fromJSON(object) {
6774
+ return {
6775
+ name: isSet2(object.name) ? globalThis.String(object.name) : "",
6776
+ value: isSet2(object.value) ? Binding.fromJSON(object.value) : void 0
6777
+ };
6778
+ },
6779
+ toJSON(message) {
6780
+ const obj = {};
6781
+ if (message.name !== "") {
6782
+ obj.name = message.name;
6783
+ }
6784
+ if (message.value !== void 0) {
6785
+ obj.value = Binding.toJSON(message.value);
6786
+ }
6787
+ return obj;
6788
+ },
6789
+ create(base) {
6790
+ return NamedBinding.fromPartial(base ?? {});
6791
+ },
6792
+ fromPartial(object) {
6793
+ const message = createBaseNamedBinding();
6794
+ message.name = object.name ?? "";
6795
+ message.value = object.value !== void 0 && object.value !== null ? Binding.fromPartial(object.value) : void 0;
6796
+ return message;
6797
+ }
6798
+ };
6349
6799
  function createBaseExports() {
6350
6800
  return { outputs: {} };
6351
6801
  }
@@ -7232,7 +7682,7 @@ var BackendConfig_ConfigEntry = {
7232
7682
  }
7233
7683
  };
7234
7684
  function createBaseProviderConfig() {
7235
- return { name: "", alias: "", config: {} };
7685
+ return { name: "", alias: "", config: {}, blocks: [] };
7236
7686
  }
7237
7687
  var ProviderConfig = {
7238
7688
  encode(message, writer = new BinaryWriter3()) {
@@ -7247,6 +7697,9 @@ var ProviderConfig = {
7247
7697
  ProviderConfig_ConfigEntry.encode({ key, value }, writer.uint32(26).fork()).join();
7248
7698
  }
7249
7699
  });
7700
+ for (const v of message.blocks) {
7701
+ Block.encode(v, writer.uint32(34).fork()).join();
7702
+ }
7250
7703
  return writer;
7251
7704
  },
7252
7705
  decode(input, length) {
@@ -7280,6 +7733,13 @@ var ProviderConfig = {
7280
7733
  }
7281
7734
  continue;
7282
7735
  }
7736
+ case 4: {
7737
+ if (tag !== 34) {
7738
+ break;
7739
+ }
7740
+ message.blocks.push(Block.decode(reader, reader.uint32()));
7741
+ continue;
7742
+ }
7283
7743
  }
7284
7744
  if ((tag & 7) === 4 || tag === 0) {
7285
7745
  break;
@@ -7298,7 +7758,8 @@ var ProviderConfig = {
7298
7758
  return acc;
7299
7759
  },
7300
7760
  {}
7301
- ) : {}
7761
+ ) : {},
7762
+ blocks: globalThis.Array.isArray(object?.blocks) ? object.blocks.map((e) => Block.fromJSON(e)) : []
7302
7763
  };
7303
7764
  },
7304
7765
  toJSON(message) {
@@ -7318,6 +7779,9 @@ var ProviderConfig = {
7318
7779
  });
7319
7780
  }
7320
7781
  }
7782
+ if (message.blocks?.length) {
7783
+ obj.blocks = message.blocks.map((e) => Block.toJSON(e));
7784
+ }
7321
7785
  return obj;
7322
7786
  },
7323
7787
  create(base) {
@@ -7336,6 +7800,7 @@ var ProviderConfig = {
7336
7800
  },
7337
7801
  {}
7338
7802
  );
7803
+ message.blocks = object.blocks?.map((e) => Block.fromPartial(e)) || [];
7339
7804
  return message;
7340
7805
  }
7341
7806
  };
@@ -16913,6 +17378,17 @@ var PostMessageEngine = class {
16913
17378
  redo() {
16914
17379
  return this.applyAction({ redo: {} });
16915
17380
  }
17381
+ placeModule(params) {
17382
+ return this.applyAction({
17383
+ place_module: {
17384
+ name: params.name,
17385
+ system: params.system,
17386
+ version: params.version,
17387
+ organization: params.organization ?? "",
17388
+ position: params.position
17389
+ }
17390
+ });
17391
+ }
16916
17392
  // ── Groups ──
16917
17393
  createGroup(label, nodeIds) {
16918
17394
  return this.applyAction({ create_group: { label, node_ids: nodeIds } });
@@ -17091,8 +17567,8 @@ var SnapshotCanvasEngine = class {
17091
17567
  }
17092
17568
  this.loadPromise = (async () => {
17093
17569
  const [bundleBytes, layoutsBytes] = await Promise.all([
17094
- this.fetchBytes(input.bundleUrl, "bundle"),
17095
- this.fetchBytes(input.layoutsUrl, "layouts")
17570
+ this.fetchBytes(input.bundleUrl, "bundle", input.headers),
17571
+ this.fetchBytes(input.layoutsUrl, "layouts", input.headers)
17096
17572
  ]);
17097
17573
  const bundle = Bundle.decode(bundleBytes);
17098
17574
  const layouts = LayoutsMap.decode(layoutsBytes).layouts ?? {};
@@ -17103,10 +17579,10 @@ var SnapshotCanvasEngine = class {
17103
17579
  }
17104
17580
  return this.loadPromise;
17105
17581
  }
17106
- async fetchBytes(url, label) {
17582
+ async fetchBytes(url, label, headers) {
17107
17583
  const res = await this.fetchImpl(url, {
17108
17584
  method: "GET",
17109
- headers: { accept: "application/octet-stream" },
17585
+ headers: { accept: "application/octet-stream", ...headers },
17110
17586
  // Credentials: include so same-origin portal fetches carry the
17111
17587
  // session cookie. Embed routes validate the token in the URL
17112
17588
  // instead, so this is a no-op there.
@@ -17195,6 +17671,9 @@ var SnapshotCanvasEngine = class {
17195
17671
  async redo() {
17196
17672
  return READ_ONLY_RESULT;
17197
17673
  }
17674
+ async placeModule(_params) {
17675
+ return READ_ONLY_RESULT;
17676
+ }
17198
17677
  async createGroup(_label, _nodeIds) {
17199
17678
  return READ_ONLY_RESULT;
17200
17679
  }