@decaf-ts/as-graph 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/README.md +160 -2
  2. package/dist/as-graph.cjs +1 -1
  3. package/dist/as-graph.cjs.map +1 -1
  4. package/dist/as-graph.js +1 -1
  5. package/dist/as-graph.js.map +1 -1
  6. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs +344 -0
  7. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs.map +1 -0
  8. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs +789 -0
  9. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs.map +1 -0
  10. package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
  11. package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
  12. package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
  13. package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
  14. package/lib/cjs/dagster/capabilities.cjs +102 -0
  15. package/lib/cjs/dagster/capabilities.cjs.map +1 -0
  16. package/lib/cjs/dagster/constants.cjs +92 -0
  17. package/lib/cjs/dagster/constants.cjs.map +1 -0
  18. package/lib/cjs/dagster/index.cjs +32 -0
  19. package/lib/cjs/dagster/index.cjs.map +1 -0
  20. package/lib/cjs/engine/constants.cjs +6 -1
  21. package/lib/cjs/engine/constants.cjs.map +1 -1
  22. package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
  23. package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
  24. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
  25. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
  26. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
  27. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
  28. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
  29. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  30. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
  31. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
  32. package/lib/cjs/engine/execution/index.cjs +4 -0
  33. package/lib/cjs/engine/execution/index.cjs.map +1 -1
  34. package/lib/cjs/engine/index.cjs +5 -0
  35. package/lib/cjs/engine/index.cjs.map +1 -1
  36. package/lib/cjs/engine/loops/ConditionEvaluator.cjs +116 -0
  37. package/lib/cjs/engine/loops/ConditionEvaluator.cjs.map +1 -0
  38. package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs +25 -2
  39. package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs.map +1 -1
  40. package/lib/cjs/engine/loops/index.cjs +1 -0
  41. package/lib/cjs/engine/loops/index.cjs.map +1 -1
  42. package/lib/cjs/engine/runs/GraphRunService.cjs +121 -3
  43. package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
  44. package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs +33 -0
  45. package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs.map +1 -1
  46. package/lib/cjs/engine/runs/ownership.cjs +100 -11
  47. package/lib/cjs/engine/runs/ownership.cjs.map +1 -1
  48. package/lib/cjs/engine/services/GraphRunModelService.cjs +16 -0
  49. package/lib/cjs/engine/services/GraphRunModelService.cjs.map +1 -1
  50. package/lib/cjs/engine/services/GraphWorkflowService.cjs +153 -16
  51. package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
  52. package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
  53. package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
  54. package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
  55. package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
  56. package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
  57. package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
  58. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
  59. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
  60. package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
  61. package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
  62. package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
  63. package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
  64. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
  65. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
  66. package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
  67. package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
  68. package/lib/cjs/mastra/index.cjs +35 -0
  69. package/lib/cjs/mastra/index.cjs.map +1 -0
  70. package/lib/cjs/mastra/types.cjs +34 -0
  71. package/lib/cjs/mastra/types.cjs.map +1 -0
  72. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
  73. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
  74. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
  75. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
  76. package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
  77. package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
  78. package/lib/cjs/nest/graph/GraphExecutionModule.cjs +30 -2
  79. package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
  80. package/lib/cjs/nest/graph/GraphRunController.cjs +208 -28
  81. package/lib/cjs/nest/graph/GraphRunController.cjs.map +1 -1
  82. package/lib/cjs/nest/graph/GraphWorkflowController.cjs +97 -14
  83. package/lib/cjs/nest/graph/GraphWorkflowController.cjs.map +1 -1
  84. package/lib/cjs/nest/graph/index.cjs +3 -0
  85. package/lib/cjs/nest/graph/index.cjs.map +1 -1
  86. package/lib/cjs/nest/graph/main.cjs +54 -0
  87. package/lib/cjs/nest/graph/main.cjs.map +1 -0
  88. package/lib/cjs/nest/graph/servingDates.cjs +53 -0
  89. package/lib/cjs/nest/graph/servingDates.cjs.map +1 -0
  90. package/lib/cjs/nest/graph/servingErrors.cjs +68 -0
  91. package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -0
  92. package/lib/cjs/node/flow/if/node.cjs +27 -9
  93. package/lib/cjs/node/flow/if/node.cjs.map +1 -1
  94. package/lib/cjs/node/flow/loop/until/node.cjs +5 -2
  95. package/lib/cjs/node/flow/loop/until/node.cjs.map +1 -1
  96. package/lib/cjs/node/flow/loop/while/node.cjs +8 -2
  97. package/lib/cjs/node/flow/loop/while/node.cjs.map +1 -1
  98. package/lib/cjs/node/flow/switch/node.cjs +2 -37
  99. package/lib/cjs/node/flow/switch/node.cjs.map +1 -1
  100. package/lib/cjs/node/utility/code/node.cjs +11 -3
  101. package/lib/cjs/node/utility/code/node.cjs.map +1 -1
  102. package/lib/cjs/ram/GraphRunStore.cjs +14 -0
  103. package/lib/cjs/ram/GraphRunStore.cjs.map +1 -1
  104. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
  105. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
  106. package/lib/cjs/shared/graph/constants.cjs +8 -0
  107. package/lib/cjs/shared/graph/constants.cjs.map +1 -1
  108. package/lib/cjs/shared/graph/index.cjs +2 -1
  109. package/lib/cjs/shared/graph/index.cjs.map +1 -1
  110. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
  111. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
  112. package/lib/cjs/shared/graph/layout/index.cjs +23 -0
  113. package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
  114. package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
  115. package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
  116. package/lib/cjs/shared/ui/index.cjs +8 -10
  117. package/lib/cjs/shared/ui/index.cjs.map +1 -1
  118. package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
  119. package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
  120. package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
  121. package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
  122. package/lib/esm/dagster/DagsterResultMapper.js +51 -0
  123. package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
  124. package/lib/esm/dagster/DagsterTypes.js +2 -0
  125. package/lib/esm/dagster/DagsterTypes.js.map +1 -0
  126. package/lib/esm/dagster/capabilities.js +97 -0
  127. package/lib/esm/dagster/capabilities.js.map +1 -0
  128. package/lib/esm/dagster/constants.js +88 -0
  129. package/lib/esm/dagster/constants.js.map +1 -0
  130. package/lib/esm/dagster/index.js +15 -0
  131. package/lib/esm/dagster/index.js.map +1 -0
  132. package/lib/esm/engine/constants.js +5 -0
  133. package/lib/esm/engine/constants.js.map +1 -1
  134. package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
  135. package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
  136. package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
  137. package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
  138. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
  139. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
  140. package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
  141. package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
  142. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
  143. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
  144. package/lib/esm/engine/execution/index.js +4 -0
  145. package/lib/esm/engine/execution/index.js.map +1 -1
  146. package/lib/esm/engine/index.js +5 -0
  147. package/lib/esm/engine/index.js.map +1 -1
  148. package/lib/esm/engine/loops/ConditionEvaluator.js +108 -0
  149. package/lib/esm/engine/loops/ConditionEvaluator.js.map +1 -0
  150. package/lib/esm/engine/loops/GraphConditionEvaluator.js +25 -2
  151. package/lib/esm/engine/loops/GraphConditionEvaluator.js.map +1 -1
  152. package/lib/esm/engine/loops/index.js +1 -0
  153. package/lib/esm/engine/loops/index.js.map +1 -1
  154. package/lib/esm/engine/runs/GraphRunService.js +123 -5
  155. package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
  156. package/lib/esm/engine/runs/InMemoryGraphRunStore.js +33 -0
  157. package/lib/esm/engine/runs/InMemoryGraphRunStore.js.map +1 -1
  158. package/lib/esm/engine/runs/ownership.js +97 -11
  159. package/lib/esm/engine/runs/ownership.js.map +1 -1
  160. package/lib/esm/engine/services/GraphRunModelService.js +16 -0
  161. package/lib/esm/engine/services/GraphRunModelService.js.map +1 -1
  162. package/lib/esm/engine/services/GraphWorkflowService.js +155 -18
  163. package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
  164. package/lib/esm/mastra/MastraCapabilities.js +164 -0
  165. package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
  166. package/lib/esm/mastra/MastraConditionBridge.js +34 -0
  167. package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
  168. package/lib/esm/mastra/MastraEventBridge.js +481 -0
  169. package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
  170. package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
  171. package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
  172. package/lib/esm/mastra/MastraResumeGuard.js +123 -0
  173. package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
  174. package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
  175. package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
  176. package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
  177. package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
  178. package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
  179. package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
  180. package/lib/esm/mastra/index.js +18 -0
  181. package/lib/esm/mastra/index.js.map +1 -0
  182. package/lib/esm/mastra/types.js +30 -0
  183. package/lib/esm/mastra/types.js.map +1 -0
  184. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
  185. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
  186. package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
  187. package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
  188. package/lib/esm/nest/graph/GraphEngineController.js +218 -0
  189. package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
  190. package/lib/esm/nest/graph/GraphExecutionModule.js +30 -2
  191. package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
  192. package/lib/esm/nest/graph/GraphRunController.js +209 -29
  193. package/lib/esm/nest/graph/GraphRunController.js.map +1 -1
  194. package/lib/esm/nest/graph/GraphWorkflowController.js +98 -15
  195. package/lib/esm/nest/graph/GraphWorkflowController.js.map +1 -1
  196. package/lib/esm/nest/graph/index.js +3 -0
  197. package/lib/esm/nest/graph/index.js.map +1 -1
  198. package/lib/esm/nest/graph/main.js +51 -0
  199. package/lib/esm/nest/graph/main.js.map +1 -0
  200. package/lib/esm/nest/graph/servingDates.js +49 -0
  201. package/lib/esm/nest/graph/servingDates.js.map +1 -0
  202. package/lib/esm/nest/graph/servingErrors.js +63 -0
  203. package/lib/esm/nest/graph/servingErrors.js.map +1 -0
  204. package/lib/esm/node/flow/if/node.js +27 -9
  205. package/lib/esm/node/flow/if/node.js.map +1 -1
  206. package/lib/esm/node/flow/loop/until/node.js +5 -2
  207. package/lib/esm/node/flow/loop/until/node.js.map +1 -1
  208. package/lib/esm/node/flow/loop/while/node.js +8 -2
  209. package/lib/esm/node/flow/loop/while/node.js.map +1 -1
  210. package/lib/esm/node/flow/switch/node.js +2 -37
  211. package/lib/esm/node/flow/switch/node.js.map +1 -1
  212. package/lib/esm/node/utility/code/node.js +11 -3
  213. package/lib/esm/node/utility/code/node.js.map +1 -1
  214. package/lib/esm/ram/GraphRunStore.js +14 -0
  215. package/lib/esm/ram/GraphRunStore.js.map +1 -1
  216. package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
  217. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
  218. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
  219. package/lib/esm/shared/graph/constants.js +8 -0
  220. package/lib/esm/shared/graph/constants.js.map +1 -1
  221. package/lib/esm/shared/graph/document/GraphFlowBuilder.js.map +1 -1
  222. package/lib/esm/shared/graph/index.js +2 -1
  223. package/lib/esm/shared/graph/index.js.map +1 -1
  224. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
  225. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
  226. package/lib/esm/shared/graph/layout/index.js +6 -0
  227. package/lib/esm/shared/graph/layout/index.js.map +1 -0
  228. package/lib/esm/shared/graph/layout/layout-options.js +96 -0
  229. package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
  230. package/lib/esm/shared/ui/index.js +8 -10
  231. package/lib/esm/shared/ui/index.js.map +1 -1
  232. package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
  233. package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
  234. package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
  235. package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
  236. package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
  237. package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
  238. package/lib/types/dagster/DagsterTypes.d.cts +355 -0
  239. package/lib/types/dagster/DagsterTypes.d.mts +355 -0
  240. package/lib/types/dagster/capabilities.d.cts +34 -0
  241. package/lib/types/dagster/capabilities.d.mts +34 -0
  242. package/lib/types/dagster/constants.d.cts +87 -0
  243. package/lib/types/dagster/constants.d.mts +87 -0
  244. package/lib/types/dagster/index.d.cts +14 -0
  245. package/lib/types/dagster/index.d.mts +14 -0
  246. package/lib/types/engine/constants.d.cts +5 -0
  247. package/lib/types/engine/constants.d.mts +5 -0
  248. package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
  249. package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
  250. package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
  251. package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
  252. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
  253. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
  254. package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
  255. package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
  256. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
  257. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
  258. package/lib/types/engine/execution/index.d.cts +4 -0
  259. package/lib/types/engine/execution/index.d.mts +4 -0
  260. package/lib/types/engine/index.d.cts +5 -0
  261. package/lib/types/engine/index.d.mts +5 -0
  262. package/lib/types/engine/loops/ConditionEvaluator.d.cts +87 -0
  263. package/lib/types/engine/loops/ConditionEvaluator.d.mts +87 -0
  264. package/lib/types/engine/loops/GraphConditionEvaluator.d.cts +27 -7
  265. package/lib/types/engine/loops/GraphConditionEvaluator.d.mts +27 -7
  266. package/lib/types/engine/loops/index.d.cts +1 -0
  267. package/lib/types/engine/loops/index.d.mts +1 -0
  268. package/lib/types/engine/runs/GraphRunService.d.cts +60 -1
  269. package/lib/types/engine/runs/GraphRunService.d.mts +60 -1
  270. package/lib/types/engine/runs/InMemoryGraphRunStore.d.cts +29 -0
  271. package/lib/types/engine/runs/InMemoryGraphRunStore.d.mts +29 -0
  272. package/lib/types/engine/runs/ownership.d.cts +89 -4
  273. package/lib/types/engine/runs/ownership.d.mts +89 -4
  274. package/lib/types/engine/runs/types.d.cts +12 -1
  275. package/lib/types/engine/runs/types.d.mts +12 -1
  276. package/lib/types/engine/services/GraphRunModelService.d.cts +13 -0
  277. package/lib/types/engine/services/GraphRunModelService.d.mts +13 -0
  278. package/lib/types/engine/services/GraphWorkflowService.d.cts +74 -2
  279. package/lib/types/engine/services/GraphWorkflowService.d.mts +74 -2
  280. package/lib/types/engine/types.d.cts +11 -4
  281. package/lib/types/engine/types.d.mts +11 -4
  282. package/lib/types/mastra/MastraCapabilities.d.cts +91 -0
  283. package/lib/types/mastra/MastraCapabilities.d.mts +91 -0
  284. package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
  285. package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
  286. package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
  287. package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
  288. package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
  289. package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
  290. package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
  291. package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
  292. package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
  293. package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
  294. package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
  295. package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
  296. package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
  297. package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
  298. package/lib/types/mastra/index.d.cts +17 -0
  299. package/lib/types/mastra/index.d.mts +17 -0
  300. package/lib/types/mastra/types.d.cts +222 -0
  301. package/lib/types/mastra/types.d.mts +222 -0
  302. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
  303. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
  304. package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
  305. package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
  306. package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
  307. package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
  308. package/lib/types/nest/graph/GraphExecutionModule.d.cts +14 -1
  309. package/lib/types/nest/graph/GraphExecutionModule.d.mts +14 -1
  310. package/lib/types/nest/graph/GraphRunController.d.cts +69 -14
  311. package/lib/types/nest/graph/GraphRunController.d.mts +69 -14
  312. package/lib/types/nest/graph/GraphWorkflowController.d.cts +50 -17
  313. package/lib/types/nest/graph/GraphWorkflowController.d.mts +50 -17
  314. package/lib/types/nest/graph/index.d.cts +3 -0
  315. package/lib/types/nest/graph/index.d.mts +3 -0
  316. package/lib/types/nest/graph/main.d.cts +1 -0
  317. package/lib/types/nest/graph/main.d.mts +1 -0
  318. package/lib/types/nest/graph/servingDates.d.cts +35 -0
  319. package/lib/types/nest/graph/servingDates.d.mts +35 -0
  320. package/lib/types/nest/graph/servingErrors.d.cts +44 -0
  321. package/lib/types/nest/graph/servingErrors.d.mts +44 -0
  322. package/lib/types/node/flow/if/node.d.cts +20 -8
  323. package/lib/types/node/flow/if/node.d.mts +20 -8
  324. package/lib/types/node/flow/loop/until/node.d.cts +4 -1
  325. package/lib/types/node/flow/loop/until/node.d.mts +4 -1
  326. package/lib/types/node/flow/loop/while/node.d.cts +4 -1
  327. package/lib/types/node/flow/loop/while/node.d.mts +4 -1
  328. package/lib/types/node/utility/code/node.d.cts +1 -1
  329. package/lib/types/node/utility/code/node.d.mts +1 -1
  330. package/lib/types/ram/GraphRunStore.d.cts +12 -0
  331. package/lib/types/ram/GraphRunStore.d.mts +12 -0
  332. package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
  333. package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
  334. package/lib/types/shared/graph/constants.d.cts +8 -0
  335. package/lib/types/shared/graph/constants.d.mts +8 -0
  336. package/lib/types/shared/graph/document/GraphFlowBuilder.d.cts +5 -5
  337. package/lib/types/shared/graph/document/GraphFlowBuilder.d.mts +5 -5
  338. package/lib/types/shared/graph/index.d.cts +2 -1
  339. package/lib/types/shared/graph/index.d.mts +2 -1
  340. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
  341. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
  342. package/lib/types/shared/graph/layout/index.d.cts +5 -0
  343. package/lib/types/shared/graph/layout/index.d.mts +5 -0
  344. package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
  345. package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
  346. package/lib/types/shared/graph/types.d.cts +12 -4
  347. package/lib/types/shared/graph/types.d.mts +12 -4
  348. package/lib/types/shared/ui/index.d.cts +8 -10
  349. package/lib/types/shared/ui/index.d.mts +8 -10
  350. package/package.json +49 -6
  351. package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
  352. package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
  353. package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
  354. package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
  355. package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
  356. package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
  357. package/lib/cjs/shared/ui/types.cjs +0 -4
  358. package/lib/cjs/shared/ui/types.cjs.map +0 -1
  359. package/lib/esm/shared/ui/GraphNodeView.js +0 -107
  360. package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
  361. package/lib/esm/shared/ui/GraphRunView.js +0 -90
  362. package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
  363. package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
  364. package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
  365. package/lib/esm/shared/ui/types.js +0 -2
  366. package/lib/esm/shared/ui/types.js.map +0 -1
  367. package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
  368. package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
  369. package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
  370. package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
  371. package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
  372. package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
  373. package/lib/types/shared/ui/types.d.cts +0 -200
  374. package/lib/types/shared/ui/types.d.mts +0 -200
