@decaf-ts/integrations 0.10.4 → 0.10.8

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 (300) hide show
  1. package/dist/integrations.cjs +1 -1
  2. package/docker/minio-compose.yml +9 -7
  3. package/jest.config.cjs +2 -0
  4. package/lib/cjs/blob/s3/S3BlobStoreService.cjs +7 -4
  5. package/lib/cjs/blob/s3/S3BlobStoreService.cjs.map +1 -1
  6. package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs +12 -73
  7. package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs.map +1 -1
  8. package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +5 -1
  9. package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
  10. package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +66 -1
  11. package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  12. package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs +16 -0
  13. package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs.map +1 -1
  14. package/lib/cjs/graph/engine/execution/index.cjs +0 -4
  15. package/lib/cjs/graph/engine/execution/index.cjs.map +1 -1
  16. package/lib/cjs/graph/engine/index.cjs +0 -7
  17. package/lib/cjs/graph/engine/index.cjs.map +1 -1
  18. package/lib/cjs/graph/engine/loops/index.cjs +0 -3
  19. package/lib/cjs/graph/engine/loops/index.cjs.map +1 -1
  20. package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs +36 -0
  21. package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs.map +1 -0
  22. package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs +36 -3
  23. package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs.map +1 -1
  24. package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs +32 -1
  25. package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs.map +1 -1
  26. package/lib/cjs/graph/engine/validation/index.cjs +1 -0
  27. package/lib/cjs/graph/engine/validation/index.cjs.map +1 -1
  28. package/lib/cjs/graph/nodes/agents/agent.cjs +118 -0
  29. package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
  30. package/lib/cjs/graph/nodes/base.cjs +61 -0
  31. package/lib/cjs/graph/nodes/base.cjs.map +1 -0
  32. package/lib/cjs/graph/nodes/boundary/input-value.cjs +59 -0
  33. package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
  34. package/lib/cjs/graph/nodes/flow-control/break.cjs +71 -0
  35. package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
  36. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +72 -0
  37. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
  38. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +80 -0
  39. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
  40. package/lib/cjs/graph/nodes/flow-control/if.cjs +82 -0
  41. package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
  42. package/lib/cjs/graph/nodes/flow-control/parallel.cjs +69 -0
  43. package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
  44. package/lib/cjs/graph/nodes/flow-control/switch.cjs +190 -0
  45. package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
  46. package/lib/cjs/graph/nodes/index.cjs +162 -0
  47. package/lib/cjs/graph/nodes/index.cjs.map +1 -0
  48. package/lib/cjs/graph/nodes/loops/foreach.cjs +189 -0
  49. package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
  50. package/lib/cjs/graph/nodes/loops/loop-metadata.cjs +48 -0
  51. package/lib/cjs/graph/nodes/loops/loop-metadata.cjs.map +1 -0
  52. package/lib/cjs/graph/nodes/loops/until.cjs +136 -0
  53. package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
  54. package/lib/cjs/graph/nodes/loops/while.cjs +133 -0
  55. package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
  56. package/lib/cjs/graph/nodes/manifests.cjs +342 -0
  57. package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
  58. package/lib/cjs/graph/nodes/triggers/chat.cjs +82 -0
  59. package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
  60. package/lib/cjs/graph/nodes/triggers/event.cjs +63 -0
  61. package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
  62. package/lib/cjs/graph/nodes/triggers/form.cjs +64 -0
  63. package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
  64. package/lib/cjs/graph/nodes/triggers/manual.cjs +65 -0
  65. package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
  66. package/lib/cjs/graph/nodes/triggers/schedule.cjs +65 -0
  67. package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
  68. package/lib/cjs/graph/nodes/triggers/webhook.cjs +67 -0
  69. package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
  70. package/lib/cjs/graph/nodes/utility/code.cjs +139 -0
  71. package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
  72. package/lib/cjs/graph/nodes/utility/delay.cjs +66 -0
  73. package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
  74. package/lib/cjs/graph/nodes/utility/log.cjs +70 -0
  75. package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
  76. package/lib/cjs/graph/nodes/utility/map.cjs +69 -0
  77. package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
  78. package/lib/cjs/graph/nodes/utility/merge.cjs +67 -0
  79. package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
  80. package/lib/cjs/graph/nodes/utility/return.cjs +69 -0
  81. package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
  82. package/lib/cjs/graph/nodes/utility/utility-log.cjs +77 -0
  83. package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
  84. package/lib/cjs/index.cjs +3 -3
  85. package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +8 -4
  86. package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
  87. package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs +2 -0
  88. package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs.map +1 -1
  89. package/lib/cjs/nest/graph/GraphWorkflowService.cjs +1 -13
  90. package/lib/cjs/nest/graph/GraphWorkflowService.cjs.map +1 -1
  91. package/lib/esm/blob/s3/S3BlobStoreService.js +7 -4
  92. package/lib/esm/blob/s3/S3BlobStoreService.js.map +1 -1
  93. package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js +11 -72
  94. package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js.map +1 -1
  95. package/lib/esm/graph/engine/execution/GraphExecutionContext.js +5 -1
  96. package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
  97. package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +66 -1
  98. package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
  99. package/lib/esm/graph/engine/execution/GraphExecutionFrame.js +16 -0
  100. package/lib/esm/graph/engine/execution/GraphExecutionFrame.js.map +1 -1
  101. package/lib/esm/graph/engine/execution/index.js +0 -4
  102. package/lib/esm/graph/engine/execution/index.js.map +1 -1
  103. package/lib/esm/graph/engine/index.js +0 -7
  104. package/lib/esm/graph/engine/index.js.map +1 -1
  105. package/lib/esm/graph/engine/loops/index.js +0 -3
  106. package/lib/esm/graph/engine/loops/index.js.map +1 -1
  107. package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js +32 -0
  108. package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js.map +1 -0
  109. package/lib/esm/graph/engine/validation/GraphParameterValidator.js +36 -3
  110. package/lib/esm/graph/engine/validation/GraphParameterValidator.js.map +1 -1
  111. package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js +32 -1
  112. package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js.map +1 -1
  113. package/lib/esm/graph/engine/validation/index.js +1 -0
  114. package/lib/esm/graph/engine/validation/index.js.map +1 -1
  115. package/lib/esm/graph/nodes/agents/agent.js +109 -0
  116. package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
  117. package/lib/esm/graph/nodes/base.js +56 -0
  118. package/lib/esm/graph/nodes/base.js.map +1 -0
  119. package/lib/esm/graph/nodes/boundary/input-value.js +50 -0
  120. package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
  121. package/lib/esm/graph/nodes/flow-control/break.js +62 -0
  122. package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
  123. package/lib/esm/graph/nodes/flow-control/error-boundary.js +63 -0
  124. package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
  125. package/lib/esm/graph/nodes/flow-control/human-approval.js +71 -0
  126. package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
  127. package/lib/esm/graph/nodes/flow-control/if.js +73 -0
  128. package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
  129. package/lib/esm/graph/nodes/flow-control/parallel.js +60 -0
  130. package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
  131. package/lib/esm/graph/nodes/flow-control/switch.js +181 -0
  132. package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
  133. package/lib/esm/graph/nodes/index.js +144 -0
  134. package/lib/esm/graph/nodes/index.js.map +1 -0
  135. package/lib/esm/graph/nodes/loops/foreach.js +180 -0
  136. package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
  137. package/lib/esm/graph/nodes/loops/loop-metadata.js +44 -0
  138. package/lib/esm/graph/nodes/loops/loop-metadata.js.map +1 -0
  139. package/lib/esm/graph/nodes/loops/until.js +127 -0
  140. package/lib/esm/graph/nodes/loops/until.js.map +1 -0
  141. package/lib/esm/graph/nodes/loops/while.js +124 -0
  142. package/lib/esm/graph/nodes/loops/while.js.map +1 -0
  143. package/lib/esm/graph/nodes/manifests.js +338 -0
  144. package/lib/esm/graph/nodes/manifests.js.map +1 -0
  145. package/lib/esm/graph/nodes/triggers/chat.js +73 -0
  146. package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
  147. package/lib/esm/graph/nodes/triggers/event.js +54 -0
  148. package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
  149. package/lib/esm/graph/nodes/triggers/form.js +55 -0
  150. package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
  151. package/lib/esm/graph/nodes/triggers/manual.js +56 -0
  152. package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
  153. package/lib/esm/graph/nodes/triggers/schedule.js +56 -0
  154. package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
  155. package/lib/esm/graph/nodes/triggers/webhook.js +58 -0
  156. package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
  157. package/lib/esm/graph/nodes/utility/code.js +130 -0
  158. package/lib/esm/graph/nodes/utility/code.js.map +1 -0
  159. package/lib/esm/graph/nodes/utility/delay.js +57 -0
  160. package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
  161. package/lib/esm/graph/nodes/utility/log.js +61 -0
  162. package/lib/esm/graph/nodes/utility/log.js.map +1 -0
  163. package/lib/esm/graph/nodes/utility/map.js +60 -0
  164. package/lib/esm/graph/nodes/utility/map.js.map +1 -0
  165. package/lib/esm/graph/nodes/utility/merge.js +58 -0
  166. package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
  167. package/lib/esm/graph/nodes/utility/return.js +60 -0
  168. package/lib/esm/graph/nodes/utility/return.js.map +1 -0
  169. package/lib/esm/graph/nodes/utility/utility-log.js +68 -0
  170. package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
  171. package/lib/esm/index.js +3 -3
  172. package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +8 -4
  173. package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
  174. package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js +2 -0
  175. package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js.map +1 -1
  176. package/lib/esm/nest/graph/GraphWorkflowService.js +2 -14
  177. package/lib/esm/nest/graph/GraphWorkflowService.js.map +1 -1
  178. package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.cts +4 -7
  179. package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.mts +4 -7
  180. package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +6 -1
  181. package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +6 -1
  182. package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +27 -0
  183. package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +27 -0
  184. package/lib/types/graph/engine/execution/GraphExecutionFrame.d.cts +12 -0
  185. package/lib/types/graph/engine/execution/GraphExecutionFrame.d.mts +12 -0
  186. package/lib/types/graph/engine/execution/index.d.cts +0 -4
  187. package/lib/types/graph/engine/execution/index.d.mts +0 -4
  188. package/lib/types/graph/engine/index.d.cts +0 -7
  189. package/lib/types/graph/engine/index.d.mts +0 -7
  190. package/lib/types/graph/engine/loops/index.d.cts +0 -3
  191. package/lib/types/graph/engine/loops/index.d.mts +0 -3
  192. package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.cts +21 -0
  193. package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.mts +21 -0
  194. package/lib/types/graph/engine/validation/GraphParameterValidator.d.cts +25 -1
  195. package/lib/types/graph/engine/validation/GraphParameterValidator.d.mts +25 -1
  196. package/lib/types/graph/engine/validation/index.d.cts +1 -0
  197. package/lib/types/graph/engine/validation/index.d.mts +1 -0
  198. package/lib/types/graph/nodes/agents/agent.d.cts +31 -0
  199. package/lib/types/graph/nodes/agents/agent.d.mts +31 -0
  200. package/lib/types/graph/nodes/base.d.cts +58 -0
  201. package/lib/types/graph/nodes/base.d.mts +58 -0
  202. package/lib/types/graph/nodes/boundary/input-value.d.cts +6 -0
  203. package/lib/types/graph/nodes/boundary/input-value.d.mts +6 -0
  204. package/lib/types/graph/nodes/flow-control/break.d.cts +8 -0
  205. package/lib/types/graph/nodes/flow-control/break.d.mts +8 -0
  206. package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +8 -0
  207. package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +8 -0
  208. package/lib/types/graph/nodes/flow-control/human-approval.d.cts +8 -0
  209. package/lib/types/graph/nodes/flow-control/human-approval.d.mts +8 -0
  210. package/lib/types/graph/nodes/flow-control/if.d.cts +8 -0
  211. package/lib/types/graph/nodes/flow-control/if.d.mts +8 -0
  212. package/lib/types/graph/nodes/flow-control/parallel.d.cts +7 -0
  213. package/lib/types/graph/nodes/flow-control/parallel.d.mts +7 -0
  214. package/lib/types/graph/nodes/flow-control/switch.d.cts +23 -0
  215. package/lib/types/graph/nodes/flow-control/switch.d.mts +23 -0
  216. package/lib/types/graph/nodes/index.d.cts +93 -0
  217. package/lib/types/graph/nodes/index.d.mts +93 -0
  218. package/lib/types/graph/nodes/loops/foreach.d.cts +11 -0
  219. package/lib/types/graph/nodes/loops/foreach.d.mts +11 -0
  220. package/lib/types/graph/nodes/loops/loop-metadata.d.cts +20 -0
  221. package/lib/types/graph/nodes/loops/loop-metadata.d.mts +20 -0
  222. package/lib/types/graph/nodes/loops/until.d.cts +8 -0
  223. package/lib/types/graph/nodes/loops/until.d.mts +8 -0
  224. package/lib/types/graph/nodes/loops/while.d.cts +8 -0
  225. package/lib/types/graph/nodes/loops/while.d.mts +8 -0
  226. package/lib/types/graph/nodes/manifests.d.cts +62 -0
  227. package/lib/types/graph/nodes/manifests.d.mts +62 -0
  228. package/lib/types/graph/nodes/triggers/chat.d.cts +8 -0
  229. package/lib/types/graph/nodes/triggers/chat.d.mts +8 -0
  230. package/lib/types/graph/nodes/triggers/event.d.cts +6 -0
  231. package/lib/types/graph/nodes/triggers/event.d.mts +6 -0
  232. package/lib/types/graph/nodes/triggers/form.d.cts +6 -0
  233. package/lib/types/graph/nodes/triggers/form.d.mts +6 -0
  234. package/lib/types/graph/nodes/triggers/manual.d.cts +6 -0
  235. package/lib/types/graph/nodes/triggers/manual.d.mts +6 -0
  236. package/lib/types/graph/nodes/triggers/schedule.d.cts +6 -0
  237. package/lib/types/graph/nodes/triggers/schedule.d.mts +6 -0
  238. package/lib/types/graph/nodes/triggers/webhook.d.cts +6 -0
  239. package/lib/types/graph/nodes/triggers/webhook.d.mts +6 -0
  240. package/lib/types/graph/nodes/utility/code.d.cts +36 -0
  241. package/lib/types/graph/nodes/utility/code.d.mts +36 -0
  242. package/lib/types/graph/nodes/utility/delay.d.cts +7 -0
  243. package/lib/types/graph/nodes/utility/delay.d.mts +7 -0
  244. package/lib/types/graph/nodes/utility/log.d.cts +8 -0
  245. package/lib/types/graph/nodes/utility/log.d.mts +8 -0
  246. package/lib/types/graph/nodes/utility/map.d.cts +7 -0
  247. package/lib/types/graph/nodes/utility/map.d.mts +7 -0
  248. package/lib/types/graph/nodes/utility/merge.d.cts +7 -0
  249. package/lib/types/graph/nodes/utility/merge.d.mts +7 -0
  250. package/lib/types/graph/nodes/utility/return.d.cts +7 -0
  251. package/lib/types/graph/nodes/utility/return.d.mts +7 -0
  252. package/lib/types/graph/nodes/utility/utility-log.d.cts +10 -0
  253. package/lib/types/graph/nodes/utility/utility-log.d.mts +10 -0
  254. package/lib/types/index.d.cts +2 -2
  255. package/lib/types/index.d.mts +2 -2
  256. package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +5 -3
  257. package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +5 -3
  258. package/package.json +1 -1
  259. package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs +0 -24
  260. package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs.map +0 -1
  261. package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs +0 -103
  262. package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs.map +0 -1
  263. package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +0 -47
  264. package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +0 -1
  265. package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +0 -121
  266. package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs.map +0 -1
  267. package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs +0 -146
  268. package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs.map +0 -1
  269. package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs +0 -102
  270. package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs.map +0 -1
  271. package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs +0 -103
  272. package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs.map +0 -1
  273. package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js +0 -19
  274. package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js.map +0 -1
  275. package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js +0 -98
  276. package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js.map +0 -1
  277. package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +0 -42
  278. package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +0 -1
  279. package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +0 -116
  280. package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js.map +0 -1
  281. package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js +0 -141
  282. package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js.map +0 -1
  283. package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js +0 -97
  284. package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js.map +0 -1
  285. package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js +0 -98
  286. package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js.map +0 -1
  287. package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.cts +0 -22
  288. package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.mts +0 -22
  289. package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.cts +0 -65
  290. package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.mts +0 -65
  291. package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +0 -25
  292. package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +0 -25
  293. package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +0 -43
  294. package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +0 -43
  295. package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.cts +0 -35
  296. package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.mts +0 -35
  297. package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.cts +0 -22
  298. package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.mts +0 -22
  299. package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.cts +0 -26
  300. package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.mts +0 -26
