@lace-cloud/canvas 0.23.0 → 0.25.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.cjs CHANGED
@@ -38,6 +38,7 @@ __export(index_exports, {
38
38
  CommandArgsForm: () => CommandArgsForm,
39
39
  CommandDetachedError: () => CommandDetachedError,
40
40
  CommandExitError: () => CommandExitError,
41
+ CommandUnobservedError: () => CommandUnobservedError,
41
42
  ConflictBanner: () => ConflictBanner,
42
43
  ConnectError: () => ConnectError,
43
44
  ContextMenu: () => ContextMenu,
@@ -65,6 +66,7 @@ __export(index_exports, {
65
66
  UngeneratedMarker: () => UngeneratedMarker,
66
67
  UnifiedSettingsPanel: () => UnifiedSettingsPanel,
67
68
  UnsavedMarker: () => UnsavedMarker,
69
+ answering: () => answering,
68
70
  bridgeCaller: () => bridgeCaller,
69
71
  carriesFailure: () => carriesFailure,
70
72
  conflictPanel: () => conflictPanel,
@@ -105,16 +107,16 @@ var import_proto14 = require("@lace-cloud/proto");
105
107
  var import_feedback = require("@lace-cloud/ui/feedback");
106
108
 
107
109
  // src/App.tsx
108
- var import_react41 = require("@xyflow/react");
109
- var import_react42 = require("react");
110
+ var import_react39 = require("@xyflow/react");
111
+ var import_react40 = require("react");
110
112
  var import_App = require("./App-IFIOMNV7.css");
111
113
 
112
114
  // src/Canvas.tsx
113
115
  var import_style = require("@xyflow/react/dist/style.css");
114
116
  var import_Canvas = require("./Canvas-JRY2HAY6.css");
115
117
  var import_proto7 = require("@lace-cloud/proto");
116
- var import_react19 = require("@xyflow/react");
117
- var import_react20 = require("react");
118
+ var import_react17 = require("@xyflow/react");
119
+ var import_react18 = require("react");
118
120
 
119
121
  // src/components/CanvasControls.tsx
120
122
  var import_ui = require("@lace-cloud/ui");
@@ -313,7 +315,7 @@ var CONTEXT_NEEDS = {
313
315
  resolved: "no open Keep or Reload conflict",
314
316
  conflict: "an open Keep or Reload conflict",
315
317
  sourceRefused: "the source-refused lock",
316
- needsConversion: "a tree that needs conversion",
318
+ needsConversion: "a tree out of lace shape",
317
319
  "selection.node": "a selected node",
318
320
  "selection.edge": "a selected connection",
319
321
  diagnostics: "diagnostics to show",
@@ -328,7 +330,8 @@ var TARGET_NEEDS = {
328
330
  nodeId: "a node",
329
331
  groupId: "a group",
330
332
  diagnostic: "a diagnostic",
331
- runId: "a run"
333
+ runId: "a run",
334
+ failure: "a failed command"
332
335
  };
333
336
  var BUSY_REASON = "A run is in progress";
334
337
  function keySatisfied(ctx, key) {
@@ -392,6 +395,16 @@ function asksConfirm(binding) {
392
395
  return binding.confirm !== void 0;
393
396
  }
394
397
  }
398
+ var FAILURE_ROW = "failure";
399
+ function placedOn(action, row) {
400
+ return typeof action.placement === "object" && action.placement.row === row;
401
+ }
402
+ function answersFailure(action, failure) {
403
+ return action.answers?.includes(failure.reason) === true;
404
+ }
405
+ function answering(actions, failure) {
406
+ return actions.filter((a) => placedOn(a, FAILURE_ROW) && answersFailure(a, failure));
407
+ }
395
408
  function unmetRequirement(action, ports, ctx, target) {
396
409
  const { label, binding } = action;
397
410
  const port = missingPort(ports, action.requiredPorts);
@@ -403,6 +416,10 @@ function unmetRequirement(action, ports, ctx, target) {
403
416
  if (key !== void 0) return `${label} needs ${CONTEXT_NEEDS[key]}`;
404
417
  const targetKey = (action.requiredTarget ?? []).find((k) => target[k] === void 0);
405
418
  if (targetKey !== void 0) return `${label} needs ${TARGET_NEEDS[targetKey]}`;
419
+ if (placedOn(action, FAILURE_ROW) || action.answers !== void 0) {
420
+ if (target.failure === void 0) return `${label} needs ${TARGET_NEEDS.failure}`;
421
+ if (!answersFailure(action, target.failure)) return `${label} does not answer this failure`;
422
+ }
406
423
  if (binding.kind === "command" && !availableCommands(ports).has(binding.path)) {
407
424
  return `${label} runs lace ${binding.path}, which this host does not route`;
408
425
  }
@@ -420,9 +437,7 @@ function resolveContributions(all, ports, ctx, target = NO_TARGET) {
420
437
  };
421
438
  }
422
439
  function rowActions(resolved, panelId) {
423
- return resolved.actions.filter(
424
- (a) => typeof a.placement === "object" && a.placement.row === panelId
425
- );
440
+ return resolved.actions.filter((a) => placedOn(a, panelId));
426
441
  }
427
442
 
428
443
  // src/core/sections.ts
@@ -4172,6 +4187,11 @@ var Reason = /* @__PURE__ */ ((Reason2) => {
4172
4187
  Reason2[Reason2["REASON_TOOL_MISSING"] = 14] = "REASON_TOOL_MISSING";
4173
4188
  Reason2[Reason2["REASON_CROSS_SCOPE"] = 15] = "REASON_CROSS_SCOPE";
4174
4189
  Reason2[Reason2["REASON_UNAUTHENTICATED"] = 16] = "REASON_UNAUTHENTICATED";
4190
+ Reason2[Reason2["REASON_IMPORT_RESIDUAL"] = 17] = "REASON_IMPORT_RESIDUAL";
4191
+ Reason2[Reason2["REASON_STACK_HAS_STATE"] = 18] = "REASON_STACK_HAS_STATE";
4192
+ Reason2[Reason2["REASON_NO_ORIGIN_REMOTE"] = 19] = "REASON_NO_ORIGIN_REMOTE";
4193
+ Reason2[Reason2["REASON_IMPORT_UNDECLARED"] = 20] = "REASON_IMPORT_UNDECLARED";
4194
+ Reason2[Reason2["REASON_ALREADY_IMPORTED"] = 21] = "REASON_ALREADY_IMPORTED";
4175
4195
  Reason2[Reason2["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
4176
4196
  return Reason2;
4177
4197
  })(Reason || {});
@@ -4228,6 +4248,21 @@ function reasonFromJSON(object) {
4228
4248
  case 16:
4229
4249
  case "REASON_UNAUTHENTICATED":
4230
4250
  return 16 /* REASON_UNAUTHENTICATED */;
4251
+ case 17:
4252
+ case "REASON_IMPORT_RESIDUAL":
4253
+ return 17 /* REASON_IMPORT_RESIDUAL */;
4254
+ case 18:
4255
+ case "REASON_STACK_HAS_STATE":
4256
+ return 18 /* REASON_STACK_HAS_STATE */;
4257
+ case 19:
4258
+ case "REASON_NO_ORIGIN_REMOTE":
4259
+ return 19 /* REASON_NO_ORIGIN_REMOTE */;
4260
+ case 20:
4261
+ case "REASON_IMPORT_UNDECLARED":
4262
+ return 20 /* REASON_IMPORT_UNDECLARED */;
4263
+ case 21:
4264
+ case "REASON_ALREADY_IMPORTED":
4265
+ return 21 /* REASON_ALREADY_IMPORTED */;
4231
4266
  case -1:
4232
4267
  case "UNRECOGNIZED":
4233
4268
  default:
@@ -4270,6 +4305,16 @@ function reasonToJSON(object) {
4270
4305
  return "REASON_CROSS_SCOPE";
4271
4306
  case 16 /* REASON_UNAUTHENTICATED */:
4272
4307
  return "REASON_UNAUTHENTICATED";
4308
+ case 17 /* REASON_IMPORT_RESIDUAL */:
4309
+ return "REASON_IMPORT_RESIDUAL";
4310
+ case 18 /* REASON_STACK_HAS_STATE */:
4311
+ return "REASON_STACK_HAS_STATE";
4312
+ case 19 /* REASON_NO_ORIGIN_REMOTE */:
4313
+ return "REASON_NO_ORIGIN_REMOTE";
4314
+ case 20 /* REASON_IMPORT_UNDECLARED */:
4315
+ return "REASON_IMPORT_UNDECLARED";
4316
+ case 21 /* REASON_ALREADY_IMPORTED */:
4317
+ return "REASON_ALREADY_IMPORTED";
4273
4318
  case -1 /* UNRECOGNIZED */:
4274
4319
  default:
4275
4320
  return "UNRECOGNIZED";
@@ -11191,6 +11236,13 @@ var CommandDetachedError = class extends Error {
11191
11236
  super("command detached: the invoking consumer stopped listening");
11192
11237
  }
11193
11238
  };
11239
+ var CommandUnobservedError = class extends Error {
11240
+ constructor() {
11241
+ super(
11242
+ "the engine's stream ended before the command exited: the command ran and may have made changes, but its outcome is unknown"
11243
+ );
11244
+ }
11245
+ };
11194
11246
 
11195
11247
  // src/utils/arrangement.ts
11196
11248
  var import_proto = require("@lace-cloud/proto");
@@ -12583,56 +12635,14 @@ var ModuleNode = ({ id, data }) => {
12583
12635
  var ModuleNode_default = ModuleNode;
12584
12636
 
12585
12637
  // src/components/PaperGrid.tsx
12586
- var import_react13 = require("@xyflow/react");
12587
- var import_react14 = require("react");
12588
-
12589
- // src/utils/style-vars.ts
12590
- function readTokenPx(el, name) {
12591
- return Number.parseFloat(getComputedStyle(el).getPropertyValue(name));
12592
- }
12593
-
12594
- // src/components/PaperGrid.tsx
12595
- var import_PaperGrid = require("./PaperGrid-WFRL3N4P.css");
12638
+ var import_PaperGrid = require("./PaperGrid-JG4GBRDP.css");
12596
12639
  var import_jsx_runtime9 = require("react/jsx-runtime");
12597
- var FADE_FROM = 6;
12598
- var FADE_TO = 12;
12599
- function threadStrength(pitch) {
12600
- return Math.min(1, Math.max(0, (pitch - FADE_FROM) / (FADE_TO - FADE_FROM)));
12601
- }
12602
- function readPaperPitch(el) {
12603
- const fine = readTokenPx(el, "--lace-canvas-paper-pitch-fine");
12604
- const major = readTokenPx(el, "--lace-canvas-paper-pitch-major");
12605
- return fine > 0 && major > 0 ? { fine, major } : null;
12606
- }
12607
- var transformOf = (s) => s.transform;
12608
12640
  function PaperGrid() {
12609
- const ref = (0, import_react14.useRef)(null);
12610
- const [pitch, setPitch] = (0, import_react14.useState)(null);
12611
- (0, import_react14.useLayoutEffect)(() => {
12612
- if (ref.current) setPitch(readPaperPitch(ref.current));
12613
- }, []);
12614
- const [x, y, zoom] = (0, import_react13.useStore)(transformOf);
12615
- const strength = (px) => `${Math.round(threadStrength((px ?? 0) * zoom) * 100)}%`;
12616
- const style = {
12617
- "--paper-x": `${x}px`,
12618
- "--paper-y": `${y}px`,
12619
- "--paper-zoom": zoom,
12620
- "--paper-fine": strength(pitch?.fine),
12621
- "--paper-major": strength(pitch?.major)
12622
- };
12623
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
12624
- "div",
12625
- {
12626
- ref,
12627
- className: "lace-paper-layers lace-canvas-paper",
12628
- style,
12629
- "aria-hidden": "true"
12630
- }
12631
- );
12641
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "lace-paper-layers lace-canvas-paper", "aria-hidden": "true" });
12632
12642
  }
12633
12643
 
12634
12644
  // src/core/use-action-keys.ts
12635
- var import_react15 = require("react");
12645
+ var import_react13 = require("react");
12636
12646
 
12637
12647
  // src/contribution-types.ts
12638
12648
  var KEY_SCOPES = ["surface", "app"];
@@ -12655,7 +12665,7 @@ function isFormTarget(target) {
12655
12665
  return tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT" || target.isContentEditable;
12656
12666
  }
12657
12667
  function useFocusWhenNoneHeld(root, mounted) {
12658
- (0, import_react15.useEffect)(() => {
12668
+ (0, import_react13.useEffect)(() => {
12659
12669
  const element = root.current;
12660
12670
  if (!mounted || !element) return;
12661
12671
  const doc = element.ownerDocument;
@@ -12680,7 +12690,7 @@ function matchesKey(e, spec) {
12680
12690
  return e.key.toLowerCase() === chord.key.toLowerCase();
12681
12691
  }
12682
12692
  function useActionKeys(actions, ctx, runner, envExtras) {
12683
- (0, import_react15.useEffect)(() => {
12693
+ (0, import_react13.useEffect)(() => {
12684
12694
  if (!ctx || !envExtras) return;
12685
12695
  const activeCtx = ctx;
12686
12696
  const activeEnvExtras = envExtras;
@@ -12717,10 +12727,10 @@ function useActionKeys(actions, ctx, runner, envExtras) {
12717
12727
  }
12718
12728
 
12719
12729
  // src/hooks/useContextMenu.ts
12720
- var import_react16 = require("react");
12730
+ var import_react14 = require("react");
12721
12731
  function useContextMenu() {
12722
- const [contextMenu, setContextMenu] = (0, import_react16.useState)(null);
12723
- const showContextMenu = (0, import_react16.useCallback)((request) => {
12732
+ const [contextMenu, setContextMenu] = (0, import_react14.useState)(null);
12733
+ const showContextMenu = (0, import_react14.useCallback)((request) => {
12724
12734
  setContextMenu({
12725
12735
  x: request.x,
12726
12736
  y: request.y,
@@ -12728,21 +12738,21 @@ function useContextMenu() {
12728
12738
  groupId: request.groupId
12729
12739
  });
12730
12740
  }, []);
12731
- const dismissContextMenu = (0, import_react16.useCallback)(() => {
12741
+ const dismissContextMenu = (0, import_react14.useCallback)(() => {
12732
12742
  setContextMenu(null);
12733
12743
  }, []);
12734
12744
  return { contextMenu, showContextMenu, dismissContextMenu };
12735
12745
  }
12736
12746
 
12737
12747
  // src/hooks/useGroupLogic.ts
12738
- var import_react17 = require("react");
12748
+ var import_react15 = require("react");
12739
12749
  function drawnPosition(groups, node) {
12740
12750
  const parent = node.parentId ? groups.find((g) => g.id === node.parentId) : void 0;
12741
12751
  if (!parent) return node.position;
12742
12752
  return { x: parent.position.x + node.position.x, y: parent.position.y + node.position.y };
12743
12753
  }
12744
12754
  function useGroupLogic(nodes, edges, groups, newNodeIds, decorations) {
12745
- return (0, import_react17.useMemo)(() => {
12755
+ return (0, import_react15.useMemo)(() => {
12746
12756
  const parentOf = /* @__PURE__ */ new Map();
12747
12757
  for (const g of groups) {
12748
12758
  for (const id of g.node_ids) parentOf.set(id, g);
@@ -12850,12 +12860,12 @@ function renderEdgeToRfEdge(e) {
12850
12860
  }
12851
12861
 
12852
12862
  // src/hooks/useNewNodeTracking.ts
12853
- var import_react18 = require("react");
12863
+ var import_react16 = require("react");
12854
12864
  function useNewNodeTracking(view) {
12855
- const [newNodeIds, setNewNodeIds] = (0, import_react18.useState)(/* @__PURE__ */ new Set());
12856
- const prevNodeIdsRef = (0, import_react18.useRef)(/* @__PURE__ */ new Set());
12857
- const sessionLoadedRef = (0, import_react18.useRef)(false);
12858
- (0, import_react18.useEffect)(() => {
12865
+ const [newNodeIds, setNewNodeIds] = (0, import_react16.useState)(/* @__PURE__ */ new Set());
12866
+ const prevNodeIdsRef = (0, import_react16.useRef)(/* @__PURE__ */ new Set());
12867
+ const sessionLoadedRef = (0, import_react16.useRef)(false);
12868
+ (0, import_react16.useEffect)(() => {
12859
12869
  if (!view) return;
12860
12870
  const currentIds = new Set(view.nodes.map((n) => n.id));
12861
12871
  if (!sessionLoadedRef.current) {
@@ -12872,7 +12882,7 @@ function useNewNodeTracking(view) {
12872
12882
  });
12873
12883
  prevNodeIdsRef.current = currentIds;
12874
12884
  }, [view]);
12875
- const clearNew = (0, import_react18.useCallback)((...ids) => {
12885
+ const clearNew = (0, import_react16.useCallback)((...ids) => {
12876
12886
  setNewNodeIds((s) => {
12877
12887
  const next = new Set(s);
12878
12888
  let changed = false;
@@ -12956,19 +12966,19 @@ function CompositeEditor({
12956
12966
  paneRef,
12957
12967
  decorations
12958
12968
  }) {
12959
- const { fitView, getNode, getNodes, getNodesBounds, getViewport, setViewport } = (0, import_react19.useReactFlow)();
12960
- const xyflowInitialized = (0, import_react19.useNodesInitialized)();
12969
+ const { fitView, getNode, getNodes, getNodesBounds, getViewport, setViewport } = (0, import_react17.useReactFlow)();
12970
+ const xyflowInitialized = (0, import_react17.useNodesInitialized)();
12961
12971
  const nodesInitialized = xyflowInitialized || view.nodes.length === 0;
12962
- (0, import_react20.useEffect)(() => {
12972
+ (0, import_react18.useEffect)(() => {
12963
12973
  registerGoToNode((nodeId) => {
12964
12974
  if (!getNode(nodeId)) return;
12965
12975
  const bounds = getNodesBounds([nodeId]);
12966
12976
  layout.panIntoView(withMargin(bounds, REVEAL_MARGIN, getViewport().zoom));
12967
12977
  });
12968
12978
  }, [registerGoToNode, getNode, getNodesBounds, getViewport, layout]);
12969
- const focusRef = (0, import_react20.useRef)(focusIds);
12979
+ const focusRef = (0, import_react18.useRef)(focusIds);
12970
12980
  focusRef.current = focusIds;
12971
- (0, import_react20.useEffect)(() => {
12981
+ (0, import_react18.useEffect)(() => {
12972
12982
  const pane = paneRef.current;
12973
12983
  if (!pane || typeof ResizeObserver === "undefined") return;
12974
12984
  let before = { width: pane.clientWidth, height: pane.clientHeight };
@@ -13001,7 +13011,7 @@ function CompositeEditor({
13001
13011
  observer.disconnect();
13002
13012
  };
13003
13013
  }, [paneRef, getViewport, getNodes, getNode, getNodesBounds, fitView, setViewport]);
13004
- (0, import_react20.useEffect)(() => {
13014
+ (0, import_react18.useEffect)(() => {
13005
13015
  layout.panIntoView = (rect) => {
13006
13016
  const pane = paneRef.current?.getBoundingClientRect();
13007
13017
  if (!pane) return;
@@ -13018,24 +13028,24 @@ function CompositeEditor({
13018
13028
  );
13019
13029
  };
13020
13030
  }, [layout, getViewport, setViewport, paneRef]);
13021
- const firedRef = (0, import_react20.useRef)(false);
13022
- (0, import_react20.useEffect)(() => {
13031
+ const firedRef = (0, import_react18.useRef)(false);
13032
+ (0, import_react18.useEffect)(() => {
13023
13033
  if (firedRef.current || !nodesInitialized || view.nodes.length === 0) return;
13024
13034
  firedRef.current = true;
13025
13035
  requestAnimationFrame(() => fitView(FIT_VIEW_OPTIONS));
13026
13036
  }, [nodesInitialized, view.nodes.length, fitView]);
13027
13037
  const groupLogic = useGroupLogic(view.nodes, view.edges, view.groups, newNodeIds, decorations);
13028
13038
  const rfEdgesFromView = groupLogic.rfEdges;
13029
- const [rfEdges, setRfEdges] = (0, import_react20.useState)(rfEdgesFromView);
13030
- (0, import_react20.useEffect)(() => {
13039
+ const [rfEdges, setRfEdges] = (0, import_react18.useState)(rfEdgesFromView);
13040
+ (0, import_react18.useEffect)(() => {
13031
13041
  setRfEdges(rfEdgesFromView);
13032
13042
  }, [rfEdgesFromView]);
13033
- const onEdgesChange = (0, import_react20.useCallback)((changes) => {
13034
- setRfEdges((prev) => (0, import_react19.applyEdgeChanges)(changes, prev));
13043
+ const onEdgesChange = (0, import_react18.useCallback)((changes) => {
13044
+ setRfEdges((prev) => (0, import_react17.applyEdgeChanges)(changes, prev));
13035
13045
  }, []);
13036
13046
  const rfNodesFromView = groupLogic.rfNodes;
13037
- const [rfNodes, setRfNodes] = (0, import_react20.useState)(rfNodesFromView);
13038
- (0, import_react20.useEffect)(() => {
13047
+ const [rfNodes, setRfNodes] = (0, import_react18.useState)(rfNodesFromView);
13048
+ (0, import_react18.useEffect)(() => {
13039
13049
  setRfNodes((prev) => {
13040
13050
  const current = new Map(prev.map((n) => [n.id, n]));
13041
13051
  return rfNodesFromView.map((n) => {
@@ -13051,10 +13061,10 @@ function CompositeEditor({
13051
13061
  });
13052
13062
  });
13053
13063
  }, [rfNodesFromView]);
13054
- const onNodesChange = (0, import_react20.useCallback)((changes) => {
13055
- setRfNodes((prev) => (0, import_react19.applyNodeChanges)(changes, prev));
13064
+ const onNodesChange = (0, import_react18.useCallback)((changes) => {
13065
+ setRfNodes((prev) => (0, import_react17.applyNodeChanges)(changes, prev));
13056
13066
  }, []);
13057
- const onNodeDragStop = (0, import_react20.useCallback)(
13067
+ const onNodeDragStop = (0, import_react18.useCallback)(
13058
13068
  (_e, _draggedNode, draggedNodes) => {
13059
13069
  const positions = {};
13060
13070
  for (const n of draggedNodes) {
@@ -13069,7 +13079,7 @@ function CompositeEditor({
13069
13079
  animated: false
13070
13080
  };
13071
13081
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
13072
- import_react19.ReactFlow,
13082
+ import_react17.ReactFlow,
13073
13083
  {
13074
13084
  onInit,
13075
13085
  nodes: rfNodes,
@@ -13133,7 +13143,7 @@ function Canvas({ height }) {
13133
13143
  layout
13134
13144
  } = useCanvas();
13135
13145
  const editor = ctx.ports.editor;
13136
- const makeEnvExtras = (0, import_react20.useCallback)(
13146
+ const makeEnvExtras = (0, import_react18.useCallback)(
13137
13147
  () => ({
13138
13148
  bundle,
13139
13149
  arrangement: { get: () => arrangement, update: updateArrangement },
@@ -13141,34 +13151,34 @@ function Canvas({ height }) {
13141
13151
  }),
13142
13152
  [bundle, arrangement, updateArrangement, layout]
13143
13153
  );
13144
- const focusIds = (0, import_react20.useMemo)(
13154
+ const focusIds = (0, import_react18.useMemo)(
13145
13155
  () => selection.edge ? [selection.edge.source, selection.edge.target] : selection.nodes,
13146
13156
  [selection]
13147
13157
  );
13148
13158
  const { contextMenu, showContextMenu, dismissContextMenu } = useContextMenu();
13149
13159
  const { newNodeIds } = useNewNodeTracking(view);
13150
- const paneRef = (0, import_react20.useRef)(null);
13151
- const surfaceRef = (0, import_react20.useRef)(null);
13152
- (0, import_react20.useEffect)(() => {
13160
+ const paneRef = (0, import_react18.useRef)(null);
13161
+ const surfaceRef = (0, import_react18.useRef)(null);
13162
+ (0, import_react18.useEffect)(() => {
13153
13163
  registerKeyTarget(ctx, "surface", surfaceRef.current);
13154
13164
  return () => registerKeyTarget(ctx, "surface", null);
13155
13165
  }, [ctx]);
13156
- const onSurfacePointerDown = (0, import_react20.useCallback)((e) => {
13166
+ const onSurfacePointerDown = (0, import_react18.useCallback)((e) => {
13157
13167
  if (isFormTarget(e.target)) return;
13158
13168
  surfaceRef.current?.focus();
13159
13169
  }, []);
13160
- const goToNodeRef = (0, import_react20.useRef)(null);
13161
- const registerGoToNode = (0, import_react20.useCallback)((fn) => {
13170
+ const goToNodeRef = (0, import_react18.useRef)(null);
13171
+ const registerGoToNode = (0, import_react18.useCallback)((fn) => {
13162
13172
  goToNodeRef.current = fn;
13163
13173
  }, []);
13164
- const onOpenNodeConfig = (0, import_react20.useCallback)(
13174
+ const onOpenNodeConfig = (0, import_react18.useCallback)(
13165
13175
  (instanceId) => {
13166
13176
  setSelection({ nodes: [instanceId], edge: null });
13167
13177
  goToNodeRef.current?.(instanceId);
13168
13178
  },
13169
13179
  [setSelection]
13170
13180
  );
13171
- const onDragStop = (0, import_react20.useCallback)(
13181
+ const onDragStop = (0, import_react18.useCallback)(
13172
13182
  (positions) => {
13173
13183
  const pinned = Object.keys(positions).reduce(
13174
13184
  (next, id) => withScopesPinned(bundle, view, next, id),
@@ -13178,7 +13188,7 @@ function Canvas({ height }) {
13178
13188
  },
13179
13189
  [bundle, view, arrangement, updateArrangement]
13180
13190
  );
13181
- const onConnect = (0, import_react20.useCallback)(
13191
+ const onConnect = (0, import_react18.useCallback)(
13182
13192
  async (conn) => {
13183
13193
  if (!conn.source || !conn.target || !editor) return;
13184
13194
  const source = (0, import_proto7.instanceAddress)(bundle, conn.source);
@@ -13200,7 +13210,7 @@ function Canvas({ height }) {
13200
13210
  },
13201
13211
  [editor, runner, bundle]
13202
13212
  );
13203
- const onEdgeClick = (0, import_react20.useCallback)(
13213
+ const onEdgeClick = (0, import_react18.useCallback)(
13204
13214
  (_e, edge) => {
13205
13215
  const data = rfEdgeData(edge);
13206
13216
  if (!data) return;
@@ -13217,7 +13227,7 @@ function Canvas({ height }) {
13217
13227
  },
13218
13228
  [setSelection]
13219
13229
  );
13220
- const onEdgesDelete = (0, import_react20.useCallback)(
13230
+ const onEdgesDelete = (0, import_react18.useCallback)(
13221
13231
  async (edges) => {
13222
13232
  for (const edge of edges) {
13223
13233
  const data = rfEdgeData(edge);
@@ -13230,7 +13240,7 @@ function Canvas({ height }) {
13230
13240
  },
13231
13241
  [runner, bundle]
13232
13242
  );
13233
- const onNodesDelete = (0, import_react20.useCallback)(
13243
+ const onNodesDelete = (0, import_react18.useCallback)(
13234
13244
  async (nodes) => {
13235
13245
  const action = ctx.contributions.actions.find((a) => a.id === "delete-node");
13236
13246
  if (!action) return;
@@ -13241,7 +13251,7 @@ function Canvas({ height }) {
13241
13251
  },
13242
13252
  [ctx, runner, makeEnvExtras]
13243
13253
  );
13244
- const onSelectionChange = (0, import_react20.useCallback)(
13254
+ const onSelectionChange = (0, import_react18.useCallback)(
13245
13255
  (params) => {
13246
13256
  const ids = params.nodes.map((n) => n.id);
13247
13257
  setSelection({ nodes: ids, edge: selection.edge });
@@ -13249,14 +13259,14 @@ function Canvas({ height }) {
13249
13259
  [setSelection, selection.edge]
13250
13260
  );
13251
13261
  const menuTarget = contextMenu ? contextMenu.groupId ? groupTarget(contextMenu.groupId) : { nodeId: contextMenu.nodeId ?? void 0 } : NO_ENV_EXTRAS_TARGET;
13252
- const menuActions = (0, import_react20.useMemo)(() => {
13262
+ const menuActions = (0, import_react18.useMemo)(() => {
13253
13263
  if (!contextMenu) return [];
13254
13264
  const placement = menuTarget.nodeId === void 0 ? "pane-menu" : "node-menu";
13255
13265
  return resolveContributions(ctx.contributions, ctx.ports, ctx, menuTarget).actions.filter(
13256
13266
  (a) => a.placement === placement
13257
13267
  );
13258
13268
  }, [contextMenu, ctx, menuTarget]);
13259
- const runMenuAction = (0, import_react20.useCallback)(
13269
+ const runMenuAction = (0, import_react18.useCallback)(
13260
13270
  (action) => {
13261
13271
  void runner.run(action, ctx, menuTarget, makeEnvExtras());
13262
13272
  },
@@ -13317,7 +13327,14 @@ function Canvas({ height }) {
13317
13327
  }
13318
13328
 
13319
13329
  // src/components/Drawer.tsx
13320
- var import_react21 = require("react");
13330
+ var import_react19 = require("react");
13331
+
13332
+ // src/utils/style-vars.ts
13333
+ function readTokenPx(el, name) {
13334
+ return Number.parseFloat(getComputedStyle(el).getPropertyValue(name));
13335
+ }
13336
+
13337
+ // src/components/Drawer.tsx
13321
13338
  var import_Drawer = require("./Drawer-34ZYTEWE.css");
13322
13339
  var import_jsx_runtime11 = require("react/jsx-runtime");
13323
13340
  var KEY_STEP = 16;
@@ -13331,30 +13348,30 @@ function clampWidth(width, bounds) {
13331
13348
  return Math.min(bounds.max, Math.max(bounds.min, width));
13332
13349
  }
13333
13350
  function Drawer({ label, children }) {
13334
- const ref = (0, import_react21.useRef)(null);
13335
- const [bounds, setBounds] = (0, import_react21.useState)(null);
13336
- const [width, setWidth] = (0, import_react21.useState)(null);
13337
- const [measured, setMeasured] = (0, import_react21.useState)(0);
13338
- const drag = (0, import_react21.useRef)(null);
13339
- (0, import_react21.useLayoutEffect)(() => {
13351
+ const ref = (0, import_react19.useRef)(null);
13352
+ const [bounds, setBounds] = (0, import_react19.useState)(null);
13353
+ const [width, setWidth] = (0, import_react19.useState)(null);
13354
+ const [measured, setMeasured] = (0, import_react19.useState)(0);
13355
+ const drag = (0, import_react19.useRef)(null);
13356
+ (0, import_react19.useLayoutEffect)(() => {
13340
13357
  if (ref.current) setBounds(readDrawerBounds(ref.current));
13341
13358
  }, []);
13342
- (0, import_react21.useLayoutEffect)(() => {
13359
+ (0, import_react19.useLayoutEffect)(() => {
13343
13360
  if (ref.current) setMeasured(Math.round(ref.current.getBoundingClientRect().width));
13344
13361
  }, [width]);
13345
- const onPointerDown = (0, import_react21.useCallback)((e) => {
13362
+ const onPointerDown = (0, import_react19.useCallback)((e) => {
13346
13363
  e.preventDefault();
13347
13364
  e.currentTarget.setPointerCapture(e.pointerId);
13348
13365
  drag.current = { x: e.clientX, width: ref.current?.getBoundingClientRect().width ?? 0 };
13349
13366
  }, []);
13350
- const onPointerMove = (0, import_react21.useCallback)(
13367
+ const onPointerMove = (0, import_react19.useCallback)(
13351
13368
  (e) => {
13352
13369
  if (!drag.current) return;
13353
13370
  setWidth(clampWidth(drag.current.width + drag.current.x - e.clientX, bounds));
13354
13371
  },
13355
13372
  [bounds]
13356
13373
  );
13357
- const onPointerUp = (0, import_react21.useCallback)((e) => {
13374
+ const onPointerUp = (0, import_react19.useCallback)((e) => {
13358
13375
  drag.current = null;
13359
13376
  e.currentTarget.releasePointerCapture(e.pointerId);
13360
13377
  }, []);
@@ -13388,7 +13405,7 @@ function Drawer({ label, children }) {
13388
13405
  }
13389
13406
 
13390
13407
  // src/components/ErrorBoundary.tsx
13391
- var import_react22 = __toESM(require("react"));
13408
+ var import_react20 = __toESM(require("react"));
13392
13409
  var import_ErrorBoundary = require("./ErrorBoundary-IXSIVZFH.css");
13393
13410
  var import_jsx_runtime12 = require("react/jsx-runtime");
13394
13411
  function ErrorState({ message }) {
@@ -13406,7 +13423,7 @@ function ErrorState({ message }) {
13406
13423
  )
13407
13424
  ] });
13408
13425
  }
13409
- var ErrorBoundary = class extends import_react22.default.Component {
13426
+ var ErrorBoundary = class extends import_react20.default.Component {
13410
13427
  constructor() {
13411
13428
  super(...arguments);
13412
13429
  this.state = { error: null };
@@ -13492,7 +13509,7 @@ function ToolbarAction({ action, disabledReason: disabledReason2, emphasized, bu
13492
13509
  }
13493
13510
 
13494
13511
  // src/core/CommandArgsForm.tsx
13495
- var import_react23 = require("react");
13512
+ var import_react21 = require("react");
13496
13513
 
13497
13514
  // src/contracts/commands.gen.ts
13498
13515
  var COMMANDS = {
@@ -14805,6 +14822,31 @@ function completeArgs(path, partial) {
14805
14822
 
14806
14823
  // src/contracts/schemas.ts
14807
14824
  var import_zod = require("zod");
14825
+ var REASON_PREFIX = "REASON_";
14826
+ function reasonWire(reason) {
14827
+ return reasonToJSON(reason).slice(REASON_PREFIX.length).toLowerCase();
14828
+ }
14829
+ var LACE_REASONS = new Set(
14830
+ Object.values(Reason).filter((value) => typeof value === "number" && value !== -1 /* UNRECOGNIZED */).map(reasonWire)
14831
+ );
14832
+ var laceReasonSchema = import_zod.z.custom(
14833
+ (value) => typeof value === "string" && LACE_REASONS.has(value),
14834
+ { message: "not a reason of Lace\u2019s own" }
14835
+ );
14836
+ var importResidualSchema = import_zod.z.object({
14837
+ address: import_zod.z.string(),
14838
+ type: import_zod.z.string(),
14839
+ reason: import_zod.z.string()
14840
+ });
14841
+ var commandFailureSchema = import_zod.z.strictObject({
14842
+ reason: laceReasonSchema,
14843
+ message: import_zod.z.string(),
14844
+ url: import_zod.z.string().optional(),
14845
+ tool: import_zod.z.string().optional(),
14846
+ importResiduals: import_zod.z.array(importResidualSchema).optional(),
14847
+ addresses: import_zod.z.array(import_zod.z.string()).optional(),
14848
+ apiCode: import_zod.z.string().optional()
14849
+ });
14808
14850
  var moduleValidateDeviationSchema = import_zod.z.object({
14809
14851
  notCompositional: import_zod.z.boolean(),
14810
14852
  clusters: import_zod.z.array(import_zod.z.unknown()),
@@ -14856,6 +14898,7 @@ var moduleValidateResultSchema = import_zod.z.object({
14856
14898
  }).optional(),
14857
14899
  modules: import_zod.z.array(import_zod.z.object({ address: import_zod.z.string(), version: import_zod.z.string(), treeHash: import_zod.z.string() })).optional(),
14858
14900
  exitClass: import_zod.z.string(),
14901
+ failure: commandFailureSchema.optional(),
14859
14902
  diagnostics: import_zod.z.array(commandDiagnosticSchema)
14860
14903
  });
14861
14904
  var moduleConvertResultSchema = import_zod.z.object({
@@ -14966,6 +15009,7 @@ var registryDescribeSchema = import_zod.z.object({
14966
15009
  )
14967
15010
  })
14968
15011
  });
15012
+ var stackIdentSchema = import_zod.z.object({ id: import_zod.z.string(), slug: import_zod.z.string() });
14969
15013
  var stackSourceSchema = import_zod.z.object({
14970
15014
  kind: import_zod.z.literal("git"),
14971
15015
  repoUrl: import_zod.z.string(),
@@ -15149,7 +15193,7 @@ var previewEntrySchema = import_zod.z.discriminatedUnion("kind", [
15149
15193
  })
15150
15194
  ]);
15151
15195
  var stackPreviewSchema = import_zod.z.object({
15152
- stack: import_zod.z.object({ id: import_zod.z.string(), slug: import_zod.z.string() }),
15196
+ stack: stackIdentSchema,
15153
15197
  treeHash: import_zod.z.string(),
15154
15198
  plan: import_zod.z.object({ summary: planSummarySchema, human: import_zod.z.string() }),
15155
15199
  policy: import_zod.z.object({
@@ -15196,16 +15240,19 @@ var gateChangeRequestSchema = import_zod.z.object({
15196
15240
  import_zod.z.object({
15197
15241
  id: import_zod.z.string(),
15198
15242
  state: import_zod.z.string(),
15199
- decidedBy: import_zod.z.enum(["lace", "ecm"])
15243
+ decidedBy: import_zod.z.enum(["lace", "ecm"]),
15244
+ recordId: import_zod.z.string().nullable()
15200
15245
  })
15201
15246
  ),
15202
15247
  records: import_zod.z.array(
15203
15248
  import_zod.z.object({
15249
+ id: import_zod.z.string(),
15204
15250
  externalSystemId: import_zod.z.string(),
15205
15251
  kind: import_zod.z.string(),
15206
15252
  externalRef: import_zod.z.string().nullable(),
15207
15253
  externalUrl: import_zod.z.string().nullable(),
15208
- state: import_zod.z.string().nullable()
15254
+ state: import_zod.z.string().nullable(),
15255
+ decision: import_zod.z.enum(["approved", "rejected"]).nullable()
15209
15256
  })
15210
15257
  )
15211
15258
  });
@@ -15229,6 +15276,7 @@ var runEventSchema = import_zod.z.discriminatedUnion("type", [
15229
15276
  })
15230
15277
  ]);
15231
15278
  var stackScanSchema = import_zod.z.object({
15279
+ stack: stackIdentSchema,
15232
15280
  triggered: import_zod.z.boolean(),
15233
15281
  reason: import_zod.z.string().nullable(),
15234
15282
  settled: import_zod.z.object({
@@ -15236,15 +15284,15 @@ var stackScanSchema = import_zod.z.object({
15236
15284
  driftCount: import_zod.z.number(),
15237
15285
  scannedAt: import_zod.z.string(),
15238
15286
  undeterminedReason: import_zod.z.string().nullable(),
15287
+ standingDriftFindings: import_zod.z.number(),
15288
+ footprintDestroyed: import_zod.z.boolean(),
15239
15289
  drift: driftSchema
15240
15290
  }).nullable()
15241
15291
  });
15242
- var stackImportSchema = import_zod.z.object({
15243
- stack: import_zod.z.object({ id: import_zod.z.string(), slug: import_zod.z.string() }),
15244
- written: import_zod.z.array(import_zod.z.string()),
15292
+ var stackImportSchema = moduleConvertResultSchema.extend({
15293
+ stack: stackIdentSchema,
15245
15294
  importBlocks: import_zod.z.number(),
15246
- importResiduals: import_zod.z.array(import_zod.z.unknown()),
15247
- validate: moduleValidateResultSchema
15295
+ importResiduals: import_zod.z.array(importResidualSchema)
15248
15296
  });
15249
15297
  var artifactRefSchema = import_zod.z.object({ url: import_zod.z.string(), key: import_zod.z.string() });
15250
15298
  var runPlanSchema = import_zod.z.object({
@@ -15355,24 +15403,6 @@ function isBoundPath(path) {
15355
15403
  function parseBound(path, data) {
15356
15404
  return SCHEMAS[path].parse(data);
15357
15405
  }
15358
- var REASON_PREFIX = "REASON_";
15359
- function reasonWire(reason) {
15360
- return reasonToJSON(reason).slice(REASON_PREFIX.length).toLowerCase();
15361
- }
15362
- var LACE_REASONS = new Set(
15363
- Object.values(Reason).filter((value) => typeof value === "number" && value !== -1 /* UNRECOGNIZED */).map(reasonWire)
15364
- );
15365
- var laceReasonSchema = import_zod.z.custom(
15366
- (value) => typeof value === "string" && LACE_REASONS.has(value),
15367
- { message: "not a reason of Lace\u2019s own" }
15368
- );
15369
- var commandFailureSchema = import_zod.z.strictObject({
15370
- reason: laceReasonSchema,
15371
- message: import_zod.z.string(),
15372
- url: import_zod.z.string().optional(),
15373
- tool: import_zod.z.string().optional(),
15374
- apiCode: import_zod.z.string().optional()
15375
- });
15376
15406
  var failureMarkSchema = import_zod.z.object({ reason: import_zod.z.string(), message: import_zod.z.string() });
15377
15407
  function carriesFailure(data) {
15378
15408
  return failureMarkSchema.safeParse(data).success;
@@ -15380,6 +15410,12 @@ function carriesFailure(data) {
15380
15410
  function parseCommandFailure(data) {
15381
15411
  return commandFailureSchema.parse(data);
15382
15412
  }
15413
+ function resultFailure(path, data) {
15414
+ const result = parseBound(path, data);
15415
+ if ("failure" in result) return result.failure;
15416
+ if ("validate" in result) return result.validate.failure;
15417
+ return void 0;
15418
+ }
15383
15419
 
15384
15420
  // src/core/CommandArgsForm.tsx
15385
15421
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -15390,7 +15426,7 @@ function flagsOf(path) {
15390
15426
  return COMMANDS[path].flags;
15391
15427
  }
15392
15428
  function CommandArgsForm({ form }) {
15393
- const [values, setValues] = (0, import_react23.useState)({});
15429
+ const [values, setValues] = (0, import_react21.useState)({});
15394
15430
  if (!form) return null;
15395
15431
  const flags = isCommandPath(form.path) ? flagsOf(form.path) : {};
15396
15432
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
@@ -15455,7 +15491,7 @@ function defineCommand(binding) {
15455
15491
  if (!binding.confirm) return void 0;
15456
15492
  const merged = completeArgs(binding.path, { ...binding.args(ctx, target), ...formArgs });
15457
15493
  if (!merged.ok) return void 0;
15458
- return binding.confirm(ctx, merged.args);
15494
+ return binding.confirm(ctx, merged.args, target);
15459
15495
  },
15460
15496
  async start(rt, ctx, target, formArgs, signal) {
15461
15497
  const merged = completeArgs(binding.path, { ...binding.args(ctx, target), ...formArgs });
@@ -15514,6 +15550,21 @@ var destroy = defineCommand({
15514
15550
  invalidates: "start+settle",
15515
15551
  result: slotSink("run")
15516
15552
  });
15553
+ function scanNotice(e) {
15554
+ const { slug } = e.stack;
15555
+ const settled = e.settled;
15556
+ if (!settled) {
15557
+ return e.triggered ? `Drift scan triggered for stack ${slug} (${e.stack.id}).` : `Drift scan already in progress for stack ${slug}.`;
15558
+ }
15559
+ if (settled.undeterminedReason !== null) return void 0;
15560
+ if (settled.footprintDestroyed) {
15561
+ return `Drift scan complete for stack ${slug}: IN_SYNC (0 drifted) \u2014 its resources were destroyed, so there was nothing to compare.`;
15562
+ }
15563
+ if (settled.standingDriftFindings > 0) {
15564
+ return `Drift scan complete for stack ${slug}: the scan observed no drift, but ${settled.standingDriftFindings} drift finding(s) from earlier scans still stand \u2014 the stack remains DRIFTED.`;
15565
+ }
15566
+ return `Drift scan complete for stack ${slug}: ${settled.driftStatus} (${settled.driftCount} drifted).`;
15567
+ }
15517
15568
  var scan = defineCommand({
15518
15569
  kind: "command",
15519
15570
  path: "stack scan",
@@ -15522,14 +15573,8 @@ var scan = defineCommand({
15522
15573
  result: {
15523
15574
  kind: "notify",
15524
15575
  consume: (rt, e) => {
15525
- if (!e.triggered) {
15526
- rt.ports.presenter.notify("info", e.reason ?? "Scan skipped");
15527
- return;
15528
- }
15529
- rt.ports.presenter.notify(
15530
- "info",
15531
- e.settled ? `Scan complete \u2014 ${e.settled.driftStatus}` : "Scan triggered"
15532
- );
15576
+ const notice = scanNotice(e);
15577
+ if (notice !== void 0) rt.ports.presenter.notify("info", notice);
15533
15578
  }
15534
15579
  }
15535
15580
  });
@@ -15543,15 +15588,50 @@ var create = defineCommand({
15543
15588
  consume: (rt, e) => rt.ports.presenter.notify("info", `Created stack ${e.slug}`)
15544
15589
  }
15545
15590
  });
15591
+ function residualAddresses(residuals) {
15592
+ return residuals.map((r) => r.address).join(", ");
15593
+ }
15594
+ function treeChanges(e) {
15595
+ return [
15596
+ ...e.written.length === 0 ? [] : [`rewriting ${e.written.join(", ")} in place`],
15597
+ ...e.removed.length === 0 ? [] : [`removing ${e.removed.join(", ")}`]
15598
+ ];
15599
+ }
15600
+ function importNotice(e) {
15601
+ const { slug } = e.stack;
15602
+ const changes = treeChanges(e);
15603
+ const files = changes.length > 0 ? `, ${changes.join(" and ")}` : "";
15604
+ const imported = `Imported ${e.importBlocks} resource(s) into ${slug}${files}.`;
15605
+ if (e.validate.exitClass !== "ok") {
15606
+ return ["warn", `${imported} The tree did not validate: fix it before you commit it.`];
15607
+ }
15608
+ const adopt = e.changed ? ` Review the change in git, commit it, then apply ${slug} to adopt them.` : "";
15609
+ if (e.importResiduals.length === 0) return ["info", `${imported}${adopt}`];
15610
+ return [
15611
+ "warn",
15612
+ `${imported}${adopt} Not adopted: ${residualAddresses(e.importResiduals)}; supply their import ids before applying, or the apply creates them anew.`
15613
+ ];
15614
+ }
15615
+ var importResult = {
15616
+ kind: "notify",
15617
+ consume: (rt, e) => rt.ports.presenter.notify(...importNotice(e))
15618
+ };
15546
15619
  var importStack = defineCommand({
15547
15620
  kind: "command",
15548
15621
  path: "stack import",
15549
15622
  args: (ctx) => ({ stack: ctx.stack?.id }),
15550
15623
  invalidates: true,
15551
- result: {
15552
- kind: "notify",
15553
- consume: (rt, e) => rt.ports.presenter.notify("info", `Imported ${e.importBlocks} block(s) into ${e.stack.slug}`)
15554
- }
15624
+ result: importResult
15625
+ });
15626
+ var importPartial = defineCommand({
15627
+ kind: "command",
15628
+ path: "stack import",
15629
+ args: (ctx) => ({ stack: ctx.stack?.id, allowPartial: true }),
15630
+ confirm: (ctx, _args, target) => ({
15631
+ text: `Import into ${ctx.stack?.slug} without adopting ${residualAddresses(target.failure?.importResiduals ?? [])}? Lace writes no import block for them, so the stack's apply creates them anew beside the live ones.`
15632
+ }),
15633
+ invalidates: true,
15634
+ result: importResult
15555
15635
  });
15556
15636
  var validate = defineCommand({
15557
15637
  kind: "command",
@@ -15619,12 +15699,14 @@ var MODULE_COMMAND_ACTIONS = [
15619
15699
  requiredContext: ["root"],
15620
15700
  binding: convert
15621
15701
  },
15622
- // The refused-tf banner's one action while the tree is out of lace shape:
15623
- // the same `module convert` the toolbar runs. The engine re-derives the
15624
- // tree it writes, which accepts it and lifts the lock.
15702
+ // Convert on the source-refused banner while the tree is out of lace
15703
+ // shape: the same `module convert` the toolbar runs, and the choice the
15704
+ // banner says of it. The engine re-derives the tree it writes, which
15705
+ // accepts it and lifts the lock.
15625
15706
  {
15626
15707
  id: "convert-refused",
15627
15708
  label: "Convert",
15709
+ choice: "Convert restructures it in place; a stack's apply creates only what its state does not hold yet.",
15628
15710
  icon: "convert",
15629
15711
  placement: { row: "source-refused" },
15630
15712
  requiredPorts: ["commands"],
@@ -15674,7 +15756,7 @@ var STACK_COMMAND_ACTIONS = [
15674
15756
  },
15675
15757
  {
15676
15758
  id: "import",
15677
- label: "Import state",
15759
+ label: "Import existing resources",
15678
15760
  placement: "toolbar",
15679
15761
  requiredPorts: ["commands"],
15680
15762
  // `stack import` writes the directory it runs in, the same way
@@ -15682,6 +15764,15 @@ var STACK_COMMAND_ACTIONS = [
15682
15764
  requiredContext: ["root", "stack"],
15683
15765
  binding: importStack
15684
15766
  },
15767
+ {
15768
+ id: "import-partial",
15769
+ label: "Import the rest",
15770
+ placement: { row: "failure" },
15771
+ requiredPorts: ["commands"],
15772
+ requiredContext: ["root", "stack"],
15773
+ answers: ["import_residual"],
15774
+ binding: importPartial
15775
+ },
15685
15776
  {
15686
15777
  id: "preview",
15687
15778
  label: "Preview",
@@ -15718,10 +15809,10 @@ var CORE_COMMAND_ACTIONS = [
15718
15809
  var import_proto8 = require("@lace-cloud/proto");
15719
15810
 
15720
15811
  // src/core/define-overlay.ts
15721
- var import_react26 = require("react");
15812
+ var import_react24 = require("react");
15722
15813
 
15723
15814
  // src/core/use-command-read.ts
15724
- var import_react25 = require("react");
15815
+ var import_react23 = require("react");
15725
15816
 
15726
15817
  // src/utils/is-plain-object.ts
15727
15818
  function isPlainObject(val) {
@@ -15729,11 +15820,11 @@ function isPlainObject(val) {
15729
15820
  }
15730
15821
 
15731
15822
  // src/core/panel-scope.tsx
15732
- var import_react24 = require("react");
15823
+ var import_react22 = require("react");
15733
15824
  var import_jsx_runtime15 = require("react/jsx-runtime");
15734
15825
  var noopReportError = () => {
15735
15826
  };
15736
- var PanelScopeContext = (0, import_react24.createContext)(null);
15827
+ var PanelScopeContext = (0, import_react22.createContext)(null);
15737
15828
  function PanelScope({
15738
15829
  ctx,
15739
15830
  target = {},
@@ -15743,14 +15834,14 @@ function PanelScope({
15743
15834
  children
15744
15835
  }) {
15745
15836
  const reportError = onReadError ?? noopReportError;
15746
- const value = (0, import_react24.useMemo)(
15837
+ const value = (0, import_react22.useMemo)(
15747
15838
  () => ({ ctx, target, paths: new Set(paths), tick, reportError }),
15748
15839
  [ctx, target, paths, tick, reportError]
15749
15840
  );
15750
15841
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(PanelScopeContext.Provider, { value, children });
15751
15842
  }
15752
15843
  function usePanelScope() {
15753
- const value = (0, import_react24.useContext)(PanelScopeContext);
15844
+ const value = (0, import_react22.useContext)(PanelScopeContext);
15754
15845
  if (!value) {
15755
15846
  throw new Error(
15756
15847
  "usePanelScope: not inside a <PanelScope> \u2014 mount panels/overlays through App, which wraps every declared-read contribution"
@@ -15784,20 +15875,20 @@ function useCommandRead(read, target) {
15784
15875
  const effectiveTarget = target ?? scope.target;
15785
15876
  const args = read.args(scope.ctx, effectiveTarget);
15786
15877
  const key = args === null ? null : stableJson(args);
15787
- const [state, setState] = (0, import_react25.useState)(INITIAL);
15788
- const prevKeyRef = (0, import_react25.useRef)(NOT_YET_READ);
15878
+ const [state, setState] = (0, import_react23.useState)(INITIAL);
15879
+ const prevKeyRef = (0, import_react23.useRef)(NOT_YET_READ);
15789
15880
  const inputs = {
15790
15881
  path: read.path,
15791
15882
  args,
15792
15883
  commands: scope.ctx.ports.commands,
15793
15884
  reportError: scope.reportError
15794
15885
  };
15795
- const inputsRef = (0, import_react25.useRef)(inputs);
15796
- (0, import_react25.useEffect)(() => {
15886
+ const inputsRef = (0, import_react23.useRef)(inputs);
15887
+ (0, import_react23.useEffect)(() => {
15797
15888
  inputsRef.current = inputs;
15798
15889
  });
15799
- const request = (0, import_react25.useMemo)(() => ({ key, tick: scope.tick }), [key, scope.tick]);
15800
- (0, import_react25.useEffect)(() => {
15890
+ const request = (0, import_react23.useMemo)(() => ({ key, tick: scope.tick }), [key, scope.tick]);
15891
+ (0, import_react23.useEffect)(() => {
15801
15892
  const { path, args: args2, commands, reportError } = inputsRef.current;
15802
15893
  const keyChanged = prevKeyRef.current !== request.key;
15803
15894
  prevKeyRef.current = request.key;
@@ -15842,7 +15933,7 @@ function defineOverlay(o) {
15842
15933
  useDecorations(ctx) {
15843
15934
  const { data } = useCommandRead(o.read);
15844
15935
  const view = ctx.view;
15845
- return (0, import_react26.useMemo)(
15936
+ return (0, import_react24.useMemo)(
15846
15937
  () => data ? o.decorate(view, data) : EMPTY_DECORATIONS2,
15847
15938
  [o.decorate, view, data]
15848
15939
  );
@@ -15894,7 +15985,7 @@ var describeOverlay = defineOverlay({
15894
15985
  decorate: decorateDescribe
15895
15986
  });
15896
15987
 
15897
- // src/core/panels/ConflictBanner.tsx
15988
+ // src/core/panels/RowActionBanner.tsx
15898
15989
  var import_ui5 = require("@lace-cloud/ui");
15899
15990
 
15900
15991
  // src/components/Banner.tsx
@@ -15915,25 +16006,30 @@ function Banner({ severity, message, className, actions }) {
15915
16006
  );
15916
16007
  }
15917
16008
 
15918
- // src/core/panels/ConflictBanner.tsx
16009
+ // src/core/panels/RowActionBanner.tsx
15919
16010
  var import_jsx_runtime17 = require("react/jsx-runtime");
15920
- function ConflictBanner({ ctx }) {
16011
+ function bannerMessage(opening, actions) {
16012
+ return [opening, ...actions.flatMap((action) => action.choice ? [action.choice] : [])].join(
16013
+ " "
16014
+ );
16015
+ }
16016
+ function RowActionBanner({ ctx, panelId, severity, className, opening }) {
15921
16017
  const { runner } = useCanvas();
15922
16018
  const envExtras = useEditorEnvExtras();
15923
- const actions = rowActionsFor(ctx, "conflict");
16019
+ const actions = rowActionsFor(ctx, panelId);
15924
16020
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15925
16021
  Banner,
15926
16022
  {
15927
- severity: "warning",
15928
- className: "lace-conflict-banner",
15929
- message: "The module's .tf files changed outside the canvas while it held edits of its own.",
15930
- actions: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
16023
+ severity,
16024
+ className,
16025
+ message: bannerMessage(opening, actions),
16026
+ actions: actions.length === 0 ? void 0 : actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
15931
16027
  import_ui5.Button,
15932
16028
  {
15933
16029
  rung: true,
15934
16030
  size: "sm",
15935
16031
  variant: "secondary",
15936
- className: `lace-conflict-banner__${action.id}`,
16032
+ className: `${className}__${action.id}`,
15937
16033
  onClick: () => void runner.run(action, ctx, {}, envExtras),
15938
16034
  children: action.label
15939
16035
  },
@@ -15942,6 +16038,21 @@ function ConflictBanner({ ctx }) {
15942
16038
  }
15943
16039
  );
15944
16040
  }
16041
+
16042
+ // src/core/panels/ConflictBanner.tsx
16043
+ var import_jsx_runtime18 = require("react/jsx-runtime");
16044
+ function ConflictBanner({ ctx }) {
16045
+ return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
16046
+ RowActionBanner,
16047
+ {
16048
+ ctx,
16049
+ panelId: "conflict",
16050
+ severity: "warning",
16051
+ className: "lace-conflict-banner",
16052
+ opening: "The module's .tf files changed outside the canvas while it held edits of its own."
16053
+ }
16054
+ );
16055
+ }
15945
16056
  var conflictPanel = {
15946
16057
  id: "conflict",
15947
16058
  title: "Conflict",
@@ -15955,9 +16066,9 @@ var conflictPanel = {
15955
16066
  var import_ui6 = require("@lace-cloud/ui");
15956
16067
 
15957
16068
  // src/components/Identifier.tsx
15958
- var import_react27 = require("react");
16069
+ var import_react25 = require("react");
15959
16070
  var import_Identifier = require("./Identifier-V6MZ37EG.css");
15960
- var import_jsx_runtime18 = (
16071
+ var import_jsx_runtime19 = (
15961
16072
  // biome-ignore lint/suspicious/noArrayIndexKey: a segment's place in the name is its identity.
15962
16073
  require("react/jsx-runtime")
15963
16074
  );
@@ -15965,15 +16076,15 @@ function identifierSegments(text) {
15965
16076
  return text.split(/(?<=[_.])/);
15966
16077
  }
15967
16078
  function Identifier({ text, className }) {
15968
- return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_react27.Fragment, { children: [
15969
- i > 0 ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("wbr", {}) : null,
16079
+ return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: className ? `lace-identifier ${className}` : "lace-identifier", children: identifierSegments(text).map((segment, i) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react25.Fragment, { children: [
16080
+ i > 0 ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("wbr", {}) : null,
15970
16081
  segment
15971
16082
  ] }, i)) });
15972
16083
  }
15973
16084
 
15974
16085
  // src/core/panels/DiagnosticsPanel.tsx
15975
16086
  var import_DiagnosticsPanel = require("./DiagnosticsPanel-T6VDHH4A.css");
15976
- var import_jsx_runtime19 = require("react/jsx-runtime");
16087
+ var import_jsx_runtime20 = require("react/jsx-runtime");
15977
16088
  function rowKey(d, index) {
15978
16089
  return `${d.severity}:${d.module_key ?? ""}.${d.instance_id ?? ""}:${index}`;
15979
16090
  }
@@ -15981,27 +16092,27 @@ function DiagnosticsPanel({ ctx }) {
15981
16092
  const { runner } = useCanvas();
15982
16093
  const envExtras = useEditorEnvExtras();
15983
16094
  const diagnostics = ctx.diagnostics;
15984
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
16095
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("ul", { className: "lace-diagnostics-panel", role: "list", children: diagnostics.map((d, index) => {
15985
16096
  const key = rowKey(d, index);
15986
16097
  const target = { diagnostic: d };
15987
16098
  const actions = rowActionsFor(ctx, "diagnostics", target);
15988
- return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
16099
+ return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
15989
16100
  "li",
15990
16101
  {
15991
16102
  className: `lace-diagnostics-panel__row lace-diagnostics-panel__row--${d.severity}`,
15992
16103
  children: [
15993
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CanvasIcon, { name: d.severity }) }),
15994
- /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("span", { className: "lace-diagnostics-panel__body", children: [
15995
- /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "lace-diagnostics-panel__message", children: d.message }),
15996
- d.instance_id !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
16104
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "lace-diagnostics-panel__icon", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CanvasIcon, { name: d.severity }) }),
16105
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("span", { className: "lace-diagnostics-panel__body", children: [
16106
+ /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("span", { className: "lace-diagnostics-panel__message", children: d.message }),
16107
+ d.instance_id !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
15997
16108
  Identifier,
15998
16109
  {
15999
16110
  className: "lace-diagnostics-panel__where",
16000
16111
  text: d.input_name ? `${d.instance_id}.${d.input_name}` : d.instance_id
16001
16112
  }
16002
16113
  ),
16003
- d.code !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
16004
- actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
16114
+ d.code !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Identifier, { className: "lace-diagnostics-panel__code", text: d.code }),
16115
+ actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
16005
16116
  import_ui6.Button,
16006
16117
  {
16007
16118
  rung: true,
@@ -16034,13 +16145,13 @@ var diagnosticsPanel = {
16034
16145
 
16035
16146
  // src/core/panels/edge-inspector.ts
16036
16147
  var import_proto10 = require("@lace-cloud/proto");
16037
- var import_react28 = require("react");
16148
+ var import_react26 = require("react");
16038
16149
 
16039
16150
  // src/components/panels/EdgeInspectorPanel.tsx
16040
16151
  var import_proto9 = require("@lace-cloud/proto");
16041
16152
  var import_ui7 = require("@lace-cloud/ui");
16042
16153
  var import_EdgeInspectorPanel = require("./EdgeInspectorPanel-JD6CVUAT.css");
16043
- var import_jsx_runtime20 = require("react/jsx-runtime");
16154
+ var import_jsx_runtime21 = require("react/jsx-runtime");
16044
16155
  function EdgeInspectorPanel({
16045
16156
  source,
16046
16157
  target,
@@ -16049,23 +16160,23 @@ function EdgeInspectorPanel({
16049
16160
  onDelete,
16050
16161
  onClose
16051
16162
  }) {
16052
- const title = /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { children: [
16053
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
16054
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "lace-edge-panel__title", children: [
16055
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Identifier, { text: source }),
16163
+ const title = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
16164
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "lace-edge-panel__title-eyebrow", children: "Connection" }),
16165
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "lace-edge-panel__title", children: [
16166
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Identifier, { text: source }),
16056
16167
  " \u2192 ",
16057
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Identifier, { text: target })
16168
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Identifier, { text: target })
16058
16169
  ] })
16059
16170
  ] });
16060
- const footer = onDelete ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ui7.Button, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
16061
- return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_ui7.Panel, { title, footer, onClose, children: [
16062
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
16063
- /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "lace-edge-panel__wiring", children: [
16064
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : (0, import_proto9.callText)(source) }),
16065
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
16066
- /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Identifier, { text: `${target}.inputs.${targetInput}` })
16171
+ const footer = onDelete ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui7.Button, { rung: true, variant: "danger", fullWidth: true, onClick: onDelete, children: "Delete connection" }) : void 0;
16172
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_ui7.Panel, { title, footer, onClose, children: [
16173
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "lace-edge-panel__section-label", children: "Wiring" }),
16174
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "lace-edge-panel__wiring", children: [
16175
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Identifier, { text: sourceOutput ? `${source}.outputs.${sourceOutput}` : (0, import_proto9.callText)(source) }),
16176
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "lace-edge-panel__wiring-arrow", children: "\u2193" }),
16177
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Identifier, { text: `${target}.inputs.${targetInput}` })
16067
16178
  ] }),
16068
- onDelete && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("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." })
16179
+ onDelete && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("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." })
16069
16180
  ] });
16070
16181
  }
16071
16182
 
@@ -16097,7 +16208,7 @@ function EdgeInspectorPanel2({ ctx }) {
16097
16208
  if (!edge) return null;
16098
16209
  const close = () => setSelection({ nodes: [], edge: null });
16099
16210
  const disconnect = rowActionsFor(ctx, "edge-inspector").find((a) => a.id === "disconnect");
16100
- return (0, import_react28.createElement)(EdgeInspectorPanel, {
16211
+ return (0, import_react26.createElement)(EdgeInspectorPanel, {
16101
16212
  source: edge.source,
16102
16213
  target: edge.target,
16103
16214
  sourceOutput: edge.sourceOutput,
@@ -16124,9 +16235,9 @@ var edgeInspectorPanel = {
16124
16235
 
16125
16236
  // src/core/panels/Markers.tsx
16126
16237
  var import_ui8 = require("@lace-cloud/ui");
16127
- var import_jsx_runtime21 = require("react/jsx-runtime");
16238
+ var import_jsx_runtime22 = require("react/jsx-runtime");
16128
16239
  function UnsavedMarker() {
16129
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui8.Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
16240
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ui8.Badge, { variant: "warning", dot: true, role: "status", className: "lace-marker lace-marker--unsaved", children: "Unsaved" });
16130
16241
  }
16131
16242
  var unsavedMarker = {
16132
16243
  id: "unsaved-marker",
@@ -16138,7 +16249,7 @@ var unsavedMarker = {
16138
16249
  Component: UnsavedMarker
16139
16250
  };
16140
16251
  function UngeneratedMarker() {
16141
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_ui8.Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
16252
+ return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_ui8.Badge, { variant: "neutral", role: "status", className: "lace-marker lace-marker--ungenerated", children: "Not generated" });
16142
16253
  }
16143
16254
  var ungeneratedMarker = {
16144
16255
  id: "ungenerated-marker",
@@ -16151,12 +16262,12 @@ var ungeneratedMarker = {
16151
16262
  };
16152
16263
 
16153
16264
  // src/core/panels/module-config.ts
16154
- var import_react39 = require("react");
16265
+ var import_react37 = require("react");
16155
16266
 
16156
16267
  // src/components/panels/ModuleConfigPanel.tsx
16157
16268
  var import_proto12 = require("@lace-cloud/proto");
16158
16269
  var import_ui17 = require("@lace-cloud/ui");
16159
- var import_react38 = require("react");
16270
+ var import_react36 = require("react");
16160
16271
 
16161
16272
  // src/exhaustive.ts
16162
16273
  function assertNever(value) {
@@ -16164,15 +16275,15 @@ function assertNever(value) {
16164
16275
  }
16165
16276
 
16166
16277
  // src/hooks/useUpdateState.ts
16167
- var import_react29 = require("react");
16278
+ var import_react27 = require("react");
16168
16279
  function useUpdateState(updateFn) {
16169
- const [status, setStatus] = (0, import_react29.useState)("idle");
16170
- const mountedRef = (0, import_react29.useRef)(true);
16171
- const resetTimerRef = (0, import_react29.useRef)(null);
16172
- const safeSetStatus = (0, import_react29.useCallback)((next) => {
16280
+ const [status, setStatus] = (0, import_react27.useState)("idle");
16281
+ const mountedRef = (0, import_react27.useRef)(true);
16282
+ const resetTimerRef = (0, import_react27.useRef)(null);
16283
+ const safeSetStatus = (0, import_react27.useCallback)((next) => {
16173
16284
  if (mountedRef.current) setStatus(next);
16174
16285
  }, []);
16175
- const scheduleReset = (0, import_react29.useCallback)(
16286
+ const scheduleReset = (0, import_react27.useCallback)(
16176
16287
  (delay) => {
16177
16288
  if (resetTimerRef.current !== null) clearTimeout(resetTimerRef.current);
16178
16289
  resetTimerRef.current = setTimeout(() => {
@@ -16182,7 +16293,7 @@ function useUpdateState(updateFn) {
16182
16293
  },
16183
16294
  [safeSetStatus]
16184
16295
  );
16185
- const handleUpdate = (0, import_react29.useCallback)(async () => {
16296
+ const handleUpdate = (0, import_react27.useCallback)(async () => {
16186
16297
  safeSetStatus("updating");
16187
16298
  try {
16188
16299
  await updateFn();
@@ -16193,7 +16304,7 @@ function useUpdateState(updateFn) {
16193
16304
  scheduleReset(2e3);
16194
16305
  }
16195
16306
  }, [updateFn, safeSetStatus, scheduleReset]);
16196
- (0, import_react29.useEffect)(() => {
16307
+ (0, import_react27.useEffect)(() => {
16197
16308
  return () => {
16198
16309
  mountedRef.current = false;
16199
16310
  if (resetTimerRef.current !== null) {
@@ -16206,13 +16317,13 @@ function useUpdateState(updateFn) {
16206
16317
  }
16207
16318
 
16208
16319
  // src/components/AccordionSection.tsx
16209
- var import_react30 = require("react");
16320
+ var import_react28 = require("react");
16210
16321
  var import_AccordionSection = require("./AccordionSection-J3ALHB5M.css");
16211
- var import_jsx_runtime22 = require("react/jsx-runtime");
16322
+ var import_jsx_runtime23 = require("react/jsx-runtime");
16212
16323
  function AccordionSection({ title, defaultOpen = false, badge, children }) {
16213
- const [open, setOpen] = (0, import_react30.useState)(defaultOpen);
16214
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
16215
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
16324
+ const [open, setOpen] = (0, import_react28.useState)(defaultOpen);
16325
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: `lace-accordion${open ? " lace-accordion--open" : ""}`, children: [
16326
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
16216
16327
  "button",
16217
16328
  {
16218
16329
  type: "button",
@@ -16220,13 +16331,13 @@ function AccordionSection({ title, defaultOpen = false, badge, children }) {
16220
16331
  onClick: () => setOpen((v) => !v),
16221
16332
  "aria-expanded": open,
16222
16333
  children: [
16223
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(CanvasIcon, { name: "chevron-right" }) }),
16224
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "lace-accordion__title", children: title }),
16225
- badge && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "lace-accordion__badge", children: badge })
16334
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "lace-accordion__chevron", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(CanvasIcon, { name: "chevron-right" }) }),
16335
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "lace-accordion__title", children: title }),
16336
+ badge && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "lace-accordion__badge", children: badge })
16226
16337
  ]
16227
16338
  }
16228
16339
  ),
16229
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "lace-accordion__body", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "lace-accordion__body-content", children }) }) })
16340
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "lace-accordion__body", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "lace-accordion__body-inner", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "lace-accordion__body-content", children }) }) })
16230
16341
  ] });
16231
16342
  }
16232
16343
 
@@ -16237,7 +16348,7 @@ var import_panels_shared8 = require("./panels-shared-5JFNYXQ7.css");
16237
16348
  // src/components/UpdateButton.tsx
16238
16349
  var import_ui9 = require("@lace-cloud/ui");
16239
16350
  var import_UpdateButton = require("./UpdateButton-TJKSFVBA.css");
16240
- var import_jsx_runtime23 = require("react/jsx-runtime");
16351
+ var import_jsx_runtime24 = require("react/jsx-runtime");
16241
16352
  var variantByStatus = {
16242
16353
  idle: "primary",
16243
16354
  updating: "primary",
@@ -16250,7 +16361,7 @@ var labelByStatus = {
16250
16361
  error: "Update failed \u2014 try again"
16251
16362
  };
16252
16363
  function UpdateButton({ status, label, onClick, disabled, disabledTitle }) {
16253
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "lace-commit-foot", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
16364
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-commit-foot", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16254
16365
  import_ui9.Button,
16255
16366
  {
16256
16367
  rung: true,
@@ -16268,13 +16379,13 @@ function UpdateButton({ status, label, onClick, disabled, disabledTitle }) {
16268
16379
  // src/components/panels/ModuleDetails.tsx
16269
16380
  var import_proto11 = require("@lace-cloud/proto");
16270
16381
  var import_ui16 = require("@lace-cloud/ui");
16271
- var import_react37 = require("react");
16382
+ var import_react35 = require("react");
16272
16383
 
16273
16384
  // src/components/panels/BlockEditor.tsx
16274
16385
  var import_ui10 = require("@lace-cloud/ui");
16275
- var import_react31 = require("react");
16386
+ var import_react29 = require("react");
16276
16387
  var import_panels_shared = require("./panels-shared-5JFNYXQ7.css");
16277
- var import_jsx_runtime24 = require("react/jsx-runtime");
16388
+ var import_jsx_runtime25 = require("react/jsx-runtime");
16278
16389
  function replaceAt(list, index, item) {
16279
16390
  return list.map((x, i) => i === index ? item : x);
16280
16391
  }
@@ -16282,8 +16393,8 @@ function blockTitle(block) {
16282
16393
  return [block.type, ...block.labels.map((l) => `"${l}"`)].join(" ");
16283
16394
  }
16284
16395
  function BlockEditor({ blocks, onChange, editable, templates }) {
16285
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [
16286
- blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16396
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
16397
+ blocks.map((block, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16287
16398
  BlockCard,
16288
16399
  {
16289
16400
  block,
@@ -16293,7 +16404,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
16293
16404
  },
16294
16405
  i
16295
16406
  )),
16296
- editable && (templates ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
16407
+ editable && (templates ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "lace-panel-row-actions", children: templates.map((t) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
16297
16408
  import_ui10.Button,
16298
16409
  {
16299
16410
  variant: "secondary",
@@ -16314,7 +16425,7 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
16314
16425
  ]
16315
16426
  },
16316
16427
  t.type
16317
- )) }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16428
+ )) }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16318
16429
  NewBlockRow,
16319
16430
  {
16320
16431
  onAdd: (type, label) => onChange([
@@ -16326,10 +16437,10 @@ function BlockEditor({ blocks, onChange, editable, templates }) {
16326
16437
  ] });
16327
16438
  }
16328
16439
  function NewBlockRow({ onAdd }) {
16329
- const [type, setType] = (0, import_react31.useState)("");
16330
- const [label, setLabel] = (0, import_react31.useState)("");
16331
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-panel-row-actions", children: [
16332
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16440
+ const [type, setType] = (0, import_react29.useState)("");
16441
+ const [label, setLabel] = (0, import_react29.useState)("");
16442
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-row-actions", children: [
16443
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16333
16444
  import_ui10.Input,
16334
16445
  {
16335
16446
  value: type,
@@ -16339,7 +16450,7 @@ function NewBlockRow({ onAdd }) {
16339
16450
  mono: true
16340
16451
  }
16341
16452
  ),
16342
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16453
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16343
16454
  import_ui10.Input,
16344
16455
  {
16345
16456
  value: label,
@@ -16349,7 +16460,7 @@ function NewBlockRow({ onAdd }) {
16349
16460
  mono: true
16350
16461
  }
16351
16462
  ),
16352
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16463
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16353
16464
  import_ui10.Button,
16354
16465
  {
16355
16466
  variant: "secondary",
@@ -16373,13 +16484,13 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16373
16484
  [field]: value
16374
16485
  })
16375
16486
  });
16376
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-panel-validation-block", children: [
16377
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-panel-row-actions", children: [
16378
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
16379
- editable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16487
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-validation-block", children: [
16488
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-row-actions", children: [
16489
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Identifier, { className: "lace-panel-row-card__name", text: blockTitle(block) }),
16490
+ editable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16380
16491
  import_ui10.IconButton,
16381
16492
  {
16382
- icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CanvasIcon, { name: "close" }),
16493
+ icon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CanvasIcon, { name: "close" }),
16383
16494
  "aria-label": `Remove the ${block.type} block`,
16384
16495
  size: "md",
16385
16496
  tooltipPlacement: "bottom-end",
@@ -16389,8 +16500,8 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16389
16500
  ] }),
16390
16501
  block.attributes.map((attribute, i) => (
16391
16502
  // biome-ignore lint/suspicious/noArrayIndexKey: attributes are positional; the render keeps their order
16392
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "lace-panel-row-actions", children: [
16393
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16503
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-row-actions", children: [
16504
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16394
16505
  import_ui10.Input,
16395
16506
  {
16396
16507
  value: attribute.name,
@@ -16401,7 +16512,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16401
16512
  readOnly: !editable
16402
16513
  }
16403
16514
  ),
16404
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16515
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16405
16516
  import_ui10.Input,
16406
16517
  {
16407
16518
  value: attribute.value,
@@ -16412,10 +16523,10 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16412
16523
  readOnly: !editable
16413
16524
  }
16414
16525
  ),
16415
- editable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16526
+ editable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16416
16527
  import_ui10.IconButton,
16417
16528
  {
16418
- icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(CanvasIcon, { name: "close" }),
16529
+ icon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CanvasIcon, { name: "close" }),
16419
16530
  "aria-label": `Remove ${attribute.name || "the argument"}`,
16420
16531
  size: "md",
16421
16532
  tooltipPlacement: "bottom-end",
@@ -16424,7 +16535,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16424
16535
  )
16425
16536
  ] }, i)
16426
16537
  )),
16427
- editable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16538
+ editable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16428
16539
  import_ui10.Button,
16429
16540
  {
16430
16541
  variant: "secondary",
@@ -16433,7 +16544,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16433
16544
  children: "+ Add argument"
16434
16545
  }
16435
16546
  ),
16436
- (block.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
16547
+ (block.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16437
16548
  BlockEditor,
16438
16549
  {
16439
16550
  blocks: block.blocks,
@@ -16446,7 +16557,7 @@ function BlockCard({ block, editable, onChange, onRemove }) {
16446
16557
 
16447
16558
  // src/components/panels/LocalsPanel.tsx
16448
16559
  var import_ui11 = require("@lace-cloud/ui");
16449
- var import_react32 = require("react");
16560
+ var import_react30 = require("react");
16450
16561
 
16451
16562
  // src/utils/duplicates.ts
16452
16563
  function findDuplicateIndices(items, keyFn) {
@@ -16466,7 +16577,7 @@ function findDuplicateIndices(items, keyFn) {
16466
16577
 
16467
16578
  // src/components/panels/LocalsPanel.tsx
16468
16579
  var import_panels_shared2 = require("./panels-shared-5JFNYXQ7.css");
16469
- var import_jsx_runtime25 = require("react/jsx-runtime");
16580
+ var import_jsx_runtime26 = require("react/jsx-runtime");
16470
16581
  function toRows(locals) {
16471
16582
  return (locals ?? []).map((l) => ({ id: crypto.randomUUID(), ...l }));
16472
16583
  }
@@ -16475,28 +16586,28 @@ function fromRows(rows) {
16475
16586
  }
16476
16587
  function LocalsContent({ locals, onSave }) {
16477
16588
  const { editable } = useCanvas();
16478
- const [rows, setRows] = (0, import_react32.useState)(() => toRows(locals));
16479
- const addLocal = (0, import_react32.useCallback)(() => {
16589
+ const [rows, setRows] = (0, import_react30.useState)(() => toRows(locals));
16590
+ const addLocal = (0, import_react30.useCallback)(() => {
16480
16591
  setRows((prev) => [...prev, { id: crypto.randomUUID(), name: "", value: "" }]);
16481
16592
  }, []);
16482
- const removeLocal = (0, import_react32.useCallback)((index) => {
16593
+ const removeLocal = (0, import_react30.useCallback)((index) => {
16483
16594
  setRows((prev) => prev.filter((_, i) => i !== index));
16484
16595
  }, []);
16485
- const updateRow = (0, import_react32.useCallback)((index, field, value) => {
16596
+ const updateRow = (0, import_react30.useCallback)((index, field, value) => {
16486
16597
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, [field]: value } : r));
16487
16598
  }, []);
16488
16599
  const nameDupes = findDuplicateIndices(rows, (r) => r.name);
16489
16600
  const hasErrors = nameDupes.size > 0;
16490
16601
  const { status: updateStatus, handleUpdate } = useUpdateState(
16491
- (0, import_react32.useCallback)(async () => {
16602
+ (0, import_react30.useCallback)(async () => {
16492
16603
  if (hasErrors) return;
16493
16604
  await onSave(fromRows(rows));
16494
16605
  }, [onSave, rows, hasErrors])
16495
16606
  );
16496
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
16497
- rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16498
- /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "lace-panel-row-actions", children: [
16499
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16607
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
16608
+ rows.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16609
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-actions", children: [
16610
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16500
16611
  import_ui11.Input,
16501
16612
  {
16502
16613
  value: row.name,
@@ -16509,10 +16620,10 @@ function LocalsContent({ locals, onSave }) {
16509
16620
  readOnly: !editable
16510
16621
  }
16511
16622
  ),
16512
- editable && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16623
+ editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16513
16624
  import_ui11.IconButton,
16514
16625
  {
16515
- icon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CanvasIcon, { name: "close" }),
16626
+ icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CanvasIcon, { name: "close" }),
16516
16627
  "aria-label": "Remove local",
16517
16628
  size: "md",
16518
16629
  tooltipPlacement: "bottom-end",
@@ -16520,8 +16631,8 @@ function LocalsContent({ locals, onSave }) {
16520
16631
  }
16521
16632
  )
16522
16633
  ] }),
16523
- nameDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
16524
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16634
+ nameDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate local name" }),
16635
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16525
16636
  import_ui11.Textarea,
16526
16637
  {
16527
16638
  value: row.value,
@@ -16535,9 +16646,9 @@ function LocalsContent({ locals, onSave }) {
16535
16646
  }
16536
16647
  ) })
16537
16648
  ] }, row.id)),
16538
- editable && /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_jsx_runtime25.Fragment, { children: [
16539
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui11.Button, { variant: "secondary", size: "sm", onClick: addLocal, children: "+ Add local" }),
16540
- /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
16649
+ editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
16650
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui11.Button, { variant: "secondary", size: "sm", onClick: addLocal, children: "+ Add local" }),
16651
+ /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16541
16652
  UpdateButton,
16542
16653
  {
16543
16654
  status: updateStatus,
@@ -16551,14 +16662,14 @@ function LocalsContent({ locals, onSave }) {
16551
16662
  ] });
16552
16663
  }
16553
16664
  function LocalsPanel({ locals, onSave, onClose }) {
16554
- return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_ui11.Panel, { title: "Locals", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(LocalsContent, { locals, onSave }) });
16665
+ return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui11.Panel, { title: "Locals", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LocalsContent, { locals, onSave }) });
16555
16666
  }
16556
16667
 
16557
16668
  // src/components/panels/ModuleInterfacePanel.tsx
16558
16669
  var import_ui12 = require("@lace-cloud/ui");
16559
- var import_react33 = require("react");
16670
+ var import_react31 = require("react");
16560
16671
  var import_panels_shared3 = require("./panels-shared-5JFNYXQ7.css");
16561
- var import_jsx_runtime26 = require("react/jsx-runtime");
16672
+ var import_jsx_runtime27 = require("react/jsx-runtime");
16562
16673
  function variablesToRows(variables) {
16563
16674
  return variables.map((v) => ({
16564
16675
  id: crypto.randomUUID(),
@@ -16596,17 +16707,17 @@ function outputName(text) {
16596
16707
  }
16597
16708
  function ModuleInterfaceContent({ settings, onSave }) {
16598
16709
  const { editable } = useCanvas();
16599
- const [variables, setVariables2] = (0, import_react33.useState)(
16710
+ const [variables, setVariables2] = (0, import_react31.useState)(
16600
16711
  () => variablesToRows(settings.variables)
16601
16712
  );
16602
- const [outputs, setOutputs2] = (0, import_react33.useState)(() => outputsToRows(settings.outputs));
16603
- const updateVariable = (0, import_react33.useCallback)(
16713
+ const [outputs, setOutputs2] = (0, import_react31.useState)(() => outputsToRows(settings.outputs));
16714
+ const updateVariable = (0, import_react31.useCallback)(
16604
16715
  (index, field, value) => {
16605
16716
  setVariables2((prev) => prev.map((v, i) => i === index ? { ...v, [field]: value } : v));
16606
16717
  },
16607
16718
  []
16608
16719
  );
16609
- const addVariable = (0, import_react33.useCallback)(() => {
16720
+ const addVariable = (0, import_react31.useCallback)(() => {
16610
16721
  setVariables2((prev) => [
16611
16722
  ...prev,
16612
16723
  {
@@ -16624,7 +16735,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16624
16735
  }
16625
16736
  ]);
16626
16737
  }, []);
16627
- const addValidation = (0, import_react33.useCallback)((index) => {
16738
+ const addValidation = (0, import_react31.useCallback)((index) => {
16628
16739
  setVariables2(
16629
16740
  (prev) => prev.map(
16630
16741
  (v, i) => i === index ? {
@@ -16637,14 +16748,14 @@ function ModuleInterfaceContent({ settings, onSave }) {
16637
16748
  )
16638
16749
  );
16639
16750
  }, []);
16640
- const removeValidation = (0, import_react33.useCallback)((index, vIndex) => {
16751
+ const removeValidation = (0, import_react31.useCallback)((index, vIndex) => {
16641
16752
  setVariables2(
16642
16753
  (prev) => prev.map(
16643
16754
  (v, i) => i === index ? { ...v, validation: v.validation.filter((_, j) => j !== vIndex) } : v
16644
16755
  )
16645
16756
  );
16646
16757
  }, []);
16647
- const updateValidation = (0, import_react33.useCallback)(
16758
+ const updateValidation = (0, import_react31.useCallback)(
16648
16759
  (index, vIndex, field, value) => {
16649
16760
  setVariables2(
16650
16761
  (prev) => prev.map(
@@ -16659,19 +16770,19 @@ function ModuleInterfaceContent({ settings, onSave }) {
16659
16770
  },
16660
16771
  []
16661
16772
  );
16662
- const updateOutput = (0, import_react33.useCallback)(
16773
+ const updateOutput = (0, import_react31.useCallback)(
16663
16774
  (index, field, value) => {
16664
16775
  setOutputs2((prev) => prev.map((o, i) => i === index ? { ...o, [field]: value } : o));
16665
16776
  },
16666
16777
  []
16667
16778
  );
16668
- const addOutput = (0, import_react33.useCallback)((name, value) => {
16779
+ const addOutput = (0, import_react31.useCallback)((name, value) => {
16669
16780
  setOutputs2((prev) => [
16670
16781
  ...prev,
16671
16782
  { id: crypto.randomUUID(), name, value, description: "", sensitive: false, depends_on: [] }
16672
16783
  ]);
16673
16784
  }, []);
16674
- const toggleDependsOn = (0, import_react33.useCallback)((index, dep) => {
16785
+ const toggleDependsOn = (0, import_react31.useCallback)((index, dep) => {
16675
16786
  setOutputs2(
16676
16787
  (prev) => prev.map((o, i) => {
16677
16788
  if (i !== index) return o;
@@ -16688,7 +16799,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16688
16799
  const unnamedOutput = outputs.some((o) => !o.name.trim() || !o.value.trim());
16689
16800
  const hasErrors = variableDupes.size > 0 || outputDupes.size > 0 || unnamedOutput;
16690
16801
  const { status: updateStatus, handleUpdate } = useUpdateState(
16691
- (0, import_react33.useCallback)(async () => {
16802
+ (0, import_react31.useCallback)(async () => {
16692
16803
  if (hasErrors) return;
16693
16804
  const variableDefs = variables.filter((v) => v.name.trim()).map((v) => {
16694
16805
  const validation = v.validation.map((b) => ({ condition: b.condition.trim(), error_message: b.error_message.trim() })).filter((b) => b.condition || b.error_message);
@@ -16719,13 +16830,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
16719
16830
  }, [variables, outputs, hasErrors, onSave])
16720
16831
  );
16721
16832
  const exposable = settings.call_outputs.filter((text) => !outputs.some((o) => o.value === text));
16722
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
16723
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
16724
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
16725
- variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-hint", children: "No variables." }),
16726
- variables.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16727
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-actions", children: [
16728
- v.added ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16833
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
16834
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-hint", children: "The module's public surface: the variables its callers set and the outputs they read." }),
16835
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
16836
+ variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-hint", children: "No variables." }),
16837
+ variables.map((v, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16838
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
16839
+ v.added ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16729
16840
  import_ui12.Input,
16730
16841
  {
16731
16842
  label: "Name",
@@ -16736,11 +16847,11 @@ function ModuleInterfaceContent({ settings, onSave }) {
16736
16847
  mono: true,
16737
16848
  error: variableDupes.has(i)
16738
16849
  }
16739
- ) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
16740
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16850
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Identifier, { className: "lace-panel-row-card__name", text: v.name }),
16851
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16741
16852
  import_ui12.IconButton,
16742
16853
  {
16743
- icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CanvasIcon, { name: "close" }),
16854
+ icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CanvasIcon, { name: "close" }),
16744
16855
  "aria-label": `Remove variable ${v.name}`,
16745
16856
  size: "md",
16746
16857
  tooltipPlacement: "bottom-end",
@@ -16748,8 +16859,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
16748
16859
  }
16749
16860
  )
16750
16861
  ] }),
16751
- variableDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
16752
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16862
+ variableDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-error", children: "Duplicate variable name" }),
16863
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16753
16864
  import_ui12.Input,
16754
16865
  {
16755
16866
  label: "Type",
@@ -16761,8 +16872,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
16761
16872
  readOnly: !editable
16762
16873
  }
16763
16874
  ) }),
16764
- v.defaultText && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui12.Input, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
16765
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16875
+ v.defaultText && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui12.Input, { label: "Default", value: v.defaultText, fullWidth: true, mono: true, readOnly: true }) }),
16876
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16766
16877
  import_ui12.Textarea,
16767
16878
  {
16768
16879
  label: "Description",
@@ -16774,9 +16885,9 @@ function ModuleInterfaceContent({ settings, onSave }) {
16774
16885
  readOnly: !editable
16775
16886
  }
16776
16887
  ) }),
16777
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-actions", children: [
16778
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16779
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16888
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
16889
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16890
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16780
16891
  "input",
16781
16892
  {
16782
16893
  type: "checkbox",
@@ -16785,10 +16896,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
16785
16896
  disabled: !editable
16786
16897
  }
16787
16898
  ),
16788
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Required" })
16899
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Required" })
16789
16900
  ] }),
16790
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16791
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16901
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16902
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16792
16903
  "input",
16793
16904
  {
16794
16905
  type: "checkbox",
@@ -16797,10 +16908,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
16797
16908
  disabled: !editable
16798
16909
  }
16799
16910
  ),
16800
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Ephemeral" })
16911
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Ephemeral" })
16801
16912
  ] }),
16802
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16803
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16913
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16914
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16804
16915
  "input",
16805
16916
  {
16806
16917
  type: "checkbox",
@@ -16809,10 +16920,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
16809
16920
  disabled: !editable
16810
16921
  }
16811
16922
  ),
16812
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Sensitive" })
16923
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Sensitive" })
16813
16924
  ] }),
16814
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16815
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16925
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16926
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16816
16927
  "input",
16817
16928
  {
16818
16929
  type: "checkbox",
@@ -16821,13 +16932,13 @@ function ModuleInterfaceContent({ settings, onSave }) {
16821
16932
  disabled: !editable
16822
16933
  }
16823
16934
  ),
16824
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Nullable" })
16935
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Nullable" })
16825
16936
  ] })
16826
16937
  ] }),
16827
- (v.validation.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-content", children: [
16828
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-subsection-label", children: "Validation" }),
16829
- v.validation.map((block, j) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-validation-block", children: [
16830
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16938
+ (v.validation.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-content", children: [
16939
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-subsection-label", children: "Validation" }),
16940
+ v.validation.map((block, j) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-validation-block", children: [
16941
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16831
16942
  import_ui12.Input,
16832
16943
  {
16833
16944
  value: block.condition,
@@ -16839,7 +16950,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16839
16950
  readOnly: !editable
16840
16951
  }
16841
16952
  ),
16842
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16953
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16843
16954
  import_ui12.Input,
16844
16955
  {
16845
16956
  value: block.error_message,
@@ -16850,10 +16961,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
16850
16961
  readOnly: !editable
16851
16962
  }
16852
16963
  ),
16853
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16964
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16854
16965
  import_ui12.IconButton,
16855
16966
  {
16856
- icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CanvasIcon, { name: "close" }),
16967
+ icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CanvasIcon, { name: "close" }),
16857
16968
  "aria-label": "Remove validation rule",
16858
16969
  size: "md",
16859
16970
  tooltipPlacement: "bottom-end",
@@ -16861,15 +16972,15 @@ function ModuleInterfaceContent({ settings, onSave }) {
16861
16972
  }
16862
16973
  )
16863
16974
  ] }, block.id)),
16864
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
16975
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: () => addValidation(i), children: "+ Add validation rule" })
16865
16976
  ] })
16866
16977
  ] }, v.id)),
16867
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
16868
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
16869
- outputs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-hint", children: "No outputs." }),
16870
- outputs.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16871
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-actions", children: [
16872
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16978
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: addVariable, children: "+ Add variable" }),
16979
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
16980
+ outputs.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-hint", children: "No outputs." }),
16981
+ outputs.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
16982
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
16983
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16873
16984
  import_ui12.Input,
16874
16985
  {
16875
16986
  label: "Name",
@@ -16882,10 +16993,10 @@ function ModuleInterfaceContent({ settings, onSave }) {
16882
16993
  error: outputDupes.has(i) || editable && !o.name.trim()
16883
16994
  }
16884
16995
  ),
16885
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
16996
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16886
16997
  import_ui12.IconButton,
16887
16998
  {
16888
- icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CanvasIcon, { name: "close" }),
16999
+ icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CanvasIcon, { name: "close" }),
16889
17000
  "aria-label": `Remove output ${o.name}`,
16890
17001
  size: "md",
16891
17002
  tooltipPlacement: "bottom-end",
@@ -16893,7 +17004,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16893
17004
  }
16894
17005
  )
16895
17006
  ] }),
16896
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17007
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16897
17008
  import_ui12.Input,
16898
17009
  {
16899
17010
  label: "Value",
@@ -16906,7 +17017,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16906
17017
  error: editable && !o.value.trim()
16907
17018
  }
16908
17019
  ) }),
16909
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17020
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-content", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16910
17021
  import_ui12.Textarea,
16911
17022
  {
16912
17023
  label: "Description",
@@ -16918,8 +17029,8 @@ function ModuleInterfaceContent({ settings, onSave }) {
16918
17029
  readOnly: !editable
16919
17030
  }
16920
17031
  ) }),
16921
- /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16922
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17032
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
17033
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16923
17034
  "input",
16924
17035
  {
16925
17036
  type: "checkbox",
@@ -16928,12 +17039,12 @@ function ModuleInterfaceContent({ settings, onSave }) {
16928
17039
  disabled: !editable
16929
17040
  }
16930
17041
  ),
16931
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { children: "Sensitive" })
17042
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { children: "Sensitive" })
16932
17043
  ] }),
16933
- (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-content", children: [
16934
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
16935
- !editable ? o.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
16936
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17044
+ (o.depends_on.length > 0 || editable && settings.dependency_options.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-content", children: [
17045
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-subsection-label", children: "Depends on" }),
17046
+ !editable ? o.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Identifier, { text: dep }) }, dep)) : settings.dependency_options.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
17047
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16937
17048
  "input",
16938
17049
  {
16939
17050
  type: "checkbox",
@@ -16941,14 +17052,14 @@ function ModuleInterfaceContent({ settings, onSave }) {
16941
17052
  onChange: () => toggleDependsOn(i, dep)
16942
17053
  }
16943
17054
  ),
16944
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Identifier, { text: dep })
17055
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Identifier, { text: dep })
16945
17056
  ] }, dep))
16946
17057
  ] }),
16947
- outputDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
17058
+ outputDupes.has(i) && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-error", children: "Output names must be unique." })
16948
17059
  ] }, o.id)),
16949
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "lace-panel-row-actions", children: [
16950
- /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
16951
- exposable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17060
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
17061
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui12.Button, { variant: "secondary", size: "sm", onClick: () => addOutput("", ""), children: "+ Add output" }),
17062
+ exposable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16952
17063
  import_ui12.Select,
16953
17064
  {
16954
17065
  "aria-label": "Expose a call's output",
@@ -16964,7 +17075,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16964
17075
  }
16965
17076
  )
16966
17077
  ] }),
16967
- editable && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
17078
+ editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
16968
17079
  UpdateButton,
16969
17080
  {
16970
17081
  status: updateStatus,
@@ -16977,7 +17088,7 @@ function ModuleInterfaceContent({ settings, onSave }) {
16977
17088
  ] });
16978
17089
  }
16979
17090
  function ModuleInterfacePanel({ onClose, ...content }) {
16980
- return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_ui12.Panel, { title: "Module Interface", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(ModuleInterfaceContent, { ...content }) });
17091
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui12.Panel, { title: "Module Interface", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModuleInterfaceContent, { ...content }) });
16981
17092
  }
16982
17093
 
16983
17094
  // src/components/panels/module-actions.ts
@@ -17095,9 +17206,9 @@ var import_panels_shared7 = require("./panels-shared-5JFNYXQ7.css");
17095
17206
 
17096
17207
  // src/components/panels/ProvidersPanel.tsx
17097
17208
  var import_ui13 = require("@lace-cloud/ui");
17098
- var import_react34 = require("react");
17209
+ var import_react32 = require("react");
17099
17210
  var import_panels_shared4 = require("./panels-shared-5JFNYXQ7.css");
17100
- var import_jsx_runtime27 = require("react/jsx-runtime");
17211
+ var import_jsx_runtime28 = require("react/jsx-runtime");
17101
17212
  function toRows2(providers) {
17102
17213
  if (!providers || providers.length === 0) return [];
17103
17214
  return providers.map((p) => ({
@@ -17125,8 +17236,8 @@ function fromRows2(rows) {
17125
17236
  }
17126
17237
  function ProvidersContent({ providers, onSave }) {
17127
17238
  const { editable } = useCanvas();
17128
- const [rows, setRows] = (0, import_react34.useState)(() => toRows2(providers));
17129
- const addProvider = (0, import_react34.useCallback)(() => {
17239
+ const [rows, setRows] = (0, import_react32.useState)(() => toRows2(providers));
17240
+ const addProvider = (0, import_react32.useCallback)(() => {
17130
17241
  setRows((prev) => [
17131
17242
  ...prev,
17132
17243
  {
@@ -17138,16 +17249,16 @@ function ProvidersContent({ providers, onSave }) {
17138
17249
  }
17139
17250
  ]);
17140
17251
  }, []);
17141
- const removeProvider = (0, import_react34.useCallback)((index) => {
17252
+ const removeProvider = (0, import_react32.useCallback)((index) => {
17142
17253
  setRows((prev) => prev.filter((_, i) => i !== index));
17143
17254
  }, []);
17144
- const updateField = (0, import_react34.useCallback)((index, field, value) => {
17255
+ const updateField = (0, import_react32.useCallback)((index, field, value) => {
17145
17256
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, [field]: value } : r));
17146
17257
  }, []);
17147
- const updateBlocks = (0, import_react34.useCallback)((index, blocks) => {
17258
+ const updateBlocks = (0, import_react32.useCallback)((index, blocks) => {
17148
17259
  setRows((prev) => prev.map((r, i) => i === index ? { ...r, blocks } : r));
17149
17260
  }, []);
17150
- const addConfigEntry = (0, import_react34.useCallback)((providerIndex) => {
17261
+ const addConfigEntry = (0, import_react32.useCallback)((providerIndex) => {
17151
17262
  setRows(
17152
17263
  (prev) => prev.map(
17153
17264
  (r, i) => i === providerIndex ? {
@@ -17157,14 +17268,14 @@ function ProvidersContent({ providers, onSave }) {
17157
17268
  )
17158
17269
  );
17159
17270
  }, []);
17160
- const removeConfigEntry = (0, import_react34.useCallback)((providerIndex, entryIndex) => {
17271
+ const removeConfigEntry = (0, import_react32.useCallback)((providerIndex, entryIndex) => {
17161
17272
  setRows(
17162
17273
  (prev) => prev.map(
17163
17274
  (r, i) => i === providerIndex ? { ...r, configEntries: r.configEntries.filter((_, ei) => ei !== entryIndex) } : r
17164
17275
  )
17165
17276
  );
17166
17277
  }, []);
17167
- const updateConfigEntry = (0, import_react34.useCallback)(
17278
+ const updateConfigEntry = (0, import_react32.useCallback)(
17168
17279
  (providerIndex, entryIndex, field, value) => {
17169
17280
  setRows(
17170
17281
  (prev) => prev.map(
@@ -17180,14 +17291,14 @@ function ProvidersContent({ providers, onSave }) {
17180
17291
  []
17181
17292
  );
17182
17293
  const { status: updateStatus, handleUpdate } = useUpdateState(
17183
- (0, import_react34.useCallback)(async () => {
17294
+ (0, import_react32.useCallback)(async () => {
17184
17295
  await onSave(fromRows2(rows));
17185
17296
  }, [onSave, rows])
17186
17297
  );
17187
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
17188
- rows.map((row, pi) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17189
- /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
17190
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17298
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17299
+ rows.map((row, pi) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17300
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
17301
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17191
17302
  import_ui13.Input,
17192
17303
  {
17193
17304
  value: row.name,
@@ -17197,7 +17308,7 @@ function ProvidersContent({ providers, onSave }) {
17197
17308
  readOnly: !editable
17198
17309
  }
17199
17310
  ),
17200
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17311
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17201
17312
  import_ui13.Input,
17202
17313
  {
17203
17314
  value: row.alias,
@@ -17207,10 +17318,10 @@ function ProvidersContent({ providers, onSave }) {
17207
17318
  readOnly: !editable
17208
17319
  }
17209
17320
  ),
17210
- editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17321
+ editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17211
17322
  import_ui13.IconButton,
17212
17323
  {
17213
- icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CanvasIcon, { name: "close" }),
17324
+ icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
17214
17325
  "aria-label": "Remove provider",
17215
17326
  size: "md",
17216
17327
  tooltipPlacement: "bottom-end",
@@ -17218,9 +17329,9 @@ function ProvidersContent({ providers, onSave }) {
17218
17329
  }
17219
17330
  )
17220
17331
  ] }),
17221
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-sublabel", children: "Config" }),
17222
- row.configEntries.map((entry, ei) => /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)("div", { className: "lace-panel-row-actions", children: [
17223
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17332
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-sublabel", children: "Config" }),
17333
+ row.configEntries.map((entry, ei) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
17334
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17224
17335
  import_ui13.Input,
17225
17336
  {
17226
17337
  value: entry.key,
@@ -17230,7 +17341,7 @@ function ProvidersContent({ providers, onSave }) {
17230
17341
  readOnly: !editable
17231
17342
  }
17232
17343
  ),
17233
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17344
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17234
17345
  import_ui13.Input,
17235
17346
  {
17236
17347
  value: entry.value,
@@ -17240,10 +17351,10 @@ function ProvidersContent({ providers, onSave }) {
17240
17351
  readOnly: !editable
17241
17352
  }
17242
17353
  ),
17243
- editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17354
+ editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17244
17355
  import_ui13.IconButton,
17245
17356
  {
17246
- icon: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(CanvasIcon, { name: "close" }),
17357
+ icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
17247
17358
  "aria-label": "Remove config key",
17248
17359
  size: "md",
17249
17360
  tooltipPlacement: "bottom-end",
@@ -17251,10 +17362,10 @@ function ProvidersContent({ providers, onSave }) {
17251
17362
  }
17252
17363
  )
17253
17364
  ] }, entry.id)),
17254
- editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui13.Button, { variant: "secondary", size: "sm", onClick: () => addConfigEntry(pi), children: "+ Add config key" }),
17255
- (row.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
17256
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
17257
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
17365
+ editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui13.Button, { variant: "secondary", size: "sm", onClick: () => addConfigEntry(pi), children: "+ Add config key" }),
17366
+ (row.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17367
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
17368
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17258
17369
  BlockEditor,
17259
17370
  {
17260
17371
  blocks: row.blocks,
@@ -17264,21 +17375,21 @@ function ProvidersContent({ providers, onSave }) {
17264
17375
  )
17265
17376
  ] })
17266
17377
  ] }, row.id)),
17267
- editable && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
17268
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui13.Button, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
17269
- /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(UpdateButton, { status: updateStatus, label: "Update providers", onClick: handleUpdate })
17378
+ editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17379
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui13.Button, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
17380
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(UpdateButton, { status: updateStatus, label: "Update providers", onClick: handleUpdate })
17270
17381
  ] })
17271
17382
  ] });
17272
17383
  }
17273
17384
  function ProvidersPanel({ providers, onSave, onClose }) {
17274
- return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_ui13.Panel, { title: "Providers", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ProvidersContent, { providers, onSave }) });
17385
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui13.Panel, { title: "Providers", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ProvidersContent, { providers, onSave }) });
17275
17386
  }
17276
17387
 
17277
17388
  // src/components/panels/ResourcesPanel.tsx
17278
17389
  var import_ui14 = require("@lace-cloud/ui");
17279
- var import_react35 = require("react");
17390
+ var import_react33 = require("react");
17280
17391
  var import_panels_shared5 = require("./panels-shared-5JFNYXQ7.css");
17281
- var import_jsx_runtime28 = require("react/jsx-runtime");
17392
+ var import_jsx_runtime29 = require("react/jsx-runtime");
17282
17393
  function ResourcesContent({
17283
17394
  resources,
17284
17395
  dependencyOptions,
@@ -17288,9 +17399,9 @@ function ResourcesContent({
17288
17399
  onAdd
17289
17400
  }) {
17290
17401
  const { editable } = useCanvas();
17291
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17292
- resources.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
17293
- resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17402
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
17403
+ resources.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-hint", children: "No resources or data sources." }),
17404
+ resources.map((resource) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17294
17405
  ResourceCard,
17295
17406
  {
17296
17407
  resource,
@@ -17303,7 +17414,7 @@ function ResourcesContent({
17303
17414
  },
17304
17415
  JSON.stringify(resource)
17305
17416
  )),
17306
- editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(NewResourceRow, { managed, onAdd })
17417
+ editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(NewResourceRow, { managed, onAdd })
17307
17418
  ] });
17308
17419
  }
17309
17420
  var MANAGED_OPTION = { value: "resource", label: "Resource" };
@@ -17313,14 +17424,14 @@ function NewResourceRow({
17313
17424
  onAdd
17314
17425
  }) {
17315
17426
  const options = managed ? [MANAGED_OPTION, DATA_OPTION] : [DATA_OPTION];
17316
- const [chosen, setChosen] = (0, import_react35.useState)("resource");
17427
+ const [chosen, setChosen] = (0, import_react33.useState)("resource");
17317
17428
  const kind = managed ? chosen : "data";
17318
- const [type, setType] = (0, import_react35.useState)("");
17319
- const [name, setName] = (0, import_react35.useState)("");
17320
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-card", children: [
17321
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
17322
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
17323
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17429
+ const [type, setType] = (0, import_react33.useState)("");
17430
+ const [name, setName] = (0, import_react33.useState)("");
17431
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-card", children: [
17432
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-subsection-label", children: "Add a resource" }),
17433
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-actions", children: [
17434
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17324
17435
  import_ui14.Select,
17325
17436
  {
17326
17437
  "aria-label": "New resource kind",
@@ -17329,7 +17440,7 @@ function NewResourceRow({
17329
17440
  onChange: (e) => setChosen(e.target.value === "data" ? "data" : "resource")
17330
17441
  }
17331
17442
  ),
17332
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17443
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17333
17444
  import_ui14.Input,
17334
17445
  {
17335
17446
  value: type,
@@ -17339,7 +17450,7 @@ function NewResourceRow({
17339
17450
  mono: true
17340
17451
  }
17341
17452
  ),
17342
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17453
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17343
17454
  import_ui14.Input,
17344
17455
  {
17345
17456
  value: name,
@@ -17349,7 +17460,7 @@ function NewResourceRow({
17349
17460
  mono: true
17350
17461
  }
17351
17462
  ),
17352
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17463
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17353
17464
  import_ui14.Button,
17354
17465
  {
17355
17466
  variant: "secondary",
@@ -17367,8 +17478,8 @@ function NewResourceRow({
17367
17478
  ] });
17368
17479
  }
17369
17480
  function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemove }) {
17370
- const [draft, setDraft] = (0, import_react35.useState)(resource);
17371
- const set = (0, import_react35.useCallback)(
17481
+ const [draft, setDraft] = (0, import_react33.useState)(resource);
17482
+ const set = (0, import_react33.useCallback)(
17372
17483
  (field, value) => setDraft((prev) => ({ ...prev, [field]: value })),
17373
17484
  []
17374
17485
  );
@@ -17379,7 +17490,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17379
17490
  const argumentDupes = findDuplicateIndices(draft.arguments, (a) => a.name);
17380
17491
  const hasErrors = argumentDupes.size > 0 || draft.arguments.some((a) => !a.name.trim());
17381
17492
  const { status, handleUpdate } = useUpdateState(
17382
- (0, import_react35.useCallback)(async () => {
17493
+ (0, import_react33.useCallback)(async () => {
17383
17494
  if (hasErrors) return;
17384
17495
  await onUpdate(resource, draft);
17385
17496
  }, [onUpdate, resource, draft, hasErrors])
@@ -17389,20 +17500,20 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17389
17500
  { field: "for_each", placeholder: "e.g. var.names" },
17390
17501
  { field: "provider", placeholder: "e.g. aws.west" }
17391
17502
  ];
17392
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17393
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
17394
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_ui14.Badge, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
17395
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17503
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17504
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-actions", children: [
17505
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_ui14.Badge, { variant: resource.kind === "data" ? "info" : "neutral", children: resource.kind === "data" ? "data" : "resource" }),
17506
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17396
17507
  Identifier,
17397
17508
  {
17398
17509
  className: "lace-panel-row-card__name",
17399
17510
  text: `${resource.type}.${resource.name}`
17400
17511
  }
17401
17512
  ),
17402
- editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17513
+ editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17403
17514
  import_ui14.IconButton,
17404
17515
  {
17405
- icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
17516
+ icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CanvasIcon, { name: "close" }),
17406
17517
  "aria-label": `Remove ${resource.type}.${resource.name}`,
17407
17518
  size: "md",
17408
17519
  tooltipPlacement: "bottom-end",
@@ -17411,7 +17522,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17411
17522
  )
17412
17523
  ] }),
17413
17524
  metaArguments.map(
17414
- ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17525
+ ({ field, placeholder }) => draft[field] || editable ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17415
17526
  import_ui14.Input,
17416
17527
  {
17417
17528
  label: field,
@@ -17424,11 +17535,11 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17424
17535
  }
17425
17536
  ) }, field) : null
17426
17537
  ),
17427
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
17538
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-sublabel", children: "Arguments" }),
17428
17539
  draft.arguments.map((argument, i) => (
17429
17540
  // biome-ignore lint/suspicious/noArrayIndexKey: argument rows are positional while edited
17430
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: "lace-panel-row-actions", children: [
17431
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17541
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-actions", children: [
17542
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17432
17543
  import_ui14.Input,
17433
17544
  {
17434
17545
  value: argument.name,
@@ -17440,7 +17551,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17440
17551
  error: argumentDupes.has(i)
17441
17552
  }
17442
17553
  ),
17443
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17554
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17444
17555
  import_ui14.Input,
17445
17556
  {
17446
17557
  value: argument.value,
@@ -17451,10 +17562,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17451
17562
  readOnly: !editable
17452
17563
  }
17453
17564
  ),
17454
- editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17565
+ editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17455
17566
  import_ui14.IconButton,
17456
17567
  {
17457
- icon: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CanvasIcon, { name: "close" }),
17568
+ icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CanvasIcon, { name: "close" }),
17458
17569
  "aria-label": `Remove ${argument.name || "the argument"}`,
17459
17570
  size: "md",
17460
17571
  tooltipPlacement: "bottom-end",
@@ -17466,7 +17577,7 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17466
17577
  )
17467
17578
  ] }, i)
17468
17579
  )),
17469
- editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17580
+ editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17470
17581
  import_ui14.Button,
17471
17582
  {
17472
17583
  variant: "secondary",
@@ -17475,9 +17586,9 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17475
17586
  children: "+ Add argument"
17476
17587
  }
17477
17588
  ),
17478
- (draft.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17479
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
17480
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17589
+ (draft.blocks.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
17590
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-sublabel", children: "Nested blocks" }),
17591
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17481
17592
  BlockEditor,
17482
17593
  {
17483
17594
  blocks: draft.blocks,
@@ -17486,10 +17597,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17486
17597
  }
17487
17598
  )
17488
17599
  ] }),
17489
- (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
17490
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
17491
- !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
17492
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17600
+ (draft.depends_on.length > 0 || editable && dependencyOptions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
17601
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-sublabel", children: "Depends on" }),
17602
+ !editable ? draft.depends_on.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Identifier, { text: dep }) }, dep)) : dependencyOptions.map((dep) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("label", { className: "lace-panel-checkbox-row", children: [
17603
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17493
17604
  "input",
17494
17605
  {
17495
17606
  type: "checkbox",
@@ -17500,10 +17611,10 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17500
17611
  )
17501
17612
  }
17502
17613
  ),
17503
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Identifier, { text: dep })
17614
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Identifier, { text: dep })
17504
17615
  ] }, dep))
17505
17616
  ] }),
17506
- editable && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
17617
+ editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17507
17618
  UpdateButton,
17508
17619
  {
17509
17620
  status,
@@ -17518,13 +17629,13 @@ function ResourceCard({ resource, dependencyOptions, editable, onUpdate, onRemov
17518
17629
 
17519
17630
  // src/components/panels/TerraformConfigPanel.tsx
17520
17631
  var import_ui15 = require("@lace-cloud/ui");
17521
- var import_react36 = require("react");
17632
+ var import_react34 = require("react");
17522
17633
  var import_panels_shared6 = require("./panels-shared-5JFNYXQ7.css");
17523
- var import_jsx_runtime29 = require("react/jsx-runtime");
17634
+ var import_jsx_runtime30 = require("react/jsx-runtime");
17524
17635
  function TerraformConfigContent({ terraform, onSave }) {
17525
17636
  const { editable } = useCanvas();
17526
- const [requiredVersion, setRequiredVersion] = (0, import_react36.useState)(terraform?.required_version ?? "");
17527
- const [providers, setProviders2] = (0, import_react36.useState)(() => {
17637
+ const [requiredVersion, setRequiredVersion] = (0, import_react34.useState)(terraform?.required_version ?? "");
17638
+ const [providers, setProviders2] = (0, import_react34.useState)(() => {
17528
17639
  if (!terraform?.required_providers) return [];
17529
17640
  return terraform.required_providers.map((req) => ({
17530
17641
  id: crypto.randomUUID(),
@@ -17534,23 +17645,23 @@ function TerraformConfigContent({ terraform, onSave }) {
17534
17645
  aliases: (req.configuration_aliases ?? []).join(", ")
17535
17646
  }));
17536
17647
  });
17537
- const addProvider = (0, import_react36.useCallback)(() => {
17648
+ const addProvider = (0, import_react34.useCallback)(() => {
17538
17649
  setProviders2((prev) => [
17539
17650
  ...prev,
17540
17651
  { id: crypto.randomUUID(), name: "", source: "", version: "", aliases: "" }
17541
17652
  ]);
17542
17653
  }, []);
17543
- const removeProvider = (0, import_react36.useCallback)((index) => {
17654
+ const removeProvider = (0, import_react34.useCallback)((index) => {
17544
17655
  setProviders2((prev) => prev.filter((_, i) => i !== index));
17545
17656
  }, []);
17546
- const updateProvider = (0, import_react36.useCallback)(
17657
+ const updateProvider = (0, import_react34.useCallback)(
17547
17658
  (index, field, value) => {
17548
17659
  setProviders2((prev) => prev.map((p, i) => i === index ? { ...p, [field]: value } : p));
17549
17660
  },
17550
17661
  []
17551
17662
  );
17552
17663
  const { status: updateStatus, handleUpdate } = useUpdateState(
17553
- (0, import_react36.useCallback)(async () => {
17664
+ (0, import_react34.useCallback)(async () => {
17554
17665
  const block = {
17555
17666
  required_version: requiredVersion.trim() || "",
17556
17667
  required_providers: providers.filter((p) => p.name.trim()).map((p) => ({
@@ -17563,9 +17674,9 @@ function TerraformConfigContent({ terraform, onSave }) {
17563
17674
  await onSave(block);
17564
17675
  }, [onSave, requiredVersion, providers])
17565
17676
  );
17566
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
17567
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h4", { className: "lace-panel-section-title", children: "Required Version" }),
17568
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-field", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17677
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
17678
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Required Version" }),
17679
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-field", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17569
17680
  import_ui15.Input,
17570
17681
  {
17571
17682
  value: requiredVersion,
@@ -17575,10 +17686,10 @@ function TerraformConfigContent({ terraform, onSave }) {
17575
17686
  readOnly: !editable
17576
17687
  }
17577
17688
  ) }),
17578
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
17579
- providers.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17580
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)("div", { className: "lace-panel-row-actions", children: [
17581
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17689
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Required Providers" }),
17690
+ providers.map((p, i) => /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-card lace-panel-row-card--with-footer", children: [
17691
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions", children: [
17692
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17582
17693
  import_ui15.Input,
17583
17694
  {
17584
17695
  value: p.name,
@@ -17588,10 +17699,10 @@ function TerraformConfigContent({ terraform, onSave }) {
17588
17699
  readOnly: !editable
17589
17700
  }
17590
17701
  ),
17591
- editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17702
+ editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17592
17703
  import_ui15.IconButton,
17593
17704
  {
17594
- icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CanvasIcon, { name: "close" }),
17705
+ icon: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CanvasIcon, { name: "close" }),
17595
17706
  "aria-label": "Remove provider",
17596
17707
  size: "md",
17597
17708
  tooltipPlacement: "bottom-end",
@@ -17599,7 +17710,7 @@ function TerraformConfigContent({ terraform, onSave }) {
17599
17710
  }
17600
17711
  )
17601
17712
  ] }),
17602
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17713
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17603
17714
  import_ui15.Input,
17604
17715
  {
17605
17716
  value: p.source,
@@ -17609,7 +17720,7 @@ function TerraformConfigContent({ terraform, onSave }) {
17609
17720
  readOnly: !editable
17610
17721
  }
17611
17722
  ) }),
17612
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17723
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17613
17724
  import_ui15.Input,
17614
17725
  {
17615
17726
  value: p.version,
@@ -17619,7 +17730,7 @@ function TerraformConfigContent({ terraform, onSave }) {
17619
17730
  readOnly: !editable
17620
17731
  }
17621
17732
  ) }),
17622
- (p.aliases || editable) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
17733
+ (p.aliases || editable) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-row-actions", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17623
17734
  import_ui15.Input,
17624
17735
  {
17625
17736
  value: p.aliases,
@@ -17632,39 +17743,39 @@ function TerraformConfigContent({ terraform, onSave }) {
17632
17743
  }
17633
17744
  ) })
17634
17745
  ] }, p.id)),
17635
- editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_ui15.Button, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
17636
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("h4", { className: "lace-panel-section-title", children: "Backend" }),
17637
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
17638
- editable && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(UpdateButton, { status: updateStatus, label: "Update terraform block", onClick: handleUpdate })
17746
+ editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui15.Button, { variant: "secondary", size: "sm", onClick: addProvider, children: "+ Add provider" }),
17747
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Backend" }),
17748
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "Terraform state is managed by Lace Cloud. The HTTP backend is configured automatically during generation." }),
17749
+ editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(UpdateButton, { status: updateStatus, label: "Update terraform block", onClick: handleUpdate })
17639
17750
  ] });
17640
17751
  }
17641
17752
  function TerraformConfigPanel({ terraform, onSave, onClose }) {
17642
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_ui15.Panel, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TerraformConfigContent, { terraform, onSave }) });
17753
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui15.Panel, { title: "Terraform Configuration", onClose, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TerraformConfigContent, { terraform, onSave }) });
17643
17754
  }
17644
17755
 
17645
17756
  // src/components/panels/ModuleDetails.tsx
17646
- var import_jsx_runtime30 = require("react/jsx-runtime");
17757
+ var import_jsx_runtime31 = require("react/jsx-runtime");
17647
17758
  function assertApplied(result) {
17648
17759
  if (!result?.success) throw new Error("apply failed");
17649
17760
  }
17650
17761
  var keyOf = (value) => JSON.stringify(value);
17651
17762
  function ModuleDetails({ moduleKey, open = [] }) {
17652
17763
  const { bundle, runner, editable } = useCanvas();
17653
- const settings = (0, import_react37.useMemo)(() => (0, import_proto11.deriveSettingsConfig)(bundle, moduleKey), [bundle, moduleKey]);
17764
+ const settings = (0, import_react35.useMemo)(() => (0, import_proto11.deriveSettingsConfig)(bundle, moduleKey), [bundle, moduleKey]);
17654
17765
  if (!settings) return null;
17655
- if (settings.reference) return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ReferenceDetails, { settings });
17766
+ if (settings.reference) return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ReferenceDetails, { settings });
17656
17767
  const apply2 = async (actions) => {
17657
17768
  if (!editable) return;
17658
17769
  assertApplied(await runner.apply(actions));
17659
17770
  };
17660
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
17661
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17771
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
17772
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17662
17773
  AccordionSection,
17663
17774
  {
17664
17775
  title: "Resources",
17665
17776
  defaultOpen: open.includes("Resources"),
17666
17777
  badge: `(${settings.resources.length})`,
17667
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17778
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17668
17779
  ResourcesContent,
17669
17780
  {
17670
17781
  resources: settings.resources,
@@ -17677,7 +17788,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
17677
17788
  )
17678
17789
  }
17679
17790
  ),
17680
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17791
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Interface", defaultOpen: open.includes("Interface"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17681
17792
  ModuleInterfaceContent,
17682
17793
  {
17683
17794
  settings,
@@ -17685,13 +17796,13 @@ function ModuleDetails({ moduleKey, open = [] }) {
17685
17796
  },
17686
17797
  keyOf([settings.variables, settings.outputs, settings.call_outputs])
17687
17798
  ) }),
17688
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17799
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17689
17800
  AccordionSection,
17690
17801
  {
17691
17802
  title: "Moved and import blocks",
17692
17803
  defaultOpen: open.includes("Moved and import blocks"),
17693
17804
  badge: settings.directives.length > 0 ? `(${settings.directives.length})` : void 0,
17694
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17805
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17695
17806
  DirectivesContent,
17696
17807
  {
17697
17808
  directives: settings.directives,
@@ -17701,7 +17812,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
17701
17812
  )
17702
17813
  }
17703
17814
  ),
17704
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17815
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Locals", defaultOpen: open.includes("Locals"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17705
17816
  LocalsContent,
17706
17817
  {
17707
17818
  locals: settings.locals,
@@ -17709,7 +17820,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
17709
17820
  },
17710
17821
  keyOf(settings.locals)
17711
17822
  ) }),
17712
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17823
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Providers", defaultOpen: open.includes("Providers"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17713
17824
  ProvidersContent,
17714
17825
  {
17715
17826
  providers: settings.providers,
@@ -17717,7 +17828,7 @@ function ModuleDetails({ moduleKey, open = [] }) {
17717
17828
  },
17718
17829
  keyOf(settings.providers)
17719
17830
  ) }),
17720
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17831
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Terraform Config", defaultOpen: open.includes("Terraform Config"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17721
17832
  TerraformConfigContent,
17722
17833
  {
17723
17834
  terraform: settings.terraform,
@@ -17732,11 +17843,11 @@ function DirectivesContent({
17732
17843
  onSave
17733
17844
  }) {
17734
17845
  const { editable } = useCanvas();
17735
- const [blocks, setBlocks] = (0, import_react37.useState)(directives);
17846
+ const [blocks, setBlocks] = (0, import_react35.useState)(directives);
17736
17847
  const { status, handleUpdate } = useUpdateState(() => onSave(blocks));
17737
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
17738
- blocks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
17739
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17848
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
17849
+ blocks.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-hint", children: "No moved or import blocks." }),
17850
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17740
17851
  BlockEditor,
17741
17852
  {
17742
17853
  blocks,
@@ -17748,7 +17859,7 @@ function DirectivesContent({
17748
17859
  ]
17749
17860
  }
17750
17861
  ),
17751
- editable && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
17862
+ editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
17752
17863
  UpdateButton,
17753
17864
  {
17754
17865
  status,
@@ -17761,26 +17872,26 @@ function DirectivesContent({
17761
17872
  function ReferenceDetails({ settings }) {
17762
17873
  const reference = settings.reference;
17763
17874
  if (!reference) return null;
17764
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
17765
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(AccordionSection, { title: "Source", defaultOpen: true, children: [
17766
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
17767
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
17768
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui16.Input, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
17769
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_ui16.Input, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
17875
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
17876
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(AccordionSection, { title: "Source", defaultOpen: true, children: [
17877
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-hint", children: "A reference: Lace reads it where its source points and never edits it." }),
17878
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-row-actions lace-panel-row-actions--stacked", children: [
17879
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui16.Input, { label: "Source", value: reference.source, fullWidth: true, mono: true, readOnly: true }),
17880
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui16.Input, { label: "Version", value: reference.version, fullWidth: true, mono: true, readOnly: true })
17770
17881
  ] })
17771
17882
  ] }),
17772
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(AccordionSection, { title: "Interface", defaultOpen: true, children: [
17773
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
17774
- settings.variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
17775
- settings.variables.map((v) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
17776
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
17777
- settings.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
17883
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(AccordionSection, { title: "Interface", defaultOpen: true, children: [
17884
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h4", { className: "lace-panel-section-title", children: "Inputs" }),
17885
+ settings.variables.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-hint", children: "The IR holds no interface for this reference." }),
17886
+ settings.variables.map((v) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { text: `${typedName(v.name, v.type)}${v.required ? " (required)" : ""}` }) }, v.name)),
17887
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h4", { className: "lace-panel-section-title", children: "Outputs" }),
17888
+ settings.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-depends-item", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { text: typedName(o.name, o.type) }) }, o.name))
17778
17889
  ] })
17779
17890
  ] });
17780
17891
  }
17781
17892
 
17782
17893
  // src/components/panels/ModuleConfigPanel.tsx
17783
- var import_jsx_runtime31 = require("react/jsx-runtime");
17894
+ var import_jsx_runtime32 = require("react/jsx-runtime");
17784
17895
  var MODE_ITEMS = [
17785
17896
  { value: "literal", label: "Lit" },
17786
17897
  { value: "variable", label: "Var" },
@@ -17805,11 +17916,11 @@ function toInputMode(mode) {
17805
17916
  }
17806
17917
  function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17807
17918
  const { editable, bundle, runner } = useCanvas();
17808
- const config = (0, import_react38.useMemo)(
17919
+ const config = (0, import_react36.useMemo)(
17809
17920
  () => (0, import_proto12.deriveNodeConfig)(bundle, instance_id),
17810
17921
  [bundle, instance_id]
17811
17922
  );
17812
- const [inputState, setInputState] = (0, import_react38.useState)({
17923
+ const [inputState, setInputState] = (0, import_react36.useState)({
17813
17924
  modes: {},
17814
17925
  values: {},
17815
17926
  variables: {},
@@ -17821,26 +17932,26 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17821
17932
  variables: localVariables,
17822
17933
  expressions: localExpressions
17823
17934
  } = inputState;
17824
- const setLocalModes = (0, import_react38.useCallback)(
17935
+ const setLocalModes = (0, import_react36.useCallback)(
17825
17936
  (fn) => setInputState((s) => ({ ...s, modes: fn(s.modes) })),
17826
17937
  []
17827
17938
  );
17828
- const setLocalValues = (0, import_react38.useCallback)(
17939
+ const setLocalValues = (0, import_react36.useCallback)(
17829
17940
  (fn) => setInputState((s) => ({ ...s, values: fn(s.values) })),
17830
17941
  []
17831
17942
  );
17832
- const setLocalVariables = (0, import_react38.useCallback)(
17943
+ const setLocalVariables = (0, import_react36.useCallback)(
17833
17944
  (fn) => setInputState((s) => ({ ...s, variables: fn(s.variables) })),
17834
17945
  []
17835
17946
  );
17836
- const setLocalExpressions = (0, import_react38.useCallback)(
17947
+ const setLocalExpressions = (0, import_react36.useCallback)(
17837
17948
  (fn) => setInputState((s) => ({ ...s, expressions: fn(s.expressions) })),
17838
17949
  []
17839
17950
  );
17840
- const [localDependsOn, setLocalDependsOn] = (0, import_react38.useState)(/* @__PURE__ */ new Set());
17841
- const [localProviders, setLocalProviders] = (0, import_react38.useState)([]);
17842
- const [localRepetition, setLocalRepetition] = (0, import_react38.useState)({ count: "", for_each: "" });
17843
- (0, import_react38.useEffect)(() => {
17951
+ const [localDependsOn, setLocalDependsOn] = (0, import_react36.useState)(/* @__PURE__ */ new Set());
17952
+ const [localProviders, setLocalProviders] = (0, import_react36.useState)([]);
17953
+ const [localRepetition, setLocalRepetition] = (0, import_react36.useState)({ count: "", for_each: "" });
17954
+ (0, import_react36.useEffect)(() => {
17844
17955
  if (!config) return;
17845
17956
  const modes = {};
17846
17957
  const values = {};
@@ -17859,7 +17970,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17859
17970
  );
17860
17971
  setLocalRepetition({ count: config.count, for_each: config.for_each });
17861
17972
  }, [config]);
17862
- const switchMode = (0, import_react38.useCallback)(
17973
+ const switchMode = (0, import_react36.useCallback)(
17863
17974
  (name, mode, input) => {
17864
17975
  setLocalModes((prev) => ({ ...prev, [name]: mode }));
17865
17976
  switch (mode) {
@@ -17887,14 +17998,14 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17887
17998
  },
17888
17999
  [setLocalModes, setLocalValues, setLocalVariables, setLocalExpressions]
17889
18000
  );
17890
- const { requiredInputs, optionalInputs } = (0, import_react38.useMemo)(
18001
+ const { requiredInputs, optionalInputs } = (0, import_react36.useMemo)(
17891
18002
  () => ({
17892
18003
  requiredInputs: (config?.inputs ?? []).filter((i) => i.required),
17893
18004
  optionalInputs: (config?.inputs ?? []).filter((i) => !i.required)
17894
18005
  }),
17895
18006
  [config?.inputs]
17896
18007
  );
17897
- const address = (0, import_react38.useMemo)(() => (0, import_proto12.instanceAddress)(bundle, instance_id), [bundle, instance_id]);
18008
+ const address = (0, import_react36.useMemo)(() => (0, import_proto12.instanceAddress)(bundle, instance_id), [bundle, instance_id]);
17898
18009
  const { status: updateStatus, handleUpdate } = useUpdateState(async () => {
17899
18010
  if (!config || !editable) return;
17900
18011
  const actions = [];
@@ -17981,7 +18092,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17981
18092
  ...m,
17982
18093
  disabled: !editable || m.value === "wired" || isWired
17983
18094
  }));
17984
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18095
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
17985
18096
  import_ui17.ModeToggle,
17986
18097
  {
17987
18098
  value: currentMode,
@@ -17993,29 +18104,29 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
17993
18104
  }
17994
18105
  function renderInputField(input) {
17995
18106
  const currentMode = localModes[input.name] ?? input.mode;
17996
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-field", children: [
17997
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "lace-panel-row-label", children: [
17998
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { text: input.name }),
17999
- input.required && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "lace-mcp__required-star", children: "*" })
18107
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-field", children: [
18108
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "lace-panel-row-label", children: [
18109
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { text: input.name }),
18110
+ input.required && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "lace-mcp__required-star", children: "*" })
18000
18111
  ] }),
18001
18112
  renderModeSelector(input),
18002
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-panel-row-content", children: [
18113
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-panel-row-content", children: [
18003
18114
  currentMode === "wired" && renderWiredEditor(input),
18004
18115
  currentMode === "variable" && renderVariableEditor(input),
18005
18116
  currentMode === "expression" && renderExpressionEditor(input),
18006
18117
  currentMode === "literal" && renderLiteralEditor(input)
18007
18118
  ] }),
18008
- input.description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-panel-field__description", children: input.description })
18119
+ input.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-panel-field__description", children: input.description })
18009
18120
  ] }, input.name);
18010
18121
  }
18011
18122
  function renderWiredEditor(input) {
18012
18123
  const label = input.wired_source ?? "Not wired";
18013
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__wired-row", children: [
18014
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui17.Input, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
18015
- editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18124
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__wired-row", children: [
18125
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__wired-input", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_ui17.Input, { value: label, readOnly: true, fullWidth: true, mono: true }) }),
18126
+ editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18016
18127
  import_ui17.IconButton,
18017
18128
  {
18018
- icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CanvasIcon, { name: "close" }),
18129
+ icon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CanvasIcon, { name: "close" }),
18019
18130
  "aria-label": "Disconnect this input",
18020
18131
  size: "md",
18021
18132
  tooltipPlacement: "bottom-end",
@@ -18026,7 +18137,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18026
18137
  }
18027
18138
  function renderVariableEditor(input) {
18028
18139
  const currentVar = localVariables[input.name] ?? input.variable ?? "";
18029
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18140
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18030
18141
  import_ui17.Input,
18031
18142
  {
18032
18143
  value: currentVar,
@@ -18044,7 +18155,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18044
18155
  }
18045
18156
  function renderExpressionEditor(input) {
18046
18157
  const currentExpr = localExpressions[input.name] ?? input.expression ?? "";
18047
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18158
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18048
18159
  import_ui17.Textarea,
18049
18160
  {
18050
18161
  value: currentExpr,
@@ -18064,7 +18175,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18064
18175
  setLocalValues((prev) => ({ ...prev, [input.name]: val }));
18065
18176
  };
18066
18177
  if (type === "bool") {
18067
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
18178
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
18068
18179
  "select",
18069
18180
  {
18070
18181
  className: "lace-mcp__select",
@@ -18072,14 +18183,14 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18072
18183
  onChange: (e) => updateValue(e.target.value === "true"),
18073
18184
  disabled: !editable,
18074
18185
  children: [
18075
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "true", children: "True" }),
18076
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("option", { value: "false", children: "False" })
18186
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "true", children: "True" }),
18187
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("option", { value: "false", children: "False" })
18077
18188
  ]
18078
18189
  }
18079
18190
  );
18080
18191
  }
18081
18192
  if (type === "number") {
18082
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18193
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18083
18194
  import_ui17.Input,
18084
18195
  {
18085
18196
  type: "number",
@@ -18092,7 +18203,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18092
18203
  }
18093
18204
  if (type.startsWith("list(") || type.startsWith("map(") || type.startsWith("set(") || type === "object" || type.startsWith("object(")) {
18094
18205
  const jsonStr = typeof value === "string" ? value : JSON.stringify(value ?? null, null, 2);
18095
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18206
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18096
18207
  import_ui17.Textarea,
18097
18208
  {
18098
18209
  value: jsonStr,
@@ -18110,7 +18221,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18110
18221
  }
18111
18222
  );
18112
18223
  }
18113
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18224
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18114
18225
  import_ui17.Input,
18115
18226
  {
18116
18227
  value: String(value ?? ""),
@@ -18127,35 +18238,35 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18127
18238
  );
18128
18239
  }
18129
18240
  if (!config) {
18130
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_ui17.Panel, { title: "Error", onClose, children: [
18131
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__error-title", children: [
18241
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_ui17.Panel, { title: "Error", onClose, children: [
18242
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__error-title", children: [
18132
18243
  'Failed to load configuration for "',
18133
18244
  instance_id,
18134
18245
  '":'
18135
18246
  ] }),
18136
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
18247
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__error-detail", children: "Instance not found in the current Bundle." })
18137
18248
  ] });
18138
18249
  }
18139
18250
  const dependsOnCount = localDependsOn.size;
18140
- const title = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__title", children: [
18141
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
18142
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { text: instance_id }) })
18251
+ const title = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__title", children: [
18252
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Module" }),
18253
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("h3", { className: "lace-mcp__title-id", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { text: instance_id }) })
18143
18254
  ] });
18144
- const footer = editable ? /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(UpdateButton, { status: updateStatus, label: "Update configuration", onClick: handleUpdate }) : void 0;
18145
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_ui17.Panel, { title, footer, flush: true, onClose, children: [
18146
- requiredInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
18147
- optionalInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
18148
- config.sibling_ids.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
18255
+ const footer = editable ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(UpdateButton, { status: updateStatus, label: "Update configuration", onClick: handleUpdate }) : void 0;
18256
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_ui17.Panel, { title, footer, flush: true, onClose, children: [
18257
+ requiredInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AccordionSection, { title: "Required Inputs", defaultOpen: true, badge: `(${requiredInputs.length})`, children: requiredInputs.map(renderInputField) }),
18258
+ optionalInputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AccordionSection, { title: "Optional Inputs", defaultOpen: true, badge: `(${optionalInputs.length})`, children: optionalInputs.map(renderInputField) }),
18259
+ config.sibling_ids.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
18149
18260
  AccordionSection,
18150
18261
  {
18151
18262
  title: "Depends On",
18152
18263
  badge: dependsOnCount > 0 ? `(${dependsOnCount})` : void 0,
18153
18264
  children: [
18154
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
18265
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__depends-hint", children: "Select sibling instances this module depends on." }),
18155
18266
  config.sibling_ids.map((sibId) => {
18156
18267
  const depKey = `module.${sibId}`;
18157
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("label", { className: "lace-mcp__depends-item", children: [
18158
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18268
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("label", { className: "lace-mcp__depends-item", children: [
18269
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18159
18270
  "input",
18160
18271
  {
18161
18272
  type: "checkbox",
@@ -18172,30 +18283,30 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18172
18283
  }
18173
18284
  }
18174
18285
  ),
18175
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { className: "lace-mcp__depends-label", text: depKey })
18286
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { className: "lace-mcp__depends-label", text: depKey })
18176
18287
  ] }, sibId);
18177
18288
  })
18178
18289
  ]
18179
18290
  }
18180
18291
  ),
18181
- (localProviders.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
18292
+ (localProviders.length > 0 || editable) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
18182
18293
  AccordionSection,
18183
18294
  {
18184
18295
  title: "Providers",
18185
18296
  badge: localProviders.length > 0 ? `(${localProviders.length})` : void 0,
18186
18297
  children: [
18187
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
18298
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
18188
18299
  "Map each child-local provider name to the root provider reference passed down (e.g.",
18189
18300
  " ",
18190
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { children: "aws" }),
18301
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: "aws" }),
18191
18302
  " \u2192 ",
18192
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { children: "aws.west" }),
18303
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: "aws.west" }),
18193
18304
  ")."
18194
18305
  ] }),
18195
18306
  localProviders.map((row, i) => (
18196
18307
  // biome-ignore lint/suspicious/noArrayIndexKey: rows are positional and freely editable
18197
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__provider-row", children: [
18198
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18308
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__provider-row", children: [
18309
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18199
18310
  import_ui17.Input,
18200
18311
  {
18201
18312
  value: row.key,
@@ -18207,8 +18318,8 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18207
18318
  readOnly: !editable
18208
18319
  }
18209
18320
  ),
18210
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "lace-mcp__provider-arrow", children: "=" }),
18211
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18321
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "lace-mcp__provider-arrow", children: "=" }),
18322
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18212
18323
  import_ui17.Input,
18213
18324
  {
18214
18325
  value: row.value,
@@ -18220,10 +18331,10 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18220
18331
  readOnly: !editable
18221
18332
  }
18222
18333
  ),
18223
- editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18334
+ editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18224
18335
  import_ui17.IconButton,
18225
18336
  {
18226
- icon: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CanvasIcon, { name: "close" }),
18337
+ icon: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CanvasIcon, { name: "close" }),
18227
18338
  "aria-label": "Remove this provider mapping",
