@decaf-ts/as-graph 0.2.1 → 0.5.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 (297) hide show
  1. package/README.md +274 -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/DagsterGraphQLClient.cjs +738 -0
  11. package/lib/cjs/dagster/DagsterGraphQLClient.cjs.map +1 -0
  12. package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
  13. package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
  14. package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
  15. package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
  16. package/lib/cjs/dagster/capabilities.cjs +102 -0
  17. package/lib/cjs/dagster/capabilities.cjs.map +1 -0
  18. package/lib/cjs/dagster/constants.cjs +92 -0
  19. package/lib/cjs/dagster/constants.cjs.map +1 -0
  20. package/lib/cjs/dagster/index.cjs +33 -0
  21. package/lib/cjs/dagster/index.cjs.map +1 -0
  22. package/lib/cjs/engine/constants.cjs +6 -1
  23. package/lib/cjs/engine/constants.cjs.map +1 -1
  24. package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
  25. package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
  26. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
  27. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
  28. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
  29. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
  30. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
  31. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  32. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
  33. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
  34. package/lib/cjs/engine/execution/index.cjs +4 -0
  35. package/lib/cjs/engine/execution/index.cjs.map +1 -1
  36. package/lib/cjs/engine/index.cjs +4 -0
  37. package/lib/cjs/engine/index.cjs.map +1 -1
  38. package/lib/cjs/engine/runs/GraphRunService.cjs +61 -0
  39. package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
  40. package/lib/cjs/engine/services/GraphWorkflowService.cjs +33 -14
  41. package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
  42. package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
  43. package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
  44. package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
  45. package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
  46. package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
  47. package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
  48. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
  49. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
  50. package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
  51. package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
  52. package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
  53. package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
  54. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
  55. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
  56. package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
  57. package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
  58. package/lib/cjs/mastra/index.cjs +35 -0
  59. package/lib/cjs/mastra/index.cjs.map +1 -0
  60. package/lib/cjs/mastra/types.cjs +34 -0
  61. package/lib/cjs/mastra/types.cjs.map +1 -0
  62. package/lib/cjs/nest/graph/GraphBackendHost.cjs +146 -0
  63. package/lib/cjs/nest/graph/GraphBackendHost.cjs.map +1 -0
  64. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
  65. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
  66. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
  67. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
  68. package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
  69. package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
  70. package/lib/cjs/nest/graph/GraphExecutionModule.cjs +31 -2
  71. package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
  72. package/lib/cjs/nest/graph/index.cjs +4 -0
  73. package/lib/cjs/nest/graph/index.cjs.map +1 -1
  74. package/lib/cjs/nest/graph/main.cjs +139 -0
  75. package/lib/cjs/nest/graph/main.cjs.map +1 -0
  76. package/lib/cjs/nest/graph/servingErrors.cjs +3 -0
  77. package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -1
  78. package/lib/cjs/node/utility/code/node.cjs +11 -3
  79. package/lib/cjs/node/utility/code/node.cjs.map +1 -1
  80. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
  81. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
  82. package/lib/cjs/shared/graph/constants.cjs +8 -0
  83. package/lib/cjs/shared/graph/constants.cjs.map +1 -1
  84. package/lib/cjs/shared/graph/index.cjs +2 -1
  85. package/lib/cjs/shared/graph/index.cjs.map +1 -1
  86. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
  87. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
  88. package/lib/cjs/shared/graph/layout/index.cjs +23 -0
  89. package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
  90. package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
  91. package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
  92. package/lib/cjs/shared/ui/index.cjs +8 -10
  93. package/lib/cjs/shared/ui/index.cjs.map +1 -1
  94. package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
  95. package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
  96. package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
  97. package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
  98. package/lib/esm/dagster/DagsterGraphQLClient.js +733 -0
  99. package/lib/esm/dagster/DagsterGraphQLClient.js.map +1 -0
  100. package/lib/esm/dagster/DagsterResultMapper.js +51 -0
  101. package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
  102. package/lib/esm/dagster/DagsterTypes.js +2 -0
  103. package/lib/esm/dagster/DagsterTypes.js.map +1 -0
  104. package/lib/esm/dagster/capabilities.js +97 -0
  105. package/lib/esm/dagster/capabilities.js.map +1 -0
  106. package/lib/esm/dagster/constants.js +88 -0
  107. package/lib/esm/dagster/constants.js.map +1 -0
  108. package/lib/esm/dagster/index.js +16 -0
  109. package/lib/esm/dagster/index.js.map +1 -0
  110. package/lib/esm/engine/constants.js +5 -0
  111. package/lib/esm/engine/constants.js.map +1 -1
  112. package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
  113. package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
  114. package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
  115. package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
  116. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
  117. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
  118. package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
  119. package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
  120. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
  121. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
  122. package/lib/esm/engine/execution/index.js +4 -0
  123. package/lib/esm/engine/execution/index.js.map +1 -1
  124. package/lib/esm/engine/index.js +4 -0
  125. package/lib/esm/engine/index.js.map +1 -1
  126. package/lib/esm/engine/runs/GraphRunService.js +62 -1
  127. package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
  128. package/lib/esm/engine/services/GraphWorkflowService.js +33 -14
  129. package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
  130. package/lib/esm/mastra/MastraCapabilities.js +164 -0
  131. package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
  132. package/lib/esm/mastra/MastraConditionBridge.js +34 -0
  133. package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
  134. package/lib/esm/mastra/MastraEventBridge.js +481 -0
  135. package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
  136. package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
  137. package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
  138. package/lib/esm/mastra/MastraResumeGuard.js +123 -0
  139. package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
  140. package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
  141. package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
  142. package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
  143. package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
  144. package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
  145. package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
  146. package/lib/esm/mastra/index.js +18 -0
  147. package/lib/esm/mastra/index.js.map +1 -0
  148. package/lib/esm/mastra/types.js +30 -0
  149. package/lib/esm/mastra/types.js.map +1 -0
  150. package/lib/esm/nest/graph/GraphBackendHost.js +138 -0
  151. package/lib/esm/nest/graph/GraphBackendHost.js.map +1 -0
  152. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
  153. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
  154. package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
  155. package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
  156. package/lib/esm/nest/graph/GraphEngineController.js +218 -0
  157. package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
  158. package/lib/esm/nest/graph/GraphExecutionModule.js +31 -2
  159. package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
  160. package/lib/esm/nest/graph/index.js +4 -0
  161. package/lib/esm/nest/graph/index.js.map +1 -1
  162. package/lib/esm/nest/graph/main.js +103 -0
  163. package/lib/esm/nest/graph/main.js.map +1 -0
  164. package/lib/esm/nest/graph/servingErrors.js +3 -0
  165. package/lib/esm/nest/graph/servingErrors.js.map +1 -1
  166. package/lib/esm/node/utility/code/node.js +11 -3
  167. package/lib/esm/node/utility/code/node.js.map +1 -1
  168. package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
  169. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
  170. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
  171. package/lib/esm/shared/graph/constants.js +8 -0
  172. package/lib/esm/shared/graph/constants.js.map +1 -1
  173. package/lib/esm/shared/graph/index.js +2 -1
  174. package/lib/esm/shared/graph/index.js.map +1 -1
  175. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
  176. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
  177. package/lib/esm/shared/graph/layout/index.js +6 -0
  178. package/lib/esm/shared/graph/layout/index.js.map +1 -0
  179. package/lib/esm/shared/graph/layout/layout-options.js +96 -0
  180. package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
  181. package/lib/esm/shared/ui/index.js +8 -10
  182. package/lib/esm/shared/ui/index.js.map +1 -1
  183. package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
  184. package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
  185. package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
  186. package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
  187. package/lib/types/dagster/DagsterGraphQLClient.d.cts +231 -0
  188. package/lib/types/dagster/DagsterGraphQLClient.d.mts +231 -0
  189. package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
  190. package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
  191. package/lib/types/dagster/DagsterTypes.d.cts +355 -0
  192. package/lib/types/dagster/DagsterTypes.d.mts +355 -0
  193. package/lib/types/dagster/capabilities.d.cts +34 -0
  194. package/lib/types/dagster/capabilities.d.mts +34 -0
  195. package/lib/types/dagster/constants.d.cts +87 -0
  196. package/lib/types/dagster/constants.d.mts +87 -0
  197. package/lib/types/dagster/index.d.cts +15 -0
  198. package/lib/types/dagster/index.d.mts +15 -0
  199. package/lib/types/engine/constants.d.cts +5 -0
  200. package/lib/types/engine/constants.d.mts +5 -0
  201. package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
  202. package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
  203. package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
  204. package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
  205. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
  206. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
  207. package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
  208. package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
  209. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
  210. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
  211. package/lib/types/engine/execution/index.d.cts +4 -0
  212. package/lib/types/engine/execution/index.d.mts +4 -0
  213. package/lib/types/engine/index.d.cts +4 -0
  214. package/lib/types/engine/index.d.mts +4 -0
  215. package/lib/types/engine/runs/GraphRunService.d.cts +19 -0
  216. package/lib/types/engine/runs/GraphRunService.d.mts +19 -0
  217. package/lib/types/engine/services/GraphWorkflowService.d.cts +22 -0
  218. package/lib/types/engine/services/GraphWorkflowService.d.mts +22 -0
  219. package/lib/types/mastra/MastraCapabilities.d.cts +86 -0
  220. package/lib/types/mastra/MastraCapabilities.d.mts +86 -0
  221. package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
  222. package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
  223. package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
  224. package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
  225. package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
  226. package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
  227. package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
  228. package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
  229. package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
  230. package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
  231. package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
  232. package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
  233. package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
  234. package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
  235. package/lib/types/mastra/index.d.cts +17 -0
  236. package/lib/types/mastra/index.d.mts +17 -0
  237. package/lib/types/mastra/types.d.cts +222 -0
  238. package/lib/types/mastra/types.d.mts +222 -0
  239. package/lib/types/nest/graph/GraphBackendHost.d.cts +100 -0
  240. package/lib/types/nest/graph/GraphBackendHost.d.mts +100 -0
  241. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
  242. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
  243. package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
  244. package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
  245. package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
  246. package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
  247. package/lib/types/nest/graph/GraphExecutionModule.d.cts +20 -0
  248. package/lib/types/nest/graph/GraphExecutionModule.d.mts +20 -0
  249. package/lib/types/nest/graph/index.d.cts +4 -0
  250. package/lib/types/nest/graph/index.d.mts +4 -0
  251. package/lib/types/nest/graph/main.d.cts +1 -0
  252. package/lib/types/nest/graph/main.d.mts +1 -0
  253. package/lib/types/nest/graph/servingErrors.d.cts +3 -1
  254. package/lib/types/nest/graph/servingErrors.d.mts +3 -1
  255. package/lib/types/node/utility/code/node.d.cts +1 -1
  256. package/lib/types/node/utility/code/node.d.mts +1 -1
  257. package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
  258. package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
  259. package/lib/types/shared/graph/constants.d.cts +8 -0
  260. package/lib/types/shared/graph/constants.d.mts +8 -0
  261. package/lib/types/shared/graph/index.d.cts +2 -1
  262. package/lib/types/shared/graph/index.d.mts +2 -1
  263. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
  264. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
  265. package/lib/types/shared/graph/layout/index.d.cts +5 -0
  266. package/lib/types/shared/graph/layout/index.d.mts +5 -0
  267. package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
  268. package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
  269. package/lib/types/shared/graph/types.d.cts +4 -3
  270. package/lib/types/shared/graph/types.d.mts +4 -3
  271. package/lib/types/shared/ui/index.d.cts +8 -10
  272. package/lib/types/shared/ui/index.d.mts +8 -10
  273. package/package.json +55 -6
  274. package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
  275. package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
  276. package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
  277. package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
  278. package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
  279. package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
  280. package/lib/cjs/shared/ui/types.cjs +0 -4
  281. package/lib/cjs/shared/ui/types.cjs.map +0 -1
  282. package/lib/esm/shared/ui/GraphNodeView.js +0 -107
  283. package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
  284. package/lib/esm/shared/ui/GraphRunView.js +0 -90
  285. package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
  286. package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
  287. package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
  288. package/lib/esm/shared/ui/types.js +0 -2
  289. package/lib/esm/shared/ui/types.js.map +0 -1
  290. package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
  291. package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
  292. package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
  293. package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
  294. package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
  295. package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
  296. package/lib/types/shared/ui/types.d.cts +0 -200
  297. package/lib/types/shared/ui/types.d.mts +0 -200
