@synergenius/flow-weaver 0.17.12 → 0.17.14
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.
- package/dist/cli/flow-weaver.mjs +68 -46
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/parser.js +24 -2
- package/package.json +5 -1
package/dist/cli/flow-weaver.mjs
CHANGED
|
@@ -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.17.
|
|
9674
|
+
VERSION = "0.17.14";
|
|
9675
9675
|
}
|
|
9676
9676
|
});
|
|
9677
9677
|
|
|
@@ -35480,6 +35480,52 @@ var init_registry = __esm({
|
|
|
35480
35480
|
}
|
|
35481
35481
|
});
|
|
35482
35482
|
|
|
35483
|
+
// src/validation/rule-registry.ts
|
|
35484
|
+
var ValidationRuleRegistry;
|
|
35485
|
+
var init_rule_registry = __esm({
|
|
35486
|
+
"src/validation/rule-registry.ts"() {
|
|
35487
|
+
"use strict";
|
|
35488
|
+
ValidationRuleRegistry = class {
|
|
35489
|
+
ruleSets = [];
|
|
35490
|
+
/** Register a validation rule set. */
|
|
35491
|
+
register(ruleSet) {
|
|
35492
|
+
this.ruleSets.push(ruleSet);
|
|
35493
|
+
}
|
|
35494
|
+
/**
|
|
35495
|
+
* Get all validation rules applicable to the given workflow AST.
|
|
35496
|
+
* Runs each registered detect predicate and collects rules from matching sets.
|
|
35497
|
+
*/
|
|
35498
|
+
getApplicableRules(ast) {
|
|
35499
|
+
const rules = [];
|
|
35500
|
+
for (const ruleSet of this.ruleSets) {
|
|
35501
|
+
if (ruleSet.detect(ast)) {
|
|
35502
|
+
rules.push(...ruleSet.getRules());
|
|
35503
|
+
}
|
|
35504
|
+
}
|
|
35505
|
+
return rules;
|
|
35506
|
+
}
|
|
35507
|
+
/** Get the number of registered rule sets. */
|
|
35508
|
+
get size() {
|
|
35509
|
+
return this.ruleSets.length;
|
|
35510
|
+
}
|
|
35511
|
+
};
|
|
35512
|
+
}
|
|
35513
|
+
});
|
|
35514
|
+
|
|
35515
|
+
// src/api/validation-registry.ts
|
|
35516
|
+
var validation_registry_exports = {};
|
|
35517
|
+
__export(validation_registry_exports, {
|
|
35518
|
+
validationRuleRegistry: () => validationRuleRegistry
|
|
35519
|
+
});
|
|
35520
|
+
var validationRuleRegistry;
|
|
35521
|
+
var init_validation_registry = __esm({
|
|
35522
|
+
"src/api/validation-registry.ts"() {
|
|
35523
|
+
"use strict";
|
|
35524
|
+
init_rule_registry();
|
|
35525
|
+
validationRuleRegistry = new ValidationRuleRegistry();
|
|
35526
|
+
}
|
|
35527
|
+
});
|
|
35528
|
+
|
|
35483
35529
|
// src/parser.ts
|
|
35484
35530
|
import * as path6 from "node:path";
|
|
35485
35531
|
import * as fs7 from "node:fs";
|
|
@@ -35606,12 +35652,12 @@ var init_parser2 = __esm({
|
|
|
35606
35652
|
async loadPackHandlers(projectDir) {
|
|
35607
35653
|
if (this.loadedPackDirs.has(projectDir)) return;
|
|
35608
35654
|
this.loadedPackDirs.add(projectDir);
|
|
35609
|
-
const { discoverTagHandlers: discoverTagHandlers2 } = await Promise.resolve().then(() => (init_registry(), registry_exports));
|
|
35655
|
+
const { discoverTagHandlers: discoverTagHandlers2, discoverValidationRuleSets: discoverValidationRuleSets2 } = await Promise.resolve().then(() => (init_registry(), registry_exports));
|
|
35656
|
+
const { pathToFileURL: pathToFileURL4 } = await import("node:url");
|
|
35610
35657
|
const handlers2 = await discoverTagHandlers2(projectDir);
|
|
35611
35658
|
for (const discovered of handlers2) {
|
|
35612
35659
|
if (discovered.tags.every((t) => this.tagRegistry.has(t))) continue;
|
|
35613
35660
|
try {
|
|
35614
|
-
const { pathToFileURL: pathToFileURL4 } = await import("node:url");
|
|
35615
35661
|
const mod = await import(pathToFileURL4(discovered.absoluteFile).href);
|
|
35616
35662
|
const handlerFn = discovered.exportName ? mod[discovered.exportName] : mod.default;
|
|
35617
35663
|
if (typeof handlerFn === "function") {
|
|
@@ -35625,6 +35671,24 @@ var init_parser2 = __esm({
|
|
|
35625
35671
|
} catch {
|
|
35626
35672
|
}
|
|
35627
35673
|
}
|
|
35674
|
+
const { validationRuleRegistry: validationRuleRegistry2 } = await Promise.resolve().then(() => (init_validation_registry(), validation_registry_exports));
|
|
35675
|
+
const ruleSets = await discoverValidationRuleSets2(projectDir);
|
|
35676
|
+
for (const ruleSet of ruleSets) {
|
|
35677
|
+
try {
|
|
35678
|
+
const mod = await import(pathToFileURL4(ruleSet.absoluteFile).href);
|
|
35679
|
+
const detectFn = mod[ruleSet.detectExport ?? "detect"];
|
|
35680
|
+
const getRulesFn = mod[ruleSet.rulesExport ?? "getRules"];
|
|
35681
|
+
if (typeof detectFn === "function" && typeof getRulesFn === "function") {
|
|
35682
|
+
validationRuleRegistry2.register({
|
|
35683
|
+
name: ruleSet.name,
|
|
35684
|
+
namespace: ruleSet.namespace,
|
|
35685
|
+
detect: detectFn,
|
|
35686
|
+
getRules: getRulesFn
|
|
35687
|
+
});
|
|
35688
|
+
}
|
|
35689
|
+
} catch {
|
|
35690
|
+
}
|
|
35691
|
+
}
|
|
35628
35692
|
}
|
|
35629
35693
|
computeHash(content) {
|
|
35630
35694
|
return createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
@@ -39841,48 +39905,6 @@ var init_agent_rules = __esm({
|
|
|
39841
39905
|
}
|
|
39842
39906
|
});
|
|
39843
39907
|
|
|
39844
|
-
// src/validation/rule-registry.ts
|
|
39845
|
-
var ValidationRuleRegistry;
|
|
39846
|
-
var init_rule_registry = __esm({
|
|
39847
|
-
"src/validation/rule-registry.ts"() {
|
|
39848
|
-
"use strict";
|
|
39849
|
-
ValidationRuleRegistry = class {
|
|
39850
|
-
ruleSets = [];
|
|
39851
|
-
/** Register a validation rule set. */
|
|
39852
|
-
register(ruleSet) {
|
|
39853
|
-
this.ruleSets.push(ruleSet);
|
|
39854
|
-
}
|
|
39855
|
-
/**
|
|
39856
|
-
* Get all validation rules applicable to the given workflow AST.
|
|
39857
|
-
* Runs each registered detect predicate and collects rules from matching sets.
|
|
39858
|
-
*/
|
|
39859
|
-
getApplicableRules(ast) {
|
|
39860
|
-
const rules = [];
|
|
39861
|
-
for (const ruleSet of this.ruleSets) {
|
|
39862
|
-
if (ruleSet.detect(ast)) {
|
|
39863
|
-
rules.push(...ruleSet.getRules());
|
|
39864
|
-
}
|
|
39865
|
-
}
|
|
39866
|
-
return rules;
|
|
39867
|
-
}
|
|
39868
|
-
/** Get the number of registered rule sets. */
|
|
39869
|
-
get size() {
|
|
39870
|
-
return this.ruleSets.length;
|
|
39871
|
-
}
|
|
39872
|
-
};
|
|
39873
|
-
}
|
|
39874
|
-
});
|
|
39875
|
-
|
|
39876
|
-
// src/api/validation-registry.ts
|
|
39877
|
-
var validationRuleRegistry;
|
|
39878
|
-
var init_validation_registry = __esm({
|
|
39879
|
-
"src/api/validation-registry.ts"() {
|
|
39880
|
-
"use strict";
|
|
39881
|
-
init_rule_registry();
|
|
39882
|
-
validationRuleRegistry = new ValidationRuleRegistry();
|
|
39883
|
-
}
|
|
39884
|
-
});
|
|
39885
|
-
|
|
39886
39908
|
// src/api/validate.ts
|
|
39887
39909
|
var validate_exports = {};
|
|
39888
39910
|
__export(validate_exports, {
|
|
@@ -105891,7 +105913,7 @@ function displayInstalledPackage(pkg) {
|
|
|
105891
105913
|
// src/cli/index.ts
|
|
105892
105914
|
init_logger();
|
|
105893
105915
|
init_error_utils();
|
|
105894
|
-
var version2 = true ? "0.17.
|
|
105916
|
+
var version2 = true ? "0.17.14" : "0.0.0-dev";
|
|
105895
105917
|
var program2 = new Command();
|
|
105896
105918
|
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", () => {
|
|
105897
105919
|
logger.banner(version2);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.17.
|
|
1
|
+
export declare const VERSION = "0.17.14";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
package/dist/parser.js
CHANGED
|
@@ -89,14 +89,15 @@ export class AnnotationParser {
|
|
|
89
89
|
if (this.loadedPackDirs.has(projectDir))
|
|
90
90
|
return;
|
|
91
91
|
this.loadedPackDirs.add(projectDir);
|
|
92
|
-
const { discoverTagHandlers } = await import('./marketplace/registry.js');
|
|
92
|
+
const { discoverTagHandlers, discoverValidationRuleSets } = await import('./marketplace/registry.js');
|
|
93
|
+
const { pathToFileURL } = await import('node:url');
|
|
94
|
+
// Load tag handlers
|
|
93
95
|
const handlers = await discoverTagHandlers(projectDir);
|
|
94
96
|
for (const discovered of handlers) {
|
|
95
97
|
// Skip if these tags are already registered (e.g. by side-effect imports)
|
|
96
98
|
if (discovered.tags.every((t) => this.tagRegistry.has(t)))
|
|
97
99
|
continue;
|
|
98
100
|
try {
|
|
99
|
-
const { pathToFileURL } = await import('node:url');
|
|
100
101
|
const mod = await import(pathToFileURL(discovered.absoluteFile).href);
|
|
101
102
|
const handlerFn = discovered.exportName ? mod[discovered.exportName] : mod.default;
|
|
102
103
|
if (typeof handlerFn === 'function') {
|
|
@@ -107,6 +108,27 @@ export class AnnotationParser {
|
|
|
107
108
|
// Skip handlers that fail to load (pack may not be built)
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
// Load validation rule sets
|
|
112
|
+
const { validationRuleRegistry } = await import('./api/validation-registry.js');
|
|
113
|
+
const ruleSets = await discoverValidationRuleSets(projectDir);
|
|
114
|
+
for (const ruleSet of ruleSets) {
|
|
115
|
+
try {
|
|
116
|
+
const mod = await import(pathToFileURL(ruleSet.absoluteFile).href);
|
|
117
|
+
const detectFn = mod[ruleSet.detectExport ?? 'detect'];
|
|
118
|
+
const getRulesFn = mod[ruleSet.rulesExport ?? 'getRules'];
|
|
119
|
+
if (typeof detectFn === 'function' && typeof getRulesFn === 'function') {
|
|
120
|
+
validationRuleRegistry.register({
|
|
121
|
+
name: ruleSet.name,
|
|
122
|
+
namespace: ruleSet.namespace,
|
|
123
|
+
detect: detectFn,
|
|
124
|
+
getRules: getRulesFn,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Skip rule sets that fail to load
|
|
130
|
+
}
|
|
131
|
+
}
|
|
110
132
|
}
|
|
111
133
|
computeHash(content) {
|
|
112
134
|
return createHash('sha256').update(content).digest('hex').slice(0, 16);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synergenius/flow-weaver",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.14",
|
|
4
4
|
"description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -82,6 +82,10 @@
|
|
|
82
82
|
"./cli": {
|
|
83
83
|
"types": "./dist/cli/exports.d.ts",
|
|
84
84
|
"default": "./dist/cli/exports.js"
|
|
85
|
+
},
|
|
86
|
+
"./executor": {
|
|
87
|
+
"types": "./dist/mcp/workflow-executor.d.ts",
|
|
88
|
+
"default": "./dist/mcp/workflow-executor.js"
|
|
85
89
|
}
|
|
86
90
|
},
|
|
87
91
|
"bin": {
|