@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,74 @@
1
+ import { DecafRequestContext } from "@decaf-ts/for-nest";
2
+ import type { GraphWorkflowDocument } from "../../shared/graph/index.d.mts";
3
+ import type { GraphEngineCapabilityManifest, GraphEngineDescriptor } from "./GraphEngineCapabilityManifest.d.mts";
4
+ import { GraphEngineCapabilityService, type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.mts";
5
+ /** One row of the engine workflow list: the serving summary a list binds to. */
6
+ export interface GraphEngineWorkflowSummary {
7
+ /** Canonical workflow id. */
8
+ workflowId: string;
9
+ /** Display name mirrored from the document, when present. */
10
+ name?: string;
11
+ /** ISO timestamp of the last update, when the backend exposes one. */
12
+ updatedAt?: string;
13
+ }
14
+ /**
15
+ * Engine capability manifest and engine-scoped workflow catalogue endpoints:
16
+ *
17
+ * - `GET /graph/engines` — the C20 capability manifest for every available
18
+ * (registered, allowlisted) engine.
19
+ * - `GET /graph/engines/{engineId}` — one engine descriptor.
20
+ * - `GET /graph/engines/{engineId}/workflows` — the workflows that engine
21
+ * surfaces through the engine-agnostic facade.
22
+ * - `GET /graph/engines/{engineId}/workflows/{workflowId}` — one canonical
23
+ * workflow document from that engine.
24
+ *
25
+ * All routes are read-only `GET`s, select engines by allowlisted id only, and
26
+ * never reflect arbitrary query input.
27
+ */
28
+ export declare class GraphEngineController {
29
+ private readonly capabilityService;
30
+ private readonly requestContext?;
31
+ private readonly options;
32
+ constructor(capabilityService: GraphEngineCapabilityService, requestContext?: DecafRequestContext | undefined, options?: GraphEngineCapabilityOptions);
33
+ /**
34
+ * Enforces the configured authentication mode: `auth` defaults to `"required"`
35
+ * and rejects a request with no request context, or with a context that carries
36
+ * no resolved owner user, with `401`; `"optional"` admits anonymous requests.
37
+ */
38
+ private requireAuthenticatedContext;
39
+ private assertKnownEngine;
40
+ /**
41
+ * Returns the capability manifest for every available engine.
42
+ *
43
+ * @return {Promise<GraphEngineCapabilityManifest>} The C20 capability manifest.
44
+ * @throws {HttpException} 401 without an authenticated caller.
45
+ */
46
+ getManifest(): Promise<GraphEngineCapabilityManifest>;
47
+ /**
48
+ * Returns one allowlisted engine's capability descriptor.
49
+ *
50
+ * @param {string} engineId - Allowlisted engine id path parameter.
51
+ * @return {Promise<GraphEngineDescriptor>} The engine descriptor.
52
+ * @throws {HttpException} 404 when the engine id is not available.
53
+ */
54
+ getEngine(engineId: string): Promise<GraphEngineDescriptor>;
55
+ /**
56
+ * Lists the workflows the selected engine surfaces through the
57
+ * engine-agnostic facade.
58
+ *
59
+ * @param {string} engineId - Allowlisted engine id path parameter.
60
+ * @return {Promise<GraphEngineWorkflowSummary[]>} Workflow summaries.
61
+ * @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no listing support.
62
+ */
63
+ listWorkflows(engineId: string): Promise<GraphEngineWorkflowSummary[]>;
64
+ /**
65
+ * Returns one canonical workflow document from the selected engine through the
66
+ * engine-agnostic facade.
67
+ *
68
+ * @param {string} engineId - Allowlisted engine id path parameter.
69
+ * @param {string} workflowId - Canonical workflow id path parameter.
70
+ * @return {Promise<GraphWorkflowDocument>} The canonical workflow document.
71
+ * @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no lookup support.
72
+ */
73
+ getWorkflow(engineId: string, workflowId: string): Promise<GraphWorkflowDocument>;
74
+ }
@@ -17,6 +17,7 @@ import { type GraphRunControllerOptions } from "./GraphRunController.d.cts";
17
17
  import type { GraphWorkflowServiceOptions } from "../../engine/services/GraphEnvironment.d.cts";
18
18
  import type { GraphRunServiceOptions } from "../../engine/runs/GraphRunService.d.cts";
19
19
  import { type GraphWorkflowControllerOptions } from "./GraphWorkflowController.d.cts";
20
+ import { type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.cts";
20
21
  /**
21
22
  * Options for {@link GraphExecutionModule.forRoot}: adapter bootstrapping
22
23
  * plus per-API (catalogue, workflows, runs) authentication and limit
@@ -58,6 +59,13 @@ export interface GraphExecutionModuleOptions {
58
59
  * (SAA-93 F3).
59
60
  */
60
61
  runs?: GraphRunControllerOptions & GraphRunServiceOptions;
62
+ /**
63
+ * Options for the engine capability HTTP API (SAA-197, SAA-193 C20/C21):
64
+ * authentication mode, the advertised default engine id, and the engine-route
65
+ * rate limit. The capability manifest is derived statically at boot from the
66
+ * registered backends and never read from the environment or a remote engine.
67
+ */
68
+ engines?: GraphEngineCapabilityOptions;
61
69
  /**
62
70
  * Production hosts MUST wire a {@link GraphCredentialAuthorizer} backed by
63
71
  * their credential store (DECAF-50 §4.8 stage 8). Without it, stage-8
@@ -17,6 +17,7 @@ import { type GraphRunControllerOptions } from "./GraphRunController.d.mts";
17
17
  import type { GraphWorkflowServiceOptions } from "../../engine/services/GraphEnvironment.d.mts";
18
18
  import type { GraphRunServiceOptions } from "../../engine/runs/GraphRunService.d.mts";
19
19
  import { type GraphWorkflowControllerOptions } from "./GraphWorkflowController.d.mts";
20
+ import { type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.mts";
20
21
  /**
21
22
  * Options for {@link GraphExecutionModule.forRoot}: adapter bootstrapping
22
23
  * plus per-API (catalogue, workflows, runs) authentication and limit
@@ -58,6 +59,13 @@ export interface GraphExecutionModuleOptions {
58
59
  * (SAA-93 F3).
59
60
  */
60
61
  runs?: GraphRunControllerOptions & GraphRunServiceOptions;
62
+ /**
63
+ * Options for the engine capability HTTP API (SAA-197, SAA-193 C20/C21):
64
+ * authentication mode, the advertised default engine id, and the engine-route
65
+ * rate limit. The capability manifest is derived statically at boot from the
66
+ * registered backends and never read from the environment or a remote engine.
67
+ */
68
+ engines?: GraphEngineCapabilityOptions;
61
69
  /**
62
70
  * Production hosts MUST wire a {@link GraphCredentialAuthorizer} backed by
63
71
  * their credential store (DECAF-50 §4.8 stage 8). Without it, stage-8
@@ -9,4 +9,7 @@ export * from "./GraphWorkflowController.d.cts";
9
9
  export * from "./GraphRunController.d.cts";
10
10
  export * from "./GraphExecutorRegistryFactory.d.cts";
11
11
  export * from "./GraphNodeCatalogueController.d.cts";
12
+ export * from "./GraphEngineCapabilityManifest.d.cts";
13
+ export * from "./GraphEngineCapabilityService.d.cts";
14
+ export * from "./GraphEngineController.d.cts";
12
15
  export * from "./GraphExecutionModule.d.cts";
@@ -9,4 +9,7 @@ export * from "./GraphWorkflowController.d.mts";
9
9
  export * from "./GraphRunController.d.mts";
10
10
  export * from "./GraphExecutorRegistryFactory.d.mts";
11
11
  export * from "./GraphNodeCatalogueController.d.mts";
12
+ export * from "./GraphEngineCapabilityManifest.d.mts";
13
+ export * from "./GraphEngineCapabilityService.d.mts";
14
+ export * from "./GraphEngineController.d.mts";
12
15
  export * from "./GraphExecutionModule.d.mts";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
6
6
  /** Logger context for the run lifecycle controller's server-side error log. */
7
- export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController";
7
+ export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController" | "GraphEngineController";
8
8
  /**
9
9
  * Request/run correlation fields attached to a server-side graph serving error
10
10
  * log. Only ids the server already resolved are included; the fields are never
@@ -15,6 +15,8 @@ export interface GraphServingErrorCorrelation {
15
15
  runId?: string;
16
16
  /** Workflow id, when the failing operation was scoped to a workflow. */
17
17
  workflowId?: string;
18
+ /** Engine id, when the failing operation was scoped to an engine. */
19
+ engineId?: string;
18
20
  }
19
21
  /**
20
22
  * Logs an unmapped graph serving failure server-side, with the request
@@ -4,7 +4,7 @@
4
4
  */
5
5
  export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
6
6
  /** Logger context for the run lifecycle controller's server-side error log. */
7
- export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController";
7
+ export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController" | "GraphEngineController";
8
8
  /**
9
9
  * Request/run correlation fields attached to a server-side graph serving error
10
10
  * log. Only ids the server already resolved are included; the fields are never
@@ -15,6 +15,8 @@ export interface GraphServingErrorCorrelation {
15
15
  runId?: string;
16
16
  /** Workflow id, when the failing operation was scoped to a workflow. */
17
17
  workflowId?: string;
18
+ /** Engine id, when the failing operation was scoped to an engine. */
19
+ engineId?: string;
18
20
  }
