@synergenius/flow-weaver 0.21.15 → 0.21.16

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.
@@ -9671,7 +9671,7 @@ var VERSION;
9671
9671
  var init_generated_version = __esm({
9672
9672
  "src/generated-version.ts"() {
9673
9673
  "use strict";
9674
- VERSION = "0.21.15";
9674
+ VERSION = "0.21.16";
9675
9675
  }
9676
9676
  });
9677
9677
 
@@ -36264,7 +36264,28 @@ ${fn.getText()}` : fn.getText();
36264
36264
  Object.values(outputs).forEach((port) => {
36265
36265
  if (port.scope) portScopes.add(port.scope);
36266
36266
  });
36267
- const scopes = config2.scope ? [config2.scope] : portScopes.size > 0 ? Array.from(portScopes) : void 0;
36267
+ let scopes;
36268
+ if (config2.scope) {
36269
+ scopes = [config2.scope];
36270
+ } else if (portScopes.size > 0) {
36271
+ const orderedScopes = [];
36272
+ try {
36273
+ const params = fn.getParameters();
36274
+ for (const param of params) {
36275
+ const paramName = param.getName();
36276
+ if (portScopes.has(paramName)) {
36277
+ orderedScopes.push(paramName);
36278
+ }
36279
+ }
36280
+ } catch {
36281
+ }
36282
+ for (const scope of portScopes) {
36283
+ if (!orderedScopes.includes(scope)) {
36284
+ orderedScopes.push(scope);
36285
+ }
36286
+ }
36287
+ scopes = orderedScopes;
36288
+ }
36268
36289
  nodeTypes.push({
36269
36290
  type: "NodeType",
36270
36291
  name: nodeTypeName,
@@ -93209,7 +93230,7 @@ function displayInstalledPackage(pkg) {
93209
93230
  // src/cli/index.ts
93210
93231
  init_logger();
93211
93232
  init_error_utils();
93212
- var version2 = true ? "0.21.15" : "0.0.0-dev";
93233
+ var version2 = true ? "0.21.16" : "0.0.0-dev";
93213
93234
  var program2 = new Command();
93214
93235
  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", () => {
93215
93236
  logger.banner(version2);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.21.15";
1
+ export declare const VERSION = "0.21.16";
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.21.15';
2
+ export const VERSION = '0.21.16';
3
3
  //# sourceMappingURL=generated-version.js.map
package/dist/parser.js CHANGED
@@ -789,13 +789,35 @@ export class AnnotationParser {
789
789
  });
790
790
  // Determine scopes array:
791
791
  // - If node has node-level scope: use that (old architecture)
792
- // - Otherwise if ports have scopes: use unique port scopes (per-port architecture)
792
+ // - Otherwise if ports have scopes: use unique port scopes ordered by function parameter position
793
793
  // - Otherwise: undefined (no scopes)
794
- const scopes = config.scope
795
- ? [config.scope]
796
- : portScopes.size > 0
797
- ? Array.from(portScopes)
798
- : undefined;
794
+ let scopes;
795
+ if (config.scope) {
796
+ scopes = [config.scope];
797
+ }
798
+ else if (portScopes.size > 0) {
799
+ // Order scopes by function parameter position (callback params whose name matches a scope)
800
+ const orderedScopes = [];
801
+ try {
802
+ const params = fn.getParameters();
803
+ for (const param of params) {
804
+ const paramName = param.getName();
805
+ if (portScopes.has(paramName)) {
806
+ orderedScopes.push(paramName);
807
+ }
808
+ }
809
+ }
810
+ catch {
811
+ // Fall back to Set order if parameter extraction fails
812
+ }
813
+ // Add any scopes not found as params (e.g. from JSDoc-only scope declarations)
814
+ for (const scope of portScopes) {
815
+ if (!orderedScopes.includes(scope)) {
816
+ orderedScopes.push(scope);
817
+ }
818
+ }
819
+ scopes = orderedScopes;
820
+ }
799
821
  nodeTypes.push({
800
822
  type: 'NodeType',
801
823
  name: nodeTypeName,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.21.15",
3
+ "version": "0.21.16",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",