@elevasis/ui 1.0.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/api/index.d.ts +87 -0
- package/dist/api/index.js +3 -0
- package/dist/auth/context.d.ts +19 -0
- package/dist/auth/context.js +1 -0
- package/dist/auth/index.d.ts +85 -0
- package/dist/auth/index.js +3 -0
- package/dist/chunk-3KMDHCAR.js +52 -0
- package/dist/chunk-5UWFGBFM.js +129 -0
- package/dist/chunk-6BJOYF6E.js +8 -0
- package/dist/chunk-6M6OLGQY.js +36 -0
- package/dist/chunk-7AI5ZYJ4.js +202 -0
- package/dist/chunk-7PLEQFHO.js +18 -0
- package/dist/chunk-GDV44UWF.js +138 -0
- package/dist/chunk-GEFB5YIR.js +338 -0
- package/dist/chunk-HBRMWW6V.js +43 -0
- package/dist/chunk-HUWJXLLF.js +681 -0
- package/dist/chunk-J3FALDQE.js +176 -0
- package/dist/chunk-JKERRYVS.js +109 -0
- package/dist/chunk-KA7LO7U5.js +28 -0
- package/dist/chunk-LHQTTUL2.js +27 -0
- package/dist/chunk-MAAS6CGR.js +1299 -0
- package/dist/chunk-NE36BUGQ.js +146 -0
- package/dist/chunk-NGXCFBCS.js +398 -0
- package/dist/chunk-OEYU5O27.js +235 -0
- package/dist/chunk-OUHGHTE7.js +748 -0
- package/dist/chunk-OXVOHOP3.js +661 -0
- package/dist/chunk-PSLKGOBZ.js +58 -0
- package/dist/chunk-PYL4XW6H.js +107 -0
- package/dist/chunk-Q47SPRY7.js +1 -0
- package/dist/chunk-Q7DJKLEN.js +18 -0
- package/dist/chunk-RJCA5672.js +1664 -0
- package/dist/chunk-S66I2PYB.js +748 -0
- package/dist/chunk-W7ZBF5AA.js +1 -0
- package/dist/chunk-WNWKOCGJ.js +1067 -0
- package/dist/chunk-XCYKC6OZ.js +1 -0
- package/dist/chunk-YULUKCS6.js +56 -0
- package/dist/chunk-YZ6GTZXL.js +48 -0
- package/dist/chunk-ZGHDPDTF.js +379 -0
- package/dist/components/command-queue/index.css +53 -0
- package/dist/components/command-queue/index.d.ts +204 -0
- package/dist/components/command-queue/index.js +10 -0
- package/dist/components/forms/index.d.ts +56 -0
- package/dist/components/forms/index.js +2 -0
- package/dist/components/index.css +443 -0
- package/dist/components/index.d.ts +1354 -0
- package/dist/components/index.js +18 -0
- package/dist/components/monitoring/index.d.ts +66 -0
- package/dist/components/monitoring/index.js +2 -0
- package/dist/components/navigation/index.d.ts +54 -0
- package/dist/components/navigation/index.js +91 -0
- package/dist/components/notifications/index.d.ts +52 -0
- package/dist/components/notifications/index.js +4 -0
- package/dist/components/resource-definition/index.css +388 -0
- package/dist/components/resource-definition/index.d.ts +301 -0
- package/dist/components/resource-definition/index.js +3 -0
- package/dist/display/index.css +53 -0
- package/dist/display/index.d.ts +606 -0
- package/dist/display/index.js +6 -0
- package/dist/execution/index.css +388 -0
- package/dist/execution/index.d.ts +1090 -0
- package/dist/execution/index.js +4 -0
- package/dist/graph/index.css +388 -0
- package/dist/graph/index.d.ts +429 -0
- package/dist/graph/index.js +1 -0
- package/dist/hooks/index.d.ts +1927 -0
- package/dist/hooks/index.js +6 -0
- package/dist/hooks/published.d.ts +1653 -0
- package/dist/hooks/published.js +4 -0
- package/dist/index.css +505 -0
- package/dist/index.d.ts +7284 -0
- package/dist/index.js +31 -0
- package/dist/initialization/index.d.ts +2325 -0
- package/dist/initialization/index.js +4 -0
- package/dist/organization/index.d.ts +225 -0
- package/dist/organization/index.js +4 -0
- package/dist/profile/index.d.ts +2265 -0
- package/dist/profile/index.js +3 -0
- package/dist/provider/index.css +61 -0
- package/dist/provider/index.d.ts +291 -0
- package/dist/provider/index.js +7 -0
- package/dist/provider/published.d.ts +198 -0
- package/dist/provider/published.js +6 -0
- package/dist/router/context.d.ts +19 -0
- package/dist/router/context.js +1 -0
- package/dist/router/index.d.ts +31 -0
- package/dist/router/index.js +2 -0
- package/dist/sse/index.d.ts +83 -0
- package/dist/sse/index.js +185 -0
- package/dist/supabase/index.d.ts +4289 -0
- package/dist/supabase/index.js +47 -0
- package/dist/typeform/index.d.ts +458 -0
- package/dist/typeform/index.js +1976 -0
- package/dist/typeform/schemas.d.ts +67 -0
- package/dist/typeform/schemas.js +1 -0
- package/dist/utils/index.d.ts +177 -0
- package/dist/utils/index.js +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,1090 @@
|
|
|
1
|
+
import { Node, Edge, NodeProps, EdgeProps } from '@xyflow/react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { BadgeProps } from '@mantine/core';
|
|
4
|
+
import * as react from 'react';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Workflow-specific logging types and utilities
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
interface WorkflowExecutionContext {
|
|
11
|
+
type: 'workflow';
|
|
12
|
+
contextType: 'workflow-execution';
|
|
13
|
+
executionId: string;
|
|
14
|
+
workflowId: string;
|
|
15
|
+
workflowName?: string;
|
|
16
|
+
organizationId: string;
|
|
17
|
+
executionPath?: string[];
|
|
18
|
+
}
|
|
19
|
+
interface WorkflowFailureContext {
|
|
20
|
+
type: 'workflow';
|
|
21
|
+
contextType: 'workflow-failure';
|
|
22
|
+
executionId: string;
|
|
23
|
+
workflowId: string;
|
|
24
|
+
error: string;
|
|
25
|
+
}
|
|
26
|
+
interface StepStartedContext {
|
|
27
|
+
type: 'workflow';
|
|
28
|
+
contextType: 'step-started';
|
|
29
|
+
stepId: string;
|
|
30
|
+
stepStatus: 'started';
|
|
31
|
+
input: unknown;
|
|
32
|
+
startTime: number;
|
|
33
|
+
}
|
|
34
|
+
interface StepCompletedContext {
|
|
35
|
+
type: 'workflow';
|
|
36
|
+
contextType: 'step-completed';
|
|
37
|
+
stepId: string;
|
|
38
|
+
stepStatus: 'completed';
|
|
39
|
+
output: unknown;
|
|
40
|
+
duration: number;
|
|
41
|
+
isTerminal: boolean;
|
|
42
|
+
startTime: number;
|
|
43
|
+
endTime: number;
|
|
44
|
+
}
|
|
45
|
+
interface StepFailedContext {
|
|
46
|
+
type: 'workflow';
|
|
47
|
+
contextType: 'step-failed';
|
|
48
|
+
stepId: string;
|
|
49
|
+
stepStatus: 'failed';
|
|
50
|
+
error: string;
|
|
51
|
+
duration: number;
|
|
52
|
+
startTime: number;
|
|
53
|
+
endTime: number;
|
|
54
|
+
}
|
|
55
|
+
interface ConditionalRouteContext {
|
|
56
|
+
type: 'workflow';
|
|
57
|
+
contextType: 'conditional-route';
|
|
58
|
+
stepId: string;
|
|
59
|
+
target: string;
|
|
60
|
+
error?: string;
|
|
61
|
+
}
|
|
62
|
+
interface ExecutionPathContext {
|
|
63
|
+
type: 'workflow';
|
|
64
|
+
contextType: 'execution-path';
|
|
65
|
+
executionPath: string[];
|
|
66
|
+
}
|
|
67
|
+
type WorkflowLogContext = WorkflowExecutionContext | WorkflowFailureContext | StepStartedContext | StepCompletedContext | StepFailedContext | ConditionalRouteContext | ExecutionPathContext;
|
|
68
|
+
interface WorkflowLogMessage {
|
|
69
|
+
level: ExecutionLogLevel;
|
|
70
|
+
message: string;
|
|
71
|
+
timestamp: number;
|
|
72
|
+
context?: WorkflowLogContext;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Agent-specific logging types
|
|
77
|
+
* Simplified 2-event model: lifecycle, iteration
|
|
78
|
+
*
|
|
79
|
+
* Design Philosophy:
|
|
80
|
+
* - LIFECYCLE EVENTS: Structural checkpoints (initialization, iteration, completion)
|
|
81
|
+
* - ITERATION EVENTS: Execution activities (reasoning, actions during iterations)
|
|
82
|
+
*/
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Agent lifecycle stages
|
|
86
|
+
* Universal checkpoints that apply to all agent executions
|
|
87
|
+
*/
|
|
88
|
+
type AgentLifecycle = 'initialization' | 'iteration' | 'completion';
|
|
89
|
+
/**
|
|
90
|
+
* Iteration event types
|
|
91
|
+
* Activities that occur during agent iterations
|
|
92
|
+
*/
|
|
93
|
+
type IterationEventType = 'reasoning' | 'action' | 'tool-call';
|
|
94
|
+
/**
|
|
95
|
+
* Base fields shared by all lifecycle events
|
|
96
|
+
*/
|
|
97
|
+
interface AgentLifecycleEventBase {
|
|
98
|
+
type: 'agent';
|
|
99
|
+
agentId: string;
|
|
100
|
+
lifecycle: AgentLifecycle;
|
|
101
|
+
sessionId?: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Lifecycle started event - emitted when a phase begins
|
|
105
|
+
* REQUIRED: startTime (phase has started, no end yet)
|
|
106
|
+
*/
|
|
107
|
+
interface AgentLifecycleStartedEvent extends AgentLifecycleEventBase {
|
|
108
|
+
stage: 'started';
|
|
109
|
+
startTime: number;
|
|
110
|
+
iteration?: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Lifecycle completed event - emitted when a phase succeeds
|
|
114
|
+
* REQUIRED: startTime, endTime, duration (phase has finished successfully)
|
|
115
|
+
*/
|
|
116
|
+
interface AgentLifecycleCompletedEvent extends AgentLifecycleEventBase {
|
|
117
|
+
stage: 'completed';
|
|
118
|
+
startTime: number;
|
|
119
|
+
endTime: number;
|
|
120
|
+
duration: number;
|
|
121
|
+
iteration?: number;
|
|
122
|
+
attempts?: number;
|
|
123
|
+
memorySize?: {
|
|
124
|
+
sessionMemoryKeys: number;
|
|
125
|
+
historyEntries: number;
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Lifecycle failed event - emitted when a phase fails
|
|
130
|
+
* REQUIRED: startTime, endTime, duration, error (phase has finished with error)
|
|
131
|
+
*/
|
|
132
|
+
interface AgentLifecycleFailedEvent extends AgentLifecycleEventBase {
|
|
133
|
+
stage: 'failed';
|
|
134
|
+
startTime: number;
|
|
135
|
+
endTime: number;
|
|
136
|
+
duration: number;
|
|
137
|
+
error: string;
|
|
138
|
+
iteration?: number;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Union type for all lifecycle events
|
|
142
|
+
* Discriminated by 'stage' field for type narrowing
|
|
143
|
+
*/
|
|
144
|
+
type AgentLifecycleEvent = AgentLifecycleStartedEvent | AgentLifecycleCompletedEvent | AgentLifecycleFailedEvent;
|
|
145
|
+
/**
|
|
146
|
+
* Placeholder data for MVP
|
|
147
|
+
* Will be typed per actionType in future
|
|
148
|
+
*/
|
|
149
|
+
interface ActionPlaceholderData {
|
|
150
|
+
message: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Iteration event - captures activities during agent iterations
|
|
154
|
+
* Consolidates reasoning (LLM thought process) and actions (tool use, memory ops, etc.)
|
|
155
|
+
*/
|
|
156
|
+
interface AgentIterationEvent {
|
|
157
|
+
type: 'agent';
|
|
158
|
+
agentId: string;
|
|
159
|
+
lifecycle: 'iteration';
|
|
160
|
+
eventType: IterationEventType;
|
|
161
|
+
iteration: number;
|
|
162
|
+
sessionId?: string;
|
|
163
|
+
startTime: number;
|
|
164
|
+
endTime: number;
|
|
165
|
+
duration: number;
|
|
166
|
+
output?: string;
|
|
167
|
+
actionType?: string;
|
|
168
|
+
data?: ActionPlaceholderData;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Tool call event - captures individual tool executions during iterations
|
|
172
|
+
* Provides granular timing for each tool invocation
|
|
173
|
+
*/
|
|
174
|
+
interface AgentToolCallEvent {
|
|
175
|
+
type: 'agent';
|
|
176
|
+
agentId: string;
|
|
177
|
+
lifecycle: 'iteration';
|
|
178
|
+
eventType: 'tool-call';
|
|
179
|
+
iteration: number;
|
|
180
|
+
sessionId?: string;
|
|
181
|
+
toolName: string;
|
|
182
|
+
startTime: number;
|
|
183
|
+
endTime: number;
|
|
184
|
+
duration: number;
|
|
185
|
+
success: boolean;
|
|
186
|
+
error?: string;
|
|
187
|
+
input?: Record<string, unknown>;
|
|
188
|
+
output?: unknown;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Union type for all agent log contexts
|
|
192
|
+
* 3 event types total (lifecycle, iteration, tool-call)
|
|
193
|
+
*/
|
|
194
|
+
type AgentLogContext = AgentLifecycleEvent | AgentIterationEvent | AgentToolCallEvent;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Base execution logger for Execution Engine
|
|
198
|
+
*/
|
|
199
|
+
type ExecutionLogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
200
|
+
|
|
201
|
+
type LogContext = WorkflowLogContext | AgentLogContext;
|
|
202
|
+
interface ExecutionLogMessage {
|
|
203
|
+
level: ExecutionLogLevel;
|
|
204
|
+
message: string;
|
|
205
|
+
timestamp: number;
|
|
206
|
+
context?: LogContext;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Shared form field types for dynamic form generation
|
|
211
|
+
* Used by: Command Queue, Execution Runner UI, future form-based features
|
|
212
|
+
*/
|
|
213
|
+
/**
|
|
214
|
+
* Supported form field types for action payloads
|
|
215
|
+
* Maps to Mantine form components
|
|
216
|
+
*/
|
|
217
|
+
type FormFieldType = 'text' | 'textarea' | 'number' | 'select' | 'checkbox' | 'radio' | 'richtext';
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Serialized Registry Types
|
|
221
|
+
*
|
|
222
|
+
* Pre-computed JSON-safe types for API responses and Command View.
|
|
223
|
+
* Serialization happens once at API startup, enabling instant response times.
|
|
224
|
+
*/
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Serialized form field for API responses
|
|
228
|
+
*/
|
|
229
|
+
interface SerializedFormField {
|
|
230
|
+
name: string;
|
|
231
|
+
label: string;
|
|
232
|
+
type: FormFieldType;
|
|
233
|
+
defaultValue?: unknown;
|
|
234
|
+
required?: boolean;
|
|
235
|
+
placeholder?: string;
|
|
236
|
+
description?: string;
|
|
237
|
+
options?: Array<{
|
|
238
|
+
label: string;
|
|
239
|
+
value: string | number;
|
|
240
|
+
}>;
|
|
241
|
+
min?: number;
|
|
242
|
+
max?: number;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Serialized form schema for API responses
|
|
246
|
+
*/
|
|
247
|
+
interface SerializedFormSchema {
|
|
248
|
+
title?: string;
|
|
249
|
+
description?: string;
|
|
250
|
+
fields: SerializedFormField[];
|
|
251
|
+
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Serialized execution form schema for API responses
|
|
255
|
+
*/
|
|
256
|
+
interface SerializedExecutionFormSchema extends SerializedFormSchema {
|
|
257
|
+
fieldMappings?: Record<string, string>;
|
|
258
|
+
submitButton?: {
|
|
259
|
+
label?: string;
|
|
260
|
+
loadingLabel?: string;
|
|
261
|
+
confirmMessage?: string;
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Serialized schedule config for API responses
|
|
266
|
+
*/
|
|
267
|
+
interface SerializedScheduleConfig {
|
|
268
|
+
enabled: boolean;
|
|
269
|
+
defaultSchedule?: string;
|
|
270
|
+
allowedPatterns?: string[];
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Serialized webhook config for API responses
|
|
274
|
+
*/
|
|
275
|
+
interface SerializedWebhookConfig {
|
|
276
|
+
enabled: boolean;
|
|
277
|
+
payloadSchema?: unknown;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Serialized execution interface for API responses
|
|
281
|
+
*/
|
|
282
|
+
interface SerializedExecutionInterface {
|
|
283
|
+
form: SerializedExecutionFormSchema;
|
|
284
|
+
schedule?: SerializedScheduleConfig;
|
|
285
|
+
webhook?: SerializedWebhookConfig;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Serialized agent definition (JSON-safe)
|
|
289
|
+
* Result of serializeDefinition(AgentDefinition)
|
|
290
|
+
*/
|
|
291
|
+
interface SerializedAgentDefinition {
|
|
292
|
+
config: {
|
|
293
|
+
resourceId: string;
|
|
294
|
+
name: string;
|
|
295
|
+
description: string;
|
|
296
|
+
version: string;
|
|
297
|
+
type: 'agent';
|
|
298
|
+
status: 'dev' | 'prod';
|
|
299
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
300
|
+
archived?: boolean;
|
|
301
|
+
systemPrompt: string;
|
|
302
|
+
constraints?: {
|
|
303
|
+
maxIterations?: number;
|
|
304
|
+
timeout?: number;
|
|
305
|
+
maxSessionMemoryKeys?: number;
|
|
306
|
+
maxMemoryTokens?: number;
|
|
307
|
+
};
|
|
308
|
+
sessionCapable?: boolean;
|
|
309
|
+
memoryPreferences?: string;
|
|
310
|
+
};
|
|
311
|
+
modelConfig: {
|
|
312
|
+
provider: string;
|
|
313
|
+
model: string;
|
|
314
|
+
apiKey: string;
|
|
315
|
+
temperature: number;
|
|
316
|
+
maxOutputTokens: number;
|
|
317
|
+
topP?: number;
|
|
318
|
+
modelOptions?: Record<string, unknown>;
|
|
319
|
+
};
|
|
320
|
+
contract: {
|
|
321
|
+
inputSchema: object;
|
|
322
|
+
outputSchema?: object;
|
|
323
|
+
};
|
|
324
|
+
tools: Array<{
|
|
325
|
+
name: string;
|
|
326
|
+
description: string;
|
|
327
|
+
inputSchema?: object;
|
|
328
|
+
outputSchema?: object;
|
|
329
|
+
}>;
|
|
330
|
+
knowledgeMap?: {
|
|
331
|
+
nodeCount: number;
|
|
332
|
+
nodes: Array<{
|
|
333
|
+
id: string;
|
|
334
|
+
description: string;
|
|
335
|
+
loaded: boolean;
|
|
336
|
+
hasPrompt: boolean;
|
|
337
|
+
}>;
|
|
338
|
+
};
|
|
339
|
+
metricsConfig?: object;
|
|
340
|
+
interface?: SerializedExecutionInterface;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Serialized workflow definition (JSON-safe)
|
|
344
|
+
* Result of serializeDefinition(WorkflowDefinition)
|
|
345
|
+
*/
|
|
346
|
+
interface SerializedWorkflowDefinition {
|
|
347
|
+
config: {
|
|
348
|
+
resourceId: string;
|
|
349
|
+
name: string;
|
|
350
|
+
description: string;
|
|
351
|
+
version: string;
|
|
352
|
+
type: 'workflow';
|
|
353
|
+
status: 'dev' | 'prod';
|
|
354
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
355
|
+
archived?: boolean;
|
|
356
|
+
};
|
|
357
|
+
entryPoint: string;
|
|
358
|
+
steps: Array<{
|
|
359
|
+
id: string;
|
|
360
|
+
name: string;
|
|
361
|
+
description: string;
|
|
362
|
+
inputSchema?: object;
|
|
363
|
+
outputSchema?: object;
|
|
364
|
+
next: {
|
|
365
|
+
type: 'linear' | 'conditional';
|
|
366
|
+
target?: string;
|
|
367
|
+
routes?: Array<{
|
|
368
|
+
target: string;
|
|
369
|
+
}>;
|
|
370
|
+
default?: string;
|
|
371
|
+
} | null;
|
|
372
|
+
}>;
|
|
373
|
+
contract: {
|
|
374
|
+
inputSchema: object;
|
|
375
|
+
outputSchema?: object;
|
|
376
|
+
};
|
|
377
|
+
metricsConfig?: object;
|
|
378
|
+
interface?: SerializedExecutionInterface;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
/**
|
|
382
|
+
* Workflow step state
|
|
383
|
+
* Aggregates step context events with timing and logs
|
|
384
|
+
*/
|
|
385
|
+
interface StepState {
|
|
386
|
+
stepId: string;
|
|
387
|
+
stepName: string;
|
|
388
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
389
|
+
startTime?: number;
|
|
390
|
+
endTime?: number;
|
|
391
|
+
duration?: number;
|
|
392
|
+
input?: unknown;
|
|
393
|
+
output?: unknown;
|
|
394
|
+
error?: unknown;
|
|
395
|
+
logs: WorkflowLogMessage[];
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Complete workflow execution data for node visualization
|
|
399
|
+
* Parsed from execution logs
|
|
400
|
+
*/
|
|
401
|
+
interface WorkflowNodeVisualizerData {
|
|
402
|
+
steps: StepState[];
|
|
403
|
+
totalDuration: number;
|
|
404
|
+
isRunning: boolean;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Step data extracted from execution logs
|
|
408
|
+
* Used to provide detailed step information in unified graph nodes
|
|
409
|
+
*/
|
|
410
|
+
interface StepExecutionData {
|
|
411
|
+
/** Final execution status for this step */
|
|
412
|
+
status: 'pending' | 'running' | 'completed' | 'failed';
|
|
413
|
+
/** Step execution duration in milliseconds */
|
|
414
|
+
duration?: number;
|
|
415
|
+
/** Step input data */
|
|
416
|
+
input?: unknown;
|
|
417
|
+
/** Step output data */
|
|
418
|
+
output?: unknown;
|
|
419
|
+
/** Error data if step failed */
|
|
420
|
+
error?: unknown;
|
|
421
|
+
/** Log messages from this step (reserved for future use) */
|
|
422
|
+
logs?: unknown[];
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Execution path tracking state
|
|
426
|
+
*
|
|
427
|
+
* Tracks which steps have been executed and which edges were taken during workflow
|
|
428
|
+
* execution. This state is built from SSE execution log events and used to compute
|
|
429
|
+
* the visual dimming/highlighting of nodes and edges.
|
|
430
|
+
*
|
|
431
|
+
* Algorithm:
|
|
432
|
+
* - `executedSteps` provides O(1) lookup for "has this step been reached?"
|
|
433
|
+
* - `executedStepsOrdered` preserves execution order for edge inference
|
|
434
|
+
* - `takenEdges` comes from `conditional-route` SSE events + linear step inference
|
|
435
|
+
* - `currentStepId` tracks the actively running step for animation
|
|
436
|
+
* - `stepStatusMap` provides final status for each executed step
|
|
437
|
+
* - `stepDataMap` provides detailed execution data (duration, input, output, error)
|
|
438
|
+
*/
|
|
439
|
+
interface ExecutionPathState {
|
|
440
|
+
/** Set of step IDs that have been executed (O(1) lookup) */
|
|
441
|
+
executedSteps: Set<string>;
|
|
442
|
+
/** Step IDs in execution order (for inferring linear edges) */
|
|
443
|
+
executedStepsOrdered: string[];
|
|
444
|
+
/** Set of edge IDs that were traversed (format: "edge-{source}-{target}") */
|
|
445
|
+
takenEdges: Set<string>;
|
|
446
|
+
/** Currently running step ID (undefined if no step is running) */
|
|
447
|
+
currentStepId?: string;
|
|
448
|
+
/** Map of step IDs to their final execution status */
|
|
449
|
+
stepStatusMap?: Map<string, 'pending' | 'running' | 'completed' | 'failed'>;
|
|
450
|
+
/** Map of step IDs to their execution data (duration, input, output, error) */
|
|
451
|
+
stepDataMap?: Map<string, StepExecutionData>;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* Agent timeline and observability types
|
|
456
|
+
* Used for UI timeline visualization and backend processing
|
|
457
|
+
*/
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* Sub-activity within an iteration
|
|
461
|
+
* Represents reasoning, actions, or tool calls with timing
|
|
462
|
+
*/
|
|
463
|
+
interface SubActivity {
|
|
464
|
+
type: 'reasoning' | 'action' | 'tool-call';
|
|
465
|
+
startTime: number;
|
|
466
|
+
endTime: number;
|
|
467
|
+
duration: number;
|
|
468
|
+
details: AgentIterationEvent | AgentToolCallEvent;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Agent iteration state
|
|
472
|
+
* Aggregates lifecycle events and sub-activities for a single iteration
|
|
473
|
+
*/
|
|
474
|
+
interface AgentIteration {
|
|
475
|
+
iterationNumber: number;
|
|
476
|
+
status: 'running' | 'completed' | 'failed' | 'pending';
|
|
477
|
+
iterationEvents: AgentIterationEvent[];
|
|
478
|
+
duration?: number;
|
|
479
|
+
timestamp: number;
|
|
480
|
+
subActivities: SubActivity[];
|
|
481
|
+
startTime?: number;
|
|
482
|
+
endTime?: number;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Agent lifecycle node state
|
|
486
|
+
* Represents initialization or completion phase
|
|
487
|
+
*/
|
|
488
|
+
interface AgentLifecycleNode {
|
|
489
|
+
type: 'initialization' | 'completion';
|
|
490
|
+
status: 'running' | 'completed' | 'failed' | 'pending';
|
|
491
|
+
duration?: number;
|
|
492
|
+
timestamp?: number;
|
|
493
|
+
startTime?: number;
|
|
494
|
+
endTime?: number;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Complete agent execution data for timeline visualization
|
|
498
|
+
* Parsed from execution logs
|
|
499
|
+
*/
|
|
500
|
+
interface AgentIterationData {
|
|
501
|
+
initialization: AgentLifecycleNode;
|
|
502
|
+
iterations: AgentIteration[];
|
|
503
|
+
completion: AgentLifecycleNode;
|
|
504
|
+
currentIteration: number | null;
|
|
505
|
+
totalIterations: number;
|
|
506
|
+
totalDuration?: number;
|
|
507
|
+
status: 'running' | 'completed' | 'failed' | 'warning';
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Resource Registry type definitions
|
|
512
|
+
*/
|
|
513
|
+
|
|
514
|
+
/**
|
|
515
|
+
* Environment/deployment status for resources
|
|
516
|
+
*/
|
|
517
|
+
type ResourceStatus = 'dev' | 'prod';
|
|
518
|
+
|
|
519
|
+
type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'warning';
|
|
520
|
+
interface APIExecutionSummary {
|
|
521
|
+
id: string;
|
|
522
|
+
status: ExecutionStatus;
|
|
523
|
+
startTime: number;
|
|
524
|
+
endTime?: number;
|
|
525
|
+
resourceStatus?: ResourceStatus;
|
|
526
|
+
}
|
|
527
|
+
interface APIExecutionDetail extends APIExecutionSummary {
|
|
528
|
+
executionLogs: ExecutionLogMessage[];
|
|
529
|
+
input?: unknown;
|
|
530
|
+
result?: unknown;
|
|
531
|
+
error?: string;
|
|
532
|
+
resourceStatus: ResourceStatus;
|
|
533
|
+
apiVersion?: string | null;
|
|
534
|
+
resourceVersion?: string | null;
|
|
535
|
+
sdkVersion?: string | null;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Merges SSE-streamed logs with fetched execution data for instant log display.
|
|
540
|
+
* Deduplicates by composite key (timestamp + message) to avoid showing the same
|
|
541
|
+
* log twice while preserving distinct logs that share the same millisecond.
|
|
542
|
+
*
|
|
543
|
+
* When no streaming logs exist or all SSE logs are already in the fetched data,
|
|
544
|
+
* returns the fetched execution unchanged for referential stability.
|
|
545
|
+
*/
|
|
546
|
+
declare function useMergedExecution(fetchedExecution: APIExecutionDetail | undefined, streamingLogs: ExecutionLogMessage[] | undefined): APIExecutionDetail | undefined;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* Hook to track execution path from execution logs
|
|
550
|
+
*
|
|
551
|
+
* This hook parses execution logs to determine:
|
|
552
|
+
* 1. Which steps have been executed
|
|
553
|
+
* 2. Which edges were taken during execution
|
|
554
|
+
* 3. The current running step
|
|
555
|
+
*
|
|
556
|
+
* Algorithm:
|
|
557
|
+
* - Track executed steps from step-started events
|
|
558
|
+
* - Track taken edges from conditional-route events (explicit routing decisions)
|
|
559
|
+
* - Infer linear edges from step execution order (consecutive steps in linear flow)
|
|
560
|
+
* - Track current step from step-started/completed/failed events
|
|
561
|
+
*
|
|
562
|
+
* Edge ID Format (must match useWorkflowStepsLayout):
|
|
563
|
+
* - Linear: edge-{source}-{target}
|
|
564
|
+
* - Conditional: edge-{source}-{target}
|
|
565
|
+
* - Default: edge-{source}-{target}-default
|
|
566
|
+
*
|
|
567
|
+
* @param executionLogs - Array of execution log messages from SSE
|
|
568
|
+
* @param workflowDefinition - Workflow definition
|
|
569
|
+
* @returns Execution path state or undefined if no logs available
|
|
570
|
+
*
|
|
571
|
+
* @see unified-workflow-graph-design-plan.mdx for algorithm details
|
|
572
|
+
*/
|
|
573
|
+
declare function useExecutionPath(executionLogs: ExecutionLogMessage[] | undefined, workflowDefinition: SerializedWorkflowDefinition | undefined): ExecutionPathState | undefined;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Parse execution logs to extract step states for timeline visualization
|
|
577
|
+
*/
|
|
578
|
+
declare function useTimelineData(execution: APIExecutionDetail | undefined, resourceDefinition: SerializedWorkflowDefinition): WorkflowNodeVisualizerData | undefined;
|
|
579
|
+
|
|
580
|
+
declare function useAgentIterationData(execution: APIExecutionDetail | undefined, resourceDefinition: SerializedAgentDefinition): AgentIterationData | null;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Timeline Bar Props
|
|
584
|
+
* Represents a single horizontal bar in the timeline
|
|
585
|
+
*/
|
|
586
|
+
interface TimelineBarProps {
|
|
587
|
+
startTime: number;
|
|
588
|
+
endTime: number;
|
|
589
|
+
executionStart: number;
|
|
590
|
+
executionEnd: number;
|
|
591
|
+
status: ExecutionStatus;
|
|
592
|
+
label?: string;
|
|
593
|
+
onClick?: () => void;
|
|
594
|
+
nodeId?: string | number;
|
|
595
|
+
isSelected?: boolean;
|
|
596
|
+
hasSelection?: boolean;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Timeline Row Props
|
|
600
|
+
* Represents a row with label + one or more bars
|
|
601
|
+
*/
|
|
602
|
+
interface TimelineRowProps {
|
|
603
|
+
label: string;
|
|
604
|
+
bars: Array<{
|
|
605
|
+
startTime: number;
|
|
606
|
+
endTime: number;
|
|
607
|
+
status: ExecutionStatus;
|
|
608
|
+
label?: string;
|
|
609
|
+
onClick?: () => void;
|
|
610
|
+
nodeId?: string | number;
|
|
611
|
+
}>;
|
|
612
|
+
executionStart: number;
|
|
613
|
+
executionEnd: number;
|
|
614
|
+
indent?: number;
|
|
615
|
+
selectedNodeId?: string | number | null;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Timeline Container Props
|
|
619
|
+
* Outer container for the timeline
|
|
620
|
+
*/
|
|
621
|
+
interface TimelineContainerProps {
|
|
622
|
+
executionStart: number;
|
|
623
|
+
executionEnd: number;
|
|
624
|
+
children: React.ReactNode;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Graph visualization mode
|
|
628
|
+
*
|
|
629
|
+
* - 'definition': Static view for workflow definition display (no dimming, all nodes visible)
|
|
630
|
+
* - 'execution': Dynamic view with execution state overlay (dimming based on execution path)
|
|
631
|
+
*/
|
|
632
|
+
type GraphMode = 'definition' | 'execution';
|
|
633
|
+
/**
|
|
634
|
+
* Unified node data combining workflow structure and execution state
|
|
635
|
+
*/
|
|
636
|
+
interface UnifiedWorkflowNodeData {
|
|
637
|
+
id: string;
|
|
638
|
+
name: string;
|
|
639
|
+
description: string;
|
|
640
|
+
isEntryPoint: boolean;
|
|
641
|
+
isEndNode: boolean;
|
|
642
|
+
isConditional: boolean;
|
|
643
|
+
routeCount?: number;
|
|
644
|
+
executionStatus?: 'pending' | 'running' | 'completed' | 'failed';
|
|
645
|
+
duration?: number;
|
|
646
|
+
input?: unknown;
|
|
647
|
+
output?: unknown;
|
|
648
|
+
error?: unknown;
|
|
649
|
+
logs?: WorkflowLogMessage[];
|
|
650
|
+
isExecuted: boolean;
|
|
651
|
+
isDimmed: boolean;
|
|
652
|
+
isSelected?: boolean;
|
|
653
|
+
[key: string]: unknown;
|
|
654
|
+
}
|
|
655
|
+
/**
|
|
656
|
+
* Unified edge data combining workflow structure and execution state
|
|
657
|
+
*/
|
|
658
|
+
interface UnifiedWorkflowEdgeData {
|
|
659
|
+
edgeType: 'linear' | 'conditional' | 'default';
|
|
660
|
+
label?: string;
|
|
661
|
+
wasTaken: boolean;
|
|
662
|
+
sourceStatus?: ExecutionStatus;
|
|
663
|
+
targetStatus?: ExecutionStatus;
|
|
664
|
+
isDimmed: boolean;
|
|
665
|
+
isAnimated: boolean;
|
|
666
|
+
[key: string]: unknown;
|
|
667
|
+
}
|
|
668
|
+
type WorkflowEdgeType = 'linear' | 'conditional' | 'default';
|
|
669
|
+
/**
|
|
670
|
+
* Data shape for workflow step nodes (static structure)
|
|
671
|
+
*/
|
|
672
|
+
interface WorkflowStepNodeData {
|
|
673
|
+
id: string;
|
|
674
|
+
name: string;
|
|
675
|
+
description: string;
|
|
676
|
+
isEntryPoint: boolean;
|
|
677
|
+
isEndNode: boolean;
|
|
678
|
+
isConditional: boolean;
|
|
679
|
+
routeCount?: number;
|
|
680
|
+
[key: string]: unknown;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Data shape for workflow step edges (static structure)
|
|
684
|
+
*/
|
|
685
|
+
interface WorkflowStepEdgeData {
|
|
686
|
+
edgeType: WorkflowEdgeType;
|
|
687
|
+
label?: string;
|
|
688
|
+
[key: string]: unknown;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Agent iteration status type (alias for shared ExecutionStatus)
|
|
692
|
+
*/
|
|
693
|
+
type AgentStatus = ExecutionStatus;
|
|
694
|
+
interface AgentIterationNodeData {
|
|
695
|
+
nodeType: 'initialization' | 'iteration' | 'completion';
|
|
696
|
+
label?: string;
|
|
697
|
+
iterationNumber?: number;
|
|
698
|
+
status: AgentStatus;
|
|
699
|
+
reasoningCount?: number;
|
|
700
|
+
actionCount?: number;
|
|
701
|
+
duration?: number;
|
|
702
|
+
isLive: boolean;
|
|
703
|
+
}
|
|
704
|
+
interface AgentIterationEdgeData {
|
|
705
|
+
sourceStatus: AgentStatus;
|
|
706
|
+
targetStatus: AgentStatus;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* useWorkflowStepsLayout - Hook to convert workflow definition to ReactFlow nodes/edges
|
|
711
|
+
*
|
|
712
|
+
* Uses Dagre for automatic graph layout:
|
|
713
|
+
* - Left-to-right flow (LR)
|
|
714
|
+
* - Minimizes edge crossings
|
|
715
|
+
* - Keeps connected nodes closer together
|
|
716
|
+
*/
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Serialized next config from API
|
|
720
|
+
*/
|
|
721
|
+
interface SerializedNextConfig {
|
|
722
|
+
type: 'linear' | 'conditional';
|
|
723
|
+
target?: string;
|
|
724
|
+
routes?: Array<{
|
|
725
|
+
target: string;
|
|
726
|
+
}>;
|
|
727
|
+
default?: string;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Serialized workflow step from API
|
|
731
|
+
*/
|
|
732
|
+
interface SerializedWorkflowStep {
|
|
733
|
+
id: string;
|
|
734
|
+
name: string;
|
|
735
|
+
description: string;
|
|
736
|
+
next: SerializedNextConfig | null;
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Serialized workflow definition subset needed for layout
|
|
740
|
+
*/
|
|
741
|
+
interface WorkflowStepsLayoutInput {
|
|
742
|
+
entryPoint: string;
|
|
743
|
+
steps: SerializedWorkflowStep[];
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Hook to convert workflow definition to React Flow nodes and edges with Dagre layout
|
|
747
|
+
*
|
|
748
|
+
* @returns nodes, edges, and calculated graphHeight for dynamic container sizing
|
|
749
|
+
*/
|
|
750
|
+
declare function useWorkflowStepsLayout(workflow: WorkflowStepsLayoutInput | undefined): {
|
|
751
|
+
nodes: Node<WorkflowStepNodeData>[];
|
|
752
|
+
edges: Edge<WorkflowStepEdgeData>[];
|
|
753
|
+
graphHeight: number;
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* useUnifiedWorkflowLayout - Merge Dagre layout with execution state
|
|
758
|
+
*
|
|
759
|
+
* Combines static workflow structure (positioned nodes/edges from Dagre) with
|
|
760
|
+
* real-time execution state (status, dimming, taken paths) to produce unified
|
|
761
|
+
* visualization data for the UnifiedWorkflowGraph component.
|
|
762
|
+
*/
|
|
763
|
+
|
|
764
|
+
/**
|
|
765
|
+
* Hook to merge workflow structure layout with execution state
|
|
766
|
+
*/
|
|
767
|
+
declare function useUnifiedWorkflowLayout(workflow: WorkflowStepsLayoutInput | undefined, executionPath: ExecutionPathState | undefined, selectedStepId?: string | null, mode?: GraphMode): {
|
|
768
|
+
nodes: Node<UnifiedWorkflowNodeData>[];
|
|
769
|
+
edges: Edge<UnifiedWorkflowEdgeData>[];
|
|
770
|
+
graphHeight: number;
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
/**
|
|
774
|
+
* useReactFlowAgent Hook
|
|
775
|
+
*
|
|
776
|
+
* Converts agent iteration data into ReactFlow nodes and edges for visualization.
|
|
777
|
+
*/
|
|
778
|
+
|
|
779
|
+
declare function useReactFlowAgent(iterationData: AgentIterationData | null, _resourceDefinition: SerializedAgentDefinition | undefined, selectedIterationId: number | 'initialization' | 'completion' | null, liveExecutions: Set<string>, selectedExecutionId?: string): {
|
|
780
|
+
nodes: Node[];
|
|
781
|
+
edges: Edge[];
|
|
782
|
+
};
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Unified status color system for execution visualizers
|
|
786
|
+
* Shared between workflow and agent implementations
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
interface StatusColorScheme {
|
|
790
|
+
color: string;
|
|
791
|
+
badge: string;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Status color mappings using CSS variables for theme-aware colors
|
|
795
|
+
* Simplified: one color for all visual elements (icon, border, selection)
|
|
796
|
+
*/
|
|
797
|
+
declare const STATUS_COLORS: Record<ExecutionStatus, StatusColorScheme>;
|
|
798
|
+
/**
|
|
799
|
+
* Get status colors for a given execution status
|
|
800
|
+
*/
|
|
801
|
+
declare function getStatusColors(status: ExecutionStatus): StatusColorScheme;
|
|
802
|
+
|
|
803
|
+
interface ExecutionStatusBadgeProps {
|
|
804
|
+
/** The execution status */
|
|
805
|
+
status: ExecutionStatus;
|
|
806
|
+
/** Badge size - defaults to 'sm' */
|
|
807
|
+
size?: BadgeProps['size'];
|
|
808
|
+
/** Badge variant - defaults to 'light' */
|
|
809
|
+
variant?: 'light' | 'filled' | 'outline' | 'dot';
|
|
810
|
+
/** Whether to show a loader for running status - defaults to true */
|
|
811
|
+
showLoader?: boolean;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* ExecutionStatusBadge - Reusable badge for execution statuses
|
|
815
|
+
*
|
|
816
|
+
* Consolidates status badge rendering across:
|
|
817
|
+
* - ExecutionSummaryRow.tsx
|
|
818
|
+
* - SessionExecutionLogs.tsx
|
|
819
|
+
* - BaseExecutionLogsHeader.tsx
|
|
820
|
+
* - UnifiedWorkflowNode.tsx
|
|
821
|
+
* - Dashboard.tsx task list
|
|
822
|
+
*
|
|
823
|
+
* Uses the centralized STATUS_COLORS from statusColors.ts
|
|
824
|
+
*
|
|
825
|
+
* @example
|
|
826
|
+
* ```tsx
|
|
827
|
+
* <ExecutionStatusBadge status="running" />
|
|
828
|
+
* <ExecutionStatusBadge status="completed" variant="dot" />
|
|
829
|
+
* ```
|
|
830
|
+
*/
|
|
831
|
+
declare function ExecutionStatusBadge({ status, size, variant, showLoader }: ExecutionStatusBadgeProps): react_jsx_runtime.JSX.Element;
|
|
832
|
+
|
|
833
|
+
interface ExecutionStatsProps {
|
|
834
|
+
totalExecutions: number;
|
|
835
|
+
successCount: number;
|
|
836
|
+
failureCount: number;
|
|
837
|
+
warningCount?: number;
|
|
838
|
+
successRate: number;
|
|
839
|
+
align?: 'flex-start' | 'flex-end' | 'center';
|
|
840
|
+
/** Compact mode renders metric chips in a horizontal row */
|
|
841
|
+
compact?: boolean;
|
|
842
|
+
}
|
|
843
|
+
/**
|
|
844
|
+
* Execution statistics with colored text — vertical stack or compact metric chips
|
|
845
|
+
*/
|
|
846
|
+
declare function ExecutionStats({ totalExecutions, successCount, failureCount, warningCount, successRate, align, compact }: ExecutionStatsProps): react_jsx_runtime.JSX.Element | null;
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* TimelineContainer Component
|
|
850
|
+
*
|
|
851
|
+
* Outer container for the timeline visualization.
|
|
852
|
+
* Wraps timeline rows and displays time axis at the bottom.
|
|
853
|
+
*/
|
|
854
|
+
declare function TimelineContainer({ executionStart, executionEnd, children }: TimelineContainerProps): react_jsx_runtime.JSX.Element;
|
|
855
|
+
|
|
856
|
+
interface TimelineAxisProps {
|
|
857
|
+
totalDuration: number;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* TimelineAxis Component
|
|
861
|
+
*
|
|
862
|
+
* Renders time markers at the bottom of the timeline.
|
|
863
|
+
* Shows 0ms on the left, total duration on the right, and 3 intermediate markers.
|
|
864
|
+
*/
|
|
865
|
+
declare function TimelineAxis({ totalDuration }: TimelineAxisProps): react_jsx_runtime.JSX.Element;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* TimelineBar Component
|
|
869
|
+
*
|
|
870
|
+
* Renders a single horizontal bar in the timeline visualization.
|
|
871
|
+
* Position and width are calculated as percentages based on absolute timestamps.
|
|
872
|
+
*/
|
|
873
|
+
declare function TimelineBar({ startTime, endTime, executionStart, executionEnd, status, label, onClick, isSelected, hasSelection }: TimelineBarProps): react_jsx_runtime.JSX.Element;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* TimelineRow Component
|
|
877
|
+
*
|
|
878
|
+
* Renders a row in the timeline with a label and one or more timeline bars.
|
|
879
|
+
* Supports indentation for nested rows (e.g., sub-activities within iterations).
|
|
880
|
+
*/
|
|
881
|
+
declare function TimelineRow({ label, bars, executionStart, executionEnd, indent, selectedNodeId }: TimelineRowProps): react_jsx_runtime.JSX.Element;
|
|
882
|
+
|
|
883
|
+
interface IVisualizerContainerProps {
|
|
884
|
+
children: React.ReactNode;
|
|
885
|
+
/** Click handler for container (for deselecting nodes). Optional for definition mode. */
|
|
886
|
+
handleContainerClick?: (event: React.MouseEvent) => void;
|
|
887
|
+
/** Optional dynamic height calculated from graph layout. Falls back to default if not provided. */
|
|
888
|
+
height?: number;
|
|
889
|
+
}
|
|
890
|
+
declare const VisualizerContainer: ({ children, handleContainerClick, height }: IVisualizerContainerProps) => react_jsx_runtime.JSX.Element;
|
|
891
|
+
|
|
892
|
+
declare const EmptyVisualizer: ({ message }: {
|
|
893
|
+
message?: string;
|
|
894
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
895
|
+
|
|
896
|
+
interface UnifiedWorkflowGraphProps {
|
|
897
|
+
/**
|
|
898
|
+
* Workflow definition (entry point, steps, routes)
|
|
899
|
+
* Accepts either SerializedWorkflowDefinition (execution mode) or WorkflowStepsLayoutInput (definition mode)
|
|
900
|
+
*/
|
|
901
|
+
resourceDefinition: SerializedWorkflowDefinition | WorkflowStepsLayoutInput;
|
|
902
|
+
/** Execution logs from SSE or useExecution hook (only used in execution mode) */
|
|
903
|
+
executionLogs?: ExecutionLogMessage[];
|
|
904
|
+
/** Currently selected step ID for highlighting (only used in execution mode) */
|
|
905
|
+
selectedStepId?: string | null;
|
|
906
|
+
/** Callback when step selection changes (only used in execution mode) */
|
|
907
|
+
onStepSelect?: (stepId: string | null) => void;
|
|
908
|
+
/** External trigger for fit view (increment to trigger, used after collapse animations) */
|
|
909
|
+
fitViewTrigger?: number;
|
|
910
|
+
}
|
|
911
|
+
declare function UnifiedWorkflowGraph({ resourceDefinition, executionLogs, selectedStepId, onStepSelect, fitViewTrigger: externalFitViewTrigger }: UnifiedWorkflowGraphProps): react_jsx_runtime.JSX.Element;
|
|
912
|
+
|
|
913
|
+
type UnifiedWorkflowNodeProps = NodeProps<Node<UnifiedWorkflowNodeData>>;
|
|
914
|
+
declare const UnifiedWorkflowNode: react.NamedExoticComponent<UnifiedWorkflowNodeProps>;
|
|
915
|
+
|
|
916
|
+
type UnifiedWorkflowEdgeProps = EdgeProps<Edge<UnifiedWorkflowEdgeData, string>>;
|
|
917
|
+
declare const UnifiedWorkflowEdge: react.NamedExoticComponent<UnifiedWorkflowEdgeProps>;
|
|
918
|
+
|
|
919
|
+
interface WorkflowExecutionTimelineProps {
|
|
920
|
+
timelineData: WorkflowNodeVisualizerData;
|
|
921
|
+
selectedStepId?: string | null;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* WorkflowExecutionTimeline Component
|
|
925
|
+
*
|
|
926
|
+
* Renders a Temporal-style timeline visualization for workflow executions.
|
|
927
|
+
* Shows all workflow steps with their timing and status.
|
|
928
|
+
*/
|
|
929
|
+
declare function WorkflowExecutionTimeline({ timelineData, selectedStepId }: WorkflowExecutionTimelineProps): react_jsx_runtime.JSX.Element;
|
|
930
|
+
|
|
931
|
+
interface AgentExecutionVisualizerProps {
|
|
932
|
+
resourceDefinition: SerializedAgentDefinition;
|
|
933
|
+
iterationData: AgentIterationData | null;
|
|
934
|
+
selectedExecutionId?: string;
|
|
935
|
+
liveExecutions: Set<string>;
|
|
936
|
+
selectedIterationId: number | 'initialization' | 'completion' | null;
|
|
937
|
+
onIterationSelect: (iterationId: number | 'initialization' | 'completion' | null) => void;
|
|
938
|
+
}
|
|
939
|
+
declare function AgentExecutionVisualizer({ resourceDefinition, iterationData, selectedExecutionId, liveExecutions, selectedIterationId, onIterationSelect }: AgentExecutionVisualizerProps): react_jsx_runtime.JSX.Element;
|
|
940
|
+
|
|
941
|
+
interface AgentExecutionTimelineProps {
|
|
942
|
+
iterationData: AgentIterationData;
|
|
943
|
+
selectedIterationId?: number | 'initialization' | 'completion' | null;
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
* AgentExecutionTimeline Component
|
|
947
|
+
*
|
|
948
|
+
* Renders a Temporal-style timeline visualization for agent executions.
|
|
949
|
+
* Shows initialization, iterations (with sub-activities), and completion phases.
|
|
950
|
+
*/
|
|
951
|
+
declare function AgentExecutionTimeline({ iterationData, selectedIterationId }: AgentExecutionTimelineProps): react_jsx_runtime.JSX.Element;
|
|
952
|
+
|
|
953
|
+
declare const AgentIterationNode: react.NamedExoticComponent<NodeProps>;
|
|
954
|
+
|
|
955
|
+
declare const AgentIterationEdge: react.NamedExoticComponent<EdgeProps>;
|
|
956
|
+
|
|
957
|
+
/**
|
|
958
|
+
* Timeline visualization constants
|
|
959
|
+
* Layout and styling constants for timeline components
|
|
960
|
+
*/
|
|
961
|
+
declare const TIMELINE_CONSTANTS: {
|
|
962
|
+
readonly BAR_HEIGHT: 24;
|
|
963
|
+
readonly ROW_GAP: 8;
|
|
964
|
+
readonly MIN_BAR_WIDTH_PERCENT: 0.5;
|
|
965
|
+
readonly LABEL_WIDTH: 200;
|
|
966
|
+
readonly INDENT_SIZE: 16;
|
|
967
|
+
readonly CONTAINER_PADDING: 16;
|
|
968
|
+
readonly CONTAINER_BORDER_RADIUS: 8;
|
|
969
|
+
};
|
|
970
|
+
/**
|
|
971
|
+
* Shared visualization constants used by both workflow and agent visualizers
|
|
972
|
+
*/
|
|
973
|
+
declare const SHARED_VIZ_CONSTANTS: {
|
|
974
|
+
readonly NODE_WIDTH: 160;
|
|
975
|
+
readonly NODE_SPACING: 220;
|
|
976
|
+
readonly HANDLE_SIZE: 8;
|
|
977
|
+
readonly MIN_ZOOM: 0.5;
|
|
978
|
+
readonly MAX_ZOOM: 2;
|
|
979
|
+
};
|
|
980
|
+
/**
|
|
981
|
+
* Container height constant (used by VisualizerContainer and EmptyVisualizer)
|
|
982
|
+
*/
|
|
983
|
+
declare const CONTAINER_CONSTANTS: {
|
|
984
|
+
CONTAINER_HEIGHT: number;
|
|
985
|
+
};
|
|
986
|
+
/**
|
|
987
|
+
* Agent-specific dimension and layout constants
|
|
988
|
+
*/
|
|
989
|
+
declare const AGENT_CONSTANTS: {
|
|
990
|
+
readonly NODE_HEIGHT: 140;
|
|
991
|
+
readonly CONTAINER_HEIGHT: 430;
|
|
992
|
+
readonly FIT_VIEW_PADDING: 0.2;
|
|
993
|
+
readonly ICON_SIZE: 16;
|
|
994
|
+
readonly STATUS_ICON_SIZE: 16;
|
|
995
|
+
readonly CIRCLE_SIZE: 40;
|
|
996
|
+
readonly PULSE_DURATION: "2s";
|
|
997
|
+
readonly TRANSITION_DURATION: "0.2s";
|
|
998
|
+
readonly NODE_WIDTH: 160;
|
|
999
|
+
readonly NODE_SPACING: 220;
|
|
1000
|
+
readonly HANDLE_SIZE: 8;
|
|
1001
|
+
readonly MIN_ZOOM: 0.5;
|
|
1002
|
+
readonly MAX_ZOOM: 2;
|
|
1003
|
+
};
|
|
1004
|
+
declare const WORKFLOW_CONSTANTS: {
|
|
1005
|
+
readonly FIT_VIEW_PADDING: 0.4;
|
|
1006
|
+
readonly ICON_SIZE: 20;
|
|
1007
|
+
readonly CIRCLE_SIZE: 40;
|
|
1008
|
+
readonly SPIN_DURATION: "1s";
|
|
1009
|
+
readonly NODE_WIDTH: 160;
|
|
1010
|
+
readonly NODE_SPACING: 220;
|
|
1011
|
+
readonly HANDLE_SIZE: 8;
|
|
1012
|
+
readonly MIN_ZOOM: 0.5;
|
|
1013
|
+
readonly MAX_ZOOM: 2;
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
/**
|
|
1017
|
+
* Format duration in milliseconds for display
|
|
1018
|
+
*
|
|
1019
|
+
* @param ms - Duration in milliseconds
|
|
1020
|
+
* @returns Formatted duration string (e.g., "150ms", "2.5s")
|
|
1021
|
+
*/
|
|
1022
|
+
declare function formatDuration(ms?: number): string;
|
|
1023
|
+
|
|
1024
|
+
interface StatusIconColors {
|
|
1025
|
+
icon: string;
|
|
1026
|
+
}
|
|
1027
|
+
interface GetStatusIconOptions {
|
|
1028
|
+
status: ExecutionStatus;
|
|
1029
|
+
colors: StatusIconColors;
|
|
1030
|
+
iconSize: number;
|
|
1031
|
+
spinDuration?: string;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* Get status icon component for execution nodes
|
|
1035
|
+
*
|
|
1036
|
+
* @param options - Configuration for icon rendering
|
|
1037
|
+
* @returns React component for the status icon
|
|
1038
|
+
*/
|
|
1039
|
+
declare function getStatusIcon({ status, colors, iconSize, spinDuration }: GetStatusIconOptions): react_jsx_runtime.JSX.Element;
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Get the color for a resource status badge
|
|
1043
|
+
* @param resourceStatus - The resource status ('dev' | 'prod')
|
|
1044
|
+
* @returns CSS variable color string
|
|
1045
|
+
*/
|
|
1046
|
+
declare function getResourceStatusColor(resourceStatus: ResourceStatus): string;
|
|
1047
|
+
|
|
1048
|
+
interface EdgeColorOptions {
|
|
1049
|
+
selected?: boolean;
|
|
1050
|
+
sourceStatus: ExecutionStatus;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Get edge color based on source node status
|
|
1054
|
+
* Simplified: uses unified status color system
|
|
1055
|
+
*/
|
|
1056
|
+
declare function getEdgeColor({ selected, sourceStatus }: EdgeColorOptions): string;
|
|
1057
|
+
interface EdgeOpacityOptions {
|
|
1058
|
+
sourceStatus: ExecutionStatus;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Get edge opacity based on source node status
|
|
1062
|
+
*/
|
|
1063
|
+
declare function getEdgeOpacity({ sourceStatus }: EdgeOpacityOptions): number;
|
|
1064
|
+
/**
|
|
1065
|
+
* Check if edge should be animated (when source or target is running)
|
|
1066
|
+
*/
|
|
1067
|
+
declare function shouldAnimateEdge(sourceStatus: ExecutionStatus, targetStatus: ExecutionStatus): boolean;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Calculate timeline bar position and width as percentages
|
|
1071
|
+
*
|
|
1072
|
+
* Handles edge cases:
|
|
1073
|
+
* - Zero duration executions (instant completion)
|
|
1074
|
+
* - Activities that start before execution (data inconsistency)
|
|
1075
|
+
* - Activities that extend beyond execution end (data inconsistency)
|
|
1076
|
+
* - Zero or near-zero duration activities (enforces minimum visible width)
|
|
1077
|
+
*
|
|
1078
|
+
* @param startTime - Activity start timestamp (absolute)
|
|
1079
|
+
* @param endTime - Activity end timestamp (absolute)
|
|
1080
|
+
* @param executionStart - Execution start timestamp (absolute)
|
|
1081
|
+
* @param executionEnd - Execution end timestamp (absolute)
|
|
1082
|
+
* @returns Object with left and width percentages for bar positioning
|
|
1083
|
+
*/
|
|
1084
|
+
declare function calculateBarPosition(startTime: number, endTime: number, executionStart: number, executionEnd: number): {
|
|
1085
|
+
left: number;
|
|
1086
|
+
width: number;
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
export { AGENT_CONSTANTS, AgentExecutionTimeline, AgentExecutionVisualizer, AgentIterationEdge, AgentIterationNode, CONTAINER_CONSTANTS, EmptyVisualizer, ExecutionStats, ExecutionStatusBadge, SHARED_VIZ_CONSTANTS, STATUS_COLORS, TIMELINE_CONSTANTS, TimelineAxis, TimelineBar, TimelineContainer, TimelineRow, UnifiedWorkflowEdge, UnifiedWorkflowGraph, UnifiedWorkflowNode, VisualizerContainer, WORKFLOW_CONSTANTS, WorkflowExecutionTimeline, calculateBarPosition, formatDuration, getEdgeColor, getEdgeOpacity, getResourceStatusColor, getStatusColors, getStatusIcon, shouldAnimateEdge, useAgentIterationData, useExecutionPath, useMergedExecution, useReactFlowAgent, useTimelineData, useUnifiedWorkflowLayout, useWorkflowStepsLayout };
|
|
1090
|
+
export type { AgentIterationEdgeData, AgentIterationNodeData, AgentStatus, EdgeColorOptions, EdgeOpacityOptions, ExecutionPathState, ExecutionStatus, GraphMode, StatusColorScheme, StatusIconColors, StepExecutionData, TimelineBarProps, TimelineContainerProps, TimelineRowProps, UnifiedWorkflowEdgeData, UnifiedWorkflowNodeData, WorkflowEdgeType, WorkflowStepEdgeData, WorkflowStepNodeData, WorkflowStepsLayoutInput };
|