19
21
  /**
20
22
  * Logs an unmapped graph serving failure server-side, with the request
@@ -36,7 +36,7 @@ export declare const GRAPH_CODE_DEFAULT_TIMEOUT_MS = 1000;
36
36
  * @param maxTimeoutMs - The effective upper bound (backend environment, default {@link GRAPH_CODE_MAX_TIMEOUT_MS}).
37
37
  * @returns A bounded timeout in milliseconds.
38
38
  */
39
- export declare function clampGraphCodeTimeoutMs(value: unknown, maxTimeoutMs: number): number;
39
+ export declare function clampGraphCodeTimeoutMs(value: unknown, maxTimeoutMs: unknown): number;
40
40
  /**
41
41
  * Languages the Code node sandbox accepts. The `language` property is decorated
42
42
  * with `@option(GRAPH_CODE_LANGUAGES)` so the CRUD renderer shows a selector
@@ -36,7 +36,7 @@ export declare const GRAPH_CODE_DEFAULT_TIMEOUT_MS = 1000;
36
36
  * @param maxTimeoutMs - The effective upper bound (backend environment, default {@link GRAPH_CODE_MAX_TIMEOUT_MS}).
37
37
  * @returns A bounded timeout in milliseconds.
38
38
  */
39
- export declare function clampGraphCodeTimeoutMs(value: unknown, maxTimeoutMs: number): number;
39
+ export declare function clampGraphCodeTimeoutMs(value: unknown, maxTimeoutMs: unknown): number;
40
40
  /**
41
41
  * Languages the Code node sandbox accepts. The `language` property is decorated
42
42
  * with `@option(GRAPH_CODE_LANGUAGES)` so the CRUD renderer shows a selector
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @module ui-decorators/graph/GraphExecutionStateMapper
2
+ * @module as-graph/shared/graph/GraphExecutionStateMapper
3
3
  * @summary Maps engine state to the frontend-safe visual-state contract.
4
4
  * @description Pure, engine-agnostic helpers that derive
5
- * `GraphVisualState` values from engine execution signals. Frontend
6
- * bundles may import this from `@decaf-ts/ui-decorators/graph` (no
7
- * engine runtime dependency); a future Mastra/NestJS driver maps its own
8
- * runtime states onto `GraphVisualState` with the same rules.
5
+ * `GraphVisualState` values from engine execution signals. Frontend bundles
6
+ * import this from `@decaf-ts/as-graph/shared` (no engine runtime
7
+ * dependency); a Mastra/NestJS driver maps its own runtime states onto
8
+ * `GraphVisualState` with the same rules.
9
9
  */