18228
18339
  size: "md",
18229
18340
  tooltipPlacement: "bottom-end",
@@ -18232,7 +18343,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18232
18343
  )
18233
18344
  ] }, i)
18234
18345
  )),
18235
- editable && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18346
+ editable && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18236
18347
  import_ui17.Button,
18237
18348
  {
18238
18349
  variant: "secondary",
@@ -18244,15 +18355,15 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18244
18355
  ]
18245
18356
  }
18246
18357
  ),
18247
- (localRepetition.count || localRepetition.for_each || editable) && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(AccordionSection, { title: "Repetition", children: [
18248
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
18358
+ (localRepetition.count || localRepetition.for_each || editable) && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(AccordionSection, { title: "Repetition", children: [
18359
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__depends-hint", children: [
18249
18360
  "The call's ",
18250
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { children: "count" }),
18361
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: "count" }),
18251
18362
  " or ",
18252
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("code", { children: "for_each" }),
18363
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("code", { children: "for_each" }),
18253
18364
  ": one module, called once per instance."
18254
18365
  ] }),
18255
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18366
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18256
18367
  import_ui17.Input,
18257
18368
  {
18258
18369
  label: "count",
@@ -18264,7 +18375,7 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18264
18375
  readOnly: !editable
18265
18376
  }
