@decaf-ts/integrations 0.10.5 → 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 (294) hide show
  1. package/dist/integrations.cjs +1 -1
  2. package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs +12 -73
  3. package/lib/cjs/graph/engine/catalog/GraphBuiltInRegistrations.cjs.map +1 -1
  4. package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +5 -1
  5. package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
  6. package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +66 -1
  7. package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  8. package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs +16 -0
  9. package/lib/cjs/graph/engine/execution/GraphExecutionFrame.cjs.map +1 -1
  10. package/lib/cjs/graph/engine/execution/index.cjs +0 -4
  11. package/lib/cjs/graph/engine/execution/index.cjs.map +1 -1
  12. package/lib/cjs/graph/engine/index.cjs +0 -7
  13. package/lib/cjs/graph/engine/index.cjs.map +1 -1
  14. package/lib/cjs/graph/engine/loops/index.cjs +0 -3
  15. package/lib/cjs/graph/engine/loops/index.cjs.map +1 -1
  16. package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs +36 -0
  17. package/lib/cjs/graph/engine/validation/GraphLooseNodeValidation.cjs.map +1 -0
  18. package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs +36 -3
  19. package/lib/cjs/graph/engine/validation/GraphParameterValidator.cjs.map +1 -1
  20. package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs +32 -1
  21. package/lib/cjs/graph/engine/validation/GraphWorkflowDocumentValidator.cjs.map +1 -1
  22. package/lib/cjs/graph/engine/validation/index.cjs +1 -0
  23. package/lib/cjs/graph/engine/validation/index.cjs.map +1 -1
  24. package/lib/cjs/graph/nodes/agents/agent.cjs +118 -0
  25. package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
  26. package/lib/cjs/graph/nodes/base.cjs +61 -0
  27. package/lib/cjs/graph/nodes/base.cjs.map +1 -0
  28. package/lib/cjs/graph/nodes/boundary/input-value.cjs +59 -0
  29. package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
  30. package/lib/cjs/graph/nodes/flow-control/break.cjs +71 -0
  31. package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
  32. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +72 -0
  33. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
  34. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +80 -0
  35. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
  36. package/lib/cjs/graph/nodes/flow-control/if.cjs +82 -0
  37. package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
  38. package/lib/cjs/graph/nodes/flow-control/parallel.cjs +69 -0
  39. package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
  40. package/lib/cjs/graph/nodes/flow-control/switch.cjs +190 -0
  41. package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
  42. package/lib/cjs/graph/nodes/index.cjs +162 -0
  43. package/lib/cjs/graph/nodes/index.cjs.map +1 -0
  44. package/lib/cjs/graph/nodes/loops/foreach.cjs +189 -0
  45. package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
  46. package/lib/cjs/graph/nodes/loops/loop-metadata.cjs +48 -0
  47. package/lib/cjs/graph/nodes/loops/loop-metadata.cjs.map +1 -0
  48. package/lib/cjs/graph/nodes/loops/until.cjs +136 -0
  49. package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
  50. package/lib/cjs/graph/nodes/loops/while.cjs +133 -0
  51. package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
  52. package/lib/cjs/graph/nodes/manifests.cjs +342 -0
  53. package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
  54. package/lib/cjs/graph/nodes/triggers/chat.cjs +82 -0
  55. package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
  56. package/lib/cjs/graph/nodes/triggers/event.cjs +63 -0
  57. package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
  58. package/lib/cjs/graph/nodes/triggers/form.cjs +64 -0
  59. package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
  60. package/lib/cjs/graph/nodes/triggers/manual.cjs +65 -0
  61. package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
  62. package/lib/cjs/graph/nodes/triggers/schedule.cjs +65 -0
  63. package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
  64. package/lib/cjs/graph/nodes/triggers/webhook.cjs +67 -0
  65. package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
  66. package/lib/cjs/graph/nodes/utility/code.cjs +139 -0
  67. package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
  68. package/lib/cjs/graph/nodes/utility/delay.cjs +66 -0
  69. package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
  70. package/lib/cjs/graph/nodes/utility/log.cjs +70 -0
  71. package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
  72. package/lib/cjs/graph/nodes/utility/map.cjs +69 -0
  73. package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
  74. package/lib/cjs/graph/nodes/utility/merge.cjs +67 -0
  75. package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
  76. package/lib/cjs/graph/nodes/utility/return.cjs +69 -0
  77. package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
  78. package/lib/cjs/graph/nodes/utility/utility-log.cjs +77 -0
  79. package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
  80. package/lib/cjs/index.cjs +3 -3
  81. package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +8 -4
  82. package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
  83. package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs +2 -0
  84. package/lib/cjs/nest/graph/GraphWorkflowBoundaryValidation.cjs.map +1 -1
  85. package/lib/cjs/nest/graph/GraphWorkflowService.cjs +1 -13
  86. package/lib/cjs/nest/graph/GraphWorkflowService.cjs.map +1 -1
  87. package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js +11 -72
  88. package/lib/esm/graph/engine/catalog/GraphBuiltInRegistrations.js.map +1 -1
  89. package/lib/esm/graph/engine/execution/GraphExecutionContext.js +5 -1
  90. package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
  91. package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +66 -1
  92. package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
  93. package/lib/esm/graph/engine/execution/GraphExecutionFrame.js +16 -0
  94. package/lib/esm/graph/engine/execution/GraphExecutionFrame.js.map +1 -1
  95. package/lib/esm/graph/engine/execution/index.js +0 -4
  96. package/lib/esm/graph/engine/execution/index.js.map +1 -1
  97. package/lib/esm/graph/engine/index.js +0 -7
  98. package/lib/esm/graph/engine/index.js.map +1 -1
  99. package/lib/esm/graph/engine/loops/index.js +0 -3
  100. package/lib/esm/graph/engine/loops/index.js.map +1 -1
  101. package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js +32 -0
  102. package/lib/esm/graph/engine/validation/GraphLooseNodeValidation.js.map +1 -0
  103. package/lib/esm/graph/engine/validation/GraphParameterValidator.js +36 -3
  104. package/lib/esm/graph/engine/validation/GraphParameterValidator.js.map +1 -1
  105. package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js +32 -1
  106. package/lib/esm/graph/engine/validation/GraphWorkflowDocumentValidator.js.map +1 -1
  107. package/lib/esm/graph/engine/validation/index.js +1 -0
  108. package/lib/esm/graph/engine/validation/index.js.map +1 -1
  109. package/lib/esm/graph/nodes/agents/agent.js +109 -0
  110. package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
  111. package/lib/esm/graph/nodes/base.js +56 -0
  112. package/lib/esm/graph/nodes/base.js.map +1 -0
  113. package/lib/esm/graph/nodes/boundary/input-value.js +50 -0
  114. package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
  115. package/lib/esm/graph/nodes/flow-control/break.js +62 -0
  116. package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
  117. package/lib/esm/graph/nodes/flow-control/error-boundary.js +63 -0
  118. package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
  119. package/lib/esm/graph/nodes/flow-control/human-approval.js +71 -0
  120. package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
  121. package/lib/esm/graph/nodes/flow-control/if.js +73 -0
  122. package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
  123. package/lib/esm/graph/nodes/flow-control/parallel.js +60 -0
  124. package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
  125. package/lib/esm/graph/nodes/flow-control/switch.js +181 -0
  126. package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
  127. package/lib/esm/graph/nodes/index.js +144 -0
  128. package/lib/esm/graph/nodes/index.js.map +1 -0
  129. package/lib/esm/graph/nodes/loops/foreach.js +180 -0
  130. package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
  131. package/lib/esm/graph/nodes/loops/loop-metadata.js +44 -0
  132. package/lib/esm/graph/nodes/loops/loop-metadata.js.map +1 -0
  133. package/lib/esm/graph/nodes/loops/until.js +127 -0
  134. package/lib/esm/graph/nodes/loops/until.js.map +1 -0
  135. package/lib/esm/graph/nodes/loops/while.js +124 -0
  136. package/lib/esm/graph/nodes/loops/while.js.map +1 -0
  137. package/lib/esm/graph/nodes/manifests.js +338 -0
  138. package/lib/esm/graph/nodes/manifests.js.map +1 -0
  139. package/lib/esm/graph/nodes/triggers/chat.js +73 -0
  140. package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
  141. package/lib/esm/graph/nodes/triggers/event.js +54 -0
  142. package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
  143. package/lib/esm/graph/nodes/triggers/form.js +55 -0
  144. package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
  145. package/lib/esm/graph/nodes/triggers/manual.js +56 -0
  146. package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
  147. package/lib/esm/graph/nodes/triggers/schedule.js +56 -0
  148. package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
  149. package/lib/esm/graph/nodes/triggers/webhook.js +58 -0
  150. package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
  151. package/lib/esm/graph/nodes/utility/code.js +130 -0
  152. package/lib/esm/graph/nodes/utility/code.js.map +1 -0
  153. package/lib/esm/graph/nodes/utility/delay.js +57 -0
  154. package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
  155. package/lib/esm/graph/nodes/utility/log.js +61 -0
  156. package/lib/esm/graph/nodes/utility/log.js.map +1 -0
  157. package/lib/esm/graph/nodes/utility/map.js +60 -0
  158. package/lib/esm/graph/nodes/utility/map.js.map +1 -0
  159. package/lib/esm/graph/nodes/utility/merge.js +58 -0
  160. package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
  161. package/lib/esm/graph/nodes/utility/return.js +60 -0
  162. package/lib/esm/graph/nodes/utility/return.js.map +1 -0
  163. package/lib/esm/graph/nodes/utility/utility-log.js +68 -0
  164. package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
  165. package/lib/esm/index.js +3 -3
  166. package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +8 -4
  167. package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
  168. package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js +2 -0
  169. package/lib/esm/nest/graph/GraphWorkflowBoundaryValidation.js.map +1 -1
  170. package/lib/esm/nest/graph/GraphWorkflowService.js +2 -14
  171. package/lib/esm/nest/graph/GraphWorkflowService.js.map +1 -1
  172. package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.cts +4 -7
  173. package/lib/types/graph/engine/catalog/GraphBuiltInRegistrations.d.mts +4 -7
  174. package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +6 -1
  175. package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +6 -1
  176. package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +27 -0
  177. package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +27 -0
  178. package/lib/types/graph/engine/execution/GraphExecutionFrame.d.cts +12 -0
  179. package/lib/types/graph/engine/execution/GraphExecutionFrame.d.mts +12 -0
  180. package/lib/types/graph/engine/execution/index.d.cts +0 -4
  181. package/lib/types/graph/engine/execution/index.d.mts +0 -4
  182. package/lib/types/graph/engine/index.d.cts +0 -7
  183. package/lib/types/graph/engine/index.d.mts +0 -7
  184. package/lib/types/graph/engine/loops/index.d.cts +0 -3
  185. package/lib/types/graph/engine/loops/index.d.mts +0 -3
  186. package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.cts +21 -0
  187. package/lib/types/graph/engine/validation/GraphLooseNodeValidation.d.mts +21 -0
  188. package/lib/types/graph/engine/validation/GraphParameterValidator.d.cts +25 -1
  189. package/lib/types/graph/engine/validation/GraphParameterValidator.d.mts +25 -1
  190. package/lib/types/graph/engine/validation/index.d.cts +1 -0
  191. package/lib/types/graph/engine/validation/index.d.mts +1 -0
  192. package/lib/types/graph/nodes/agents/agent.d.cts +31 -0
  193. package/lib/types/graph/nodes/agents/agent.d.mts +31 -0
  194. package/lib/types/graph/nodes/base.d.cts +58 -0
  195. package/lib/types/graph/nodes/base.d.mts +58 -0
  196. package/lib/types/graph/nodes/boundary/input-value.d.cts +6 -0
  197. package/lib/types/graph/nodes/boundary/input-value.d.mts +6 -0
  198. package/lib/types/graph/nodes/flow-control/break.d.cts +8 -0
  199. package/lib/types/graph/nodes/flow-control/break.d.mts +8 -0
  200. package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +8 -0
  201. package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +8 -0
  202. package/lib/types/graph/nodes/flow-control/human-approval.d.cts +8 -0
  203. package/lib/types/graph/nodes/flow-control/human-approval.d.mts +8 -0
  204. package/lib/types/graph/nodes/flow-control/if.d.cts +8 -0
  205. package/lib/types/graph/nodes/flow-control/if.d.mts +8 -0
  206. package/lib/types/graph/nodes/flow-control/parallel.d.cts +7 -0
  207. package/lib/types/graph/nodes/flow-control/parallel.d.mts +7 -0
  208. package/lib/types/graph/nodes/flow-control/switch.d.cts +23 -0
  209. package/lib/types/graph/nodes/flow-control/switch.d.mts +23 -0
  210. package/lib/types/graph/nodes/index.d.cts +93 -0
  211. package/lib/types/graph/nodes/index.d.mts +93 -0
  212. package/lib/types/graph/nodes/loops/foreach.d.cts +11 -0
  213. package/lib/types/graph/nodes/loops/foreach.d.mts +11 -0
  214. package/lib/types/graph/nodes/loops/loop-metadata.d.cts +20 -0
  215. package/lib/types/graph/nodes/loops/loop-metadata.d.mts +20 -0
  216. package/lib/types/graph/nodes/loops/until.d.cts +8 -0
  217. package/lib/types/graph/nodes/loops/until.d.mts +8 -0
  218. package/lib/types/graph/nodes/loops/while.d.cts +8 -0
  219. package/lib/types/graph/nodes/loops/while.d.mts +8 -0
  220. package/lib/types/graph/nodes/manifests.d.cts +62 -0
  221. package/lib/types/graph/nodes/manifests.d.mts +62 -0
  222. package/lib/types/graph/nodes/triggers/chat.d.cts +8 -0
  223. package/lib/types/graph/nodes/triggers/chat.d.mts +8 -0
  224. package/lib/types/graph/nodes/triggers/event.d.cts +6 -0
  225. package/lib/types/graph/nodes/triggers/event.d.mts +6 -0
  226. package/lib/types/graph/nodes/triggers/form.d.cts +6 -0
  227. package/lib/types/graph/nodes/triggers/form.d.mts +6 -0
  228. package/lib/types/graph/nodes/triggers/manual.d.cts +6 -0
  229. package/lib/types/graph/nodes/triggers/manual.d.mts +6 -0
  230. package/lib/types/graph/nodes/triggers/schedule.d.cts +6 -0
  231. package/lib/types/graph/nodes/triggers/schedule.d.mts +6 -0
  232. package/lib/types/graph/nodes/triggers/webhook.d.cts +6 -0
  233. package/lib/types/graph/nodes/triggers/webhook.d.mts +6 -0
  234. package/lib/types/graph/nodes/utility/code.d.cts +36 -0
  235. package/lib/types/graph/nodes/utility/code.d.mts +36 -0
  236. package/lib/types/graph/nodes/utility/delay.d.cts +7 -0
  237. package/lib/types/graph/nodes/utility/delay.d.mts +7 -0
  238. package/lib/types/graph/nodes/utility/log.d.cts +8 -0
  239. package/lib/types/graph/nodes/utility/log.d.mts +8 -0
  240. package/lib/types/graph/nodes/utility/map.d.cts +7 -0
  241. package/lib/types/graph/nodes/utility/map.d.mts +7 -0
  242. package/lib/types/graph/nodes/utility/merge.d.cts +7 -0
  243. package/lib/types/graph/nodes/utility/merge.d.mts +7 -0
  244. package/lib/types/graph/nodes/utility/return.d.cts +7 -0
  245. package/lib/types/graph/nodes/utility/return.d.mts +7 -0
  246. package/lib/types/graph/nodes/utility/utility-log.d.cts +10 -0
  247. package/lib/types/graph/nodes/utility/utility-log.d.mts +10 -0
  248. package/lib/types/index.d.cts +2 -2
  249. package/lib/types/index.d.mts +2 -2
  250. package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +5 -3
  251. package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +5 -3
  252. package/package.json +1 -1
  253. package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs +0 -24
  254. package/lib/cjs/graph/engine/execution/BreakGraphNodeExecutor.cjs.map +0 -1
  255. package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs +0 -103
  256. package/lib/cjs/graph/engine/execution/CodeGraphNodeExecutor.cjs.map +0 -1
  257. package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +0 -47
  258. package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +0 -1
  259. package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs +0 -121
  260. package/lib/cjs/graph/engine/execution/SwitchGraphNodeExecutor.cjs.map +0 -1
  261. package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs +0 -146
  262. package/lib/cjs/graph/engine/loops/ForeachGraphNodeExecutor.cjs.map +0 -1
  263. package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs +0 -102
  264. package/lib/cjs/graph/engine/loops/UntilGraphNodeExecutor.cjs.map +0 -1
  265. package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs +0 -103
  266. package/lib/cjs/graph/engine/loops/WhileGraphNodeExecutor.cjs.map +0 -1
  267. package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js +0 -19
  268. package/lib/esm/graph/engine/execution/BreakGraphNodeExecutor.js.map +0 -1
  269. package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js +0 -98
  270. package/lib/esm/graph/engine/execution/CodeGraphNodeExecutor.js.map +0 -1
  271. package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +0 -42
  272. package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +0 -1
  273. package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js +0 -116
  274. package/lib/esm/graph/engine/execution/SwitchGraphNodeExecutor.js.map +0 -1
  275. package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js +0 -141
  276. package/lib/esm/graph/engine/loops/ForeachGraphNodeExecutor.js.map +0 -1
  277. package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js +0 -97
  278. package/lib/esm/graph/engine/loops/UntilGraphNodeExecutor.js.map +0 -1
  279. package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js +0 -98
  280. package/lib/esm/graph/engine/loops/WhileGraphNodeExecutor.js.map +0 -1
  281. package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.cts +0 -22
  282. package/lib/types/graph/engine/execution/BreakGraphNodeExecutor.d.mts +0 -22
  283. package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.cts +0 -65
  284. package/lib/types/graph/engine/execution/CodeGraphNodeExecutor.d.mts +0 -65
  285. package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +0 -25
  286. package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +0 -25
  287. package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.cts +0 -43
  288. package/lib/types/graph/engine/execution/SwitchGraphNodeExecutor.d.mts +0 -43
  289. package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.cts +0 -35
  290. package/lib/types/graph/engine/loops/ForeachGraphNodeExecutor.d.mts +0 -35
  291. package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.cts +0 -22
  292. package/lib/types/graph/engine/loops/UntilGraphNodeExecutor.d.mts +0 -22
  293. package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.cts +0 -26
  294. package/lib/types/graph/engine/loops/WhileGraphNodeExecutor.d.mts +0 -26
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @module integrations/graph/nodes/utility/code
3
+ * @summary Code utility node declaration (ALFRED-5 §7, DECAF-32 §22.4).
4
+ * @description Code — sandboxed JS/TS code execution. The class's own
5
+ * `static execute` is the only implementation of the kind, derived by
6
+ * `GraphBuiltInRegistrations`, and reaches the pluggable `CodeSandboxEvaluator`
7
+ * through `GraphExecutionContext.engine`.
8
+ * The default `IsolatedVmCodeSandboxEvaluator` (backed by `isolated-vm`)
9
+ * enforces the Code Node restrictions: no imports, no requires, pure
10
+ * functions only. The sandbox context exposes `$input`, `$vars`, `$item`,
11
+ * `$index`, `$node`, and `$output` as data variables. TypeScript is
12
+ * supported via transpilation.
13
+ *
14
+ * The `@input` on `CodeNode.input` is a schema group — the nested
15
+ * model's `@input` ports are spliced into the parent unprefixed. `code` has
16
+ * `@input` + `@uielement("code-editor")`, so it appears as a port AND in the
17
+ * CRUD modal (the only visible field). `data` has `@input` + `@hidden()` but
18
+ * no `@uielement`, so it is a canvas-only port (for edge connections from
19
+ * workflow input badges) but never appears in the CRUD modal. `language` has
20
+ * no `@input` and no `@uielement`, so it is neither a port nor rendered — it
21
+ * defaults to `"javascript"`.
22
+ */
23
+ import { Model } from "@decaf-ts/decorator-validation";
24
+ import { GraphNode } from "../base.d.mts";
25
+ import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
26
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
27
+ export declare class CodeInputSchema extends Model {
28
+ language: string;
29
+ code: string;
30
+ data?: unknown;
31
+ }
32
+ export declare class CodeNode extends GraphNode {
33
+ static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): Promise<GraphExecutionValues>;
34
+ input: CodeInputSchema;
35
+ result: unknown;
36
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.cts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
3
+ export declare class DelayFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ valueOut: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.mts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
3
+ export declare class DelayFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ valueOut: unknown;
7
+ }
@@ -0,0 +1,8 @@
1
+ import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.cts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
3
+ import { GraphNode } from "../base.d.cts";
4
+ export declare class LogFlowNode extends GraphNode {
5
+ static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
6
+ value: unknown;
7
+ logged: unknown;
8
+ }
@@ -0,0 +1,8 @@
1
+ import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
3
+ import { GraphNode } from "../base.d.mts";
4
+ export declare class LogFlowNode extends GraphNode {
5
+ static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
6
+ value: unknown;
7
+ logged: unknown;
8
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.cts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
3
+ export declare class MapNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ result: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.mts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
3
+ export declare class MapNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ result: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.cts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
3
+ export declare class MergeFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ values: unknown[];
6
+ merged: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.mts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
3
+ export declare class MergeFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ values: unknown[];
6
+ merged: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.cts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
3
+ export declare class ReturnFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ result: unknown;
7
+ }
@@ -0,0 +1,7 @@
1
+ import { GraphNode } from "../base.d.mts";
2
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
3
+ export declare class ReturnFlowNode extends GraphNode {
4
+ static execute(request: GraphNodeExecutionRequest): GraphExecutionValues;
5
+ value: unknown;
6
+ result: unknown;
7
+ }
@@ -0,0 +1,10 @@
1
+ import type { LogNodeLevel } from "@decaf-ts/ui-decorators/graph";
2
+ import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.cts";
3
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.cts";
4
+ import { GraphNode } from "../base.d.cts";
5
+ export declare class UtilityLogNode extends GraphNode {
6
+ static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
7
+ value: unknown;
8
+ level: LogNodeLevel;
9
+ logged: unknown;
10
+ }
@@ -0,0 +1,10 @@
1
+ import type { LogNodeLevel } from "@decaf-ts/ui-decorators/graph";
2
+ import type { GraphExecutionContext } from "../../engine/execution/GraphExecutionContext.d.mts";
3
+ import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../engine/types.d.mts";
4
+ import { GraphNode } from "../base.d.mts";
5
+ export declare class UtilityLogNode extends GraphNode {
6
+ static execute(request: GraphNodeExecutionRequest, context: GraphExecutionContext): GraphExecutionValues;
7
+ value: unknown;
8
+ level: LogNodeLevel;
9
+ logged: unknown;
10
+ }
@@ -7,6 +7,6 @@ export * from "./utils.d.cts";
7
7
  export * from "./namespaces/index.d.cts";
