@synergenius/flow-weaver 0.9.4 → 0.9.5

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.
@@ -60562,11 +60562,12 @@ function assignUnpositionedNodes(layers, diagramNodes, explicitPositions) {
60562
60562
  }
60563
60563
  }
60564
60564
  }
60565
- function resolveHorizontalOverlaps(diagramNodes) {
60565
+ function resolveHorizontalOverlaps(diagramNodes, explicitPositions) {
60566
60566
  const nodes = [...diagramNodes.values()].sort((a, b) => a.x - b.x);
60567
60567
  for (let i = 1; i < nodes.length; i++) {
60568
60568
  const prev = nodes[i - 1];
60569
60569
  const curr = nodes[i];
60570
+ if (explicitPositions.has(curr.id)) continue;
60570
60571
  const prevRightExtent = maxPortLabelExtent(prev.outputs);
60571
60572
  const currLeftExtent = maxPortLabelExtent(curr.inputs);
60572
60573
  const minGap = Math.max(prevRightExtent + LABEL_CLEARANCE + currLeftExtent, MIN_EDGE_GAP);
@@ -60684,14 +60685,13 @@ function buildDiagramGraph(ast, options = {}) {
60684
60685
  node.y = pos.y;
60685
60686
  }
60686
60687
  }
60687
- resolveHorizontalOverlaps(diagramNodes);
60688
60688
  } else if (nonePositioned) {
60689
60689
  const { layers } = layoutWorkflow(ast);
60690
60690
  assignLayerCoordinates(layers, diagramNodes);
60691
60691
  } else {
60692
60692
  const { layers } = layoutWorkflow(ast);
60693
60693
  assignUnpositionedNodes(layers, diagramNodes, explicitPositions);
60694
- resolveHorizontalOverlaps(diagramNodes);
60694
+ resolveHorizontalOverlaps(diagramNodes, explicitPositions);
60695
60695
  }
60696
60696
  for (const node of diagramNodes.values()) {
60697
60697
  computePortPositions(node);
@@ -96210,7 +96210,7 @@ function displayInstalledPackage(pkg) {
96210
96210
  }
96211
96211
 
96212
96212
  // src/cli/index.ts
96213
- var version2 = true ? "0.9.4" : "0.0.0-dev";
96213
+ var version2 = true ? "0.9.5" : "0.0.0-dev";
96214
96214
  var program2 = new Command();
96215
96215
  program2.name("flow-weaver").description("Flow Weaver Annotations - Compile and validate workflow files").version(version2, "-v, --version", "Output the current version");
96216
96216
  program2.configureOutput({
@@ -610,11 +610,13 @@ function assignUnpositionedNodes(layers, diagramNodes, explicitPositions) {
610
610
  * label extent) intrudes into the previous node's right edge (plus its
611
611
  * output label extent and clearance).
612
612
  */
613
- function resolveHorizontalOverlaps(diagramNodes) {
613
+ function resolveHorizontalOverlaps(diagramNodes, explicitPositions) {
614
614
  const nodes = [...diagramNodes.values()].sort((a, b) => a.x - b.x);
615
615
  for (let i = 1; i < nodes.length; i++) {
616
616
  const prev = nodes[i - 1];
617
617
  const curr = nodes[i];
618
+ if (explicitPositions.has(curr.id))
619
+ continue; // respect author-set positions
618
620
  // Only external port labels overhang the node boundary.
619
621
  // Scope inner-edge port labels face inward and don't extend past the node box.
620
622
  const prevRightExtent = maxPortLabelExtent(prev.outputs);
@@ -744,8 +746,7 @@ export function buildDiagramGraph(ast, options = {}) {
744
746
  const allPositioned = [...diagramNodes.keys()].every(id => explicitPositions.has(id));
745
747
  const nonePositioned = ![...diagramNodes.keys()].some(id => explicitPositions.has(id));
746
748
  if (allPositioned) {
747
- // All nodes have explicit positions — apply them, then fix overlaps
748
- // caused by scope expansion making nodes wider than the author anticipated.
749
+ // All nodes have explicit positions — apply them as-is
749
750
  for (const [id, pos] of explicitPositions) {
750
751
  const node = diagramNodes.get(id);
751
752
  if (node) {
@@ -753,7 +754,6 @@ export function buildDiagramGraph(ast, options = {}) {
753
754
  node.y = pos.y;
754
755
  }
755
756
  }
756
- resolveHorizontalOverlaps(diagramNodes);
757
757
  }
758
758
  else if (nonePositioned) {
759
759
  // No positions — full auto-layout (original behavior)
@@ -764,7 +764,7 @@ export function buildDiagramGraph(ast, options = {}) {
764
764
  // Mixed — explicit positions + auto-layout for remaining nodes
765
765
  const { layers } = layoutWorkflow(ast);
766
766
  assignUnpositionedNodes(layers, diagramNodes, explicitPositions);
767
- resolveHorizontalOverlaps(diagramNodes);
767
+ resolveHorizontalOverlaps(diagramNodes, explicitPositions);
768
768
  }
769
769
  // Compute external port positions
770
770
  for (const node of diagramNodes.values()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.9.4",
3
+ "version": "0.9.5",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",