@@ -5,7 +5,8 @@
5
5
  * (`GET /graph/runs/:runId`), cancels (`DELETE /graph/runs/:runId`), and
6
6
  * replays (`SSE /graph/runs/:runId/events`) graph runs on top of
7
7
  * {@link GraphRunService}, enforcing authentication, run limits, and
8
- * ownership; engine errors surface as `500` with their message while Nest
8
+ * ownership; unmapped engine errors surface as a constant generic `500`
9
+ * (the underlying error is logged server-side only) while Nest
9
10
  * {@link HttpException}s pass through unchanged.
10
11
  */
11
12
  import { MessageEvent } from "@nestjs/common";
@@ -15,38 +16,46 @@ import { DecafRequestContext } from "@decaf-ts/for-nest";
15
16
  import type { GraphRunLimits } from "../../shared/graph/index.d.mts";
16
17
  import type { GraphExecutionValues } from "../..//index.d.mts";
17
18
  import { GraphRunService } from "../..//index.d.mts";
19
+ import { GraphWorkflowService } from "../../engine/services/GraphWorkflowService.d.mts";
18
20
  /** DI token for {@link GraphRunControllerOptions}. */
19
21
  export declare const GRAPH_RUN_OPTIONS = "GRAPH_RUN_OPTIONS";
