@marktoflow/gui 2.0.0-alpha.12 → 2.0.0-alpha.13

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 (121) hide show
  1. package/package.json +1 -3
  2. package/.marktoflow/state/workflow-state.db +0 -0
  3. package/.marktoflow/state/workflow-state.db-shm +0 -0
  4. package/.marktoflow/state/workflow-state.db-wal +0 -0
  5. package/.turbo/turbo-build.log +0 -42
  6. package/.turbo/turbo-test.log +0 -38
  7. package/marktoflow-gui-2.0.0-alpha.12.tgz +0 -0
  8. package/playwright.config.ts +0 -27
  9. package/postcss.config.js +0 -6
  10. package/src/client/App.tsx +0 -520
  11. package/src/client/components/Canvas/Canvas.tsx +0 -425
  12. package/src/client/components/Canvas/ExecutionOverlay.tsx +0 -935
  13. package/src/client/components/Canvas/ForEachNode.tsx +0 -152
  14. package/src/client/components/Canvas/IfElseNode.tsx +0 -141
  15. package/src/client/components/Canvas/NodeContextMenu.tsx +0 -192
  16. package/src/client/components/Canvas/OutputNode.tsx +0 -111
  17. package/src/client/components/Canvas/ParallelNode.tsx +0 -157
  18. package/src/client/components/Canvas/StepNode.tsx +0 -106
  19. package/src/client/components/Canvas/SubWorkflowNode.tsx +0 -141
  20. package/src/client/components/Canvas/SwitchNode.tsx +0 -185
  21. package/src/client/components/Canvas/Toolbar.tsx +0 -227
  22. package/src/client/components/Canvas/TransformNode.tsx +0 -194
  23. package/src/client/components/Canvas/TriggerNode.tsx +0 -128
  24. package/src/client/components/Canvas/TryCatchNode.tsx +0 -164
  25. package/src/client/components/Canvas/WhileNode.tsx +0 -161
  26. package/src/client/components/Canvas/index.ts +0 -24
  27. package/src/client/components/Debug/VariableInspector.tsx +0 -148
  28. package/src/client/components/Editor/InputsEditor.tsx +0 -458
  29. package/src/client/components/Editor/NewStepWizard.tsx +0 -344
  30. package/src/client/components/Editor/StepEditor.tsx +0 -532
  31. package/src/client/components/Editor/YamlEditor.tsx +0 -160
  32. package/src/client/components/Panels/PropertiesPanel.tsx +0 -589
  33. package/src/client/components/Prompt/ChangePreview.tsx +0 -281
  34. package/src/client/components/Prompt/PromptHistoryPanel.tsx +0 -209
  35. package/src/client/components/Prompt/PromptInput.tsx +0 -110
  36. package/src/client/components/Settings/ProviderSwitcher.tsx +0 -228
  37. package/src/client/components/Sidebar/ImportDialog.tsx +0 -257
  38. package/src/client/components/Sidebar/Sidebar.tsx +0 -362
  39. package/src/client/components/common/Breadcrumb.tsx +0 -40
  40. package/src/client/components/common/Button.tsx +0 -68
  41. package/src/client/components/common/ContextMenu.tsx +0 -202
  42. package/src/client/components/common/KeyboardShortcuts.tsx +0 -149
  43. package/src/client/components/common/Modal.tsx +0 -93
  44. package/src/client/components/common/Tabs.tsx +0 -57
  45. package/src/client/components/common/ThemeToggle.tsx +0 -63
  46. package/src/client/components/index.ts +0 -32
  47. package/src/client/hooks/index.ts +0 -4
  48. package/src/client/hooks/useAIPrompt.ts +0 -108
  49. package/src/client/hooks/useCanvas.ts +0 -247
  50. package/src/client/hooks/useWebSocket.ts +0 -164
  51. package/src/client/hooks/useWorkflow.ts +0 -138
  52. package/src/client/main.tsx +0 -10
  53. package/src/client/stores/agentStore.ts +0 -109
  54. package/src/client/stores/canvasStore.ts +0 -348
  55. package/src/client/stores/editorStore.ts +0 -133
  56. package/src/client/stores/executionStore.ts +0 -502
  57. package/src/client/stores/index.ts +0 -4
  58. package/src/client/stores/layoutStore.ts +0 -103
  59. package/src/client/stores/navigationStore.ts +0 -49
  60. package/src/client/stores/promptStore.ts +0 -113
  61. package/src/client/stores/themeStore.ts +0 -75
  62. package/src/client/stores/workflowStore.ts +0 -185
  63. package/src/client/styles/globals.css +0 -452
  64. package/src/client/utils/cn.ts +0 -9
  65. package/src/client/utils/index.ts +0 -4
  66. package/src/client/utils/platform.ts +0 -46
  67. package/src/client/utils/serviceIcons.tsx +0 -97
  68. package/src/client/utils/stepValidation.ts +0 -155
  69. package/src/client/utils/workflowToGraph.ts +0 -523
  70. package/src/server/index.ts +0 -137
  71. package/src/server/routes/ai.ts +0 -91
  72. package/src/server/routes/execute.ts +0 -71
  73. package/src/server/routes/executions.ts +0 -136
  74. package/src/server/routes/tools.ts +0 -970
  75. package/src/server/routes/workflows.ts +0 -147
  76. package/src/server/services/AIService.ts +0 -105
  77. package/src/server/services/FileWatcher.ts +0 -69
  78. package/src/server/services/WorkflowService.ts +0 -601
  79. package/src/server/services/agents/claude-code-provider.ts +0 -320
  80. package/src/server/services/agents/claude-provider.ts +0 -248
  81. package/src/server/services/agents/codex-provider.ts +0 -398
  82. package/src/server/services/agents/copilot-provider.ts +0 -311
  83. package/src/server/services/agents/demo-provider.ts +0 -184
  84. package/src/server/services/agents/index.ts +0 -31
  85. package/src/server/services/agents/ollama-provider.ts +0 -267
  86. package/src/server/services/agents/prompts.ts +0 -509
  87. package/src/server/services/agents/registry.ts +0 -310
  88. package/src/server/services/agents/types.ts +0 -146
  89. package/src/server/websocket/index.ts +0 -117
  90. package/src/shared/constants.ts +0 -180
  91. package/src/shared/types.ts +0 -179
  92. package/tailwind.config.ts +0 -73
  93. package/tests/e2e/app.spec.ts +0 -90
  94. package/tests/e2e/canvas.spec.ts +0 -128
  95. package/tests/e2e/workflow.spec.ts +0 -185
  96. package/tests/integration/api.test.ts +0 -452
  97. package/tests/integration/testApp.ts +0 -31
  98. package/tests/setup.ts +0 -72
  99. package/tests/unit/ForEachNode.test.tsx +0 -308
  100. package/tests/unit/IfElseNode.test.tsx +0 -235
  101. package/tests/unit/ParallelNode.test.tsx +0 -344
  102. package/tests/unit/SwitchNode.test.tsx +0 -327
  103. package/tests/unit/TransformNode.test.tsx +0 -386
  104. package/tests/unit/TryCatchNode.test.tsx +0 -243
  105. package/tests/unit/WhileNode.test.tsx +0 -230
  106. package/tests/unit/agentStore.test.ts +0 -218
  107. package/tests/unit/canvasStore.test.ts +0 -502
  108. package/tests/unit/codexProvider.test.ts +0 -399
  109. package/tests/unit/components.test.tsx +0 -151
  110. package/tests/unit/executionStore.test.ts +0 -567
  111. package/tests/unit/layoutStore.test.ts +0 -194
  112. package/tests/unit/navigationStore.test.ts +0 -152
  113. package/tests/unit/platform.test.ts +0 -118
  114. package/tests/unit/serviceIcons.test.ts +0 -197
  115. package/tests/unit/stepValidation.test.ts +0 -226
  116. package/tests/unit/themeStore.test.ts +0 -141
  117. package/tests/unit/workflowToGraph.test.ts +0 -311
  118. package/tsconfig.json +0 -29
  119. package/tsconfig.server.json +0 -28
  120. package/vite.config.ts +0 -31
  121. package/vitest.config.ts +0 -26