package/README.md CHANGED
@@ -148,6 +148,8 @@ npm install @decaf-ts/as-graph
148
148
  | `@decaf-ts/as-graph/shared` | UI-known contracts: `@node`/`@graph`/`@port` decorators, the canonical `GraphWorkflowDocument` and its builder/reader/serializer, manifest catalogue types, constants, and frontend-safe execution-state projections |
149
149
  | `@decaf-ts/as-graph/nest` | NestJS HTTP/SSE wiring: catalogue, workflow persistence and run-lifecycle controllers |
150
150
  | `@decaf-ts/as-graph/ram` | Adapter-backed persistence: `GraphRunModel`/`GraphRunEventModel`/`GraphValueModel` and their `@repository()` classes, the `RamGraphRunStore`/`RamGraphRunEventStore` stores, and the `createRamGraphAdapter` helper |
151
+ | `@decaf-ts/as-graph/mastra` | Mastra execution backend: `MastraGraphExecutionBackend`, the workflow compiler, condition/event bridges, schema converter, resume guard, and the Mastra capability table. Runs canonical documents on a host-injected `@mastra/core` runtime (pinned `1.74.0`) |
152
+ | `@decaf-ts/as-graph/dagster` | Dagster execution backend: `DagsterGraphExecutionBackend`, the workflow translator, event bridge, result mapper, capability table (`DAGSTER_CAPABILITY_TABLE`), and Dagster identifier/condition-grammar helpers. Driven through a host-injected `DagsterClient` port against the pinned engine contract (`1.13.25`; Dagster is Python-side, there is no JavaScript runtime dependency) |
151
153
 
