@decaf-ts/as-graph 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/README.md +158 -2
  2. package/dist/as-graph.cjs +1 -1
  3. package/dist/as-graph.cjs.map +1 -1
  4. package/dist/as-graph.js +1 -1
  5. package/dist/as-graph.js.map +1 -1
  6. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs +344 -0
  7. package/lib/cjs/dagster/DagsterGraphEventBridge.cjs.map +1 -0
  8. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs +789 -0
  9. package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs.map +1 -0
  10. package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
  11. package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
  12. package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
  13. package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
  14. package/lib/cjs/dagster/capabilities.cjs +102 -0
  15. package/lib/cjs/dagster/capabilities.cjs.map +1 -0
  16. package/lib/cjs/dagster/constants.cjs +92 -0
  17. package/lib/cjs/dagster/constants.cjs.map +1 -0
  18. package/lib/cjs/dagster/index.cjs +32 -0
  19. package/lib/cjs/dagster/index.cjs.map +1 -0
  20. package/lib/cjs/engine/constants.cjs +6 -1
  21. package/lib/cjs/engine/constants.cjs.map +1 -1
  22. package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
  23. package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
  24. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
  25. package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
  26. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
  27. package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
  28. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
  29. package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
  30. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
  31. package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
  32. package/lib/cjs/engine/execution/index.cjs +4 -0
  33. package/lib/cjs/engine/execution/index.cjs.map +1 -1
  34. package/lib/cjs/engine/index.cjs +4 -0
  35. package/lib/cjs/engine/index.cjs.map +1 -1
  36. package/lib/cjs/engine/runs/GraphRunService.cjs +61 -0
  37. package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
  38. package/lib/cjs/engine/services/GraphWorkflowService.cjs +33 -14
  39. package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
  40. package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
  41. package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
  42. package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
  43. package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
  44. package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
  45. package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
  46. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
  47. package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
  48. package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
  49. package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
  50. package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
  51. package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
  52. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
  53. package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
  54. package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
  55. package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
  56. package/lib/cjs/mastra/index.cjs +35 -0
  57. package/lib/cjs/mastra/index.cjs.map +1 -0
  58. package/lib/cjs/mastra/types.cjs +34 -0
  59. package/lib/cjs/mastra/types.cjs.map +1 -0
  60. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
  61. package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
  62. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
  63. package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
  64. package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
  65. package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
  66. package/lib/cjs/nest/graph/GraphExecutionModule.cjs +30 -2
  67. package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
  68. package/lib/cjs/nest/graph/index.cjs +3 -0
  69. package/lib/cjs/nest/graph/index.cjs.map +1 -1
  70. package/lib/cjs/nest/graph/main.cjs +54 -0
  71. package/lib/cjs/nest/graph/main.cjs.map +1 -0
  72. package/lib/cjs/nest/graph/servingErrors.cjs +3 -0
  73. package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -1
  74. package/lib/cjs/node/utility/code/node.cjs +11 -3
  75. package/lib/cjs/node/utility/code/node.cjs.map +1 -1
  76. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
  77. package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
  78. package/lib/cjs/shared/graph/constants.cjs +8 -0
  79. package/lib/cjs/shared/graph/constants.cjs.map +1 -1
  80. package/lib/cjs/shared/graph/index.cjs +2 -1
  81. package/lib/cjs/shared/graph/index.cjs.map +1 -1
  82. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
  83. package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
  84. package/lib/cjs/shared/graph/layout/index.cjs +23 -0
  85. package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
  86. package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
  87. package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
  88. package/lib/cjs/shared/ui/index.cjs +8 -10
  89. package/lib/cjs/shared/ui/index.cjs.map +1 -1
  90. package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
  91. package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
  92. package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
  93. package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
  94. package/lib/esm/dagster/DagsterResultMapper.js +51 -0
  95. package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
  96. package/lib/esm/dagster/DagsterTypes.js +2 -0
  97. package/lib/esm/dagster/DagsterTypes.js.map +1 -0
  98. package/lib/esm/dagster/capabilities.js +97 -0
  99. package/lib/esm/dagster/capabilities.js.map +1 -0
  100. package/lib/esm/dagster/constants.js +88 -0
  101. package/lib/esm/dagster/constants.js.map +1 -0
  102. package/lib/esm/dagster/index.js +15 -0
  103. package/lib/esm/dagster/index.js.map +1 -0
  104. package/lib/esm/engine/constants.js +5 -0
  105. package/lib/esm/engine/constants.js.map +1 -1
  106. package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
  107. package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
  108. package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
  109. package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
  110. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
  111. package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
  112. package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
  113. package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
  114. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
  115. package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
  116. package/lib/esm/engine/execution/index.js +4 -0
  117. package/lib/esm/engine/execution/index.js.map +1 -1
  118. package/lib/esm/engine/index.js +4 -0
  119. package/lib/esm/engine/index.js.map +1 -1
  120. package/lib/esm/engine/runs/GraphRunService.js +62 -1
  121. package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
  122. package/lib/esm/engine/services/GraphWorkflowService.js +33 -14
  123. package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
  124. package/lib/esm/mastra/MastraCapabilities.js +164 -0
  125. package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
  126. package/lib/esm/mastra/MastraConditionBridge.js +34 -0
  127. package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
  128. package/lib/esm/mastra/MastraEventBridge.js +481 -0
  129. package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
  130. package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
  131. package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
  132. package/lib/esm/mastra/MastraResumeGuard.js +123 -0
  133. package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
  134. package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
  135. package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
  136. package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
  137. package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
  138. package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
  139. package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
  140. package/lib/esm/mastra/index.js +18 -0
  141. package/lib/esm/mastra/index.js.map +1 -0
  142. package/lib/esm/mastra/types.js +30 -0
  143. package/lib/esm/mastra/types.js.map +1 -0
  144. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
  145. package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
  146. package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
  147. package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
  148. package/lib/esm/nest/graph/GraphEngineController.js +218 -0
  149. package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
  150. package/lib/esm/nest/graph/GraphExecutionModule.js +30 -2
  151. package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
  152. package/lib/esm/nest/graph/index.js +3 -0
  153. package/lib/esm/nest/graph/index.js.map +1 -1
  154. package/lib/esm/nest/graph/main.js +51 -0
  155. package/lib/esm/nest/graph/main.js.map +1 -0
  156. package/lib/esm/nest/graph/servingErrors.js +3 -0
  157. package/lib/esm/nest/graph/servingErrors.js.map +1 -1
  158. package/lib/esm/node/utility/code/node.js +11 -3
  159. package/lib/esm/node/utility/code/node.js.map +1 -1
  160. package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
  161. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
  162. package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
  163. package/lib/esm/shared/graph/constants.js +8 -0
  164. package/lib/esm/shared/graph/constants.js.map +1 -1
  165. package/lib/esm/shared/graph/index.js +2 -1
  166. package/lib/esm/shared/graph/index.js.map +1 -1
  167. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
  168. package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
  169. package/lib/esm/shared/graph/layout/index.js +6 -0
  170. package/lib/esm/shared/graph/layout/index.js.map +1 -0
  171. package/lib/esm/shared/graph/layout/layout-options.js +96 -0
  172. package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
  173. package/lib/esm/shared/ui/index.js +8 -10
  174. package/lib/esm/shared/ui/index.js.map +1 -1
  175. package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
  176. package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
  177. package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
  178. package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
  179. package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
  180. package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
  181. package/lib/types/dagster/DagsterTypes.d.cts +355 -0
  182. package/lib/types/dagster/DagsterTypes.d.mts +355 -0
  183. package/lib/types/dagster/capabilities.d.cts +34 -0
  184. package/lib/types/dagster/capabilities.d.mts +34 -0
  185. package/lib/types/dagster/constants.d.cts +87 -0
  186. package/lib/types/dagster/constants.d.mts +87 -0
  187. package/lib/types/dagster/index.d.cts +14 -0
  188. package/lib/types/dagster/index.d.mts +14 -0
  189. package/lib/types/engine/constants.d.cts +5 -0
  190. package/lib/types/engine/constants.d.mts +5 -0
  191. package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
  192. package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
  193. package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
  194. package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
  195. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
  196. package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
  197. package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
  198. package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
  199. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
  200. package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
  201. package/lib/types/engine/execution/index.d.cts +4 -0
  202. package/lib/types/engine/execution/index.d.mts +4 -0
  203. package/lib/types/engine/index.d.cts +4 -0
  204. package/lib/types/engine/index.d.mts +4 -0
  205. package/lib/types/engine/runs/GraphRunService.d.cts +19 -0
  206. package/lib/types/engine/runs/GraphRunService.d.mts +19 -0
  207. package/lib/types/engine/services/GraphWorkflowService.d.cts +22 -0
  208. package/lib/types/engine/services/GraphWorkflowService.d.mts +22 -0
  209. package/lib/types/mastra/MastraCapabilities.d.cts +91 -0
  210. package/lib/types/mastra/MastraCapabilities.d.mts +91 -0
  211. package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
  212. package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
  213. package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
  214. package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
  215. package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
  216. package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
  217. package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
  218. package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
  219. package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
  220. package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
  221. package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
  222. package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
  223. package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
  224. package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
  225. package/lib/types/mastra/index.d.cts +17 -0
  226. package/lib/types/mastra/index.d.mts +17 -0
  227. package/lib/types/mastra/types.d.cts +222 -0
  228. package/lib/types/mastra/types.d.mts +222 -0
  229. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
  230. package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
  231. package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
  232. package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
  233. package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
  234. package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
  235. package/lib/types/nest/graph/GraphExecutionModule.d.cts +8 -0
  236. package/lib/types/nest/graph/GraphExecutionModule.d.mts +8 -0
  237. package/lib/types/nest/graph/index.d.cts +3 -0
  238. package/lib/types/nest/graph/index.d.mts +3 -0
  239. package/lib/types/nest/graph/main.d.cts +1 -0
  240. package/lib/types/nest/graph/main.d.mts +1 -0
  241. package/lib/types/nest/graph/servingErrors.d.cts +3 -1
  242. package/lib/types/nest/graph/servingErrors.d.mts +3 -1
  243. package/lib/types/node/utility/code/node.d.cts +1 -1
  244. package/lib/types/node/utility/code/node.d.mts +1 -1
  245. package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
  246. package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
  247. package/lib/types/shared/graph/constants.d.cts +8 -0
  248. package/lib/types/shared/graph/constants.d.mts +8 -0
  249. package/lib/types/shared/graph/index.d.cts +2 -1
  250. package/lib/types/shared/graph/index.d.mts +2 -1
  251. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
  252. package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
  253. package/lib/types/shared/graph/layout/index.d.cts +5 -0
  254. package/lib/types/shared/graph/layout/index.d.mts +5 -0
  255. package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
  256. package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
  257. package/lib/types/shared/graph/types.d.cts +4 -3
  258. package/lib/types/shared/graph/types.d.mts +4 -3
  259. package/lib/types/shared/ui/index.d.cts +8 -10
  260. package/lib/types/shared/ui/index.d.mts +8 -10
  261. package/package.json +49 -6
  262. package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
  263. package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
  264. package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
  265. package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
  266. package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
  267. package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
  268. package/lib/cjs/shared/ui/types.cjs +0 -4
  269. package/lib/cjs/shared/ui/types.cjs.map +0 -1
  270. package/lib/esm/shared/ui/GraphNodeView.js +0 -107
  271. package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
  272. package/lib/esm/shared/ui/GraphRunView.js +0 -90
  273. package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
  274. package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
  275. package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
  276. package/lib/esm/shared/ui/types.js +0 -2
  277. package/lib/esm/shared/ui/types.js.map +0 -1
  278. package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
  279. package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
  280. package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
  281. package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
  282. package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
  283. package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
  284. package/lib/types/shared/ui/types.d.cts +0 -200
  285. package/lib/types/shared/ui/types.d.mts +0 -200
