@synergenius/flow-weaver 0.21.18 → 0.21.20

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.18";
9674
+ VERSION = "0.21.20";
9675
9675
  }
9676
9676
  });
9677
9677
 
@@ -93270,7 +93270,7 @@ function displayInstalledPackage(pkg) {
93270
93270
  // src/cli/index.ts
93271
93271
  init_logger();
93272
93272
  init_error_utils();
93273
- var version2 = true ? "0.21.18" : "0.0.0-dev";
93273
+ var version2 = true ? "0.21.20" : "0.0.0-dev";
93274
93274
  var program2 = new Command();
93275
93275
  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", () => {
93276
93276
  logger.banner(version2);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.21.18";
1
+ export declare const VERSION = "0.21.20";
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.18';
2
+ export const VERSION = '0.21.20';
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -31,7 +31,8 @@ export type TNpmNodeType = {
31
31
  description: string;
32
32
  };
33
33
  /**
34
- * Get list of packages that have TypeScript declarations (.d.ts files).
34
+ * Get list of all packages that have TypeScript declarations (.d.ts files).
35
+ * Any package with types can be used as a node type in workflows.
35
36
  * Excludes @types/* packages as they are type augmentations.
36
37
  *
37
38
  * @param workdir - Directory to start searching from
@@ -41,7 +41,6 @@ function listPackagesInNodeModules(nmDir) {
41
41
  for (const entry of entries) {
42
42
  if (!entry.isDirectory())
43
43
  continue;
44
- // Handle scoped packages (@scope/pkg)
45
44
  if (entry.name.startsWith('@')) {
46
45
  const scopeDir = path.join(nmDir, entry.name);
47
46
  try {
@@ -57,7 +56,6 @@ function listPackagesInNodeModules(nmDir) {
57
56
  }
58
57
  }
59
58
  else {
60
- // Regular package
61
59
  packages.push(entry.name);
62
60
  }
63
61
  }
@@ -68,7 +66,8 @@ function listPackagesInNodeModules(nmDir) {
68
66
  return packages;
69
67
  }
70
68
  /**
71
- * Get list of packages that have TypeScript declarations (.d.ts files).
69
+ * Get list of all packages that have TypeScript declarations (.d.ts files).
70
+ * Any package with types can be used as a node type in workflows.
72
71
  * Excludes @types/* packages as they are type augmentations.
73
72
  *
74
73
  * @param workdir - Directory to start searching from
@@ -84,14 +83,11 @@ export function getTypedPackages(workdir, nodeModulesOverride) {
84
83
  for (const nmDir of nodeModulesDirs) {
85
84
  const packages = listPackagesInNodeModules(nmDir);
86
85
  for (const pkg of packages) {
87
- // Skip @types/* packages - they are type augmentations, not actual packages
88
86
  if (pkg.startsWith('@types/'))
89
87
  continue;
90
- // Skip if already seen (from a closer node_modules)
91
88
  if (seenPackages.has(pkg))
92
89
  continue;
93
90
  seenPackages.add(pkg);
94
- // Check if package has types
95
91
  const typesPath = resolvePackageTypesPath(pkg, workdir, nodeModulesOverride);
96
92
  if (typesPath) {
97
93
  typed.push({ name: pkg, typesPath });
@@ -100,16 +96,14 @@ export function getTypedPackages(workdir, nodeModulesOverride) {
100
96
  }
101
97
  return { packages: typed };
102
98
  }
103
- /**
104
- * Capitalize first letter of a string.
105
- */
99
+ const PRIMITIVE_TYPES = new Set(['string', 'number', 'boolean', 'any', 'unknown', 'never']);
106
100
  function capitalize(str) {
107
101
  return str.charAt(0).toUpperCase() + str.slice(1);
108
102
  }
109
103
  /**
110
104
  * Infer node type from a function declaration in a .d.ts file.
111
105
  */
112
- function inferNodeTypeFromDtsFunction(fn, packageName, _dtsPath) {
106
+ function inferNodeTypeFromDtsFunction(fn, packageName) {
113
107
  const fnName = fn.getName();
114
108
  if (!fnName)
115
109
  return null;
@@ -149,8 +143,7 @@ function inferNodeTypeFromDtsFunction(fn, packageName, _dtsPath) {
149
143
  }
150
144
  const unwrappedText = returnType.getText();
151
145
  if (unwrappedText !== 'void' && unwrappedText !== 'undefined') {
152
- const primitiveTypes = new Set(['string', 'number', 'boolean', 'any', 'unknown', 'never']);
153
- const isPrimitive = primitiveTypes.has(unwrappedText);
146
+ const isPrimitive = PRIMITIVE_TYPES.has(unwrappedText);
154
147
  const isArray = unwrappedText.endsWith('[]') || unwrappedText.startsWith('Array<');
155
148
  const properties = returnType.getProperties();
156
149
  const isObjectLike = !isPrimitive && !isArray && returnType.isObject() && properties.length > 0;
@@ -239,7 +232,7 @@ export function getPackageExports(packageName, workdir, nodeModulesOverride) {
239
232
  if (!fnName || seenFunctionNames.has(fnName))
240
233
  continue;
241
234
  seenFunctionNames.add(fnName);
242
- const nodeType = inferNodeTypeFromDtsFunction(fn, packageName, typesPath);
235
+ const nodeType = inferNodeTypeFromDtsFunction(fn, packageName);
243
236
  if (nodeType) {
244
237
  nodeTypes.push(nodeType);
245
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.21.18",
3
+ "version": "0.21.20",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",