@synergenius/flow-weaver 0.23.4 → 0.23.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.
@@ -9886,7 +9886,7 @@ var VERSION;
9886
9886
  var init_generated_version = __esm({
9887
9887
  "src/generated-version.ts"() {
9888
9888
  "use strict";
9889
- VERSION = "0.23.4";
9889
+ VERSION = "0.23.5";
9890
9890
  }
9891
9891
  });
9892
9892
 
@@ -11472,7 +11472,7 @@ function generateControlFlowWithExecutionContext(workflow, nodeTypes, isAsync2,
11472
11472
  "ctx",
11473
11473
  bundleMode,
11474
11474
  promotedPreDeclared,
11475
- branchingNodesNeedingSuccessFlag.has(instanceId),
11475
+ branchingNodesNeedingSuccessFlag.has(instanceId) || topLevelSuccessFlags.has(toValidIdentifier(instanceId)),
11476
11476
  production
11477
11477
  );
11478
11478
  if (branchNeedsClose) {
@@ -11888,8 +11888,8 @@ function generateBranchingChainCode(chain, workflow, nodeTypes, branchingNodes,
11888
11888
  const preDeclaredFlags = new Set(alreadyDeclaredFlags);
11889
11889
  for (let i = 0; i < chain.length; i++) {
11890
11890
  const isLast = i === chain.length - 1;
11891
- if (!isLast || forceTrackSuccessNodes.has(chain[i])) {
11892
- const safeId = toValidIdentifier(chain[i]);
11891
+ const safeId = toValidIdentifier(chain[i]);
11892
+ if (!isLast || forceTrackSuccessNodes.has(chain[i]) || alreadyDeclaredFlags.has(safeId)) {
11893
11893
  if (!alreadyDeclaredFlags.has(safeId)) {
11894
11894
  lines.push(`${indent}let ${safeId}_success = false;`);
11895
11895
  }
@@ -11942,8 +11942,8 @@ function generateBranchingChainCode(chain, workflow, nodeTypes, branchingNodes,
11942
11942
  ctxVar,
11943
11943
  bundleMode,
11944
11944
  preDeclaredFlags,
11945
- !isLast || forceTrackSuccessNodes.has(chain[i]),
11946
- // forceTrackSuccess for non-last chain nodes or nodes with promoted dependents
11945
+ !isLast || forceTrackSuccessNodes.has(chain[i]) || alreadyDeclaredFlags.has(safeId),
11946
+ // forceTrackSuccess for non-last chain nodes, nodes with promoted dependents, or nodes with pre-declared flags
11947
11947
  production
11948
11948
  );
11949
11949
  generateScopedChildrenExecution(
@@ -12269,7 +12269,8 @@ function generateBranchingNodeCode(instance, branchNode, workflow, allNodeTypes,
12269
12269
  ctxVar,
12270
12270
  bundleMode,
12271
12271
  nestedPreDeclared,
12272
- false,
12272
+ nestedPreDeclared.has(nestedSafeId),
12273
+ // force tracking if flag was pre-declared at higher scope
12273
12274
  production
12274
12275
  );
12275
12276
  successExecutedNodes.push(instanceId2);
@@ -12353,7 +12354,8 @@ function generateBranchingNodeCode(instance, branchNode, workflow, allNodeTypes,
12353
12354
  ctxVar,
12354
12355
  bundleMode,
12355
12356
  nestedPreDeclared,
12356
- false,
12357
+ nestedPreDeclared.has(nestedSafeId),
12358
+ // force tracking if flag was pre-declared at higher scope
12357
12359
  production
12358
12360
  );
12359
12361
  failureExecutedNodes.push(instanceId2);
@@ -95951,7 +95953,7 @@ var {
95951
95953
  // src/cli/index.ts
95952
95954
  init_logger();
95953
95955
  init_error_utils();
95954
- var version2 = true ? "0.23.4" : "0.0.0-dev";
95956
+ var version2 = true ? "0.23.5" : "0.0.0-dev";
95955
95957
  var program2 = new Command();
95956
95958
  program2.name("fw").description("Flow Weaver Annotations - Compile and validate workflow files").option("-v, --version", "Output the current version").option("--no-color", "Disable colors").option("--color", "Force colors").on("option:version", () => {
95957
95959
  logger.banner(version2);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.23.4";
1
+ export declare const VERSION = "0.23.5";
2
2
  //# sourceMappingURL=generated-version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Auto-generated by scripts/generate-version.ts — do not edit manually
2
- export const VERSION = '0.23.4';
2
+ export const VERSION = '0.23.5';
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -456,7 +456,7 @@ export function generateControlFlowWithExecutionContext(workflow, nodeTypes, isA
456
456
  branchNeedsClose = true;
457
457
  }
458
458
  }
459
- generateBranchingNodeCode(instance, nodeType, workflow, nodeTypes, nodeRegion, availableVars, generatedNodes, lines, branchIndent, false, branchingNodes, branchRegions, isAsync, 'ctx', bundleMode, promotedPreDeclared, branchingNodesNeedingSuccessFlag.has(instanceId), production);
459
+ generateBranchingNodeCode(instance, nodeType, workflow, nodeTypes, nodeRegion, availableVars, generatedNodes, lines, branchIndent, false, branchingNodes, branchRegions, isAsync, 'ctx', bundleMode, promotedPreDeclared, branchingNodesNeedingSuccessFlag.has(instanceId) || topLevelSuccessFlags.has(toValidIdentifier(instanceId)), production);
460
460
  if (branchNeedsClose) {
461
461
  lines.push(` }`);
462
462
  }
@@ -885,8 +885,8 @@ function generateBranchingChainCode(chain, workflow, nodeTypes, branchingNodes,
885
885
  const preDeclaredFlags = new Set(alreadyDeclaredFlags);
886
886
  for (let i = 0; i < chain.length; i++) {
887
887
  const isLast = i === chain.length - 1;
888
- if (!isLast || forceTrackSuccessNodes.has(chain[i])) {
889
- const safeId = toValidIdentifier(chain[i]);
888
+ const safeId = toValidIdentifier(chain[i]);
889
+ if (!isLast || forceTrackSuccessNodes.has(chain[i]) || alreadyDeclaredFlags.has(safeId)) {
890
890
  if (!alreadyDeclaredFlags.has(safeId)) {
891
891
  lines.push(`${indent}let ${safeId}_success = false;`);
892
892
  }
@@ -924,7 +924,7 @@ function generateBranchingChainCode(chain, workflow, nodeTypes, branchingNodes,
924
924
  lines.push(`${indent}if (${guardCondition}) {`);
925
925
  }
926
926
  const nodeIndent = hasGuard ? indent + ' ' : indent;
927
- generateBranchingNodeCode(instance, nodeType, workflow, nodeTypes, effectiveRegion, availableVars, generatedNodes, lines, nodeIndent, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, preDeclaredFlags, !isLast || forceTrackSuccessNodes.has(chain[i]), // forceTrackSuccess for non-last chain nodes or nodes with promoted dependents
927
+ generateBranchingNodeCode(instance, nodeType, workflow, nodeTypes, effectiveRegion, availableVars, generatedNodes, lines, nodeIndent, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, preDeclaredFlags, !isLast || forceTrackSuccessNodes.has(chain[i]) || alreadyDeclaredFlags.has(safeId), // forceTrackSuccess for non-last chain nodes, nodes with promoted dependents, or nodes with pre-declared flags
928
928
  production);
929
929
  // Generate scoped children for this chain node
930
930
  generateScopedChildrenExecution(instance, nodeType, workflow, nodeTypes, generatedNodes, availableVars, lines, nodeIndent, branchingNodes, branchRegions, isAsync, bundleMode, production);
@@ -1225,7 +1225,8 @@ bundleMode = false, preDeclaredSuccessFlags = new Set(), forceTrackSuccess = fal
1225
1225
  lines.push(`${indent} let ${nestedSafeId}_success = false;`);
1226
1226
  nestedPreDeclared.add(nestedSafeId);
1227
1227
  }
1228
- generateBranchingNodeCode(inst, nodeType, workflow, allNodeTypes, nestedRegion, successVars, generatedNodes, lines, `${indent} `, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, nestedPreDeclared, false, production);
1228
+ generateBranchingNodeCode(inst, nodeType, workflow, allNodeTypes, nestedRegion, successVars, generatedNodes, lines, `${indent} `, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, nestedPreDeclared, nestedPreDeclared.has(nestedSafeId), // force tracking if flag was pre-declared at higher scope
1229
+ production);
1229
1230
  successExecutedNodes.push(instanceId);
1230
1231
  nestedRegion.successNodes.forEach((n) => successExecutedNodes.push(n));
1231
1232
  nestedRegion.failureNodes.forEach((n) => successExecutedNodes.push(n));
@@ -1275,7 +1276,8 @@ bundleMode = false, preDeclaredSuccessFlags = new Set(), forceTrackSuccess = fal
1275
1276
  lines.push(`${indent} let ${nestedSafeId}_success = false;`);
1276
1277
  nestedPreDeclared.add(nestedSafeId);
1277
1278
  }
1278
- generateBranchingNodeCode(inst, nodeType, workflow, allNodeTypes, nestedRegion, failureVars, generatedNodes, lines, `${indent} `, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, nestedPreDeclared, false, production);
1279
+ generateBranchingNodeCode(inst, nodeType, workflow, allNodeTypes, nestedRegion, failureVars, generatedNodes, lines, `${indent} `, false, branchingNodes, branchRegions, isAsync, ctxVar, bundleMode, nestedPreDeclared, nestedPreDeclared.has(nestedSafeId), // force tracking if flag was pre-declared at higher scope
1280
+ production);
1279
1281
  failureExecutedNodes.push(instanceId);
1280
1282
  nestedRegion.successNodes.forEach((n) => failureExecutedNodes.push(n));
1281
1283
  nestedRegion.failureNodes.forEach((n) => failureExecutedNodes.push(n));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.23.4",
3
+ "version": "0.23.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",