152
154
  The `exports` map in `package.json` is:
153
155
 
@@ -173,6 +175,16 @@ The `exports` map in `package.json` is:
173
175
  "import": { "types": "./lib/types/ram/index.d.mts", "default": "./lib/esm/ram/index.js" },
174
176
  "require": { "types": "./lib/types/ram/index.d.cts", "default": "./lib/cjs/ram/index.cjs" },
175
177
  "default": "./lib/esm/ram/index.js"
178
+ },
179
+ "./mastra": {
180
+ "import": { "types": "./lib/types/mastra/index.d.mts", "default": "./lib/esm/mastra/index.js" },
181
+ "require": { "types": "./lib/types/mastra/index.d.cts", "default": "./lib/cjs/mastra/index.cjs" },
182
+ "default": "./lib/esm/mastra/index.js"
183
+ },
184
+ "./dagster": {
185
+ "import": { "types": "./lib/types/dagster/index.d.mts", "default": "./lib/esm/dagster/index.js" },
186
+ "require": { "types": "./lib/types/dagster/index.d.cts", "default": "./lib/cjs/dagster/index.cjs" },
187
+ "default": "./lib/esm/dagster/index.js"
176
188
  }
177
189
  }
178
190
  }
@@ -363,6 +375,113 @@ The engine emits structured events (workflow/node/edge lifecycle, visual state c
363
375
  channel) through Decaf's Observable pipeline. Register an observer with `engine.observe({ refresh })`.
