@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,733 @@
1
+ import { GraphExecutionError } from "./../engine/errors/index.js";
2
+ import { DAGSTER_ERROR } from "./constants.js";
3
+ /**
4
+ * The documented Dagster event types the read-only driver consumes. Raw Dagster
5
+ * telemetry outside this set is filtered by the transport (see module docs).
6
+ */
7
+ const DAGSTER_MAPPED_EVENT_TYPES = new Set([
8
+ "STEP_START",
9
+ "STEP_SUCCESS",
10
+ "STEP_FAILURE",
11
+ "STEP_SKIPPED",
12
+ "STEP_OUTPUT",
13
+ "RUN_START",
14
+ "RUN_SUCCESS",
15
+ "RUN_FAILURE",
16
+ "RUN_CANCELED",
17
+ ]);
18
+ /** Default hard cap on the transport's pagination depth. */
19
+ const DEFAULT_MAX_PAGES = 100;
20
+ /** Default hard cap on the transport's replayed event count. */
21
+ const DEFAULT_MAX_EVENTS = 10000;
22
+ const LIST_JOBS_QUERY = /* GraphQL */ `
23
+ query AsGraphListJobs {
24
+ repositoriesOrError {
25
+ __typename
26
+ ... on RepositoryConnection {
27
+ nodes {
28
+ name
29
+ location {
30
+ name
31
+ }
32
+ jobs {
33
+ name
34
+ description
35
+ }
36
+ }
37
+ }
38
+ ... on PythonError {
39
+ message
40
+ }
41
+ }
42
+ }
43
+ `;
44
+ const REPOSITORY_QUERY = /* GraphQL */ `
45
+ query AsGraphRepository($repositoryName: String!, $repositoryLocationName: String!) {
46
+ repositoryOrError(
47
+ repositorySelector: {
48
+ repositoryName: $repositoryName
49
+ repositoryLocationName: $repositoryLocationName
50
+ }
51
+ ) {
52
+ __typename
53
+ ... on Repository {
54
+ name
55
+ jobs {
56
+ name
57
+ description
58
+ solids {
59
+ name
60
+ inputs {
61
+ definition {
62
+ name
63
+ }
64
+ dependsOn {
65
+ solid {
66
+ name
67
+ }
68
+ definition {
69
+ name
70
+ }
71
+ }
72
+ }
73
+ outputs {
74
+ definition {
75
+ name
76
+ }
77
+ }
78
+ }
79
+ }
80
+ schedules {
81
+ name
82
+ cronSchedule
83
+ executionTimezone
84
+ pipelineName
85
+ }
86
+ sensors {
87
+ name
88
+ sensorType
89
+ targets {
90
+ pipelineName
91
+ }
92
+ }
93
+ assetNodes {
94
+ assetKey {
95
+ path
96
+ }
97
+ jobNames
98
+ }
99
+ }
100
+ ... on RepositoryNotFoundError {
101
+ message
102
+ }
103
+ ... on PythonError {
104
+ message
105
+ }
106
+ }
107
+ }
108
+ `;
109
+ const RUN_QUERY = /* GraphQL */ `
110
+ query AsGraphRun($runId: ID!) {
111
+ runOrError(runId: $runId) {
112
+ __typename
113
+ ... on Run {
114
+ runId
115
+ jobName
116
+ status
117
+ startTime
118
+ endTime
119
+ }
120
+ ... on RunNotFoundError {
121
+ message
122
+ }
123
+ ... on PythonError {
124
+ message
125
+ }
126
+ }
127
+ }
128
+ `;
129
+ const RUN_EVENTS_QUERY = /* GraphQL */ `
130
+ query AsGraphRunEvents($runId: ID!, $after: String) {
131
+ runOrError(runId: $runId) {
132
+ __typename
133
+ ... on Run {
134
+ runId
135
+ status
136
+ eventConnection(afterCursor: $after, limit: 1000) {
137
+ cursor
138
+ hasMore
139
+ events {
140
+ __typename
141
+ ... on MessageEvent {
142
+ eventType
143
+ timestamp
144
+ message
145
+ stepKey
146
+ }
147
+ ... on ExecutionStepOutputEvent {
148
+ outputName
149
+ }
150
+ }
151
+ }
152
+ }
153
+ ... on RunNotFoundError {
154
+ message
155
+ }
156
+ ... on PythonError {
157
+ message
158
+ }
159
+ }
160
+ }
161
+ `;
162
+ const RUNS_QUERY = /* GraphQL */ `
163
+ query AsGraphRuns($pipelineName: String) {
164
+ runsOrError(filter: { pipelineName: $pipelineName }, limit: 100) {
165
+ __typename
166
+ ... on Runs {
167
+ results {
168
+ runId
169
+ jobName
170
+ status
171
+ }
172
+ }
173
+ ... on PythonError {
174
+ message
175
+ }
176
+ }
177
+ }
178
+ `;
179
+ const TERMINATE_RUN_MUTATION = /* GraphQL */ `
180
+ mutation AsGraphTerminateRun($runId: String!) {
181
+ terminateRun(runId: $runId) {
182
+ __typename
183
+ ... on TerminateRunSuccess {
184
+ run {
185
+ runId
186
+ }
187
+ }
188
+ ... on TerminateRunFailure {
189
+ message
190
+ }
191
+ ... on RunNotFoundError {
192
+ message
193
+ }
194
+ ... on PythonError {
195
+ message
196
+ }
197
+ }
198
+ }
199
+ `;
200
+ /**
201
+ * Launches a run of an already-deployed job. This is not authoring: the job must
202
+ * already exist in the deployment; the mutation only selects it and launches a
203
+ * run. The driver never emits Python.
204
+ */
205
+ const LAUNCH_RUN_MUTATION = /* GraphQL */ `
206
+ mutation AsGraphLaunchRun($executionParams: ExecutionParams!) {
207
+ launchRun(executionParams: $executionParams) {
208
+ __typename
209
+ ... on LaunchRunSuccess {
210
+ run {
211
+ runId
212
+ status
213
+ }
214
+ }
215
+ ... on RunConfigValidationInvalid {
216
+ errors {
217
+ message
218
+ }
219
+ }
220
+ ... on PipelineNotFoundError {
221
+ message
222
+ }
223
+ ... on RunConflict {
224
+ message
225
+ }
226
+ ... on UnauthorizedError {
227
+ message
228
+ }
229
+ ... on PythonError {
230
+ message
231
+ }
232
+ }
233
+ }
234
+ `;
235
+ /**
236
+ * Re-executes an existing run from its run id through Dagster's dedicated
237
+ * re-execution mutation (`launchRunReexecution`). Dagster requires exactly one of
238
+ * `executionParams` or `reexecutionParams`; selecting a parent run uses the
239
+ * latter. The parent run must already exist; the driver never authors a job or
240
+ * emits Python.
241
+ */
242
+ const REEXECUTE_RUN_MUTATION = /* GraphQL */ `
243
+ mutation AsGraphReexecuteRun($reexecutionParams: ReexecutionParams!) {
244
+ launchRunReexecution(reexecutionParams: $reexecutionParams) {
245
+ __typename
246
+ ... on LaunchRunSuccess {
247
+ run {
248
+ runId
249
+ status
250
+ }
251
+ }
252
+ ... on RunConfigValidationInvalid {
253
+ errors {
254
+ message
255
+ }
256
+ }
257
+ ... on PipelineNotFoundError {
258
+ message
259
+ }
260
+ ... on RunConflict {
261
+ message
262
+ }
263
+ ... on UnauthorizedError {
264
+ message
265
+ }
266
+ ... on PythonError {
267
+ message
268
+ }
269
+ }
270
+ }
271
+ `;
272
+ /**
273
+ * Real, read-only Dagster GraphQL client implementing the production
274
+ * `DagsterClient` port. It never authors a workflow or launches a run.
275
+ */
276
+ export class DagsterGraphQLClient {
277
+ /**
278
+ * @param options - Endpoint URL, fetch implementation, timeout, and repository
279
+ * selector.
280
+ */
281
+ constructor(options) {
282
+ this.url = options.url;
283
+ this.fetchImpl = options.fetchImpl ?? fetch;
284
+ this.requestTimeoutMs = options.requestTimeoutMs ?? 15000;
285
+ this.repositoryName = options.repositoryName ?? "__repository__";
286
+ this.repositoryLocationName =
287
+ options.repositoryLocationName ?? "definitions.py";
288
+ }
289
+ /**
290
+ * Sends a GraphQL operation and unwraps the `data` envelope, failing loudly
291
+ * on transport, HTTP, or GraphQL errors.
292
+ *
293
+ * @typeParam T - The expected `data` shape.
294
+ * @param query - The GraphQL document.
295
+ * @param variables - Optional operation variables.
296
+ * @param signal - Optional caller signal composed with the request timeout.
297
+ * @returns The response `data`.
298
+ */
299
+ async request(query, variables, signal) {
300
+ const timeoutSignal = AbortSignal.timeout(this.requestTimeoutMs);
301
+ const effectiveSignal = signal
302
+ ? AbortSignal.any([signal, timeoutSignal])
303
+ : timeoutSignal;
304
+ const response = await this.fetchImpl(this.url, {
305
+ method: "POST",
306
+ headers: { "content-type": "application/json" },
307
+ body: JSON.stringify({ query, variables }),
308
+ signal: effectiveSignal,
309
+ });
310
+ if (!response.ok) {
311
+ throw new Error(`Dagster GraphQL request failed with HTTP ${response.status}`);
312
+ }
313
+ const body = (await response.json());
314
+ if (body.errors?.length) {
315
+ throw new Error(`Dagster GraphQL errors: ${body.errors
316
+ .map((error) => error.message)
317
+ .join("; ")}`);
318
+ }
319
+ if (!body.data) {
320
+ throw new Error("Dagster GraphQL response carried no data");
321
+ }
322
+ return body.data;
323
+ }
324
+ /**
325
+ * Lists every already-deployed Dagster job across the served repositories.
326
+ *
327
+ * @returns The deployed job summaries.
328
+ */
329
+ async listJobs() {
330
+ const data = await this.request(LIST_JOBS_QUERY);
331
+ const connection = data.repositoriesOrError;
332
+ if (connection.__typename !== "RepositoryConnection") {
333
+ throw new Error(`Dagster repository listing failed: ${connection.message ?? connection.__typename}`);
334
+ }
335
+ const summaries = [];
336
+ for (const repository of connection.nodes ?? []) {
337
+ for (const job of repository.jobs) {
338
+ summaries.push({
339
+ name: job.name,
340
+ ...(job.description ? { description: job.description } : {}),
341
+ });
342
+ }
343
+ }
344
+ return summaries;
345
+ }
346
+ /**
347
+ * Reads a single already-deployed Dagster job, including its real graph
348
+ * structure (ops, dependencies, asset keys, schedules, sensors).
349
+ *
350
+ * @param jobName - The Dagster job name.
351
+ * @returns The inspected job record.
352
+ */
353
+ async getJob(jobName) {
354
+ const data = await this.request(REPOSITORY_QUERY, {
355
+ repositoryName: this.repositoryName,
356
+ repositoryLocationName: this.repositoryLocationName,
357
+ });
358
+ const repository = data.repositoryOrError;
359
+ if (repository.__typename !== "Repository") {
360
+ throw new Error(`Dagster repository lookup failed: ${repository.message ?? repository.__typename}`);
361
+ }
362
+ const job = (repository.jobs ?? []).find((candidate) => candidate.name === jobName);
363
+ if (!job) {
364
+ throw new Error(`Dagster job '${jobName}' was not found in the deployment`);
365
+ }
366
+ return this.toJobRecord(job, repository);
367
+ }
368
+ /**
369
+ * Replays the recorded event stream of an EXISTING Dagster run and invokes the
370
+ * handler for every documented graph-transition event. The client never launches
371
+ * a run; it only reads a run that already exists.
372
+ *
373
+ * @param runId - The Dagster run id.
374
+ * @param handler - The per-event callback.
375
+ * @param options - Optional signal/event/page bounds.
376
+ * @returns A subscription handle.
377
+ * @throws {GraphExecutionError} `GRAPH_DAGSTER_OBSERVE_ABORTED` when the signal
378
+ * is already aborted before or during the event replay,
379
+ * `GRAPH_DAGSTER_PAGE_LIMIT_EXCEEDED` when the page cap is hit, or
380
+ * `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED` when the event cap is hit.
381
+ */
382
+ async subscribeRun(runId, handler, options = {}) {
383
+ let closed = false;
384
+ const raw = await this.fetchRunEvents(runId, options);
385
+ for (const event of raw) {
386
+ if (closed || options.signal?.aborted)
387
+ break;
388
+ const record = this.toEventRecord(event);
389
+ if (record)
390
+ handler(record);
391
+ }
392
+ return {
393
+ unsubscribe: () => {
394
+ closed = true;
395
+ },
396
+ };
397
+ }
398
+ /**
399
+ * Terminates an EXISTING Dagster run through the GraphQL mutation.
400
+ *
401
+ * @param runId - The Dagster run id.
402
+ * @param reason - Optional termination reason (unused by Dagster).
403
+ */
404
+ async terminateRun(runId, reason) {
405
+ void reason;
406
+ const data = await this.request(TERMINATE_RUN_MUTATION, { runId });
407
+ const result = data.terminateRun;
408
+ if (result.__typename !== "TerminateRunSuccess") {
409
+ throw new Error(`Dagster run termination failed: ${result.message ?? result.__typename}`);
410
+ }
411
+ }
412
+ /**
413
+ * Launches a run of an ALREADY-DEPLOYED Dagster job through the real GraphQL
414
+ * `launchRun` mutation. The job must already exist in the deployment; no job or
415
+ * op is authored and no Python is emitted.
416
+ *
417
+ * @param request - The job name, optional raw run config, and optional tags.
418
+ * @returns The launched run's id and initial status.
419
+ */
420
+ async launchRun(request) {
421
+ const data = await this.request(LAUNCH_RUN_MUTATION, {
422
+ executionParams: this.executionParams(request.jobName, request.runConfig, request.tags),
423
+ });
424
+ return this.toLaunchedRun(data.launchRun, request.jobName);
425
+ }
426
+ /**
427
+ * Re-executes an EXISTING Dagster run from its run id through the real GraphQL
428
+ * `launchRunReexecution` mutation (Dagster's re-execution surface). The parent
429
+ * run must already exist; no job or op is authored and no Python is emitted.
430
+ *
431
+ * @param request - The parent run id, its job name, and optional tags.
432
+ * @returns The re-executed run's id and initial status.
433
+ */
434
+ async replayRun(request) {
435
+ const reexecutionParams = {
436
+ parentRunId: request.dagsterRunId,
437
+ strategy: "ALL_STEPS",
438
+ };
439
+ if (request.tags && Object.keys(request.tags).length > 0) {
440
+ reexecutionParams["extraTags"] = Object.entries(request.tags).map(([key, value]) => ({ key, value }));
441
+ }
442
+ const data = await this.request(REEXECUTE_RUN_MUTATION, { reexecutionParams });
443
+ return this.toLaunchedRun(data.launchRunReexecution, request.jobName ?? request.dagsterRunId);
444
+ }
445
+ /**
446
+ * Builds the GraphQL `ExecutionParams` for a launch/re-execution: the job
447
+ * selector, optional raw run config, and optional run tags.
448
+ *
449
+ * @param jobName - The already-deployed job name.
450
+ * @param runConfig - Optional raw Dagster run config (forwarded verbatim).
451
+ * @param tags - Optional run tags.
452
+ * @returns The `ExecutionParams` input object.
453
+ */
454
+ executionParams(jobName, runConfig, tags) {
455
+ const executionMetadata = {};
456
+ if (tags && Object.keys(tags).length > 0) {
457
+ executionMetadata["tags"] = Object.entries(tags).map(([key, value]) => ({
458
+ key,
459
+ value,
460
+ }));
461
+ }
462
+ return {
463
+ selector: {
464
+ pipelineName: jobName,
465
+ repositoryName: this.repositoryName,
466
+ repositoryLocationName: this.repositoryLocationName,
467
+ },
468
+ ...(runConfig ? { runConfigData: runConfig } : {}),
469
+ ...(Object.keys(executionMetadata).length > 0
470
+ ? { executionMetadata }
471
+ : {}),
472
+ };
473
+ }
474
+ /**
475
+ * Unwraps a launch/re-execution result union into a run handle, failing loudly
476
+ * on a launch error.
477
+ *
478
+ * @param result - The raw launch result union.
479
+ * @param jobName - The job name, for error context.
480
+ * @returns The launched run's id and initial status.
481
+ */
482
+ toLaunchedRun(result, jobName) {
483
+ if (result.__typename !== "LaunchRunSuccess" || !result.run) {
484
+ const detail = result.errors?.map((error) => error.message).join("; ") ??
485
+ result.message ??
486
+ result.__typename;
487
+ throw new Error(`Dagster launch of job '${jobName}' failed: ${detail}`);
488
+ }
489
+ return {
490
+ runId: result.run.runId,
491
+ status: this.toRunStatus(result.run.status),
492
+ };
493
+ }
494
+ /**
495
+ * Reads an EXISTING Dagster run's terminal record.
496
+ *
497
+ * @param runId - The Dagster run id.
498
+ * @returns The terminal run record.
499
+ */
500
+ async getRun(runId) {
501
+ const data = await this.request(RUN_QUERY, {
502
+ runId,
503
+ });
504
+ return this.toRunRecord(data.runOrError);
505
+ }
506
+ /**
507
+ * Harness-only helper: lists the runs for a job (or every run when no job name
508
+ * is given) with their raw Dagster status. Not part of the `DagsterClient` port;
509
+ * it exists so the suite can discover a pre-existing terminal run (e.g. the
510
+ * `etl_pipeline` run materialized at startup) without launching one, and can
511
+ * count runs before/after an operation to prove no run was created.
512
+ *
513
+ * @param jobName - Optional Dagster job name filter.
514
+ * @returns The runs, with raw Dagster run status.
515
+ */
516
+ async listRuns(jobName) {
517
+ const data = await this.request(RUNS_QUERY, jobName ? { pipelineName: jobName } : {});
518
+ const runs = data.runsOrError;
519
+ if (runs.__typename !== "Runs") {
520
+ throw new Error(`Dagster run listing failed: ${runs.message ?? runs.__typename}`);
521
+ }
522
+ return (runs.results ?? []).map((run) => ({
523
+ runId: run.runId,
524
+ jobName: run.jobName,
525
+ status: run.status,
526
+ }));
527
+ }
528
+ /**
529
+ * Harness-only helper: lists the ids of runs for a job (or every run when no
530
+ * job name is given). Not part of the `DagsterClient` port; it exists so the
531
+ * suite can discover a pre-existing run without launching one.
532
+ *
533
+ * @param jobName - Optional Dagster job name filter.
534
+ * @returns The run ids.
535
+ */
536
+ async listRunIds(jobName) {
537
+ const runs = await this.listRuns(jobName);
538
+ return runs.map((run) => run.runId);
539
+ }
540
+ /** Disposes the client; the fetch transport holds no resources. */
541
+ dispose() {
542
+ return;
543
+ }
544
+ /**
545
+ * Paginates the run's recorded event stream, bounded by `maxPages` and
546
+ * `maxEvents` so a gateway whose `eventConnection` never reports
547
+ * `hasMore: false` cannot page or buffer without limit.
548
+ *
549
+ * @param runId - The Dagster run id.
550
+ * @param options - Optional signal/event/page bounds.
551
+ * @returns The raw events, in order.
552
+ * @throws {GraphExecutionError} `GRAPH_DAGSTER_PAGE_LIMIT_EXCEEDED` when the
553
+ * page cap is hit, or `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED` when the event cap
554
+ * is hit.
555
+ */
556
+ async fetchRunEvents(runId, options = {}) {
557
+ const maxPages = options.maxPages ?? DEFAULT_MAX_PAGES;
558
+ const maxEvents = options.maxEvents ?? DEFAULT_MAX_EVENTS;
559
+ const events = [];
560
+ let after;
561
+ let pages = 0;
562
+ for (;;) {
563
+ if (options.signal?.aborted) {
564
+ throw new GraphExecutionError(`Dagster run '${runId}' event replay was aborted by the caller`, DAGSTER_ERROR.OBSERVE_ABORTED, { runId });
565
+ }
566
+ if (pages >= maxPages) {
567
+ throw new GraphExecutionError(`Dagster run '${runId}' event replay exceeded the ${maxPages}-page cap`, DAGSTER_ERROR.PAGE_LIMIT_EXCEEDED, { runId, maxPages });
568
+ }
569
+ const data = await this.request(RUN_EVENTS_QUERY, after ? { runId, after } : { runId }, options.signal);
570
+ pages += 1;
571
+ const run = data.runOrError;
572
+ if (run.__typename !== "Run") {
573
+ throw new Error(`Dagster run event lookup failed: ${run.message ?? run.__typename}`);
574
+ }
575
+ const connection = run.eventConnection;
576
+ if (!connection)
577
+ break;
578
+ events.push(...connection.events);
579
+ if (events.length > maxEvents) {
580
+ throw new GraphExecutionError(`Dagster run '${runId}' event replay exceeded the ${maxEvents}-event cap`, DAGSTER_ERROR.EVENT_LIMIT_EXCEEDED, { runId, maxEvents });
581
+ }
582
+ if (!connection.hasMore)
583
+ break;
584
+ after = connection.cursor;
585
+ }
586
+ return events;
587
+ }
588
+ /**
589
+ * Maps a raw Dagster event onto the driver's documented `DagsterEventRecord`
590
+ * contract, filtering out non-graph-transition telemetry.
591
+ *
592
+ * @param event - The raw event.
593
+ * @returns The driver event record, or `undefined` when the event is engine
594
+ * telemetry the read-only driver does not consume.
595
+ */
596
+ toEventRecord(event) {
597
+ const type = event.eventType;
598
+ if (!type || !DAGSTER_MAPPED_EVENT_TYPES.has(type))
599
+ return undefined;
600
+ const record = { type };
601
+ if (event.stepKey)
602
+ record.stepKey = event.stepKey;
603
+ if (event.timestamp) {
604
+ record.timestamp = new Date(Number(event.timestamp)).toISOString();
605
+ }
606
+ if (event.message)
607
+ record.message = event.message;
608
+ if (type === "STEP_OUTPUT" && event.outputName) {
609
+ record.payload = { outputs: { [event.outputName]: event.outputName } };
610
+ }
611
+ return record;
612
+ }
613
+ /**
614
+ * Maps a raw `Run` onto the driver's `DagsterRunRecord` contract.
615
+ *
616
+ * @param run - The raw run.
617
+ * @returns The driver run record.
618
+ */
619
+ toRunRecord(run) {
620
+ if (run.__typename !== "Run") {
621
+ throw new Error(`Dagster run lookup failed: ${run.message ?? run.__typename}`);
622
+ }
623
+ const record = {
624
+ runId: run.runId ?? "",
625
+ status: this.toRunStatus(run.status),
626
+ outputs: {},
627
+ ...(run.jobName ? { jobName: run.jobName } : {}),
628
+ };
629
+ if (run.startTime) {
630
+ record.startedAt = new Date(run.startTime * 1000).toISOString();
631
+ }
632
+ if (run.endTime) {
633
+ record.finishedAt = new Date(run.endTime * 1000).toISOString();
634
+ }
635
+ return record;
636
+ }
637
+ /**
638
+ * Maps a Dagster `RunStatus` onto the driver's terminal run status.
639
+ *
640
+ * @param status - The raw Dagster run status.
641
+ * @returns The driver run status.
642
+ */
643
+ toRunStatus(status) {
644
+ switch (status) {
645
+ case "SUCCESS":
646
+ return "success";
647
+ case "FAILURE":
648
+ return "failure";
649
+ case "CANCELED":
650
+ return "canceled";
651
+ case "QUEUED":
652
+ return "QUEUED";
653
+ case "STARTING":
654
+ return "STARTING";
655
+ default:
656
+ return "started";
657
+ }
658
+ }
659
+ /**
660
+ * Maps a raw job plus its repository context onto the driver's
661
+ * `DagsterJobRecord` contract.
662
+ *
663
+ * @param job - The raw job.
664
+ * @param repository - The raw repository the job belongs to.
665
+ * @returns The inspected job record.
666
+ */
667
+ toJobRecord(job, repository) {
668
+ const assetKeys = this.assetKeysFor(job.name, repository.assetNodes ?? []);
669
+ const ops = job.solids.map((solid) => {
670
+ const op = {
671
+ name: solid.name,
672
+ inputs: solid.inputs.map((input) => input.definition.name),
673
+ outputs: solid.outputs.map((output) => output.definition.name),
674
+ };
675
+ const keys = assetKeys.filter((key) => key.split(".").pop() === solid.name);
676
+ if (keys.length)
677
+ op.assetKeys = keys;
678
+ return op;
679
+ });
680
+ const dependencies = [];
681
+ for (const solid of job.solids) {
682
+ for (const input of solid.inputs) {
683
+ for (const upstream of input.dependsOn) {
684
+ dependencies.push({
685
+ from: upstream.solid.name,
686
+ to: solid.name,
687
+ });
688
+ }
689
+ }
690
+ }
691
+ const schedules = (repository.schedules ?? [])
692
+ .filter((schedule) => schedule.pipelineName === job.name)
693
+ .map((schedule) => ({
694
+ name: schedule.name,
695
+ ...(schedule.cronSchedule ? { cron: schedule.cronSchedule } : {}),
696
+ ...(schedule.executionTimezone
697
+ ? { timezone: schedule.executionTimezone }
698
+ : {}),
699
+ }));
700
+ const sensors = (repository.sensors ?? [])
701
+ .filter((sensor) => sensor.targets.some((target) => target.pipelineName === job.name))
702
+ .map((sensor) => ({
703
+ name: sensor.name,
704
+ ...(sensor.sensorType ? { kind: sensor.sensorType } : {}),
705
+ }));
706
+ return {
707
+ name: job.name,
708
+ ...(job.description ? { description: job.description } : {}),
709
+ ops,
710
+ dependencies,
711
+ ...(assetKeys.length ? { assetKeys } : {}),
712
+ ...(schedules.length ? { schedules } : {}),
713
+ ...(sensors.length ? { sensors } : {}),
714
+ };
715
+ }
716
+ /**
717
+ * Resolves the asset keys a job produces from the repository's asset nodes.
718
+ *
719
+ * @param jobName - The Dagster job name.
720
+ * @param assetNodes - The repository asset nodes.
721
+ * @returns The dotted asset keys.
722
+ */
723
+ assetKeysFor(jobName, assetNodes) {
724
+ const keys = [];
725
+ for (const node of assetNodes) {
726
+ if (!node.jobNames.includes(jobName))
727
+ continue;
728
+ keys.push(node.assetKey.path.join("."));
729
+ }
730
+ return keys;
731
+ }
732
+ }
733
+ //# sourceMappingURL=DagsterGraphQLClient.js.map