@synergenius/flow-weaver 0.19.3 → 0.19.4

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.19.3";
9674
+ VERSION = "0.19.4";
9675
9675
  }
9676
9676
  });
9677
9677
 
@@ -35842,7 +35842,17 @@ var init_parser2 = __esm({
35842
35842
  const hasExtension = extensions.some((ext2) => moduleSpecifier.endsWith(ext2));
35843
35843
  if (hasExtension) {
35844
35844
  const fullPath = path6.resolve(currentDir, moduleSpecifier);
35845
- return fs7.existsSync(fullPath) ? fullPath : null;
35845
+ if (fs7.existsSync(fullPath)) return fullPath;
35846
+ if (moduleSpecifier.endsWith(".js")) {
35847
+ const tsPath = fullPath.replace(/\.js$/, ".ts");
35848
+ if (fs7.existsSync(tsPath)) return tsPath;
35849
+ const tsxPath = fullPath.replace(/\.js$/, ".tsx");
35850
+ if (fs7.existsSync(tsxPath)) return tsxPath;
35851
+ } else if (moduleSpecifier.endsWith(".jsx")) {
35852
+ const tsxPath = fullPath.replace(/\.jsx$/, ".tsx");
35853
+ if (fs7.existsSync(tsxPath)) return tsxPath;
35854
+ }
35855
+ return null;
35846
35856
  }
35847
35857
  for (const ext2 of extensions) {
35848
35858
  const fullPath = path6.resolve(currentDir, moduleSpecifier + ext2);
@@ -106429,7 +106439,7 @@ function displayInstalledPackage(pkg) {
106429
106439
  // src/cli/index.ts
106430
106440
  init_logger();
106431
106441
  init_error_utils();
106432
- var version2 = true ? "0.19.3" : "0.0.0-dev";
106442
+ var version2 = true ? "0.19.4" : "0.0.0-dev";
106433
106443
  var program2 = new Command();
106434
106444
  program2.name("flow-weaver").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", () => {
106435
106445
  logger.banner(version2);
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.19.3";
1
+ export declare const VERSION = "0.19.4";
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.19.3';
2
+ export const VERSION = '0.19.4';
3
3
  //# sourceMappingURL=generated-version.js.map
package/dist/parser.js CHANGED
@@ -311,11 +311,28 @@ export class AnnotationParser {
311
311
  }
312
312
  resolveModulePath(moduleSpecifier, currentDir) {
313
313
  const extensions = ['.ts', '.tsx', '.js', '.jsx'];
314
- // If already has extension, check if exists
314
+ // If already has extension, check if exists (with ESM .js → .ts fallback)
315
315
  const hasExtension = extensions.some((ext) => moduleSpecifier.endsWith(ext));
316
316
  if (hasExtension) {
317
317
  const fullPath = path.resolve(currentDir, moduleSpecifier);
318
- return fs.existsSync(fullPath) ? fullPath : null;
318
+ if (fs.existsSync(fullPath))
319
+ return fullPath;
320
+ // ESM convention: TypeScript files use .js extensions in imports.
321
+ // If the .js file doesn't exist, try the .ts/.tsx equivalent.
322
+ if (moduleSpecifier.endsWith('.js')) {
323
+ const tsPath = fullPath.replace(/\.js$/, '.ts');
324
+ if (fs.existsSync(tsPath))
325
+ return tsPath;
326
+ const tsxPath = fullPath.replace(/\.js$/, '.tsx');
327
+ if (fs.existsSync(tsxPath))
328
+ return tsxPath;
329
+ }
330
+ else if (moduleSpecifier.endsWith('.jsx')) {
331
+ const tsxPath = fullPath.replace(/\.jsx$/, '.tsx');
332
+ if (fs.existsSync(tsxPath))
333
+ return tsxPath;
334
+ }
335
+ return null;
319
336
  }
320
337
  // Try each extension in order
321
338
  for (const ext of extensions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.19.3",
3
+ "version": "0.19.4",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",