364
376
  Pinnable nodes are cached and replayed with `engine.pinNode(...)` / `engine.unpinNode(...)`.
365
377
 
378
+ #### Execution backends
379
+
380
+ `GraphExecutionEngine` delegates actual execution to a pluggable
381
+ `GraphExecutionBackend` — the engine's analogue of Decaf's persistence `Adapter`
382
+ seam. The facade always owns validation, catalogue resolution, authorization,
383
+ planning, event sequencing, and observer dispatch; a backend only runs the
384
+ resolved plan and/or canonical document and reports every transition through the
385
+ facade-owned event sink. It can never bypass the pre-execution gate.
386
+
387
+ The default backend is a fresh `LocalGraphExecutionBackend` (flavour `local`, the
388
+ built-in reference interpreter) per engine: it executes in-process, runs code-mode
389
+ surfaces host-side through the configured `codeSandboxEvaluator`, and backs the
390
+ engine-agnostic workflow listing/lookup with the `workflowStore` port from the
391
+ engine config. Remote/translated backends are supplied through
392
+ `GraphExecutionEngineConfig.backend` (initialize the backend with its own host
393
+ config first — see below).
394
+
395
+ Registration and lookup mirror Decaf's persistence-adapter registry through the
396
+ static `GraphExecutionBackendRegistry`: `register(flavour, backend)` (the built-in
397
+ backends self-register under their flavour on construction), `get(flavour?)`,
398
+ `getOrFail(flavour)`, `setCurrent(flavour)` / `current` / `currentFlavour`,
399
+ `list()`, and `clear()` (test isolation). The current flavour is never changed
400
+ implicitly — hosts opt into a non-default backend explicitly, so concurrently
401
+ booted engines never share per-run state.
402
+
403
+ A backend declares its contract to the facade:
404
+
405
+ | Declaration | Meaning |
406
+ | --- | --- |
407
+ | `local` | Whether the backend executes in-process. |
408
+ | `codeMode` | `"hostSide"` (code-mode surfaces run through the facade-owned sandbox evaluator) or `"unsupported"`. The facade fails closed with `GRAPH_CODE_MODE_UNSUPPORTED_BACKEND` before delegating a code-mode workflow to any backend that is not local and not `"hostSide"`. |
409
+ | `capabilities` | Optional `GraphBackendCapabilities` (`codeMode` plus `workflows: { list, get }`). When omitted, the facade derives them from the declared `codeMode` and the presence of the optional `listWorkflows`/`getWorkflow` methods (`resolveGraphBackendCapabilities`), so an unsupported operation is reported as `not_supported` instead of silently returning an empty result. |
410
+ | optional methods | `listWorkflows` / `getWorkflow` (workflow catalogue seam), `cancel`, `resume`, `release`, `dispose`. |
411
+
412
+ Engine-level reads of the active backend: `engine.backend`,
413
+ `engine.backendCapabilities`, `engine.listWorkflows()` (active backend),
414
+ and the flavour-scoped `engine.listEngineWorkflows(flavour)` /
415
+ `engine.getEngineWorkflow(flavour, workflowId)` counterparts, which fail closed
416
+ with `GRAPH_EXECUTION_BACKEND_NOT_REGISTERED` (unknown flavour) or
417
+ `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` (no listing/lookup support).
418
+
419
+ ##### Mastra backend (`@decaf-ts/as-graph/mastra`)
420
+
421
+ `MastraGraphExecutionBackend` translates the canonical document into a Mastra
422
+ workflow, runs it on the injected `@mastra/core` runtime (pinned `1.74.0`),
423
+ bridges Mastra's `fullStream` onto the facade event sink, and enforces the
424
+ schema-safe resume guard on every resume payload. It reports `codeMode:
425
+ "unsupported"` (code-mode surfaces currently fail closed) and surfaces
426
+ `workflowList`/`workflowLookup` over its compiled-workflow cache. Its full
427
+ per-feature capability table (`MASTRA_FEATURE_CAPABILITIES`) declares, per
428
+ feature, `SUPPORTED` / `NOT_SUPPORTED` / `EXTENSION_POINT` / `PARTIAL` — e.g.
429
+ `whileUntil`, `foreach`, `humanApproval`, and `durableExecution` are supported;
430
+ `parallel` and `dynamicTopology` are not translated; `suspendResume` is an
431
+ extension point through the optional backend `resume?()`.
432
+
433
+ ```typescript
434
+ import { MastraGraphExecutionBackend } from "@decaf-ts/as-graph/mastra";
435
+
436
+ const backend = new MastraGraphExecutionBackend(); // self-registers under the "mastra" flavour
437
+ await backend.initialize({
438
+ mastra, // the host's @mastra/core runtime instance
439
+ agents, // optional agent map for agent/LLM nodes
440
+ stepHandlers, // optional MastraNodeStepHandler[] for custom node kinds
441
+ suspendStateReader, // optional, for suspend/resume runs
442
+ maxResumeBytes, // optional resume payload byte cap
443
+ });
444
+ // pass `backend` via GraphExecutionEngineConfig.backend
445
+ ```
446
+
447
+ The flavour constant is `MASTRA_BACKEND_FLAVOUR` (`"mastra"`); unsupported node
448
+ kinds and unsafe/invalid resume payloads fail loudly with
449
+ `GRAPH_MASTRA_UNSUPPORTED_KIND` / `GRAPH_MASTRA_RESUME_*` errors.
450
+
451
+ ##### Dagster backend (`@decaf-ts/as-graph/dagster`)
452
+
453
+ `DagsterGraphExecutionBackend` translates the canonical document into Dagster
454
+ job/schedule/sensor artifacts and dispatches execution through a host-injected
455
+ `DagsterClient` port — Dagster is a Python orchestration engine with no official
456
+ JavaScript runtime, so the client (and any op body for custom node kinds) is
457
+ always host-supplied. The pin recorded in the package is `1.13.25`
458
+ (`DAGSTER_PINNED_VERSION`, sourced from PyPI), which the generated artifacts
459
+ target. The backend reports `codeMode: "unsupported"` (code-mode workflows are
460
+ rejected before translation with `GRAPH_DAGSTER_CODE_MODE_UNSUPPORTED`), and
461
+ workflow listing/lookup is supported exactly when the wired client port exposes
462
+ `listJobs`/`getJob` (`dagsterBackendCapabilities(client)`).
463
+
464
+ The exported `DAGSTER_CAPABILITY_TABLE` declares, per feature, whether Dagster
465
+ supports it natively, not at all, or only through an extension point: sequential
466
+ nodes, `if`/`switch` routing, `foreach` (DynamicOut fan-out), schedule triggers,
467
+ and webhook/event/form/chat triggers (sensors) are supported; `while`/`until`
468
+ loops, suspend/resume, human approval, and code-mode surfaces are declared
469
+ `not_supported` so translation fails loudly rather than silently dropping them;
470
+ manual triggers and agent/custom node kinds are extension points
471
+ (`DagsterOpResolver` supplies the fixed op body; unmapped kinds fail loudly).
472
+
473
+ ```typescript
474
+ import { DagsterGraphExecutionBackend } from "@decaf-ts/as-graph/dagster";
475
+
476
+ const backend = new DagsterGraphExecutionBackend(); // self-registers under the "dagster" flavour
477
+ await backend.initialize({
478
+ client, // host-injected DagsterClient port (required)
479
+ opResolver, // optional DagsterOpResolver for non-built-in kinds
480
+ tags, // optional default run tags
481
+ });
482
+ // pass `backend` via GraphExecutionEngineConfig.backend
483
+ ```
484
+
366
485
  #### Persistence (`@decaf-ts/as-graph/ram`)