8
8
  export * from "./feature-flags/index.d.cts";
9
9
  export declare const VERSION: string;
10
- export declare const COMMIT = "aa047af";
11
- export declare const FULL_VERSION = "0.10.4-aa047af";
10
+ export declare const COMMIT = "9f5df0a";
11
+ export declare const FULL_VERSION = "0.10.7-9f5df0a";
12
12
  export declare const PACKAGE_NAME: string;
@@ -7,6 +7,6 @@ export * from "./utils.d.mts";
7
7
  export * from "./namespaces/index.d.mts";
8
8
  export * from "./feature-flags/index.d.mts";
9
9
  export declare const VERSION: string;
10
- export declare const COMMIT = "aa047af";
11
- export declare const FULL_VERSION = "0.10.4-aa047af";
10
+ export declare const COMMIT = "9f5df0a";
11
+ export declare const FULL_VERSION = "0.10.7-9f5df0a";
12
12
  export declare const PACKAGE_NAME: string;
@@ -40,10 +40,12 @@ export declare function createGraphExecutorRegistry(extra?: Record<string, Graph
40
40
  * engine-bound executors.
41
41
  *
42
42
  * @param catalogue - The catalogue receiving the registrations.
43
- * @param engine - The engine instance the loop/Code/Switch executors bind to.
44
- * @returns The catalogue with the engine-bound registrations applied.
43
+ * @param _engine - Retained for call-site compatibility; node classes now
44
+ * reach the engine through `GraphExecutionContext.engine`, so no executor
45
+ * needs an engine back-reference.
46
+ * @returns The catalogue with the built-in registrations applied.
45
47
  */
46
- export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, engine: GraphExecutionEngine): GraphNodeCatalogue;
48
+ export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, _engine: GraphExecutionEngine): GraphNodeCatalogue;
47
49
  /**
48
50
  * Builds a `GraphExecutionEngineConfig` populated with all built-in
49
51
  * registrations including loop executors that need a back-reference to the
@@ -40,10 +40,12 @@ export declare function createGraphExecutorRegistry(extra?: Record<string, Graph
40
40
  * engine-bound executors.
41
41
  *
42
42
  * @param catalogue - The catalogue receiving the registrations.
43
- * @param engine - The engine instance the loop/Code/Switch executors bind to.
44
- * @returns The catalogue with the engine-bound registrations applied.
43
+ * @param _engine - Retained for call-site compatibility; node classes now
44
+ * reach the engine through `GraphExecutionContext.engine`, so no executor
45
+ * needs an engine back-reference.
46
+ * @returns The catalogue with the built-in registrations applied.
45
47
  */