20
22
  /** Options for the run lifecycle HTTP API (DECAF-50 §4.14–§4.15): authentication mode and run limits. */
21
23
  export interface GraphRunControllerOptions {
22
24
  /**
23
25
  * Whether an authenticated request context is required (default
24
- * `"required"`, SAA-595 secure-defaults alignment). `"optional"` admits
25
- * anonymous requests for standalone module runs (DECAF-48 §4.15) — pair it
26
- * with an explicit `allowAnonymousAccess` decision.
26
+ * `"required"`, SAA-595 secure-defaults alignment). `"required"` rejects a
27
+ * request with no request context **and** a request whose context carries no
28
+ * resolved owner user with `401` (SAA-93 F2): in a host that installs the
29
+ * request-context machinery a context exists for every request, so gating on
30
+ * context existence alone would admit unauthenticated callers as anonymous.
31
+ * `"optional"` admits anonymous requests for standalone module runs
32
+ * (DECAF-48 §4.15) — pair it with an explicit `allowAnonymousAccess`
33
+ * decision on the run service options.
27
34
  */
28
35
  auth?: "required" | "optional";
29
- /**
30
- * Explicit DECAF-48 §4.15 standalone tolerance: when `true`, anonymous
31
- * callers are tolerated on owned runs. Defaults to `false` — ownership
32
- * checks fail closed for absent identities (SAA-595 F3).
33
- */
34
- allowAnonymousAccess?: boolean;
35
36
  /** Run limits forwarded to {@link GraphRunService}. */
36
37
  limits?: GraphRunLimits;
37
38
  }
