@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,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/nest/graph/GraphEngineCapabilityManifest
|
|
3
|
+
* @summary Server-side engine capability manifest (SAA-197, SAA-193 C20).
|
|
4
|
+
* @description Builds the read-only, statically-derived capability manifest the
|
|
5
|
+
* frontend consumes to toggle per-engine features/buttons. The manifest is derived
|
|
6
|
+
* exclusively from engine metadata — the registered
|
|
7
|
+
* {@link GraphExecutionBackend}s and the capability tables the Dagster/Mastra
|
|
8
|
+
* wrappers export — and is never probed against a remote engine and never read from
|
|
9
|
+
* the environment. Every `detail` is a static, reviewed literal (C20): no secrets,
|
|
10
|
+
* endpoints/DSNs, sandbox internals, infrastructure topology, or authorization
|
|
11
|
+
* internals are exposed.
|
|
12
|
+
*/
|
|
13
|
+
import type { GraphBackendCapabilities, GraphExecutionBackend } from "../../engine/execution/GraphExecutionBackend.d.cts";
|
|
14
|
+
/**
|
|
15
|
+
* The normalized per-feature verdict served by the manifest. C20 defines exactly
|
|
16
|
+
* three verdicts; the wrapper tables' source spellings are normalized onto them
|
|
17
|
+
* (`supported`/`SUPPORTED` → `SUPPORTED`, `not_supported`/`NOT-SUPPORTED` →
|
|
18
|
+
* `NOT_SUPPORTED`, `extension_point`/`EXTENSION-POINT` → `EXTENSION_POINT`).
|
|
19
|
+
*/
|
|
20
|
+
export type GraphEngineFeatureVerdict = "SUPPORTED" | "NOT_SUPPORTED" | "EXTENSION_POINT";
|
|
21
|
+
/** One engine feature row served by the manifest (C20). */
|
|
22
|
+
export interface GraphEngineFeature {
|
|
23
|
+
/** Feature identifier as declared by the engine's capability metadata. */
|
|
24
|
+
feature: string;
|
|
25
|
+
/** Normalized verdict (C20 three-value vocabulary). */
|
|
26
|
+
verdict: GraphEngineFeatureVerdict;
|
|
27
|
+
/** Static, reviewed human-readable detail; never dynamic engine output. */
|
|
28
|
+
detail?: string;
|
|
29
|
+
}
|
|
30
|
+
/** One engine entry served by the manifest (exact C20 shape). */
|
|
31
|
+
export interface GraphEngineDescriptor {
|
|
32
|
+
/** Allowlisted engine id (the backend flavour). */
|
|
33
|
+
engineId: string;
|
|
34
|
+
/** Human-readable engine name. */
|
|
35
|
+
displayName: string;
|
|
36
|
+
/** Whether the engine executes in-process. */
|
|
37
|
+
local: boolean;
|
|
38
|
+
/** Pinned engine version the wrapper targets. */
|
|
39
|
+
pinnedEngineVersion: string;
|
|
40
|
+
/** Feature/verdict rows derived from the engine's capability metadata. */
|
|
41
|
+
capabilities: GraphEngineFeature[];
|
|
42
|
+
}
|
|
43
|
+
/** The top-level capability manifest served to the frontend (exact C20 shape). */
|
|
44
|
+
export interface GraphEngineCapabilityManifest {
|
|
45
|
+
/** One entry per available (registered) engine. */
|
|
46
|
+
engines: GraphEngineDescriptor[];
|
|
47
|
+
/** Engine id the server defaults to. */
|
|
48
|
+
defaultEngineId: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Pinned `@mastra/core` engine version. Kept here because the Mastra wrapper
|
|
52
|
+
* exports only its feature table, not a version constant; the value mirrors the
|
|
53
|
+
* `@mastra/core` dependency pin in `as-graph/package.json` (`1.74.0`).
|
|
54
|
+
*/
|
|
55
|
+
export declare const MASTRA_PINNED_VERSION = "1.74.0";
|
|
56
|
+
/**
|
|
57
|
+
* Normalizes a wrapper capability verdict onto the C20 three-value vocabulary.
|
|
58
|
+
* `PARTIAL` is deliberately downgraded to `NOT_SUPPORTED` (fail-closed): a
|
|
59
|
+
* partially-supported feature must never be advertised as a usable toggle.
|
|
60
|
+
*
|
|
61
|
+
* @param verdict - The wrapper table verdict string.
|
|
62
|
+
* @returns The normalized C20 verdict.
|
|
63
|
+
*/
|
|
64
|
+
export declare function toGraphEngineFeatureVerdict(verdict: string): GraphEngineFeatureVerdict;
|
|
65
|
+
/**
|
|
66
|
+
* Derives the local engine's feature rows from the engine-agnostic
|
|
67
|
+
* {@link GraphBackendCapabilities} the built-in backend exposes, so the manifest
|
|
68
|
+
* never hand-maintains a separate local table.
|
|
69
|
+
*
|
|
70
|
+
* @param capabilities - The active backend's effective capability metadata.
|
|
71
|
+
* @returns The normalized feature rows for the local engine.
|
|
72
|
+
*/
|
|
73
|
+
export declare function localEngineFeatures(capabilities: GraphBackendCapabilities): GraphEngineFeature[];
|
|
74
|
+
/**
|
|
75
|
+
* Builds the capability manifest from the registered backends, statically at boot.
|
|
76
|
+
* Only allowlisted flavours are advertised; the descriptors' `local` flag is read
|
|
77
|
+
* from the registered backend, and no remote engine is ever probed. The returned
|
|
78
|
+
* object is a fresh snapshot so a caller cannot mutate the served manifest.
|
|
79
|
+
*
|
|
80
|
+
* @param registered - The registered flavour/backend entries.
|
|
81
|
+
* @param defaultEngineId - Optional host-preferred default engine id.
|
|
82
|
+
* @returns The C20 capability manifest.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildGraphEngineCapabilityManifest(registered: ReadonlyArray<{
|
|
85
|
+
flavour: string;
|
|
86
|
+
backend: GraphExecutionBackend<any>;
|
|
87
|
+
}>, defaultEngineId?: string): GraphEngineCapabilityManifest;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module as-graph/nest/graph/GraphEngineCapabilityManifest
|
|
3
|
+
* @summary Server-side engine capability manifest (SAA-197, SAA-193 C20).
|
|
4
|
+
* @description Builds the read-only, statically-derived capability manifest the
|
|
5
|
+
* frontend consumes to toggle per-engine features/buttons. The manifest is derived
|
|
6
|
+
* exclusively from engine metadata — the registered
|
|
7
|
+
* {@link GraphExecutionBackend}s and the capability tables the Dagster/Mastra
|
|
8
|
+
* wrappers export — and is never probed against a remote engine and never read from
|
|
9
|
+
* the environment. Every `detail` is a static, reviewed literal (C20): no secrets,
|
|
10
|
+
* endpoints/DSNs, sandbox internals, infrastructure topology, or authorization
|
|
11
|
+
* internals are exposed.
|
|
12
|
+
*/
|
|
13
|
+
import type { GraphBackendCapabilities, GraphExecutionBackend } from "../../engine/execution/GraphExecutionBackend.d.mts";
|
|
14
|
+
/**
|
|
15
|
+
* The normalized per-feature verdict served by the manifest. C20 defines exactly
|
|
16
|
+
* three verdicts; the wrapper tables' source spellings are normalized onto them
|
|
17
|
+
* (`supported`/`SUPPORTED` → `SUPPORTED`, `not_supported`/`NOT-SUPPORTED` →
|
|
18
|
+
* `NOT_SUPPORTED`, `extension_point`/`EXTENSION-POINT` → `EXTENSION_POINT`).
|
|
19
|
+
*/
|
|
20
|
+
export type GraphEngineFeatureVerdict = "SUPPORTED" | "NOT_SUPPORTED" | "EXTENSION_POINT";
|
|
21
|
+
/** One engine feature row served by the manifest (C20). */
|
|
22
|
+
export interface GraphEngineFeature {
|
|
23
|
+
/** Feature identifier as declared by the engine's capability metadata. */
|
|
24
|
+
feature: string;
|
|
25
|
+
/** Normalized verdict (C20 three-value vocabulary). */
|
|
26
|
+
verdict: GraphEngineFeatureVerdict;
|
|
27
|
+
/** Static, reviewed human-readable detail; never dynamic engine output. */
|
|
28
|
+
detail?: string;
|
|
29
|
+
}
|
|
30
|
+
/** One engine entry served by the manifest (exact C20 shape). */
|
|
31
|
+
export interface GraphEngineDescriptor {
|
|
32
|
+
/** Allowlisted engine id (the backend flavour). */
|
|
33
|
+
engineId: string;
|
|
34
|
+
/** Human-readable engine name. */
|
|
35
|
+
displayName: string;
|
|
36
|
+
/** Whether the engine executes in-process. */
|
|
37
|
+
local: boolean;
|
|
38
|
+
/** Pinned engine version the wrapper targets. */
|
|
39
|
+
pinnedEngineVersion: string;
|
|
40
|
+
/** Feature/verdict rows derived from the engine's capability metadata. */
|
|
41
|
+
capabilities: GraphEngineFeature[];
|
|
42
|
+
}
|
|
43
|
+
/** The top-level capability manifest served to the frontend (exact C20 shape). */
|
|
44
|
+
export interface GraphEngineCapabilityManifest {
|
|
45
|
+
/** One entry per available (registered) engine. */
|
|
46
|
+
engines: GraphEngineDescriptor[];
|
|
47
|
+
/** Engine id the server defaults to. */
|
|
48
|
+
defaultEngineId: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Pinned `@mastra/core` engine version. Kept here because the Mastra wrapper
|
|
52
|
+
* exports only its feature table, not a version constant; the value mirrors the
|
|
53
|
+
* `@mastra/core` dependency pin in `as-graph/package.json` (`1.74.0`).
|
|
54
|
+
*/
|
|
55
|
+
export declare const MASTRA_PINNED_VERSION = "1.74.0";
|
|
56
|
+
/**
|
|
57
|
+
* Normalizes a wrapper capability verdict onto the C20 three-value vocabulary.
|
|
58
|
+
* `PARTIAL` is deliberately downgraded to `NOT_SUPPORTED` (fail-closed): a
|
|
59
|
+
* partially-supported feature must never be advertised as a usable toggle.
|
|
60
|
+
*
|
|
61
|
+
* @param verdict - The wrapper table verdict string.
|
|
62
|
+
* @returns The normalized C20 verdict.
|
|
63
|
+
*/
|
|
64
|
+
export declare function toGraphEngineFeatureVerdict(verdict: string): GraphEngineFeatureVerdict;
|
|
65
|
+
/**
|
|
66
|
+
* Derives the local engine's feature rows from the engine-agnostic
|
|
67
|
+
* {@link GraphBackendCapabilities} the built-in backend exposes, so the manifest
|
|
68
|
+
* never hand-maintains a separate local table.
|
|
69
|
+
*
|
|
70
|
+
* @param capabilities - The active backend's effective capability metadata.
|
|
71
|
+
* @returns The normalized feature rows for the local engine.
|
|
72
|
+
*/
|
|
73
|
+
export declare function localEngineFeatures(capabilities: GraphBackendCapabilities): GraphEngineFeature[];
|
|
74
|
+
/**
|
|
75
|
+
* Builds the capability manifest from the registered backends, statically at boot.
|
|
76
|
+
* Only allowlisted flavours are advertised; the descriptors' `local` flag is read
|
|
77
|
+
* from the registered backend, and no remote engine is ever probed. The returned
|
|
78
|
+
* object is a fresh snapshot so a caller cannot mutate the served manifest.
|
|
79
|
+
*
|
|
80
|
+
* @param registered - The registered flavour/backend entries.
|
|
81
|
+
* @param defaultEngineId - Optional host-preferred default engine id.
|
|
82
|
+
* @returns The C20 capability manifest.
|
|
83
|
+
*/
|
|
84
|
+
export declare function buildGraphEngineCapabilityManifest(registered: ReadonlyArray<{
|
|
85
|
+
flavour: string;
|
|
86
|
+
backend: GraphExecutionBackend<any>;
|
|
87
|
+
}>, defaultEngineId?: string): GraphEngineCapabilityManifest;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Context, MaybeContextualArg } from "@decaf-ts/core";
|
|
2
|
+
import type { GraphBackendWorkflowSummary } from "../../engine/execution/GraphExecutionBackend.d.cts";
|
|
3
|
+
import type { GraphExecutionEngine } from "../../engine/execution/GraphExecutionEngine.d.cts";
|
|
4
|
+
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.cts";
|
|
5
|
+
import { type GraphEngineCapabilityManifest, type GraphEngineDescriptor } from "./GraphEngineCapabilityManifest.d.cts";
|
|
6
|
+
/** DI token for {@link GraphEngineCapabilityOptions}. */
|
|
7
|
+
export declare const GRAPH_ENGINE_CAPABILITY_OPTIONS = "GRAPH_ENGINE_CAPABILITY_OPTIONS";
|
|
8
|
+
/** Rate-limit configuration for the engine capability routes: window and request cap. */
|
|
9
|
+
export interface GraphEngineRateLimitOptions {
|
|
10
|
+
windowMs?: number;
|
|
11
|
+
maxRequests?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Default rate limit for the engine capability routes: 120 requests per 60-second
|
|
15
|
+
* window, applied by the `@nestjs/throttler` guard on the `engines` bucket.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_GRAPH_ENGINE_RATE_LIMIT: Required<GraphEngineRateLimitOptions>;
|
|
18
|
+
/**
|
|
19
|
+
* Options for the engine capability HTTP API (SAA-193 C20/C21): authentication
|
|
20
|
+
* mode, the host-preferred default engine id, and the engine-route rate limit.
|
|
21
|
+
*/
|
|
22
|
+
export interface GraphEngineCapabilityOptions {
|
|
23
|
+
/**
|
|
24
|
+
* `"required"` (default) rejects a request with no request context, or with a
|
|
25
|
+
* context that carries no resolved owner user, with `401`, matching the other
|
|
26
|
+
* graph read routes; `"optional"` tolerates anonymous/system callers for
|
|
27
|
+
* standalone module runs.
|
|
28
|
+
*/
|
|
29
|
+
auth?: "required" | "optional";
|
|
30
|
+
/**
|
|
31
|
+
* Engine id the manifest advertises as the default. Ignored when it is not one of
|
|
32
|
+
* the registered, allowlisted engine ids; the current backend flavour is used
|
|
33
|
+
* instead.
|
|
34
|
+
*/
|
|
35
|
+
defaultEngineId?: string;
|
|
36
|
+
/** Rate limit for the engine capability routes (the `engines` throttler bucket). */
|
|
37
|
+
rateLimit?: GraphEngineRateLimitOptions;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Owns the boot-time capability manifest and resolves engine-scoped workflow
|
|
41
|
+
* listing/lookup. The manifest is built once in the constructor from the
|
|
42
|
+
* registered backends; request handling never mutates it and never probes a remote
|
|
43
|
+
* engine.
|
|
44
|
+
*/
|
|
45
|
+
export declare class GraphEngineCapabilityService {
|
|
46
|
+
private readonly engine?;
|
|
47
|
+
private readonly manifest;
|
|
48
|
+
private readonly engineIds;
|
|
49
|
+
/**
|
|
50
|
+
* @param options - Controller options (auth, default engine id, rate limit).
|
|
51
|
+
* @param engine - The engine facade resolving flavour-scoped listing/lookup.
|
|
52
|
+
*/
|
|
53
|
+
constructor(options?: GraphEngineCapabilityOptions, engine?: GraphExecutionEngine | undefined);
|
|
54
|
+
/**
|
|
55
|
+
* Returns a defensive copy of the statically-derived capability manifest.
|
|
56
|
+
*
|
|
57
|
+
* @returns The C20 capability manifest snapshot.
|
|
58
|
+
*/
|
|
59
|
+
manifestSnapshot(): GraphEngineCapabilityManifest;
|
|
60
|
+
/**
|
|
61
|
+
* Returns a defensive copy of a single allowlisted engine descriptor.
|
|
62
|
+
*
|
|
63
|
+
* @param engineId - The engine id to look up.
|
|
64
|
+
* @returns The engine descriptor, or `undefined` when not allowlisted.
|
|
65
|
+
*/
|
|
66
|
+
descriptor(engineId: string): GraphEngineDescriptor | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the engine id is registered and allowlisted.
|
|
69
|
+
*
|
|
70
|
+
* @param engineId - The engine id to check.
|
|
71
|
+
* @returns `true` when the id is an available engine.
|
|
72
|
+
*/
|
|
73
|
+
isKnownEngine(engineId: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Lists the workflows a registered engine can surface through the engine-agnostic
|
|
76
|
+
* facade, which applies the fail-closed capability gate and the
|
|
77
|
+
* `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` error code.
|
|
78
|
+
*
|
|
79
|
+
* @param engineId - The allowlisted engine id to list for.
|
|
80
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
81
|
+
* @returns Workflow summaries.
|
|
82
|
+
* @throws {GraphExecutionError} when the engine declares no listing support.
|
|
83
|
+
*/
|
|
84
|
+
listWorkflows(engineId: string, ...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Looks up a single canonical workflow document on a registered engine through
|
|
87
|
+
* the engine-agnostic facade.
|
|
88
|
+
*
|
|
89
|
+
* @param engineId - The allowlisted engine id to read from.
|
|
90
|
+
* @param workflowId - The canonical workflow id to read.
|
|
91
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
92
|
+
* @returns The canonical workflow document.
|
|
93
|
+
* @throws {GraphExecutionError} when the engine declares no lookup support.
|
|
94
|
+
*/
|
|
95
|
+
getWorkflow(engineId: string, workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
96
|
+
/** Resolves the engine facade, failing closed when it is not wired. */
|
|
97
|
+
private requireEngine;
|
|
98
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import type { Context, MaybeContextualArg } from "@decaf-ts/core";
|
|
2
|
+
import type { GraphBackendWorkflowSummary } from "../../engine/execution/GraphExecutionBackend.d.mts";
|
|
3
|
+
import type { GraphExecutionEngine } from "../../engine/execution/GraphExecutionEngine.d.mts";
|
|
4
|
+
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.mts";
|
|
5
|
+
import { type GraphEngineCapabilityManifest, type GraphEngineDescriptor } from "./GraphEngineCapabilityManifest.d.mts";
|
|
6
|
+
/** DI token for {@link GraphEngineCapabilityOptions}. */
|
|
7
|
+
export declare const GRAPH_ENGINE_CAPABILITY_OPTIONS = "GRAPH_ENGINE_CAPABILITY_OPTIONS";
|
|
8
|
+
/** Rate-limit configuration for the engine capability routes: window and request cap. */
|
|
9
|
+
export interface GraphEngineRateLimitOptions {
|
|
10
|
+
windowMs?: number;
|
|
11
|
+
maxRequests?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Default rate limit for the engine capability routes: 120 requests per 60-second
|
|
15
|
+
* window, applied by the `@nestjs/throttler` guard on the `engines` bucket.
|
|
16
|
+
*/
|
|
17
|
+
export declare const DEFAULT_GRAPH_ENGINE_RATE_LIMIT: Required<GraphEngineRateLimitOptions>;
|
|
18
|
+
/**
|
|
19
|
+
* Options for the engine capability HTTP API (SAA-193 C20/C21): authentication
|
|
20
|
+
* mode, the host-preferred default engine id, and the engine-route rate limit.
|
|
21
|
+
*/
|
|
22
|
+
export interface GraphEngineCapabilityOptions {
|
|
23
|
+
/**
|
|
24
|
+
* `"required"` (default) rejects a request with no request context, or with a
|
|
25
|
+
* context that carries no resolved owner user, with `401`, matching the other
|
|
26
|
+
* graph read routes; `"optional"` tolerates anonymous/system callers for
|
|
27
|
+
* standalone module runs.
|
|
28
|
+
*/
|
|
29
|
+
auth?: "required" | "optional";
|
|
30
|
+
/**
|
|
31
|
+
* Engine id the manifest advertises as the default. Ignored when it is not one of
|
|
32
|
+
* the registered, allowlisted engine ids; the current backend flavour is used
|
|
33
|
+
* instead.
|
|
34
|
+
*/
|
|
35
|
+
defaultEngineId?: string;
|
|
36
|
+
/** Rate limit for the engine capability routes (the `engines` throttler bucket). */
|
|
37
|
+
rateLimit?: GraphEngineRateLimitOptions;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Owns the boot-time capability manifest and resolves engine-scoped workflow
|
|
41
|
+
* listing/lookup. The manifest is built once in the constructor from the
|
|
42
|
+
* registered backends; request handling never mutates it and never probes a remote
|
|
43
|
+
* engine.
|
|
44
|
+
*/
|
|
45
|
+
export declare class GraphEngineCapabilityService {
|
|
46
|
+
private readonly engine?;
|
|
47
|
+
private readonly manifest;
|
|
48
|
+
private readonly engineIds;
|
|
49
|
+
/**
|
|
50
|
+
* @param options - Controller options (auth, default engine id, rate limit).
|
|
51
|
+
* @param engine - The engine facade resolving flavour-scoped listing/lookup.
|
|
52
|
+
*/
|
|
53
|
+
constructor(options?: GraphEngineCapabilityOptions, engine?: GraphExecutionEngine | undefined);
|
|
54
|
+
/**
|
|
55
|
+
* Returns a defensive copy of the statically-derived capability manifest.
|
|
56
|
+
*
|
|
57
|
+
* @returns The C20 capability manifest snapshot.
|
|
58
|
+
*/
|
|
59
|
+
manifestSnapshot(): GraphEngineCapabilityManifest;
|
|
60
|
+
/**
|
|
61
|
+
* Returns a defensive copy of a single allowlisted engine descriptor.
|
|
62
|
+
*
|
|
63
|
+
* @param engineId - The engine id to look up.
|
|
64
|
+
* @returns The engine descriptor, or `undefined` when not allowlisted.
|
|
65
|
+
*/
|
|
66
|
+
descriptor(engineId: string): GraphEngineDescriptor | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Whether the engine id is registered and allowlisted.
|
|
69
|
+
*
|
|
70
|
+
* @param engineId - The engine id to check.
|
|
71
|
+
* @returns `true` when the id is an available engine.
|
|
72
|
+
*/
|
|
73
|
+
isKnownEngine(engineId: string): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Lists the workflows a registered engine can surface through the engine-agnostic
|
|
76
|
+
* facade, which applies the fail-closed capability gate and the
|
|
77
|
+
* `GRAPH_BACKEND_WORKFLOWS_NOT_SUPPORTED` error code.
|
|
78
|
+
*
|
|
79
|
+
* @param engineId - The allowlisted engine id to list for.
|
|
80
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
81
|
+
* @returns Workflow summaries.
|
|
82
|
+
* @throws {GraphExecutionError} when the engine declares no listing support.
|
|
83
|
+
*/
|
|
84
|
+
listWorkflows(engineId: string, ...args: MaybeContextualArg<Context>): Promise<GraphBackendWorkflowSummary[]>;
|
|
85
|
+
/**
|
|
86
|
+
* Looks up a single canonical workflow document on a registered engine through
|
|
87
|
+
* the engine-agnostic facade.
|
|
88
|
+
*
|
|
89
|
+
* @param engineId - The allowlisted engine id to read from.
|
|
90
|
+
* @param workflowId - The canonical workflow id to read.
|
|
91
|
+
* @param args - Optional decaf contextual arguments forwarded to the backend.
|
|
92
|
+
* @returns The canonical workflow document.
|
|
93
|
+
* @throws {GraphExecutionError} when the engine declares no lookup support.
|
|
94
|
+
*/
|
|
95
|
+
getWorkflow(engineId: string, workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphWorkflowDocument>;
|
|
96
|
+
/** Resolves the engine facade, failing closed when it is not wired. */
|
|
97
|
+
private requireEngine;
|
|
98
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { DecafRequestContext } from "@decaf-ts/for-nest";
|
|
2
|
+
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.cts";
|
|
3
|
+
import type { GraphEngineCapabilityManifest, GraphEngineDescriptor } from "./GraphEngineCapabilityManifest.d.cts";
|
|
4
|
+
import { GraphEngineCapabilityService, type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.cts";
|
|
5
|
+
/** One row of the engine workflow list: the serving summary a list binds to. */
|
|
6
|
+
export interface GraphEngineWorkflowSummary {
|
|
7
|
+
/** Canonical workflow id. */
|
|
8
|
+
workflowId: string;
|
|
9
|
+
/** Display name mirrored from the document, when present. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** ISO timestamp of the last update, when the backend exposes one. */
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Engine capability manifest and engine-scoped workflow catalogue endpoints:
|
|
16
|
+
*
|
|
17
|
+
* - `GET /graph/engines` — the C20 capability manifest for every available
|
|
18
|
+
* (registered, allowlisted) engine.
|
|
19
|
+
* - `GET /graph/engines/{engineId}` — one engine descriptor.
|
|
20
|
+
* - `GET /graph/engines/{engineId}/workflows` — the workflows that engine
|
|
21
|
+
* surfaces through the engine-agnostic facade.
|
|
22
|
+
* - `GET /graph/engines/{engineId}/workflows/{workflowId}` — one canonical
|
|
23
|
+
* workflow document from that engine.
|
|
24
|
+
*
|
|
25
|
+
* All routes are read-only `GET`s, select engines by allowlisted id only, and
|
|
26
|
+
* never reflect arbitrary query input.
|
|
27
|
+
*/
|
|
28
|
+
export declare class GraphEngineController {
|
|
29
|
+
private readonly capabilityService;
|
|
30
|
+
private readonly requestContext?;
|
|
31
|
+
private readonly options;
|
|
32
|
+
constructor(capabilityService: GraphEngineCapabilityService, requestContext?: DecafRequestContext | undefined, options?: GraphEngineCapabilityOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Enforces the configured authentication mode: `auth` defaults to `"required"`
|
|
35
|
+
* and rejects a request with no request context, or with a context that carries
|
|
36
|
+
* no resolved owner user, with `401`; `"optional"` admits anonymous requests.
|
|
37
|
+
*/
|
|
38
|
+
private requireAuthenticatedContext;
|
|
39
|
+
private assertKnownEngine;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the capability manifest for every available engine.
|
|
42
|
+
*
|
|
43
|
+
* @return {Promise<GraphEngineCapabilityManifest>} The C20 capability manifest.
|
|
44
|
+
* @throws {HttpException} 401 without an authenticated caller.
|
|
45
|
+
*/
|
|
46
|
+
getManifest(): Promise<GraphEngineCapabilityManifest>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns one allowlisted engine's capability descriptor.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
51
|
+
* @return {Promise<GraphEngineDescriptor>} The engine descriptor.
|
|
52
|
+
* @throws {HttpException} 404 when the engine id is not available.
|
|
53
|
+
*/
|
|
54
|
+
getEngine(engineId: string): Promise<GraphEngineDescriptor>;
|
|
55
|
+
/**
|
|
56
|
+
* Lists the workflows the selected engine surfaces through the
|
|
57
|
+
* engine-agnostic facade.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
60
|
+
* @return {Promise<GraphEngineWorkflowSummary[]>} Workflow summaries.
|
|
61
|
+
* @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no listing support.
|
|
62
|
+
*/
|
|
63
|
+
listWorkflows(engineId: string): Promise<GraphEngineWorkflowSummary[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns one canonical workflow document from the selected engine through the
|
|
66
|
+
* engine-agnostic facade.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
69
|
+
* @param {string} workflowId - Canonical workflow id path parameter.
|
|
70
|
+
* @return {Promise<GraphWorkflowDocument>} The canonical workflow document.
|
|
71
|
+
* @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no lookup support.
|
|
72
|
+
*/
|
|
73
|
+
getWorkflow(engineId: string, workflowId: string): Promise<GraphWorkflowDocument>;
|
|
74
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { DecafRequestContext } from "@decaf-ts/for-nest";
|
|
2
|
+
import type { GraphWorkflowDocument } from "../../shared/graph/index.d.mts";
|
|
3
|
+
import type { GraphEngineCapabilityManifest, GraphEngineDescriptor } from "./GraphEngineCapabilityManifest.d.mts";
|
|
4
|
+
import { GraphEngineCapabilityService, type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.mts";
|
|
5
|
+
/** One row of the engine workflow list: the serving summary a list binds to. */
|
|
6
|
+
export interface GraphEngineWorkflowSummary {
|
|
7
|
+
/** Canonical workflow id. */
|
|
8
|
+
workflowId: string;
|
|
9
|
+
/** Display name mirrored from the document, when present. */
|
|
10
|
+
name?: string;
|
|
11
|
+
/** ISO timestamp of the last update, when the backend exposes one. */
|
|
12
|
+
updatedAt?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Engine capability manifest and engine-scoped workflow catalogue endpoints:
|
|
16
|
+
*
|
|
17
|
+
* - `GET /graph/engines` — the C20 capability manifest for every available
|
|
18
|
+
* (registered, allowlisted) engine.
|
|
19
|
+
* - `GET /graph/engines/{engineId}` — one engine descriptor.
|
|
20
|
+
* - `GET /graph/engines/{engineId}/workflows` — the workflows that engine
|
|
21
|
+
* surfaces through the engine-agnostic facade.
|
|
22
|
+
* - `GET /graph/engines/{engineId}/workflows/{workflowId}` — one canonical
|
|
23
|
+
* workflow document from that engine.
|
|
24
|
+
*
|
|
25
|
+
* All routes are read-only `GET`s, select engines by allowlisted id only, and
|
|
26
|
+
* never reflect arbitrary query input.
|
|
27
|
+
*/
|
|
28
|
+
export declare class GraphEngineController {
|
|
29
|
+
private readonly capabilityService;
|
|
30
|
+
private readonly requestContext?;
|
|
31
|
+
private readonly options;
|
|
32
|
+
constructor(capabilityService: GraphEngineCapabilityService, requestContext?: DecafRequestContext | undefined, options?: GraphEngineCapabilityOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Enforces the configured authentication mode: `auth` defaults to `"required"`
|
|
35
|
+
* and rejects a request with no request context, or with a context that carries
|
|
36
|
+
* no resolved owner user, with `401`; `"optional"` admits anonymous requests.
|
|
37
|
+
*/
|
|
38
|
+
private requireAuthenticatedContext;
|
|
39
|
+
private assertKnownEngine;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the capability manifest for every available engine.
|
|
42
|
+
*
|
|
43
|
+
* @return {Promise<GraphEngineCapabilityManifest>} The C20 capability manifest.
|
|
44
|
+
* @throws {HttpException} 401 without an authenticated caller.
|
|
45
|
+
*/
|
|
46
|
+
getManifest(): Promise<GraphEngineCapabilityManifest>;
|
|
47
|
+
/**
|
|
48
|
+
* Returns one allowlisted engine's capability descriptor.
|
|
49
|
+
*
|
|
50
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
51
|
+
* @return {Promise<GraphEngineDescriptor>} The engine descriptor.
|
|
52
|
+
* @throws {HttpException} 404 when the engine id is not available.
|
|
53
|
+
*/
|
|
54
|
+
getEngine(engineId: string): Promise<GraphEngineDescriptor>;
|
|
55
|
+
/**
|
|
56
|
+
* Lists the workflows the selected engine surfaces through the
|
|
57
|
+
* engine-agnostic facade.
|
|
58
|
+
*
|
|
59
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
60
|
+
* @return {Promise<GraphEngineWorkflowSummary[]>} Workflow summaries.
|
|
61
|
+
* @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no listing support.
|
|
62
|
+
*/
|
|
63
|
+
listWorkflows(engineId: string): Promise<GraphEngineWorkflowSummary[]>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns one canonical workflow document from the selected engine through the
|
|
66
|
+
* engine-agnostic facade.
|
|
67
|
+
*
|
|
68
|
+
* @param {string} engineId - Allowlisted engine id path parameter.
|
|
69
|
+
* @param {string} workflowId - Canonical workflow id path parameter.
|
|
70
|
+
* @return {Promise<GraphWorkflowDocument>} The canonical workflow document.
|
|
71
|
+
* @throws {HttpException} 404 for an unknown engine id, 501 when the engine declares no lookup support.
|
|
72
|
+
*/
|
|
73
|
+
getWorkflow(engineId: string, workflowId: string): Promise<GraphWorkflowDocument>;
|
|
74
|
+
}
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
import { DynamicModule, Type } from "@nestjs/common";
|
|
12
12
|
import type { AuthHandler } from "@decaf-ts/for-http/server";
|
|
13
13
|
import { Adapter } from "@decaf-ts/core";
|
|
14
|
+
import type { GraphExecutionBackend } from "../../engine/execution/GraphExecutionBackend.d.cts";
|
|
14
15
|
import { type GraphCredentialAuthorizer, type GraphNamespaceMatchOptions } from "../..//index.d.cts";
|
|
15
16
|
import { type GraphCatalogueControllerOptions } from "./GraphNodeCatalogueController.d.cts";
|
|
16
17
|
import { type GraphRunControllerOptions } from "./GraphRunController.d.cts";
|
|
17
18
|
import type { GraphWorkflowServiceOptions } from "../../engine/services/GraphEnvironment.d.cts";
|
|
18
19
|
import type { GraphRunServiceOptions } from "../../engine/runs/GraphRunService.d.cts";
|
|
19
20
|
import { type GraphWorkflowControllerOptions } from "./GraphWorkflowController.d.cts";
|
|
21
|
+
import { type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.cts";
|
|
20
22
|
/**
|
|
21
23
|
* Options for {@link GraphExecutionModule.forRoot}: adapter bootstrapping
|
|
22
24
|
* plus per-API (catalogue, workflows, runs) authentication and limit
|
|
@@ -58,6 +60,24 @@ export interface GraphExecutionModuleOptions {
|
|
|
58
60
|
* (SAA-93 F3).
|
|
59
61
|
*/
|
|
60
62
|
runs?: GraphRunControllerOptions & GraphRunServiceOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Options for the engine capability HTTP API (SAA-197, SAA-193 C20/C21):
|
|
65
|
+
* authentication mode, the advertised default engine id, and the engine-route
|
|
66
|
+
* rate limit. The capability manifest is derived statically at boot from the
|
|
67
|
+
* registered backends and never read from the environment or a remote engine.
|
|
68
|
+
*/
|
|
69
|
+
engines?: GraphEngineCapabilityOptions;
|
|
70
|
+
/**
|
|
71
|
+
* Pluggable execution backend the host selects as the engine's active backend
|
|
72
|
+
* (SAA-706). When omitted the engine falls back to the registry's current
|
|
73
|
+
* backend and then to the built-in {@link LocalGraphExecutionBackend}, so the
|
|
74
|
+
* standard local host needs no wiring. A host that boots a translated/remote
|
|
75
|
+
* engine (Mastra, Dagster) constructs its backend, registers it, and passes it
|
|
76
|
+
* here; the capability manifest then advertises that engine's flavour. The
|
|
77
|
+
* backend must already be registered under its flavour (constructing the
|
|
78
|
+
* wrapper does this) so the manifest and the per-engine catalogue agree.
|
|
79
|
+
*/
|
|
80
|
+
backend?: GraphExecutionBackend<any>;
|
|
61
81
|
/**
|
|
62
82
|
* Production hosts MUST wire a {@link GraphCredentialAuthorizer} backed by
|
|
63
83
|
* their credential store (DECAF-50 §4.8 stage 8). Without it, stage-8
|
|
@@ -11,12 +11,14 @@
|
|
|
11
11
|
import { DynamicModule, Type } from "@nestjs/common";
|
|
12
12
|
import type { AuthHandler } from "@decaf-ts/for-http/server";
|
|
13
13
|
import { Adapter } from "@decaf-ts/core";
|
|
14
|
+
import type { GraphExecutionBackend } from "../../engine/execution/GraphExecutionBackend.d.mts";
|
|
14
15
|
import { type GraphCredentialAuthorizer, type GraphNamespaceMatchOptions } from "../..//index.d.mts";
|
|
15
16
|
import { type GraphCatalogueControllerOptions } from "./GraphNodeCatalogueController.d.mts";
|
|
16
17
|
import { type GraphRunControllerOptions } from "./GraphRunController.d.mts";
|
|
17
18
|
import type { GraphWorkflowServiceOptions } from "../../engine/services/GraphEnvironment.d.mts";
|
|
18
19
|
import type { GraphRunServiceOptions } from "../../engine/runs/GraphRunService.d.mts";
|
|
19
20
|
import { type GraphWorkflowControllerOptions } from "./GraphWorkflowController.d.mts";
|
|
21
|
+
import { type GraphEngineCapabilityOptions } from "./GraphEngineCapabilityService.d.mts";
|
|
20
22
|
/**
|
|
21
23
|
* Options for {@link GraphExecutionModule.forRoot}: adapter bootstrapping
|
|
22
24
|
* plus per-API (catalogue, workflows, runs) authentication and limit
|
|
@@ -58,6 +60,24 @@ export interface GraphExecutionModuleOptions {
|
|
|
58
60
|
* (SAA-93 F3).
|
|
59
61
|
*/
|
|
60
62
|
runs?: GraphRunControllerOptions & GraphRunServiceOptions;
|
|
63
|
+
/**
|
|
64
|
+
* Options for the engine capability HTTP API (SAA-197, SAA-193 C20/C21):
|
|
65
|
+
* authentication mode, the advertised default engine id, and the engine-route
|
|
66
|
+
* rate limit. The capability manifest is derived statically at boot from the
|
|
67
|
+
* registered backends and never read from the environment or a remote engine.
|
|
68
|
+
*/
|
|
69
|
+
engines?: GraphEngineCapabilityOptions;
|
|
70
|
+
/**
|
|
71
|
+
* Pluggable execution backend the host selects as the engine's active backend
|
|
72
|
+
* (SAA-706). When omitted the engine falls back to the registry's current
|
|
73
|
+
* backend and then to the built-in {@link LocalGraphExecutionBackend}, so the
|
|
74
|
+
* standard local host needs no wiring. A host that boots a translated/remote
|
|
75
|
+
* engine (Mastra, Dagster) constructs its backend, registers it, and passes it
|
|
76
|
+
* here; the capability manifest then advertises that engine's flavour. The
|
|
77
|
+
* backend must already be registered under its flavour (constructing the
|
|
78
|
+
* wrapper does this) so the manifest and the per-engine catalogue agree.
|
|
79
|
+
*/
|
|
80
|
+
backend?: GraphExecutionBackend<any>;
|
|
61
81
|
/**
|
|
62
82
|
* Production hosts MUST wire a {@link GraphCredentialAuthorizer} backed by
|
|
63
83
|
* their credential store (DECAF-50 §4.8 stage 8). Without it, stage-8
|
|
@@ -9,4 +9,8 @@ export * from "./GraphWorkflowController.d.cts";
|
|
|
9
9
|
export * from "./GraphRunController.d.cts";
|
|
10
10
|
export * from "./GraphExecutorRegistryFactory.d.cts";
|
|
11
11
|
export * from "./GraphNodeCatalogueController.d.cts";
|
|
12
|
+
export * from "./GraphEngineCapabilityManifest.d.cts";
|
|
13
|
+
export * from "./GraphEngineCapabilityService.d.cts";
|
|
14
|
+
export * from "./GraphEngineController.d.cts";
|
|
12
15
|
export * from "./GraphExecutionModule.d.cts";
|
|
16
|
+
export * from "./GraphBackendHost.d.cts";
|
|
@@ -9,4 +9,8 @@ export * from "./GraphWorkflowController.d.mts";
|
|
|
9
9
|
export * from "./GraphRunController.d.mts";
|
|
10
10
|
export * from "./GraphExecutorRegistryFactory.d.mts";
|
|
11
11
|
export * from "./GraphNodeCatalogueController.d.mts";
|
|
12
|
+
export * from "./GraphEngineCapabilityManifest.d.mts";
|
|
13
|
+
export * from "./GraphEngineCapabilityService.d.mts";
|
|
14
|
+
export * from "./GraphEngineController.d.mts";
|
|
12
15
|
export * from "./GraphExecutionModule.d.mts";
|
|
16
|
+
export * from "./GraphBackendHost.d.mts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
|
|
6
6
|
/** Logger context for the run lifecycle controller's server-side error log. */
|
|
7
|
-
export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController";
|
|
7
|
+
export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController" | "GraphEngineController";
|
|
8
8
|
/**
|
|
9
9
|
* Request/run correlation fields attached to a server-side graph serving error
|
|
10
10
|
* log. Only ids the server already resolved are included; the fields are never
|
|
@@ -15,6 +15,8 @@ export interface GraphServingErrorCorrelation {
|
|
|
15
15
|
runId?: string;
|
|
16
16
|
/** Workflow id, when the failing operation was scoped to a workflow. */
|
|
17
17
|
workflowId?: string;
|
|
18
|
+
/** Engine id, when the failing operation was scoped to an engine. */
|
|
19
|
+
engineId?: string;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Logs an unmapped graph serving failure server-side, with the request
|