18266
18377
  ),
18267
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
18378
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18268
18379
  import_ui17.Input,
18269
18380
  {
18270
18381
  label: "for_each",
@@ -18277,20 +18388,20 @@ function ModuleConfigPanel({ instance_id, onClose, onModified }) {
18277
18388
  }
18278
18389
  )
18279
18390
  ] }),
18280
- config.outputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__output-card", children: [
18281
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__output-header", children: [
18282
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { className: "lace-mcp__output-name", text: o.name }),
18283
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
18391
+ config.outputs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(AccordionSection, { title: "Outputs", badge: `(${config.outputs.length})`, children: config.outputs.map((o) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__output-card", children: [
18392
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__output-header", children: [
18393
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { className: "lace-mcp__output-name", text: o.name }),
18394
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { className: "lace-mcp__output-type", text: o.type ?? "" })
18284
18395
  ] }),
18285
- o.description && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__output-description", children: o.description }),
18286
- o.sensitive && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
18396
+ o.description && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__output-description", children: o.description }),
18397
+ o.sensitive && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__output-sensitive", children: "sensitive" })
18287
18398
  ] }, o.name)) }),
18288
- config.module_key && /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [
18289
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: "lace-mcp__module-heading", children: [
18290
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
18291
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Identifier, { text: config.module_key })
18399
+ config.module_key && /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [
18400
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "lace-mcp__module-heading", children: [
18401
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "lace-mcp__title-eyebrow", children: "Called module" }),
18402
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Identifier, { text: config.module_key })
18292
18403
  ] }),