46
- export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, engine: GraphExecutionEngine): GraphNodeCatalogue;
48
+ export declare function registerEngineBoundGraphNodes(catalogue: GraphNodeCatalogue, _engine: GraphExecutionEngine): GraphNodeCatalogue;
47
49
  /**
48
50
  * Builds a `GraphExecutionEngineConfig` populated with all built-in
49
51
  * registrations including loop executors that need a back-reference to the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/integrations",
3
- "version": "0.10.5",
3
+ "version": "0.10.8",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.mts",
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BreakGraphNodeExecutor = void 0;
4
- const GraphBreakSignal_js_1 = require("./../errors/GraphBreakSignal.cjs");
5
- /**
6
- * Executor for `core.flow.break` nodes.
7
- *
8
- * Reads the optional `value` input port and throws a {@link GraphBreakSignal}
9
- * carrying it. The enclosing loop executor (`core.loop.foreach`,
10
- * `core.loop.while`, `core.loop.until`) catches the signal, stops iterating,
11
- * and returns the results collected so far (plus the carried value as the
12
- * final partial result).
13
- */
14
- class BreakGraphNodeExecutor {
15
- async execute(request,
16
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
- _context) {
18
- const value = request.inputs["value"];
19
- throw new GraphBreakSignal_js_1.GraphBreakSignal(value);
20
- }
21
- }
22
- exports.BreakGraphNodeExecutor = BreakGraphNodeExecutor;
23
- //# sourceMappingURL=BreakGraphNodeExecutor.js.map
24
- //# sourceMappingURL=BreakGraphNodeExecutor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph/engine/execution/BreakGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/BreakGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA,yEAAmE;AACnE;;;;;;;;GAQG;AACH,MAAa,sBAAsB;IAC/B,KAAK,CAAC,OAAO,CAAC,OAAO;IACrB,6DAA6D;IAC7D,QAAQ;QACJ,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,IAAI,sCAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,CAAC;CACJ;AAPD,wDAOC;AACD,kDAAkD"}
@@ -1,103 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CodeGraphNodeExecutor = void 0;
4
- const GraphExecutionError_js_1 = require("./../errors/GraphExecutionError.cjs");
5
- const GraphInputError_js_1 = require("./../errors/GraphInputError.cjs");
6
- /**
7
- * Reads the Code node metadata from the canonical node instance (DECAF-50):
8
- * configuration lives in the instance `parameters` with `metadata` as the
9
- * legacy fallback (the §4.18 transition compiler mirrors legacy
10
- * `graph.metadata` bags into instance metadata).
11
- */
12
- function readCodeMetadata(context) {
13
- const parameters = context.node.parameters;
14
- const metadata = context.node.metadata;
15
- const source = { ...(metadata ?? {}), ...parameters };
16
- return source;
17
- }
18
- /**
19
- * Executor for `core.flow.code` nodes.
20
- *
21
- * The Code Node runs user-authored JS/TS in a restricted sandbox. The engine
22
- * does not implement the sandbox directly (§22.4); instead it delegates to the
23
- * pluggable {@link CodeSandboxEvaluator} registered on the engine config. When
24
- * no evaluator is registered, the executor throws
25
- * `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`.
26
- *
27
- * The code is read from the `code` input port (spliced from
28
- * {@link CodeInputSchema}). The language is hardcoded to `"javascript"` for
29
- * now (the `language` field on `CodeInputSchema` has no `@input` so it is not
30
- * a port and not wired). The timeout is read from `graph.metadata.timeoutMs`.
31
- *
32
- * The sandbox context exposes:
33
- * - `$input` — the full input values object (all resolved port values).
34
- * - `$vars` — workflow variables (sourced from `context.metadata.vars`).
35
- * - `$item` / `$index` — current loop item and index.
36
- * - `$node` — outputs of upstream nodes.
37
- * - `$output` — the current draft output.
38
- *
39
- * The evaluator's return value is forwarded verbatim on the `result` output
40
- * port.
41
- */
42
- class CodeGraphNodeExecutor {
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
- this.engine = engine;
50
- }
51
- async execute(request, context) {
52
- const meta = readCodeMetadata(context);
53
- const input = request.inputs;
54
- const code = input["code"] ?? meta.defaultCode;
55
- if (!code || typeof code !== "string" || code.trim().length === 0) {
56
- throw new GraphInputError_js_1.GraphInputError("Code node has no code to execute (input.code is empty)", { input });
57
- }
58
- const evaluator = this.engine?.codeSandboxEvaluator;
59
- if (!evaluator) {
60
- throw new GraphExecutionError_js_1.GraphExecutionError("Code node execution requires a CodeSandboxEvaluator to be registered in GraphExecutionEngineConfig.codeSandboxEvaluator", "GRAPH_CODE_SANDBOX_NOT_CONFIGURED", { code });
61
- }
62
- const sandboxContext = this.buildSandboxContext(input, context);
63
- await context.log("Executing code node", {
64
- language: "javascript",
65
- length: code.length,
66
- timeoutMs: meta.timeoutMs,
67
- });
68
- const result = await evaluator.evaluate(sandboxContext);
69
- await context.log("Code node executed", { hasResult: result !== undefined });
70
- return { result };
71
- }
72
- /**
73
- * Builds the {@link CodeSandboxContext} from the executor input and the
74
- * graph execution context.
75
- *
76
- * The `$input` value is the full input values object so the code can access
77
- * every resolved port value (including `code` itself via `$input.code`).
78
- *
79
- * The `$vars`, `$item`, `$index`, `$node`, and `$output` values are sourced
80
- * from `context.metadata` — the engine (or a wrapping loop executor) may
81
- * populate these when the Code node runs inside a loop body or a workflow
82
- * with variables.
83
- */
84
- buildSandboxContext(input, context) {
85
- const md = context.metadata;
86
- const meta = readCodeMetadata(context);
87
- const code = input["code"] ?? meta.defaultCode ?? "";
88
- return {
89
- code,
90
- language: "javascript",
91
- input: input,
92
- vars: md?.vars ?? undefined,
93
- item: md?.item,
94
- index: md?.index,
95
- nodes: md?.nodes ??
96
- undefined,
97
- logger: context.logger,
98
- };
99
- }
100
- }
101
- exports.CodeGraphNodeExecutor = CodeGraphNodeExecutor;
102
- //# sourceMappingURL=CodeGraphNodeExecutor.js.map
103
- //# sourceMappingURL=CodeGraphNodeExecutor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph/engine/execution/CodeGraphNodeExecutor.cjs","sourceRoot":"","sources":["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OAAO,CAAC,CAAC;QAChE,MAAM,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE;YACrC,QAAQ,EAAE,YAAY;YACtB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,SAAS,EAAE,IAAI,CAAC,SAAS;SAC5B,CAAC,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QACxD,MAAM,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,SAAS,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC,CAAC;QAC7E,OAAO,EAAE,MAAM,EAAE,CAAC;IACtB,CAAC;IACD;;;;;;;;;;;OAWG;IACH,mBAAmB,CAAC,KAAK,EAAE,OAAO;QAC9B,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;QAC5B,MAAM,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;QACvC,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC;QACrD,OAAO;YACH,IAAI;YACJ,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,KAAK;YACZ,IAAI,EAAE,EAAE,EAAE,IAAI,IAAI,SAAS;YAC3B,IAAI,EAAE,EAAE,EAAE,IAAI;YACd,KAAK,EAAE,EAAE,EAAE,KAAK;YAChB,KAAK,EAAE,EAAE,EAAE,KAAK;gBACZ,SAAS;YACb,MAAM,EAAE,OAAO,CAAC,MAAM;SACzB,CAAC;IACN,CAAC;CACJ;AA1DD,sDA0DC;AACD,iDAAiD"}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LogGraphNodeExecutor = void 0;
4
- /**
5
- * Resolves the log level for a Log node execution.
6
- *
7
- * The level is read from the canonical node instance configuration
8
- * (`parameters.level`, with instance `metadata.level` as the legacy
9
- * fallback); defaults to `info` when unset.
10
- */
11
- function logLevelOf(context) {
12
- const parameters = context.node.parameters;
13
- const metadata = context.node.metadata;
14
- const candidate = (parameters.level ?? metadata?.["level"]);
15
- return candidate || "info";
16
- }
17
- /**
18
- * Executor for `core.utility.log` / `core.flow.log` nodes.
19
- *
20
- * Reads the `value` input port, logs it through `context.logger` at the
21
- * configured level, and returns it unchanged on the `logged` output port.
22
- */
23
- class LogGraphNodeExecutor {
24
- /**
25
- * Logs the `value` input through the run's `ctx.logger` and forwards it
26
- * unchanged on the `logged` output port.
27
- *
28
- * The level is read from the node's UI config (`node.props.level`, see
29
- * {@link logLevelOf}) and defaults to `info`. The emitted log line carries
30
- * the DECAF-48 run attributes and streams over `graph.run.log` through the
31
- * shared `ctx.logger` path (DECAF-48 Req-1).
32
- *
33
- * @param request - The node execution request (expects the `value` input).
34
- * @param context - The run-scoped execution context exposing `ctx.logger`.
35
- * @returns The node's output values keyed by port name (the `logged` port).
36
- */
37
- async execute(request, context) {
38
- const value = request.inputs["value"];
39
- const level = logLevelOf(context);
40
- const logger = context.logger;
41
- logger[level]("Log node", { value });
42
- return { logged: value };
43
- }
44
- }
45
- exports.LogGraphNodeExecutor = LogGraphNodeExecutor;
46
- //# sourceMappingURL=LogGraphNodeExecutor.js.map
47
- //# sourceMappingURL=LogGraphNodeExecutor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph/engine/execution/LogGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/LogGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,OAAO;IACvB,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,UAAU,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC5D,OAAO,SAAS,IAAI,MAAM,CAAC;AAC/B,CAAC;AACD;;;;;GAKG;AACH,MAAa,oBAAoB;IAC7B;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,OAAO;QAC1B,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;QAClC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IAC7B,CAAC;CACJ;AArBD,oDAqBC;AACD,gDAAgD"}
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SwitchGraphNodeExecutor = void 0;
4
- const GraphExecutionError_js_1 = require("./../errors/GraphExecutionError.cjs");
5
- const ConditionExpressionEvaluator_js_1 = require("./../loops/ConditionExpressionEvaluator.cjs");
6
- /**
7
- * Reads the Switch metadata from the canonical node instance (DECAF-50):
8
- * configuration lives in the instance `parameters` (`switch` key) with
9
- * instance `metadata` as the legacy fallback (the §4.18 transition compiler
10
- * mirrors legacy `graph.metadata.switch` into instance metadata). When
11
- * absent, falls back to an empty default with the `default` port enabled.
12
- */
13
- function readSwitchMetadata(context) {
14
- const parameters = context.node.parameters;
15
- const metadata = context.node.metadata;
16
- const raw = parameters["switch"] ?? metadata?.["switch"];
17
- const switchMeta = raw;
18
- if (!switchMeta || !Array.isArray(switchMeta.cases)) {
19
- return { cases: [], defaultPort: "default", hasDefault: false };
20
- }
21
- return {
22
- cases: switchMeta.cases,
23
- defaultPort: switchMeta.defaultPort ?? "default",
24
- hasDefault: switchMeta.hasDefault === true,
25
- };
26
- }
27
- /**
28
- * Detects whether a condition is a `CodeCondition` (has `type: "code"`).
29
- */
30
- function isCodeCondition(cond) {
31
- return (typeof cond === "object" &&
32
- cond !== null &&
33
- "type" in cond &&
34
- cond.type === "code");
35
- }
36
- /**
37
- * Detects whether a condition is a `ConditionExpression` (has `op` field).
38
- */
39
- function isConditionExpression(cond) {
40
- return (typeof cond === "object" &&
41
- cond !== null &&
42
- "op" in cond &&
43
- typeof cond.op === "string");
44
- }
45
- /**
46
- * Executor for `core.flow.switch` nodes.
47
- *
48
- * Evaluates each case's condition in order and routes the input to the
49
- * first matching case's output port. When no case matches:
50
- * - If `hasDefault` is `true`, routes to the `default` output port.
51
- * - If `hasDefault` is `false` (the default), throws `GRAPH_SWITCH_NO_MATCH`.
52
- *
53
- * Condition evaluation:
54
- * - `ConditionExpression` — evaluated via {@link ConditionExpressionEvaluator}.
55
- * - `CodeCondition` — evaluated via the pluggable {@link CodeSandboxEvaluator}
56
- * from the engine's config. Throws `GRAPH_CODE_SANDBOX_NOT_CONFIGURED`
57
- * when no evaluator is registered.
58
- */
59
- class SwitchGraphNodeExecutor {
60
- constructor(engine) {
61
- this.engine = engine;
62
- this.expressionEvaluator = new ConditionExpressionEvaluator_js_1.ConditionExpressionEvaluator();
63
- }
64
- async execute(request, context) {
65
- const meta = readSwitchMetadata(context);
66
- const input = request.inputs;
67
- const inputValue = input["value"] ?? input;
68
- for (const switchCase of meta.cases) {
69
- const matches = await this.evaluateCondition(switchCase.condition, inputValue, input, context);
70
- if (matches) {
71
- return { [switchCase.outputPort]: inputValue };
72
- }
73
- }
74
- // No case matched — route to the default port when it is enabled.
75
- if (meta.hasDefault !== true) {
76
- throw new GraphExecutionError_js_1.GraphExecutionError("No switch case matched and default port is not enabled", "GRAPH_SWITCH_NO_MATCH", { cases: meta.cases.map((c) => c.id) });
77
- }
78
- const defaultPort = meta.defaultPort ?? "default";
79
- return { [defaultPort]: inputValue };
80
- }
81
- /**
82
- * Evaluates a single switch case condition.
83
- */
84
- async evaluateCondition(condition, inputValue, fullInput, context) {
85
- if (isCodeCondition(condition)) {
86
- return this.evaluateCodeCondition(condition, fullInput, context);
87
- }
88
- if (isConditionExpression(condition)) {
89
- return this.expressionEvaluator.evaluate(condition, inputValue);
90
- }
91
- throw new GraphExecutionError_js_1.GraphExecutionError("Unknown switch case condition type — must be ConditionExpression (op) or CodeCondition (type: 'code')", "GRAPH_UNKNOWN_SWITCH_CONDITION", { condition });
92
- }
93
- /**
94
- * Evaluates a code condition via the pluggable sandbox evaluator.
95
- */
96
- async evaluateCodeCondition(condition, input, context) {
97
- const evaluator = this.engine?.codeSandboxEvaluator;
98
- if (!evaluator) {
99
- throw new GraphExecutionError_js_1.GraphExecutionError("Code conditions require a CodeSandboxEvaluator to be registered in GraphExecutionEngineConfig.codeSandboxEvaluator", "GRAPH_CODE_SANDBOX_NOT_CONFIGURED", { code: condition.code });
100
- }
101
- await context.log(`Evaluating code condition`, {
102
- language: condition.language ?? "javascript",
103
- });
104
- const md = context.metadata;
105
- const result = await evaluator.evaluate({
106
- code: condition.code,
107
- language: condition.language,
108
- input,
109
- vars: md?.vars ?? undefined,
110
- item: md?.item,
111
- index: md?.index,
112
- nodes: md?.nodes ??
113
- undefined,
114
- logger: context.logger,
115
- });
116
- return !!result;
117
- }
118
- }
119
- exports.SwitchGraphNodeExecutor = SwitchGraphNodeExecutor;
120
- //# sourceMappingURL=SwitchGraphNodeExecutor.js.map
121
- //# sourceMappingURL=SwitchGraphNodeExecutor.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"graph/engine/execution/SwitchGraphNodeExecutor.cjs","sourceRoot":"","sources":["graph/engine/execution/SwitchGraphNodeExecutor.js"],"names":[],"mappings":";;;AAAA,+EAAyE;AACzE,gGAA0F;AAC1F;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,OAAO;IAC/B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC;IACvC,MAAM,GAAG,GAAG,UAAU,CAAC,QAAQ,CAAC,IAA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