@@ -1,116 +0,0 @@
1
- import { GraphExecutionError } from "./../errors/GraphExecutionError.js";
2
- import { ConditionExpressionEvaluator } from "./../loops/ConditionExpressionEvaluator.js";
3
- /**
4
- * Reads the Switch metadata from the canonical node instance (DECAF-50):
5
- * configuration lives in the instance `parameters` (`switch` key) with
6
- * instance `metadata` as the legacy fallback (the §4.18 transition compiler
7
- * mirrors legacy `graph.metadata.switch` into instance metadata). When
8
- * absent, falls back to an empty default with the `default` port enabled.
9
- */
10
- function readSwitchMetadata(context) {
11
- const parameters = context.node.parameters;
12
- const metadata = context.node.metadata;
13
- const raw = parameters["switch"] ?? metadata?.["switch"];
14
- const switchMeta = raw;
15
- if (!switchMeta || !Array.isArray(switchMeta.cases)) {
16
- return { cases: [], defaultPort: "default", hasDefault: false };
17
- }
18
- return {
19
- cases: switchMeta.cases,
20
- defaultPort: switchMeta.defaultPort ?? "default",
21
- hasDefault: switchMeta.hasDefault === true,
22
- };
23
- }
24
- /**
25
- * Detects whether a condition is a `CodeCondition` (has `type: "code"`).
26
- */
27
- function isCodeCondition(cond) {
28
- return (typeof cond === "object" &&
29
- cond !== null &&
30
- "type" in cond &&
31
- cond.type === "code");
32
- }
33
- /**
34
- * Detects whether a condition is a `ConditionExpression` (has `op` field).
35
- */
36
- function isConditionExpression(cond) {
37
- return (typeof cond === "object" &&
38
- cond !== null &&
39
- "op" in cond &&
40
- typeof cond.op === "string");
41
- }
42
- /**
43
- * Executor for `core.flow.switch` nodes.
44
- *
45
- * Evaluates each case's condition in order and routes the input to the
46
- * first matching case's output port. When no case matches:
47
- * - If `hasDefault` is `true`, routes to the `default` output port.
48
- * - If `hasDefault` is `false` (the default), throws `GRAPH_SWITCH_NO_MATCH`.
49
- *
50
- * Condition evaluation:
51
- * - `ConditionExpression` — evaluated via {@link ConditionExpressionEvaluator}.
52
- * - `CodeCondition` — evaluated via the pluggable {@link CodeSandboxEvaluator}
53
- * from the engine's config. Throws `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`
54
- * when no evaluator is registered.
55
- */
56
- export class SwitchGraphNodeExecutor {
57
- constructor(engine) {
58
- this.engine = engine;
59
- this.expressionEvaluator = new ConditionExpressionEvaluator();
60
- }
61
- async execute(request, context) {
62
- const meta = readSwitchMetadata(context);
63
- const input = request.inputs;
64
- const inputValue = input["value"] ?? input;
65
- for (const switchCase of meta.cases) {
66
- const matches = await this.evaluateCondition(switchCase.condition, inputValue, input, context);
67
- if (matches) {
68
- return { [switchCase.outputPort]: inputValue };
69
- }
70
- }
71
- // No case matched — route to the default port when it is enabled.
72
- if (meta.hasDefault !== true) {
73
- throw new GraphExecutionError("No switch case matched and default port is not enabled", "GRAPH_SWITCH_NO_MATCH", { cases: meta.cases.map((c) => c.id) });
74
- }
75
- const defaultPort = meta.defaultPort ?? "default";
76
- return { [defaultPort]: inputValue };
77
- }
78
- /**
79
- * Evaluates a single switch case condition.
80
- */
81
- async evaluateCondition(condition, inputValue, fullInput, context) {
82
- if (isCodeCondition(condition)) {
83
- return this.evaluateCodeCondition(condition, fullInput, context);
84
- }
85
- if (isConditionExpression(condition)) {
86
- return this.expressionEvaluator.evaluate(condition, inputValue);
87
- }
88
- throw new GraphExecutionError("Unknown switch case condition type — must be ConditionExpression (op) or CodeCondition (type: 'code')", "GRAPH_UNKNOWN_SWITCH_CONDITION", { condition });
89
- }
90
- /**
91
- * Evaluates a code condition via the pluggable sandbox evaluator.
92
- */
93
- async evaluateCodeCondition(condition, input, context) {
94
- const evaluator = this.engine?.codeSandboxEvaluator;
95
- if (!evaluator) {
96
- throw new GraphExecutionError("Code conditions require a CodeSandboxEvaluator to be registered in GraphExecutionEngineConfig.codeSandboxEvaluator", "GRAPH_CODE_SANDBOX_NOT_CONFIGURED", { code: condition.code });
97
- }
98
- await context.log(`Evaluating code condition`, {
99
- language: condition.language ?? "javascript",
100
- });
101
- const md = context.metadata;
102
- const result = await evaluator.evaluate({
103
- code: condition.code,
104
- language: condition.language,
105
- input,
106
- vars: md?.vars ?? undefined,
107
- item: md?.item,
108
- index: md?.index,
109
- nodes: md?.nodes ??
110
- undefined,
111
- logger: context.logger,
112
- });
113
- return !!result;
114
- }
115
- }
116
- //# sourceMappingURL=SwitchGraphNodeExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SwitchGraphNodeExecutor.js","sourceRoot":"","sources":["../../../../../src/graph/engine/execution/SwitchGraphNodeExecutor.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,mBAAmB,EAAE,2CAAsC;AACpE,OAAO,EAAE,4BAA4B,EAAE,mDAA8C;AAGrF;;;;;;GAMG;AACH,SAAS,kBAAkB,CACzB,OAA8B;IAE9B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAqC,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AmB,CAC3B,uGAAuG,EACvG,gCAAgC,EAChC,EAAE,SAAS,EAAE,CACd,CAAC;IACJ,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,qBAAqB,CACjC,SAAwB,EACxB,KAA2B,EAC3B,OAA8B;QAE9B,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,oBAAoB,CAAC;QACpD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,MAAM,IAAI,mBAAmB,CAC3B,oHAAoH,EACpH,mCAAmC,EACnC,EAAE,IAAI,EAAE,SAAS,CAAC,IAAI,EAAE,CACzB,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAE;YAC7C,QAAQ,EAAE,SAAS,CAAC,QAAQ,IAAI,YAAY;SAC7C,CAAC,CAAC;QAEH,MAAM,EAAE,GAAG,OAAO,CAAC,QAA+C,CAAC;QAEnE,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC;YACtC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,QAAQ,EAAE,SAAS,CAAC,QAAQ;YAC5B,KAAK;YACL,IAAI,EAAG,EAAE,EAAE,IAA4C,IAAI,SAAS;YACpE,IAAI,EAAE,EAAE,EAAE,IAAI;YACd,KAAK,EAAE,EAAE,EAAE,KAA2B;YACtC,KAAK,EACF,EAAE,EAAE,KAA6D;gBAClE,SAAS;YACX,MAAM,EAAE,OAAO,CAAC,MAEH;SACd,CAAC,CAAC;QAEH,OAAO,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;CACF"}
@@ -1,141 +0,0 @@
1
- import { GRAPH_DEFAULT_MAX_FOREACH_ITERATIONS } from "./../constants.js";
2
- import { GraphExecutionEventType } from "@decaf-ts/ui-decorators/graph";
3
- import { GraphBreakSignal } from "./../errors/GraphBreakSignal.js";
4
- import { GraphInputError } from "./../errors/GraphInputError.js";
5
- import { GraphLoopLimitError } from "./../errors/GraphLoopLimitError.js";
6
- /**
7
- * Executor for `core.loop.foreach` nodes.
8
- *
9
- * Expects input:
10
- * - `items`: array of values to iterate over
11
- * - `slice?`: optional slice size (overrides `metadata.loop.slice`); default `1`
12
- * - `state?`: optional initial state
13
- *
14
- * Produces output:
15
- * - `results`: array of body outputs (in item order). When `slice > 1`, one
16
- * entry per slice (the body receives a slice array on the item port).
17
- * - `completed`: alias for `results` — the flow after the loop ends (the
18
- * collected results array).
19
- * - `iterations`: number of iterations executed
20
- * - `broken`: `true` when the loop was terminated early by a Break node
21
- * - `state?`: final state
22
- */
23
- export class ForeachGraphNodeExecutor {
24
- constructor(engine) {
25
- this.engine = engine;
26
- }
27
- async execute(request, context) {
28
- const metadata = this.extractMetadata(context);
29
- const input = request.inputs;
30
- const items = input.items;
31
- const maxIterations = metadata.maxIterations ?? GRAPH_DEFAULT_MAX_FOREACH_ITERATIONS;
32
- if (!Array.isArray(items)) {
33
- throw new GraphInputError("foreach input 'items' must be an array");
34
- }
35
- const sliceRaw = Number(input.slice ?? metadata.slice ?? 1);
36
- const slice = Number.isFinite(sliceRaw) && sliceRaw > 0 ? Math.floor(sliceRaw) : 1;
37
- const iterations = slice > 1 ? Math.ceil(items.length / slice) : items.length;
38
- if (iterations > maxIterations) {
39
- throw new GraphLoopLimitError(`foreach exceeded max iterations (${iterations} > ${maxIterations})`);
40
- }
41
- const itemPort = metadata.itemPort ?? "item";
42
- const resultPort = metadata.resultPort ?? "result";
43
- const statePort = metadata.statePort ?? "state";
44
- const bodyWorkflow = metadata.body;
45
- const results = [];
46
- let state = input.state;
47
- let broken = false;
48
- await context.emit({ type: GraphExecutionEventType.LOOP_STARTED });
49
- for (let i = 0; i < iterations; i++) {
50
- await context.emit({
51
- type: GraphExecutionEventType.LOOP_ITERATION_STARTED,
52
- iteration: i,
53
- });
54
- const sliceItems = slice > 1 ? items.slice(i * slice, i * slice + slice) : items[i];
55
- const childInputs = {
56
- [itemPort]: sliceItems,
57
- index: i,
58
- };
59
- if (slice > 1)
60
- childInputs["slice"] = sliceItems;
61
- if (state !== undefined)
62
- childInputs[statePort] = state;
63
- try {
64
- const childResult = await this.engine.execute(bodyWorkflow, childInputs, {
65
- parentRunId: context.runId,
66
- path: [...context.path, `iteration:${i}`],
67
- metadata: { item: sliceItems, index: i, slice },
68
- });
69
- results.push(childResult.outputs[resultPort]);
70
- if (childResult.outputs[statePort] !== undefined) {
71
- state = childResult.outputs[statePort];
72
- }
73
- }
74
- catch (err) {
75
- if (err instanceof GraphBreakSignal) {
76
- const carried = err.details?.value;
77
- if (carried !== undefined)
78
- results.push(carried);
79
- broken = true;
80
- await context.emit({
81
- type: GraphExecutionEventType.LOOP_ITERATION_COMPLETED,
82
- iteration: i,
83
- metadata: { broken: true },
84
- });
85
- break;
86
- }
87
- throw err;
88
- }
89
- await context.emit({
90
- type: GraphExecutionEventType.LOOP_ITERATION_COMPLETED,
91
- iteration: i,
92
- });
93
- }
94
- await context.emit({
95
- type: GraphExecutionEventType.LOOP_COMPLETED,
96
- metadata: { broken },
97
- });
98
- const output = {
99
- results,
100
- completed: results,
101
- iterations: results.length,
102
- broken,
103
- };
104
- if (state !== undefined)
105
- output[statePort] = state;
106
- return output;
107
- }
108
- extractMetadata(context) {
109
- const instance = context.node;
110
- const parameters = (instance.parameters ?? {});
111
- const loop = instance.loop;
112
- const fallback = context.metadata?.["loop"];
113
- if (!loop?.body && !fallback?.["body"]) {
114
- throw new GraphInputError("foreach node is missing loop configuration (instance.loop.body)");
115
- }
116
- const body = (loop?.body ?? fallback?.["body"]);
117
- const number = (key) => {
118
- const raw = parameters[key] ?? loop?.[key] ?? fallback?.[key];
119
- const value = Number(raw);
120
- return raw !== undefined && Number.isFinite(value) ? value : undefined;
121
- };
122
- const string = (key) => {
123
- const raw = parameters[key] ?? fallback?.[key];
124
- return typeof raw === "string" ? raw : undefined;
125
- };
126
- return {
127
- body,
128
- maxIterations: number("maxIterations"),
129
- timeoutMs: number("timeoutMs"),
130
- concurrency: number("concurrency"),
131
- condition: (parameters["condition"] ?? fallback?.["condition"]),
132
- inputPort: string("inputPort"),
133
- outputPort: string("outputPort"),
134
- itemPort: string("itemPort"),
135
- resultPort: string("resultPort"),
136
- statePort: string("statePort"),
137
- slice: number("slice"),
138
- };
139
- }
140
- }
141
- //# sourceMappingURL=ForeachGraphNodeExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ForeachGraphNodeExecutor.js","sourceRoot":"","sources":["../../../../../src/graph/engine/loops/ForeachGraphNodeExecutor.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,oCAAoC,EAAE,0BAAqB;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,wCAAmC;AAC9D,OAAO,EAAE,eAAe,EAAE,uCAAkC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,2CAAsC;AAEpE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,wBAAwB;IACnC,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;IAAG,CAAC;IAE7D,KAAK,CAAC,OAAO,CACX,OAAkC,EAClC,OAA8B;QAE9B,MAAM,QAAQ,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;QAC1B,MAAM,aAAa,GACjB,QAAQ,CAAC,aAAa,IAAI,oCAAoC,CAAC;QAEjE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,eAAe,CAAC,wCAAwC,CAAC,CAAC;QACtE,CAAC;QAED,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QAC5D,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,I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IAAI,IAAI,EAAE,CAAC,GAAoD,CAAC,IAAI,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;YAC/G,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1B,OAAO,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACzE,CAAC,CAAC;QACF,MAAM,MAAM,GAAG,CAAC,GAAW,EAAsB,EAAE;YACjD,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;YAC/C,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;QACnD,CAAC,CAAC;QACF,OAAO;YACL,IAAI;YACJ,aAAa,EAAE,MAAM,CAAC,eAAe,CAAC;YACtC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;YAC9B,WAAW,EAAE,MAAM,CAAC,aAAa,CAAC;YAClC,SAAS,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,QAAQ,EAAE,CAAC,WAAW,CAAC,CAEjD;YACb,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;YAC9B,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC;YAChC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC;YAC5B,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC;YAChC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC;YAC9B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC;SACvB,CAAC;IACJ,CAAC;CACF"}
@@ -1,97 +0,0 @@
1
- import { GRAPH_DEFAULT_MAX_LOOP_ITERATIONS } from "./../constants.js";
2
- import { GraphExecutionEventType } from "@decaf-ts/ui-decorators/graph";
3
- import { GraphInputError } from "./../errors/GraphInputError.js";
4
- import { GraphLoopLimitError } from "./../errors/GraphLoopLimitError.js";
5
- import { GraphConditionEvaluator } from "./GraphConditionEvaluator.js";
6
- /**
7
- * Executor for `core.loop.until` nodes.
8
- *
9
- * Executes the body at least once, then checks the condition. Repeats until
10
- * the condition evaluates to true.
11
- */
12
- export class UntilGraphNodeExecutor {
13
- constructor(engine) {
14
- this.engine = engine;
15
- this.evaluator = new GraphConditionEvaluator();
16
- }
17
- async execute(request, context) {
18
- const metadata = this.extractMetadata(context);
19
- const input = request.inputs;
20
- const maxIterations = metadata.maxIterations ?? GRAPH_DEFAULT_MAX_LOOP_ITERATIONS;
21
- const condition = metadata.condition;
22
- if (!condition) {
23
- throw new GraphInputError("until node is missing a condition");
24
- }
25
- const statePort = metadata.statePort ?? "state";
26
- const bodyWorkflow = metadata.body;
27
- let state = input.state;
28
- let iteration = 0;
29
- await context.emit({ type: GraphExecutionEventType.LOOP_STARTED });
30
- let shouldStop = false;
31
- do {
32
- if (iteration >= maxIterations) {
33
- await context.emit({
34
- type: GraphExecutionEventType.LOOP_LIMIT_REACHED,
35
- iteration,
36
- });
37
- throw new GraphLoopLimitError(`until loop exceeded max iterations (${maxIterations})`);
38
- }
39
- await context.emit({
40
- type: GraphExecutionEventType.LOOP_ITERATION_STARTED,
41
- iteration,
42
- });
43
- const childResult = await this.engine.execute(bodyWorkflow, { [statePort]: state, iteration }, {
44
- parentRunId: context.runId,
45
- path: [...context.path, `iteration:${iteration}`],
46
- });
47
- state = childResult.outputs[statePort];
48
- await context.emit({
49
- type: GraphExecutionEventType.LOOP_ITERATION_COMPLETED,
50
- iteration,
51
- });
52
- const conditionResult = this.evaluator.evaluate(condition, state);
53
- await context.emit({
54
- type: GraphExecutionEventType.LOOP_CONDITION_EVALUATED,
55
- iteration,
56
- payload: { result: conditionResult },
57
- });
58
- iteration++;
59
- shouldStop = conditionResult;
60
- } while (!shouldStop);
61
- await context.emit({ type: GraphExecutionEventType.LOOP_COMPLETED });
62
- return { [statePort]: state, iterations: iteration };
63
- }
64
- extractMetadata(context) {
65
- const instance = context.node;
66
- const parameters = (instance.parameters ?? {});
67
- const loop = instance.loop;
68
- const fallback = context.metadata?.["loop"];
69
- if (!loop?.body && !fallback?.["body"]) {
70
- throw new GraphInputError("until node is missing loop configuration (instance.loop.body)");
71
- }
72
- const body = (loop?.body ?? fallback?.["body"]);
73
- const number = (key) => {
74
- const raw = parameters[key] ?? loop?.[key] ?? fallback?.[key];
75
- const value = Number(raw);
76
- return raw !== undefined && Number.isFinite(value) ? value : undefined;
77
- };
78
- const string = (key) => {
79
- const raw = parameters[key] ?? fallback?.[key];
80
- return typeof raw === "string" ? raw : undefined;
81
- };
82
- return {
83
- body,
84
- maxIterations: number("maxIterations"),
85
- timeoutMs: number("timeoutMs"),
86
- concurrency: number("concurrency"),
87
- condition: (parameters["condition"] ?? fallback?.["condition"]),
88
- inputPort: string("inputPort"),
89
- outputPort: string("outputPort"),
90
- itemPort: string("itemPort"),
91
- resultPort: string("resultPort"),
92
- statePort: string("statePort"),
93
- slice: number("slice"),
94
- };
95
- }
96
- }
97
- //# sourceMappingURL=UntilGraphNodeExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UntilGraphNodeExecutor.js","sourceRoot":"","sources":["../../../../../src/graph/engine/loops/UntilGraphNodeExecutor.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iCAAiC,EAAE,0BAAqB;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,uCAAkC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,2CAAsC;AACpE,OAAO,EAAE,uBAAuB,EAAE,qCAAkC;AAEpE;;;;;GAKG;AACH,MAAM,OAAO,sBAAsB;IAGjC,YAA6B,MAA4B;QAA5B,WAAM,GAAN,MAAM,CAAsB;QAFxC,cAAS,GAAG,IAAI,uBAAuB,EAAE,CAAC;IAEC,CAAC;IAE7D,KAAK,CAAC,OAAO,CACX,OAAkC,EAClC,OAA8B;Q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1
- import { GRAPH_DEFAULT_MAX_LOOP_ITERATIONS } from "./../constants.js";
2
- import { GraphExecutionEventType } from "@decaf-ts/ui-decorators/graph";
3
- import { GraphInputError } from "./../errors/GraphInputError.js";
4
- import { GraphLoopLimitError } from "./../errors/GraphLoopLimitError.js";
5
- import { GraphConditionEvaluator } from "./GraphConditionEvaluator.js";
6
- /**
7
- * Executor for `core.loop.while` nodes.
8
- *
9
- * Expects input:
10
- * - `state`: initial state
11
- *
12
- * Produces output:
13
- * - `state`: final state
14
- * - `iterations`: number of iterations executed
15
- */
16
- export class WhileGraphNodeExecutor {
17
- constructor(engine) {
18
- this.engine = engine;
19
- this.evaluator = new GraphConditionEvaluator();
20
- }
21
- async execute(request, context) {
22
- const metadata = this.extractMetadata(context);
23
- const input = request.inputs;
24
- const maxIterations = metadata.maxIterations ?? GRAPH_DEFAULT_MAX_LOOP_ITERATIONS;
25
- const condition = metadata.condition;
26
- if (!condition) {
27
- throw new GraphInputError("while node is missing a condition");
28
- }
29
- const statePort = metadata.statePort ?? "state";
30
- const bodyWorkflow = metadata.body;
31
- let state = input.state;
32
- let iteration = 0;
33
- await context.emit({ type: GraphExecutionEventType.LOOP_STARTED });
34
- while (this.evaluator.evaluate(condition, state)) {
35
- if (iteration >= maxIterations) {
36
- await context.emit({
37
- type: GraphExecutionEventType.LOOP_LIMIT_REACHED,
38
- iteration,
39
- });
40
- throw new GraphLoopLimitError(`while loop exceeded max iterations (${maxIterations})`);
41
- }
42
- await context.emit({
43
- type: GraphExecutionEventType.LOOP_CONDITION_EVALUATED,
44
- iteration,
45
- payload: { result: true },
46
- });
47
- await context.emit({
48
- type: GraphExecutionEventType.LOOP_ITERATION_STARTED,
49
- iteration,
50
- });
51
- const childResult = await this.engine.execute(bodyWorkflow, { [statePort]: state, iteration }, {
52
- parentRunId: context.runId,
53
- path: [...context.path, `iteration:${iteration}`],
54
- });
55
- state = childResult.outputs[statePort];
56
- await context.emit({
57
- type: GraphExecutionEventType.LOOP_ITERATION_COMPLETED,
58
- iteration,
59
- });
60
- iteration++;
61
- }
62
- await context.emit({ type: GraphExecutionEventType.LOOP_COMPLETED });
63
- return { [statePort]: state, iterations: iteration };
64
- }
65
- extractMetadata(context) {
66
- const instance = context.node;
67
- const parameters = (instance.parameters ?? {});
68
- const loop = instance.loop;
69
- const fallback = context.metadata?.["loop"];
70
- if (!loop?.body && !fallback?.["body"]) {
71
- throw new GraphInputError("while node is missing loop configuration (instance.loop.body)");
72
- }
73
- const body = (loop?.body ?? fallback?.["body"]);
74
- const number = (key) => {
75
- const raw = parameters[key] ?? loop?.[key] ?? fallback?.[key];
76
- const value = Number(raw);
77
- return raw !== undefined && Number.isFinite(value) ? value : undefined;
78
- };
79
- const string = (key) => {
80
- const raw = parameters[key] ?? fallback?.[key];
81
- return typeof raw === "string" ? raw : undefined;
82
- };
83
- return {
84
- body,
85
- maxIterations: number("maxIterations"),
86
- timeoutMs: number("timeoutMs"),
87
- concurrency: number("concurrency"),
88
- condition: (parameters["condition"] ?? fallback?.["condition"]),
89
- inputPort: string("inputPort"),
90
- outputPort: string("outputPort"),
91
- itemPort: string("itemPort"),
92
- resultPort: string("resultPort"),
93
- statePort: string("statePort"),
94
- slice: number("slice"),
95
- };
96
- }
97
- }
98
- //# sourceMappingURL=WhileGraphNodeExecutor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WhileGraphNodeExecutor.js","sourceRoot":"","sources":["../../../../../src/graph/engine/loops/WhileGraphNodeExecutor.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iCAAiC,EAAE,0BAAqB;AACjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,uCAAkC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,2CAAsC;AACpE,OAAO,EAAE,uBAAuB,EAAE,qCAAkC;AAEpE;;;;;;;;;GASG;AACH,MAAM,OAAO,sBAAsB;IAGjC,YAA6B,MAA4B;QAA5B,WAAM,GA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0 @@
1
- /**
2
- * @module integrations/graph/execution/BreakGraphNodeExecutor
3
- * @summary Executor for the Break flow-control node.
4
- * @description Throws a {@link GraphBreakSignal} that the enclosing loop
5
- * executor catches to terminate the loop early. The optional `value` input is
6
- * carried on the signal so the loop can append it as the last partial result.
7
- */
8
- import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.cts";
9
- import type { GraphExecutionContext } from "./GraphExecutionContext.d.cts";
10
- import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../types.d.cts";
11
- /**
12
- * Executor for `core.flow.break` nodes.
13
- *
14
- * Reads the optional `value` input port and throws a {@link GraphBreakSignal}
15
- * carrying it. The enclosing loop executor (`core.loop.foreach`,
16
- * `core.loop.while`, `core.loop.until`) catches the signal, stops iterating,
17
- * and returns the results collected so far (plus the carried value as the
18
- * final partial result).
19
- */
20
- export declare class BreakGraphNodeExecutor implements GraphNodeExecutor {
21
- execute(request: GraphNodeExecutionRequest, _context: GraphExecutionContext): Promise<GraphExecutionValues>;
22
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * @module integrations/graph/execution/BreakGraphNodeExecutor
3
- * @summary Executor for the Break flow-control node.
4
- * @description Throws a {@link GraphBreakSignal} that the enclosing loop
5
- * executor catches to terminate the loop early. The optional `value` input is
6
- * carried on the signal so the loop can append it as the last partial result.
7
- */
8
- import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.mts";
9
- import type { GraphExecutionContext } from "./GraphExecutionContext.d.mts";
10
- import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../types.d.mts";
11
- /**
12
- * Executor for `core.flow.break` nodes.
13
- *
14
- * Reads the optional `value` input port and throws a {@link GraphBreakSignal}
15
- * carrying it. The enclosing loop executor (`core.loop.foreach`,
16
- * `core.loop.while`, `core.loop.until`) catches the signal, stops iterating,
17
- * and returns the results collected so far (plus the carried value as the
18
- * final partial result).
19
- */
20
- export declare class BreakGraphNodeExecutor implements GraphNodeExecutor {
21
- execute(request: GraphNodeExecutionRequest, _context: GraphExecutionContext): Promise<GraphExecutionValues>;
22
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * @module integrations/graph/execution/CodeGraphNodeExecutor
3
- * @summary Executor for the Code flow-control node (DECAF-32 §22.4, DECAF-34 §7.5).
4
- * @description Executes user-authored JS/TS in a restricted sandbox via the
5
- * pluggable {@link CodeSandboxEvaluator}. The sandbox enforces the Code Node
6
- * restrictions: no imports, no requires, pure functions only (no system API
7
- * access). The executor reads the code from the node's `code` input port
8
- * (spliced from {@link CodeInputSchema}), the timeout from the node's graph
9
- * metadata, resolves the sandbox context from the node's input values and
10
- * execution context, invokes the evaluator, and returns the result on the
11
- * `result` output port.
12
- */
13
- import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.cts";
14
- import type { GraphExecutionContext } from "./GraphExecutionContext.d.cts";
15
- import type { CodeSandboxEvaluator } from "./CodeSandboxEvaluator.d.cts";
16
- import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../types.d.cts";
17
- /**
18
- * Executor for `core.flow.code` nodes.
19
- *
20
- * The Code Node runs user-authored JS/TS in a restricted sandbox. The engine
21
- * does not implement the sandbox directly (§22.4); instead it delegates to the
22
- * pluggable {@link CodeSandboxEvaluator} registered on the engine config. When
23
- * no evaluator is registered, the executor throws
24
- * `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`.
25
- *
26
- * The code is read from the `code` input port (spliced from
27
- * {@link CodeInputSchema}). The language is hardcoded to `"javascript"` for
28
- * now (the `language` field on `CodeInputSchema` has no `@input` so it is not
29
- * a port and not wired). The timeout is read from `graph.metadata.timeoutMs`.
30
- *
31
- * The sandbox context exposes:
32
- * - `$input` — the full input values object (all resolved port values).
33
- * - `$vars` — workflow variables (sourced from `context.metadata.vars`).
34
- * - `$item` / `$index` — current loop item and index.
35
- * - `$node` — outputs of upstream nodes.
36
- * - `$output` — the current draft output.
37
- *
38
- * The evaluator's return value is forwarded verbatim on the `result` output
39
- * port.
40
- */
41
- export declare class CodeGraphNodeExecutor implements GraphNodeExecutor {
42
- private readonly engine?;
43
- /**
44
- * @param engine - The graph execution engine (or any object exposing the
45
- * optional `codeSandboxEvaluator`). This mirrors the pattern used by
46
- * {@link SwitchGraphNodeExecutor} for code conditions.
47
- */
48
- constructor(engine?: {
49
- codeSandboxEvaluator?: CodeSandboxEvaluator;
50
- } | undefined);
51
- execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): Promise<GraphExecutionValues>;
52
- /**
53
- * Builds the {@link CodeSandboxContext} from the executor input and the
54
- * graph execution context.
55
- *
56
- * The `$input` value is the full input values object so the code can access
57
- * every resolved port value (including `code` itself via `$input.code`).
58
- *
59
- * The `$vars`, `$item`, `$index`, `$node`, and `$output` values are sourced
60
- * from `context.metadata` — the engine (or a wrapping loop executor) may
61
- * populate these when the Code node runs inside a loop body or a workflow
62
- * with variables.
63
- */
64
- private buildSandboxContext;
65
- }