@@ -1,589 +0,0 @@
1
- import { useState, useMemo } from 'react';
2
- import {
3
- Settings,
4
- Variable,
5
- History,
6
- X,
7
- ChevronRight,
8
- ChevronLeft,
9
- CheckCircle,
10
- XCircle,
11
- Clock,
12
- Loader2,
13
- Trash2,
14
- Play,
15
- } from 'lucide-react';
16
- import { useCanvasStore } from '../../stores/canvasStore';
17
- import { useWorkflowStore } from '../../stores/workflowStore';
18
- import { useLayoutStore } from '../../stores/layoutStore';
19
- import {
20
- useExecutionStore,
21
- formatDuration,
22
- formatRelativeTime,
23
- type ExecutionRun,
24
- } from '../../stores/executionStore';
25
-
26
- type TabId = 'properties' | 'variables' | 'history';
27
-
28
- export function PropertiesPanel() {
29
- const [activeTab, setActiveTab] = useState<TabId>('properties');
30
- const nodes = useCanvasStore((s) => s.nodes);
31
- const selectedNodes = useMemo(() => nodes.filter((n) => n.selected), [nodes]);
32
- const workflow = useWorkflowStore((s) => s.currentWorkflow);
33
- const { propertiesPanelOpen, setPropertiesPanelOpen, breakpoint } = useLayoutStore();
34
-
35
- // On mobile, show as an overlay when open
36
- if (breakpoint === 'mobile') {
37
- if (!propertiesPanelOpen) return null;
38
-
39
- return (
40
- <>
41
- {/* Backdrop */}
42
- <div
43
- className="fixed inset-0 bg-black/50 z-40"
44
- onClick={() => setPropertiesPanelOpen(false)}
45
- />
46
- {/* Panel */}
47
- <div className="fixed inset-y-0 right-0 w-80 max-w-[85vw] bg-panel-bg border-l border-node-border flex flex-col z-50 animate-slide-in-right">
48
- <PropertiesPanelContent
49
- activeTab={activeTab}
50
- setActiveTab={setActiveTab}
51
- selectedNodes={selectedNodes}
52
- workflow={workflow}
53
- onClose={() => setPropertiesPanelOpen(false)}
54
- showClose
55
- />
56
- </div>
57
- </>
58
- );
59
- }
60
-
61
- // Desktop/Tablet: collapsed state
62
- if (!propertiesPanelOpen) {
63
- return (
64
- <button
65
- onClick={() => setPropertiesPanelOpen(true)}
66
- className="w-10 bg-panel-bg border-l border-node-border flex flex-col items-center py-4 gap-4 hover:bg-white/5 transition-colors"
67
- aria-label="Expand properties panel"
68
- >
69
- <ChevronLeft className="w-4 h-4 text-gray-400" />
70
- <Settings className="w-5 h-5 text-gray-400" />
71
- </button>
72
- );
73
- }
74
-
75
- return (
76
- <div className="w-80 bg-panel-bg border-l border-node-border flex flex-col">
77
- <PropertiesPanelContent
78
- activeTab={activeTab}
79
- setActiveTab={setActiveTab}
80
- selectedNodes={selectedNodes}
81
- workflow={workflow}
82
- onClose={() => setPropertiesPanelOpen(false)}
83
- showClose={breakpoint === 'tablet'}
84
- />
85
- </div>
86
- );
87
- }
88
-
89
- interface PropertiesPanelContentProps {
90
- activeTab: TabId;
91
- setActiveTab: (tab: TabId) => void;
92
- selectedNodes: any[];
93
- workflow: any;
94
- onClose: () => void;
95
- showClose?: boolean;
96
- }
97
-
98
- function PropertiesPanelContent({
99
- activeTab,
100
- setActiveTab,
101
- selectedNodes,
102
- workflow,
103
- onClose,
104
- showClose,
105
- }: PropertiesPanelContentProps) {
106
- return (
107
- <>
108
- {/* Header */}
109
- <div className="flex items-center justify-between p-4 border-b border-node-border">
110
- <h2 className="text-sm font-medium text-white">Properties</h2>
111
- {showClose && (
112
- <button
113
- onClick={onClose}
114
- className="w-8 h-8 rounded-lg flex items-center justify-center hover:bg-white/10 transition-colors"
115
- aria-label="Close properties panel"
116
- >
117
- <X className="w-4 h-4 text-gray-400" />
118
- </button>
119
- )}
120
- </div>
121
-
122
- {/* Tabs */}
123
- <div className="flex border-b border-node-border">
124
- <TabButton
125
- active={activeTab === 'properties'}
126
- onClick={() => setActiveTab('properties')}
127
- icon={<Settings className="w-4 h-4" />}
128
- label="Properties"
129
- />
130
- <TabButton
131
- active={activeTab === 'variables'}
132
- onClick={() => setActiveTab('variables')}
133
- icon={<Variable className="w-4 h-4" />}
134
- label="Variables"
135
- />
136
- <TabButton
137
- active={activeTab === 'history'}
138
- onClick={() => setActiveTab('history')}
139
- icon={<History className="w-4 h-4" />}
140
- label="History"
141
- />
142
- </div>
143
-
144
- {/* Content */}
145
- <div className="flex-1 overflow-y-auto">
146
- {activeTab === 'properties' && (
147
- <PropertiesTab selectedNodes={selectedNodes} workflow={workflow} />
148
- )}
149
- {activeTab === 'variables' && <VariablesTab />}
150
- {activeTab === 'history' && <HistoryTab />}
151
- </div>
152
- </>
153
- );
154
- }
155
-
156
- interface TabButtonProps {
157
- active: boolean;
158
- onClick: () => void;
159
- icon: React.ReactNode;
160
- label: string;
161
- }
162
-
163
- function TabButton({ active, onClick, icon, label }: TabButtonProps) {
164
- return (
165
- <button
166
- onClick={onClick}
167
- className={`flex-1 flex items-center justify-center gap-1.5 px-3 py-2.5 text-xs font-medium transition-colors ${
168
- active
169
- ? 'text-primary border-b-2 border-primary -mb-px'
170
- : 'text-gray-400 hover:text-white'
171
- }`}
172
- >
173
- {icon}
174
- {label}
175
- </button>
176
- );
177
- }
178
-
179
- interface PropertiesTabProps {
180
- selectedNodes: any[];
181
- workflow: any;
182
- }
183
-
184
- function PropertiesTab({ selectedNodes, workflow }: PropertiesTabProps) {
185
- if (selectedNodes.length === 0) {
186
- // Show workflow properties
187
- return (
188
- <div className="p-4 space-y-4">
189
- <Section title="Workflow">
190
- {workflow ? (
191
- <div className="space-y-3">
192
- <Property label="Name" value={workflow.metadata?.name || 'Untitled'} />
193
- <Property label="Version" value={workflow.metadata?.version || '1.0.0'} />
194
- <Property label="Author" value={workflow.metadata?.author || 'Unknown'} />
195
- <Property
196
- label="Steps"
197
- value={`${workflow.steps?.length || 0} steps`}
198
- />
199
- </div>
200
- ) : (
201
- <div className="text-sm text-gray-500">No workflow loaded</div>
202
- )}
203
- </Section>
204
-
205
- {workflow?.metadata?.description && (
206
- <Section title="Description">
207
- <p className="text-sm text-gray-300">
208
- {workflow.metadata.description}
209
- </p>
210
- </Section>
211
- )}
212
-
213
- {workflow?.metadata?.tags && workflow.metadata.tags.length > 0 && (
214
- <Section title="Tags">
215
- <div className="flex flex-wrap gap-1.5">
216
- {workflow.metadata.tags.map((tag: string) => (
217
- <span
218
- key={tag}
219
- className="px-2 py-0.5 bg-primary/10 text-primary text-xs rounded-full"
220
- >
221
- {tag}
222
- </span>
223
- ))}
224
- </div>
225
- </Section>
226
- )}
227
- </div>
228
- );
229
- }
230
-
231
- if (selectedNodes.length === 1) {
232
- const node = selectedNodes[0];
233
- return (
234
- <div className="p-4 space-y-4">
235
- <Section title="Step">
236
- <div className="space-y-3">
237
- <Property label="ID" value={node.data?.id || node.id} />
238
- <Property label="Name" value={node.data?.name || '(unnamed)'} />
239
- <Property label="Action" value={node.data?.action || node.data?.workflowPath || '-'} />
240
- <Property
241
- label="Status"
242
- value={node.data?.status || 'pending'}
243
- badge
244
- badgeColor={
245
- node.data?.status === 'completed'
246
- ? 'success'
247
- : node.data?.status === 'failed'
248
- ? 'error'
249
- : node.data?.status === 'running'
250
- ? 'warning'
251
- : 'default'
252
- }
253
- />
254
- </div>
255
- </Section>
256
-
257
- {node.data?.error && (
258
- <Section title="Error">
259
- <div className="p-2 bg-error/10 border border-error/20 rounded text-xs text-error font-mono">
260
- {node.data.error}
261
- </div>
262
- </Section>
263
- )}
264
-
265
- <Section title="Actions">
266
- <div className="flex gap-2">
267
- <button className="flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors">
268
- Edit
269
- </button>
270
- <button className="flex-1 px-3 py-1.5 bg-node-bg border border-node-border rounded text-xs text-gray-300 hover:border-primary transition-colors">
271
- View YAML
272
- </button>
273
- </div>
274
- </Section>
275
- </div>
276
- );
277
- }
278
-
279
- // Multiple nodes selected
280
- return (
281
- <div className="p-4">
282
- <div className="text-sm text-gray-400">
283
- {selectedNodes.length} nodes selected
284
- </div>
285
- </div>
286
- );
287
- }
288
-
289
- function VariablesTab() {
290
- const variables = [
291
- { name: 'inputs.repo', value: 'owner/repo', type: 'string' },
292
- { name: 'inputs.pr_number', value: '123', type: 'number' },
293
- { name: 'pr_details.title', value: 'Fix bug', type: 'string' },
294
- { name: 'pr_details.state', value: 'open', type: 'string' },
295
- ];
296
-
297
- return (
298
- <div className="p-4 space-y-2">
299
- {variables.map((variable) => (
300
- <div
301
- key={variable.name}
302
- className="p-3 bg-node-bg rounded-lg border border-node-border"
303
- >
304
- <div className="flex items-center justify-between mb-1">
305
- <span className="text-xs font-mono text-primary">
306
- {variable.name}
307
- </span>
308
- <span className="text-xs text-gray-500">{variable.type}</span>
309
- </div>
310
- <div className="text-sm text-gray-300 font-mono truncate">
311
- {variable.value}
312
- </div>
313
- </div>
314
- ))}
315
- </div>
316
- );
317
- }
318
-
319
- function HistoryTab() {
320
- const { runs, clearHistory } = useExecutionStore();
321
- const [selectedRun, setSelectedRun] = useState<ExecutionRun | null>(null);
322
-
323
- if (selectedRun) {
324
- return <RunDetailView run={selectedRun} onBack={() => setSelectedRun(null)} />;
325
- }
326
-
327
- if (runs.length === 0) {
328
- return (
329
- <div className="p-4 text-center">
330
- <div className="w-12 h-12 mx-auto mb-3 rounded-full bg-node-bg flex items-center justify-center">
331
- <History className="w-6 h-6 text-gray-500" />
332
- </div>
333
- <p className="text-sm text-gray-400 mb-1">No execution history</p>
334
- <p className="text-xs text-gray-500">
335
- Run a workflow to see execution history here
336
- </p>
337
- </div>
338
- );
339
- }
340
-
341
- return (
342
- <div className="flex flex-col h-full">
343
- <div className="flex-1 overflow-y-auto p-4 space-y-2">
344
- {runs.map((run) => (
345
- <button
346
- key={run.id}
347
- onClick={() => setSelectedRun(run)}
348
- className="w-full p-3 bg-node-bg rounded-lg border border-node-border cursor-pointer hover:border-primary transition-colors text-left"
349
- >
350
- <div className="flex items-center justify-between mb-1">
351
- <span className="text-xs font-medium text-white truncate max-w-[140px]">
352
- {run.workflowName}
353
- </span>
354
- <RunStatusBadge status={run.status} />
355
- </div>
356
- <div className="flex items-center justify-between text-xs text-gray-400">
357
- <span>{run.duration ? formatDuration(run.duration) : '-'}</span>
358
- <span>{formatRelativeTime(run.startTime)}</span>
359
- </div>
360
- {run.steps.length > 0 && (
361
- <div className="mt-2 flex items-center gap-1">
362
- {run.steps.slice(0, 5).map((step) => (
363
- <StepStatusDot key={step.stepId} status={step.status} />
364
- ))}
365
- {run.steps.length > 5 && (
366
- <span className="text-xs text-gray-500">+{run.steps.length - 5}</span>
367
- )}
368
- </div>
369
- )}
370
- </button>
371
- ))}
372
- </div>
373
- {runs.length > 0 && (
374
- <div className="p-3 border-t border-node-border">
375
- <button
376
- onClick={clearHistory}
377
- className="w-full flex items-center justify-center gap-2 px-3 py-2 text-xs text-gray-400 hover:text-error transition-colors"
378
- >
379
- <Trash2 className="w-3.5 h-3.5" />
380
- Clear History
381
- </button>
382
- </div>
383
- )}
384
- </div>
385
- );
386
- }
387
-
388
- interface RunDetailViewProps {
389
- run: ExecutionRun;
390
- onBack: () => void;
391
- }
392
-
393
- function RunDetailView({ run, onBack }: RunDetailViewProps) {
394
- const [showLogs, setShowLogs] = useState(false);
395
-
396
- return (
397
- <div className="flex flex-col h-full">
398
- {/* Header */}
399
- <div className="p-3 border-b border-node-border">
400
- <button
401
- onClick={onBack}
402
- className="flex items-center gap-1 text-xs text-gray-400 hover:text-white mb-2"
403
- >
404
- <ChevronRight className="w-3 h-3 rotate-180" />
405
- Back to history
406
- </button>
407
- <div className="flex items-center justify-between">
408
- <span className="text-sm font-medium text-white truncate max-w-[180px]">
409
- {run.workflowName}
410
- </span>
411
- <RunStatusBadge status={run.status} />
412
- </div>
413
- <div className="flex items-center justify-between mt-1 text-xs text-gray-400">
414
- <span>{run.duration ? formatDuration(run.duration) : 'Running...'}</span>
415
- <span>{new Date(run.startTime).toLocaleString()}</span>
416
- </div>
417
- </div>
418
-
419
- {/* Tabs */}
420
- <div className="flex border-b border-node-border">
421
- <button
422
- onClick={() => setShowLogs(false)}
423
- className={`flex-1 px-3 py-2 text-xs font-medium transition-colors ${
424
- !showLogs
425
- ? 'text-primary border-b-2 border-primary -mb-px'
426
- : 'text-gray-400 hover:text-white'
427
- }`}
428
- >
429
- Steps ({run.steps.length})
430
- </button>
431
- <button
432
- onClick={() => setShowLogs(true)}
433
- className={`flex-1 px-3 py-2 text-xs font-medium transition-colors ${
434
- showLogs
435
- ? 'text-primary border-b-2 border-primary -mb-px'
436
- : 'text-gray-400 hover:text-white'
437
- }`}
438
- >
439
- Logs ({run.logs.length})
440
- </button>
441
- </div>
442
-
443
- {/* Content */}
444
- <div className="flex-1 overflow-y-auto p-3">
445
- {showLogs ? (
446
- <div className="space-y-1 font-mono text-xs">
447
- {run.logs.map((log, i) => (
448
- <div key={i} className="text-gray-300 break-words">
449
- {log}
450
- </div>
451
- ))}
452
- </div>
453
- ) : (
454
- <div className="space-y-2">
455
- {run.steps.map((step) => (
456
- <div
457
- key={step.stepId}
458
- className="p-2 bg-node-bg rounded border border-node-border"
459
- >
460
- <div className="flex items-center justify-between">
461
- <span className="text-xs font-medium text-white truncate">
462
- {step.stepName}
463
- </span>
464
- <StepStatusBadge status={step.status} />
465
- </div>
466
- {step.duration && (
467
- <div className="text-xs text-gray-500 mt-1">
468
- {formatDuration(step.duration)}
469
- </div>
470
- )}
471
- {step.error && (
472
- <div className="mt-2 p-2 bg-error/10 border border-error/20 rounded text-xs text-error">
473
- {step.error}
474
- </div>
475
- )}
476
- </div>
477
- ))}
478
- </div>
479
- )}
480
- </div>
481
- </div>
482
- );
483
- }
484
-
485
- function RunStatusBadge({ status }: { status: ExecutionRun['status'] }) {
486
- const config = {
487
- running: { bg: 'bg-warning/10', text: 'text-warning', icon: Loader2 },
488
- completed: { bg: 'bg-success/10', text: 'text-success', icon: CheckCircle },
489
- failed: { bg: 'bg-error/10', text: 'text-error', icon: XCircle },
490
- cancelled: { bg: 'bg-gray-500/10', text: 'text-gray-400', icon: XCircle },
491
- pending: { bg: 'bg-gray-500/10', text: 'text-gray-400', icon: Clock },
492
- };
493
-
494
- const { bg, text, icon: Icon } = config[status] || config.pending;
495
-
496
- return (
497
- <span className={`flex items-center gap-1 text-xs px-2 py-0.5 rounded-full ${bg} ${text}`}>
498
- <Icon className={`w-3 h-3 ${status === 'running' ? 'animate-spin' : ''}`} />
499
- {status}
500
- </span>
501
- );
502
- }
503
-
504
- function StepStatusBadge({ status }: { status: string }) {
505
- const config: Record<string, { bg: string; text: string }> = {
506
- running: { bg: 'bg-warning/10', text: 'text-warning' },
507
- completed: { bg: 'bg-success/10', text: 'text-success' },
508
- failed: { bg: 'bg-error/10', text: 'text-error' },
509
- pending: { bg: 'bg-gray-500/10', text: 'text-gray-400' },
510
- };
511
-
512
- const { bg, text } = config[status] || config.pending;
513
-
514
- return (
515
- <span className={`text-xs px-1.5 py-0.5 rounded ${bg} ${text}`}>
516
- {status}
517
- </span>
518
- );
519
- }
520
-
521
- function StepStatusDot({ status }: { status: string }) {
522
- const colors: Record<string, string> = {
523
- running: 'bg-warning',
524
- completed: 'bg-success',
525
- failed: 'bg-error',
526
- pending: 'bg-gray-500',
527
- };
528
-
529
- return (
530
- <div
531
- className={`w-2 h-2 rounded-full ${colors[status] || colors.pending} ${
532
- status === 'running' ? 'animate-pulse' : ''
533
- }`}
534
- title={status}
535
- />
536
- );
537
- }
538
-
539
- interface SectionProps {
540
- title: string;
541
- children: React.ReactNode;
542
- }
543
-
544
- function Section({ title, children }: SectionProps) {
545
- return (
546
- <div>
547
- <h3 className="text-xs font-medium text-gray-500 uppercase tracking-wider mb-2">
548
- {title}
549
- </h3>
550
- {children}
551
- </div>
552
- );
553
- }
554
-
555
- interface PropertyProps {
556
- label: string;
557
- value: string;
558
- badge?: boolean;
559
- badgeColor?: 'default' | 'success' | 'error' | 'warning';
560
- }
561
-
562
- function Property({
563
- label,
564
- value,
565
- badge,
566
- badgeColor = 'default',
567
- }: PropertyProps) {
568
- const colors = {
569
- default: 'bg-gray-500/10 text-gray-400',
570
- success: 'bg-success/10 text-success',
571
- error: 'bg-error/10 text-error',
572
- warning: 'bg-warning/10 text-warning',
573
- };
574
-
575
- return (
576
- <div className="flex items-center justify-between">
577
- <span className="text-xs text-gray-400">{label}</span>
578
- {badge ? (
579
- <span className={`text-xs px-2 py-0.5 rounded-full ${colors[badgeColor]}`}>
580
- {value}
581
- </span>
582
- ) : (
583
- <span className="text-sm text-gray-200 font-mono truncate max-w-[180px]">
584
- {value}
585
- </span>
586
- )}
587
- </div>
588
- );
589
- }