@synergenius/flow-weaver 0.17.5 → 0.17.7
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/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/manipulation/index.d.ts +1 -1
- package/dist/api/manipulation/index.js +1 -1
- package/dist/ast/types.d.ts +3 -29
- package/dist/cli/commands/migrate.js +1 -1
- package/dist/cli/flow-weaver.mjs +48 -427
- package/dist/deployment/index.d.ts +0 -4
- package/dist/deployment/index.js +0 -5
- package/dist/deployment/targets/base.d.ts +1 -1
- package/dist/deployment/targets/base.js +1 -1
- package/dist/diagram/geometry.d.ts +0 -2
- package/dist/diagram/geometry.js +0 -4
- package/dist/extensions/cicd/base-target.js +1 -1
- package/dist/extensions/cicd/index.d.ts +5 -0
- package/dist/extensions/cicd/index.js +5 -0
- package/dist/generated-version.d.ts +1 -1
- package/dist/generated-version.js +1 -1
- package/dist/generator/async-detection.js +1 -1
- package/dist/generator/code-utils.d.ts +2 -2
- package/dist/generator/code-utils.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/tools-editor.js +1 -1
- package/dist/mcp/tools-pattern.js +1 -1
- package/package.json +1 -1
- package/dist/api/manipulation/validation.d.ts +0 -6
- package/dist/api/manipulation/validation.js +0 -6
- package/dist/api/manipulation.d.ts +0 -8
- package/dist/api/manipulation.js +0 -8
- package/dist/jsdoc-port-sync.d.ts +0 -10
- package/dist/jsdoc-port-sync.js +0 -10
package/dist/api/index.d.ts
CHANGED
|
@@ -37,7 +37,7 @@ export { type ParseResult, parseWorkflow } from './parse.js';
|
|
|
37
37
|
export { transformWorkflow } from './transform.js';
|
|
38
38
|
export { type ValidationResult, validateWorkflow } from './validate.js';
|
|
39
39
|
export { validationRuleRegistry } from './validation-registry.js';
|
|
40
|
-
export * from './manipulation.js';
|
|
40
|
+
export * from './manipulation/index.js';
|
|
41
41
|
export { withValidation, withMinimalValidation, withoutValidation, type RemoveOptions, type NodeFilter, type OperationResult, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeTypeExists, assertNodeExists, assertNodeNotExists, } from './helpers.js';
|
|
42
42
|
export * from './query.js';
|
|
43
43
|
export * from './builder.js';
|
package/dist/api/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export { parseWorkflow } from './parse.js';
|
|
|
36
36
|
export { transformWorkflow } from './transform.js';
|
|
37
37
|
export { validateWorkflow } from './validate.js';
|
|
38
38
|
export { validationRuleRegistry } from './validation-registry.js';
|
|
39
|
-
export * from './manipulation.js';
|
|
39
|
+
export * from './manipulation/index.js';
|
|
40
40
|
export { withValidation, withMinimalValidation, withoutValidation, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeTypeExists, assertNodeExists, assertNodeNotExists, } from './helpers.js';
|
|
41
41
|
export * from './query.js';
|
|
42
42
|
export * from './builder.js';
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* - `withMinimalValidation(workflow)` - Skip expensive checks
|
|
25
25
|
* - `withoutValidation(workflow)` - No validation (use with caution)
|
|
26
26
|
*/
|
|
27
|
-
export { withoutValidation, type RemoveOptions, type NodeFilter, type OperationResult, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "
|
|
27
|
+
export { withoutValidation, type RemoveOptions, type NodeFilter, type OperationResult, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "../helpers.js";
|
|
28
28
|
export { cloneWorkflow, setWorkflowDescription, setWorkflowMetadata, setOutputFileType, renameWorkflow, setWorkflowPorts, } from "./workflow.js";
|
|
29
29
|
export { addNodeType, removeNodeType, updateNodeType, getNodeType, hasNodeType, listNodeTypes, renameNodeType, replaceNodeTypes, } from "./node-types.js";
|
|
30
30
|
export { addNode, removeNode, renameNode, updateNode, addNodes, removeNodes, setNodeConfig, setNodePosition, setNodeMinimized, setNodeSize, setNodeLabel, } from "./nodes.js";
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* - `withoutValidation(workflow)` - No validation (use with caution)
|
|
26
26
|
*/
|
|
27
27
|
// Re-export validation utilities
|
|
28
|
-
export { withoutValidation, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "
|
|
28
|
+
export { withoutValidation, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "../helpers.js";
|
|
29
29
|
// Re-export workflow-level operations
|
|
30
30
|
export { cloneWorkflow, setWorkflowDescription, setWorkflowMetadata, setOutputFileType, renameWorkflow, setWorkflowPorts, } from "./workflow.js";
|
|
31
31
|
// Re-export node type operations
|
package/dist/ast/types.d.ts
CHANGED
|
@@ -321,23 +321,6 @@ export type TPortConfig = {
|
|
|
321
321
|
type: 'all' | 'any' | 'expression';
|
|
322
322
|
expression?: string;
|
|
323
323
|
};
|
|
324
|
-
/**
|
|
325
|
-
* Legacy field - use `constant` instead
|
|
326
|
-
* @deprecated Use `constant` with type and value instead
|
|
327
|
-
*/
|
|
328
|
-
evaluateConstantAs?: {
|
|
329
|
-
type: string;
|
|
330
|
-
expression?: string;
|
|
331
|
-
value?: TSerializableValue;
|
|
332
|
-
};
|
|
333
|
-
/**
|
|
334
|
-
* Legacy field - use `executionSignal` instead
|
|
335
|
-
* @deprecated Use `executionSignal` with type and expression instead
|
|
336
|
-
*/
|
|
337
|
-
evaluateExecutionSignalAs?: {
|
|
338
|
-
type: string;
|
|
339
|
-
expression?: string;
|
|
340
|
-
};
|
|
341
324
|
};
|
|
342
325
|
/**
|
|
343
326
|
* Instance-specific configuration that can override node type defaults
|
|
@@ -397,15 +380,9 @@ export type TNodeInstanceAST = {
|
|
|
397
380
|
sourceLocation?: TSourceLocation;
|
|
398
381
|
/** Reserved for plugin extensibility */
|
|
399
382
|
metadata?: TNodeMetadata;
|
|
400
|
-
/**
|
|
401
|
-
* CI/CD job group this node belongs to (from [job: "name"] attribute).
|
|
402
|
-
* @deprecated Use `deploy?.['cicd']?.job` instead. Kept for backwards compatibility.
|
|
403
|
-
*/
|
|
383
|
+
/** CI/CD job group this node belongs to (from [job: "name"] attribute). */
|
|
404
384
|
job?: string;
|
|
405
|
-
/**
|
|
406
|
-
* CI/CD environment for this node's job (from [environment: "name"] attribute).
|
|
407
|
-
* @deprecated Use `deploy?.['cicd']?.environment` instead. Kept for backwards compatibility.
|
|
408
|
-
*/
|
|
385
|
+
/** CI/CD environment for this node's job (from [environment: "name"] attribute). */
|
|
409
386
|
environment?: string;
|
|
410
387
|
/** Per-target deploy config contributed by packs (e.g., deploy['cicd'].job) */
|
|
411
388
|
deploy?: Record<string, Record<string, unknown>>;
|
|
@@ -454,10 +431,7 @@ export type TWorkflowOptions = {
|
|
|
454
431
|
limit: number;
|
|
455
432
|
period?: string;
|
|
456
433
|
};
|
|
457
|
-
/**
|
|
458
|
-
* CI/CD pipeline configuration from @secret, @cache, @artifact, etc.
|
|
459
|
-
* @deprecated Use `deploy?.['cicd']` instead. Kept for backwards compatibility.
|
|
460
|
-
*/
|
|
434
|
+
/** CI/CD pipeline configuration from @secret, @cache, @artifact, etc. */
|
|
461
435
|
cicd?: TCICDOptions;
|
|
462
436
|
/** Target-specific config (e.g., deploy['github-actions'].runner) */
|
|
463
437
|
deploy?: Record<string, Record<string, unknown>>;
|
|
@@ -33,7 +33,7 @@ export async function migrateCommand(globPattern, options = {}) {
|
|
|
33
33
|
const filePath = path.resolve(file);
|
|
34
34
|
try {
|
|
35
35
|
const sourceCode = fs.readFileSync(filePath, 'utf8');
|
|
36
|
-
// Parse with current parser (
|
|
36
|
+
// Parse with current parser (adds defaults for missing fields)
|
|
37
37
|
const parseResult = await parseWorkflow(filePath);
|
|
38
38
|
if (parseResult.errors.length > 0) {
|
|
39
39
|
logger.error(` ${file}: parse errors — skipping`);
|
package/dist/cli/flow-weaver.mjs
CHANGED
|
@@ -17567,54 +17567,6 @@ var init_grammar_diagrams = __esm({
|
|
|
17567
17567
|
}
|
|
17568
17568
|
});
|
|
17569
17569
|
|
|
17570
|
-
// src/extensions/cicd/detection.ts
|
|
17571
|
-
function isCICDWorkflow(ast) {
|
|
17572
|
-
const cicd = ast.options?.cicd;
|
|
17573
|
-
if (cicd) {
|
|
17574
|
-
if (cicd.secrets && cicd.secrets.length > 0) return true;
|
|
17575
|
-
if (cicd.runner) return true;
|
|
17576
|
-
if (cicd.caches && cicd.caches.length > 0) return true;
|
|
17577
|
-
if (cicd.artifacts && cicd.artifacts.length > 0) return true;
|
|
17578
|
-
if (cicd.environments && cicd.environments.length > 0) return true;
|
|
17579
|
-
if (cicd.matrix) return true;
|
|
17580
|
-
if (cicd.services && cicd.services.length > 0) return true;
|
|
17581
|
-
if (cicd.concurrency) return true;
|
|
17582
|
-
if (cicd.triggers && cicd.triggers.length > 0) return true;
|
|
17583
|
-
if (cicd.jobs && cicd.jobs.length > 0) return true;
|
|
17584
|
-
if (cicd.variables && Object.keys(cicd.variables).length > 0) return true;
|
|
17585
|
-
if (cicd.beforeScript && cicd.beforeScript.length > 0) return true;
|
|
17586
|
-
if (cicd.tags && cicd.tags.length > 0) return true;
|
|
17587
|
-
if (cicd.includes && cicd.includes.length > 0) return true;
|
|
17588
|
-
if (cicd.stages && cicd.stages.length > 0) return true;
|
|
17589
|
-
}
|
|
17590
|
-
if (ast.instances.some((inst) => inst.job)) return true;
|
|
17591
|
-
return false;
|
|
17592
|
-
}
|
|
17593
|
-
function getJobNames(ast) {
|
|
17594
|
-
const jobs = /* @__PURE__ */ new Set();
|
|
17595
|
-
for (const inst of ast.instances) {
|
|
17596
|
-
if (inst.job) jobs.add(inst.job);
|
|
17597
|
-
}
|
|
17598
|
-
return Array.from(jobs);
|
|
17599
|
-
}
|
|
17600
|
-
function getDeclaredSecrets(ast) {
|
|
17601
|
-
return (ast.options?.cicd?.secrets || []).map((s) => s.name);
|
|
17602
|
-
}
|
|
17603
|
-
function getReferencedSecrets(ast) {
|
|
17604
|
-
const secrets = /* @__PURE__ */ new Set();
|
|
17605
|
-
for (const conn of ast.connections) {
|
|
17606
|
-
if (conn.from.node.startsWith("secret:")) {
|
|
17607
|
-
secrets.add(conn.from.node.substring(7));
|
|
17608
|
-
}
|
|
17609
|
-
}
|
|
17610
|
-
return Array.from(secrets);
|
|
17611
|
-
}
|
|
17612
|
-
var init_detection = __esm({
|
|
17613
|
-
"src/extensions/cicd/detection.ts"() {
|
|
17614
|
-
"use strict";
|
|
17615
|
-
}
|
|
17616
|
-
});
|
|
17617
|
-
|
|
17618
17570
|
// src/generator/compile-target-registry.ts
|
|
17619
17571
|
var CompileTargetRegistry, compileTargetRegistry;
|
|
17620
17572
|
var init_compile_target_registry = __esm({
|
|
@@ -25607,7 +25559,7 @@ var VERSION2;
|
|
|
25607
25559
|
var init_generated_version = __esm({
|
|
25608
25560
|
"src/generated-version.ts"() {
|
|
25609
25561
|
"use strict";
|
|
25610
|
-
VERSION2 = "0.17.
|
|
25562
|
+
VERSION2 = "0.17.7";
|
|
25611
25563
|
}
|
|
25612
25564
|
});
|
|
25613
25565
|
|
|
@@ -42009,14 +41961,6 @@ var init_helpers2 = __esm({
|
|
|
42009
41961
|
}
|
|
42010
41962
|
});
|
|
42011
41963
|
|
|
42012
|
-
// src/api/manipulation/validation.ts
|
|
42013
|
-
var init_validation = __esm({
|
|
42014
|
-
"src/api/manipulation/validation.ts"() {
|
|
42015
|
-
"use strict";
|
|
42016
|
-
init_helpers2();
|
|
42017
|
-
}
|
|
42018
|
-
});
|
|
42019
|
-
|
|
42020
41964
|
// src/api/manipulation/workflow.ts
|
|
42021
41965
|
var init_workflow = __esm({
|
|
42022
41966
|
"src/api/manipulation/workflow.ts"() {
|
|
@@ -42396,7 +42340,7 @@ var init_scopes = __esm({
|
|
|
42396
42340
|
var init_manipulation = __esm({
|
|
42397
42341
|
"src/api/manipulation/index.ts"() {
|
|
42398
42342
|
"use strict";
|
|
42399
|
-
|
|
42343
|
+
init_helpers2();
|
|
42400
42344
|
init_workflow();
|
|
42401
42345
|
init_node_types();
|
|
42402
42346
|
init_nodes();
|
|
@@ -42406,14 +42350,6 @@ var init_manipulation = __esm({
|
|
|
42406
42350
|
}
|
|
42407
42351
|
});
|
|
42408
42352
|
|
|
42409
|
-
// src/api/manipulation.ts
|
|
42410
|
-
var init_manipulation2 = __esm({
|
|
42411
|
-
"src/api/manipulation.ts"() {
|
|
42412
|
-
"use strict";
|
|
42413
|
-
init_manipulation();
|
|
42414
|
-
}
|
|
42415
|
-
});
|
|
42416
|
-
|
|
42417
42353
|
// src/api/query.ts
|
|
42418
42354
|
function getMainFlowConnections(ast) {
|
|
42419
42355
|
return ast.connections.filter((conn) => {
|
|
@@ -42989,7 +42925,7 @@ var init_api6 = __esm({
|
|
|
42989
42925
|
init_transform();
|
|
42990
42926
|
init_validate();
|
|
42991
42927
|
init_validation_registry();
|
|
42992
|
-
|
|
42928
|
+
init_manipulation();
|
|
42993
42929
|
init_helpers2();
|
|
42994
42930
|
init_query();
|
|
42995
42931
|
init_builder();
|
|
@@ -71355,7 +71291,7 @@ export const functionRegistry = {
|
|
|
71355
71291
|
instances = /* @__PURE__ */ new Map();
|
|
71356
71292
|
/**
|
|
71357
71293
|
* Register a target factory. The target is only instantiated on first use.
|
|
71358
|
-
* Also accepts a pre-instantiated target
|
|
71294
|
+
* Also accepts a pre-instantiated target.
|
|
71359
71295
|
*/
|
|
71360
71296
|
register(nameOrTarget, factory) {
|
|
71361
71297
|
if (typeof nameOrTarget === "string") {
|
|
@@ -71394,355 +71330,6 @@ export const functionRegistry = {
|
|
|
71394
71330
|
}
|
|
71395
71331
|
});
|
|
71396
71332
|
|
|
71397
|
-
// src/extensions/cicd/base-target.ts
|
|
71398
|
-
var NODE_ACTION_MAP, BaseCICDTarget;
|
|
71399
|
-
var init_base_target = __esm({
|
|
71400
|
-
"src/extensions/cicd/base-target.ts"() {
|
|
71401
|
-
"use strict";
|
|
71402
|
-
init_base();
|
|
71403
|
-
NODE_ACTION_MAP = {
|
|
71404
|
-
checkout: {
|
|
71405
|
-
githubAction: "actions/checkout@v4",
|
|
71406
|
-
gitlabScript: ['echo "Checkout handled by GitLab CI runner"'],
|
|
71407
|
-
label: "Checkout code"
|
|
71408
|
-
},
|
|
71409
|
-
"setup-node": {
|
|
71410
|
-
githubAction: "actions/setup-node@v4",
|
|
71411
|
-
githubWith: { "node-version": "20" },
|
|
71412
|
-
gitlabImage: "node:20",
|
|
71413
|
-
label: "Setup Node.js"
|
|
71414
|
-
},
|
|
71415
|
-
"setup-python": {
|
|
71416
|
-
githubAction: "actions/setup-python@v5",
|
|
71417
|
-
githubWith: { "python-version": "3.12" },
|
|
71418
|
-
gitlabImage: "python:3.12",
|
|
71419
|
-
label: "Setup Python"
|
|
71420
|
-
},
|
|
71421
|
-
"npm-install": {
|
|
71422
|
-
githubAction: void 0,
|
|
71423
|
-
gitlabScript: ["npm ci"],
|
|
71424
|
-
label: "Install dependencies"
|
|
71425
|
-
},
|
|
71426
|
-
"npm-test": {
|
|
71427
|
-
githubAction: void 0,
|
|
71428
|
-
gitlabScript: ["npm test"],
|
|
71429
|
-
label: "Run tests"
|
|
71430
|
-
},
|
|
71431
|
-
"npm-build": {
|
|
71432
|
-
githubAction: void 0,
|
|
71433
|
-
gitlabScript: ["npm run build"],
|
|
71434
|
-
label: "Build"
|
|
71435
|
-
},
|
|
71436
|
-
"docker-build": {
|
|
71437
|
-
githubAction: "docker/build-push-action@v6",
|
|
71438
|
-
githubWith: { push: "false" },
|
|
71439
|
-
gitlabScript: ["docker build -t $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA ."],
|
|
71440
|
-
label: "Build Docker image"
|
|
71441
|
-
},
|
|
71442
|
-
"docker-push": {
|
|
71443
|
-
githubAction: "docker/build-push-action@v6",
|
|
71444
|
-
githubWith: { push: "true" },
|
|
71445
|
-
gitlabScript: ["docker push $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA"],
|
|
71446
|
-
label: "Push Docker image"
|
|
71447
|
-
},
|
|
71448
|
-
"docker-login": {
|
|
71449
|
-
githubAction: "docker/login-action@v3",
|
|
71450
|
-
gitlabScript: ['echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY'],
|
|
71451
|
-
label: "Docker login"
|
|
71452
|
-
},
|
|
71453
|
-
"shell-command": {
|
|
71454
|
-
githubAction: void 0,
|
|
71455
|
-
gitlabScript: ['echo "TODO: Add shell command"'],
|
|
71456
|
-
label: "Run command"
|
|
71457
|
-
},
|
|
71458
|
-
"deploy-ssh": {
|
|
71459
|
-
githubAction: void 0,
|
|
71460
|
-
gitlabScript: ['echo "TODO: Configure SSH deployment"'],
|
|
71461
|
-
label: "Deploy via SSH"
|
|
71462
|
-
},
|
|
71463
|
-
"deploy-s3": {
|
|
71464
|
-
githubAction: "aws-actions/configure-aws-credentials@v4",
|
|
71465
|
-
gitlabScript: ["aws s3 sync dist/ s3://$S3_BUCKET/"],
|
|
71466
|
-
label: "Deploy to S3"
|
|
71467
|
-
},
|
|
71468
|
-
"slack-notify": {
|
|
71469
|
-
githubAction: "slackapi/slack-github-action@v1",
|
|
71470
|
-
gitlabScript: [`curl -X POST -H 'Content-type: application/json' --data '{"text":"Pipeline complete"}' $SLACK_WEBHOOK_URL`],
|
|
71471
|
-
label: "Send Slack notification"
|
|
71472
|
-
},
|
|
71473
|
-
"health-check": {
|
|
71474
|
-
githubAction: void 0,
|
|
71475
|
-
gitlabScript: ["curl --retry 10 --retry-delay 5 --retry-all-errors $HEALTH_CHECK_URL"],
|
|
71476
|
-
label: "Health check"
|
|
71477
|
-
},
|
|
71478
|
-
"wait-for-url": {
|
|
71479
|
-
githubAction: void 0,
|
|
71480
|
-
gitlabScript: ["for i in $(seq 1 30); do curl -sf $WAIT_URL && exit 0; sleep 10; done; exit 1"],
|
|
71481
|
-
label: "Wait for URL"
|
|
71482
|
-
}
|
|
71483
|
-
};
|
|
71484
|
-
BaseCICDTarget = class extends BaseExportTarget {
|
|
71485
|
-
async generateMultiWorkflow(_workflows, _options) {
|
|
71486
|
-
throw new Error("CI/CD targets use generate() with AST, not generateMultiWorkflow()");
|
|
71487
|
-
}
|
|
71488
|
-
async generateNodeTypeService(_nodeTypes, _options) {
|
|
71489
|
-
throw new Error("CI/CD targets do not export node types as services");
|
|
71490
|
-
}
|
|
71491
|
-
async generateBundle(_workflows, _nodeTypes, _options) {
|
|
71492
|
-
throw new Error("CI/CD targets use generate() with AST, not generateBundle()");
|
|
71493
|
-
}
|
|
71494
|
-
// ---------------------------------------------------------------------------
|
|
71495
|
-
// Shared CI/CD Logic
|
|
71496
|
-
// ---------------------------------------------------------------------------
|
|
71497
|
-
resolveActionMapping(step, targetName) {
|
|
71498
|
-
const deployConfig = step.nodeTypeDeploy?.[targetName];
|
|
71499
|
-
if (deployConfig) {
|
|
71500
|
-
return {
|
|
71501
|
-
githubAction: deployConfig.action,
|
|
71502
|
-
githubWith: deployConfig.with ? typeof deployConfig.with === "string" ? JSON.parse(deployConfig.with) : deployConfig.with : void 0,
|
|
71503
|
-
gitlabScript: deployConfig.script ? Array.isArray(deployConfig.script) ? deployConfig.script : [deployConfig.script] : void 0,
|
|
71504
|
-
gitlabImage: deployConfig.image,
|
|
71505
|
-
label: deployConfig.label || step.name
|
|
71506
|
-
};
|
|
71507
|
-
}
|
|
71508
|
-
return NODE_ACTION_MAP[step.nodeType] || NODE_ACTION_MAP[step.nodeType.replace(/([A-Z])/g, "-$1").toLowerCase()];
|
|
71509
|
-
}
|
|
71510
|
-
buildJobGraph(ast) {
|
|
71511
|
-
const nodeTypeLookup = /* @__PURE__ */ new Map();
|
|
71512
|
-
for (const nt of ast.nodeTypes) {
|
|
71513
|
-
nodeTypeLookup.set(nt.name, nt);
|
|
71514
|
-
if (nt.functionName !== nt.name) nodeTypeLookup.set(nt.functionName, nt);
|
|
71515
|
-
}
|
|
71516
|
-
const jobMap = /* @__PURE__ */ new Map();
|
|
71517
|
-
const defaultRunner = ast.options?.cicd?.runner;
|
|
71518
|
-
for (const inst of ast.instances) {
|
|
71519
|
-
const jobName = inst.job || "default";
|
|
71520
|
-
if (!jobMap.has(jobName)) jobMap.set(jobName, []);
|
|
71521
|
-
jobMap.get(jobName).push(inst);
|
|
71522
|
-
}
|
|
71523
|
-
const nodeJob = /* @__PURE__ */ new Map();
|
|
71524
|
-
for (const inst of ast.instances) {
|
|
71525
|
-
nodeJob.set(inst.id, inst.job || "default");
|
|
71526
|
-
}
|
|
71527
|
-
const jobDeps = /* @__PURE__ */ new Map();
|
|
71528
|
-
for (const conn of ast.connections) {
|
|
71529
|
-
if (conn.from.node.startsWith("secret:")) continue;
|
|
71530
|
-
if (conn.from.node === "Start" || conn.to.node === "Exit") continue;
|
|
71531
|
-
const fromJob = nodeJob.get(conn.from.node);
|
|
71532
|
-
const toJob = nodeJob.get(conn.to.node);
|
|
71533
|
-
if (fromJob && toJob && fromJob !== toJob) {
|
|
71534
|
-
if (!jobDeps.has(toJob)) jobDeps.set(toJob, /* @__PURE__ */ new Set());
|
|
71535
|
-
jobDeps.get(toJob).add(fromJob);
|
|
71536
|
-
}
|
|
71537
|
-
}
|
|
71538
|
-
const jobs = [];
|
|
71539
|
-
for (const [jobId, instances] of jobMap) {
|
|
71540
|
-
const environment = instances.find((i) => i.environment)?.environment;
|
|
71541
|
-
const steps = instances.map((inst) => {
|
|
71542
|
-
const nt = nodeTypeLookup.get(inst.nodeType);
|
|
71543
|
-
return {
|
|
71544
|
-
id: inst.id,
|
|
71545
|
-
name: inst.config?.label || inst.id,
|
|
71546
|
-
nodeType: inst.nodeType,
|
|
71547
|
-
...nt?.deploy && { nodeTypeDeploy: nt.deploy }
|
|
71548
|
-
};
|
|
71549
|
-
});
|
|
71550
|
-
const needs = jobDeps.get(jobId) ? Array.from(jobDeps.get(jobId)) : [];
|
|
71551
|
-
jobs.push({
|
|
71552
|
-
id: jobId,
|
|
71553
|
-
name: jobId,
|
|
71554
|
-
runner: defaultRunner,
|
|
71555
|
-
needs,
|
|
71556
|
-
steps,
|
|
71557
|
-
environment,
|
|
71558
|
-
secrets: []
|
|
71559
|
-
});
|
|
71560
|
-
}
|
|
71561
|
-
const jobConfigs = ast.options?.cicd?.jobs;
|
|
71562
|
-
if (jobConfigs) {
|
|
71563
|
-
for (const jc of jobConfigs) {
|
|
71564
|
-
const job = jobs.find((j) => j.id === jc.id);
|
|
71565
|
-
if (!job) continue;
|
|
71566
|
-
if (jc.retry !== void 0) job.retry = jc.retry;
|
|
71567
|
-
if (jc.allowFailure !== void 0) job.allowFailure = jc.allowFailure;
|
|
71568
|
-
if (jc.timeout) job.timeout = jc.timeout;
|
|
71569
|
-
if (jc.variables) job.variables = { ...job.variables, ...jc.variables };
|
|
71570
|
-
if (jc.tags) job.tags = jc.tags;
|
|
71571
|
-
if (jc.beforeScript) job.beforeScript = jc.beforeScript;
|
|
71572
|
-
if (jc.rules) job.rules = jc.rules;
|
|
71573
|
-
if (jc.coverage) job.coverage = jc.coverage;
|
|
71574
|
-
if (jc.reports) job.reports = jc.reports;
|
|
71575
|
-
if (jc.runner) job.runner = jc.runner;
|
|
71576
|
-
if (jc.extends) job.extends = jc.extends;
|
|
71577
|
-
}
|
|
71578
|
-
}
|
|
71579
|
-
const stages = ast.options?.cicd?.stages;
|
|
71580
|
-
if (stages && stages.length > 0) {
|
|
71581
|
-
const depthMap = this.computeJobDepths(jobs);
|
|
71582
|
-
for (const job of jobs) {
|
|
71583
|
-
if (!job.stage) {
|
|
71584
|
-
for (const s of stages) {
|
|
71585
|
-
if (job.id === s.name || job.id.startsWith(s.name + "-") || job.id.startsWith(s.name + "_")) {
|
|
71586
|
-
job.stage = s.name;
|
|
71587
|
-
break;
|
|
71588
|
-
}
|
|
71589
|
-
}
|
|
71590
|
-
}
|
|
71591
|
-
}
|
|
71592
|
-
for (const job of jobs) {
|
|
71593
|
-
if (!job.stage) {
|
|
71594
|
-
const depth = depthMap.get(job.id) || 0;
|
|
71595
|
-
job.stage = stages[Math.min(depth, stages.length - 1)].name;
|
|
71596
|
-
}
|
|
71597
|
-
}
|
|
71598
|
-
}
|
|
71599
|
-
const cicd = ast.options?.cicd;
|
|
71600
|
-
if (cicd) {
|
|
71601
|
-
for (const job of jobs) {
|
|
71602
|
-
if (cicd.variables && !job.variables) {
|
|
71603
|
-
job.variables = { ...cicd.variables };
|
|
71604
|
-
}
|
|
71605
|
-
if (cicd.beforeScript && !job.beforeScript) {
|
|
71606
|
-
job.beforeScript = [...cicd.beforeScript];
|
|
71607
|
-
}
|
|
71608
|
-
if (cicd.tags && !job.tags) {
|
|
71609
|
-
job.tags = [...cicd.tags];
|
|
71610
|
-
}
|
|
71611
|
-
}
|
|
71612
|
-
}
|
|
71613
|
-
return this.topoSortJobs(jobs);
|
|
71614
|
-
}
|
|
71615
|
-
topoSortJobs(jobs) {
|
|
71616
|
-
const jobMap = new Map(jobs.map((j) => [j.id, j]));
|
|
71617
|
-
const visited = /* @__PURE__ */ new Set();
|
|
71618
|
-
const sorted = [];
|
|
71619
|
-
function visit(id) {
|
|
71620
|
-
if (visited.has(id)) return;
|
|
71621
|
-
visited.add(id);
|
|
71622
|
-
const job = jobMap.get(id);
|
|
71623
|
-
if (!job) return;
|
|
71624
|
-
for (const dep of job.needs) {
|
|
71625
|
-
visit(dep);
|
|
71626
|
-
}
|
|
71627
|
-
sorted.push(job);
|
|
71628
|
-
}
|
|
71629
|
-
for (const job of jobs) {
|
|
71630
|
-
visit(job.id);
|
|
71631
|
-
}
|
|
71632
|
-
return sorted;
|
|
71633
|
-
}
|
|
71634
|
-
computeJobDepths(jobs) {
|
|
71635
|
-
const depths = /* @__PURE__ */ new Map();
|
|
71636
|
-
function depth(jobId, visited) {
|
|
71637
|
-
if (depths.has(jobId)) return depths.get(jobId);
|
|
71638
|
-
if (visited.has(jobId)) return 0;
|
|
71639
|
-
visited.add(jobId);
|
|
71640
|
-
const job = jobs.find((j) => j.id === jobId);
|
|
71641
|
-
if (!job || job.needs.length === 0) {
|
|
71642
|
-
depths.set(jobId, 0);
|
|
71643
|
-
return 0;
|
|
71644
|
-
}
|
|
71645
|
-
const maxDep = Math.max(...job.needs.map((n) => depth(n, visited)));
|
|
71646
|
-
const d = maxDep + 1;
|
|
71647
|
-
depths.set(jobId, d);
|
|
71648
|
-
return d;
|
|
71649
|
-
}
|
|
71650
|
-
for (const job of jobs) {
|
|
71651
|
-
depth(job.id, /* @__PURE__ */ new Set());
|
|
71652
|
-
}
|
|
71653
|
-
return depths;
|
|
71654
|
-
}
|
|
71655
|
-
resolveJobSecrets(jobs, ast, renderSecretRef) {
|
|
71656
|
-
const nodeJob = /* @__PURE__ */ new Map();
|
|
71657
|
-
for (const inst of ast.instances) {
|
|
71658
|
-
nodeJob.set(inst.id, inst.job || "default");
|
|
71659
|
-
}
|
|
71660
|
-
const stepMap = /* @__PURE__ */ new Map();
|
|
71661
|
-
for (const job of jobs) {
|
|
71662
|
-
for (const step of job.steps) {
|
|
71663
|
-
stepMap.set(step.id, step);
|
|
71664
|
-
}
|
|
71665
|
-
}
|
|
71666
|
-
for (const conn of ast.connections) {
|
|
71667
|
-
if (!conn.from.node.startsWith("secret:")) continue;
|
|
71668
|
-
const secretName = conn.from.node.substring(7);
|
|
71669
|
-
const targetNode = conn.to.node;
|
|
71670
|
-
const targetPort = conn.to.port;
|
|
71671
|
-
const jobId = nodeJob.get(targetNode);
|
|
71672
|
-
if (!jobId) continue;
|
|
71673
|
-
const job = jobs.find((j) => j.id === jobId);
|
|
71674
|
-
if (!job) continue;
|
|
71675
|
-
if (!job.secrets.includes(secretName)) {
|
|
71676
|
-
job.secrets.push(secretName);
|
|
71677
|
-
}
|
|
71678
|
-
const step = stepMap.get(targetNode);
|
|
71679
|
-
if (step) {
|
|
71680
|
-
step.env = step.env || {};
|
|
71681
|
-
step.env[targetPort.replace(/([A-Z])/g, "_$1").toUpperCase().replace(/^_/, "")] = renderSecretRef(secretName);
|
|
71682
|
-
}
|
|
71683
|
-
}
|
|
71684
|
-
}
|
|
71685
|
-
injectArtifactSteps(jobs, artifacts) {
|
|
71686
|
-
if (artifacts.length === 0) return;
|
|
71687
|
-
for (const job of jobs) {
|
|
71688
|
-
if (job.needs.length === 0) continue;
|
|
71689
|
-
const neededJobs = jobs.filter((j) => job.needs.includes(j.id));
|
|
71690
|
-
for (const needed of neededJobs) {
|
|
71691
|
-
const jobArtifacts = artifacts.filter(
|
|
71692
|
-
(a) => !a.name || needed.steps.some((s) => s.nodeType === a.name)
|
|
71693
|
-
);
|
|
71694
|
-
if (jobArtifacts.length > 0) {
|
|
71695
|
-
needed.uploadArtifacts = (needed.uploadArtifacts || []).concat(jobArtifacts);
|
|
71696
|
-
job.downloadArtifacts = (job.downloadArtifacts || []).concat(
|
|
71697
|
-
jobArtifacts.map((a) => a.name)
|
|
71698
|
-
);
|
|
71699
|
-
}
|
|
71700
|
-
}
|
|
71701
|
-
}
|
|
71702
|
-
}
|
|
71703
|
-
generateSecretsDoc(secrets, platform) {
|
|
71704
|
-
if (secrets.length === 0) return "";
|
|
71705
|
-
const lines = [
|
|
71706
|
-
"# Secrets Setup Guide",
|
|
71707
|
-
"",
|
|
71708
|
-
`This workflow requires ${secrets.length} secret(s) to be configured.`,
|
|
71709
|
-
""
|
|
71710
|
-
];
|
|
71711
|
-
for (const secret of secrets) {
|
|
71712
|
-
lines.push(`## ${secret.name}`);
|
|
71713
|
-
if (secret.description) {
|
|
71714
|
-
lines.push(`> ${secret.description}`);
|
|
71715
|
-
}
|
|
71716
|
-
lines.push("");
|
|
71717
|
-
if (platform === "github-actions" || secret.platform === "all" || secret.platform === "github" || !secret.platform) {
|
|
71718
|
-
lines.push("**GitHub Actions:**");
|
|
71719
|
-
lines.push("1. Go to your repository on GitHub");
|
|
71720
|
-
lines.push("2. Navigate to Settings > Secrets and variables > Actions");
|
|
71721
|
-
lines.push('3. Click "New repository secret"');
|
|
71722
|
-
lines.push(`4. Name: \`${secret.name}\``);
|
|
71723
|
-
lines.push('5. Paste your secret value and click "Add secret"');
|
|
71724
|
-
lines.push("");
|
|
71725
|
-
}
|
|
71726
|
-
if (platform === "gitlab-ci" || secret.platform === "all" || secret.platform === "gitlab" || !secret.platform) {
|
|
71727
|
-
lines.push("**GitLab CI:**");
|
|
71728
|
-
lines.push("1. Go to your project on GitLab");
|
|
71729
|
-
lines.push("2. Navigate to Settings > CI/CD > Variables");
|
|
71730
|
-
lines.push('3. Click "Add variable"');
|
|
71731
|
-
lines.push(`4. Key: \`${secret.name}\``);
|
|
71732
|
-
lines.push("5. Paste your secret value");
|
|
71733
|
-
lines.push('6. Check "Mask variable" and optionally "Protect variable"');
|
|
71734
|
-
lines.push('7. Click "Add variable"');
|
|
71735
|
-
lines.push("");
|
|
71736
|
-
}
|
|
71737
|
-
lines.push("---");
|
|
71738
|
-
lines.push("");
|
|
71739
|
-
}
|
|
71740
|
-
return lines.join("\n");
|
|
71741
|
-
}
|
|
71742
|
-
};
|
|
71743
|
-
}
|
|
71744
|
-
});
|
|
71745
|
-
|
|
71746
71333
|
// src/marketplace/registry.ts
|
|
71747
71334
|
var registry_exports = {};
|
|
71748
71335
|
__export(registry_exports, {
|
|
@@ -71898,7 +71485,6 @@ var init_registry = __esm({
|
|
|
71898
71485
|
// src/deployment/index.ts
|
|
71899
71486
|
var deployment_exports = {};
|
|
71900
71487
|
__export(deployment_exports, {
|
|
71901
|
-
BaseCICDTarget: () => BaseCICDTarget,
|
|
71902
71488
|
BaseExportTarget: () => BaseExportTarget,
|
|
71903
71489
|
CliRequestAdapter: () => CliRequestAdapter,
|
|
71904
71490
|
DEFAULT_CONFIG: () => DEFAULT_CONFIG,
|
|
@@ -71906,7 +71492,6 @@ __export(deployment_exports, {
|
|
|
71906
71492
|
DEFAULT_SERVER_CONFIG: () => DEFAULT_SERVER_CONFIG,
|
|
71907
71493
|
ExportTargetRegistry: () => ExportTargetRegistry,
|
|
71908
71494
|
HttpRequestAdapter: () => HttpRequestAdapter,
|
|
71909
|
-
NODE_ACTION_MAP: () => NODE_ACTION_MAP,
|
|
71910
71495
|
OpenAPIGenerator: () => OpenAPIGenerator,
|
|
71911
71496
|
SchemaConverter: () => SchemaConverter,
|
|
71912
71497
|
UnifiedWorkflowExecutor: () => UnifiedWorkflowExecutor,
|
|
@@ -71921,7 +71506,6 @@ __export(deployment_exports, {
|
|
|
71921
71506
|
generateStandaloneRuntimeModule: () => generateStandaloneRuntimeModule,
|
|
71922
71507
|
getConfigValue: () => getConfigValue,
|
|
71923
71508
|
getDefaultConfig: () => getDefaultConfig,
|
|
71924
|
-
isCICDWorkflow: () => isCICDWorkflow,
|
|
71925
71509
|
loadConfig: () => loadConfig,
|
|
71926
71510
|
loadConfigSync: () => loadConfigSync,
|
|
71927
71511
|
schemaConverter: () => schemaConverter
|
|
@@ -71955,9 +71539,7 @@ var init_deployment = __esm({
|
|
|
71955
71539
|
init_generator();
|
|
71956
71540
|
init_schema_converter();
|
|
71957
71541
|
init_base();
|
|
71958
|
-
init_detection();
|
|
71959
71542
|
init_inline_runtime();
|
|
71960
|
-
init_base_target();
|
|
71961
71543
|
init_base();
|
|
71962
71544
|
}
|
|
71963
71545
|
});
|
|
@@ -73514,11 +73096,50 @@ function parseCicdTrigger(text, d, warnings) {
|
|
|
73514
73096
|
triggers.push(trigger);
|
|
73515
73097
|
}
|
|
73516
73098
|
|
|
73517
|
-
// src/extensions/cicd/
|
|
73518
|
-
|
|
73099
|
+
// src/extensions/cicd/detection.ts
|
|
73100
|
+
function isCICDWorkflow(ast) {
|
|
73101
|
+
const cicd = ast.options?.cicd;
|
|
73102
|
+
if (cicd) {
|
|
73103
|
+
if (cicd.secrets && cicd.secrets.length > 0) return true;
|
|
73104
|
+
if (cicd.runner) return true;
|
|
73105
|
+
if (cicd.caches && cicd.caches.length > 0) return true;
|
|
73106
|
+
if (cicd.artifacts && cicd.artifacts.length > 0) return true;
|
|
73107
|
+
if (cicd.environments && cicd.environments.length > 0) return true;
|
|
73108
|
+
if (cicd.matrix) return true;
|
|
73109
|
+
if (cicd.services && cicd.services.length > 0) return true;
|
|
73110
|
+
if (cicd.concurrency) return true;
|
|
73111
|
+
if (cicd.triggers && cicd.triggers.length > 0) return true;
|
|
73112
|
+
if (cicd.jobs && cicd.jobs.length > 0) return true;
|
|
73113
|
+
if (cicd.variables && Object.keys(cicd.variables).length > 0) return true;
|
|
73114
|
+
if (cicd.beforeScript && cicd.beforeScript.length > 0) return true;
|
|
73115
|
+
if (cicd.tags && cicd.tags.length > 0) return true;
|
|
73116
|
+
if (cicd.includes && cicd.includes.length > 0) return true;
|
|
73117
|
+
if (cicd.stages && cicd.stages.length > 0) return true;
|
|
73118
|
+
}
|
|
73119
|
+
if (ast.instances.some((inst) => inst.job)) return true;
|
|
73120
|
+
return false;
|
|
73121
|
+
}
|
|
73122
|
+
function getJobNames(ast) {
|
|
73123
|
+
const jobs = /* @__PURE__ */ new Set();
|
|
73124
|
+
for (const inst of ast.instances) {
|
|
73125
|
+
if (inst.job) jobs.add(inst.job);
|
|
73126
|
+
}
|
|
73127
|
+
return Array.from(jobs);
|
|
73128
|
+
}
|
|
73129
|
+
function getDeclaredSecrets(ast) {
|
|
73130
|
+
return (ast.options?.cicd?.secrets || []).map((s) => s.name);
|
|
73131
|
+
}
|
|
73132
|
+
function getReferencedSecrets(ast) {
|
|
73133
|
+
const secrets = /* @__PURE__ */ new Set();
|
|
73134
|
+
for (const conn of ast.connections) {
|
|
73135
|
+
if (conn.from.node.startsWith("secret:")) {
|
|
73136
|
+
secrets.add(conn.from.node.substring(7));
|
|
73137
|
+
}
|
|
73138
|
+
}
|
|
73139
|
+
return Array.from(secrets);
|
|
73140
|
+
}
|
|
73519
73141
|
|
|
73520
73142
|
// src/extensions/cicd/rules.ts
|
|
73521
|
-
init_detection();
|
|
73522
73143
|
var secretNotDeclaredRule = {
|
|
73523
73144
|
name: "CICD_SECRET_NOT_DECLARED",
|
|
73524
73145
|
validate(ast) {
|
|
@@ -103606,7 +103227,7 @@ function getRegisteredMigrations() {
|
|
|
103606
103227
|
}
|
|
103607
103228
|
|
|
103608
103229
|
// src/mcp/tools-pattern.ts
|
|
103609
|
-
|
|
103230
|
+
init_manipulation();
|
|
103610
103231
|
init_query();
|
|
103611
103232
|
init_parser2();
|
|
103612
103233
|
var modifyParamsSchemas = {
|
|
@@ -109305,7 +108926,7 @@ function displayInstalledPackage(pkg) {
|
|
|
109305
108926
|
|
|
109306
108927
|
// src/cli/index.ts
|
|
109307
108928
|
init_error_utils();
|
|
109308
|
-
var version2 = true ? "0.17.
|
|
108929
|
+
var version2 = true ? "0.17.7" : "0.0.0-dev";
|
|
109309
108930
|
var program2 = new Command();
|
|
109310
108931
|
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", () => {
|
|
109311
108932
|
logger.banner(version2);
|
|
@@ -15,11 +15,7 @@ export { loadConfig, loadConfigSync, getConfigValue } from './config/loader.js';
|
|
|
15
15
|
export { OpenAPIGenerator, generateOpenAPIJson, generateOpenAPIYaml, type OpenAPIDocument, type OpenAPIInfo, type OpenAPIServer, type GeneratorOptions, } from './openapi/generator.js';
|
|
16
16
|
export { SchemaConverter, schemaConverter, type OpenAPISchema, } from './openapi/schema-converter.js';
|
|
17
17
|
export { type ExportTarget, type ExportOptions, type ExportArtifacts, type GeneratedFile, type DeployInstructions, type DeploySchema, type DeploySchemaField, type CompiledWorkflow, type MultiWorkflowArtifacts, type NodeTypeInfo, type NodeTypeExportOptions, type NodeTypeArtifacts, type BundleWorkflow, type BundleNodeType, type BundleArtifacts, BaseExportTarget, ExportTargetRegistry, } from './targets/base.js';
|
|
18
|
-
/** @deprecated Import from '@synergenius/flow-weaver/extensions/cicd' instead */
|
|
19
|
-
export { isCICDWorkflow } from '../extensions/cicd/detection.js';
|
|
20
18
|
export { generateStandaloneRuntimeModule } from '../api/inline-runtime.js';
|
|
21
|
-
/** @deprecated Import from '@synergenius/flow-weaver/extensions/cicd' instead */
|
|
22
|
-
export { BaseCICDTarget, NODE_ACTION_MAP, type CICDStep, type CICDJob, type ActionMapping, } from '../extensions/cicd/base-target.js';
|
|
23
19
|
import { ExportTargetRegistry } from './targets/base.js';
|
|
24
20
|
/**
|
|
25
21
|
* Create an export target registry via marketplace discovery.
|
package/dist/deployment/index.js
CHANGED
|
@@ -18,12 +18,7 @@ export { OpenAPIGenerator, generateOpenAPIJson, generateOpenAPIYaml, } from './o
|
|
|
18
18
|
export { SchemaConverter, schemaConverter, } from './openapi/schema-converter.js';
|
|
19
19
|
// Export Targets
|
|
20
20
|
export { BaseExportTarget, ExportTargetRegistry, } from './targets/base.js';
|
|
21
|
-
// Utilities needed by export target packs
|
|
22
|
-
/** @deprecated Import from '@synergenius/flow-weaver/extensions/cicd' instead */
|
|
23
|
-
export { isCICDWorkflow } from '../extensions/cicd/detection.js';
|
|
24
21
|
export { generateStandaloneRuntimeModule } from '../api/inline-runtime.js';
|
|
25
|
-
/** @deprecated Import from '@synergenius/flow-weaver/extensions/cicd' instead */
|
|
26
|
-
export { BaseCICDTarget, NODE_ACTION_MAP, } from '../extensions/cicd/base-target.js';
|
|
27
22
|
import * as path from 'path';
|
|
28
23
|
import { pathToFileURL } from 'url';
|
|
29
24
|
import { ExportTargetRegistry } from './targets/base.js';
|
|
@@ -331,7 +331,7 @@ export declare class ExportTargetRegistry {
|
|
|
331
331
|
private instances;
|
|
332
332
|
/**
|
|
333
333
|
* Register a target factory. The target is only instantiated on first use.
|
|
334
|
-
* Also accepts a pre-instantiated target
|
|
334
|
+
* Also accepts a pre-instantiated target.
|
|
335
335
|
*/
|
|
336
336
|
register(nameOrTarget: string | ExportTarget, factory?: () => ExportTarget): void;
|
|
337
337
|
get(name: string): ExportTarget | undefined;
|
|
@@ -810,7 +810,7 @@ export class ExportTargetRegistry {
|
|
|
810
810
|
instances = new Map();
|
|
811
811
|
/**
|
|
812
812
|
* Register a target factory. The target is only instantiated on first use.
|
|
813
|
-
* Also accepts a pre-instantiated target
|
|
813
|
+
* Also accepts a pre-instantiated target.
|
|
814
814
|
*/
|
|
815
815
|
register(nameOrTarget, factory) {
|
|
816
816
|
if (typeof nameOrTarget === 'string') {
|
|
@@ -25,7 +25,5 @@ export declare function portBadgeWidth(port: DiagramPort): number;
|
|
|
25
25
|
export declare function computeNodeDimensions(node: DiagramNode): void;
|
|
26
26
|
export declare function computePortPositions(node: DiagramNode): void;
|
|
27
27
|
export declare function computeConnectionPath(sx: number, sy: number, tx: number, ty: number): string;
|
|
28
|
-
/** @deprecated Use computeConnectionPath instead */
|
|
29
|
-
export declare function computeBezierPath(sx: number, sy: number, tx: number, ty: number): string;
|
|
30
28
|
export declare function buildDiagramGraph(ast: TWorkflowAST, options?: DiagramOptions): DiagramGraph;
|
|
31
29
|
//# sourceMappingURL=geometry.d.ts.map
|
package/dist/diagram/geometry.js
CHANGED
|
@@ -137,10 +137,6 @@ export function computeConnectionPath(sx, sy, tx, ty) {
|
|
|
137
137
|
path += ` L ${hx},${hy}`;
|
|
138
138
|
return path;
|
|
139
139
|
}
|
|
140
|
-
/** @deprecated Use computeConnectionPath instead */
|
|
141
|
-
export function computeBezierPath(sx, sy, tx, ty) {
|
|
142
|
-
return computeConnectionPath(sx, sy, tx, ty);
|
|
143
|
-
}
|
|
144
140
|
// ---- Port ordering helpers ----
|
|
145
141
|
/**
|
|
146
142
|
* Get ordered ports from a port definition record using metadata.order.
|
|
@@ -122,7 +122,7 @@ export class BaseCICDTarget extends BaseExportTarget {
|
|
|
122
122
|
gitlabScript: deployConfig.script
|
|
123
123
|
? (Array.isArray(deployConfig.script)
|
|
124
124
|
? deployConfig.script
|
|
125
|
-
:
|
|
125
|
+
: deployConfig.script.split('\n'))
|
|
126
126
|
: undefined,
|
|
127
127
|
gitlabImage: deployConfig.image,
|
|
128
128
|
label: deployConfig.label || step.name,
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Re-exports detection, base target, and validation rule utilities
|
|
5
5
|
* for consumers importing from `@synergenius/flow-weaver/extensions/cicd`.
|
|
6
|
+
*
|
|
7
|
+
* The register import is a side effect that populates the global tag handler
|
|
8
|
+
* registry with CI/CD handlers. Without it, parseWorkflow() silently drops
|
|
9
|
+
* all CI/CD annotations (@runner, @stage, @job, @variables, etc.).
|
|
6
10
|
*/
|
|
11
|
+
import './register.js';
|
|
7
12
|
export { isCICDWorkflow, getJobNames, getDeclaredSecrets, getReferencedSecrets } from './detection.js';
|
|
8
13
|
export { BaseCICDTarget, NODE_ACTION_MAP, type CICDJob, type CICDStep, type ActionMapping } from './base-target.js';
|
|
9
14
|
export { getCICDValidationRules } from './rules.js';
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Re-exports detection, base target, and validation rule utilities
|
|
5
5
|
* for consumers importing from `@synergenius/flow-weaver/extensions/cicd`.
|
|
6
|
+
*
|
|
7
|
+
* The register import is a side effect that populates the global tag handler
|
|
8
|
+
* registry with CI/CD handlers. Without it, parseWorkflow() silently drops
|
|
9
|
+
* all CI/CD annotations (@runner, @stage, @job, @variables, etc.).
|
|
6
10
|
*/
|
|
11
|
+
import './register.js';
|
|
7
12
|
export { isCICDWorkflow, getJobNames, getDeclaredSecrets, getReferencedSecrets } from './detection.js';
|
|
8
13
|
export { BaseCICDTarget, NODE_ACTION_MAP } from './base-target.js';
|
|
9
14
|
export { getCICDValidationRules } from './rules.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.17.
|
|
1
|
+
export declare const VERSION = "0.17.7";
|
|
2
2
|
//# sourceMappingURL=generated-version.d.ts.map
|
|
@@ -39,7 +39,7 @@ export function shouldWorkflowBeAsync(workflow, nodeTypes) {
|
|
|
39
39
|
*/
|
|
40
40
|
export function validateWorkflowAsync(workflow, nodeTypes) {
|
|
41
41
|
const computedAsync = shouldWorkflowBeAsync(workflow, nodeTypes);
|
|
42
|
-
const userAsync = workflow.userSpecifiedAsync ?? true;
|
|
42
|
+
const userAsync = workflow.userSpecifiedAsync ?? true;
|
|
43
43
|
if (!userAsync && computedAsync) {
|
|
44
44
|
// User wrote sync function, but workflow contains async nodes
|
|
45
45
|
return {
|
|
@@ -49,7 +49,7 @@ export type TBuildNodeArgsOptions = {
|
|
|
49
49
|
*
|
|
50
50
|
* ## Resolution Priority (per port):
|
|
51
51
|
* 1. **Skip Ports**: If port is in skipPorts set, use pre-declared variable
|
|
52
|
-
* 2. **Instance Expression**: Check instance.config.portConfigs for
|
|
52
|
+
* 2. **Instance Expression**: Check instance.config.portConfigs for constant expressions
|
|
53
53
|
* 3. **Connection**: Get value from connected output port via ctx.getVariable()
|
|
54
54
|
* 4. **Node Type Expression**: Check nodeType.inputs[port].expression
|
|
55
55
|
* 5. **Default Value**: Use nodeType.inputs[port].default if available
|
|
@@ -64,7 +64,7 @@ export type TBuildNodeArgsOptions = {
|
|
|
64
64
|
* ## STEP Port Execution Strategies:
|
|
65
65
|
* - **CONJUNCTION (AND)**: `execute = stepA && stepB && stepC`
|
|
66
66
|
* - **DISJUNCTION (OR)**: `execute = stepA || stepB || stepC`
|
|
67
|
-
* - **CUSTOM**: Uses
|
|
67
|
+
* - **CUSTOM**: Uses executionSignal expression
|
|
68
68
|
*
|
|
69
69
|
* @param opts - Configuration object with node, workflow, and generation settings
|
|
70
70
|
* @param opts.node - The node type definition with input/output port specs
|
|
@@ -114,7 +114,7 @@ export function buildMergeExpression(sources, strategy) {
|
|
|
114
114
|
*
|
|
115
115
|
* ## Resolution Priority (per port):
|
|
116
116
|
* 1. **Skip Ports**: If port is in skipPorts set, use pre-declared variable
|
|
117
|
-
* 2. **Instance Expression**: Check instance.config.portConfigs for
|
|
117
|
+
* 2. **Instance Expression**: Check instance.config.portConfigs for constant expressions
|
|
118
118
|
* 3. **Connection**: Get value from connected output port via ctx.getVariable()
|
|
119
119
|
* 4. **Node Type Expression**: Check nodeType.inputs[port].expression
|
|
120
120
|
* 5. **Default Value**: Use nodeType.inputs[port].default if available
|
|
@@ -129,7 +129,7 @@ export function buildMergeExpression(sources, strategy) {
|
|
|
129
129
|
* ## STEP Port Execution Strategies:
|
|
130
130
|
* - **CONJUNCTION (AND)**: `execute = stepA && stepB && stepC`
|
|
131
131
|
* - **DISJUNCTION (OR)**: `execute = stepA || stepB || stepC`
|
|
132
|
-
* - **CUSTOM**: Uses
|
|
132
|
+
* - **CUSTOM**: Uses executionSignal expression
|
|
133
133
|
*
|
|
134
134
|
* @param opts - Configuration object with node, workflow, and generation settings
|
|
135
135
|
* @param opts.node - The node type definition with input/output port specs
|
package/dist/index.d.ts
CHANGED
|
@@ -79,7 +79,7 @@ export { generator, WorkflowGenerator } from './generator.js';
|
|
|
79
79
|
export { AnnotationGenerator } from './annotation-generator.js';
|
|
80
80
|
export type { GenerateAnnotationsOptions } from './annotation-generator.js';
|
|
81
81
|
export * as GeneratorUtils from './generator.js';
|
|
82
|
-
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync.js';
|
|
82
|
+
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync/index.js';
|
|
83
83
|
export { workflowTemplates, nodeTemplates, getWorkflowTemplate, getNodeTemplate, toCamelCase, toPascalCase, } from './cli/templates/index.js';
|
|
84
84
|
export type { WorkflowTemplate, NodeTemplate, WorkflowTemplateOptions } from './cli/templates/index.js';
|
|
85
85
|
export { WorkflowDiffer } from './diff/WorkflowDiffer.js';
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ export { AnnotationGenerator } from './annotation-generator.js';
|
|
|
82
82
|
// Generator Utilities (for advanced use)
|
|
83
83
|
export * as GeneratorUtils from './generator.js';
|
|
84
84
|
// JSDoc Port Sync (browser-compatible parsing/updating)
|
|
85
|
-
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync.js';
|
|
85
|
+
export { parsePortsFromFunctionText, updatePortsInFunctionText, formatPortsInFunctionText, syncCodeRenames, renamePortInCode, parseReturnTypeFields, parseFunctionSignature, parseReturnFields, } from './jsdoc-port-sync/index.js';
|
|
86
86
|
// Templates (for workflow/node creation)
|
|
87
87
|
export { workflowTemplates, nodeTemplates, getWorkflowTemplate, getNodeTemplate, toCamelCase, toPascalCase, } from './cli/templates/index.js';
|
|
88
88
|
// Diff (semantic comparison)
|
package/dist/mcp/tools-editor.js
CHANGED
|
@@ -187,7 +187,7 @@ export function registerEditorTools(mcp, connection, buffer) {
|
|
|
187
187
|
message: 'Workflow paused at waitForAgent node. Use fw_resume_workflow to continue.',
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
// Completed without pausing
|
|
190
|
+
// Completed without pausing, return flat result
|
|
191
191
|
return makeToolResult(raceResult.result);
|
|
192
192
|
}
|
|
193
193
|
catch (err) {
|
|
@@ -7,7 +7,7 @@ import { listPatterns, applyPattern, findWorkflows, extractPattern } from '../ap
|
|
|
7
7
|
import { generateInPlace } from '../api/generate-in-place.js';
|
|
8
8
|
import { applyMigrations, getRegisteredMigrations } from '../migration/registry.js';
|
|
9
9
|
import { describeWorkflow, formatDescribeOutput } from '../cli/commands/describe.js';
|
|
10
|
-
import { addNode as manipAddNode, removeNode as manipRemoveNode, renameNode as manipRenameNode, addConnection as manipAddConnection, removeConnection as manipRemoveConnection, setNodePosition as manipSetNodePosition, setNodeLabel as manipSetNodeLabel, } from '../api/manipulation.js';
|
|
10
|
+
import { addNode as manipAddNode, removeNode as manipRemoveNode, renameNode as manipRenameNode, addConnection as manipAddConnection, removeConnection as manipRemoveConnection, setNodePosition as manipSetNodePosition, setNodeLabel as manipSetNodeLabel, } from '../api/manipulation/index.js';
|
|
11
11
|
import { findIsolatedNodes } from '../api/query.js';
|
|
12
12
|
import { AnnotationParser } from '../parser.js';
|
|
13
13
|
import { makeToolResult, makeErrorResult, addHintsToItems } from './response-utils.js';
|
package/package.json
CHANGED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation wrappers for workflow manipulation operations
|
|
3
|
-
* Re-exports from helpers.ts for backward compatibility
|
|
4
|
-
*/
|
|
5
|
-
export { withoutValidation, type RemoveOptions, type NodeFilter, type OperationResult, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "../helpers.js";
|
|
6
|
-
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validation wrappers for workflow manipulation operations
|
|
3
|
-
* Re-exports from helpers.ts for backward compatibility
|
|
4
|
-
*/
|
|
5
|
-
export { withoutValidation, validatePortReference, portReferencesEqual, formatPortReference, generateUniqueNodeId, assertNodeExists, assertNodeNotExists, } from "../helpers.js";
|
|
6
|
-
//# sourceMappingURL=validation.js.map
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manipulation API for programmatic workflow creation and modification
|
|
3
|
-
* All operations are immutable (return new AST) and validated
|
|
4
|
-
*
|
|
5
|
-
* This file re-exports all functions from the manipulation module for backward compatibility.
|
|
6
|
-
*/
|
|
7
|
-
export * from "./manipulation/index.js";
|
|
8
|
-
//# sourceMappingURL=manipulation.d.ts.map
|
package/dist/api/manipulation.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Manipulation API for programmatic workflow creation and modification
|
|
3
|
-
* All operations are immutable (return new AST) and validated
|
|
4
|
-
*
|
|
5
|
-
* This file re-exports all functions from the manipulation module for backward compatibility.
|
|
6
|
-
*/
|
|
7
|
-
export * from "./manipulation/index.js";
|
|
8
|
-
//# sourceMappingURL=manipulation.js.map
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module jsdoc-port-sync
|
|
3
|
-
*
|
|
4
|
-
* Re-exports from modular jsdoc-port-sync/ directory.
|
|
5
|
-
* This file maintains backwards compatibility for existing imports.
|
|
6
|
-
*
|
|
7
|
-
* @see ./jsdoc-port-sync/index.ts for the modular implementation
|
|
8
|
-
*/
|
|
9
|
-
export * from "./jsdoc-port-sync/index.js";
|
|
10
|
-
//# sourceMappingURL=jsdoc-port-sync.d.ts.map
|
package/dist/jsdoc-port-sync.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module jsdoc-port-sync
|
|
3
|
-
*
|
|
4
|
-
* Re-exports from modular jsdoc-port-sync/ directory.
|
|
5
|
-
* This file maintains backwards compatibility for existing imports.
|
|
6
|
-
*
|
|
7
|
-
* @see ./jsdoc-port-sync/index.ts for the modular implementation
|
|
8
|
-
*/
|
|
9
|
-
export * from "./jsdoc-port-sync/index.js";
|
|
10
|
-
//# sourceMappingURL=jsdoc-port-sync.js.map
|