@lace-cloud/canvas 0.37.1 → 0.38.0

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
@@ -1,6 +1,5 @@
1
1
  import {
2
2
  ApplyUnobservedError,
3
- Bundle,
4
3
  COMMANDS,
5
4
  CommandDetachedError,
6
5
  CommandExitError,
@@ -15,7 +14,6 @@ import {
15
14
  actionState,
16
15
  answering,
17
16
  bridgeCaller,
18
- carriesFailure,
19
17
  commandPathOf,
20
18
  commandUnderWay,
21
19
  connectCaller,
@@ -51,28 +49,22 @@ import {
51
49
  rowActions,
52
50
  sourceHandleId,
53
51
  targetHandleId,
54
- toArgv,
55
- uniqueDiagnostics,
56
52
  wireEndText
57
- } from "./chunk-323MYV3H.mjs";
58
-
59
- // src/index.ts
60
- import { projectCanvasView as projectCanvasView2 } from "@lace-cloud/proto";
61
- import { Toast } from "@lace-cloud/ui/feedback";
53
+ } from "./chunk-GLQVTWB4.mjs";
62
54
 
63
55
  // src/App.tsx
64
56
  import { ReactFlowProvider } from "@xyflow/react";
65
57
  import {
66
- Fragment as Fragment15,
58
+ Fragment as Fragment16,
67
59
  useCallback as useCallback11,
68
60
  useEffect as useEffect13,
69
- useLayoutEffect as useLayoutEffect5,
61
+ useLayoutEffect as useLayoutEffect6,
70
62
  useMemo as useMemo12,
71
63
  useRef as useRef12,
72
64
  useState as useState17,
73
65
  useSyncExternalStore as useSyncExternalStore2
74
66
  } from "react";
75
- import "./App-IFIOMNV7.css";
67
+ import "./App-ZKO6I5AO.css";
76
68
 
77
69
  // src/Canvas.tsx
78
70
  import "@xyflow/react/dist/style.css";
@@ -85,7 +77,7 @@ import {
85
77
  useNodesInitialized,
86
78
  useReactFlow as useReactFlow3
87
79
  } from "@xyflow/react";
88
- import { useCallback as useCallback8, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from "react";
80
+ import { useCallback as useCallback8, useEffect as useEffect9, useLayoutEffect as useLayoutEffect4, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from "react";
89
81
 
90
82
  // src/components/CanvasControls.tsx
91
83
  import { IconButton } from "@lace-cloud/ui";
@@ -286,32 +278,31 @@ function isEmphasized(action, ctx) {
286
278
  }
287
279
 
288
280
  // src/utils/key-chord.ts
281
+ import { commandChord, isMacPlatform } from "@lace-cloud/ui";
282
+
283
+ // src/utils/key-spec.ts
289
284
  var BARE_KEYS = ["Delete", "Backspace"];
290
285
  var MODIFIERS = ["Mod", "Ctrl"];
291
- function parseChord(spec, mac) {
286
+
287
+ // src/utils/key-chord.ts
288
+ var MAC_GLYPHS = { Backspace: "\u232B", Delete: "\u2326" };
289
+ function keyChord(spec) {
290
+ const mac = isMacPlatform();
292
291
  if (BARE_KEYS.some((bare) => bare === spec)) {
293
- return { modifier: void 0, shift: false, key: spec };
292
+ return {
293
+ cap: mac ? MAC_GLYPHS[spec] : spec,
294
+ pressedBy: (e) => !(e.metaKey || e.ctrlKey || e.altKey || e.shiftKey) && e.key === spec
295
+ };
294
296
  }
295
297
  const [head, ...rest] = spec.split("+");
296
298
  const modifier = MODIFIERS.find((m) => m === head);
297
299
  if (!modifier || modifier === "Ctrl" && mac) return void 0;
298
- if (rest.length === 1 && rest[0] !== "") return { modifier, shift: false, key: rest[0] };
299
- if (rest.length === 2 && rest[0] === "Shift" && rest[1] !== "") {
300
- return { modifier, shift: true, key: rest[1] };
301
- }
302
- return void 0;
303
- }
304
- var MAC_GLYPHS = { Backspace: "\u232B", Delete: "\u2326" };
305
- function formatChord(spec, mac) {
306
- const chord = parseChord(spec, mac);
307
- if (!chord) return void 0;
308
- if (!chord.modifier) return mac ? MAC_GLYPHS[chord.key] ?? chord.key : chord.key;
309
- const key = chord.key.length === 1 ? chord.key.toUpperCase() : chord.key;
310
- if (mac) return `${chord.shift ? "\u21E7" : ""}\u2318${key}`;
311
- return ["Ctrl", ...chord.shift ? ["Shift"] : [], key].join("+");
312
- }
313
- function isMacPlatform() {
314
- return typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.userAgent);
300
+ const shift = rest.length === 2 && rest[0] === "Shift";
301
+ const key = rest[rest.length - 1];
302
+ if (rest.length !== (shift ? 2 : 1) || !key) return void 0;
303
+ const chord = commandChord(key, shift);
304
+ if (modifier === "Mod") return chord;
305
+ return { cap: chord.cap, pressedBy: (e) => !e.metaKey && chord.pressedBy(e) };
315
306
  }
316
307
 
317
308
  // src/components/ContextMenu.tsx
@@ -394,7 +385,7 @@ function ContextMenu({
394
385
  children: sectionsOf(actions).map((section, index) => /* @__PURE__ */ jsxs2(Fragment2, { children: [
395
386
  index > 0 ? /* @__PURE__ */ jsx3("hr", { className: "lace-ctx-menu__separator" }) : null,
396
387
  section.actions.map((action) => {
397
- const chord = action.keys?.[0] ? formatChord(action.keys[0], isMacPlatform()) : void 0;
388
+ const chord = action.keys?.[0] ? keyChord(action.keys[0])?.cap : void 0;
398
389
  const reason = disabledReason2(action);
399
390
  return /* @__PURE__ */ jsx3(Tooltip, { content: reason, placement: "bottom-start", fullWidth: true, children: (describedBy) => /* @__PURE__ */ jsxs2(
400
391
  "button",
@@ -936,32 +927,6 @@ function gcArrangement(bundle, arrangement) {
936
927
  return changed ? next : arrangement;
937
928
  }
938
929
 
939
- // src/components/nodes/BadgeRow.tsx
940
- import { Badge as Chip } from "@lace-cloud/ui";
941
- import "./BadgeRow-KVODWDQK.css";
942
- import { jsx as jsx6 } from "react/jsx-runtime";
943
- var VARIANT = {
944
- neutral: "neutral",
945
- warn: "warning",
946
- error: "danger"
947
- };
948
- function BadgeRow({ badges }) {
949
- if (badges.length === 0) return null;
950
- return /* @__PURE__ */ jsx6("div", { className: "lace-badge-row", children: badges.map((b) => /* @__PURE__ */ jsx6(
951
- Chip,
952
- {
953
- "data-badge": b.id,
954
- "data-tone": b.tone,
955
- variant: VARIANT[b.tone],
956
- size: "md",
957
- className: "lace-badge-row__chip",
958
- title: b.title ?? b.label,
959
- children: /* @__PURE__ */ jsx6("span", { className: "lace-badge-row__text", children: b.label })
960
- },
961
- b.id
962
- )) });
963
- }
964
-
965
930
  // src/components/nodes/CallHandles.tsx
966
931
  import { Handle, Position, useUpdateNodeInternals } from "@xyflow/react";
967
932
  import { useEffect as useEffect2 } from "react";
@@ -1032,7 +997,7 @@ function pinFace(color, wired) {
1032
997
  }
1033
998
 
1034
999
  // src/components/nodes/CallHandles.tsx
1035
- import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
1000
+ import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
1036
1001
  var handleStyle = (top, side) => ({
1037
1002
  background: ANY_PIN_COLOR.fill,
1038
1003
  borderColor: ANY_PIN_COLOR.stroke,
@@ -1055,7 +1020,7 @@ var CallHandles = ({
1055
1020
  updateNodeInternals(nodeId);
1056
1021
  }, [nodeId, drawn, updateNodeInternals]);
1057
1022
  return /* @__PURE__ */ jsxs3(Fragment4, { children: [
1058
- callWired && /* @__PURE__ */ jsx7(
1023
+ callWired && /* @__PURE__ */ jsx6(
1059
1024
  Handle,
1060
1025
  {
1061
1026
  id: sourceHandleId(""),
@@ -1066,7 +1031,7 @@ var CallHandles = ({
1066
1031
  style: handleStyle(headerHeight / 2, "right")
1067
1032
  }
1068
1033
  ),
1069
- metaWired.map((meta) => /* @__PURE__ */ jsx7(
1034
+ metaWired.map((meta) => /* @__PURE__ */ jsx6(
1070
1035
  Handle,
1071
1036
  {
1072
1037
  id: targetHandleId(meta),
@@ -1101,7 +1066,7 @@ function useEditorEnvExtras() {
1101
1066
 
1102
1067
  // src/components/nodes/CardActions.tsx
1103
1068
  import "./CardActions-ORDC2L5Y.css";
1104
- import { jsx as jsx8 } from "react/jsx-runtime";
1069
+ import { jsx as jsx7 } from "react/jsx-runtime";
1105
1070
  function CardActions({ target }) {
1106
1071
  const { ctx, runner } = useCanvas();
1107
1072
  const envExtras = useEditorEnvExtras();
@@ -1120,13 +1085,13 @@ function CardActions({ target }) {
1120
1085
  );
1121
1086
  return actions.map((action) => {
1122
1087
  const state = actionState(action, ctx, runner.busy(action, ctx, target));
1123
- return /* @__PURE__ */ jsx8(
1088
+ return /* @__PURE__ */ jsx7(
1124
1089
  Tooltip2,
1125
1090
  {
1126
1091
  name: action.label,
1127
1092
  content: state.disabledReason,
1128
1093
  placement: "bottom-end",
1129
- children: (describedBy) => /* @__PURE__ */ jsx8(
1094
+ children: (describedBy) => /* @__PURE__ */ jsx7(
1130
1095
  "button",
1131
1096
  {
1132
1097
  type: "button",
@@ -1134,7 +1099,7 @@ function CardActions({ target }) {
1134
1099
  "aria-label": action.label,
1135
1100
  "aria-describedby": describedBy,
1136
1101
  ...inertProps2(isInert(state), runOnCard(action)),
1137
- children: action.icon ? /* @__PURE__ */ jsx8(CanvasIcon, { name: action.icon }) : action.label
1102
+ children: action.icon ? /* @__PURE__ */ jsx7(CanvasIcon, { name: action.icon }) : action.label
1138
1103
  }
1139
1104
  )
1140
1105
  },
@@ -1143,8 +1108,35 @@ function CardActions({ target }) {
1143
1108
  });
1144
1109
  }
1145
1110
 
1111
+ // src/components/nodes/CardDecoration.tsx
1112
+ import { StatusBadge } from "@lace-cloud/ui";
1113
+ import "./CardDecoration-VECUWURJ.css";
1114
+ import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
1115
+ var TONE = {
1116
+ neutral: "neutral",
1117
+ warn: "warn",
1118
+ error: "danger"
1119
+ };
1120
+ function CardDecoration({ badges, cloud }) {
1121
+ return /* @__PURE__ */ jsxs4(Fragment5, { children: [
1122
+ badges.length > 0 && /* @__PURE__ */ jsx8("div", { className: "lace-badge-row", children: badges.map((b) => /* @__PURE__ */ jsx8(
1123
+ StatusBadge,
1124
+ {
1125
+ "data-badge": b.id,
1126
+ "data-tone": b.tone,
1127
+ tone: TONE[b.tone],
1128
+ className: "lace-badge-row__chip",
1129
+ title: b.title ?? b.label,
1130
+ children: b.label
1131
+ },
1132
+ b.id
1133
+ )) }),
1134
+ cloud && /* @__PURE__ */ jsx8("span", { className: "lace-node-cloud", "data-cloud": "", role: "img", "aria-label": cloud.label })
1135
+ ] });
1136
+ }
1137
+
1146
1138
  // src/components/nodes/GroupNode.tsx
1147
- import "./GroupNode-2IGAUA6V.css";
1139
+ import "./GroupNode-ZTT7ELHC.css";
1148
1140
 
1149
1141
  // src/components/nodes/NodeDropTarget.tsx
1150
1142
  import { Handle as Handle2, Position as Position2, useStore as useStore3 } from "@xyflow/react";
@@ -1403,7 +1395,7 @@ function useRenameInstance() {
1403
1395
  }
1404
1396
 
1405
1397
  // src/components/nodes/GroupNode.tsx
1406
- import { jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
1398
+ import { jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
1407
1399
  var GroupHeader = ({
1408
1400
  label,
1409
1401
  memberCount,
@@ -1418,7 +1410,7 @@ var GroupHeader = ({
1418
1410
  onEditChange,
1419
1411
  onEditBlur,
1420
1412
  onEditKeyDown
1421
- }) => /* @__PURE__ */ jsxs4(
1413
+ }) => /* @__PURE__ */ jsxs5(
1422
1414
  "div",
1423
1415
  {
1424
1416
  className: `lace-group-node__header lace-group-node__header--${collapsed ? "collapsed" : "expanded"}`,
@@ -1448,7 +1440,7 @@ var GroupHeader = ({
1448
1440
  onClick: (e) => e.stopPropagation()
1449
1441
  }
1450
1442
  ) : /* @__PURE__ */ jsx10("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
1451
- /* @__PURE__ */ jsxs4("span", { className: "lace-group-node__count", children: [
1443
+ /* @__PURE__ */ jsxs5("span", { className: "lace-group-node__count", children: [
1452
1444
  memberCount,
1453
1445
  " ",
1454
1446
  memberCount === 1 ? "module" : "modules"
@@ -1473,7 +1465,7 @@ var InterfacePinRow = ({
1473
1465
  [isInput ? "left" : "right"]: -5,
1474
1466
  top: NODE_ROW_HEIGHT / 2
1475
1467
  };
1476
- return /* @__PURE__ */ jsxs4(
1468
+ return /* @__PURE__ */ jsxs5(
1477
1469
  "div",
1478
1470
  {
1479
1471
  style: {
@@ -1599,7 +1591,7 @@ var GroupNode = ({ id, data }) => {
1599
1591
  ];
1600
1592
  if (collapsed) {
1601
1593
  const bare = data.interfacePins.length === 0;
1602
- return /* @__PURE__ */ jsxs4(
1594
+ return /* @__PURE__ */ jsxs5(
1603
1595
  "div",
1604
1596
  {
1605
1597
  "data-group": data.groupId,
@@ -1610,7 +1602,7 @@ var GroupNode = ({ id, data }) => {
1610
1602
  onMouseLeave: () => setHovered(false),
1611
1603
  children: [
1612
1604
  /* @__PURE__ */ jsx10(GroupHeader, { ...headerProps }),
1613
- /* @__PURE__ */ jsx10(BadgeRow, { badges: data.badges }),
1605
+ /* @__PURE__ */ jsx10(CardDecoration, { badges: data.badges, cloud: data.cloud }),
1614
1606
  callHandles,
1615
1607
  pinRows(true),
1616
1608
  editable && /* @__PURE__ */ jsx10(NodeDropTarget, {})
@@ -1618,7 +1610,7 @@ var GroupNode = ({ id, data }) => {
1618
1610
  }
1619
1611
  );
1620
1612
  }
1621
- return /* @__PURE__ */ jsxs4(
1613
+ return /* @__PURE__ */ jsxs5(
1622
1614
  "div",
1623
1615
  {
1624
1616
  "data-group": data.groupId,
@@ -1629,7 +1621,7 @@ var GroupNode = ({ id, data }) => {
1629
1621
  onMouseLeave: () => setHovered(false),
1630
1622
  children: [
1631
1623
  /* @__PURE__ */ jsx10(GroupHeader, { ...headerProps }),
1632
- /* @__PURE__ */ jsx10(BadgeRow, { badges: data.badges }),
1624
+ /* @__PURE__ */ jsx10(CardDecoration, { badges: data.badges, cloud: data.cloud }),
1633
1625
  callHandles,
1634
1626
  pinRows(false),
1635
1627
  editable && /* @__PURE__ */ jsx10(NodeDropTarget, {})
@@ -1660,13 +1652,12 @@ function hasErrorBadge(badges) {
1660
1652
  function decorate(view, overlayDecorations, diagnostics) {
1661
1653
  if (overlayDecorations.length === 0 && diagnostics.length === 0) return EMPTY_DECORATIONS;
1662
1654
  const nodes = {};
1663
- const addBadge = (nodeId, badge) => {
1664
- if (!nodes[nodeId]) nodes[nodeId] = { badges: [] };
1665
- nodes[nodeId].badges.push(badge);
1666
- };
1655
+ const at = (nodeId) => nodes[nodeId] ?? (nodes[nodeId] = { badges: [] });
1667
1656
  for (const overlayResult of overlayDecorations) {
1668
- for (const [nodeId, decoration] of Object.entries(overlayResult.nodes)) {
1669
- for (const badge of decoration.badges) addBadge(nodeId, badge);
1657
+ for (const [nodeId, { badges, cloud }] of Object.entries(overlayResult.nodes)) {
1658
+ const drawn = at(nodeId);
1659
+ drawn.badges.push(...badges);
1660
+ if (cloud) drawn.cloud = cloud;
1670
1661
  }
1671
1662
  }
1672
1663
  const byNode = /* @__PURE__ */ new Map();
@@ -1676,7 +1667,7 @@ function decorate(view, overlayDecorations, diagnostics) {
1676
1667
  byNode.set(nodeId, [...byNode.get(nodeId) ?? [], diagnostic]);
1677
1668
  }
1678
1669
  for (const [nodeId, held] of byNode) {
1679
- addBadge(nodeId, diagnosticsBadge(held));
1670
+ at(nodeId).badges.push(diagnosticsBadge(held));
1680
1671
  const pins = pinFindings(held);
1681
1672
  if (pins) nodes[nodeId].pins = pins;
1682
1673
  }
@@ -1714,7 +1705,7 @@ function typedName(name, type) {
1714
1705
  }
1715
1706
 
1716
1707
  // src/components/nodes/ModuleNode.tsx
1717
- import "./ModuleNode-3GTXKKVQ.css";
1708
+ import "./ModuleNode-6Q4ZBNGG.css";
1718
1709
 
1719
1710
  // src/components/nodes/node-config-bus.tsx
1720
1711
  import { createContext as createContext2, useContext as useContext2, useRef as useRef4 } from "react";
@@ -1736,7 +1727,7 @@ function useOpenNodeConfig() {
1736
1727
  }
1737
1728
 
1738
1729
  // src/components/nodes/ModuleNode.tsx
1739
- import { Fragment as Fragment5, jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
1730
+ import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
1740
1731
  var ICON_SIZE = 16;
1741
1732
  var LABEL_ROOM = NODE_WIDTH - 28;
1742
1733
  var labelRoom = (shared) => shared ? LABEL_ROOM / 2 - 4 : LABEL_ROOM;
@@ -1761,7 +1752,7 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
1761
1752
  top: NODE_ROW_HEIGHT2 / 2
1762
1753
  };
1763
1754
  const about = `${typedName(pin.name, pin.type)}${pin.description ? ` \u2014 ${pin.description}` : ""}`;
1764
- return /* @__PURE__ */ jsxs5(
1755
+ return /* @__PURE__ */ jsxs6(
1765
1756
  "div",
1766
1757
  {
1767
1758
  className: "lace-pin-row",
@@ -1892,7 +1883,7 @@ var ModuleNode = ({ id, data }) => {
1892
1883
  const bodyHeight = rowCount * NODE_ROW_HEIGHT2;
1893
1884
  const nodeHeight = NODE_HEADER_HEIGHT + bodyHeight;
1894
1885
  const stateClass = hasAnyError ? "lace-module-node--error" : isNew ? "lace-module-node--new" : "";
1895
- return /* @__PURE__ */ jsxs5(
1886
+ return /* @__PURE__ */ jsxs6(
1896
1887
  "div",
1897
1888
  {
1898
1889
  className: `lace-module-node${collapsed ? " lace-module-node--collapsed" : ""}${stateClass ? ` ${stateClass}` : ""}`,
@@ -1900,7 +1891,7 @@ var ModuleNode = ({ id, data }) => {
1900
1891
  onMouseEnter: () => setHovered(true),
1901
1892
  onMouseLeave: () => setHovered(false),
1902
1893
  children: [
1903
- /* @__PURE__ */ jsxs5(
1894
+ /* @__PURE__ */ jsxs6(
1904
1895
  "div",
1905
1896
  {
1906
1897
  className: "lace-module-node__header",
@@ -1953,7 +1944,7 @@ var ModuleNode = ({ id, data }) => {
1953
1944
  ]
1954
1945
  }
1955
1946
  ),
1956
- /* @__PURE__ */ jsx12(BadgeRow, { badges }),
1947
+ /* @__PURE__ */ jsx12(CardDecoration, { badges, cloud: data.cloud }),
1957
1948
  /* @__PURE__ */ jsx12(
1958
1949
  CallHandles,
1959
1950
  {
@@ -1963,7 +1954,7 @@ var ModuleNode = ({ id, data }) => {
1963
1954
  headerHeight: NODE_HEADER_HEIGHT
1964
1955
  }
1965
1956
  ),
1966
- !collapsed && /* @__PURE__ */ jsxs5("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
1957
+ !collapsed && /* @__PURE__ */ jsxs6("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
1967
1958
  shownInputs.map((pin, i) => /* @__PURE__ */ jsx12(
1968
1959
  PinRow,
1969
1960
  {
@@ -1987,7 +1978,7 @@ var ModuleNode = ({ id, data }) => {
1987
1978
  },
1988
1979
  `out:${pin.name}`
1989
1980
  )),
1990
- hiddenInputCount > 0 && /* @__PURE__ */ jsxs5(
1981
+ hiddenInputCount > 0 && /* @__PURE__ */ jsxs6(
1991
1982
  "div",
1992
1983
  {
1993
1984
  className: "lace-module-node__hidden-count",
@@ -2012,7 +2003,7 @@ var ModuleNode = ({ id, data }) => {
2012
2003
  }
2013
2004
  )
2014
2005
  ] }),
2015
- collapsed && /* @__PURE__ */ jsxs5(Fragment5, { children: [
2006
+ collapsed && /* @__PURE__ */ jsxs6(Fragment6, { children: [
2016
2007
  inputs.map((pin, i) => {
2017
2008
  const face = pinFace(pinColor(pin), !!pin.wired);
2018
2009
  return /* @__PURE__ */ jsx12(
@@ -2060,7 +2051,7 @@ var ModuleNode = ({ id, data }) => {
2060
2051
  );
2061
2052
  })
2062
2053
  ] }),
2063
- editable && /* @__PURE__ */ jsxs5(Fragment5, { children: [
2054
+ editable && /* @__PURE__ */ jsxs6(Fragment6, { children: [
2064
2055
  /* @__PURE__ */ jsx12(
2065
2056
  Handle4,
2066
2057
  {
@@ -2080,7 +2071,7 @@ var ModuleNode = ({ id, data }) => {
2080
2071
  var ModuleNode_default = ModuleNode;
2081
2072
 
2082
2073
  // src/components/PaperGrid.tsx
2083
- import "./PaperGrid-JG4GBRDP.css";
2074
+ import "./PaperGrid-NNLCTIEC.css";
2084
2075
  import { jsx as jsx13 } from "react/jsx-runtime";
2085
2076
  function PaperGrid() {
2086
2077
  return /* @__PURE__ */ jsx13("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
@@ -2548,7 +2539,8 @@ var CORE_EDITOR_ACTIONS = [
2548
2539
  ];
2549
2540
 
2550
2541
  // src/core/use-action-keys.ts
2551
- import { useEffect as useEffect6 } from "react";
2542
+ import { listenKeydown } from "@lace-cloud/ui";
2543
+ import { useEffect as useEffect6, useLayoutEffect as useLayoutEffect2 } from "react";
2552
2544
 
2553
2545
  // src/contribution-types.ts
2554
2546
  var KEY_SCOPES = ["surface", "app"];
@@ -2623,45 +2615,33 @@ function useFocusKeptOnRemoval(target, mounted) {
2623
2615
  function keyScopeOf(action) {
2624
2616
  return action.keyScope ?? "surface";
2625
2617
  }
2626
- function matchesKey(e, spec, mac) {
2627
- const chord = parseChord(spec, mac);
2628
- if (!chord) return false;
2629
- const modHeld = e.metaKey || e.ctrlKey;
2630
- const held = { Mod: modHeld, Ctrl: e.ctrlKey && !e.metaKey };
2631
- if (chord.modifier ? !held[chord.modifier] : modHeld || e.altKey) return false;
2632
- if (e.shiftKey !== chord.shift) return false;
2633
- return e.key.toLowerCase() === chord.key.toLowerCase();
2634
- }
2635
2618
  function useActionKeys(actions, ctx, runner, envExtras) {
2636
- useEffect6(() => {
2619
+ useLayoutEffect2(() => {
2637
2620
  if (!ctx || !envExtras) return;
2638
2621
  const activeCtx = ctx;
2639
2622
  const activeEnvExtras = envExtras;
2640
2623
  const targets = targetsByCtx.get(ctx) ?? {};
2641
2624
  const target = {};
2642
- const mac = isMacPlatform();
2643
2625
  function bind(scope) {
2644
2626
  const { handlesFormTargets } = KEY_SCOPE_RULES[scope];
2645
2627
  const element = targets[scope];
2646
2628
  if (!element) return void 0;
2647
- const keyed = actions.filter((a) => (a.keys?.length ?? 0) > 0 && keyScopeOf(a) === scope);
2629
+ const keyed = actions.filter((a) => keyScopeOf(a) === scope).flatMap(
2630
+ (action) => (action.keys ?? []).flatMap((spec) => {
2631
+ const chord = keyChord(spec);
2632
+ return chord ? [{ action, chord }] : [];
2633
+ })
2634
+ );
2648
2635
  function onKeyDown(e) {
2649
- if (!(e instanceof KeyboardEvent)) return;
2650
2636
  if (e.defaultPrevented) return;
2651
2637
  if (!handlesFormTargets && isFormTarget(e.target)) return;
2652
- for (const action of keyed) {
2653
- for (const spec of action.keys ?? []) {
2654
- if (matchesKey(e, spec, mac)) {
2655
- e.preventDefault();
2656
- e.stopPropagation();
2657
- void runner.run(action, activeCtx, target, activeEnvExtras);
2658
- return;
2659
- }
2660
- }
2661
- }
2638
+ const hit = keyed.find(({ chord }) => chord.pressedBy(e));
2639
+ if (!hit) return;
2640
+ e.preventDefault();
2641
+ e.stopPropagation();
2642
+ void runner.run(hit.action, activeCtx, target, activeEnvExtras);
2662
2643
  }
2663
- element.addEventListener("keydown", onKeyDown);
2664
- return () => element.removeEventListener("keydown", onKeyDown);
2644
+ return listenKeydown(element, onKeyDown);
2665
2645
  }
2666
2646
  const unbind = KEY_SCOPES.map(bind);
2667
2647
  return () => {
@@ -2740,6 +2720,7 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2740
2720
  collapsed: true,
2741
2721
  hasErrors,
2742
2722
  badges: groupBadges,
2723
+ cloud: [group2.id, ...group2.node_ids].map((id) => decorations?.nodes[id]?.cloud).find(Boolean),
2743
2724
  interfacePins: pinsOf(group2),
2744
2725
  callWired: !!group2.call_wired,
2745
2726
  metaWired: group2.meta_wired ?? []
@@ -2757,6 +2738,7 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2757
2738
  collapsed: false,
2758
2739
  hasErrors: hasErrorBadge(groupBadges),
2759
2740
  badges: groupBadges,
2741
+ cloud: decorations?.nodes[group2.id]?.cloud,
2760
2742
  interfacePins: pinsOf(group2),
2761
2743
  callWired: !!group2.call_wired,
2762
2744
  metaWired: group2.meta_wired ?? []
@@ -2772,8 +2754,7 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2772
2754
  data: {
2773
2755
  ...n,
2774
2756
  isNew: newNodeIds.has(n.id),
2775
- badges: decorations?.nodes[n.id]?.badges,
2776
- pins: decorations?.nodes[n.id]?.pins
2757
+ ...decorations?.nodes[n.id]
2777
2758
  }
2778
2759
  });
2779
2760
  }
@@ -2851,7 +2832,7 @@ function useNewNodeTracking(view) {
2851
2832
  // src/hooks/useViewport.ts
2852
2833
  import { extentOf as extentOf2 } from "@lace-cloud/proto";
2853
2834
  import { useReactFlow as useReactFlow2 } from "@xyflow/react";
2854
- import { useCallback as useCallback7, useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as useRef7 } from "react";
2835
+ import { useCallback as useCallback7, useEffect as useEffect8, useLayoutEffect as useLayoutEffect3, useMemo as useMemo5, useRef as useRef7 } from "react";
2855
2836
  var FIT = { duration: 300, maxZoom: 1 };
2856
2837
  var PAN_MS = 300;
2857
2838
  var RESIZE_MS = 200;
@@ -2909,7 +2890,7 @@ function useViewport(pane, focusIds) {
2909
2890
  );
2910
2891
  const resized = useRef7((_was, _after) => {
2911
2892
  });
2912
- useLayoutEffect2(() => {
2893
+ useLayoutEffect3(() => {
2913
2894
  resized.current = (was, after) => {
2914
2895
  const from = heading()?.viewport ?? getViewport();
2915
2896
  const drawn = getNodes().filter((n) => !n.hidden);
@@ -2990,7 +2971,7 @@ function useViewport(pane, focusIds) {
2990
2971
  }
2991
2972
 
2992
2973
  // src/Canvas.tsx
2993
- import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
2974
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
2994
2975
  var nodeTypes = {
2995
2976
  moduleNode: ModuleNode_default,
2996
2977
  groupNode: GroupNode_default
@@ -3117,7 +3098,7 @@ function CompositeEditor({
3117
3098
  y: e.clientY
3118
3099
  });
3119
3100
  };
3120
- return /* @__PURE__ */ jsxs6(
3101
+ return /* @__PURE__ */ jsxs7(
3121
3102
  ReactFlow,
3122
3103
  {
3123
3104
  onInit,
@@ -3196,13 +3177,13 @@ function Canvas({ height }) {
3196
3177
  }, [selection.nodes, clearNew]);
3197
3178
  const [pane, setPane] = useState8(null);
3198
3179
  const surfaceRef = useRef8(null);
3199
- useEffect9(() => {
3180
+ useLayoutEffect4(() => {
3200
3181
  registerKeyTarget(ctx, "surface", surfaceRef.current);
3201
3182
  return () => registerKeyTarget(ctx, "surface", null);
3202
3183
  }, [ctx]);
3203
3184
  const onSurfacePointerDown = useCallback8((e) => {
3204
3185
  if (isFormTarget(e.target)) return;
3205
- surfaceRef.current?.focus();
3186
+ surfaceRef.current?.focus({ preventScroll: true });
3206
3187
  }, []);
3207
3188
  useFocusKeptOnRemoval(surfaceRef, true);
3208
3189
  const goToNodeRef = useRef8(null);
@@ -3210,7 +3191,7 @@ function Canvas({ height }) {
3210
3191
  goToNodeRef.current = fn;
3211
3192
  }, []);
3212
3193
  const reported = useRef8(selection);
3213
- useLayoutEffect3(() => {
3194
+ useLayoutEffect4(() => {
3214
3195
  reported.current = selection;
3215
3196
  }, [selection]);
3216
3197
  const selectNow = useCallback8(
@@ -3304,7 +3285,7 @@ function Canvas({ height }) {
3304
3285
  },
3305
3286
  [runner, menuCtx, menuTarget, makeEnvExtras]
3306
3287
  );
3307
- return /* @__PURE__ */ jsx14(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ jsxs6(
3288
+ return /* @__PURE__ */ jsx14(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ jsxs7(
3308
3289
  "div",
3309
3290
  {
3310
3291
  ref: surfaceRef,
@@ -3329,7 +3310,7 @@ function Canvas({ height }) {
3329
3310
  onDismiss: dismissContextMenu
3330
3311
  }
3331
3312
  ),
3332
- /* @__PURE__ */ jsxs6("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
3313
+ /* @__PURE__ */ jsxs7("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
3333
3314
  /* @__PURE__ */ jsx14(
3334
3315
  CompositeEditor,
3335
3316
  {
@@ -3359,8 +3340,18 @@ function Canvas({ height }) {
3359
3340
  ) });
3360
3341
  }
3361
3342
 
3343
+ // src/components/CanvasRoot.tsx
3344
+ import { forwardRef } from "react";
3345
+ import { jsx as jsx15 } from "react/jsx-runtime";
3346
+ var CanvasRoot = forwardRef(
3347
+ function CanvasRoot2(props, ref) {
3348
+ return /* @__PURE__ */ jsx15("div", { ...props, ref, "data-lace-type-set": "compact" });
3349
+ }
3350
+ );
3351
+ var CanvasRoot_default = CanvasRoot;
3352
+
3362
3353
  // src/components/Drawer.tsx
3363
- import { useCallback as useCallback9, useLayoutEffect as useLayoutEffect4, useRef as useRef9, useState as useState9 } from "react";
3354
+ import { useCallback as useCallback9, useLayoutEffect as useLayoutEffect5, useRef as useRef9, useState as useState9 } from "react";
3364
3355
 
3365
3356
  // src/utils/style-vars.ts
3366
3357
  function readTokenPx(el, name) {
@@ -3368,8 +3359,8 @@ function readTokenPx(el, name) {
3368
3359
  }
3369
3360
 
3370
3361
  // src/components/Drawer.tsx
3371
- import "./Drawer-34ZYTEWE.css";
3372
- import { jsx as jsx15, jsxs as jsxs7 } from "react/jsx-runtime";
3362
+ import "./Drawer-R4IFVVJE.css";
3363
+ import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
3373
3364
  var KEY_STEP = 16;
3374
3365
  function readDrawerBounds(el) {
3375
3366
  const min = readTokenPx(el, "--lace-size-drawer-min");
@@ -3386,10 +3377,10 @@ function Drawer({ label, children }) {
3386
3377
  const [width, setWidth] = useState9(null);
3387
3378
  const [measured, setMeasured] = useState9(0);
3388
3379
  const drag = useRef9(null);
3389
- useLayoutEffect4(() => {
3380
+ useLayoutEffect5(() => {
3390
3381
  if (ref.current) setBounds(readDrawerBounds(ref.current));
3391
3382
  }, []);
3392
- useLayoutEffect4(() => {
3383
+ useLayoutEffect5(() => {
3393
3384
  if (ref.current) setMeasured(Math.round(ref.current.getBoundingClientRect().width));
3394
3385
  }, [width]);
3395
3386
  const onPointerDown = useCallback9((e) => {
@@ -3415,8 +3406,8 @@ function Drawer({ label, children }) {
3415
3406
  setWidth(clampWidth(next, bounds));
3416
3407
  };
3417
3408
  const style = width === null ? void 0 : { "--drawer-width": `${width}px` };
3418
- return /* @__PURE__ */ jsxs7("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
3419
- /* @__PURE__ */ jsx15(
3409
+ return /* @__PURE__ */ jsxs8("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
3410
+ /* @__PURE__ */ jsx16(
3420
3411
  "div",
3421
3412
  {
3422
3413
  className: "lace-app__drawer-handle",
@@ -3433,19 +3424,19 @@ function Drawer({ label, children }) {
3433
3424
  onKeyDown
3434
3425
  }
3435
3426
  ),
3436
- /* @__PURE__ */ jsx15("div", { className: "lace-app__drawer-body", children })
3427
+ /* @__PURE__ */ jsx16("div", { className: "lace-app__drawer-body", children })
3437
3428
  ] });
3438
3429
  }
3439
3430
 
3440
3431
  // src/components/ErrorBoundary.tsx
3441
3432
  import React from "react";
3442
3433
  import "./ErrorBoundary-IXSIVZFH.css";
3443
- import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
3434
+ import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
3444
3435
  function ErrorState({ message }) {
3445
- return /* @__PURE__ */ jsxs8("div", { className: "lace-error-state", role: "alert", children: [
3446
- /* @__PURE__ */ jsx16("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
3447
- /* @__PURE__ */ jsx16("pre", { className: "lace-error-state__message", children: message }),
3448
- /* @__PURE__ */ jsx16(
3436
+ return /* @__PURE__ */ jsxs9("div", { className: "lace-error-state", role: "alert", children: [
3437
+ /* @__PURE__ */ jsx17("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
3438
+ /* @__PURE__ */ jsx17("pre", { className: "lace-error-state__message", children: message }),
3439
+ /* @__PURE__ */ jsx17(
3449
3440
  "button",
3450
3441
  {
3451
3442
  type: "button",
@@ -3466,7 +3457,7 @@ var ErrorBoundary = class extends React.Component {
3466
3457
  }
3467
3458
  render() {
3468
3459
  if (this.state.error) {
3469
- return /* @__PURE__ */ jsx16(ErrorState, { message: this.state.error.message });
3460
+ return /* @__PURE__ */ jsx17(ErrorState, { message: this.state.error.message });
3470
3461
  }
3471
3462
  return this.props.children;
3472
3463
  }
@@ -3475,26 +3466,25 @@ var ErrorBoundary = class extends React.Component {
3475
3466
  // src/components/ToolbarAction.tsx
3476
3467
  import { Button, IconButton as IconButton2, Spinner } from "@lace-cloud/ui";
3477
3468
  import "./ToolbarAction-PQNWHJSU.css";
3478
- import { jsx as jsx17, jsxs as jsxs9 } from "react/jsx-runtime";
3469
+ import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
3479
3470
  var TIP = "bottom-start";
3480
3471
  function actionTip(keys, reason) {
3481
- const chord = keys?.[0] ? formatChord(keys[0], isMacPlatform()) : void 0;
3472
+ const chord = keys?.[0] ? keyChord(keys[0])?.cap : void 0;
3482
3473
  if (!chord && !reason) return void 0;
3483
- return /* @__PURE__ */ jsxs9("span", { className: "lace-action-tip", children: [
3484
- chord ? /* @__PURE__ */ jsx17("kbd", { className: "lace-action-tip__key", children: chord }) : null,
3485
- reason ? /* @__PURE__ */ jsx17("span", { className: "lace-action-tip__reason", children: reason }) : null
3474
+ return /* @__PURE__ */ jsxs10("span", { className: "lace-action-tip", children: [
3475
+ chord ? /* @__PURE__ */ jsx18("kbd", { className: "lace-action-tip__key", children: chord }) : null,
3476
+ reason ? /* @__PURE__ */ jsx18("span", { className: "lace-action-tip__reason", children: reason }) : null
3486
3477
  ] });
3487
3478
  }
3488
3479
  function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, busyLabel, onRun }) {
3489
3480
  const busy = busyLabel !== void 0;
3490
3481
  const inert = isInert({ disabledReason: disabledReason2, busyLabel });
3491
3482
  const tooltip = actionTip(action.keys, disabledReason2);
3492
- const glyph = action.icon ? /* @__PURE__ */ jsx17(CanvasIcon, { name: action.icon }) : void 0;
3483
+ const glyph = action.icon ? /* @__PURE__ */ jsx18(CanvasIcon, { name: action.icon }) : void 0;
3493
3484
  if (action.primary) {
3494
- return /* @__PURE__ */ jsx17(
3485
+ return /* @__PURE__ */ jsx18(
3495
3486
  Button,
3496
3487
  {
3497
- rung: true,
3498
3488
  size: "sm",
3499
3489
  variant: emphasized && !inert ? "primary" : "secondary",
3500
3490
  icon: busy ? void 0 : glyph,
@@ -3510,10 +3500,10 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3510
3500
  );
3511
3501
  }
3512
3502
  if (glyph) {
3513
- return /* @__PURE__ */ jsx17(
3503
+ return /* @__PURE__ */ jsx18(
3514
3504
  IconButton2,
3515
3505
  {
3516
- icon: busy ? /* @__PURE__ */ jsx17(Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
3506
+ icon: busy ? /* @__PURE__ */ jsx18(Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
3517
3507
  "aria-label": action.label,
3518
3508
  size: "md",
3519
3509
  "aria-disabled": inert,
@@ -3523,10 +3513,9 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3523
3513
  }
3524
3514
  );
3525
3515
  }
3526
- return /* @__PURE__ */ jsx17(
3516
+ return /* @__PURE__ */ jsx18(
3527
3517
  Button,
3528
3518
  {
3529
- rung: true,
3530
3519
  size: "sm",
3531
3520
  variant: "ghost",
3532
3521
  loading: busy,
@@ -3543,7 +3532,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3543
3532
 
3544
3533
  // src/core/CommandArgsForm.tsx
3545
3534
  import { useState as useState10 } from "react";
3546
- import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
3535
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
3547
3536
  function flagsOf(path) {
3548
3537
  return COMMANDS[path].flags;
3549
3538
  }
@@ -3551,7 +3540,7 @@ function CommandArgsForm({ form }) {
3551
3540
  const [values, setValues] = useState10({});
3552
3541
  if (!form) return null;
3553
3542
  const flags = isCommandPath(form.path) ? flagsOf(form.path) : {};
3554
- return /* @__PURE__ */ jsxs10(
3543
+ return /* @__PURE__ */ jsxs11(
3555
3544
  "form",
3556
3545
  {
3557
3546
  className: "lace-command-args-form",
@@ -3562,16 +3551,16 @@ function CommandArgsForm({ form }) {
3562
3551
  children: [
3563
3552
  form.missing.map((key) => {
3564
3553
  const flagType = flags[key]?.type;
3565
- return /* @__PURE__ */ jsxs10("label", { className: "lace-command-args-form__field", children: [
3566
- /* @__PURE__ */ jsx18("span", { children: key }),
3567
- flagType === "bool" ? /* @__PURE__ */ jsx18(
3554
+ return /* @__PURE__ */ jsxs11("label", { className: "lace-command-args-form__field", children: [
3555
+ /* @__PURE__ */ jsx19("span", { children: key }),
3556
+ flagType === "bool" ? /* @__PURE__ */ jsx19(
3568
3557
  "input",
3569
3558
  {
3570
3559
  type: "checkbox",
3571
3560
  checked: Boolean(values[key]),
3572
3561
  onChange: (e) => setValues((prev) => ({ ...prev, [key]: e.target.checked }))
3573
3562
  }
3574
- ) : /* @__PURE__ */ jsx18(
3563
+ ) : /* @__PURE__ */ jsx19(
3575
3564
  "input",
3576
3565
  {
3577
3566
  type: "text",
@@ -3582,9 +3571,9 @@ function CommandArgsForm({ form }) {
3582
3571
  )
3583
3572
  ] }, key);
3584
3573
  }),
3585
- /* @__PURE__ */ jsxs10("div", { className: "lace-command-args-form__actions", children: [
3586
- /* @__PURE__ */ jsx18("button", { type: "submit", children: "Continue" }),
3587
- /* @__PURE__ */ jsx18("button", { type: "button", onClick: form.cancel, children: "Cancel" })
3574
+ /* @__PURE__ */ jsxs11("div", { className: "lace-command-args-form__actions", children: [
3575
+ /* @__PURE__ */ jsx19("button", { type: "submit", children: "Continue" }),
3576
+ /* @__PURE__ */ jsx19("button", { type: "button", onClick: form.cancel, children: "Cancel" })
3588
3577
  ] })
3589
3578
  ]
3590
3579
  }
@@ -3602,7 +3591,7 @@ import { useEffect as useEffect10, useMemo as useMemo8, useRef as useRef10, useS
3602
3591
 
3603
3592
  // src/core/panel-scope.tsx
3604
3593
  import { createContext as createContext3, useContext as useContext3, useMemo as useMemo7 } from "react";
3605
- import { jsx as jsx19 } from "react/jsx-runtime";
3594
+ import { jsx as jsx20 } from "react/jsx-runtime";
3606
3595
  var noopReportError = () => {
3607
3596
  };
3608
3597
  var PanelScopeContext = createContext3(null);
@@ -3619,7 +3608,7 @@ function PanelScope({
3619
3608
  () => ({ ctx, target, paths: new Set(paths), tick, reportError }),
3620
3609
  [ctx, target, paths, tick, reportError]
3621
3610
  );
3622
- return /* @__PURE__ */ jsx19(PanelScopeContext.Provider, { value, children });
3611
+ return /* @__PURE__ */ jsx20(PanelScopeContext.Provider, { value, children });
3623
3612
  }
3624
3613
  function usePanelScope() {
3625
3614
  const value = useContext3(PanelScopeContext);
@@ -3711,6 +3700,7 @@ function defineOverlay(o) {
3711
3700
  return {
3712
3701
  id: o.id,
3713
3702
  paths: [o.read.path],
3703
+ requiredContext: o.requiredContext,
3714
3704
  useDecorations(ctx) {
3715
3705
  const { data } = useCommandRead(o.read);
3716
3706
  const view = ctx.view;
@@ -3723,6 +3713,14 @@ function defineOverlay(o) {
3723
3713
  }
3724
3714
 
3725
3715
  // src/core/overlays/describe.ts
3716
+ function resourcesByNode(view, resources) {
3717
+ const counts = /* @__PURE__ */ new Map();
3718
+ for (const { address } of resources) {
3719
+ const nodeId = nodeIdForAddress(view, address);
3720
+ if (nodeId !== null) counts.set(nodeId, (counts.get(nodeId) ?? 0) + 1);
3721
+ }
3722
+ return counts;
3723
+ }
3726
3724
  function decorateDescribe(view, data) {
3727
3725
  const nodes = {};
3728
3726
  const addBadge = (nodeId, badge) => {
@@ -3730,13 +3728,7 @@ function decorateDescribe(view, data) {
3730
3728
  nodes[nodeId].badges.push(badge);
3731
3729
  };
3732
3730
  if (data.state) {
3733
- const countByNode = /* @__PURE__ */ new Map();
3734
- for (const resource of data.state.resources) {
3735
- const nodeId = nodeIdForAddress(view, resource.address);
3736
- if (nodeId === null) continue;
3737
- countByNode.set(nodeId, (countByNode.get(nodeId) ?? 0) + 1);
3738
- }
3739
- for (const [nodeId, count] of countByNode) {
3731
+ for (const [nodeId, count] of resourcesByNode(view, data.state.resources)) {
3740
3732
  addBadge(nodeId, {
3741
3733
  id: "resources",
3742
3734
  tone: "neutral",
@@ -3766,29 +3758,47 @@ var describeOverlay = defineOverlay({
3766
3758
  decorate: decorateDescribe
3767
3759
  });
3768
3760
 
3761
+ // src/core/overlays/plan.ts
3762
+ function decoratePlan(view, data) {
3763
+ const nodes = {};
3764
+ for (const [nodeId, count] of resourcesByNode(view, data.plan?.resources ?? [])) {
3765
+ nodes[nodeId] = { badges: [], cloud: { label: counted(count, "planned change") } };
3766
+ }
3767
+ return { nodes };
3768
+ }
3769
+ var planOverlay = defineOverlay({
3770
+ id: "plan",
3771
+ read: {
3772
+ path: "run plan",
3773
+ args: (ctx) => ctx.run ? { run: ctx.run.id } : null
3774
+ },
3775
+ requiredContext: ["run"],
3776
+ decorate: decoratePlan
3777
+ });
3778
+
3769
3779
  // src/core/panels/RowActionBanner.tsx
3770
3780
  import { Button as Button2 } from "@lace-cloud/ui";
3771
3781
 
3772
3782
  // src/components/Banner.tsx
3773
- import "./Banner-4TSIKYLF.css";
3774
- import { jsx as jsx20, jsxs as jsxs11 } from "react/jsx-runtime";
3783
+ import "./Banner-V657C2TO.css";
3784
+ import { jsx as jsx21, jsxs as jsxs12 } from "react/jsx-runtime";
3775
3785
  function Banner({ severity, message, className, actions }) {
3776
- return /* @__PURE__ */ jsxs11(
3786
+ return /* @__PURE__ */ jsxs12(
3777
3787
  "div",
3778
3788
  {
3779
3789
  className: `lace-banner lace-banner--${severity} ${className}`,
3780
3790
  role: severity === "error" ? "alert" : "status",
3781
3791
  children: [
3782
- /* @__PURE__ */ jsx20("span", { className: "lace-banner__icon", children: /* @__PURE__ */ jsx20(CanvasIcon, { name: severity }) }),
3783
- /* @__PURE__ */ jsx20("span", { className: "lace-banner__message", children: message }),
3784
- actions ? /* @__PURE__ */ jsx20("span", { className: "lace-banner__actions", children: actions }) : null
3792
+ /* @__PURE__ */ jsx21("span", { className: "lace-banner__icon", children: /* @__PURE__ */ jsx21(CanvasIcon, { name: severity }) }),
3793
+ /* @__PURE__ */ jsx21("span", { className: "lace-banner__message", children: message }),
3794
+ actions ? /* @__PURE__ */ jsx21("span", { className: "lace-banner__actions", children: actions }) : null
3785
3795
  ]
3786
3796
  }
3787
3797
  );
3788
3798
  }
3789
3799
 
3790
3800
  // src/core/panels/RowActionBanner.tsx
3791
- import { jsx as jsx21 } from "react/jsx-runtime";
3801
+ import { jsx as jsx22 } from "react/jsx-runtime";
3792
3802
  function bannerMessage(opening, actions) {
3793
3803
  return [opening, ...actions.flatMap((action) => action.choice ? [action.choice] : [])].join(
3794
3804
  " "
@@ -3798,7 +3808,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3798
3808
  const { runner } = useCanvas();
3799
3809
  const envExtras = useEditorEnvExtras();
3800
3810
  const actions = rowActionsFor(ctx, panelId);
3801
- return /* @__PURE__ */ jsx21(
3811
+ return /* @__PURE__ */ jsx22(
3802
3812
  Banner,
3803
3813
  {
3804
3814
  severity,
@@ -3806,10 +3816,9 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3806
3816
  message: bannerMessage(opening, actions),
3807
3817
  actions: actions.length === 0 ? void 0 : actions.map((action) => {
3808
3818
  const state = actionState(action, ctx, runner.busy(action, ctx, {}));
3809
- return /* @__PURE__ */ jsx21(
3819
+ return /* @__PURE__ */ jsx22(
3810
3820
  Button2,
3811
3821
  {
3812
- rung: true,
3813
3822
  size: "sm",
3814
3823
  variant: "secondary",
3815
3824
  className: `${className}__${action.id}`,
@@ -3827,9 +3836,9 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3827
3836
  }
3828
3837
 
3829
3838
  // src/core/panels/ConflictBanner.tsx
3830
- import { jsx as jsx22 } from "react/jsx-runtime";
3839
+ import { jsx as jsx23 } from "react/jsx-runtime";
3831
3840
  function ConflictBanner({ ctx }) {
3832
- return /* @__PURE__ */ jsx22(
3841
+ return /* @__PURE__ */ jsx23(
3833
3842
  RowActionBanner,
3834
3843
  {
3835
3844
  ctx,
@@ -3853,17 +3862,17 @@ var conflictPanel = {
3853
3862
  import { Button as Button3 } from "@lace-cloud/ui";
3854
3863
 
3855
3864
  // src/components/Identifier.tsx
3856
- import { Fragment as Fragment6 } from "react";
3865
+ import { Fragment as Fragment7 } from "react";
3857
3866
  import "./Identifier-V6MZ37EG.css";
3858
- import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
3867
+ import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
3859
3868
  function identifierSegments(text) {
3860
3869
  return text.split(/(?<=[_.])/);
3861
3870
  }
3862
3871
  function Identifier({ text, className }) {
3863
- return /* @__PURE__ */ jsx23("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => (
3872
+ return /* @__PURE__ */ jsx24("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => (
3864
3873
  // biome-ignore lint/suspicious/noArrayIndexKey: a segment's place in the name is its identity.
3865
- /* @__PURE__ */ jsxs12(Fragment6, { children: [
3866
- i > 0 ? /* @__PURE__ */ jsx23("wbr", {}) : null,
3874
+ /* @__PURE__ */ jsxs13(Fragment7, { children: [
3875
+ i > 0 ? /* @__PURE__ */ jsx24("wbr", {}) : null,
3867
3876
  segment
3868
3877
  ] }, i)
3869
3878
  )) });
@@ -3871,7 +3880,7 @@ function Identifier({ text, className }) {
3871
3880
 
3872
3881
  // src/core/panels/DiagnosticsPanel.tsx
3873
3882
  import "./DiagnosticsPanel-MSK72CGM.css";
3874
- import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
3883
+ import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
3875
3884
  function locationOf(file, line) {
3876
3885
  return line === void 0 ? file : `${file}:${line}`;
3877
3886
  }
@@ -3882,39 +3891,38 @@ function DiagnosticsPanel({ ctx }) {
3882
3891
  const { runner } = useCanvas();
3883
3892
  const envExtras = useEditorEnvExtras();
3884
3893
  const diagnostics = ctx.diagnostics;
3885
- return /* @__PURE__ */ jsx24("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
3894
+ return /* @__PURE__ */ jsx25("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
3886
3895
  const key = rowKey(d, index);
3887
3896
  const target = { diagnostic: d };
3888
3897
  const actions = rowActionsFor(ctx, "diagnostics", target);
3889
- return /* @__PURE__ */ jsxs13(
3898
+ return /* @__PURE__ */ jsxs14(
3890
3899
  "li",
3891
3900
  {
3892
3901
  className: `lace-diagnostics-panel__row lace-diagnostics-panel__row--${d.severity}`,
3893
3902
  children: [
3894
- /* @__PURE__ */ jsx24("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ jsx24(CanvasIcon, { name: d.severity }) }),
3895
- /* @__PURE__ */ jsxs13("span", { className: "lace-diagnostics-panel__body", children: [
3896
- /* @__PURE__ */ jsx24("span", { className: "lace-diagnostics-panel__message", children: d.message }),
3897
- d.file !== void 0 && /* @__PURE__ */ jsx24(
3903
+ /* @__PURE__ */ jsx25("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ jsx25(CanvasIcon, { name: d.severity }) }),
3904
+ /* @__PURE__ */ jsxs14("span", { className: "lace-diagnostics-panel__body", children: [
3905
+ /* @__PURE__ */ jsx25("span", { className: "lace-diagnostics-panel__message", children: d.message }),
3906
+ d.file !== void 0 && /* @__PURE__ */ jsx25(
3898
3907
  Identifier,
3899
3908
  {
3900
3909
  className: "lace-diagnostics-panel__file",
3901
3910
  text: locationOf(d.file, d.line)
3902
3911
  }
3903
3912
  ),
3904
- d.instance_id !== void 0 && /* @__PURE__ */ jsx24(
3913
+ d.instance_id !== void 0 && /* @__PURE__ */ jsx25(
3905
3914
  Identifier,
3906
3915
  {
3907
3916
  className: "lace-diagnostics-panel__where",
3908
3917
  text: d.input_name ? `${d.instance_id}.${d.input_name}` : d.instance_id
3909
3918
  }
3910
3919
  ),
3911
- d.code !== void 0 && /* @__PURE__ */ jsx24(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
3920
+ d.code !== void 0 && /* @__PURE__ */ jsx25(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
3912
3921
  actions.map((action) => {
3913
3922
  const state = actionState(action, ctx, runner.busy(action, ctx, target));
3914
- return /* @__PURE__ */ jsx24(
3923
+ return /* @__PURE__ */ jsx25(
3915
3924
  Button3,
3916
3925
  {
3917
- rung: true,
3918
3926
  size: "sm",
3919
3927
  variant: "ghost",
3920
3928
  className: "lace-diagnostics-panel__action",
@@ -3953,7 +3961,7 @@ import { createElement } from "react";
3953
3961
  // src/components/panels/EdgeInspectorPanel.tsx
3954
3962
  import { Button as Button4, Panel } from "@lace-cloud/ui";
3955
3963
  import "./EdgeInspectorPanel-JD6CVUAT.css";
3956
- import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
3964
+ import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
3957
3965
  var pinText = (node, pin, end) => `${node}.${end === "source" ? "outputs" : "inputs"}.${pin}`;
3958
3966
  function EdgeInspectorPanel({
3959
3967
  source,
@@ -3965,12 +3973,12 @@ function EdgeInspectorPanel({
3965
3973
  onDelete,
3966
3974
  onClose
3967
3975
  }) {
3968
- const title = /* @__PURE__ */ jsxs14("div", { children: [
3969
- /* @__PURE__ */ jsx25("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
3970
- /* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__title", children: [
3971
- /* @__PURE__ */ jsx25(Identifier, { text: source }),
3976
+ const title = /* @__PURE__ */ jsxs15("div", { children: [
3977
+ /* @__PURE__ */ jsx26("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
3978
+ /* @__PURE__ */ jsxs15("div", { className: "lace-edge-panel__title", children: [
3979
+ /* @__PURE__ */ jsx26(Identifier, { text: source }),
3972
3980
  " \u2192 ",
3973
- /* @__PURE__ */ jsx25(Identifier, { text: target })
3981
+ /* @__PURE__ */ jsx26(Identifier, { text: target })
3974
3982
  ] })
3975
3983
  ] });
3976
3984
  const wire = {
@@ -3983,15 +3991,15 @@ function EdgeInspectorPanel({
3983
3991
  };
3984
3992
  const sourceText = wireEndText(wire, "source", pinText);
3985
3993
  const targetText = wireEndText(wire, "target", pinText);
3986
- const footer = onDelete ? /* @__PURE__ */ jsx25(Button4, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
3987
- return /* @__PURE__ */ jsxs14(Panel, { title, footer, onClose, children: [
3988
- /* @__PURE__ */ jsx25("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
3989
- /* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__wiring", children: [
3990
- /* @__PURE__ */ jsx25(Identifier, { text: sourceText }),
3991
- /* @__PURE__ */ jsx25("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
3992
- /* @__PURE__ */ jsx25(Identifier, { text: targetText })
3994
+ const footer = onDelete ? /* @__PURE__ */ jsx26(Button4, { variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
3995
+ return /* @__PURE__ */ jsxs15(Panel, { title, footer, onClose, children: [
3996
+ /* @__PURE__ */ jsx26("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
3997
+ /* @__PURE__ */ jsxs15("div", { className: "lace-edge-panel__wiring", children: [
3998
+ /* @__PURE__ */ jsx26(Identifier, { text: sourceText }),
3999
+ /* @__PURE__ */ jsx26("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
4000
+ /* @__PURE__ */ jsx26(Identifier, { text: targetText })
3993
4001
  ] }),
3994
- onDelete && /* @__PURE__ */ jsx25("div", { className: "lace-edge-panel__hint", children: "Delete or press Backspace with the edge selected to remove this connection. Create new edges by dragging between the pins on each node's edge." })
4002
+ onDelete && /* @__PURE__ */ jsx26("div", { className: "lace-edge-panel__hint", children: "Delete or press Backspace with the edge selected to remove this connection. Create new edges by dragging between the pins on each node's edge." })
3995
4003
  ] });
3996
4004
  }
3997
4005
 
@@ -4056,10 +4064,10 @@ var edgeInspectorPanel = {
4056
4064
  };
4057
4065
 
4058
4066
  // src/core/panels/Markers.tsx
4059
- import { Badge } from "@lace-cloud/ui";
4060
- import { jsx as jsx26 } from "react/jsx-runtime";
4067
+ import { StatusBadge as StatusBadge2 } from "@lace-cloud/ui";
4068
+ import { jsx as jsx27 } from "react/jsx-runtime";
4061
4069
  function UnsavedMarker() {
4062
- return /* @__PURE__ */ jsx26(Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
4070
+ return /* @__PURE__ */ jsx27(StatusBadge2, { tone: "warn", role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
4063
4071
  }
4064
4072
  var unsavedMarker = {
4065
4073
  id: "unsaved-marker",
@@ -4071,7 +4079,7 @@ var unsavedMarker = {
4071
4079
  Component: UnsavedMarker
4072
4080
  };
4073
4081
  function UngeneratedMarker() {
4074
- return /* @__PURE__ */ jsx26(Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
4082
+ return /* @__PURE__ */ jsx27(StatusBadge2, { tone: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
4075
4083
  }
4076
4084
  var ungeneratedMarker = {
4077
4085
  id: "ungenerated-marker",
@@ -4093,8 +4101,8 @@ import {
4093
4101
  Button as Button12,
4094
4102
  IconButton as IconButton9,
4095
4103
  Input as Input8,
4096
- ModeToggle,
4097
4104
  Panel as Panel6,
4105
+ SegmentedControl,
4098
4106
  Textarea as Textarea3
4099
4107
  } from "@lace-cloud/ui";
4100
4108
  import { useMemo as useMemo11 } from "react";
@@ -4104,8 +4112,14 @@ import { useSyncExternalStore } from "react";
4104
4112
 
4105
4113
  // src/hooks/useUpdateState.ts
4106
4114
  import { useCallback as useCallback10, useEffect as useEffect11, useRef as useRef11, useState as useState12 } from "react";
4115
+
4116
+ // src/utils/update-error.ts
4117
+ var UPDATE_FAILURE = "The update could not be applied.";
4118
+
4119
+ // src/hooks/useUpdateState.ts
4107
4120
  function useUpdateState(updateFn) {
4108
4121
  const [status, setStatus] = useState12("idle");
4122
+ const [error, setError] = useState12(null);
4109
4123
  const mountedRef = useRef11(true);
4110
4124
  const resetTimerRef = useRef11(null);
4111
4125
  const safeSetStatus = useCallback10((next) => {
@@ -4122,14 +4136,21 @@ function useUpdateState(updateFn) {
4122
4136
  [safeSetStatus]
4123
4137
  );
4124
4138
  const handleUpdate = useCallback10(async () => {
4139
+ if (resetTimerRef.current !== null) {
4140
+ clearTimeout(resetTimerRef.current);
4141
+ resetTimerRef.current = null;
4142
+ }
4143
+ if (mountedRef.current) setError(null);
4125
4144
  safeSetStatus("updating");
4126
4145
  try {
4127
4146
  await updateFn();
4128
4147
  safeSetStatus("updated");
4129
4148
  scheduleReset(1500);
4130
- } catch {
4149
+ } catch (cause) {
4150
+ if (mountedRef.current) {
4151
+ setError(cause instanceof Error && cause.message.trim() ? cause.message : UPDATE_FAILURE);
4152
+ }
4131
4153
  safeSetStatus("error");
4132
- scheduleReset(2e3);
4133
4154
  }
4134
4155
  }, [updateFn, safeSetStatus, scheduleReset]);
4135
4156
  useEffect11(() => {
@@ -4142,7 +4163,7 @@ function useUpdateState(updateFn) {
4142
4163
  }
4143
4164
  };
4144
4165
  }, []);
4145
- return { status, handleUpdate };
4166
+ return { status, error, handleUpdate };
4146
4167
  }
4147
4168
 
4148
4169
  // src/hooks/useDraft.ts
@@ -4151,7 +4172,7 @@ function useDraft(kind, params, seed, send) {
4151
4172
  const held = useSyncExternalStore(store.subscribe, () => store.read(kind, params));
4152
4173
  const live = editable && held ? keeping(held.drafts, unsettledIn(seed)) : NO_DRAFTS;
4153
4174
  const value = { ...seed, ...Object.fromEntries(live) };
4154
- const { status, handleUpdate } = useUpdateState(async () => {
4175
+ const { status, error, handleUpdate } = useUpdateState(async () => {
4155
4176
  const sent2 = value;
4156
4177
  try {
4157
4178
  await send(sent2);
@@ -4164,6 +4185,7 @@ function useDraft(kind, params, seed, send) {
4164
4185
  return {
4165
4186
  value,
4166
4187
  dirty,
4188
+ error,
4167
4189
  set: (key, next) => store.set(kind, params, key, next, seed),
4168
4190
  status: held?.sending ? "updating" : status === "updated" && dirty ? "idle" : status,
4169
4191
  update: async () => {
@@ -4175,11 +4197,11 @@ function useDraft(kind, params, seed, send) {
4175
4197
  // src/components/AccordionSection.tsx
4176
4198
  import { useState as useState13 } from "react";
4177
4199
  import "./AccordionSection-5X2XWUYY.css";
4178
- import { jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
4200
+ import { jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
4179
4201
  function AccordionSection({ title, defaultOpen = false, badge, children }) {
4180
4202
  const [open, setOpen] = useState13(defaultOpen);
4181
- return /* @__PURE__ */ jsxs15("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
4182
- /* @__PURE__ */ jsxs15(
4203
+ return /* @__PURE__ */ jsxs16("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
4204
+ /* @__PURE__ */ jsxs16(
4183
4205
  "button",
4184
4206
  {
4185
4207
  type: "button",
@@ -4187,27 +4209,27 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
4187
4209
  onClick: () => setOpen((v) => !v),
4188
4210
  "aria-expanded": open,
4189
4211
  children: [
4190
- /* @__PURE__ */ jsx27("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ jsx27(CanvasIcon, { name: "chevron-right" }) }),
4191
- /* @__PURE__ */ jsx27("span", { className: "lace-accordion__title", children: title }),
4192
- badge && /* @__PURE__ */ jsx27("span", { className: "lace-accordion__badge", children: badge })
4212
+ /* @__PURE__ */ jsx28("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ jsx28(CanvasIcon, { name: "chevron-right" }) }),
4213
+ /* @__PURE__ */ jsx28("span", { className: "lace-accordion__title", children: title }),
4214
+ badge && /* @__PURE__ */ jsx28("span", { className: "lace-accordion__badge", children: badge })
4193
4215
  ]
4194
4216
  }
4195
4217
  ),
4196
- /* @__PURE__ */ jsx27("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx27("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx27("div", { className: "lace-accordion__body-content", children }) }) })
4218
+ /* @__PURE__ */ jsx28("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx28("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx28("div", { className: "lace-accordion__body-content", children }) }) })
4197
4219
  ] });
4198
4220
  }
4199
4221
 
4200
4222
  // src/components/panels/ModuleConfigPanel.tsx
4201
4223
  import "./ModuleConfigPanel-DW3RSOEL.css";
4202
- import "./panels-shared-3HUQC7TC.css";
4224
+ import "./panels-shared-Y4ULZZLB.css";
4203
4225
 
4204
4226
  // src/components/UpdateButton.tsx
4205
4227
  import { Button as Button5 } from "@lace-cloud/ui";
4206
- import "./UpdateButton-VSIHLAZC.css";
4207
- import { jsx as jsx28 } from "react/jsx-runtime";
4228
+ import "./UpdateButton-JJ4WELPG.css";
4229
+ import { jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
4208
4230
  var variantByStatus = {
4209
4231
  updating: "primary",
4210
- updated: "success",
4232
+ updated: "secondary",
4211
4233
  error: "danger"
4212
4234
  };
4213
4235
  var labelByStatus = {
@@ -4220,19 +4242,29 @@ function variantOf({ status, dirty }, blocked) {
4220
4242
  return dirty && blocked === void 0 ? "primary" : "secondary";
4221
4243
  }
4222
4244
  function UpdateButton({ draft, label, blocked }) {
4223
- return /* @__PURE__ */ jsx28("div", { className: "lace-commit-foot", children: /* @__PURE__ */ jsx28(
4224
- Button5,
4225
- {
4226
- rung: true,
4227
- variant: variantOf(draft, blocked),
4228
- fullWidth: true,
4229
- loading: draft.status === "updating",
4230
- "aria-disabled": blocked !== void 0 || draft.status === "updated",
4231
- onClick: draft.update,
4232
- tooltip: blocked,
4233
- children: draft.status === "idle" ? label : labelByStatus[draft.status]
4234
- }
4235
- ) });
4245
+ return /* @__PURE__ */ jsxs17("div", { className: "lace-commit-foot", children: [
4246
+ draft.status === "error" && draft.error && /* @__PURE__ */ jsx29("p", { className: "lace-commit-foot__error", role: "alert", children: draft.error }),
4247
+ /* @__PURE__ */ jsx29(
4248
+ Button5,
4249
+ {
4250
+ variant: variantOf(draft, blocked),
4251
+ fullWidth: true,
4252
+ loading: draft.status === "updating",
4253
+ "aria-disabled": blocked !== void 0 || draft.status === "updated",
4254
+ onClick: draft.update,
4255
+ tooltip: blocked,
4256
+ children: draft.status === "idle" ? label : labelByStatus[draft.status]
4257
+ }
4258
+ )
4259
+ ] });
4260
+ }
4261
+
4262
+ // src/components/panels/assert-applied.ts
4263
+ function assertApplied(result) {
4264
+ if (!result?.success) {
4265
+ const reasons = result?.errors.map((error) => error.message).filter((message) => message.trim());
4266
+ throw new Error(reasons?.join("\n") || UPDATE_FAILURE);
4267
+ }
4236
4268
  }
4237
4269
 
4238
4270
  // src/components/panels/ModuleDetails.tsx
@@ -4243,8 +4275,8 @@ import { useMemo as useMemo10 } from "react";
4243
4275
  // src/components/panels/BlockEditor.tsx
4244
4276
  import { Button as Button6, IconButton as IconButton3, Input } from "@lace-cloud/ui";
4245
4277
  import { useState as useState14 } from "react";
4246
- import "./panels-shared-3HUQC7TC.css";
4247
- import { Fragment as Fragment7, jsx as jsx29, jsxs as jsxs16 } from "react/jsx-runtime";
4278
+ import "./panels-shared-Y4ULZZLB.css";
4279
+ import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
4248
4280
  function replaceAt(list, index, item) {
4249
4281
  return list.map((x, i) => i === index ? item : x);
4250
4282
  }
@@ -4252,8 +4284,8 @@ function blockTitle(block) {
4252
4284
  return [block.type, ...block.labels.map((l) => `"${l}"`)].join(" ");
4253
4285
  }
4254
4286
  function BlockEditor({ blocks, onChange, editable, templates }) {
4255
- return /* @__PURE__ */ jsxs16(Fragment7, { children: [
4256
- blocks.map((block, i) => /* @__PURE__ */ jsx29(
4287
+ return /* @__PURE__ */ jsxs18(Fragment8, { children: [
4288
+ blocks.map((block, i) => /* @__PURE__ */ jsx30(
4257
4289
  BlockCard,
4258
4290
  {
4259
4291
  block,
@@ -4263,7 +4295,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
4263
4295
  },
4264
4296
  i
4265
4297
  )),
4266
- editable && (templates ? /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ jsxs16(
4298
+ editable && (templates ? /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ jsxs18(
4267
4299
  Button6,
4268
4300
  {
4269
4301
  variant: "secondary",
@@ -4284,7 +4316,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
4284
4316
  ]
4285
4317
  },
4286
4318
  t.type
4287
- )) }) : /* @__PURE__ */ jsx29(
4319
+ )) }) : /* @__PURE__ */ jsx30(
4288
4320
  NewBlockRow,
4289
4321
  {
4290
4322
  onAdd: (type, label) => onChange([
@@ -4298,8 +4330,8 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
4298
4330
  function NewBlockRow({ onAdd }) {
4299
4331
  const [type, setType] = useState14("");
4300
4332
  const [label, setLabel] = useState14("");
4301
- return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
4302
- /* @__PURE__ */ jsx29(
4333
+ return /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4334
+ /* @__PURE__ */ jsx30(
4303
4335
  Input,
4304
4336
  {
4305
4337
  value: type,
@@ -4309,7 +4341,7 @@ function NewBlockRow({ onAdd }) {
4309
4341
  mono: true
4310
4342
  }
4311
4343
  ),
4312
- /* @__PURE__ */ jsx29(
4344
+ /* @__PURE__ */ jsx30(
4313
4345
  Input,
4314
4346
  {
4315
4347
  value: label,
@@ -4319,7 +4351,7 @@ function NewBlockRow({ onAdd }) {
4319
4351
  mono: true
4320
4352
  }
4321
4353
  ),
4322
- /* @__PURE__ */ jsx29(
4354
+ /* @__PURE__ */ jsx30(
4323
4355
  Button6,
4324
4356
  {
4325
4357
  variant: "secondary",
@@ -4343,13 +4375,13 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4343
4375
  [field]: value
4344
4376
  })
4345
4377
  });
4346
- return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-validation-block", children: [
4347
- /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
4348
- /* @__PURE__ */ jsx29(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
4349
- editable && /* @__PURE__ */ jsx29(
4378
+ return /* @__PURE__ */ jsxs18("div", { className: "lace-panel-validation-block", children: [
4379
+ /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4380
+ /* @__PURE__ */ jsx30(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
4381
+ editable && /* @__PURE__ */ jsx30(
4350
4382
  IconButton3,
4351
4383
  {
4352
- icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4384
+ icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4353
4385
  "aria-label": `Remove the ${block.type} block`,
4354
4386
  size: "md",
4355
4387
  tooltipPlacement: "bottom-end",
@@ -4359,8 +4391,8 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4359
4391
  ] }),
4360
4392
  block.attributes.map((attribute, i) => (
4361
4393
  // biome-ignore lint/suspicious/noArrayIndexKey: attributes are positional; the render keeps their order
4362
- /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4363
- /* @__PURE__ */ jsx29(
4394
+ /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4395
+ /* @__PURE__ */ jsx30(
4364
4396
  Input,
4365
4397
  {
4366
4398
  value: attribute.name,
@@ -4371,7 +4403,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4371
4403
  readOnly: !editable
4372
4404
  }
4373
4405
  ),
4374
- /* @__PURE__ */ jsx29(
4406
+ /* @__PURE__ */ jsx30(
4375
4407
  Input,
4376
4408
  {
4377
4409
  value: attribute.value,
@@ -4382,10 +4414,10 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4382
4414
  readOnly: !editable
4383
4415
  }
4384
4416
  ),
4385
- editable && /* @__PURE__ */ jsx29(
4417
+ editable && /* @__PURE__ */ jsx30(
4386
4418
  IconButton3,
4387
4419
  {
4388
- icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4420
+ icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4389
4421
  "aria-label": `Remove ${attribute.name || "the argument"}`,
4390
4422
  size: "md",
4391
4423
  tooltipPlacement: "bottom-end",
@@ -4394,7 +4426,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4394
4426
  )
4395
4427
  ] }, i)
4396
4428
  )),
4397
- editable && /* @__PURE__ */ jsx29(
4429
+ editable && /* @__PURE__ */ jsx30(
4398
4430
  Button6,
4399
4431
  {
4400
4432
  variant: "secondary",
@@ -4403,7 +4435,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4403
4435
  children: "+ Add argument"
4404
4436
  }
4405
4437
  ),
4406
- (block.blocks.length > 0 || editable) && /* @__PURE__ */ jsx29(
4438
+ (block.blocks.length > 0 || editable) && /* @__PURE__ */ jsx30(
4407
4439
  BlockEditor,
4408
4440
  {
4409
4441
  blocks: block.blocks,
@@ -4438,8 +4470,8 @@ function firstDuplicate(items, keyFn) {
4438
4470
  }
4439
4471
 
4440
4472
  // src/components/panels/LocalsPanel.tsx
4441
- import "./panels-shared-3HUQC7TC.css";
4442
- import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs17 } from "react/jsx-runtime";
4473
+ import "./panels-shared-Y4ULZZLB.css";
4474
+ import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
4443
4475
  function toRows(locals) {
4444
4476
  return (locals ?? []).map((l) => ({ id: l.name, ...l }));
4445
4477
  }
@@ -4458,10 +4490,10 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4458
4490
  const updateRow = (index, field, value) => setRows(rows.map((r, i) => i === index ? { ...r, [field]: value } : r));
4459
4491
  const nameDupes = findDuplicateIndices(rows, (r) => r.name);
4460
4492
  const duplicate = firstDuplicate(rows, (r) => r.name);
4461
- return /* @__PURE__ */ jsxs17(Fragment8, { children: [
4462
- rows.map((row, i) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4463
- /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4464
- /* @__PURE__ */ jsx30(
4493
+ return /* @__PURE__ */ jsxs19(Fragment9, { children: [
4494
+ rows.map((row, i) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4495
+ /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4496
+ /* @__PURE__ */ jsx31(
4465
4497
  Input2,
4466
4498
  {
4467
4499
  value: row.name,
@@ -4474,10 +4506,10 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4474
4506
  readOnly: !editable
4475
4507
  }
4476
4508
  ),
4477
- editable && /* @__PURE__ */ jsx30(
4509
+ editable && /* @__PURE__ */ jsx31(
4478
4510
  IconButton4,
4479
4511
  {
4480
- icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4512
+ icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4481
4513
  "aria-label": "Remove local",
4482
4514
  size: "md",
4483
4515
  tooltipPlacement: "bottom-end",
@@ -4485,8 +4517,8 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4485
4517
  }
4486
4518
  )
4487
4519
  ] }),
4488
- nameDupes.has(i) && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
4489
- /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx30(
4520
+ nameDupes.has(i) && /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
4521
+ /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx31(
4490
4522
  Textarea,
4491
4523
  {
4492
4524
  value: row.value,
@@ -4500,8 +4532,8 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4500
4532
  }
4501
4533
  ) })
4502
4534
  ] }, row.id)),
4503
- editable && /* @__PURE__ */ jsxs17(Fragment8, { children: [
4504
- /* @__PURE__ */ jsx30(
4535
+ editable && /* @__PURE__ */ jsxs19(Fragment9, { children: [
4536
+ /* @__PURE__ */ jsx31(
4505
4537
  Button7,
4506
4538
  {
4507
4539
  variant: "secondary",
@@ -4510,7 +4542,7 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4510
4542
  children: "+ Add local"
4511
4543
  }
4512
4544
  ),
4513
- /* @__PURE__ */ jsx30(
4545
+ /* @__PURE__ */ jsx31(
4514
4546
  UpdateButton,
4515
4547
  {
4516
4548
  draft,
@@ -4522,13 +4554,13 @@ function LocalsContent({ moduleKey, locals, onSave }) {
4522
4554
  ] });
4523
4555
  }
4524
4556
  function LocalsPanel({ onClose, ...content }) {
4525
- return /* @__PURE__ */ jsx30(Panel2, { title: "Locals", onClose, children: /* @__PURE__ */ jsx30(LocalsContent, { ...content }) });
4557
+ return /* @__PURE__ */ jsx31(Panel2, { title: "Locals", onClose, children: /* @__PURE__ */ jsx31(LocalsContent, { ...content }) });
4526
4558
  }
4527
4559
 
4528
4560
  // src/components/panels/ModuleInterfacePanel.tsx
4529
4561
  import { Button as Button8, IconButton as IconButton5, Input as Input3, Panel as Panel3, Select, Textarea as Textarea2 } from "@lace-cloud/ui";
4530
- import "./panels-shared-3HUQC7TC.css";
4531
- import { Fragment as Fragment9, jsx as jsx31, jsxs as jsxs18 } from "react/jsx-runtime";
4562
+ import "./panels-shared-Y4ULZZLB.css";
4563
+ import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
4532
4564
  function variablesToRows(variables) {
4533
4565
  return variables.map((v) => ({
4534
4566
  id: v.name,
@@ -4662,13 +4694,13 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4662
4694
  const variableDupes = findDuplicateIndices(variables, (v) => v.name);
4663
4695
  const outputDupes = findDuplicateIndices(outputs, (o) => o.name);
4664
4696
  const exposable = settings.call_outputs.filter((text) => !outputs.some((o) => o.value === text));
4665
- return /* @__PURE__ */ jsxs18(Fragment9, { children: [
4666
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
4667
- /* @__PURE__ */ jsx31("h4", { className: "lace-panel-section-title", children: "Inputs" }),
4668
- variables.length === 0 && /* @__PURE__ */ jsx31("div", { className: "lace-panel-hint", children: "No variables." }),
4669
- variables.map((v, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4670
- /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4671
- v.added ? /* @__PURE__ */ jsx31(
4697
+ return /* @__PURE__ */ jsxs20(Fragment10, { children: [
4698
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
4699
+ /* @__PURE__ */ jsx32("h4", { className: "lace-panel-section-title", children: "Inputs" }),
4700
+ variables.length === 0 && /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "No variables." }),
4701
+ variables.map((v, i) => /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4702
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4703
+ v.added ? /* @__PURE__ */ jsx32(
4672
4704
  Input3,
4673
4705
  {
4674
4706
  label: "Name",
@@ -4679,11 +4711,11 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4679
4711
  mono: true,
4680
4712
  error: variableDupes.has(i)
4681
4713
  }
4682
- ) : /* @__PURE__ */ jsx31(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
4683
- editable && /* @__PURE__ */ jsx31(
4714
+ ) : /* @__PURE__ */ jsx32(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
4715
+ editable && /* @__PURE__ */ jsx32(
4684
4716
  IconButton5,
4685
4717
  {
4686
- icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4718
+ icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
4687
4719
  "aria-label": `Remove variable ${v.name}`,
4688
4720
  size: "md",
4689
4721
  tooltipPlacement: "bottom-end",
@@ -4691,8 +4723,8 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4691
4723
  }
4692
4724
  )
4693
4725
  ] }),
4694
- variableDupes.has(i) && /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
4695
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx31(
4726
+ variableDupes.has(i) && /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
4727
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
4696
4728
  Input3,
4697
4729
  {
4698
4730
  label: "Type",
@@ -4704,8 +4736,8 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4704
4736
  readOnly: !editable
4705
4737
  }
4706
4738
  ) }),
4707
- v.defaultText && /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx31(Input3, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
4708
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx31(
4739
+ v.defaultText && /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(Input3, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
4740
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx32(
4709
4741
  Textarea2,
4710
4742
  {
4711
4743
  label: "Description",
@@ -4717,9 +4749,9 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4717
4749
  readOnly: !editable
4718
4750
  }
4719
4751
  ) }),
4720
- /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4721
- /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4722
- /* @__PURE__ */ jsx31(
4752
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
4753
+ /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4754
+ /* @__PURE__ */ jsx32(
4723
4755
  "input",
4724
4756
  {
4725
4757
  type: "checkbox",
@@ -4728,10 +4760,10 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4728
4760
  disabled: !editable
4729
4761
  }
4730
4762
  ),
4731
- /* @__PURE__ */ jsx31("span", { children: "Required" })
4763
+ /* @__PURE__ */ jsx32("span", { children: "Required" })
4732
4764
  ] }),
4733
- /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4734
- /* @__PURE__ */ jsx31(
4765
+ /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4766
+ /* @__PURE__ */ jsx32(
4735
4767
  "input",
4736
4768
  {
4737
4769
  type: "checkbox",
@@ -4740,10 +4772,10 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4740
4772
  disabled: !editable
4741
4773
  }
4742
4774
  ),
4743
- /* @__PURE__ */ jsx31("span", { children: "Ephemeral" })
4775
+ /* @__PURE__ */ jsx32("span", { children: "Ephemeral" })
4744
4776
  ] }),
4745
- /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4746
- /* @__PURE__ */ jsx31(
4777
+ /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4778
+ /* @__PURE__ */ jsx32(
4747
4779
  "input",
4748
4780
  {
4749
4781
  type: "checkbox",
@@ -4752,10 +4784,10 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4752
4784
  disabled: !editable
4753
4785
  }
4754
4786
  ),
4755
- /* @__PURE__ */ jsx31("span", { children: "Sensitive" })
4787
+ /* @__PURE__ */ jsx32("span", { children: "Sensitive" })
4756
4788
  ] }),
4757
- /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4758
- /* @__PURE__ */ jsx31(
4789
+ /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4790
+ /* @__PURE__ */ jsx32(
4759
4791
  "input",
4760
4792
  {
4761
4793
  type: "checkbox",
@@ -4764,13 +4796,13 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4764
4796
  disabled: !editable
4765
4797
  }
4766
4798
  ),
4767
- /* @__PURE__ */ jsx31("span", { children: "Nullable" })
4799
+ /* @__PURE__ */ jsx32("span", { children: "Nullable" })
4768
4800
  ] })
4769
4801
  ] }),
4770
- (v.validation.length > 0 || editable) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
4771
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-subsection-label", children: "Validation" }),
4772
- v.validation.map((block, j) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-validation-block", children: [
4773
- /* @__PURE__ */ jsx31(
4802
+ (v.validation.length > 0 || editable) && /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-content", children: [
4803
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-subsection-label", children: "Validation" }),
4804
+ v.validation.map((block, j) => /* @__PURE__ */ jsxs20("div", { className: "lace-panel-validation-block", children: [
4805
+ /* @__PURE__ */ jsx32(
4774
4806
  Input3,
4775
4807
  {
4776
4808
  value: block.condition,
@@ -4782,7 +4814,7 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4782
4814
  readOnly: !editable
4783
4815
  }
4784
4816
  ),
4785
- /* @__PURE__ */ jsx31(
4817
+ /* @__PURE__ */ jsx32(
4786
4818
  Input3,
4787
4819
  {
4788
4820
  value: block.error_message,
@@ -4793,10 +4825,10 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4793
4825
  readOnly: !editable
4794
4826
  }
4795
4827
  ),
4796
- editable && /* @__PURE__ */ jsx31(
4828
+ editable && /* @__PURE__ */ jsx32(
4797
4829
  IconButton5,
4798
4830
  {
4799
- icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4831
+ icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
4800
4832
  "aria-label": "Remove validation rule",
4801
4833
  size: "md",
4802
4834
  tooltipPlacement: "bottom-end",
@@ -4804,15 +4836,15 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4804
4836
  }
4805
4837
  )
4806
4838
  ] }, block.id)),
4807
- editable && /* @__PURE__ */ jsx31(Button8, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
4839
+ editable && /* @__PURE__ */ jsx32(Button8, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
4808
4840
  ] })
4809
4841
  ] }, v.id)),
4810
- editable && /* @__PURE__ */ jsx31(Button8, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
4811
- /* @__PURE__ */ jsx31("h4", { className: "lace-panel-section-title", children: "Outputs" }),
4812
- outputs.length === 0 && /* @__PURE__ */ jsx31("div", { className: "lace-panel-hint", children: "No outputs." }),
4813
- outputs.map((o, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4814
- /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4815
- /* @__PURE__ */ jsx31(
4842
+ editable && /* @__PURE__ */ jsx32(Button8, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
4843
+ /* @__PURE__ */ jsx32("h4", { className: "lace-panel-section-title", children: "Outputs" }),
4844
+ outputs.length === 0 && /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "No outputs." }),
4845
+ outputs.map((o, i) => /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4846
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4847
+ /* @__PURE__ */ jsx32(
4816
4848
  Input3,
4817
4849
  {
4818
4850
  label: "Name",
@@ -4825,10 +4857,10 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4825
4857
  error: outputDupes.has(i) || editable && !o.name.trim()
4826
4858
  }
4827
4859
  ),
4828
- editable && /* @__PURE__ */ jsx31(
4860
+ editable && /* @__PURE__ */ jsx32(
4829
4861
  IconButton5,
4830
4862
  {
4831
- icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4863
+ icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
4832
4864
  "aria-label": `Remove output ${o.name}`,
4833
4865
  size: "md",
4834
4866
  tooltipPlacement: "bottom-end",
@@ -4836,7 +4868,7 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4836
4868
  }
4837
4869
  )
4838
4870
  ] }),
4839
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx31(
4871
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
4840
4872
  Input3,
4841
4873
  {
4842
4874
  label: "Value",
@@ -4849,7 +4881,7 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4849
4881
  error: editable && !o.value.trim()
4850
4882
  }
4851
4883
  ) }),
4852
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx31(
4884
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx32(
4853
4885
  Textarea2,
4854
4886
  {
4855
4887
  label: "Description",
@@ -4861,8 +4893,8 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4861
4893
  readOnly: !editable
4862
4894
  }
4863
4895
  ) }),
4864
- /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4865
- /* @__PURE__ */ jsx31(
4896
+ /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4897
+ /* @__PURE__ */ jsx32(
4866
4898
  "input",
4867
4899
  {
4868
4900
  type: "checkbox",
@@ -4871,12 +4903,12 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4871
4903
  disabled: !editable
4872
4904
  }
4873
4905
  ),
4874
- /* @__PURE__ */ jsx31("span", { children: "Sensitive" })
4906
+ /* @__PURE__ */ jsx32("span", { children: "Sensitive" })
4875
4907
  ] }),
4876
- (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
4877
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
4878
- !editable ? o.depends_on.map((dep) => /* @__PURE__ */ jsx31("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx31(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4879
- /* @__PURE__ */ jsx31(
4908
+ (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-content", children: [
4909
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
4910
+ !editable ? o.depends_on.map((dep) => /* @__PURE__ */ jsx32("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx32(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
4911
+ /* @__PURE__ */ jsx32(
4880
4912
  "input",
4881
4913
  {
4882
4914
  type: "checkbox",
@@ -4884,14 +4916,14 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4884
4916
  onChange: () => toggleDependsOn(i, dep)
4885
4917
  }
4886
4918
  ),
4887
- /* @__PURE__ */ jsx31(Identifier, { text: dep })
4919
+ /* @__PURE__ */ jsx32(Identifier, { text: dep })
4888
4920
  ] }, dep))
4889
4921
  ] }),
4890
- outputDupes.has(i) && /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
4922
+ outputDupes.has(i) && /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
4891
4923
  ] }, o.id)),
4892
- editable && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4893
- /* @__PURE__ */ jsx31(Button8, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
4894
- exposable.length > 0 && /* @__PURE__ */ jsx31(
4924
+ editable && /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
4925
+ /* @__PURE__ */ jsx32(Button8, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
4926
+ exposable.length > 0 && /* @__PURE__ */ jsx32(
4895
4927
  Select,
4896
4928
  {
4897
4929
  "aria-label": "Expose a call's output",
@@ -4907,7 +4939,7 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4907
4939
  }
4908
4940
  )
4909
4941
  ] }),
4910
- editable && /* @__PURE__ */ jsx31(
4942
+ editable && /* @__PURE__ */ jsx32(
4911
4943
  UpdateButton,
4912
4944
  {
4913
4945
  draft,
@@ -4918,7 +4950,7 @@ function ModuleInterfaceContent({ moduleKey, settings, onSave }) {
4918
4950
  ] });
4919
4951
  }
4920
4952
  function ModuleInterfacePanel({ onClose, ...content }) {
4921
- return /* @__PURE__ */ jsx31(Panel3, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx31(ModuleInterfaceContent, { ...content }) });
4953
+ return /* @__PURE__ */ jsx32(Panel3, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx32(ModuleInterfaceContent, { ...content }) });
4922
4954
  }
4923
4955
 
4924
4956
  // src/components/panels/module-actions.ts
@@ -5041,12 +5073,12 @@ function resourceActions(scope, before, after) {
5041
5073
  }
5042
5074
 
5043
5075
  // src/components/panels/ModuleDetails.tsx
5044
- import "./panels-shared-3HUQC7TC.css";
5076
+ import "./panels-shared-Y4ULZZLB.css";
5045
5077
 
5046
5078
  // src/components/panels/ProvidersPanel.tsx
5047
5079
  import { Button as Button9, IconButton as IconButton6, Input as Input4, Panel as Panel4 } from "@lace-cloud/ui";
5048
- import "./panels-shared-3HUQC7TC.css";
5049
- import { Fragment as Fragment10, jsx as jsx32, jsxs as jsxs19 } from "react/jsx-runtime";
5080
+ import "./panels-shared-Y4ULZZLB.css";
5081
+ import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
5050
5082
  function toRows2(providers) {
5051
5083
  if (!providers || providers.length === 0) return [];
5052
5084
  return providers.map((p) => ({
@@ -5107,10 +5139,10 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5107
5139
  (c, ei) => ei === entryIndex ? { ...c, [field]: value } : c
5108
5140
  )
5109
5141
  );
5110
- return /* @__PURE__ */ jsxs19(Fragment10, { children: [
5111
- rows.map((row, pi) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5112
- /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5113
- /* @__PURE__ */ jsx32(
5142
+ return /* @__PURE__ */ jsxs21(Fragment11, { children: [
5143
+ rows.map((row, pi) => /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5144
+ /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5145
+ /* @__PURE__ */ jsx33(
5114
5146
  Input4,
5115
5147
  {
5116
5148
  value: row.name,
@@ -5120,7 +5152,7 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5120
5152
  readOnly: !editable
5121
5153
  }
5122
5154
  ),
5123
- /* @__PURE__ */ jsx32(
5155
+ /* @__PURE__ */ jsx33(
5124
5156
  Input4,
5125
5157
  {
5126
5158
  value: row.alias,
@@ -5130,10 +5162,10 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5130
5162
  readOnly: !editable
5131
5163
  }
5132
5164
  ),
5133
- editable && /* @__PURE__ */ jsx32(
5165
+ editable && /* @__PURE__ */ jsx33(
5134
5166
  IconButton6,
5135
5167
  {
5136
- icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
5168
+ icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
5137
5169
  "aria-label": "Remove provider",
5138
5170
  size: "md",
5139
5171
  tooltipPlacement: "bottom-end",
@@ -5141,9 +5173,9 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5141
5173
  }
5142
5174
  )
5143
5175
  ] }),
5144
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Config" }),
5145
- row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5146
- /* @__PURE__ */ jsx32(
5176
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-sublabel", children: "Config" }),
5177
+ row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5178
+ /* @__PURE__ */ jsx33(
5147
5179
  Input4,
5148
5180
  {
5149
5181
  value: entry.key,
@@ -5153,7 +5185,7 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5153
5185
  readOnly: !editable
5154
5186
  }
5155
5187
  ),
5156
- /* @__PURE__ */ jsx32(
5188
+ /* @__PURE__ */ jsx33(
5157
5189
  Input4,
5158
5190
  {
5159
5191
  value: entry.value,
@@ -5163,10 +5195,10 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5163
5195
  readOnly: !editable
5164
5196
  }
5165
5197
  ),
5166
- editable && /* @__PURE__ */ jsx32(
5198
+ editable && /* @__PURE__ */ jsx33(
5167
5199
  IconButton6,
5168
5200
  {
5169
- icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
5201
+ icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
5170
5202
  "aria-label": "Remove config key",
5171
5203
  size: "md",
5172
5204
  tooltipPlacement: "bottom-end",
@@ -5177,7 +5209,7 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5177
5209
  }
5178
5210
  )
5179
5211
  ] }, entry.id)),
5180
- editable && /* @__PURE__ */ jsx32(
5212
+ editable && /* @__PURE__ */ jsx33(
5181
5213
  Button9,
5182
5214
  {
5183
5215
  variant: "secondary",
@@ -5189,9 +5221,9 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5189
5221
  children: "+ Add config key"
5190
5222
  }
5191
5223
  ),
5192
- (row.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs19(Fragment10, { children: [
5193
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5194
- /* @__PURE__ */ jsx32(
5224
+ (row.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs21(Fragment11, { children: [
5225
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5226
+ /* @__PURE__ */ jsx33(
5195
5227
  BlockEditor,
5196
5228
  {
5197
5229
  blocks: row.blocks,
@@ -5201,21 +5233,21 @@ function ProvidersContent({ moduleKey, providers, onSave }) {
5201
5233
  )
5202
5234
  ] })
5203
5235
  ] }, row.id)),
5204
- editable && /* @__PURE__ */ jsxs19(Fragment10, { children: [
5205
- /* @__PURE__ */ jsx32(Button9, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
5206
- /* @__PURE__ */ jsx32(UpdateButton, { draft, label: "Update providers" })
5236
+ editable && /* @__PURE__ */ jsxs21(Fragment11, { children: [
5237
+ /* @__PURE__ */ jsx33(Button9, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
5238
+ /* @__PURE__ */ jsx33(UpdateButton, { draft, label: "Update providers" })
5207
5239
  ] })
5208
5240
  ] });
5209
5241
  }
5210
5242
  function ProvidersPanel({ onClose, ...content }) {
5211
- return /* @__PURE__ */ jsx32(Panel4, { title: "Providers", onClose, children: /* @__PURE__ */ jsx32(ProvidersContent, { ...content }) });
5243
+ return /* @__PURE__ */ jsx33(Panel4, { title: "Providers", onClose, children: /* @__PURE__ */ jsx33(ProvidersContent, { ...content }) });
5212
5244
  }
5213
5245
 
5214
5246
  // src/components/panels/ResourcesPanel.tsx
5215
- import { Badge as Badge2, Button as Button10, IconButton as IconButton7, Input as Input5, Select as Select2 } from "@lace-cloud/ui";
5247
+ import { Button as Button10, IconButton as IconButton7, Input as Input5, Select as Select2, StatusBadge as StatusBadge3 } from "@lace-cloud/ui";
5216
5248
  import { useState as useState15 } from "react";
5217
- import "./panels-shared-3HUQC7TC.css";
5218
- import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs20 } from "react/jsx-runtime";
5249
+ import "./panels-shared-Y4ULZZLB.css";
5250
+ import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
5219
5251
  var resourceDraft = {
5220
5252
  name: "resource",
5221
5253
  seed: (derive, [moduleKey, id]) => derive.settings(moduleKey)?.resources.find((r) => r.id === id) ?? null
@@ -5230,9 +5262,9 @@ function ResourcesContent({
5230
5262
  onAdd
5231
5263
  }) {
5232
5264
  const { editable } = useCanvas();
5233
- return /* @__PURE__ */ jsxs20(Fragment11, { children: [
5234
- resources.length === 0 && /* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
5235
- resources.map((resource) => /* @__PURE__ */ jsx33(
5265
+ return /* @__PURE__ */ jsxs22(Fragment12, { children: [
5266
+ resources.length === 0 && /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
5267
+ resources.map((resource) => /* @__PURE__ */ jsx34(
5236
5268
  ResourceCard,
5237
5269
  {
5238
5270
  moduleKey,
@@ -5246,7 +5278,7 @@ function ResourcesContent({
5246
5278
  },
5247
5279
  resource.id
5248
5280
  )),
5249
- editable && /* @__PURE__ */ jsx33(NewResourceRow, { managed, onAdd })
5281
+ editable && /* @__PURE__ */ jsx34(NewResourceRow, { managed, onAdd })
5250
5282
  ] });
5251
5283
  }
5252
5284
  var MANAGED_OPTION = { value: "resource", label: "Resource" };
@@ -5260,10 +5292,10 @@ function NewResourceRow({
5260
5292
  const kind = managed ? chosen : "data";
5261
5293
  const [type, setType] = useState15("");
5262
5294
  const [name, setName] = useState15("");
5263
- return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card", children: [
5264
- /* @__PURE__ */ jsx33("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
5265
- /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
5266
- /* @__PURE__ */ jsx33(
5295
+ return /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-card", children: [
5296
+ /* @__PURE__ */ jsx34("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
5297
+ /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions", children: [
5298
+ /* @__PURE__ */ jsx34(
5267
5299
  Select2,
5268
5300
  {
5269
5301
  "aria-label": "New resource kind",
@@ -5272,7 +5304,7 @@ function NewResourceRow({
5272
5304
  onChange: (e) => setChosen(e.target.value === "data" ? "data" : "resource")
5273
5305
  }
5274
5306
  ),
5275
- /* @__PURE__ */ jsx33(
5307
+ /* @__PURE__ */ jsx34(
5276
5308
  Input5,
5277
5309
  {
5278
5310
  value: type,
@@ -5282,7 +5314,7 @@ function NewResourceRow({
5282
5314
  mono: true
5283
5315
  }
5284
5316
  ),
5285
- /* @__PURE__ */ jsx33(
5317
+ /* @__PURE__ */ jsx34(
5286
5318
  Input5,
5287
5319
  {
5288
5320
  value: name,
@@ -5292,7 +5324,7 @@ function NewResourceRow({
5292
5324
  mono: true
5293
5325
  }
5294
5326
  ),
5295
- /* @__PURE__ */ jsx33(
5327
+ /* @__PURE__ */ jsx34(
5296
5328
  Button10,
5297
5329
  {
5298
5330
  variant: "secondary",
@@ -5340,20 +5372,20 @@ function ResourceCard({
5340
5372
  { field: "for_each", placeholder: "e.g. var.names" },
5341
5373
  { field: "provider", placeholder: "e.g. aws.west" }
5342
5374
  ];
5343
- return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5344
- /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
5345
- /* @__PURE__ */ jsx33(Badge2, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
5346
- /* @__PURE__ */ jsx33(
5375
+ return /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5376
+ /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions", children: [
5377
+ /* @__PURE__ */ jsx34(StatusBadge3, { tone: "neutral", children: resource.kind === "data" ? "data" : "resource" }),
5378
+ /* @__PURE__ */ jsx34(
5347
5379
  Identifier,
5348
5380
  {
5349
5381
  className: "lace-panel-row-card__name",
5350
5382
  text: `${resource.type}.${resource.name}`
5351
5383
  }
5352
5384
  ),
5353
- editable && /* @__PURE__ */ jsx33(
5385
+ editable && /* @__PURE__ */ jsx34(
5354
5386
  IconButton7,
5355
5387
  {
5356
- icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
5388
+ icon: /* @__PURE__ */ jsx34(CanvasIcon, { name: "close" }),
5357
5389
  "aria-label": `Remove ${resource.type}.${resource.name}`,
5358
5390
  size: "md",
5359
5391
  tooltipPlacement: "bottom-end",
@@ -5361,7 +5393,7 @@ function ResourceCard({
5361
5393
  }
5362
5394
  )
5363
5395
  ] }),
5364
- editable && /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
5396
+ editable && /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx34(
5365
5397
  Input5,
5366
5398
  {
5367
5399
  label: "Name",
@@ -5373,7 +5405,7 @@ function ResourceCard({
5373
5405
  }
5374
5406
  ) }),
5375
5407
  metaArguments.map(
5376
- ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
5408
+ ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx34(
5377
5409
  Input5,
5378
5410
  {
5379
5411
  label: field,
@@ -5386,11 +5418,11 @@ function ResourceCard({
5386
5418
  }
5387
5419
  ) }, field) : null
5388
5420
  ),
5389
- /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
5421
+ /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
5390
5422
  draft.arguments.map((argument, i) => (
5391
5423
  // biome-ignore lint/suspicious/noArrayIndexKey: argument rows are positional while edited
5392
- /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5393
- /* @__PURE__ */ jsx33(
5424
+ /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5425
+ /* @__PURE__ */ jsx34(
5394
5426
  Input5,
5395
5427
  {
5396
5428
  value: argument.name,
@@ -5402,7 +5434,7 @@ function ResourceCard({
5402
5434
  error: argumentDupes.has(i)
5403
5435
  }
5404
5436
  ),
5405
- /* @__PURE__ */ jsx33(
5437
+ /* @__PURE__ */ jsx34(
5406
5438
  Input5,
5407
5439
  {
5408
5440
  value: argument.value,
@@ -5413,10 +5445,10 @@ function ResourceCard({
5413
5445
  readOnly: !editable
5414
5446
  }
5415
5447
  ),
5416
- editable && /* @__PURE__ */ jsx33(
5448
+ editable && /* @__PURE__ */ jsx34(
5417
5449
  IconButton7,
5418
5450
  {
5419
- icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
5451
+ icon: /* @__PURE__ */ jsx34(CanvasIcon, { name: "close" }),
5420
5452
  "aria-label": `Remove ${argument.name || "the argument"}`,
5421
5453
  size: "md",
5422
5454
  tooltipPlacement: "bottom-end",
@@ -5428,7 +5460,7 @@ function ResourceCard({
5428
5460
  )
5429
5461
  ] }, i)
5430
5462
  )),
5431
- editable && /* @__PURE__ */ jsx33(
5463
+ editable && /* @__PURE__ */ jsx34(
5432
5464
  Button10,
5433
5465
  {
5434
5466
  variant: "secondary",
@@ -5437,9 +5469,9 @@ function ResourceCard({
5437
5469
  children: "+ Add argument"
5438
5470
  }
5439
5471
  ),
5440
- (draft.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
5441
- /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5442
- /* @__PURE__ */ jsx33(
5472
+ (draft.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs22(Fragment12, { children: [
5473
+ /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5474
+ /* @__PURE__ */ jsx34(
5443
5475
  BlockEditor,
5444
5476
  {
5445
5477
  blocks: draft.blocks,
@@ -5448,10 +5480,10 @@ function ResourceCard({
5448
5480
  }
5449
5481
  )
5450
5482
  ] }),
5451
- (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
5452
- /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
5453
- !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ jsx33("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx33(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
5454
- /* @__PURE__ */ jsx33(
5483
+ (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ jsxs22(Fragment12, { children: [
5484
+ /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
5485
+ !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ jsx34("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx34(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ jsxs22("label", { className: "lace-panel-checkbox-row", children: [
5486
+ /* @__PURE__ */ jsx34(
5455
5487
  "input",
5456
5488
  {
5457
5489
  type: "checkbox",
@@ -5462,10 +5494,10 @@ function ResourceCard({
5462
5494
  )
5463
5495
  }
5464
5496
  ),
5465
- /* @__PURE__ */ jsx33(Identifier, { text: dep })
5497
+ /* @__PURE__ */ jsx34(Identifier, { text: dep })
5466
5498
  ] }, dep))
5467
5499
  ] }),
5468
- editable && /* @__PURE__ */ jsx33(
5500
+ editable && /* @__PURE__ */ jsx34(
5469
5501
  UpdateButton,
5470
5502
  {
5471
5503
  draft: card,
@@ -5478,8 +5510,8 @@ function ResourceCard({
5478
5510
 
5479
5511
  // src/components/panels/TerraformConfigPanel.tsx
5480
5512
  import { Button as Button11, IconButton as IconButton8, Input as Input6, Panel as Panel5 } from "@lace-cloud/ui";
5481
- import "./panels-shared-3HUQC7TC.css";
5482
- import { Fragment as Fragment12, jsx as jsx34, jsxs as jsxs21 } from "react/jsx-runtime";
5513
+ import "./panels-shared-Y4ULZZLB.css";
5514
+ import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
5483
5515
  function toRows3(terraform) {
5484
5516
  return (terraform?.required_providers ?? []).map((req) => ({
5485
5517
  id: req.name,
@@ -5521,9 +5553,9 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5521
5553
  const { requiredVersion, providers } = draft.value;
5522
5554
  const setProviders2 = (next) => draft.set("providers", next);
5523
5555
  const updateProvider = (index, field, value) => setProviders2(providers.map((p, i) => i === index ? { ...p, [field]: value } : p));
5524
- return /* @__PURE__ */ jsxs21(Fragment12, { children: [
5525
- /* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Required Version" }),
5526
- /* @__PURE__ */ jsx34("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx34(
5556
+ return /* @__PURE__ */ jsxs23(Fragment13, { children: [
5557
+ /* @__PURE__ */ jsx35("h4", { className: "lace-panel-section-title", children: "Required Version" }),
5558
+ /* @__PURE__ */ jsx35("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx35(
5527
5559
  Input6,
5528
5560
  {
5529
5561
  value: requiredVersion,
@@ -5533,10 +5565,10 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5533
5565
  readOnly: !editable
5534
5566
  }
5535
5567
  ) }),
5536
- /* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
5537
- providers.map((p, i) => /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5538
- /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5539
- /* @__PURE__ */ jsx34(
5568
+ /* @__PURE__ */ jsx35("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
5569
+ providers.map((p, i) => /* @__PURE__ */ jsxs23("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5570
+ /* @__PURE__ */ jsxs23("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5571
+ /* @__PURE__ */ jsx35(
5540
5572
  Input6,
5541
5573
  {
5542
5574
  value: p.name,
@@ -5546,10 +5578,10 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5546
5578
  readOnly: !editable
5547
5579
  }
5548
5580
  ),
5549
- editable && /* @__PURE__ */ jsx34(
5581
+ editable && /* @__PURE__ */ jsx35(
5550
5582
  IconButton8,
5551
5583
  {
5552
- icon: /* @__PURE__ */ jsx34(CanvasIcon, { name: "close" }),
5584
+ icon: /* @__PURE__ */ jsx35(CanvasIcon, { name: "close" }),
5553
5585
  "aria-label": "Remove provider",
5554
5586
  size: "md",
5555
5587
  tooltipPlacement: "bottom-end",
@@ -5557,7 +5589,7 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5557
5589
  }
5558
5590
  )
5559
5591
  ] }),
5560
- /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx34(
5592
+ /* @__PURE__ */ jsx35("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx35(
5561
5593
  Input6,
5562
5594
  {
5563
5595
  value: p.source,
@@ -5567,7 +5599,7 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5567
5599
  readOnly: !editable
5568
5600
  }
5569
5601
  ) }),
5570
- /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx34(
5602
+ /* @__PURE__ */ jsx35("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx35(
5571
5603
  Input6,
5572
5604
  {
5573
5605
  value: p.version,
@@ -5577,7 +5609,7 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5577
5609
  readOnly: !editable
5578
5610
  }
5579
5611
  ) }),
5580
- (p.aliases || editable) && /* @__PURE__ */ jsx34("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx34(
5612
+ (p.aliases || editable) && /* @__PURE__ */ jsx35("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx35(
5581
5613
  Input6,
5582
5614
  {
5583
5615
  value: p.aliases,
@@ -5590,7 +5622,7 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5590
5622
  }
5591
5623
  ) })
5592
5624
  ] }, p.id)),
5593
- editable && /* @__PURE__ */ jsx34(
5625
+ editable && /* @__PURE__ */ jsx35(
5594
5626
  Button11,
5595
5627
  {
5596
5628
  variant: "secondary",
@@ -5602,37 +5634,34 @@ function TerraformConfigContent({ moduleKey, terraform, onSave }) {
5602
5634
  children: "+ Add provider"
5603
5635
  }
5604
5636
  ),
5605
- /* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Backend" }),
5606
- /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
5607
- editable && /* @__PURE__ */ jsx34(UpdateButton, { draft, label: "Update terraform block" })
5637
+ /* @__PURE__ */ jsx35("h4", { className: "lace-panel-section-title", children: "Backend" }),
5638
+ /* @__PURE__ */ jsx35("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
5639
+ editable && /* @__PURE__ */ jsx35(UpdateButton, { draft, label: "Update terraform block" })
5608
5640
  ] });
5609
5641
  }
5610
5642
  function TerraformConfigPanel({ onClose, ...content }) {
5611
- return /* @__PURE__ */ jsx34(Panel5, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx34(TerraformConfigContent, { ...content }) });
5643
+ return /* @__PURE__ */ jsx35(Panel5, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx35(TerraformConfigContent, { ...content }) });
5612
5644
  }
5613
5645
 
5614
5646
  // src/components/panels/ModuleDetails.tsx
5615
- import { Fragment as Fragment13, jsx as jsx35, jsxs as jsxs22 } from "react/jsx-runtime";
5616
- function assertApplied(result) {
5617
- if (!result?.success) throw new Error("apply failed");
5618
- }
5647
+ import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
5619
5648
  var sectionKey = (moduleKey, section) => `${moduleKey}:${section}`;
5620
5649
  function ModuleDetails({ moduleKey, open = [] }) {
5621
5650
  const { bundle, runner } = useCanvas();
5622
5651
  const settings = useMemo10(() => deriveSettingsConfig2(bundle, moduleKey), [bundle, moduleKey]);
5623
5652
  if (!settings) return null;
5624
- if (settings.reference) return /* @__PURE__ */ jsx35(ReferenceDetails, { settings });
5653
+ if (settings.reference) return /* @__PURE__ */ jsx36(ReferenceDetails, { settings });
5625
5654
  const apply = async (actions) => {
5626
5655
  assertApplied(await runner.apply(actions));
5627
5656
  };
5628
- return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5629
- /* @__PURE__ */ jsx35(
5657
+ return /* @__PURE__ */ jsxs24(Fragment14, { children: [
5658
+ /* @__PURE__ */ jsx36(
5630
5659
  AccordionSection,
5631
5660
  {
5632
5661
  title: "Resources",
5633
5662
  defaultOpen: open.includes("Resources"),
5634
5663
  badge: `(${settings.resources.length})`,
5635
- children: /* @__PURE__ */ jsx35(
5664
+ children: /* @__PURE__ */ jsx36(
5636
5665
  ResourcesContent,
5637
5666
  {
5638
5667
  moduleKey,
@@ -5647,7 +5676,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5647
5676
  )
5648
5677
  }
5649
5678
  ),
5650
- /* @__PURE__ */ jsx35(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ jsx35(
5679
+ /* @__PURE__ */ jsx36(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ jsx36(
5651
5680
  ModuleInterfaceContent,
5652
5681
  {
5653
5682
  moduleKey,
@@ -5656,13 +5685,13 @@ function ModuleDetails({ moduleKey, open = [] }) {
5656
5685
  },
5657
5686
  sectionKey(moduleKey, "Interface")
5658
5687
  ) }),
5659
- /* @__PURE__ */ jsx35(
5688
+ /* @__PURE__ */ jsx36(
5660
5689
  AccordionSection,
5661
5690
  {
5662
5691
  title: "Moved and import blocks",
5663
5692
  defaultOpen: open.includes("Moved and import blocks"),
5664
5693
  badge: settings.directives.length > 0 ? `(${settings.directives.length})` : void 0,
5665
- children: /* @__PURE__ */ jsx35(
5694
+ children: /* @__PURE__ */ jsx36(
5666
5695
  DirectivesContent,
5667
5696
  {
5668
5697
  moduleKey,
@@ -5673,7 +5702,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5673
5702
  )
5674
5703
  }
5675
5704
  ),
5676
- /* @__PURE__ */ jsx35(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ jsx35(
5705
+ /* @__PURE__ */ jsx36(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ jsx36(
5677
5706
  LocalsContent,
5678
5707
  {
5679
5708
  moduleKey,
@@ -5682,7 +5711,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5682
5711
  },
5683
5712
  sectionKey(moduleKey, "Locals")
5684
5713
  ) }),
5685
- /* @__PURE__ */ jsx35(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ jsx35(
5714
+ /* @__PURE__ */ jsx36(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ jsx36(
5686
5715
  ProvidersContent,
5687
5716
  {
5688
5717
  moduleKey,
@@ -5691,7 +5720,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5691
5720
  },
5692
5721
  sectionKey(moduleKey, "Providers")
5693
5722
  ) }),
5694
- /* @__PURE__ */ jsx35(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ jsx35(
5723
+ /* @__PURE__ */ jsx36(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ jsx36(
5695
5724
  TerraformConfigContent,
5696
5725
  {
5697
5726
  moduleKey,
@@ -5720,9 +5749,9 @@ function DirectivesContent({
5720
5749
  ({ blocks: blocks2 }) => onSave(blocks2)
5721
5750
  );
5722
5751
  const { blocks } = draft.value;
5723
- return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5724
- blocks.length === 0 && /* @__PURE__ */ jsx35("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
5725
- /* @__PURE__ */ jsx35(
5752
+ return /* @__PURE__ */ jsxs24(Fragment14, { children: [
5753
+ blocks.length === 0 && /* @__PURE__ */ jsx36("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
5754
+ /* @__PURE__ */ jsx36(
5726
5755
  BlockEditor,
5727
5756
  {
5728
5757
  blocks,
@@ -5734,32 +5763,32 @@ function DirectivesContent({
5734
5763
  ]
5735
5764
  }
5736
5765
  ),
5737
- editable && /* @__PURE__ */ jsx35(UpdateButton, { draft, label: "Update moved and import blocks" })
5766
+ editable && /* @__PURE__ */ jsx36(UpdateButton, { draft, label: "Update moved and import blocks" })
5738
5767
  ] });
5739
5768
  }
5740
5769
  function ReferenceDetails({ settings }) {
5741
5770
  const reference = settings.reference;
5742
5771
  if (!reference) return null;
5743
- return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5744
- /* @__PURE__ */ jsxs22(AccordionSection, { title: "Source", defaultOpen: true, children: [
5745
- /* @__PURE__ */ jsx35("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
5746
- /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
5747
- /* @__PURE__ */ jsx35(Input7, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
5748
- /* @__PURE__ */ jsx35(Input7, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
5772
+ return /* @__PURE__ */ jsxs24(Fragment14, { children: [
5773
+ /* @__PURE__ */ jsxs24(AccordionSection, { title: "Source", defaultOpen: true, children: [
5774
+ /* @__PURE__ */ jsx36("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
5775
+ /* @__PURE__ */ jsxs24("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
5776
+ /* @__PURE__ */ jsx36(Input7, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
5777
+ /* @__PURE__ */ jsx36(Input7, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
5749
5778
  ] })
5750
5779
  ] }),
5751
- /* @__PURE__ */ jsxs22(AccordionSection, { title: "Interface", defaultOpen: true, children: [
5752
- /* @__PURE__ */ jsx35("h4", { className: "lace-panel-section-title", children: "Inputs" }),
5753
- settings.variables.length === 0 && /* @__PURE__ */ jsx35("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
5754
- settings.variables.map((v) => /* @__PURE__ */ jsx35("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx35(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
5755
- /* @__PURE__ */ jsx35("h4", { className: "lace-panel-section-title", children: "Outputs" }),
5756
- settings.outputs.map((o) => /* @__PURE__ */ jsx35("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx35(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
5780
+ /* @__PURE__ */ jsxs24(AccordionSection, { title: "Interface", defaultOpen: true, children: [
5781
+ /* @__PURE__ */ jsx36("h4", { className: "lace-panel-section-title", children: "Inputs" }),
5782
+ settings.variables.length === 0 && /* @__PURE__ */ jsx36("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
5783
+ settings.variables.map((v) => /* @__PURE__ */ jsx36("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx36(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
5784
+ /* @__PURE__ */ jsx36("h4", { className: "lace-panel-section-title", children: "Outputs" }),
5785
+ settings.outputs.map((o) => /* @__PURE__ */ jsx36("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx36(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
5757
5786
  ] })
5758
5787
  ] });
5759
5788
  }
5760
5789
 
5761
5790
  // src/components/panels/ModuleConfigPanel.tsx
5762
- import { Fragment as Fragment14, jsx as jsx36, jsxs as jsxs23 } from "react/jsx-runtime";
5791
+ import { Fragment as Fragment15, jsx as jsx37, jsxs as jsxs25 } from "react/jsx-runtime";
5763
5792
  var MODE_ITEMS = [
5764
5793
  { value: "empty", label: "Unset" },
5765
5794
  { value: "literal", label: "Lit" },
@@ -5878,8 +5907,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5878
5907
  const seed = useMemo11(() => callFields(config), [config]);
5879
5908
  const draft = useDraft(callDraft, [instance_id], seed, async (fields2) => {
5880
5909
  if (!config) throw new Error(`no instance ${instance_id} to update`);
5881
- const result = await runner.apply(callActions(config, address, fields2));
5882
- if (!result?.success) throw new Error("apply failed");
5910
+ assertApplied(await runner.apply(callActions(config, address, fields2)));
5883
5911
  });
5884
5912
  const fields = draft.value;
5885
5913
  const binding = (input) => fields[inputField(input.name)];
@@ -5911,41 +5939,41 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5911
5939
  ...m,
5912
5940
  disabled: !editable || m.value === "wired" || currentMode === "wired"
5913
5941
  }));
5914
- return /* @__PURE__ */ jsx36(
5915
- ModeToggle,
5942
+ return /* @__PURE__ */ jsx37(
5943
+ SegmentedControl,
5916
5944
  {
5945
+ label: `${input.name} binding mode`,
5917
5946
  value: currentMode,
5918
5947
  onChange: (next) => switchMode(input, next),
5919
- items,
5920
- "aria-label": `${input.name} binding mode`
5948
+ options: items
5921
5949
  }
5922
5950
  );
5923
5951
  }
5924
5952
  function renderInputField(input) {
5925
5953
  const currentMode = binding(input)?.mode ?? input.mode;
5926
- return /* @__PURE__ */ jsxs23("div", { className: "lace-panel-field", children: [
5927
- /* @__PURE__ */ jsxs23("label", { className: "lace-panel-row-label", children: [
5928
- /* @__PURE__ */ jsx36(Identifier, { text: input.name }),
5929
- input.required && /* @__PURE__ */ jsx36("span", { className: "lace-mcp__required-star", children: "*" })
5954
+ return /* @__PURE__ */ jsxs25("div", { className: "lace-panel-field", children: [
5955
+ /* @__PURE__ */ jsxs25("label", { className: "lace-panel-row-label", children: [
5956
+ /* @__PURE__ */ jsx37(Identifier, { text: input.name }),
5957
+ input.required && /* @__PURE__ */ jsx37("span", { className: "lace-mcp__required-star", children: "*" })
5930
5958
  ] }),
5931
5959
  renderModeSelector(input),
5932
- /* @__PURE__ */ jsxs23("div", { className: "lace-panel-row-content", children: [
5960
+ /* @__PURE__ */ jsxs25("div", { className: "lace-panel-row-content", children: [
5933
5961
  currentMode === "wired" && renderWiredEditor(input),
5934
5962
  currentMode === "variable" && renderVariableEditor(input),
5935
5963
  currentMode === "expression" && renderExpressionEditor(input),
5936
5964
  currentMode === "literal" && renderLiteralEditor(input)
5937
5965
  ] }),
5938
- input.description && /* @__PURE__ */ jsx36("div", { className: "lace-panel-field__description", children: input.description })
5966
+ input.description && /* @__PURE__ */ jsx37("div", { className: "lace-panel-field__description", children: input.description })
5939
5967
  ] }, input.name);
5940
5968
  }
5941
5969
  function renderWiredEditor(input) {
5942
5970
  const label = input.wired_source ?? "Not wired";
5943
- return /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__wired-row", children: [
5944
- /* @__PURE__ */ jsx36("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx36(Input8, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
5945
- editable && /* @__PURE__ */ jsx36(
5971
+ return /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__wired-row", children: [
5972
+ /* @__PURE__ */ jsx37("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx37(Input8, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
5973
+ editable && /* @__PURE__ */ jsx37(
5946
5974
  IconButton9,
5947
5975
  {
5948
- icon: /* @__PURE__ */ jsx36(CanvasIcon, { name: "close" }),
5976
+ icon: /* @__PURE__ */ jsx37(CanvasIcon, { name: "close" }),
5949
5977
  "aria-label": "Disconnect this input",
5950
5978
  size: "md",
5951
5979
  tooltipPlacement: "bottom-end",
@@ -5955,7 +5983,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5955
5983
  ] });
5956
5984
  }
5957
5985
  function renderVariableEditor(input) {
5958
- return /* @__PURE__ */ jsx36(
5986
+ return /* @__PURE__ */ jsx37(
5959
5987
  Input8,
5960
5988
  {
5961
5989
  value: binding(input)?.variable ?? "",
@@ -5971,7 +5999,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5971
5999
  );
5972
6000
  }
5973
6001
  function renderExpressionEditor(input) {
5974
- return /* @__PURE__ */ jsx36(
6002
+ return /* @__PURE__ */ jsx37(
5975
6003
  Textarea3,
5976
6004
  {
5977
6005
  value: binding(input)?.expression ?? "",
@@ -5989,7 +6017,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5989
6017
  const kind = literalKind(input.type);
5990
6018
  const updateValue = (next) => setBinding(input, { value: next });
5991
6019
  if (kind === "bool") {
5992
- return /* @__PURE__ */ jsxs23(
6020
+ return /* @__PURE__ */ jsxs25(
5993
6021
  "select",
5994
6022
  {
5995
6023
  className: "lace-mcp__select",
@@ -5997,14 +6025,14 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5997
6025
  onChange: (e) => updateValue(e.target.value === "true"),
5998
6026
  disabled: !editable,
5999
6027
  children: [
6000
- /* @__PURE__ */ jsx36("option", { value: "true", children: "True" }),
6001
- /* @__PURE__ */ jsx36("option", { value: "false", children: "False" })
6028
+ /* @__PURE__ */ jsx37("option", { value: "true", children: "True" }),
6029
+ /* @__PURE__ */ jsx37("option", { value: "false", children: "False" })
6002
6030
  ]
6003
6031
  }
6004
6032
  );
6005
6033
  }
6006
6034
  if (kind === "number") {
6007
- return /* @__PURE__ */ jsx36(
6035
+ return /* @__PURE__ */ jsx37(
6008
6036
  Input8,
6009
6037
  {
6010
6038
  type: "number",
@@ -6017,7 +6045,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6017
6045
  }
6018
6046
  if (kind === "collection") {
6019
6047
  const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
6020
- return /* @__PURE__ */ jsx36(
6048
+ return /* @__PURE__ */ jsx37(
6021
6049
  Textarea3,
6022
6050
  {
6023
6051
  value: jsonStr,
@@ -6035,7 +6063,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6035
6063
  }
6036
6064
  );
6037
6065
  }
6038
- return /* @__PURE__ */ jsx36(
6066
+ return /* @__PURE__ */ jsx37(
6039
6067
  Input8,
6040
6068
  {
6041
6069
  value: String(value ?? ""),
@@ -6052,34 +6080,34 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6052
6080
  );
6053
6081
  }
6054
6082
  if (!config) {
6055
- return /* @__PURE__ */ jsxs23(Panel6, { title: "Error", onClose, children: [
6056
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__error-title", children: [
6083
+ return /* @__PURE__ */ jsxs25(Panel6, { title: "Error", onClose, children: [
6084
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__error-title", children: [
6057
6085
  'Failed to load configuration for "',
6058
6086
  instance_id,
6059
6087
  '":'
6060
6088
  ] }),
6061
- /* @__PURE__ */ jsx36("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
6089
+ /* @__PURE__ */ jsx37("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
6062
6090
  ] });
6063
6091
  }
6064
6092
  const dependsOn = fields.depends_on;
6065
6093
  const setProviders2 = (next) => draft.set("providers", next);
6066
- const title = /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__title", children: [
6067
- /* @__PURE__ */ jsx36("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
6068
- /* @__PURE__ */ jsx36("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ jsx36(Identifier, { text: instance_id }) })
6094
+ const title = /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__title", children: [
6095
+ /* @__PURE__ */ jsx37("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
6096
+ /* @__PURE__ */ jsx37("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ jsx37(Identifier, { text: instance_id }) })
6069
6097
  ] });
6070
- const footer = editable ? /* @__PURE__ */ jsx36(UpdateButton, { draft, label: "Update configuration" }) : void 0;
6071
- return /* @__PURE__ */ jsxs23(Panel6, { title, footer, flush: true, onClose, children: [
6072
- requiredInputs.length > 0 && /* @__PURE__ */ jsx36(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
6073
- optionalInputs.length > 0 && /* @__PURE__ */ jsx36(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
6074
- config.dependency_options.length > 0 && /* @__PURE__ */ jsxs23(
6098
+ const footer = editable ? /* @__PURE__ */ jsx37(UpdateButton, { draft, label: "Update configuration" }) : void 0;
6099
+ return /* @__PURE__ */ jsxs25(Panel6, { title, footer, flush: true, onClose, children: [
6100
+ requiredInputs.length > 0 && /* @__PURE__ */ jsx37(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
6101
+ optionalInputs.length > 0 && /* @__PURE__ */ jsx37(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
6102
+ config.dependency_options.length > 0 && /* @__PURE__ */ jsxs25(
6075
6103
  AccordionSection,
6076
6104
  {
6077
6105
  title: "Depends On",
6078
6106
  badge: dependsOn.length > 0 ? `(${dependsOn.length})` : void 0,
6079
6107
  children: [
6080
- /* @__PURE__ */ jsx36("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
6081
- config.dependency_options.map((option) => /* @__PURE__ */ jsxs23("label", { className: "lace-mcp__depends-item", children: [
6082
- /* @__PURE__ */ jsx36(
6108
+ /* @__PURE__ */ jsx37("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
6109
+ config.dependency_options.map((option) => /* @__PURE__ */ jsxs25("label", { className: "lace-mcp__depends-item", children: [
6110
+ /* @__PURE__ */ jsx37(
6083
6111
  "input",
6084
6112
  {
6085
6113
  type: "checkbox",
@@ -6092,29 +6120,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6092
6120
  )
6093
6121
  }
6094
6122
  ),
6095
- /* @__PURE__ */ jsx36(Identifier, { className: "lace-mcp__depends-label", text: option })
6123
+ /* @__PURE__ */ jsx37(Identifier, { className: "lace-mcp__depends-label", text: option })
6096
6124
  ] }, option))
6097
6125
  ]
6098
6126
  }
6099
6127
  ),
6100
- (fields.providers.length > 0 || editable) && /* @__PURE__ */ jsxs23(
6128
+ (fields.providers.length > 0 || editable) && /* @__PURE__ */ jsxs25(
6101
6129
  AccordionSection,
6102
6130
  {
6103
6131
  title: "Providers",
6104
6132
  badge: fields.providers.length > 0 ? `(${fields.providers.length})` : void 0,
6105
6133
  children: [
6106
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
6134
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__depends-hint", children: [
6107
6135
  "Map each child-local provider name to the root provider reference passed down (e.g.",
6108
6136
  " ",
6109
- /* @__PURE__ */ jsx36("code", { children: "aws" }),
6137
+ /* @__PURE__ */ jsx37("code", { children: "aws" }),
6110
6138
  " \u2192 ",
6111
- /* @__PURE__ */ jsx36("code", { children: "aws.west" }),
6139
+ /* @__PURE__ */ jsx37("code", { children: "aws.west" }),
6112
6140
  ")."
6113
6141
  ] }),
6114
6142
  fields.providers.map((row, i) => (
6115
6143
  // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
6116
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__provider-row", children: [
6117
- /* @__PURE__ */ jsx36(
6144
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__provider-row", children: [
6145
+ /* @__PURE__ */ jsx37(
6118
6146
  Input8,
6119
6147
  {
6120
6148
  value: row.key,
@@ -6126,8 +6154,8 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6126
6154
  readOnly: !editable
6127
6155
  }
6128
6156
  ),
6129
- /* @__PURE__ */ jsx36("span", { className: "lace-mcp__provider-arrow", children: "=" }),
6130
- /* @__PURE__ */ jsx36(
6157
+ /* @__PURE__ */ jsx37("span", { className: "lace-mcp__provider-arrow", children: "=" }),
6158
+ /* @__PURE__ */ jsx37(
6131
6159
  Input8,
6132
6160
  {
6133
6161
  value: row.value,
@@ -6139,10 +6167,10 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6139
6167
  readOnly: !editable
6140
6168
  }
6141
6169
  ),
6142
- editable && /* @__PURE__ */ jsx36(
6170
+ editable && /* @__PURE__ */ jsx37(
6143
6171
  IconButton9,
6144
6172
  {
6145
- icon: /* @__PURE__ */ jsx36(CanvasIcon, { name: "close" }),
6173
+ icon: /* @__PURE__ */ jsx37(CanvasIcon, { name: "close" }),
6146
6174
  "aria-label": "Remove this provider mapping",
6147
6175
  size: "md",
6148
6176
  tooltipPlacement: "bottom-end",
@@ -6151,7 +6179,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6151
6179
  )
6152
6180
  ] }, i)
6153
6181
  )),
6154
- editable && /* @__PURE__ */ jsx36(
6182
+ editable && /* @__PURE__ */ jsx37(
6155
6183
  Button12,
6156
6184
  {
6157
6185
  variant: "secondary",
@@ -6163,15 +6191,15 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6163
6191
  ]
6164
6192
  }
6165
6193
  ),
6166
- (fields.count || fields.for_each || editable) && /* @__PURE__ */ jsxs23(AccordionSection, { title: "Repetition", children: [
6167
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
6194
+ (fields.count || fields.for_each || editable) && /* @__PURE__ */ jsxs25(AccordionSection, { title: "Repetition", children: [
6195
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__depends-hint", children: [
6168
6196
  "The call's ",
6169
- /* @__PURE__ */ jsx36("code", { children: "count" }),
6197
+ /* @__PURE__ */ jsx37("code", { children: "count" }),
6170
6198
  " or ",
6171
- /* @__PURE__ */ jsx36("code", { children: "for_each" }),
6199
+ /* @__PURE__ */ jsx37("code", { children: "for_each" }),
6172
6200
  ": one module, called once per instance."
6173
6201
  ] }),
6174
- /* @__PURE__ */ jsx36(
6202
+ /* @__PURE__ */ jsx37(
6175
6203
  Input8,
6176
6204
  {
6177
6205
  label: "count",
@@ -6183,7 +6211,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6183
6211
  readOnly: !editable
6184
6212
  }
6185
6213
  ),
6186
- /* @__PURE__ */ jsx36(
6214
+ /* @__PURE__ */ jsx37(
6187
6215
  Input8,
6188
6216
  {
6189
6217
  label: "for_each",
@@ -6196,26 +6224,26 @@ function ModuleConfigPanel({ instance_id, onClose }) {
6196
6224
  }
6197
6225
  )
6198
6226
  ] }),
6199
- config.outputs.length > 0 && /* @__PURE__ */ jsx36(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-card", children: [
6200
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-header", children: [
6201
- /* @__PURE__ */ jsx36(Identifier, { className: "lace-mcp__output-name", text: o.name }),
6202
- /* @__PURE__ */ jsx36(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
6227
+ config.outputs.length > 0 && /* @__PURE__ */ jsx37(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__output-card", children: [
6228
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__output-header", children: [
6229
+ /* @__PURE__ */ jsx37(Identifier, { className: "lace-mcp__output-name", text: o.name }),
6230
+ /* @__PURE__ */ jsx37(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
6203
6231
  ] }),
6204
- o.description && /* @__PURE__ */ jsx36("div", { className: "lace-mcp__output-description", children: o.description }),
6205
- o.sensitive && /* @__PURE__ */ jsx36("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
6232
+ o.description && /* @__PURE__ */ jsx37("div", { className: "lace-mcp__output-description", children: o.description }),
6233
+ o.sensitive && /* @__PURE__ */ jsx37("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
6206
6234
  ] }, o.name)) }),
6207
- config.module_key && /* @__PURE__ */ jsxs23(Fragment14, { children: [
6208
- /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__module-heading", children: [
6209
- /* @__PURE__ */ jsx36("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
6210
- /* @__PURE__ */ jsxs23("div", { children: [
6211
- /* @__PURE__ */ jsx36(Identifier, { text: config.module_key }),
6212
- config.source && /* @__PURE__ */ jsxs23("span", { className: "lace-mcp__module-source", children: [
6235
+ config.module_key && /* @__PURE__ */ jsxs25(Fragment15, { children: [
6236
+ /* @__PURE__ */ jsxs25("div", { className: "lace-mcp__module-heading", children: [
6237
+ /* @__PURE__ */ jsx37("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
6238
+ /* @__PURE__ */ jsxs25("div", { children: [
6239
+ /* @__PURE__ */ jsx37(Identifier, { text: config.module_key }),
6240
+ config.source && /* @__PURE__ */ jsxs25("span", { className: "lace-mcp__module-source", children: [
6213
6241
  " \xB7 ",
6214
- /* @__PURE__ */ jsx36(Identifier, { text: config.source })
6242
+ /* @__PURE__ */ jsx37(Identifier, { text: config.source })
6215
6243
  ] })
6216
6244
  ] })
6217
6245
  ] }),
6218
- /* @__PURE__ */ jsx36(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
6246
+ /* @__PURE__ */ jsx37(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
6219
6247
  ] })
6220
6248
  ] });
6221
6249
  }
@@ -6241,11 +6269,11 @@ var moduleConfigPanel = {
6241
6269
  };
6242
6270
 
6243
6271
  // src/core/panels/SourceRefusedBanner.tsx
6244
- import { jsx as jsx37 } from "react/jsx-runtime";
6272
+ import { jsx as jsx38 } from "react/jsx-runtime";
6245
6273
  var LOCKED = "The canvas can't take this module's .tf, so editing, saving and generating are locked until it can; the Diagnostics tab says why.";
6246
6274
  var OUT_OF_LACE_SHAPE = "This Terraform is not in lace shape yet, so the canvas shows it read-only.";
6247
6275
  function SourceRefusedBanner({ ctx }) {
6248
- return /* @__PURE__ */ jsx37(
6276
+ return /* @__PURE__ */ jsx38(
6249
6277
  RowActionBanner,
6250
6278
  {
6251
6279
  ctx,
@@ -6271,11 +6299,11 @@ import { createElement as createElement3 } from "react";
6271
6299
 
6272
6300
  // src/components/panels/UnifiedSettingsPanel.tsx
6273
6301
  import { Panel as Panel7 } from "@lace-cloud/ui";
6274
- import "./panels-shared-3HUQC7TC.css";
6275
- import { jsx as jsx38 } from "react/jsx-runtime";
6302
+ import "./panels-shared-Y4ULZZLB.css";
6303
+ import { jsx as jsx39 } from "react/jsx-runtime";
6276
6304
  function UnifiedSettingsPanel({ onClose }) {
6277
6305
  const { bundle } = useCanvas();
6278
- return /* @__PURE__ */ jsx38(Panel7, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ jsx38(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
6306
+ return /* @__PURE__ */ jsx39(Panel7, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ jsx39(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
6279
6307
  }
6280
6308
 
6281
6309
  // src/core/panels/settings.ts
@@ -6314,7 +6342,7 @@ var settingsToggle = {
6314
6342
 
6315
6343
  // src/core/contributions.ts
6316
6344
  var CORE_CONTRIBUTIONS = {
6317
- overlays: [describeOverlay],
6345
+ overlays: [describeOverlay, planOverlay],
6318
6346
  panels: [
6319
6347
  conflictPanel,
6320
6348
  sourceRefusedPanel,
@@ -6343,7 +6371,7 @@ function useEditing(runner) {
6343
6371
  }
6344
6372
 
6345
6373
  // src/App.tsx
6346
- import { jsx as jsx39, jsxs as jsxs24 } from "react/jsx-runtime";
6374
+ import { jsx as jsx40, jsxs as jsxs26 } from "react/jsx-runtime";
6347
6375
  var EMPTY_CONTRIBUTIONS = { overlays: [], panels: [], actions: [] };
6348
6376
  var NO_TARGET = {};
6349
6377
  function OverlayRunner({
@@ -6362,7 +6390,7 @@ function OverlayRunner({
6362
6390
  },
6363
6391
  [ctx.ports.presenter]
6364
6392
  );
6365
- return /* @__PURE__ */ jsx39(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ jsx39(OverlayDecorations, { overlay, ctx, onDecorations }) });
6393
+ return /* @__PURE__ */ jsx40(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ jsx40(OverlayDecorations, { overlay, ctx, onDecorations }) });
6366
6394
  }
6367
6395
  function OverlayDecorations({
6368
6396
  overlay,
@@ -6391,7 +6419,7 @@ function PanelSlot({ panel, ctx, tick }) {
6391
6419
  return next;
6392
6420
  });
6393
6421
  }, []);
6394
- return /* @__PURE__ */ jsxs24(
6422
+ return /* @__PURE__ */ jsxs26(
6395
6423
  PanelScope,
6396
6424
  {
6397
6425
  ctx,
@@ -6399,13 +6427,13 @@ function PanelSlot({ panel, ctx, tick }) {
6399
6427
  tick,
6400
6428
  onReadError,
6401
6429
  children: [
6402
- [...readErrors].map(([path, error]) => /* @__PURE__ */ jsxs24("p", { className: "lace-app__panel-error", children: [
6430
+ [...readErrors].map(([path, error]) => /* @__PURE__ */ jsxs26("p", { className: "lace-app__panel-error", children: [
6403
6431
  "Couldn't load ",
6404
6432
  path,
6405
6433
  ": ",
6406
6434
  error.message
6407
6435
  ] }, path)),
6408
- /* @__PURE__ */ jsx39(panel.Component, { ctx })
6436
+ /* @__PURE__ */ jsx40(panel.Component, { ctx })
6409
6437
  ]
6410
6438
  }
6411
6439
  );
@@ -6419,8 +6447,8 @@ function BottomTabs({
6419
6447
  const manual = manualId !== null ? panels.find((p) => p.id === manualId) : void 0;
6420
6448
  const active = manual ?? panels[0] ?? null;
6421
6449
  if (panels.length === 0) return null;
6422
- return /* @__PURE__ */ jsxs24("div", { className: "lace-app__bottom", children: [
6423
- /* @__PURE__ */ jsx39("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ jsx39(
6450
+ return /* @__PURE__ */ jsxs26("div", { className: "lace-app__bottom", children: [
6451
+ /* @__PURE__ */ jsx40("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ jsx40(
6424
6452
  "button",
6425
6453
  {
6426
6454
  type: "button",
@@ -6432,7 +6460,7 @@ function BottomTabs({
6432
6460
  },
6433
6461
  panel.id
6434
6462
  )) }),
6435
- /* @__PURE__ */ jsx39("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ jsx39(PanelSlot, { panel: active, ctx, tick }) })
6463
+ /* @__PURE__ */ jsx40("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ jsx40(PanelSlot, { panel: active, ctx, tick }) })
6436
6464
  ] });
6437
6465
  }
6438
6466
  function endMessage(end) {
@@ -6530,7 +6558,7 @@ function App({
6530
6558
  }, [source, stored, ports.source]);
6531
6559
  const arrangement = projected?.arrangement ?? stored;
6532
6560
  const view = projected?.view ?? null;
6533
- useLayoutEffect5(() => {
6561
+ useLayoutEffect6(() => {
6534
6562
  if (!source || !projected) return;
6535
6563
  const held = ledgerFor(portLedger.current, ports.source);
6536
6564
  const landed = held.shown?.source !== source;
@@ -6545,12 +6573,22 @@ function App({
6545
6573
  queueMicrotask(() => ports.viewState.save(corrected));
6546
6574
  }, [source, projected, stored, ports.source, ports.viewState]);
6547
6575
  const reconciledFrame = useRef12(null);
6548
- useLayoutEffect5(() => {
6576
+ useLayoutEffect6(() => {
6549
6577
  if (!source || !view || reconciledFrame.current === source) return;
6550
6578
  reconciledFrame.current = source;
6551
6579
  setSelection((current) => reconcileSelection(view, current));
6552
6580
  }, [source, view]);
6553
- useLayoutEffect5(() => {
6581
+ const selectionPort = ports.selection;
6582
+ const heardModules = useRef12(NO_SELECTION.nodes);
6583
+ useEffect13(() => {
6584
+ if (!selectionPort) return;
6585
+ const modules = selection.nodes;
6586
+ const heard = heardModules.current;
6587
+ if (modules.length === heard.length && modules.every((id) => heard.includes(id))) return;
6588
+ heardModules.current = modules;
6589
+ selectionPort.selected(modules);
6590
+ }, [selectionPort, selection.nodes]);
6591
+ useLayoutEffect6(() => {
6554
6592
  if (source) drafts.settle(source.bundle);
6555
6593
  }, [source, drafts]);
6556
6594
  const editable = ports.editor !== void 0 && !source?.sourceRefused;
@@ -6579,6 +6617,7 @@ function App({
6579
6617
  root: ports.context.root,
6580
6618
  sessionId: ports.context.sessionId,
6581
6619
  stack,
6620
+ run: ports.context.run,
6582
6621
  editable,
6583
6622
  generating: source.generating,
6584
6623
  sourceRefused: source.sourceRefused,
@@ -6620,7 +6659,7 @@ function App({
6620
6659
  resolved.panels.filter((panel) => panel.slot === "toolbar")
6621
6660
  );
6622
6661
  const rootRef = useRef12(null);
6623
- useEffect13(() => {
6662
+ useLayoutEffect6(() => {
6624
6663
  if (!ctx) return;
6625
6664
  registerKeyTarget(ctx, "app", rootRef.current);
6626
6665
  return () => registerKeyTarget(ctx, "app", null);
@@ -6630,7 +6669,7 @@ function App({
6630
6669
  useFocusKeptOnRemoval(rootRef, rootMounted);
6631
6670
  useActionKeys(ctx && envExtras ? resolved.actions : [], ctx, runner, envExtras);
6632
6671
  if (!ctx || !view || !source || !envExtras) {
6633
- return end ? /* @__PURE__ */ jsx39(ErrorState, { message: endMessage(end) }) : null;
6672
+ return end ? /* @__PURE__ */ jsx40(CanvasRoot_default, { className: "lace-app", style: { height }, children: /* @__PURE__ */ jsx40(ErrorState, { message: endMessage(end) }) }) : null;
6634
6673
  }
6635
6674
  const contextValue = {
6636
6675
  ports,
@@ -6652,8 +6691,8 @@ function App({
6652
6691
  const bannerPanels = resolved.panels.filter((panel) => panel.slot === "banner");
6653
6692
  const bottomPanels = resolved.panels.filter((panel) => panel.slot === "bottom");
6654
6693
  const drawerPanel = resolved.panels.find((panel) => panel.slot === "drawer");
6655
- return /* @__PURE__ */ jsxs24(ErrorBoundary, { children: [
6656
- resolved.overlays.map((overlay) => /* @__PURE__ */ jsx39(
6694
+ return /* @__PURE__ */ jsx40(CanvasRoot_default, { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: /* @__PURE__ */ jsxs26(ErrorBoundary, { children: [
6695
+ resolved.overlays.map((overlay) => /* @__PURE__ */ jsx40(
6657
6696
  OverlayRunner,
6658
6697
  {
6659
6698
  overlay,
@@ -6663,15 +6702,15 @@ function App({
6663
6702
  },
6664
6703
  overlay.id
6665
6704
  )),
6666
- /* @__PURE__ */ jsx39(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs24("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
6667
- (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar", children: [
6668
- toolbar.sections.map((section, index) => /* @__PURE__ */ jsxs24(Fragment15, { children: [
6669
- index > 0 ? /* @__PURE__ */ jsx39("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
6670
- /* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar-section", children: [
6705
+ /* @__PURE__ */ jsxs26(CanvasContext.Provider, { value: contextValue, children: [
6706
+ (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ jsxs26("div", { className: "lace-app__toolbar", children: [
6707
+ toolbar.sections.map((section, index) => /* @__PURE__ */ jsxs26(Fragment16, { children: [
6708
+ index > 0 ? /* @__PURE__ */ jsx40("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
6709
+ /* @__PURE__ */ jsxs26("div", { className: "lace-app__toolbar-section", children: [
6671
6710
  section.actions.map((action) => (
6672
6711
  // `runner.busy` reads the store, whose every write
6673
6712
  // re-renders App (`resultSlots`).
6674
- /* @__PURE__ */ jsx39(
6713
+ /* @__PURE__ */ jsx40(
6675
6714
  ToolbarAction,
6676
6715
  {
6677
6716
  action,
@@ -6682,45 +6721,32 @@ function App({
6682
6721
  action.id
6683
6722
  )
6684
6723
  )),
6685
- section.panels.map((panel) => /* @__PURE__ */ jsx39(PanelSlot, { panel, ctx, tick }, panel.id))
6724
+ section.panels.map((panel) => /* @__PURE__ */ jsx40(PanelSlot, { panel, ctx, tick }, panel.id))
6686
6725
  ] })
6687
6726
  ] }, section.key ?? "")),
6688
- toolbar.trailing.length > 0 && /* @__PURE__ */ jsx39("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ jsx39(PanelSlot, { panel, ctx, tick }, panel.id)) })
6727
+ toolbar.trailing.length > 0 && /* @__PURE__ */ jsx40("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ jsx40(PanelSlot, { panel, ctx, tick }, panel.id)) })
6689
6728
  ] }),
6690
- /* @__PURE__ */ jsx39("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ jsx39(PanelSlot, { panel, ctx, tick }, panel.id)) }),
6691
- /* @__PURE__ */ jsxs24("div", { className: "lace-app__body", children: [
6692
- /* @__PURE__ */ jsxs24("div", { className: "lace-app__main", children: [
6693
- /* @__PURE__ */ jsx39("div", { className: "lace-app__canvas", children: /* @__PURE__ */ jsx39(ReactFlowProvider, { children: /* @__PURE__ */ jsx39(Canvas, { height: "100%" }) }) }),
6694
- /* @__PURE__ */ jsx39(BottomTabs, { panels: bottomPanels, ctx, tick })
6729
+ /* @__PURE__ */ jsx40("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ jsx40(PanelSlot, { panel, ctx, tick }, panel.id)) }),
6730
+ /* @__PURE__ */ jsxs26("div", { className: "lace-app__body", children: [
6731
+ /* @__PURE__ */ jsxs26("div", { className: "lace-app__main", children: [
6732
+ /* @__PURE__ */ jsx40("div", { className: "lace-app__canvas", children: /* @__PURE__ */ jsx40(ReactFlowProvider, { children: /* @__PURE__ */ jsx40(Canvas, { height: "100%" }) }) }),
6733
+ /* @__PURE__ */ jsx40(BottomTabs, { panels: bottomPanels, ctx, tick })
6695
6734
  ] }),
6696
- drawerPanel && /* @__PURE__ */ jsx39(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ jsx39(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
6735
+ drawerPanel && /* @__PURE__ */ jsx40(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ jsx40(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
6697
6736
  ] }),
6698
- /* @__PURE__ */ jsx39(CommandArgsForm, { form: pendingForm })
6699
- ] }) })
6700
- ] });
6737
+ /* @__PURE__ */ jsx40(CommandArgsForm, { form: pendingForm })
6738
+ ] })
6739
+ ] }) });
6701
6740
  }
6702
6741
 
6703
6742
  // src/adapters/snapshot-source.ts
6704
- var SnapshotFetchError = class extends Error {
6705
- constructor(status) {
6706
- super(`snapshotSource: failed to fetch bundle (status ${status})`);
6707
- this.status = status;
6708
- this.name = "SnapshotFetchError";
6709
- }
6710
- };
6743
+ import { Bundle } from "@lace-cloud/proto";
6711
6744
  function snapshotSource(input) {
6712
- const fetchImpl = input.fetch ?? globalThis.fetch.bind(globalThis);
6713
6745
  let cached = null;
6714
6746
  let loadPromise = null;
6715
6747
  async function load() {
6716
6748
  if (cached) return cached;
6717
- const res = await fetchImpl(input.bundleUrl, {
6718
- method: "GET",
6719
- headers: { accept: "application/octet-stream", ...input.headers },
6720
- credentials: "include"
6721
- });
6722
- if (!res.ok) throw new SnapshotFetchError(res.status);
6723
- const bytes = new Uint8Array(await res.arrayBuffer());
6749
+ const bytes = await input.read();
6724
6750
  const source = {
6725
6751
  bundle: Bundle.decode(bytes),
6726
6752
  canUndo: false,
@@ -6767,6 +6793,7 @@ export {
6767
6793
  ApplyUnobservedError,
6768
6794
  COMMANDS,
6769
6795
  CanvasContext,
6796
+ CanvasRoot_default as CanvasRoot,
6770
6797
  CommandArgsForm,
6771
6798
  CommandDetachedError,
6772
6799
  CommandExitError,
@@ -6780,42 +6807,30 @@ export {
6780
6807
  ErrorState,
6781
6808
  GENERATE_STAGES,
6782
6809
  GroupNode_default as GroupNode,
6783
- LocalsContent,
6784
6810
  LocalsPanel,
6785
6811
  ModuleConfigPanel,
6786
- ModuleInterfaceContent,
6787
6812
  ModuleInterfacePanel,
6788
6813
  ModuleNode_default as ModuleNode,
6789
6814
  NodeConfigBusProvider,
6790
6815
  PanelScope,
6791
- ProvidersContent,
6792
6816
  ProvidersPanel,
6793
6817
  Reason,
6794
6818
  SCHEMAS,
6795
- SnapshotFetchError,
6796
- SourceRefusedBanner,
6797
6819
  TerraformConfigContent,
6798
6820
  TerraformConfigPanel,
6799
- Toast,
6800
- UngeneratedMarker,
6801
6821
  UnifiedSettingsPanel,
6802
- UnsavedMarker,
6803
6822
  answering,
6804
6823
  bridgeCaller,
6805
- carriesFailure,
6806
6824
  commandPathOf,
6807
6825
  commandUnderWay,
6808
- conflictPanel,
6809
6826
  connectCaller,
6810
6827
  createActionRunner,
6811
6828
  createDraftStore,
6812
6829
  createResultStore,
6813
6830
  currentReport,
6814
6831
  decorate,
6815
- decorateDescribe,
6816
6832
  defineCommand,
6817
6833
  defineOverlay,
6818
- describeOverlay,
6819
6834
  diagnosticsOf,
6820
6835
  disabledReason,
6821
6836
  foldReport,
@@ -6825,16 +6840,10 @@ export {
6825
6840
  openEngineSession,
6826
6841
  parseBound,
6827
6842
  parseCommandFailure,
6828
- projectCanvasView2 as projectCanvasView,
6829
6843
  reportDiagnostics,
6830
6844
  resolveContributions,
6831
6845
  rowActions,
6832
6846
  snapshotSource,
6833
- sourceRefusedPanel,
6834
- toArgv,
6835
- ungeneratedMarker,
6836
- uniqueDiagnostics,
6837
- unsavedMarker,
6838
6847
  useCanvas,
6839
6848
  useCanvasSource,
6840
6849
  useCommandRead,