flowcraft 1.0.0 → 2.0.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.
Files changed (201) hide show
  1. package/README.md +37 -134
  2. package/dist/analysis.d.ts +43 -0
  3. package/dist/analysis.js +3 -0
  4. package/dist/chunk-55J6XMHW.js +3 -0
  5. package/dist/{chunk-7XUN3OQT.js.map → chunk-55J6XMHW.js.map} +1 -1
  6. package/dist/chunk-6DNEDIIT.js +123 -0
  7. package/dist/chunk-6DNEDIIT.js.map +1 -0
  8. package/dist/chunk-734J4PTM.js +100 -0
  9. package/dist/chunk-734J4PTM.js.map +1 -0
  10. package/dist/chunk-DSZSR7UE.js +40 -0
  11. package/dist/chunk-DSZSR7UE.js.map +1 -0
  12. package/dist/chunk-GTZC6PQI.js +22 -0
  13. package/dist/chunk-GTZC6PQI.js.map +1 -0
  14. package/dist/chunk-HMR2GEGE.js +3 -0
  15. package/dist/{chunk-F2RSES6P.js.map → chunk-HMR2GEGE.js.map} +1 -1
  16. package/dist/chunk-J3RNCPED.js +27 -0
  17. package/dist/chunk-J3RNCPED.js.map +1 -0
  18. package/dist/chunk-M23P46ZL.js +105 -0
  19. package/dist/chunk-M23P46ZL.js.map +1 -0
  20. package/dist/chunk-MICPMOTW.js +49 -0
  21. package/dist/chunk-MICPMOTW.js.map +1 -0
  22. package/dist/chunk-NPAJNLXQ.js +106 -0
  23. package/dist/chunk-NPAJNLXQ.js.map +1 -0
  24. package/dist/chunk-RAZXOMZC.js +64 -0
  25. package/dist/chunk-RAZXOMZC.js.map +1 -0
  26. package/dist/chunk-REH55ZXV.js +13 -0
  27. package/dist/chunk-REH55ZXV.js.map +1 -0
  28. package/dist/chunk-RW4FH7IL.js +135 -0
  29. package/dist/chunk-RW4FH7IL.js.map +1 -0
  30. package/dist/chunk-RYTIQZIB.js +303 -0
  31. package/dist/chunk-RYTIQZIB.js.map +1 -0
  32. package/dist/chunk-UYPIWXZG.js +62 -0
  33. package/dist/chunk-UYPIWXZG.js.map +1 -0
  34. package/dist/chunk-VFC342WL.js +29 -0
  35. package/dist/chunk-VFC342WL.js.map +1 -0
  36. package/dist/chunk-WXT3YEWU.js +28 -0
  37. package/dist/chunk-WXT3YEWU.js.map +1 -0
  38. package/dist/context.d.ts +23 -105
  39. package/dist/context.js +1 -1
  40. package/dist/errors.d.ts +15 -31
  41. package/dist/errors.js +1 -1
  42. package/dist/evaluator.d.ts +22 -0
  43. package/dist/evaluator.js +3 -0
  44. package/dist/evaluator.js.map +1 -0
  45. package/dist/flow.d.ts +54 -0
  46. package/dist/flow.js +4 -0
  47. package/dist/flow.js.map +1 -0
  48. package/dist/index.d.ts +14 -16
  49. package/dist/index.js +17 -25
  50. package/dist/linter.d.ts +24 -0
  51. package/dist/linter.js +4 -0
  52. package/dist/linter.js.map +1 -0
  53. package/dist/logger.d.ts +11 -36
  54. package/dist/logger.js +1 -1
  55. package/dist/node.d.ts +1 -0
  56. package/dist/node.js +3 -0
  57. package/dist/node.js.map +1 -0
  58. package/dist/runtime/adapter.d.ts +78 -0
  59. package/dist/runtime/adapter.js +15 -0
  60. package/dist/runtime/adapter.js.map +1 -0
  61. package/dist/runtime/executors.d.ts +26 -0
  62. package/dist/runtime/executors.js +4 -0
  63. package/dist/runtime/executors.js.map +1 -0
  64. package/dist/runtime/index.d.ts +7 -0
  65. package/dist/runtime/index.js +16 -0
  66. package/dist/runtime/runtime.d.ts +33 -0
  67. package/dist/runtime/runtime.js +14 -0
  68. package/dist/runtime/runtime.js.map +1 -0
  69. package/dist/runtime/state.d.ts +21 -0
  70. package/dist/runtime/state.js +4 -0
  71. package/dist/runtime/state.js.map +1 -0
  72. package/dist/runtime/traverser.d.ts +24 -0
  73. package/dist/runtime/traverser.js +5 -0
  74. package/dist/runtime/traverser.js.map +1 -0
  75. package/dist/runtime/types.d.ts +15 -0
  76. package/dist/runtime/types.js +3 -0
  77. package/dist/sanitizer.d.ts +10 -0
  78. package/dist/sanitizer.js +3 -0
  79. package/dist/{utils/sanitize.js.map → sanitizer.js.map} +1 -1
  80. package/dist/serializer.d.ts +15 -0
  81. package/dist/serializer.js +3 -0
  82. package/dist/serializer.js.map +1 -0
  83. package/dist/types-CZN_FcB6.d.ts +201 -0
  84. package/dist/types.d.ts +1 -3
  85. package/dist/types.js +1 -1
  86. package/package.json +9 -20
  87. package/LICENSE +0 -21
  88. package/dist/builder/graph/graph.d.ts +0 -57
  89. package/dist/builder/graph/graph.js +0 -21
  90. package/dist/builder/graph/graph.js.map +0 -1
  91. package/dist/builder/graph/index.d.ts +0 -8
  92. package/dist/builder/graph/index.js +0 -23
  93. package/dist/builder/graph/internal-nodes.d.ts +0 -59
  94. package/dist/builder/graph/internal-nodes.js +0 -20
  95. package/dist/builder/graph/internal-nodes.js.map +0 -1
  96. package/dist/builder/graph/runner.d.ts +0 -51
  97. package/dist/builder/graph/runner.js +0 -21
  98. package/dist/builder/graph/runner.js.map +0 -1
  99. package/dist/builder/graph/types.d.ts +0 -3
  100. package/dist/builder/graph/types.js +0 -3
  101. package/dist/builder/index.d.ts +0 -8
  102. package/dist/builder/index.js +0 -24
  103. package/dist/builder/index.js.map +0 -1
  104. package/dist/builder/patterns.d.ts +0 -136
  105. package/dist/builder/patterns.js +0 -19
  106. package/dist/builder/patterns.js.map +0 -1
  107. package/dist/chunk-3YMBNZ77.js +0 -441
  108. package/dist/chunk-3YMBNZ77.js.map +0 -1
  109. package/dist/chunk-64DNBF5W.js +0 -36
  110. package/dist/chunk-64DNBF5W.js.map +0 -1
  111. package/dist/chunk-6QCXIRLA.js +0 -18
  112. package/dist/chunk-6QCXIRLA.js.map +0 -1
  113. package/dist/chunk-7XUN3OQT.js +0 -3
  114. package/dist/chunk-AOHBHYF6.js +0 -7
  115. package/dist/chunk-AOHBHYF6.js.map +0 -1
  116. package/dist/chunk-BRFMFLR6.js +0 -85
  117. package/dist/chunk-BRFMFLR6.js.map +0 -1
  118. package/dist/chunk-ELEHMJPM.js +0 -13
  119. package/dist/chunk-ELEHMJPM.js.map +0 -1
  120. package/dist/chunk-F2RSES6P.js +0 -3
  121. package/dist/chunk-F6C6J7HK.js +0 -3
  122. package/dist/chunk-F6C6J7HK.js.map +0 -1
  123. package/dist/chunk-GMKJ34T2.js +0 -3
  124. package/dist/chunk-GMKJ34T2.js.map +0 -1
  125. package/dist/chunk-HEO3XL4Z.js +0 -328
  126. package/dist/chunk-HEO3XL4Z.js.map +0 -1
  127. package/dist/chunk-IIKTTIW5.js +0 -56
  128. package/dist/chunk-IIKTTIW5.js.map +0 -1
  129. package/dist/chunk-KOBEU2EM.js +0 -3
  130. package/dist/chunk-KOBEU2EM.js.map +0 -1
  131. package/dist/chunk-L5PK5VL2.js +0 -178
  132. package/dist/chunk-L5PK5VL2.js.map +0 -1
  133. package/dist/chunk-P3RPDZHO.js +0 -36
  134. package/dist/chunk-P3RPDZHO.js.map +0 -1
  135. package/dist/chunk-PNWOW52F.js +0 -19
  136. package/dist/chunk-PNWOW52F.js.map +0 -1
  137. package/dist/chunk-R27FIYR5.js +0 -62
  138. package/dist/chunk-R27FIYR5.js.map +0 -1
  139. package/dist/chunk-S4WFNGQG.js +0 -17
  140. package/dist/chunk-S4WFNGQG.js.map +0 -1
  141. package/dist/chunk-TS3M7MWA.js +0 -3
  142. package/dist/chunk-TS3M7MWA.js.map +0 -1
  143. package/dist/chunk-UY4PNPBX.js +0 -156
  144. package/dist/chunk-UY4PNPBX.js.map +0 -1
  145. package/dist/chunk-VMH2LRM6.js +0 -114
  146. package/dist/chunk-VMH2LRM6.js.map +0 -1
  147. package/dist/chunk-VZDHIOCH.js +0 -76
  148. package/dist/chunk-VZDHIOCH.js.map +0 -1
  149. package/dist/chunk-WGVHM7DU.js +0 -66
  150. package/dist/chunk-WGVHM7DU.js.map +0 -1
  151. package/dist/chunk-WR5PDOPP.js +0 -91
  152. package/dist/chunk-WR5PDOPP.js.map +0 -1
  153. package/dist/chunk-YR433ZDA.js +0 -20
  154. package/dist/chunk-YR433ZDA.js.map +0 -1
  155. package/dist/executors/in-memory.d.ts +0 -39
  156. package/dist/executors/in-memory.js +0 -6
  157. package/dist/executors/in-memory.js.map +0 -1
  158. package/dist/executors/types.d.ts +0 -3
  159. package/dist/executors/types.js +0 -3
  160. package/dist/executors/types.js.map +0 -1
  161. package/dist/functions.d.ts +0 -88
  162. package/dist/functions.js +0 -21
  163. package/dist/functions.js.map +0 -1
  164. package/dist/types-U76Ukj96.d.ts +0 -609
  165. package/dist/utils/analysis.d.ts +0 -75
  166. package/dist/utils/analysis.js +0 -3
  167. package/dist/utils/index.d.ts +0 -8
  168. package/dist/utils/index.js +0 -10
  169. package/dist/utils/index.js.map +0 -1
  170. package/dist/utils/mermaid.d.ts +0 -46
  171. package/dist/utils/mermaid.js +0 -4
  172. package/dist/utils/mermaid.js.map +0 -1
  173. package/dist/utils/middleware.d.ts +0 -11
  174. package/dist/utils/middleware.js +0 -3
  175. package/dist/utils/middleware.js.map +0 -1
  176. package/dist/utils/sanitize.d.ts +0 -19
  177. package/dist/utils/sanitize.js +0 -3
  178. package/dist/utils/sleep.d.ts +0 -9
  179. package/dist/utils/sleep.js +0 -4
  180. package/dist/utils/sleep.js.map +0 -1
  181. package/dist/workflow/AbstractNode.d.ts +0 -3
  182. package/dist/workflow/AbstractNode.js +0 -4
  183. package/dist/workflow/AbstractNode.js.map +0 -1
  184. package/dist/workflow/Flow.d.ts +0 -3
  185. package/dist/workflow/Flow.js +0 -16
  186. package/dist/workflow/Flow.js.map +0 -1
  187. package/dist/workflow/Node.d.ts +0 -3
  188. package/dist/workflow/Node.js +0 -15
  189. package/dist/workflow/Node.js.map +0 -1
  190. package/dist/workflow/index.d.ts +0 -4
  191. package/dist/workflow/index.js +0 -18
  192. package/dist/workflow/index.js.map +0 -1
  193. package/dist/workflow/node-patterns.d.ts +0 -55
  194. package/dist/workflow/node-patterns.js +0 -16
  195. package/dist/workflow/node-patterns.js.map +0 -1
  196. package/dist/workflow/registry.d.ts +0 -17
  197. package/dist/workflow/registry.js +0 -3
  198. package/dist/workflow/registry.js.map +0 -1
  199. /package/dist/{utils/analysis.js.map → analysis.js.map} +0 -0
  200. /package/dist/{builder/graph → runtime}/index.js.map +0 -0
  201. /package/dist/{builder/graph → runtime}/types.js.map +0 -0
