@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
@@ -0,0 +1,401 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MastraWorkflowManager = void 0;
4
+ const GraphExecutionError_js_1 = require("./../engine/errors/GraphExecutionError.cjs");
5
+ const GraphRunFingerprint_js_1 = require("./../engine/runs/GraphRunFingerprint.cjs");
6
+ const ownership_js_1 = require("./../engine/runs/ownership.cjs");
7
+ const GraphWorkflowService_js_1 = require("./../engine/services/GraphWorkflowService.cjs");
8
+ const MastraWorkflowCompiler_js_1 = require("./MastraWorkflowCompiler.cjs");
9
+ const types_js_1 = require("./types.cjs");
10
+ /**
11
+ * Structural check for a Decaf execution {@link Context} inside a
12
+ * {@link MaybeContextualArg} argument list. Mirrors `@decaf-ts/core`'s own
13
+ * realm-safe duck-typing (multiple linked core builds defeat `instanceof`).
14
+ *
15
+ * @param value - A candidate argument.
16
+ * @returns `true` when the value is a Decaf execution context.
17
+ */
18
+ function isMastraManagerContextLike(value) {
19
+ if (!value || typeof value !== "object")
20
+ return false;
21
+ const candidate = value;
22
+ return (typeof candidate.get === "function" &&
23
+ typeof candidate.accumulate === "function" &&
24
+ typeof candidate.override === "function" &&
25
+ typeof candidate.toOverrides === "function" &&
26
+ candidate.cache !== undefined);
27
+ }
28
+ /**
29
+ * Resolves the caller owner from the forwarded contextual arguments, matching the
30
+ * backend's C23 resolution. The trailing context, when present, carries the
31
+ * authenticated principal resolved with {@link graphWorkflowOwnerOf}.
32
+ *
33
+ * @param args - The forwarded contextual arguments.
34
+ * @returns The caller owner, or `undefined` for owner-less callers.
35
+ */
36
+ function mastraManagerCallerOwnerOf(args) {
37
+ for (let index = args.length - 1; index >= 0; index -= 1) {
38
+ const candidate = args[index];
39
+ if (isMastraManagerContextLike(candidate)) {
40
+ return (0, GraphWorkflowService_js_1.graphWorkflowOwnerOf)(candidate);
41
+ }
42
+ }
43
+ return undefined;
44
+ }
45
+ /**
46
+ * Management surface over real `@mastra/core` workflows (SAA-346). Holds only the
47
+ * wired runtime reference and the canonical-document compiler; it never constructs a
48
+ * Mastra primitive itself and never synthesizes a method the pinned library does not
49
+ * expose. Every method validates the runtime surface it needs first and fails
50
+ * closed with {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE} otherwise.
51
+ */
52
+ class MastraWorkflowManager {
53
+ /**
54
+ * @param options - The wired runtime and optional shared compiler.
55
+ */
56
+ constructor(options = {}) {
57
+ this.options = options;
58
+ /** Canonical document revision (fingerprint) by managed workflow id. */
59
+ this.revisions = new Map();
60
+ /**
61
+ * Wrapper-managed provenance: the owner recorded when the wrapper created or
62
+ * updated a workflow. An id absent from this map is not wrapper-managed, so a
63
+ * host `origin: "code"` registration is protected from overwrite/delete (C3).
64
+ */
65
+ this.owners = new Map();
66
+ /** Standalone compiler used when the host does not inject one. */
67
+ this.fallbackCompiler = new MastraWorkflowCompiler_js_1.MastraWorkflowCompiler();
68
+ }
69
+ /** The wired real `@mastra/core` runtime, when any. */
70
+ get runtime() {
71
+ return this.options.runtime;
72
+ }
73
+ /**
74
+ * Registers a workflow translated from a canonical document on the real Mastra
75
+ * instance (real `addWorkflow`). This is the honest "create" operation: the
76
+ * pinned library registers live, it does not persist a translated code-step
77
+ * definition (see {@link persist}).
78
+ *
79
+ * @param document - The canonical document to translate and register.
80
+ * @returns The managed workflow descriptor.
81
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
82
+ * when the runtime exposes no `addWorkflow`.
83
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_UNSUPPORTED_KIND} when the
84
+ * document cannot be translated.
85
+ */
86
+ async create(document, ...args) {
87
+ const runtime = this.requireRuntime("addWorkflow");
88
+ const owner = mastraManagerCallerOwnerOf(args);
89
+ this.assertWritableProvenance(runtime, document.id);
90
+ const compiled = this.compilerOf().compile(document);
91
+ this.revisions.set(document.id, compiled.fingerprint);
92
+ this.owners.set(document.id, owner);
93
+ runtime.addWorkflow?.(compiled.workflow, document.id);
94
+ return this.describe(document.id);
95
+ }
96
+ /**
97
+ * Edits a managed workflow by recompiling the updated canonical document and
98
+ * replacing the live registration (real `removeWorkflow` then `addWorkflow`). The
99
+ * pinned library documents `removeWorkflow` as the update/delete path so a
100
+ * subsequent save can re-register the same id cleanly.
101
+ *
102
+ * @param document - The updated canonical document.
103
+ * @returns The managed workflow descriptor with its new revision.
104
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
105
+ * when the runtime exposes no `addWorkflow`/`removeWorkflow`.
106
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_NOT_FOUND} when
107
+ * no workflow is registered under the document id.
108
+ */
109
+ async update(document, ...args) {
110
+ const runtime = this.requireRuntime("addWorkflow", "removeWorkflow");
111
+ const owner = mastraManagerCallerOwnerOf(args);
112
+ this.assertWritableProvenance(runtime, document.id);
113
+ this.assertOwnerAccess(document.id, owner);
114
+ const compiled = this.compilerOf().compile(document);
115
+ const removed = runtime.removeWorkflow?.(document.id) === true;
116
+ if (!removed) {
117
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra runtime has no managed workflow '${document.id}' to update`, types_js_1.GRAPH_MASTRA_WORKFLOW_NOT_FOUND, { workflowId: document.id });
118
+ }
119
+ this.revisions.set(document.id, compiled.fingerprint);
120
+ this.owners.set(document.id, owner);
121
+ runtime.addWorkflow?.(compiled.workflow, document.id);
122
+ return this.describe(document.id);
123
+ }
124
+ /**
125
+ * Deletes a managed workflow from the live Mastra registry (real
126
+ * `removeWorkflow`).
127
+ *
128
+ * @param workflowId - The managed workflow id to remove.
129
+ * @returns `true` when a workflow was removed.
130
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
131
+ * when the runtime exposes no `removeWorkflow`.
132
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_NOT_FOUND} when no
133
+ * workflow is registered under the id.
134
+ */
135
+ async delete(workflowId, ...args) {
136
+ const runtime = this.requireRuntime("removeWorkflow");
137
+ const owner = mastraManagerCallerOwnerOf(args);
138
+ this.assertWritableProvenance(runtime, workflowId);
139
+ this.assertOwnerAccess(workflowId, owner);
140
+ const removed = runtime.removeWorkflow?.(workflowId) === true;
141
+ if (!removed) {
142
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra runtime has no managed workflow '${workflowId}' to delete`, types_js_1.GRAPH_MASTRA_WORKFLOW_NOT_FOUND, { workflowId });
143
+ }
144
+ this.revisions.delete(workflowId);
145
+ this.owners.delete(workflowId);
146
+ return true;
147
+ }
148
+ /**
149
+ * Lists the managed workflows registered on the real Mastra instance (real
150
+ * `listWorkflows`).
151
+ *
152
+ * @returns The managed workflow descriptors, in registry order.
153
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
154
+ * when the runtime exposes no `listWorkflows`.
155
+ */
156
+ async list() {
157
+ const runtime = this.requireRuntime("listWorkflows");
158
+ const registered = runtime.listWorkflows?.() ?? {};
159
+ return Object.entries(registered).map(([id, workflow]) => this.describeWorkflow(id, workflow));
160
+ }
161
+ /**
162
+ * Reads one managed workflow registered on the real Mastra instance (real
163
+ * `getWorkflow`).
164
+ *
165
+ * @param workflowId - The managed workflow id to read.
166
+ * @returns The managed workflow descriptor.
167
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
168
+ * when the runtime exposes no `getWorkflow`.
169
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_NOT_FOUND} when no
170
+ * workflow is registered under the id.
171
+ */
172
+ async get(workflowId) {
173
+ const runtime = this.requireRuntime("getWorkflow");
174
+ const workflow = this.registeredWorkflow(runtime, workflowId);
175
+ return this.describeWorkflow(workflowId, workflow);
176
+ }
177
+ /**
178
+ * Serializes a managed workflow through the real Mastra
179
+ * `Workflow.serializedStepGraph` surface.
180
+ *
181
+ * @param workflowId - The managed workflow id to serialize.
182
+ * @returns The JSON-safe serialized workflow.
183
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
184
+ * when the runtime exposes no `getWorkflow`.
185
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_NOT_FOUND} when no
186
+ * workflow is registered under the id.
187
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_SERIALIZE_NOT_SUPPORTED}
188
+ * when the registered workflow exposes no serializable step graph.
189
+ */
190
+ async serialize(workflowId) {
191
+ const runtime = this.requireRuntime("getWorkflow");
192
+ const workflow = this.registeredWorkflow(runtime, workflowId);
193
+ const steps = workflow
194
+ .serializedStepGraph;
195
+ if (!Array.isArray(steps)) {
196
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra workflow '${workflowId}' exposes no serialized step graph`, types_js_1.GRAPH_MASTRA_SERIALIZE_NOT_SUPPORTED, { workflowId });
197
+ }
198
+ const revision = this.revisions.get(workflowId);
199
+ return {
200
+ id: workflowId,
201
+ ...(revision !== undefined ? { revision } : {}),
202
+ steps,
203
+ };
204
+ }
205
+ /**
206
+ * The canonical document revision (fingerprint) the wrapper tracks for a
207
+ * document. Mastra has no native workflow version, so this is the honest
208
+ * `EXTENSION-POINT` revision identity: it is computed from the canonical
209
+ * document alone and requires no runtime.
210
+ *
211
+ * @param document - The canonical document to fingerprint.
212
+ * @returns The stable revision fingerprint.
213
+ */
214
+ revision(document) {
215
+ return (0, GraphRunFingerprint_js_1.graphRunDocumentFingerprint)(document);
216
+ }
217
+ /**
218
+ * Persists a translated workflow to Mastra storage. The pinned real
219
+ * `Mastra.addDynamicWorkflow` persists only agent/tool-referenced steps, while
220
+ * the canonical translation emits host code steps, so this operation is
221
+ * `NOT-SUPPORTED` and fails closed rather than faking a persisted definition.
222
+ *
223
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_PERSIST_NOT_SUPPORTED}
224
+ * always.
225
+ */
226
+ async persist() {
227
+ throw new GraphExecutionError_js_1.GraphExecutionError("Mastra addDynamicWorkflow persists only agent/tool-referenced steps; the canonical translation emits host code steps", types_js_1.GRAPH_MASTRA_PERSIST_NOT_SUPPORTED);
228
+ }
229
+ /** The compiler the surface translates canonical documents with. */
230
+ compilerOf() {
231
+ return this.options.compiler ?? this.fallbackCompiler;
232
+ }
233
+ /**
234
+ * Resolves the wired runtime after asserting it exposes every required real
235
+ * Mastra method.
236
+ *
237
+ * @param methods - The real method names the operation needs.
238
+ * @returns The wired runtime.
239
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE}
240
+ * when the runtime is unwired or omits a required method.
241
+ */
242
+ requireRuntime(...methods) {
243
+ const runtime = this.options.runtime;
244
+ if (!runtime || typeof runtime !== "object") {
245
+ throw new GraphExecutionError_js_1.GraphExecutionError("Mastra runtime is not wired; workflow management is unavailable", types_js_1.GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE);
246
+ }
247
+ const candidate = runtime;
248
+ for (const method of methods) {
249
+ if (typeof candidate[method] !== "function") {
250
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra runtime exposes no '${method}' method; workflow management is unavailable`, types_js_1.GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE, { method });
251
+ }
252
+ }
253
+ return runtime;
254
+ }
255
+ /**
256
+ * Fails closed when a management mutation targets a workflow the wrapper did not
257
+ * create (C3 complete mediation). A wrapper-managed id is writable; any
258
+ * pre-existing registration — including a host `origin: "code"` workflow — is
259
+ * protected from overwrite/delete, and an existing workflow whose provenance
260
+ * cannot be determined is refused rather than mutated.
261
+ *
262
+ * @param runtime - The validated runtime.
263
+ * @param workflowId - The managed workflow id.
264
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_FORBIDDEN} when the
265
+ * workflow is not wrapper-managed.
266
+ */
267
+ assertWritableProvenance(runtime, workflowId) {
268
+ if (this.revisions.has(workflowId))
269
+ return;
270
+ const origin = this.originOf(runtime, workflowId);
271
+ if (origin !== undefined) {
272
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra workflow '${workflowId}' is a host registration (origin '${origin}'); the wrapper only manages workflows it created`, types_js_1.GRAPH_MASTRA_WORKFLOW_FORBIDDEN, { workflowId, origin });
273
+ }
274
+ if (this.registered(runtime, workflowId)) {
275
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra workflow '${workflowId}' exists but is not wrapper-managed; refusing to modify a foreign registration`, types_js_1.GRAPH_MASTRA_WORKFLOW_FORBIDDEN, { workflowId });
276
+ }
277
+ }
278
+ /**
279
+ * Enforces the C23 ownership predicate on a wrapper-managed workflow before a
280
+ * management mutation, mirroring the backend's `canAccessGraphResource`
281
+ * enforcement. Owner-less workflows stay writable by every caller.
282
+ *
283
+ * @param workflowId - The managed workflow id.
284
+ * @param callerOwner - The caller owner resolved from the context.
285
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_FORBIDDEN} when the
286
+ * caller may not write the workflow.
287
+ */
288
+ assertOwnerAccess(workflowId, callerOwner) {
289
+ const owner = this.owners.get(workflowId);
290
+ if (!(0, ownership_js_1.canAccessGraphResource)({ owner }, callerOwner)) {
291
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra workflow '${workflowId}' is not writable by the caller`, types_js_1.GRAPH_MASTRA_WORKFLOW_FORBIDDEN, { workflowId });
292
+ }
293
+ }
294
+ /**
295
+ * Reads how the runtime reports a workflow's registration origin.
296
+ *
297
+ * @param runtime - The validated runtime.
298
+ * @param workflowId - The workflow id.
299
+ * @returns The origin, or `undefined` when the runtime reports none.
300
+ */
301
+ originOf(runtime, workflowId) {
302
+ if (typeof runtime.getWorkflowOrigin !== "function")
303
+ return undefined;
304
+ try {
305
+ return runtime.getWorkflowOrigin(workflowId);
306
+ }
307
+ catch {
308
+ return undefined;
309
+ }
310
+ }
311
+ /**
312
+ * Whether the runtime already has a workflow registered under the id.
313
+ *
314
+ * @param runtime - The validated runtime.
315
+ * @param workflowId - The workflow id.
316
+ * @returns `true` when a workflow is registered under the id.
317
+ */
318
+ registered(runtime, workflowId) {
319
+ if (typeof runtime.getWorkflow !== "function")
320
+ return false;
321
+ try {
322
+ const workflow = runtime.getWorkflow(workflowId);
323
+ return workflow !== undefined && workflow !== null;
324
+ }
325
+ catch {
326
+ return false;
327
+ }
328
+ }
329
+ /**
330
+ * Reads a registered workflow, mapping the real not-found failure onto the
331
+ * canonical error code.
332
+ *
333
+ * @param runtime - The validated runtime.
334
+ * @param workflowId - The managed workflow id to read.
335
+ * @returns The registered workflow object.
336
+ * @throws {GraphExecutionError} {@link GRAPH_MASTRA_WORKFLOW_NOT_FOUND} when no
337
+ * workflow is registered under the id.
338
+ */
339
+ registeredWorkflow(runtime, workflowId) {
340
+ let workflow;
341
+ try {
342
+ workflow = runtime.getWorkflow?.(workflowId);
343
+ }
344
+ catch {
345
+ workflow = undefined;
346
+ }
347
+ if (workflow === undefined || workflow === null) {
348
+ throw new GraphExecutionError_js_1.GraphExecutionError(`Mastra runtime has no managed workflow '${workflowId}'`, types_js_1.GRAPH_MASTRA_WORKFLOW_NOT_FOUND, { workflowId });
349
+ }
350
+ return workflow;
351
+ }
352
+ /**
353
+ * Builds a managed workflow descriptor, reading the real registration origin
354
+ * and the wrapper-tracked revision when available.
355
+ *
356
+ * @param workflowId - The managed workflow id.
357
+ * @param workflow - The registered workflow object.
358
+ * @returns The managed workflow descriptor.
359
+ */
360
+ describeWorkflow(workflowId, workflow) {
361
+ const name = workflow?.name;
362
+ let origin;
363
+ const runtime = this.options.runtime;
364
+ try {
365
+ origin = runtime?.getWorkflowOrigin?.(workflowId);
366
+ }
367
+ catch {
368
+ origin = undefined;
369
+ }
370
+ const revision = this.revisions.get(workflowId);
371
+ return {
372
+ id: workflowId,
373
+ ...(typeof name === "string" ? { name } : {}),
374
+ ...(origin ? { origin } : {}),
375
+ ...(revision !== undefined ? { revision } : {}),
376
+ };
377
+ }
378
+ /**
379
+ * Builds a descriptor for a workflow the wrapper has just registered or
380
+ * updated.
381
+ *
382
+ * @param workflowId - The managed workflow id.
383
+ * @returns The managed workflow descriptor.
384
+ */
385
+ describe(workflowId) {
386
+ const runtime = this.options.runtime;
387
+ let workflow;
388
+ if (typeof runtime?.getWorkflow === "function") {
389
+ try {
390
+ workflow = runtime.getWorkflow(workflowId);
391
+ }
392
+ catch {
393
+ workflow = undefined;
394
+ }
395
+ }
396
+ return this.describeWorkflow(workflowId, workflow);
397
+ }
398
+ }
399
+ exports.MastraWorkflowManager = MastraWorkflowManager;
400
+ //# sourceMappingURL=MastraWorkflowManager.js.map
401
+ //# sourceMappingURL=MastraWorkflowManager.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastra/MastraWorkflowManager.cjs","sourceRoot":"","sources":["mastra/MastraWorkflowManager.js"],"names":[],"mappings":";;;AAAA,sFAAgF;AAChF,oFAAsF;AACtF,gEAAuE;AACvE,0FAAoF;AACpF,2EAAqE;AACrE,yCAA8M;AAC9M;;;;;;;GAOG;AACH,SAAS,0BAA0B,CAAC,KAAK;IACrC,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QACnC,OAAO,KAAK,CAAC;IACjB,MAAM,SAAS,GAAG,KAAK,CAAC;IACxB,OAAO,CAAC,OAAO,SAAS,CAAC,GAAG,KAAK,UAAU;QACvC,OAAO,SAAS,CAAC,UAAU,KAAK,UAAU;QAC1C,OAAO,SAAS,CAAC,QAAQ,KAAK,UAAU;QACxC,OAAO,SAAS,CAAC,WAAW,KAAK,UAAU;QAC3C,SAAS,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC;AACvC,CAAC;AACD;;;;;;;GAOG;AACH,S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AC7C,IAAI,CAAC;gBACD,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAC/C,CAAC;YACD,MAAM,CAAC;gBACH,QAAQ,GAAG,SAAS,CAAC;YACzB,CAAC;QACL,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IACvD,CAAC;CACJ;AA1VD,sDA0VC;AACD,iDAAiD"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ /**
18
+ * @module as-graph/mastra
19
+ * @summary Mastra graph execution backend barrel (SAA-196).
20
+ * @description Public surface of the `@decaf-ts/as-graph/mastra` entrypoint:
21
+ * the Mastra execution backend, the workflow compiler, the event bridge, the
22
+ * condition bridge, the schema converter, the resume guard, the capability
23
+ * table, and the shared types/ports.
24
+ */
25
+ __exportStar(require("./types.cjs"), exports);
26
+ __exportStar(require("./MastraCapabilities.cjs"), exports);
27
+ __exportStar(require("./MastraSchemaConverter.cjs"), exports);
28
+ __exportStar(require("./MastraConditionBridge.cjs"), exports);
29
+ __exportStar(require("./MastraEventBridge.cjs"), exports);
30
+ __exportStar(require("./MastraWorkflowCompiler.cjs"), exports);
31
+ __exportStar(require("./MastraWorkflowManager.cjs"), exports);
32
+ __exportStar(require("./MastraResumeGuard.cjs"), exports);
33
+ __exportStar(require("./MastraGraphExecutionBackend.cjs"), exports);
34
+ //# sourceMappingURL=index.js.map
35
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastra/index.cjs","sourceRoot":"","sources":["mastra/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,6CAA2B;AAC3B,0DAAwC;AACxC,6DAA2C;AAC3C,6DAA2C;AAC3C,yDAAuC;AACvC,8DAA4C;AAC5C,6DAA2C;AAC3C,yDAAuC;AACvC,mEAAiD;AACjD,iCAAiC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GRAPH_MASTRA_WORKFLOW_FORBIDDEN = exports.GRAPH_MASTRA_SERIALIZE_NOT_SUPPORTED = exports.GRAPH_MASTRA_PERSIST_NOT_SUPPORTED = exports.GRAPH_MASTRA_WORKFLOW_NOT_FOUND = exports.GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE = exports.GRAPH_MASTRA_AGENT_UNAVAILABLE = exports.GRAPH_MASTRA_TRANSLATION_JSON_UNSAFE = exports.GRAPH_MASTRA_RESUME_STATE_INVALID = exports.GRAPH_MASTRA_RESUME_STEP_UNKNOWN = exports.GRAPH_MASTRA_RESUME_INVALID = exports.GRAPH_MASTRA_RESUME_SCHEMA_UNSAFE = exports.GRAPH_MASTRA_UNSUPPORTED_KIND = exports.MASTRA_BACKEND_FLAVOUR = void 0;
4
+ /** The flavour id the Mastra backend registers under in the backend registry. */
5
+ exports.MASTRA_BACKEND_FLAVOUR = "mastra";
6
+ /** A document node kind the Mastra translator cannot represent. */
7
+ exports.GRAPH_MASTRA_UNSUPPORTED_KIND = "GRAPH_MASTRA_UNSUPPORTED_KIND";
8
+ /** A suspendable step declared a missing or degraded resume schema. */
9
+ exports.GRAPH_MASTRA_RESUME_SCHEMA_UNSAFE = "GRAPH_MASTRA_RESUME_SCHEMA_UNSAFE";
10
+ /** A resume request failed validation (size, JSON safety, schema, or step). */
11
+ exports.GRAPH_MASTRA_RESUME_INVALID = "GRAPH_MASTRA_RESUME_INVALID";
12
+ /** The resume step or iteration index is not allowlisted by the document. */
13
+ exports.GRAPH_MASTRA_RESUME_STEP_UNKNOWN = "GRAPH_MASTRA_RESUME_STEP_UNKNOWN";
14
+ /** The Mastra snapshot is not a suspended run of the current document. */
15
+ exports.GRAPH_MASTRA_RESUME_STATE_INVALID = "GRAPH_MASTRA_RESUME_STATE_INVALID";
16
+ /** The document translation emitted non-JSON-safe Mastra config. */
17
+ exports.GRAPH_MASTRA_TRANSLATION_JSON_UNSAFE = "GRAPH_MASTRA_TRANSLATION_JSON_UNSAFE";
18
+ /** No Mastra agent is available for an agent-backed node. */
19
+ exports.GRAPH_MASTRA_AGENT_UNAVAILABLE = "GRAPH_MASTRA_AGENT_UNAVAILABLE";
20
+ /** The wired Mastra runtime exposes no workflow-management surface. */
21
+ exports.GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE = "GRAPH_MASTRA_MANAGEMENT_UNAVAILABLE";
22
+ /** A managed workflow id has no workflow registered on the runtime. */
23
+ exports.GRAPH_MASTRA_WORKFLOW_NOT_FOUND = "GRAPH_MASTRA_WORKFLOW_NOT_FOUND";
24
+ /** Persisting a translated workflow to Mastra storage is not supported. */
25
+ exports.GRAPH_MASTRA_PERSIST_NOT_SUPPORTED = "GRAPH_MASTRA_PERSIST_NOT_SUPPORTED";
26
+ /** A registered workflow exposes no serializable step graph. */
27
+ exports.GRAPH_MASTRA_SERIALIZE_NOT_SUPPORTED = "GRAPH_MASTRA_SERIALIZE_NOT_SUPPORTED";
28
+ /**
29
+ * A management mutation targeted a workflow the caller may not write, or a host
30
+ * registration the wrapper did not create (C3 complete-mediation guard).
31
+ */
32
+ exports.GRAPH_MASTRA_WORKFLOW_FORBIDDEN = "GRAPH_MASTRA_WORKFLOW_FORBIDDEN";
33
+ //# sourceMappingURL=types.js.map
34
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mastra/types.cjs","sourceRoot":"","sources":["mastra/types.js"],"names":[],"mappings":";;;AAAA,iFAAiF;AACpE,QAAA,sBAAsB,GAAG,QAAQ,CAAC;AAC/C,mEAAmE;AACtD,QAAA,6BAA6B,GAAG,+BAA+B,CAAC;AAC7E,uEAAuE;AAC1D,QAAA,iCAAiC,GAAG,mCAAmC,CAAC;AACrF,+EAA+E;AAClE,QAAA,2BAA2B,GAAG,6BAA6B,CAAC;AACzE,6EAA6E;AAChE,QAAA,gCAAgC,GAAG,kCAAkC,CAAC;AACnF,0EAA0E;AAC7D,QAAA,iCAAiC,GAAG,mCAAmC,CAAC;AACrF,oEAAoE;AACvD,QAAA,oCAAoC,GAAG,sCAAsC,CAAC;AAC3F,6DAA6D;AAChD,QAAA,8BAA8B,GAAG,gCAAgC,CAAC;AAC/E,uEAAuE;AAC1D,QAAA,mCAAmC,GAAG,qCAAqC,CAAC;AACzF,uEAAuE;AAC1D,QAAA,+BAA+B,GAAG,iCAAiC,CAAC;AACjF,2EAA2E;AAC9D,QAAA,kCAAkC,GAAG,oCAAoC,CAAC;AACvF,gEAAgE;AACnD,QAAA,oCAAoC,GAAG,sCAAsC,CAAC;AAC3F;;;GAGG;AACU,QAAA,+BAA+B,GAAG,iCAAiC,CAAC;AACjF,iCAAiC"}
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MASTRA_PINNED_VERSION = void 0;
4
+ exports.toGraphEngineFeatureVerdict = toGraphEngineFeatureVerdict;
5
+ exports.localEngineFeatures = localEngineFeatures;
6
+ exports.buildGraphEngineCapabilityManifest = buildGraphEngineCapabilityManifest;
7
+ const GraphExecutionBackend_js_1 = require("./../../engine/execution/GraphExecutionBackend.cjs");
8
+ const GraphExecutionBackendRegistry_js_1 = require("./../../engine/execution/GraphExecutionBackendRegistry.cjs");
9
+ const constants_js_1 = require("./../../engine/constants.cjs");
10
+ const capabilities_js_1 = require("./../../dagster/capabilities.cjs");
11
+ const constants_js_2 = require("./../../dagster/constants.cjs");
12
+ const MastraCapabilities_js_1 = require("./../../mastra/MastraCapabilities.cjs");
13
+ const types_js_1 = require("./../../mastra/types.cjs");
14
+ /**
15
+ * Pinned `@mastra/core` engine version. Kept here because the Mastra wrapper
16
+ * exports only its feature table, not a version constant; the value mirrors the
17
+ * `@mastra/core` dependency pin in `as-graph/package.json` (`1.74.0`).
18
+ */
19
+ exports.MASTRA_PINNED_VERSION = "1.74.0";
20
+ /**
21
+ * Normalizes a wrapper capability verdict onto the C20 three-value vocabulary.
22
+ * `PARTIAL` is deliberately downgraded to `NOT_SUPPORTED` (fail-closed): a
23
+ * partially-supported feature must never be advertised as a usable toggle.
24
+ *
25
+ * @param verdict - The wrapper table verdict string.
26
+ * @returns The normalized C20 verdict.
27
+ */
28
+ function toGraphEngineFeatureVerdict(verdict) {
29
+ const normalized = verdict.trim().toUpperCase().replace(/[-\s]+/g, "_");
30
+ if (normalized === "SUPPORTED")
31
+ return "SUPPORTED";
32
+ if (normalized === "EXTENSION_POINT")
33
+ return "EXTENSION_POINT";
34
+ return "NOT_SUPPORTED";
35
+ }
36
+ /** The Dagster feature rows, derived from the exported capability table. */
37
+ const DAGSTER_ENGINE_FEATURES = capabilities_js_1.DAGSTER_CAPABILITY_TABLE.map((row) => ({
38
+ feature: row.feature,
39
+ verdict: toGraphEngineFeatureVerdict(row.verdict),
40
+ ...(row.detail !== undefined ? { detail: row.detail } : {}),
41
+ }));
42
+ /** The Mastra feature rows, derived from the exported capability table. */
43
+ const MASTRA_ENGINE_FEATURES = MastraCapabilities_js_1.MASTRA_FEATURE_CAPABILITIES.map((row) => ({
44
+ feature: row.feature,
45
+ verdict: toGraphEngineFeatureVerdict(row.verdict),
46
+ ...(row.detail !== undefined ? { detail: row.detail } : {}),
47
+ }));
48
+ /**
49
+ * Derives the local engine's feature rows from the engine-agnostic
50
+ * {@link GraphBackendCapabilities} the built-in backend exposes, so the manifest
51
+ * never hand-maintains a separate local table.
52
+ *
53
+ * @param capabilities - The active backend's effective capability metadata.
54
+ * @returns The normalized feature rows for the local engine.
55
+ */
56
+ function localEngineFeatures(capabilities) {
57
+ return [
58
+ {
59
+ feature: "codeMode",
60
+ verdict: capabilities.codeMode === "hostSide" ? "SUPPORTED" : "NOT_SUPPORTED",
61
+ detail: "Host-side sandbox execution.",
62
+ },
63
+ {
64
+ feature: "workflowList",
65
+ verdict: capabilities.workflows.list === "supported"
66
+ ? "SUPPORTED"
67
+ : "NOT_SUPPORTED",
68
+ },
69
+ {
70
+ feature: "workflowLookup",
71
+ verdict: capabilities.workflows.get === "supported"
72
+ ? "SUPPORTED"
73
+ : "NOT_SUPPORTED",
74
+ },
75
+ ];
76
+ }
77
+ /**
78
+ * The allowlisted engine capability sources, keyed by backend flavour. An engine
79
+ * absent from this map is never advertised (C21: engine selection is by
80
+ * allowlisted ids only), even when a backend is registered under its flavour.
81
+ */
82
+ const BUILT_IN_ENGINE_CAPABILITY_SOURCES = {
83
+ [constants_js_1.GRAPH_LOCAL_EXECUTION_BACKEND]: {
84
+ engineId: constants_js_1.GRAPH_LOCAL_EXECUTION_BACKEND,
85
+ displayName: "Local (built-in)",
86
+ pinnedEngineVersion: "built-in",
87
+ features: (backend) => localEngineFeatures((0, GraphExecutionBackend_js_1.resolveGraphBackendCapabilities)(backend)),
88
+ },
89
+ [constants_js_2.DAGSTER_BACKEND_FLAVOUR]: {
90
+ engineId: constants_js_2.DAGSTER_BACKEND_FLAVOUR,
91
+ displayName: "Dagster",
92
+ pinnedEngineVersion: constants_js_2.DAGSTER_PINNED_VERSION,
93
+ features: () => DAGSTER_ENGINE_FEATURES,
94
+ },
95
+ [types_js_1.MASTRA_BACKEND_FLAVOUR]: {
96
+ engineId: types_js_1.MASTRA_BACKEND_FLAVOUR,
97
+ displayName: "Mastra",
98
+ pinnedEngineVersion: exports.MASTRA_PINNED_VERSION,
99
+ features: () => MASTRA_ENGINE_FEATURES,
100
+ },
101
+ };
102
+ /**
103
+ * Builds the capability manifest from the registered backends, statically at boot.
104
+ * Only allowlisted flavours are advertised; the descriptors' `local` flag is read
105
+ * from the registered backend, and no remote engine is ever probed. The returned
106
+ * object is a fresh snapshot so a caller cannot mutate the served manifest.
107
+ *
108
+ * @param registered - The registered flavour/backend entries.
109
+ * @param defaultEngineId - Optional host-preferred default engine id.
110
+ * @returns The C20 capability manifest.
111
+ */
112
+ function buildGraphEngineCapabilityManifest(registered, defaultEngineId) {
113
+ const engines = [];
114
+ for (const { flavour, backend } of registered) {
115
+ const source = BUILT_IN_ENGINE_CAPABILITY_SOURCES[flavour];
116
+ if (!source)
117
+ continue;
118
+ engines.push({
119
+ engineId: source.engineId,
120
+ displayName: source.displayName,
121
+ local: backend.local === true,
122
+ pinnedEngineVersion: source.pinnedEngineVersion,
123
+ capabilities: source.features(backend).map((row) => ({ ...row })),
124
+ });
125
+ }
126
+ const ids = new Set(engines.map((engine) => engine.engineId));
127
+ const currentFlavour = GraphExecutionBackendRegistry_js_1.GraphExecutionBackendRegistry.currentFlavour;
128
+ const resolvedDefault = defaultEngineId && ids.has(defaultEngineId)
129
+ ? defaultEngineId
130
+ : ids.has(currentFlavour)
131
+ ? currentFlavour
132
+ : (engines[0]?.engineId ?? currentFlavour);
133
+ return { engines, defaultEngineId: resolvedDefault };
134
+ }
135
+ //# sourceMappingURL=GraphEngineCapabilityManifest.js.map
136
+ //# sourceMappingURL=GraphEngineCapabilityManifest.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest/graph/GraphEngineCapabilityManifest.cjs","sourceRoot":"","sources":["nest/graph/GraphEngineCapabilityManifest.js"],"names":[],"mappings":";;;AAqBA,kEAOC;AAqBD,kDAoBC;AAoCD,gFAsBC;AA/HD,gGAAoG;AACpG,gHAA0G;AAC1G,8DAA4E;AAC5E,qEAA2E;AAC3E,+DAAgG;AAChG,gFA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