@flowdrop/flowdrop 1.15.0 → 2.0.0-beta.10
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/CHANGELOG.md +648 -0
- package/MIGRATION-2.0.md +642 -0
- package/README.md +28 -28
- package/dist/adapters/WorkflowAdapter.d.ts +1 -1
- package/dist/adapters/WorkflowAdapter.js +18 -13
- package/dist/adapters/agentspec/AgentSpecAdapter.js +10 -10
- package/dist/adapters/agentspec/defaultNodeTypes.js +9 -9
- package/dist/api/enhanced-client.js +6 -11
- package/dist/chat/batchFeedback.d.ts +39 -0
- package/dist/chat/batchFeedback.js +51 -0
- package/dist/commands/executor.js +66 -27
- package/dist/commands/storeIntegration.svelte.d.ts +4 -1
- package/dist/commands/storeIntegration.svelte.js +36 -21
- package/dist/commands/types.d.ts +2 -0
- package/dist/commands/types.js +5 -5
- package/dist/components/App.svelte +696 -565
- package/dist/components/App.svelte.d.ts +63 -16
- package/dist/components/Button.stories.svelte +65 -0
- package/dist/components/Button.stories.svelte.d.ts +19 -0
- package/dist/components/Button.svelte +62 -0
- package/dist/components/Button.svelte.d.ts +24 -0
- package/dist/components/CanvasIconButton.svelte +76 -0
- package/dist/components/CanvasIconButton.svelte.d.ts +18 -0
- package/dist/components/ConfigForm.svelte +181 -552
- package/dist/components/ConfigForm.svelte.d.ts +24 -7
- package/dist/components/ConfigModal.svelte +16 -3
- package/dist/components/ConfigPanel.svelte +234 -15
- package/dist/components/ConfigPanel.svelte.d.ts +6 -0
- package/dist/components/ConnectionLine.svelte +4 -2
- package/dist/components/EditorStatusBar.stories.svelte +44 -0
- package/dist/components/EditorStatusBar.stories.svelte.d.ts +27 -0
- package/dist/components/EditorStatusBar.svelte +99 -0
- package/dist/components/EditorStatusBar.svelte.d.ts +15 -0
- package/dist/components/IconButton.svelte +80 -0
- package/dist/components/IconButton.svelte.d.ts +30 -0
- package/dist/components/Input.svelte +74 -0
- package/dist/components/Input.svelte.d.ts +17 -0
- package/dist/components/LogoWordmark.svelte +113 -0
- package/dist/components/LogoWordmark.svelte.d.ts +26 -0
- package/dist/components/Navbar.svelte +78 -64
- package/dist/components/Navbar.svelte.d.ts +3 -0
- package/dist/components/NodeSidebar.svelte +48 -171
- package/dist/components/NodeStatusOverlay.svelte +94 -6
- package/dist/components/NodeSwapPicker.svelte +22 -38
- package/dist/components/PipelineStatus.svelte +22 -68
- package/dist/components/PipelineStatus.svelte.d.ts +3 -0
- package/dist/components/PortCoordinateTracker.svelte +5 -6
- package/dist/components/PortMappingRow.svelte +0 -2
- package/dist/components/SchemaForm.stories.svelte +1 -3
- package/dist/components/SchemaForm.svelte +22 -39
- package/dist/components/SchemaForm.svelte.d.ts +0 -8
- package/dist/components/Select.svelte +53 -0
- package/dist/components/Select.svelte.d.ts +15 -0
- package/dist/components/SettingsModal.svelte +8 -8
- package/dist/components/SettingsPanel.svelte +44 -10
- package/dist/components/SwapMappingEditor.svelte +67 -49
- package/dist/components/SwapMappingEditor.svelte.d.ts +0 -2
- package/dist/components/Textarea.svelte +39 -0
- package/dist/components/Textarea.svelte.d.ts +12 -0
- package/dist/components/ThemeToggle.svelte +15 -94
- package/dist/components/UniversalNode.svelte +45 -11
- package/dist/components/UniversalNode.svelte.d.ts +1 -1
- package/dist/components/WorkflowEditor.svelte +183 -162
- package/dist/components/WorkflowEditor.svelte.d.ts +39 -10
- package/dist/components/chat/AIChatPanel.svelte +99 -90
- package/dist/components/chat/AIChatPanel.svelte.d.ts +0 -4
- package/dist/components/chat/CommandPreview.svelte +2 -1
- package/dist/components/console/CommandConsole.svelte +7 -5
- package/dist/components/console/ConsoleAutocomplete.svelte +11 -12
- package/dist/components/console/ConsoleAutocomplete.svelte.d.ts +6 -0
- package/dist/components/console/ConsoleInput.svelte +18 -9
- package/dist/components/console/ConsoleOutput.svelte +4 -3
- package/dist/components/form/FormArray.svelte +42 -182
- package/dist/components/form/FormArray.svelte.d.ts +2 -1
- package/dist/components/form/FormAutocomplete.svelte +26 -21
- package/dist/components/form/FormCheckboxGroup.svelte +1 -5
- package/dist/components/form/FormCodeEditor.svelte +9 -7
- package/dist/components/form/FormField.svelte +22 -44
- package/dist/components/form/FormFieldLight.svelte +56 -50
- package/dist/components/form/FormFieldLight.svelte.d.ts +12 -0
- package/dist/components/form/FormFieldset.svelte +45 -11
- package/dist/components/form/FormMarkdownEditor.svelte +17 -9
- package/dist/components/form/FormNumberField.svelte +4 -36
- package/dist/components/form/FormPorts.svelte +262 -0
- package/dist/components/form/FormPorts.svelte.d.ts +13 -0
- package/dist/components/form/FormRangeField.svelte +62 -30
- package/dist/components/form/FormSelect.svelte +13 -75
- package/dist/components/form/FormTemplateEditor.svelte +17 -7
- package/dist/components/form/FormTextField.svelte +3 -35
- package/dist/components/form/FormTextarea.svelte +4 -39
- package/dist/components/form/FormToggle.svelte +5 -16
- package/dist/components/form/FormToggle.svelte.d.ts +4 -2
- package/dist/components/form/FormUISchemaRenderer.svelte +3 -1
- package/dist/components/form/resolveFieldType.d.ts +24 -0
- package/dist/components/form/resolveFieldType.js +55 -0
- package/dist/components/form/templateAutocomplete.js +1 -5
- package/dist/components/form/types.d.ts +1 -14
- package/dist/components/icons/CloseIcon.svelte +6 -0
- package/dist/components/icons/CloseIcon.svelte.d.ts +26 -0
- package/dist/components/icons/CommandLineIcon.svelte +15 -0
- package/dist/components/icons/CommandLineIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuIcon.svelte +4 -0
- package/dist/components/icons/MenuIcon.svelte.d.ts +26 -0
- package/dist/components/icons/MenuOpenIcon.svelte +6 -0
- package/dist/components/icons/MenuOpenIcon.svelte.d.ts +26 -0
- package/dist/components/interrupt/ChoicePrompt.svelte +0 -10
- package/dist/components/interrupt/ConfirmationPrompt.svelte +0 -5
- package/dist/components/interrupt/FormPrompt.svelte +3 -2
- package/dist/components/interrupt/InterruptBubble.svelte +25 -27
- package/dist/components/interrupt/ReviewPrompt.svelte +10 -23
- package/dist/components/interrupt/TextInputPrompt.svelte +2 -7
- package/dist/components/layouts/MainLayout.svelte +24 -18
- package/dist/components/layouts/MainLayout.svelte.d.ts +4 -0
- package/dist/components/nodes/AtomNode.svelte +70 -72
- package/dist/components/nodes/AtomNode.svelte.d.ts +1 -1
- package/dist/components/nodes/GatewayNode.svelte +134 -172
- package/dist/components/nodes/GatewayNode.svelte.d.ts +1 -1
- package/dist/components/nodes/IdeaNode.svelte +79 -98
- package/dist/components/nodes/IdeaNode.svelte.d.ts +8 -4
- package/dist/components/nodes/NodeConfigButton.svelte +86 -0
- package/dist/components/nodes/NodeConfigButton.svelte.d.ts +15 -0
- package/dist/components/nodes/NotesNode.svelte +76 -85
- package/dist/components/nodes/NotesNode.svelte.d.ts +8 -4
- package/dist/components/nodes/SimpleNode.svelte +68 -137
- package/dist/components/nodes/SimpleNode.svelte.d.ts +4 -4
- package/dist/components/nodes/SquareNode.svelte +122 -169
- package/dist/components/nodes/SquareNode.svelte.d.ts +4 -4
- package/dist/components/nodes/TerminalNode.svelte +70 -127
- package/dist/components/nodes/TerminalNode.svelte.d.ts +4 -4
- package/dist/components/nodes/ToolNode.svelte +99 -104
- package/dist/components/nodes/ToolNode.svelte.d.ts +6 -6
- package/dist/components/nodes/WorkflowNode.svelte +145 -195
- package/dist/components/nodes/WorkflowNode.svelte.d.ts +1 -1
- package/dist/components/playground/ChatInput.svelte +11 -15
- package/dist/components/playground/ChatPanel.svelte +6 -49
- package/dist/components/playground/ChatPanel.svelte.d.ts +0 -14
- package/dist/components/playground/ControlPanel.svelte +134 -123
- package/dist/components/playground/ControlPanel.svelte.d.ts +3 -0
- package/dist/components/playground/ExecutionLogs.svelte +11 -9
- package/dist/components/playground/InputCollector.svelte +22 -57
- package/dist/components/playground/MessageStream.svelte +17 -23
- package/dist/components/playground/PipelineKanbanView.svelte +69 -8
- package/dist/components/playground/PipelineKanbanView.svelte.d.ts +2 -0
- package/dist/components/playground/PipelinePanel.svelte +31 -8
- package/dist/components/playground/PipelinePanel.svelte.d.ts +2 -0
- package/dist/components/playground/PipelineTableView.svelte +188 -44
- package/dist/components/playground/PipelineTableView.svelte.d.ts +2 -0
- package/dist/components/playground/Playground.svelte +154 -105
- package/dist/components/playground/Playground.svelte.d.ts +5 -0
- package/dist/components/playground/PlaygroundApp.svelte +12 -2
- package/dist/components/playground/PlaygroundApp.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundModal.svelte +18 -3
- package/dist/components/playground/PlaygroundModal.svelte.d.ts +6 -0
- package/dist/components/playground/PlaygroundStudio.svelte +40 -37
- package/dist/components/playground/PlaygroundStudio.svelte.d.ts +6 -0
- package/dist/components/playground/SessionManager.svelte +9 -12
- package/dist/components/playground/pipelineViewUtils.svelte.d.ts +30 -1
- package/dist/components/playground/pipelineViewUtils.svelte.js +40 -3
- package/dist/components/surfaces/SurfaceOverlay.svelte +153 -0
- package/dist/components/surfaces/SurfaceOverlay.svelte.d.ts +14 -0
- package/dist/components/surfaces/TabbedSurface.svelte +133 -0
- package/dist/components/surfaces/TabbedSurface.svelte.d.ts +27 -0
- package/dist/config/endpoints.d.ts +23 -7
- package/dist/config/endpoints.js +30 -10
- package/dist/core/index.d.ts +6 -7
- package/dist/core/index.js +8 -12
- package/dist/display/index.d.ts +6 -3
- package/dist/display/index.js +7 -5
- package/dist/editor/index.d.ts +20 -21
- package/dist/editor/index.js +26 -36
- package/dist/form/code.d.ts +25 -15
- package/dist/form/code.js +44 -41
- package/dist/form/fieldRegistry.d.ts +17 -13
- package/dist/form/fieldRegistry.js +32 -12
- package/dist/form/full.d.ts +19 -14
- package/dist/form/full.js +26 -28
- package/dist/form/index.d.ts +3 -4
- package/dist/form/index.js +6 -5
- package/dist/form/markdown.d.ts +13 -8
- package/dist/form/markdown.js +22 -23
- package/dist/helpers/proximityConnect.d.ts +3 -2
- package/dist/helpers/proximityConnect.js +2 -5
- package/dist/helpers/workflowEditorHelper.d.ts +14 -5
- package/dist/helpers/workflowEditorHelper.js +32 -30
- package/dist/index.d.ts +28 -24
- package/dist/index.js +27 -50
- package/dist/messages/defaults.d.ts +2 -5
- package/dist/messages/defaults.js +3 -6
- package/dist/messages/index.d.ts +1 -2
- package/dist/messages/index.js +1 -2
- package/dist/mocks/app-forms.d.ts +6 -2
- package/dist/mocks/app-forms.js +11 -4
- package/dist/openapi/v1/openapi.yaml +38 -26
- package/dist/playground/index.d.ts +4 -5
- package/dist/playground/index.js +4 -32
- package/dist/playground/mount.d.ts +34 -5
- package/dist/playground/mount.js +58 -24
- package/dist/registry/{BaseRegistry.d.ts → BaseRegistry.svelte.d.ts} +22 -1
- package/dist/registry/{BaseRegistry.js → BaseRegistry.svelte.js} +37 -1
- package/dist/registry/builtinFormats.d.ts +9 -18
- package/dist/registry/builtinFormats.js +9 -39
- package/dist/registry/builtinNodeTypes.d.ts +53 -0
- package/dist/registry/builtinNodeTypes.js +67 -0
- package/dist/registry/builtinNodes.d.ts +2 -64
- package/dist/registry/builtinNodes.js +7 -103
- package/dist/registry/index.d.ts +3 -4
- package/dist/registry/index.js +4 -6
- package/dist/registry/nodeComponentRegistry.d.ts +184 -16
- package/dist/registry/nodeComponentRegistry.js +235 -17
- package/dist/registry/workflowFormatRegistry.d.ts +14 -9
- package/dist/registry/workflowFormatRegistry.js +24 -8
- package/dist/{schema → schemas}/index.d.ts +2 -2
- package/dist/{schema → schemas}/index.js +2 -2
- package/dist/schemas/v1/workflow.schema.json +19 -17
- package/dist/services/agentSpecExecutionService.d.ts +0 -2
- package/dist/services/agentSpecExecutionService.js +0 -3
- package/dist/services/apiVariableService.d.ts +2 -1
- package/dist/services/apiVariableService.js +16 -47
- package/dist/services/autoSaveService.d.ts +7 -0
- package/dist/services/autoSaveService.js +6 -4
- package/dist/services/categoriesApi.js +3 -6
- package/dist/services/chatService.d.ts +9 -4
- package/dist/services/chatService.js +23 -28
- package/dist/services/draftStorage.d.ts +129 -13
- package/dist/services/draftStorage.js +185 -37
- package/dist/services/dynamicSchemaService.d.ts +33 -5
- package/dist/services/dynamicSchemaService.js +67 -55
- package/dist/services/globalSave.d.ts +13 -12
- package/dist/services/globalSave.js +29 -51
- package/dist/services/historyService.d.ts +39 -11
- package/dist/services/historyService.js +60 -18
- package/dist/services/interruptService.d.ts +15 -9
- package/dist/services/interruptService.js +35 -37
- package/dist/services/nodeExecutionService.d.ts +18 -3
- package/dist/services/nodeExecutionService.js +71 -45
- package/dist/services/playgroundService.d.ts +16 -10
- package/dist/services/playgroundService.js +42 -43
- package/dist/services/portConfigApi.js +3 -6
- package/dist/services/settingsService.d.ts +9 -4
- package/dist/services/settingsService.js +23 -12
- package/dist/services/variableService.d.ts +2 -1
- package/dist/services/variableService.js +2 -2
- package/dist/services/workflowStorage.js +6 -6
- package/dist/skins/drafter.d.ts +30 -0
- package/dist/skins/drafter.js +198 -0
- package/dist/skins/index.d.ts +2 -1
- package/dist/skins/index.js +4 -2
- package/dist/stores/apiContext.d.ts +56 -0
- package/dist/stores/apiContext.js +80 -0
- package/dist/stores/categoriesStore.svelte.d.ts +28 -23
- package/dist/stores/categoriesStore.svelte.js +69 -64
- package/dist/stores/getInstance.svelte.d.ts +39 -0
- package/dist/stores/getInstance.svelte.js +65 -0
- package/dist/stores/historyStore.svelte.d.ts +89 -91
- package/dist/stores/historyStore.svelte.js +159 -158
- package/dist/stores/instanceContainer.svelte.d.ts +111 -0
- package/dist/stores/instanceContainer.svelte.js +119 -0
- package/dist/stores/interruptStore.svelte.d.ts +112 -82
- package/dist/stores/interruptStore.svelte.js +253 -226
- package/dist/stores/pipelinePanelStore.svelte.d.ts +27 -3
- package/dist/stores/pipelinePanelStore.svelte.js +61 -14
- package/dist/stores/playgroundStore.svelte.d.ts +169 -222
- package/dist/stores/playgroundStore.svelte.js +513 -580
- package/dist/stores/portCoordinateStore.svelte.d.ts +57 -51
- package/dist/stores/portCoordinateStore.svelte.js +109 -98
- package/dist/stores/settingsStore.svelte.d.ts +17 -1
- package/dist/stores/settingsStore.svelte.js +79 -12
- package/dist/stores/workflowStore.svelte.d.ts +212 -210
- package/dist/stores/workflowStore.svelte.js +527 -502
- package/dist/stories/EdgeDecorator.svelte +5 -2
- package/dist/stories/NodeDecorator.svelte +5 -3
- package/dist/styles/base.css +285 -14
- package/dist/styles/tokens.css +60 -2
- package/dist/svelte-app.d.ts +78 -11
- package/dist/svelte-app.js +210 -141
- package/dist/themes/drafter.d.ts +2 -0
- package/dist/themes/drafter.js +15 -0
- package/dist/themes/index.d.ts +2 -1
- package/dist/themes/index.js +8 -2
- package/dist/types/auth.d.ts +9 -51
- package/dist/types/auth.js +4 -54
- package/dist/types/events.d.ts +24 -3
- package/dist/types/events.js +2 -1
- package/dist/types/index.d.ts +117 -32
- package/dist/types/index.js +0 -1
- package/dist/types/navbar.d.ts +7 -0
- package/dist/types/playground.d.ts +18 -3
- package/dist/types/settings.d.ts +30 -1
- package/dist/types/settings.js +5 -2
- package/dist/types/skin.d.ts +1 -1
- package/dist/types/theme.d.ts +16 -2
- package/dist/types/uischema.d.ts +5 -0
- package/dist/utils/colors.d.ts +74 -21
- package/dist/utils/colors.js +92 -68
- package/dist/utils/connections.d.ts +9 -15
- package/dist/utils/connections.js +33 -88
- package/dist/utils/duration.d.ts +13 -0
- package/dist/utils/duration.js +45 -0
- package/dist/utils/edgeStyling.js +9 -5
- package/dist/utils/fetchWithAuth.d.ts +36 -15
- package/dist/utils/fetchWithAuth.js +53 -23
- package/dist/utils/icons.d.ts +5 -2
- package/dist/utils/icons.js +6 -5
- package/dist/utils/nodeIds.d.ts +1 -1
- package/dist/utils/nodeIds.js +1 -1
- package/dist/utils/nodeSwap.d.ts +6 -2
- package/dist/utils/nodeSwap.js +62 -129
- package/dist/utils/nodeTypes.d.ts +17 -8
- package/dist/utils/nodeTypes.js +27 -20
- package/dist/utils/performanceUtils.js +7 -0
- package/dist/utils/portUtils.d.ts +47 -11
- package/dist/utils/portUtils.js +67 -14
- package/dist/utils/portal.d.ts +18 -0
- package/dist/utils/portal.js +34 -0
- package/dist/utils/schemaMerge.d.ts +25 -0
- package/dist/utils/schemaMerge.js +61 -0
- package/package.json +7 -5
- package/dist/messages/deprecation.d.ts +0 -20
- package/dist/messages/deprecation.js +0 -33
- package/dist/registry/plugin.d.ts +0 -215
- package/dist/registry/plugin.js +0 -249
- package/dist/services/api.d.ts +0 -129
- package/dist/services/api.js +0 -217
|
@@ -25,19 +25,26 @@
|
|
|
25
25
|
idle: 'mdi:circle-outline'
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
function formatDuration(ms: number | null | undefined): string | null {
|
|
29
|
-
if (ms == null) return null;
|
|
30
|
-
if (ms < 1000) return `${ms}ms`;
|
|
31
|
-
if (ms < 60000) return `${(ms / 1000).toFixed(2)}s`;
|
|
32
|
-
const mins = Math.floor(ms / 60000);
|
|
33
|
-
const secs = Math.floor((ms % 60000) / 1000);
|
|
34
|
-
return `${mins}m ${secs}s`;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
28
|
function formatDateTime(iso: string | null | undefined): string | null {
|
|
38
29
|
if (!iso) return null;
|
|
39
30
|
return new Date(iso).toLocaleString();
|
|
40
31
|
}
|
|
32
|
+
|
|
33
|
+
function formatJson(value: unknown): string {
|
|
34
|
+
if (typeof value === 'string') return value;
|
|
35
|
+
try {
|
|
36
|
+
return JSON.stringify(value, null, 2);
|
|
37
|
+
} catch {
|
|
38
|
+
return String(value);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** Treat null/undefined and empty objects/arrays as "nothing to show". */
|
|
43
|
+
function hasData(value: unknown): boolean {
|
|
44
|
+
if (value == null) return false;
|
|
45
|
+
if (typeof value === 'object') return Object.keys(value).length > 0;
|
|
46
|
+
return value !== '';
|
|
47
|
+
}
|
|
41
48
|
</script>
|
|
42
49
|
|
|
43
50
|
<script lang="ts">
|
|
@@ -45,27 +52,42 @@
|
|
|
45
52
|
import Icon from '@iconify/svelte';
|
|
46
53
|
import { createPipelineDataFetcher, resolveStatus } from './pipelineViewUtils.svelte.js';
|
|
47
54
|
import { getStatusTextColor } from '../../utils/nodeStatus.js';
|
|
48
|
-
import
|
|
55
|
+
import { formatMicroseconds } from '../../utils/duration.js';
|
|
49
56
|
import type { Workflow, WorkflowNode } from '../../types/index.js';
|
|
50
57
|
import type { EndpointConfig } from '../../config/endpoints.js';
|
|
58
|
+
import type { AuthProvider } from '../../types/auth.js';
|
|
51
59
|
|
|
52
60
|
interface Props {
|
|
53
61
|
pipelineId: string;
|
|
54
62
|
workflow: Workflow;
|
|
55
63
|
endpointConfig: EndpointConfig;
|
|
64
|
+
authProvider?: AuthProvider;
|
|
56
65
|
refreshTrigger?: number;
|
|
57
66
|
}
|
|
58
67
|
|
|
59
|
-
let { pipelineId, workflow, endpointConfig, refreshTrigger = 0 }: Props = $props();
|
|
68
|
+
let { pipelineId, workflow, endpointConfig, authProvider, refreshTrigger = 0 }: Props = $props();
|
|
60
69
|
|
|
61
|
-
interface
|
|
62
|
-
|
|
70
|
+
interface JobRow {
|
|
71
|
+
/** Stable key: job id, or node id for nodes without a job yet */
|
|
72
|
+
key: string;
|
|
73
|
+
label: string;
|
|
74
|
+
typeId: string;
|
|
75
|
+
nodeId: string;
|
|
63
76
|
status: NodeStatus;
|
|
64
|
-
|
|
77
|
+
started?: string | null;
|
|
78
|
+
completed?: string | null;
|
|
79
|
+
/** Duration in microseconds */
|
|
80
|
+
executionTimeUs?: number | null;
|
|
81
|
+
error?: string | null;
|
|
82
|
+
retryCount?: number | null;
|
|
83
|
+
maxRetries?: number | null;
|
|
84
|
+
inputData?: unknown;
|
|
85
|
+
outputData?: unknown;
|
|
65
86
|
}
|
|
66
87
|
|
|
67
|
-
//
|
|
68
|
-
|
|
88
|
+
// endpointConfig is consumed once to build the API client; it must be stable
|
|
89
|
+
// svelte-ignore state_referenced_locally
|
|
90
|
+
const fetcher = createPipelineDataFetcher(() => pipelineId, endpointConfig, authProvider);
|
|
69
91
|
|
|
70
92
|
$effect(() => {
|
|
71
93
|
if (refreshTrigger <= 0) return;
|
|
@@ -73,28 +95,76 @@
|
|
|
73
95
|
return () => clearTimeout(timer);
|
|
74
96
|
});
|
|
75
97
|
|
|
76
|
-
|
|
77
|
-
|
|
98
|
+
// One row per job, timeline style: loop iterations create multiple jobs
|
|
99
|
+
// for the same node and each shows as its own row (label carries the #N
|
|
100
|
+
// suffix). Executed jobs sort by start time; never-started jobs keep
|
|
101
|
+
// pipeline order at the end, followed by nodes that have no job yet.
|
|
102
|
+
const sortedRows = $derived.by((): JobRow[] => {
|
|
103
|
+
const nodesById = new Map<string, WorkflowNode>(workflow.nodes.map((node) => [node.id, node]));
|
|
104
|
+
|
|
105
|
+
const jobRows: JobRow[] = [];
|
|
106
|
+
const nodesWithJobs = new Set<string>();
|
|
107
|
+
for (const job of fetcher.jobs) {
|
|
108
|
+
const node = nodesById.get(job.nodeId);
|
|
109
|
+
if (!node) continue;
|
|
110
|
+
nodesWithJobs.add(job.nodeId);
|
|
111
|
+
jobRows.push({
|
|
112
|
+
key: job.id,
|
|
113
|
+
label: job.label || node.data.label,
|
|
114
|
+
typeId: node.data.metadata.node_type_id,
|
|
115
|
+
nodeId: job.nodeId,
|
|
116
|
+
status: resolveStatus({ status: job.status }),
|
|
117
|
+
started: job.started,
|
|
118
|
+
completed: job.completed,
|
|
119
|
+
executionTimeUs: job.executionTimeUs,
|
|
120
|
+
error: job.error,
|
|
121
|
+
retryCount: job.retryCount,
|
|
122
|
+
maxRetries: job.maxRetries,
|
|
123
|
+
inputData: job.inputData,
|
|
124
|
+
outputData: job.outputData
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const startedRows = jobRows
|
|
129
|
+
.filter((row) => row.started)
|
|
130
|
+
.sort((a, b) => Date.parse(a.started!) - Date.parse(b.started!));
|
|
131
|
+
const neverStartedRows = jobRows.filter((row) => !row.started);
|
|
132
|
+
|
|
133
|
+
const nodeRows: JobRow[] = workflow.nodes
|
|
134
|
+
.filter((node) => !nodesWithJobs.has(node.id))
|
|
78
135
|
.map((node) => {
|
|
79
136
|
const statusData = fetcher.nodeStatusMap[node.id];
|
|
80
|
-
return {
|
|
137
|
+
return {
|
|
138
|
+
key: node.id,
|
|
139
|
+
label: node.data.label,
|
|
140
|
+
typeId: node.data.metadata.node_type_id,
|
|
141
|
+
nodeId: node.id,
|
|
142
|
+
status: resolveStatus(statusData),
|
|
143
|
+
started: statusData?.last_executed,
|
|
144
|
+
executionTimeUs:
|
|
145
|
+
statusData?.execution_time_us ??
|
|
146
|
+
(statusData?.execution_time != null ? statusData.execution_time * 1000 : null),
|
|
147
|
+
error: statusData?.error
|
|
148
|
+
};
|
|
81
149
|
})
|
|
82
|
-
.sort((a, b) => (STATUS_ORDER[a.status] ?? Infinity) - (STATUS_ORDER[b.status] ?? Infinity))
|
|
83
|
-
|
|
150
|
+
.sort((a, b) => (STATUS_ORDER[a.status] ?? Infinity) - (STATUS_ORDER[b.status] ?? Infinity));
|
|
151
|
+
|
|
152
|
+
return [...startedRows, ...neverStartedRows, ...nodeRows];
|
|
153
|
+
});
|
|
84
154
|
|
|
85
155
|
let expandedIds = $state(new Set<string>());
|
|
86
156
|
|
|
87
|
-
function hasDetails(row:
|
|
88
|
-
return !!(row.
|
|
157
|
+
function hasDetails(row: JobRow): boolean {
|
|
158
|
+
return !!(row.started || row.error || hasData(row.inputData) || hasData(row.outputData));
|
|
89
159
|
}
|
|
90
160
|
|
|
91
|
-
function toggleRow(row:
|
|
161
|
+
function toggleRow(row: JobRow) {
|
|
92
162
|
if (!hasDetails(row)) return;
|
|
93
163
|
const next = new Set(expandedIds);
|
|
94
|
-
if (next.has(row.
|
|
95
|
-
next.delete(row.
|
|
164
|
+
if (next.has(row.key)) {
|
|
165
|
+
next.delete(row.key);
|
|
96
166
|
} else {
|
|
97
|
-
next.add(row.
|
|
167
|
+
next.add(row.key);
|
|
98
168
|
}
|
|
99
169
|
expandedIds = next;
|
|
100
170
|
}
|
|
@@ -121,12 +191,13 @@
|
|
|
121
191
|
<th class="pipeline-table__th">Node</th>
|
|
122
192
|
<th class="pipeline-table__th">Type</th>
|
|
123
193
|
<th class="pipeline-table__th">Status</th>
|
|
194
|
+
<th class="pipeline-table__th pipeline-table__th--duration">Duration</th>
|
|
124
195
|
<th class="pipeline-table__th pipeline-table__th--id">ID</th>
|
|
125
196
|
</tr>
|
|
126
197
|
</thead>
|
|
127
198
|
<tbody>
|
|
128
|
-
{#each sortedRows as row (row.
|
|
129
|
-
{@const expanded = expandedIds.has(row.
|
|
199
|
+
{#each sortedRows as row (row.key)}
|
|
200
|
+
{@const expanded = expandedIds.has(row.key)}
|
|
130
201
|
{@const expandable = hasDetails(row)}
|
|
131
202
|
<tr
|
|
132
203
|
class="pipeline-table__row"
|
|
@@ -144,12 +215,11 @@
|
|
|
144
215
|
/>
|
|
145
216
|
{/if}
|
|
146
217
|
</td>
|
|
147
|
-
<td class="pipeline-table__td pipeline-table__td--label" title={row.
|
|
148
|
-
>{row.
|
|
218
|
+
<td class="pipeline-table__td pipeline-table__td--label" title={row.label}
|
|
219
|
+
>{row.label}</td
|
|
149
220
|
>
|
|
150
|
-
<td
|
|
151
|
-
|
|
152
|
-
title={row.node.data.metadata.id}>{row.node.data.metadata.id}</td
|
|
221
|
+
<td class="pipeline-table__td pipeline-table__td--muted" title={row.typeId}
|
|
222
|
+
>{row.typeId}</td
|
|
153
223
|
>
|
|
154
224
|
<td class="pipeline-table__td">
|
|
155
225
|
<span
|
|
@@ -163,33 +233,62 @@
|
|
|
163
233
|
{row.status}
|
|
164
234
|
</span>
|
|
165
235
|
</td>
|
|
166
|
-
<td class="pipeline-table__td pipeline-table__td--
|
|
167
|
-
|
|
236
|
+
<td class="pipeline-table__td pipeline-table__td--duration">
|
|
237
|
+
{formatMicroseconds(row.executionTimeUs) ?? '—'}
|
|
238
|
+
</td>
|
|
239
|
+
<td class="pipeline-table__td pipeline-table__td--id" title={row.nodeId}
|
|
240
|
+
>{row.nodeId}</td
|
|
168
241
|
>
|
|
169
242
|
</tr>
|
|
170
243
|
{#if expanded && expandable}
|
|
171
244
|
<tr class="pipeline-table__detail-row">
|
|
172
|
-
<td colspan="
|
|
245
|
+
<td colspan="6" class="pipeline-table__detail-cell">
|
|
173
246
|
<dl class="pipeline-table__details">
|
|
174
|
-
{#if row.
|
|
247
|
+
{#if row.started}
|
|
248
|
+
<div class="pipeline-table__detail-item">
|
|
249
|
+
<dt>Started</dt>
|
|
250
|
+
<dd>{formatDateTime(row.started)}</dd>
|
|
251
|
+
</div>
|
|
252
|
+
{/if}
|
|
253
|
+
{#if row.completed}
|
|
175
254
|
<div class="pipeline-table__detail-item">
|
|
176
|
-
<dt>
|
|
177
|
-
<dd>{formatDateTime(row.
|
|
255
|
+
<dt>Completed</dt>
|
|
256
|
+
<dd>{formatDateTime(row.completed)}</dd>
|
|
178
257
|
</div>
|
|
179
258
|
{/if}
|
|
180
|
-
{#if row.
|
|
259
|
+
{#if row.executionTimeUs != null}
|
|
181
260
|
<div class="pipeline-table__detail-item">
|
|
182
261
|
<dt>Duration</dt>
|
|
183
|
-
<dd>{
|
|
262
|
+
<dd>{formatMicroseconds(row.executionTimeUs)}</dd>
|
|
184
263
|
</div>
|
|
185
264
|
{/if}
|
|
186
|
-
{#if row.
|
|
265
|
+
{#if row.retryCount != null && row.retryCount > 0}
|
|
266
|
+
<div class="pipeline-table__detail-item">
|
|
267
|
+
<dt>Retries</dt>
|
|
268
|
+
<dd>
|
|
269
|
+
{row.retryCount}{row.maxRetries != null ? ` / ${row.maxRetries}` : ''}
|
|
270
|
+
</dd>
|
|
271
|
+
</div>
|
|
272
|
+
{/if}
|
|
273
|
+
{#if row.error}
|
|
187
274
|
<div class="pipeline-table__detail-item pipeline-table__detail-item--error">
|
|
188
275
|
<dt>Error</dt>
|
|
189
|
-
<dd>{row.
|
|
276
|
+
<dd>{row.error}</dd>
|
|
190
277
|
</div>
|
|
191
278
|
{/if}
|
|
192
279
|
</dl>
|
|
280
|
+
{#if hasData(row.inputData)}
|
|
281
|
+
<details class="pipeline-table__data">
|
|
282
|
+
<summary class="pipeline-table__data-summary">Input data</summary>
|
|
283
|
+
<pre class="pipeline-table__data-pre">{formatJson(row.inputData)}</pre>
|
|
284
|
+
</details>
|
|
285
|
+
{/if}
|
|
286
|
+
{#if hasData(row.outputData)}
|
|
287
|
+
<details class="pipeline-table__data">
|
|
288
|
+
<summary class="pipeline-table__data-summary">Output data</summary>
|
|
289
|
+
<pre class="pipeline-table__data-pre">{formatJson(row.outputData)}</pre>
|
|
290
|
+
</details>
|
|
291
|
+
{/if}
|
|
193
292
|
</td>
|
|
194
293
|
</tr>
|
|
195
294
|
{/if}
|
|
@@ -270,6 +369,19 @@
|
|
|
270
369
|
font-family: var(--fd-font-mono, monospace);
|
|
271
370
|
}
|
|
272
371
|
|
|
372
|
+
.pipeline-table__th--duration,
|
|
373
|
+
.pipeline-table__td--duration {
|
|
374
|
+
text-align: right;
|
|
375
|
+
white-space: nowrap;
|
|
376
|
+
font-variant-numeric: tabular-nums;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.pipeline-table__td--duration {
|
|
380
|
+
font-family: var(--fd-font-mono, monospace);
|
|
381
|
+
font-size: var(--fd-text-2xs);
|
|
382
|
+
color: var(--fd-muted-foreground);
|
|
383
|
+
}
|
|
384
|
+
|
|
273
385
|
.pipeline-table__th--expand {
|
|
274
386
|
width: 1.5rem;
|
|
275
387
|
padding-right: 0;
|
|
@@ -375,6 +487,38 @@
|
|
|
375
487
|
font-size: var(--fd-text-2xs);
|
|
376
488
|
}
|
|
377
489
|
|
|
490
|
+
.pipeline-table__data {
|
|
491
|
+
margin-top: var(--fd-space-sm);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.pipeline-table__data-summary {
|
|
495
|
+
cursor: pointer;
|
|
496
|
+
font-size: var(--fd-text-2xs);
|
|
497
|
+
font-weight: 600;
|
|
498
|
+
text-transform: uppercase;
|
|
499
|
+
letter-spacing: 0.05em;
|
|
500
|
+
color: var(--fd-muted-foreground);
|
|
501
|
+
user-select: none;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
.pipeline-table__data-summary:hover {
|
|
505
|
+
color: var(--fd-foreground);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.pipeline-table__data-pre {
|
|
509
|
+
margin: var(--fd-space-2xs) 0 0;
|
|
510
|
+
padding: var(--fd-space-sm);
|
|
511
|
+
max-height: 16rem;
|
|
512
|
+
overflow: auto;
|
|
513
|
+
font-family: var(--fd-font-mono, monospace);
|
|
514
|
+
font-size: var(--fd-text-2xs);
|
|
515
|
+
background-color: var(--fd-muted);
|
|
516
|
+
border: 1px solid var(--fd-border);
|
|
517
|
+
border-radius: var(--fd-radius-sm, 4px);
|
|
518
|
+
white-space: pre-wrap;
|
|
519
|
+
word-break: break-word;
|
|
520
|
+
}
|
|
521
|
+
|
|
378
522
|
.pipeline-table__status {
|
|
379
523
|
display: inline-flex;
|
|
380
524
|
align-items: center;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Workflow } from '../../types/index.js';
|
|
2
2
|
import type { EndpointConfig } from '../../config/endpoints.js';
|
|
3
|
+
import type { AuthProvider } from '../../types/auth.js';
|
|
3
4
|
interface Props {
|
|
4
5
|
pipelineId: string;
|
|
5
6
|
workflow: Workflow;
|
|
6
7
|
endpointConfig: EndpointConfig;
|
|
8
|
+
authProvider?: AuthProvider;
|
|
7
9
|
refreshTrigger?: number;
|
|
8
10
|
}
|
|
9
11
|
declare const PipelineTableView: import("svelte").Component<Props, {}, "">;
|