38
39
  /** Response of `POST /graph/runs`: the queued run's identity and its event/result URLs. */
39
40
  export interface GraphRunCreatedResponse {
41
+ /** Queued run's id. */
40
42
  runId: string;
43
+ /** Id of the workflow the run executes. */
41
44
  workflowId: string;
45
+ /** Constant `"queued"`: the run is scheduled, not yet started. */
42
46
  status: "queued";
47
+ /** SSE stream URL for the run's event envelopes. */
43
48
  eventsUrl: string;
49
+ /** Read URL for the run's lifecycle state. */
44
50
  resultUrl: string;
45
51
  }
46
52
  /** Request body for creating a run: an inline workflow document or a saved `workflowId`, plus optional inputs. */
47
53
  export interface GraphRunRequestBody {
54
+ /** Inline workflow document to execute, when not referencing a saved workflow. */
48
55
  workflow?: GraphWorkflowDocument;
56
+ /** Saved workflow id to execute, when no inline document is provided. */
49
57
  workflowId?: string;
58
+ /** Optional execution inputs forwarded to the run. */
50
59
  inputs?: GraphExecutionValues;
51
60
  }
52
61
  /**
@@ -59,16 +68,24 @@ export interface GraphRunRequestBody {
59
68
  */
60
69
  export declare class GraphRunController {
61
70
  private readonly runService;
71
+ private readonly workflowService;
62
72
  private readonly requestContext?;
63
73
  private readonly options;
64
- constructor(runService: GraphRunService, requestContext?: DecafRequestContext | undefined, options?: GraphRunControllerOptions);
74
+ constructor(runService: GraphRunService, workflowService: GraphWorkflowService, requestContext?: DecafRequestContext | undefined, options?: GraphRunControllerOptions);
65
75
  /**
66
76
  * Enforces the configured authentication mode: `auth` defaults to
67
- * `"required"` (SAA-595 secure-defaults alignment) and rejects
68
- * unauthenticated calls with `401`; `"optional"` admits anonymous
69
- * requests for standalone module runs (DECAF-48 §4.15).
77
+ * `"required"` (SAA-595 secure-defaults alignment) and rejects a request
78
+ * with no request context, or with a context that carries no resolved owner
79
+ * user, with `401` (SAA-93 F2); `"optional"` admits anonymous requests
80
+ * for standalone module runs (DECAF-48 §4.15).
70
81
  */
71
82
  private requireAuthenticatedContext;
83
+ /**
84
+ * Resolves the requesting caller's identity from the injected request
85
+ * context via {@link graphWorkflowOwnerOf}; `null` for anonymous callers.
86
+ *
87
+ * @return {string | null} The authenticated owner user, or `null` when absent.
88
+ */
72
89
  private ownerUserOf;
73
90
  /**
74
91
  * Concurrency-bucket key for the per-caller run cap: the authenticated
@@ -87,9 +104,34 @@ export declare class GraphRunController {
87
104
  * else a single shared anonymous bucket (SAA-595 F4, SAA-1950 F7).
88
105
  */
89
106
  createRun(body: GraphRunRequestBody): Promise<GraphRunCreatedResponse>;
107
+ /**
108
+ * Lists a workflow's past runs, newest first (DECAF-50 §4.14).
109
+ *
110
+ * The workflow itself is access-checked first (unknown → `404`, foreign
111
+ * owner → `403`), then the persisted `GraphRunModel` rows for that workflow
112
+ * are ownership-filtered and returned as their JSON rows. Each row carries
113
+ * `runId`, `workflowId`, `owner`, `status`, `documentFingerprint`,
114
+ * `inputs`, `result`, `error`, `createdAt`, `updatedAt`, `startedAt` and
115
+ * `finishedAt` (dates as ISO strings; optional members are omitted when
116
+ * unset). The `inputs`/`result`/`error` payload members are served only
117
+ * for rows the caller owns (SAA-93 F1): a caller that may see an
118
+ * owner-less row by the documented owner-less visibility contract but does
119
+ * not own it receives the summary-only projection. Rows whose required
120
+ * dates cannot be projected are skipped per row (SAA-93 F4). Auth follows
121
+ * the controller's configured `auth` mode.
122
+ *
123
+ * @param {string} workflowId - Workflow id path parameter.
124
+ * @return {Promise<Array<Record<string, unknown>>>} The workflow's runs, newest first.
125
+ * @throws {HttpException} The mapped graph-run HTTP error (404 for unknown workflows/runs, 403 for foreign owners, 401 without an authenticated caller).
126
+ */
127
+ listRuns(workflowId: string): Promise<Record<string, unknown>[]>;
90
128
  /**
91
129
  * Reads a run and maps it to its HTTP representation.
92
130
  *
131
+ * The run's `result`/`error` payload is projected out for a caller that
132
+ * does not own the run (SAA-93 F1): the summary-only projection the list
133
+ * path applies cannot be bypassed by reading the run by id.
134
+ *
93
135
  * @param {string} runId - Run id path parameter.
94
136
  * @return {Promise<Record<string, unknown>>} The run's HTTP shape.
95
137
  * @throws {HttpException} The mapped graph-run HTTP error (404 for unknown runs, 403 for foreign owners).
@@ -108,11 +150,24 @@ export declare class GraphRunController {
108
150
  * `afterSequence`, then streams live events until the terminal event type
109
151
  * completes the stream.
110
152
  *
153
+ * SAA-93 F1: a caller that may see an owner-less run by the documented
154
+ * owner-less visibility contract but does not own it receives envelopes with
155
+ * the `payload`/`error` members projected out, matching the list and
156
+ * single-read projections.
157
+ *
111
158
  * @param {string} runId - Run id path parameter.
112
159
  * @param {string} [afterSequence] - Sequence number to replay events after.
113
160
  * @return {Promise<Observable<MessageEvent>>} The SSE event stream.
114
161
  * @throws {HttpException} The mapped graph-run HTTP error (404 for unknown runs, 403 for foreign owners).
115
162
  */
116
163
  events(runId: string, afterSequence?: string): Promise<Observable<MessageEvent>>;
164
+ /**
165
+ * Parses the SSE replay cursor: `0` for absent/empty values, otherwise the
166
+ * parsed non-negative integer.
167
+ *
168
+ * @param {string | undefined} afterSequence - Raw `afterSequence` query parameter.
169
+ * @return {number} The sequence number to replay events after.
170
+ * @throws {HttpException} `400` when the value is not a non-negative integer.
171
+ */
117
172
  private parseAfterSequence;
118
173
  }
