@synergenius/flow-weaver 0.19.4 → 0.20.0

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.4";
9674
+ VERSION = "0.20.0";
9675
9675
  }
9676
9676
  });
9677
9677
 
@@ -73228,6 +73228,40 @@ __export(pack_commands_exports, {
73228
73228
  registerPackCommands: () => registerPackCommands
73229
73229
  });
73230
73230
  import * as path55 from "path";
73231
+ import { createRequire as createRequire2 } from "node:module";
73232
+ function getEngineVersion2() {
73233
+ try {
73234
+ const req = createRequire2(import.meta.url);
73235
+ const pkg = req("../../package.json");
73236
+ return pkg.version;
73237
+ } catch {
73238
+ return "0.0.0";
73239
+ }
73240
+ }
73241
+ function compareVersions2(a, b) {
73242
+ const pa = a.split(".").map(Number);
73243
+ const pb = b.split(".").map(Number);
73244
+ for (let i = 0; i < 3; i++) {
73245
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
73246
+ if (diff !== 0) return diff;
73247
+ }
73248
+ return 0;
73249
+ }
73250
+ function checkPackEngineVersion2(pkg) {
73251
+ const required2 = pkg.manifest.engineVersion;
73252
+ if (!required2) return;
73253
+ const minVersion = required2.replace(/^>=?\s*/, "");
73254
+ const current2 = getEngineVersion2();
73255
+ if (current2 === "0.0.0") return;
73256
+ if (compareVersions2(current2, minVersion) < 0) {
73257
+ console.warn(
73258
+ `\x1B[33mWarning: ${pkg.name} requires flow-weaver >=${minVersion} but ${current2} is installed.\x1B[0m`
73259
+ );
73260
+ console.warn(
73261
+ `\x1B[33mRun: npm install @synergenius/flow-weaver@latest\x1B[0m`
73262
+ );
73263
+ }
73264
+ }
73231
73265
  function deriveNamespace(packageName) {
73232
73266
  const base = packageName.replace(/^@[^/]+\//, "");
73233
73267
  return base.replace(/^flowweaver-pack-/, "");
@@ -73243,6 +73277,7 @@ async function registerPackCommands(program3) {
73243
73277
  for (const pkg of packages) {
73244
73278
  const manifest = pkg.manifest;
73245
73279
  if (!manifest.cliEntrypoint || !manifest.cliCommands?.length) continue;
73280
+ checkPackEngineVersion2(pkg);
73246
73281
  const namespace = deriveNamespace(pkg.name);
73247
73282
  const entrypointPath = path55.join(pkg.path, manifest.cliEntrypoint);
73248
73283
  const group = program3.command(namespace).description(`Commands from ${pkg.name}`);
@@ -103591,6 +103626,42 @@ function registerPrompts(mcp) {
103591
103626
  // src/mcp/pack-tools.ts
103592
103627
  init_registry();
103593
103628
  import * as path44 from "path";
103629
+ import { createRequire } from "node:module";
103630
+ function getEngineVersion() {
103631
+ try {
103632
+ const req = createRequire(import.meta.url);
103633
+ const pkg = req("../../package.json");
103634
+ return pkg.version;
103635
+ } catch {
103636
+ return "0.0.0";
103637
+ }
103638
+ }
103639
+ function compareVersions(a, b) {
103640
+ const pa = a.split(".").map(Number);
103641
+ const pb = b.split(".").map(Number);
103642
+ for (let i = 0; i < 3; i++) {
103643
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
103644
+ if (diff !== 0) return diff;
103645
+ }
103646
+ return 0;
103647
+ }
103648
+ function checkPackEngineVersion(pkg) {
103649
+ const required2 = pkg.manifest.engineVersion;
103650
+ if (!required2) return;
103651
+ const minVersion = required2.replace(/^>=?\s*/, "");
103652
+ const current2 = getEngineVersion();
103653
+ if (current2 === "0.0.0") return;
103654
+ if (compareVersions(current2, minVersion) < 0) {
103655
+ process.stderr.write(
103656
+ `\x1B[33mWarning: ${pkg.name} requires flow-weaver >=${minVersion} but ${current2} is installed.\x1B[0m
103657
+ `
103658
+ );
103659
+ process.stderr.write(
103660
+ `\x1B[33mRun: npm install @synergenius/flow-weaver@latest\x1B[0m
103661
+ `
103662
+ );
103663
+ }
103664
+ }
103594
103665
  async function registerPackMcpTools(mcp) {
103595
103666
  const projectDir = process.cwd();
103596
103667
  let packages;
@@ -103602,6 +103673,7 @@ async function registerPackMcpTools(mcp) {
103602
103673
  for (const pkg of packages) {
103603
103674
  const manifest = pkg.manifest;
103604
103675
  if (!manifest.mcpEntrypoint || !manifest.mcpTools?.length) continue;
103676
+ checkPackEngineVersion(pkg);
103605
103677
  const entrypointPath = path44.join(pkg.path, manifest.mcpEntrypoint);
103606
103678
  try {
103607
103679
  const mod = await import(entrypointPath);
@@ -106439,7 +106511,7 @@ function displayInstalledPackage(pkg) {
106439
106511
  // src/cli/index.ts
106440
106512
  init_logger();
106441
106513
  init_error_utils();
106442
- var version2 = true ? "0.19.4" : "0.0.0-dev";
106514
+ var version2 = true ? "0.20.0" : "0.0.0-dev";
106443
106515
  var program2 = new Command();
106444
106516
  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", () => {
106445
106517
  logger.banner(version2);
@@ -9,7 +9,41 @@
9
9
  * when the user actually invokes a pack command.
10
10
  */
11
11
  import * as path from 'path';
12
+ import { createRequire } from 'node:module';
12
13
  import { listInstalledPackages } from '../marketplace/registry.js';
14
+ function getEngineVersion() {
15
+ try {
16
+ const req = createRequire(import.meta.url);
17
+ const pkg = req('../../package.json');
18
+ return pkg.version;
19
+ }
20
+ catch {
21
+ return '0.0.0';
22
+ }
23
+ }
24
+ function compareVersions(a, b) {
25
+ const pa = a.split('.').map(Number);
26
+ const pb = b.split('.').map(Number);
27
+ for (let i = 0; i < 3; i++) {
28
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
29
+ if (diff !== 0)
30
+ return diff;
31
+ }
32
+ return 0;
33
+ }
34
+ function checkPackEngineVersion(pkg) {
35
+ const required = pkg.manifest.engineVersion;
36
+ if (!required)
37
+ return;
38
+ const minVersion = required.replace(/^>=?\s*/, '');
39
+ const current = getEngineVersion();
40
+ if (current === '0.0.0')
41
+ return; // dev mode, skip check
42
+ if (compareVersions(current, minVersion) < 0) {
43
+ console.warn(`\x1b[33mWarning: ${pkg.name} requires flow-weaver >=${minVersion} but ${current} is installed.\x1b[0m`);
44
+ console.warn(`\x1b[33mRun: npm install @synergenius/flow-weaver@latest\x1b[0m`);
45
+ }
46
+ }
13
47
  /**
14
48
  * Derive a short namespace from a pack's npm name.
15
49
  * @synergenius/flowweaver-pack-weaver -> weaver
@@ -32,6 +66,7 @@ export async function registerPackCommands(program) {
32
66
  const manifest = pkg.manifest;
33
67
  if (!manifest.cliEntrypoint || !manifest.cliCommands?.length)
34
68
  continue;
69
+ checkPackEngineVersion(pkg);
35
70
  const namespace = deriveNamespace(pkg.name);
36
71
  const entrypointPath = path.join(pkg.path, manifest.cliEntrypoint);
37
72
  const group = program
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.19.4";
1
+ export declare const VERSION = "0.20.0";
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.4';
2
+ export const VERSION = '0.20.0';
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -5,7 +5,41 @@
5
5
  * imports the entrypoint and calls its registerMcpTools(mcp) function.
6
6
  */
7
7
  import * as path from 'path';
8
+ import { createRequire } from 'node:module';
8
9
  import { listInstalledPackages } from '../marketplace/registry.js';
10
+ function getEngineVersion() {
11
+ try {
12
+ const req = createRequire(import.meta.url);
13
+ const pkg = req('../../package.json');
14
+ return pkg.version;
15
+ }
16
+ catch {
17
+ return '0.0.0';
18
+ }
19
+ }
20
+ function compareVersions(a, b) {
21
+ const pa = a.split('.').map(Number);
22
+ const pb = b.split('.').map(Number);
23
+ for (let i = 0; i < 3; i++) {
24
+ const diff = (pa[i] ?? 0) - (pb[i] ?? 0);
25
+ if (diff !== 0)
26
+ return diff;
27
+ }
28
+ return 0;
29
+ }
30
+ function checkPackEngineVersion(pkg) {
31
+ const required = pkg.manifest.engineVersion;
32
+ if (!required)
33
+ return;
34
+ const minVersion = required.replace(/^>=?\s*/, '');
35
+ const current = getEngineVersion();
36
+ if (current === '0.0.0')
37
+ return;
38
+ if (compareVersions(current, minVersion) < 0) {
39
+ process.stderr.write(`\x1b[33mWarning: ${pkg.name} requires flow-weaver >=${minVersion} but ${current} is installed.\x1b[0m\n`);
40
+ process.stderr.write(`\x1b[33mRun: npm install @synergenius/flow-weaver@latest\x1b[0m\n`);
41
+ }
42
+ }
9
43
  export async function registerPackMcpTools(mcp) {
10
44
  const projectDir = process.cwd();
11
45
  let packages;
@@ -19,6 +53,7 @@ export async function registerPackMcpTools(mcp) {
19
53
  const manifest = pkg.manifest;
20
54
  if (!manifest.mcpEntrypoint || !manifest.mcpTools?.length)
21
55
  continue;
56
+ checkPackEngineVersion(pkg);
22
57
  const entrypointPath = path.join(pkg.path, manifest.mcpEntrypoint);
23
58
  try {
24
59
  const mod = await import(entrypointPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.19.4",
3
+ "version": "0.20.0",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",