@decaf-ts/as-graph 0.2.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/README.md +274 -2
  2. package/dist/as-graph.cjs +1 -1
  3. package/dist/as-graph.cjs.map +1 -1
  4. package/dist/as-graph.js +1 -1
  5. package/dist/as-graph.js.map +1 -1
  6. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs +344 -0
  7. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs.map +1 -0
  8. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs +789 -0
  9. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs.map +1 -0
  10. package/lib/cjs/dagster/DagsterGraphQLClient.cjs +738 -0
  11. package/lib/cjs/dagster/DagsterGraphQLClient.cjs.map +1 -0
  12. package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
  13. package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
  14. package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
  15. package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
  16. package/lib/cjs/dagster/capabilities.cjs +102 -0
  17. package/lib/cjs/dagster/capabilities.cjs.map +1 -0
  18. package/lib/cjs/dagster/constants.cjs +92 -0
  19. package/lib/cjs/dagster/constants.cjs.map +1 -0
  20. package/lib/cjs/dagster/index.cjs +33 -0
  21. package/lib/cjs/dagster/index.cjs.map +1 -0
  22. package/lib/cjs/engine/constants.cjs +6 -1
  23. package/lib/cjs/engine/constants.cjs.map +1 -1
  24. package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
  25. package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
  26. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
  27. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
  28. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
  29. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
  30. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
  31. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  32. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
  33. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
  34. package/lib/cjs/engine/execution/index.cjs +4 -0
  35. package/lib/cjs/engine/execution/index.cjs.map +1 -1
  36. package/lib/cjs/engine/index.cjs +4 -0
  37. package/lib/cjs/engine/index.cjs.map +1 -1
  38. package/lib/cjs/engine/runs/GraphRunService.cjs +61 -0
  39. package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
  40. package/lib/cjs/engine/services/GraphWorkflowService.cjs +33 -14
  41. package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
  42. package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
  43. package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
  44. package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
  45. package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
  46. package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
  47. package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
  48. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
  49. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
  50. package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
  51. package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
  52. package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
  53. package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
  54. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
  55. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
  56. package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
  57. package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
  58. package/lib/cjs/mastra/index.cjs +35 -0
  59. package/lib/cjs/mastra/index.cjs.map +1 -0
  60. package/lib/cjs/mastra/types.cjs +34 -0
  61. package/lib/cjs/mastra/types.cjs.map +1 -0
  62. package/lib/cjs/nest/graph/GraphBackendHost.cjs +146 -0
  63. package/lib/cjs/nest/graph/GraphBackendHost.cjs.map +1 -0
  64. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
  65. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
  66. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
  67. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
  68. package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
  69. package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
  70. package/lib/cjs/nest/graph/GraphExecutionModule.cjs +31 -2
  71. package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
  72. package/lib/cjs/nest/graph/index.cjs +4 -0
  73. package/lib/cjs/nest/graph/index.cjs.map +1 -1
  74. package/lib/cjs/nest/graph/main.cjs +139 -0
  75. package/lib/cjs/nest/graph/main.cjs.map +1 -0
  76. package/lib/cjs/nest/graph/servingErrors.cjs +3 -0
  77. package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -1
  78. package/lib/cjs/node/utility/code/node.cjs +11 -3
  79. package/lib/cjs/node/utility/code/node.cjs.map +1 -1
  80. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
  81. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
  82. package/lib/cjs/shared/graph/constants.cjs +8 -0
  83. package/lib/cjs/shared/graph/constants.cjs.map +1 -1
  84. package/lib/cjs/shared/graph/index.cjs +2 -1
  85. package/lib/cjs/shared/graph/index.cjs.map +1 -1
  86. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
  87. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
  88. package/lib/cjs/shared/graph/layout/index.cjs +23 -0
  89. package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
  90. package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
  91. package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
  92. package/lib/cjs/shared/ui/index.cjs +8 -10
  93. package/lib/cjs/shared/ui/index.cjs.map +1 -1
  94. package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
  95. package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
  96. package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
  97. package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
  98. package/lib/esm/dagster/DagsterGraphQLClient.js +733 -0
  99. package/lib/esm/dagster/DagsterGraphQLClient.js.map +1 -0
  100. package/lib/esm/dagster/DagsterResultMapper.js +51 -0
  101. package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
  102. package/lib/esm/dagster/DagsterTypes.js +2 -0
  103. package/lib/esm/dagster/DagsterTypes.js.map +1 -0
  104. package/lib/esm/dagster/capabilities.js +97 -0
  105. package/lib/esm/dagster/capabilities.js.map +1 -0
  106. package/lib/esm/dagster/constants.js +88 -0
  107. package/lib/esm/dagster/constants.js.map +1 -0
  108. package/lib/esm/dagster/index.js +16 -0
  109. package/lib/esm/dagster/index.js.map +1 -0
  110. package/lib/esm/engine/constants.js +5 -0
  111. package/lib/esm/engine/constants.js.map +1 -1
  112. package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
  113. package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
  114. package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
  115. package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
  116. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
  117. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
  118. package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
  119. package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
  120. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
  121. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
  122. package/lib/esm/engine/execution/index.js +4 -0
  123. package/lib/esm/engine/execution/index.js.map +1 -1
  124. package/lib/esm/engine/index.js +4 -0
  125. package/lib/esm/engine/index.js.map +1 -1
  126. package/lib/esm/engine/runs/GraphRunService.js +62 -1
  127. package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
  128. package/lib/esm/engine/services/GraphWorkflowService.js +33 -14
  129. package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
  130. package/lib/esm/mastra/MastraCapabilities.js +164 -0
  131. package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
  132. package/lib/esm/mastra/MastraConditionBridge.js +34 -0
  133. package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
  134. package/lib/esm/mastra/MastraEventBridge.js +481 -0
  135. package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
  136. package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
  137. package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
  138. package/lib/esm/mastra/MastraResumeGuard.js +123 -0
  139. package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
  140. package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
  141. package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
  142. package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
  143. package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
  144. package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
  145. package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
  146. package/lib/esm/mastra/index.js +18 -0
  147. package/lib/esm/mastra/index.js.map +1 -0
  148. package/lib/esm/mastra/types.js +30 -0
  149. package/lib/esm/mastra/types.js.map +1 -0
  150. package/lib/esm/nest/graph/GraphBackendHost.js +138 -0
  151. package/lib/esm/nest/graph/GraphBackendHost.js.map +1 -0
  152. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
  153. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
  154. package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
  155. package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
  156. package/lib/esm/nest/graph/GraphEngineController.js +218 -0
  157. package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
  158. package/lib/esm/nest/graph/GraphExecutionModule.js +31 -2
  159. package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
  160. package/lib/esm/nest/graph/index.js +4 -0
  161. package/lib/esm/nest/graph/index.js.map +1 -1
  162. package/lib/esm/nest/graph/main.js +103 -0
  163. package/lib/esm/nest/graph/main.js.map +1 -0
  164. package/lib/esm/nest/graph/servingErrors.js +3 -0
  165. package/lib/esm/nest/graph/servingErrors.js.map +1 -1
  166. package/lib/esm/node/utility/code/node.js +11 -3
  167. package/lib/esm/node/utility/code/node.js.map +1 -1
  168. package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
  169. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
  170. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
  171. package/lib/esm/shared/graph/constants.js +8 -0
  172. package/lib/esm/shared/graph/constants.js.map +1 -1
  173. package/lib/esm/shared/graph/index.js +2 -1
  174. package/lib/esm/shared/graph/index.js.map +1 -1
  175. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
  176. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
  177. package/lib/esm/shared/graph/layout/index.js +6 -0
  178. package/lib/esm/shared/graph/layout/index.js.map +1 -0
  179. package/lib/esm/shared/graph/layout/layout-options.js +96 -0
  180. package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
  181. package/lib/esm/shared/ui/index.js +8 -10
  182. package/lib/esm/shared/ui/index.js.map +1 -1
  183. package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
  184. package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
  185. package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
  186. package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
  187. package/lib/types/dagster/DagsterGraphQLClient.d.cts +231 -0
  188. package/lib/types/dagster/DagsterGraphQLClient.d.mts +231 -0
  189. package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
  190. package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
  191. package/lib/types/dagster/DagsterTypes.d.cts +355 -0
  192. package/lib/types/dagster/DagsterTypes.d.mts +355 -0
  193. package/lib/types/dagster/capabilities.d.cts +34 -0
  194. package/lib/types/dagster/capabilities.d.mts +34 -0
  195. package/lib/types/dagster/constants.d.cts +87 -0
  196. package/lib/types/dagster/constants.d.mts +87 -0
  197. package/lib/types/dagster/index.d.cts +15 -0
  198. package/lib/types/dagster/index.d.mts +15 -0
  199. package/lib/types/engine/constants.d.cts +5 -0
  200. package/lib/types/engine/constants.d.mts +5 -0
  201. package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
  202. package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
  203. package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
  204. package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
  205. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
  206. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
  207. package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
  208. package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
  209. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
  210. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
  211. package/lib/types/engine/execution/index.d.cts +4 -0
  212. package/lib/types/engine/execution/index.d.mts +4 -0
  213. package/lib/types/engine/index.d.cts +4 -0
  214. package/lib/types/engine/index.d.mts +4 -0
  215. package/lib/types/engine/runs/GraphRunService.d.cts +19 -0
  216. package/lib/types/engine/runs/GraphRunService.d.mts +19 -0
  217. package/lib/types/engine/services/GraphWorkflowService.d.cts +22 -0
  218. package/lib/types/engine/services/GraphWorkflowService.d.mts +22 -0
  219. package/lib/types/mastra/MastraCapabilities.d.cts +86 -0
  220. package/lib/types/mastra/MastraCapabilities.d.mts +86 -0
  221. package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
  222. package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
  223. package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
  224. package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
  225. package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
  226. package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
  227. package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
  228. package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
  229. package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
  230. package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
  231. package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
  232. package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
  233. package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
  234. package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
  235. package/lib/types/mastra/index.d.cts +17 -0
  236. package/lib/types/mastra/index.d.mts +17 -0
  237. package/lib/types/mastra/types.d.cts +222 -0
  238. package/lib/types/mastra/types.d.mts +222 -0
  239. package/lib/types/nest/graph/GraphBackendHost.d.cts +100 -0
  240. package/lib/types/nest/graph/GraphBackendHost.d.mts +100 -0
  241. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
  242. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
  243. package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
  244. package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
  245. package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
  246. package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
  247. package/lib/types/nest/graph/GraphExecutionModule.d.cts +20 -0
  248. package/lib/types/nest/graph/GraphExecutionModule.d.mts +20 -0
  249. package/lib/types/nest/graph/index.d.cts +4 -0
  250. package/lib/types/nest/graph/index.d.mts +4 -0
  251. package/lib/types/nest/graph/main.d.cts +1 -0
  252. package/lib/types/nest/graph/main.d.mts +1 -0
  253. package/lib/types/nest/graph/servingErrors.d.cts +3 -1
  254. package/lib/types/nest/graph/servingErrors.d.mts +3 -1
  255. package/lib/types/node/utility/code/node.d.cts +1 -1
  256. package/lib/types/node/utility/code/node.d.mts +1 -1
  257. package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
  258. package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
  259. package/lib/types/shared/graph/constants.d.cts +8 -0
  260. package/lib/types/shared/graph/constants.d.mts +8 -0
  261. package/lib/types/shared/graph/index.d.cts +2 -1
  262. package/lib/types/shared/graph/index.d.mts +2 -1
  263. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
  264. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
  265. package/lib/types/shared/graph/layout/index.d.cts +5 -0
  266. package/lib/types/shared/graph/layout/index.d.mts +5 -0
  267. package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
  268. package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
  269. package/lib/types/shared/graph/types.d.cts +4 -3
  270. package/lib/types/shared/graph/types.d.mts +4 -3
  271. package/lib/types/shared/ui/index.d.cts +8 -10
  272. package/lib/types/shared/ui/index.d.mts +8 -10
  273. package/package.json +55 -6
  274. package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
  275. package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
  276. package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
  277. package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
  278. package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
  279. package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
  280. package/lib/cjs/shared/ui/types.cjs +0 -4
  281. package/lib/cjs/shared/ui/types.cjs.map +0 -1
  282. package/lib/esm/shared/ui/GraphNodeView.js +0 -107
  283. package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
  284. package/lib/esm/shared/ui/GraphRunView.js +0 -90
  285. package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
  286. package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
  287. package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
  288. package/lib/esm/shared/ui/types.js +0 -2
  289. package/lib/esm/shared/ui/types.js.map +0 -1
  290. package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
  291. package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
  292. package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
  293. package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
  294. package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
  295. package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
  296. package/lib/types/shared/ui/types.d.cts +0 -200
  297. package/lib/types/shared/ui/types.d.mts +0 -200
