@synergenius/flow-weaver 0.22.0 → 0.22.3

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.
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Core metadata extractor.
3
+ *
4
+ * Provides runtime-accessible arrays and objects for data types, strategies,
5
+ * reserved names, templates, and package exports — derived from the actual
6
+ * source constants so documentation stays in sync automatically.
7
+ */
8
+ import { RESERVED_NODE_NAMES, RESERVED_PORT_NAMES, SCOPED_PORT_NAMES, EXECUTION_STRATEGIES, BRANCHING_STRATEGIES, VALID_NODE_COLORS, } from '../../constants.js';
9
+ import { workflowTemplates, nodeTemplates, } from '../../cli/templates/index.js';
10
+ // ── Data Types ──────────────────────────────────────────────────────────
11
+ /** All supported port data types (runtime array, mirrors TDataType union). */
12
+ export const DATA_TYPES = [
13
+ 'STRING',
14
+ 'NUMBER',
15
+ 'BOOLEAN',
16
+ 'OBJECT',
17
+ 'ARRAY',
18
+ 'FUNCTION',
19
+ 'STEP',
20
+ 'ANY',
21
+ ];
22
+ /** All supported merge strategies (runtime array, mirrors TMergeStrategy union). */
23
+ export const MERGE_STRATEGIES = ['FIRST', 'LAST', 'COLLECT', 'MERGE', 'CONCAT'];
24
+ /** All supported branching strategies (runtime array, mirrors TBranchingStrategy union). */
25
+ export const BRANCHING_STRATEGY_VALUES = ['value-based', 'exception-based', 'none'];
26
+ /** All supported execution strategies (runtime array, mirrors TExecuteWhen union). */
27
+ export const EXECUTION_STRATEGY_VALUES = ['CONJUNCTION', 'DISJUNCTION', 'CUSTOM'];
28
+ // ── Reserved Names ──────────────────────────────────────────────────────
29
+ export { RESERVED_NODE_NAMES, RESERVED_PORT_NAMES, SCOPED_PORT_NAMES };
30
+ export { EXECUTION_STRATEGIES, BRANCHING_STRATEGIES, VALID_NODE_COLORS };
31
+ /** All registered workflow templates (id, name, description, category). */
32
+ export const WORKFLOW_TEMPLATES = workflowTemplates.map(({ id, name, description, category }) => ({ id, name, description, category }));
33
+ /** All registered node templates (id, name, description, category). */
34
+ export const NODE_TEMPLATES = nodeTemplates.map(({ id, name, description, category }) => ({ id, name, description, category }));
35
+ // ── Package Exports ─────────────────────────────────────────────────────
36
+ /** All named export subpaths from @synergenius/flow-weaver/package.json. */
37
+ export const PACKAGE_EXPORTS = [
38
+ { subpath: '.', description: 'Core library (parser, validator, compiler)' },
39
+ { subpath: './runtime', description: 'Workflow runtime executor' },
40
+ { subpath: './built-in-nodes', description: 'Standard node type library' },
41
+ { subpath: './diagram', description: 'Diagram rendering (SVG/Mermaid)' },
42
+ { subpath: './describe', description: 'Workflow description formatter' },
43
+ { subpath: './doc-metadata', description: 'Documentation metadata extractors' },
44
+ { subpath: './docs', description: 'Documentation generation utilities' },
45
+ { subpath: './ast', description: 'AST type definitions and builders' },
46
+ { subpath: './api', description: 'Public API (parseWorkflow, validateWorkflow, etc.)' },
47
+ { subpath: './diff', description: 'Workflow semantic diff engine' },
48
+ { subpath: './editor', description: 'Editor completions and diagnostics' },
49
+ { subpath: './browser', description: 'Browser-compatible JSDoc port sync' },
50
+ { subpath: './generated-branding', description: 'Generated branding configuration' },
51
+ { subpath: './npm-packages', description: 'NPM package metadata' },
52
+ { subpath: './deployment', description: 'Deployment target configurations' },
53
+ { subpath: './marketplace', description: 'Extension/pack marketplace APIs' },
54
+ { subpath: './testing', description: 'Testing utilities' },
55
+ { subpath: './generator', description: 'Code generation' },
56
+ { subpath: './constants', description: 'Constants and reserved names' },
57
+ { subpath: './cli', description: 'CLI command definitions' },
58
+ { subpath: './executor', description: 'MCP workflow executor' },
59
+ { subpath: './context', description: 'LLM context generation' },
60
+ ];
61
+ //# sourceMappingURL=core-metadata.js.map
@@ -7,4 +7,6 @@ export type { TValidationCodeDoc } from './extractors/error-codes.js';
7
7
  export { extractGrammarEBNF, extractTerminals } from './extractors/grammar-rules.js';
8
8
  export type { TGrammarGroupDoc, TTerminalDoc } from './extractors/grammar-rules.js';