10
10
  import type { GraphExecutionEvent } from "./types.d.cts";
11
11
  import { GraphExecutionStatus, GraphVisualState } from "./constants.d.cts";
@@ -1,11 +1,11 @@
1
1
  /**
2
- * @module ui-decorators/graph/GraphExecutionStateMapper
2
+ * @module as-graph/shared/graph/GraphExecutionStateMapper
3
3
  * @summary Maps engine state to the frontend-safe visual-state contract.
4
4
  * @description Pure, engine-agnostic helpers that derive
5
- * `GraphVisualState` values from engine execution signals. Frontend
6
- * bundles may import this from `@decaf-ts/ui-decorators/graph` (no
7
- * engine runtime dependency); a future Mastra/NestJS driver maps its own
8
- * runtime states onto `GraphVisualState` with the same rules.
5
+ * `GraphVisualState` values from engine execution signals. Frontend bundles
6
+ * import this from `@decaf-ts/as-graph/shared` (no engine runtime
7
+ * dependency); a Mastra/NestJS driver maps its own runtime states onto
8
+ * `GraphVisualState` with the same rules.
9
9
  */
10
10
  import type { GraphExecutionEvent } from "./types.d.mts";
11
11
  import { GraphExecutionStatus, GraphVisualState } from "./constants.d.mts";
