@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
@@ -1,11 +1,102 @@
1
1
  import { ForbiddenError } from "@decaf-ts/core";
2
2
  /**
3
- * Centralized graph resource ownership check (SAA-595 security hardening).
3
+ * Centralized graph resource access predicate (SAA-595 security hardening).
4
4
  *
5
- * Fail-closed by default: a resource that carries an owner is only accessible
6
- * to that owner; an absent caller identity is denied unless the explicit
5
+ * Fail-closed by default: a resource that carries an owner is only visible to
6
+ * that owner; an absent caller identity is denied unless the explicit
7
7
  * `allowAnonymousAccess` tolerance (DECAF-48 §4.15 standalone runs) is set.
8
- * Owner-less resources remain accessible to everyone.
8
+ * Owner-less resources remain accessible to everyone. Returns a boolean so list
9
+ * endpoints can filter a collection without aborting on the first foreign row.
10
+ *
11
+ * @param resource - The guarded resource (or its persisted record); only its
12
+ * `owner` member is read. `null`/`undefined` counts as owner-less.
13
+ * @param callerOwner - Identity of the caller resolved from the request
14
+ * context; `null`/`undefined`/`""` represent anonymous callers.
15
+ * @param options - `allowAnonymousAccess` opts in to the DECAF-48 §4.15
16
+ * standalone tolerance (default `false`).
17
+ * @return `true` when the caller may access the resource.
18
+ */
19
+ export function canAccessGraphResource(resource, callerOwner, options = {}) {
20
+ const owner = resource?.owner ?? null;
21
+ if (!owner || owner === callerOwner)
22
+ return true;
23
+ if ((callerOwner === undefined || callerOwner === null || callerOwner === "") &&
24
+ options.allowAnonymousAccess === true) {
25
+ return true;
26
+ }
27
+ return false;
28
+ }
29
+ /**
30
+ * Payload-scoped companion to {@link canAccessGraphResource} (SAA-93 F1).
31
+ *
32
+ * Read *visibility* of an owner-less resource is intentionally open to every
33
+ * caller, but the sensitive payload members a list projection serves
34
+ * (`inputs`/`result`/`error` on run rows) must not be. This predicate is
35
+ * fail-closed: a caller may see a row's payload only when the row's recorded
36
+ * owner equals the caller's resolved owner. An owner-less row (no recorded
37
+ * owner) therefore exposes its payload only to an owner-less caller (an
38
+ * anonymous/standalone caller); a named caller — even one allowed to see the row
39
+ * by {@link canAccessGraphResource} — receives the summary-only projection.
40
+ * That closes the cross-caller exposure where an unrelated authenticated caller
41
+ * could read another anonymous caller's `inputs`/`result`/`error` through
42
+ * `GET /graph/workflows/{workflowId}/runs`.
43
+ *
44
+ * @param resource - The guarded resource (or its persisted record); only its
45
+ * `owner` member is read. `null`/`undefined` counts as owner-less.
46
+ * @param callerOwner - Identity of the caller resolved from the request
47
+ * context; `null`/`undefined`/`""` represent owner-less callers.
48
+ * @return `true` when the caller may see the resource's payload members.
49
+ */
50
+ export function canAccessGraphResourcePayload(resource, callerOwner) {
51
+ const owner = resource?.owner ?? null;
52
+ const caller = callerOwner ?? null;
53
+ return owner === caller;
54
+ }
55
+ /**
56
+ * Write-path ownership assertion for graph resources (SAA-105 R3).
57
+ *
58
+ * Mutation authorization is strict owner equality, deliberately stricter than the
59
+ * read-visibility predicate {@link canAccessGraphResource}: the owner-less
60
+ * visibility branch that lets any caller *read* an owner-less resource must never
61
+ * authorize a write. Concretely this denies a named caller mutating an owner-less
62
+ * resource (the R3 cross-caller hole) and denies an anonymous caller mutating an
63
+ * owned resource even when the read tolerance `allowAnonymousAccess` is set.
64
+ *
65
+ * The normative effects are:
66
+ * - owner-less resource + owner-less (anonymous) caller → allow;
67
+ * - owner-less resource + named caller → `ForbiddenError`;
68
+ * - owned resource + its owner → allow;
69
+ * - owned resource + any other caller (including anonymous with the read
70
+ * tolerance) → `ForbiddenError`.
71
+ *
72
+ * `allowAnonymousAccess` is intentionally not a parameter here: it is a
73
+ * read-visibility tolerance and never grants a write.
74
+ *
75
+ * @param resource - The guarded resource (or its persisted record); only its
76
+ * `owner` member is read. `null`/`undefined` counts as owner-less.
77
+ * @param callerOwner - Identity of the caller resolved from the request
78
+ * context; `null`/`undefined`/`""` represent owner-less callers.
79
+ * @param options - `resourceKind`/`resourceId` name the resource in the
80
+ * denial message.
81
+ * @throws ForbiddenError when the caller is not the resource's recorded owner
82
+ * (owner equality).
83
+ */
84
+ export function assertGraphResourceWriteOwnership(resource, callerOwner, options) {
85
+ if (!canAccessGraphResourcePayload(resource, callerOwner)) {
86
+ throw new ForbiddenError(`${options.resourceKind} '${options.resourceId}' is owned by another user`);
87
+ }
88
+ }
89
+ /**
90
+ * Centralized graph resource ownership check (SAA-595 security hardening).
91
+ *
92
+ * Read-visibility check. Fail-closed by default: a resource that carries an
93
+ * owner is only accessible to that owner; an absent caller identity is denied
94
+ * unless the explicit `allowAnonymousAccess` tolerance (DECAF-48 §4.15 standalone
95
+ * runs) is set. Owner-less resources remain accessible to everyone.
96
+ *
97
+ * Writes must NOT use this predicate; use
98
+ * {@link assertGraphResourceWriteOwnership} so the owner-less visibility branch
99
+ * and the `allowAnonymousAccess` tolerance cannot authorize a mutation.
9
100
  *
10
101
  * @param resource - The guarded resource (or its persisted record); only its
11
102
  * `owner` member is read. `null`/`undefined` counts as owner-less.
@@ -18,13 +109,8 @@ import { ForbiddenError } from "@decaf-ts/core";
18
109
  * different user, or an anonymous caller without the explicit tolerance.
19
110
  */