9
9
  export type { TMcpToolDoc, TMcpToolParam, TPluginApiFieldDoc, TCliCommandDoc, TCliOptionDoc } from './types.js';
10
+ export { DATA_TYPES, MERGE_STRATEGIES, BRANCHING_STRATEGY_VALUES, EXECUTION_STRATEGY_VALUES, RESERVED_NODE_NAMES, RESERVED_PORT_NAMES, SCOPED_PORT_NAMES, EXECUTION_STRATEGIES, BRANCHING_STRATEGIES, VALID_NODE_COLORS, WORKFLOW_TEMPLATES, NODE_TEMPLATES, PACKAGE_EXPORTS, } from './extractors/core-metadata.js';
11
+ export type { TemplateSummary } from './extractors/core-metadata.js';
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -4,4 +4,6 @@ export { PLUGIN_DEFINITION_FIELDS, PLUGIN_CAPABILITIES, PLUGIN_COMPONENT_CONFIG_
4
4
  export { ALL_ANNOTATIONS, PORT_MODIFIERS, NODE_MODIFIERS, } from './extractors/annotations.js';
5
5
  export { VALIDATION_CODES } from './extractors/error-codes.js';
6
6
  export { extractGrammarEBNF, extractTerminals } from './extractors/grammar-rules.js';
7
+ // Core metadata — data types, strategies, reserved names, templates, package exports
8
+ export { DATA_TYPES, MERGE_STRATEGIES, BRANCHING_STRATEGY_VALUES, EXECUTION_STRATEGY_VALUES, RESERVED_NODE_NAMES, RESERVED_PORT_NAMES, SCOPED_PORT_NAMES, EXECUTION_STRATEGIES, BRANCHING_STRATEGIES, VALID_NODE_COLORS, WORKFLOW_TEMPLATES, NODE_TEMPLATES, PACKAGE_EXPORTS, } from './extractors/core-metadata.js';
7
9
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.22.0";
1
+ export declare const VERSION = "0.22.3";
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.22.0';
2
+ export const VERSION = '0.22.3';
3
3
  //# sourceMappingURL=generated-version.js.map
@@ -816,6 +816,10 @@ isAsync = false) {
816
816
  const safeId = toValidIdentifier(instanceId);
817
817
  // Add execution index for this skipped node so the event has a valid reference
818
818
  lines.push(`${indent}const ${safeId}Idx = ${ctxVar}.addExecution('${instanceId}');`);
819
+ // Set STEP port variables so downstream nodes reading onSuccess/onFailure
820
+ // from this cancelled node don't crash with "Variable not found".
821
+ lines.push(`${indent}${awaitPrefix}${ctxVar}.setVariable({ id: '${instanceId}', portName: 'onSuccess', executionIndex: ${safeId}Idx, nodeTypeName: '${instance.nodeType}' }, false);`);
822
+ lines.push(`${indent}${awaitPrefix}${ctxVar}.setVariable({ id: '${instanceId}', portName: 'onFailure', executionIndex: ${safeId}Idx, nodeTypeName: '${instance.nodeType}' }, false);`);
819
823
  lines.push(`${indent}${awaitPrefix}${ctxVar}.sendStatusChangedEvent({`);
820
824
  lines.push(`${indent} nodeTypeName: '${instance.nodeType}',`);
821
825
  lines.push(`${indent} id: '${instanceId}',`);
@@ -37,6 +37,15 @@ export type DebugResumeAction = {
37
37
  } | {
38
38
  type: 'abort';
39
39
  };
40
+ /**
41
+ * Minimal interface for the debug controller as referenced by generated code.
42
+ * The full DebugController class implements this, but generated code only
43
+ * needs beforeNode/afterNode — so this type is what gets imported.
44
+ */
45
+ export type TDebugController = {
46
+ beforeNode(nodeId: string, ctx: GeneratedExecutionContext): Promise<boolean> | boolean;
47
+ afterNode(nodeId: string, ctx: GeneratedExecutionContext): Promise<void> | void;
48
+ };
40
49
  export interface DebugControllerConfig {
41
50
  /** Enable step-through debugging (pauses before first node) */
42
51
  debug?: boolean;
@@ -1,7 +1,7 @@
1
1
  export { GeneratedExecutionContext } from "./ExecutionContext.js";
2
2
  export { CancellationError } from "./CancellationError.js";
3
3
  export { DebugController } from "./debug-controller.js";
4
- export type { DebugMode, DebugPauseState, DebugResumeAction, DebugControllerConfig } from "./debug-controller.js";
4
+ export type { TDebugController, DebugMode, DebugPauseState, DebugResumeAction, DebugControllerConfig } from "./debug-controller.js";
5
5
  export { CheckpointWriter, loadCheckpoint, findLatestCheckpoint } from "./checkpoint.js";
6
6
  export type { CheckpointData } from "./checkpoint.js";
7
7
  export * from "./events.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.22.0",
3
+ "version": "0.22.3",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",