@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,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.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/as-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Workflow document model, node catalogue and reference execution engine for Decaf graph workflows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -47,11 +47,36 @@
|
|
|
47
47
|
"default": "./lib/cjs/ram/index.cjs"
|
|
48
48
|
},
|
|
49
49
|
"default": "./lib/esm/ram/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./mastra": {
|
|
52
|
+
"import": {
|
|
53
|
+
"types": "./lib/types/mastra/index.d.mts",
|
|
54
|
+
"default": "./lib/esm/mastra/index.js"
|
|
55
|
+
},
|
|
56
|
+
"require": {
|
|
57
|
+
"types": "./lib/types/mastra/index.d.cts",
|
|
58
|
+
"default": "./lib/cjs/mastra/index.cjs"
|
|
59
|
+
},
|
|
60
|
+
"default": "./lib/esm/mastra/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./dagster": {
|
|
63
|
+
"import": {
|
|
64
|
+
"types": "./lib/types/dagster/index.d.mts",
|
|
65
|
+
"default": "./lib/esm/dagster/index.js"
|
|
66
|
+
},
|
|
67
|
+
"require": {
|
|
68
|
+
"types": "./lib/types/dagster/index.d.cts",
|
|
69
|
+
"default": "./lib/cjs/dagster/index.cjs"
|
|
70
|
+
},
|
|
71
|
+
"default": "./lib/esm/dagster/index.js"
|
|
50
72
|
}
|
|
51
73
|
},
|
|
52
74
|
"main": "./lib/cjs/index.cjs",
|
|
53
75
|
"module": "./lib/esm/index.js",
|
|
54
76
|
"types": "./lib/types/index.d.mts",
|
|
77
|
+
"bin": {
|
|
78
|
+
"as-graph-server": "./lib/cjs/nest/graph/main.cjs"
|
|
79
|
+
},
|
|
55
80
|
"sideEffects": false,
|
|
56
81
|
"scripts": {
|
|
57
82
|
"do-install": "NPM_TOKEN=$(cat .npmtoken) npm install",
|
|
@@ -69,11 +94,14 @@
|
|
|
69
94
|
"test": "npm run test:all",
|
|
70
95
|
"test:unit": "jest --testPathPatterns=\"/tests/unit\" --passWithNoTests --detectOpenHandles",
|
|
71
96
|
"test:integration": "jest --testPathPatterns=\"/tests/(integration)\" --passWithNoTests --detectOpenHandles",
|
|
97
|
+
"test:integration:mastra": "jest --testPathPatterns=\"/tests/integration/mastra\" --passWithNoTests --detectOpenHandles",
|
|
98
|
+
"test:integration:dagster": "bash tests/integration/dagster/run.sh",
|
|
72
99
|
"test:e2e": "jest --testPathPatterns=\"/tests/(e2e)\" --passWithNoTests --detectOpenHandles",
|
|
73
100
|
"test:all": "jest --testPathPatterns=\"/tests\" --passWithNoTests --detectOpenHandles",
|
|
74
101
|
"test:dist": "TEST_TARGET=lib npm run test:all && TEST_TARGET=dist npm run test:all",
|
|
75
102
|
"test:circular": "dpdm -T --no-warning --no-tree ./src/index.ts",
|
|
76
|
-
"prepare-it-tests": "
|
|
103
|
+
"prepare-it-tests": "bash scripts/prepare-it-tests.sh",
|
|
104
|
+
"teardown-it-tests": "bash tests/integration/dagster/run.sh down",
|
|
77
105
|
"coverage": "rimraf ./workdocs/reports/data/*.json && npm run test:all -- --coverage --config=./workdocs/reports/jest.coverage.config.cjs",
|
|
78
106
|
"lint": "eslint .",
|
|
79
107
|
"lint-fix": "eslint --fix .",
|
|
@@ -128,6 +156,12 @@
|
|
|
128
156
|
"url": "https://github.com/decaf-ts/as-graph/issues"
|
|
129
157
|
},
|
|
130
158
|
"homepage": "https://github.com/decaf-ts/as-graph#readme",
|
|
159
|
+
"dagster": {
|
|
160
|
+
"distribution": "dagster",
|
|
161
|
+
"pinnedVersion": "1.13.25",
|
|
162
|
+
"source": "https://pypi.org/pypi/dagster/json",
|
|
163
|
+
"note": "Dagster is a Python orchestration engine with no official JavaScript runtime. This pin records the engine contract the generated ./dagster artifacts target; execution is driven through the host-injected DagsterClient port."
|
|
164
|
+
},
|
|
131
165
|
"dependencies": {
|
|
132
166
|
"@decaf-ts/crypto": "latest",
|
|
133
167
|
"@decaf-ts/db-decorators": "latest",
|
|
@@ -135,7 +169,7 @@
|
|
|
135
169
|
"@decaf-ts/decorator-validation": "latest",
|
|
136
170
|
"@decaf-ts/for-http": "latest",
|
|
137
171
|
"@decaf-ts/for-nest": "latest",
|
|
138
|
-
"@decaf-ts/integrations": "
|
|
172
|
+
"@decaf-ts/integrations": "latest",
|
|
139
173
|
"@decaf-ts/ui-decorators": "latest",
|
|
140
174
|
"@nestjs/common": "^11.2.6",
|
|
141
175
|
"@nestjs/core": "^11.2.6",
|
|
@@ -144,10 +178,9 @@
|
|
|
144
178
|
"@nestjs/throttler": "^6.7.1",
|
|
145
179
|
"acorn": "^8.18.0",
|
|
146
180
|
"acorn-walk": "^8.3.5",
|
|
181
|
+
"elkjs": "^0.12.0",
|
|
147
182
|
"isolated-vm": "^6.2.0",
|
|
148
|
-
"
|
|
149
|
-
"rxjs": "^7.8.2",
|
|
150
|
-
"typescript": "^5.9.3"
|
|
183
|
+
"rxjs": "^7.8.2"
|
|
151
184
|
},
|
|
152
185
|
"devDependencies": {
|
|
153
186
|
"@decaf-ts/utils": "latest",
|
|
@@ -155,6 +188,16 @@
|
|
|
155
188
|
"@types/jest": "^30.0.0",
|
|
156
189
|
"@types/node": "^24.0.0",
|
|
157
190
|
"@types/supertest": "^6.0.3",
|
|
191
|
+
"jsdoc-mermaid": "^1.0.0",
|
|
158
192
|
"supertest": "^7.3.0"
|
|
193
|
+
},
|
|
194
|
+
"peerDependencies": {
|
|
195
|
+
"@mastra/core": "^1.77.0"
|
|
196
|
+
},
|
|
197
|
+
"overrides": {
|
|
198
|
+
"js-yaml": "^5.2.2",
|
|
199
|
+
"gray-matter": {
|
|
200
|
+
"js-yaml": "^3.13.1"
|
|
201
|
+
}
|
|
159
202
|
}
|
|
160
203
|
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.graphPortViewOf = graphPortViewOf;
|
|
4
|
-
exports.graphNodeColorOf = graphNodeColorOf;
|
|
5
|
-
exports.graphNodeIconOf = graphNodeIconOf;
|
|
6
|
-
exports.graphNodeViewOf = graphNodeViewOf;
|
|
7
|
-
/**
|
|
8
|
-
* @module as-graph/shared/ui/GraphNodeView
|
|
9
|
-
* @summary Builds the framework-neutral node/port view models.
|
|
10
|
-
* @description Projects a node manifest (static or resolved) plus an optional
|
|
11
|
-
* document instance and an optional run record into the {@link GraphNodeView}
|
|
12
|
-
* a graph UI renders. Dynamic ports are expected to be expanded by the caller
|
|
13
|
-
* (the engine's manifest resolver) before projection; this module is pure and
|
|
14
|
-
* DOM-free so it stays importable from any frontend bundle.
|
|
15
|
-
*/
|
|
16
|
-
const index_js_1 = require("./../graph/index.cjs");
|
|
17
|
-
/**
|
|
18
|
-
* Resolves a catalogue icon reference to its display name. URL/data icons keep
|
|
19
|
-
* their literal payload so a renderer can still show something meaningful.
|
|
20
|
-
*
|
|
21
|
-
* @param icon - The manifest icon reference, when present.
|
|
22
|
-
* @returns The icon name/url/value, or `undefined`.
|
|
23
|
-
*/
|
|
24
|
-
function iconNameOf(icon) {
|
|
25
|
-
if (!icon)
|
|
26
|
-
return undefined;
|
|
27
|
-
switch (icon.type) {
|
|
28
|
-
case "catalogue":
|
|
29
|
-
return icon.name;
|
|
30
|
-
case "url":
|
|
31
|
-
return icon.url;
|
|
32
|
-
case "data":
|
|
33
|
-
return icon.value;
|
|
34
|
-
default:
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Projects a manifest port into its view model.
|
|
40
|
-
*
|
|
41
|
-
* @param port - The manifest port.
|
|
42
|
-
* @returns The port view model.
|
|
43
|
-
*/
|
|
44
|
-
function graphPortViewOf(port) {
|
|
45
|
-
return {
|
|
46
|
-
id: port.id,
|
|
47
|
-
label: port.label,
|
|
48
|
-
direction: port.direction,
|
|
49
|
-
required: port.required === true,
|
|
50
|
-
hidden: port.hidden === true,
|
|
51
|
-
category: port.category,
|
|
52
|
-
handle: port.handle,
|
|
53
|
-
schema: port.schema,
|
|
54
|
-
element: port.element,
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Resolves the effective accent colour for a node: the manifest's explicit
|
|
59
|
-
* colour wins, else the registered category style, else the default style.
|
|
60
|
-
*
|
|
61
|
-
* @param manifest - The node manifest.
|
|
62
|
-
* @returns The resolved colour, when one is known.
|
|
63
|
-
*/
|
|
64
|
-
function graphNodeColorOf(manifest) {
|
|
65
|
-
if (manifest.display.color)
|
|
66
|
-
return manifest.display.color;
|
|
67
|
-
return (0, index_js_1.graphCategoryStyleOf)(manifest.display.category).color;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Resolves the effective icon for a node: the manifest's explicit icon wins,
|
|
71
|
-
* else the registered category style icon.
|
|
72
|
-
*
|
|
73
|
-
* @param manifest - The node manifest.
|
|
74
|
-
* @returns The resolved icon name, when one is known.
|
|
75
|
-
*/
|
|
76
|
-
function graphNodeIconOf(manifest) {
|
|
77
|
-
return (iconNameOf(manifest.display.icon) ??
|
|
78
|
-
(0, index_js_1.graphCategoryStyleOf)(manifest.display.category).icon);
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Builds the view model for a single node instance.
|
|
82
|
-
*
|
|
83
|
-
* @param manifest - The node's manifest (static or already resolved).
|
|
84
|
-
* @param instance - The optional document node instance.
|
|
85
|
-
* @param run - The optional per-node run record.
|
|
86
|
-
* @returns The node view model.
|
|
87
|
-
*/
|
|
88
|
-
function graphNodeViewOf(manifest, instance, run) {
|
|
89
|
-
const visualState = run?.visualState ?? index_js_1.GraphVisualState.IDLE;
|
|
90
|
-
return {
|
|
91
|
-
id: instance?.id ?? manifest.kind,
|
|
92
|
-
kind: manifest.kind,
|
|
93
|
-
label: instance?.label ?? manifest.display.name,
|
|
94
|
-
description: manifest.display.description,
|
|
95
|
-
category: manifest.display.category,
|
|
96
|
-
color: graphNodeColorOf(manifest),
|
|
97
|
-
icon: graphNodeIconOf(manifest),
|
|
98
|
-
width: manifest.display.width,
|
|
99
|
-
height: manifest.display.height,
|
|
100
|
-
shape: manifest.display.shape,
|
|
101
|
-
cornerRadius: manifest.display.cornerRadius,
|
|
102
|
-
labels: [...(manifest.display.labels ?? [])],
|
|
103
|
-
inputs: (manifest.inputs ?? []).map(graphPortViewOf),
|
|
104
|
-
outputs: (manifest.outputs ?? []).map(graphPortViewOf),
|
|
105
|
-
connections: (manifest.connections ?? []).map(graphPortViewOf),
|
|
106
|
-
capabilities: [...(manifest.capabilities ?? [])],
|
|
107
|
-
disabled: instance?.disabled === true,
|
|
108
|
-
pinned: instance?.pinned !== undefined,
|
|
109
|
-
visualState,
|
|
110
|
-
visualStyle: { state: visualState, ...(0, index_js_1.graphVisualStyleOf)(visualState) },
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=GraphNodeView.js.map
|
|
114
|
-
//# sourceMappingURL=GraphNodeView.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared/ui/GraphNodeView.cjs","sourceRoot":"","sources":["shared/ui/GraphNodeView.js"],"names":[],"mappings":";;AAqCA,0CAYC;AAQD,4CAIC;AAQD,0CAGC;AASD,0CAwBC;AAzGD;;;;;;;;GAQG;AACH,kDAAkG;AAClG;;;;;;GAMG;AACH,SAAS,UAAU,CAAC,IAAI;IACpB,IAAI,CAAC,IAAI;QACL,OAAO,SAAS,CAAC;IACrB,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAChB,KAAK,WAAW;YACZ,OAAO,IAAI,CAAC,IAAI,CAAC;QACrB,KAAK,KAAK;YACN,OAAO,IAAI,CAAC,GAAG,CAAC;QACpB,KAAK,MAAM;YACP,OAAO,IAAI,CAAC,KAAK,CAAC;QACtB;YACI,OAAO,SAAS,CAAC;IACzB,CAAC;AACL,CAAC;A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ports.graphNodeRunViewOf = graphNodeRunViewOf;
|
|
5
|
-
exports.graphRunViewOf = graphRunViewOf;
|
|
6
|
-
/**
|
|
7
|
-
* @module as-graph/shared/ui/GraphRunView
|
|
8
|
-
* @summary Projects engine run results into frontend-safe run view models.
|
|
9
|
-
* @description Consumes the structural shape of a `GraphExecutionResult`
|
|
10
|
-
* (without importing the engine) and derives the per-node visual state from the
|
|
11
|
-
* shared `GraphExecutionStateMapper` — the canonical run-state feedback a graph
|
|
12
|
-
* UI renders. Per-node intermediate `inputs`/`outputs` are carried verbatim so
|
|
13
|
-
* the UI can display what each node consumed and produced.
|
|
14
|
-
*/
|
|
15
|
-
const index_js_1 = require("./../graph/index.cjs");
|
|
16
|
-
/** Event types that carry a node visual-state transition. */
|
|
17
|
-
const NODE_STATE_EVENT_TYPES = [
|
|
18
|
-
index_js_1.GraphExecutionEventType.NODE_STATE_CHANGED,
|
|
19
|
-
index_js_1.GraphExecutionEventType.NODE_STARTED,
|
|
20
|
-
index_js_1.GraphExecutionEventType.NODE_COMPLETED,
|
|
21
|
-
index_js_1.GraphExecutionEventType.NODE_FAILED,
|
|
22
|
-
index_js_1.GraphExecutionEventType.NODE_SKIPPED,
|
|
23
|
-
];
|
|
24
|
-
/** Formats a timestamp as an ISO-8601 string, when known. */
|
|
25
|
-
function isoOf(value) {
|
|
26
|
-
if (!value)
|
|
27
|
-
return undefined;
|
|
28
|
-
return value instanceof Date ? value.toISOString() : value;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Derives the per-node visual state from the engine events for that node,
|
|
32
|
-
* falling back to the node's engine status when no state event was emitted.
|
|
33
|
-
*
|
|
34
|
-
* @param nodeId - The node identifier.
|
|
35
|
-
* @param status - The node's engine status, when known.
|
|
36
|
-
* @param events - The run's ordered engine events.
|
|
37
|
-
* @returns The derived visual state.
|
|
38
|
-
*/
|
|
39
|
-
function deriveNodeRunVisualState(nodeId, status, events) {
|
|
40
|
-
let derived;
|
|
41
|
-
for (const event of events ?? []) {
|
|
42
|
-
if (event.nodeId !== nodeId)
|
|
43
|
-
continue;
|
|
44
|
-
if (NODE_STATE_EVENT_TYPES.includes(event.type)) {
|
|
45
|
-
derived = (0, index_js_1.visualStateOfEvent)(event);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return (derived ?? (0, index_js_1.mapExecutionStatus)(status));
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Builds the run view model for a single node.
|
|
52
|
-
*
|
|
53
|
-
* @param result - The structural node result.
|
|
54
|
-
* @param events - The run's ordered engine events.
|
|
55
|
-
* @returns The node run view model.
|
|
56
|
-
*/
|
|
57
|
-
function graphNodeRunViewOf(result, events) {
|
|
58
|
-
return {
|
|
59
|
-
nodeId: result.nodeId,
|
|
60
|
-
status: result.status,
|
|
61
|
-
visualState: deriveNodeRunVisualState(result.nodeId, result.status, result.events ?? events),
|
|
62
|
-
inputs: { ...(result.inputs ?? {}) },
|
|
63
|
-
outputs: { ...(result.outputs ?? {}) },
|
|
64
|
-
error: result.error
|
|
65
|
-
? { code: result.error.code, message: result.error.message }
|
|
66
|
-
: undefined,
|
|
67
|
-
fromCache: result.fromCache === true,
|
|
68
|
-
pinned: result.pinned === true,
|
|
69
|
-
startedAt: isoOf(result.startedAt),
|
|
70
|
-
finishedAt: isoOf(result.finishedAt),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Builds the run feedback view model for a whole workflow execution.
|
|
75
|
-
*
|
|
76
|
-
* @param result - The structural workflow result.
|
|
77
|
-
* @returns The workflow run view model.
|
|
78
|
-
*/
|
|
79
|
-
function graphRunViewOf(result) {
|
|
80
|
-
const nodes = {};
|
|
81
|
-
for (const [id, nodeResult] of Object.entries(result.nodeResults ?? {})) {
|
|
82
|
-
nodes[id] = graphNodeRunViewOf(nodeResult, result.events);
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
runId: result.runId,
|
|
86
|
-
workflowId: result.workflowId,
|
|
87
|
-
status: result.status,
|
|
88
|
-
visualState: (0, index_js_1.mapExecutionStatus)(result.status),
|
|
89
|
-
outputs: { ...(result.outputs ?? {}) },
|
|
90
|
-
nodes,
|
|
91
|
-
startedAt: isoOf(result.startedAt),
|
|
92
|
-
finishedAt: isoOf(result.finishedAt),
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=GraphRunView.js.map
|
|
96
|
-
//# sourceMappingURL=GraphRunView.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared/ui/GraphRunView.cjs","sourceRoot":"","sources":["shared/ui/GraphRunView.js"],"names":[],"mappings":";;AAiCA,4DAUC;AAQD,gDAeC;AAOD,wCAeC;AAxFD;;;;;;;;GAQG;AACH,kDAAuG;AACvG,6DAA6D;AAC7D,MAAM,sBAAsB,GAAG;IAC3B,kCAAuB,CAAC,kBAAkB;IAC1C,kCAAuB,CAAC,YAAY;IACpC,kCAAuB,CAAC,cAAc;IACtC,kCAAuB,CAAC,WAAW;IACnC,kCAAuB,CAAC,YAAY;CACvC,CAAC;AACF,6DAA6D;AAC7D,SAAS,KAAK,CAAC,KAAK;IAChB,IAAI,CAAC,KAAK;QACN,OAAO,SAAS,CAAC;IACrB,OAAO,KAAK,YAAY,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC;AACD;;;;;;;;GAQG;AACH,SAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM;IAC3D,IAAI,OAAO,CAAC;IACZ,KAAK,MAAM,KAAK,IAAI,MAAM,IAAI,EAAE,EAAE,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,MAAM;YACvB,SAAS;QACb,IAAI,sBAAsB,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;YAC9C,OAAO,GAAG,IAAA,6BAAkB,EAAC,KAAK,CAAC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CAAC,CAAC;IAC9D,CAAC;IACD,OAAO;QACH,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU;QAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,IAAA,6BAAkB,EAAC,MAAM,CAAC,MAAM,CAAC;QAC9C,OAAO,EAAE,EAAE,GAAG,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE;QACtC,KAAK;QACL,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC;QAClC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;KACvC,CAAC;AACN,CAAC;AACD,wCAAwC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.graphEndpointViewOf = graphEndpointViewOf;
|
|
4
|
-
exports.graphEdgeViewOf = graphEdgeViewOf;
|
|
5
|
-
exports.graphWorkflowViewOf = graphWorkflowViewOf;
|
|
6
|
-
/**
|
|
7
|
-
* @module as-graph/shared/ui/GraphWorkflowView
|
|
8
|
-
* @summary Builds the framework-neutral workflow canvas view model.
|
|
9
|
-
* @description Projects a canonical `GraphWorkflowDocument` plus a kind→manifest
|
|
10
|
-
* map and an optional run feedback model into the {@link GraphWorkflowView} a
|
|
11
|
-
* graph UI renders: the workflow boundary ports, every node instance (with its
|
|
12
|
-
* effective ports and visual run state) and every edge with its resolved
|
|
13
|
-
* endpoints. Pure and DOM-free, so the shared export stays frontend-safe.
|
|
14
|
-
*/
|
|
15
|
-
const index_js_1 = require("./../graph/index.cjs");
|
|
16
|
-
const GraphNodeView_js_1 = require("./GraphNodeView.cjs");
|
|
17
|
-
/** Projects a workflow boundary port into its view model. */
|
|
18
|
-
function workflowPortViewOf(port) {
|
|
19
|
-
return {
|
|
20
|
-
id: port.id,
|
|
21
|
-
label: port.label ?? port.id,
|
|
22
|
-
required: port.required === true,
|
|
23
|
-
schema: port.schema,
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
/** Projects an edge endpoint into its view model. */
|
|
27
|
-
function graphEndpointViewOf(endpoint) {
|
|
28
|
-
if (endpoint.scope === "workflow") {
|
|
29
|
-
return { scope: "workflow", port: endpoint.port };
|
|
30
|
-
}
|
|
31
|
-
return { scope: "node", nodeId: endpoint.nodeId, port: endpoint.port };
|
|
32
|
-
}
|
|
33
|
-
/** Projects an edge instance into its view model. */
|
|
34
|
-
function graphEdgeViewOf(edge) {
|
|
35
|
-
return {
|
|
36
|
-
id: edge.id,
|
|
37
|
-
type: edge.type,
|
|
38
|
-
source: graphEndpointViewOf(edge.source),
|
|
39
|
-
target: graphEndpointViewOf(edge.target),
|
|
40
|
-
label: edge.label,
|
|
41
|
-
visualState: index_js_1.GraphVisualState.IDLE,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Synthesizes a minimal manifest for an unknown node kind so the canvas can
|
|
46
|
-
* still render a placeholder node instead of dropping it.
|
|
47
|
-
*/
|
|
48
|
-
function fallbackManifestOf(instance) {
|
|
49
|
-
return {
|
|
50
|
-
kind: instance.kind,
|
|
51
|
-
display: { name: instance.label ?? instance.kind },
|
|
52
|
-
inputs: [],
|
|
53
|
-
outputs: [],
|
|
54
|
-
parameters: [],
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Builds the view model for a whole workflow document.
|
|
59
|
-
*
|
|
60
|
-
* @param document - The canonical workflow document.
|
|
61
|
-
* @param manifests - Per-instance manifest resolver for the document's nodes.
|
|
62
|
-
* @param run - The optional run feedback model.
|
|
63
|
-
* @returns The workflow view model.
|
|
64
|
-
*/
|
|
65
|
-
function graphWorkflowViewOf(document, manifests, run) {
|
|
66
|
-
const nodes = document.nodes.map((instance) => (0, GraphNodeView_js_1.graphNodeViewOf)(manifests(instance) ?? fallbackManifestOf(instance), instance, run?.nodes[instance.id]));
|
|
67
|
-
return {
|
|
68
|
-
id: document.id,
|
|
69
|
-
name: document.name,
|
|
70
|
-
inputs: document.inputs.map(workflowPortViewOf),
|
|
71
|
-
outputs: document.outputs.map(workflowPortViewOf),
|
|
72
|
-
nodes,
|
|
73
|
-
edges: document.edges.map(graphEdgeViewOf),
|
|
74
|
-
run,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=GraphWorkflowView.js.map
|
|
78
|
-
//# sourceMappingURL=GraphWorkflowView.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared/ui/GraphWorkflowView.cjs","sourceRoot":"","sources":["shared/ui/GraphWorkflowView.js"],"names":[],"mappings":";;AAqBA,kDAKC;AAED,0CASC;AAsBD,kDAWC;AAtED;;;;;;;;GAQG;AACH,kDAAuD;AACvD,yDAAqD;AACrD,6DAA6D;AAC7D,SAAS,kBAAkB,CAAC,IAAI;IAC5B,OAAO;QACH,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE;QAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,KAAK,IAAI;QAChC,MAAM,EAAE,IAAI,CAAC,MAAM;KACtB,CAAC;AACN,CAAC;AACD,qDAAqD;AACrD,SAAgB,mBAAmB,CAAC,QAAQ;IACxC,IAAI,QAAQ,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC3E,CAAC;AACD,qDAAqD;AACrD,SAAgB,eAAe,CAAC,IAAI;IAChC,OAAO;QACH,EAAE,EAAE,IAAI,CAAC,EAAE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
|
1
|
-
{"version":3,"file":"shared/ui/types.cjs","sourceRoot":"","sources":["shared/ui/types.js"],"names":[],"mappings":";;AACA,iCAAiC"}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module as-graph/shared/ui/GraphNodeView
|
|
3
|
-
* @summary Builds the framework-neutral node/port view models.
|
|
4
|
-
* @description Projects a node manifest (static or resolved) plus an optional
|
|
5
|
-
* document instance and an optional run record into the {@link GraphNodeView}
|
|
6
|
-
* a graph UI renders. Dynamic ports are expected to be expanded by the caller
|
|
7
|
-
* (the engine's manifest resolver) before projection; this module is pure and
|
|
8
|
-
* DOM-free so it stays importable from any frontend bundle.
|
|
9
|
-
*/
|
|
10
|
-
import { GraphVisualState, graphCategoryStyleOf, graphVisualStyleOf, } from "./../graph/index.js";
|
|
11
|
-
/**
|
|
12
|
-
* Resolves a catalogue icon reference to its display name. URL/data icons keep
|
|
13
|
-
* their literal payload so a renderer can still show something meaningful.
|
|
14
|
-
*
|
|
15
|
-
* @param icon - The manifest icon reference, when present.
|
|
16
|
-
* @returns The icon name/url/value, or `undefined`.
|
|
17
|
-
*/
|
|
18
|
-
function iconNameOf(icon) {
|
|
19
|
-
if (!icon)
|
|
20
|
-
return undefined;
|
|
21
|
-
switch (icon.type) {
|
|
22
|
-
case "catalogue":
|
|
23
|
-
return icon.name;
|
|
24
|
-
case "url":
|
|
25
|
-
return icon.url;
|
|
26
|
-
case "data":
|
|
27
|
-
return icon.value;
|
|
28
|
-
default:
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Projects a manifest port into its view model.
|
|
34
|
-
*
|
|
35
|
-
* @param port - The manifest port.
|
|
36
|
-
* @returns The port view model.
|
|
37
|
-
*/
|
|
38
|
-
export function graphPortViewOf(port) {
|
|
39
|
-
return {
|
|
40
|
-
id: port.id,
|
|
41
|
-
label: port.label,
|
|
42
|
-
direction: port.direction,
|
|
43
|
-
required: port.required === true,
|
|
44
|
-
hidden: port.hidden === true,
|
|
45
|
-
category: port.category,
|
|
46
|
-
handle: port.handle,
|
|
47
|
-
schema: port.schema,
|
|
48
|
-
element: port.element,
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Resolves the effective accent colour for a node: the manifest's explicit
|
|
53
|
-
* colour wins, else the registered category style, else the default style.
|
|
54
|
-
*
|
|
55
|
-
* @param manifest - The node manifest.
|
|
56
|
-
* @returns The resolved colour, when one is known.
|
|
57
|
-
*/
|
|
58
|
-
export function graphNodeColorOf(manifest) {
|
|
59
|
-
if (manifest.display.color)
|
|
60
|
-
return manifest.display.color;
|
|
61
|
-
return graphCategoryStyleOf(manifest.display.category).color;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Resolves the effective icon for a node: the manifest's explicit icon wins,
|
|
65
|
-
* else the registered category style icon.
|
|
66
|
-
*
|
|
67
|
-
* @param manifest - The node manifest.
|
|
68
|
-
* @returns The resolved icon name, when one is known.
|
|
69
|
-
*/
|
|
70
|
-
export function graphNodeIconOf(manifest) {
|
|
71
|
-
return (iconNameOf(manifest.display.icon) ??
|
|
72
|
-
graphCategoryStyleOf(manifest.display.category).icon);
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Builds the view model for a single node instance.
|
|
76
|
-
*
|
|
77
|
-
* @param manifest - The node's manifest (static or already resolved).
|
|
78
|
-
* @param instance - The optional document node instance.
|
|
79
|
-
* @param run - The optional per-node run record.
|
|
80
|
-
* @returns The node view model.
|
|
81
|
-
*/
|
|
82
|
-
export function graphNodeViewOf(manifest, instance, run) {
|
|
83
|
-
const visualState = run?.visualState ?? GraphVisualState.IDLE;
|
|
84
|
-
return {
|
|
85
|
-
id: instance?.id ?? manifest.kind,
|
|
86
|
-
kind: manifest.kind,
|
|
87
|
-
label: instance?.label ?? manifest.display.name,
|
|
88
|
-
description: manifest.display.description,
|
|
89
|
-
category: manifest.display.category,
|
|
90
|
-
color: graphNodeColorOf(manifest),
|
|
91
|
-
icon: graphNodeIconOf(manifest),
|
|
92
|
-
width: manifest.display.width,
|
|
93
|
-
height: manifest.display.height,
|
|
94
|
-
shape: manifest.display.shape,
|
|
95
|
-
cornerRadius: manifest.display.cornerRadius,
|
|
96
|
-
labels: [...(manifest.display.labels ?? [])],
|
|
97
|
-
inputs: (manifest.inputs ?? []).map(graphPortViewOf),
|
|
98
|
-
outputs: (manifest.outputs ?? []).map(graphPortViewOf),
|
|
99
|
-
connections: (manifest.connections ?? []).map(graphPortViewOf),
|
|
100
|
-
capabilities: [...(manifest.capabilities ?? [])],
|
|
101
|
-
disabled: instance?.disabled === true,
|
|
102
|
-
pinned: instance?.pinned !== undefined,
|
|
103
|
-
visualState,
|
|
104
|
-
visualStyle: { state: visualState, ...graphVisualStyleOf(visualState) },
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=GraphNodeView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphNodeView.js","sourceRoot":"","sources":["../../../../src/shared/ui/GraphNodeView.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,GACnB,4BAAiB;AAkBlB;;;;;;GAMG;AACH,SAAS,UAAU,CACjB,IAA8C;IAE9C,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAC;IAC5B,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,WAAW;YACd,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,KAAK;YACR,OAAO,IAAI,CAAC,GAAG,CAAC;QAClB,KAAK,MAAM;YACT,OAAO,IAAI,CAAC,KAAK,CAAC;QACpB;YACE,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAuB;IACrD,OAAO;QACL,EAAE,EAAE,IA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,EAAE,QAAQ,CAAC,OAAO,CAAC,QAAQ;QACnC,KAAK,EAAE,gBAAgB,CAAC,QAAQ,CAAC;QACjC,IAAI,EAAE,eAAe,CAAC,QAAQ,CAAC;QAC/B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK;QAC7B,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC,MAAM;QAC/B,KAAK,EAAE,QAAQ,CAAC,OAAO,CAAC,KAAK;QAC7B,YAAY,EAAE,QAAQ,CAAC,OAAO,CAAC,YAAY;QAC3C,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC;QAC5C,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QACpD,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QACtD,WAAW,EAAE,CAAC,QAAQ,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC;QAC9D,YAAY,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QAChD,QAAQ,EAAE,QAAQ,EAAE,QAAQ,KAAK,IAAI;QACrC,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,SAAS;QACtC,WAAW;QACX,WAAW,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,WAAW,CAAC,EAAE;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module as-graph/shared/ui/GraphRunView
|
|
3
|
-
* @summary Projects engine run results into frontend-safe run view models.
|
|
4
|
-
* @description Consumes the structural shape of a `GraphExecutionResult`
|
|
5
|
-
* (without importing the engine) and derives the per-node visual state from the
|
|
6
|
-
* shared `GraphExecutionStateMapper` — the canonical run-state feedback a graph
|
|
7
|
-
* UI renders. Per-node intermediate `inputs`/`outputs` are carried verbatim so
|
|
8
|
-
* the UI can display what each node consumed and produced.
|
|
9
|
-
*/
|
|
10
|
-
import { GraphExecutionEventType, mapExecutionStatus, visualStateOfEvent, } from "./../graph/index.js";
|
|
11
|
-
/** Event types that carry a node visual-state transition. */
|
|
12
|
-
const NODE_STATE_EVENT_TYPES = [
|
|
13
|
-
GraphExecutionEventType.NODE_STATE_CHANGED,
|
|
14
|
-
GraphExecutionEventType.NODE_STARTED,
|
|
15
|
-
GraphExecutionEventType.NODE_COMPLETED,
|
|
16
|
-
GraphExecutionEventType.NODE_FAILED,
|
|
17
|
-
GraphExecutionEventType.NODE_SKIPPED,
|
|
18
|
-
];
|
|
19
|
-
/** Formats a timestamp as an ISO-8601 string, when known. */
|
|
20
|
-
function isoOf(value) {
|
|
21
|
-
if (!value)
|
|
22
|
-
return undefined;
|
|
23
|
-
return value instanceof Date ? value.toISOString() : value;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Derives the per-node visual state from the engine events for that node,
|
|
27
|
-
* falling back to the node's engine status when no state event was emitted.
|
|
28
|
-
*
|
|
29
|
-
* @param nodeId - The node identifier.
|
|
30
|
-
* @param status - The node's engine status, when known.
|
|
31
|
-
* @param events - The run's ordered engine events.
|
|
32
|
-
* @returns The derived visual state.
|
|
33
|
-
*/
|
|
34
|
-
export function deriveNodeRunVisualState(nodeId, status, events) {
|
|
35
|
-
let derived;
|
|
36
|
-
for (const event of events ?? []) {
|
|
37
|
-
if (event.nodeId !== nodeId)
|
|
38
|
-
continue;
|
|
39
|
-
if (NODE_STATE_EVENT_TYPES.includes(event.type)) {
|
|
40
|
-
derived = visualStateOfEvent(event);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return (derived ?? mapExecutionStatus(status));
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Builds the run view model for a single node.
|
|
47
|
-
*
|
|
48
|
-
* @param result - The structural node result.
|
|
49
|
-
* @param events - The run's ordered engine events.
|
|
50
|
-
* @returns The node run view model.
|
|
51
|
-
*/
|
|
52
|
-
export function graphNodeRunViewOf(result, events) {
|
|
53
|
-
return {
|
|
54
|
-
nodeId: result.nodeId,
|
|
55
|
-
status: result.status,
|
|
56
|
-
visualState: deriveNodeRunVisualState(result.nodeId, result.status, result.events ?? events),
|
|
57
|
-
inputs: { ...(result.inputs ?? {}) },
|
|
58
|
-
outputs: { ...(result.outputs ?? {}) },
|
|
59
|
-
error: result.error
|
|
60
|
-
? { code: result.error.code, message: result.error.message }
|
|
61
|
-
: undefined,
|
|
62
|
-
fromCache: result.fromCache === true,
|
|
63
|
-
pinned: result.pinned === true,
|
|
64
|
-
startedAt: isoOf(result.startedAt),
|
|
65
|
-
finishedAt: isoOf(result.finishedAt),
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Builds the run feedback view model for a whole workflow execution.
|
|
70
|
-
*
|
|
71
|
-
* @param result - The structural workflow result.
|
|
72
|
-
* @returns The workflow run view model.
|
|
73
|
-
*/
|
|
74
|
-
export function graphRunViewOf(result) {
|
|
75
|
-
const nodes = {};
|
|
76
|
-
for (const [id, nodeResult] of Object.entries(result.nodeResults ?? {})) {
|
|
77
|
-
nodes[id] = graphNodeRunViewOf(nodeResult, result.events);
|
|
78
|
-
}
|
|
79
|
-
return {
|
|
80
|
-
runId: result.runId,
|
|
81
|
-
workflowId: result.workflowId,
|
|
82
|
-
status: result.status,
|
|
83
|
-
visualState: mapExecutionStatus(result.status),
|
|
84
|
-
outputs: { ...(result.outputs ?? {}) },
|
|
85
|
-
nodes,
|
|
86
|
-
startedAt: isoOf(result.startedAt),
|
|
87
|
-
finishedAt: isoOf(result.finishedAt),
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=GraphRunView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GraphRun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