20
111
  export function assertGraphResourceOwnership(resource, callerOwner, options) {
21
- const owner = resource?.owner ?? null;
22
- if (!owner || owner === callerOwner)
23
- return;
24
- if ((callerOwner === undefined || callerOwner === null || callerOwner === "") &&
25
- options.allowAnonymousAccess === true) {
26
- return;
112
+ if (!canAccessGraphResource(resource, callerOwner, options)) {
113
+ throw new ForbiddenError(`${options.resourceKind} '${options.resourceId}' is owned by another user`);
27
114
  }
28
- throw new ForbiddenError(`${options.resourceKind} '${options.resourceId}' is owned by another user`);
29
115
  }
30
116
  //# sourceMappingURL=ownership.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../../../src/engine/runs/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAsD,EACtD,WAAsC,EACtC,OAIC;IAED,MAAM,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC;IACtC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO;IAC5C,IACE,CAAC,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,EAAE,CAAC;QACzE,OAAO,CAAC,oBAAoB,KAAK,IAAI,EACrC,CAAC;QACD,OAAO;IACT,CAAC;IACD,MAAM,IAAI,cAAc,CACtB,GAAG,OAAO,CAAC,YAAY,KAAK,OAAO,CAAC,UAAU,4BAA4B,CAC3E,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../../../src/engine/runs/ownership.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CACpC,QAAsD,EACtD,WAAsC,EACtC,UAA8C,EAAE;IAEhD,MAAM,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC;IACtC,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IACjD,IACE,CAAC,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,EAAE,CAAC;QACzE,OAAO,CAAC,oBAAoB,KAAK,IAAI,EACrC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAsD,EACtD,WAAsC;IAEtC,MAAM,KAAK,GAAG,QAAQ,EAAE,KAAK,IAAI,IAAI,CAAC;IACtC,MAAM,MAAM,GAAG,WAAW,IAAI,IAAI,CAAC;IACnC,OAAO,KAAK,KAAK,MAAM,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,iCAAiC,CAC/C,QAAsD,EACtD,WAAsC,EACtC,OAGC;IAED,IAAI,CAAC,6BAA6B,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,cAAc,CACtB,GAAG,OAAO,CAAC,YAAY,KAAK,OAAO,CAAC,UAAU,4BAA4B,CAC3E,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAAsD,EACtD,WAAsC,EACtC,OAIC;IAED,IAAI,CAAC,sBAAsB,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,cAAc,CACtB,GAAG,OAAO,CAAC,YAAY,KAAK,OAAO,CAAC,UAAU,4BAA4B,CAC3E,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -77,6 +77,22 @@ let GraphRunModelService = class GraphRunModelService extends ModelService {
77
77
  return null;
78
78
  }
79
79
  }