367
486
 
368
487
  Run lifecycle and cached/pinned-value persistence always flows through Decaf repositories over a
@@ -422,12 +541,48 @@ manifests, documents and engine run results into DOM-free render inputs.
422
541
  `GraphExecutionModule.forRoot(options)` wires the engine into a NestJS app: the node catalogue API
423
542
  (`GET /graph/node-types`, `GET /graph/node-types/:kind`, `POST /graph/node-types/:kind/resolve`), canonical
424
543
  workflow persistence (`PUT|GET /graph/workflows/:workflowId`, `GET /graph/workflows` ownership-filtered
425
- summaries, `POST /graph/workflows/validate`) and the asynchronous run lifecycle (`POST /graph/runs` → `202`,
544
+ summaries, `POST /graph/workflows/validate`), the asynchronous run lifecycle (`POST /graph/runs` → `202`,
426
545
  `GET /graph/workflows/:workflowId/runs` per-workflow run listing, `GET /graph/runs/:runId/events` SSE,
427
- `DELETE /graph/runs/:runId`).
546
+ `DELETE /graph/runs/:runId`), and the read-only engine capability API (`GET /graph/engines`,
547
+ `GET /graph/engines/:engineId`, `GET /graph/engines/:engineId/workflows`,
548
+ `GET /graph/engines/:engineId/workflows/:workflowId`).
428
549
  The engine provider is a Decaf `ClientBasedService`: the module constructs `new GraphExecutionEngine()`