18293
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
18404
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ModuleDetails, { moduleKey: config.module_key }, config.module_key)
18294
18405
  ] })
18295
18406
  ] });
18296
18407
  }
@@ -18300,7 +18411,7 @@ function ModuleConfigPanel2({ ctx }) {
18300
18411
  const { setSelection } = useCanvas();
18301
18412
  const instanceId = ctx.selection.nodes[0];
18302
18413
  if (!instanceId) return null;
18303
- return (0, import_react39.createElement)(ModuleConfigPanel, {
18414
+ return (0, import_react37.createElement)(ModuleConfigPanel, {
18304
18415
  instance_id: instanceId,
18305
18416
  onClose: () => setSelection({ nodes: [], edge: null })
18306
18417
  });
@@ -18315,40 +18426,18 @@ var moduleConfigPanel = {
18315
18426
  };
18316
18427
 
18317
18428
  // src/core/panels/SourceRefusedBanner.tsx
18318
- var import_ui18 = require("@lace-cloud/ui");
18319
- var import_jsx_runtime32 = require("react/jsx-runtime");
18429
+ var import_jsx_runtime33 = require("react/jsx-runtime");
18430
+ 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.";
18431
+ var OUT_OF_LACE_SHAPE = "This Terraform is not in lace shape yet, so the canvas shows it read-only.";
18320
18432
  function SourceRefusedBanner({ ctx }) {
18321
- const { runner } = useCanvas();
18322
- const envExtras = useEditorEnvExtras();
18323
- if (!keySatisfied(ctx, "needsConversion")) {
18324
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18325
- Banner,
18326
- {
18327
- severity: "error",
18328
- className: "lace-source-refused-banner",
18329
- message: "The canvas can't take this module's .tf, so editing, saving and generating are locked until it can; the Diagnostics tab says why."
18330
- }
18331
- );
18332
- }
18333
- const actions = rowActionsFor(ctx, "source-refused");
18334
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18335
- Banner,
18433
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
18434
+ RowActionBanner,
18336
18435
  {
18436
+ ctx,
18437
+ panelId: "source-refused",
18337
18438
  severity: "error",
18338
- className: "lace-source-refused-banner lace-source-refused-banner--needs-conversion",
18339
- message: "Needs conversion: this module's .tf is not in lace shape, so the canvas shows it read-only. Convert composes each managed resource the Diagnostics tab names into a module of its own.",
18340
- actions: actions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
18341
- import_ui18.Button,
18342
- {
18343
- rung: true,
18344
- size: "sm",
18345
- variant: "primary",
18346
- className: `lace-source-refused-banner__${action.id}`,
18347
- onClick: () => void runner.run(action, ctx, {}, envExtras),
18348
- children: action.label
18349
- },
18350
- action.id
18351
- ))
18439
+ className: "lace-source-refused-banner",
18440
+ opening: keySatisfied(ctx, "needsConversion") ? OUT_OF_LACE_SHAPE : LOCKED
18352
18441
  }
18353
18442
  );