80
+ /**
81
+ * Lists every persisted run row for the given workflow document as its
82
+ * persisted {@link GraphRunModel} shape (keeping storage-derived fields such
83
+ * as `updatedAt` and `inputs`).
84
+ *
85
+ * A store failure propagates instead of being swallowed as `[]` (SAA-93 F4):
86
+ * silently emptying the list masks an outage as "no runs".
87
+ *
88
+ * @param {string} workflowId - Workflow document id the runs executed.
89
+ * @param args - An optional decaf `Context` forwarded to the model service.
90
+ * @return {Promise<GraphRunModel[]>} The matching rows (empty when none exist).
91
+ */
92
+ async listRuns(workflowId, ...args) {
93
+ const { ctxArgs } = (await this.logCtx(args, "listRuns", true)).for(this.listRuns);
94
+ return (await this.findBy("workflowId", workflowId, ...ctxArgs));
95
+ }
80
96
  };
81
97
  GraphRunModelService = __decorate([
82
98
  service(GraphRunModel),
@@ -1 +1 @@
1
- {"version":3,"file":"GraphRunModelService.js","sourceRoot":"","sources":["../../../../src/engine/services/GraphRunModelService.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,EACL,YAAY,EACZ,OAAO,GAGR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,sCAA2B;AACnD,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,wCAAmC;AAEpE;;;;GAIG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,YAA2B;IAEnE;QACE,KAAK,CAAC,aAAa,CAAC,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,OAAO,CACX,GAAa,EACb,GAAG,IAAiC;QAEpC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAChE,IAAI,CAAC,OAAO,CACb,CAAC;QACF,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;QAC9B,IAAI,QAA8B,CAAC;QACnC,IAAI,CAAC;YACH,QAAQ,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAkB,CAAC;QACxE,CAAC;QAAC,MAAM,CAAC;YACP,QAAQ,GAAG,IAAI,CAAC;QAClB,CAAC;QACD,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACvC,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC7B,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YAC/B,QAAQ,CAAC,mBAAmB,GAAG,KAAK,CAAC,mBAAmB,CAAC;YACzD,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;YAC/B,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;YAC7B,QAAQ,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;YACrC,QAAQ,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;YACvC,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,GAAG,OAAO,CAAC,CAAC;YACxC,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,CACX,KAAa,EACb,GAAG,IAAiC;QAEpC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAChE,IAAI,CAAC,OAAO,CACb,CAAC;QACF,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAkB,CAAC;YACrE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAA;AAjEY,oBAAoB;IADhC,OAAO,CAAC,aAAa,CAAC;;GACV,oBAAoB,CAiEhC"}
1
+ {"version":3,"file":"GraphRunModelService.js","sourceRoot":"","sources":["../../../../src/engine/services/GraphRunModelService.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,EACL,YAAY,EACZ,OAAO,GAGR,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,sCAA2B;AACnD,OAAO,EAAE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C,OAAO;QACT,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,OAAO,CACX,KAAa,EACb,GAAG,IAAiC;QAEpC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CAChE,IAAI,CAAC,OAAO,CACb,CAAC;QACF,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,OAAO,CAAC,CAAkB,CAAC;YACrE,OAAO,UAAU,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,QAAQ,CACZ,UAAkB,EAClB,GAAG,IAAiC;QAEpC,MAAM,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,CACjE,IAAI,CAAC,QAAQ,CACd,CAAC;QACF,OAAO,CAAC,MAAM,IAAI,CAAC,MAAM,CACvB,YAAY,EACZ,UAAU,EACV,GAAG,OAAO,CACX,CAAoB,CAAC;IACxB,CAAC;CACF,CAAA;AA3FY,oBAAoB;IADhC,OAAO,CAAC,aAAa,CAAC;;GACV,oBAAoB,CA2FhC"}
@@ -7,9 +7,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
+ /**
11
+ * @module as-graph/engine/services/GraphWorkflowService
12
+ * @summary Model-backed persistence for canonical workflow documents
13
+ * (DECAF-50 §4.10) plus the ownership-filtered workflow serving list (SAA-76).
14
+ * @description Saves, reads, lists, validates, and access-checks
15
+ * {@link GraphWorkflowModel} rows via the Decaf {@link ModelService}:
16
+ * every submitted document passes the boundary validation gate before
17
+ * persisting, legacy snapshots are handled per DECAF-50 §4.18, reads and
18
+ * listings are fail-closed ownership-scoped through
19
+ * {@link canAccessGraphResource} / {@link assertGraphResourceOwnership}, and
20
+ * existing-row overwrites are authorized by strict owner equality through
21
+ * {@link assertGraphResourceWriteOwnership} (SAA-105 R3).
22
+ */
10
23
  import { NotFoundError, ValidationError } from "@decaf-ts/db-decorators";
11
- import { ModelService, service, } from "@decaf-ts/core";
12
- import { assertGraphResourceOwnership } from "./../runs/ownership.js";
24
+ import { ModelService, OrderDirection, service, } from "@decaf-ts/core";
25
+ import { assertGraphResourceOwnership, assertGraphResourceWriteOwnership, canAccessGraphResource, } from "./../runs/ownership.js";
13
26
  import { isGraphJsonSafeValue, isGraphWorkflowDocumentShape, } from "./../../shared/graph/index.js";
14
27
  import { GraphWorkflowModel } from "./../../shared/graph/GraphWorkflowModel.js";
15
28
  import { DEFAULT_GRAPH_WORKFLOW_DOCUMENT_LIMITS, } from "./../validation/GraphWorkflowDocumentLimits.js";
@@ -53,6 +66,22 @@ function isCanonicalSnapshotWrapper(value) {
53
66
  function cloneWorkflowDocument(document) {
54
67
  return JSON.parse(JSON.stringify(document));
55
68
  }
69
+ /**
70
+ * Corrupt-date-safe sort key for the workflow serving list (SAA-93 F4): a
71
+ * missing or non-finite `updatedAt` sorts last (key `0`) instead of throwing.
72
+ */
73
+ function graphUpdatedAtMillis(value) {
74
+ if (value === undefined || value === null)
75
+ return 0;
76
+ let time;
77
+ try {
78
+ time = value.getTime();
79
+ }
80
+ catch {
81
+ return 0;
82
+ }
83
+ return Number.isFinite(time) ? time : 0;
84
+ }
56
85
  /**
57
86
  * Model-backed persistence for canonical workflow documents (DECAF-50
58
87
  * §4.10): saves and reads {@link GraphWorkflowModel} rows, validating every
@@ -61,7 +90,16 @@ function cloneWorkflowDocument(document) {
61
90
  * previously persisted legacy snapshots to canonical documents on read.
62
91
  * Enforces per-user ownership; absent caller identities are denied on owned
63
92
  * workflows unless the explicit DECAF-48 §4.15 standalone tolerance
64
- * (`allowAnonymousAccess`) is set (SAA-595 F3).
93
+ * (`allowAnonymousAccess`) is set for reads (SAA-595 F3). Overwriting an
94
+ * existing row is a write and is authorized by strict owner equality, so the
95
+ * read tolerance never grants an overwrite (SAA-105 R3).
96
+ *
97
+ * @remarks The overwrite gate is a read-then-write check, so it depends on the
98
+ * persistence adapter's contract (SAA-105 R3-b): `read` must throw
99
+ * `NotFoundError` for an absent row, and `create` must be create-only — it must
100
+ * reject a duplicate primary key rather than upsert. An adapter whose `create`
101
+ * upserts (or whose `read` hides an existing row) would let a named caller
102
+ * silently overwrite an owner-less row and bypass the owner-equality gate.
65
103
  */
66
104
  let GraphWorkflowService = class GraphWorkflowService extends ModelService {
67
105
  constructor(catalogue) {
@@ -93,6 +131,15 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
93
131
  * validation, and the DECAF-48 ownership tuple; creates or updates the
94
132
  * {@link GraphWorkflowModel} row accordingly.
95
133
  *
134
+ * A fresh create stamps the caller's own owner and is unconditional. An
135
+ * overwrite of an existing row is a write authorized by strict owner equality
136
+ * (SAA-105 R3): a named caller cannot overwrite an owner-less workflow and
137
+ * the `allowAnonymousAccess` read tolerance never grants an overwrite.
138
+ *
139
+ * @remarks Relies on the class-level adapter contract that `read` throws
140
+ * `NotFoundError` for an absent row and `create` rejects a duplicate primary
141
+ * key instead of upserting (SAA-105 R3-b).
142
+ *
96
143
  * @param {string} workflowId - Workflow id from the request path.
97
144
  * @param {GraphWorkflowDocument} document - Canonical document to persist (its `id` must equal `workflowId`).
98
145
  * @param args - An optional decaf `Context` carrying the owning principal.
@@ -113,14 +160,13 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
113
160
  throw new GraphWorkflowDocumentRejectedError(result.issues);
114
161
  }
115
162
  const owner = graphWorkflowOwnerOf(ctx);
116
- let existing;
117
- try {
118
- existing = (await this.read(workflowId, ...ctxArgs));
119
- }
120
- catch {
121
- existing = null;
163
+ const existing = await this.readExistingForWrite(workflowId, ctxArgs);
164
+ // Fresh create is unconditional (the caller stamps their own owner); an
165
+ // overwrite of an existing row is a write and requires strict owner
166
+ // equality (SAA-105 R3).
167
+ if (existing) {
168
+ this.assertWriteOwnership(workflowId, existing, owner);
122
169
  }
123
- this.assertOwnership(workflowId, existing, owner);
124
170
  const now = new Date();
125
171
  if (existing) {
126
172
  existing.name = document.name;
@@ -164,6 +210,62 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
164
210
  }
165
211
  throw new NotFoundError(`Graph workflow '${workflowId}' has no canonical document; legacy definition/state snapshots are no longer supported (DECAF-50 §4.26 R2-2)`);
166
212
  }
213
+ /**
214
+ * Lists the workflows visible to the requesting caller, newest update first.
215
+ *
216
+ * The collection is ownership-filtered with
217
+ * {@link canAccessGraphResource}: owner-less system workflows stay visible to
218
+ * everyone, a named caller sees their own plus owner-less workflows, and an
219
+ * anonymous caller without the explicit `allowAnonymousAccess` tolerance sees
220
+ * only owner-less workflows (SAA-595 F3). The full rows are returned so the
221
+ * HTTP boundary can project the serving summary it exposes.
222
+ *
223
+ * A store failure propagates instead of being swallowed as `[]` (SAA-93 F4):
224
+ * silently emptying the list masks an outage as "no workflows" and hides it
225
+ * from monitoring. The sort key is computed through a corrupt-date-safe helper
226
+ * so a bad persisted `updatedAt` cannot throw before the per-row projection
227
+ * guard at the HTTP boundary skips that row.
228
+ *
229
+ * @param args - An optional decaf `Context` carrying the requesting principal.
230
+ * @return {Promise<GraphWorkflowModel[]>} Visible workflows, newest first.
231
+ */
232
+ async listWorkflows(...args) {
233
+ const { ctx, ctxArgs } = (await this.logCtx(args, "listWorkflows", true)).for(this.listWorkflows);
234
+ const models = (await this.listBy("workflowId", OrderDirection.ASC, ...ctxArgs));
235
+ const owner = graphWorkflowOwnerOf(ctx);
236
+ return models
237
+ .filter((model) => canAccessGraphResource(model, owner, {
238
+ allowAnonymousAccess: this.allowAnonymousAccess,
239
+ }))
240
+ .sort((a, b) => graphUpdatedAtMillis(b.updatedAt) -
241
+ graphUpdatedAtMillis(a.updatedAt));
242
+ }
243
+ /**
244
+ * Asserts that the workflow exists and is visible to the requesting caller,
245
+ * returning the persisted row. Foreign owners surface as a `ForbiddenError`;
246
+ * unknown workflows as a `NotFoundError` (the read path's own contract).
247
+ *
248
+ * @param {string} workflowId - Workflow id to check.
249
+ * @param args - An optional decaf `Context` carrying the requesting principal.
250
+ * @return {Promise<GraphWorkflowModel>} The accessible workflow row.
251
+ * @throws {NotFoundError} When the workflow does not exist.
252
+ * @throws {ForbiddenError} When the workflow is owned by another user.
253
+ */
254
+ async assertAccess(workflowId, ...args) {
255
+ const { ctx, ctxArgs } = (await this.logCtx(args, "assertAccess", true)).for(this.assertAccess);
256
+ let model;
257
+ try {
258
+ model = (await this.read(workflowId, ...ctxArgs));
259
+ }
260
+ catch {
261
+ model = null;
262
+ }
263
+ if (!model) {
264
+ throw new NotFoundError(`No graph workflow found for workflowId '${workflowId}'`);
265
+ }
266
+ this.assertOwnership(workflowId, model, graphWorkflowOwnerOf(ctx));
267
+ return model;
268
+ }
167
269
  /**
168
270
  * Runs the nine-stage boundary validation gate over a canonical document
169
271
  * without persisting anything.
@@ -185,6 +287,14 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
185
287
  * enforcing the DECAF-48 ownership tuple and mirroring the wrapper's
186
288
  * document onto the row's canonical columns.
187
289
  *
290
+ * A fresh create is unconditional; an overwrite of an existing row is a write
291
+ * authorized by strict owner equality (SAA-105 R3) — see
292
+ * {@link saveDocument}.
293
+ *
294
+ * @remarks Relies on the class-level adapter contract that `read` throws
295
+ * `NotFoundError` for an absent row and `create` rejects a duplicate primary
296
+ * key instead of upserting (SAA-105 R3-b).
297
+ *
188
298
  * @param {string} workflowId - Workflow id from the request path.
189
299
  * @param {Record<string, unknown>} snapshot - JSON-safe canonical snapshot wrapper.
190
300
  * @param args - An optional decaf `Context` carrying the owning principal.
@@ -200,14 +310,13 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
200
310
  throw new ValidationError("Workflow snapshots must wrap a canonical GraphWorkflowDocument ({ document, editor?, metadata? }): legacy definition/state snapshots are no longer accepted; save canonical documents via PUT /graph/workflows/{workflowId}");
201
311
  }
202
312
  const owner = graphWorkflowOwnerOf(ctx);
203
- let existing;
204
- try {
205
- existing = (await this.read(workflowId, ...ctxArgs));
206
- }
207
- catch {
208
- existing = null;
313
+ const existing = await this.readExistingForWrite(workflowId, ctxArgs);
314
+ // Fresh create is unconditional (the caller stamps their own owner); an
315
+ // overwrite of an existing row is a write and requires strict owner
316
+ // equality (SAA-105 R3).
317
+ if (existing) {
318
+ this.assertWriteOwnership(workflowId, existing, owner);
209
319
  }
210
- this.assertOwnership(workflowId, existing, owner);
211
320
  const now = new Date();
212
321
  if (existing) {
213
322
  existing.snapshot = snapshot;
@@ -244,7 +353,23 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
244
353
  }
245
354
  }
246
355
  /**
247
- * Guards a persisted workflow record with the centralized
356
+ * Existence probe for the owner-equality overwrite gate (SAA-105 R3-a): only a
357
+ * genuine absence (`NotFoundError`) resolves to `null`; every other read
358
+ * failure propagates so a transient store fault is never mistaken for absence
359
+ * and downgraded into an unconditional create.
360
+ */
361
+ async readExistingForWrite(workflowId, ctxArgs) {
362
+ try {
363
+ return (await this.read(workflowId, ...ctxArgs));
364
+ }
365
+ catch (error) {
366
+ if (error instanceof NotFoundError)
367
+ return null;
368
+ throw error;
369
+ }
370
+ }
371
+ /**
372
+ * Read-visibility guard for a persisted workflow record via the centralized
248
373
  * {@link assertGraphResourceOwnership} check, honouring this service's
249
374
  * configured `allowAnonymousAccess` tolerance (SAA-595 F3).
250
375
  */
@@ -255,6 +380,18 @@ let GraphWorkflowService = class GraphWorkflowService extends ModelService {
255
380
  resourceId: workflowId,
256
381
  });
257
382
  }
383
+ /**
384
+ * Write-path guard for an existing workflow record via the centralized
385
+ * {@link assertGraphResourceWriteOwnership} check: strict owner equality,
386
+ * never the read tolerance (SAA-105 R3). Only applied to overwrites; fresh
387
+ * creates are unconditional.
388
+ */
389
+ assertWriteOwnership(workflowId, model, user) {
390
+ assertGraphResourceWriteOwnership(model ?? null, user ?? null, {
391
+ resourceKind: "Graph workflow",
392
+ resourceId: workflowId,
393
+ });
394
+ }
258
395
  async applyCanonicalWrapper(model, snapshot, ctx) {
259
396
  if (!isCanonicalSnapshotWrapper(snapshot))
260
397
  return;
@@ -1 +1 @@
1
- {"version":3,"file":"GraphWorkflowService.js","sourceRoot":"","sources":["../../../../src/engine/services/GraphWorkflowService.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,OAAO,GAGR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,4BAA4B,EAAE,+BAA0B;AACjE,OAAO,EACL,oBAAoB,EACpB,4BAA4B,GAG7B,sCAA2B;AAG5B,OAAO,EAAE,kBAAkB,EAAE,mDAA8C;AAC3E,OAAO,EACL,sCAAsC,GAEvC,uDAAkD;AACnD,OAAO,EAAE,uCAAuC,EAAE,2DAAsD;AACxG,OAAO,EAAE,kCAAkC,EAAE,2CAAsC;AACnF,OAAO,EAAE,gBAAgB,EAAE,8BAA2B;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAwB;IAExB,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAI,GAAsD,CAAC,KAAK,EAAE,CACpE,MAAM,CACP,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,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,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,IAAI,kCAAkC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1D,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;IACtC,CAAC;CACF,CAAA;AAtSY,oBAAoB;IADhC,OAAO,CAAC,kBAAkB,CAAC;;GACf,oBAAoB,CAsShC"}
1
+ {"version":3,"file":"GraphWorkflowService.js","sourceRoot":"","sources":["../../../../src/engine/services/GraphWorkflowService.ts"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,YAAY,EACZ,cAAc,EACd,OAAO,GAIR,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,iCAAiC,EACjC,sBAAsB,GACvB,+BAA0B;AAC3B,OAAO,EACL,oBAAoB,EACpB,4BAA4B,GAG7B,sCAA2B;AAG5B,OAAO,EAAE,kBAAkB,EAAE,mDAA8C;AAC3E,OAAO,EACL,sCAAsC,GAEvC,uDAAkD;AACnD,OAAO,EAAE,uCAAuC,EAAE,2DAAsD;AACxG,OAAO,EAAE,kCAAkC,EAAE,2CAAsC;AACnF,OAAO,EAAE,gBAAgB,EAAE,8BAA2B;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAClC,GAAwB;IAExB,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,IAAa,CAAC;IAClB,IAAI,CAAC;QACH,IAAI,GAAI,GAAsD,CAAC,KAAK,EAAE,CACpE,MAAM,CACP,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,GAAG,SAAS,CAAC;IACnB,CAAC;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CAAC;QAC9D,CAAC;QACD,KAAK,CAAC,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAC1D,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC;IACtC,CAAC;CACF,CAAA;AApaY,oBAAoB;IADhC,OAAO,CAAC,kBAAkB,CAAC;;GACf,oBAAoB,CAoahC"}
@@ -0,0 +1,164 @@
1
+ /**
2
+ * The exported Mastra capability table (SAA-196). Every row names a feature and
3
+ * whether Mastra supports it natively, not at all, or through a declared
4
+ * extension point. `parallel` and `pinning` are declared NOT-SUPPORTED, and
5
+ * code-mode conditions fail closed, so the wrapper fails loudly rather than
6
+ * silently degrading behaviour.
7
+ */
8
+ export const MASTRA_FEATURE_CAPABILITIES = [
9
+ {
10
+ feature: "builders",
11
+ verdict: "EXTENSION-POINT",
12
+ detail: "translate the emitted canonical document",
13
+ },
14
+ { feature: "declarativeDocument", verdict: "SUPPORTED" },
15
+ { feature: "nodeExecutorByKind", verdict: "SUPPORTED" },
16
+ {
17
+ feature: "graphicalConditions",
18
+ verdict: "SUPPORTED",
19
+ detail: "branch predicates delegate to as-graph evaluateConditionSync",
20
+ },
21
+ {
22
+ feature: "codeModeConditions",
23
+ verdict: "EXTENSION-POINT",
24
+ detail: "reuse the facade CodeSandboxEvaluator; currently fails closed",
25
+ },
26
+ { feature: "whileUntil", verdict: "SUPPORTED" },
27
+ { feature: "foreach", verdict: "SUPPORTED" },
28
+ {
29
+ feature: "parallel",
30
+ verdict: "NOT-SUPPORTED",
31
+ detail: "fan-out/fan-in topology is not translated by the compiler",
32
+ },
33
+ { feature: "parametersStateBindings", verdict: "SUPPORTED" },
34
+ { feature: "runsSnapshotsObservables", verdict: "SUPPORTED" },
35
+ {
36
+ feature: "edgeStateEvents",
37
+ verdict: "EXTENSION-POINT",
38
+ detail: "derived from the document's declared routing",
39
+ },
40
+ {
41
+ feature: "suspendResume",
42
+ verdict: "EXTENSION-POINT",
43
+ detail: "Mastra native; exposed through the optional backend resume?() extension",
44
+ },
45
+ { feature: "humanApproval", verdict: "SUPPORTED" },
46
+ {
47
+ feature: "pinning",
48
+ verdict: "NOT-SUPPORTED",
49
+ detail: "wrapper-managed value adapter only",
50
+ },
51
+ { feature: "errorBoundary", verdict: "PARTIAL" },
52
+ { feature: "agentLlmNode", verdict: "SUPPORTED" },
53
+ {
54
+ feature: "dynamicTopology",
55
+ verdict: "NOT-SUPPORTED",
56
+ detail: "recompile on document fingerprint change",
57
+ },
58
+ { feature: "durableExecution", verdict: "SUPPORTED" },
59
+ {
60
+ feature: "aiStepSurfaces",
61
+ verdict: "EXTENSION-POINT",
62
+ detail: "projected read-only via node metadata; no shared type changes",
63
+ },
64
+ {
65
+ feature: "workflowList",
66
+ verdict: "SUPPORTED",
67
+ detail: "over the compiled-workflow cache",
68
+ },
69
+ {
70
+ feature: "workflowLookup",
71
+ verdict: "SUPPORTED",
72
+ detail: "over the compiled-workflow cache",
73
+ },
74
+ {
75
+ feature: "workflowCreate",
76
+ verdict: "SUPPORTED",
77
+ detail: "compile a canonical document and register it on the wired Mastra runtime (real addWorkflow)",
78
+ },
79
+ {
80
+ feature: "workflowUpdate",
81
+ verdict: "SUPPORTED",
82
+ detail: "recompile and replace the live registration (real removeWorkflow then addWorkflow)",
83
+ },
84
+ {
85
+ feature: "workflowDelete",
86
+ verdict: "SUPPORTED",
87
+ detail: "remove the live registration (real removeWorkflow)",
88
+ },
89
+ {
90
+ feature: "workflowRegistryList",
91
+ verdict: "SUPPORTED",
92
+ detail: "list the registered workflows (real listWorkflows)",
93
+ },
94
+ {
95
+ feature: "workflowRegistryLookup",
96
+ verdict: "SUPPORTED",
97
+ detail: "read a registered workflow (real getWorkflow)",
98
+ },
99
+ {
100
+ feature: "workflowSerialize",
101
+ verdict: "SUPPORTED",
102
+ detail: "the real Workflow.serializedStepGraph of a registered workflow",
103
+ },
104
+ {
105
+ feature: "workflowPersist",
106
+ verdict: "NOT-SUPPORTED",
107
+ detail: "real addDynamicWorkflow persists only agent/tool-referenced steps; the canonical translation emits host code steps",
108
+ },
109
+ {
110
+ feature: "workflowVersion",
111
+ verdict: "EXTENSION-POINT",
112
+ detail: "Mastra has no native workflow version; the wrapper tracks the canonical document fingerprint",
113
+ },
114
+ ];
115
+ /**
116
+ * Resolves a feature row's three-valued management status from the exported
117
+ * table, mapping the wrapper's `SUPPORTED`/`NOT-SUPPORTED`/`EXTENSION-POINT`
118
+ * verdicts onto the projection's lowercase vocabulary.
119
+ *
120
+ * @param feature - The feature row name to resolve.
121
+ * @returns The three-valued management status.
122
+ */
123
+ export function mastraCapabilityStatusOf(feature) {
124
+ const verdict = mastraCapabilityOf(feature)?.verdict;
125
+ if (verdict === "SUPPORTED")
126
+ return "supported";
127
+ if (verdict === "EXTENSION-POINT")
128
+ return "extension_point";
129
+ // Fail closed (C6): a missing/renamed row or a PARTIAL verdict must never
130
+ // silently resolve to `supported`.
131
+ return "not_supported";
132
+ }
133
+ /**
134
+ * Engine-agnostic capability projection of the Mastra backend: no in-process
135
+ * code execution, workflow list/lookup supported over the compiled-workflow cache,
136
+ * and the SAA-346 workflow-management statuses resolved from the exported table.
137
+ *
138
+ * @returns The {@link MastraBackendCapabilities} served by the Mastra backend.
139
+ */
140
+ export function resolveMastraCapabilities() {
141
+ return {
142
+ codeMode: "unsupported",
143
+ workflows: {
144
+ list: "supported",
145
+ get: "supported",
146
+ create: mastraCapabilityStatusOf("workflowCreate"),
147
+ update: mastraCapabilityStatusOf("workflowUpdate"),
148
+ delete: mastraCapabilityStatusOf("workflowDelete"),
149
+ serialize: mastraCapabilityStatusOf("workflowSerialize"),
150
+ persist: mastraCapabilityStatusOf("workflowPersist"),
151
+ version: mastraCapabilityStatusOf("workflowVersion"),
152
+ },
153
+ };
154
+ }
155
+ /**
156
+ * Looks up one capability row by feature name.
157
+ *
158
+ * @param feature - The engine feature name to look up.
159
+ * @returns The capability row, or `undefined` for an unknown feature.
160
+ */
161
+ export function mastraCapabilityOf(feature) {
162
+ return MASTRA_FEATURE_CAPABILITIES.find((row) => row.feature === feature);
163
+ }
164
+ //# sourceMappingURL=MastraCapabilities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MastraCapabilities.js","sourceRoot":"","sources":["../../../src/mastra/MastraCapabilities.ts"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAuC;IAC7E;QACE,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,0CAA0C;KACnD;IACD,EAAE,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,WAAW,EAAE;IACxD,EAAE,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,WAAW,EAAE;IACvD;QACE,OAAO,EAAE,qBAAqB;QAC9B,OAAO,EAAE,WAAW;QACpB,MAAM,EAAE,8DAA8D;KACvE;IACD;QACE,OAAO,EAAE,oBAAoB;QAC7B,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,+DAA+D;KACxE;IACD,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE;IAC/C,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE;IAC5C;QACE,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,eAAe;QACxB,MAAM,EAAE,2DAA2D;KACpE;IACD,EAAE,OAAO,EAAE,yBAAyB,EAAE,OAAO,EAAE,WAAW,EAAE;IAC5D,EAAE,OAAO,EAAE,0BAA0B,EAAE,OAAO,EAAE,WAAW,EAAE;IAC7D;QACE,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EAAE,8CAA8C;KACvD;IACD;QACE,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,iBAAiB;QAC1B,MAAM,EACJ,yEAAyE;KAC5E;IACD,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,E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