@decaf-ts/as-graph 0.2.0 → 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.
- package/README.md +160 -2
- package/dist/as-graph.cjs +1 -1
- package/dist/as-graph.cjs.map +1 -1
- package/dist/as-graph.js +1 -1
- package/dist/as-graph.js.map +1 -1
- package/lib/cjs/dagster/DagsterGraphEventBridge.cjs +344 -0
- package/lib/cjs/dagster/DagsterGraphEventBridge.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs +789 -0
- package/lib/cjs/dagster/DagsterGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterResultMapper.cjs +56 -0
- package/lib/cjs/dagster/DagsterResultMapper.cjs.map +1 -0
- package/lib/cjs/dagster/DagsterTypes.cjs +4 -0
- package/lib/cjs/dagster/DagsterTypes.cjs.map +1 -0
- package/lib/cjs/dagster/capabilities.cjs +102 -0
- package/lib/cjs/dagster/capabilities.cjs.map +1 -0
- package/lib/cjs/dagster/constants.cjs +92 -0
- package/lib/cjs/dagster/constants.cjs.map +1 -0
- package/lib/cjs/dagster/index.cjs +32 -0
- package/lib/cjs/dagster/index.cjs.map +1 -0
- package/lib/cjs/engine/constants.cjs +6 -1
- package/lib/cjs/engine/constants.cjs.map +1 -1
- package/lib/cjs/engine/execution/GraphCodeMode.cjs +137 -0
- package/lib/cjs/engine/execution/GraphCodeMode.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionBackend.cjs +89 -0
- package/lib/cjs/engine/execution/GraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs +107 -0
- package/lib/cjs/engine/execution/GraphExecutionBackendRegistry.cjs.map +1 -0
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs +250 -733
- package/lib/cjs/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs +804 -0
- package/lib/cjs/engine/execution/LocalGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/engine/execution/index.cjs +4 -0
- package/lib/cjs/engine/execution/index.cjs.map +1 -1
- package/lib/cjs/engine/index.cjs +5 -0
- package/lib/cjs/engine/index.cjs.map +1 -1
- package/lib/cjs/engine/loops/ConditionEvaluator.cjs +116 -0
- package/lib/cjs/engine/loops/ConditionEvaluator.cjs.map +1 -0
- package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs +25 -2
- package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs.map +1 -1
- package/lib/cjs/engine/loops/index.cjs +1 -0
- package/lib/cjs/engine/loops/index.cjs.map +1 -1
- package/lib/cjs/engine/runs/GraphRunService.cjs +121 -3
- package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
- package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs +33 -0
- package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs.map +1 -1
- package/lib/cjs/engine/runs/ownership.cjs +100 -11
- package/lib/cjs/engine/runs/ownership.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphRunModelService.cjs +16 -0
- package/lib/cjs/engine/services/GraphRunModelService.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphWorkflowService.cjs +153 -16
- package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
- package/lib/cjs/mastra/MastraCapabilities.cjs +171 -0
- package/lib/cjs/mastra/MastraCapabilities.cjs.map +1 -0
- package/lib/cjs/mastra/MastraConditionBridge.cjs +39 -0
- package/lib/cjs/mastra/MastraConditionBridge.cjs.map +1 -0
- package/lib/cjs/mastra/MastraEventBridge.cjs +486 -0
- package/lib/cjs/mastra/MastraEventBridge.cjs.map +1 -0
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs +351 -0
- package/lib/cjs/mastra/MastraGraphExecutionBackend.cjs.map +1 -0
- package/lib/cjs/mastra/MastraResumeGuard.cjs +127 -0
- package/lib/cjs/mastra/MastraResumeGuard.cjs.map +1 -0
- package/lib/cjs/mastra/MastraSchemaConverter.cjs +124 -0
- package/lib/cjs/mastra/MastraSchemaConverter.cjs.map +1 -0
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs +461 -0
- package/lib/cjs/mastra/MastraWorkflowCompiler.cjs.map +1 -0
- package/lib/cjs/mastra/MastraWorkflowManager.cjs +401 -0
- package/lib/cjs/mastra/MastraWorkflowManager.cjs.map +1 -0
- package/lib/cjs/mastra/index.cjs +35 -0
- package/lib/cjs/mastra/index.cjs.map +1 -0
- package/lib/cjs/mastra/types.cjs +34 -0
- package/lib/cjs/mastra/types.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs +136 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityManifest.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs +140 -0
- package/lib/cjs/nest/graph/GraphEngineCapabilityService.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphEngineController.cjs +227 -0
- package/lib/cjs/nest/graph/GraphEngineController.cjs.map +1 -0
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs +30 -2
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphRunController.cjs +208 -28
- package/lib/cjs/nest/graph/GraphRunController.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs +97 -14
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs.map +1 -1
- package/lib/cjs/nest/graph/index.cjs +3 -0
- package/lib/cjs/nest/graph/index.cjs.map +1 -1
- package/lib/cjs/nest/graph/main.cjs +54 -0
- package/lib/cjs/nest/graph/main.cjs.map +1 -0
- package/lib/cjs/nest/graph/servingDates.cjs +53 -0
- package/lib/cjs/nest/graph/servingDates.cjs.map +1 -0
- package/lib/cjs/nest/graph/servingErrors.cjs +68 -0
- package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -0
- package/lib/cjs/node/flow/if/node.cjs +27 -9
- package/lib/cjs/node/flow/if/node.cjs.map +1 -1
- package/lib/cjs/node/flow/loop/until/node.cjs +5 -2
- package/lib/cjs/node/flow/loop/until/node.cjs.map +1 -1
- package/lib/cjs/node/flow/loop/while/node.cjs +8 -2
- package/lib/cjs/node/flow/loop/while/node.cjs.map +1 -1
- package/lib/cjs/node/flow/switch/node.cjs +2 -37
- package/lib/cjs/node/flow/switch/node.cjs.map +1 -1
- package/lib/cjs/node/utility/code/node.cjs +11 -3
- package/lib/cjs/node/utility/code/node.cjs.map +1 -1
- package/lib/cjs/ram/GraphRunStore.cjs +14 -0
- package/lib/cjs/ram/GraphRunStore.cjs.map +1 -1
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs +2 -3
- package/lib/cjs/shared/graph/catalog/GraphManifestCompiler.cjs.map +1 -1
- package/lib/cjs/shared/graph/constants.cjs +8 -0
- package/lib/cjs/shared/graph/constants.cjs.map +1 -1
- package/lib/cjs/shared/graph/index.cjs +2 -1
- package/lib/cjs/shared/graph/index.cjs.map +1 -1
- package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs +146 -0
- package/lib/cjs/shared/graph/layout/GraphWorkflowLayout.cjs.map +1 -0
- package/lib/cjs/shared/graph/layout/index.cjs +23 -0
- package/lib/cjs/shared/graph/layout/index.cjs.map +1 -0
- package/lib/cjs/shared/graph/layout/layout-options.cjs +93 -0
- package/lib/cjs/shared/graph/layout/layout-options.cjs.map +1 -0
- package/lib/cjs/shared/ui/index.cjs +8 -10
- package/lib/cjs/shared/ui/index.cjs.map +1 -1
- package/lib/esm/dagster/DagsterGraphEventBridge.js +339 -0
- package/lib/esm/dagster/DagsterGraphEventBridge.js.map +1 -0
- package/lib/esm/dagster/DagsterGraphExecutionBackend.js +781 -0
- package/lib/esm/dagster/DagsterGraphExecutionBackend.js.map +1 -0
- package/lib/esm/dagster/DagsterResultMapper.js +51 -0
- package/lib/esm/dagster/DagsterResultMapper.js.map +1 -0
- package/lib/esm/dagster/DagsterTypes.js +2 -0
- package/lib/esm/dagster/DagsterTypes.js.map +1 -0
- package/lib/esm/dagster/capabilities.js +97 -0
- package/lib/esm/dagster/capabilities.js.map +1 -0
- package/lib/esm/dagster/constants.js +88 -0
- package/lib/esm/dagster/constants.js.map +1 -0
- package/lib/esm/dagster/index.js +15 -0
- package/lib/esm/dagster/index.js.map +1 -0
- package/lib/esm/engine/constants.js +5 -0
- package/lib/esm/engine/constants.js.map +1 -1
- package/lib/esm/engine/execution/GraphCodeMode.js +132 -0
- package/lib/esm/engine/execution/GraphCodeMode.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionBackend.js +83 -0
- package/lib/esm/engine/execution/GraphExecutionBackend.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js +102 -0
- package/lib/esm/engine/execution/GraphExecutionBackendRegistry.js.map +1 -0
- package/lib/esm/engine/execution/GraphExecutionEngine.js +232 -716
- package/lib/esm/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js +799 -0
- package/lib/esm/engine/execution/LocalGraphExecutionBackend.js.map +1 -0
- package/lib/esm/engine/execution/index.js +4 -0
- package/lib/esm/engine/execution/index.js.map +1 -1
- package/lib/esm/engine/index.js +5 -0
- package/lib/esm/engine/index.js.map +1 -1
- package/lib/esm/engine/loops/ConditionEvaluator.js +108 -0
- package/lib/esm/engine/loops/ConditionEvaluator.js.map +1 -0
- package/lib/esm/engine/loops/GraphConditionEvaluator.js +25 -2
- package/lib/esm/engine/loops/GraphConditionEvaluator.js.map +1 -1
- package/lib/esm/engine/loops/index.js +1 -0
- package/lib/esm/engine/loops/index.js.map +1 -1
- package/lib/esm/engine/runs/GraphRunService.js +123 -5
- package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
- package/lib/esm/engine/runs/InMemoryGraphRunStore.js +33 -0
- package/lib/esm/engine/runs/InMemoryGraphRunStore.js.map +1 -1
- package/lib/esm/engine/runs/ownership.js +97 -11
- package/lib/esm/engine/runs/ownership.js.map +1 -1
- package/lib/esm/engine/services/GraphRunModelService.js +16 -0
- package/lib/esm/engine/services/GraphRunModelService.js.map +1 -1
- package/lib/esm/engine/services/GraphWorkflowService.js +155 -18
- package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
- package/lib/esm/mastra/MastraCapabilities.js +164 -0
- package/lib/esm/mastra/MastraCapabilities.js.map +1 -0
- package/lib/esm/mastra/MastraConditionBridge.js +34 -0
- package/lib/esm/mastra/MastraConditionBridge.js.map +1 -0
- package/lib/esm/mastra/MastraEventBridge.js +481 -0
- package/lib/esm/mastra/MastraEventBridge.js.map +1 -0
- package/lib/esm/mastra/MastraGraphExecutionBackend.js +346 -0
- package/lib/esm/mastra/MastraGraphExecutionBackend.js.map +1 -0
- package/lib/esm/mastra/MastraResumeGuard.js +123 -0
- package/lib/esm/mastra/MastraResumeGuard.js.map +1 -0
- package/lib/esm/mastra/MastraSchemaConverter.js +119 -0
- package/lib/esm/mastra/MastraSchemaConverter.js.map +1 -0
- package/lib/esm/mastra/MastraWorkflowCompiler.js +456 -0
- package/lib/esm/mastra/MastraWorkflowCompiler.js.map +1 -0
- package/lib/esm/mastra/MastraWorkflowManager.js +396 -0
- package/lib/esm/mastra/MastraWorkflowManager.js.map +1 -0
- package/lib/esm/mastra/index.js +18 -0
- package/lib/esm/mastra/index.js.map +1 -0
- package/lib/esm/mastra/types.js +30 -0
- package/lib/esm/mastra/types.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js +129 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityManifest.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityService.js +131 -0
- package/lib/esm/nest/graph/GraphEngineCapabilityService.js.map +1 -0
- package/lib/esm/nest/graph/GraphEngineController.js +218 -0
- package/lib/esm/nest/graph/GraphEngineController.js.map +1 -0
- package/lib/esm/nest/graph/GraphExecutionModule.js +30 -2
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/GraphRunController.js +209 -29
- package/lib/esm/nest/graph/GraphRunController.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowController.js +98 -15
- package/lib/esm/nest/graph/GraphWorkflowController.js.map +1 -1
- package/lib/esm/nest/graph/index.js +3 -0
- package/lib/esm/nest/graph/index.js.map +1 -1
- package/lib/esm/nest/graph/main.js +51 -0
- package/lib/esm/nest/graph/main.js.map +1 -0
- package/lib/esm/nest/graph/servingDates.js +49 -0
- package/lib/esm/nest/graph/servingDates.js.map +1 -0
- package/lib/esm/nest/graph/servingErrors.js +63 -0
- package/lib/esm/nest/graph/servingErrors.js.map +1 -0
- package/lib/esm/node/flow/if/node.js +27 -9
- package/lib/esm/node/flow/if/node.js.map +1 -1
- package/lib/esm/node/flow/loop/until/node.js +5 -2
- package/lib/esm/node/flow/loop/until/node.js.map +1 -1
- package/lib/esm/node/flow/loop/while/node.js +8 -2
- package/lib/esm/node/flow/loop/while/node.js.map +1 -1
- package/lib/esm/node/flow/switch/node.js +2 -37
- package/lib/esm/node/flow/switch/node.js.map +1 -1
- package/lib/esm/node/utility/code/node.js +11 -3
- package/lib/esm/node/utility/code/node.js.map +1 -1
- package/lib/esm/ram/GraphRunStore.js +14 -0
- package/lib/esm/ram/GraphRunStore.js.map +1 -1
- package/lib/esm/shared/graph/GraphExecutionStateMapper.js.map +1 -1
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js +2 -3
- package/lib/esm/shared/graph/catalog/GraphManifestCompiler.js.map +1 -1
- package/lib/esm/shared/graph/constants.js +8 -0
- package/lib/esm/shared/graph/constants.js.map +1 -1
- package/lib/esm/shared/graph/document/GraphFlowBuilder.js.map +1 -1
- package/lib/esm/shared/graph/index.js +2 -1
- package/lib/esm/shared/graph/index.js.map +1 -1
- package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js +107 -0
- package/lib/esm/shared/graph/layout/GraphWorkflowLayout.js.map +1 -0
- package/lib/esm/shared/graph/layout/index.js +6 -0
- package/lib/esm/shared/graph/layout/index.js.map +1 -0
- package/lib/esm/shared/graph/layout/layout-options.js +96 -0
- package/lib/esm/shared/graph/layout/layout-options.js.map +1 -0
- package/lib/esm/shared/ui/index.js +8 -10
- package/lib/esm/shared/ui/index.js.map +1 -1
- package/lib/types/dagster/DagsterGraphEventBridge.d.cts +142 -0
- package/lib/types/dagster/DagsterGraphEventBridge.d.mts +142 -0
- package/lib/types/dagster/DagsterGraphExecutionBackend.d.cts +323 -0
- package/lib/types/dagster/DagsterGraphExecutionBackend.d.mts +323 -0
- package/lib/types/dagster/DagsterResultMapper.d.cts +50 -0
- package/lib/types/dagster/DagsterResultMapper.d.mts +50 -0
- package/lib/types/dagster/DagsterTypes.d.cts +355 -0
- package/lib/types/dagster/DagsterTypes.d.mts +355 -0
- package/lib/types/dagster/capabilities.d.cts +34 -0
- package/lib/types/dagster/capabilities.d.mts +34 -0
- package/lib/types/dagster/constants.d.cts +87 -0
- package/lib/types/dagster/constants.d.mts +87 -0
- package/lib/types/dagster/index.d.cts +14 -0
- package/lib/types/dagster/index.d.mts +14 -0
- package/lib/types/engine/constants.d.cts +5 -0
- package/lib/types/engine/constants.d.mts +5 -0
- package/lib/types/engine/execution/GraphCodeMode.d.cts +52 -0
- package/lib/types/engine/execution/GraphCodeMode.d.mts +52 -0
- package/lib/types/engine/execution/GraphExecutionBackend.d.cts +306 -0
- package/lib/types/engine/execution/GraphExecutionBackend.d.mts +306 -0
- package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.cts +59 -0
- package/lib/types/engine/execution/GraphExecutionBackendRegistry.d.mts +59 -0
- package/lib/types/engine/execution/GraphExecutionEngine.d.cts +116 -135
- package/lib/types/engine/execution/GraphExecutionEngine.d.mts +116 -135
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.cts +232 -0
- package/lib/types/engine/execution/LocalGraphExecutionBackend.d.mts +232 -0
- package/lib/types/engine/execution/index.d.cts +4 -0
- package/lib/types/engine/execution/index.d.mts +4 -0
- package/lib/types/engine/index.d.cts +5 -0
- package/lib/types/engine/index.d.mts +5 -0
- package/lib/types/engine/loops/ConditionEvaluator.d.cts +87 -0
- package/lib/types/engine/loops/ConditionEvaluator.d.mts +87 -0
- package/lib/types/engine/loops/GraphConditionEvaluator.d.cts +27 -7
- package/lib/types/engine/loops/GraphConditionEvaluator.d.mts +27 -7
- package/lib/types/engine/loops/index.d.cts +1 -0
- package/lib/types/engine/loops/index.d.mts +1 -0
- package/lib/types/engine/runs/GraphRunService.d.cts +60 -1
- package/lib/types/engine/runs/GraphRunService.d.mts +60 -1
- package/lib/types/engine/runs/InMemoryGraphRunStore.d.cts +29 -0
- package/lib/types/engine/runs/InMemoryGraphRunStore.d.mts +29 -0
- package/lib/types/engine/runs/ownership.d.cts +89 -4
- package/lib/types/engine/runs/ownership.d.mts +89 -4
- package/lib/types/engine/runs/types.d.cts +12 -1
- package/lib/types/engine/runs/types.d.mts +12 -1
- package/lib/types/engine/services/GraphRunModelService.d.cts +13 -0
- package/lib/types/engine/services/GraphRunModelService.d.mts +13 -0
- package/lib/types/engine/services/GraphWorkflowService.d.cts +74 -2
- package/lib/types/engine/services/GraphWorkflowService.d.mts +74 -2
- package/lib/types/engine/types.d.cts +11 -4
- package/lib/types/engine/types.d.mts +11 -4
- package/lib/types/mastra/MastraCapabilities.d.cts +91 -0
- package/lib/types/mastra/MastraCapabilities.d.mts +91 -0
- package/lib/types/mastra/MastraConditionBridge.d.cts +38 -0
- package/lib/types/mastra/MastraConditionBridge.d.mts +38 -0
- package/lib/types/mastra/MastraEventBridge.d.cts +189 -0
- package/lib/types/mastra/MastraEventBridge.d.mts +189 -0
- package/lib/types/mastra/MastraGraphExecutionBackend.d.cts +119 -0
- package/lib/types/mastra/MastraGraphExecutionBackend.d.mts +119 -0
- package/lib/types/mastra/MastraResumeGuard.d.cts +58 -0
- package/lib/types/mastra/MastraResumeGuard.d.mts +58 -0
- package/lib/types/mastra/MastraSchemaConverter.d.cts +39 -0
- package/lib/types/mastra/MastraSchemaConverter.d.mts +39 -0
- package/lib/types/mastra/MastraWorkflowCompiler.d.cts +218 -0
- package/lib/types/mastra/MastraWorkflowCompiler.d.mts +218 -0
- package/lib/types/mastra/MastraWorkflowManager.d.cts +220 -0
- package/lib/types/mastra/MastraWorkflowManager.d.mts +220 -0
- package/lib/types/mastra/index.d.cts +17 -0
- package/lib/types/mastra/index.d.mts +17 -0
- package/lib/types/mastra/types.d.cts +222 -0
- package/lib/types/mastra/types.d.mts +222 -0
- package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.cts +87 -0
- package/lib/types/nest/graph/GraphEngineCapabilityManifest.d.mts +87 -0
- package/lib/types/nest/graph/GraphEngineCapabilityService.d.cts +98 -0
- package/lib/types/nest/graph/GraphEngineCapabilityService.d.mts +98 -0
- package/lib/types/nest/graph/GraphEngineController.d.cts +74 -0
- package/lib/types/nest/graph/GraphEngineController.d.mts +74 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +14 -1
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +14 -1
- package/lib/types/nest/graph/GraphRunController.d.cts +69 -14
- package/lib/types/nest/graph/GraphRunController.d.mts +69 -14
- package/lib/types/nest/graph/GraphWorkflowController.d.cts +50 -17
- package/lib/types/nest/graph/GraphWorkflowController.d.mts +50 -17
- package/lib/types/nest/graph/index.d.cts +3 -0
- package/lib/types/nest/graph/index.d.mts +3 -0
- package/lib/types/nest/graph/main.d.cts +1 -0
- package/lib/types/nest/graph/main.d.mts +1 -0
- package/lib/types/nest/graph/servingDates.d.cts +35 -0
- package/lib/types/nest/graph/servingDates.d.mts +35 -0
- package/lib/types/nest/graph/servingErrors.d.cts +44 -0
- package/lib/types/nest/graph/servingErrors.d.mts +44 -0
- package/lib/types/node/flow/if/node.d.cts +20 -8
- package/lib/types/node/flow/if/node.d.mts +20 -8
- package/lib/types/node/flow/loop/until/node.d.cts +4 -1
- package/lib/types/node/flow/loop/until/node.d.mts +4 -1
- package/lib/types/node/flow/loop/while/node.d.cts +4 -1
- package/lib/types/node/flow/loop/while/node.d.mts +4 -1
- package/lib/types/node/utility/code/node.d.cts +1 -1
- package/lib/types/node/utility/code/node.d.mts +1 -1
- package/lib/types/ram/GraphRunStore.d.cts +12 -0
- package/lib/types/ram/GraphRunStore.d.mts +12 -0
- package/lib/types/shared/graph/GraphExecutionStateMapper.d.cts +5 -5
- package/lib/types/shared/graph/GraphExecutionStateMapper.d.mts +5 -5
- package/lib/types/shared/graph/constants.d.cts +8 -0
- package/lib/types/shared/graph/constants.d.mts +8 -0
- package/lib/types/shared/graph/document/GraphFlowBuilder.d.cts +5 -5
- package/lib/types/shared/graph/document/GraphFlowBuilder.d.mts +5 -5
- package/lib/types/shared/graph/index.d.cts +2 -1
- package/lib/types/shared/graph/index.d.mts +2 -1
- package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.cts +49 -0
- package/lib/types/shared/graph/layout/GraphWorkflowLayout.d.mts +49 -0
- package/lib/types/shared/graph/layout/index.d.cts +5 -0
- package/lib/types/shared/graph/layout/index.d.mts +5 -0
- package/lib/types/shared/graph/layout/layout-options.d.cts +46 -0
- package/lib/types/shared/graph/layout/layout-options.d.mts +46 -0
- package/lib/types/shared/graph/types.d.cts +12 -4
- package/lib/types/shared/graph/types.d.mts +12 -4
- package/lib/types/shared/ui/index.d.cts +8 -10
- package/lib/types/shared/ui/index.d.mts +8 -10
- package/package.json +49 -6
- package/lib/cjs/shared/ui/GraphNodeView.cjs +0 -114
- package/lib/cjs/shared/ui/GraphNodeView.cjs.map +0 -1
- package/lib/cjs/shared/ui/GraphRunView.cjs +0 -96
- package/lib/cjs/shared/ui/GraphRunView.cjs.map +0 -1
- package/lib/cjs/shared/ui/GraphWorkflowView.cjs +0 -78
- package/lib/cjs/shared/ui/GraphWorkflowView.cjs.map +0 -1
- package/lib/cjs/shared/ui/types.cjs +0 -4
- package/lib/cjs/shared/ui/types.cjs.map +0 -1
- package/lib/esm/shared/ui/GraphNodeView.js +0 -107
- package/lib/esm/shared/ui/GraphNodeView.js.map +0 -1
- package/lib/esm/shared/ui/GraphRunView.js +0 -90
- package/lib/esm/shared/ui/GraphRunView.js.map +0 -1
- package/lib/esm/shared/ui/GraphWorkflowView.js +0 -72
- package/lib/esm/shared/ui/GraphWorkflowView.js.map +0 -1
- package/lib/esm/shared/ui/types.js +0 -2
- package/lib/esm/shared/ui/types.js.map +0 -1
- package/lib/types/shared/ui/GraphNodeView.d.cts +0 -48
- package/lib/types/shared/ui/GraphNodeView.d.mts +0 -48
- package/lib/types/shared/ui/GraphRunView.d.cts +0 -88
- package/lib/types/shared/ui/GraphRunView.d.mts +0 -88
- package/lib/types/shared/ui/GraphWorkflowView.d.cts +0 -18
- package/lib/types/shared/ui/GraphWorkflowView.d.mts +0 -18
- package/lib/types/shared/ui/types.d.cts +0 -200
- package/lib/types/shared/ui/types.d.mts +0 -200
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Condition } from "../../../shared/graph/index.d.mts";
|
|
2
2
|
import { GraphNode } from "../../base.d.mts";
|
|
3
3
|
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../../engine/types.d.mts";
|
|
4
|
+
import type { GraphExecutionContext } from "../../../engine/execution/GraphExecutionContext.d.mts";
|
|
4
5
|
/** Inputs accepted by the if node. */
|
|
5
6
|
export type IfFlowInput = Record<string, unknown>;
|
|
6
7
|
/** Outputs produced by the if node. */
|
|
@@ -14,21 +15,32 @@ export interface IfFlowOutput {
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class IfFlowNode extends GraphNode<IfFlowInput, IfFlowOutput> {
|
|
16
17
|
/**
|
|
17
|
-
* Evaluates the configured `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Evaluates the configured `Condition` against the resolved condition state
|
|
19
|
+
* and routes the input value to `then` or `else`; throws when the condition
|
|
20
|
+
* is false and the `else` branch is disabled. A `CodeCondition` is dispatched
|
|
21
|
+
* through the registered `CodeSandboxEvaluator`, mirroring the switch node.
|
|
22
|
+
*
|
|
23
|
+
* Graphical conditions evaluate synchronously so the existing synchronous
|
|
24
|
+
* `GRAPH_IF_NO_CONDITION` / `GRAPH_IF_ELSE_DISABLED` throw contract is
|
|
25
|
+
* preserved; only code conditions return a promise.
|
|
20
26
|
*
|
|
21
27
|
* @param {GraphNodeExecutionRequest<IfFlowInput>} request - Execution request carrying the `value` input.
|
|
22
|
-
* @
|
|
28
|
+
* @param {GraphExecutionContext} context - Execution context providing run metadata and the sandbox evaluator for code conditions.
|
|
29
|
+
* @return {GraphExecutionValues | Promise<GraphExecutionValues>} The routed input value under `then` or `else`.
|
|
23
30
|
* @throws {GraphExecutionError} When no condition is configured (`GRAPH_IF_NO_CONDITION`) or when the condition is false with `else` disabled (`GRAPH_IF_ELSE_DISABLED`).
|
|
24
31
|
*/
|
|
25
|
-
execute(request: GraphNodeExecutionRequest<IfFlowInput
|
|
32
|
+
execute(request: GraphNodeExecutionRequest<IfFlowInput>, context: GraphExecutionContext): GraphExecutionValues | Promise<GraphExecutionValues>;
|
|
33
|
+
/**
|
|
34
|
+
* Routes the input value to `then`/`else`, throwing when the condition is
|
|
35
|
+
* false and the `else` branch is disabled.
|
|
36
|
+
*/
|
|
37
|
+
private route;
|
|
26
38
|
/** Primary input value routed to the `then` or `else` output. */
|
|
27
39
|
value: unknown;
|
|
28
40
|
/** Output carrying the input value when the condition evaluates truthy. */
|
|
29
41
|
then: unknown;
|
|
30
|
-
/** Condition
|
|
31
|
-
condition?:
|
|
42
|
+
/** Condition (§22.3 graphical or §22.4 code) evaluated against the resolved condition state. */
|
|
43
|
+
condition?: Condition;
|
|
32
44
|
/** Enables the `else` output branch; when false, a failed condition throws. */
|
|
33
45
|
else?: boolean;
|
|
34
46
|
}
|
|
@@ -11,7 +11,10 @@ export declare class GraphUntilLoopNode extends GraphNode<GraphUntilLoopInput, G
|
|
|
11
11
|
* Runs the body workflow at least once and repeats until `condition`
|
|
12
12
|
* evaluates truthy against the carried state, emitting `LOOP_*` events per
|
|
13
13
|
* iteration and executing the body as a child run through
|
|
14
|
-
* `engine.execute(bodyWorkflow, ...)`.
|
|
14
|
+
* `engine.execute(bodyWorkflow, ...)`. A `CodeCondition` is dispatched
|
|
15
|
+
* through the registered `CodeSandboxEvaluator`; a graphical
|
|
16
|
+
* `ConditionExpression` and the built-in comparison types are evaluated
|
|
17
|
+
* directly.
|
|
15
18
|
*
|
|
16
19
|
* @param {GraphNodeExecutionRequest<GraphUntilLoopInput>} request - Execution request carrying the `state` input.
|
|
17
20
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -11,7 +11,10 @@ export declare class GraphUntilLoopNode extends GraphNode<GraphUntilLoopInput, G
|
|
|
11
11
|
* Runs the body workflow at least once and repeats until `condition`
|
|
12
12
|
* evaluates truthy against the carried state, emitting `LOOP_*` events per
|
|
13
13
|
* iteration and executing the body as a child run through
|
|
14
|
-
* `engine.execute(bodyWorkflow, ...)`.
|
|
14
|
+
* `engine.execute(bodyWorkflow, ...)`. A `CodeCondition` is dispatched
|
|
15
|
+
* through the registered `CodeSandboxEvaluator`; a graphical
|
|
16
|
+
* `ConditionExpression` and the built-in comparison types are evaluated
|
|
17
|
+
* directly.
|
|
15
18
|
*
|
|
16
19
|
* @param {GraphNodeExecutionRequest<GraphUntilLoopInput>} request - Execution request carrying the `state` input.
|
|
17
20
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -10,7 +10,10 @@ export declare class GraphWhileLoopNode extends GraphNode<GraphWhileLoopInput, G
|
|
|
10
10
|
/**
|
|
11
11
|
* Repeats the body workflow while `condition` evaluates truthy against the
|
|
12
12
|
* carried state, emitting `LOOP_*` events per iteration and executing the
|
|
13
|
-
* body as a child run through `engine.execute(bodyWorkflow, ...)`.
|
|
13
|
+
* body as a child run through `engine.execute(bodyWorkflow, ...)`. A
|
|
14
|
+
* `CodeCondition` is dispatched through the registered
|
|
15
|
+
* `CodeSandboxEvaluator`; a graphical `ConditionExpression` and the built-in
|
|
16
|
+
* comparison types are evaluated directly.
|
|
14
17
|
*
|
|
15
18
|
* @param {GraphNodeExecutionRequest<GraphWhileLoopInput>} request - Execution request carrying the `state` input.
|
|
16
19
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -10,7 +10,10 @@ export declare class GraphWhileLoopNode extends GraphNode<GraphWhileLoopInput, G
|
|
|
10
10
|
/**
|
|
11
11
|
* Repeats the body workflow while `condition` evaluates truthy against the
|
|
12
12
|
* carried state, emitting `LOOP_*` events per iteration and executing the
|
|
13
|
-
* body as a child run through `engine.execute(bodyWorkflow, ...)`.
|
|
13
|
+
* body as a child run through `engine.execute(bodyWorkflow, ...)`. A
|
|
14
|
+
* `CodeCondition` is dispatched through the registered
|
|
15
|
+
* `CodeSandboxEvaluator`; a graphical `ConditionExpression` and the built-in
|
|
16
|
+
* comparison types are evaluated directly.
|
|
14
17
|
*
|
|
15
18
|
* @param {GraphNodeExecutionRequest<GraphWhileLoopInput>} request - Execution request carrying the `state` input.
|
|
16
19
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -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:
|
|
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:
|
|
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,4 +36,16 @@ export declare class RamGraphRunStore implements GraphRunStore {
|
|
|
36
36
|
* @return {Promise<GraphRun | null>} The run, or `null` when no row exists.
|
|
37
37
|
*/
|
|
38
38
|
readRun(runId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRun | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists every persisted run row for the given workflow document as its
|
|
41
|
+
* persisted {@link GraphRunModel} shape (keeping storage-derived fields such
|
|
42
|
+
* as `updatedAt` and `inputs`).
|
|
43
|
+
*
|
|
44
|
+
* @param {string} workflowId - Workflow document id the runs executed.
|
|
45
|
+
* @param args - Optional decaf `Context` arguments forwarded to the repository.
|
|
46
|
+
* @return {Promise<GraphRunModel[]>} The matching rows — empty only when no
|
|
47
|
+
* runs exist for the workflow. A store failure now propagates to the caller
|
|
48
|
+
* instead of being swallowed into an empty list (SAA-93 R1).
|
|
49
|
+
*/
|
|
50
|
+
listRuns(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRunModel[]>;
|
|
39
51
|
}
|
|
@@ -36,4 +36,16 @@ export declare class RamGraphRunStore implements GraphRunStore {
|
|
|
36
36
|
* @return {Promise<GraphRun | null>} The run, or `null` when no row exists.
|
|
37
37
|
*/
|
|
38
38
|
readRun(runId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRun | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists every persisted run row for the given workflow document as its
|
|
41
|
+
* persisted {@link GraphRunModel} shape (keeping storage-derived fields such
|
|
42
|
+
* as `updatedAt` and `inputs`).
|
|
43
|
+
*
|
|
44
|
+
* @param {string} workflowId - Workflow document id the runs executed.
|
|
45
|
+
* @param args - Optional decaf `Context` arguments forwarded to the repository.
|
|
46
|
+
* @return {Promise<GraphRunModel[]>} The matching rows — empty only when no
|
|
47
|
+
* runs exist for the workflow. A store failure now propagates to the caller
|
|
48
|
+
* instead of being swallowed into an empty list (SAA-93 R1).
|
|
49
|
+
*/
|
|
50
|
+
listRuns(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRunModel[]>;
|
|
39
51
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @module
|
|
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
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
|
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
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Constructor } from "@decaf-ts/decoration";
|
|
10
10
|
import type { Model } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import type {
|
|
11
|
+
import type { Condition, SwitchCaseCondition } from "../types.d.cts";
|
|
12
12
|
import type { GraphJsonValue } from "./GraphJsonValue.d.cts";
|
|
13
13
|
import type { GraphWorkflowDocument, GraphWorkflowPortInstance } from "./GraphWorkflowDocument.d.cts";
|
|
14
14
|
import { type GraphNodeOverrideOptions } from "./GraphWorkflowDocumentBuilder.d.cts";
|
|
@@ -191,12 +191,12 @@ export declare class GraphFlowBuilder {
|
|
|
191
191
|
* Adds a `core.flow.if` node and routes the cursor to its `then` output.
|
|
192
192
|
* Must be closed with {@link endIf} (or opened onto an `else` branch).
|
|
193
193
|
*/
|
|
194
|
-
if(condition:
|
|
194
|
+
if(condition: Condition, options?: FlowIfOptions): this;
|
|
195
195
|
/**
|
|
196
196
|
* Opens an `elseIf` branch on the current `if` frame: adds another
|
|
197
197
|
* `core.flow.if` node connected from the parent's `else` output.
|
|
198
198
|
*/
|
|
199
|
-
elseIf(condition:
|
|
199
|
+
elseIf(condition: Condition, options?: FlowIfOptions): this;
|
|
200
200
|
/**
|
|
201
201
|
* Opens the `else` branch of the current `if` frame and adds its first node.
|
|
202
202
|
*/
|
|
@@ -223,9 +223,9 @@ export declare class GraphFlowBuilder {
|
|
|
223
223
|
*/
|
|
224
224
|
map(body: GraphWorkflowDocument, options?: FlowMapOptions): this;
|
|
225
225
|
/** Adds a `core.loop.while` node with the given condition and body. */
|
|
226
|
-
while(condition:
|
|
226
|
+
while(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
227
227
|
/** Adds a `core.loop.until` node with the given condition and body. */
|
|
228
|
-
until(condition:
|
|
228
|
+
until(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
229
229
|
/**
|
|
230
230
|
* Adds a `core.flow.errorBoundary` node with the try/catch/finally bodies.
|
|
231
231
|
* The cursor becomes the boundary's `result` output (plus `error` when a catch
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Constructor } from "@decaf-ts/decoration";
|
|
10
10
|
import type { Model } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import type {
|
|
11
|
+
import type { Condition, SwitchCaseCondition } from "../types.d.mts";
|
|
12
12
|
import type { GraphJsonValue } from "./GraphJsonValue.d.mts";
|
|
13
13
|
import type { GraphWorkflowDocument, GraphWorkflowPortInstance } from "./GraphWorkflowDocument.d.mts";
|
|
14
14
|
import { type GraphNodeOverrideOptions } from "./GraphWorkflowDocumentBuilder.d.mts";
|
|
@@ -191,12 +191,12 @@ export declare class GraphFlowBuilder {
|
|
|
191
191
|
* Adds a `core.flow.if` node and routes the cursor to its `then` output.
|
|
192
192
|
* Must be closed with {@link endIf} (or opened onto an `else` branch).
|
|
193
193
|
*/
|
|
194
|
-
if(condition:
|
|
194
|
+
if(condition: Condition, options?: FlowIfOptions): this;
|
|
195
195
|
/**
|
|
196
196
|
* Opens an `elseIf` branch on the current `if` frame: adds another
|
|
197
197
|
* `core.flow.if` node connected from the parent's `else` output.
|
|
198
198
|
*/
|
|
199
|
-
elseIf(condition:
|
|
199
|
+
elseIf(condition: Condition, options?: FlowIfOptions): this;
|
|
200
200
|
/**
|
|
201
201
|
* Opens the `else` branch of the current `if` frame and adds its first node.
|
|
202
202
|
*/
|
|
@@ -223,9 +223,9 @@ export declare class GraphFlowBuilder {
|
|
|
223
223
|
*/
|
|
224
224
|
map(body: GraphWorkflowDocument, options?: FlowMapOptions): this;
|
|
225
225
|
/** Adds a `core.loop.while` node with the given condition and body. */
|
|
226
|
-
while(condition:
|
|
226
|
+
while(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
227
227
|
/** Adds a `core.loop.until` node with the given condition and body. */
|
|
228
|
-
until(condition:
|
|
228
|
+
until(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
229
229
|
/**
|
|
230
230
|
* Adds a `core.flow.errorBoundary` node with the try/catch/finally bodies.
|
|
231
231
|
* The cursor becomes the boundary's `result` output (plus `error` when a catch
|
|
@@ -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,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;
|
|
@@ -77,12 +77,19 @@ export interface CodeCondition {
|
|
|
77
77
|
code: string;
|
|
78
78
|
language?: "javascript" | "typescript";
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A condition accepted by every flow-control carrier (if, elseIf, while, until,
|
|
82
|
+
* switch) — either a declarative {@link ConditionExpression} (graphical mode) or a
|
|
83
|
+
* {@link CodeCondition} (code mode). The two modes are dispatched identically by
|
|
84
|
+
* the engine regardless of which carrier holds the condition.
|
|
85
|
+
*/
|
|
86
|
+
export type Condition = ConditionExpression | CodeCondition;
|
|
80
87
|
/**
|
|
81
88
|
* A condition on a Switch case — either a declarative
|
|
82
89
|
* {@link ConditionExpression} (graphical mode) or a {@link CodeCondition}
|
|
83
90
|
* (code mode).
|
|
84
91
|
*/
|
|
85
|
-
export type SwitchCaseCondition =
|
|
92
|
+
export type SwitchCaseCondition = Condition;
|
|
86
93
|
/**
|
|
87
94
|
* A single case in a Switch node.
|
|
88
95
|
*
|
|
@@ -139,9 +146,10 @@ export interface GraphExecutionErrorPayload {
|
|
|
139
146
|
* A single event emitted during graph execution.
|
|
140
147
|
*
|
|
141
148
|
* Frontend-safe: the frontend consumes these events over the SSE endpoint
|
|
142
|
-
* (`GET /graph/events`) and maps them to UI state updates via
|
|
143
|
-
* `
|
|
144
|
-
* over the wire; the frontend deserialises it back to a `Date`
|
|
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.
|
|
145
153
|
*/
|
|
146
154
|
export interface GraphExecutionEvent {
|
|
147
155
|
id: string;
|
|
@@ -77,12 +77,19 @@ export interface CodeCondition {
|
|
|
77
77
|
code: string;
|
|
78
78
|
language?: "javascript" | "typescript";
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A condition accepted by every flow-control carrier (if, elseIf, while, until,
|
|
82
|
+
* switch) — either a declarative {@link ConditionExpression} (graphical mode) or a
|
|
83
|
+
* {@link CodeCondition} (code mode). The two modes are dispatched identically by
|
|
84
|
+
* the engine regardless of which carrier holds the condition.
|
|
85
|
+
*/
|
|
86
|
+
export type Condition = ConditionExpression | CodeCondition;
|
|
80
87
|
/**
|
|
81
88
|
* A condition on a Switch case — either a declarative
|
|
82
89
|
* {@link ConditionExpression} (graphical mode) or a {@link CodeCondition}
|
|
83
90
|
* (code mode).
|
|
84
91
|
*/
|
|
85
|
-
export type SwitchCaseCondition =
|
|
92
|
+
export type SwitchCaseCondition = Condition;
|
|
86
93
|
/**
|
|
87
94
|
* A single case in a Switch node.
|
|
88
95
|
*
|
|
@@ -139,9 +146,10 @@ export interface GraphExecutionErrorPayload {
|
|
|
139
146
|
* A single event emitted during graph execution.
|
|
140
147
|
*
|
|
141
148
|
* Frontend-safe: the frontend consumes these events over the SSE endpoint
|
|
142
|
-
* (`GET /graph/events`) and maps them to UI state updates via
|
|
143
|
-
* `
|
|
144
|
-
* over the wire; the frontend deserialises it back to a `Date`
|
|
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.
|
|
145
153
|
*/
|
|
146
154
|
export interface GraphExecutionEvent {
|
|
147
155
|
id: string;
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module as-graph/shared/ui
|
|
3
|
-
* @summary
|
|
4
|
-
* @description The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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";
|