@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.
Files changed (200) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/lib/cjs/graph/GraphExecutionStateMapper.cjs +97 -0
  3. package/lib/cjs/graph/GraphExecutionStateMapper.cjs.map +1 -0
  4. package/lib/cjs/graph/GraphResolution.cjs +17 -0
  5. package/lib/cjs/graph/GraphResolution.cjs.map +1 -0
  6. package/lib/cjs/graph/constants.cjs +157 -1
  7. package/lib/cjs/graph/constants.cjs.map +1 -1
  8. package/lib/cjs/graph/index.cjs +3 -0
  9. package/lib/cjs/graph/index.cjs.map +1 -1
  10. package/lib/cjs/graph/nodes/agents/agent.cjs +110 -0
  11. package/lib/cjs/graph/nodes/agents/agent.cjs.map +1 -0
  12. package/lib/cjs/graph/nodes/base.cjs +36 -0
  13. package/lib/cjs/graph/nodes/base.cjs.map +1 -0
  14. package/lib/cjs/graph/nodes/boundary/input-value.cjs +57 -0
  15. package/lib/cjs/graph/nodes/boundary/input-value.cjs.map +1 -0
  16. package/lib/cjs/graph/nodes/category-styles.cjs +38 -0
  17. package/lib/cjs/graph/nodes/category-styles.cjs.map +1 -0
  18. package/lib/cjs/graph/nodes/flow-control/break.cjs +63 -0
  19. package/lib/cjs/graph/nodes/flow-control/break.cjs.map +1 -0
  20. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs +67 -0
  21. package/lib/cjs/graph/nodes/flow-control/error-boundary.cjs.map +1 -0
  22. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs +69 -0
  23. package/lib/cjs/graph/nodes/flow-control/human-approval.cjs.map +1 -0
  24. package/lib/cjs/graph/nodes/flow-control/if.cjs +71 -0
  25. package/lib/cjs/graph/nodes/flow-control/if.cjs.map +1 -0
  26. package/lib/cjs/graph/nodes/flow-control/parallel.cjs +61 -0
  27. package/lib/cjs/graph/nodes/flow-control/parallel.cjs.map +1 -0
  28. package/lib/cjs/graph/nodes/flow-control/switch.cjs +121 -0
  29. package/lib/cjs/graph/nodes/flow-control/switch.cjs.map +1 -0
  30. package/lib/cjs/graph/nodes/index.cjs +123 -0
  31. package/lib/cjs/graph/nodes/index.cjs.map +1 -0
  32. package/lib/cjs/graph/nodes/loops/foreach.cjs +86 -0
  33. package/lib/cjs/graph/nodes/loops/foreach.cjs.map +1 -0
  34. package/lib/cjs/graph/nodes/loops/until.cjs +74 -0
  35. package/lib/cjs/graph/nodes/loops/until.cjs.map +1 -0
  36. package/lib/cjs/graph/nodes/loops/while.cjs +74 -0
  37. package/lib/cjs/graph/nodes/loops/while.cjs.map +1 -0
  38. package/lib/cjs/graph/nodes/manifests.cjs +338 -0
  39. package/lib/cjs/graph/nodes/manifests.cjs.map +1 -0
  40. package/lib/cjs/graph/nodes/triggers/chat.cjs +70 -0
  41. package/lib/cjs/graph/nodes/triggers/chat.cjs.map +1 -0
  42. package/lib/cjs/graph/nodes/triggers/event.cjs +58 -0
  43. package/lib/cjs/graph/nodes/triggers/event.cjs.map +1 -0
  44. package/lib/cjs/graph/nodes/triggers/form.cjs +59 -0
  45. package/lib/cjs/graph/nodes/triggers/form.cjs.map +1 -0
  46. package/lib/cjs/graph/nodes/triggers/manual.cjs +60 -0
  47. package/lib/cjs/graph/nodes/triggers/manual.cjs.map +1 -0
  48. package/lib/cjs/graph/nodes/triggers/schedule.cjs +60 -0
  49. package/lib/cjs/graph/nodes/triggers/schedule.cjs.map +1 -0
  50. package/lib/cjs/graph/nodes/triggers/webhook.cjs +62 -0
  51. package/lib/cjs/graph/nodes/triggers/webhook.cjs.map +1 -0
  52. package/lib/cjs/graph/nodes/utility/code.cjs +99 -0
  53. package/lib/cjs/graph/nodes/utility/code.cjs.map +1 -0
  54. package/lib/cjs/graph/nodes/utility/delay.cjs +61 -0
  55. package/lib/cjs/graph/nodes/utility/delay.cjs.map +1 -0
  56. package/lib/cjs/graph/nodes/utility/log.cjs +62 -0
  57. package/lib/cjs/graph/nodes/utility/log.cjs.map +1 -0
  58. package/lib/cjs/graph/nodes/utility/map.cjs +61 -0
  59. package/lib/cjs/graph/nodes/utility/map.cjs.map +1 -0
  60. package/lib/cjs/graph/nodes/utility/merge.cjs +62 -0
  61. package/lib/cjs/graph/nodes/utility/merge.cjs.map +1 -0
  62. package/lib/cjs/graph/nodes/utility/return.cjs +61 -0
  63. package/lib/cjs/graph/nodes/utility/return.cjs.map +1 -0
  64. package/lib/cjs/graph/nodes/utility/utility-log.cjs +66 -0
  65. package/lib/cjs/graph/nodes/utility/utility-log.cjs.map +1 -0
  66. package/lib/cjs/index.cjs +3 -3
  67. package/lib/esm/graph/GraphExecutionStateMapper.js +91 -0
  68. package/lib/esm/graph/GraphExecutionStateMapper.js.map +1 -0
  69. package/lib/esm/graph/GraphResolution.js +13 -0
  70. package/lib/esm/graph/GraphResolution.js.map +1 -0
  71. package/lib/esm/graph/constants.js +179 -0
  72. package/lib/esm/graph/constants.js.map +1 -1
  73. package/lib/esm/graph/index.js +3 -0
  74. package/lib/esm/graph/index.js.map +1 -1
  75. package/lib/esm/graph/nodes/agents/agent.js +101 -0
  76. package/lib/esm/graph/nodes/agents/agent.js.map +1 -0
  77. package/lib/esm/graph/nodes/base.js +31 -0
  78. package/lib/esm/graph/nodes/base.js.map +1 -0
  79. package/lib/esm/graph/nodes/boundary/input-value.js +48 -0
  80. package/lib/esm/graph/nodes/boundary/input-value.js.map +1 -0
  81. package/lib/esm/graph/nodes/category-styles.js +34 -0
  82. package/lib/esm/graph/nodes/category-styles.js.map +1 -0
  83. package/lib/esm/graph/nodes/flow-control/break.js +54 -0
  84. package/lib/esm/graph/nodes/flow-control/break.js.map +1 -0
  85. package/lib/esm/graph/nodes/flow-control/error-boundary.js +58 -0
  86. package/lib/esm/graph/nodes/flow-control/error-boundary.js.map +1 -0
  87. package/lib/esm/graph/nodes/flow-control/human-approval.js +60 -0
  88. package/lib/esm/graph/nodes/flow-control/human-approval.js.map +1 -0
  89. package/lib/esm/graph/nodes/flow-control/if.js +62 -0
  90. package/lib/esm/graph/nodes/flow-control/if.js.map +1 -0
  91. package/lib/esm/graph/nodes/flow-control/parallel.js +52 -0
  92. package/lib/esm/graph/nodes/flow-control/parallel.js.map +1 -0
  93. package/lib/esm/graph/nodes/flow-control/switch.js +112 -0
  94. package/lib/esm/graph/nodes/flow-control/switch.js.map +1 -0
  95. package/lib/esm/graph/nodes/index.js +105 -0
  96. package/lib/esm/graph/nodes/index.js.map +1 -0
  97. package/lib/esm/graph/nodes/loops/foreach.js +77 -0
  98. package/lib/esm/graph/nodes/loops/foreach.js.map +1 -0
  99. package/lib/esm/graph/nodes/loops/until.js +65 -0
  100. package/lib/esm/graph/nodes/loops/until.js.map +1 -0
  101. package/lib/esm/graph/nodes/loops/while.js +65 -0
  102. package/lib/esm/graph/nodes/loops/while.js.map +1 -0
  103. package/lib/esm/graph/nodes/manifests.js +334 -0
  104. package/lib/esm/graph/nodes/manifests.js.map +1 -0
  105. package/lib/esm/graph/nodes/triggers/chat.js +61 -0
  106. package/lib/esm/graph/nodes/triggers/chat.js.map +1 -0
  107. package/lib/esm/graph/nodes/triggers/event.js +49 -0
  108. package/lib/esm/graph/nodes/triggers/event.js.map +1 -0
  109. package/lib/esm/graph/nodes/triggers/form.js +50 -0
  110. package/lib/esm/graph/nodes/triggers/form.js.map +1 -0
  111. package/lib/esm/graph/nodes/triggers/manual.js +51 -0
  112. package/lib/esm/graph/nodes/triggers/manual.js.map +1 -0
  113. package/lib/esm/graph/nodes/triggers/schedule.js +51 -0
  114. package/lib/esm/graph/nodes/triggers/schedule.js.map +1 -0
  115. package/lib/esm/graph/nodes/triggers/webhook.js +53 -0
  116. package/lib/esm/graph/nodes/triggers/webhook.js.map +1 -0
  117. package/lib/esm/graph/nodes/utility/code.js +90 -0
  118. package/lib/esm/graph/nodes/utility/code.js.map +1 -0
  119. package/lib/esm/graph/nodes/utility/delay.js +52 -0
  120. package/lib/esm/graph/nodes/utility/delay.js.map +1 -0
  121. package/lib/esm/graph/nodes/utility/log.js +53 -0
  122. package/lib/esm/graph/nodes/utility/log.js.map +1 -0
  123. package/lib/esm/graph/nodes/utility/map.js +52 -0
  124. package/lib/esm/graph/nodes/utility/map.js.map +1 -0
  125. package/lib/esm/graph/nodes/utility/merge.js +53 -0
  126. package/lib/esm/graph/nodes/utility/merge.js.map +1 -0
  127. package/lib/esm/graph/nodes/utility/return.js +52 -0
  128. package/lib/esm/graph/nodes/utility/return.js.map +1 -0
  129. package/lib/esm/graph/nodes/utility/utility-log.js +57 -0
  130. package/lib/esm/graph/nodes/utility/utility-log.js.map +1 -0
  131. package/lib/esm/index.js +3 -3
  132. package/lib/types/graph/GraphExecutionStateMapper.d.cts +66 -0
  133. package/lib/types/graph/GraphExecutionStateMapper.d.mts +66 -0
  134. package/lib/types/graph/GraphResolution.d.cts +53 -0
  135. package/lib/types/graph/GraphResolution.d.mts +53 -0
  136. package/lib/types/graph/constants.d.cts +165 -0
  137. package/lib/types/graph/constants.d.mts +165 -0
  138. package/lib/types/graph/index.d.cts +3 -0
  139. package/lib/types/graph/index.d.mts +3 -0
  140. package/lib/types/graph/nodes/agents/agent.d.cts +44 -0
  141. package/lib/types/graph/nodes/agents/agent.d.mts +44 -0
  142. package/lib/types/graph/nodes/base.d.cts +28 -0
  143. package/lib/types/graph/nodes/base.d.mts +28 -0
  144. package/lib/types/graph/nodes/boundary/input-value.d.cts +13 -0
  145. package/lib/types/graph/nodes/boundary/input-value.d.mts +13 -0
  146. package/lib/types/graph/nodes/category-styles.d.cts +8 -0
  147. package/lib/types/graph/nodes/category-styles.d.mts +8 -0
  148. package/lib/types/graph/nodes/flow-control/break.d.cts +15 -0
  149. package/lib/types/graph/nodes/flow-control/break.d.mts +15 -0
  150. package/lib/types/graph/nodes/flow-control/error-boundary.d.cts +12 -0
  151. package/lib/types/graph/nodes/flow-control/error-boundary.d.mts +12 -0
  152. package/lib/types/graph/nodes/flow-control/human-approval.d.cts +13 -0
  153. package/lib/types/graph/nodes/flow-control/human-approval.d.mts +13 -0
  154. package/lib/types/graph/nodes/flow-control/if.d.cts +16 -0
  155. package/lib/types/graph/nodes/flow-control/if.d.mts +16 -0
  156. package/lib/types/graph/nodes/flow-control/parallel.d.cts +11 -0
  157. package/lib/types/graph/nodes/flow-control/parallel.d.mts +11 -0
  158. package/lib/types/graph/nodes/flow-control/switch.d.cts +21 -0
  159. package/lib/types/graph/nodes/flow-control/switch.d.mts +21 -0
  160. package/lib/types/graph/nodes/index.d.cts +79 -0
  161. package/lib/types/graph/nodes/index.d.mts +79 -0
  162. package/lib/types/graph/nodes/loops/foreach.d.cts +19 -0
  163. package/lib/types/graph/nodes/loops/foreach.d.mts +19 -0
  164. package/lib/types/graph/nodes/loops/until.d.cts +16 -0
  165. package/lib/types/graph/nodes/loops/until.d.mts +16 -0
  166. package/lib/types/graph/nodes/loops/while.d.cts +16 -0
  167. package/lib/types/graph/nodes/loops/while.d.mts +16 -0
  168. package/lib/types/graph/nodes/manifests.d.cts +62 -0
  169. package/lib/types/graph/nodes/manifests.d.mts +62 -0
  170. package/lib/types/graph/nodes/triggers/chat.d.cts +13 -0
  171. package/lib/types/graph/nodes/triggers/chat.d.mts +13 -0
  172. package/lib/types/graph/nodes/triggers/event.d.cts +10 -0
  173. package/lib/types/graph/nodes/triggers/event.d.mts +10 -0
  174. package/lib/types/graph/nodes/triggers/form.d.cts +11 -0
  175. package/lib/types/graph/nodes/triggers/form.d.mts +11 -0
  176. package/lib/types/graph/nodes/triggers/manual.d.cts +12 -0
  177. package/lib/types/graph/nodes/triggers/manual.d.mts +12 -0
  178. package/lib/types/graph/nodes/triggers/schedule.d.cts +11 -0
  179. package/lib/types/graph/nodes/triggers/schedule.d.mts +11 -0
  180. package/lib/types/graph/nodes/triggers/webhook.d.cts +11 -0
  181. package/lib/types/graph/nodes/triggers/webhook.d.mts +11 -0
  182. package/lib/types/graph/nodes/utility/code.d.cts +31 -0
  183. package/lib/types/graph/nodes/utility/code.d.mts +31 -0
  184. package/lib/types/graph/nodes/utility/delay.d.cts +11 -0
  185. package/lib/types/graph/nodes/utility/delay.d.mts +11 -0
  186. package/lib/types/graph/nodes/utility/log.d.cts +13 -0
  187. package/lib/types/graph/nodes/utility/log.d.mts +13 -0
  188. package/lib/types/graph/nodes/utility/map.d.cts +11 -0
  189. package/lib/types/graph/nodes/utility/map.d.mts +11 -0
  190. package/lib/types/graph/nodes/utility/merge.d.cts +12 -0
  191. package/lib/types/graph/nodes/utility/merge.d.mts +12 -0
  192. package/lib/types/graph/nodes/utility/return.d.cts +11 -0
  193. package/lib/types/graph/nodes/utility/return.d.mts +11 -0
  194. package/lib/types/graph/nodes/utility/utility-log.d.cts +15 -0
  195. package/lib/types/graph/nodes/utility/utility-log.d.mts +15 -0
  196. package/lib/types/graph/types.d.cts +286 -0
  197. package/lib/types/graph/types.d.mts +286 -0
  198. package/lib/types/index.d.cts +3 -3
  199. package/lib/types/index.d.mts +3 -3
  200. 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">;
@@ -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.4";
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 = "b1ab2bc";
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.4-b1ab2bc";
32
+ export declare const FULL_VERSION = "0.20.5-4e03aa0";
33
33
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
@@ -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.4";
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 = "b1ab2bc";
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.4-b1ab2bc";
32
+ export declare const FULL_VERSION = "0.20.5-4e03aa0";
33
33
  export declare const PACKAGE_NAME = "@decaf-ts/ui-decorators";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/ui-decorators",
3
- "version": "0.20.4",
3
+ "version": "0.20.6",
4
4
  "description": "Extension of decorator validation to ui elements to allow for web integration",
5
5
  "type": "module",
6
6
  "exports": {