18354
18443
  }
@@ -18362,22 +18451,22 @@ var sourceRefusedPanel = {
18362
18451
  };
18363
18452
 
18364
18453
  // src/core/panels/settings.ts
18365
- var import_ui20 = require("@lace-cloud/ui");
18366
- var import_react40 = require("react");
18454
+ var import_ui19 = require("@lace-cloud/ui");
18455
+ var import_react38 = require("react");
18367
18456
 
18368
18457
  // src/components/panels/UnifiedSettingsPanel.tsx
18369
- var import_ui19 = require("@lace-cloud/ui");
18458
+ var import_ui18 = require("@lace-cloud/ui");
18370
18459
  var import_panels_shared9 = require("./panels-shared-5JFNYXQ7.css");
18371
- var import_jsx_runtime33 = require("react/jsx-runtime");
18460
+ var import_jsx_runtime34 = require("react/jsx-runtime");
18372
18461
  function UnifiedSettingsPanel({ onClose }) {
18373
18462
  const { bundle } = useCanvas();
18374
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_ui19.Panel, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
18463
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui18.Panel, { title: "Settings", flush: true, onClose, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ModuleDetails, { moduleKey: bundle.entry, open: ["Interface"] }, bundle.entry) });
18375
18464
  }
18376
18465
 