429
550
  and initializes it with `await engine.boot(config)`.
430
551
 
552
+ The engine capability API serves a statically-derived, boot-time capability manifest
553
+ (`GraphEngineCapabilityService`): it is built once from the backends registered in the
554
+ `GraphExecutionBackendRegistry`, only allowlisted flavours (`local`, `mastra`, `dagster`) are advertised,
555
+ and no remote engine is ever probed. Every `detail` is a static, reviewed literal — no secrets and no
556
+ dynamic engine output. The manifest shape:
557
+
558
+ ```typescript
559
+ {
560
+ engines: [
561
+ {
562
+ engineId: "local", // backend flavour (allowlisted id)
563
+ displayName: "Local (built-in)",
564
+ local: true,
565
+ pinnedEngineVersion: "built-in", // "1.13.25" for dagster, "1.74.0" for mastra
566
+ capabilities: [
567
+ { feature: "codeMode", verdict: "SUPPORTED", detail?: "…" },
568
+ { feature: "workflowList", verdict: "NOT_SUPPORTED" },
569
+ // …
570
+ ],
571
+ },
572
+ // …
573
+ ],
574
+ defaultEngineId: "local",
575
+ }
576
+ ```
577
+
578
+ The three-value verdict vocabulary (`SUPPORTED` / `NOT_SUPPORTED` / `EXTENSION_POINT`) is normalized
579
+ from the wrapper capability tables, so a partially-supported feature is never advertised as a usable
580
+ toggle. The workflow listing/lookup routes resolve through the engine-agnostic facade
581
+ (`listEngineWorkflows` / `getEngineWorkflow`) and answer `404` for an unknown engine id and `501` when
582
+ the selected engine declares no listing/lookup support. Engines are selected by allowlisted id only and
583
+ routes never reflect arbitrary query input; authentication defaults to `"required"` (a request without
584
+ an authenticated owner user is rejected with `401`) and can be relaxed to `"optional"` per host.
585
+
431
586
  `GraphExecutionModuleOptions`:
432
587
 
433
588
  | Option | Meaning |
@@ -440,6 +595,7 @@ and initializes it with `await engine.boot(config)`.
440
595
  | `authGlobal` | When `true` (default when `authHandler` is set), the auth interceptor is registered globally; `false` installs the handler without a global interceptor (routes opt in with `@Auth()`) |
441
596
  | `authLogAccess` | When `true` (and `authHandler` is set), the handler emits OCSF-style access logs |
442
597
  | `catalogue` / `workflows` / `runs` | Per-API authentication enforcement plus backend-enforced rate limits (`resolve`/`methods`) and document/run resource limits |
