@lace-cloud/canvas 0.33.0 → 0.35.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
@@ -46,7 +46,7 @@ import {
46
46
  rowActions,
47
47
  toArgv,
48
48
  uniqueDiagnostics
49
- } from "./chunk-45HRNFCU.mjs";
49
+ } from "./chunk-O3I4KLND.mjs";
50
50
 
51
51
  // src/index.ts
52
52
  import { projectCanvasView as projectCanvasView2 } from "@lace-cloud/proto";
@@ -55,9 +55,9 @@ import { Toast } from "@lace-cloud/ui/feedback";
55
55
  // src/App.tsx
56
56
  import { ReactFlowProvider } from "@xyflow/react";
57
57
  import {
58
- Fragment as Fragment14,
58
+ Fragment as Fragment15,
59
59
  useCallback as useCallback11,
60
- useEffect as useEffect12,
60
+ useEffect as useEffect13,
61
61
  useLayoutEffect as useLayoutEffect5,
62
62
  useMemo as useMemo12,
63
63
  useRef as useRef12,
@@ -68,7 +68,7 @@ import "./App-IFIOMNV7.css";
68
68
 
69
69
  // src/Canvas.tsx
70
70
  import "@xyflow/react/dist/style.css";
71
- import "./Canvas-JRY2HAY6.css";
71
+ import "./Canvas-VQQEZSPA.css";
72
72
  import { drawnRect as drawnRect2, extentOf as extentOf3, instanceAddress as instanceAddress4, localIn as localIn3 } from "@lace-cloud/proto";
73
73
  import {
74
74
  applyEdgeChanges,
@@ -77,7 +77,7 @@ import {
77
77
  useNodesInitialized,
78
78
  useReactFlow as useReactFlow3
79
79
  } from "@xyflow/react";
80
- import { useCallback as useCallback8, useEffect as useEffect8, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from "react";
80
+ import { useCallback as useCallback8, useEffect as useEffect9, useLayoutEffect as useLayoutEffect3, useMemo as useMemo6, useRef as useRef8, useState as useState8 } from "react";
81
81
 
82
82
  // src/components/CanvasControls.tsx
83
83
  import { IconButton } from "@lace-cloud/ui";
@@ -279,21 +279,25 @@ function isEmphasized(action, ctx) {
279
279
 
280
280
  // src/utils/key-chord.ts
281
281
  var BARE_KEYS = ["Delete", "Backspace"];
282
- function parseChord(spec) {
283
- if (BARE_KEYS.some((bare) => bare === spec)) return { mod: false, shift: false, key: spec };
284
- const [mod, ...rest] = spec.split("+");
285
- if (mod !== "Mod") return void 0;
286
- if (rest.length === 1 && rest[0] !== "") return { mod: true, shift: false, key: rest[0] };
282
+ var MODIFIERS = ["Mod", "Ctrl"];
283
+ function parseChord(spec, mac) {
284
+ if (BARE_KEYS.some((bare) => bare === spec)) {
285
+ return { modifier: void 0, shift: false, key: spec };
286
+ }
287
+ const [head, ...rest] = spec.split("+");
288
+ const modifier = MODIFIERS.find((m) => m === head);
289
+ if (!modifier || modifier === "Ctrl" && mac) return void 0;
290
+ if (rest.length === 1 && rest[0] !== "") return { modifier, shift: false, key: rest[0] };
287
291
  if (rest.length === 2 && rest[0] === "Shift" && rest[1] !== "") {
288
- return { mod: true, shift: true, key: rest[1] };
292
+ return { modifier, shift: true, key: rest[1] };
289
293
  }
290
294
  return void 0;
291
295
  }
292
296
  var MAC_GLYPHS = { Backspace: "\u232B", Delete: "\u2326" };
293
297
  function formatChord(spec, mac) {
294
- const chord = parseChord(spec);
298
+ const chord = parseChord(spec, mac);
295
299
  if (!chord) return void 0;
296
- if (!chord.mod) return mac ? MAC_GLYPHS[chord.key] ?? chord.key : chord.key;
300
+ if (!chord.modifier) return mac ? MAC_GLYPHS[chord.key] ?? chord.key : chord.key;
297
301
  const key = chord.key.length === 1 ? chord.key.toUpperCase() : chord.key;
298
302
  if (mac) return `${chord.shift ? "\u21E7" : ""}\u2318${key}`;
299
303
  return ["Ctrl", ...chord.shift ? ["Shift"] : [], key].join("+");
@@ -711,8 +715,8 @@ import {
711
715
  groupPinY,
712
716
  NODE_ROW_HEIGHT
713
717
  } from "@lace-cloud/proto";
714
- import { Handle, Position } from "@xyflow/react";
715
- import { useCallback as useCallback3, useEffect as useEffect3, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
718
+ import { Handle as Handle2, Position as Position2 } from "@xyflow/react";
719
+ import { useCallback as useCallback3, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
716
720
 
717
721
  // src/state/canvas-context.ts
718
722
  import { createContext, useContext } from "react";
@@ -877,6 +881,141 @@ function BadgeRow({ badges }) {
877
881
  )) });
878
882
  }
879
883
 
884
+ // src/components/nodes/CallHandles.tsx
885
+ import { Handle, Position, useUpdateNodeInternals } from "@xyflow/react";
886
+ import { useEffect as useEffect2 } from "react";
887
+
888
+ // src/utils/handleId.ts
889
+ var NODE_HANDLE = "node";
890
+ function parseHandleId(handleId, prefix) {
891
+ if (!handleId) return null;
892
+ const marker = `${prefix}:`;
893
+ if (!handleId.startsWith(marker)) return null;
894
+ const name = handleId.slice(marker.length);
895
+ return name.length > 0 ? name : null;
896
+ }
897
+ function sourceHandleId(output) {
898
+ return `out:${output}`;
899
+ }
900
+ function targetHandleId(input) {
901
+ return `in:${input}`;
902
+ }
903
+
904
+ // src/components/nodes/pinColor.ts
905
+ var STRING = {
906
+ fill: "var(--lace-pin-string-fill)",
907
+ stroke: "var(--lace-pin-string-stroke)",
908
+ ring: "var(--lace-pin-string-ring)"
909
+ };
910
+ var NUMBER = {
911
+ fill: "var(--lace-pin-number-fill)",
912
+ stroke: "var(--lace-pin-number-stroke)",
913
+ ring: "var(--lace-pin-number-ring)"
914
+ };
915
+ var BOOL = {
916
+ fill: "var(--lace-pin-bool-fill)",
917
+ stroke: "var(--lace-pin-bool-stroke)",
918
+ ring: "var(--lace-pin-bool-ring)"
919
+ };
920
+ var LIST = {
921
+ fill: "var(--lace-pin-list-fill)",
922
+ stroke: "var(--lace-pin-list-stroke)",
923
+ ring: "var(--lace-pin-list-ring)"
924
+ };
925
+ var MAP = {
926
+ fill: "var(--lace-pin-map-fill)",
927
+ stroke: "var(--lace-pin-map-stroke)",
928
+ ring: "var(--lace-pin-map-ring)"
929
+ };
930
+ var OBJECT = {
931
+ fill: "var(--lace-pin-object-fill)",
932
+ stroke: "var(--lace-pin-object-stroke)",
933
+ ring: "var(--lace-pin-object-ring)"
934
+ };
935
+ var ANY = {
936
+ fill: "var(--lace-pin-any-fill)",
937
+ stroke: "var(--lace-pin-any-stroke)",
938
+ ring: "var(--lace-pin-any-ring)"
939
+ };
940
+ var FAMILY_COLORS = {
941
+ string: STRING,
942
+ number: NUMBER,
943
+ bool: BOOL,
944
+ boolean: BOOL,
945
+ list: LIST,
946
+ set: LIST,
947
+ tuple: LIST,
948
+ map: MAP,
949
+ object: OBJECT,
950
+ any: ANY
951
+ };
952
+ var ANY_PIN_COLOR = ANY;
953
+ function inferTypeFamily(type) {
954
+ const t = (type || "").trim().toLowerCase();
955
+ if (t === "" || t === "any") return "any";
956
+ for (const family of ["list", "set", "tuple", "map", "object"]) {
957
+ if (t.startsWith(family)) return family;
958
+ }
959
+ return t;
960
+ }
961
+ function pinColor(pin) {
962
+ const family = pin.type_family ?? inferTypeFamily(pin.type);
963
+ return FAMILY_COLORS[family] ?? ANY;
964
+ }
965
+ function pinFace(color, wired) {
966
+ return wired ? { background: color.fill, borderColor: color.stroke } : { background: "var(--lace-node-bg)", borderColor: color.ring };
967
+ }
968
+
969
+ // src/components/nodes/CallHandles.tsx
970
+ import { Fragment as Fragment4, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
971
+ var handleStyle = (top, side) => ({
972
+ background: ANY_PIN_COLOR.fill,
973
+ borderColor: ANY_PIN_COLOR.stroke,
974
+ borderWidth: 1,
975
+ borderStyle: "solid",
976
+ width: 8,
977
+ height: 8,
978
+ top,
979
+ [side]: -4
980
+ });
981
+ var CallHandles = ({
982
+ nodeId,
983
+ callWired,
984
+ metaWired,
985
+ headerHeight
986
+ }) => {
987
+ const updateNodeInternals = useUpdateNodeInternals();
988
+ const drawn = `${callWired}|${metaWired.join("|")}`;
989
+ useEffect2(() => {
990
+ updateNodeInternals(nodeId);
991
+ }, [nodeId, drawn, updateNodeInternals]);
992
+ return /* @__PURE__ */ jsxs3(Fragment4, { children: [
993
+ callWired && /* @__PURE__ */ jsx7(
994
+ Handle,
995
+ {
996
+ id: sourceHandleId(""),
997
+ type: "source",
998
+ position: Position.Right,
999
+ isConnectable: false,
1000
+ className: "lace-pin-handle",
1001
+ style: handleStyle(headerHeight / 2, "right")
1002
+ }
1003
+ ),
1004
+ metaWired.map((meta) => /* @__PURE__ */ jsx7(
1005
+ Handle,
1006
+ {
1007
+ id: targetHandleId(meta),
1008
+ type: "target",
1009
+ position: Position.Left,
1010
+ isConnectable: false,
1011
+ className: "lace-pin-handle",
1012
+ style: handleStyle(headerHeight / 2, "left")
1013
+ },
1014
+ meta
1015
+ ))
1016
+ ] });
1017
+ };
1018
+
880
1019
  // src/components/nodes/CardActions.tsx
881
1020
  import { inertProps as inertProps2, Tooltip as Tooltip2 } from "@lace-cloud/ui";
882
1021
  import { useCallback, useMemo } from "react";
@@ -897,7 +1036,7 @@ function useEditorEnvExtras() {
897
1036
 
898
1037
  // src/components/nodes/CardActions.tsx
899
1038
  import "./CardActions-QLTNQUVW.css";
900
- import { jsx as jsx7 } from "react/jsx-runtime";
1039
+ import { jsx as jsx8 } from "react/jsx-runtime";
901
1040
  function CardActions({ target }) {
902
1041
  const { ctx, runner } = useCanvas();
903
1042
  const envExtras = useEditorEnvExtras();
@@ -916,13 +1055,13 @@ function CardActions({ target }) {
916
1055
  );
917
1056
  return actions.map((action) => {
918
1057
  const state = actionState(action, ctx, runner.busy(action, ctx, target));
919
- return /* @__PURE__ */ jsx7(
1058
+ return /* @__PURE__ */ jsx8(
920
1059
  Tooltip2,
921
1060
  {
922
1061
  name: action.label,
923
1062
  content: state.disabledReason,
924
1063
  placement: "bottom-end",
925
- children: (describedBy) => /* @__PURE__ */ jsx7(
1064
+ children: (describedBy) => /* @__PURE__ */ jsx8(
926
1065
  "button",
927
1066
  {
928
1067
  type: "button",
@@ -930,7 +1069,7 @@ function CardActions({ target }) {
930
1069
  "aria-label": action.label,
931
1070
  "aria-describedby": describedBy,
932
1071
  ...inertProps2(isInert(state), runOnCard(action)),
933
- children: action.icon ? /* @__PURE__ */ jsx7(CanvasIcon, { name: action.icon }) : action.label
1072
+ children: action.icon ? /* @__PURE__ */ jsx8(CanvasIcon, { name: action.icon }) : action.label
934
1073
  }
935
1074
  )
936
1075
  },
@@ -948,7 +1087,7 @@ import { useCallback as useCallback2, useRef as useRef2 } from "react";
948
1087
 
949
1088
  // src/core/pipeline.ts
950
1089
  import { projectCanvasView } from "@lace-cloud/proto";
951
- import { useEffect as useEffect2, useState as useState3 } from "react";
1090
+ import { useEffect as useEffect3, useState as useState3 } from "react";
952
1091
  function projectFrame(frame, arrangement) {
953
1092
  return projectCanvasView(frame.bundle, arrangement, {
954
1093
  canUndo: frame.canUndo,
@@ -979,7 +1118,7 @@ function carrySelection(selection, oldPath, newPath) {
979
1118
  var NO_SOURCE = { source: null, end: null, session: null };
980
1119
  function useCanvasSource(source, onCommandResult, onSessionEnd) {
981
1120
  const [held, setHeld] = useState3({ ...NO_SOURCE, port: null });
982
- useEffect2(() => {
1121
+ useEffect3(() => {
983
1122
  const session = {};
984
1123
  const unsubscribe = source.subscribe(
985
1124
  (next) => setHeld({ source: next, end: null, session, port: source }),
@@ -1028,7 +1167,7 @@ function useRenameInstance() {
1028
1167
  }
1029
1168
 
1030
1169
  // src/components/nodes/GroupNode.tsx
1031
- import { jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
1170
+ import { jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
1032
1171
  var GroupHeader = ({
1033
1172
  label,
1034
1173
  memberCount,
@@ -1043,13 +1182,13 @@ var GroupHeader = ({
1043
1182
  onEditChange,
1044
1183
  onEditBlur,
1045
1184
  onEditKeyDown
1046
- }) => /* @__PURE__ */ jsxs3(
1185
+ }) => /* @__PURE__ */ jsxs4(
1047
1186
  "div",
1048
1187
  {
1049
1188
  className: `lace-group-node__header lace-group-node__header--${collapsed ? "collapsed" : "expanded"}`,
1050
1189
  style: collapsed ? { height: GROUP_HEADER_HEIGHT } : void 0,
1051
1190
  children: [
1052
- /* @__PURE__ */ jsx8(
1191
+ /* @__PURE__ */ jsx9(
1053
1192
  "button",
1054
1193
  {
1055
1194
  type: "button",
@@ -1057,11 +1196,11 @@ var GroupHeader = ({
1057
1196
  className: "lace-group-node__collapse-btn",
1058
1197
  title: collapsed ? "Expand" : "Collapse",
1059
1198
  "aria-label": collapsed ? "Expand" : "Collapse",
1060
- children: /* @__PURE__ */ jsx8(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
1199
+ children: /* @__PURE__ */ jsx9(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
1061
1200
  }
1062
1201
  ),
1063
- /* @__PURE__ */ jsx8("span", { className: "lace-group-node__glyph", children: /* @__PURE__ */ jsx8(CanvasIcon, { name: "group" }) }),
1064
- editing ? /* @__PURE__ */ jsx8(
1202
+ /* @__PURE__ */ jsx9("span", { className: "lace-group-node__glyph", children: /* @__PURE__ */ jsx9(CanvasIcon, { name: "group" }) }),
1203
+ editing ? /* @__PURE__ */ jsx9(
1065
1204
  "input",
1066
1205
  {
1067
1206
  ref: inputRef,
@@ -1072,26 +1211,29 @@ var GroupHeader = ({
1072
1211
  className: "lace-group-node__rename-input",
1073
1212
  onClick: (e) => e.stopPropagation()
1074
1213
  }
1075
- ) : /* @__PURE__ */ jsx8("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
1076
- /* @__PURE__ */ jsxs3("span", { className: "lace-group-node__count", children: [
1214
+ ) : /* @__PURE__ */ jsx9("span", { className: "lace-group-node__label", onDoubleClick, title: label, children: label }),
1215
+ /* @__PURE__ */ jsxs4("span", { className: "lace-group-node__count", children: [
1077
1216
  memberCount,
1078
1217
  " ",
1079
1218
  memberCount === 1 ? "module" : "modules"
1080
1219
  ] }),
1081
- hovered && /* @__PURE__ */ jsx8(CardActions, { target })
1220
+ hovered && /* @__PURE__ */ jsx9(CardActions, { target })
1082
1221
  ]
1083
1222
  }
1084
1223
  );
1085
- var InterfacePinRow = ({ pin, y }) => {
1224
+ var InterfacePinRow = ({
1225
+ pin,
1226
+ y,
1227
+ spans
1228
+ }) => {
1086
1229
  const isInput = pin.side === "input";
1087
- return /* @__PURE__ */ jsxs3(
1230
+ return /* @__PURE__ */ jsxs4(
1088
1231
  "div",
1089
1232
  {
1090
1233
  style: {
1091
1234
  position: "absolute",
1092
1235
  top: y - NODE_ROW_HEIGHT / 2,
1093
- left: 0,
1094
- right: 0,
1236
+ ...spans ? { left: 0, right: 0 } : { [isInput ? "left" : "right"]: 0 },
1095
1237
  height: NODE_ROW_HEIGHT,
1096
1238
  paddingLeft: isInput ? 12 : 8,
1097
1239
  paddingRight: isInput ? 8 : 12,
@@ -1101,12 +1243,12 @@ var InterfacePinRow = ({ pin, y }) => {
1101
1243
  },
1102
1244
  title: pin.name,
1103
1245
  children: [
1104
- /* @__PURE__ */ jsx8(
1105
- Handle,
1246
+ /* @__PURE__ */ jsx9(
1247
+ Handle2,
1106
1248
  {
1107
1249
  id: pin.handleId,
1108
1250
  type: isInput ? "target" : "source",
1109
- position: isInput ? Position.Left : Position.Right,
1251
+ position: isInput ? Position2.Left : Position2.Right,
1110
1252
  isConnectable: false,
1111
1253
  className: "lace-pin-handle",
1112
1254
  style: {
@@ -1121,12 +1263,12 @@ var InterfacePinRow = ({ pin, y }) => {
1121
1263
  }
1122
1264
  }
1123
1265
  ),
1124
- /* @__PURE__ */ jsx8("span", { className: "lace-group-node__pin-label", style: { maxWidth: COLLAPSED_GROUP_WIDTH - 28 }, children: pin.name })
1266
+ /* @__PURE__ */ jsx9("span", { className: "lace-group-node__pin-label", style: { maxWidth: COLLAPSED_GROUP_WIDTH - 28 }, children: pin.name })
1125
1267
  ]
1126
1268
  }
1127
1269
  );
1128
1270
  };
1129
- var GroupNode = ({ data }) => {
1271
+ var GroupNode = ({ id, data }) => {
1130
1272
  const { editable, bundle, arrangement, updateArrangement } = useCanvas();
1131
1273
  const rename = useRenameInstance();
1132
1274
  const [editing, setEditing] = useState4(false);
@@ -1134,7 +1276,7 @@ var GroupNode = ({ data }) => {
1134
1276
  const [hovered, setHovered] = useState4(false);
1135
1277
  const inputRef = useRef3(null);
1136
1278
  const collapsed = data.collapsed;
1137
- useEffect3(() => {
1279
+ useEffect4(() => {
1138
1280
  if (editing && inputRef.current) {
1139
1281
  inputRef.current.focus();
1140
1282
  inputRef.current.select();
@@ -1188,11 +1330,24 @@ var GroupNode = ({ data }) => {
1188
1330
  onEditBlur: commitRename,
1189
1331
  onEditKeyDown: onKeyDown
1190
1332
  };
1333
+ const inputs = data.interfacePins.filter((p) => p.side === "input");
1334
+ const outputs = data.interfacePins.filter((p) => p.side === "output");
1335
+ const callHandles = /* @__PURE__ */ jsx9(
1336
+ CallHandles,
1337
+ {
1338
+ nodeId: id,
1339
+ callWired: data.callWired,
1340
+ metaWired: data.metaWired,
1341
+ headerHeight: GROUP_HEADER_HEIGHT
1342
+ }
1343
+ );
1344
+ const pinRows = (spans) => [
1345
+ ...inputs.map((pin, i) => /* @__PURE__ */ jsx9(InterfacePinRow, { pin, y: groupPinY(i), spans }, pin.handleId)),
1346
+ ...outputs.map((pin, i) => /* @__PURE__ */ jsx9(InterfacePinRow, { pin, y: groupPinY(i), spans }, pin.handleId))
1347
+ ];
1191
1348
  if (collapsed) {
1192
- const inputs = data.interfacePins.filter((p) => p.side === "input");
1193
- const outputs = data.interfacePins.filter((p) => p.side === "output");
1194
1349
  const bare = data.interfacePins.length === 0;
1195
- return /* @__PURE__ */ jsxs3(
1350
+ return /* @__PURE__ */ jsxs4(
1196
1351
  "div",
1197
1352
  {
1198
1353
  "data-group": data.groupId,
@@ -1202,15 +1357,15 @@ var GroupNode = ({ data }) => {
1202
1357
  onMouseEnter: () => setHovered(true),
1203
1358
  onMouseLeave: () => setHovered(false),
1204
1359
  children: [
1205
- /* @__PURE__ */ jsx8(GroupHeader, { ...headerProps }),
1206
- /* @__PURE__ */ jsx8(BadgeRow, { badges: data.badges }),
1207
- inputs.map((pin, i) => /* @__PURE__ */ jsx8(InterfacePinRow, { pin, y: groupPinY(i) }, pin.handleId)),
1208
- outputs.map((pin, i) => /* @__PURE__ */ jsx8(InterfacePinRow, { pin, y: groupPinY(i) }, pin.handleId))
1360
+ /* @__PURE__ */ jsx9(GroupHeader, { ...headerProps }),
1361
+ /* @__PURE__ */ jsx9(BadgeRow, { badges: data.badges }),
1362
+ callHandles,
1363
+ pinRows(true)
1209
1364
  ]
1210
1365
  }
1211
1366
  );
1212
1367
  }
1213
- return /* @__PURE__ */ jsxs3(
1368
+ return /* @__PURE__ */ jsxs4(
1214
1369
  "div",
1215
1370
  {
1216
1371
  "data-group": data.groupId,
@@ -1220,8 +1375,10 @@ var GroupNode = ({ data }) => {
1220
1375
  onMouseEnter: () => setHovered(true),
1221
1376
  onMouseLeave: () => setHovered(false),
1222
1377
  children: [
1223
- /* @__PURE__ */ jsx8(GroupHeader, { ...headerProps }),
1224
- /* @__PURE__ */ jsx8(BadgeRow, { badges: data.badges })
1378
+ /* @__PURE__ */ jsx9(GroupHeader, { ...headerProps }),
1379
+ /* @__PURE__ */ jsx9(BadgeRow, { badges: data.badges }),
1380
+ callHandles,
1381
+ pinRows(false)
1225
1382
  ]
1226
1383
  }
1227
1384
  );
@@ -1238,12 +1395,12 @@ import {
1238
1395
  visibleInputs
1239
1396
  } from "@lace-cloud/proto";
1240
1397
  import {
1241
- Handle as Handle2,
1242
- Position as Position2,
1398
+ Handle as Handle3,
1399
+ Position as Position3,
1243
1400
  useStore as useStore3,
1244
- useUpdateNodeInternals
1401
+ useUpdateNodeInternals as useUpdateNodeInternals2
1245
1402
  } from "@xyflow/react";
1246
- import { useCallback as useCallback4, useEffect as useEffect4, useMemo as useMemo3, useRef as useRef5, useState as useState5 } from "react";
1403
+ import { useCallback as useCallback4, useEffect as useEffect5, useMemo as useMemo3, useRef as useRef5, useState as useState5 } from "react";
1247
1404
 
1248
1405
  // src/core/decorate.ts
1249
1406
  import { nodeIdForDiagnostic } from "@lace-cloud/proto";
@@ -1302,19 +1459,6 @@ function diagnosticsBadge(held) {
1302
1459
  };
1303
1460
  }
1304
1461
 
1305
- // src/utils/handleId.ts
1306
- var NODE_HANDLE = "node";
1307
- function parseHandleId(handleId, prefix) {
1308
- if (!handleId) return null;
1309
- const marker = `${prefix}:`;
1310
- if (!handleId.startsWith(marker)) return null;
1311
- const name = handleId.slice(marker.length);
1312
- return name.length > 0 ? name : null;
1313
- }
1314
- function sourceHandleId(output) {
1315
- return `out:${output}`;
1316
- }
1317
-
1318
1462
  // src/utils/typed-name.ts
1319
1463
  function typedName(name, type) {
1320
1464
  return type ? `${name}: ${type}` : name;
@@ -1325,7 +1469,7 @@ import "./ModuleNode-LPPBJZCD.css";
1325
1469
 
1326
1470
  // src/components/nodes/node-config-bus.tsx
1327
1471
  import { createContext as createContext2, useContext as useContext2, useRef as useRef4 } from "react";
1328
- import { jsx as jsx9 } from "react/jsx-runtime";
1472
+ import { jsx as jsx10 } from "react/jsx-runtime";
1329
1473
  var NodeConfigBusContext = createContext2(null);
1330
1474
  function NodeConfigBusProvider({
1331
1475
  onOpen,
@@ -1334,7 +1478,7 @@ function NodeConfigBusProvider({
1334
1478
  const onOpenRef = useRef4(onOpen);
1335
1479
  onOpenRef.current = onOpen;
1336
1480
  const stableRef = useRef4((instanceId) => onOpenRef.current(instanceId));
1337
- return /* @__PURE__ */ jsx9(NodeConfigBusContext.Provider, { value: stableRef.current, children });
1481
+ return /* @__PURE__ */ jsx10(NodeConfigBusContext.Provider, { value: stableRef.current, children });
1338
1482
  }
1339
1483
  function useOpenNodeConfig() {
1340
1484
  const fn = useContext2(NodeConfigBusContext);
@@ -1342,63 +1486,8 @@ function useOpenNodeConfig() {
1342
1486
  return fn;
1343
1487
  }
1344
1488
 
1345
- // src/components/nodes/pinColor.ts
1346
- var STRING = {
1347
- fill: "var(--lace-pin-string-fill)",
1348
- stroke: "var(--lace-pin-string-stroke)"
1349
- };
1350
- var NUMBER = {
1351
- fill: "var(--lace-pin-number-fill)",
1352
- stroke: "var(--lace-pin-number-stroke)"
1353
- };
1354
- var BOOL = {
1355
- fill: "var(--lace-pin-bool-fill)",
1356
- stroke: "var(--lace-pin-bool-stroke)"
1357
- };
1358
- var LIST = {
1359
- fill: "var(--lace-pin-list-fill)",
1360
- stroke: "var(--lace-pin-list-stroke)"
1361
- };
1362
- var MAP = {
1363
- fill: "var(--lace-pin-map-fill)",
1364
- stroke: "var(--lace-pin-map-stroke)"
1365
- };
1366
- var OBJECT = {
1367
- fill: "var(--lace-pin-object-fill)",
1368
- stroke: "var(--lace-pin-object-stroke)"
1369
- };
1370
- var ANY = {
1371
- fill: "var(--lace-pin-any-fill)",
1372
- stroke: "var(--lace-pin-any-stroke)"
1373
- };
1374
- var FAMILY_COLORS = {
1375
- string: STRING,
1376
- number: NUMBER,
1377
- bool: BOOL,
1378
- boolean: BOOL,
1379
- list: LIST,
1380
- set: LIST,
1381
- tuple: LIST,
1382
- map: MAP,
1383
- object: OBJECT,
1384
- any: ANY
1385
- };
1386
- var ANY_PIN_COLOR = ANY;
1387
- function inferTypeFamily(type) {
1388
- const t = (type || "").trim().toLowerCase();
1389
- if (t === "" || t === "any") return "any";
1390
- for (const family of ["list", "set", "tuple", "map", "object"]) {
1391
- if (t.startsWith(family)) return family;
1392
- }
1393
- return t;
1394
- }
1395
- function pinColor(pin) {
1396
- const family = pin.type_family ?? inferTypeFamily(pin.type);
1397
- return FAMILY_COLORS[family] ?? ANY;
1398
- }
1399
-
1400
1489
  // src/components/nodes/ModuleNode.tsx
1401
- import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs4 } from "react/jsx-runtime";
1490
+ import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
1402
1491
  var ICON_SIZE = 16;
1403
1492
  var LABEL_ROOM = NODE_WIDTH - 28;
1404
1493
  var labelRoom = (shared) => shared ? LABEL_ROOM / 2 - 4 : LABEL_ROOM;
@@ -1409,14 +1498,14 @@ var PROBLEM_RING = {
1409
1498
  neutral: void 0
1410
1499
  };
1411
1500
  var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
1412
- const color = pinColor(pin);
1413
1501
  const isInput = side === "input";
1414
1502
  const filled = !!pin.wired;
1503
+ const face = pinFace(pinColor(pin), filled);
1415
1504
  const ring = problem ? PROBLEM_RING[problem.tone] : void 0;
1416
1505
  const isError = problem?.tone === "error";
1417
- const handleStyle = {
1418
- background: filled ? color.fill : "var(--lace-node-bg)",
1419
- borderColor: ring ?? (filled ? color.stroke : color.fill),
1506
+ const handleStyle2 = {
1507
+ background: face.background,
1508
+ borderColor: ring ?? face.borderColor,
1420
1509
  borderWidth: ring ? 2 : 1.5,
1421
1510
  borderStyle: "solid",
1422
1511
  width: 10,
@@ -1425,7 +1514,7 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
1425
1514
  top: NODE_ROW_HEIGHT2 / 2
1426
1515
  };
1427
1516
  const about = `${typedName(pin.name, pin.type)}${pin.description ? ` \u2014 ${pin.description}` : ""}`;
1428
- return /* @__PURE__ */ jsxs4(
1517
+ return /* @__PURE__ */ jsxs5(
1429
1518
  "div",
1430
1519
  {
1431
1520
  className: "lace-pin-row",
@@ -1444,18 +1533,18 @@ var PinRow = ({ pin, side, top, shared, problem, isConnectable }) => {
1444
1533
  title: problem ? `${problem.message}
1445
1534
  ${about}` : about,
1446
1535
  children: [
1447
- /* @__PURE__ */ jsx10(
1448
- Handle2,
1536
+ /* @__PURE__ */ jsx11(
1537
+ Handle3,
1449
1538
  {
1450
- id: `${isInput ? "in" : "out"}:${pin.name}`,
1539
+ id: isInput ? targetHandleId(pin.name) : sourceHandleId(pin.name),
1451
1540
  type: isInput ? "target" : "source",
1452
- position: isInput ? Position2.Left : Position2.Right,
1541
+ position: isInput ? Position3.Left : Position3.Right,
1453
1542
  isConnectable,
1454
1543
  className: "lace-pin-handle",
1455
- style: handleStyle
1544
+ style: handleStyle2
1456
1545
  }
1457
1546
  ),
1458
- /* @__PURE__ */ jsx10(
1547
+ /* @__PURE__ */ jsx11(
1459
1548
  "span",
1460
1549
  {
1461
1550
  className: `lace-module-node__pin-row-label lace-module-node__pin-row-label--${isError ? "error" : filled ? "wired" : "default"}`,
@@ -1480,7 +1569,7 @@ var ModuleNode = ({ id, data }) => {
1480
1569
  const [showAllInputs, setShowAllInputs] = useState5(false);
1481
1570
  const inputRef = useRef5(null);
1482
1571
  const renamingRef = useRef5(false);
1483
- useEffect4(() => {
1572
+ useEffect5(() => {
1484
1573
  if (editing && inputRef.current) {
1485
1574
  inputRef.current.focus();
1486
1575
  inputRef.current.select();
@@ -1499,12 +1588,12 @@ var ModuleNode = ({ id, data }) => {
1499
1588
  };
1500
1589
  }, [inputs, showAllInputs]);
1501
1590
  const inputRows = shownInputs.length + (hiddenInputCount > 0 ? 1 : 0);
1502
- const updateNodeInternals = useUpdateNodeInternals();
1591
+ const updateNodeInternals = useUpdateNodeInternals2();
1503
1592
  const drawnHandles = [
1504
- ...shownInputs.map((pin) => `in:${pin.name}`),
1593
+ ...shownInputs.map((pin) => targetHandleId(pin.name)),
1505
1594
  ...outputs.map((pin) => sourceHandleId(pin.name))
1506
1595
  ].join("|");
1507
- useEffect4(() => {
1596
+ useEffect5(() => {
1508
1597
  updateNodeInternals(id);
1509
1598
  }, [id, drawnHandles, updateNodeInternals]);
1510
1599
  const onDoubleClick = useCallback4(
@@ -1556,7 +1645,7 @@ var ModuleNode = ({ id, data }) => {
1556
1645
  const bodyHeight = rowCount * NODE_ROW_HEIGHT2;
1557
1646
  const nodeHeight = NODE_HEADER_HEIGHT + bodyHeight;
1558
1647
  const stateClass = hasAnyError ? "lace-module-node--error" : isNew ? "lace-module-node--new" : "";
1559
- return /* @__PURE__ */ jsxs4(
1648
+ return /* @__PURE__ */ jsxs5(
1560
1649
  "div",
1561
1650
  {
1562
1651
  className: `lace-module-node${collapsed ? " lace-module-node--collapsed" : ""}${stateClass ? ` ${stateClass}` : ""}`,
@@ -1564,7 +1653,7 @@ var ModuleNode = ({ id, data }) => {
1564
1653
  onMouseEnter: () => setHovered(true),
1565
1654
  onMouseLeave: () => setHovered(false),
1566
1655
  children: [
1567
- /* @__PURE__ */ jsxs4(
1656
+ /* @__PURE__ */ jsxs5(
1568
1657
  "div",
1569
1658
  {
1570
1659
  className: "lace-module-node__header",
@@ -1572,7 +1661,7 @@ var ModuleNode = ({ id, data }) => {
1572
1661
  onClick: onHeaderClick,
1573
1662
  title: badges.length > 0 ? badges.map((b) => b.title ?? b.label).join("\n") : data.label,
1574
1663
  children: [
1575
- /* @__PURE__ */ jsx10(
1664
+ /* @__PURE__ */ jsx11(
1576
1665
  "button",
1577
1666
  {
1578
1667
  type: "button",
@@ -1580,10 +1669,10 @@ var ModuleNode = ({ id, data }) => {
1580
1669
  className: "lace-module-node__collapse-btn",
1581
1670
  title: collapsed ? "Expand" : "Collapse",
1582
1671
  "aria-label": collapsed ? "Expand" : "Collapse",
1583
- children: /* @__PURE__ */ jsx10(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
1672
+ children: /* @__PURE__ */ jsx11(CanvasIcon, { name: collapsed ? "chevron-right" : "chevron-down" })
1584
1673
  }
1585
1674
  ),
1586
- showIcon ? /* @__PURE__ */ jsx10(
1675
+ showIcon ? /* @__PURE__ */ jsx11(
1587
1676
  "img",
1588
1677
  {
1589
1678
  src: data.icon_url,
@@ -1592,8 +1681,8 @@ var ModuleNode = ({ id, data }) => {
1592
1681
  style: { width: ICON_SIZE, height: ICON_SIZE },
1593
1682
  onError: () => setImgFailed(true)
1594
1683
  }
1595
- ) : /* @__PURE__ */ jsx10("span", { className: "lace-module-node__icon-fallback", children: /* @__PURE__ */ jsx10(CanvasIcon, { name: "module" }) }),
1596
- editing ? /* @__PURE__ */ jsx10(
1684
+ ) : /* @__PURE__ */ jsx11("span", { className: "lace-module-node__icon-fallback", children: /* @__PURE__ */ jsx11(CanvasIcon, { name: "module" }) }),
1685
+ editing ? /* @__PURE__ */ jsx11(
1597
1686
  "input",
1598
1687
  {
1599
1688
  ref: inputRef,
@@ -1604,7 +1693,7 @@ var ModuleNode = ({ id, data }) => {
1604
1693
  className: "lace-module-node__rename-input",
1605
1694
  onClick: (e) => e.stopPropagation()
1606
1695
  }
1607
- ) : /* @__PURE__ */ jsx10(
1696
+ ) : /* @__PURE__ */ jsx11(
1608
1697
  "span",
1609
1698
  {
1610
1699
  className: "lace-module-node__label",
@@ -1613,33 +1702,22 @@ var ModuleNode = ({ id, data }) => {
1613
1702
  children: data.label
1614
1703
  }
1615
1704
  ),
1616
- hovered && /* @__PURE__ */ jsx10(CardActions, { target })
1705
+ hovered && /* @__PURE__ */ jsx11(CardActions, { target })
1617
1706
  ]
1618
1707
  }
1619
1708
  ),
1620
- /* @__PURE__ */ jsx10(BadgeRow, { badges }),
1621
- data.call_wired && /* @__PURE__ */ jsx10(
1622
- Handle2,
1709
+ /* @__PURE__ */ jsx11(BadgeRow, { badges }),
1710
+ /* @__PURE__ */ jsx11(
1711
+ CallHandles,
1623
1712
  {
1624
- id: sourceHandleId(""),
1625
- type: "source",
1626
- position: Position2.Right,
1627
- isConnectable: false,
1628
- className: "lace-pin-handle",
1629
- style: {
1630
- background: ANY_PIN_COLOR.fill,
1631
- borderColor: ANY_PIN_COLOR.stroke,
1632
- borderWidth: 1,
1633
- borderStyle: "solid",
1634
- width: 8,
1635
- height: 8,
1636
- top: NODE_HEADER_HEIGHT / 2,
1637
- right: -4
1638
- }
1713
+ nodeId: id,
1714
+ callWired: !!data.call_wired,
1715
+ metaWired: data.meta_wired ?? [],
1716
+ headerHeight: NODE_HEADER_HEIGHT
1639
1717
  }
1640
1718
  ),
1641
- !collapsed && /* @__PURE__ */ jsxs4("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
1642
- shownInputs.map((pin, i) => /* @__PURE__ */ jsx10(
1719
+ !collapsed && /* @__PURE__ */ jsxs5("div", { className: "lace-module-node__body", style: { height: bodyHeight }, children: [
1720
+ shownInputs.map((pin, i) => /* @__PURE__ */ jsx11(
1643
1721
  PinRow,
1644
1722
  {
1645
1723
  pin,
@@ -1651,7 +1729,7 @@ var ModuleNode = ({ id, data }) => {
1651
1729
  },
1652
1730
  `in:${pin.name}`
1653
1731
  )),
1654
- outputs.map((pin, i) => /* @__PURE__ */ jsx10(
1732
+ outputs.map((pin, i) => /* @__PURE__ */ jsx11(
1655
1733
  PinRow,
1656
1734
  {
1657
1735
  pin,
@@ -1662,7 +1740,7 @@ var ModuleNode = ({ id, data }) => {
1662
1740
  },
1663
1741
  `out:${pin.name}`
1664
1742
  )),
1665
- hiddenInputCount > 0 && /* @__PURE__ */ jsxs4(
1743
+ hiddenInputCount > 0 && /* @__PURE__ */ jsxs5(
1666
1744
  "div",
1667
1745
  {
1668
1746
  className: "lace-module-node__hidden-count",
@@ -1687,20 +1765,19 @@ var ModuleNode = ({ id, data }) => {
1687
1765
  }
1688
1766
  )
1689
1767
  ] }),
1690
- collapsed && /* @__PURE__ */ jsxs4(Fragment4, { children: [
1768
+ collapsed && /* @__PURE__ */ jsxs5(Fragment5, { children: [
1691
1769
  inputs.map((pin, i) => {
1692
- const color = pinColor(pin);
1693
- return /* @__PURE__ */ jsx10(
1694
- Handle2,
1770
+ const face = pinFace(pinColor(pin), !!pin.wired);
1771
+ return /* @__PURE__ */ jsx11(
1772
+ Handle3,
1695
1773
  {
1696
- id: `in:${pin.name}`,
1774
+ id: targetHandleId(pin.name),
1697
1775
  type: "target",
1698
- position: Position2.Left,
1776
+ position: Position3.Left,
1699
1777
  isConnectable: editable,
1700
1778
  className: "lace-pin-handle",
1701
1779
  style: {
1702
- background: pin.wired ? color.fill : "var(--lace-node-bg)",
1703
- borderColor: pin.wired ? color.stroke : color.fill,
1780
+ ...face,
1704
1781
  borderWidth: 1,
1705
1782
  borderStyle: "solid",
1706
1783
  width: 8,
@@ -1709,22 +1786,21 @@ var ModuleNode = ({ id, data }) => {
1709
1786
  left: -4
1710
1787
  }
1711
1788
  },
1712
- `in:${pin.name}`
1789
+ targetHandleId(pin.name)
1713
1790
  );
1714
1791
  }),
1715
1792
  outputs.map((pin, i) => {
1716
- const color = pinColor(pin);
1717
- return /* @__PURE__ */ jsx10(
1718
- Handle2,
1793
+ const face = pinFace(pinColor(pin), !!pin.wired);
1794
+ return /* @__PURE__ */ jsx11(
1795
+ Handle3,
1719
1796
  {
1720
- id: `out:${pin.name}`,
1797
+ id: sourceHandleId(pin.name),
1721
1798
  type: "source",
1722
- position: Position2.Right,
1799
+ position: Position3.Right,
1723
1800
  isConnectable: editable,
1724
1801
  className: "lace-pin-handle",
1725
1802
  style: {
1726
- background: pin.wired ? color.fill : "var(--lace-node-bg)",
1727
- borderColor: pin.wired ? color.stroke : color.fill,
1803
+ ...face,
1728
1804
  borderWidth: 1,
1729
1805
  borderStyle: "solid",
1730
1806
  width: 8,
@@ -1733,27 +1809,27 @@ var ModuleNode = ({ id, data }) => {
1733
1809
  right: -4
1734
1810
  }
1735
1811
  },
1736
- `out:${pin.name}`
1812
+ sourceHandleId(pin.name)
1737
1813
  );
1738
1814
  })
1739
1815
  ] }),
1740
- editable && /* @__PURE__ */ jsxs4(Fragment4, { children: [
1741
- /* @__PURE__ */ jsx10(
1742
- Handle2,
1816
+ editable && /* @__PURE__ */ jsxs5(Fragment5, { children: [
1817
+ /* @__PURE__ */ jsx11(
1818
+ Handle3,
1743
1819
  {
1744
1820
  id: NODE_HANDLE,
1745
1821
  type: "source",
1746
- position: Position2.Bottom,
1822
+ position: Position3.Bottom,
1747
1823
  onClick: void 0,
1748
1824
  className: "lace-module-node__grip"
1749
1825
  }
1750
1826
  ),
1751
- /* @__PURE__ */ jsx10(
1752
- Handle2,
1827
+ /* @__PURE__ */ jsx11(
1828
+ Handle3,
1753
1829
  {
1754
1830
  id: NODE_HANDLE,
1755
1831
  type: "target",
1756
- position: Position2.Top,
1832
+ position: Position3.Top,
1757
1833
  isConnectableStart: false,
1758
1834
  isConnectableEnd: connecting,
1759
1835
  className: "lace-module-node__drop"
@@ -1768,9 +1844,9 @@ var ModuleNode_default = ModuleNode;
1768
1844
 
1769
1845
  // src/components/PaperGrid.tsx
1770
1846
  import "./PaperGrid-JG4GBRDP.css";
1771
- import { jsx as jsx11 } from "react/jsx-runtime";
1847
+ import { jsx as jsx12 } from "react/jsx-runtime";
1772
1848
  function PaperGrid() {
1773
- return /* @__PURE__ */ jsx11("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
1849
+ return /* @__PURE__ */ jsx12("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
1774
1850
  }
1775
1851
 
1776
1852
  // src/core/editor-actions.ts
@@ -2093,7 +2169,9 @@ var CORE_EDITOR_ACTIONS = [
2093
2169
  icon: "redo",
2094
2170
  section: "history",
2095
2171
  placement: "toolbar",
2096
- keys: ["Mod+Shift+z"],
2172
+ // ⇧⌘Z / Ctrl+Shift+Z everywhere, and Ctrl+Y where Windows and Linux
2173
+ // bind it; the first is what the tooltip spells.
2174
+ keys: ["Mod+Shift+z", "Ctrl+y"],
2097
2175
  requiredPorts: ["editor"],
2098
2176
  requiredContext: ["editable"],
2099
2177
  enabledWhen: [{ key: "redoable", reason: "Nothing to redo" }],
@@ -2226,7 +2304,7 @@ var CORE_EDITOR_ACTIONS = [
2226
2304
  ];
2227
2305
 
2228
2306
  // src/core/use-action-keys.ts
2229
- import { useEffect as useEffect5 } from "react";
2307
+ import { useEffect as useEffect6 } from "react";
2230
2308
 
2231
2309
  // src/contribution-types.ts
2232
2310
  var KEY_SCOPES = ["surface", "app"];
@@ -2249,7 +2327,7 @@ function isFormTarget(target) {
2249
2327
  return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable;
2250
2328
  }
2251
2329
  function useFocusWhenNoneHeld(root, mounted) {
2252
- useEffect5(() => {
2330
+ useEffect6(() => {
2253
2331
  const element = root.current;
2254
2332
  if (!mounted || !element) return;
2255
2333
  const doc = element.ownerDocument;
@@ -2264,24 +2342,60 @@ function useFocusWhenNoneHeld(root, mounted) {
2264
2342
  return () => view?.removeEventListener("focus", takeFocus);
2265
2343
  }, [root, mounted]);
2266
2344
  }
2345
+ var focusKeepers = /* @__PURE__ */ new WeakSet();
2346
+ function keeperOf(focused) {
2347
+ for (let at = focused.parentElement; at; at = at.parentElement) {
2348
+ if (focusKeepers.has(at)) return at;
2349
+ }
2350
+ return void 0;
2351
+ }
2352
+ function useFocusKeptOnRemoval(target, mounted) {
2353
+ useEffect6(() => {
2354
+ const element = target.current;
2355
+ if (!mounted || !element) return;
2356
+ const doc = element.ownerDocument;
2357
+ focusKeepers.add(element);
2358
+ let held;
2359
+ const onFocusIn = (e) => {
2360
+ const focused = e.target instanceof Element ? e.target : void 0;
2361
+ held = focused && keeperOf(focused) === element ? focused : void 0;
2362
+ };
2363
+ const observer = new MutationObserver(() => {
2364
+ if (!held || held.isConnected) return;
2365
+ held = void 0;
2366
+ if (doc.activeElement === null || doc.activeElement === doc.body) {
2367
+ element.focus({ preventScroll: true });
2368
+ }
2369
+ });
2370
+ element.addEventListener("focusin", onFocusIn);
2371
+ observer.observe(element, { childList: true, subtree: true });
2372
+ return () => {
2373
+ observer.disconnect();
2374
+ element.removeEventListener("focusin", onFocusIn);
2375
+ focusKeepers.delete(element);
2376
+ };
2377
+ }, [target, mounted]);
2378
+ }
2267
2379
  function keyScopeOf(action) {
2268
2380
  return action.keyScope ?? "surface";
2269
2381
  }
2270
- function matchesKey(e, spec) {
2271
- const chord = parseChord(spec);
2382
+ function matchesKey(e, spec, mac) {
2383
+ const chord = parseChord(spec, mac);
2272
2384
  if (!chord) return false;
2273
2385
  const modHeld = e.metaKey || e.ctrlKey;
2274
- if (chord.mod ? !modHeld : modHeld || e.altKey) return false;
2386
+ const held = { Mod: modHeld, Ctrl: e.ctrlKey && !e.metaKey };
2387
+ if (chord.modifier ? !held[chord.modifier] : modHeld || e.altKey) return false;
2275
2388
  if (e.shiftKey !== chord.shift) return false;
2276
2389
  return e.key.toLowerCase() === chord.key.toLowerCase();
2277
2390
  }
2278
2391
  function useActionKeys(actions, ctx, runner, envExtras) {
2279
- useEffect5(() => {
2392
+ useEffect6(() => {
2280
2393
  if (!ctx || !envExtras) return;
2281
2394
  const activeCtx = ctx;
2282
2395
  const activeEnvExtras = envExtras;
2283
2396
  const targets = targetsByCtx.get(ctx) ?? {};
2284
2397
  const target = {};
2398
+ const mac = isMacPlatform();
2285
2399
  function bind(scope) {
2286
2400
  const { handlesFormTargets } = KEY_SCOPE_RULES[scope];
2287
2401
  const element = targets[scope];
@@ -2293,7 +2407,7 @@ function useActionKeys(actions, ctx, runner, envExtras) {
2293
2407
  if (!handlesFormTargets && isFormTarget(e.target)) return;
2294
2408
  for (const action of keyed) {
2295
2409
  for (const spec of action.keys ?? []) {
2296
- if (matchesKey(e, spec)) {
2410
+ if (matchesKey(e, spec, mac)) {
2297
2411
  e.preventDefault();
2298
2412
  e.stopPropagation();
2299
2413
  void runner.run(action, activeCtx, target, activeEnvExtras);
@@ -2382,7 +2496,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2382
2496
  collapsed: true,
2383
2497
  hasErrors,
2384
2498
  badges: groupBadges,
2385
- interfacePins: pinsOf(group2)
2499
+ interfacePins: pinsOf(group2),
2500
+ callWired: !!group2.call_wired,
2501
+ metaWired: group2.meta_wired ?? []
2386
2502
  }
2387
2503
  });
2388
2504
  } else {
@@ -2397,7 +2513,9 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2397
2513
  collapsed: false,
2398
2514
  hasErrors: hasErrorBadge(groupBadges),
2399
2515
  badges: groupBadges,
2400
- interfacePins: []
2516
+ interfacePins: pinsOf(group2),
2517
+ callWired: !!group2.call_wired,
2518
+ metaWired: group2.meta_wired ?? []
2401
2519
  }
2402
2520
  });
2403
2521
  }
@@ -2423,8 +2541,11 @@ function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
2423
2541
  }, [nodes, edges, groups, newNodeIds, decorations]);
2424
2542
  }
2425
2543
  function pinsOf(group2) {
2426
- const pins = (side, prefix, of = []) => of.map((pin) => ({ ...pin, handleId: `${prefix}:${pin.name}`, side, color: pinColor(pin) }));
2427
- return [...pins("input", "in", group2.inputs), ...pins("output", "out", group2.outputs)];
2544
+ const pins = (side, handleId, of = []) => of.map((pin) => ({ ...pin, handleId: handleId(pin.name), side, color: pinColor(pin) }));
2545
+ return [
2546
+ ...pins("input", targetHandleId, group2.inputs),
2547
+ ...pins("output", sourceHandleId, group2.outputs)
2548
+ ];
2428
2549
  }
2429
2550
  function renderEdgeToRfEdge(e) {
2430
2551
  return {
@@ -2432,20 +2553,20 @@ function renderEdgeToRfEdge(e) {
2432
2553
  source: e.source,
2433
2554
  target: e.target,
2434
2555
  sourceHandle: sourceHandleId(e.source_output),
2435
- targetHandle: `in:${e.target_input}`,
2556
+ targetHandle: targetHandleId(e.target_input),
2436
2557
  data: { source_output: e.source_output, target_input: e.target_input },
2437
2558
  type: DEPENDENCY_EDGE_TYPE
2438
2559
  };
2439
2560
  }
2440
2561
 
2441
2562
  // src/hooks/useNewNodeTracking.ts
2442
- import { useCallback as useCallback6, useEffect as useEffect6, useRef as useRef6, useState as useState7 } from "react";
2563
+ import { useCallback as useCallback6, useEffect as useEffect7, useRef as useRef6, useState as useState7 } from "react";
2443
2564
  function useNewNodeTracking(view) {
2444
2565
  const [addedIds, setAddedIds] = useState7(/* @__PURE__ */ new Set());
2445
2566
  const [newNodeIds, setNewNodeIds] = useState7(/* @__PURE__ */ new Set());
2446
2567
  const prevCardIdsRef = useRef6(/* @__PURE__ */ new Set());
2447
2568
  const sessionLoadedRef = useRef6(false);
2448
- useEffect6(() => {
2569
+ useEffect7(() => {
2449
2570
  if (!view) return;
2450
2571
  const nodeIds = new Set(view.nodes.map((n) => n.id));
2451
2572
  const cardIds = /* @__PURE__ */ new Set([...nodeIds, ...view.groups.map((g) => g.id)]);
@@ -2482,7 +2603,7 @@ function useNewNodeTracking(view) {
2482
2603
  // src/hooks/useViewport.ts
2483
2604
  import { extentOf as extentOf2 } from "@lace-cloud/proto";
2484
2605
  import { useReactFlow as useReactFlow2 } from "@xyflow/react";
2485
- import { useCallback as useCallback7, useEffect as useEffect7, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as useRef7 } from "react";
2606
+ import { useCallback as useCallback7, useEffect as useEffect8, useLayoutEffect as useLayoutEffect2, useMemo as useMemo5, useRef as useRef7 } from "react";
2486
2607
  var FIT = { duration: 300, maxZoom: 1 };
2487
2608
  var PAN_MS = 300;
2488
2609
  var RESIZE_MS = 200;
@@ -2561,7 +2682,7 @@ function useViewport(pane, focusIds) {
2561
2682
  else if (outcome.kind === "move") move(outcome.viewport, RESIZE_MS);
2562
2683
  };
2563
2684
  });
2564
- useEffect7(() => {
2685
+ useEffect8(() => {
2565
2686
  if (!pane || typeof ResizeObserver === "undefined") return;
2566
2687
  let before = sightOf(pane).visible;
2567
2688
  let judged = before;
@@ -2621,7 +2742,7 @@ function useViewport(pane, focusIds) {
2621
2742
  }
2622
2743
 
2623
2744
  // src/Canvas.tsx
2624
- import { jsx as jsx12, jsxs as jsxs5 } from "react/jsx-runtime";
2745
+ import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
2625
2746
  var nodeTypes = {
2626
2747
  moduleNode: ModuleNode_default,
2627
2748
  groupNode: GroupNode_default
@@ -2654,24 +2775,24 @@ function CompositeEditor({
2654
2775
  const viewport = useViewport(pane, focusIds);
2655
2776
  const xyflowInitialized = useNodesInitialized();
2656
2777
  const nodesInitialized = xyflowInitialized || view.nodes.length === 0;
2657
- useEffect8(() => {
2778
+ useEffect9(() => {
2658
2779
  registerGoToNode((nodeId) => {
2659
2780
  if (!getNode(nodeId)) return;
2660
2781
  viewport.panIntoView(getNodesBounds([nodeId]));
2661
2782
  });
2662
2783
  }, [registerGoToNode, getNode, getNodesBounds, viewport]);
2663
- useEffect8(() => {
2784
+ useEffect9(() => {
2664
2785
  layout.panIntoView = viewport.panIntoView;
2665
2786
  }, [layout, viewport]);
2666
2787
  const firedRef = useRef8(false);
2667
- useEffect8(() => {
2788
+ useEffect9(() => {
2668
2789
  if (firedRef.current || !pane || !nodesInitialized || view.nodes.length === 0) return;
2669
2790
  firedRef.current = true;
2670
2791
  requestAnimationFrame(viewport.fit);
2671
2792
  }, [pane, nodesInitialized, view.nodes.length, viewport]);
2672
2793
  const groupLogic = useGroupLogic(view.nodes, view.edges, view.groups, newNodeIds, decorations);
2673
2794
  const revealedRef = useRef8(addedIds);
2674
- useEffect8(() => {
2795
+ useEffect9(() => {
2675
2796
  if (editing) return;
2676
2797
  const shown = [...addedIds].filter((id) => !revealedRef.current.has(id)).flatMap((id) => {
2677
2798
  const node = groupLogic.rfNodes.find((n) => n.id === id);
@@ -2688,7 +2809,7 @@ function CompositeEditor({
2688
2809
  const selectedNodeIds = useMemo6(() => new Set(selection.nodes), [selection.nodes]);
2689
2810
  const selectedEdgeIds = useMemo6(() => new Set(selection.edges), [selection.edges]);
2690
2811
  const [rfEdges, setRfEdges] = useState8(rfEdgesFromView);
2691
- useEffect8(() => {
2812
+ useEffect9(() => {
2692
2813
  setRfEdges((prev) => {
2693
2814
  const held = new Set(prev.filter((e) => e.selected).map((e) => e.id));
2694
2815
  return rfEdgesFromView.map(
@@ -2705,7 +2826,7 @@ function CompositeEditor({
2705
2826
  );
2706
2827
  const rfNodesFromView = groupLogic.rfNodes;
2707
2828
  const [rfNodes, setRfNodes] = useState8(rfNodesFromView);
2708
- useEffect8(() => {
2829
+ useEffect9(() => {
2709
2830
  setRfNodes((prev) => {
2710
2831
  const current = new Map(prev.map((n) => [n.id, n]));
2711
2832
  return rfNodesFromView.map((n) => {
@@ -2743,7 +2864,17 @@ function CompositeEditor({
2743
2864
  style: { stroke: "var(--lace-canvas-edge-stroke)", strokeWidth: 1.5 },
2744
2865
  animated: false
2745
2866
  };
2746
- return /* @__PURE__ */ jsxs5(
2867
+ const onNodeContextMenu = (e, node) => {
2868
+ e.preventDefault();
2869
+ if (!editable) return;
2870
+ onContextMenu({
2871
+ instanceId: node.type === "groupNode" ? null : node.id,
2872
+ groupId: node.type === "groupNode" ? node.id : null,
2873
+ x: e.clientX,
2874
+ y: e.clientY
2875
+ });
2876
+ };
2877
+ return /* @__PURE__ */ jsxs6(
2747
2878
  ReactFlow,
2748
2879
  {
2749
2880
  onInit,
@@ -2756,15 +2887,11 @@ function CompositeEditor({
2756
2887
  onConnect,
2757
2888
  isValidConnection,
2758
2889
  onNodeDragStop,
2759
- onNodeContextMenu: (e, node) => {
2890
+ onNodeContextMenu,
2891
+ onSelectionContextMenu: (e, nodes) => {
2760
2892
  e.preventDefault();
2761
- if (!editable) return;
2762
- onContextMenu({
2763
- instanceId: node.type === "groupNode" ? null : node.id,
2764
- groupId: node.type === "groupNode" ? node.id : null,
2765
- x: e.clientX,
2766
- y: e.clientY
2767
- });
2893
+ const node = nodes[0];
2894
+ if (node) onNodeContextMenu(e, node);
2768
2895
  },
2769
2896
  onPaneContextMenu: (e) => {
2770
2897
  e.preventDefault();
@@ -2783,9 +2910,9 @@ function CompositeEditor({
2783
2910
  proOptions: { hideAttribution: true },
2784
2911
  style: { background: "var(--lace-color-bg-canvas)" },
2785
2912
  children: [
2786
- /* @__PURE__ */ jsx12(CanvasControls, { onFit: viewport.fit }),
2787
- /* @__PURE__ */ jsx12(PaperGrid, {}),
2788
- nodesInitialized ? /* @__PURE__ */ jsx12("div", { hidden: true, "data-rendered": "" }) : null
2913
+ /* @__PURE__ */ jsx13(CanvasControls, { onFit: viewport.fit }),
2914
+ /* @__PURE__ */ jsx13(PaperGrid, {}),
2915
+ nodesInitialized ? /* @__PURE__ */ jsx13("div", { hidden: true, "data-rendered": "" }) : null
2789
2916
  ]
2790
2917
  }
2791
2918
  );
@@ -2821,12 +2948,12 @@ function Canvas({ height }) {
2821
2948
  }, [selection, view.edges]);
2822
2949
  const { contextMenu, showContextMenu, dismissContextMenu } = useContextMenu();
2823
2950
  const { addedIds, newNodeIds, clearNew } = useNewNodeTracking(view);
2824
- useEffect8(() => {
2951
+ useEffect9(() => {
2825
2952
  clearNew(...selection.nodes);
2826
2953
  }, [selection.nodes, clearNew]);
2827
2954
  const [pane, setPane] = useState8(null);
2828
2955
  const surfaceRef = useRef8(null);
2829
- useEffect8(() => {
2956
+ useEffect9(() => {
2830
2957
  registerKeyTarget(ctx, "surface", surfaceRef.current);
2831
2958
  return () => registerKeyTarget(ctx, "surface", null);
2832
2959
  }, [ctx]);
@@ -2834,6 +2961,7 @@ function Canvas({ height }) {
2834
2961
  if (isFormTarget(e.target)) return;
2835
2962
  surfaceRef.current?.focus();
2836
2963
  }, []);
2964
+ useFocusKeptOnRemoval(surfaceRef, true);
2837
2965
  const goToNodeRef = useRef8(null);
2838
2966
  const registerGoToNode = useCallback8((fn) => {
2839
2967
  goToNodeRef.current = fn;
@@ -2933,7 +3061,7 @@ function Canvas({ height }) {
2933
3061
  },
2934
3062
  [runner, menuCtx, menuTarget, makeEnvExtras]
2935
3063
  );
2936
- return /* @__PURE__ */ jsx12(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ jsxs5(
3064
+ return /* @__PURE__ */ jsx13(NodeConfigBusProvider, { onOpen: onOpenNodeConfig, children: /* @__PURE__ */ jsxs6(
2937
3065
  "div",
2938
3066
  {
2939
3067
  ref: surfaceRef,
@@ -2948,7 +3076,7 @@ function Canvas({ height }) {
2948
3076
  outline: "none"
2949
3077
  },
2950
3078
  children: [
2951
- /* @__PURE__ */ jsx12(
3079
+ /* @__PURE__ */ jsx13(
2952
3080
  ContextMenu,
2953
3081
  {
2954
3082
  contextMenu,
@@ -2958,8 +3086,8 @@ function Canvas({ height }) {
2958
3086
  onDismiss: dismissContextMenu
2959
3087
  }
2960
3088
  ),
2961
- /* @__PURE__ */ jsxs5("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
2962
- /* @__PURE__ */ jsx12(
3089
+ /* @__PURE__ */ jsxs6("div", { ref: setPane, style: { position: "relative", flex: "1 1 auto", minHeight: 0 }, children: [
3090
+ /* @__PURE__ */ jsx13(
2963
3091
  CompositeEditor,
2964
3092
  {
2965
3093
  view,
@@ -2981,7 +3109,7 @@ function Canvas({ height }) {
2981
3109
  decorations
2982
3110
  }
2983
3111
  ),
2984
- view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */ jsx12(EmptyCanvas, { editable }) : null
3112
+ !ctx.sourceRefused && view.nodes.length === 0 && view.groups.length === 0 ? /* @__PURE__ */ jsx13(EmptyCanvas, { editable }) : null
2985
3113
  ] })
2986
3114
  ]
2987
3115
  }
@@ -2998,7 +3126,7 @@ function readTokenPx(el, name) {
2998
3126
 
2999
3127
  // src/components/Drawer.tsx
3000
3128
  import "./Drawer-34ZYTEWE.css";
3001
- import { jsx as jsx13, jsxs as jsxs6 } from "react/jsx-runtime";
3129
+ import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
3002
3130
  var KEY_STEP = 16;
3003
3131
  function readDrawerBounds(el) {
3004
3132
  const min = readTokenPx(el, "--lace-size-drawer-min");
@@ -3044,8 +3172,8 @@ function Drawer({ label, children }) {
3044
3172
  setWidth(clampWidth(next, bounds));
3045
3173
  };
3046
3174
  const style = width === null ? void 0 : { "--drawer-width": `${width}px` };
3047
- return /* @__PURE__ */ jsxs6("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
3048
- /* @__PURE__ */ jsx13(
3175
+ return /* @__PURE__ */ jsxs7("aside", { ref, className: "lace-app__drawer", "aria-label": label, style, children: [
3176
+ /* @__PURE__ */ jsx14(
3049
3177
  "div",
3050
3178
  {
3051
3179
  className: "lace-app__drawer-handle",
@@ -3062,19 +3190,19 @@ function Drawer({ label, children }) {
3062
3190
  onKeyDown
3063
3191
  }
3064
3192
  ),
3065
- /* @__PURE__ */ jsx13("div", { className: "lace-app__drawer-body", children })
3193
+ /* @__PURE__ */ jsx14("div", { className: "lace-app__drawer-body", children })
3066
3194
  ] });
3067
3195
  }
3068
3196
 
3069
3197
  // src/components/ErrorBoundary.tsx
3070
3198
  import React from "react";
3071
3199
  import "./ErrorBoundary-IXSIVZFH.css";
3072
- import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
3200
+ import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
3073
3201
  function ErrorState({ message }) {
3074
- return /* @__PURE__ */ jsxs7("div", { className: "lace-error-state", role: "alert", children: [
3075
- /* @__PURE__ */ jsx14("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
3076
- /* @__PURE__ */ jsx14("pre", { className: "lace-error-state__message", children: message }),
3077
- /* @__PURE__ */ jsx14(
3202
+ return /* @__PURE__ */ jsxs8("div", { className: "lace-error-state", role: "alert", children: [
3203
+ /* @__PURE__ */ jsx15("h3", { className: "lace-error-state__title", children: "Something went wrong" }),
3204
+ /* @__PURE__ */ jsx15("pre", { className: "lace-error-state__message", children: message }),
3205
+ /* @__PURE__ */ jsx15(
3078
3206
  "button",
3079
3207
  {
3080
3208
  type: "button",
@@ -3095,7 +3223,7 @@ var ErrorBoundary = class extends React.Component {
3095
3223
  }
3096
3224
  render() {
3097
3225
  if (this.state.error) {
3098
- return /* @__PURE__ */ jsx14(ErrorState, { message: this.state.error.message });
3226
+ return /* @__PURE__ */ jsx15(ErrorState, { message: this.state.error.message });
3099
3227
  }
3100
3228
  return this.props.children;
3101
3229
  }
@@ -3104,23 +3232,23 @@ var ErrorBoundary = class extends React.Component {
3104
3232
  // src/components/ToolbarAction.tsx
3105
3233
  import { Button, IconButton as IconButton2, Spinner } from "@lace-cloud/ui";
3106
3234
  import "./ToolbarAction-PQNWHJSU.css";
3107
- import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
3235
+ import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
3108
3236
  var TIP = "bottom-start";
3109
3237
  function actionTip(keys, reason) {
3110
3238
  const chord = keys?.[0] ? formatChord(keys[0], isMacPlatform()) : void 0;
3111
3239
  if (!chord && !reason) return void 0;
3112
- return /* @__PURE__ */ jsxs8("span", { className: "lace-action-tip", children: [
3113
- chord ? /* @__PURE__ */ jsx15("kbd", { className: "lace-action-tip__key", children: chord }) : null,
3114
- reason ? /* @__PURE__ */ jsx15("span", { className: "lace-action-tip__reason", children: reason }) : null
3240
+ return /* @__PURE__ */ jsxs9("span", { className: "lace-action-tip", children: [
3241
+ chord ? /* @__PURE__ */ jsx16("kbd", { className: "lace-action-tip__key", children: chord }) : null,
3242
+ reason ? /* @__PURE__ */ jsx16("span", { className: "lace-action-tip__reason", children: reason }) : null
3115
3243
  ] });
3116
3244
  }
3117
3245
  function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, busyLabel, onRun }) {
3118
3246
  const busy = busyLabel !== void 0;
3119
3247
  const inert = isInert({ disabledReason: disabledReason2, busyLabel });
3120
3248
  const tooltip = actionTip(action.keys, disabledReason2);
3121
- const glyph = action.icon ? /* @__PURE__ */ jsx15(CanvasIcon, { name: action.icon }) : void 0;
3249
+ const glyph = action.icon ? /* @__PURE__ */ jsx16(CanvasIcon, { name: action.icon }) : void 0;
3122
3250
  if (action.primary) {
3123
- return /* @__PURE__ */ jsx15(
3251
+ return /* @__PURE__ */ jsx16(
3124
3252
  Button,
3125
3253
  {
3126
3254
  rung: true,
@@ -3139,10 +3267,10 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3139
3267
  );
3140
3268
  }
3141
3269
  if (glyph) {
3142
- return /* @__PURE__ */ jsx15(
3270
+ return /* @__PURE__ */ jsx16(
3143
3271
  IconButton2,
3144
3272
  {
3145
- icon: busy ? /* @__PURE__ */ jsx15(Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
3273
+ icon: busy ? /* @__PURE__ */ jsx16(Spinner, { size: 14, "aria-hidden": "true" }) : glyph,
3146
3274
  "aria-label": action.label,
3147
3275
  size: "md",
3148
3276
  "aria-disabled": inert,
@@ -3152,7 +3280,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3152
3280
  }
3153
3281
  );
3154
3282
  }
3155
- return /* @__PURE__ */ jsx15(
3283
+ return /* @__PURE__ */ jsx16(
3156
3284
  Button,
3157
3285
  {
3158
3286
  rung: true,
@@ -3172,7 +3300,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
3172
3300
 
3173
3301
  // src/core/CommandArgsForm.tsx
3174
3302
  import { useState as useState10 } from "react";
3175
- import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
3303
+ import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
3176
3304
  function flagsOf(path) {
3177
3305
  return COMMANDS[path].flags;
3178
3306
  }
@@ -3180,7 +3308,7 @@ function CommandArgsForm({ form }) {
3180
3308
  const [values, setValues] = useState10({});
3181
3309
  if (!form) return null;
3182
3310
  const flags = isCommandPath(form.path) ? flagsOf(form.path) : {};
3183
- return /* @__PURE__ */ jsxs9(
3311
+ return /* @__PURE__ */ jsxs10(
3184
3312
  "form",
3185
3313
  {
3186
3314
  className: "lace-command-args-form",
@@ -3191,16 +3319,16 @@ function CommandArgsForm({ form }) {
3191
3319
  children: [
3192
3320
  form.missing.map((key) => {
3193
3321
  const flagType = flags[key]?.type;
3194
- return /* @__PURE__ */ jsxs9("label", { className: "lace-command-args-form__field", children: [
3195
- /* @__PURE__ */ jsx16("span", { children: key }),
3196
- flagType === "bool" ? /* @__PURE__ */ jsx16(
3322
+ return /* @__PURE__ */ jsxs10("label", { className: "lace-command-args-form__field", children: [
3323
+ /* @__PURE__ */ jsx17("span", { children: key }),
3324
+ flagType === "bool" ? /* @__PURE__ */ jsx17(
3197
3325
  "input",
3198
3326
  {
3199
3327
  type: "checkbox",
3200
3328
  checked: Boolean(values[key]),
3201
3329
  onChange: (e) => setValues((prev) => ({ ...prev, [key]: e.target.checked }))
3202
3330
  }
3203
- ) : /* @__PURE__ */ jsx16(
3331
+ ) : /* @__PURE__ */ jsx17(
3204
3332
  "input",
3205
3333
  {
3206
3334
  type: "text",
@@ -3211,9 +3339,9 @@ function CommandArgsForm({ form }) {
3211
3339
  )
3212
3340
  ] }, key);
3213
3341
  }),
3214
- /* @__PURE__ */ jsxs9("div", { className: "lace-command-args-form__actions", children: [
3215
- /* @__PURE__ */ jsx16("button", { type: "submit", children: "Continue" }),
3216
- /* @__PURE__ */ jsx16("button", { type: "button", onClick: form.cancel, children: "Cancel" })
3342
+ /* @__PURE__ */ jsxs10("div", { className: "lace-command-args-form__actions", children: [
3343
+ /* @__PURE__ */ jsx17("button", { type: "submit", children: "Continue" }),
3344
+ /* @__PURE__ */ jsx17("button", { type: "button", onClick: form.cancel, children: "Cancel" })
3217
3345
  ] })
3218
3346
  ]
3219
3347
  }
@@ -3227,11 +3355,11 @@ import { nodeIdForAddress } from "@lace-cloud/proto";
3227
3355
  import { useMemo as useMemo9 } from "react";
3228
3356
 
3229
3357
  // src/core/use-command-read.ts
3230
- import { useEffect as useEffect9, useMemo as useMemo8, useRef as useRef10, useState as useState11 } from "react";
3358
+ import { useEffect as useEffect10, useMemo as useMemo8, useRef as useRef10, useState as useState11 } from "react";
3231
3359
 
3232
3360
  // src/core/panel-scope.tsx
3233
3361
  import { createContext as createContext3, useContext as useContext3, useMemo as useMemo7 } from "react";
3234
- import { jsx as jsx17 } from "react/jsx-runtime";
3362
+ import { jsx as jsx18 } from "react/jsx-runtime";
3235
3363
  var noopReportError = () => {
3236
3364
  };
3237
3365
  var PanelScopeContext = createContext3(null);
@@ -3248,7 +3376,7 @@ function PanelScope({
3248
3376
  () => ({ ctx, target, paths: new Set(paths), tick, reportError }),
3249
3377
  [ctx, target, paths, tick, reportError]
3250
3378
  );
3251
- return /* @__PURE__ */ jsx17(PanelScopeContext.Provider, { value, children });
3379
+ return /* @__PURE__ */ jsx18(PanelScopeContext.Provider, { value, children });
3252
3380
  }
3253
3381
  function usePanelScope() {
3254
3382
  const value = useContext3(PanelScopeContext);
@@ -3294,11 +3422,11 @@ function useCommandRead(read, target) {
3294
3422
  reportError: scope.reportError
3295
3423
  };
3296
3424
  const inputsRef = useRef10(inputs);
3297
- useEffect9(() => {
3425
+ useEffect10(() => {
3298
3426
  inputsRef.current = inputs;
3299
3427
  });
3300
3428
  const request = useMemo8(() => ({ key, tick: scope.tick }), [key, scope.tick]);
3301
- useEffect9(() => {
3429
+ useEffect10(() => {
3302
3430
  const { path, args: args2, commands, reportError } = inputsRef.current;
3303
3431
  const keyChanged = prevKeyRef.current !== request.key;
3304
3432
  prevKeyRef.current = request.key;
@@ -3400,24 +3528,24 @@ import { Button as Button2 } from "@lace-cloud/ui";
3400
3528
 
3401
3529
  // src/components/Banner.tsx
3402
3530
  import "./Banner-4TSIKYLF.css";
3403
- import { jsx as jsx18, jsxs as jsxs10 } from "react/jsx-runtime";
3531
+ import { jsx as jsx19, jsxs as jsxs11 } from "react/jsx-runtime";
3404
3532
  function Banner({ severity, message, className, actions }) {
3405
- return /* @__PURE__ */ jsxs10(
3533
+ return /* @__PURE__ */ jsxs11(
3406
3534
  "div",
3407
3535
  {
3408
3536
  className: `lace-banner lace-banner--${severity} ${className}`,
3409
3537
  role: severity === "error" ? "alert" : "status",
3410
3538
  children: [
3411
- /* @__PURE__ */ jsx18("span", { className: "lace-banner__icon", children: /* @__PURE__ */ jsx18(CanvasIcon, { name: severity }) }),
3412
- /* @__PURE__ */ jsx18("span", { className: "lace-banner__message", children: message }),
3413
- actions ? /* @__PURE__ */ jsx18("span", { className: "lace-banner__actions", children: actions }) : null
3539
+ /* @__PURE__ */ jsx19("span", { className: "lace-banner__icon", children: /* @__PURE__ */ jsx19(CanvasIcon, { name: severity }) }),
3540
+ /* @__PURE__ */ jsx19("span", { className: "lace-banner__message", children: message }),
3541
+ actions ? /* @__PURE__ */ jsx19("span", { className: "lace-banner__actions", children: actions }) : null
3414
3542
  ]
3415
3543
  }
3416
3544
  );
3417
3545
  }
3418
3546
 
3419
3547
  // src/core/panels/RowActionBanner.tsx
3420
- import { jsx as jsx19 } from "react/jsx-runtime";
3548
+ import { jsx as jsx20 } from "react/jsx-runtime";
3421
3549
  function bannerMessage(opening, actions) {
3422
3550
  return [opening, ...actions.flatMap((action) => action.choice ? [action.choice] : [])].join(
3423
3551
  " "
@@ -3427,7 +3555,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3427
3555
  const { runner } = useCanvas();
3428
3556
  const envExtras = useEditorEnvExtras();
3429
3557
  const actions = rowActionsFor(ctx, panelId);
3430
- return /* @__PURE__ */ jsx19(
3558
+ return /* @__PURE__ */ jsx20(
3431
3559
  Banner,
3432
3560
  {
3433
3561
  severity,
@@ -3435,7 +3563,7 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3435
3563
  message: bannerMessage(opening, actions),
3436
3564
  actions: actions.length === 0 ? void 0 : actions.map((action) => {
3437
3565
  const state = actionState(action, ctx, runner.busy(action, ctx, {}));
3438
- return /* @__PURE__ */ jsx19(
3566
+ return /* @__PURE__ */ jsx20(
3439
3567
  Button2,
3440
3568
  {
3441
3569
  rung: true,
@@ -3456,9 +3584,9 @@ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
3456
3584
  }
3457
3585
 
3458
3586
  // src/core/panels/ConflictBanner.tsx
3459
- import { jsx as jsx20 } from "react/jsx-runtime";
3587
+ import { jsx as jsx21 } from "react/jsx-runtime";
3460
3588
  function ConflictBanner({ ctx }) {
3461
- return /* @__PURE__ */ jsx20(
3589
+ return /* @__PURE__ */ jsx21(
3462
3590
  RowActionBanner,
3463
3591
  {
3464
3592
  ctx,
@@ -3482,17 +3610,17 @@ var conflictPanel = {
3482
3610
  import { Button as Button3 } from "@lace-cloud/ui";
3483
3611
 
3484
3612
  // src/components/Identifier.tsx
3485
- import { Fragment as Fragment5 } from "react";
3613
+ import { Fragment as Fragment6 } from "react";
3486
3614
  import "./Identifier-V6MZ37EG.css";
3487
- import { jsx as jsx21, jsxs as jsxs11 } from "react/jsx-runtime";
3615
+ import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
3488
3616
  function identifierSegments(text) {
3489
3617
  return text.split(/(?<=[_.])/);
3490
3618
  }
3491
3619
  function Identifier({ text, className }) {
3492
- return /* @__PURE__ */ jsx21("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => (
3620
+ return /* @__PURE__ */ jsx22("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => (
3493
3621
  // biome-ignore lint/suspicious/noArrayIndexKey: a segment's place in the name is its identity.
3494
- /* @__PURE__ */ jsxs11(Fragment5, { children: [
3495
- i > 0 ? /* @__PURE__ */ jsx21("wbr", {}) : null,
3622
+ /* @__PURE__ */ jsxs12(Fragment6, { children: [
3623
+ i > 0 ? /* @__PURE__ */ jsx22("wbr", {}) : null,
3496
3624
  segment
3497
3625
  ] }, i)
3498
3626
  )) });
@@ -3500,7 +3628,7 @@ function Identifier({ text, className }) {
3500
3628
 
3501
3629
  // src/core/panels/DiagnosticsPanel.tsx
3502
3630
  import "./DiagnosticsPanel-MSK72CGM.css";
3503
- import { jsx as jsx22, jsxs as jsxs12 } from "react/jsx-runtime";
3631
+ import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
3504
3632
  function locationOf(file, line) {
3505
3633
  return line === void 0 ? file : `${file}:${line}`;
3506
3634
  }
@@ -3511,36 +3639,36 @@ function DiagnosticsPanel({ ctx }) {
3511
3639
  const { runner } = useCanvas();
3512
3640
  const envExtras = useEditorEnvExtras();
3513
3641
  const diagnostics = ctx.diagnostics;
3514
- return /* @__PURE__ */ jsx22("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
3642
+ return /* @__PURE__ */ jsx23("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
3515
3643
  const key = rowKey(d, index);
3516
3644
  const target = { diagnostic: d };
3517
3645
  const actions = rowActionsFor(ctx, "diagnostics", target);
3518
- return /* @__PURE__ */ jsxs12(
3646
+ return /* @__PURE__ */ jsxs13(
3519
3647
  "li",
3520
3648
  {
3521
3649
  className: `lace-diagnostics-panel__row lace-diagnostics-panel__row--${d.severity}`,
3522
3650
  children: [
3523
- /* @__PURE__ */ jsx22("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ jsx22(CanvasIcon, { name: d.severity }) }),
3524
- /* @__PURE__ */ jsxs12("span", { className: "lace-diagnostics-panel__body", children: [
3525
- /* @__PURE__ */ jsx22("span", { className: "lace-diagnostics-panel__message", children: d.message }),
3526
- d.file !== void 0 && /* @__PURE__ */ jsx22(
3651
+ /* @__PURE__ */ jsx23("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ jsx23(CanvasIcon, { name: d.severity }) }),
3652
+ /* @__PURE__ */ jsxs13("span", { className: "lace-diagnostics-panel__body", children: [
3653
+ /* @__PURE__ */ jsx23("span", { className: "lace-diagnostics-panel__message", children: d.message }),
3654
+ d.file !== void 0 && /* @__PURE__ */ jsx23(
3527
3655
  Identifier,
3528
3656
  {
3529
3657
  className: "lace-diagnostics-panel__file",
3530
3658
  text: locationOf(d.file, d.line)
3531
3659
  }
3532
3660
  ),
3533
- d.instance_id !== void 0 && /* @__PURE__ */ jsx22(
3661
+ d.instance_id !== void 0 && /* @__PURE__ */ jsx23(
3534
3662
  Identifier,
3535
3663
  {
3536
3664
  className: "lace-diagnostics-panel__where",
3537
3665
  text: d.input_name ? `${d.instance_id}.${d.input_name}` : d.instance_id
3538
3666
  }
3539
3667
  ),
3540
- d.code !== void 0 && /* @__PURE__ */ jsx22(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
3668
+ d.code !== void 0 && /* @__PURE__ */ jsx23(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
3541
3669
  actions.map((action) => {
3542
3670
  const state = actionState(action, ctx, runner.busy(action, ctx, target));
3543
- return /* @__PURE__ */ jsx22(
3671
+ return /* @__PURE__ */ jsx23(
3544
3672
  Button3,
3545
3673
  {
3546
3674
  rung: true,
@@ -3583,7 +3711,7 @@ import { createElement } from "react";
3583
3711
  import { callText } from "@lace-cloud/proto";
3584
3712
  import { Button as Button4, Panel } from "@lace-cloud/ui";
3585
3713
  import "./EdgeInspectorPanel-JD6CVUAT.css";
3586
- import { jsx as jsx23, jsxs as jsxs13 } from "react/jsx-runtime";
3714
+ import { jsx as jsx24, jsxs as jsxs14 } from "react/jsx-runtime";
3587
3715
  function EdgeInspectorPanel({
3588
3716
  source,
3589
3717
  target,
@@ -3592,23 +3720,23 @@ function EdgeInspectorPanel({
3592
3720
  onDelete,
3593
3721
  onClose
3594
3722
  }) {
3595
- const title = /* @__PURE__ */ jsxs13("div", { children: [
3596
- /* @__PURE__ */ jsx23("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
3597
- /* @__PURE__ */ jsxs13("div", { className: "lace-edge-panel__title", children: [
3598
- /* @__PURE__ */ jsx23(Identifier, { text: source }),
3723
+ const title = /* @__PURE__ */ jsxs14("div", { children: [
3724
+ /* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
3725
+ /* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__title", children: [
3726
+ /* @__PURE__ */ jsx24(Identifier, { text: source }),
3599
3727
  " \u2192 ",
3600
- /* @__PURE__ */ jsx23(Identifier, { text: target })
3728
+ /* @__PURE__ */ jsx24(Identifier, { text: target })
3601
3729
  ] })
3602
3730
  ] });
3603
- const footer = onDelete ? /* @__PURE__ */ jsx23(Button4, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
3604
- return /* @__PURE__ */ jsxs13(Panel, { title, footer, onClose, children: [
3605
- /* @__PURE__ */ jsx23("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
3606
- /* @__PURE__ */ jsxs13("div", { className: "lace-edge-panel__wiring", children: [
3607
- /* @__PURE__ */ jsx23(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : callText(source) }),
3608
- /* @__PURE__ */ jsx23("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
3609
- /* @__PURE__ */ jsx23(Identifier, { text: `${target}.inputs.${targetInput}` })
3731
+ const footer = onDelete ? /* @__PURE__ */ jsx24(Button4, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
3732
+ return /* @__PURE__ */ jsxs14(Panel, { title, footer, onClose, children: [
3733
+ /* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
3734
+ /* @__PURE__ */ jsxs14("div", { className: "lace-edge-panel__wiring", children: [
3735
+ /* @__PURE__ */ jsx24(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : callText(source) }),
3736
+ /* @__PURE__ */ jsx24("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
3737
+ /* @__PURE__ */ jsx24(Identifier, { text: `${target}.inputs.${targetInput}` })
3610
3738
  ] }),
3611
- onDelete && /* @__PURE__ */ jsx23("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." })
3739
+ onDelete && /* @__PURE__ */ jsx24("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." })
3612
3740
  ] });
3613
3741
  }
3614
3742
 
@@ -3671,9 +3799,9 @@ var edgeInspectorPanel = {
3671
3799
 
3672
3800
  // src/core/panels/Markers.tsx
3673
3801
  import { Badge } from "@lace-cloud/ui";
3674
- import { jsx as jsx24 } from "react/jsx-runtime";
3802
+ import { jsx as jsx25 } from "react/jsx-runtime";
3675
3803
  function UnsavedMarker() {
3676
- return /* @__PURE__ */ jsx24(Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
3804
+ return /* @__PURE__ */ jsx25(Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
3677
3805
  }
3678
3806
  var unsavedMarker = {
3679
3807
  id: "unsaved-marker",
@@ -3685,7 +3813,7 @@ var unsavedMarker = {
3685
3813
  Component: UnsavedMarker
3686
3814
  };
3687
3815
  function UngeneratedMarker() {
3688
- return /* @__PURE__ */ jsx24(Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
3816
+ return /* @__PURE__ */ jsx25(Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
3689
3817
  }
3690
3818
  var ungeneratedMarker = {
3691
3819
  id: "ungenerated-marker",
@@ -3717,7 +3845,7 @@ import { useMemo as useMemo11 } from "react";
3717
3845
  import { useState as useState13 } from "react";
3718
3846
 
3719
3847
  // src/hooks/useUpdateState.ts
3720
- import { useCallback as useCallback10, useEffect as useEffect10, useRef as useRef11, useState as useState12 } from "react";
3848
+ import { useCallback as useCallback10, useEffect as useEffect11, useRef as useRef11, useState as useState12 } from "react";
3721
3849
  function useUpdateState(updateFn) {
3722
3850
  const [status, setStatus] = useState12("idle");
3723
3851
  const mountedRef = useRef11(true);
@@ -3746,7 +3874,7 @@ function useUpdateState(updateFn) {
3746
3874
  scheduleReset(2e3);
3747
3875
  }
3748
3876
  }, [updateFn, safeSetStatus, scheduleReset]);
3749
- useEffect10(() => {
3877
+ useEffect11(() => {
3750
3878
  mountedRef.current = true;
3751
3879
  return () => {
3752
3880
  mountedRef.current = false;
@@ -3787,11 +3915,11 @@ function useDraft(seed, send) {
3787
3915
  // src/components/AccordionSection.tsx
3788
3916
  import { useState as useState14 } from "react";
3789
3917
  import "./AccordionSection-5X2XWUYY.css";
3790
- import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
3918
+ import { jsx as jsx26, jsxs as jsxs15 } from "react/jsx-runtime";
3791
3919
  function AccordionSection({ title, defaultOpen = false, badge, children }) {
3792
3920
  const [open, setOpen] = useState14(defaultOpen);
3793
- return /* @__PURE__ */ jsxs14("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
3794
- /* @__PURE__ */ jsxs14(
3921
+ return /* @__PURE__ */ jsxs15("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
3922
+ /* @__PURE__ */ jsxs15(
3795
3923
  "button",
3796
3924
  {
3797
3925
  type: "button",
@@ -3799,13 +3927,13 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
3799
3927
  onClick: () => setOpen((v) => !v),
3800
3928
  "aria-expanded": open,
3801
3929
  children: [
3802
- /* @__PURE__ */ jsx25("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ jsx25(CanvasIcon, { name: "chevron-right" }) }),
3803
- /* @__PURE__ */ jsx25("span", { className: "lace-accordion__title", children: title }),
3804
- badge && /* @__PURE__ */ jsx25("span", { className: "lace-accordion__badge", children: badge })
3930
+ /* @__PURE__ */ jsx26("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ jsx26(CanvasIcon, { name: "chevron-right" }) }),
3931
+ /* @__PURE__ */ jsx26("span", { className: "lace-accordion__title", children: title }),
3932
+ badge && /* @__PURE__ */ jsx26("span", { className: "lace-accordion__badge", children: badge })
3805
3933
  ]
3806
3934
  }
3807
3935
  ),
3808
- /* @__PURE__ */ jsx25("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx25("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx25("div", { className: "lace-accordion__body-content", children }) }) })
3936
+ /* @__PURE__ */ jsx26("div", { className: "lace-accordion__body", children: /* @__PURE__ */ jsx26("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ jsx26("div", { className: "lace-accordion__body-content", children }) }) })
3809
3937
  ] });
3810
3938
  }
3811
3939
 
@@ -3815,8 +3943,8 @@ import "./panels-shared-3HUQC7TC.css";
3815
3943
 
3816
3944
  // src/components/UpdateButton.tsx
3817
3945
  import { Button as Button5 } from "@lace-cloud/ui";
3818
- import "./UpdateButton-TJKSFVBA.css";
3819
- import { jsx as jsx26 } from "react/jsx-runtime";
3946
+ import "./UpdateButton-VSIHLAZC.css";
3947
+ import { jsx as jsx27 } from "react/jsx-runtime";
3820
3948
  var variantByStatus = {
3821
3949
  updating: "primary",
3822
3950
  updated: "success",
@@ -3832,7 +3960,7 @@ function variantOf({ status, dirty }, blocked) {
3832
3960
  return dirty && blocked === void 0 ? "primary" : "secondary";
3833
3961
  }
3834
3962
  function UpdateButton({ draft, label, blocked }) {
3835
- return /* @__PURE__ */ jsx26("div", { className: "lace-commit-foot", children: /* @__PURE__ */ jsx26(
3963
+ return /* @__PURE__ */ jsx27("div", { className: "lace-commit-foot", children: /* @__PURE__ */ jsx27(
3836
3964
  Button5,
3837
3965
  {
3838
3966
  rung: true,
@@ -3856,7 +3984,7 @@ import { useMemo as useMemo10 } from "react";
3856
3984
  import { Button as Button6, IconButton as IconButton3, Input } from "@lace-cloud/ui";
3857
3985
  import { useState as useState15 } from "react";
3858
3986
  import "./panels-shared-3HUQC7TC.css";
3859
- import { Fragment as Fragment6, jsx as jsx27, jsxs as jsxs15 } from "react/jsx-runtime";
3987
+ import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
3860
3988
  function replaceAt(list, index, item) {
3861
3989
  return list.map((x, i) => i === index ? item : x);
3862
3990
  }
@@ -3864,8 +3992,8 @@ function blockTitle(block) {
3864
3992
  return [block.type, ...block.labels.map((l) => `"${l}"`)].join(" ");
3865
3993
  }
3866
3994
  function BlockEditor({ blocks, onChange, editable, templates }) {
3867
- return /* @__PURE__ */ jsxs15(Fragment6, { children: [
3868
- blocks.map((block, i) => /* @__PURE__ */ jsx27(
3995
+ return /* @__PURE__ */ jsxs16(Fragment7, { children: [
3996
+ blocks.map((block, i) => /* @__PURE__ */ jsx28(
3869
3997
  BlockCard,
3870
3998
  {
3871
3999
  block,
@@ -3875,7 +4003,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
3875
4003
  },
3876
4004
  i
3877
4005
  )),
3878
- editable && (templates ? /* @__PURE__ */ jsx27("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ jsxs15(
4006
+ editable && (templates ? /* @__PURE__ */ jsx28("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ jsxs16(
3879
4007
  Button6,
3880
4008
  {
3881
4009
  variant: "secondary",
@@ -3896,7 +4024,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
3896
4024
  ]
3897
4025
  },
3898
4026
  t.type
3899
- )) }) : /* @__PURE__ */ jsx27(
4027
+ )) }) : /* @__PURE__ */ jsx28(
3900
4028
  NewBlockRow,
3901
4029
  {
3902
4030
  onAdd: (type, label) => onChange([
@@ -3910,8 +4038,8 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
3910
4038
  function NewBlockRow({ onAdd }) {
3911
4039
  const [type, setType] = useState15("");
3912
4040
  const [label, setLabel] = useState15("");
3913
- return /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions", children: [
3914
- /* @__PURE__ */ jsx27(
4041
+ return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
4042
+ /* @__PURE__ */ jsx28(
3915
4043
  Input,
3916
4044
  {
3917
4045
  value: type,
@@ -3921,7 +4049,7 @@ function NewBlockRow({ onAdd }) {
3921
4049
  mono: true
3922
4050
  }
3923
4051
  ),
3924
- /* @__PURE__ */ jsx27(
4052
+ /* @__PURE__ */ jsx28(
3925
4053
  Input,
3926
4054
  {
3927
4055
  value: label,
@@ -3931,7 +4059,7 @@ function NewBlockRow({ onAdd }) {
3931
4059
  mono: true
3932
4060
  }
3933
4061
  ),
3934
- /* @__PURE__ */ jsx27(
4062
+ /* @__PURE__ */ jsx28(
3935
4063
  Button6,
3936
4064
  {
3937
4065
  variant: "secondary",
@@ -3955,13 +4083,13 @@ function BlockCard({ block, editable, onChange, onRemove }) {
3955
4083
  [field]: value
3956
4084
  })
3957
4085
  });
3958
- return /* @__PURE__ */ jsxs15("div", { className: "lace-panel-validation-block", children: [
3959
- /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions", children: [
3960
- /* @__PURE__ */ jsx27(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
3961
- editable && /* @__PURE__ */ jsx27(
4086
+ return /* @__PURE__ */ jsxs16("div", { className: "lace-panel-validation-block", children: [
4087
+ /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions", children: [
4088
+ /* @__PURE__ */ jsx28(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
4089
+ editable && /* @__PURE__ */ jsx28(
3962
4090
  IconButton3,
3963
4091
  {
3964
- icon: /* @__PURE__ */ jsx27(CanvasIcon, { name: "close" }),
4092
+ icon: /* @__PURE__ */ jsx28(CanvasIcon, { name: "close" }),
3965
4093
  "aria-label": `Remove the ${block.type} block`,
3966
4094
  size: "md",
3967
4095
  tooltipPlacement: "bottom-end",
@@ -3971,8 +4099,8 @@ function BlockCard({ block, editable, onChange, onRemove }) {
3971
4099
  ] }),
3972
4100
  block.attributes.map((attribute, i) => (
3973
4101
  // biome-ignore lint/suspicious/noArrayIndexKey: attributes are positional; the render keeps their order
3974
- /* @__PURE__ */ jsxs15("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
3975
- /* @__PURE__ */ jsx27(
4102
+ /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4103
+ /* @__PURE__ */ jsx28(
3976
4104
  Input,
3977
4105
  {
3978
4106
  value: attribute.name,
@@ -3983,7 +4111,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
3983
4111
  readOnly: !editable
3984
4112
  }
3985
4113
  ),
3986
- /* @__PURE__ */ jsx27(
4114
+ /* @__PURE__ */ jsx28(
3987
4115
  Input,
3988
4116
  {
3989
4117
  value: attribute.value,
@@ -3994,10 +4122,10 @@ function BlockCard({ block, editable, onChange, onRemove }) {
3994
4122
  readOnly: !editable
3995
4123
  }
3996
4124
  ),
3997
- editable && /* @__PURE__ */ jsx27(
4125
+ editable && /* @__PURE__ */ jsx28(
3998
4126
  IconButton3,
3999
4127
  {
4000
- icon: /* @__PURE__ */ jsx27(CanvasIcon, { name: "close" }),
4128
+ icon: /* @__PURE__ */ jsx28(CanvasIcon, { name: "close" }),
4001
4129
  "aria-label": `Remove ${attribute.name || "the argument"}`,
4002
4130
  size: "md",
4003
4131
  tooltipPlacement: "bottom-end",
@@ -4006,7 +4134,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4006
4134
  )
4007
4135
  ] }, i)
4008
4136
  )),
4009
- editable && /* @__PURE__ */ jsx27(
4137
+ editable && /* @__PURE__ */ jsx28(
4010
4138
  Button6,
4011
4139
  {
4012
4140
  variant: "secondary",
@@ -4015,7 +4143,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
4015
4143
  children: "+ Add argument"
4016
4144
  }
4017
4145
  ),
4018
- (block.blocks.length > 0 || editable) && /* @__PURE__ */ jsx27(
4146
+ (block.blocks.length > 0 || editable) && /* @__PURE__ */ jsx28(
4019
4147
  BlockEditor,
4020
4148
  {
4021
4149
  blocks: block.blocks,
@@ -4051,7 +4179,7 @@ function firstDuplicate(items, keyFn) {
4051
4179
 
4052
4180
  // src/components/panels/LocalsPanel.tsx
4053
4181
  import "./panels-shared-3HUQC7TC.css";
4054
- import { Fragment as Fragment7, jsx as jsx28, jsxs as jsxs16 } from "react/jsx-runtime";
4182
+ import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
4055
4183
  function toRows(locals) {
4056
4184
  return (locals ?? []).map((l) => ({ id: l.name, ...l }));
4057
4185
  }
@@ -4068,10 +4196,10 @@ function LocalsContent({ locals, onSave }) {
4068
4196
  const updateRow = (index, field, value) => setRows(rows.map((r, i) => i === index ? { ...r, [field]: value } : r));
4069
4197
  const nameDupes = findDuplicateIndices(rows, (r) => r.name);
4070
4198
  const duplicate = firstDuplicate(rows, (r) => r.name);
4071
- return /* @__PURE__ */ jsxs16(Fragment7, { children: [
4072
- rows.map((row, i) => /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4073
- /* @__PURE__ */ jsxs16("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4074
- /* @__PURE__ */ jsx28(
4199
+ return /* @__PURE__ */ jsxs17(Fragment8, { children: [
4200
+ rows.map((row, i) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4201
+ /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4202
+ /* @__PURE__ */ jsx29(
4075
4203
  Input2,
4076
4204
  {
4077
4205
  value: row.name,
@@ -4084,10 +4212,10 @@ function LocalsContent({ locals, onSave }) {
4084
4212
  readOnly: !editable
4085
4213
  }
4086
4214
  ),
4087
- editable && /* @__PURE__ */ jsx28(
4215
+ editable && /* @__PURE__ */ jsx29(
4088
4216
  IconButton4,
4089
4217
  {
4090
- icon: /* @__PURE__ */ jsx28(CanvasIcon, { name: "close" }),
4218
+ icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4091
4219
  "aria-label": "Remove local",
4092
4220
  size: "md",
4093
4221
  tooltipPlacement: "bottom-end",
@@ -4095,8 +4223,8 @@ function LocalsContent({ locals, onSave }) {
4095
4223
  }
4096
4224
  )
4097
4225
  ] }),
4098
- nameDupes.has(i) && /* @__PURE__ */ jsx28("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
4099
- /* @__PURE__ */ jsx28("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx28(
4226
+ nameDupes.has(i) && /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
4227
+ /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx29(
4100
4228
  Textarea,
4101
4229
  {
4102
4230
  value: row.value,
@@ -4110,8 +4238,8 @@ function LocalsContent({ locals, onSave }) {
4110
4238
  }
4111
4239
  ) })
4112
4240
  ] }, row.id)),
4113
- editable && /* @__PURE__ */ jsxs16(Fragment7, { children: [
4114
- /* @__PURE__ */ jsx28(
4241
+ editable && /* @__PURE__ */ jsxs17(Fragment8, { children: [
4242
+ /* @__PURE__ */ jsx29(
4115
4243
  Button7,
4116
4244
  {
4117
4245
  variant: "secondary",
@@ -4120,7 +4248,7 @@ function LocalsContent({ locals, onSave }) {
4120
4248
  children: "+ Add local"
4121
4249
  }
4122
4250
  ),
4123
- /* @__PURE__ */ jsx28(
4251
+ /* @__PURE__ */ jsx29(
4124
4252
  UpdateButton,
4125
4253
  {
4126
4254
  draft,
@@ -4132,13 +4260,13 @@ function LocalsContent({ locals, onSave }) {
4132
4260
  ] });
4133
4261
  }
4134
4262
  function LocalsPanel({ onClose, ...content }) {
4135
- return /* @__PURE__ */ jsx28(Panel2, { title: "Locals", onClose, children: /* @__PURE__ */ jsx28(LocalsContent, { ...content }) });
4263
+ return /* @__PURE__ */ jsx29(Panel2, { title: "Locals", onClose, children: /* @__PURE__ */ jsx29(LocalsContent, { ...content }) });
4136
4264
  }
4137
4265
 
4138
4266
  // src/components/panels/ModuleInterfacePanel.tsx
4139
4267
  import { Button as Button8, IconButton as IconButton5, Input as Input3, Panel as Panel3, Select, Textarea as Textarea2 } from "@lace-cloud/ui";
4140
4268
  import "./panels-shared-3HUQC7TC.css";
4141
- import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs17 } from "react/jsx-runtime";
4269
+ import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
4142
4270
  function variablesToRows(variables) {
4143
4271
  return variables.map((v) => ({
4144
4272
  id: v.name,
@@ -4270,13 +4398,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
4270
4398
  const variableDupes = findDuplicateIndices(variables, (v) => v.name);
4271
4399
  const outputDupes = findDuplicateIndices(outputs, (o) => o.name);
4272
4400
  const exposable = settings.call_outputs.filter((text) => !outputs.some((o) => o.value === text));
4273
- return /* @__PURE__ */ jsxs17(Fragment8, { children: [
4274
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
4275
- /* @__PURE__ */ jsx29("h4", { className: "lace-panel-section-title", children: "Inputs" }),
4276
- variables.length === 0 && /* @__PURE__ */ jsx29("div", { className: "lace-panel-hint", children: "No variables." }),
4277
- variables.map((v, i) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4278
- /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4279
- v.added ? /* @__PURE__ */ jsx29(
4401
+ return /* @__PURE__ */ jsxs18(Fragment9, { children: [
4402
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
4403
+ /* @__PURE__ */ jsx30("h4", { className: "lace-panel-section-title", children: "Inputs" }),
4404
+ variables.length === 0 && /* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "No variables." }),
4405
+ variables.map((v, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4406
+ /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4407
+ v.added ? /* @__PURE__ */ jsx30(
4280
4408
  Input3,
4281
4409
  {
4282
4410
  label: "Name",
@@ -4287,11 +4415,11 @@ function ModuleInterfaceContent({ settings, onSave }) {
4287
4415
  mono: true,
4288
4416
  error: variableDupes.has(i)
4289
4417
  }
4290
- ) : /* @__PURE__ */ jsx29(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
4291
- editable && /* @__PURE__ */ jsx29(
4418
+ ) : /* @__PURE__ */ jsx30(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
4419
+ editable && /* @__PURE__ */ jsx30(
4292
4420
  IconButton5,
4293
4421
  {
4294
- icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4422
+ icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4295
4423
  "aria-label": `Remove variable ${v.name}`,
4296
4424
  size: "md",
4297
4425
  tooltipPlacement: "bottom-end",
@@ -4299,8 +4427,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
4299
4427
  }
4300
4428
  )
4301
4429
  ] }),
4302
- variableDupes.has(i) && /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
4303
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx29(
4430
+ variableDupes.has(i) && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
4431
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(
4304
4432
  Input3,
4305
4433
  {
4306
4434
  label: "Type",
@@ -4312,8 +4440,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
4312
4440
  readOnly: !editable
4313
4441
  }
4314
4442
  ) }),
4315
- v.defaultText && /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx29(Input3, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
4316
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx29(
4443
+ v.defaultText && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(Input3, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
4444
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx30(
4317
4445
  Textarea2,
4318
4446
  {
4319
4447
  label: "Description",
@@ -4325,9 +4453,9 @@ function ModuleInterfaceContent({ settings, onSave }) {
4325
4453
  readOnly: !editable
4326
4454
  }
4327
4455
  ) }),
4328
- /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions", children: [
4329
- /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4330
- /* @__PURE__ */ jsx29(
4456
+ /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4457
+ /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4458
+ /* @__PURE__ */ jsx30(
4331
4459
  "input",
4332
4460
  {
4333
4461
  type: "checkbox",
@@ -4336,10 +4464,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
4336
4464
  disabled: !editable
4337
4465
  }
4338
4466
  ),
4339
- /* @__PURE__ */ jsx29("span", { children: "Required" })
4467
+ /* @__PURE__ */ jsx30("span", { children: "Required" })
4340
4468
  ] }),
4341
- /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4342
- /* @__PURE__ */ jsx29(
4469
+ /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4470
+ /* @__PURE__ */ jsx30(
4343
4471
  "input",
4344
4472
  {
4345
4473
  type: "checkbox",
@@ -4348,10 +4476,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
4348
4476
  disabled: !editable
4349
4477
  }
4350
4478
  ),
4351
- /* @__PURE__ */ jsx29("span", { children: "Ephemeral" })
4479
+ /* @__PURE__ */ jsx30("span", { children: "Ephemeral" })
4352
4480
  ] }),
4353
- /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4354
- /* @__PURE__ */ jsx29(
4481
+ /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4482
+ /* @__PURE__ */ jsx30(
4355
4483
  "input",
4356
4484
  {
4357
4485
  type: "checkbox",
@@ -4360,10 +4488,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
4360
4488
  disabled: !editable
4361
4489
  }
4362
4490
  ),
4363
- /* @__PURE__ */ jsx29("span", { children: "Sensitive" })
4491
+ /* @__PURE__ */ jsx30("span", { children: "Sensitive" })
4364
4492
  ] }),
4365
- /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4366
- /* @__PURE__ */ jsx29(
4493
+ /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4494
+ /* @__PURE__ */ jsx30(
4367
4495
  "input",
4368
4496
  {
4369
4497
  type: "checkbox",
@@ -4372,13 +4500,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
4372
4500
  disabled: !editable
4373
4501
  }
4374
4502
  ),
4375
- /* @__PURE__ */ jsx29("span", { children: "Nullable" })
4503
+ /* @__PURE__ */ jsx30("span", { children: "Nullable" })
4376
4504
  ] })
4377
4505
  ] }),
4378
- (v.validation.length > 0 || editable) && /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-content", children: [
4379
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-subsection-label", children: "Validation" }),
4380
- v.validation.map((block, j) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-validation-block", children: [
4381
- /* @__PURE__ */ jsx29(
4506
+ (v.validation.length > 0 || editable) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
4507
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-subsection-label", children: "Validation" }),
4508
+ v.validation.map((block, j) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-validation-block", children: [
4509
+ /* @__PURE__ */ jsx30(
4382
4510
  Input3,
4383
4511
  {
4384
4512
  value: block.condition,
@@ -4390,7 +4518,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
4390
4518
  readOnly: !editable
4391
4519
  }
4392
4520
  ),
4393
- /* @__PURE__ */ jsx29(
4521
+ /* @__PURE__ */ jsx30(
4394
4522
  Input3,
4395
4523
  {
4396
4524
  value: block.error_message,
@@ -4401,10 +4529,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
4401
4529
  readOnly: !editable
4402
4530
  }
4403
4531
  ),
4404
- editable && /* @__PURE__ */ jsx29(
4532
+ editable && /* @__PURE__ */ jsx30(
4405
4533
  IconButton5,
4406
4534
  {
4407
- icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4535
+ icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4408
4536
  "aria-label": "Remove validation rule",
4409
4537
  size: "md",
4410
4538
  tooltipPlacement: "bottom-end",
@@ -4412,15 +4540,15 @@ function ModuleInterfaceContent({ settings, onSave }) {
4412
4540
  }
4413
4541
  )
4414
4542
  ] }, block.id)),
4415
- editable && /* @__PURE__ */ jsx29(Button8, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
4543
+ editable && /* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
4416
4544
  ] })
4417
4545
  ] }, v.id)),
4418
- editable && /* @__PURE__ */ jsx29(Button8, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
4419
- /* @__PURE__ */ jsx29("h4", { className: "lace-panel-section-title", children: "Outputs" }),
4420
- outputs.length === 0 && /* @__PURE__ */ jsx29("div", { className: "lace-panel-hint", children: "No outputs." }),
4421
- outputs.map((o, i) => /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4422
- /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4423
- /* @__PURE__ */ jsx29(
4546
+ editable && /* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
4547
+ /* @__PURE__ */ jsx30("h4", { className: "lace-panel-section-title", children: "Outputs" }),
4548
+ outputs.length === 0 && /* @__PURE__ */ jsx30("div", { className: "lace-panel-hint", children: "No outputs." }),
4549
+ outputs.map((o, i) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4550
+ /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4551
+ /* @__PURE__ */ jsx30(
4424
4552
  Input3,
4425
4553
  {
4426
4554
  label: "Name",
@@ -4433,10 +4561,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
4433
4561
  error: outputDupes.has(i) || editable && !o.name.trim()
4434
4562
  }
4435
4563
  ),
4436
- editable && /* @__PURE__ */ jsx29(
4564
+ editable && /* @__PURE__ */ jsx30(
4437
4565
  IconButton5,
4438
4566
  {
4439
- icon: /* @__PURE__ */ jsx29(CanvasIcon, { name: "close" }),
4567
+ icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4440
4568
  "aria-label": `Remove output ${o.name}`,
4441
4569
  size: "md",
4442
4570
  tooltipPlacement: "bottom-end",
@@ -4444,7 +4572,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
4444
4572
  }
4445
4573
  )
4446
4574
  ] }),
4447
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx29(
4575
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx30(
4448
4576
  Input3,
4449
4577
  {
4450
4578
  label: "Value",
@@ -4457,7 +4585,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
4457
4585
  error: editable && !o.value.trim()
4458
4586
  }
4459
4587
  ) }),
4460
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx29(
4588
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ jsx30(
4461
4589
  Textarea2,
4462
4590
  {
4463
4591
  label: "Description",
@@ -4469,8 +4597,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
4469
4597
  readOnly: !editable
4470
4598
  }
4471
4599
  ) }),
4472
- /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4473
- /* @__PURE__ */ jsx29(
4600
+ /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4601
+ /* @__PURE__ */ jsx30(
4474
4602
  "input",
4475
4603
  {
4476
4604
  type: "checkbox",
@@ -4479,12 +4607,12 @@ function ModuleInterfaceContent({ settings, onSave }) {
4479
4607
  disabled: !editable
4480
4608
  }
4481
4609
  ),
4482
- /* @__PURE__ */ jsx29("span", { children: "Sensitive" })
4610
+ /* @__PURE__ */ jsx30("span", { children: "Sensitive" })
4483
4611
  ] }),
4484
- (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-content", children: [
4485
- /* @__PURE__ */ jsx29("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
4486
- !editable ? o.depends_on.map((dep) => /* @__PURE__ */ jsx29("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx29(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ jsxs17("label", { className: "lace-panel-checkbox-row", children: [
4487
- /* @__PURE__ */ jsx29(
4612
+ (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-content", children: [
4613
+ /* @__PURE__ */ jsx30("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
4614
+ !editable ? o.depends_on.map((dep) => /* @__PURE__ */ jsx30("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx30(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ jsxs18("label", { className: "lace-panel-checkbox-row", children: [
4615
+ /* @__PURE__ */ jsx30(
4488
4616
  "input",
4489
4617
  {
4490
4618
  type: "checkbox",
@@ -4492,14 +4620,14 @@ function ModuleInterfaceContent({ settings, onSave }) {
4492
4620
  onChange: () => toggleDependsOn(i, dep)
4493
4621
  }
4494
4622
  ),
4495
- /* @__PURE__ */ jsx29(Identifier, { text: dep })
4623
+ /* @__PURE__ */ jsx30(Identifier, { text: dep })
4496
4624
  ] }, dep))
4497
4625
  ] }),
4498
- outputDupes.has(i) && /* @__PURE__ */ jsx29("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
4626
+ outputDupes.has(i) && /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
4499
4627
  ] }, o.id)),
4500
- editable && /* @__PURE__ */ jsxs17("div", { className: "lace-panel-row-actions", children: [
4501
- /* @__PURE__ */ jsx29(Button8, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
4502
- exposable.length > 0 && /* @__PURE__ */ jsx29(
4628
+ editable && /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions", children: [
4629
+ /* @__PURE__ */ jsx30(Button8, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
4630
+ exposable.length > 0 && /* @__PURE__ */ jsx30(
4503
4631
  Select,
4504
4632
  {
4505
4633
  "aria-label": "Expose a call's output",
@@ -4515,7 +4643,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
4515
4643
  }
4516
4644
  )
4517
4645
  ] }),
4518
- editable && /* @__PURE__ */ jsx29(
4646
+ editable && /* @__PURE__ */ jsx30(
4519
4647
  UpdateButton,
4520
4648
  {
4521
4649
  draft,
@@ -4526,7 +4654,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
4526
4654
  ] });
4527
4655
  }
4528
4656
  function ModuleInterfacePanel({ onClose, ...content }) {
4529
- return /* @__PURE__ */ jsx29(Panel3, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx29(ModuleInterfaceContent, { ...content }) });
4657
+ return /* @__PURE__ */ jsx30(Panel3, { title: "Module Interface", onClose, children: /* @__PURE__ */ jsx30(ModuleInterfaceContent, { ...content }) });
4530
4658
  }
4531
4659
 
4532
4660
  // src/components/panels/module-actions.ts
@@ -4645,7 +4773,7 @@ import "./panels-shared-3HUQC7TC.css";
4645
4773
  // src/components/panels/ProvidersPanel.tsx
4646
4774
  import { Button as Button9, IconButton as IconButton6, Input as Input4, Panel as Panel4 } from "@lace-cloud/ui";
4647
4775
  import "./panels-shared-3HUQC7TC.css";
4648
- import { Fragment as Fragment9, jsx as jsx30, jsxs as jsxs18 } from "react/jsx-runtime";
4776
+ import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
4649
4777
  function toRows2(providers) {
4650
4778
  if (!providers || providers.length === 0) return [];
4651
4779
  return providers.map((p) => ({
@@ -4696,10 +4824,10 @@ function ProvidersContent({ providers, onSave }) {
4696
4824
  (c, ei) => ei === entryIndex ? { ...c, [field]: value } : c
4697
4825
  )
4698
4826
  );
4699
- return /* @__PURE__ */ jsxs18(Fragment9, { children: [
4700
- rows.map((row, pi) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4701
- /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4702
- /* @__PURE__ */ jsx30(
4827
+ return /* @__PURE__ */ jsxs19(Fragment10, { children: [
4828
+ rows.map((row, pi) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4829
+ /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4830
+ /* @__PURE__ */ jsx31(
4703
4831
  Input4,
4704
4832
  {
4705
4833
  value: row.name,
@@ -4709,7 +4837,7 @@ function ProvidersContent({ providers, onSave }) {
4709
4837
  readOnly: !editable
4710
4838
  }
4711
4839
  ),
4712
- /* @__PURE__ */ jsx30(
4840
+ /* @__PURE__ */ jsx31(
4713
4841
  Input4,
4714
4842
  {
4715
4843
  value: row.alias,
@@ -4719,10 +4847,10 @@ function ProvidersContent({ providers, onSave }) {
4719
4847
  readOnly: !editable
4720
4848
  }
4721
4849
  ),
4722
- editable && /* @__PURE__ */ jsx30(
4850
+ editable && /* @__PURE__ */ jsx31(
4723
4851
  IconButton6,
4724
4852
  {
4725
- icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4853
+ icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4726
4854
  "aria-label": "Remove provider",
4727
4855
  size: "md",
4728
4856
  tooltipPlacement: "bottom-end",
@@ -4730,9 +4858,9 @@ function ProvidersContent({ providers, onSave }) {
4730
4858
  }
4731
4859
  )
4732
4860
  ] }),
4733
- /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-sublabel", children: "Config" }),
4734
- row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs18("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4735
- /* @__PURE__ */ jsx30(
4861
+ /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Config" }),
4862
+ row.configEntries.map((entry, ei) => /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4863
+ /* @__PURE__ */ jsx31(
4736
4864
  Input4,
4737
4865
  {
4738
4866
  value: entry.key,
@@ -4742,7 +4870,7 @@ function ProvidersContent({ providers, onSave }) {
4742
4870
  readOnly: !editable
4743
4871
  }
4744
4872
  ),
4745
- /* @__PURE__ */ jsx30(
4873
+ /* @__PURE__ */ jsx31(
4746
4874
  Input4,
4747
4875
  {
4748
4876
  value: entry.value,
@@ -4752,10 +4880,10 @@ function ProvidersContent({ providers, onSave }) {
4752
4880
  readOnly: !editable
4753
4881
  }
4754
4882
  ),
4755
- editable && /* @__PURE__ */ jsx30(
4883
+ editable && /* @__PURE__ */ jsx31(
4756
4884
  IconButton6,
4757
4885
  {
4758
- icon: /* @__PURE__ */ jsx30(CanvasIcon, { name: "close" }),
4886
+ icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
4759
4887
  "aria-label": "Remove config key",
4760
4888
  size: "md",
4761
4889
  tooltipPlacement: "bottom-end",
@@ -4766,7 +4894,7 @@ function ProvidersContent({ providers, onSave }) {
4766
4894
  }
4767
4895
  )
4768
4896
  ] }, entry.id)),
4769
- editable && /* @__PURE__ */ jsx30(
4897
+ editable && /* @__PURE__ */ jsx31(
4770
4898
  Button9,
4771
4899
  {
4772
4900
  variant: "secondary",
@@ -4778,9 +4906,9 @@ function ProvidersContent({ providers, onSave }) {
4778
4906
  children: "+ Add config key"
4779
4907
  }
4780
4908
  ),
4781
- (row.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs18(Fragment9, { children: [
4782
- /* @__PURE__ */ jsx30("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
4783
- /* @__PURE__ */ jsx30(
4909
+ (row.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs19(Fragment10, { children: [
4910
+ /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
4911
+ /* @__PURE__ */ jsx31(
4784
4912
  BlockEditor,
4785
4913
  {
4786
4914
  blocks: row.blocks,
@@ -4790,21 +4918,21 @@ function ProvidersContent({ providers, onSave }) {
4790
4918
  )
4791
4919
  ] })
4792
4920
  ] }, row.id)),
4793
- editable && /* @__PURE__ */ jsxs18(Fragment9, { children: [
4794
- /* @__PURE__ */ jsx30(Button9, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
4795
- /* @__PURE__ */ jsx30(UpdateButton, { draft, label: "Update providers" })
4921
+ editable && /* @__PURE__ */ jsxs19(Fragment10, { children: [
4922
+ /* @__PURE__ */ jsx31(Button9, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
4923
+ /* @__PURE__ */ jsx31(UpdateButton, { draft, label: "Update providers" })
4796
4924
  ] })
4797
4925
  ] });
4798
4926
  }
4799
4927
  function ProvidersPanel({ providers, onSave, onClose }) {
4800
- return /* @__PURE__ */ jsx30(Panel4, { title: "Providers", onClose, children: /* @__PURE__ */ jsx30(ProvidersContent, { providers, onSave }) });
4928
+ return /* @__PURE__ */ jsx31(Panel4, { title: "Providers", onClose, children: /* @__PURE__ */ jsx31(ProvidersContent, { providers, onSave }) });
4801
4929
  }
4802
4930
 
4803
4931
  // src/components/panels/ResourcesPanel.tsx
4804
4932
  import { Badge as Badge2, Button as Button10, IconButton as IconButton7, Input as Input5, Select as Select2 } from "@lace-cloud/ui";
4805
4933
  import { useState as useState16 } from "react";
4806
4934
  import "./panels-shared-3HUQC7TC.css";
4807
- import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs19 } from "react/jsx-runtime";
4935
+ import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
4808
4936
  function ResourcesContent({
4809
4937
  resources,
4810
4938
  dependencyOptions,
@@ -4814,9 +4942,9 @@ function ResourcesContent({
4814
4942
  onAdd
4815
4943
  }) {
4816
4944
  const { editable } = useCanvas();
4817
- return /* @__PURE__ */ jsxs19(Fragment10, { children: [
4818
- resources.length === 0 && /* @__PURE__ */ jsx31("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
4819
- resources.map((resource) => /* @__PURE__ */ jsx31(
4945
+ return /* @__PURE__ */ jsxs20(Fragment11, { children: [
4946
+ resources.length === 0 && /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
4947
+ resources.map((resource) => /* @__PURE__ */ jsx32(
4820
4948
  ResourceCard,
4821
4949
  {
4822
4950
  resource,
@@ -4829,7 +4957,7 @@ function ResourcesContent({
4829
4957
  },
4830
4958
  resource.id
4831
4959
  )),
4832
- editable && /* @__PURE__ */ jsx31(NewResourceRow, { managed, onAdd })
4960
+ editable && /* @__PURE__ */ jsx32(NewResourceRow, { managed, onAdd })
4833
4961
  ] });
4834
4962
  }
4835
4963
  var MANAGED_OPTION = { value: "resource", label: "Resource" };
@@ -4843,10 +4971,10 @@ function NewResourceRow({
4843
4971
  const kind = managed ? chosen : "data";
4844
4972
  const [type, setType] = useState16("");
4845
4973
  const [name, setName] = useState16("");
4846
- return /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card", children: [
4847
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
4848
- /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions", children: [
4849
- /* @__PURE__ */ jsx31(
4974
+ return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card", children: [
4975
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
4976
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
4977
+ /* @__PURE__ */ jsx32(
4850
4978
  Select2,
4851
4979
  {
4852
4980
  "aria-label": "New resource kind",
@@ -4855,7 +4983,7 @@ function NewResourceRow({
4855
4983
  onChange: (e) => setChosen(e.target.value === "data" ? "data" : "resource")
4856
4984
  }
4857
4985
  ),
4858
- /* @__PURE__ */ jsx31(
4986
+ /* @__PURE__ */ jsx32(
4859
4987
  Input5,
4860
4988
  {
4861
4989
  value: type,
@@ -4865,7 +4993,7 @@ function NewResourceRow({
4865
4993
  mono: true
4866
4994
  }
4867
4995
  ),
4868
- /* @__PURE__ */ jsx31(
4996
+ /* @__PURE__ */ jsx32(
4869
4997
  Input5,
4870
4998
  {
4871
4999
  value: name,
@@ -4875,7 +5003,7 @@ function NewResourceRow({
4875
5003
  mono: true
4876
5004
  }
4877
5005
  ),
4878
- /* @__PURE__ */ jsx31(
5006
+ /* @__PURE__ */ jsx32(
4879
5007
  Button10,
4880
5008
  {
4881
5009
  variant: "secondary",
@@ -4911,20 +5039,20 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4911
5039
  { field: "for_each", placeholder: "e.g. var.names" },
4912
5040
  { field: "provider", placeholder: "e.g. aws.west" }
4913
5041
  ];
4914
- return /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
4915
- /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions", children: [
4916
- /* @__PURE__ */ jsx31(Badge2, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
4917
- /* @__PURE__ */ jsx31(
5042
+ return /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5043
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions", children: [
5044
+ /* @__PURE__ */ jsx32(Badge2, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
5045
+ /* @__PURE__ */ jsx32(
4918
5046
  Identifier,
4919
5047
  {
4920
5048
  className: "lace-panel-row-card__name",
4921
5049
  text: `${resource.type}.${resource.name}`
4922
5050
  }
4923
5051
  ),
4924
- editable && /* @__PURE__ */ jsx31(
5052
+ editable && /* @__PURE__ */ jsx32(
4925
5053
  IconButton7,
4926
5054
  {
4927
- icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
5055
+ icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
4928
5056
  "aria-label": `Remove ${resource.type}.${resource.name}`,
4929
5057
  size: "md",
4930
5058
  tooltipPlacement: "bottom-end",
@@ -4933,7 +5061,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4933
5061
  )
4934
5062
  ] }),
4935
5063
  metaArguments.map(
4936
- ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx31(
5064
+ ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
4937
5065
  Input5,
4938
5066
  {
4939
5067
  label: field,
@@ -4946,11 +5074,11 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4946
5074
  }
4947
5075
  ) }, field) : null
4948
5076
  ),
4949
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
5077
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
4950
5078
  draft.arguments.map((argument, i) => (
4951
5079
  // biome-ignore lint/suspicious/noArrayIndexKey: argument rows are positional while edited
4952
- /* @__PURE__ */ jsxs19("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
4953
- /* @__PURE__ */ jsx31(
5080
+ /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5081
+ /* @__PURE__ */ jsx32(
4954
5082
  Input5,
4955
5083
  {
4956
5084
  value: argument.name,
@@ -4962,7 +5090,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4962
5090
  error: argumentDupes.has(i)
4963
5091
  }
4964
5092
  ),
4965
- /* @__PURE__ */ jsx31(
5093
+ /* @__PURE__ */ jsx32(
4966
5094
  Input5,
4967
5095
  {
4968
5096
  value: argument.value,
@@ -4973,10 +5101,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4973
5101
  readOnly: !editable
4974
5102
  }
4975
5103
  ),
4976
- editable && /* @__PURE__ */ jsx31(
5104
+ editable && /* @__PURE__ */ jsx32(
4977
5105
  IconButton7,
4978
5106
  {
4979
- icon: /* @__PURE__ */ jsx31(CanvasIcon, { name: "close" }),
5107
+ icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
4980
5108
  "aria-label": `Remove ${argument.name || "the argument"}`,
4981
5109
  size: "md",
4982
5110
  tooltipPlacement: "bottom-end",
@@ -4988,7 +5116,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4988
5116
  )
4989
5117
  ] }, i)
4990
5118
  )),
4991
- editable && /* @__PURE__ */ jsx31(
5119
+ editable && /* @__PURE__ */ jsx32(
4992
5120
  Button10,
4993
5121
  {
4994
5122
  variant: "secondary",
@@ -4997,9 +5125,9 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
4997
5125
  children: "+ Add argument"
4998
5126
  }
4999
5127
  ),
5000
- (draft.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs19(Fragment10, { children: [
5001
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5002
- /* @__PURE__ */ jsx31(
5128
+ (draft.blocks.length > 0 || editable) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
5129
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
5130
+ /* @__PURE__ */ jsx32(
5003
5131
  BlockEditor,
5004
5132
  {
5005
5133
  blocks: draft.blocks,
@@ -5008,10 +5136,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
5008
5136
  }
5009
5137
  )
5010
5138
  ] }),
5011
- (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ jsxs19(Fragment10, { children: [
5012
- /* @__PURE__ */ jsx31("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
5013
- !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ jsx31("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx31(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ jsxs19("label", { className: "lace-panel-checkbox-row", children: [
5014
- /* @__PURE__ */ jsx31(
5139
+ (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ jsxs20(Fragment11, { children: [
5140
+ /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
5141
+ !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ jsx32("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx32(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ jsxs20("label", { className: "lace-panel-checkbox-row", children: [
5142
+ /* @__PURE__ */ jsx32(
5015
5143
  "input",
5016
5144
  {
5017
5145
  type: "checkbox",
@@ -5022,10 +5150,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
5022
5150
  )
5023
5151
  }
5024
5152
  ),
5025
- /* @__PURE__ */ jsx31(Identifier, { text: dep })
5153
+ /* @__PURE__ */ jsx32(Identifier, { text: dep })
5026
5154
  ] }, dep))
5027
5155
  ] }),
5028
- editable && /* @__PURE__ */ jsx31(
5156
+ editable && /* @__PURE__ */ jsx32(
5029
5157
  UpdateButton,
5030
5158
  {
5031
5159
  draft: card,
@@ -5039,7 +5167,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
5039
5167
  // src/components/panels/TerraformConfigPanel.tsx
5040
5168
  import { Button as Button11, IconButton as IconButton8, Input as Input6, Panel as Panel5 } from "@lace-cloud/ui";
5041
5169
  import "./panels-shared-3HUQC7TC.css";
5042
- import { Fragment as Fragment11, jsx as jsx32, jsxs as jsxs20 } from "react/jsx-runtime";
5170
+ import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
5043
5171
  function toRows3(terraform) {
5044
5172
  return (terraform?.required_providers ?? []).map((req) => ({
5045
5173
  id: req.name,
@@ -5071,9 +5199,9 @@ function TerraformConfigContent({ terraform, onSave }) {
5071
5199
  const { requiredVersion, providers } = draft.value;
5072
5200
  const setProviders2 = (next) => draft.set("providers", next);
5073
5201
  const updateProvider = (index, field, value) => setProviders2(providers.map((p, i) => i === index ? { ...p, [field]: value } : p));
5074
- return /* @__PURE__ */ jsxs20(Fragment11, { children: [
5075
- /* @__PURE__ */ jsx32("h4", { className: "lace-panel-section-title", children: "Required Version" }),
5076
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx32(
5202
+ return /* @__PURE__ */ jsxs21(Fragment12, { children: [
5203
+ /* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Required Version" }),
5204
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-field", children: /* @__PURE__ */ jsx33(
5077
5205
  Input6,
5078
5206
  {
5079
5207
  value: requiredVersion,
@@ -5083,10 +5211,10 @@ function TerraformConfigContent({ terraform, onSave }) {
5083
5211
  readOnly: !editable
5084
5212
  }
5085
5213
  ) }),
5086
- /* @__PURE__ */ jsx32("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
5087
- providers.map((p, i) => /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5088
- /* @__PURE__ */ jsxs20("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5089
- /* @__PURE__ */ jsx32(
5214
+ /* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
5215
+ providers.map((p, i) => /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
5216
+ /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--field", children: [
5217
+ /* @__PURE__ */ jsx33(
5090
5218
  Input6,
5091
5219
  {
5092
5220
  value: p.name,
@@ -5096,10 +5224,10 @@ function TerraformConfigContent({ terraform, onSave }) {
5096
5224
  readOnly: !editable
5097
5225
  }
5098
5226
  ),
5099
- editable && /* @__PURE__ */ jsx32(
5227
+ editable && /* @__PURE__ */ jsx33(
5100
5228
  IconButton8,
5101
5229
  {
5102
- icon: /* @__PURE__ */ jsx32(CanvasIcon, { name: "close" }),
5230
+ icon: /* @__PURE__ */ jsx33(CanvasIcon, { name: "close" }),
5103
5231
  "aria-label": "Remove provider",
5104
5232
  size: "md",
5105
5233
  tooltipPlacement: "bottom-end",
@@ -5107,7 +5235,7 @@ function TerraformConfigContent({ terraform, onSave }) {
5107
5235
  }
5108
5236
  )
5109
5237
  ] }),
5110
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
5238
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
5111
5239
  Input6,
5112
5240
  {
5113
5241
  value: p.source,
@@ -5117,7 +5245,7 @@ function TerraformConfigContent({ terraform, onSave }) {
5117
5245
  readOnly: !editable
5118
5246
  }
5119
5247
  ) }),
5120
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
5248
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
5121
5249
  Input6,
5122
5250
  {
5123
5251
  value: p.version,
@@ -5127,7 +5255,7 @@ function TerraformConfigContent({ terraform, onSave }) {
5127
5255
  readOnly: !editable
5128
5256
  }
5129
5257
  ) }),
5130
- (p.aliases || editable) && /* @__PURE__ */ jsx32("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx32(
5258
+ (p.aliases || editable) && /* @__PURE__ */ jsx33("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ jsx33(
5131
5259
  Input6,
5132
5260
  {
5133
5261
  value: p.aliases,
@@ -5140,7 +5268,7 @@ function TerraformConfigContent({ terraform, onSave }) {
5140
5268
  }
5141
5269
  ) })
5142
5270
  ] }, p.id)),
5143
- editable && /* @__PURE__ */ jsx32(
5271
+ editable && /* @__PURE__ */ jsx33(
5144
5272
  Button11,
5145
5273
  {
5146
5274
  variant: "secondary",
@@ -5152,17 +5280,17 @@ function TerraformConfigContent({ terraform, onSave }) {
5152
5280
  children: "+ Add provider"
5153
5281
  }
5154
5282
  ),
5155
- /* @__PURE__ */ jsx32("h4", { className: "lace-panel-section-title", children: "Backend" }),
5156
- /* @__PURE__ */ jsx32("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
5157
- editable && /* @__PURE__ */ jsx32(UpdateButton, { draft, label: "Update terraform block" })
5283
+ /* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Backend" }),
5284
+ /* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
5285
+ editable && /* @__PURE__ */ jsx33(UpdateButton, { draft, label: "Update terraform block" })
5158
5286
  ] });
5159
5287
  }
5160
5288
  function TerraformConfigPanel({ terraform, onSave, onClose }) {
5161
- return /* @__PURE__ */ jsx32(Panel5, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx32(TerraformConfigContent, { terraform, onSave }) });
5289
+ return /* @__PURE__ */ jsx33(Panel5, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ jsx33(TerraformConfigContent, { terraform, onSave }) });
5162
5290
  }
5163
5291
 
5164
5292
  // src/components/panels/ModuleDetails.tsx
5165
- import { Fragment as Fragment12, jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
5293
+ import { Fragment as Fragment13, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
5166
5294
  function assertApplied(result) {
5167
5295
  if (!result?.success) throw new Error("apply failed");
5168
5296
  }
@@ -5171,18 +5299,18 @@ function ModuleDetails({ moduleKey, open = [] }) {
5171
5299
  const { bundle, runner } = useCanvas();
5172
5300
  const settings = useMemo10(() => deriveSettingsConfig(bundle, moduleKey), [bundle, moduleKey]);
5173
5301
  if (!settings) return null;
5174
- if (settings.reference) return /* @__PURE__ */ jsx33(ReferenceDetails, { settings });
5302
+ if (settings.reference) return /* @__PURE__ */ jsx34(ReferenceDetails, { settings });
5175
5303
  const apply = async (actions) => {
5176
5304
  assertApplied(await runner.apply(actions));
5177
5305
  };
5178
- return /* @__PURE__ */ jsxs21(Fragment12, { children: [
5179
- /* @__PURE__ */ jsx33(
5306
+ return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5307
+ /* @__PURE__ */ jsx34(
5180
5308
  AccordionSection,
5181
5309
  {
5182
5310
  title: "Resources",
5183
5311
  defaultOpen: open.includes("Resources"),
5184
5312
  badge: `(${settings.resources.length})`,
5185
- children: /* @__PURE__ */ jsx33(
5313
+ children: /* @__PURE__ */ jsx34(
5186
5314
  ResourcesContent,
5187
5315
  {
5188
5316
  resources: settings.resources,
@@ -5196,7 +5324,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5196
5324
  )
5197
5325
  }
5198
5326
  ),
5199
- /* @__PURE__ */ jsx33(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ jsx33(
5327
+ /* @__PURE__ */ jsx34(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ jsx34(
5200
5328
  ModuleInterfaceContent,
5201
5329
  {
5202
5330
  settings,
@@ -5204,13 +5332,13 @@ function ModuleDetails({ moduleKey, open = [] }) {
5204
5332
  },
5205
5333
  sectionKey(moduleKey, "Interface")
5206
5334
  ) }),
5207
- /* @__PURE__ */ jsx33(
5335
+ /* @__PURE__ */ jsx34(
5208
5336
  AccordionSection,
5209
5337
  {
5210
5338
  title: "Moved and import blocks",
5211
5339
  defaultOpen: open.includes("Moved and import blocks"),
5212
5340
  badge: settings.directives.length > 0 ? `(${settings.directives.length})` : void 0,
5213
- children: /* @__PURE__ */ jsx33(
5341
+ children: /* @__PURE__ */ jsx34(
5214
5342
  DirectivesContent,
5215
5343
  {
5216
5344
  directives: settings.directives,
@@ -5220,7 +5348,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5220
5348
  )
5221
5349
  }
5222
5350
  ),
5223
- /* @__PURE__ */ jsx33(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ jsx33(
5351
+ /* @__PURE__ */ jsx34(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ jsx34(
5224
5352
  LocalsContent,
5225
5353
  {
5226
5354
  locals: settings.locals,
@@ -5228,7 +5356,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5228
5356
  },
5229
5357
  sectionKey(moduleKey, "Locals")
5230
5358
  ) }),
5231
- /* @__PURE__ */ jsx33(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ jsx33(
5359
+ /* @__PURE__ */ jsx34(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ jsx34(
5232
5360
  ProvidersContent,
5233
5361
  {
5234
5362
  providers: settings.providers,
@@ -5236,7 +5364,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
5236
5364
  },
5237
5365
  sectionKey(moduleKey, "Providers")
5238
5366
  ) }),
5239
- /* @__PURE__ */ jsx33(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ jsx33(
5367
+ /* @__PURE__ */ jsx34(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ jsx34(
5240
5368
  TerraformConfigContent,
5241
5369
  {
5242
5370
  terraform: settings.terraform,
@@ -5253,9 +5381,9 @@ function DirectivesContent({
5253
5381
  const { editable } = useCanvas();
5254
5382
  const draft = useDraft({ blocks: directives }, ({ blocks: blocks2 }) => onSave(blocks2));
5255
5383
  const { blocks } = draft.value;
5256
- return /* @__PURE__ */ jsxs21(Fragment12, { children: [
5257
- blocks.length === 0 && /* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
5258
- /* @__PURE__ */ jsx33(
5384
+ return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5385
+ blocks.length === 0 && /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
5386
+ /* @__PURE__ */ jsx34(
5259
5387
  BlockEditor,
5260
5388
  {
5261
5389
  blocks,
@@ -5267,32 +5395,32 @@ function DirectivesContent({
5267
5395
  ]
5268
5396
  }
5269
5397
  ),
5270
- editable && /* @__PURE__ */ jsx33(UpdateButton, { draft, label: "Update moved and import blocks" })
5398
+ editable && /* @__PURE__ */ jsx34(UpdateButton, { draft, label: "Update moved and import blocks" })
5271
5399
  ] });
5272
5400
  }
5273
5401
  function ReferenceDetails({ settings }) {
5274
5402
  const reference = settings.reference;
5275
5403
  if (!reference) return null;
5276
- return /* @__PURE__ */ jsxs21(Fragment12, { children: [
5277
- /* @__PURE__ */ jsxs21(AccordionSection, { title: "Source", defaultOpen: true, children: [
5278
- /* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
5279
- /* @__PURE__ */ jsxs21("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
5280
- /* @__PURE__ */ jsx33(Input7, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
5281
- /* @__PURE__ */ jsx33(Input7, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
5404
+ return /* @__PURE__ */ jsxs22(Fragment13, { children: [
5405
+ /* @__PURE__ */ jsxs22(AccordionSection, { title: "Source", defaultOpen: true, children: [
5406
+ /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
5407
+ /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
5408
+ /* @__PURE__ */ jsx34(Input7, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
5409
+ /* @__PURE__ */ jsx34(Input7, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
5282
5410
  ] })
5283
5411
  ] }),
5284
- /* @__PURE__ */ jsxs21(AccordionSection, { title: "Interface", defaultOpen: true, children: [
5285
- /* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Inputs" }),
5286
- settings.variables.length === 0 && /* @__PURE__ */ jsx33("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
5287
- settings.variables.map((v) => /* @__PURE__ */ jsx33("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx33(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
5288
- /* @__PURE__ */ jsx33("h4", { className: "lace-panel-section-title", children: "Outputs" }),
5289
- settings.outputs.map((o) => /* @__PURE__ */ jsx33("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx33(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
5412
+ /* @__PURE__ */ jsxs22(AccordionSection, { title: "Interface", defaultOpen: true, children: [
5413
+ /* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Inputs" }),
5414
+ settings.variables.length === 0 && /* @__PURE__ */ jsx34("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
5415
+ settings.variables.map((v) => /* @__PURE__ */ jsx34("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx34(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
5416
+ /* @__PURE__ */ jsx34("h4", { className: "lace-panel-section-title", children: "Outputs" }),
5417
+ settings.outputs.map((o) => /* @__PURE__ */ jsx34("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ jsx34(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
5290
5418
  ] })
5291
5419
  ] });
5292
5420
  }
5293
5421
 
5294
5422
  // src/components/panels/ModuleConfigPanel.tsx
5295
- import { Fragment as Fragment13, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
5423
+ import { Fragment as Fragment14, jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
5296
5424
  var MODE_ITEMS = [
5297
5425
  { value: "empty", label: "Unset" },
5298
5426
  { value: "literal", label: "Lit" },
@@ -5437,7 +5565,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5437
5565
  ...m,
5438
5566
  disabled: !editable || m.value === "wired" || currentMode === "wired"
5439
5567
  }));
5440
- return /* @__PURE__ */ jsx34(
5568
+ return /* @__PURE__ */ jsx35(
5441
5569
  ModeToggle,
5442
5570
  {
5443
5571
  value: currentMode,
@@ -5449,29 +5577,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5449
5577
  }
5450
5578
  function renderInputField(input) {
5451
5579
  const currentMode = binding(input)?.mode ?? input.mode;
5452
- return /* @__PURE__ */ jsxs22("div", { className: "lace-panel-field", children: [
5453
- /* @__PURE__ */ jsxs22("label", { className: "lace-panel-row-label", children: [
5454
- /* @__PURE__ */ jsx34(Identifier, { text: input.name }),
5455
- input.required && /* @__PURE__ */ jsx34("span", { className: "lace-mcp__required-star", children: "*" })
5580
+ return /* @__PURE__ */ jsxs23("div", { className: "lace-panel-field", children: [
5581
+ /* @__PURE__ */ jsxs23("label", { className: "lace-panel-row-label", children: [
5582
+ /* @__PURE__ */ jsx35(Identifier, { text: input.name }),
5583
+ input.required && /* @__PURE__ */ jsx35("span", { className: "lace-mcp__required-star", children: "*" })
5456
5584
  ] }),
5457
5585
  renderModeSelector(input),
5458
- /* @__PURE__ */ jsxs22("div", { className: "lace-panel-row-content", children: [
5586
+ /* @__PURE__ */ jsxs23("div", { className: "lace-panel-row-content", children: [
5459
5587
  currentMode === "wired" && renderWiredEditor(input),
5460
5588
  currentMode === "variable" && renderVariableEditor(input),
5461
5589
  currentMode === "expression" && renderExpressionEditor(input),
5462
5590
  currentMode === "literal" && renderLiteralEditor(input)
5463
5591
  ] }),
5464
- input.description && /* @__PURE__ */ jsx34("div", { className: "lace-panel-field__description", children: input.description })
5592
+ input.description && /* @__PURE__ */ jsx35("div", { className: "lace-panel-field__description", children: input.description })
5465
5593
  ] }, input.name);
5466
5594
  }
5467
5595
  function renderWiredEditor(input) {
5468
5596
  const label = input.wired_source ?? "Not wired";
5469
- return /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__wired-row", children: [
5470
- /* @__PURE__ */ jsx34("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx34(Input8, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
5471
- editable && /* @__PURE__ */ jsx34(
5597
+ return /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__wired-row", children: [
5598
+ /* @__PURE__ */ jsx35("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ jsx35(Input8, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
5599
+ editable && /* @__PURE__ */ jsx35(
5472
5600
  IconButton9,
5473
5601
  {
5474
- icon: /* @__PURE__ */ jsx34(CanvasIcon, { name: "close" }),
5602
+ icon: /* @__PURE__ */ jsx35(CanvasIcon, { name: "close" }),
5475
5603
  "aria-label": "Disconnect this input",
5476
5604
  size: "md",
5477
5605
  tooltipPlacement: "bottom-end",
@@ -5481,7 +5609,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5481
5609
  ] });
5482
5610
  }
5483
5611
  function renderVariableEditor(input) {
5484
- return /* @__PURE__ */ jsx34(
5612
+ return /* @__PURE__ */ jsx35(
5485
5613
  Input8,
5486
5614
  {
5487
5615
  value: binding(input)?.variable ?? "",
@@ -5497,7 +5625,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5497
5625
  );
5498
5626
  }
5499
5627
  function renderExpressionEditor(input) {
5500
- return /* @__PURE__ */ jsx34(
5628
+ return /* @__PURE__ */ jsx35(
5501
5629
  Textarea3,
5502
5630
  {
5503
5631
  value: binding(input)?.expression ?? "",
@@ -5515,7 +5643,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5515
5643
  const kind = literalKind(input.type);
5516
5644
  const updateValue = (next) => setBinding(input, { value: next });
5517
5645
  if (kind === "bool") {
5518
- return /* @__PURE__ */ jsxs22(
5646
+ return /* @__PURE__ */ jsxs23(
5519
5647
  "select",
5520
5648
  {
5521
5649
  className: "lace-mcp__select",
@@ -5523,14 +5651,14 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5523
5651
  onChange: (e) => updateValue(e.target.value === "true"),
5524
5652
  disabled: !editable,
5525
5653
  children: [
5526
- /* @__PURE__ */ jsx34("option", { value: "true", children: "True" }),
5527
- /* @__PURE__ */ jsx34("option", { value: "false", children: "False" })
5654
+ /* @__PURE__ */ jsx35("option", { value: "true", children: "True" }),
5655
+ /* @__PURE__ */ jsx35("option", { value: "false", children: "False" })
5528
5656
  ]
5529
5657
  }
5530
5658
  );
5531
5659
  }
5532
5660
  if (kind === "number") {
5533
- return /* @__PURE__ */ jsx34(
5661
+ return /* @__PURE__ */ jsx35(
5534
5662
  Input8,
5535
5663
  {
5536
5664
  type: "number",
@@ -5543,7 +5671,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5543
5671
  }
5544
5672
  if (kind === "collection") {
5545
5673
  const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
5546
- return /* @__PURE__ */ jsx34(
5674
+ return /* @__PURE__ */ jsx35(
5547
5675
  Textarea3,
5548
5676
  {
5549
5677
  value: jsonStr,
@@ -5561,7 +5689,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5561
5689
  }
5562
5690
  );
5563
5691
  }
5564
- return /* @__PURE__ */ jsx34(
5692
+ return /* @__PURE__ */ jsx35(
5565
5693
  Input8,
5566
5694
  {
5567
5695
  value: String(value ?? ""),
@@ -5578,34 +5706,34 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5578
5706
  );
5579
5707
  }
5580
5708
  if (!config) {
5581
- return /* @__PURE__ */ jsxs22(Panel6, { title: "Error", onClose, children: [
5582
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__error-title", children: [
5709
+ return /* @__PURE__ */ jsxs23(Panel6, { title: "Error", onClose, children: [
5710
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__error-title", children: [
5583
5711
  'Failed to load configuration for "',
5584
5712
  instance_id,
5585
5713
  '":'
5586
5714
  ] }),
5587
- /* @__PURE__ */ jsx34("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
5715
+ /* @__PURE__ */ jsx35("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
5588
5716
  ] });
5589
5717
  }
5590
5718
  const dependsOn = fields.depends_on;
5591
5719
  const setProviders2 = (next) => draft.set("providers", next);
5592
- const title = /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__title", children: [
5593
- /* @__PURE__ */ jsx34("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
5594
- /* @__PURE__ */ jsx34("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ jsx34(Identifier, { text: instance_id }) })
5720
+ const title = /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__title", children: [
5721
+ /* @__PURE__ */ jsx35("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
5722
+ /* @__PURE__ */ jsx35("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ jsx35(Identifier, { text: instance_id }) })
5595
5723
  ] });
5596
- const footer = editable ? /* @__PURE__ */ jsx34(UpdateButton, { draft, label: "Update configuration" }) : void 0;
5597
- return /* @__PURE__ */ jsxs22(Panel6, { title, footer, flush: true, onClose, children: [
5598
- requiredInputs.length > 0 && /* @__PURE__ */ jsx34(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
5599
- optionalInputs.length > 0 && /* @__PURE__ */ jsx34(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
5600
- config.dependency_options.length > 0 && /* @__PURE__ */ jsxs22(
5724
+ const footer = editable ? /* @__PURE__ */ jsx35(UpdateButton, { draft, label: "Update configuration" }) : void 0;
5725
+ return /* @__PURE__ */ jsxs23(Panel6, { title, footer, flush: true, onClose, children: [
5726
+ requiredInputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
5727
+ optionalInputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
5728
+ config.dependency_options.length > 0 && /* @__PURE__ */ jsxs23(
5601
5729
  AccordionSection,
5602
5730
  {
5603
5731
  title: "Depends On",
5604
5732
  badge: dependsOn.length > 0 ? `(${dependsOn.length})` : void 0,
5605
5733
  children: [
5606
- /* @__PURE__ */ jsx34("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
5607
- config.dependency_options.map((option) => /* @__PURE__ */ jsxs22("label", { className: "lace-mcp__depends-item", children: [
5608
- /* @__PURE__ */ jsx34(
5734
+ /* @__PURE__ */ jsx35("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
5735
+ config.dependency_options.map((option) => /* @__PURE__ */ jsxs23("label", { className: "lace-mcp__depends-item", children: [
5736
+ /* @__PURE__ */ jsx35(
5609
5737
  "input",
5610
5738
  {
5611
5739
  type: "checkbox",
@@ -5618,29 +5746,29 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5618
5746
  )
5619
5747
  }
5620
5748
  ),
5621
- /* @__PURE__ */ jsx34(Identifier, { className: "lace-mcp__depends-label", text: option })
5749
+ /* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__depends-label", text: option })
5622
5750
  ] }, option))
5623
5751
  ]
5624
5752
  }
5625
5753
  ),
5626
- (fields.providers.length > 0 || editable) && /* @__PURE__ */ jsxs22(
5754
+ (fields.providers.length > 0 || editable) && /* @__PURE__ */ jsxs23(
5627
5755
  AccordionSection,
5628
5756
  {
5629
5757
  title: "Providers",
5630
5758
  badge: fields.providers.length > 0 ? `(${fields.providers.length})` : void 0,
5631
5759
  children: [
5632
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__depends-hint", children: [
5760
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
5633
5761
  "Map each child-local provider name to the root provider reference passed down (e.g.",
5634
5762
  " ",
5635
- /* @__PURE__ */ jsx34("code", { children: "aws" }),
5763
+ /* @__PURE__ */ jsx35("code", { children: "aws" }),
5636
5764
  " \u2192 ",
5637
- /* @__PURE__ */ jsx34("code", { children: "aws.west" }),
5765
+ /* @__PURE__ */ jsx35("code", { children: "aws.west" }),
5638
5766
  ")."
5639
5767
  ] }),
5640
5768
  fields.providers.map((row, i) => (
5641
5769
  // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
5642
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__provider-row", children: [
5643
- /* @__PURE__ */ jsx34(
5770
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__provider-row", children: [
5771
+ /* @__PURE__ */ jsx35(
5644
5772
  Input8,
5645
5773
  {
5646
5774
  value: row.key,
@@ -5652,8 +5780,8 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5652
5780
  readOnly: !editable
5653
5781
  }
5654
5782
  ),
5655
- /* @__PURE__ */ jsx34("span", { className: "lace-mcp__provider-arrow", children: "=" }),
5656
- /* @__PURE__ */ jsx34(
5783
+ /* @__PURE__ */ jsx35("span", { className: "lace-mcp__provider-arrow", children: "=" }),
5784
+ /* @__PURE__ */ jsx35(
5657
5785
  Input8,
5658
5786
  {
5659
5787
  value: row.value,
@@ -5665,10 +5793,10 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5665
5793
  readOnly: !editable
5666
5794
  }
5667
5795
  ),
5668
- editable && /* @__PURE__ */ jsx34(
5796
+ editable && /* @__PURE__ */ jsx35(
5669
5797
  IconButton9,
5670
5798
  {
5671
- icon: /* @__PURE__ */ jsx34(CanvasIcon, { name: "close" }),
5799
+ icon: /* @__PURE__ */ jsx35(CanvasIcon, { name: "close" }),
5672
5800
  "aria-label": "Remove this provider mapping",
5673
5801
  size: "md",
5674
5802
  tooltipPlacement: "bottom-end",
@@ -5677,7 +5805,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5677
5805
  )
5678
5806
  ] }, i)
5679
5807
  )),
5680
- editable && /* @__PURE__ */ jsx34(
5808
+ editable && /* @__PURE__ */ jsx35(
5681
5809
  Button12,
5682
5810
  {
5683
5811
  variant: "secondary",
@@ -5689,15 +5817,15 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5689
5817
  ]
5690
5818
  }
5691
5819
  ),
5692
- (fields.count || fields.for_each || editable) && /* @__PURE__ */ jsxs22(AccordionSection, { title: "Repetition", children: [
5693
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__depends-hint", children: [
5820
+ (fields.count || fields.for_each || editable) && /* @__PURE__ */ jsxs23(AccordionSection, { title: "Repetition", children: [
5821
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__depends-hint", children: [
5694
5822
  "The call's ",
5695
- /* @__PURE__ */ jsx34("code", { children: "count" }),
5823
+ /* @__PURE__ */ jsx35("code", { children: "count" }),
5696
5824
  " or ",
5697
- /* @__PURE__ */ jsx34("code", { children: "for_each" }),
5825
+ /* @__PURE__ */ jsx35("code", { children: "for_each" }),
5698
5826
  ": one module, called once per instance."
5699
5827
  ] }),
5700
- /* @__PURE__ */ jsx34(
5828
+ /* @__PURE__ */ jsx35(
5701
5829
  Input8,
5702
5830
  {
5703
5831
  label: "count",
@@ -5709,7 +5837,7 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5709
5837
  readOnly: !editable
5710
5838
  }
5711
5839
  ),
5712
- /* @__PURE__ */ jsx34(
5840
+ /* @__PURE__ */ jsx35(
5713
5841
  Input8,
5714
5842
  {
5715
5843
  label: "for_each",
@@ -5722,26 +5850,26 @@ function ModuleConfigPanel({ instance_id, onClose }) {
5722
5850
  }
5723
5851
  )
5724
5852
  ] }),
5725
- config.outputs.length > 0 && /* @__PURE__ */ jsx34(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__output-card", children: [
5726
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__output-header", children: [
5727
- /* @__PURE__ */ jsx34(Identifier, { className: "lace-mcp__output-name", text: o.name }),
5728
- /* @__PURE__ */ jsx34(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
5853
+ config.outputs.length > 0 && /* @__PURE__ */ jsx35(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-card", children: [
5854
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__output-header", children: [
5855
+ /* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__output-name", text: o.name }),
5856
+ /* @__PURE__ */ jsx35(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
5729
5857
  ] }),
5730
- o.description && /* @__PURE__ */ jsx34("div", { className: "lace-mcp__output-description", children: o.description }),
5731
- o.sensitive && /* @__PURE__ */ jsx34("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
5858
+ o.description && /* @__PURE__ */ jsx35("div", { className: "lace-mcp__output-description", children: o.description }),
5859
+ o.sensitive && /* @__PURE__ */ jsx35("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
5732
5860
  ] }, o.name)) }),
5733
- config.module_key && /* @__PURE__ */ jsxs22(Fragment13, { children: [
5734
- /* @__PURE__ */ jsxs22("div", { className: "lace-mcp__module-heading", children: [
5735
- /* @__PURE__ */ jsx34("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
5736
- /* @__PURE__ */ jsxs22("div", { children: [
5737
- /* @__PURE__ */ jsx34(Identifier, { text: config.module_key }),
5738
- config.source && /* @__PURE__ */ jsxs22("span", { className: "lace-mcp__module-source", children: [
5861
+ config.module_key && /* @__PURE__ */ jsxs23(Fragment14, { children: [
5862
+ /* @__PURE__ */ jsxs23("div", { className: "lace-mcp__module-heading", children: [
5863
+ /* @__PURE__ */ jsx35("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
5864
+ /* @__PURE__ */ jsxs23("div", { children: [
5865
+ /* @__PURE__ */ jsx35(Identifier, { text: config.module_key }),
5866
+ config.source && /* @__PURE__ */ jsxs23("span", { className: "lace-mcp__module-source", children: [
5739
5867
  " \xB7 ",
5740
- /* @__PURE__ */ jsx34(Identifier, { text: config.source })
5868
+ /* @__PURE__ */ jsx35(Identifier, { text: config.source })
5741
5869
  ] })
5742
5870
  ] })
5743
5871
  ] }),
5744
- /* @__PURE__ */ jsx34(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
5872
+ /* @__PURE__ */ jsx35(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
5745
5873
  ] })
5746
5874
  ] });
5747
5875
  }
@@ -5767,11 +5895,11 @@ var moduleConfigPanel = {
5767
5895
  };
5768
5896
 
5769
5897
  // src/core/panels/SourceRefusedBanner.tsx
5770
- import { jsx as jsx35 } from "react/jsx-runtime";
5898
+ import { jsx as jsx36 } from "react/jsx-runtime";
5771
5899
  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.";
5772
5900
  var OUT_OF_LACE_SHAPE = "This Terraform is not in lace shape yet, so the canvas shows it read-only.";
5773
5901
  function SourceRefusedBanner({ ctx }) {
5774
- return /* @__PURE__ */ jsx35(
5902
+ return /* @__PURE__ */ jsx36(
5775
5903
  RowActionBanner,
5776
5904
  {
5777
5905
  ctx,
@@ -5798,10 +5926,10 @@ import { createElement as createElement3 } from "react";
5798
5926
  // src/components/panels/UnifiedSettingsPanel.tsx
5799
5927
  import { Panel as Panel7 } from "@lace-cloud/ui";
5800
5928
  import "./panels-shared-3HUQC7TC.css";
5801
- import { jsx as jsx36 } from "react/jsx-runtime";
5929
+ import { jsx as jsx37 } from "react/jsx-runtime";
5802
5930
  function UnifiedSettingsPanel({ onClose }) {
5803
5931
  const { bundle } = useCanvas();
5804
- return /* @__PURE__ */ jsx36(Panel7, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ jsx36(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
5932
+ return /* @__PURE__ */ jsx37(Panel7, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ jsx37(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
5805
5933
  }
5806
5934
 
5807
5935
  // src/core/panels/settings.ts
@@ -5858,10 +5986,10 @@ var CORE_CONTRIBUTIONS = {
5858
5986
  };
5859
5987
 
5860
5988
  // src/core/use-editing.ts
5861
- import { useEffect as useEffect11, useState as useState17 } from "react";
5989
+ import { useEffect as useEffect12, useState as useState17 } from "react";
5862
5990
  function useEditing(runner) {
5863
5991
  const [editing, setEditing] = useState17(() => runner.editing());
5864
- useEffect11(() => {
5992
+ useEffect12(() => {
5865
5993
  setEditing(runner.editing());
5866
5994
  return runner.onEditingChange(setEditing);
5867
5995
  }, [runner]);
@@ -5869,7 +5997,7 @@ function useEditing(runner) {
5869
5997
  }
5870
5998
 
5871
5999
  // src/App.tsx
5872
- import { jsx as jsx37, jsxs as jsxs23 } from "react/jsx-runtime";
6000
+ import { jsx as jsx38, jsxs as jsxs24 } from "react/jsx-runtime";
5873
6001
  var EMPTY_CONTRIBUTIONS = { overlays: [], panels: [], actions: [] };
5874
6002
  var NO_TARGET = {};
5875
6003
  function OverlayRunner({
@@ -5888,7 +6016,7 @@ function OverlayRunner({
5888
6016
  },
5889
6017
  [ctx.ports.presenter]
5890
6018
  );
5891
- return /* @__PURE__ */ jsx37(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ jsx37(OverlayDecorations, { overlay, ctx, onDecorations }) });
6019
+ return /* @__PURE__ */ jsx38(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ jsx38(OverlayDecorations, { overlay, ctx, onDecorations }) });
5892
6020
  }
5893
6021
  function OverlayDecorations({
5894
6022
  overlay,
@@ -5896,10 +6024,10 @@ function OverlayDecorations({
5896
6024
  onDecorations
5897
6025
  }) {
5898
6026
  const decorations = overlay.useDecorations(ctx);
5899
- useEffect12(() => {
6027
+ useEffect13(() => {
5900
6028
  onDecorations(overlay.id, decorations);
5901
6029
  }, [overlay.id, decorations, onDecorations]);
5902
- useEffect12(() => () => onDecorations(overlay.id, null), [overlay.id, onDecorations]);
6030
+ useEffect13(() => () => onDecorations(overlay.id, null), [overlay.id, onDecorations]);
5903
6031
  return null;
5904
6032
  }
5905
6033
  function PanelSlot({ panel, ctx, tick }) {
@@ -5917,7 +6045,7 @@ function PanelSlot({ panel, ctx, tick }) {
5917
6045
  return next;
5918
6046
  });
5919
6047
  }, []);
5920
- return /* @__PURE__ */ jsxs23(
6048
+ return /* @__PURE__ */ jsxs24(
5921
6049
  PanelScope,
5922
6050
  {
5923
6051
  ctx,
@@ -5925,13 +6053,13 @@ function PanelSlot({ panel, ctx, tick }) {
5925
6053
  tick,
5926
6054
  onReadError,
5927
6055
  children: [
5928
- [...readErrors].map(([path, error]) => /* @__PURE__ */ jsxs23("p", { className: "lace-app__panel-error", children: [
6056
+ [...readErrors].map(([path, error]) => /* @__PURE__ */ jsxs24("p", { className: "lace-app__panel-error", children: [
5929
6057
  "Couldn't load ",
5930
6058
  path,
5931
6059
  ": ",
5932
6060
  error.message
5933
6061
  ] }, path)),
5934
- /* @__PURE__ */ jsx37(panel.Component, { ctx })
6062
+ /* @__PURE__ */ jsx38(panel.Component, { ctx })
5935
6063
  ]
5936
6064
  }
5937
6065
  );
@@ -5945,8 +6073,8 @@ function BottomTabs({
5945
6073
  const manual = manualId !== null ? panels.find((p) => p.id === manualId) : void 0;
5946
6074
  const active = manual ?? panels[0] ?? null;
5947
6075
  if (panels.length === 0) return null;
5948
- return /* @__PURE__ */ jsxs23("div", { className: "lace-app__bottom", children: [
5949
- /* @__PURE__ */ jsx37("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ jsx37(
6076
+ return /* @__PURE__ */ jsxs24("div", { className: "lace-app__bottom", children: [
6077
+ /* @__PURE__ */ jsx38("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ jsx38(
5950
6078
  "button",
5951
6079
  {
5952
6080
  type: "button",
@@ -5958,7 +6086,7 @@ function BottomTabs({
5958
6086
  },
5959
6087
  panel.id
5960
6088
  )) }),
5961
- /* @__PURE__ */ jsx37("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ jsx37(PanelSlot, { panel: active, ctx, tick }) })
6089
+ /* @__PURE__ */ jsx38("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ jsx38(PanelSlot, { panel: active, ctx, tick }) })
5962
6090
  ] });
5963
6091
  }
5964
6092
  function endMessage(end) {
@@ -6003,7 +6131,7 @@ function App({
6003
6131
  }),
6004
6132
  [commands, presenter, editor, results]
6005
6133
  );
6006
- useEffect12(() => {
6134
+ useEffect13(() => {
6007
6135
  return () => {
6008
6136
  runner.dispose();
6009
6137
  };
@@ -6017,9 +6145,9 @@ function App({
6017
6145
  },
6018
6146
  [ports.viewState]
6019
6147
  );
6020
- const gcSeenBundle = useRef12(null);
6021
- if (source && gcSeenBundle.current !== source.bundle) {
6022
- gcSeenBundle.current = source.bundle;
6148
+ const pruned = useRef12(false);
6149
+ if (source && !pruned.current) {
6150
+ pruned.current = true;
6023
6151
  const gced = gcArrangement(source.bundle, arrangement);
6024
6152
  if (gced !== arrangement) {
6025
6153
  queueMicrotask(() => {
@@ -6105,15 +6233,17 @@ function App({
6105
6233
  resolved.panels.filter((panel) => panel.slot === "toolbar")
6106
6234
  );
6107
6235
  const rootRef = useRef12(null);
6108
- useEffect12(() => {
6236
+ useEffect13(() => {
6109
6237
  if (!ctx) return;
6110
6238
  registerKeyTarget(ctx, "app", rootRef.current);
6111
6239
  return () => registerKeyTarget(ctx, "app", null);
6112
6240
  }, [ctx]);
6113
- useFocusWhenNoneHeld(rootRef, Boolean(ctx && view && source && envExtras));
6241
+ const rootMounted = Boolean(ctx && view && source && envExtras);
6242
+ useFocusWhenNoneHeld(rootRef, rootMounted);
6243
+ useFocusKeptOnRemoval(rootRef, rootMounted);
6114
6244
  useActionKeys(ctx && envExtras ? resolved.actions : [], ctx, runner, envExtras);
6115
6245
  if (!ctx || !view || !source || !envExtras) {
6116
- return end ? /* @__PURE__ */ jsx37(ErrorState, { message: endMessage(end) }) : null;
6246
+ return end ? /* @__PURE__ */ jsx38(ErrorState, { message: endMessage(end) }) : null;
6117
6247
  }
6118
6248
  const contextValue = {
6119
6249
  ports,
@@ -6134,8 +6264,8 @@ function App({
6134
6264
  const bannerPanels = resolved.panels.filter((panel) => panel.slot === "banner");
6135
6265
  const bottomPanels = resolved.panels.filter((panel) => panel.slot === "bottom");
6136
6266
  const drawerPanel = resolved.panels.find((panel) => panel.slot === "drawer");
6137
- return /* @__PURE__ */ jsxs23(ErrorBoundary, { children: [
6138
- resolved.overlays.map((overlay) => /* @__PURE__ */ jsx37(
6267
+ return /* @__PURE__ */ jsxs24(ErrorBoundary, { children: [
6268
+ resolved.overlays.map((overlay) => /* @__PURE__ */ jsx38(
6139
6269
  OverlayRunner,
6140
6270
  {
6141
6271
  overlay,
@@ -6145,15 +6275,15 @@ function App({
6145
6275
  },
6146
6276
  overlay.id
6147
6277
  )),
6148
- /* @__PURE__ */ jsx37(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs23("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
6149
- (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ jsxs23("div", { className: "lace-app__toolbar", children: [
6150
- toolbar.sections.map((section, index) => /* @__PURE__ */ jsxs23(Fragment14, { children: [
6151
- index > 0 ? /* @__PURE__ */ jsx37("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
6152
- /* @__PURE__ */ jsxs23("div", { className: "lace-app__toolbar-section", children: [
6278
+ /* @__PURE__ */ jsx38(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs24("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
6279
+ (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar", children: [
6280
+ toolbar.sections.map((section, index) => /* @__PURE__ */ jsxs24(Fragment15, { children: [
6281
+ index > 0 ? /* @__PURE__ */ jsx38("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
6282
+ /* @__PURE__ */ jsxs24("div", { className: "lace-app__toolbar-section", children: [
6153
6283
  section.actions.map((action) => (
6154
6284
  // `runner.busy` reads the store, whose every write
6155
6285
  // re-renders App (`resultSlots`).
6156
- /* @__PURE__ */ jsx37(
6286
+ /* @__PURE__ */ jsx38(
6157
6287
  ToolbarAction,
6158
6288
  {
6159
6289
  action,
@@ -6164,20 +6294,20 @@ function App({
6164
6294
  action.id
6165
6295
  )
6166
6296
  )),
6167
- section.panels.map((panel) => /* @__PURE__ */ jsx37(PanelSlot, { panel, ctx, tick }, panel.id))
6297
+ section.panels.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id))
6168
6298
  ] })
6169
6299
  ] }, section.key ?? "")),
6170
- toolbar.trailing.length > 0 && /* @__PURE__ */ jsx37("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ jsx37(PanelSlot, { panel, ctx, tick }, panel.id)) })
6300
+ toolbar.trailing.length > 0 && /* @__PURE__ */ jsx38("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id)) })
6171
6301
  ] }),
6172
- /* @__PURE__ */ jsx37("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ jsx37(PanelSlot, { panel, ctx, tick }, panel.id)) }),
6173
- /* @__PURE__ */ jsxs23("div", { className: "lace-app__body", children: [
6174
- /* @__PURE__ */ jsxs23("div", { className: "lace-app__main", children: [
6175
- /* @__PURE__ */ jsx37("div", { className: "lace-app__canvas", children: /* @__PURE__ */ jsx37(ReactFlowProvider, { children: /* @__PURE__ */ jsx37(Canvas, { height: "100%" }) }) }),
6176
- /* @__PURE__ */ jsx37(BottomTabs, { panels: bottomPanels, ctx, tick })
6302
+ /* @__PURE__ */ jsx38("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ jsx38(PanelSlot, { panel, ctx, tick }, panel.id)) }),
6303
+ /* @__PURE__ */ jsxs24("div", { className: "lace-app__body", children: [
6304
+ /* @__PURE__ */ jsxs24("div", { className: "lace-app__main", children: [
6305
+ /* @__PURE__ */ jsx38("div", { className: "lace-app__canvas", children: /* @__PURE__ */ jsx38(ReactFlowProvider, { children: /* @__PURE__ */ jsx38(Canvas, { height: "100%" }) }) }),
6306
+ /* @__PURE__ */ jsx38(BottomTabs, { panels: bottomPanels, ctx, tick })
6177
6307
  ] }),
6178
- drawerPanel && /* @__PURE__ */ jsx37(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ jsx37(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
6308
+ drawerPanel && /* @__PURE__ */ jsx38(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ jsx38(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
6179
6309
  ] }),
6180
- /* @__PURE__ */ jsx37(CommandArgsForm, { form: pendingForm })
6310
+ /* @__PURE__ */ jsx38(CommandArgsForm, { form: pendingForm })
6181
6311
  ] }) })
6182
6312
  ] });
6183
6313
  }