@@ -8,19 +8,16 @@ export declare const GRAPH_WORKFLOW_OPTIONS = "GRAPH_WORKFLOW_OPTIONS";
8
8
  /** Options for the workflow persistence HTTP API (DECAF-50 §4.10): authentication mode and document resource limits. */
9
9
  export interface GraphWorkflowControllerOptions {
10
10
  /**
11
- * `"required"` rejects unauthenticated calls with `401` (default,
12
- * SAA-595 secure-defaults alignment); `"optional"` tolerates
13
- * anonymous/system callers for standalone module runs (DECAF-48 §4.15)
14
- * while still enforcing ownership between distinct users — pair it with an
15
- * explicit `allowAnonymousAccess` decision.
11
+ * `"required"` rejects a request with no request context **and** a request
12
+ * whose context carries no resolved owner user with `401` (SAA-93 F2): in a
13
+ * host that installs the request-context machinery a context exists for every
14
+ * request, so gating on context existence alone would admit unauthenticated
15
+ * callers as anonymous. `"optional"` tolerates anonymous/system callers for
16
+ * standalone module runs (DECAF-48 §4.15) while still enforcing ownership
17
+ * between distinct users — pair it with an explicit `allowAnonymousAccess`
18
+ * decision on the workflow service options.
16
19
  */
17
20
  auth?: "required" | "optional";
18
- /**
19
- * Explicit DECAF-48 §4.15 standalone tolerance: when `true`, anonymous
20
- * callers are tolerated on owned workflows. Defaults to `false` —
21
- * ownership checks fail closed for absent identities (SAA-595 F3).
22
- */
23
- allowAnonymousAccess?: boolean;
24
21
  /** Backend-enforced resource limits (DECAF-50 §4.16). */
25
22
  limits?: GraphWorkflowDocumentLimits;
26
23
  }
@@ -30,6 +27,15 @@ export interface GraphWorkflowSaveResponse {
30
27
  name?: string;
31
28
  savedAt: string;
32
29
  }
30
+ /** One row of `GET /graph/workflows`: the serving summary a workflow list binds to. */
31
+ export interface GraphWorkflowSummary {
32
+ /** Workflow document id (the persistence primary key). */
33
+ workflowId: string;
34
+ /** Display name mirrored from the document, when present. */
35
+ name?: string;
36
+ /** ISO timestamp of the last save/update. */
37
+ updatedAt: string;
38
+ }
33
39
  /**
34
40
  * Canonical workflow document persistence endpoints (DECAF-50 §4.10):
35
41
  *
@@ -40,9 +46,7 @@ export interface GraphWorkflowSaveResponse {
40
46
  * legacy persisted snapshots are converted losslessly on the read path.
41
47
  * - `POST /graph/workflows/validate` — run boundary validation and return
42
48
  * structured issues (`code`, `path`, `nodeId`, `edgeId`, `message`,
43
- * safe `details`).
44
- *
45
- * @class GraphWorkflowController
49
+ * safe `details`).
46
50
  */
