@decaf-ts/as-graph 0.2.0 → 0.2.1
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 +4 -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/engine/index.cjs +1 -0
- package/lib/cjs/engine/index.cjs.map +1 -1
- package/lib/cjs/engine/loops/ConditionEvaluator.cjs +116 -0
- package/lib/cjs/engine/loops/ConditionEvaluator.cjs.map +1 -0
- package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs +25 -2
- package/lib/cjs/engine/loops/GraphConditionEvaluator.cjs.map +1 -1
- package/lib/cjs/engine/loops/index.cjs +1 -0
- package/lib/cjs/engine/loops/index.cjs.map +1 -1
- package/lib/cjs/engine/runs/GraphRunService.cjs +60 -3
- package/lib/cjs/engine/runs/GraphRunService.cjs.map +1 -1
- package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs +33 -0
- package/lib/cjs/engine/runs/InMemoryGraphRunStore.cjs.map +1 -1
- package/lib/cjs/engine/runs/ownership.cjs +100 -11
- package/lib/cjs/engine/runs/ownership.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphRunModelService.cjs +16 -0
- package/lib/cjs/engine/services/GraphRunModelService.cjs.map +1 -1
- package/lib/cjs/engine/services/GraphWorkflowService.cjs +122 -4
- package/lib/cjs/engine/services/GraphWorkflowService.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphRunController.cjs +208 -28
- package/lib/cjs/nest/graph/GraphRunController.cjs.map +1 -1
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs +97 -14
- package/lib/cjs/nest/graph/GraphWorkflowController.cjs.map +1 -1
- package/lib/cjs/nest/graph/servingDates.cjs +53 -0
- package/lib/cjs/nest/graph/servingDates.cjs.map +1 -0
- package/lib/cjs/nest/graph/servingErrors.cjs +65 -0
- package/lib/cjs/nest/graph/servingErrors.cjs.map +1 -0
- package/lib/cjs/node/flow/if/node.cjs +27 -9
- package/lib/cjs/node/flow/if/node.cjs.map +1 -1
- package/lib/cjs/node/flow/loop/until/node.cjs +5 -2
- package/lib/cjs/node/flow/loop/until/node.cjs.map +1 -1
- package/lib/cjs/node/flow/loop/while/node.cjs +8 -2
- package/lib/cjs/node/flow/loop/while/node.cjs.map +1 -1
- package/lib/cjs/node/flow/switch/node.cjs +2 -37
- package/lib/cjs/node/flow/switch/node.cjs.map +1 -1
- package/lib/cjs/ram/GraphRunStore.cjs +14 -0
- package/lib/cjs/ram/GraphRunStore.cjs.map +1 -1
- package/lib/esm/engine/index.js +1 -0
- package/lib/esm/engine/index.js.map +1 -1
- package/lib/esm/engine/loops/ConditionEvaluator.js +108 -0
- package/lib/esm/engine/loops/ConditionEvaluator.js.map +1 -0
- package/lib/esm/engine/loops/GraphConditionEvaluator.js +25 -2
- package/lib/esm/engine/loops/GraphConditionEvaluator.js.map +1 -1
- package/lib/esm/engine/loops/index.js +1 -0
- package/lib/esm/engine/loops/index.js.map +1 -1
- package/lib/esm/engine/runs/GraphRunService.js +61 -4
- package/lib/esm/engine/runs/GraphRunService.js.map +1 -1
- package/lib/esm/engine/runs/InMemoryGraphRunStore.js +33 -0
- package/lib/esm/engine/runs/InMemoryGraphRunStore.js.map +1 -1
- package/lib/esm/engine/runs/ownership.js +97 -11
- package/lib/esm/engine/runs/ownership.js.map +1 -1
- package/lib/esm/engine/services/GraphRunModelService.js +16 -0
- package/lib/esm/engine/services/GraphRunModelService.js.map +1 -1
- package/lib/esm/engine/services/GraphWorkflowService.js +124 -6
- package/lib/esm/engine/services/GraphWorkflowService.js.map +1 -1
- package/lib/esm/nest/graph/GraphExecutionModule.js.map +1 -1
- package/lib/esm/nest/graph/GraphRunController.js +209 -29
- package/lib/esm/nest/graph/GraphRunController.js.map +1 -1
- package/lib/esm/nest/graph/GraphWorkflowController.js +98 -15
- package/lib/esm/nest/graph/GraphWorkflowController.js.map +1 -1
- package/lib/esm/nest/graph/servingDates.js +49 -0
- package/lib/esm/nest/graph/servingDates.js.map +1 -0
- package/lib/esm/nest/graph/servingErrors.js +60 -0
- package/lib/esm/nest/graph/servingErrors.js.map +1 -0
- package/lib/esm/node/flow/if/node.js +27 -9
- package/lib/esm/node/flow/if/node.js.map +1 -1
- package/lib/esm/node/flow/loop/until/node.js +5 -2
- package/lib/esm/node/flow/loop/until/node.js.map +1 -1
- package/lib/esm/node/flow/loop/while/node.js +8 -2
- package/lib/esm/node/flow/loop/while/node.js.map +1 -1
- package/lib/esm/node/flow/switch/node.js +2 -37
- package/lib/esm/node/flow/switch/node.js.map +1 -1
- package/lib/esm/ram/GraphRunStore.js +14 -0
- package/lib/esm/ram/GraphRunStore.js.map +1 -1
- package/lib/esm/shared/graph/document/GraphFlowBuilder.js.map +1 -1
- package/lib/types/engine/index.d.cts +1 -0
- package/lib/types/engine/index.d.mts +1 -0
- package/lib/types/engine/loops/ConditionEvaluator.d.cts +87 -0
- package/lib/types/engine/loops/ConditionEvaluator.d.mts +87 -0
- package/lib/types/engine/loops/GraphConditionEvaluator.d.cts +27 -7
- package/lib/types/engine/loops/GraphConditionEvaluator.d.mts +27 -7
- package/lib/types/engine/loops/index.d.cts +1 -0
- package/lib/types/engine/loops/index.d.mts +1 -0
- package/lib/types/engine/runs/GraphRunService.d.cts +41 -1
- package/lib/types/engine/runs/GraphRunService.d.mts +41 -1
- package/lib/types/engine/runs/InMemoryGraphRunStore.d.cts +29 -0
- package/lib/types/engine/runs/InMemoryGraphRunStore.d.mts +29 -0
- package/lib/types/engine/runs/ownership.d.cts +89 -4
- package/lib/types/engine/runs/ownership.d.mts +89 -4
- package/lib/types/engine/runs/types.d.cts +12 -1
- package/lib/types/engine/runs/types.d.mts +12 -1
- package/lib/types/engine/services/GraphRunModelService.d.cts +13 -0
- package/lib/types/engine/services/GraphRunModelService.d.mts +13 -0
- package/lib/types/engine/services/GraphWorkflowService.d.cts +52 -2
- package/lib/types/engine/services/GraphWorkflowService.d.mts +52 -2
- package/lib/types/engine/types.d.cts +11 -4
- package/lib/types/engine/types.d.mts +11 -4
- package/lib/types/nest/graph/GraphExecutionModule.d.cts +6 -1
- package/lib/types/nest/graph/GraphExecutionModule.d.mts +6 -1
- package/lib/types/nest/graph/GraphRunController.d.cts +69 -14
- package/lib/types/nest/graph/GraphRunController.d.mts +69 -14
- package/lib/types/nest/graph/GraphWorkflowController.d.cts +50 -17
- package/lib/types/nest/graph/GraphWorkflowController.d.mts +50 -17
- package/lib/types/nest/graph/servingDates.d.cts +35 -0
- package/lib/types/nest/graph/servingDates.d.mts +35 -0
- package/lib/types/nest/graph/servingErrors.d.cts +42 -0
- package/lib/types/nest/graph/servingErrors.d.mts +42 -0
- package/lib/types/node/flow/if/node.d.cts +20 -8
- package/lib/types/node/flow/if/node.d.mts +20 -8
- package/lib/types/node/flow/loop/until/node.d.cts +4 -1
- package/lib/types/node/flow/loop/until/node.d.mts +4 -1
- package/lib/types/node/flow/loop/while/node.d.cts +4 -1
- package/lib/types/node/flow/loop/while/node.d.mts +4 -1
- package/lib/types/ram/GraphRunStore.d.cts +12 -0
- package/lib/types/ram/GraphRunStore.d.mts +12 -0
- package/lib/types/shared/graph/document/GraphFlowBuilder.d.cts +5 -5
- package/lib/types/shared/graph/document/GraphFlowBuilder.d.mts +5 -5
- package/lib/types/shared/graph/types.d.cts +8 -1
- package/lib/types/shared/graph/types.d.mts +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constant generic `500` body served for any unmapped graph serving failure.
|
|
3
|
+
* Deliberately static: no dynamic content, no `e.message`, no `String(e)`.
|
|
4
|
+
*/
|
|
5
|
+
export declare const GRAPH_SERVING_INTERNAL_ERROR_MESSAGE = "Internal server error";
|
|
6
|
+
/** Logger context for the run lifecycle controller's server-side error log. */
|
|
7
|
+
export type GraphServingErrorLoggerContext = "GraphRunController" | "GraphWorkflowController";
|
|
8
|
+
/**
|
|
9
|
+
* Request/run correlation fields attached to a server-side graph serving error
|
|
10
|
+
* log. Only ids the server already resolved are included; the fields are never
|
|
11
|
+
* served to the client.
|
|
12
|
+
*/
|
|
13
|
+
export interface GraphServingErrorCorrelation {
|
|
14
|
+
/** Run id, when the failing operation was scoped to a run. */
|
|
15
|
+
runId?: string;
|
|
16
|
+
/** Workflow id, when the failing operation was scoped to a workflow. */
|
|
17
|
+
workflowId?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Logs an unmapped graph serving failure server-side, with the request
|
|
21
|
+
* correlation ids and the underlying error message/stack. The client receives the
|
|
22
|
+
* constant generic {@link GRAPH_SERVING_INTERNAL_ERROR_MESSAGE} instead; this log
|
|
23
|
+
* is the only place the underlying error detail is surfaced.
|
|
24
|
+
*
|
|
25
|
+
* The correlation ids are serialized directly into the log message (via
|
|
26
|
+
* `JSON.stringify`) rather than relying solely on the logger's `meta` channel. The
|
|
27
|
+
* default RAW log pattern has no `{meta}` placeholder, so a `meta`-only
|
|
28
|
+
* correlation would never render under default text logging; inlining it keeps the
|
|
29
|
+
* ids visible under any renderer, and JSON escaping preserves the no-log-injection
|
|
30
|
+
* property.
|
|
31
|
+
*
|
|
32
|
+
* The whole body is guarded so a hostile thrown value (e.g. a throwing `toString`
|
|
33
|
+
* on the caught value) or a logging-infrastructure failure can never make this
|
|
34
|
+
* mapper throw; failures are swallowed because Nest's default handler still answers
|
|
35
|
+
* the constant generic `500` fail-securely.
|
|
36
|
+
*
|
|
37
|
+
* @param {GraphServingErrorLoggerContext} context - Logger context for the controller handling the failure.
|
|
38
|
+
* @param {unknown} e - The caught error that was not mapped to a specific HTTP status.
|
|
39
|
+
* @param {GraphServingErrorCorrelation} correlation - Request correlation ids, when known.
|
|
40
|
+
* @return {void}
|
|
41
|
+
*/
|
|
42
|
+
export declare function logUnmappedGraphServingError(context: GraphServingErrorLoggerContext, e: unknown, correlation?: GraphServingErrorCorrelation): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Condition } from "../../../shared/graph/index.d.cts";
|
|
2
2
|
import { GraphNode } from "../../base.d.cts";
|
|
3
3
|
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../../engine/types.d.cts";
|
|
4
|
+
import type { GraphExecutionContext } from "../../../engine/execution/GraphExecutionContext.d.cts";
|
|
4
5
|
/** Inputs accepted by the if node. */
|
|
5
6
|
export type IfFlowInput = Record<string, unknown>;
|
|
6
7
|
/** Outputs produced by the if node. */
|
|
@@ -14,21 +15,32 @@ export interface IfFlowOutput {
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class IfFlowNode extends GraphNode<IfFlowInput, IfFlowOutput> {
|
|
16
17
|
/**
|
|
17
|
-
* Evaluates the configured `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Evaluates the configured `Condition` against the resolved condition state
|
|
19
|
+
* and routes the input value to `then` or `else`; throws when the condition
|
|
20
|
+
* is false and the `else` branch is disabled. A `CodeCondition` is dispatched
|
|
21
|
+
* through the registered `CodeSandboxEvaluator`, mirroring the switch node.
|
|
22
|
+
*
|
|
23
|
+
* Graphical conditions evaluate synchronously so the existing synchronous
|
|
24
|
+
* `GRAPH_IF_NO_CONDITION` / `GRAPH_IF_ELSE_DISABLED` throw contract is
|
|
25
|
+
* preserved; only code conditions return a promise.
|
|
20
26
|
*
|
|
21
27
|
* @param {GraphNodeExecutionRequest<IfFlowInput>} request - Execution request carrying the `value` input.
|
|
22
|
-
* @
|
|
28
|
+
* @param {GraphExecutionContext} context - Execution context providing run metadata and the sandbox evaluator for code conditions.
|
|
29
|
+
* @return {GraphExecutionValues | Promise<GraphExecutionValues>} The routed input value under `then` or `else`.
|
|
23
30
|
* @throws {GraphExecutionError} When no condition is configured (`GRAPH_IF_NO_CONDITION`) or when the condition is false with `else` disabled (`GRAPH_IF_ELSE_DISABLED`).
|
|
24
31
|
*/
|
|
25
|
-
execute(request: GraphNodeExecutionRequest<IfFlowInput
|
|
32
|
+
execute(request: GraphNodeExecutionRequest<IfFlowInput>, context: GraphExecutionContext): GraphExecutionValues | Promise<GraphExecutionValues>;
|
|
33
|
+
/**
|
|
34
|
+
* Routes the input value to `then`/`else`, throwing when the condition is
|
|
35
|
+
* false and the `else` branch is disabled.
|
|
36
|
+
*/
|
|
37
|
+
private route;
|
|
26
38
|
/** Primary input value routed to the `then` or `else` output. */
|
|
27
39
|
value: unknown;
|
|
28
40
|
/** Output carrying the input value when the condition evaluates truthy. */
|
|
29
41
|
then: unknown;
|
|
30
|
-
/** Condition
|
|
31
|
-
condition?:
|
|
42
|
+
/** Condition (§22.3 graphical or §22.4 code) evaluated against the resolved condition state. */
|
|
43
|
+
condition?: Condition;
|
|
32
44
|
/** Enables the `else` output branch; when false, a failed condition throws. */
|
|
33
45
|
else?: boolean;
|
|
34
46
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Condition } from "../../../shared/graph/index.d.mts";
|
|
2
2
|
import { GraphNode } from "../../base.d.mts";
|
|
3
3
|
import type { GraphExecutionValues, GraphNodeExecutionRequest } from "../../../engine/types.d.mts";
|
|
4
|
+
import type { GraphExecutionContext } from "../../../engine/execution/GraphExecutionContext.d.mts";
|
|
4
5
|
/** Inputs accepted by the if node. */
|
|
5
6
|
export type IfFlowInput = Record<string, unknown>;
|
|
6
7
|
/** Outputs produced by the if node. */
|
|
@@ -14,21 +15,32 @@ export interface IfFlowOutput {
|
|
|
14
15
|
*/
|
|
15
16
|
export declare class IfFlowNode extends GraphNode<IfFlowInput, IfFlowOutput> {
|
|
16
17
|
/**
|
|
17
|
-
* Evaluates the configured `
|
|
18
|
-
*
|
|
19
|
-
*
|
|
18
|
+
* Evaluates the configured `Condition` against the resolved condition state
|
|
19
|
+
* and routes the input value to `then` or `else`; throws when the condition
|
|
20
|
+
* is false and the `else` branch is disabled. A `CodeCondition` is dispatched
|
|
21
|
+
* through the registered `CodeSandboxEvaluator`, mirroring the switch node.
|
|
22
|
+
*
|
|
23
|
+
* Graphical conditions evaluate synchronously so the existing synchronous
|
|
24
|
+
* `GRAPH_IF_NO_CONDITION` / `GRAPH_IF_ELSE_DISABLED` throw contract is
|
|
25
|
+
* preserved; only code conditions return a promise.
|
|
20
26
|
*
|
|
21
27
|
* @param {GraphNodeExecutionRequest<IfFlowInput>} request - Execution request carrying the `value` input.
|
|
22
|
-
* @
|
|
28
|
+
* @param {GraphExecutionContext} context - Execution context providing run metadata and the sandbox evaluator for code conditions.
|
|
29
|
+
* @return {GraphExecutionValues | Promise<GraphExecutionValues>} The routed input value under `then` or `else`.
|
|
23
30
|
* @throws {GraphExecutionError} When no condition is configured (`GRAPH_IF_NO_CONDITION`) or when the condition is false with `else` disabled (`GRAPH_IF_ELSE_DISABLED`).
|
|
24
31
|
*/
|
|
25
|
-
execute(request: GraphNodeExecutionRequest<IfFlowInput
|
|
32
|
+
execute(request: GraphNodeExecutionRequest<IfFlowInput>, context: GraphExecutionContext): GraphExecutionValues | Promise<GraphExecutionValues>;
|
|
33
|
+
/**
|
|
34
|
+
* Routes the input value to `then`/`else`, throwing when the condition is
|
|
35
|
+
* false and the `else` branch is disabled.
|
|
36
|
+
*/
|
|
37
|
+
private route;
|
|
26
38
|
/** Primary input value routed to the `then` or `else` output. */
|
|
27
39
|
value: unknown;
|
|
28
40
|
/** Output carrying the input value when the condition evaluates truthy. */
|
|
29
41
|
then: unknown;
|
|
30
|
-
/** Condition
|
|
31
|
-
condition?:
|
|
42
|
+
/** Condition (§22.3 graphical or §22.4 code) evaluated against the resolved condition state. */
|
|
43
|
+
condition?: Condition;
|
|
32
44
|
/** Enables the `else` output branch; when false, a failed condition throws. */
|
|
33
45
|
else?: boolean;
|
|
34
46
|
}
|
|
@@ -11,7 +11,10 @@ export declare class GraphUntilLoopNode extends GraphNode<GraphUntilLoopInput, G
|
|
|
11
11
|
* Runs the body workflow at least once and repeats until `condition`
|
|
12
12
|
* evaluates truthy against the carried state, emitting `LOOP_*` events per
|
|
13
13
|
* iteration and executing the body as a child run through
|
|
14
|
-
* `engine.execute(bodyWorkflow, ...)`.
|
|
14
|
+
* `engine.execute(bodyWorkflow, ...)`. A `CodeCondition` is dispatched
|
|
15
|
+
* through the registered `CodeSandboxEvaluator`; a graphical
|
|
16
|
+
* `ConditionExpression` and the built-in comparison types are evaluated
|
|
17
|
+
* directly.
|
|
15
18
|
*
|
|
16
19
|
* @param {GraphNodeExecutionRequest<GraphUntilLoopInput>} request - Execution request carrying the `state` input.
|
|
17
20
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -11,7 +11,10 @@ export declare class GraphUntilLoopNode extends GraphNode<GraphUntilLoopInput, G
|
|
|
11
11
|
* Runs the body workflow at least once and repeats until `condition`
|
|
12
12
|
* evaluates truthy against the carried state, emitting `LOOP_*` events per
|
|
13
13
|
* iteration and executing the body as a child run through
|
|
14
|
-
* `engine.execute(bodyWorkflow, ...)`.
|
|
14
|
+
* `engine.execute(bodyWorkflow, ...)`. A `CodeCondition` is dispatched
|
|
15
|
+
* through the registered `CodeSandboxEvaluator`; a graphical
|
|
16
|
+
* `ConditionExpression` and the built-in comparison types are evaluated
|
|
17
|
+
* directly.
|
|
15
18
|
*
|
|
16
19
|
* @param {GraphNodeExecutionRequest<GraphUntilLoopInput>} request - Execution request carrying the `state` input.
|
|
17
20
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -10,7 +10,10 @@ export declare class GraphWhileLoopNode extends GraphNode<GraphWhileLoopInput, G
|
|
|
10
10
|
/**
|
|
11
11
|
* Repeats the body workflow while `condition` evaluates truthy against the
|
|
12
12
|
* carried state, emitting `LOOP_*` events per iteration and executing the
|
|
13
|
-
* body as a child run through `engine.execute(bodyWorkflow, ...)`.
|
|
13
|
+
* body as a child run through `engine.execute(bodyWorkflow, ...)`. A
|
|
14
|
+
* `CodeCondition` is dispatched through the registered
|
|
15
|
+
* `CodeSandboxEvaluator`; a graphical `ConditionExpression` and the built-in
|
|
16
|
+
* comparison types are evaluated directly.
|
|
14
17
|
*
|
|
15
18
|
* @param {GraphNodeExecutionRequest<GraphWhileLoopInput>} request - Execution request carrying the `state` input.
|
|
16
19
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -10,7 +10,10 @@ export declare class GraphWhileLoopNode extends GraphNode<GraphWhileLoopInput, G
|
|
|
10
10
|
/**
|
|
11
11
|
* Repeats the body workflow while `condition` evaluates truthy against the
|
|
12
12
|
* carried state, emitting `LOOP_*` events per iteration and executing the
|
|
13
|
-
* body as a child run through `engine.execute(bodyWorkflow, ...)`.
|
|
13
|
+
* body as a child run through `engine.execute(bodyWorkflow, ...)`. A
|
|
14
|
+
* `CodeCondition` is dispatched through the registered
|
|
15
|
+
* `CodeSandboxEvaluator`; a graphical `ConditionExpression` and the built-in
|
|
16
|
+
* comparison types are evaluated directly.
|
|
14
17
|
*
|
|
15
18
|
* @param {GraphNodeExecutionRequest<GraphWhileLoopInput>} request - Execution request carrying the `state` input.
|
|
16
19
|
* @param {GraphExecutionContext} context - Execution context providing run metadata and engine access.
|
|
@@ -36,4 +36,16 @@ export declare class RamGraphRunStore implements GraphRunStore {
|
|
|
36
36
|
* @return {Promise<GraphRun | null>} The run, or `null` when no row exists.
|
|
37
37
|
*/
|
|
38
38
|
readRun(runId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRun | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists every persisted run row for the given workflow document as its
|
|
41
|
+
* persisted {@link GraphRunModel} shape (keeping storage-derived fields such
|
|
42
|
+
* as `updatedAt` and `inputs`).
|
|
43
|
+
*
|
|
44
|
+
* @param {string} workflowId - Workflow document id the runs executed.
|
|
45
|
+
* @param args - Optional decaf `Context` arguments forwarded to the repository.
|
|
46
|
+
* @return {Promise<GraphRunModel[]>} The matching rows — empty only when no
|
|
47
|
+
* runs exist for the workflow. A store failure now propagates to the caller
|
|
48
|
+
* instead of being swallowed into an empty list (SAA-93 R1).
|
|
49
|
+
*/
|
|
50
|
+
listRuns(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRunModel[]>;
|
|
39
51
|
}
|
|
@@ -36,4 +36,16 @@ export declare class RamGraphRunStore implements GraphRunStore {
|
|
|
36
36
|
* @return {Promise<GraphRun | null>} The run, or `null` when no row exists.
|
|
37
37
|
*/
|
|
38
38
|
readRun(runId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRun | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Lists every persisted run row for the given workflow document as its
|
|
41
|
+
* persisted {@link GraphRunModel} shape (keeping storage-derived fields such
|
|
42
|
+
* as `updatedAt` and `inputs`).
|
|
43
|
+
*
|
|
44
|
+
* @param {string} workflowId - Workflow document id the runs executed.
|
|
45
|
+
* @param args - Optional decaf `Context` arguments forwarded to the repository.
|
|
46
|
+
* @return {Promise<GraphRunModel[]>} The matching rows — empty only when no
|
|
47
|
+
* runs exist for the workflow. A store failure now propagates to the caller
|
|
48
|
+
* instead of being swallowed into an empty list (SAA-93 R1).
|
|
49
|
+
*/
|
|
50
|
+
listRuns(workflowId: string, ...args: MaybeContextualArg<Context>): Promise<GraphRunModel[]>;
|
|
39
51
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Constructor } from "@decaf-ts/decoration";
|
|
10
10
|
import type { Model } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import type {
|
|
11
|
+
import type { Condition, SwitchCaseCondition } from "../types.d.cts";
|
|
12
12
|
import type { GraphJsonValue } from "./GraphJsonValue.d.cts";
|
|
13
13
|
import type { GraphWorkflowDocument, GraphWorkflowPortInstance } from "./GraphWorkflowDocument.d.cts";
|
|
14
14
|
import { type GraphNodeOverrideOptions } from "./GraphWorkflowDocumentBuilder.d.cts";
|
|
@@ -191,12 +191,12 @@ export declare class GraphFlowBuilder {
|
|
|
191
191
|
* Adds a `core.flow.if` node and routes the cursor to its `then` output.
|
|
192
192
|
* Must be closed with {@link endIf} (or opened onto an `else` branch).
|
|
193
193
|
*/
|
|
194
|
-
if(condition:
|
|
194
|
+
if(condition: Condition, options?: FlowIfOptions): this;
|
|
195
195
|
/**
|
|
196
196
|
* Opens an `elseIf` branch on the current `if` frame: adds another
|
|
197
197
|
* `core.flow.if` node connected from the parent's `else` output.
|
|
198
198
|
*/
|
|
199
|
-
elseIf(condition:
|
|
199
|
+
elseIf(condition: Condition, options?: FlowIfOptions): this;
|
|
200
200
|
/**
|
|
201
201
|
* Opens the `else` branch of the current `if` frame and adds its first node.
|
|
202
202
|
*/
|
|
@@ -223,9 +223,9 @@ export declare class GraphFlowBuilder {
|
|
|
223
223
|
*/
|
|
224
224
|
map(body: GraphWorkflowDocument, options?: FlowMapOptions): this;
|
|
225
225
|
/** Adds a `core.loop.while` node with the given condition and body. */
|
|
226
|
-
while(condition:
|
|
226
|
+
while(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
227
227
|
/** Adds a `core.loop.until` node with the given condition and body. */
|
|
228
|
-
until(condition:
|
|
228
|
+
until(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
229
229
|
/**
|
|
230
230
|
* Adds a `core.flow.errorBoundary` node with the try/catch/finally bodies.
|
|
231
231
|
* The cursor becomes the boundary's `result` output (plus `error` when a catch
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { Constructor } from "@decaf-ts/decoration";
|
|
10
10
|
import type { Model } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import type {
|
|
11
|
+
import type { Condition, SwitchCaseCondition } from "../types.d.mts";
|
|
12
12
|
import type { GraphJsonValue } from "./GraphJsonValue.d.mts";
|
|
13
13
|
import type { GraphWorkflowDocument, GraphWorkflowPortInstance } from "./GraphWorkflowDocument.d.mts";
|
|
14
14
|
import { type GraphNodeOverrideOptions } from "./GraphWorkflowDocumentBuilder.d.mts";
|
|
@@ -191,12 +191,12 @@ export declare class GraphFlowBuilder {
|
|
|
191
191
|
* Adds a `core.flow.if` node and routes the cursor to its `then` output.
|
|
192
192
|
* Must be closed with {@link endIf} (or opened onto an `else` branch).
|
|
193
193
|
*/
|
|
194
|
-
if(condition:
|
|
194
|
+
if(condition: Condition, options?: FlowIfOptions): this;
|
|
195
195
|
/**
|
|
196
196
|
* Opens an `elseIf` branch on the current `if` frame: adds another
|
|
197
197
|
* `core.flow.if` node connected from the parent's `else` output.
|
|
198
198
|
*/
|
|
199
|
-
elseIf(condition:
|
|
199
|
+
elseIf(condition: Condition, options?: FlowIfOptions): this;
|
|
200
200
|
/**
|
|
201
201
|
* Opens the `else` branch of the current `if` frame and adds its first node.
|
|
202
202
|
*/
|
|
@@ -223,9 +223,9 @@ export declare class GraphFlowBuilder {
|
|
|
223
223
|
*/
|
|
224
224
|
map(body: GraphWorkflowDocument, options?: FlowMapOptions): this;
|
|
225
225
|
/** Adds a `core.loop.while` node with the given condition and body. */
|
|
226
|
-
while(condition:
|
|
226
|
+
while(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
227
227
|
/** Adds a `core.loop.until` node with the given condition and body. */
|
|
228
|
-
until(condition:
|
|
228
|
+
until(condition: Condition, body: GraphWorkflowDocument, options?: FlowLoopOptions): this;
|
|
229
229
|
/**
|
|
230
230
|
* Adds a `core.flow.errorBoundary` node with the try/catch/finally bodies.
|
|
231
231
|
* The cursor becomes the boundary's `result` output (plus `error` when a catch
|
|
@@ -77,12 +77,19 @@ export interface CodeCondition {
|
|
|
77
77
|
code: string;
|
|
78
78
|
language?: "javascript" | "typescript";
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A condition accepted by every flow-control carrier (if, elseIf, while, until,
|
|
82
|
+
* switch) — either a declarative {@link ConditionExpression} (graphical mode) or a
|
|
83
|
+
* {@link CodeCondition} (code mode). The two modes are dispatched identically by
|
|
84
|
+
* the engine regardless of which carrier holds the condition.
|
|
85
|
+
*/
|
|
86
|
+
export type Condition = ConditionExpression | CodeCondition;
|
|
80
87
|
/**
|
|
81
88
|
* A condition on a Switch case — either a declarative
|
|
82
89
|
* {@link ConditionExpression} (graphical mode) or a {@link CodeCondition}
|
|
83
90
|
* (code mode).
|
|
84
91
|
*/
|
|
85
|
-
export type SwitchCaseCondition =
|
|
92
|
+
export type SwitchCaseCondition = Condition;
|
|
86
93
|
/**
|
|
87
94
|
* A single case in a Switch node.
|
|
88
95
|
*
|
|
@@ -77,12 +77,19 @@ export interface CodeCondition {
|
|
|
77
77
|
code: string;
|
|
78
78
|
language?: "javascript" | "typescript";
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* A condition accepted by every flow-control carrier (if, elseIf, while, until,
|
|
82
|
+
* switch) — either a declarative {@link ConditionExpression} (graphical mode) or a
|
|
83
|
+
* {@link CodeCondition} (code mode). The two modes are dispatched identically by
|
|
84
|
+
* the engine regardless of which carrier holds the condition.
|
|
85
|
+
*/
|
|
86
|
+
export type Condition = ConditionExpression | CodeCondition;
|
|
80
87
|
/**
|
|
81
88
|
* A condition on a Switch case — either a declarative
|
|
82
89
|
* {@link ConditionExpression} (graphical mode) or a {@link CodeCondition}
|
|
83
90
|
* (code mode).
|
|
84
91
|
*/
|
|
85
|
-
export type SwitchCaseCondition =
|
|
92
|
+
export type SwitchCaseCondition = Condition;
|
|
86
93
|
/**
|
|
87
94
|
* A single case in a Switch node.
|
|
88
95
|
*
|