@decaf-ts/ui-decorators 0.20.4 → 0.20.6
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/ui-decorators.cjs +1 -1
- package/lib/cjs/graph/GraphExecutionStateMapper.cjs +97 -0
- package/lib/cjs/graph/GraphExecutionStateMapper.cjs.map +1 -0
- package/lib/cjs/graph/GraphResolution.cjs +17 -0
- package/lib/cjs/graph/GraphResolution.cjs.map +1 -0
- package/lib/cjs/graph/constants.cjs +157 -1
- package/lib/cjs/graph/constants.cjs.map +1 -1
- package/lib/cjs/graph/index.cjs +3 -0
- package/lib/cjs/graph/index.cjs.map +1 -1
- package/lib/cjs/graph/nodes/agents/agent.cjs +110 -0
- package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
- package/lib/cjs/graph/nodes/base.cjs +36 -0
- package/lib/cjs/graph/nodes/base.cjs.map +1 -0
- package/lib/cjs/graph/nodes/boundary/input-value.cjs +57 -0
- package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
- package/lib/cjs/graph/nodes/category-styles.cjs +38 -0
- package/lib/cjs/graph/nodes/category-styles.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/break.cjs +63 -0
- package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +67 -0
- package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +69 -0
- package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/if.cjs +71 -0
- package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs +61 -0
- package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
- package/lib/cjs/graph/nodes/flow-control/switch.cjs +121 -0
- package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
- package/lib/cjs/graph/nodes/index.cjs +123 -0
- package/lib/cjs/graph/nodes/index.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/foreach.cjs +86 -0
- package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/until.cjs +74 -0
- package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
- package/lib/cjs/graph/nodes/loops/while.cjs +74 -0
- package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
- package/lib/cjs/graph/nodes/manifests.cjs +338 -0
- package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/chat.cjs +70 -0
- package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/event.cjs +58 -0
- package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/form.cjs +59 -0
- package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/manual.cjs +60 -0
- package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/schedule.cjs +60 -0
- package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
- package/lib/cjs/graph/nodes/triggers/webhook.cjs +62 -0
- package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/code.cjs +99 -0
- package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/delay.cjs +61 -0
- package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/log.cjs +62 -0
- package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/map.cjs +61 -0
- package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/merge.cjs +62 -0
- package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/return.cjs +61 -0
- package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
- package/lib/cjs/graph/nodes/utility/utility-log.cjs +66 -0
- package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
- package/lib/cjs/index.cjs +3 -3
- package/lib/esm/graph/GraphExecutionStateMapper.js +91 -0
- package/lib/esm/graph/GraphExecutionStateMapper.js.map +1 -0
- package/lib/esm/graph/GraphResolution.js +13 -0
- package/lib/esm/graph/GraphResolution.js.map +1 -0
- package/lib/esm/graph/constants.js +179 -0
- package/lib/esm/graph/constants.js.map +1 -1
- package/lib/esm/graph/index.js +3 -0
- package/lib/esm/graph/index.js.map +1 -1
- package/lib/esm/graph/nodes/agents/agent.js +101 -0
- package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
- package/lib/esm/graph/nodes/base.js +31 -0
- package/lib/esm/graph/nodes/base.js.map +1 -0
- package/lib/esm/graph/nodes/boundary/input-value.js +48 -0
- package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
- package/lib/esm/graph/nodes/category-styles.js +34 -0
- package/lib/esm/graph/nodes/category-styles.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/break.js +54 -0
- package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/error-boundary.js +58 -0
- package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/human-approval.js +60 -0
- package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/if.js +62 -0
- package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/parallel.js +52 -0
- package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
- package/lib/esm/graph/nodes/flow-control/switch.js +112 -0
- package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
- package/lib/esm/graph/nodes/index.js +105 -0
- package/lib/esm/graph/nodes/index.js.map +1 -0
- package/lib/esm/graph/nodes/loops/foreach.js +77 -0
- package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
- package/lib/esm/graph/nodes/loops/until.js +65 -0
- package/lib/esm/graph/nodes/loops/until.js.map +1 -0
- package/lib/esm/graph/nodes/loops/while.js +65 -0
- package/lib/esm/graph/nodes/loops/while.js.map +1 -0
- package/lib/esm/graph/nodes/manifests.js +334 -0
- package/lib/esm/graph/nodes/manifests.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/chat.js +61 -0
- package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/event.js +49 -0
- package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/form.js +50 -0
- package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/manual.js +51 -0
- package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/schedule.js +51 -0
- package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
- package/lib/esm/graph/nodes/triggers/webhook.js +53 -0
- package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
- package/lib/esm/graph/nodes/utility/code.js +90 -0
- package/lib/esm/graph/nodes/utility/code.js.map +1 -0
- package/lib/esm/graph/nodes/utility/delay.js +52 -0
- package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
- package/lib/esm/graph/nodes/utility/log.js +53 -0
- package/lib/esm/graph/nodes/utility/log.js.map +1 -0
- package/lib/esm/graph/nodes/utility/map.js +52 -0
- package/lib/esm/graph/nodes/utility/map.js.map +1 -0
- package/lib/esm/graph/nodes/utility/merge.js +53 -0
- package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
- package/lib/esm/graph/nodes/utility/return.js +52 -0
- package/lib/esm/graph/nodes/utility/return.js.map +1 -0
- package/lib/esm/graph/nodes/utility/utility-log.js +57 -0
- package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
- package/lib/esm/index.js +3 -3
- package/lib/types/graph/GraphExecutionStateMapper.d.cts +66 -0
- package/lib/types/graph/GraphExecutionStateMapper.d.mts +66 -0
- package/lib/types/graph/GraphResolution.d.cts +53 -0
- package/lib/types/graph/GraphResolution.d.mts +53 -0
- package/lib/types/graph/constants.d.cts +165 -0
- package/lib/types/graph/constants.d.mts +165 -0
- package/lib/types/graph/index.d.cts +3 -0
- package/lib/types/graph/index.d.mts +3 -0
- package/lib/types/graph/nodes/agents/agent.d.cts +44 -0
- package/lib/types/graph/nodes/agents/agent.d.mts +44 -0
- package/lib/types/graph/nodes/base.d.cts +28 -0
- package/lib/types/graph/nodes/base.d.mts +28 -0
- package/lib/types/graph/nodes/boundary/input-value.d.cts +13 -0
- package/lib/types/graph/nodes/boundary/input-value.d.mts +13 -0
- package/lib/types/graph/nodes/category-styles.d.cts +8 -0
- package/lib/types/graph/nodes/category-styles.d.mts +8 -0
- package/lib/types/graph/nodes/flow-control/break.d.cts +15 -0
- package/lib/types/graph/nodes/flow-control/break.d.mts +15 -0
- package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +12 -0
- package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +12 -0
- package/lib/types/graph/nodes/flow-control/human-approval.d.cts +13 -0
- package/lib/types/graph/nodes/flow-control/human-approval.d.mts +13 -0
- package/lib/types/graph/nodes/flow-control/if.d.cts +16 -0
- package/lib/types/graph/nodes/flow-control/if.d.mts +16 -0
- package/lib/types/graph/nodes/flow-control/parallel.d.cts +11 -0
- package/lib/types/graph/nodes/flow-control/parallel.d.mts +11 -0
- package/lib/types/graph/nodes/flow-control/switch.d.cts +21 -0
- package/lib/types/graph/nodes/flow-control/switch.d.mts +21 -0
- package/lib/types/graph/nodes/index.d.cts +79 -0
- package/lib/types/graph/nodes/index.d.mts +79 -0
- package/lib/types/graph/nodes/loops/foreach.d.cts +19 -0
- package/lib/types/graph/nodes/loops/foreach.d.mts +19 -0
- package/lib/types/graph/nodes/loops/until.d.cts +16 -0
- package/lib/types/graph/nodes/loops/until.d.mts +16 -0
- package/lib/types/graph/nodes/loops/while.d.cts +16 -0
- package/lib/types/graph/nodes/loops/while.d.mts +16 -0
- package/lib/types/graph/nodes/manifests.d.cts +62 -0
- package/lib/types/graph/nodes/manifests.d.mts +62 -0
- package/lib/types/graph/nodes/triggers/chat.d.cts +13 -0
- package/lib/types/graph/nodes/triggers/chat.d.mts +13 -0
- package/lib/types/graph/nodes/triggers/event.d.cts +10 -0
- package/lib/types/graph/nodes/triggers/event.d.mts +10 -0
- package/lib/types/graph/nodes/triggers/form.d.cts +11 -0
- package/lib/types/graph/nodes/triggers/form.d.mts +11 -0
- package/lib/types/graph/nodes/triggers/manual.d.cts +12 -0
- package/lib/types/graph/nodes/triggers/manual.d.mts +12 -0
- package/lib/types/graph/nodes/triggers/schedule.d.cts +11 -0
- package/lib/types/graph/nodes/triggers/schedule.d.mts +11 -0
- package/lib/types/graph/nodes/triggers/webhook.d.cts +11 -0
- package/lib/types/graph/nodes/triggers/webhook.d.mts +11 -0
- package/lib/types/graph/nodes/utility/code.d.cts +31 -0
- package/lib/types/graph/nodes/utility/code.d.mts +31 -0
- package/lib/types/graph/nodes/utility/delay.d.cts +11 -0
- package/lib/types/graph/nodes/utility/delay.d.mts +11 -0
- package/lib/types/graph/nodes/utility/log.d.cts +13 -0
- package/lib/types/graph/nodes/utility/log.d.mts +13 -0
- package/lib/types/graph/nodes/utility/map.d.cts +11 -0
- package/lib/types/graph/nodes/utility/map.d.mts +11 -0
- package/lib/types/graph/nodes/utility/merge.d.cts +12 -0
- package/lib/types/graph/nodes/utility/merge.d.mts +12 -0
- package/lib/types/graph/nodes/utility/return.d.cts +11 -0
- package/lib/types/graph/nodes/utility/return.d.mts +11 -0
- package/lib/types/graph/nodes/utility/utility-log.d.cts +15 -0
- package/lib/types/graph/nodes/utility/utility-log.d.mts +15 -0
- package/lib/types/graph/types.d.cts +286 -0
- package/lib/types/graph/types.d.mts +286 -0
- package/lib/types/index.d.cts +3 -3
- package/lib/types/index.d.mts +3 -3
- package/package.json +1 -1
|
@@ -1,3 +1,289 @@
|
|
|
1
1
|
export { PortDirection } from "./constants.d.mts";
|
|
2
2
|
export type { GraphConnectionRule, GraphNodeDefinition, GraphNodeKind, GraphNodeMetadata, GraphPortDefinition, GraphPortMetadata, GraphWorkflowDefinition, GraphWorkflowMetadata, GraphWorkflowNodeMetadata, GraphWorkflowRelationMetadata, } from "./constants.d.mts";
|
|
3
3
|
export type { GraphWorkflowSnapshot, LegacyGraphWorkflowSnapshot, GraphWorkflowSnapshotDefinition, GraphWorkflowSnapshotEdge, GraphWorkflowSnapshotInput, GraphWorkflowSnapshotNode, GraphWorkflowSnapshotPosition, GraphWorkflowSnapshotReference, GraphWorkflowSnapshotSize, GraphWorkflowSnapshotState, GraphWorkflowSnapshotValue, GraphWorkflowSnapshotPortState, GraphWorkflowSnapshotLike, GraphSnapshotEditorState, } from "./snapshot.d.mts";
|
|
4
|
+
import type { GraphPortDefinition } from "./constants.d.mts";
|
|
5
|
+
import type { GraphExecutionEventType, GraphExecutionStatus, GraphVisualState } from "./constants.d.mts";
|
|
6
|
+
import type { GraphJsonValue } from "./document/index.d.mts";
|
|
7
|
+
/**
|
|
8
|
+
* A value reference inside a {@link ConditionExpression}.
|
|
9
|
+
*
|
|
10
|
+
* - `{ const: x }` — a literal constant.
|
|
11
|
+
* - `{ path: "a.b" }` — a dotted path resolved against the current loop state.
|
|
12
|
+
* - `{ step: "nodeId", path: "out" }` — a cross-node reference (resolved from
|
|
13
|
+
* the execution state in v1; reserved for future multi-step evaluation).
|
|
14
|
+
*/
|
|
15
|
+
export type ExprValue = {
|
|
16
|
+
const: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
path: string;
|
|
19
|
+
} | {
|
|
20
|
+
step: string;
|
|
21
|
+
path: string;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Declarative, serializable condition expression DSL (ALFRED-5 §8 / DECAF-32 §22.3).
|
|
25
|
+
*
|
|
26
|
+
* The engine's `GraphConditionEvaluator` recognises this DSL when the
|
|
27
|
+
* condition object carries an `op` field and dispatches to the
|
|
28
|
+
* `ConditionExpressionEvaluator`.
|
|
29
|
+
*/
|
|
30
|
+
export type ConditionExpression = {
|
|
31
|
+
op: "eq";
|
|
32
|
+
left: ExprValue;
|
|
33
|
+
right: ExprValue;
|
|
34
|
+
} | {
|
|
35
|
+
op: "neq";
|
|
36
|
+
left: ExprValue;
|
|
37
|
+
right: ExprValue;
|
|
38
|
+
} | {
|
|
39
|
+
op: "gt";
|
|
40
|
+
left: ExprValue;
|
|
41
|
+
right: ExprValue;
|
|
42
|
+
} | {
|
|
43
|
+
op: "gte";
|
|
44
|
+
left: ExprValue;
|
|
45
|
+
right: ExprValue;
|
|
46
|
+
} | {
|
|
47
|
+
op: "lt";
|
|
48
|
+
left: ExprValue;
|
|
49
|
+
right: ExprValue;
|
|
50
|
+
} | {
|
|
51
|
+
op: "lte";
|
|
52
|
+
left: ExprValue;
|
|
53
|
+
right: ExprValue;
|
|
54
|
+
} | {
|
|
55
|
+
op: "and";
|
|
56
|
+
conditions: ConditionExpression[];
|
|
57
|
+
} | {
|
|
58
|
+
op: "or";
|
|
59
|
+
conditions: ConditionExpression[];
|
|
60
|
+
} | {
|
|
61
|
+
op: "not";
|
|
62
|
+
condition: ConditionExpression;
|
|
63
|
+
} | {
|
|
64
|
+
op: "exists";
|
|
65
|
+
value: ExprValue;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A code-based condition evaluated in a restricted VM sandbox (§22.4).
|
|
69
|
+
*
|
|
70
|
+
* The engine does NOT implement the sandbox directly — a pluggable
|
|
71
|
+
* `CodeSandboxEvaluator` must be registered for code conditions to work.
|
|
72
|
+
* The code must follow the same restrictions as the Code Node (§22.4):
|
|
73
|
+
* no system API access, placeholder syntax for workflow data references.
|
|
74
|
+
*/
|
|
75
|
+
export interface CodeCondition {
|
|
76
|
+
type: "code";
|
|
77
|
+
code: string;
|
|
78
|
+
language?: "javascript" | "typescript";
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A condition on a Switch case — either a declarative
|
|
82
|
+
* {@link ConditionExpression} (graphical mode) or a {@link CodeCondition}
|
|
83
|
+
* (code mode).
|
|
84
|
+
*/
|
|
85
|
+
export type SwitchCaseCondition = ConditionExpression | CodeCondition;
|
|
86
|
+
/**
|
|
87
|
+
* A single case in a Switch node.
|
|
88
|
+
*
|
|
89
|
+
* Each case pairs a condition with a dedicated output port. When the
|
|
90
|
+
* condition evaluates to `true`, the input is routed to `outputPort`.
|
|
91
|
+
*/
|
|
92
|
+
export interface SwitchCase {
|
|
93
|
+
id: string;
|
|
94
|
+
label: string;
|
|
95
|
+
condition: SwitchCaseCondition;
|
|
96
|
+
outputPort: string;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Metadata for a Switch node, stored in `metadata.switch`.
|
|
100
|
+
*
|
|
101
|
+
* When `hasDefault` is `false` (the default), the `default` output port is
|
|
102
|
+
* hidden and the executor throws a `GraphExecutionError` when no case
|
|
103
|
+
* matches. When `hasDefault` is `true`, the `default` output port is visible
|
|
104
|
+
* and receives the input when no case matches (DECAF-34 §6.2).
|
|
105
|
+
*/
|
|
106
|
+
export interface SwitchNodeMetadata {
|
|
107
|
+
cases: SwitchCase[];
|
|
108
|
+
defaultPort?: string;
|
|
109
|
+
hasDefault?: boolean;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* The result of applying a metadata change to a node. Each concrete node
|
|
113
|
+
* class that overrides `GraphNode.applyMetadata()` returns this so the
|
|
114
|
+
* renderer can update the diagram model — the node owns its ports, its
|
|
115
|
+
* size, and any data patches.
|
|
116
|
+
*/
|
|
117
|
+
export interface NodeMetadataChange {
|
|
118
|
+
ports: GraphPortDefinition[];
|
|
119
|
+
size: {
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
};
|
|
123
|
+
dataPatch: Record<string, unknown>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Serialized error payload included in execution events and results.
|
|
127
|
+
*
|
|
128
|
+
* Frontend-safe: the frontend receives this over SSE when a node or workflow
|
|
129
|
+
* fails and needs to render the error details.
|
|
130
|
+
*/
|
|
131
|
+
export interface GraphExecutionErrorPayload {
|
|
132
|
+
name: string;
|
|
133
|
+
message: string;
|
|
134
|
+
stack?: string;
|
|
135
|
+
code?: string;
|
|
136
|
+
details?: unknown;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* A single event emitted during graph execution.
|
|
140
|
+
*
|
|
141
|
+
* Frontend-safe: the frontend consumes these events over the SSE endpoint
|
|
142
|
+
* (`GET /graph/events`) and maps them to UI state updates via
|
|
143
|
+
* `GraphExecutionStateMapper`. The `timestamp` is serialised as an ISO string
|
|
144
|
+
* over the wire; the frontend deserialises it back to a `Date` when mapping.
|
|
145
|
+
*/
|
|
146
|
+
export interface GraphExecutionEvent {
|
|
147
|
+
id: string;
|
|
148
|
+
sequence: number;
|
|
149
|
+
runId: string;
|
|
150
|
+
parentRunId?: string;
|
|
151
|
+
workflowId: string;
|
|
152
|
+
type: GraphExecutionEventType;
|
|
153
|
+
timestamp: Date;
|
|
154
|
+
nodeId?: string;
|
|
155
|
+
edgeId?: string;
|
|
156
|
+
port?: string;
|
|
157
|
+
iteration?: number;
|
|
158
|
+
path: string[];
|
|
159
|
+
status?: GraphExecutionStatus;
|
|
160
|
+
payload?: unknown;
|
|
161
|
+
error?: GraphExecutionErrorPayload;
|
|
162
|
+
metadata?: Record<string, unknown>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Payload carried by `NODE_STATE_CHANGED` events (DECAF-48 §4.4).
|
|
166
|
+
*
|
|
167
|
+
* The visual state is the engine-agnostic contract a Mastra/NestJS driver
|
|
168
|
+
* MUST emit; the reference engine derives it from its own execution events.
|
|
169
|
+
*/
|
|
170
|
+
export interface GraphNodeStateChangedPayload {
|
|
171
|
+
nodeId: string;
|
|
172
|
+
state: GraphVisualState;
|
|
173
|
+
runId: string;
|
|
174
|
+
workflowId: string;
|
|
175
|
+
/** Engine status that produced the visual state (when available). */
|
|
176
|
+
status?: GraphExecutionStatus;
|
|
177
|
+
iteration?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Payload carried by `EDGE_STATE_CHANGED` events (DECAF-48 §4.4).
|
|
181
|
+
*/
|
|
182
|
+
export interface GraphEdgeStateChangedPayload {
|
|
183
|
+
edgeId: string;
|
|
184
|
+
state: GraphVisualState;
|
|
185
|
+
runId: string;
|
|
186
|
+
workflowId: string;
|
|
187
|
+
/** Source node of the routed edge (when available). */
|
|
188
|
+
nodeId?: string;
|
|
189
|
+
/** Engine status that produced the visual state (when available). */
|
|
190
|
+
status?: GraphExecutionStatus;
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Structured log line streamed over the `graph.run.log` SSE channel
|
|
194
|
+
* (DECAF-48 §4.3). Serialized from the run's `ctx.logger` output; the level
|
|
195
|
+
* drives the Chrome-console-style filter while the attributes render as
|
|
196
|
+
* discrete columns.
|
|
197
|
+
*/
|
|
198
|
+
export interface GraphRunLogEntry {
|
|
199
|
+
/** Log severity level driving the Chrome-console-style widget filter (all `LogNodeLevel` values plus `benchmark`). */
|
|
200
|
+
level: "silly" | "trace" | "debug" | "verbose" | "info" | "warn" | "error" | "critical" | "fatal" | "benchmark";
|
|
201
|
+
message: string;
|
|
202
|
+
timestamp: string;
|
|
203
|
+
runId: string;
|
|
204
|
+
workflowId: string;
|
|
205
|
+
nodeId?: string;
|
|
206
|
+
user?: string | null;
|
|
207
|
+
/** Structured payload associated with the log line, if any. */
|
|
208
|
+
payload?: unknown;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Structured per-node I/O payload exposed for node inspection (DECAF-48 §4.6).
|
|
212
|
+
*
|
|
213
|
+
* Frontend-safe: pure data delivered via the shared graph types over the SSE
|
|
214
|
+
* state channel (or a `GET /graph/results/:runId` lookup); the frontend
|
|
215
|
+
* renders both panes (inputs right, outputs/error left) from this one shape.
|
|
216
|
+
*/
|
|
217
|
+
export interface GraphNodeInspectionPayload {
|
|
218
|
+
runId: string;
|
|
219
|
+
workflowId: string;
|
|
220
|
+
nodeId: string;
|
|
221
|
+
state: GraphVisualState;
|
|
222
|
+
inputs: Record<string, unknown>;
|
|
223
|
+
/** Present when SUCCEEDED (or from cache). */
|
|
224
|
+
outputs?: Record<string, unknown>;
|
|
225
|
+
/** Present when FAILED. */
|
|
226
|
+
error?: GraphExecutionErrorPayload;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Log levels accepted by the Log node (DECAF-48 §4.3).
|
|
230
|
+
*
|
|
231
|
+
* Mirrors the DECAF-9 log level set so the Log node executor (and the
|
|
232
|
+
* `GraphRunLogger` dispatch) can forward onto the run's `ctx.logger`.
|
|
233
|
+
* Includes every level rendered by the Chrome-console-style widget filter.
|
|
234
|
+
*/
|
|
235
|
+
export type LogNodeLevel = "silly" | "trace" | "debug" | "verbose" | "info" | "warn" | "error" | "critical" | "fatal";
|
|
236
|
+
/**
|
|
237
|
+
* Run-scoped SSE subscription ownership key (DECAF-48 §4.2).
|
|
238
|
+
*
|
|
239
|
+
* Subscription-mode SSE is keyed by run ownership: a consumer is only
|
|
240
|
+
* delivered graph events/logs for runs it owns. This tuple is the
|
|
241
|
+
* engine-agnostic contract a Mastra/NestJS driver MUST honour —
|
|
242
|
+
* `runId` together with the owning `user` (or a `system` runner when the
|
|
243
|
+
* identity is absent) scope every `graph.run.*` event before `next(...)`.
|
|
244
|
+
*/
|
|
245
|
+
export interface GraphRunSubscription {
|
|
246
|
+
runId: string;
|
|
247
|
+
ownerUser: string | null;
|
|
248
|
+
/** Optional topic filter (e.g. `graph.run.log`, `graph.run.state`). */
|
|
249
|
+
topics?: string[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Status of a graph run lifecycle (DECAF-50 §4.14).
|
|
253
|
+
*
|
|
254
|
+
* Frontend-safe: rendered as run status badges and mirrored into the
|
|
255
|
+
* Angular run state store. `queued` — accepted, not yet validated;
|
|
256
|
+
* `validating` — document validation gate in progress; `running` — the
|
|
257
|
+
* engine is executing the planned graph.
|
|
258
|
+
* `succeeded`/`failed`/`cancelled` are terminal (`isGraphRunTerminalStatus`).
|
|
259
|
+
*/
|
|
260
|
+
export type GraphRunStatus = "queued" | "validating" | "running" | "succeeded" | "failed" | "cancelled";
|
|
261
|
+
/**
|
|
262
|
+
* Frontend-safe run event envelope streamed over the run SSE endpoint
|
|
263
|
+
* (`GET /graph/runs/:runId/events`, DECAF-50 §4.15).
|
|
264
|
+
*
|
|
265
|
+
* Envelopes are numbered with a gapless monotonically increasing `sequence`
|
|
266
|
+
* starting at `1`; `timestamp` is serialised as an ISO string over the wire
|
|
267
|
+
* (unlike `GraphExecutionEvent`, whose `timestamp` stays a `Date`
|
|
268
|
+
* engine-side). `error?` carries the structured failure payload for
|
|
269
|
+
* failure-typed events; `path?` scopes nested loop-plan events to their
|
|
270
|
+
* execution path.
|
|
271
|
+
*/
|
|
272
|
+
export interface GraphRunEventEnvelope {
|
|
273
|
+
runId: string;
|
|
274
|
+
workflowId: string;
|
|
275
|
+
sequence: number;
|
|
276
|
+
type: GraphExecutionEventType;
|
|
277
|
+
timestamp: string;
|
|
278
|
+
nodeId?: string;
|
|
279
|
+
edgeId?: string;
|
|
280
|
+
payload?: GraphJsonValue;
|
|
281
|
+
error?: GraphExecutionErrorPayload;
|
|
282
|
+
parentRunId?: string;
|
|
283
|
+
path?: string[];
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Input to the run event publisher before sequencing/timestamping
|
|
287
|
+
* (DECAF-50 §4.14). The publisher fills `sequence` and `timestamp`.
|
|
288
|
+
*/
|
|
289
|
+
export type GraphRunEventEnvelopeInput = Omit<GraphRunEventEnvelope, "sequence" | "timestamp">;
|
package/lib/types/index.d.cts
CHANGED
|
@@ -15,19 +15,19 @@ export * from "./ui/index.d.cts";
|
|
|
15
15
|
* @const VERSION
|
|
16
16
|
* @memberOf module:ui-decorators
|
|
17
17
|
*/
|
|
18
|
-
export declare const VERSION = "0.20.
|
|
18
|
+
export declare const VERSION = "0.20.5";
|
|
19
19
|
/**
|
|
20
20
|
* @description Represents the current commit hash of the module build.
|
|
21
21
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
22
22
|
* the placeholder with the actual commit hash at publish time.
|
|
23
23
|
* @const COMMIT
|
|
24
24
|
*/
|
|
25
|
-
export declare const COMMIT = "
|
|
25
|
+
export declare const COMMIT = "4e03aa0";
|
|
26
26
|
/**
|
|
27
27
|
* @description Represents the full version string of the module.
|
|
28
28
|
* @summary Stores the semver version and commit hash for the package.
|
|
29
29
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
30
30
|
* @const FULL_VERSION
|
|
31
31
|
*/
|
|
32
|
-
export declare const FULL_VERSION = "0.20.
|
|
32
|
+
export declare const FULL_VERSION = "0.20.5-4e03aa0";
|
|
33
33
|
export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|
package/lib/types/index.d.mts
CHANGED
|
@@ -15,19 +15,19 @@ export * from "./ui/index.d.mts";
|
|
|
15
15
|
* @const VERSION
|
|
16
16
|
* @memberOf module:ui-decorators
|
|
17
17
|
*/
|
|
18
|
-
export declare const VERSION = "0.20.
|
|
18
|
+
export declare const VERSION = "0.20.5";
|
|
19
19
|
/**
|
|
20
20
|
* @description Represents the current commit hash of the module build.
|
|
21
21
|
* @summary Stores the current git commit hash for the package. The build replaces
|
|
22
22
|
* the placeholder with the actual commit hash at publish time.
|
|
23
23
|
* @const COMMIT
|
|
24
24
|
*/
|
|
25
|
-
export declare const COMMIT = "
|
|
25
|
+
export declare const COMMIT = "4e03aa0";
|
|
26
26
|
/**
|
|
27
27
|
* @description Represents the full version string of the module.
|
|
28
28
|
* @summary Stores the semver version and commit hash for the package.
|
|
29
29
|
* The build replaces the placeholder with the actual `<version>-<commit>` value at publish time.
|
|
30
30
|
* @const FULL_VERSION
|
|
31
31
|
*/
|
|
32
|
-
export declare const FULL_VERSION = "0.20.
|
|
32
|
+
export declare const FULL_VERSION = "0.20.5-4e03aa0";
|
|
33
33
|
export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
|