@@ -1,3 +0,0 @@
1
- export { analyzeGraph, checkForCycles, createNodeRule, isNodeType } from '../chunk-WR5PDOPP.js';
2
- //# sourceMappingURL=analysis.js.map
3
- //# sourceMappingURL=analysis.js.map
@@ -1,8 +0,0 @@
1
- export { GraphAnalysis, ValidationError, Validator, analyzeGraph, checkForCycles, createNodeRule, isNodeType } from './analysis.js';
2
- export { generateMermaidFromBlueprint, generateMermaidGraph } from './mermaid.js';
3
- export { applyMiddleware } from './middleware.js';
4
- export { sanitizeGraph } from './sanitize.js';
5
- export { sleep } from './sleep.js';
6
- import '../types-U76Ukj96.js';
7
- import '../context.js';
8
- import '../logger.js';
@@ -1,10 +0,0 @@
1
- import '../chunk-7XUN3OQT.js';
2
- export { analyzeGraph, checkForCycles, createNodeRule, isNodeType } from '../chunk-WR5PDOPP.js';
3
- export { generateMermaidFromBlueprint, generateMermaidGraph } from '../chunk-VMH2LRM6.js';
4
- export { sanitizeGraph } from '../chunk-YR433ZDA.js';
5
- export { sleep } from '../chunk-6QCXIRLA.js';
6
- export { applyMiddleware } from '../chunk-PNWOW52F.js';
7
- import '../chunk-64DNBF5W.js';
8
- import '../chunk-AOHBHYF6.js';
9
- //# sourceMappingURL=index.js.map
10
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,46 +0,0 @@
1
- import { F as Flow, W as WorkflowBlueprint } from '../types-U76Ukj96.js';
2
- import '../context.js';
3
- import '../logger.js';
4
-
5
- /**
6
- * Generates a Mermaid graph definition from a `Flow` instance.
7
- *
8
- * This utility traverses the workflow's node structure and outputs a string
9
- * that can be rendered by Mermaid.js to visualize the flow's logic,
10
- * including branching and cycles.
11
- *
12
- * @param flow The `Flow` instance to visualize.
13
- * @returns A string containing the Mermaid `graph TD` definition.
14
- *
15
- * @example
16
- * const startNode = new Node('start')
17
- * const processNode = new Node('process')
18
- * const endNode = new Node('end')
19
- *
20
- * startNode.next(processNode)
21
- * processNode.next(endNode)
22
- *
23
- * const myFlow = new Flow(startNode)
24
- * const mermaidSyntax = generateMermaidGraph(myFlow)
25
- * console.log(mermaidSyntax)
26
- * // Outputs:
27
- * // graph TD
28
- * // Node_0[Node]
29
- * // Node_1[Node]
30
- * // Node_2[Node]
31
- * // Node_0 --> Node_1
32
- * // Node_1 --> Node_2
33
- */
34
- declare function generateMermaidGraph(flow: Flow): string;
35
- /**
36
- * Generates a Mermaid graph definition from a static `WorkflowBlueprint`.
37
- *
38
- * This utility iterates over the blueprint's nodes and edges to output a string
39
- * that can be rendered by Mermaid.js to visualize the entire workflow structure.
40
- *
41
- * @param blueprint The `WorkflowBlueprint` instance to visualize.
42
- * @returns A string containing the Mermaid `graph TD` definition.
43
- */
44
- declare function generateMermaidFromBlueprint(blueprint: WorkflowBlueprint): string;
45
-
46
- export { generateMermaidFromBlueprint, generateMermaidGraph };
@@ -1,4 +0,0 @@
1
- export { generateMermaidFromBlueprint, generateMermaidGraph } from '../chunk-VMH2LRM6.js';
2
- import '../chunk-AOHBHYF6.js';
3
- //# sourceMappingURL=mermaid.js.map
4
- //# sourceMappingURL=mermaid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"mermaid.js"}
@@ -1,11 +0,0 @@
1
- import { e as Middleware, A as AbstractNode, M as MiddlewareNext } from '../types-U76Ukj96.js';
2
- import '../context.js';
3
- import '../logger.js';
4
-
5
- /**
6
- * Composes a chain of middleware functions around a node's execution.
7
- * @internal
8
- */
9
- declare function applyMiddleware<T = any>(middleware: Middleware<T>[], nodeToRun: AbstractNode): MiddlewareNext<T>;
10
-
11
- export { applyMiddleware };
@@ -1,3 +0,0 @@
1
- export { applyMiddleware } from '../chunk-PNWOW52F.js';
2
- //# sourceMappingURL=middleware.js.map
3
- //# sourceMappingURL=middleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"middleware.js"}
@@ -1,19 +0,0 @@
1
- import { m as WorkflowGraph } from '../types-U76Ukj96.js';
2
- import '../context.js';
3
- import '../logger.js';
4
-
5
- /**
6
- * Sanitizes a raw workflow graph object by removing properties that are not
7
- * relevant to the execution engine, such as UI-specific data.
8
- *
9
- * @param rawGraph - The raw graph object, potentially containing extraneous properties.
10
- * @param rawGraph.nodes - An array of node objects.
11
- * @param rawGraph.edges - An array of edge objects.
12
- * @returns A clean, execution-focused `WorkflowGraph` object.
13
- */
14
- declare function sanitizeGraph(rawGraph: {
15
- nodes: any[];
16
- edges: any[];
17
- }): WorkflowGraph;
18
-
19
- export { sanitizeGraph };
@@ -1,3 +0,0 @@
1
- export { sanitizeGraph } from '../chunk-YR433ZDA.js';
2
- //# sourceMappingURL=sanitize.js.map
3
- //# sourceMappingURL=sanitize.js.map
@@ -1,9 +0,0 @@
1
- /**
2
- * An abortable `sleep` utility that pauses execution for a specified duration.
3
- * It will reject with an `AbortError` if the provided `AbortSignal` is triggered.
4
- * @param ms The number of milliseconds to sleep.
5
- * @param signal An optional `AbortSignal` to listen for cancellation.
6
- */
7
- declare function sleep(ms: number, signal?: AbortSignal): Promise<void>;
8
-
9
- export { sleep };
@@ -1,4 +0,0 @@
1
- export { sleep } from '../chunk-6QCXIRLA.js';
2
- import '../chunk-64DNBF5W.js';
3
- //# sourceMappingURL=sleep.js.map
4
- //# sourceMappingURL=sleep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"sleep.js"}
@@ -1,3 +0,0 @@
1
- export { A as AbstractNode } from '../types-U76Ukj96.js';
2
- import '../context.js';
3
- import '../logger.js';
@@ -1,4 +0,0 @@
1
- export { AbstractNode } from '../chunk-VZDHIOCH.js';
2
- import '../chunk-AOHBHYF6.js';
3
- //# sourceMappingURL=AbstractNode.js.map
4
- //# sourceMappingURL=AbstractNode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"AbstractNode.js"}
@@ -1,3 +0,0 @@
1
- import '../context.js';
2
- export { F as Flow } from '../types-U76Ukj96.js';
3
- import '../logger.js';
@@ -1,16 +0,0 @@
1
- export { Flow } from '../chunk-UY4PNPBX.js';
2
- import '../chunk-HEO3XL4Z.js';
3
- import '../chunk-7XUN3OQT.js';
4
- import '../chunk-WR5PDOPP.js';
5
- import '../chunk-VMH2LRM6.js';
6
- import '../chunk-YR433ZDA.js';
7
- import '../chunk-6QCXIRLA.js';
8
- import '../chunk-BRFMFLR6.js';
9
- import '../chunk-PNWOW52F.js';
10
- import '../chunk-VZDHIOCH.js';
11
- import '../chunk-S4WFNGQG.js';
12
- import '../chunk-64DNBF5W.js';
13
- import '../chunk-IIKTTIW5.js';
14
- import '../chunk-AOHBHYF6.js';
15
- //# sourceMappingURL=Flow.js.map
16
- //# sourceMappingURL=Flow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"Flow.js"}
@@ -1,3 +0,0 @@
1
- import '../context.js';
2
- export { N as Node } from '../types-U76Ukj96.js';
3
- import '../logger.js';
@@ -1,15 +0,0 @@
1
- export { Node } from '../chunk-HEO3XL4Z.js';
2
- import '../chunk-7XUN3OQT.js';
3
- import '../chunk-WR5PDOPP.js';
4
- import '../chunk-VMH2LRM6.js';
5
- import '../chunk-YR433ZDA.js';
6
- import '../chunk-6QCXIRLA.js';
7
- import '../chunk-BRFMFLR6.js';
8
- import '../chunk-PNWOW52F.js';
9
- import '../chunk-VZDHIOCH.js';
10
- import '../chunk-S4WFNGQG.js';
11
- import '../chunk-64DNBF5W.js';
12
- import '../chunk-IIKTTIW5.js';
13
- import '../chunk-AOHBHYF6.js';
14
- //# sourceMappingURL=Node.js.map
15
- //# sourceMappingURL=Node.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"Node.js"}
@@ -1,4 +0,0 @@
1
- export { A as AbstractNode, F as Flow, N as Node } from '../types-U76Ukj96.js';
2
- export { ExecNode, PostNode, PreNode } from './node-patterns.js';
3
- import '../context.js';
4
- import '../logger.js';
@@ -1,18 +0,0 @@
1
- import '../chunk-F6C6J7HK.js';
2
- export { Flow } from '../chunk-UY4PNPBX.js';
3
- export { ExecNode, PostNode, PreNode } from '../chunk-ELEHMJPM.js';
4
- export { Node } from '../chunk-HEO3XL4Z.js';
5
- import '../chunk-7XUN3OQT.js';
6
- import '../chunk-WR5PDOPP.js';
7
- import '../chunk-VMH2LRM6.js';
8
- import '../chunk-YR433ZDA.js';
9
- import '../chunk-6QCXIRLA.js';
10
- import '../chunk-BRFMFLR6.js';
11
- import '../chunk-PNWOW52F.js';
12
- export { AbstractNode } from '../chunk-VZDHIOCH.js';
13
- import '../chunk-S4WFNGQG.js';
14
- import '../chunk-64DNBF5W.js';
15
- import '../chunk-IIKTTIW5.js';
16
- import '../chunk-AOHBHYF6.js';
17
- //# sourceMappingURL=index.js.map
18
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -1,55 +0,0 @@
1
- import { P as Params, N as Node, b as NodeArgs } from '../types-U76Ukj96.js';
2
- import { Context } from '../context.js';
3
- import '../logger.js';
4
-
5
- /**
6
- * A simplified base class for nodes that only need to perform a core action.
7
- * This pattern is ideal for nodes that receive their inputs via `params` and
8
- * produce an output, without needing `prep` or complex `post` branching logic.
9
- *
10
- * @template ExecRes The type of data returned by the `exec` phase.
11
- * @template TParams The type for the node's static parameters.
12
- */
13
- declare abstract class ExecNode<ExecRes = any, TParams extends Params = Params, TContext extends Context = Context> extends Node<void, ExecRes, any, TParams, TContext> {
14
- /**
15
- * (Lifecycle) Performs the core, isolated logic of the node.
16
- * This is the only phase that is retried on failure. It should not access the `Context` directly.
17
- * @param args The arguments for the node, including `prepRes`.
18
- * @returns The result of the execution.
19
- */
20
- abstract exec(args: NodeArgs<void, void, TParams, TContext>): Promise<ExecRes>;
21
- }
22
- /**
23
- * A simplified base class for nodes that only perform a side effect, such as
24
- * modifying the `Context` or logging. These nodes do not produce an `exec` result.
25
- * Their logic is typically placed in the `prep` phase.
26
- *
27
- * @template TParams The type for the node's static parameters.
28
- */
29
- declare abstract class PreNode<TParams extends Params = Params, TContext extends Context = Context> extends Node<void, void, any, TParams, TContext> {
30
- /**
31
- * (Lifecycle) Prepares data or performs a side effect. Runs once before `exec`.
32
- * This is the ideal place to read from or write to the `Context`.
33
- * @param args The arguments for the node, including `ctx` and `params`.
34
- */
35
- abstract prep(args: NodeArgs<void, void, TParams, TContext>): Promise<void>;
36
- }
37
- /**
38
- * A simplified base class for nodes that make a branching decision.
39
- * This pattern is ideal for routing the workflow based on data in the `Context`.
40
- * The branching logic is placed in the `post` phase, which returns a custom action string.
41
- *
42
- * @template PostRes The type of the "action" string returned by the `post` phase.
43
- * @template TParams The type for the node's static parameters.
44
- */
45
- declare abstract class PostNode<PostRes = any, TParams extends Params = Params, TContext extends Context = Context> extends Node<void, void, PostRes, TParams, TContext> {
46
- /**
47
- * (Lifecycle) Processes results and determines the next step. Runs once after `exec`.
48
- * This is the ideal place to write data to the `Context` and return an action.
49
- * @param args The arguments for the node, including `execRes`.
50
- * @returns An "action" string to determine which successor to execute next.
51
- */
52
- abstract post(args: NodeArgs<void, void, TParams, TContext>): Promise<PostRes>;
53
- }
54
-
55
- export { ExecNode, PostNode, PreNode };
@@ -1,16 +0,0 @@
1
- export { ExecNode, PostNode, PreNode } from '../chunk-ELEHMJPM.js';
2
- import '../chunk-HEO3XL4Z.js';
3
- import '../chunk-7XUN3OQT.js';
4
- import '../chunk-WR5PDOPP.js';
5
- import '../chunk-VMH2LRM6.js';
6
- import '../chunk-YR433ZDA.js';
7
- import '../chunk-6QCXIRLA.js';
8
- import '../chunk-BRFMFLR6.js';
9
- import '../chunk-PNWOW52F.js';
10
- import '../chunk-VZDHIOCH.js';
11
- import '../chunk-S4WFNGQG.js';
12
- import '../chunk-64DNBF5W.js';
13
- import '../chunk-IIKTTIW5.js';
14
- import '../chunk-AOHBHYF6.js';
15
- //# sourceMappingURL=node-patterns.js.map
16
- //# sourceMappingURL=node-patterns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"node-patterns.js"}
@@ -1,17 +0,0 @@
1
- import { A as AbstractNode, F as Flow } from '../types-U76Ukj96.js';
2
- import '../context.js';
3
- import '../logger.js';
4
-
5
- type FlowConstructor = new (start?: AbstractNode) => Flow;
6
- /**
7
- * For internal use by the Flow class to register itself, breaking the circular dependency.
8
- * @internal
9
- */
10
- declare function registerFlow(constructor: FlowConstructor): void;
11
- /**
12
- * For internal use by the Node class to get the Flow constructor without a direct import.
13
- * @internal
14
- */
15
- declare function getFlowConstructor(): FlowConstructor;
16
-
17
- export { getFlowConstructor, registerFlow };
@@ -1,3 +0,0 @@
1
- export { getFlowConstructor, registerFlow } from '../chunk-S4WFNGQG.js';
2
- //# sourceMappingURL=registry.js.map
3
- //# sourceMappingURL=registry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"registry.js"}
File without changes
File without changes
File without changes