18377
18466
  // src/core/panels/settings.ts
18378
18467
  function SettingsPanel(_props) {
18379
18468
  const { setSettingsOpen } = useCanvas();
18380
- return (0, import_react40.createElement)(UnifiedSettingsPanel, {
18469
+ return (0, import_react38.createElement)(UnifiedSettingsPanel, {
18381
18470
  onClose: () => setSettingsOpen(false)
18382
18471
  });
18383
18472
  }
@@ -18391,8 +18480,8 @@ var settingsPanel = {
18391
18480
  };
18392
18481
  function SettingsToggle({ ctx }) {
18393
18482
  const { setSettingsOpen } = useCanvas();
18394
- return (0, import_react40.createElement)(import_ui20.IconButton, {
18395
- icon: (0, import_react40.createElement)(CanvasIcon, { name: "settings" }),
18483
+ return (0, import_react38.createElement)(import_ui19.IconButton, {
18484
+ icon: (0, import_react38.createElement)(CanvasIcon, { name: "settings" }),
18396
18485
  "aria-label": "Settings",
18397
18486
  size: "md",
18398
18487
  tooltipPlacement: "bottom-end",
@@ -18429,10 +18518,10 @@ var CORE_CONTRIBUTIONS = {
18429
18518
 
18430
18519
  // src/core/report-fold.ts
18431
18520
  var REPORT_PATHS = ["module validate", "module convert", "module scan"];
18432
- var REPORT_PATH_SET = new Set(REPORT_PATHS);
18433
- function isReportPath(path) {
18434
- return REPORT_PATH_SET.has(path);
18435
- }
18521
+ var FOLDS_AS = new Map([
18522
+ ...REPORT_PATHS.map((path) => [path, path]),
18523
+ ["stack import", "module convert"]
18524
+ ]);
18436
18525
  var EMPTY_REPORT_FOLD = /* @__PURE__ */ new Map();
18437
18526
  function readEntry(path, exitCode, data) {
18438
18527
  if (carriesFailure(data)) {
@@ -18448,10 +18537,11 @@ function readEntry(path, exitCode, data) {
18448
18537
  }
18449
18538
  }
18450
18539
  function foldReport(prev, result) {
18451
- if (!isReportPath(result.path)) return prev;
18540
+ const path = FOLDS_AS.get(result.path);
18541
+ if (path === void 0) return prev;
18452
18542
  const next = new Map(prev);
18453
- if (result.document === "") next.delete(result.path);
18454
- else next.set(result.path, readEntry(result.path, result.exitCode, JSON.parse(result.document)));
18543
+ if (result.document === "") next.delete(path);
18544
+ else next.set(path, readEntry(path, result.exitCode, JSON.parse(result.document)));
18455
18545
  return next;
18456
18546
  }
18457
18547
  function treeHashOf(entry) {
@@ -18539,7 +18629,7 @@ function reduceRun(prev, token, event) {
18539
18629
  if (event.type === "gate" && event.changeRequest !== null) {
18540
18630
  return {
18541
18631
  token,
18542
- outcome: { kind: "awaiting-approval", changeRequest: event.changeRequest },
18632
+ outcome: { kind: "awaiting-approval", changeRequest: event.changeRequest, runUrl: null },
18543
18633
  lastLog,
18544
18634
  submitted,
18545
18635
  phases: closePhases(phases)
@@ -18547,7 +18637,13 @@ function reduceRun(prev, token, event) {
18547
18637
  }
18548
18638
  if (event.type === "result") {
18549
18639
  if (carried?.outcome.kind === "awaiting-approval") {
18550
- return { token, outcome: carried.outcome, lastLog, submitted, phases };
18640
+ return {
18641
+ token,
18642
+ outcome: { ...carried.outcome, runUrl: event.run.url ?? null },
18643
+ lastLog,
18644
+ submitted,
18645
+ phases
18646
+ };
18551
18647
  }
18552
18648
  if (event.error)
18553
18649
  return {
@@ -18575,7 +18671,7 @@ function settleRun(prev, token, error) {
18575
18671
  const lastLog = carried?.lastLog ?? null;
18576
18672
  const submitted = carried?.submitted ?? false;
18577
18673
  const phases = closePhases(carried?.phases ?? []);
18578
- if (error instanceof CommandDetachedError)
18674
+ if (error instanceof CommandDetachedError || error instanceof CommandUnobservedError)
18579
18675
  return { token, outcome: { kind: "detached", submitted }, lastLog, submitted, phases };
18580
18676
  if (error instanceof CommandExitError) {
18581
18677
  if (error.code === 130)
@@ -18811,6 +18907,10 @@ function createActionRunner(ports, store, options = {}) {
18811
18907
  handles.delete(kind);
18812
18908
  tokens.delete(kind);
18813
18909
  }
18910
+ function tellFailure(error) {
18911
+ if (error instanceof CommandDetachedError) return;
18912
+ ports.presenter.notify("error", error instanceof Error ? error.message : String(error));
18913
+ }
18814
18914
  async function startCommand(action, ctx, target, formArgs) {
18815
18915
  const binding = action.binding;
18816
18916
  if (binding.kind !== "command") return;
@@ -18865,7 +18965,7 @@ function createActionRunner(ports, store, options = {}) {
18865
18965
  missing: completion.missing,
18866
18966
  submit: (values) => {
18867
18967
  options.onPendingFormChange?.(null);
18868
- void startCommand(action, ctx, target, values);
18968
+ void startCommand(action, ctx, target, values).catch(tellFailure);
18869
18969
  },
18870
18970
  cancel: () => options.onPendingFormChange?.(null)
18871
18971
  });
@@ -18939,8 +19039,7 @@ function createActionRunner(ports, store, options = {}) {
18939
19039
  return;
18940
19040
  }
18941
19041
  } catch (error) {
18942
- if (error instanceof CommandDetachedError) return;
18943
- ports.presenter.notify("error", error instanceof Error ? error.message : String(error));
19042
+ tellFailure(error);
18944
19043
  }
18945
19044
  },
18946
19045
  apply(actions) {
@@ -18964,7 +19063,7 @@ function createActionRunner(ports, store, options = {}) {
18964
19063
  }
18965
19064
 
18966
19065
  // src/App.tsx
18967
- var import_jsx_runtime34 = require("react/jsx-runtime");
19066
+ var import_jsx_runtime35 = require("react/jsx-runtime");
18968
19067
  var EMPTY_CONTRIBUTIONS = { overlays: [], panels: [], actions: [] };
18969
19068
  var NO_SELECTION = { nodes: [], edge: null };
18970
19069
  var NO_TARGET2 = {};
@@ -18974,8 +19073,8 @@ function OverlayRunner({
18974
19073
  tick,
18975
19074
  onDecorations
18976
19075
  }) {
18977
- const lastErrorRef = (0, import_react42.useRef)(/* @__PURE__ */ new Map());
18978
- const onReadError = (0, import_react42.useCallback)(
19076
+ const lastErrorRef = (0, import_react40.useRef)(/* @__PURE__ */ new Map());
19077
+ const onReadError = (0, import_react40.useCallback)(
18979
19078
  (path, error) => {
18980
19079
  const next = error?.message ?? null;
18981
19080
  if (lastErrorRef.current.get(path) === next) return;
@@ -18984,7 +19083,7 @@ function OverlayRunner({
18984
19083
  },
18985
19084
  [ctx.ports.presenter]
18986
19085
  );
18987
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(OverlayDecorations, { overlay, ctx, onDecorations }) });
19086
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelScope, { ctx, paths: overlay.paths, tick, onReadError, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(OverlayDecorations, { overlay, ctx, onDecorations }) });
18988
19087
  }
18989
19088
  function OverlayDecorations({
18990
19089
  overlay,
@@ -18992,14 +19091,14 @@ function OverlayDecorations({
18992
19091
  onDecorations
18993
19092
  }) {
18994
19093
  const decorations = overlay.useDecorations(ctx);
18995
- (0, import_react42.useEffect)(() => {
19094
+ (0, import_react40.useEffect)(() => {
18996
19095
  onDecorations(overlay.id, decorations);
18997
19096
  }, [overlay.id, decorations, onDecorations]);
18998
19097
  return null;
18999
19098
  }
19000
19099
  function PanelSlot({ panel, ctx, tick }) {
19001
- const [readErrors, setReadErrors] = (0, import_react42.useState)(/* @__PURE__ */ new Map());
19002
- const onReadError = (0, import_react42.useCallback)((path, error) => {
19100
+ const [readErrors, setReadErrors] = (0, import_react40.useState)(/* @__PURE__ */ new Map());
19101
+ const onReadError = (0, import_react40.useCallback)((path, error) => {
19003
19102
  setReadErrors((prev) => {
19004
19103
  if (error === null) {
19005
19104
  if (!prev.has(path)) return prev;
@@ -19012,7 +19111,7 @@ function PanelSlot({ panel, ctx, tick }) {
19012
19111
  return next;
19013
19112
  });
19014
19113
  }, []);
19015
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
19114
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
19016
19115
  PanelScope,
19017
19116
  {
19018
19117
  ctx,
@@ -19020,13 +19119,13 @@ function PanelSlot({ panel, ctx, tick }) {
19020
19119
  tick,
19021
19120
  onReadError,
19022
19121
  children: [
19023
- [...readErrors].map(([path, error]) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("p", { className: "lace-app__panel-error", children: [
19122
+ [...readErrors].map(([path, error]) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("p", { className: "lace-app__panel-error", children: [
19024
19123
  "Couldn't load ",
19025
19124
  path,
19026
19125
  ": ",
19027
19126
  error.message
19028
19127
  ] }, path)),
19029
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(panel.Component, { ctx })
19128
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(panel.Component, { ctx })
19030
19129
  ]
19031
19130
  }
19032
19131
  );
@@ -19036,12 +19135,12 @@ function BottomTabs({
19036
19135
  ctx,
19037
19136
  tick
19038
19137
  }) {
19039
- const [manualId, setManualId] = (0, import_react42.useState)(null);
19138
+ const [manualId, setManualId] = (0, import_react40.useState)(null);
19040
19139
  const manual = manualId !== null ? panels.find((p) => p.id === manualId) : void 0;
19041
19140
  const active = manual ?? panels[0] ?? null;
19042
19141
  if (panels.length === 0) return null;
19043
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-app__bottom", children: [
19044
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
19142
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-app__bottom", children: [
19143
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-app__bottom-tabs", role: "tablist", children: panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
19045
19144
  "button",
19046
19145
  {
19047
19146
  type: "button",
@@ -19053,7 +19152,7 @@ function BottomTabs({
19053
19152
  },
19054
19153
  panel.id
19055
19154
  )) }),
19056
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelSlot, { panel: active, ctx, tick }) })
19155
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-app__bottom-content", children: active && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelSlot, { panel: active, ctx, tick }) })
19057
19156
  ] });
19058
19157
  }
19059
19158
  function endMessage(end) {
@@ -19065,8 +19164,8 @@ function App({
19065
19164
  height = "100vh",
19066
19165
  results: hostResults
19067
19166
  }) {
19068
- const results = (0, import_react42.useMemo)(() => hostResults ?? createResultStore(), [hostResults]);
19069
- const writeReport = (0, import_react42.useCallback)(
19167
+ const results = (0, import_react40.useMemo)(() => hostResults ?? createResultStore(), [hostResults]);
19168
+ const writeReport = (0, import_react40.useCallback)(
19070
19169
  (result, session2) => {
19071
19170
  try {
19072
19171
  results.write("report", session2, result, { stack: void 0 });
@@ -19077,43 +19176,43 @@ function App({
19077
19176
  },
19078
19177
  [results, ports.presenter]
19079
19178
  );
19080
- const dropReport = (0, import_react42.useCallback)((session2) => results.detach("report", session2), [results]);
19179
+ const dropReport = (0, import_react40.useCallback)((session2) => results.detach("report", session2), [results]);
19081
19180
  const { source, end, session } = useCanvasSource(ports.source, writeReport, dropReport);
19082
- const [arrangement, setArrangement] = (0, import_react42.useState)(() => ports.viewState.load());
19181
+ const [arrangement, setArrangement] = (0, import_react40.useState)(() => ports.viewState.load());
19083
19182
  const stack = ports.context.stack;
19084
- const [selection, setSelection] = (0, import_react42.useState)(
19183
+ const [selection, setSelection] = (0, import_react40.useState)(
19085
19184
  NO_SELECTION
19086
19185
  );
19087
- const [settingsOpen, setSettingsOpen] = (0, import_react42.useState)(false);
19088
- const select = (0, import_react42.useCallback)((next) => {
19186
+ const [settingsOpen, setSettingsOpen] = (0, import_react40.useState)(false);
19187
+ const select = (0, import_react40.useCallback)((next) => {
19089
19188
  setSelection(next);
19090
19189
  if (next.nodes.length > 0 || next.edge !== null) setSettingsOpen(false);
19091
19190
  }, []);
19092
- const [pendingForm, setPendingForm] = (0, import_react42.useState)(null);
19093
- const [overlayDecorations, setOverlayDecorations] = (0, import_react42.useState)({});
19094
- const layoutRef = (0, import_react42.useRef)({ panIntoView: () => {
19191
+ const [pendingForm, setPendingForm] = (0, import_react40.useState)(null);
19192
+ const [overlayDecorations, setOverlayDecorations] = (0, import_react40.useState)({});
19193
+ const layoutRef = (0, import_react40.useRef)({ panIntoView: () => {
19095
19194
  } });
19096
19195
  const { commands, presenter, editor } = ports;
19097
- const runner = (0, import_react42.useMemo)(
19196
+ const runner = (0, import_react40.useMemo)(
19098
19197
  () => createActionRunner({ commands, presenter, editor }, results, {
19099
19198
  onPendingFormChange: setPendingForm
19100
19199
  }),
19101
19200
  [commands, presenter, editor, results]
19102
19201
  );
19103
- (0, import_react42.useEffect)(() => {
19202
+ (0, import_react40.useEffect)(() => {
19104
19203
  return () => {
19105
19204
  runner.dispose();
19106
19205
  };
19107
19206
  }, [runner]);
19108
- const tick = (0, import_react42.useSyncExternalStore)(results.subscribe, results.getTick);
19109
- const updateArrangement = (0, import_react42.useCallback)(
19207
+ const tick = (0, import_react40.useSyncExternalStore)(results.subscribe, results.getTick);
19208
+ const updateArrangement = (0, import_react40.useCallback)(
19110
19209
  (next) => {
19111
19210
  setArrangement(next);
19112
19211
  ports.viewState.save(next);
19113
19212
  },
19114
19213
  [ports.viewState]
19115
19214
  );
19116
- const gcSeenBundle = (0, import_react42.useRef)(null);
19215
+ const gcSeenBundle = (0, import_react40.useRef)(null);
19117
19216
  if (source && gcSeenBundle.current !== source.bundle) {
19118
19217
  gcSeenBundle.current = source.bundle;
19119
19218
  const gced = gcArrangement(source.bundle, arrangement);
@@ -19124,12 +19223,12 @@ function App({
19124
19223
  });
19125
19224
  }
19126
19225
  }
19127
- const view = (0, import_react42.useMemo)(
19226
+ const view = (0, import_react40.useMemo)(
19128
19227
  () => source ? projectFrame(source, arrangement) : null,
19129
19228
  [source, arrangement]
19130
19229
  );
19131
19230
  const editable = ports.editor !== void 0 && !source?.sourceRefused;
19132
- const merged = (0, import_react42.useMemo)(
19231
+ const merged = (0, import_react40.useMemo)(
19133
19232
  () => ({
19134
19233
  overlays: [...CORE_CONTRIBUTIONS.overlays, ...contributions.overlays],
19135
19234
  panels: [...CORE_CONTRIBUTIONS.panels, ...contributions.panels],
@@ -19137,17 +19236,17 @@ function App({
19137
19236
  }),
19138
19237
  [contributions]
19139
19238
  );
19140
- const resultSlots = (0, import_react42.useSyncExternalStore)(results.subscribe, results.getSnapshot);
19239
+ const resultSlots = (0, import_react40.useSyncExternalStore)(results.subscribe, results.getSnapshot);
19141
19240
  const stackId = stack?.id;
19142
- const live = (0, import_react42.useMemo)(
19241
+ const live = (0, import_react40.useMemo)(
19143
19242
  () => source && session ? liveSlots(resultSlots, { session, treeHash: source.treeHash, stack: stackId }) : null,
19144
19243
  [resultSlots, source, session, stackId]
19145
19244
  );
19146
- const diagnostics = (0, import_react42.useMemo)(
19245
+ const diagnostics = (0, import_react40.useMemo)(
19147
19246
  () => source && live ? diagnosticsOf(source.diagnostics, live.report ? reportDiagnostics(live.report) : []) : [],
19148
19247
  [source, live]
19149
19248
  );
19150
- const ctx = (0, import_react42.useMemo)(() => {
19249
+ const ctx = (0, import_react40.useMemo)(() => {
19151
19250
  if (!source || !view) return null;
19152
19251
  return {
19153
19252
  ports,
@@ -19164,18 +19263,18 @@ function App({
19164
19263
  contributions: merged
19165
19264
  };
19166
19265
  }, [ports, source, view, stack, selection, settingsOpen, merged, diagnostics, editable]);
19167
- const resolved = (0, import_react42.useMemo)(() => {
19266
+ const resolved = (0, import_react40.useMemo)(() => {
19168
19267
  if (!ctx) return EMPTY_CONTRIBUTIONS;
19169
19268
  return resolveContributions(merged, ports, ctx, NO_TARGET2);
19170
19269
  }, [merged, ports, ctx]);
19171
- const setOverlayDecoration = (0, import_react42.useCallback)((id, next) => {
19270
+ const setOverlayDecoration = (0, import_react40.useCallback)((id, next) => {
19172
19271
  setOverlayDecorations((prev) => prev[id] === next ? prev : { ...prev, [id]: next });
19173
19272
  }, []);
19174
- const decorations = (0, import_react42.useMemo)(() => {
19273
+ const decorations = (0, import_react40.useMemo)(() => {
19175
19274
  if (!view || !source) return { nodes: {} };
19176
19275
  return decorate(view, Object.values(overlayDecorations), diagnostics);
19177
19276
  }, [view, source, overlayDecorations, diagnostics]);
19178
- const envExtras = (0, import_react42.useMemo)(() => {
19277
+ const envExtras = (0, import_react40.useMemo)(() => {
19179
19278
  if (!source) return null;
19180
19279
  return {
19181
19280
  bundle: source.bundle,
@@ -19187,8 +19286,8 @@ function App({
19187
19286
  resolved.actions.filter((action) => action.placement === "toolbar"),
19188
19287
  resolved.panels.filter((panel) => panel.slot === "toolbar")
19189
19288
  );
19190
- const rootRef = (0, import_react42.useRef)(null);
19191
- (0, import_react42.useEffect)(() => {
19289
+ const rootRef = (0, import_react40.useRef)(null);
19290
+ (0, import_react40.useEffect)(() => {
19192
19291
  if (!ctx) return;
19193
19292
  registerKeyTarget(ctx, "app", rootRef.current);
19194
19293
  return () => registerKeyTarget(ctx, "app", null);
@@ -19196,7 +19295,7 @@ function App({
19196
19295
  useFocusWhenNoneHeld(rootRef, Boolean(ctx && view && source && envExtras));
19197
19296
  useActionKeys(ctx && envExtras ? resolved.actions : [], ctx, runner, envExtras);
19198
19297
  if (!ctx || !view || !source || !envExtras) {
19199
- return end ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ErrorState, { message: endMessage(end) }) : null;
19298
+ return end ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ErrorState, { message: endMessage(end) }) : null;
19200
19299
  }
19201
19300
  const contextValue = {
19202
19301
  ports,
@@ -19216,8 +19315,8 @@ function App({
19216
19315
  const bannerPanels = resolved.panels.filter((panel) => panel.slot === "banner");
19217
19316
  const bottomPanels = resolved.panels.filter((panel) => panel.slot === "bottom");
19218
19317
  const drawerPanel = resolved.panels.find((panel) => panel.slot === "drawer");
19219
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ErrorBoundary, { children: [
19220
- resolved.overlays.map((overlay) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
19318
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(ErrorBoundary, { children: [
19319
+ resolved.overlays.map((overlay) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
19221
19320
  OverlayRunner,
19222
19321
  {
19223
19322
  overlay,
@@ -19227,14 +19326,14 @@ function App({
19227
19326
  },
19228
19327
  overlay.id
19229
19328
  )),
19230
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
19231
- (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-app__toolbar", children: [
19232
- toolbar.sections.map((section, index) => /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_react42.Fragment, { children: [
19233
- index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
19234
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-app__toolbar-section", children: [
19329
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CanvasContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ref: rootRef, className: "lace-app", style: { height }, tabIndex: -1, children: [
19330
+ (toolbar.sections.length > 0 || toolbar.trailing.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-app__toolbar", children: [
19331
+ toolbar.sections.map((section, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_react40.Fragment, { children: [
19332
+ index > 0 ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "lace-app__toolbar-separator", "aria-hidden": "true" }) : null,
19333
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-app__toolbar-section", children: [
19235
19334
  section.actions.map((action) => {
19236
19335
  const commandBusy = action.binding.kind === "command" && results.isBusy(action.binding.resultKind);
19237
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
19336
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
19238
19337
  ToolbarAction,
19239
19338
  {
19240
19339
  action,
@@ -19246,20 +19345,20 @@ function App({
19246
19345
  action.id
19247
19346
  );
19248
19347
  }),
19249
- section.panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelSlot, { panel, ctx, tick }, panel.id))
19348
+ section.panels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelSlot, { panel, ctx, tick }, panel.id))
19250
19349
  ] })
19251
19350
  ] }, section.key ?? "")),
19252
- toolbar.trailing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) })
19351
+ toolbar.trailing.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-app__toolbar-end", children: toolbar.trailing.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) })
19253
19352
  ] }),
19254
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) }),
19255
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-app__body", children: [
19256
- /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "lace-app__main", children: [
19257
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "lace-app__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_react41.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Canvas, { height: "100%" }) }) }),
19258
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(BottomTabs, { panels: bottomPanels, ctx, tick })
19353
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-app__banners", children: bannerPanels.map((panel) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelSlot, { panel, ctx, tick }, panel.id)) }),
19354
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-app__body", children: [
19355
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "lace-app__main", children: [
19356
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "lace-app__canvas", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_react39.ReactFlowProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Canvas, { height: "100%" }) }) }),
19357
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(BottomTabs, { panels: bottomPanels, ctx, tick })
19259
19358
  ] }),
19260
- drawerPanel && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
19359
+ drawerPanel && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Drawer, { label: drawerPanel.title, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PanelSlot, { panel: drawerPanel, ctx, tick }, drawerPanel.id) })
19261
19360
  ] }),
19262
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(CommandArgsForm, { form: pendingForm })
19361
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(CommandArgsForm, { form: pendingForm })
19263
19362
  ] }) })
19264
19363
  ] });
19265
19364
  }
@@ -19354,8 +19453,13 @@ async function* readConnectFrames(body, signal) {
19354
19453
  try {
19355
19454
  while (!signal.aborted) {
19356
19455
  const { value, done } = await reader.read();
19357
- if (done) return;
19358
19456
  if (signal.aborted) return;
19457
+ if (done) {
19458
+ throw new ConnectError(
19459
+ "internal",
19460
+ "the engine's stream was cut off before its end-of-stream frame"
19461
+ );
19462
+ }
19359
19463
  if (!value) continue;
19360
19464
  chunks.push(value);
19361
19465
  bufferedLen += value.length;
@@ -19773,6 +19877,7 @@ async function openEngineSession(caller, target, options = {}) {
19773
19877
  revisionWaiters.clear();
19774
19878
  }
19775
19879
  function publishCommandResult(result) {
19880
+ commandResults.delete(result.path);
19776
19881
  commandResults.set(result.path, result);
19777
19882
  for (const listener of commandResultListeners) deliver(listener, result);
19778
19883
  }
@@ -19931,13 +20036,14 @@ function commandsPort(caller, commandPaths, ownCwd) {
19931
20036
  throw new CommandExitError(
19932
20037
  event.exit.code,
19933
20038
  event.exit.stderr_tail,
19934
- exitFailure(event.exit.document)
20039
+ exitFailure(path, event.exit.document)
19935
20040
  );
19936
20041
  }
19937
20042
  return;
19938
20043
  }
19939
20044
  }
19940
- throw new CommandDetachedError();
20045
+ if (signal.aborted) throw new CommandDetachedError();
20046
+ throw new CommandUnobservedError();
19941
20047
  }
19942
20048
  return {
19943
20049
  events: run(),
@@ -19948,10 +20054,10 @@ function commandsPort(caller, commandPaths, ownCwd) {
19948
20054
  }
19949
20055
  };
19950
20056
  }
19951
- function exitFailure(document2) {
20057
+ function exitFailure(path, document2) {
19952
20058
  if (document2 === "") return void 0;
19953
20059
  const data = JSON.parse(document2);
19954
- return carriesFailure(data) ? parseCommandFailure(data) : void 0;
20060
+ return carriesFailure(data) ? parseCommandFailure(data) : resultFailure(path, data);
19955
20061
  }
19956
20062
  async function openSession(caller, target) {
19957
20063
  if ("fixture" in target) {
@@ -20020,6 +20126,7 @@ function convertCreatedRef(r) {
20020
20126
  CommandArgsForm,
20021
20127
  CommandDetachedError,
20022
20128
  CommandExitError,
20129
+ CommandUnobservedError,
20023
20130
  ConflictBanner,
20024
20131
  ConnectError,
20025
20132
  ContextMenu,
@@ -20047,6 +20154,7 @@ function convertCreatedRef(r) {
20047
20154
  UngeneratedMarker,
20048
20155
  UnifiedSettingsPanel,
20049
20156
  UnsavedMarker,
20157
+ answering,
20050
20158
  bridgeCaller,
20051
20159
  carriesFailure,
20052
20160
  conflictPanel,