@decaf-ts/as-graph 0.2.1 → 0.5.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 +274 -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/DagsterGraphQLClient.cjs +738 -0
- package/lib/cjs/dagster/DagsterGraphQLClient.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 +33 -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/GraphBackendHost.cjs +146 -0
- package/lib/cjs/nest/graph/GraphBackendHost.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 +31 -2
- package/lib/cjs/nest/graph/GraphExecutionModule.cjs.map +1 -1
- package/lib/cjs/nest/graph/index.cjs +4 -0
- package/lib/cjs/nest/graph/index.cjs.map +1 -1
- package/lib/cjs/nest/graph/main.cjs +139 -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/DagsterGraphQLClient.js +733 -0
- package/lib/esm/dagster/DagsterGraphQLClient.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 +16 -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/GraphBackendHost.js +138 -0
- package/lib/esm/nest/graph/GraphBackendHost.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 +31 -2
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/index.js +4 -0
- package/lib/esm/nest/graph/index.js.map +1 -1
- package/lib/esm/nest/graph/main.js +103 -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/DagsterGraphQLClient.d.cts +231 -0
- package/lib/types/dagster/DagsterGraphQLClient.d.mts +231 -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 +15 -0
- package/lib/types/dagster/index.d.mts +15 -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 +86 -0
- package/lib/types/mastra/MastraCapabilities.d.mts +86 -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/GraphBackendHost.d.cts +100 -0
- package/lib/types/nest/graph/GraphBackendHost.d.mts +100 -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 +20 -0
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +20 -0
- package/lib/types/nest/graph/index.d.cts +4 -0
- package/lib/types/nest/graph/index.d.mts +4 -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 +55 -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
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterGraphQLClient
|
|
3
|
+
* @summary Real, read-only Dagster GraphQL client implementing the driver's
|
|
4
|
+
* `DagsterClient` port (SAA-306, SAA-706).
|
|
5
|
+
* @description A thin transport that implements the production `DagsterClient`
|
|
6
|
+
* port against a real `dagster-webserver` GraphQL endpoint. It is the only piece
|
|
7
|
+
* of the host that talks to Dagster, so a bootable Dagster host (see
|
|
8
|
+
* `@decaf-ts/as-graph/nest`) can list and inspect an already-deployed deployment.
|
|
9
|
+
* It exposes **no authoring method**: it
|
|
10
|
+
* never emits Python and never registers a job/op. It does implement the port's
|
|
11
|
+
* gated execution surface (`launchRun` of an already-deployed job and
|
|
12
|
+
* `replayRun` of an existing run via Dagster's `launchRunReexecution`), exactly as
|
|
13
|
+
* a host would wire its own transport; the production driver only calls those when
|
|
14
|
+
* its explicit `executionEnabled` gate is on.
|
|
15
|
+
*
|
|
16
|
+
* The client maps the raw GraphQL event vocabulary onto the driver's documented
|
|
17
|
+
* `DagsterEventRecord` contract. Dagster emits far more step-scoped telemetry
|
|
18
|
+
* (`STEP_WORKER_STARTING`, `RESOURCE_INIT_STARTED`, `LOADED_INPUT`, ...) than
|
|
19
|
+
* the canonical event map the driver consumes; those non-graph-transition events
|
|
20
|
+
* are engine telemetry and are intentionally not forwarded, matching the driver's
|
|
21
|
+
* allowlist posture. Only the documented graph-transition event types
|
|
22
|
+
* (`STEP_START`/`STEP_SUCCESS`/`STEP_FAILURE`/`STEP_SKIPPED`/`STEP_OUTPUT` and
|
|
23
|
+
* the run-level terminal events) are surfaced.
|
|
24
|
+
*/
|
|
25
|
+
import type { DagsterClient, DagsterEventRecord, DagsterJobRecord, DagsterJobSummary, DagsterLaunchedRun, DagsterLaunchRunRequest, DagsterReplayRunRequest, DagsterRunRecord, DagsterRunSubscription, DagsterRunSubscriptionOptions } from "./DagsterTypes.d.mts";
|
|
26
|
+
/**
|
|
27
|
+
* The fetch implementation a {@link DagsterGraphQLClient} transport is constructed
|
|
28
|
+
* with: the global `fetch` signature. It is named so the type is expressible in
|
|
29
|
+
* JSDoc — a bare `typeof fetch` member type is not parseable — and so a host can
|
|
30
|
+
* inject a stub in tests without changing the transport.
|
|
31
|
+
*/
|
|
32
|
+
export type FetchImpl = typeof fetch;
|
|
33
|
+
/** Options for constructing a {@link DagsterGraphQLClient}. */
|
|
34
|
+
export interface DagsterGraphQLClientOptions {
|
|
35
|
+
/** Absolute GraphQL endpoint URL, e.g. `http://127.0.0.1:3300/graphql`. */
|
|
36
|
+
url: string;
|
|
37
|
+
/** Fetch implementation; defaults to the global `fetch`. */
|
|
38
|
+
fetchImpl?: FetchImpl;
|
|
39
|
+
/** Per-request timeout in milliseconds. Defaults to `15000`. */
|
|
40
|
+
requestTimeoutMs?: number;
|
|
41
|
+
/** Repository (code location) selector name. Defaults to `__repository__`. */
|
|
42
|
+
repositoryName?: string;
|
|
43
|
+
/** Repository location name. Defaults to `definitions.py`. */
|
|
44
|
+
repositoryLocationName?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Real, read-only Dagster GraphQL client implementing the production
|
|
48
|
+
* `DagsterClient` port. It never authors a workflow or launches a run.
|
|
49
|
+
*/
|
|
50
|
+
export declare class DagsterGraphQLClient implements DagsterClient {
|
|
51
|
+
private readonly url;
|
|
52
|
+
private readonly fetchImpl;
|
|
53
|
+
private readonly requestTimeoutMs;
|
|
54
|
+
private readonly repositoryName;
|
|
55
|
+
private readonly repositoryLocationName;
|
|
56
|
+
/**
|
|
57
|
+
* @param options - Endpoint URL, fetch implementation, timeout, and repository
|
|
58
|
+
* selector.
|
|
59
|
+
*/
|
|
60
|
+
constructor(options: DagsterGraphQLClientOptions);
|
|
61
|
+
/**
|
|
62
|
+
* Sends a GraphQL operation and unwraps the `data` envelope, failing loudly
|
|
63
|
+
* on transport, HTTP, or GraphQL errors.
|
|
64
|
+
*
|
|
65
|
+
* @typeParam T - The expected `data` shape.
|
|
66
|
+
* @param query - The GraphQL document.
|
|
67
|
+
* @param variables - Optional operation variables.
|
|
68
|
+
* @param signal - Optional caller signal composed with the request timeout.
|
|
69
|
+
* @returns The response `data`.
|
|
70
|
+
*/
|
|
71
|
+
private request;
|
|
72
|
+
/**
|
|
73
|
+
* Lists every already-deployed Dagster job across the served repositories.
|
|
74
|
+
*
|
|
75
|
+
* @returns The deployed job summaries.
|
|
76
|
+
*/
|
|
77
|
+
listJobs(): Promise<DagsterJobSummary[]>;
|
|
78
|
+
/**
|
|
79
|
+
* Reads a single already-deployed Dagster job, including its real graph
|
|
80
|
+
* structure (ops, dependencies, asset keys, schedules, sensors).
|
|
81
|
+
*
|
|
82
|
+
* @param jobName - The Dagster job name.
|
|
83
|
+
* @returns The inspected job record.
|
|
84
|
+
*/
|
|
85
|
+
getJob(jobName: string): Promise<DagsterJobRecord>;
|
|
86
|
+
/**
|
|
87
|
+
* Replays the recorded event stream of an EXISTING Dagster run and invokes the
|
|
88
|
+
* handler for every documented graph-transition event. The client never launches
|
|
89
|
+
* a run; it only reads a run that already exists.
|
|
90
|
+
*
|
|
91
|
+
* @param runId - The Dagster run id.
|
|
92
|
+
* @param handler - The per-event callback.
|
|
93
|
+
* @param options - Optional signal/event/page bounds.
|
|
94
|
+
* @returns A subscription handle.
|
|
95
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_OBSERVE_ABORTED` when the signal
|
|
96
|
+
* is already aborted before or during the event replay,
|
|
97
|
+
* `GRAPH_DAGSTER_PAGE_LIMIT_EXCEEDED` when the page cap is hit, or
|
|
98
|
+
* `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED` when the event cap is hit.
|
|
99
|
+
*/
|
|
100
|
+
subscribeRun(runId: string, handler: (event: DagsterEventRecord) => void, options?: DagsterRunSubscriptionOptions): Promise<DagsterRunSubscription>;
|
|
101
|
+
/**
|
|
102
|
+
* Terminates an EXISTING Dagster run through the GraphQL mutation.
|
|
103
|
+
*
|
|
104
|
+
* @param runId - The Dagster run id.
|
|
105
|
+
* @param reason - Optional termination reason (unused by Dagster).
|
|
106
|
+
*/
|
|
107
|
+
terminateRun(runId: string, reason?: string): Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Launches a run of an ALREADY-DEPLOYED Dagster job through the real GraphQL
|
|
110
|
+
* `launchRun` mutation. The job must already exist in the deployment; no job or
|
|
111
|
+
* op is authored and no Python is emitted.
|
|
112
|
+
*
|
|
113
|
+
* @param request - The job name, optional raw run config, and optional tags.
|
|
114
|
+
* @returns The launched run's id and initial status.
|
|
115
|
+
*/
|
|
116
|
+
launchRun(request: DagsterLaunchRunRequest): Promise<DagsterLaunchedRun>;
|
|
117
|
+
/**
|
|
118
|
+
* Re-executes an EXISTING Dagster run from its run id through the real GraphQL
|
|
119
|
+
* `launchRunReexecution` mutation (Dagster's re-execution surface). The parent
|
|
120
|
+
* run must already exist; no job or op is authored and no Python is emitted.
|
|
121
|
+
*
|
|
122
|
+
* @param request - The parent run id, its job name, and optional tags.
|
|
123
|
+
* @returns The re-executed run's id and initial status.
|
|
124
|
+
*/
|
|
125
|
+
replayRun(request: DagsterReplayRunRequest): Promise<DagsterLaunchedRun>;
|
|
126
|
+
/**
|
|
127
|
+
* Builds the GraphQL `ExecutionParams` for a launch/re-execution: the job
|
|
128
|
+
* selector, optional raw run config, and optional run tags.
|
|
129
|
+
*
|
|
130
|
+
* @param jobName - The already-deployed job name.
|
|
131
|
+
* @param runConfig - Optional raw Dagster run config (forwarded verbatim).
|
|
132
|
+
* @param tags - Optional run tags.
|
|
133
|
+
* @returns The `ExecutionParams` input object.
|
|
134
|
+
*/
|
|
135
|
+
private executionParams;
|
|
136
|
+
/**
|
|
137
|
+
* Unwraps a launch/re-execution result union into a run handle, failing loudly
|
|
138
|
+
* on a launch error.
|
|
139
|
+
*
|
|
140
|
+
* @param result - The raw launch result union.
|
|
141
|
+
* @param jobName - The job name, for error context.
|
|
142
|
+
* @returns The launched run's id and initial status.
|
|
143
|
+
*/
|
|
144
|
+
private toLaunchedRun;
|
|
145
|
+
/**
|
|
146
|
+
* Reads an EXISTING Dagster run's terminal record.
|
|
147
|
+
*
|
|
148
|
+
* @param runId - The Dagster run id.
|
|
149
|
+
* @returns The terminal run record.
|
|
150
|
+
*/
|
|
151
|
+
getRun(runId: string): Promise<DagsterRunRecord>;
|
|
152
|
+
/**
|
|
153
|
+
* Harness-only helper: lists the runs for a job (or every run when no job name
|
|
154
|
+
* is given) with their raw Dagster status. Not part of the `DagsterClient` port;
|
|
155
|
+
* it exists so the suite can discover a pre-existing terminal run (e.g. the
|
|
156
|
+
* `etl_pipeline` run materialized at startup) without launching one, and can
|
|
157
|
+
* count runs before/after an operation to prove no run was created.
|
|
158
|
+
*
|
|
159
|
+
* @param jobName - Optional Dagster job name filter.
|
|
160
|
+
* @returns The runs, with raw Dagster run status.
|
|
161
|
+
*/
|
|
162
|
+
listRuns(jobName?: string): Promise<{
|
|
163
|
+
runId: string;
|
|
164
|
+
jobName: string;
|
|
165
|
+
status: string;
|
|
166
|
+
}[]>;
|
|
167
|
+
/**
|
|
168
|
+
* Harness-only helper: lists the ids of runs for a job (or every run when no
|
|
169
|
+
* job name is given). Not part of the `DagsterClient` port; it exists so the
|
|
170
|
+
* suite can discover a pre-existing run without launching one.
|
|
171
|
+
*
|
|
172
|
+
* @param jobName - Optional Dagster job name filter.
|
|
173
|
+
* @returns The run ids.
|
|
174
|
+
*/
|
|
175
|
+
listRunIds(jobName?: string): Promise<string[]>;
|
|
176
|
+
/** Disposes the client; the fetch transport holds no resources. */
|
|
177
|
+
dispose(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Paginates the run's recorded event stream, bounded by `maxPages` and
|
|
180
|
+
* `maxEvents` so a gateway whose `eventConnection` never reports
|
|
181
|
+
* `hasMore: false` cannot page or buffer without limit.
|
|
182
|
+
*
|
|
183
|
+
* @param runId - The Dagster run id.
|
|
184
|
+
* @param options - Optional signal/event/page bounds.
|
|
185
|
+
* @returns The raw events, in order.
|
|
186
|
+
* @throws {GraphExecutionError} `GRAPH_DAGSTER_PAGE_LIMIT_EXCEEDED` when the
|
|
187
|
+
* page cap is hit, or `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED` when the event cap
|
|
188
|
+
* is hit.
|
|
189
|
+
*/
|
|
190
|
+
private fetchRunEvents;
|
|
191
|
+
/**
|
|
192
|
+
* Maps a raw Dagster event onto the driver's documented `DagsterEventRecord`
|
|
193
|
+
* contract, filtering out non-graph-transition telemetry.
|
|
194
|
+
*
|
|
195
|
+
* @param event - The raw event.
|
|
196
|
+
* @returns The driver event record, or `undefined` when the event is engine
|
|
197
|
+
* telemetry the read-only driver does not consume.
|
|
198
|
+
*/
|
|
199
|
+
private toEventRecord;
|
|
200
|
+
/**
|
|
201
|
+
* Maps a raw `Run` onto the driver's `DagsterRunRecord` contract.
|
|
202
|
+
*
|
|
203
|
+
* @param run - The raw run.
|
|
204
|
+
* @returns The driver run record.
|
|
205
|
+
*/
|
|
206
|
+
private toRunRecord;
|
|
207
|
+
/**
|
|
208
|
+
* Maps a Dagster `RunStatus` onto the driver's terminal run status.
|
|
209
|
+
*
|
|
210
|
+
* @param status - The raw Dagster run status.
|
|
211
|
+
* @returns The driver run status.
|
|
212
|
+
*/
|
|
213
|
+
private toRunStatus;
|
|
214
|
+
/**
|
|
215
|
+
* Maps a raw job plus its repository context onto the driver's
|
|
216
|
+
* `DagsterJobRecord` contract.
|
|
217
|
+
*
|
|
218
|
+
* @param job - The raw job.
|
|
219
|
+
* @param repository - The raw repository the job belongs to.
|
|
220
|
+
* @returns The inspected job record.
|
|
221
|
+
*/
|
|
222
|
+
private toJobRecord;
|
|
223
|
+
/**
|
|
224
|
+
* Resolves the asset keys a job produces from the repository's asset nodes.
|
|
225
|
+
*
|
|
226
|
+
* @param jobName - The Dagster job name.
|
|
227
|
+
* @param assetNodes - The repository asset nodes.
|
|
228
|
+
* @returns The dotted asset keys.
|
|
229
|
+
*/
|
|
230
|
+
private assetKeysFor;
|
|
231
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterResultMapper
|
|
3
|
+
* @summary Maps a terminal Dagster run onto an engine-agnostic result (SAA-195).
|
|
4
|
+
* @description Assembles the canonical {@link GraphExecutionResult} from the
|
|
5
|
+
* terminal Dagster run record and the node results the event bridge collected.
|
|
6
|
+
* Error payloads are frontend-safe: raw Dagster details never reach clients.
|
|
7
|
+
*/
|
|
8
|
+
import type { GraphExecutionEvent, GraphWorkflowDocument } from "../shared/graph/index.d.cts";
|
|
9
|
+
import type { GraphExecutionErrorPayload } from "../shared/graph/index.d.cts";
|
|
10
|
+
import type { GraphExecutionOptions, GraphExecutionResult, GraphExecutionValues, GraphNodeExecutionResult } from "../engine/types.d.cts";
|
|
11
|
+
import type { DagsterRunRecord } from "./DagsterTypes.d.cts";
|
|
12
|
+
/** Input to {@link DagsterResultMapper.map}. */
|
|
13
|
+
export interface DagsterResultMapperInput {
|
|
14
|
+
/** Dagster run id. */
|
|
15
|
+
runId: string;
|
|
16
|
+
/** Canonical document of the inspected job. */
|
|
17
|
+
document: GraphWorkflowDocument;
|
|
18
|
+
/** The run's workflow input values. */
|
|
19
|
+
inputs: GraphExecutionValues;
|
|
20
|
+
/** Effective execution options. */
|
|
21
|
+
options: GraphExecutionOptions;
|
|
22
|
+
/** The terminal Dagster run record. */
|
|
23
|
+
record: DagsterRunRecord;
|
|
24
|
+
/** Node results collected by the event bridge. */
|
|
25
|
+
nodeResults: Record<string, GraphNodeExecutionResult>;
|
|
26
|
+
/** Events collected by the event bridge. */
|
|
27
|
+
events: GraphExecutionEvent[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Maps terminal Dagster run records onto canonical execution results.
|
|
31
|
+
*/
|
|
32
|
+
export declare class DagsterResultMapper {
|
|
33
|
+
/**
|
|
34
|
+
* Maps a terminal run record and collected node results to a
|
|
35
|
+
* {@link GraphExecutionResult}.
|
|
36
|
+
*
|
|
37
|
+
* @param input - The mapping input.
|
|
38
|
+
* @returns The canonical execution result.
|
|
39
|
+
*/
|
|
40
|
+
map(input: DagsterResultMapperInput): GraphExecutionResult;
|
|
41
|
+
/**
|
|
42
|
+
* Maps a terminal Dagster run status to an engine-agnostic status.
|
|
43
|
+
*
|
|
44
|
+
* @param record - The terminal run record.
|
|
45
|
+
* @returns The engine-agnostic status.
|
|
46
|
+
*/
|
|
47
|
+
private statusOf;
|
|
48
|
+
}
|
|
49
|
+
/** Re-exported for typing clarity. */
|
|
50
|
+
export type { GraphExecutionErrorPayload };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterResultMapper
|
|
3
|
+
* @summary Maps a terminal Dagster run onto an engine-agnostic result (SAA-195).
|
|
4
|
+
* @description Assembles the canonical {@link GraphExecutionResult} from the
|
|
5
|
+
* terminal Dagster run record and the node results the event bridge collected.
|
|
6
|
+
* Error payloads are frontend-safe: raw Dagster details never reach clients.
|
|
7
|
+
*/
|
|
8
|
+
import type { GraphExecutionEvent, GraphWorkflowDocument } from "../shared/graph/index.d.mts";
|
|
9
|
+
import type { GraphExecutionErrorPayload } from "../shared/graph/index.d.mts";
|
|
10
|
+
import type { GraphExecutionOptions, GraphExecutionResult, GraphExecutionValues, GraphNodeExecutionResult } from "../engine/types.d.mts";
|
|
11
|
+
import type { DagsterRunRecord } from "./DagsterTypes.d.mts";
|
|
12
|
+
/** Input to {@link DagsterResultMapper.map}. */
|
|
13
|
+
export interface DagsterResultMapperInput {
|
|
14
|
+
/** Dagster run id. */
|
|
15
|
+
runId: string;
|
|
16
|
+
/** Canonical document of the inspected job. */
|
|
17
|
+
document: GraphWorkflowDocument;
|
|
18
|
+
/** The run's workflow input values. */
|
|
19
|
+
inputs: GraphExecutionValues;
|
|
20
|
+
/** Effective execution options. */
|
|
21
|
+
options: GraphExecutionOptions;
|
|
22
|
+
/** The terminal Dagster run record. */
|
|
23
|
+
record: DagsterRunRecord;
|
|
24
|
+
/** Node results collected by the event bridge. */
|
|
25
|
+
nodeResults: Record<string, GraphNodeExecutionResult>;
|
|
26
|
+
/** Events collected by the event bridge. */
|
|
27
|
+
events: GraphExecutionEvent[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Maps terminal Dagster run records onto canonical execution results.
|
|
31
|
+
*/
|
|
32
|
+
export declare class DagsterResultMapper {
|
|
33
|
+
/**
|
|
34
|
+
* Maps a terminal run record and collected node results to a
|
|
35
|
+
* {@link GraphExecutionResult}.
|
|
36
|
+
*
|
|
37
|
+
* @param input - The mapping input.
|
|
38
|
+
* @returns The canonical execution result.
|
|
39
|
+
*/
|
|
40
|
+
map(input: DagsterResultMapperInput): GraphExecutionResult;
|
|
41
|
+
/**
|
|
42
|
+
* Maps a terminal Dagster run status to an engine-agnostic status.
|
|
43
|
+
*
|
|
44
|
+
* @param record - The terminal run record.
|
|
45
|
+
* @returns The engine-agnostic status.
|
|
46
|
+
*/
|
|
47
|
+
private statusOf;
|
|
48
|
+
}
|
|
49
|
+
/** Re-exported for typing clarity. */
|
|
50
|
+
export type { GraphExecutionErrorPayload };
|
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/dagster/DagsterTypes
|
|
3
|
+
* @summary Capability, inspection, run, execution, and client-port types for the
|
|
4
|
+
* Dagster backend.
|
|
5
|
+
* @description The Dagster driver never authors workflows and never generates,
|
|
6
|
+
* embeds, or emits Python source. It may list, look up, inspect, and surface
|
|
7
|
+
* ALREADY-EXISTING Dagster workflows through the host-injected
|
|
8
|
+
* {@link DagsterClient} port, and — only behind the explicit
|
|
9
|
+
* {@link DagsterGraphExecutionBackendConfig.executionEnabled} gate — launch a run
|
|
10
|
+
* of an already-deployed job and re-execute an existing run. The wrapper never
|
|
11
|
+
* bundles a phantom JavaScript Dagster runtime.
|
|
12
|
+
*/
|
|
13
|
+
import type { GraphExecutionEventSink } from "../engine/execution/GraphExecutionBackend.d.cts";
|
|
14
|
+
/**
|
|
15
|
+
* A capability verdict row in the exported Dagster capability table.
|
|
16
|
+
*/
|
|
17
|
+
export type DagsterCapabilityVerdict = "supported" | "not_supported" | "extension_point";
|
|
18
|
+
/**
|
|
19
|
+
* A single row of the exported Dagster capability table.
|
|
20
|
+
*/
|
|
21
|
+
export interface DagsterCapabilityRow {
|
|
22
|
+
/** The engine feature being described. */
|
|
23
|
+
feature: string;
|
|
24
|
+
/** Whether Dagster supports it natively, not at all, or via an extension point. */
|
|
25
|
+
verdict: DagsterCapabilityVerdict;
|
|
26
|
+
/** Human-readable detail for the verdict. */
|
|
27
|
+
detail: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A raw Dagster event record surfaced by the client port.
|
|
31
|
+
*/
|
|
32
|
+
export interface DagsterEventRecord {
|
|
33
|
+
/** Raw Dagster event type (e.g. `STEP_START`, `STEP_SUCCESS`). */
|
|
34
|
+
type: string;
|
|
35
|
+
/** Dagster step key; maps to a canonical node id via the inspected job map. */
|
|
36
|
+
stepKey?: string;
|
|
37
|
+
/** ISO-8601 event timestamp. */
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
/** Raw event payload (outputs, errors, ...). */
|
|
40
|
+
payload?: Record<string, unknown>;
|
|
41
|
+
/** Raw human-readable message. */
|
|
42
|
+
message?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* The raw Dagster run-status vocabulary the driver may receive. Only `success`,
|
|
46
|
+
* `failure`, and `canceled` are terminal; `started` and the real Dagster pending
|
|
47
|
+
* statuses (`QUEUED`/`STARTING`) are non-terminal and must be polled to a terminal
|
|
48
|
+
* state, a caller abort, or a timeout (C5 fail-closed).
|
|
49
|
+
*/
|
|
50
|
+
export type DagsterRunStatus = "started" | "success" | "failure" | "canceled" | "QUEUED" | "STARTING";
|
|
51
|
+
/**
|
|
52
|
+
* A Dagster run record. Carries the run's status and, when the port exposes it,
|
|
53
|
+
* the name of the deployed job that owns the run (`jobName`/`pipelineName`), so the
|
|
54
|
+
* driver can bind a run to the workflow it belongs to before replaying it (C1).
|
|
55
|
+
*/
|
|
56
|
+
export interface DagsterRunRecord {
|
|
57
|
+
/** Dagster run id. */
|
|
58
|
+
runId: string;
|
|
59
|
+
/** Run status. Only `success`/`failure`/`canceled` are terminal. */
|
|
60
|
+
status: DagsterRunStatus;
|
|
61
|
+
/** Workflow output values, when the client exposes them. */
|
|
62
|
+
outputs?: Record<string, unknown>;
|
|
63
|
+
/** Run failure, when the run failed. */
|
|
64
|
+
error?: {
|
|
65
|
+
message: string;
|
|
66
|
+
code?: string;
|
|
67
|
+
};
|
|
68
|
+
/** Run start timestamp. */
|
|
69
|
+
startedAt?: string;
|
|
70
|
+
/** Run finish timestamp. */
|
|
71
|
+
finishedAt?: string;
|
|
72
|
+
/** Name of the deployed job that owns the run, when the port exposes it. */
|
|
73
|
+
jobName?: string;
|
|
74
|
+
/** Legacy alias of {@link DagsterRunRecord.jobName}, when the port exposes it. */
|
|
75
|
+
pipelineName?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The handle a client port returns when it launches or re-executes a run. Carries
|
|
79
|
+
* the new Dagster run id and its (initial or terminal) status; the driver then
|
|
80
|
+
* observes the run through the existing event bridge.
|
|
81
|
+
*/
|
|
82
|
+
export interface DagsterLaunchedRun {
|
|
83
|
+
/** Dagster run id of the launched/re-executed run. */
|
|
84
|
+
runId: string;
|
|
85
|
+
/**
|
|
86
|
+
* Run status reported by the launch; `started` for a fresh launch, but a real
|
|
87
|
+
* transport may report a pending `QUEUED`/`STARTING` status the driver then
|
|
88
|
+
* polls to terminal.
|
|
89
|
+
*/
|
|
90
|
+
status: DagsterRunStatus;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A request to launch a run of an ALREADY-DEPLOYED Dagster job. The driver only
|
|
94
|
+
* ever sends this behind the explicit execution gate; it never authors a job, op,
|
|
95
|
+
* or Python source — it asks the host transport to launch a job the deployment
|
|
96
|
+
* already defines.
|
|
97
|
+
*/
|
|
98
|
+
export interface DagsterLaunchRunRequest {
|
|
99
|
+
/** Name of the already-deployed job to launch. */
|
|
100
|
+
jobName: string;
|
|
101
|
+
/**
|
|
102
|
+
* Optional raw Dagster run configuration (the job's `runConfigData`). The host
|
|
103
|
+
* transport forwards it verbatim; the driver never synthesizes it.
|
|
104
|
+
*/
|
|
105
|
+
runConfig?: Record<string, unknown>;
|
|
106
|
+
/** Optional run tags (merged by the host with any transport-owned tags). */
|
|
107
|
+
tags?: Record<string, string>;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* A request to re-execute (replay) an EXISTING Dagster run, sent to the host
|
|
111
|
+
* {@link DagsterClient} port. The host transport owns the mechanism: where the
|
|
112
|
+
* GraphQL surface exposes a re-execution mutation it re-executes from the run id,
|
|
113
|
+
* otherwise it re-launches the run's job with the run's original configuration.
|
|
114
|
+
* The driver never authors a job or Python source.
|
|
115
|
+
*/
|
|
116
|
+
export interface DagsterReplayRunRequest {
|
|
117
|
+
/** Dagster run id of the existing run to replay. */
|
|
118
|
+
dagsterRunId: string;
|
|
119
|
+
/** Optional name of the run's job, when the transport needs it to re-launch. */
|
|
120
|
+
jobName?: string;
|
|
121
|
+
/** Optional run tags (merged by the host with any transport-owned tags). */
|
|
122
|
+
tags?: Record<string, string>;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* A request to replay an EXISTING Dagster run through
|
|
126
|
+
* {@link DagsterGraphExecutionBackend.replayRun}. Carries the run identity, the
|
|
127
|
+
* workflow it belongs to, the facade-owned event sink, and the same observation
|
|
128
|
+
* bounds as {@link DagsterObserveRunRequest}. The driver delegates the actual
|
|
129
|
+
* re-execution to the host transport's `replayRun` and then observes the new run.
|
|
130
|
+
*/
|
|
131
|
+
export interface DagsterReplayExistingRunRequest {
|
|
132
|
+
/** Dagster run id of the existing run to replay. */
|
|
133
|
+
dagsterRunId: string;
|
|
134
|
+
/** Canonical workflow id (Dagster job name) the run belongs to. */
|
|
135
|
+
workflowId: string;
|
|
136
|
+
/** Facade-owned event sink the driver reports transitions through. */
|
|
137
|
+
events: GraphExecutionEventSink;
|
|
138
|
+
/** Canonical as-graph run id carried on emitted events; defaults to the new run id. */
|
|
139
|
+
graphRunId?: string;
|
|
140
|
+
/** Workflow input values carried onto the canonical result. */
|
|
141
|
+
inputs?: Record<string, unknown>;
|
|
142
|
+
/** Execution options metadata carried onto the canonical result. */
|
|
143
|
+
metadata?: Record<string, unknown>;
|
|
144
|
+
/** Caller cancellation signal, forwarded to the observation bridge. */
|
|
145
|
+
signal?: AbortSignal;
|
|
146
|
+
/** Hard cap on the number of events the bridge processes. */
|
|
147
|
+
maxEvents?: number;
|
|
148
|
+
/** Hard cap on the transport pagination depth. */
|
|
149
|
+
maxPages?: number;
|
|
150
|
+
/** Maximum time to await the terminal record. */
|
|
151
|
+
terminalTimeoutMs?: number;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* A subscription to a Dagster run's event stream.
|
|
155
|
+
*/
|
|
156
|
+
export interface DagsterRunSubscription {
|
|
157
|
+
/** Stops the subscription. */
|
|
158
|
+
unsubscribe: () => void | Promise<void>;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Bounds applied to a run-event subscription. The read-only driver passes these
|
|
162
|
+
* through to the host-injected {@link DagsterClient} so a wedged or hostile
|
|
163
|
+
* gateway cannot make the transport page or buffer without limit: `signal` cancels
|
|
164
|
+
* in-flight transport work, `maxEvents` caps the number of events replayed, and
|
|
165
|
+
* `maxPages` caps the pagination depth. Every field is optional so a host port that
|
|
166
|
+
* predates them keeps working.
|
|
167
|
+
*/
|
|
168
|
+
export interface DagsterRunSubscriptionOptions {
|
|
169
|
+
/** Cancels the subscription and any in-flight transport work. */
|
|
170
|
+
signal?: AbortSignal;
|
|
171
|
+
/** Hard cap on the number of events the transport replays. */
|
|
172
|
+
maxEvents?: number;
|
|
173
|
+
/** Hard cap on the number of pagination pages the transport fetches. */
|
|
174
|
+
maxPages?: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* A Dagster job summary surfaced by workflow listing.
|
|
178
|
+
*/
|
|
179
|
+
export interface DagsterJobSummary {
|
|
180
|
+
/** Job name. */
|
|
181
|
+
name: string;
|
|
182
|
+
/** Optional description. */
|
|
183
|
+
description?: string;
|
|
184
|
+
/** Optional last-update timestamp. */
|
|
185
|
+
updatedAt?: Date;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* One op/step of a deployed Dagster job, as exposed by the client port.
|
|
189
|
+
* `nodeId` and `kind` are optional because a deployment may not classify its ops;
|
|
190
|
+
* the driver falls back to the op `name` and {@link DAGSTER_DEFAULT_NODE_KIND}.
|
|
191
|
+
*/
|
|
192
|
+
export interface DagsterJobOp {
|
|
193
|
+
/** Dagster op/step name. */
|
|
194
|
+
name: string;
|
|
195
|
+
/** Canonical node id, when the deployment exposes one. */
|
|
196
|
+
nodeId?: string;
|
|
197
|
+
/** Canonical node kind, when the deployment exposes one. */
|
|
198
|
+
kind?: string;
|
|
199
|
+
/** Op input names, when the deployment exposes them. */
|
|
200
|
+
inputs?: string[];
|
|
201
|
+
/** Op output names, when the deployment exposes them. */
|
|
202
|
+
outputs?: string[];
|
|
203
|
+
/** Asset keys the op materializes, when the deployment exposes them. */
|
|
204
|
+
assetKeys?: string[];
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* A directed op dependency of a deployed Dagster job: `from` feeds `to`.
|
|
208
|
+
*/
|
|
209
|
+
export interface DagsterJobDependency {
|
|
210
|
+
/** Upstream op name. */
|
|
211
|
+
from: string;
|
|
212
|
+
/** Downstream op name. */
|
|
213
|
+
to: string;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* A schedule declared by a deployed Dagster job, when the deployment exposes it.
|
|
217
|
+
*/
|
|
218
|
+
export interface DagsterJobSchedule {
|
|
219
|
+
/** Schedule name. */
|
|
220
|
+
name: string;
|
|
221
|
+
/** Cron expression, when exposed. */
|
|
222
|
+
cron?: string;
|
|
223
|
+
/** IANA timezone, when exposed. */
|
|
224
|
+
timezone?: string;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* A sensor declared by a deployed Dagster job, when the deployment exposes it.
|
|
228
|
+
*/
|
|
229
|
+
export interface DagsterJobSensor {
|
|
230
|
+
/** Sensor name. */
|
|
231
|
+
name: string;
|
|
232
|
+
/** Sensor kind, when exposed. */
|
|
233
|
+
kind?: string;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* A deployed Dagster job record surfaced by workflow lookup. Carries the actual
|
|
237
|
+
* deployment structure the driver maps into the canonical document shape: the job
|
|
238
|
+
* name, graph/op structure, asset keys, and schedules/sensors where the client
|
|
239
|
+
* port exposes them. Every field is read-only inspection data — no op body, no
|
|
240
|
+
* Python source.
|
|
241
|
+
*/
|
|
242
|
+
export interface DagsterJobRecord {
|
|
243
|
+
/** Job name. */
|
|
244
|
+
name: string;
|
|
245
|
+
/** Optional description. */
|
|
246
|
+
description?: string;
|
|
247
|
+
/** Optional last-update timestamp. */
|
|
248
|
+
updatedAt?: Date;
|
|
249
|
+
/** Ops/steps of the job's graph, when the deployment exposes them. */
|
|
250
|
+
ops?: DagsterJobOp[];
|
|
251
|
+
/** Directed op dependencies, when the deployment exposes them. */
|
|
252
|
+
dependencies?: DagsterJobDependency[];
|
|
253
|
+
/** Asset keys the job reads/materializes, when the deployment exposes them. */
|
|
254
|
+
assetKeys?: string[];
|
|
255
|
+
/** Schedules attached to the job, when the deployment exposes them. */
|
|
256
|
+
schedules?: DagsterJobSchedule[];
|
|
257
|
+
/** Sensors attached to the job, when the deployment exposes them. */
|
|
258
|
+
sensors?: DagsterJobSensor[];
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Host-injected, read-only Dagster client port. Abstracts the GraphQL/REST
|
|
262
|
+
* transport so the wrapper stays a pure inspection + event-mapping layer and the
|
|
263
|
+
* host owns the Dagster deployment. Listing/lookup are required: the owner mandate
|
|
264
|
+
* makes reading already-existing workflows the driver's core responsibility.
|
|
265
|
+
*/
|
|
266
|
+
export interface DagsterClient {
|
|
267
|
+
/** Lists already-deployed Dagster jobs. */
|
|
268
|
+
listJobs(): Promise<DagsterJobSummary[]>;
|
|
269
|
+
/** Reads a single already-deployed Dagster job, including its graph structure. */
|
|
270
|
+
getJob(jobName: string): Promise<DagsterJobRecord>;
|
|
271
|
+
/** Subscribes to an EXISTING run's raw event stream. */
|
|
272
|
+
subscribeRun(runId: string, handler: (event: DagsterEventRecord) => void, options?: DagsterRunSubscriptionOptions): Promise<DagsterRunSubscription>;
|
|
273
|
+
/** Terminates an EXISTING run. */
|
|
274
|
+
terminateRun(runId: string, reason?: string): Promise<void>;
|
|
275
|
+
/** Reads an EXISTING run's terminal record. */
|
|
276
|
+
getRun(runId: string): Promise<DagsterRunRecord>;
|
|
277
|
+
/**
|
|
278
|
+
* Launches a run of an ALREADY-DEPLOYED job. Optional: a read-only host port
|
|
279
|
+
* omits it, and the driver then fails closed with
|
|
280
|
+
* `GRAPH_DAGSTER_EXECUTION_NOT_SUPPORTED`. Called only when the explicit
|
|
281
|
+
* execution gate is enabled.
|
|
282
|
+
*/
|
|
283
|
+
launchRun?(request: DagsterLaunchRunRequest): Promise<DagsterLaunchedRun>;
|
|
284
|
+
/**
|
|
285
|
+
* Re-executes (replays) an EXISTING run. Optional: a host without a
|
|
286
|
+
* re-execution surface omits it, and the driver then fails closed with
|
|
287
|
+
* `GRAPH_DAGSTER_REPLAY_NOT_SUPPORTED`. Called only when the explicit execution
|
|
288
|
+
* gate is enabled.
|
|
289
|
+
*/
|
|
290
|
+
replayRun?(request: DagsterReplayRunRequest): Promise<DagsterLaunchedRun>;
|
|
291
|
+
/** Disposes the client and its transport. */
|
|
292
|
+
dispose?(): void | Promise<void>;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Configuration for {@link DagsterGraphExecutionBackend}. The driver accepts no
|
|
296
|
+
* op resolver: it never authors ops. Execution/replay of EXISTING workflows is
|
|
297
|
+
* opt-in and defaults off.
|
|
298
|
+
*/
|
|
299
|
+
export interface DagsterGraphExecutionBackendConfig extends Record<string, unknown> {
|
|
300
|
+
/** Host-injected Dagster client port (read surface always; launch/replay when enabled). */
|
|
301
|
+
client: DagsterClient;
|
|
302
|
+
/** Optional host-supplied default run tags. */
|
|
303
|
+
tags?: Record<string, string>;
|
|
304
|
+
/**
|
|
305
|
+
* Explicit opt-in for executing (launching a run of an already-deployed job)
|
|
306
|
+
* and replaying (re-executing an existing run) through the client port. Defaults
|
|
307
|
+
* to `false`: when off, `execute`/`replayRun` fail closed with
|
|
308
|
+
* `GRAPH_DAGSTER_EXECUTION_NOT_ENABLED` before any network call, and the driver
|
|
309
|
+
* remains purely read-only. The facade preserves this key across
|
|
310
|
+
* `GraphExecutionEngine.initialize` (it is not facade-owned).
|
|
311
|
+
*/
|
|
312
|
+
executionEnabled?: boolean;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* A request to observe an EXISTING Dagster run. The run is never launched by the
|
|
316
|
+
* driver; the caller supplies the id of a run that already exists in the
|
|
317
|
+
* deployment.
|
|
318
|
+
*/
|
|
319
|
+
export interface DagsterObserveRunRequest {
|
|
320
|
+
/** Dagster run id of the existing run. */
|
|
321
|
+
dagsterRunId: string;
|
|
322
|
+
/** Canonical as-graph run id carried on emitted events; defaults to the Dagster run id. */
|
|
323
|
+
graphRunId?: string;
|
|
324
|
+
/** Canonical workflow id the run belongs to. */
|
|
325
|
+
workflowId: string;
|
|
326
|
+
/** Facade-owned event sink the driver reports transitions through. */
|
|
327
|
+
events: GraphExecutionEventSink;
|
|
328
|
+
/** Workflow input values carried onto the canonical result. */
|
|
329
|
+
inputs?: Record<string, unknown>;
|
|
330
|
+
/** Execution options metadata carried onto the canonical result. */
|
|
331
|
+
metadata?: Record<string, unknown>;
|
|
332
|
+
/**
|
|
333
|
+
* Caller cancellation signal. Aborting it fails the observation closed with
|
|
334
|
+
* `GRAPH_DAGSTER_OBSERVE_ABORTED` and cancels in-flight transport work
|
|
335
|
+
* instead of leaving the caller waiting on a wedged or stalled run.
|
|
336
|
+
*/
|
|
337
|
+
signal?: AbortSignal;
|
|
338
|
+
/**
|
|
339
|
+
* Hard cap on the number of events the bridge will process. Exceeding it fails
|
|
340
|
+
* the observation closed with `GRAPH_DAGSTER_EVENT_LIMIT_EXCEEDED`, so a gateway
|
|
341
|
+
* that never terminates cannot accumulate events without bound.
|
|
342
|
+
*/
|
|
343
|
+
maxEvents?: number;
|
|
344
|
+
/**
|
|
345
|
+
* Hard cap on the transport pagination depth. Forwarded to the client port so a
|
|
346
|
+
* gateway whose `eventConnection` never reports `hasMore: false` cannot page
|
|
347
|
+
* without bound.
|
|
348
|
+
*/
|
|
349
|
+
maxPages?: number;
|
|
350
|
+
/**
|
|
351
|
+
* Maximum time to await the terminal record. Exceeding it fails the observation
|
|
352
|
+
* closed with `GRAPH_DAGSTER_OBSERVE_TIMEOUT`.
|
|
353
|
+
*/
|
|
354
|
+
terminalTimeoutMs?: number;
|
|
355
|
+
}
|