@@ -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,+DAA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M,GAAG,kCAAkC,CAAC,OAAO,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM;YACP,SAAS;QACb,OAAO,CAAC,IAAI,CAAC;YACT,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,KAAK,EAAE,OAAO,CAAC,KAAK,KAAK,IAAI;YAC7B,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;YAC/C,YAAY,EAAE,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC;SACpE,CAAC,CAAC;IACP,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC9D,MAAM,cAAc,GAAG,gEAA6B,CAAC,cAAc,CAAC;IACpE,MAAM,eAAe,GAAG,eAAe,IAAI,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC;QAC/D,CAAC,CAAC,eAAe;QACjB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC;YACrB,CAAC,CAAC,cAAc;YAChB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,QAAQ,IAAI,cAAc,CAAC,CAAC;IACnD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC;AACzD,CAAC;AACD,yDAAyD"}
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphEngineCapabilityService = exports.DEFAULT_GRAPH_ENGINE_RATE_LIMIT = exports.GRAPH_ENGINE_CAPABILITY_OPTIONS = void 0;
4
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
7
+ r = Reflect.decorate(decorators, target, key, desc);
8
+ else
9
+ for (var i = decorators.length - 1; i >= 0; i--)
10
+ if (d = decorators[i])
11
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __metadata = (this && this.__metadata) || function (k, v) {
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
16
+ return Reflect.metadata(k, v);
17
+ };
18
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
19
+ return function (target, key) { decorator(target, key, paramIndex); };
20
+ };
21
+ /**
22
+ * @module as-graph/nest/graph/GraphEngineCapabilityService
23
+ * @summary Engine capability manifest + workflow-catalogue service (SAA-197).
24
+ * @description Holds the statically-derived, boot-time capability manifest and
25
+ * resolves the engine-scoped workflow listing/lookup through the engine-agnostic
26
+ * {@link GraphExecutionEngine} facade. The manifest is never rebuilt per request
27
+ * and no remote engine is probed (C21).
28
+ */
29
+ const common_1 = require("@nestjs/common");
30
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
31
+ const GraphExecutionBackendRegistry_js_1 = require("./../../engine/execution/GraphExecutionBackendRegistry.cjs");
32
+ const GraphEngineCapabilityManifest_js_1 = require("./GraphEngineCapabilityManifest.cjs");
33
+ /** DI token for {@link GraphEngineCapabilityOptions}. */
34
+ exports.GRAPH_ENGINE_CAPABILITY_OPTIONS = "GRAPH_ENGINE_CAPABILITY_OPTIONS";
35
+ /**
36
+ * Default rate limit for the engine capability routes: 120 requests per 60-second
37
+ * window, applied by the `@nestjs/throttler` guard on the `engines` bucket.
38
+ */
39
+ exports.DEFAULT_GRAPH_ENGINE_RATE_LIMIT = {
40
+ windowMs: 60_000,
41
+ maxRequests: 120,
42
+ };
43
+ /**
44
+ * Owns the boot-time capability manifest and resolves engine-scoped workflow
45
+ * listing/lookup. The manifest is built once in the constructor from the
46
+ * registered backends; request handling never mutates it and never probes a remote
47
+ * engine.
48
+ */
49
+ let GraphEngineCapabilityService = class GraphEngineCapabilityService {
50
+ /**
51
+ * @param options - Controller options (auth, default engine id, rate limit).
52
+ * @param engine - The engine facade resolving flavour-scoped listing/lookup.
53
+ */
54
+ constructor(options = {}, engine) {
55
+ this.engine = engine;
56
+ this.manifest = (0, GraphEngineCapabilityManifest_js_1.buildGraphEngineCapabilityManifest)(GraphExecutionBackendRegistry_js_1.GraphExecutionBackendRegistry.list(), options.defaultEngineId);
57
+ this.engineIds = new Set(this.manifest.engines.map((engine) => engine.engineId));
58
+ }
59
+ /**
60
+ * Returns a defensive copy of the statically-derived capability manifest.
61
+ *
62
+ * @returns The C20 capability manifest snapshot.
63
+ */
64
+ manifestSnapshot() {
65
+ return {
66
+ engines: this.manifest.engines.map((engine) => ({
67
+ ...engine,
68
+ capabilities: engine.capabilities.map((row) => ({ ...row })),
69
+ })),
70
+ defaultEngineId: this.manifest.defaultEngineId,
71
+ };
72
+ }
73
+ /**
74
+ * Returns a defensive copy of a single allowlisted engine descriptor.
75
+ *
76
+ * @param engineId - The engine id to look up.
77
+ * @returns The engine descriptor, or `undefined` when not allowlisted.
78
+ */
79
+ descriptor(engineId) {
80
+ const engine = this.manifest.engines.find((entry) => entry.engineId === engineId);
81
+ if (!engine)
82
+ return undefined;
83
+ return {
84
+ ...engine,
85
+ capabilities: engine.capabilities.map((row) => ({ ...row })),
86
+ };
87
+ }
88
+ /**
89
+ * Whether the engine id is registered and allowlisted.
90
+ *
91
+ * @param engineId - The engine id to check.
92
+ * @returns `true` when the id is an available engine.
93
+ */
94
+ isKnownEngine(engineId) {
95
+ return this.engineIds.has(engineId);
96
+ }
97
+ /**
98
+ * Lists the workflows a registered engine can surface through the engine-agnostic
99
+ * facade, which applies the fail-closed capability gate and the
100
+ * `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` error code.
101
+ *
102
+ * @param engineId - The allowlisted engine id to list for.
103
+ * @param args - Optional decaf contextual arguments forwarded to the backend.
104
+ * @returns Workflow summaries.
105
+ * @throws {GraphExecutionError} when the engine declares no listing support.
106
+ */
107
+ async listWorkflows(engineId, ...args) {
108
+ return await this.requireEngine().listEngineWorkflows(engineId, ...args);
109
+ }
110
+ /**
111
+ * Looks up a single canonical workflow document on a registered engine through
112
+ * the engine-agnostic facade.
113
+ *
114
+ * @param engineId - The allowlisted engine id to read from.
115
+ * @param workflowId - The canonical workflow id to read.
116
+ * @param args - Optional decaf contextual arguments forwarded to the backend.
117
+ * @returns The canonical workflow document.
118
+ * @throws {GraphExecutionError} when the engine declares no lookup support.
119
+ */
120
+ async getWorkflow(engineId, workflowId, ...args) {
121
+ return await this.requireEngine().getEngineWorkflow(engineId, workflowId, ...args);
122
+ }
123
+ /** Resolves the engine facade, failing closed when it is not wired. */
124
+ requireEngine() {
125
+ if (!this.engine) {
126
+ throw new db_decorators_1.InternalError("Graph engine is not available; engine workflow catalogue cannot be resolved");
127
+ }
128
+ return this.engine;
129
+ }
130
+ };
131
+ exports.GraphEngineCapabilityService = GraphEngineCapabilityService;
132
+ exports.GraphEngineCapabilityService = GraphEngineCapabilityService = __decorate([
133
+ (0, common_1.Injectable)(),
134
+ __param(0, (0, common_1.Optional)()),
135
+ __param(0, (0, common_1.Inject)(exports.GRAPH_ENGINE_CAPABILITY_OPTIONS)),
136
+ __param(1, (0, common_1.Optional)()),
137
+ __metadata("design:paramtypes", [Object, Function])
138
+ ], GraphEngineCapabilityService);
139
+ //# sourceMappingURL=GraphEngineCapabilityService.js.map
140
+ //# sourceMappingURL=GraphEngineCapabilityService.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest/graph/GraphEngineCapabilityService.cjs","sourceRoot":"","sources":["nest/graph/GraphEngineCapabilityService.js"],"names":[],"mappings":";;;AAAA,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,UAAU,EAAE,MAAM,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AAC;AAQO,oEAA4B;AAPrC,uCAAA,4BAA4B,GAAG,UAAU,CAAC;IACtC,IAAA,mBAAU,GAAE;IACZ,OAAO,CAAC,CAAC,EAAE,IAAA,iBAAQ,GAAE,CAAC;IACtB,OAAO,CAAC,CAAC,EAAE,IAAA,eAAM,EAAC,uCAA+B,CAAC,CAAC;IACnD,OAAO,CAAC,CAAC,EAAE,IAAA,iBAAQ,GAAE,CAAC;IACtB,UAAU,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;CACtD,EAAE,4BAA4B,CAAC,CAAC;AAEjC,wDAAwD"}
@@ -0,0 +1,227 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GraphEngineController = void 0;
4
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
5
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
6
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
7
+ r = Reflect.decorate(decorators, target, key, desc);
8
+ else
9
+ for (var i = decorators.length - 1; i >= 0; i--)
10
+ if (d = decorators[i])
11
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
12
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
13
+ };
14
+ var __metadata = (this && this.__metadata) || function (k, v) {
15
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
16
+ return Reflect.metadata(k, v);
17
+ };
18
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
19
+ return function (target, key) { decorator(target, key, paramIndex); };
20
+ };
21
+ /**
22
+ * @module as-graph/nest/graph/GraphEngineController
23
+ * @summary Engine capability manifest + workflow-catalogue HTTP API (SAA-197,
24
+ * SAA-193 C20/C21).
25
+ * @description Serves the statically-derived engine capability manifest and the
26
+ * engine-scoped workflow listing/lookup over read-only `GET` routes under the
27
+ * `graph/engines` namespace. The routes carry the same authentication posture
28
+ * as the other graph read routes, select engines by allowlisted id only (zero query
29
+ * reflection), are rate-limited on the dedicated `engines` throttler bucket, and
30
+ * map engine errors without ever surfacing `GraphExecutionError.details`.
31
+ */
32
+ const common_1 = require("@nestjs/common");
33
+ const throttler_1 = require("@nestjs/throttler");
34
+ const db_decorators_1 = require("@decaf-ts/db-decorators");
35
+ const for_nest_1 = require("@decaf-ts/for-nest");
36
+ const GraphExecutionError_js_1 = require("./../../engine/errors/GraphExecutionError.cjs");
37
+ const GraphWorkflowService_js_1 = require("./../../engine/services/GraphWorkflowService.cjs");
38
+ const GraphEngineCapabilityService_js_1 = require("./GraphEngineCapabilityService.cjs");
39
+ const servingDates_js_1 = require("./servingDates.cjs");
40
+ const servingErrors_js_1 = require("./servingErrors.cjs");
41
+ /**
42
+ * Maps a thrown engine-catalogue error to the Nest HTTP equivalent: a backend
43
+ * that declares no workflow catalogue becomes `501`, and any other unmapped error
44
+ * surfaces as a constant generic `500` with the underlying error logged
45
+ * server-side only. `GraphExecutionError.details` is never surfaced to clients.
46
+ *
47
+ * @param {unknown} e - The caught error from the engine facade.
48
+ * @param {GraphServingErrorCorrelation} [correlation] - Request correlation ids attached to the server-side log.
49
+ * @return {HttpException} The HTTP-mapped error to rethrow.
50
+ */
51
+ function graphEngineHttpErrorOf(e, correlation = {}) {
52
+ if (e instanceof GraphExecutionError_js_1.GraphExecutionError) {
53
+ if (e.graphCode === "GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED") {
54
+ return new common_1.HttpException("Graph workflow catalogue is not supported by the selected engine", common_1.HttpStatus.NOT_IMPLEMENTED);
55
+ }
56
+ (0, servingErrors_js_1.logUnmappedGraphServingError)("GraphEngineController", e, correlation);
57
+ return new common_1.HttpException(servingErrors_js_1.GRAPH_SERVING_INTERNAL_ERROR_MESSAGE, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
58
+ }
59
+ if (e instanceof db_decorators_1.NotFoundError) {
60
+ return new common_1.NotFoundException(e.message);
61
+ }
62
+ if (e instanceof common_1.HttpException)
63
+ return e;
64
+ (0, servingErrors_js_1.logUnmappedGraphServingError)("GraphEngineController", e, correlation);
65
+ return new common_1.HttpException(servingErrors_js_1.GRAPH_SERVING_INTERNAL_ERROR_MESSAGE, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
66
+ }
67
+ /**
68
+ * Engine capability manifest and engine-scoped workflow catalogue endpoints:
69
+ *
70
+ * - `GET /graph/engines` — the C20 capability manifest for every available
71
+ * (registered, allowlisted) engine.
72
+ * - `GET /graph/engines/{engineId}` — one engine descriptor.
73
+ * - `GET /graph/engines/{engineId}/workflows` — the workflows that engine
74
+ * surfaces through the engine-agnostic facade.
75
+ * - `GET /graph/engines/{engineId}/workflows/{workflowId}` — one canonical
76
+ * workflow document from that engine.
77
+ *
78
+ * All routes are read-only `GET`s, select engines by allowlisted id only, and
79
+ * never reflect arbitrary query input.
80
+ */
81
+ let GraphEngineController = class GraphEngineController {
82
+ constructor(capabilityService, requestContext, options = {}) {
83
+ this.capabilityService = capabilityService;
84
+ this.requestContext = requestContext;
85
+ this.options = options;
86
+ }
87
+ /**
88
+ * Enforces the configured authentication mode: `auth` defaults to `"required"`
89
+ * and rejects a request with no request context, or with a context that carries
90
+ * no resolved owner user, with `401`; `"optional"` admits anonymous requests.
91
+ */
92
+ requireAuthenticatedContext() {
93
+ if ((this.options.auth ?? "required") !== "required") {
94
+ return this.requestContext;
95
+ }
96
+ if (!this.requestContext) {
97
+ throw new common_1.HttpException("Graph engine access requires an authenticated request context", common_1.HttpStatus.UNAUTHORIZED);
98
+ }
99
+ if ((0, GraphWorkflowService_js_1.graphWorkflowOwnerOf)(this.requestContext) === undefined) {
100
+ throw new common_1.HttpException("Graph engine access requires an authenticated user", common_1.HttpStatus.UNAUTHORIZED);
101
+ }
102
+ return this.requestContext;
103
+ }
104
+ assertKnownEngine(engineId) {
105
+ if (!this.capabilityService.isKnownEngine(engineId)) {
106
+ throw new common_1.NotFoundException(`No graph engine '${engineId}' is available`);
107
+ }
108
+ }
109
+ /**
110
+ * Returns the capability manifest for every available engine.
111
+ *
112
+ * @return {Promise<GraphEngineCapabilityManifest>} The C20 capability manifest.
113
+ * @throws {HttpException} 401 without an authenticated caller.
114
+ */
115
+ async getManifest() {
116
+ this.requireAuthenticatedContext();
117
+ return this.capabilityService.manifestSnapshot();
118
+ }
119
+ /**
120
+ * Returns one allowlisted engine's capability descriptor.
121
+ *
122
+ * @param {string} engineId - Allowlisted engine id path parameter.
123
+ * @return {Promise<GraphEngineDescriptor>} The engine descriptor.
124
+ * @throws {HttpException} 404 when the engine id is not available.
125
+ */
126
+ async getEngine(engineId) {
127
+ this.requireAuthenticatedContext();
128
+ const engine = this.capabilityService.descriptor(engineId);
129
+ if (!engine) {
130
+ throw new common_1.NotFoundException(`No graph engine '${engineId}' is available`);
131
+ }
132
+ return engine;
133
+ }
134
+ /**
135
+ * Lists the workflows the selected engine surfaces through the
136
+ * engine-agnostic facade.
137
+ *
138
+ * @param {string} engineId - Allowlisted engine id path parameter.
139
+ * @return {Promise<GraphEngineWorkflowSummary[]>} Workflow summaries.
140
+ * @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no listing support.
141
+ */
142
+ async listWorkflows(engineId) {
143
+ const context = this.requireAuthenticatedContext();
144
+ this.assertKnownEngine(engineId);
145
+ try {
146
+ const summaries = await this.capabilityService.listWorkflows(engineId, context);
147
+ return summaries.map((summary) => {
148
+ const updatedAt = (0, servingDates_js_1.toIsoDateString)(summary.updatedAt);
149
+ return {
150
+ workflowId: summary.id,
151
+ ...(summary.name !== undefined ? { name: summary.name } : {}),
152
+ ...(updatedAt !== undefined ? { updatedAt } : {}),
153
+ };
154
+ });
155
+ }
156
+ catch (e) {
157
+ throw graphEngineHttpErrorOf(e, { engineId });
158
+ }
159
+ }
160
+ /**
161
+ * Returns one canonical workflow document from the selected engine through the
162
+ * engine-agnostic facade.
163
+ *
164
+ * @param {string} engineId - Allowlisted engine id path parameter.
165
+ * @param {string} workflowId - Canonical workflow id path parameter.
166
+ * @return {Promise<GraphWorkflowDocument>} The canonical workflow document.
167
+ * @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no lookup support.
168
+ */
169
+ async getWorkflow(engineId, workflowId) {
170
+ const context = this.requireAuthenticatedContext();
171
+ this.assertKnownEngine(engineId);
172
+ try {
173
+ return await this.capabilityService.getWorkflow(engineId, workflowId, context);
174
+ }
175
+ catch (e) {
176
+ throw graphEngineHttpErrorOf(e, { engineId, workflowId });
177
+ }
178
+ }
179
+ };
180
+ exports.GraphEngineController = GraphEngineController;
181
+ __decorate([
182
+ (0, throttler_1.SkipThrottle)({ default: true }),
183
+ (0, throttler_1.Throttle)({ engines: {} }),
184
+ (0, common_1.Get)(),
185
+ __metadata("design:type", Function),
186
+ __metadata("design:paramtypes", []),
187
+ __metadata("design:returntype", Promise)
188
+ ], GraphEngineController.prototype, "getManifest", null);
189
+ __decorate([
190
+ (0, throttler_1.SkipThrottle)({ default: true }),
191
+ (0, throttler_1.Throttle)({ engines: {} }),
192
+ (0, common_1.Get)(":engineId"),
193
+ __param(0, (0, common_1.Param)("engineId")),
194
+ __metadata("design:type", Function),
195
+ __metadata("design:paramtypes", [String]),
196
+ __metadata("design:returntype", Promise)
197
+ ], GraphEngineController.prototype, "getEngine", null);
198
+ __decorate([
199
+ (0, throttler_1.SkipThrottle)({ default: true }),
200
+ (0, throttler_1.Throttle)({ engines: {} }),
201
+ (0, common_1.Get)(":engineId/workflows"),
202
+ __param(0, (0, common_1.Param)("engineId")),
203
+ __metadata("design:type", Function),
204
+ __metadata("design:paramtypes", [String]),
205
+ __metadata("design:returntype", Promise)
206
+ ], GraphEngineController.prototype, "listWorkflows", null);
207
+ __decorate([
208
+ (0, throttler_1.SkipThrottle)({ default: true }),
209
+ (0, throttler_1.Throttle)({ engines: {} }),
210
+ (0, common_1.Get)(":engineId/workflows/:workflowId"),
211
+ __param(0, (0, common_1.Param)("engineId")),
212
+ __param(1, (0, common_1.Param)("workflowId")),
213
+ __metadata("design:type", Function),
214
+ __metadata("design:paramtypes", [String, String]),
215
+ __metadata("design:returntype", Promise)
216
+ ], GraphEngineController.prototype, "getWorkflow", null);
217
+ exports.GraphEngineController = GraphEngineController = __decorate([
218
+ (0, common_1.Controller)("graph/engines"),
219
+ __param(1, (0, common_1.Optional)()),
220
+ __param(1, (0, common_1.Inject)(for_nest_1.DecafRequestContext)),
221
+ __param(2, (0, common_1.Optional)()),
222
+ __param(2, (0, common_1.Inject)(GraphEngineCapabilityService_js_1.GRAPH_ENGINE_CAPABILITY_OPTIONS)),
223
+ __metadata("design:paramtypes", [GraphEngineCapabilityService_js_1.GraphEngineCapabilityService,
224
+ for_nest_1.DecafRequestContext, Object])
225
+ ], GraphEngineController);
226
+ //# sourceMappingURL=GraphEngineController.js.map
227
+ //# sourceMappingURL=GraphEngineController.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nest/graph/GraphEngineController.cjs","sourceRoot":"","sources":["nest/graph/GraphEngineController.js"],"names":[],"mappings":";;;AAAA,IAAI,UAAU,GAAG,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,UAAU,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI;IACjF,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7H,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU;QAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;;QAC1H,KAAK,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,GAA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zB,IAAA,YAAG,EAAC,iCAAiC,CAAC;IACtC,OAAO,CAAC,CAAC,EAAE,IAAA,cAAK,EAAC,UAAU,CAAC,CAAC;IAC7B,OAAO,CAAC,CAAC,EAAE,IAAA,cAAK,EAAC,YAAY,CAAC,CAAC;IAC/B,UAAU,CAAC,aAAa,EAAE,QAAQ,CAAC;IACnC,UAAU,CAAC,mBAAmB,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,UAAU,CAAC,mBAAmB,EAAE,OAAO,CAAC;CAC3C,EAAE,qBAAqB,CAAC,SAAS,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC;AACzD,gCAAA,qBAAqB,GAAG,UAAU,CAAC;IAC/B,IAAA,mBAAU,EAAC,eAAe,CAAC;IAC3B,OAAO,CAAC,CAAC,EAAE,IAAA,iBAAQ,GAAE,CAAC;IACtB,OAAO,CAAC,CAAC,EAAE,IAAA,eAAM,EAAC,8BAAmB,CAAC,CAAC;IACvC,OAAO,CAAC,CAAC,EAAE,IAAA,iBAAQ,GAAE,CAAC;IACtB,OAAO,CAAC,CAAC,EAAE,IAAA,eAAM,EAAC,iEAA+B,CAAC,CAAC;IACnD,UAAU,CAAC,mBAAmB,EAAE,CAAC,8DAA4B;QACzD,8BAAmB,EAAE,MAAM,CAAC,CAAC;CACpC,EAAE,qBAAqB,CAAC,CAAC;AAE1B,iDAAiD"}
@@ -35,7 +35,10 @@ const GraphNodeCatalogueController_js_1 = require("./GraphNodeCatalogueControlle
35
35
  const GraphRunController_js_1 = require("./GraphRunController.cjs");
36
36
  const GraphWorkflowService_js_1 = require("./../../engine/services/GraphWorkflowService.cjs");
37
37
  const GraphEnvironment_js_1 = require("./../../engine/services/GraphEnvironment.cjs");
38
+ const constants_js_1 = require("./../../engine/constants.cjs");
38
39
  const GraphWorkflowController_js_1 = require("./GraphWorkflowController.cjs");
40
+ const GraphEngineController_js_1 = require("./GraphEngineController.cjs");
41
+ const GraphEngineCapabilityService_js_1 = require("./GraphEngineCapabilityService.cjs");
39
42
  /**
40
43
  * Generous app-wide default request-rate limit (SAA-1950 F7). The expensive
41
44
  * catalogue `resolve`/`methods` routes carry their own `@Throttle` limits; every
@@ -106,10 +109,16 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
106
109
  ...GraphNodeCatalogueController_js_1.DEFAULT_GRAPH_CATALOGUE_RATE_LIMIT,
107
110
  ...(catalogueOptions.methodsRateLimit ?? {}),
108
111
  };
112
+ const engineOptions = options.engines ?? {};
113
+ const engineRateLimit = {
114
+ ...GraphEngineCapabilityService_js_1.DEFAULT_GRAPH_ENGINE_RATE_LIMIT,
115
+ ...(engineOptions.rateLimit ?? {}),
116
+ };
109
117
  // Backend services consume their options from the accumulated graph
110
118
  // environment (`@decaf-ts/logging`), never from injectable config objects.
111
119
  // Host-supplied `workflows` options are accumulated into the environment
112
- // before the service provider is built.
120
+ // before the service provider is built. The `execution` sibling leaf is
121
+ // accumulated in the same call so it survives the raw-object accumulate.
113
122
  if (options.workflows) {
114
123
  const serviceOptions = {};
115
124
  if (options.workflows.limits) {
@@ -122,6 +131,7 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
122
131
  GraphEnvironment_js_1.GraphEnvironment.accumulate({
123
132
  graph: {
124
133
  workflows: serviceOptions,
134
+ execution: { maxCodeTimeoutMs: constants_js_1.GRAPH_CODE_MAX_TIMEOUT_MS },
125
135
  },
126
136
  });
127
137
  }
@@ -175,11 +185,13 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
175
185
  const providers = [
176
186
  {
177
187
  provide: index_js_1.GraphExecutionEngine,
178
- useFactory: async () => {
188
+ useFactory: async (workflowService) => {
179
189
  const config = await sharedConfig();
180
190
  const engine = new index_js_1.GraphExecutionEngine();
181
191
  await engine.boot({
182
192
  ...config,
193
+ ...(options.backend ? { backend: options.backend } : {}),
194
+ workflowStore: workflowService,
183
195
  authEnabled: resolveGraphAuthEnabled(options),
184
196
  ...(options.authMatch ? { authMatch: options.authMatch } : {}),
185
197
  ...(options.credentialAuthorizer
@@ -188,6 +200,7 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
188
200
  });
189
201
  return engine;
190
202
  },
203
+ inject: [GraphWorkflowService_js_1.GraphWorkflowService],
191
204
  },
192
205
  {
193
206
  provide: index_js_1.GraphNodeCatalogue,
@@ -205,6 +218,15 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
205
218
  provide: GraphRunController_js_1.GRAPH_RUN_OPTIONS,
206
219
  useValue: (options.runs ?? {}),
207
220
  },
221
+ {
222
+ provide: GraphEngineCapabilityService_js_1.GRAPH_ENGINE_CAPABILITY_OPTIONS,
223
+ useValue: engineOptions,
224
+ },
225
+ {
226
+ provide: GraphEngineCapabilityService_js_1.GraphEngineCapabilityService,
227
+ useFactory: (engine) => new GraphEngineCapabilityService_js_1.GraphEngineCapabilityService(engineOptions, engine),
228
+ inject: [index_js_1.GraphExecutionEngine],
229
+ },
208
230
  {
209
231
  provide: index_js_2.RamGraphRunStore,
210
232
  useFactory: async () => new index_js_2.RamGraphRunStore(await sharedRunAdapter()),
@@ -251,6 +273,11 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
251
273
  ttl: methodsRateLimit.windowMs,
252
274
  limit: methodsRateLimit.maxRequests,
253
275
  },
276
+ {
277
+ name: "engines",
278
+ ttl: engineRateLimit.windowMs,
279
+ limit: engineRateLimit.maxRequests,
280
+ },
254
281
  ]),
255
282
  ];
256
283
  // Auth (for-nest pattern): when the host supplies an AuthHandler, install
@@ -271,6 +298,7 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
271
298
  GraphNodeCatalogueController_js_1.GraphNodeCatalogueController,
272
299
  GraphWorkflowController_js_1.GraphWorkflowController,
273
300
  GraphRunController_js_1.GraphRunController,
301
+ GraphEngineController_js_1.GraphEngineController,
274
302
  ],
275
303
  providers: [
276
304
  ...providers,
@@ -283,6 +311,7 @@ let GraphExecutionModule = GraphExecutionModule_1 = class GraphExecutionModule {
283
311
  index_js_2.RamGraphRunEventStore,
284
312
  index_js_1.GraphRunService,
285
313
  GraphWorkflowService_js_1.GraphWorkflowService,
314
+ GraphEngineCapabilityService_js_1.GraphEngineCapabilityService,
286
315
  ],
287
316
  };
288
317
  }