@@ -564,6 +564,14 @@ export declare enum GraphExecutionEventType {
564
564
  WORKFLOW_COMPLETED = "workflow.completed",
565
565
  WORKFLOW_FAILED = "workflow.failed",
566
566
  WORKFLOW_CANCELLED = "workflow.cancelled",
567
+ /**
568
+ * Engine-agnostic suspend/resume extension point (SAA-196). A backend that
569
+ * supports suspend/resume reports the suspension and the accepted resume through
570
+ * these shared event types so observers and the run store stay engine-agnostic.
571
+ */
572
+ WORKFLOW_SUSPENDED = "workflow.suspended",
573
+ /** Engine-agnostic suspend/resume extension point (SAA-196). */
574
+ WORKFLOW_RESUMED = "workflow.resumed",
567
575
  NODE_QUEUED = "node.queued",
568
576
  NODE_STARTED = "node.started",
569
577
  NODE_OUTPUT = "node.output",
@@ -564,6 +564,14 @@ export declare enum GraphExecutionEventType {
564
564
  WORKFLOW_COMPLETED = "workflow.completed",
565
565
  WORKFLOW_FAILED = "workflow.failed",
566
566
  WORKFLOW_CANCELLED = "workflow.cancelled",
567
+ /**
568
+ * Engine-agnostic suspend/resume extension point (SAA-196). A backend that
569
+ * supports suspend/resume reports the suspension and the accepted resume through
570
+ * these shared event types so observers and the run store stay engine-agnostic.
571
+ */
572
+ WORKFLOW_SUSPENDED = "workflow.suspended",
573
+ /** Engine-agnostic suspend/resume extension point (SAA-196). */
574
+ WORKFLOW_RESUMED = "workflow.resumed",
567
575
  NODE_QUEUED = "node.queued",
568
576
  NODE_STARTED = "node.started",
569
577
  NODE_OUTPUT = "node.output",
@@ -12,10 +12,11 @@ export * from "./snapshot.d.cts";
12
12
  export * from "./reader.d.cts";
13
13
  export * from "./document/index.d.cts";
14
14
  export * from "./catalog/index.d.cts";
15
+ export * from "./layout/index.d.cts";
15
16
  export * from "./types.d.cts";
16
17
  export * from "./GraphRunModel.d.cts";
17
18
  export * from "./GraphWorkflowModel.d.cts";
18
- export * from "./GraphExecutionStateMapper.d.cts";
19
19
  export * from "./GraphResolution.d.cts";
20
+ export * from "./GraphExecutionStateMapper.d.cts";
20
21
  export * from "./category-styles.d.cts";
21
22
  export * from "./overrides/index.d.cts";
@@ -12,10 +12,11 @@ export * from "./snapshot.d.mts";
12
12
  export * from "./reader.d.mts";
13
13
  export * from "./document/index.d.mts";
14
14
  export * from "./catalog/index.d.mts";
15
+ export * from "./layout/index.d.mts";
15
16
  export * from "./types.d.mts";
16
17
  export * from "./GraphRunModel.d.mts";
17
18
  export * from "./GraphWorkflowModel.d.mts";
18
- export * from "./GraphExecutionStateMapper.d.mts";
19
19
  export * from "./GraphResolution.d.mts";
20
+ export * from "./GraphExecutionStateMapper.d.mts";
20
21
  export * from "./category-styles.d.mts";
21
22
  export * from "./overrides/index.d.mts";
@@ -0,0 +1,49 @@
1
+ import type { ElkExtendedEdge, ElkNode } from "elkjs/lib/elk-api";
2
+ import type { GraphWorkflowDocument } from "../document/GraphWorkflowDocument.d.cts";
3
+ import { type GraphLayoutOptions } from "./layout-options.d.cts";
4
+ /**
5
+ * A 2D point in canvas coordinates. Matches `GraphNodeUiState.position` and the
6
+ * `GraphEdgeUiState.points` waypoint shape.
7
+ */
8
+ export interface GraphLayoutPoint {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ /**
13
+ * Deterministic result of `computeGraphWorkflowLayout`.
14
+ *
15
+ * - `nodes` maps every document node id to its laid-out top-left `{x,y}`.
16
+ * - `edges` is present only when at least one edge has routed waypoints, mapping
17
+ * the edge id to its ordered polyline `{x,y}` points.
18
+ */
19
+ export interface GraphWorkflowLayoutResult {
20
+ nodes: Record<string, GraphLayoutPoint>;
21
+ edges?: Record<string, GraphLayoutPoint[]>;
22
+ }
23
+ type ElkGraph = ElkNode & {
24
+ edges?: ElkExtendedEdge[];
25
+ };
26
+ /**
27
+ * Pure transform of a workflow document into the ELK layered input graph. It reads
28
+ * the document without mutating it; only node→node edges are forwarded (workflow
29
+ * boundary edges have no canvas node to route between). Node sizes come from the
30
+ * persisted `GraphNodeUiState.size` when present, otherwise the shared
31
+ * {@link GRAPH_DEFAULT_NODE_SIZE} display default.
32
+ */
33
+ export declare function toElkGraph(document: GraphWorkflowDocument, options?: GraphLayoutOptions): ElkGraph;
34
+ /**
35
+ * Pure projection of an ELK layout result back onto document ids. Node keys follow
36
+ * the document's node order; edge keys follow the document's edge order. The input
37
+ * document is only read, never mutated.
38
+ */
39
+ export declare function fromElkLayout(laidOut: ElkGraph, document: GraphWorkflowDocument): GraphWorkflowLayoutResult;
40
+ /**
41
+ * Computes a deterministic, left-to-right layout for a workflow document.
42
+ *
43
+ * The function is pure with respect to the document (it is never mutated) and
44
+ * deterministic (same document + options yields byte-identical output). It returns a
45
+ * Promise because ELK's `layout()` is asynchronous; `toElkGraph` and
46
+ * `fromElkLayout` are synchronous and side-effect free.
47
+ */
48
+ export declare function computeGraphWorkflowLayout(document: GraphWorkflowDocument, options?: GraphLayoutOptions): Promise<GraphWorkflowLayoutResult>;
49
+ export {};
@@ -0,0 +1,49 @@
1
+ import type { ElkExtendedEdge, ElkNode } from "elkjs/lib/elk-api";
2
+ import type { GraphWorkflowDocument } from "../document/GraphWorkflowDocument.d.mts";
3
+ import { type GraphLayoutOptions } from "./layout-options.d.mts";
4
+ /**
5
+ * A 2D point in canvas coordinates. Matches `GraphNodeUiState.position` and the
6
+ * `GraphEdgeUiState.points` waypoint shape.
7
+ */
8
+ export interface GraphLayoutPoint {
9
+ x: number;
10
+ y: number;
11
+ }
12
+ /**
13
+ * Deterministic result of `computeGraphWorkflowLayout`.
14
+ *
15
+ * - `nodes` maps every document node id to its laid-out top-left `{x,y}`.
16
+ * - `edges` is present only when at least one edge has routed waypoints, mapping
17
+ * the edge id to its ordered polyline `{x,y}` points.
18
+ */
19
+ export interface GraphWorkflowLayoutResult {
20
+ nodes: Record<string, GraphLayoutPoint>;
21
+ edges?: Record<string, GraphLayoutPoint[]>;
22
+ }
23
+ type ElkGraph = ElkNode & {
24
+ edges?: ElkExtendedEdge[];
25
+ };
26
+ /**
27
+ * Pure transform of a workflow document into the ELK layered input graph. It reads
28
+ * the document without mutating it; only node→node edges are forwarded (workflow
29
+ * boundary edges have no canvas node to route between). Node sizes come from the
30
+ * persisted `GraphNodeUiState.size` when present, otherwise the shared
31
+ * {@link GRAPH_DEFAULT_NODE_SIZE} display default.
32
+ */
33
+ export declare function toElkGraph(document: GraphWorkflowDocument, options?: GraphLayoutOptions): ElkGraph;
34
+ /**
35
+ * Pure projection of an ELK layout result back onto document ids. Node keys follow
36
+ * the document's node order; edge keys follow the document's edge order. The input
37
+ * document is only read, never mutated.
38
+ */
39
+ export declare function fromElkLayout(laidOut: ElkGraph, document: GraphWorkflowDocument): GraphWorkflowLayoutResult;
40
+ /**
41
+ * Computes a deterministic, left-to-right layout for a workflow document.
42
+ *
43
+ * The function is pure with respect to the document (it is never mutated) and
44
+ * deterministic (same document + options yields byte-identical output). It returns a
45
+ * Promise because ELK's `layout()` is asynchronous; `toElkGraph` and
46
+ * `fromElkLayout` are synchronous and side-effect free.
47
+ */
48
+ export declare function computeGraphWorkflowLayout(document: GraphWorkflowDocument, options?: GraphLayoutOptions): Promise<GraphWorkflowLayoutResult>;
49
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Barrel for the pure, deterministic left-to-right graph auto-layout surface.
3
+ */
4
+ export * from "./layout-options.d.cts";
5
+ export * from "./GraphWorkflowLayout.d.cts";
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Barrel for the pure, deterministic left-to-right graph auto-layout surface.
3
+ */
4
+ export * from "./layout-options.d.mts";
5
+ export * from "./GraphWorkflowLayout.d.mts";
@@ -0,0 +1,46 @@
1
+ import type { LayoutOptions } from "elkjs/lib/elk-api";
2
+ /**
3
+ * User-selectable auto-layout algorithm presets. Every preset is left-to-right;
4
+ * direction is not (and must never become) an option.
5
+ */
6
+ export declare enum GraphLayoutMode {
7
+ /** Crossing-minimisation priority: LAYER_SWEEP + BRANDES_KOEPF + ORTHOGONAL. */
8
+ READABILITY = "readability",
9
+ /** Tight packing: NETWORK_SIMPLEX + POLYLINE routing. */
10
+ COMPACTNESS = "compactness",
11
+ /** Default: GREEDY crossing minimisation + ORTHOGONAL routing. */
12
+ BALANCED = "balanced"
13
+ }
14
+ /**
15
+ * Spacing profiles composable with any {@link GraphLayoutMode}. Each profile is a
16
+ * scalar multiplier over the ELK `elk.spacing.*` keys.
17
+ */
18
+ export declare enum GraphLayoutSpacing {
19
+ /** Reduced spacing (0.5x). */
20
+ TIGHT = "tight",
21
+ /** Baseline spacing (1x). */
22
+ NORMAL = "normal",
23
+ /** Generous spacing (1.5x). */
24
+ COMFORTABLE = "comfortable"
25
+ }
26
+ /**
27
+ * Options accepted by `computeGraphWorkflowLayout`. The interface deliberately has
28
+ * no direction field: the adapter hard-codes `elk.direction: "RIGHT"` so no caller
29
+ * can ever request a non-left-to-right layout.
30
+ */
31
+ export interface GraphLayoutOptions {
32
+ /** Algorithm preset. Defaults to {@link GraphLayoutMode.BALANCED}. */
33
+ mode?: GraphLayoutMode;
34
+ /** Spacing profile. Defaults to the selected mode's own spacing. */
35
+ spacing?: GraphLayoutSpacing;
36
+ }
37
+ /** Resolves the requested mode, defaulting to {@link GraphLayoutMode.BALANCED}. */
38
+ export declare function resolveLayoutMode(options?: GraphLayoutOptions): GraphLayoutMode;
39
+ /** Resolves the requested spacing, defaulting to the mode's own profile. */
40
+ export declare function resolveLayoutSpacing(options?: GraphLayoutOptions): GraphLayoutSpacing;
41
+ /**
42
+ * Builds the ELK `layoutOptions` map for the requested mode and spacing. The
43
+ * `elk.direction` key is hard-coded to `"RIGHT"` here — this is the only place
44
+ * direction is set and it is not reachable from {@link GraphLayoutOptions}.
45
+ */
46
+ export declare function buildLayoutOptions(options?: GraphLayoutOptions): LayoutOptions;
@@ -0,0 +1,46 @@
1
+ import type { LayoutOptions } from "elkjs/lib/elk-api";
2
+ /**
3
+ * User-selectable auto-layout algorithm presets. Every preset is left-to-right;
4
+ * direction is not (and must never become) an option.
5
+ */
6
+ export declare enum GraphLayoutMode {
7
+ /** Crossing-minimisation priority: LAYER_SWEEP + BRANDES_KOEPF + ORTHOGONAL. */
8
+ READABILITY = "readability",
9
+ /** Tight packing: NETWORK_SIMPLEX + POLYLINE routing. */
10
+ COMPACTNESS = "compactness",
11
+ /** Default: GREEDY crossing minimisation + ORTHOGONAL routing. */
12
+ BALANCED = "balanced"
13
+ }
14
+ /**
15
+ * Spacing profiles composable with any {@link GraphLayoutMode}. Each profile is a
16
+ * scalar multiplier over the ELK `elk.spacing.*` keys.
17
+ */
18
+ export declare enum GraphLayoutSpacing {
19
+ /** Reduced spacing (0.5x). */
20
+ TIGHT = "tight",
21
+ /** Baseline spacing (1x). */
22
+ NORMAL = "normal",
23
+ /** Generous spacing (1.5x). */
24
+ COMFORTABLE = "comfortable"
25
+ }
26
+ /**
27
+ * Options accepted by `computeGraphWorkflowLayout`. The interface deliberately has
28
+ * no direction field: the adapter hard-codes `elk.direction: "RIGHT"` so no caller
29
+ * can ever request a non-left-to-right layout.
30
+ */
31
+ export interface GraphLayoutOptions {
32
+ /** Algorithm preset. Defaults to {@link GraphLayoutMode.BALANCED}. */
33
+ mode?: GraphLayoutMode;
34
+ /** Spacing profile. Defaults to the selected mode's own spacing. */
35
+ spacing?: GraphLayoutSpacing;
36
+ }
37
+ /** Resolves the requested mode, defaulting to {@link GraphLayoutMode.BALANCED}. */
38
+ export declare function resolveLayoutMode(options?: GraphLayoutOptions): GraphLayoutMode;
39
+ /** Resolves the requested spacing, defaulting to the mode's own profile. */
40
+ export declare function resolveLayoutSpacing(options?: GraphLayoutOptions): GraphLayoutSpacing;
41
+ /**
42
+ * Builds the ELK `layoutOptions` map for the requested mode and spacing. The
43
+ * `elk.direction` key is hard-coded to `"RIGHT"` here — this is the only place
44
+ * direction is set and it is not reachable from {@link GraphLayoutOptions}.
45
+ */
46
+ export declare function buildLayoutOptions(options?: GraphLayoutOptions): LayoutOptions;
@@ -146,9 +146,10 @@ export interface GraphExecutionErrorPayload {
146
146
  * A single event emitted during graph execution.
147
147
  *
148
148
  * Frontend-safe: the frontend consumes these events over the SSE endpoint
149
- * (`GET /graph/events`) and maps them to UI state updates via
150
- * `GraphExecutionStateMapper`. The `timestamp` is serialised as an ISO string
151
- * over the wire; the frontend deserialises it back to a `Date` when mapping.
149
+ * (`GET /graph/events`) and maps them to UI state updates via the canonical
150
+ * `@decaf-ts/ui-decorators/graph` state mapper. The `timestamp` is serialised
151
+ * as an ISO string over the wire; the frontend deserialises it back to a `Date`
152
+ * when mapping.
152
153
  */
153
154
  export interface GraphExecutionEvent {
154
155
  id: string;
@@ -146,9 +146,10 @@ export interface GraphExecutionErrorPayload {
146
146
  * A single event emitted during graph execution.
147
147
  *
148
148
  * Frontend-safe: the frontend consumes these events over the SSE endpoint
149
- * (`GET /graph/events`) and maps them to UI state updates via
150
- * `GraphExecutionStateMapper`. The `timestamp` is serialised as an ISO string
151
- * over the wire; the frontend deserialises it back to a `Date` when mapping.
149
+ * (`GET /graph/events`) and maps them to UI state updates via the canonical
150
+ * `@decaf-ts/ui-decorators/graph` state mapper. The `timestamp` is serialised
151
+ * as an ISO string over the wire; the frontend deserialises it back to a `Date`
152
+ * when mapping.
152
153
  */
153
154
  export interface GraphExecutionEvent {
154
155
  id: string;
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * @module as-graph/shared/ui
3
- * @summary Framework-neutral graph UI view models.
4
- * @description The shared, DOM-free projection a graph UI renders: node/port
5
- * view models built from the canonical manifests, workflow canvas views built
6
- * from the canonical documents, and run feedback views built from engine run
7
- * results via the shared execution-state mapper. Consumed by graph UI
8
- * renderers (e.g. `for-angular`).
3
+ * @summary UI metadata keys shared with the rendering layer.
4
+ * @description The graph reader inspects the UI decoration metadata that the
5
+ * `@uielement`/`@uiprop` decorators attach to a model's properties. Only the
6
+ * `UIKeys.PROP` key is consumed by the shared graph reader; the rest of the key
7
+ * object is reproduced so the shared package stays self-contained. The former
8
+ * framework-neutral view-model projections and the duplicate execution-state mapper
9
+ * were retired (no consumers; the canonical mapper lives in
10
+ * `@decaf-ts/ui-decorators/graph`).
9
11
  */
10
12
  export * from "./constants.d.cts";
11
- export * from "./types.d.cts";
12
- export * from "./GraphNodeView.d.cts";
13
- export * from "./GraphRunView.d.cts";
14
- export * from "./GraphWorkflowView.d.cts";
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * @module as-graph/shared/ui
3
- * @summary Framework-neutral graph UI view models.
4
- * @description The shared, DOM-free projection a graph UI renders: node/port
5
- * view models built from the canonical manifests, workflow canvas views built
6
- * from the canonical documents, and run feedback views built from engine run
7
- * results via the shared execution-state mapper. Consumed by graph UI
8
- * renderers (e.g. `for-angular`).
3
+ * @summary UI metadata keys shared with the rendering layer.
4
+ * @description The graph reader inspects the UI decoration metadata that the
5
+ * `@uielement`/`@uiprop` decorators attach to a model's properties. Only the
6
+ * `UIKeys.PROP` key is consumed by the shared graph reader; the rest of the key
7
+ * object is reproduced so the shared package stays self-contained. The former
8
+ * framework-neutral view-model projections and the duplicate execution-state mapper
9
+ * were retired (no consumers; the canonical mapper lives in
10
+ * `@decaf-ts/ui-decorators/graph`).
9
11
  */
10
12
  export * from "./constants.d.mts";
11
- export * from "./types.d.mts";
12
- export * from "./GraphNodeView.d.mts";
13
- export * from "./GraphRunView.d.mts";
14
- export * from "./GraphWorkflowView.d.mts";