@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,344 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DagsterGraphEventBridge = void 0;
4
+ const index_js_1 = require("./../shared/graph/index.cjs");
5
+ const index_js_2 = require("./../engine/errors/index.cjs");
6
+ const constants_js_1 = require("./constants.cjs");
7
+ /**
8
+ * The documented Dagster → engine-agnostic event mapping table (§4.3).
9
+ */
10
+ const DAGSTER_EVENT_MAP = {
11
+ STEP_START: index_js_1.GraphExecutionEventType.NODE_STARTED,
12
+ STEP_SUCCESS: index_js_1.GraphExecutionEventType.NODE_COMPLETED,
13
+ STEP_FAILURE: index_js_1.GraphExecutionEventType.NODE_FAILED,
14
+ STEP_SKIPPED: index_js_1.GraphExecutionEventType.NODE_SKIPPED,
15
+ STEP_OUTPUT: index_js_1.GraphExecutionEventType.NODE_OUTPUT,
16
+ RUN_START: index_js_1.GraphExecutionEventType.WORKFLOW_STARTED,
17
+ RUN_SUCCESS: index_js_1.GraphExecutionEventType.WORKFLOW_COMPLETED,
18
+ RUN_FAILURE: index_js_1.GraphExecutionEventType.WORKFLOW_FAILED,
19
+ RUN_CANCELED: index_js_1.GraphExecutionEventType.WORKFLOW_CANCELLED,
20
+ };
21
+ /** Dagster event types that terminate a run. */
22
+ const DAGSTER_TERMINAL_EVENTS = new Set([
23
+ "RUN_SUCCESS",
24
+ "RUN_FAILURE",
25
+ "RUN_CANCELED",
26
+ ]);
27
+ /**
28
+ * Default hard cap on the number of events the bridge processes before failing
29
+ * the observation closed. Bounds a gateway that never emits a terminal event.
30
+ */
31
+ const DEFAULT_MAX_EVENTS = 10000;
32
+ /**
33
+ * Default hard cap on the transport pagination depth. Bounds a gateway whose
34
+ * `eventConnection` never reports `hasMore: false`.
35
+ */
36
+ const DEFAULT_MAX_PAGES = 100;
37
+ /**
38
+ * Default maximum time (ms) to await the terminal record before failing the
39
+ * observation closed. Callers observing a genuinely long-lived run raise this.
40
+ */
41
+ const DEFAULT_TERMINAL_TIMEOUT_MS = 5 * 60 * 1000;
42
+ /**
43
+ * Bridges a Dagster run's raw event stream onto the engine-agnostic event sink.
44
+ */
45
+ class DagsterGraphEventBridge {
46
+ /**
47
+ * @param options - The run identity, op-name map, sink, client port, and bounds.
48
+ */
49
+ constructor(options) {
50
+ this.options = options;
51
+ this.nodeResults = new Map();
52
+ this.workflowOutputs = {};
53
+ this.eventCount = 0;
54
+ this.processing = [];
55
+ this.terminalPromise = new Promise((resolve, reject) => {
56
+ this.resolveTerminal = resolve;
57
+ this.rejectTerminal = reject;
58
+ });
59
+ // A scripted client can overflow the event cap during the synchronous replay
60
+ // inside `subscribeRun`, before `waitForTerminal` attaches its handler. Keep a
61
+ // no-op rejection handler so that early failure is never "unhandled".
62
+ this.terminalPromise.catch(() => { });
63
+ }
64
+ /** Subscribes to the run's event stream. */
65
+ async start() {
66
+ if (this.failure)
67
+ throw this.failure;
68
+ if (this.options.signal?.aborted) {
69
+ throw this.failClosed(this.abortError());
70
+ }
71
+ this.subscription = await this.options.client.subscribeRun(this.options.dagsterRunId, (event) => {
72
+ this.processing.push(this.handleEvent(event));
73
+ }, {
74
+ ...(this.options.signal ? { signal: this.options.signal } : {}),
75
+ maxEvents: this.options.maxEvents ?? DEFAULT_MAX_EVENTS,
76
+ maxPages: this.options.maxPages ?? DEFAULT_MAX_PAGES,
77
+ });
78
+ }
79
+ /** Stops the subscription and waits for in-flight event processing. */
80
+ async stop() {
81
+ await this.subscription?.unsubscribe();
82
+ await Promise.all(this.processing);
83
+ if (this.failure)
84
+ throw this.failure;
85
+ }
86
+ /**
87
+ * Waits for the run's terminal record, bounded by the observation's
88
+ * `terminalTimeoutMs` and `signal`. Exceeding the timeout, or an abort, fails
89
+ * the wait closed instead of hanging on a stalled or hostile gateway.
90
+ *
91
+ * @returns The terminal Dagster run record.
92
+ * @throws {GraphExecutionError} `GRAPH_DAGSTER_OBSERVE_TIMEOUT` when the run
93
+ * does not terminate in time, or `GRAPH_DAGSTER_OBSERVE_ABORTED` on abort.
94
+ */
95
+ async waitForTerminal() {
96
+ if (this.terminal)
97
+ return this.terminal;
98
+ if (this.failure)
99
+ throw this.failure;
100
+ const signal = this.options.signal;
101
+ if (signal?.aborted) {
102
+ throw this.failClosed(this.abortError());
103
+ }
104
+ const timeoutMs = this.options.terminalTimeoutMs ?? DEFAULT_TERMINAL_TIMEOUT_MS;
105
+ return await new Promise((resolve, reject) => {
106
+ let timer;
107
+ const onAbort = () => {
108
+ cleanup();
109
+ this.failClosed(this.abortError());
110
+ };
111
+ const cleanup = () => {
112
+ if (timer)
113
+ clearTimeout(timer);
114
+ signal?.removeEventListener("abort", onAbort);
115
+ };
116
+ if (signal)
117
+ signal.addEventListener("abort", onAbort, { once: true });
118
+ if (timeoutMs > 0) {
119
+ timer = setTimeout(() => {
120
+ this.failClosed(this.timeoutError(timeoutMs));
121
+ }, timeoutMs);
122
+ }
123
+ this.terminalPromise.then((record) => {
124
+ cleanup();
125
+ resolve(record);
126
+ }, (error) => {
127
+ cleanup();
128
+ reject(error);
129
+ });
130
+ });
131
+ }
132
+ /** The node results collected from step events. */
133
+ collectedNodeResults() {
134
+ return Object.fromEntries(this.nodeResults);
135
+ }
136
+ /** The workflow output values collected from the terminal record. */
137
+ collectedWorkflowOutputs() {
138
+ return this.workflowOutputs;
139
+ }
140
+ /**
141
+ * Resolves a Dagster step key to a canonical node id through the inspected
142
+ * job's op-name map.
143
+ *
144
+ * @param stepKey - The Dagster step key.
145
+ * @returns The canonical node id, or `undefined` for non-graph steps.
146
+ */
147
+ resolveNodeId(stepKey) {
148
+ if (!stepKey)
149
+ return undefined;
150
+ const direct = this.options.nodeIdsByOpName[stepKey];
151
+ if (direct)
152
+ return direct;
153
+ const tail = stepKey.split(".").pop();
154
+ return tail ? this.options.nodeIdsByOpName[tail] : undefined;
155
+ }
156
+ /**
157
+ * Handles a single raw Dagster event.
158
+ *
159
+ * @param event - The raw event.
160
+ */
161
+ async handleEvent(event) {
162
+ if (this.failure)
163
+ return;
164
+ this.eventCount += 1;
165
+ const maxEvents = this.options.maxEvents ?? DEFAULT_MAX_EVENTS;
166
+ if (this.eventCount > maxEvents) {
167
+ this.failClosed(this.limitError(maxEvents));
168
+ return;
169
+ }
170
+ const type = DAGSTER_EVENT_MAP[event.type];
171
+ if (!type) {
172
+ if (event.stepKey !== undefined || event.type.startsWith("STEP_")) {
173
+ throw new index_js_2.GraphExecutionError(`Dagster step event '${event.type}' has no engine-agnostic mapping`, constants_js_1.DAGSTER_ERROR.EVENT_UNSUPPORTED, { eventType: event.type, stepKey: event.stepKey });
174
+ }
175
+ // Unknown run/engine-level telemetry is ignored: it is not a graph
176
+ // transition and must not break the run.
177
+ return;
178
+ }
179
+ if (DAGSTER_TERMINAL_EVENTS.has(event.type)) {
180
+ const record = await this.options.client.getRun(this.options.dagsterRunId);
181
+ this.terminal = record;
182
+ if (record.outputs) {
183
+ for (const [key, value] of Object.entries(record.outputs)) {
184
+ this.workflowOutputs[key] = value;
185
+ }
186
+ }
187
+ await this.options.sink.emit({
188
+ type,
189
+ runId: this.options.graphRunId,
190
+ workflowId: this.options.workflowId,
191
+ path: [],
192
+ status: this.terminalStatus(record),
193
+ ...(record.error
194
+ ? { error: this.toErrorPayload(record.error) }
195
+ : {}),
196
+ payload: { outputs: this.workflowOutputs },
197
+ });
198
+ this.resolveTerminal?.(record);
199
+ return;
200
+ }
201
+ const nodeId = this.resolveNodeId(event.stepKey);
202
+ if (!nodeId) {
203
+ // Run-level, non-terminal transitions (e.g. `RUN_START`) carry no step
204
+ // key and map onto the workflow without a node id. A step event whose key
205
+ // the inspected job does not know is still ignored.
206
+ if (event.stepKey !== undefined)
207
+ return;
208
+ await this.options.sink.emit({
209
+ type,
210
+ runId: this.options.graphRunId,
211
+ workflowId: this.options.workflowId,
212
+ path: [],
213
+ });
214
+ return;
215
+ }
216
+ const status = this.nodeStatus(event.type);
217
+ const outputs = this.extractOutputs(event);
218
+ if (outputs) {
219
+ this.workflowOutputs[nodeId] = outputs;
220
+ }
221
+ this.nodeResults.set(nodeId, {
222
+ nodeId,
223
+ status,
224
+ inputs: {},
225
+ ...(outputs ? { outputs } : {}),
226
+ startedAt: new Date(),
227
+ finishedAt: new Date(),
228
+ events: [],
229
+ ...(status === index_js_1.GraphExecutionStatus.FAILED && event.message
230
+ ? { error: this.toErrorPayload({ message: event.message }) }
231
+ : {}),
232
+ });
233
+ await this.options.sink.emit({
234
+ type,
235
+ runId: this.options.graphRunId,
236
+ workflowId: this.options.workflowId,
237
+ nodeId,
238
+ path: [nodeId],
239
+ status,
240
+ ...(outputs ? { payload: { outputs } } : {}),
241
+ ...(status === index_js_1.GraphExecutionStatus.FAILED && event.message
242
+ ? { error: this.toErrorPayload({ message: event.message }) }
243
+ : {}),
244
+ });
245
+ }
246
+ /**
247
+ * Maps a Dagster event type to an engine-agnostic execution status.
248
+ *
249
+ * @param eventType - The Dagster event type.
250
+ * @returns The engine-agnostic status.
251
+ */
252
+ nodeStatus(eventType) {
253
+ switch (eventType) {
254
+ case "STEP_SUCCESS":
255
+ return index_js_1.GraphExecutionStatus.SUCCEEDED;
256
+ case "STEP_FAILURE":
257
+ return index_js_1.GraphExecutionStatus.FAILED;
258
+ case "STEP_SKIPPED":
259
+ return index_js_1.GraphExecutionStatus.SKIPPED;
260
+ default:
261
+ return index_js_1.GraphExecutionStatus.RUNNING;
262
+ }
263
+ }
264
+ /**
265
+ * Maps a terminal Dagster run record to an engine-agnostic status.
266
+ *
267
+ * @param record - The terminal run record.
268
+ * @returns The engine-agnostic status.
269
+ */
270
+ terminalStatus(record) {
271
+ switch (record.status) {
272
+ case "success":
273
+ return index_js_1.GraphExecutionStatus.SUCCEEDED;
274
+ case "canceled":
275
+ return index_js_1.GraphExecutionStatus.CANCELLED;
276
+ default:
277
+ return index_js_1.GraphExecutionStatus.FAILED;
278
+ }
279
+ }
280
+ /**
281
+ * Extracts output values from a Dagster step event payload.
282
+ *
283
+ * @param event - The raw event.
284
+ * @returns The extracted outputs, or `undefined`.
285
+ */
286
+ extractOutputs(event) {
287
+ if (event.type !== "STEP_OUTPUT")
288
+ return undefined;
289
+ const payload = event.payload ?? {};
290
+ const raw = payload["outputs"];
291
+ if (raw && typeof raw === "object" && !Array.isArray(raw)) {
292
+ return raw;
293
+ }
294
+ return payload;
295
+ }
296
+ /**
297
+ * Fails the observation closed exactly once: records the failure, rejects the
298
+ * terminal wait, and cancels the underlying subscription so a stalled transport
299
+ * stops working.
300
+ *
301
+ * @param error - The graph error the observation failed with.
302
+ * @returns The same error, for convenient `throw`/`return` use.
303
+ */
304
+ failClosed(error) {
305
+ if (!this.failure) {
306
+ this.failure = error;
307
+ this.rejectTerminal?.(error);
308
+ const subscription = this.subscription;
309
+ if (subscription) {
310
+ void Promise.resolve(subscription.unsubscribe()).catch(() => { });
311
+ }
312
+ }
313
+ return this.failure;
314
+ }
315
+ /** The error raised when the caller aborts the observation. */
316
+ abortError() {
317
+ return new index_js_2.GraphExecutionError(`Dagster run '${this.options.dagsterRunId}' observation was aborted by the caller`, constants_js_1.DAGSTER_ERROR.OBSERVE_ABORTED, { runId: this.options.dagsterRunId });
318
+ }
319
+ /** The error raised when the run misses the terminal-wait timeout. */
320
+ timeoutError(timeoutMs) {
321
+ return new index_js_2.GraphExecutionError(`Dagster run '${this.options.dagsterRunId}' did not reach a terminal state within ${timeoutMs}ms`, constants_js_1.DAGSTER_ERROR.OBSERVE_TIMEOUT, { runId: this.options.dagsterRunId, timeoutMs });
322
+ }
323
+ /** The error raised when the run exceeds the event cap. */
324
+ limitError(maxEvents) {
325
+ return new index_js_2.GraphExecutionError(`Dagster run '${this.options.dagsterRunId}' emitted more than ${maxEvents} events without reaching a terminal state`, constants_js_1.DAGSTER_ERROR.EVENT_LIMIT_EXCEEDED, { runId: this.options.dagsterRunId, maxEvents });
326
+ }
327
+ /**
328
+ * Builds a frontend-safe error payload. Raw Dagster details are never
329
+ * forwarded to clients (standing hardening rule).
330
+ *
331
+ * @param error - The raw error.
332
+ * @returns The frontend-safe error payload.
333
+ */
334
+ toErrorPayload(error) {
335
+ return {
336
+ name: "DagsterRunError",
337
+ message: error.message ?? "Dagster run failed",
338
+ ...(error.code ? { code: error.code } : {}),
339
+ };
340
+ }
341
+ }
342
+ exports.DagsterGraphEventBridge = DagsterGraphEventBridge;
343
+ //# sourceMappingURL=DagsterGraphEventBridge.js.map
344
+ //# sourceMappingURL=DagsterGraphEventBridge.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dagster/DagsterGraphEventBridge.cjs","sourceRoot":"","sources":["dagster/DagsterGraph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