47
51
  export declare class GraphWorkflowController {
48
52
  private readonly workflowService;
@@ -51,9 +55,10 @@ export declare class GraphWorkflowController {
51
55
  constructor(workflowService: GraphWorkflowService, requestContext?: DecafRequestContext | undefined, options?: GraphWorkflowControllerOptions);
52
56
  /**
53
57
  * Enforces the configured authentication mode: `auth` defaults to
54
- * `"required"` (SAA-595 secure-defaults alignment) and rejects
55
- * unauthenticated calls with `401`; `"optional"` admits anonymous
56
- * requests for standalone module runs (DECAF-48 §4.15).
58
+ * `"required"` (SAA-595 secure-defaults alignment) and rejects a request
59
+ * with no request context, or with a context that carries no resolved owner
60
+ * user, with `401` (SAA-93 F2); `"optional"` admits anonymous requests
61
+ * for standalone module runs (DECAF-48 §4.15).
57
62
  */
58
63
  private requireAuthenticatedContext;
59
64
  /**
@@ -67,6 +72,20 @@ export declare class GraphWorkflowController {
67
72
  * @throws {HttpException} The mapped graph-workflow HTTP error (400/403/409 per the service contract).
68
73
  */
69
74
  saveWorkflow(workflowId: string, body: unknown): Promise<GraphWorkflowSaveResponse>;
75
+ /**
76
+ * Lists the workflows visible to the requesting caller, newest update first.
77
+ *
78
+ * Auth follows the controller's configured `auth` mode (default `"required"`
79
+ * rejects anonymous calls with `401`). The collection is ownership-filtered
80
+ * by {@link GraphWorkflowService.listWorkflows}, so a caller only sees their
81
+ * own plus owner-less (system/standalone) workflows. A row whose `updatedAt`
82
+ * cannot be projected to an ISO string is skipped per row so a single corrupt
83
+ * persisted date never 500s the whole collection (SAA-93 F4).
84
+ *
85
+ * @return {Promise<GraphWorkflowSummary[]>} Visible workflow summaries, newest first.
86
+ * @throws {HttpException} 401 without an authenticated caller.
87
+ */
88
+ listWorkflows(): Promise<GraphWorkflowSummary[]>;
70
89
  /**
71
90
  * Returns a workflow's canonical document.
72
91
  *
@@ -83,6 +102,20 @@ export declare class GraphWorkflowController {
83
102
  * @throws {HttpException} 401 without an authenticated context.
84
103
  */
85
104
  validateWorkflow(body: unknown): Promise<GraphWorkflowValidationResult>;
105
+ /**
106
+ * Detects a canonical snapshot wrapper body (`{ document, ... }`): an
107
+ * object carrying a `document` member but no bare document `nodes` member.
108
+ *
109
+ * @param {unknown} body - The raw request body.
110
+ * @return {boolean} `true` when the body should be routed to {@link GraphWorkflowService.saveSnapshot}.
111
+ */
86
112
  private isCanonicalWrapper;
113
+ /**
114
+ * Extracts the bare {@link GraphWorkflowDocument} from a request body,
115
+ * unwrapping a canonical snapshot wrapper when present.
116
+ *
117
+ * @param {unknown} body - The raw request body.
118
+ * @return {GraphWorkflowDocument} The document to validate.
119
+ */
87
120
  private documentOf;
88
121
  }
@@ -8,19 +8,16 @@ export declare const GRAPH_WORKFLOW_OPTIONS = "GRAPH_WORKFLOW_OPTIONS";
8
8
  /** Options for the workflow persistence HTTP API (DECAF-50 §4.10): authentication mode and document resource limits. */
9
9
  export interface GraphWorkflowControllerOptions {
10
10
  /**
11
- * `"required"` rejects unauthenticated calls with `401` (default,
12
- * SAA-595 secure-defaults alignment); `"optional"` tolerates
13
- * anonymous/system callers for standalone module runs (DECAF-48 §4.15)
14
- * while still enforcing ownership between distinct users — pair it with an
15
- * explicit `allowAnonymousAccess` decision.
11
+ * `"required"` rejects a request with no request context **and** a request
12
+ * whose context carries no resolved owner user with `401` (SAA-93 F2): in a
13
+ * host that installs the request-context machinery a context exists for every
14
+ * request, so gating on context existence alone would admit unauthenticated
15
+ * callers as anonymous. `"optional"` tolerates anonymous/system callers for
16
+ * standalone module runs (DECAF-48 §4.15) while still enforcing ownership
17
+ * between distinct users — pair it with an explicit `allowAnonymousAccess`
18
+ * decision on the workflow service options.
16
19
  */
17
20
  auth?: "required" | "optional";
18
- /**
19
- * Explicit DECAF-48 §4.15 standalone tolerance: when `true`, anonymous
20
- * callers are tolerated on owned workflows. Defaults to `false` —
21
- * ownership checks fail closed for absent identities (SAA-595 F3).
22
- */
23
- allowAnonymousAccess?: boolean;
24
21
  /** Backend-enforced resource limits (DECAF-50 §4.16). */
25
22
  limits?: GraphWorkflowDocumentLimits;
26
23
  }
@@ -30,6 +27,15 @@ export interface GraphWorkflowSaveResponse {
30
27
  name?: string;
31
28
  savedAt: string;
32
29
  }
30
+ /** One row of `GET /graph/workflows`: the serving summary a workflow list binds to. */
31
+ export interface GraphWorkflowSummary {
32
+ /** Workflow document id (the persistence primary key). */
33
+ workflowId: string;
34
+ /** Display name mirrored from the document, when present. */
35
+ name?: string;
36
+ /** ISO timestamp of the last save/update. */
37
+ updatedAt: string;
38
+ }
33
39
  /**
34
40
  * Canonical workflow document persistence endpoints (DECAF-50 §4.10):
35
41
  *
@@ -40,9 +46,7 @@ export interface GraphWorkflowSaveResponse {
40
46
  * legacy persisted snapshots are converted losslessly on the read path.
41
47
  * - `POST /graph/workflows/validate` — run boundary validation and return
42
48
  * structured issues (`code`, `path`, `nodeId`, `edgeId`, `message`,
43
- * safe `details`).
44
- *
45
- * @class GraphWorkflowController
49
+ * safe `details`).
46
50
  */
47
51
  export declare class GraphWorkflowController {
48
52
  private readonly workflowService;
@@ -51,9 +55,10 @@ export declare class GraphWorkflowController {
51
55
  constructor(workflowService: GraphWorkflowService, requestContext?: DecafRequestContext | undefined, options?: GraphWorkflowControllerOptions);
52
56
  /**
53
57
  * Enforces the configured authentication mode: `auth` defaults to
54
- * `"required"` (SAA-595 secure-defaults alignment) and rejects
55
- * unauthenticated calls with `401`; `"optional"` admits anonymous
56
- * requests for standalone module runs (DECAF-48 §4.15).
58
+ * `"required"` (SAA-595 secure-defaults alignment) and rejects a request
59
+ * with no request context, or with a context that carries no resolved owner
60
+ * user, with `401` (SAA-93 F2); `"optional"` admits anonymous requests
61
+ * for standalone module runs (DECAF-48 §4.15).
57
62
  */
58
63
  private requireAuthenticatedContext;
59
64
  /**
@@ -67,6 +72,20 @@ export declare class GraphWorkflowController {
67
72
  * @throws {HttpException} The mapped graph-workflow HTTP error (400/403/409 per the service contract).
68
73
  */
69
74
  saveWorkflow(workflowId: string, body: unknown): Promise<GraphWorkflowSaveResponse>;
75
+ /**
76
+ * Lists the workflows visible to the requesting caller, newest update first.
77
+ *
78
+ * Auth follows the controller's configured `auth` mode (default `"required"`
79
+ * rejects anonymous calls with `401`). The collection is ownership-filtered
80
+ * by {@link GraphWorkflowService.listWorkflows}, so a caller only sees their
81
+ * own plus owner-less (system/standalone) workflows. A row whose `updatedAt`
82
+ * cannot be projected to an ISO string is skipped per row so a single corrupt
83
+ * persisted date never 500s the whole collection (SAA-93 F4).
84
+ *
85
+ * @return {Promise<GraphWorkflowSummary[]>} Visible workflow summaries, newest first.
86
+ * @throws {HttpException} 401 without an authenticated caller.
87
+ */
88
+ listWorkflows(): Promise<GraphWorkflowSummary[]>;
70
89
  /**
71
90
  * Returns a workflow's canonical document.
72
91
  *
@@ -83,6 +102,20 @@ export declare class GraphWorkflowController {
83
102
  * @throws {HttpException} 401 without an authenticated context.
84
103
  */
85
104
  validateWorkflow(body: unknown): Promise<GraphWorkflowValidationResult>;
105
+ /**
106
+ * Detects a canonical snapshot wrapper body (`{ document, ... }`): an
107
+ * object carrying a `document` member but no bare document `nodes` member.
108
+ *
109
+ * @param {unknown} body - The raw request body.
110
+ * @return {boolean} `true` when the body should be routed to {@link GraphWorkflowService.saveSnapshot}.
111
+ */
86
112
  private isCanonicalWrapper;
113
+ /**
114
+ * Extracts the bare {@link GraphWorkflowDocument} from a request body,
115
+ * unwrapping a canonical snapshot wrapper when present.
116
+ *
117
+ * @param {unknown} body - The raw request body.
118
+ * @return {GraphWorkflowDocument} The document to validate.
119
+ */
87
120
  private documentOf;
88
121
  }
@@ -9,4 +9,7 @@ export * from "./GraphWorkflowController.d.cts";
9
9
  export * from "./GraphRunController.d.cts";
10
10
  export * from "./GraphExecutorRegistryFactory.d.cts";
11
11
  export * from "./GraphNodeCatalogueController.d.cts";
12
+ export * from "./GraphEngineCapabilityManifest.d.cts";
13
+ export * from "./GraphEngineCapabilityService.d.cts";
14
+ export * from "./GraphEngineController.d.cts";
12
15
  export * from "./GraphExecutionModule.d.cts";
@@ -9,4 +9,7 @@ export * from "./GraphWorkflowController.d.mts";
9
9
  export * from "./GraphRunController.d.mts";
10
10
  export * from "./GraphExecutorRegistryFactory.d.mts";
11
11
  export * from "./GraphNodeCatalogueController.d.mts";
12
+ export * from "./GraphEngineCapabilityManifest.d.mts";
13
+ export * from "./GraphEngineCapabilityService.d.mts";
14
+ export * from "./GraphEngineController.d.mts";
12
15
  export * from "./GraphExecutionModule.d.mts";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @module as-graph/nest/graph/servingDates
3
+ * @summary HTTP-boundary date projection for the graph serving endpoints.
4
+ * @description Projects the `Date` values stored on persisted
5
+ * {@link GraphWorkflowModel} / {@link GraphRunModel} rows to true ISO-8601
6
+ * strings at the HTTP boundary, so every served date is unambiguously
7
+ * machine-readable regardless of the Decaf date format configured on the
8
+ * models (`@date`/`@timestamp` bind a proxy that renders `dd/MM/yyyy
9
+ * HH:mm:ss:S`).
10
+ */
11
+ /**
12
+ * Converts a persisted `Date` to its ISO-8601 string form (`2026-01-01T12:00:00.000Z`).
13
+ *
14
+ * Used by the serving controllers when projecting persisted rows to their HTTP
15
+ * shape (workflow save/list summaries and run rows), so clients never receive a
16
+ * locale-bound Decaf date rendering. The value is round-tripped through
17
+ * `new Date(value.getTime())` to normalize anything proxy- or model-bound into
18
+ * a plain `Date` before formatting.
19
+ *
20
+ * A corrupt persisted date (`Invalid Date` / non-finite time) returns `undefined`
21
+ * instead of throwing (SAA-93 F4): one bad row must not 500 the whole
22
+ * collection. Callers either omit the optional member or skip the row when a
23
+ * required date is unprojectable.
24
+ *
25
+ * @param {Date | null | undefined} value - The persisted date, or `null`/`undefined` when the member is unset.
26
+ * @return {string | undefined} The ISO-8601 string, or `undefined` when no date was given or the date is invalid.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * toIsoDateString(new Date("2026-01-01T12:00:00Z")); // "2026-01-01T12:00:00.000Z"
31
+ * toIsoDateString(null); // undefined
32
+ * toIsoDateString(new Date("nope")); // undefined (corrupt persisted date)
33
+ * ```
34
+ */
35
+ export declare function toIsoDateString(value: Date | null | undefined): string | undefined;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @module as-graph/nest/graph/servingDates
3
+ * @summary HTTP-boundary date projection for the graph serving endpoints.
4
+ * @description Projects the `Date` values stored on persisted
5
+ * {@link GraphWorkflowModel} / {@link GraphRunModel} rows to true ISO-8601
6
+ * strings at the HTTP boundary, so every served date is unambiguously
7
+ * machine-readable regardless of the Decaf date format configured on the
8
+ * models (`@date`/`@timestamp` bind a proxy that renders `dd/MM/yyyy
9
+ * HH:mm:ss:S`).
10
+ */
11
+ /**
12
+ * Converts a persisted `Date` to its ISO-8601 string form (`2026-01-01T12:00:00.000Z`).
13
+ *
14
+ * Used by the serving controllers when projecting persisted rows to their HTTP
15
+ * shape (workflow save/list summaries and run rows), so clients never receive a
16
+ * locale-bound Decaf date rendering. The value is round-tripped through
17
+ * `new Date(value.getTime())` to normalize anything proxy- or model-bound into
18
+ * a plain `Date` before formatting.
19
+ *
20
+ * A corrupt persisted date (`Invalid Date` / non-finite time) returns `undefined`
21
+ * instead of throwing (SAA-93 F4): one bad row must not 500 the whole
22
+ * collection. Callers either omit the optional member or skip the row when a
23
+ * required date is unprojectable.
24
+ *
25
+ * @param {Date | null | undefined} value - The persisted date, or `null`/`undefined` when the member is unset.
26
+ * @return {string | undefined} The ISO-8601 string, or `undefined` when no date was given or the date is invalid.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * toIsoDateString(new Date("2026-01-01T12:00:00Z")); // "2026-01-01T12:00:00.000Z"
31
+ * toIsoDateString(null); // undefined
32
+ * toIsoDateString(new Date("nope")); // undefined (corrupt persisted date)
33
+ * ```
34
+ */
35
+ export declare function toIsoDateString(value: Date | null | undefined): string | undefined;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Constant generic `500` body served for any unmapped graph serving failure.
3
+ * Deliberately static: no dynamic content, no `e.message`, no `String(e)`.
4
+ */
5
+ export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
6
+ /** Logger context for the run lifecycle controller's server-side error log. */
7
+ export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController" | "GraphEngineController";
8
+ /**
9
+ * Request/run correlation fields attached to a server-side graph serving error
10
+ * log. Only ids the server already resolved are included; the fields are never
11
+ * served to the client.
12
+ */
13
+ export interface GraphServingErrorCorrelation {
14
+ /** Run id, when the failing operation was scoped to a run. */
15
+ runId?: string;
16
+ /** Workflow id, when the failing operation was scoped to a workflow. */
17
+ workflowId?: string;
18
+ /** Engine id, when the failing operation was scoped to an engine. */
19
+ engineId?: string;
20
+ }
21
+ /**
22
+ * Logs an unmapped graph serving failure server-side, with the request
23
+ * correlation ids and the underlying error message/stack. The client receives the
24
+ * constant generic {@link GRAPH_SERVING_INTERNAL_ERROR_MESSAGE} instead; this log
25
+ * is the only place the underlying error detail is surfaced.
26
+ *
27
+ * The correlation ids are serialized directly into the log message (via
28
+ * `JSON.stringify`) rather than relying solely on the logger's `meta` channel. The
29
+ * default RAW log pattern has no `{meta}` placeholder, so a `meta`-only
30
+ * correlation would never render under default text logging; inlining it keeps the
31
+ * ids visible under any renderer, and JSON escaping preserves the no-log-injection
32
+ * property.
33
+ *
34
+ * The whole body is guarded so a hostile thrown value (e.g. a throwing `toString`
35
+ * on the caught value) or a logging-infrastructure failure can never make this
36
+ * mapper throw; failures are swallowed because Nest's default handler still answers
37
+ * the constant generic `500` fail-securely.
38
+ *
39
+ * @param {GraphServingErrorLoggerContext} context - Logger context for the controller handling the failure.
40
+ * @param {unknown} e - The caught error that was not mapped to a specific HTTP status.
41
+ * @param {GraphServingErrorCorrelation} correlation - Request correlation ids, when known.
42
+ * @return {void}
43
+ */
44
+ export declare function logUnmappedGraphServingError(context: GraphServingErrorLoggerContext, e: unknown, correlation?: GraphServingErrorCorrelation): void;
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Constant generic `500` body served for any unmapped graph serving failure.
3
+ * Deliberately static: no dynamic content, no `e.message`, no `String(e)`.
4
+ */
5
+ export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
6
+ /** Logger context for the run lifecycle controller's server-side error log. */
7
+ export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController" | "GraphEngineController";
8
+ /**
9
+ * Request/run correlation fields attached to a server-side graph serving error
10
+ * log. Only ids the server already resolved are included; the fields are never
11
+ * served to the client.
12
+ */
13
+ export interface GraphServingErrorCorrelation {
14
+ /** Run id, when the failing operation was scoped to a run. */
15
+ runId?: string;
16
+ /** Workflow id, when the failing operation was scoped to a workflow. */
17
+ workflowId?: string;
18
+ /** Engine id, when the failing operation was scoped to an engine. */
19
+ engineId?: string;
20
+ }
21
+ /**
22
+ * Logs an unmapped graph serving failure server-side, with the request
23
+ * correlation ids and the underlying error message/stack. The client receives the
24
+ * constant generic {@link GRAPH_SERVING_INTERNAL_ERROR_MESSAGE} instead; this log
25
+ * is the only place the underlying error detail is surfaced.
26
+ *
27
+ * The correlation ids are serialized directly into the log message (via
28
+ * `JSON.stringify`) rather than relying solely on the logger's `meta` channel. The
29
+ * default RAW log pattern has no `{meta}` placeholder, so a `meta`-only
30
+ * correlation would never render under default text logging; inlining it keeps the
31
+ * ids visible under any renderer, and JSON escaping preserves the no-log-injection
32
+ * property.
33
+ *
34
+ * The whole body is guarded so a hostile thrown value (e.g. a throwing `toString`
35
+ * on the caught value) or a logging-infrastructure failure can never make this
36
+ * mapper throw; failures are swallowed because Nest's default handler still answers
37
+ * the constant generic `500` fail-securely.
38
+ *
39
+ * @param {GraphServingErrorLoggerContext} context - Logger context for the controller handling the failure.
40
+ * @param {unknown} e - The caught error that was not mapped to a specific HTTP status.
41
+ * @param {GraphServingErrorCorrelation} correlation - Request correlation ids, when known.
42
+ * @return {void}
43
+ */
44
+ export declare function logUnmappedGraphServingError(context: GraphServingErrorLoggerContext, e: unknown, correlation?: GraphServingErrorCorrelation): void;
@@ -1,6 +1,7 @@
1
- import type { ConditionExpression } from "../../../shared/graph/index.d.cts";
1
+ import type { Condition } from "../../../shared/graph/index.d.cts";
2
2
  import { GraphNode } from "../../base.d.cts";
3
3
  import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../../engine/types.d.cts";
4
+ import type { GraphExecutionContext } from "../../../engine/execution/GraphExecutionContext.d.cts";
4
5
  /** Inputs accepted by the if node. */
5
6
  export type IfFlowInput = Record<string, unknown>;
6
7
  /** Outputs produced by the if node. */
@@ -14,21 +15,32 @@ export interface IfFlowOutput {
14
15
  */
15
16
  export declare class IfFlowNode extends GraphNode<IfFlowInput, IfFlowOutput> {
16
17
  /**
17
- * Evaluates the configured `ConditionExpression` against the resolved
18
- * condition state and routes the input value to `then` or `else`; throws
19
- * when the condition is false and the `else` branch is disabled.
18
+ * Evaluates the configured `Condition` against the resolved condition state
19
+ * and routes the input value to `then` or `else`; throws when the condition
20
+ * is false and the `else` branch is disabled. A `CodeCondition` is dispatched
21
+ * through the registered `CodeSandboxEvaluator`, mirroring the switch node.
22
+ *
23
+ * Graphical conditions evaluate synchronously so the existing synchronous
24
+ * `GRAPH_IF_NO_CONDITION` / `GRAPH_IF_ELSE_DISABLED` throw contract is
25
+ * preserved; only code conditions return a promise.
20
26
  *
21
27
  * @param {GraphNodeExecutionRequest<IfFlowInput>} request - Execution request carrying the `value` input.
22
- * @return {GraphExecutionValues} The routed input value under `then` or `else`.
28
+ * @param {GraphExecutionContext} context - Execution context providing run metadata and the sandbox evaluator for code conditions.
29
+ * @return {GraphExecutionValues | Promise<GraphExecutionValues>} The routed input value under `then` or `else`.
23
30
  * @throws {GraphExecutionError} When no condition is configured (`GRAPH_IF_NO_CONDITION`) or when the condition is false with `else` disabled (`GRAPH_IF_ELSE_DISABLED`).
24
31
  */
25
- execute(request: GraphNodeExecutionRequest<IfFlowInput>): GraphExecutionValues;
32
+ execute(request: GraphNodeExecutionRequest<IfFlowInput>, context: GraphExecutionContext): GraphExecutionValues | Promise<GraphExecutionValues>;
33
+ /**
34
+ * Routes the input value to `then`/`else`, throwing when the condition is
35
+ * false and the `else` branch is disabled.
36
+ */
37
+ private route;
26
38
  /** Primary input value routed to the `then` or `else` output. */
27
39
  value: unknown;
28
40
  /** Output carrying the input value when the condition evaluates truthy. */
29
41
  then: unknown;
30
- /** Condition expression (§22.3) evaluated against the resolved condition state. */
31
- condition?: ConditionExpression;
42
+ /** Condition (§22.3 graphical or §22.4 code) evaluated against the resolved condition state. */
43
+ condition?: Condition;
32
44
  /** Enables the `else` output branch; when false, a failed condition throws. */
33
45
  else?: boolean;
34
46
  }