@@ -0,0 +1,355 @@
1
+ /**
2
+ * @module as-graph/dagster/DagsterTypes
3
+ * @summary Capability, inspection, run, execution, and client-port types for the
4
+ * Dagster backend.
5
+ * @description The Dagster driver never authors workflows and never generates,
6
+ * embeds, or emits Python source. It may list, look up, inspect, and surface
7
+ * ALREADY-EXISTING Dagster workflows through the host-injected
8
+ * {@link DagsterClient} port, and — only behind the explicit
9
+ * {@link DagsterGraphExecutionBackendConfig.executionEnabled} gate — launch a run
10
+ * of an already-deployed job and re-execute an existing run. The wrapper never
11
+ * bundles a phantom JavaScript Dagster runtime.
12
+ */
13
+ import type { GraphExecutionEventSink } from "../engine/execution/GraphExecutionBackend.d.cts";
14
+ /**
15
+ * A capability verdict row in the exported Dagster capability table.
16
+ */
17
+ export type DagsterCapabilityVerdict = "supported" | "not_supported" | "extension_point";
18
+ /**
19
+ * A single row of the exported Dagster capability table.
20
+ */
21
+ export interface DagsterCapabilityRow {
22
+ /** The engine feature being described. */
23
+ feature: string;
24
+ /** Whether Dagster supports it natively, not at all, or via an extension point. */
25
+ verdict: DagsterCapabilityVerdict;
26
+ /** Human-readable detail for the verdict. */
27
+ detail: string;
28
+ }
29
+ /**
30
+ * A raw Dagster event record surfaced by the client port.
31
+ */
32
+ export interface DagsterEventRecord {
33
+ /** Raw Dagster event type (e.g. `STEP_START`, `STEP_SUCCESS`). */
34
+ type: string;
35
+ /** Dagster step key; maps to a canonical node id via the inspected job map. */
36
+ stepKey?: string;
37
+ /** ISO-8601 event timestamp. */
38
+ timestamp?: string;
39
+ /** Raw event payload (outputs, errors, ...). */
40
+ payload?: Record<string, unknown>;
41
+ /** Raw human-readable message. */
42
+ message?: string;
43
+ }
44
+ /**
45
+ * The raw Dagster run-status vocabulary the driver may receive. Only `success`,
46
+ * `failure`, and `canceled` are terminal; `started` and the real Dagster pending
47
+ * statuses (`QUEUED`/`STARTING`) are non-terminal and must be polled to a terminal
48
+ * state, a caller abort, or a timeout (C5 fail-closed).
49
+ */
50
+ export type DagsterRunStatus = "started" | "success" | "failure" | "canceled" | "QUEUED" | "STARTING";
51
+ /**
52
+ * A Dagster run record. Carries the run's status and, when the port exposes it,
53
+ * the name of the deployed job that owns the run (`jobName`/`pipelineName`), so the
54
+ * driver can bind a run to the workflow it belongs to before replaying it (C1).
55
+ */
56
+ export interface DagsterRunRecord {
57
+ /** Dagster run id. */
58
+ runId: string;
59
+ /** Run status. Only `success`/`failure`/`canceled` are terminal. */
60
+ status: DagsterRunStatus;
61
+ /** Workflow output values, when the client exposes them. */
62
+ outputs?: Record<string, unknown>;
63
+ /** Run failure, when the run failed. */
64
+ error?: {
65
+ message: string;
66
+ code?: string;
67
+ };
68
+ /** Run start timestamp. */
69
+ startedAt?: string;
70
+ /** Run finish timestamp. */
71
+ finishedAt?: string;
72
+ /** Name of the deployed job that owns the run, when the port exposes it. */
73
+ jobName?: string;
74
+ /** Legacy alias of {@link DagsterRunRecord.jobName}, when the port exposes it. */
75
+ pipelineName?: string;
76
+ }
77
+ /**
78
+ * The handle a client port returns when it launches or re-executes a run. Carries
79
+ * the new Dagster run id and its (initial or terminal) status; the driver then
80
+ * observes the run through the existing event bridge.
81
+ */
82
+ export interface DagsterLaunchedRun {
83
+ /** Dagster run id of the launched/re-executed run. */
84
+ runId: string;
85
+ /**
86
+ * Run status reported by the launch; `started` for a fresh launch, but a real
87
+ * transport may report a pending `QUEUED`/`STARTING` status the driver then
88
+ * polls to terminal.
89
+ */
90
+ status: DagsterRunStatus;
91
+ }
92
+ /**
93
+ * A request to launch a run of an ALREADY-DEPLOYED Dagster job. The driver only
94
+ * ever sends this behind the explicit execution gate; it never authors a job, op,
95
+ * or Python source — it asks the host transport to launch a job the deployment
96
+ * already defines.
97
+ */
98
+ export interface DagsterLaunchRunRequest {
99
+ /** Name of the already-deployed job to launch. */
100
+ jobName: string;
101
+ /**
102
+ * Optional raw Dagster run configuration (the job's `runConfigData`). The host
103
+ * transport forwards it verbatim; the driver never synthesizes it.
104
+ */
105
+ runConfig?: Record<string, unknown>;
106
+ /** Optional run tags (merged by the host with any transport-owned tags). */
107
+ tags?: Record<string, string>;
108
+ }
109
+ /**
110
+ * A request to re-execute (replay) an EXISTING Dagster run, sent to the host
111
+ * {@link DagsterClient} port. The host transport owns the mechanism: where the
112
+ * GraphQL surface exposes a re-execution mutation it re-executes from the run id,
113
+ * otherwise it re-launches the run's job with the run's original configuration.
114
+ * The driver never authors a job or Python source.
115
+ */
116
+ export interface DagsterReplayRunRequest {
117
+ /** Dagster run id of the existing run to replay. */
118
+ dagsterRunId: string;
119
+ /** Optional name of the run's job, when the transport needs it to re-launch. */
120
+ jobName?: string;
121
+ /** Optional run tags (merged by the host with any transport-owned tags). */
122
+ tags?: Record<string, string>;
123
+ }
124
+ /**
125
+ * A request to replay an EXISTING Dagster run through
126
+ * {@link DagsterGraphExecutionBackend.replayRun}. Carries the run identity, the
127
+ * workflow it belongs to, the facade-owned event sink, and the same observation
128
+ * bounds as {@link DagsterObserveRunRequest}. The driver delegates the actual
129
+ * re-execution to the host transport's `replayRun` and then observes the new run.
130
+ */
131
+ export interface DagsterReplayExistingRunRequest {
132
+ /** Dagster run id of the existing run to replay. */
133
+ dagsterRunId: string;
134
+ /** Canonical workflow id (Dagster job name) the run belongs to. */
135
+ workflowId: string;
136
+ /** Facade-owned event sink the driver reports transitions through. */
137
+ events: GraphExecutionEventSink;
138
+ /** Canonical as-graph run id carried on emitted events; defaults to the new run id. */
139
+ graphRunId?: string;
140
+ /** Workflow input values carried onto the canonical result. */
141
+ inputs?: Record<string, unknown>;
142
+ /** Execution options metadata carried onto the canonical result. */
143
+ metadata?: Record<string, unknown>;
144
+ /** Caller cancellation signal, forwarded to the observation bridge. */
145
+ signal?: AbortSignal;
146
+ /** Hard cap on the number of events the bridge processes. */
147
+ maxEvents?: number;
148
+ /** Hard cap on the transport pagination depth. */
149
+ maxPages?: number;
150
+ /** Maximum time to await the terminal record. */
151
+ terminalTimeoutMs?: number;
152
+ }
153
+ /**
154
+ * A subscription to a Dagster run's event stream.
155
+ */
156
+ export interface DagsterRunSubscription {
157
+ /** Stops the subscription. */
158
+ unsubscribe: () => void | Promise<void>;
159
+ }
160
+ /**
161
+ * Bounds applied to a run-event subscription. The read-only driver passes these
162
+ * through to the host-injected {@link DagsterClient} so a wedged or hostile
163
+ * gateway cannot make the transport page or buffer without limit: `signal` cancels
164
+ * in-flight transport work, `maxEvents` caps the number of events replayed, and
165
+ * `maxPages` caps the pagination depth. Every field is optional so a host port that
166
+ * predates them keeps working.
167
+ */
168
+ export interface DagsterRunSubscriptionOptions {
169
+ /** Cancels the subscription and any in-flight transport work. */
170
+ signal?: AbortSignal;
171
+ /** Hard cap on the number of events the transport replays. */
172
+ maxEvents?: number;
173
+ /** Hard cap on the number of pagination pages the transport fetches. */
174
+ maxPages?: number;
175
+ }
176
+ /**
177
+ * A Dagster job summary surfaced by workflow listing.
178
+ */
179
+ export interface DagsterJobSummary {
180
+ /** Job name. */
181
+ name: string;
182
+ /** Optional description. */
183
+ description?: string;
184
+ /** Optional last-update timestamp. */
185
+ updatedAt?: Date;
186
+ }
187
+ /**
188
+ * One op/step of a deployed Dagster job, as exposed by the client port.
189
+ * `nodeId` and `kind` are optional because a deployment may not classify its ops;
190
+ * the driver falls back to the op `name` and {@link DAGSTER_DEFAULT_NODE_KIND}.
191
+ */
192
+ export interface DagsterJobOp {
193
+ /** Dagster op/step name. */
194
+ name: string;
195
+ /** Canonical node id, when the deployment exposes one. */
196
+ nodeId?: string;
197
+ /** Canonical node kind, when the deployment exposes one. */
198
+ kind?: string;
199
+ /** Op input names, when the deployment exposes them. */
200
+ inputs?: string[];
201
+ /** Op output names, when the deployment exposes them. */
202
+ outputs?: string[];
203
+ /** Asset keys the op materializes, when the deployment exposes them. */
204
+ assetKeys?: string[];
205
+ }
206
+ /**
207
+ * A directed op dependency of a deployed Dagster job: `from` feeds `to`.
208
+ */
209
+ export interface DagsterJobDependency {
210
+ /** Upstream op name. */
211
+ from: string;
212
+ /** Downstream op name. */
213
+ to: string;
214
+ }
215
+ /**
216
+ * A schedule declared by a deployed Dagster job, when the deployment exposes it.
217
+ */
218
+ export interface DagsterJobSchedule {
219
+ /** Schedule name. */
220
+ name: string;
221
+ /** Cron expression, when exposed. */
222
+ cron?: string;
223
+ /** IANA timezone, when exposed. */
224
+ timezone?: string;
225
+ }
226
+ /**
227
+ * A sensor declared by a deployed Dagster job, when the deployment exposes it.
228
+ */
229
+ export interface DagsterJobSensor {
230
+ /** Sensor name. */
231
+ name: string;
232
+ /** Sensor kind, when exposed. */
233
+ kind?: string;
234
+ }
235
+ /**
236
+ * A deployed Dagster job record surfaced by workflow lookup. Carries the actual
237
+ * deployment structure the driver maps into the canonical document shape: the job
238
+ * name, graph/op structure, asset keys, and schedules/sensors where the client
239
+ * port exposes them. Every field is read-only inspection data — no op body, no
240
+ * Python source.
241
+ */
242
+ export interface DagsterJobRecord {
243
+ /** Job name. */
244
+ name: string;
245
+ /** Optional description. */
246
+ description?: string;
247
+ /** Optional last-update timestamp. */
248
+ updatedAt?: Date;
249
+ /** Ops/steps of the job's graph, when the deployment exposes them. */
250
+ ops?: DagsterJobOp[];
251
+ /** Directed op dependencies, when the deployment exposes them. */
252
+ dependencies?: DagsterJobDependency[];
253
+ /** Asset keys the job reads/materializes, when the deployment exposes them. */
254
+ assetKeys?: string[];
255
+ /** Schedules attached to the job, when the deployment exposes them. */
256
+ schedules?: DagsterJobSchedule[];
257
+ /** Sensors attached to the job, when the deployment exposes them. */
258
+ sensors?: DagsterJobSensor[];
259
+ }
260
+ /**
261
+ * Host-injected, read-only Dagster client port. Abstracts the GraphQL/REST
262
+ * transport so the wrapper stays a pure inspection + event-mapping layer and the
263
+ * host owns the Dagster deployment. Listing/lookup are required: the owner mandate
264
+ * makes reading already-existing workflows the driver's core responsibility.
265
+ */
266
+ export interface DagsterClient {
267
+ /** Lists already-deployed Dagster jobs. */
268
+ listJobs(): Promise<DagsterJobSummary[]>;
269
+ /** Reads a single already-deployed Dagster job, including its graph structure. */
270
+ getJob(jobName: string): Promise<DagsterJobRecord>;
271
+ /** Subscribes to an EXISTING run's raw event stream. */
272
+ subscribeRun(runId: string, handler: (event: DagsterEventRecord) => void, options?: DagsterRunSubscriptionOptions): Promise<DagsterRunSubscription>;
273
+ /** Terminates an EXISTING run. */
274
+ terminateRun(runId: string, reason?: string): Promise<void>;
275
+ /** Reads an EXISTING run's terminal record. */
276
+ getRun(runId: string): Promise<DagsterRunRecord>;
277
+ /**
278
+ * Launches a run of an ALREADY-DEPLOYED job. Optional: a read-only host port
279
+ * omits it, and the driver then fails closed with
280
+ * `GRAPH_DAGSTER_EXECUTION_NOT_SUPPORTED`. Called only when the explicit
281
+ * execution gate is enabled.
282
+ */
283
+ launchRun?(request: DagsterLaunchRunRequest): Promise<DagsterLaunchedRun>;
284
+ /**
285
+ * Re-executes (replays) an EXISTING run. Optional: a host without a
286
+ * re-execution surface omits it, and the driver then fails closed with
287
+ * `GRAPH_DAGSTER_REPLAY_NOT_SUPPORTED`. Called only when the explicit execution
288
+ * gate is enabled.
289
+ */
290
+ replayRun?(request: DagsterReplayRunRequest): Promise<DagsterLaunchedRun>;
291
+ /** Disposes the client and its transport. */
292
+ dispose?(): void | Promise<void>;
293
+ }
294
+ /**
295
+ * Configuration for {@link DagsterGraphExecutionBackend}. The driver accepts no
296
+ * op resolver: it never authors ops. Execution/replay of EXISTING workflows is
297
+ * opt-in and defaults off.
298
+ */
299
+ export interface DagsterGraphExecutionBackendConfig extends Record<string, unknown> {
300
+ /** Host-injected Dagster client port (read surface always; launch/replay when enabled). */
301
+ client: DagsterClient;
302
+ /** Optional host-supplied default run tags. */
303
+ tags?: Record<string, string>;
304
+ /**
305
+ * Explicit opt-in for executing (launching a run of an already-deployed job)
306
+ * and replaying (re-executing an existing run) through the client port. Defaults
307
+ * to `false`: when off, `execute`/`replayRun` fail closed with
308
+ * `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` before any network call, and the driver
309
+ * remains purely read-only. The facade preserves this key across
310
+ * `GraphExecutionEngine.initialize` (it is not facade-owned).
311
+ */
312
+ executionEnabled?: boolean;
313
+ }
314
+ /**
315
+ * A request to observe an EXISTING Dagster run. The run is never launched by the
316
+ * driver; the caller supplies the id of a run that already exists in the
317
+ * deployment.
318
+ */
319
+ export interface DagsterObserveRunRequest {
320
+ /** Dagster run id of the existing run. */
321
+ dagsterRunId: string;
322
+ /** Canonical as-graph run id carried on emitted events; defaults to the Dagster run id. */
323
+ graphRunId?: string;
324
+ /** Canonical workflow id the run belongs to. */
325
+ workflowId: string;
326
+ /** Facade-owned event sink the driver reports transitions through. */
327
+ events: GraphExecutionEventSink;
328
+ /** Workflow input values carried onto the canonical result. */
329
+ inputs?: Record<string, unknown>;
330
+ /** Execution options metadata carried onto the canonical result. */
331
+ metadata?: Record<string, unknown>;
332
+ /**
333
+ * Caller cancellation signal. Aborting it fails the observation closed with
334
+ * `GRAPH_DAGSTER_OBSERVE_ABORTED` and cancels in-flight transport work
335
+ * instead of leaving the caller waiting on a wedged or stalled run.
336
+ */
337
+ signal?: AbortSignal;
338
+ /**
339
+ * Hard cap on the number of events the bridge will process. Exceeding it fails
340
+ * the observation closed with `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED`, so a gateway
341
+ * that never terminates cannot accumulate events without bound.
342
+ */
343
+ maxEvents?: number;
344
+ /**
345
+ * Hard cap on the transport pagination depth. Forwarded to the client port so a
346
+ * gateway whose `eventConnection` never reports `hasMore: false` cannot page
347
+ * without bound.
348
+ */
349
+ maxPages?: number;
350
+ /**
351
+ * Maximum time to await the terminal record. Exceeding it fails the observation
352
+ * closed with `GRAPH_DAGSTER_OBSERVE_TIMEOUT`.
353
+ */
354
+ terminalTimeoutMs?: number;
355
+ }