@decaf-ts/integrations 0.6.1 → 0.7.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/dist/integrations.cjs +1 -1
- package/jest.config.cjs +10 -0
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs +23 -2
- package/lib/cjs/graph/engine/execution/GraphExecutionContext.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs +76 -0
- package/lib/cjs/graph/engine/execution/GraphExecutionEngine.cjs.map +1 -1
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs +29 -4
- package/lib/cjs/graph/engine/execution/LogGraphNodeExecutor.cjs.map +1 -1
- package/lib/cjs/graph/index.cjs +1 -0
- package/lib/cjs/graph/index.cjs.map +1 -1
- package/lib/cjs/graph/log/GraphRunLogger.cjs +142 -0
- package/lib/cjs/graph/log/GraphRunLogger.cjs.map +1 -0
- package/lib/cjs/graph/log/LogParameters.cjs +73 -0
- package/lib/cjs/graph/log/LogParameters.cjs.map +1 -0
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs +97 -0
- package/lib/cjs/graph/shared/GraphExecutionStateMapper.cjs.map +1 -0
- package/lib/cjs/graph/shared/constants.cjs +56 -1
- package/lib/cjs/graph/shared/constants.cjs.map +1 -1
- package/lib/cjs/graph/shared/index.cjs +9 -1
- package/lib/cjs/graph/shared/index.cjs.map +1 -1
- package/lib/cjs/graph/shared/nodes/flow-control.cjs +50 -6
- package/lib/cjs/graph/shared/nodes/flow-control.cjs.map +1 -1
- package/lib/cjs/index.cjs +3 -3
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs +1 -1
- package/lib/cjs/nest/graph/GraphExecutionResultModel.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs +4 -3
- package/lib/cjs/nest/graph/GraphExecutorRegistryFactory.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs +1 -5
- package/lib/cjs/nest/graph/GraphWorkflowModel.cjs.map +1 -1
- package/lib/cjs/user-requests/index.cjs +27 -0
- package/lib/cjs/user-requests/index.cjs.map +1 -0
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js +23 -2
- package/lib/esm/graph/engine/execution/GraphExecutionContext.js.map +1 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js +77 -1
- package/lib/esm/graph/engine/execution/GraphExecutionEngine.js.map +1 -1
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js +29 -4
- package/lib/esm/graph/engine/execution/LogGraphNodeExecutor.js.map +1 -1
- package/lib/esm/graph/index.js +1 -0
- package/lib/esm/graph/index.js.map +1 -1
- package/lib/esm/graph/log/GraphRunLogger.js +137 -0
- package/lib/esm/graph/log/GraphRunLogger.js.map +1 -0
- package/lib/esm/graph/log/LogParameters.js +69 -0
- package/lib/esm/graph/log/LogParameters.js.map +1 -0
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js +91 -0
- package/lib/esm/graph/shared/GraphExecutionStateMapper.js.map +1 -0
- package/lib/esm/graph/shared/constants.js +82 -3
- package/lib/esm/graph/shared/constants.js.map +1 -1
- package/lib/esm/graph/shared/index.js +6 -0
- package/lib/esm/graph/shared/index.js.map +1 -1
- package/lib/esm/graph/shared/nodes/flow-control.js +49 -5
- package/lib/esm/graph/shared/nodes/flow-control.js.map +1 -1
- package/lib/esm/index.js +3 -3
- package/lib/esm/nest/graph/GraphExecutionResultModel.js +3 -3
- package/lib/esm/nest/graph/GraphExecutionResultModel.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js +4 -3
- package/lib/esm/nest/graph/GraphExecutorRegistryFactory.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowModel.js +3 -7
- package/lib/esm/nest/graph/GraphWorkflowModel.js.map +1 -1
- package/lib/esm/user-requests/index.js +10 -0
- package/lib/esm/user-requests/index.js.map +1 -0
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.cts +12 -2
- package/lib/types/graph/engine/execution/GraphExecutionContext.d.mts +12 -2
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.cts +34 -1
- package/lib/types/graph/engine/execution/GraphExecutionEngine.d.mts +34 -1
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.cts +16 -10
- package/lib/types/graph/engine/execution/LogGraphNodeExecutor.d.mts +16 -10
- package/lib/types/graph/index.d.cts +1 -0
- package/lib/types/graph/index.d.mts +1 -0
- package/lib/types/graph/log/GraphRunLogger.d.cts +72 -0
- package/lib/types/graph/log/GraphRunLogger.d.mts +72 -0
- package/lib/types/graph/log/LogParameters.d.cts +7 -0
- package/lib/types/graph/log/LogParameters.d.mts +7 -0
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.cts +66 -0
- package/lib/types/graph/shared/GraphExecutionStateMapper.d.mts +66 -0
- package/lib/types/graph/shared/constants.d.cts +70 -3
- package/lib/types/graph/shared/constants.d.mts +70 -3
- package/lib/types/graph/shared/index.d.cts +3 -0
- package/lib/types/graph/shared/index.d.mts +3 -0
- package/lib/types/graph/shared/nodes/flow-control.d.cts +20 -7
- package/lib/types/graph/shared/nodes/flow-control.d.mts +20 -7
- package/lib/types/graph/shared/types.d.cts +94 -5
- package/lib/types/graph/shared/types.d.mts +94 -5
- package/lib/types/index.d.cts +2 -2
- package/lib/types/index.d.mts +2 -2
- package/lib/types/nest/graph/GraphExecutionResultModel.d.cts +3 -3
- package/lib/types/nest/graph/GraphExecutionResultModel.d.mts +3 -3
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.cts +3 -3
- package/lib/types/nest/graph/GraphExecutorRegistryFactory.d.mts +3 -3
- package/lib/types/nest/graph/GraphWorkflowModel.d.cts +3 -4
- package/lib/types/nest/graph/GraphWorkflowModel.d.mts +3 -4
- package/lib/types/user-requests/index.d.cts +9 -0
- package/lib/types/user-requests/index.d.mts +9 -0
- package/package.json +16 -6
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* @description Creates a registry pre-loaded with the demo executors used by
|
|
5
5
|
* the graph execution backend's sample workflows. The executors cover the
|
|
6
6
|
* flow-control kinds (including Code, Log, and Switch with code conditions),
|
|
7
|
-
* the agent kind, and the loop
|
|
8
|
-
*
|
|
9
|
-
* {@link GraphExecutionEngine}.
|
|
7
|
+
* the DECAF-48 `core.utility.log` Log node, the agent kind, and the loop
|
|
8
|
+
* kinds. Additional executors can be registered on the returned registry
|
|
9
|
+
* before it is handed to the {@link GraphExecutionEngine}.
|
|
10
10
|
*/
|
|
11
11
|
import { GraphNodeExecutorRegistry, ForeachGraphNodeExecutor, WhileGraphNodeExecutor, UntilGraphNodeExecutor, CodeGraphNodeExecutor, LogGraphNodeExecutor, SwitchGraphNodeExecutor, BreakGraphNodeExecutor, IsolatedVmCodeSandboxEvaluator, } from "./../../graph/index.js";
|
|
12
12
|
import { GraphBreakSignal } from "./../../graph/engine/errors/GraphBreakSignal.js";
|
|
@@ -86,6 +86,7 @@ export function createDemoEngineConfig() {
|
|
|
86
86
|
registry.register("core.loop.until", new UntilGraphNodeExecutor(engine));
|
|
87
87
|
registry.register("core.flow.code", new CodeGraphNodeExecutor(engine));
|
|
88
88
|
registry.register("core.flow.log", new LogGraphNodeExecutor());
|
|
89
|
+
registry.register("core.utility.log", new LogGraphNodeExecutor());
|
|
89
90
|
registry.register("core.flow.switch", new SwitchGraphNodeExecutor(engine));
|
|
90
91
|
registry.register("core.flow.break", new BreakGraphNodeExecutor());
|
|
91
92
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphExecutorRegistryFactory.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphExecutorRegistryFactory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EACL,yBAAyB,EAKzB,wBAAwB,EACxB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,GAC/B,+BA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,CAAC,CAAC;YAC7E,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;YACzE,QAAQ,CAAC,QAAQ,CAAC,gBAAgB,EAAE,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAAC;YACvE,QAAQ,CAAC,QAAQ,CAAC,eAAe,EAAE,IAAI,oBAAoB,EAAE,CAAC,CAAC;YAC/D,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,oBAAoB,EAAE,CAAC,CAAC;YAClE,QAAQ,CAAC,QAAQ,CAAC,kBAAkB,EAAE,IAAI,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;YAC3E,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,EAAE,IAAI,sBAAsB,EAAE,CAAC,CAAC;QACrE,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -7,9 +7,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
|
-
import {
|
|
11
|
-
import { column, pk, table } from "@decaf-ts/core";
|
|
12
|
-
let GraphWorkflowModel = class GraphWorkflowModel extends
|
|
10
|
+
import { model } from "@decaf-ts/decorator-validation";
|
|
11
|
+
import { BaseModel, column, pk, table } from "@decaf-ts/core";
|
|
12
|
+
let GraphWorkflowModel = class GraphWorkflowModel extends BaseModel {
|
|
13
13
|
constructor(arg) {
|
|
14
14
|
super(arg);
|
|
15
15
|
}
|
|
@@ -22,10 +22,6 @@ __decorate([
|
|
|
22
22
|
column(),
|
|
23
23
|
__metadata("design:type", Object)
|
|
24
24
|
], GraphWorkflowModel.prototype, "snapshot", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
column(),
|
|
27
|
-
__metadata("design:type", Date)
|
|
28
|
-
], GraphWorkflowModel.prototype, "updatedAt", void 0);
|
|
29
25
|
GraphWorkflowModel = __decorate([
|
|
30
26
|
table("graph_workflow_snapshot"),
|
|
31
27
|
model(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphWorkflowModel.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphWorkflowModel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"GraphWorkflowModel.js","sourceRoot":"","sources":["../../../../src/nest/graph/GraphWorkflowModel.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAIvD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,SAAS;IAO/C,YAAY,GAAiC;QAC3C,KAAK,CAAC,GAAG,CAAC,CAAC;IACb,CAAC;CACF,CAAA;AARC;IADC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;;sDACnB;AAGpB;IADC,MAAM,EAAE;;oDAC0B;AALxB,kBAAkB;IAF9B,KAAK,CAAC,yBAAyB,CAAC;IAChC,KAAK,EAAE;;GACK,kBAAkB,CAU9B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/user-requests
|
|
3
|
+
* @summary User Request Resolution Engine surface exported to integrations
|
|
4
|
+
* consumers.
|
|
5
|
+
* @description Re-exports the `@decaf-ts/ui-decorators/user-requests` barrel so
|
|
6
|
+
* integrations packages can hand user-request handling to app consumers
|
|
7
|
+
* through a flat entry point.
|
|
8
|
+
*/
|
|
9
|
+
export * from '@decaf-ts/ui-decorators/user-requests';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/user-requests/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,uCAAuC,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionContext
|
|
3
3
|
* @summary Decaf Context for graph node execution.
|
|
4
|
-
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline.
|
|
4
|
+
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline. Each context also exposes a run-scoped `ctx.logger` (DECAF-48 §4.3) bound to the executing node's `runId` / `workflowId` / `nodeId` / `user`, so every log line streams over `graph.run.log` with the DECAF-9 custom attributes.
|
|
5
5
|
*/
|
|
6
6
|
import { Context } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphNodeDefinition, GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
8
|
+
import type { Logger } from "@decaf-ts/logging";
|
|
8
9
|
import type { GraphExecutionEvent, GraphRunId } from "../types.d.cts";
|
|
9
10
|
/**
|
|
10
11
|
* Context passed to every graph node executor.
|
|
@@ -12,7 +13,8 @@ import type { GraphExecutionEvent, GraphRunId } from "../types.d.cts";
|
|
|
12
13
|
* Mirrors the `TaskEngine` / `TaskContext` pattern: the engine creates a
|
|
13
14
|
* `GraphExecutionContext` per node execution and passes it to
|
|
14
15
|
* `executor.execute(inputs, context)`. The executor uses `context.progress(...)`
|
|
15
|
-
* and `context.log(...)` to report intermediate state.
|
|
16
|
+
* and `context.log(...)` to report intermediate state, and `context.logger`
|
|
17
|
+
* to emit structured run log lines (DECAF-48 §4.3).
|
|
16
18
|
*/
|
|
17
19
|
export declare class GraphExecutionContext extends Context {
|
|
18
20
|
readonly runId: GraphRunId;
|
|
@@ -22,6 +24,7 @@ export declare class GraphExecutionContext extends Context {
|
|
|
22
24
|
readonly path: string[];
|
|
23
25
|
private readonly emitFn;
|
|
24
26
|
readonly metadata: Record<string, unknown>;
|
|
27
|
+
private readonly runLogger?;
|
|
25
28
|
/**
|
|
26
29
|
* @param runId - Unique identifier for the current execution run.
|
|
27
30
|
* @param parentRunId - Run id of the parent execution (for nested loop bodies).
|
|
@@ -32,6 +35,13 @@ export declare class GraphExecutionContext extends Context {
|
|
|
32
35
|
* @param metadata - Free-form metadata attached to this context.
|
|
33
36
|
*/
|
|
34
37
|
constructor(runId: GraphRunId, parentRunId: GraphRunId | undefined, workflow: GraphWorkflowDefinition, node: GraphNodeDefinition, path: string[], emitFn: (event: Partial<GraphExecutionEvent>) => Promise<void>, metadata?: Record<string, unknown>);
|
|
38
|
+
/**
|
|
39
|
+
* The decaf-ts {@link Logger} bound to this node's run context. Every log
|
|
40
|
+
* line carries the DECAF-48 attributes (`nodeId` / `workflowId` / `runId` /
|
|
41
|
+
* `user`) and is forwarded onto the existing graph execution Observable as
|
|
42
|
+
* a `GRAPH_RUN_LOG` event (streamed over the `graph.run.log` SSE channel).
|
|
43
|
+
*/
|
|
44
|
+
get logger(): Logger;
|
|
35
45
|
/**
|
|
36
46
|
* Emits a partial graph execution event. The engine fills in runId,
|
|
37
47
|
* parentRunId, workflowId, nodeId, and path automatically.
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionContext
|
|
3
3
|
* @summary Decaf Context for graph node execution.
|
|
4
|
-
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline.
|
|
4
|
+
* @description Extends Decaf's {@link Context} so node executors receive the same contextual plumbing as task handlers. Executors use the context to emit progress, log messages, and report state through the engine's observer pipeline. Each context also exposes a run-scoped `ctx.logger` (DECAF-48 §4.3) bound to the executing node's `runId` / `workflowId` / `nodeId` / `user`, so every log line streams over `graph.run.log` with the DECAF-9 custom attributes.
|
|
5
5
|
*/
|
|
6
6
|
import { Context } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphNodeDefinition, GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
8
|
+
import type { Logger } from "@decaf-ts/logging";
|
|
8
9
|
import type { GraphExecutionEvent, GraphRunId } from "../types.d.mts";
|
|
9
10
|
/**
|
|
10
11
|
* Context passed to every graph node executor.
|
|
@@ -12,7 +13,8 @@ import type { GraphExecutionEvent, GraphRunId } from "../types.d.mts";
|
|
|
12
13
|
* Mirrors the `TaskEngine` / `TaskContext` pattern: the engine creates a
|
|
13
14
|
* `GraphExecutionContext` per node execution and passes it to
|
|
14
15
|
* `executor.execute(inputs, context)`. The executor uses `context.progress(...)`
|
|
15
|
-
* and `context.log(...)` to report intermediate state.
|
|
16
|
+
* and `context.log(...)` to report intermediate state, and `context.logger`
|
|
17
|
+
* to emit structured run log lines (DECAF-48 §4.3).
|
|
16
18
|
*/
|
|
17
19
|
export declare class GraphExecutionContext extends Context {
|
|
18
20
|
readonly runId: GraphRunId;
|
|
@@ -22,6 +24,7 @@ export declare class GraphExecutionContext extends Context {
|
|
|
22
24
|
readonly path: string[];
|
|
23
25
|
private readonly emitFn;
|
|
24
26
|
readonly metadata: Record<string, unknown>;
|
|
27
|
+
private readonly runLogger?;
|
|
25
28
|
/**
|
|
26
29
|
* @param runId - Unique identifier for the current execution run.
|
|
27
30
|
* @param parentRunId - Run id of the parent execution (for nested loop bodies).
|
|
@@ -32,6 +35,13 @@ export declare class GraphExecutionContext extends Context {
|
|
|
32
35
|
* @param metadata - Free-form metadata attached to this context.
|
|
33
36
|
*/
|
|
34
37
|
constructor(runId: GraphRunId, parentRunId: GraphRunId | undefined, workflow: GraphWorkflowDefinition, node: GraphNodeDefinition, path: string[], emitFn: (event: Partial<GraphExecutionEvent>) => Promise<void>, metadata?: Record<string, unknown>);
|
|
38
|
+
/**
|
|
39
|
+
* The decaf-ts {@link Logger} bound to this node's run context. Every log
|
|
40
|
+
* line carries the DECAF-48 attributes (`nodeId` / `workflowId` / `runId` /
|
|
41
|
+
* `user`) and is forwarded onto the existing graph execution Observable as
|
|
42
|
+
* a `GRAPH_RUN_LOG` event (streamed over the `graph.run.log` SSE channel).
|
|
43
|
+
*/
|
|
44
|
+
get logger(): Logger;
|
|
35
45
|
/**
|
|
36
46
|
* Emits a partial graph execution event. The engine fills in runId,
|
|
37
47
|
* parentRunId, workflowId, nodeId, and path automatically.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionEngine
|
|
3
3
|
* @summary Reference graph execution engine.
|
|
4
|
-
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result.
|
|
4
|
+
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result. Per DECAF-48 §4.4 it also emits `NODE_STATE_CHANGED` / `EDGE_STATE_CHANGED` visual-state events on the same pipeline, and node executors log through the run-scoped `ctx.logger` (streamed over the `graph.run.log` SSE channel).
|
|
5
5
|
*/
|
|
6
6
|
import type { Observable } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
@@ -56,11 +56,33 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
56
56
|
readonly codeSandboxEvaluator?: CodeSandboxEvaluator;
|
|
57
57
|
constructor(config: GraphExecutionEngineConfig);
|
|
58
58
|
private readonly config;
|
|
59
|
+
/**
|
|
60
|
+
* Registers an observer on the engine's event pipeline.
|
|
61
|
+
*
|
|
62
|
+
* @param observer - The observer to register.
|
|
63
|
+
* @returns An unsubscribe function that removes the observer.
|
|
64
|
+
*/
|
|
59
65
|
observe(observer: GraphExecutionObserver): () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Unregisters an observer from the engine's event pipeline.
|
|
68
|
+
*
|
|
69
|
+
* @param observer - The observer to remove.
|
|
70
|
+
*/
|
|
60
71
|
unObserve(observer: GraphExecutionObserver): void;
|
|
72
|
+
/**
|
|
73
|
+
* Dispatches an event to all registered observers.
|
|
74
|
+
*
|
|
75
|
+
* @param event - The event to distribute.
|
|
76
|
+
*/
|
|
61
77
|
updateObservers(event: GraphExecutionEvent): Promise<void>;
|
|
62
78
|
/**
|
|
63
79
|
* Executes a workflow with the given inputs and options.
|
|
80
|
+
*
|
|
81
|
+
* @param workflow - The workflow definition to execute.
|
|
82
|
+
* @param inputs - Workflow input values keyed by input port name.
|
|
83
|
+
* @param options - Optional execution overrides (merged over the defaults).
|
|
84
|
+
* @returns The complete execution result, including a `runId`, per-node
|
|
85
|
+
* results, and workflow outputs (or the failure payload).
|
|
64
86
|
*/
|
|
65
87
|
execute(workflow: GraphWorkflowDefinition, inputs?: GraphExecutionValues, options?: GraphExecutionOptions): Promise<GraphExecutionResult>;
|
|
66
88
|
/**
|
|
@@ -120,6 +142,17 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
120
142
|
* Emits an event, records it in the frame, and dispatches to observers.
|
|
121
143
|
*/
|
|
122
144
|
private emitEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
147
|
+
* visual state for the node. Rides the existing Observable pipeline; no
|
|
148
|
+
* second out-of-band channel.
|
|
149
|
+
*/
|
|
150
|
+
private emitNodeStateChanged;
|
|
151
|
+
/**
|
|
152
|
+
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
153
|
+
* visual state for a routed edge.
|
|
154
|
+
*/
|
|
155
|
+
private emitEdgeStateChanged;
|
|
123
156
|
/**
|
|
124
157
|
* Merges default options with the given options.
|
|
125
158
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module integrations/graph/execution/GraphExecutionEngine
|
|
3
3
|
* @summary Reference graph execution engine.
|
|
4
|
-
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result.
|
|
4
|
+
* @description Executes graph workflows declared with `@decaf-ts/ui-decorators/graph`, emits events through Decaf's Observable pipeline, supports parallel node execution within topological layers, and returns a complete execution result. Per DECAF-48 §4.4 it also emits `NODE_STATE_CHANGED` / `EDGE_STATE_CHANGED` visual-state events on the same pipeline, and node executors log through the run-scoped `ctx.logger` (streamed over the `graph.run.log` SSE channel).
|
|
5
5
|
*/
|
|
6
6
|
import type { Observable } from "@decaf-ts/core";
|
|
7
7
|
import type { GraphWorkflowDefinition } from "@decaf-ts/ui-decorators/graph";
|
|
@@ -56,11 +56,33 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
56
56
|
readonly codeSandboxEvaluator?: CodeSandboxEvaluator;
|
|
57
57
|
constructor(config: GraphExecutionEngineConfig);
|
|
58
58
|
private readonly config;
|
|
59
|
+
/**
|
|
60
|
+
* Registers an observer on the engine's event pipeline.
|
|
61
|
+
*
|
|
62
|
+
* @param observer - The observer to register.
|
|
63
|
+
* @returns An unsubscribe function that removes the observer.
|
|
64
|
+
*/
|
|
59
65
|
observe(observer: GraphExecutionObserver): () => void;
|
|
66
|
+
/**
|
|
67
|
+
* Unregisters an observer from the engine's event pipeline.
|
|
68
|
+
*
|
|
69
|
+
* @param observer - The observer to remove.
|
|
70
|
+
*/
|
|
60
71
|
unObserve(observer: GraphExecutionObserver): void;
|
|
72
|
+
/**
|
|
73
|
+
* Dispatches an event to all registered observers.
|
|
74
|
+
*
|
|
75
|
+
* @param event - The event to distribute.
|
|
76
|
+
*/
|
|
61
77
|
updateObservers(event: GraphExecutionEvent): Promise<void>;
|
|
62
78
|
/**
|
|
63
79
|
* Executes a workflow with the given inputs and options.
|
|
80
|
+
*
|
|
81
|
+
* @param workflow - The workflow definition to execute.
|
|
82
|
+
* @param inputs - Workflow input values keyed by input port name.
|
|
83
|
+
* @param options - Optional execution overrides (merged over the defaults).
|
|
84
|
+
* @returns The complete execution result, including a `runId`, per-node
|
|
85
|
+
* results, and workflow outputs (or the failure payload).
|
|
64
86
|
*/
|
|
65
87
|
execute(workflow: GraphWorkflowDefinition, inputs?: GraphExecutionValues, options?: GraphExecutionOptions): Promise<GraphExecutionResult>;
|
|
66
88
|
/**
|
|
@@ -120,6 +142,17 @@ export declare class GraphExecutionEngine implements Observable<[GraphExecutionO
|
|
|
120
142
|
* Emits an event, records it in the frame, and dispatches to observers.
|
|
121
143
|
*/
|
|
122
144
|
private emitEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Emits a `NODE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
147
|
+
* visual state for the node. Rides the existing Observable pipeline; no
|
|
148
|
+
* second out-of-band channel.
|
|
149
|
+
*/
|
|
150
|
+
private emitNodeStateChanged;
|
|
151
|
+
/**
|
|
152
|
+
* Emits an `EDGE_STATE_CHANGED` event (DECAF-48 §4.4) carrying the given
|
|
153
|
+
* visual state for a routed edge.
|
|
154
|
+
*/
|
|
155
|
+
private emitEdgeStateChanged;
|
|
123
156
|
/**
|
|
124
157
|
* Merges default options with the given options.
|
|
125
158
|
*/
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module integrations/graph/execution/LogGraphNodeExecutor
|
|
3
|
-
* @summary Executor for the Log flow-control node.
|
|
4
|
-
* @description Logs the input value via the execution context's logger and
|
|
5
|
-
* forwards it unchanged on the `logged` output port. Useful for debugging,
|
|
6
|
-
* audit trails, and discard/side-effect branches in a workflow.
|
|
7
|
-
*/
|
|
8
1
|
import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.cts";
|
|
9
2
|
import type { GraphExecutionContext } from "./GraphExecutionContext.d.cts";
|
|
10
3
|
import type { GraphExecutionValues } from "../types.d.cts";
|
|
11
4
|
/**
|
|
12
|
-
* Executor for `core.flow.log` nodes.
|
|
5
|
+
* Executor for `core.utility.log` / `core.flow.log` nodes.
|
|
13
6
|
*
|
|
14
|
-
* Reads the `value` input port, logs it through `context.
|
|
15
|
-
* it unchanged on the `logged` output port.
|
|
7
|
+
* Reads the `value` input port, logs it through `context.logger` at the
|
|
8
|
+
* configured level, and returns it unchanged on the `logged` output port.
|
|
16
9
|
*/
|
|
17
10
|
export declare class LogGraphNodeExecutor implements GraphNodeExecutor {
|
|
11
|
+
/**
|
|
12
|
+
* Logs the `value` input through the run's `ctx.logger` and forwards it
|
|
13
|
+
* unchanged on the `logged` output port.
|
|
14
|
+
*
|
|
15
|
+
* The level is read from the node's UI config (`node.props.level`, see
|
|
16
|
+
* {@link logLevelOf}) and defaults to `info`. The emitted log line carries
|
|
17
|
+
* the DECAF-48 run attributes and streams over `graph.run.log` through the
|
|
18
|
+
* shared `ctx.logger` path (DECAF-48 Req-1).
|
|
19
|
+
*
|
|
20
|
+
* @param input - Resolved input values keyed by port name (expects `value`).
|
|
21
|
+
* @param context - The run-scoped execution context exposing `ctx.logger`.
|
|
22
|
+
* @returns The node's output values keyed by port name (the `logged` port).
|
|
23
|
+
*/
|
|
18
24
|
execute(input: GraphExecutionValues, context: GraphExecutionContext): Promise<GraphExecutionValues>;
|
|
19
25
|
}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module integrations/graph/execution/LogGraphNodeExecutor
|
|
3
|
-
* @summary Executor for the Log flow-control node.
|
|
4
|
-
* @description Logs the input value via the execution context's logger and
|
|
5
|
-
* forwards it unchanged on the `logged` output port. Useful for debugging,
|
|
6
|
-
* audit trails, and discard/side-effect branches in a workflow.
|
|
7
|
-
*/
|
|
8
1
|
import type { GraphNodeExecutor } from "./GraphNodeExecutor.d.mts";
|
|
9
2
|
import type { GraphExecutionContext } from "./GraphExecutionContext.d.mts";
|
|
10
3
|
import type { GraphExecutionValues } from "../types.d.mts";
|
|
11
4
|
/**
|
|
12
|
-
* Executor for `core.flow.log` nodes.
|
|
5
|
+
* Executor for `core.utility.log` / `core.flow.log` nodes.
|
|
13
6
|
*
|
|
14
|
-
* Reads the `value` input port, logs it through `context.
|
|
15
|
-
* it unchanged on the `logged` output port.
|
|
7
|
+
* Reads the `value` input port, logs it through `context.logger` at the
|
|
8
|
+
* configured level, and returns it unchanged on the `logged` output port.
|
|
16
9
|
*/
|
|
17
10
|
export declare class LogGraphNodeExecutor implements GraphNodeExecutor {
|
|
11
|
+
/**
|
|
12
|
+
* Logs the `value` input through the run's `ctx.logger` and forwards it
|
|
13
|
+
* unchanged on the `logged` output port.
|
|
14
|
+
*
|
|
15
|
+
* The level is read from the node's UI config (`node.props.level`, see
|
|
16
|
+
* {@link logLevelOf}) and defaults to `info`. The emitted log line carries
|
|
17
|
+
* the DECAF-48 run attributes and streams over `graph.run.log` through the
|
|
18
|
+
* shared `ctx.logger` path (DECAF-48 Req-1).
|
|
19
|
+
*
|
|
20
|
+
* @param input - Resolved input values keyed by port name (expects `value`).
|
|
21
|
+
* @param context - The run-scoped execution context exposing `ctx.logger`.
|
|
22
|
+
* @returns The node's output values keyed by port name (the `logged` port).
|
|
23
|
+
*/
|
|
18
24
|
execute(input: GraphExecutionValues, context: GraphExecutionContext): Promise<GraphExecutionValues>;
|
|
19
25
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Logger, LogMeta, StringLike } from "@decaf-ts/logging";
|
|
2
|
+
import type { GraphExecutionEvent } from "../shared/types.d.cts";
|
|
3
|
+
/**
|
|
4
|
+
* Signature of the context's event emitter used to forward log entries onto
|
|
5
|
+
* the existing graph execution Observable.
|
|
6
|
+
*/
|
|
7
|
+
export type GraphLogForwardFn = (event: Partial<GraphExecutionEvent>) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Options for constructing a {@link GraphRunLogger}.
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphRunLoggerOptions {
|
|
12
|
+
runId: string;
|
|
13
|
+
workflowId: string;
|
|
14
|
+
nodeId: string;
|
|
15
|
+
user?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Callback that forwards a structured log entry to the graph execution
|
|
18
|
+
* Observable (emits a `GRAPH_RUN_LOG` event). Errors are swallowed.
|
|
19
|
+
*/
|
|
20
|
+
forward: GraphLogForwardFn;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Logger used by graph node executors (`ctx.logger`).
|
|
24
|
+
*
|
|
25
|
+
* Wraps the shared MiniLogger pipeline so the DECAF-48 attributes render as
|
|
26
|
+
* discrete custom attributes in the formatted output, and forwards each
|
|
27
|
+
* structured entry through {@link GraphRunLoggerOptions.forward} so the SSE
|
|
28
|
+
* log channel (`graph.run.log`) receives the level/message/attributes/
|
|
29
|
+
* timestamp payload.
|
|
30
|
+
*/
|
|
31
|
+
export declare class GraphRunLogger implements Logger {
|
|
32
|
+
private readonly inner;
|
|
33
|
+
private readonly baseOptions;
|
|
34
|
+
constructor(options: GraphRunLoggerOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Produces the `Partial<LoggingConfig>` carrying the DECAF-48 attributes
|
|
37
|
+
* so the LogParameter descriptors render them (DECAF-9 §4.6).
|
|
38
|
+
*/
|
|
39
|
+
private attributeConfig;
|
|
40
|
+
/** Emits a structured log entry synchronously (forward is fire-and-forget). */
|
|
41
|
+
private emit;
|
|
42
|
+
/** @inheritdoc */
|
|
43
|
+
benchmark(msg: StringLike, meta?: LogMeta): void;
|
|
44
|
+
/** @inheritdoc */
|
|
45
|
+
fatal(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
46
|
+
/** @inheritdoc */
|
|
47
|
+
critical(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
silly(msg: StringLike, verbosity?: number | LogMeta, meta?: LogMeta): void;
|
|
50
|
+
/** @inheritdoc */
|
|
51
|
+
trace(msg: StringLike, meta?: LogMeta): void;
|
|
52
|
+
/** @inheritdoc */
|
|
53
|
+
verbose(msg: StringLike, verbosity?: number | LogMeta, meta?: LogMeta): void;
|
|
54
|
+
/** @inheritdoc */
|
|
55
|
+
info(msg: StringLike, meta?: LogMeta): void;
|
|
56
|
+
/** @inheritdoc */
|
|
57
|
+
error(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
warn(msg: StringLike, meta?: LogMeta): void;
|
|
60
|
+
/** @inheritdoc */
|
|
61
|
+
debug(msg: StringLike, meta?: LogMeta): void;
|
|
62
|
+
/** @inheritdoc */
|
|
63
|
+
setConfig(): void;
|
|
64
|
+
/** @inheritdoc */
|
|
65
|
+
for(_method?: string | ((...args: any[]) => any) | {
|
|
66
|
+
new (...args: any[]): any;
|
|
67
|
+
} | object | Partial<any>, _config?: Partial<any>, ..._args: any[]): this;
|
|
68
|
+
/** @inheritdoc */
|
|
69
|
+
clear(): this;
|
|
70
|
+
/** @inheritdoc */
|
|
71
|
+
get root(): string[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { Logger, LogMeta, StringLike } from "@decaf-ts/logging";
|
|
2
|
+
import type { GraphExecutionEvent } from "../shared/types.d.mts";
|
|
3
|
+
/**
|
|
4
|
+
* Signature of the context's event emitter used to forward log entries onto
|
|
5
|
+
* the existing graph execution Observable.
|
|
6
|
+
*/
|
|
7
|
+
export type GraphLogForwardFn = (event: Partial<GraphExecutionEvent>) => Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Options for constructing a {@link GraphRunLogger}.
|
|
10
|
+
*/
|
|
11
|
+
export interface GraphRunLoggerOptions {
|
|
12
|
+
runId: string;
|
|
13
|
+
workflowId: string;
|
|
14
|
+
nodeId: string;
|
|
15
|
+
user?: string | null;
|
|
16
|
+
/**
|
|
17
|
+
* Callback that forwards a structured log entry to the graph execution
|
|
18
|
+
* Observable (emits a `GRAPH_RUN_LOG` event). Errors are swallowed.
|
|
19
|
+
*/
|
|
20
|
+
forward: GraphLogForwardFn;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Logger used by graph node executors (`ctx.logger`).
|
|
24
|
+
*
|
|
25
|
+
* Wraps the shared MiniLogger pipeline so the DECAF-48 attributes render as
|
|
26
|
+
* discrete custom attributes in the formatted output, and forwards each
|
|
27
|
+
* structured entry through {@link GraphRunLoggerOptions.forward} so the SSE
|
|
28
|
+
* log channel (`graph.run.log`) receives the level/message/attributes/
|
|
29
|
+
* timestamp payload.
|
|
30
|
+
*/
|
|
31
|
+
export declare class GraphRunLogger implements Logger {
|
|
32
|
+
private readonly inner;
|
|
33
|
+
private readonly baseOptions;
|
|
34
|
+
constructor(options: GraphRunLoggerOptions);
|
|
35
|
+
/**
|
|
36
|
+
* Produces the `Partial<LoggingConfig>` carrying the DECAF-48 attributes
|
|
37
|
+
* so the LogParameter descriptors render them (DECAF-9 §4.6).
|
|
38
|
+
*/
|
|
39
|
+
private attributeConfig;
|
|
40
|
+
/** Emits a structured log entry synchronously (forward is fire-and-forget). */
|
|
41
|
+
private emit;
|
|
42
|
+
/** @inheritdoc */
|
|
43
|
+
benchmark(msg: StringLike, meta?: LogMeta): void;
|
|
44
|
+
/** @inheritdoc */
|
|
45
|
+
fatal(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
46
|
+
/** @inheritdoc */
|
|
47
|
+
critical(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
silly(msg: StringLike, verbosity?: number | LogMeta, meta?: LogMeta): void;
|
|
50
|
+
/** @inheritdoc */
|
|
51
|
+
trace(msg: StringLike, meta?: LogMeta): void;
|
|
52
|
+
/** @inheritdoc */
|
|
53
|
+
verbose(msg: StringLike, verbosity?: number | LogMeta, meta?: LogMeta): void;
|
|
54
|
+
/** @inheritdoc */
|
|
55
|
+
info(msg: StringLike, meta?: LogMeta): void;
|
|
56
|
+
/** @inheritdoc */
|
|
57
|
+
error(msg: StringLike | Error, error?: Error | LogMeta, meta?: LogMeta): void;
|
|
58
|
+
/** @inheritdoc */
|
|
59
|
+
warn(msg: StringLike, meta?: LogMeta): void;
|
|
60
|
+
/** @inheritdoc */
|
|
61
|
+
debug(msg: StringLike, meta?: LogMeta): void;
|
|
62
|
+
/** @inheritdoc */
|
|
63
|
+
setConfig(): void;
|
|
64
|
+
/** @inheritdoc */
|
|
65
|
+
for(_method?: string | ((...args: any[]) => any) | {
|
|
66
|
+
new (...args: any[]): any;
|
|
67
|
+
} | object | Partial<any>, _config?: Partial<any>, ..._args: any[]): this;
|
|
68
|
+
/** @inheritdoc */
|
|
69
|
+
clear(): this;
|
|
70
|
+
/** @inheritdoc */
|
|
71
|
+
get root(): string[];
|
|
72
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers the four DECAF-48 run attributes as log parameter descriptors
|
|
3
|
+
* (nodeId / workflowId / runId / user). Rendered only when keyed with a
|
|
4
|
+
* non-null value so one-shot module imports from other packages never leak
|
|
5
|
+
* empty columns.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerGraphRunLogParameters(): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registers the four DECAF-48 run attributes as log parameter descriptors
|
|
3
|
+
* (nodeId / workflowId / runId / user). Rendered only when keyed with a
|
|
4
|
+
* non-null value so one-shot module imports from other packages never leak
|
|
5
|
+
* empty columns.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerGraphRunLogParameters(): void;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module integrations/graph/shared/GraphExecutionStateMapper
|
|
3
|
+
* @summary Maps engine state to the frontend-safe visual-state contract.
|
|
4
|
+
* @description Pure, engine-agnostic helpers that derive
|
|
5
|
+
* {@link GraphVisualState} values from engine execution signals. Frontend
|
|
6
|
+
* bundles may import this from `@decaf-ts/integrations/graph/shared` (no
|
|
7
|
+
* engine runtime dependency); a future Mastra/NestJS driver maps its own
|
|
8
|
+
* runtime states onto {@link GraphVisualState} with the same rules.
|
|
9
|
+
*/
|
|
10
|
+
import type { GraphExecutionEvent } from "./types.d.cts";
|
|
11
|
+
import { GraphExecutionStatus, GraphVisualState } from "./constants.d.cts";
|
|
12
|
+
/**
|
|
13
|
+
* Maps an engine execution {@link GraphExecutionStatus} to the shared visual
|
|
14
|
+
* state. `CACHED` collapses onto {@link GraphVisualState.SUCCEEDED} for
|
|
15
|
+
* rendering; `CANCELLED`/`PENDING`/`PLANNING` yield `IDLE`.
|
|
16
|
+
*
|
|
17
|
+
* @param status - The engine execution status, if any.
|
|
18
|
+
* @returns The visual state for the node/edge.
|
|
19
|
+
*/
|
|
20
|
+
export declare function mapExecutionStatus(status?: GraphExecutionStatus): GraphVisualState;
|
|
21
|
+
/**
|
|
22
|
+
* Options describing a single node's position within a run (DECAF-48 §4.4).
|
|
23
|
+
*/
|
|
24
|
+
export interface GraphVisualStateDerivation {
|
|
25
|
+
/** Whether the node has already executed (any terminal engine status). */
|
|
26
|
+
executed: boolean;
|
|
27
|
+
/** Whether the node is currently running. */
|
|
28
|
+
running: boolean;
|
|
29
|
+
/** Whether the node completed successfully (or from cache). */
|
|
30
|
+
succeeded?: boolean;
|
|
31
|
+
/** Whether the node failed. */
|
|
32
|
+
failed?: boolean;
|
|
33
|
+
/** Number of incoming edges that have completed value routing. */
|
|
34
|
+
completedUpstreams?: number;
|
|
35
|
+
/** Total number of incoming edges for the node. */
|
|
36
|
+
upstreamCount?: number;
|
|
37
|
+
/** Whether the node is reachable from the workflow inputs in the plan. */
|
|
38
|
+
reachable?: boolean;
|
|
39
|
+
/** Whether the whole run has failed (unexecuted nodes then fade/disable). */
|
|
40
|
+
runFailed?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Derives the visual state for one node from its execution signals.
|
|
44
|
+
*
|
|
45
|
+
* Rules (DECAF-48 §4.4 / Req-5/Req-6):
|
|
46
|
+
* - currently running → {@link GraphVisualState.RUNNING}
|
|
47
|
+
* - failed → {@link GraphVisualState.FAILED}
|
|
48
|
+
* - executed and succeeded (or from cache) → {@link GraphVisualState.SUCCEEDED}
|
|
49
|
+
* - unexecuted and reachable with incomplete upstream deps → {@link GraphVisualState.BLOCKED}
|
|
50
|
+
* - unexecuted with `runFailed` → {@link GraphVisualState.SKIPPED} (faded/disabled)
|
|
51
|
+
* - otherwise → {@link GraphVisualState.IDLE}
|
|
52
|
+
*
|
|
53
|
+
* @param options - The node execution signals.
|
|
54
|
+
* @returns The derived visual state.
|
|
55
|
+
*/
|
|
56
|
+
export declare function deriveNodeVisualState(options: GraphVisualStateDerivation): GraphVisualState;
|
|
57
|
+
/**
|
|
58
|
+
* Translates a {@link GraphExecutionEvent} into a node visual state when the
|
|
59
|
+
* event carries enough information. Used by contract conformance checks and
|
|
60
|
+
* engine-agnostic consumers that derive state from the shared event stream.
|
|
61
|
+
*
|
|
62
|
+
* @param event - The graph execution event.
|
|
63
|
+
* @returns The corresponding {@link GraphVisualState}, or `IDLE` when the
|
|
64
|
+
* event does not indicate a specific visual transition.
|
|
65
|
+
*/
|
|
66
|
+
export declare function visualStateOfEvent(event: GraphExecutionEvent): GraphVisualState;
|