@decaf-ts/as-graph 0.2.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +158 -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 +4 -0
- package/lib/cjs/engine/index.cjs.map +1 -1
- package/lib/cjs/engine/runs/GraphRunService.cjs +61 -0
- package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphWorkflowService.cjs +33 -14
- 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/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/servingErrors.cjs +3 -0
- package/lib/cjs/nest/graph/servingErrors.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/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 +4 -0
- package/lib/esm/engine/index.js.map +1 -1
- package/lib/esm/engine/runs/GraphRunService.js +62 -1
- package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
- package/lib/esm/engine/services/GraphWorkflowService.js +33 -14
- 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/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/servingErrors.js +3 -0
- package/lib/esm/nest/graph/servingErrors.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/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/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 +4 -0
- package/lib/types/engine/index.d.mts +4 -0
- package/lib/types/engine/runs/GraphRunService.d.cts +19 -0
- package/lib/types/engine/runs/GraphRunService.d.mts +19 -0
- package/lib/types/engine/services/GraphWorkflowService.d.cts +22 -0
- package/lib/types/engine/services/GraphWorkflowService.d.mts +22 -0
- 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 +8 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +8 -0
- 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/servingErrors.d.cts +3 -1
- package/lib/types/nest/graph/servingErrors.d.mts +3 -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/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/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 +4 -3
- package/lib/types/shared/graph/types.d.mts +4 -3
- 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
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
* events and the `graph.run.log` run-log channel.
|
|
18
18
|
*/
|
|
19
19
|
import { Adapter, ClientBasedService, type Context, type ContextualArgs, type MaybeContextualArg } from "@decaf-ts/core";
|
|
20
|
-
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.cts";
|
|
21
|
-
import type { GraphExecutionEvent } from "../../shared/graph/index.d.cts";
|
|
20
|
+
import type { GraphExecutionEvent, GraphWorkflowDocument } from "../../shared/graph/index.d.cts";
|
|
22
21
|
import type { GraphExecutionOptions, GraphExecutionResult, GraphExecutionValues, GraphPinNodeOptions, GraphUnpinNodeOptions } from "../types.d.cts";
|
|
23
22
|
import type { GraphExecutionObserver } from "../events/GraphExecutionObserver.d.cts";
|
|
24
23
|
import { GraphExecutionEventEmitter } from "../events/GraphExecutionEventEmitter.d.cts";
|
|
@@ -28,7 +27,22 @@ import { GraphExecutionPlanner } from "../planning/GraphExecutionPlanner.d.cts";
|
|
|
28
27
|
import { GraphWorkflowDocumentValidator, type GraphWorkflowDocumentValidationLimits } from "../validation/GraphWorkflowDocumentValidator.d.cts";
|
|
29
28
|
import type { GraphCredentialAuthorizer } from "../validation/GraphCredentialReferenceValidator.d.cts";
|
|
30
29
|
import type { CodeSandboxEvaluator } from "./CodeSandboxEvaluator.d.cts";
|
|
30
|
+
import { type GraphBackendCapabilities, type GraphBackendWorkflowStore, type GraphBackendWorkflowSummary, type GraphExecutionBackend } from "./GraphExecutionBackend.d.cts";
|
|
31
31
|
import { GraphAuthValidator, type GraphNamespaceMatchOptions } from "../auth/index.d.cts";
|
|
32
|
+
/**
|
|
33
|
+
* Strips facade-owned keys from a backend's retained configuration that the facade
|
|
34
|
+
* did not itself set (defense in depth). A backend's `config` getter may derive
|
|
35
|
+
* from lower-trust input; without this guard a same-key value would survive the
|
|
36
|
+
* merge whenever the facade omits that key and become a config-injection sink. Keys
|
|
37
|
+
* the facade itself set are kept: the facade is their authority and the caller
|
|
38
|
+
* merges its own values over them afterwards.
|
|
39
|
+
*
|
|
40
|
+
* @param hostBackendConfig - The config the backend retained from a previous
|
|
41
|
+
* `initialize`; may be `undefined`.
|
|
42
|
+
* @param facadeSetKeys - The facade-owned keys the facade itself set on this pass.
|
|
43
|
+
* @returns A copy of the host config with unowned facade-owned keys removed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function stripFacadeOwnedBackendConfig(hostBackendConfig: Record<string, unknown> | undefined, facadeSetKeys: ReadonlySet<string>): Record<string, unknown>;
|
|
32
46
|
/**
|
|
33
47
|
* Configuration for the {@link GraphExecutionEngine}.
|
|
34
48
|
*/
|
|
@@ -57,6 +71,22 @@ export interface GraphExecutionEngineConfig {
|
|
|
57
71
|
*/
|
|
58
72
|
authMatch?: GraphNamespaceMatchOptions;
|
|
59
73
|
planner?: GraphExecutionPlanner;
|
|
74
|
+
/**
|
|
75
|
+
* Pluggable execution backend. Defaults to a fresh
|
|
76
|
+
* {@link LocalGraphExecutionBackend} (the extracted reference interpreter);
|
|
77
|
+
* remote/translated backends (Dagster, Mastra) are supplied here. The facade
|
|
78
|
+
* still owns validation, resolution, auth, planning, event sequencing, and
|
|
79
|
+
* observer dispatch for every backend.
|
|
80
|
+
*/
|
|
81
|
+
backend?: GraphExecutionBackend;
|
|
82
|
+
/**
|
|
83
|
+
* Workflow catalogue port used by the default {@link LocalGraphExecutionBackend}
|
|
84
|
+
* to back the engine-agnostic `listWorkflows`/`getWorkflow` seam. Hosts pass
|
|
85
|
+
* their `GraphWorkflowService` here; remote backends surface their own
|
|
86
|
+
* catalogue through the optional {@link GraphExecutionBackend} extension and
|
|
87
|
+
* ignore this port.
|
|
88
|
+
*/
|
|
89
|
+
workflowStore?: GraphBackendWorkflowStore;
|
|
60
90
|
/**
|
|
61
91
|
* Decaf adapter backing cached/pinned value persistence. Defaults to the
|
|
62
92
|
* globally configured adapter (`Adapter.current`); tests pass a `RamAdapter`
|
|
@@ -91,6 +121,8 @@ export interface GraphExecutionEngineClient {
|
|
|
91
121
|
catalogue: GraphNodeCatalogue;
|
|
92
122
|
/** Topological planner. */
|
|
93
123
|
planner: GraphExecutionPlanner;
|
|
124
|
+
/** Pluggable execution backend (local by default). */
|
|
125
|
+
backend: GraphExecutionBackend;
|
|
94
126
|
/** Decaf adapter backing cached/pinned value persistence. */
|
|
95
127
|
valueAdapter: Adapter<any, any, any, any>;
|
|
96
128
|
/** Engine event emitter. */
|
|
@@ -128,6 +160,12 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
128
160
|
* `Service.boot` may call this with only a decaf `Context`; an explicit
|
|
129
161
|
* `initialize(config)` is required before the engine can execute.
|
|
130
162
|
*
|
|
163
|
+
* The active backend is (re-)initialized with the facade-owned collaborators
|
|
164
|
+
* merged over any host config the backend already retains
|
|
165
|
+
* (`GraphExecutionBackend.config`). Facade-owned keys win on collision, so a
|
|
166
|
+
* host `backend.initialize({ mastra, stepHandlers, ... })` performed before
|
|
167
|
+
* `engine.boot` survives this pass instead of being dropped.
|
|
168
|
+
*
|
|
131
169
|
* @param args - The engine config, optionally followed by a decaf `Context`.
|
|
132
170
|
* @returns The resolved config and runtime client bundle.
|
|
133
171
|
*/
|
|
@@ -178,6 +216,82 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
178
216
|
* nine-stage validation gate (carries every structured issue).
|
|
179
217
|
*/
|
|
180
218
|
execute(document: GraphWorkflowDocument, inputs?: GraphExecutionValues, options?: GraphExecutionOptions, ...args: MaybeContextualArg<Context>): Promise<GraphExecutionResult>;
|
|
219
|
+
/**
|
|
220
|
+
* The active pluggable execution backend. Exposed so the run lifecycle service
|
|
221
|
+
* can delegate optional backend extensions (e.g. the SAA-196 resume extension)
|
|
222
|
+
* without re-resolving the configured backend.
|
|
223
|
+
*/
|
|
224
|
+
get backend(): GraphExecutionBackend;
|
|
225
|
+
/**
|
|
226
|
+
* Effective capability metadata of the active backend. Hosts and servers read
|
|
227
|
+
* this to surface what the current backend supports (code-mode handling and
|
|
228
|
+
* workflow listing/lookup) without probing it, and an unsupported operation is
|
|
229
|
+
* reported as `not_supported` rather than a silently empty result.
|
|
230
|
+
*/
|
|
231
|
+
get backendCapabilities(): GraphBackendCapabilities;
|
|
232
|
+
/**
|
|
233
|
+
* Lists the workflows the active backend can surface, through the engine-agnostic
|
|
234
|
+
* seam. Works identically for the default local backend (over its wired
|
|
235
|
+
* workflow store) and any remote/translated backend that implements the
|
|
236
|
+
* optional catalogue extension.
|
|
237
|
+
*
|
|
238
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
239
|
+
* @returns Workflow summaries.
|
|
240
|
+
* @throws {GraphExecutionError} with `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED`
|
|
241
|
+
* when the active backend declares no listing support.
|
|
242
|
+
*/
|
|
243
|
+
listWorkflows(...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
244
|
+
/**
|
|
245
|
+
* Looks up a single canonical workflow document through the active backend's
|
|
246
|
+
* engine-agnostic catalogue seam. The default local backend reads it from its
|
|
247
|
+
* wired workflow store; remote backends surface their own catalogue.
|
|
248
|
+
*
|
|
249
|
+
* @param workflowId - The canonical workflow id to read.
|
|
250
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
251
|
+
* @returns The canonical workflow document.
|
|
252
|
+
* @throws {GraphExecutionError} with `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED`
|
|
253
|
+
* when the active backend declares no lookup support.
|
|
254
|
+
*/
|
|
255
|
+
getWorkflow(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
256
|
+
/**
|
|
257
|
+
* Lists the workflows a *specific* registered backend can surface, resolved by
|
|
258
|
+
* flavour. This is the flavour-scoped counterpart of {@link listWorkflows}: the
|
|
259
|
+
* server exposes the engine catalogue per engine id, and every registered backend
|
|
260
|
+
* is reached through the same engine-agnostic {@link GraphExecutionBackend}
|
|
261
|
+
* listing seam with the same fail-closed capability gate and error code.
|
|
262
|
+
*
|
|
263
|
+
* @param flavour - The registered backend flavour (allowlisted engine id).
|
|
264
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
265
|
+
* @returns Workflow summaries.
|
|
266
|
+
* @throws {GraphExecutionError} with `GRAPH_EXECUTION_BACKEND_NOT_REGISTERED`
|
|
267
|
+
* for an unknown flavour, or `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` when the
|
|
268
|
+
* backend declares no listing support.
|
|
269
|
+
*/
|
|
270
|
+
listEngineWorkflows(flavour: string, ...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
271
|
+
/**
|
|
272
|
+
* Looks up a single canonical workflow document on a *specific* registered
|
|
273
|
+
* backend, resolved by flavour. Flavour-scoped counterpart of
|
|
274
|
+
* {@link getWorkflow} with the same capability gate and error code.
|
|
275
|
+
*
|
|
276
|
+
* @param flavour - The registered backend flavour (allowlisted engine id).
|
|
277
|
+
* @param workflowId - The canonical workflow id to read.
|
|
278
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
279
|
+
* @returns The canonical workflow document.
|
|
280
|
+
* @throws {GraphExecutionError} with `GRAPH_EXECUTION_BACKEND_NOT_REGISTERED`
|
|
281
|
+
* for an unknown flavour, or `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` when the
|
|
282
|
+
* backend declares no lookup support.
|
|
283
|
+
*/
|
|
284
|
+
getEngineWorkflow(flavour: string, workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
285
|
+
/** Human-readable name of the active backend, for diagnostics. */
|
|
286
|
+
private get backendName();
|
|
287
|
+
/**
|
|
288
|
+
* SAA-193 C1 fail-closed gate. A non-local backend must not launch a
|
|
289
|
+
* workflow carrying any code-mode surface unless it declares
|
|
290
|
+
* `codeMode: "hostSide"` and the facade has a configured sandbox evaluator.
|
|
291
|
+
* Local backends are not gated: their code-mode surfaces fail naturally
|
|
292
|
+
* through the existing per-surface `GRAPH_CODE_SANDBOX_NOT_CONFIGURED` path.
|
|
293
|
+
*/
|
|
294
|
+
private assertCodeModeSupported;
|
|
181
295
|
/**
|
|
182
296
|
* Pins a node and its upstream dependencies after a completed run.
|
|
183
297
|
*
|
|
@@ -202,139 +316,10 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
202
316
|
* Fills unprovided workflow inputs with their declared port defaults.
|
|
203
317
|
*/
|
|
204
318
|
private withWorkflowInputDefaults;
|
|
205
|
-
/**
|
|
206
|
-
* Executes a layer of nodes with the configured concurrency.
|
|
207
|
-
*/
|
|
208
|
-
private executeLayer;
|
|
209
|
-
/**
|
|
210
|
-
* Executes a single node, honouring disabled-node semantics (§4.9).
|
|
211
|
-
*/
|
|
212
|
-
private executeNode;
|
|
213
|
-
/**
|
|
214
|
-
* Resolves whether a plan node is activated for execution under the
|
|
215
|
-
* DECAF-50 §4.9 branch semantics. A node with no incoming data edges is
|
|
216
|
-
* a root/source node and always runs. A node fed by one or more data
|
|
217
|
-
* edges runs only when at least one of those edges was activated by a
|
|
218
|
-
* routed upstream output port — a branch the upstream switch (or any
|
|
219
|
-
* partial-output node) did not select leaves its downstream edges
|
|
220
|
-
* unactivated, so the branch is never executed. Workflow-boundary edges
|
|
221
|
-
* are active from the start because workflow inputs are seeded before
|
|
222
|
-
* execution begins.
|
|
223
|
-
*/
|
|
224
|
-
private isNodeActivated;
|
|
225
|
-
/**
|
|
226
|
-
* Skips a node whose incoming data edges were all left unactivated by an
|
|
227
|
-
* upstream branch selection. The node is not executed and its outputs are
|
|
228
|
-
* never routed or collected into workflow outputs (DECAF-50 §4.9).
|
|
229
|
-
*/
|
|
230
|
-
private skipInactiveNode;
|
|
231
|
-
/**
|
|
232
|
-
* Applies the explicit disabled-node semantics (§4.9):
|
|
233
|
-
* `skip`, `passThroughFirstInput`, or `emitDefaults`, resolved from the
|
|
234
|
-
* instance metadata, document settings, and the default.
|
|
235
|
-
*/
|
|
236
|
-
private executeDisabledNode;
|
|
237
|
-
/**
|
|
238
|
-
* Invokes the node's catalogue-resolved executor (§4.9 request contract,
|
|
239
|
-
* post-cutover: every executor receives the full request with
|
|
240
|
-
* configuration and input data separated).
|
|
241
|
-
*/
|
|
242
|
-
private invokeExecutor;
|
|
243
|
-
/**
|
|
244
|
-
* Validates executor outputs against the effective output manifest
|
|
245
|
-
* (§4.9): unknown outputs are rejected by default; missing required
|
|
246
|
-
* outputs fail the node. Lenient transition manifests (legacy
|
|
247
|
-
* executor-only registrations) are exempt until cutover.
|
|
248
|
-
*/
|
|
249
|
-
private validateNodeOutputs;
|
|
250
|
-
/**
|
|
251
|
-
* Collects the resolved credential references for a node: credential-type
|
|
252
|
-
* parameter values plus the `credentials` record in instance metadata.
|
|
253
|
-
* Documents carry references only — secret material never enters requests.
|
|
254
|
-
*/
|
|
255
|
-
private collectCredentials;
|
|
256
|
-
/**
|
|
257
|
-
* Resolves a node's input values from routed data edges, literal bindings,
|
|
258
|
-
* allowed expression bindings, and manifest port defaults (§4.9).
|
|
259
|
-
*
|
|
260
|
-
* When multiple edges target the same port, their values are spread into the
|
|
261
|
-
* top-level inputs keyed by each edge's `sourcePort`. This allows multiple
|
|
262
|
-
* workflow input badges to connect to a single port (e.g. the Code node's
|
|
263
|
-
* `data` port) and have all values accessible directly as
|
|
264
|
-
* `$input.{sourcePort}` (e.g. `$input.count`, `$input.text`).
|
|
265
|
-
*/
|
|
266
|
-
private resolveNodeInputs;
|
|
267
|
-
/**
|
|
268
|
-
* Resolves a node's persisted parameters at execution time, evaluating any
|
|
269
|
-
* `GraphValueTemplate` user property through the code-evaluator VM and
|
|
270
|
-
* leaving straight literal values unchanged.
|
|
271
|
-
*/
|
|
272
|
-
private resolveNodeParameters;
|
|
273
|
-
/**
|
|
274
|
-
* Evaluates a persisted `GraphValueTemplate` with the pluggable
|
|
275
|
-
* {@link CodeSandboxEvaluator} (DECAF-32 §22.4) — no new evaluator.
|
|
276
|
-
* `expression` mode evaluates the body directly; `template` mode compiles its
|
|
277
|
-
* `{{ ... }}` placeholders into a JavaScript template literal evaluated in
|
|
278
|
-
* the same sandbox, so both modes share the code-evaluator VM.
|
|
279
|
-
*/
|
|
280
|
-
private evaluateValueTemplate;
|
|
281
|
-
/**
|
|
282
|
-
* Evaluates an expression binding with the EXISTING allowed-expression
|
|
283
|
-
* machinery only (the pluggable {@link CodeSandboxEvaluator}, DECAF-32
|
|
284
|
-
* §22.4) — no new evaluator. The expression sees the already-routed input
|
|
285
|
-
* values as `$input` and the run metadata as context.
|
|
286
|
-
*/
|
|
287
|
-
private evaluateExpressionBinding;
|
|
288
|
-
/**
|
|
289
|
-
* Attempts to read a pinned value for the node. Returns the cached outputs
|
|
290
|
-
* when a valid pinned value exists, or `undefined` to proceed with normal
|
|
291
|
-
* execution.
|
|
292
|
-
*/
|
|
293
|
-
private tryPinnedValue;
|
|
294
|
-
/**
|
|
295
|
-
* Recursively computes fingerprints for all upstream dependencies of a node
|
|
296
|
-
* using the results already accumulated in the frame.
|
|
297
|
-
*/
|
|
298
|
-
private computeDependencyFingerprints;
|
|
299
|
-
/**
|
|
300
|
-
* Routes a node's outputs to downstream inputs and workflow outputs along
|
|
301
|
-
* data edges (connection edges are structural and never route values).
|
|
302
|
-
*
|
|
303
|
-
* An edge is traversed only when the source node actually emitted the
|
|
304
|
-
* edge's `sourcePort` (DECAF-50 §4.9 branch semantics). A node that
|
|
305
|
-
* emitted a subset of its declared outputs — e.g. a switch that selected
|
|
306
|
-
* one case — therefore activates only the downstream branch edges of the
|
|
307
|
-
* emitted ports; unselected branch edges are left unactivated, so their
|
|
308
|
-
* downstream nodes are skipped and never contribute to workflow outputs.
|
|
309
|
-
* Emitting an output port explicitly with `undefined` still counts as
|
|
310
|
-
* activated (the port was produced by the executor).
|
|
311
|
-
*/
|
|
312
|
-
private routeOutgoingEdges;
|
|
313
|
-
/**
|
|
314
|
-
* Emits an event, records it in the frame, and dispatches to observers.
|
|
315
|
-
*/
|
|
316
|
-
private emitEvent;
|
|
317
|
-
/**
|
|
318
|
-
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
319
|
-
* visual state for the node. Rides the existing Observable pipeline; no
|
|
320
|
-
* second out-of-band channel.
|
|
321
|
-
*/
|
|
322
|
-
private emitNodeStateChanged;
|
|
323
|
-
/**
|
|
324
|
-
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
325
|
-
* visual state for a routed edge.
|
|
326
|
-
*/
|
|
327
|
-
private emitEdgeStateChanged;
|
|
328
319
|
/**
|
|
329
320
|
* Merges default options with the given options.
|
|
330
321
|
*/
|
|
331
322
|
private mergeOptions;
|
|
332
|
-
/**
|
|
333
|
-
* Resolves the effective loop-iteration ceilings for a run. A node-level
|
|
334
|
-
* `maxIterations` can never exceed these; loop executors read them from the
|
|
335
|
-
* node context.
|
|
336
|
-
*/
|
|
337
|
-
private executionLimits;
|
|
338
323
|
private assertNotAborted;
|
|
339
324
|
/**
|
|
340
325
|
* Generates a cryptographically random run id. `crypto.randomUUID` is always
|
|
@@ -345,8 +330,4 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
345
330
|
* @throws {GraphExecutionError} when `crypto.randomUUID` is unavailable.
|
|
346
331
|
*/
|
|
347
332
|
private generateRunId;
|
|
348
|
-
/**
|
|
349
|
-
* Converts an error into a serialized payload.
|
|
350
|
-
*/
|
|
351
|
-
private toErrorPayload;
|
|
352
333
|
}
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
* events and the `graph.run.log` run-log channel.
|
|
18
18
|
*/
|
|
19
19
|
import { Adapter, ClientBasedService, type Context, type ContextualArgs, type MaybeContextualArg } from "@decaf-ts/core";
|
|
20
|
-
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.mts";
|
|
21
|
-
import type { GraphExecutionEvent } from "../../shared/graph/index.d.mts";
|
|
20
|
+
import type { GraphExecutionEvent, GraphWorkflowDocument } from "../../shared/graph/index.d.mts";
|
|
22
21
|
import type { GraphExecutionOptions, GraphExecutionResult, GraphExecutionValues, GraphPinNodeOptions, GraphUnpinNodeOptions } from "../types.d.mts";
|
|
23
22
|
import type { GraphExecutionObserver } from "../events/GraphExecutionObserver.d.mts";
|
|
24
23
|
import { GraphExecutionEventEmitter } from "../events/GraphExecutionEventEmitter.d.mts";
|
|
@@ -28,7 +27,22 @@ import { GraphExecutionPlanner } from "../planning/GraphExecutionPlanner.d.mts";
|
|
|
28
27
|
import { GraphWorkflowDocumentValidator, type GraphWorkflowDocumentValidationLimits } from "../validation/GraphWorkflowDocumentValidator.d.mts";
|
|
29
28
|
import type { GraphCredentialAuthorizer } from "../validation/GraphCredentialReferenceValidator.d.mts";
|
|
30
29
|
import type { CodeSandboxEvaluator } from "./CodeSandboxEvaluator.d.mts";
|
|
30
|
+
import { type GraphBackendCapabilities, type GraphBackendWorkflowStore, type GraphBackendWorkflowSummary, type GraphExecutionBackend } from "./GraphExecutionBackend.d.mts";
|
|
31
31
|
import { GraphAuthValidator, type GraphNamespaceMatchOptions } from "../auth/index.d.mts";
|
|
32
|
+
/**
|
|
33
|
+
* Strips facade-owned keys from a backend's retained configuration that the facade
|
|
34
|
+
* did not itself set (defense in depth). A backend's `config` getter may derive
|
|
35
|
+
* from lower-trust input; without this guard a same-key value would survive the
|
|
36
|
+
* merge whenever the facade omits that key and become a config-injection sink. Keys
|
|
37
|
+
* the facade itself set are kept: the facade is their authority and the caller
|
|
38
|
+
* merges its own values over them afterwards.
|
|
39
|
+
*
|
|
40
|
+
* @param hostBackendConfig - The config the backend retained from a previous
|
|
41
|
+
* `initialize`; may be `undefined`.
|
|
42
|
+
* @param facadeSetKeys - The facade-owned keys the facade itself set on this pass.
|
|
43
|
+
* @returns A copy of the host config with unowned facade-owned keys removed.
|
|
44
|
+
*/
|
|
45
|
+
export declare function stripFacadeOwnedBackendConfig(hostBackendConfig: Record<string, unknown> | undefined, facadeSetKeys: ReadonlySet<string>): Record<string, unknown>;
|
|
32
46
|
/**
|
|
33
47
|
* Configuration for the {@link GraphExecutionEngine}.
|
|
34
48
|
*/
|
|
@@ -57,6 +71,22 @@ export interface GraphExecutionEngineConfig {
|
|
|
57
71
|
*/
|
|
58
72
|
authMatch?: GraphNamespaceMatchOptions;
|
|
59
73
|
planner?: GraphExecutionPlanner;
|
|
74
|
+
/**
|
|
75
|
+
* Pluggable execution backend. Defaults to a fresh
|
|
76
|
+
* {@link LocalGraphExecutionBackend} (the extracted reference interpreter);
|
|
77
|
+
* remote/translated backends (Dagster, Mastra) are supplied here. The facade
|
|
78
|
+
* still owns validation, resolution, auth, planning, event sequencing, and
|
|
79
|
+
* observer dispatch for every backend.
|
|
80
|
+
*/
|
|
81
|
+
backend?: GraphExecutionBackend;
|
|
82
|
+
/**
|
|
83
|
+
* Workflow catalogue port used by the default {@link LocalGraphExecutionBackend}
|
|
84
|
+
* to back the engine-agnostic `listWorkflows`/`getWorkflow` seam. Hosts pass
|
|
85
|
+
* their `GraphWorkflowService` here; remote backends surface their own
|
|
86
|
+
* catalogue through the optional {@link GraphExecutionBackend} extension and
|
|
87
|
+
* ignore this port.
|
|
88
|
+
*/
|
|
89
|
+
workflowStore?: GraphBackendWorkflowStore;
|
|
60
90
|
/**
|
|
61
91
|
* Decaf adapter backing cached/pinned value persistence. Defaults to the
|
|
62
92
|
* globally configured adapter (`Adapter.current`); tests pass a `RamAdapter`
|
|
@@ -91,6 +121,8 @@ export interface GraphExecutionEngineClient {
|
|
|
91
121
|
catalogue: GraphNodeCatalogue;
|
|
92
122
|
/** Topological planner. */
|
|
93
123
|
planner: GraphExecutionPlanner;
|
|
124
|
+
/** Pluggable execution backend (local by default). */
|
|
125
|
+
backend: GraphExecutionBackend;
|
|
94
126
|
/** Decaf adapter backing cached/pinned value persistence. */
|
|
95
127
|
valueAdapter: Adapter<any, any, any, any>;
|
|
96
128
|
/** Engine event emitter. */
|
|
@@ -128,6 +160,12 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
128
160
|
* `Service.boot` may call this with only a decaf `Context`; an explicit
|
|
129
161
|
* `initialize(config)` is required before the engine can execute.
|
|
130
162
|
*
|
|
163
|
+
* The active backend is (re-)initialized with the facade-owned collaborators
|
|
164
|
+
* merged over any host config the backend already retains
|
|
165
|
+
* (`GraphExecutionBackend.config`). Facade-owned keys win on collision, so a
|
|
166
|
+
* host `backend.initialize({ mastra, stepHandlers, ... })` performed before
|
|
167
|
+
* `engine.boot` survives this pass instead of being dropped.
|
|
168
|
+
*
|
|
131
169
|
* @param args - The engine config, optionally followed by a decaf `Context`.
|
|
132
170
|
* @returns The resolved config and runtime client bundle.
|
|
133
171
|
*/
|
|
@@ -178,6 +216,82 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
178
216
|
* nine-stage validation gate (carries every structured issue).
|
|
179
217
|
*/
|
|
180
218
|
execute(document: GraphWorkflowDocument, inputs?: GraphExecutionValues, options?: GraphExecutionOptions, ...args: MaybeContextualArg<Context>): Promise<GraphExecutionResult>;
|
|
219
|
+
/**
|
|
220
|
+
* The active pluggable execution backend. Exposed so the run lifecycle service
|
|
221
|
+
* can delegate optional backend extensions (e.g. the SAA-196 resume extension)
|
|
222
|
+
* without re-resolving the configured backend.
|
|
223
|
+
*/
|
|
224
|
+
get backend(): GraphExecutionBackend;
|
|
225
|
+
/**
|
|
226
|
+
* Effective capability metadata of the active backend. Hosts and servers read
|
|
227
|
+
* this to surface what the current backend supports (code-mode handling and
|
|
228
|
+
* workflow listing/lookup) without probing it, and an unsupported operation is
|
|
229
|
+
* reported as `not_supported` rather than a silently empty result.
|
|
230
|
+
*/
|
|
231
|
+
get backendCapabilities(): GraphBackendCapabilities;
|
|
232
|
+
/**
|
|
233
|
+
* Lists the workflows the active backend can surface, through the engine-agnostic
|
|
234
|
+
* seam. Works identically for the default local backend (over its wired
|
|
235
|
+
* workflow store) and any remote/translated backend that implements the
|
|
236
|
+
* optional catalogue extension.
|
|
237
|
+
*
|
|
238
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
239
|
+
* @returns Workflow summaries.
|
|
240
|
+
* @throws {GraphExecutionError} with `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED`
|
|
241
|
+
* when the active backend declares no listing support.
|
|
242
|
+
*/
|
|
243
|
+
listWorkflows(...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
244
|
+
/**
|
|
245
|
+
* Looks up a single canonical workflow document through the active backend's
|
|
246
|
+
* engine-agnostic catalogue seam. The default local backend reads it from its
|
|
247
|
+
* wired workflow store; remote backends surface their own catalogue.
|
|
248
|
+
*
|
|
249
|
+
* @param workflowId - The canonical workflow id to read.
|
|
250
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
251
|
+
* @returns The canonical workflow document.
|
|
252
|
+
* @throws {GraphExecutionError} with `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED`
|
|
253
|
+
* when the active backend declares no lookup support.
|
|
254
|
+
*/
|
|
255
|
+
getWorkflow(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
256
|
+
/**
|
|
257
|
+
* Lists the workflows a *specific* registered backend can surface, resolved by
|
|
258
|
+
* flavour. This is the flavour-scoped counterpart of {@link listWorkflows}: the
|
|
259
|
+
* server exposes the engine catalogue per engine id, and every registered backend
|
|
260
|
+
* is reached through the same engine-agnostic {@link GraphExecutionBackend}
|
|
261
|
+
* listing seam with the same fail-closed capability gate and error code.
|
|
262
|
+
*
|
|
263
|
+
* @param flavour - The registered backend flavour (allowlisted engine id).
|
|
264
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
265
|
+
* @returns Workflow summaries.
|
|
266
|
+
* @throws {GraphExecutionError} with `GRAPH_EXECUTION_BACKEND_NOT_REGISTERED`
|
|
267
|
+
* for an unknown flavour, or `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` when the
|
|
268
|
+
* backend declares no listing support.
|
|
269
|
+
*/
|
|
270
|
+
listEngineWorkflows(flavour: string, ...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
271
|
+
/**
|
|
272
|
+
* Looks up a single canonical workflow document on a *specific* registered
|
|
273
|
+
* backend, resolved by flavour. Flavour-scoped counterpart of
|
|
274
|
+
* {@link getWorkflow} with the same capability gate and error code.
|
|
275
|
+
*
|
|
276
|
+
* @param flavour - The registered backend flavour (allowlisted engine id).
|
|
277
|
+
* @param workflowId - The canonical workflow id to read.
|
|
278
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
279
|
+
* @returns The canonical workflow document.
|
|
280
|
+
* @throws {GraphExecutionError} with `GRAPH_EXECUTION_BACKEND_NOT_REGISTERED`
|
|
281
|
+
* for an unknown flavour, or `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` when the
|
|
282
|
+
* backend declares no lookup support.
|
|
283
|
+
*/
|
|
284
|
+
getEngineWorkflow(flavour: string, workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
285
|
+
/** Human-readable name of the active backend, for diagnostics. */
|
|
286
|
+
private get backendName();
|
|
287
|
+
/**
|
|
288
|
+
* SAA-193 C1 fail-closed gate. A non-local backend must not launch a
|
|
289
|
+
* workflow carrying any code-mode surface unless it declares
|
|
290
|
+
* `codeMode: "hostSide"` and the facade has a configured sandbox evaluator.
|
|
291
|
+
* Local backends are not gated: their code-mode surfaces fail naturally
|
|
292
|
+
* through the existing per-surface `GRAPH_CODE_SANDBOX_NOT_CONFIGURED` path.
|
|
293
|
+
*/
|
|
294
|
+
private assertCodeModeSupported;
|
|
181
295
|
/**
|
|
182
296
|
* Pins a node and its upstream dependencies after a completed run.
|
|
183
297
|
*
|
|
@@ -202,139 +316,10 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
202
316
|
* Fills unprovided workflow inputs with their declared port defaults.
|
|
203
317
|
*/
|
|
204
318
|
private withWorkflowInputDefaults;
|
|
205
|
-
/**
|
|
206
|
-
* Executes a layer of nodes with the configured concurrency.
|
|
207
|
-
*/
|
|
208
|
-
private executeLayer;
|
|
209
|
-
/**
|
|
210
|
-
* Executes a single node, honouring disabled-node semantics (§4.9).
|
|
211
|
-
*/
|
|
212
|
-
private executeNode;
|
|
213
|
-
/**
|
|
214
|
-
* Resolves whether a plan node is activated for execution under the
|
|
215
|
-
* DECAF-50 §4.9 branch semantics. A node with no incoming data edges is
|
|
216
|
-
* a root/source node and always runs. A node fed by one or more data
|
|
217
|
-
* edges runs only when at least one of those edges was activated by a
|
|
218
|
-
* routed upstream output port — a branch the upstream switch (or any
|
|
219
|
-
* partial-output node) did not select leaves its downstream edges
|
|
220
|
-
* unactivated, so the branch is never executed. Workflow-boundary edges
|
|
221
|
-
* are active from the start because workflow inputs are seeded before
|
|
222
|
-
* execution begins.
|
|
223
|
-
*/
|
|
224
|
-
private isNodeActivated;
|
|
225
|
-
/**
|
|
226
|
-
* Skips a node whose incoming data edges were all left unactivated by an
|
|
227
|
-
* upstream branch selection. The node is not executed and its outputs are
|
|
228
|
-
* never routed or collected into workflow outputs (DECAF-50 §4.9).
|
|
229
|
-
*/
|
|
230
|
-
private skipInactiveNode;
|
|
231
|
-
/**
|
|
232
|
-
* Applies the explicit disabled-node semantics (§4.9):
|
|
233
|
-
* `skip`, `passThroughFirstInput`, or `emitDefaults`, resolved from the
|
|
234
|
-
* instance metadata, document settings, and the default.
|
|
235
|
-
*/
|
|
236
|
-
private executeDisabledNode;
|
|
237
|
-
/**
|
|
238
|
-
* Invokes the node's catalogue-resolved executor (§4.9 request contract,
|
|
239
|
-
* post-cutover: every executor receives the full request with
|
|
240
|
-
* configuration and input data separated).
|
|
241
|
-
*/
|
|
242
|
-
private invokeExecutor;
|
|
243
|
-
/**
|
|
244
|
-
* Validates executor outputs against the effective output manifest
|
|
245
|
-
* (§4.9): unknown outputs are rejected by default; missing required
|
|
246
|
-
* outputs fail the node. Lenient transition manifests (legacy
|
|
247
|
-
* executor-only registrations) are exempt until cutover.
|
|
248
|
-
*/
|
|
249
|
-
private validateNodeOutputs;
|
|
250
|
-
/**
|
|
251
|
-
* Collects the resolved credential references for a node: credential-type
|
|
252
|
-
* parameter values plus the `credentials` record in instance metadata.
|
|
253
|
-
* Documents carry references only — secret material never enters requests.
|
|
254
|
-
*/
|
|
255
|
-
private collectCredentials;
|
|
256
|
-
/**
|
|
257
|
-
* Resolves a node's input values from routed data edges, literal bindings,
|
|
258
|
-
* allowed expression bindings, and manifest port defaults (§4.9).
|
|
259
|
-
*
|
|
260
|
-
* When multiple edges target the same port, their values are spread into the
|
|
261
|
-
* top-level inputs keyed by each edge's `sourcePort`. This allows multiple
|
|
262
|
-
* workflow input badges to connect to a single port (e.g. the Code node's
|
|
263
|
-
* `data` port) and have all values accessible directly as
|
|
264
|
-
* `$input.{sourcePort}` (e.g. `$input.count`, `$input.text`).
|
|
265
|
-
*/
|
|
266
|
-
private resolveNodeInputs;
|
|
267
|
-
/**
|
|
268
|
-
* Resolves a node's persisted parameters at execution time, evaluating any
|
|
269
|
-
* `GraphValueTemplate` user property through the code-evaluator VM and
|
|
270
|
-
* leaving straight literal values unchanged.
|
|
271
|
-
*/
|
|
272
|
-
private resolveNodeParameters;
|
|
273
|
-
/**
|
|
274
|
-
* Evaluates a persisted `GraphValueTemplate` with the pluggable
|
|
275
|
-
* {@link CodeSandboxEvaluator} (DECAF-32 §22.4) — no new evaluator.
|
|
276
|
-
* `expression` mode evaluates the body directly; `template` mode compiles its
|
|
277
|
-
* `{{ ... }}` placeholders into a JavaScript template literal evaluated in
|
|
278
|
-
* the same sandbox, so both modes share the code-evaluator VM.
|
|
279
|
-
*/
|
|
280
|
-
private evaluateValueTemplate;
|
|
281
|
-
/**
|
|
282
|
-
* Evaluates an expression binding with the EXISTING allowed-expression
|
|
283
|
-
* machinery only (the pluggable {@link CodeSandboxEvaluator}, DECAF-32
|
|
284
|
-
* §22.4) — no new evaluator. The expression sees the already-routed input
|
|
285
|
-
* values as `$input` and the run metadata as context.
|
|
286
|
-
*/
|
|
287
|
-
private evaluateExpressionBinding;
|
|
288
|
-
/**
|
|
289
|
-
* Attempts to read a pinned value for the node. Returns the cached outputs
|
|
290
|
-
* when a valid pinned value exists, or `undefined` to proceed with normal
|
|
291
|
-
* execution.
|
|
292
|
-
*/
|
|
293
|
-
private tryPinnedValue;
|
|
294
|
-
/**
|
|
295
|
-
* Recursively computes fingerprints for all upstream dependencies of a node
|
|
296
|
-
* using the results already accumulated in the frame.
|
|
297
|
-
*/
|
|
298
|
-
private computeDependencyFingerprints;
|
|
299
|
-
/**
|
|
300
|
-
* Routes a node's outputs to downstream inputs and workflow outputs along
|
|
301
|
-
* data edges (connection edges are structural and never route values).
|
|
302
|
-
*
|
|
303
|
-
* An edge is traversed only when the source node actually emitted the
|
|
304
|
-
* edge's `sourcePort` (DECAF-50 §4.9 branch semantics). A node that
|
|
305
|
-
* emitted a subset of its declared outputs — e.g. a switch that selected
|
|
306
|
-
* one case — therefore activates only the downstream branch edges of the
|
|
307
|
-
* emitted ports; unselected branch edges are left unactivated, so their
|
|
308
|
-
* downstream nodes are skipped and never contribute to workflow outputs.
|
|
309
|
-
* Emitting an output port explicitly with `undefined` still counts as
|
|
310
|
-
* activated (the port was produced by the executor).
|
|
311
|
-
*/
|
|
312
|
-
private routeOutgoingEdges;
|
|
313
|
-
/**
|
|
314
|
-
* Emits an event, records it in the frame, and dispatches to observers.
|
|
315
|
-
*/
|
|
316
|
-
private emitEvent;
|
|
317
|
-
/**
|
|
318
|
-
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
319
|
-
* visual state for the node. Rides the existing Observable pipeline; no
|
|
320
|
-
* second out-of-band channel.
|
|
321
|
-
*/
|
|
322
|
-
private emitNodeStateChanged;
|
|
323
|
-
/**
|
|
324
|
-
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
325
|
-
* visual state for a routed edge.
|
|
326
|
-
*/
|
|
327
|
-
private emitEdgeStateChanged;
|
|
328
319
|
/**
|
|
329
320
|
* Merges default options with the given options.
|
|
330
321
|
*/
|
|
331
322
|
private mergeOptions;
|
|
332
|
-
/**
|
|
333
|
-
* Resolves the effective loop-iteration ceilings for a run. A node-level
|
|
334
|
-
* `maxIterations` can never exceed these; loop executors read them from the
|
|
335
|
-
* node context.
|
|
336
|
-
*/
|
|
337
|
-
private executionLimits;
|
|
338
323
|
private assertNotAborted;
|
|
339
324
|
/**
|
|
340
325
|
* Generates a cryptographically random run id. `crypto.randomUUID` is always
|
|
@@ -345,8 +330,4 @@ export declare class GraphExecutionEngine extends ClientBasedService<GraphExecut
|
|
|
345
330
|
* @throws {GraphExecutionError} when `crypto.randomUUID` is unavailable.
|
|
346
331
|
*/
|
|
347
332
|
private generateRunId;
|
|
348
|
-
/**
|
|
349
|
-
* Converts an error into a serialized payload.
|
|
350
|
-
*/
|
|
351
|
-
private toErrorPayload;
|
|
352
333
|
}
|