598
+ | `engines` | Options for the engine capability HTTP API: `auth` (`"required"` default / `"optional"`), `defaultEngineId` (the advertised default; ignored when it is not a registered, allowlisted engine id — the current backend flavour is used instead), and `rateLimit` (`windowMs`/`maxRequests`, default 120 requests per 60-second window on the `engines` throttler bucket) |
443
599
 
444
600
  Without an `authHandler`, no auth middleware or interceptor is installed and graph auth requirements
445
601
  fail closed. The engine's `GraphAuthValidator` runs before any node executes: it validates the
@@ -464,11 +620,127 @@ import { KeycloakAuthHandler } from "@decaf-ts/integrations/nest";
464
620
  export class AppModule {}
465
621
  ```
466
622
 
623
+ #### Running each backend + UI combination
624
+
625
+ The standalone host (`bin.as-graph-server`, `lib/cjs/nest/graph/main.cjs`) boots exactly one engine
626
+ variant, selected by `GRAPH_BACKEND_ENGINE`, and serves the C20 capability manifest
627
+ (`GET /graph/engines`) plus the per-engine workflow catalogue
628
+ (`GET /graph/engines/{engineId}/workflows`). The for-angular graph page talks to it over
629
+ `http://localhost:3000` (`GRAPH_BACKEND_URL`) and needs no code change when the variant changes — it
630
+ lists whatever the backend advertises and gates its actions on the served capabilities.
631
+
632
+ **Build first.** The scripts run the compiled entrypoint, so `npm run build` (or `build:prod`) must
633
+ have produced `lib/cjs/nest/graph/main.cjs`.
634
+
635
+ | Combination | Boot the backend | Run the UI | Backend port | Extra prerequisites |
636
+ | --- | --- | --- | --- | --- |
637
+ | standard (local engine) | `npm run start:backend` / `start:backend:local` | `npm run start` (for-angular, `:8110`) | `3000` | none — built-in reference interpreter |
638
+ | mastra | `npm run start:backend:mastra` | `npm run start` (for-angular, `:8110`) | `3000` | `@mastra/core` peer installed (`^1.77.0`) |
639
+ | dagster | `npm run start:backend:dagster` | `npm run start` (for-angular, `:8110`) | `3000` | a Dagster gateway + `DAGSTER_GRAPHQL_URL` (see below) |
640
+
641
+ From `for-angular`, `npm run start:dev` (local), `start:dev:mastra`, and `start:dev:dagster` boot
642
+ the backend and the UI together with `concurrently`.
643
+
644
+ | Variable | Default | Meaning |
645
+ | --- | --- | --- |
646
+ | `GRAPH_BACKEND_ENGINE` | `local` | `local` \| `mastra` \| `dagster`; an unknown value fails closed with `GRAPH_BACKEND_ENGINE_UNKNOWN` |
647
+ | `GRAPH_BACKEND_PORT` | `3000` | Backend HTTP port (the standalone binary also accepts the port as its first argument) |
648
+ | `DAGSTER_GRAPHQL_URL` | unset | Read-only Dagster client target. Without it the dagster backend still boots and serves the manifest, but the catalogue reports `NOT_SUPPORTED` (`501`) |
649
+ | `DAGSTER_EXECUTION_ENABLED` | `false` | Opt-in gate for launching/replaying existing Dagster runs |
650
+ | `GRAPH_BACKEND_URL` | `http://localhost:3000` | for-angular injection token for the backend base URL (a provider override, not an env var) |
651
+
652
+ The host binds to `127.0.0.1` and only admits `http://localhost`/`http://127.0.0.1` CORS origins
653
+ (development posture, SAA-595 F5).
654
+
655
+ ##### Standard (local engine)
656
+
657
+ No backing service. Build the backend, boot it, and run the UI in a second terminal:
658
+
659
+ ```bash
660
+ # as-graph
661
+ npm run build && npm run start:backend # http://127.0.0.1:3000 (engine: local)
662
+ # for-angular
663
+ npm run start # http://localhost:8110
664
+ ```
665
+
666
+ Verify the backend advertises the local engine:
667
+
668
+ ```bash
669
+ curl -s http://127.0.0.1:3000/graph/engines # .defaultEngineId == "local"
670
+ ```
671
+
672
+ Open the graph route (`http://localhost:8110/graph`); the workflow table lists the workflows
673
+ persisted in the backend's local engine store.
674
+
675
+ ##### Mastra
676
+
677
+ In-process; the only prerequisite is the `@mastra/core` peer dependency (pinned `^1.77.0`),
678
+ resolved by `npm install` in `as-graph`. The host lazily builds a real `@mastra/core` runtime.
679
+
680
+ ```bash
681
+ npm run start:backend:mastra # engine: mastra, still on :3000
682
+ ```
683
+
684
+ The Mastra catalogue lists workflows already compiled/executed in the process (its
685
+ `workflowList`/`workflowLookup` capability), so `GET /graph/engines/mastra/workflows` returns `[]`
686
+ until a workflow is run. The manifest advertises the mastra engine and its per-feature verdicts.
687
+
688
+ ##### Dagster
689
+
690
+ Dagster is Python-side and has no JavaScript runtime, so the backend lists/executes through a
691
+ host-injected `DagsterClient` built from `DAGSTER_GRAPHQL_URL`. Provision the pinned gateway fixture
692
+ (Docker; Dagster `1.13.25`) with the integration harness:
693
+
694
+ ```bash
695
+ # as-graph: boot + seed the pinned gateway and persist its GraphQL URL
696
+ npm run prepare-it-tests # publishes the gateway at http://127.0.0.1:3300/graphql
697
+ DAGSTER_GRAPHQL_URL=http://127.0.0.1:3300/graphql npm run start:backend:dagster
698
+ npm run teardown-it-tests # when done
699
+ ```
700
+
701
+ Without `DAGSTER_GRAPHQL_URL` the dagster host still boots and serves the manifest; its catalogue
702
+ answers `501` (`NOT_SUPPORTED`). To run against an already-running Dagster, set
703
+ `DAGSTER_GRAPHQL_URL` yourself and skip `prepare-it-tests`.
704
+
705
+ > **Environment note (CI sandbox):** inside a container (`/.dockerenv`), the fixture joins the
706
+ > runner's network namespace and binds `127.0.0.1:3000`, which collides with the graph backend's
707
+ > default port. On a normal host the fixture is published at `127.0.0.1:3300`, so there is no
708
+ > collision. Because the for-angular UI is wired to `http://localhost:3000`, run the Dagster gateway
709
+ > on a host (or another namespace) and keep the graph backend on `3000` when exercising the UI +
710
+ > dagster combination.
711
+
712
+ ##### Verifying the UI lists a backend's scenarios
713
+
714
+ 1. `GET /graph/engines` returns the manifest with `defaultEngineId` equal to the booted variant.
715
+ 2. `GET /graph/engines/{engineId}/workflows` returns that engine's catalogue (`200`), or `501` when
716
+ the engine declares no listing support (dagster without a client).
717
+ 3. In the UI the workflow table shows the catalogue rows and gates create/run/save per the manifest
718
+ verdicts; switching variants requires no UI code change.
719
+
720
+ ##### Running each variant's test suite
721
+
722
+ | Variant | Command |
723
+ | --- | --- |
724
+ | standard (local) | `npm run test:integration:standard` |
725
+ | mastra | `npm run test:integration:mastra` |
726
+ | dagster | `npm run prepare-it-tests` then `npm run test:integration:dagster` (or `npm run teardown-it-tests` after) |
727
+ | backend host boot (all variants + standalone binary) | `npm run test:integration:backend` |
728
+
729
+ The dagster suite needs the gateway fixture (`prepare-it-tests`) and Docker; it skips honestly when
730
+ no gateway is prepared. The standalone-binary boot test needs the `lib/cjs` build and skips when it
731
+ is absent.
732
+
467
733
  #### Scripts
468
734
 
469
735
  | Script | Purpose |
470
736
  | --- | --- |
471
737
  | `npm run build` / `build:prod` | Compile ESM + CJS + types |
738
+ | `npm run start:backend` / `start:backend:local` | Boot the standalone host with the built-in local engine (`:3000`) |
739
+ | `npm run start:backend:mastra` | Boot the standalone host with the Mastra engine (`GRAPH_BACKEND_ENGINE=mastra`) |
740
+ | `npm run start:backend:dagster` | Boot the standalone host with the Dagster engine (`GRAPH_BACKEND_ENGINE=dagster`) |
741
+ | `npm run test:integration:standard` / `:mastra` / `:dagster` | Run one engine variant's integration suite |
742
+ | `npm run test:integration:backend` | Run the host-boot integration suite (all variants + standalone binary) |
743
+ | `npm run prepare-it-tests` / `teardown-it-tests` | Provision / stop the pinned Dagster gateway fixture |
472
744
  | `npm run test:unit` / `test:integration` / `test:e2e` | Run the Jest unit / integration / e2e suites |
473
745
  | `npm run test:all` | Run the entire Jest suite (unit, integration, e2e) |
474
746
  | `npm run test:dist` | Re-run the full suite against the compiled `lib` and `dist` outputs |