windmill-components 1.522.0 → 1.531.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/package/components/AIAgentLogViewer.svelte +123 -0
- package/package/components/AIAgentLogViewer.svelte.d.ts +13 -0
- package/package/components/AppConnectInner.svelte +10 -10
- package/package/components/AutoscalingConfigEditor.svelte +76 -2
- package/package/components/Dev.svelte +12 -28
- package/package/components/DiffEditor.svelte +6 -3
- package/package/components/DiffEditor.svelte.d.ts +1 -0
- package/package/components/DisplayResult.svelte +16 -10
- package/package/components/DisplayResult.svelte.d.ts +1 -0
- package/package/components/EditableSchemaForm.svelte +5 -2
- package/package/components/Editor.svelte +26 -8
- package/package/components/Editor.svelte.d.ts +1 -1
- package/package/components/EditorBar.svelte +25 -5
- package/package/components/EditorSettings.svelte +6 -0
- package/package/components/FirstStepInputs.svelte +2 -2
- package/package/components/FlowBuilder.svelte +18 -36
- package/package/components/FlowGraphViewerStep.svelte +7 -0
- package/package/components/FlowJobResult.svelte +15 -63
- package/package/components/FlowJobResult.svelte.d.ts +10 -4
- package/package/components/FlowLogViewer.svelte +660 -0
- package/package/components/FlowLogViewer.svelte.d.ts +34 -0
- package/package/components/FlowLogViewerWrapper.svelte +52 -0
- package/package/components/FlowLogViewerWrapper.svelte.d.ts +21 -0
- package/package/components/FlowLoopIterationPreview.svelte +3 -3
- package/package/components/FlowPreviewContent.svelte +4 -5
- package/package/components/FlowPreviewContent.svelte.d.ts +7 -7
- package/package/components/FlowPreviewResult.svelte +4 -5
- package/package/components/FlowPreviewResult.svelte.d.ts +3 -5
- package/package/components/FlowStatusViewer.svelte +28 -16
- package/package/components/FlowStatusViewer.svelte.d.ts +19 -27
- package/package/components/FlowStatusViewerInner.svelte +483 -296
- package/package/components/FlowStatusViewerInner.svelte.d.ts +27 -33
- package/package/components/FlowTimeline.svelte +11 -13
- package/package/components/FlowTimeline.svelte.d.ts +6 -5
- package/package/components/HighlightCode.svelte +4 -1
- package/package/components/IconedResourceType.svelte +9 -5
- package/package/components/JobLoader.svelte +61 -8
- package/package/components/JobLoader.svelte.d.ts +9 -1
- package/package/components/LogViewer.svelte +8 -2
- package/package/components/LogViewer.svelte.d.ts +1 -0
- package/package/components/LogViewerHeader.svelte +32 -0
- package/package/components/LogViewerHeader.svelte.d.ts +8 -0
- package/package/components/ModulePreviewForm.svelte +10 -6
- package/package/components/ModulePreviewResultViewer.svelte +16 -0
- package/package/components/ModulePreviewResultViewer.svelte.d.ts +1 -1
- package/package/components/ModuleTest.svelte +59 -16
- package/package/components/RelativeLineNumbers.svelte +16 -0
- package/package/components/RelativeLineNumbers.svelte.d.ts +18 -0
- package/package/components/ResourceEditor.svelte +9 -4
- package/package/components/ScriptBuilder.svelte +13 -11
- package/package/components/ScriptEditor.svelte +2 -2
- package/package/components/SimpleEditor.svelte +10 -4
- package/package/components/SimpleEditor.svelte.d.ts +1 -0
- package/package/components/TemplateEditor.svelte +1 -1
- package/package/components/UserSettings.svelte +4 -4
- package/package/components/apps/components/display/AppAccordionList.svelte +1 -1
- package/package/components/apps/components/display/AppCarouselList.svelte +10 -8
- package/package/components/apps/components/display/AppJobIdFlowStatus.svelte +3 -3
- package/package/components/apps/components/display/table/AppAggridTable.svelte +2 -2
- package/package/components/apps/components/helpers/HiddenComponent.svelte +0 -1
- package/package/components/apps/components/helpers/InputValue.svelte +6 -1
- package/package/components/apps/components/helpers/NonRunnableComponent.svelte +8 -4
- package/package/components/apps/components/helpers/NonRunnableComponent.svelte.d.ts +1 -1
- package/package/components/apps/components/helpers/RunnableComponent.svelte +7 -8
- package/package/components/apps/components/helpers/RunnableComponent.svelte.d.ts +1 -1
- package/package/components/apps/components/helpers/RunnableWrapper.svelte +12 -3
- package/package/components/apps/components/helpers/RunnableWrapper.svelte.d.ts +1 -1
- package/package/components/apps/components/inputs/AppCodeInputComponent.svelte +0 -5
- package/package/components/apps/components/layout/AppConditionalWrapper.svelte +1 -1
- package/package/components/apps/components/layout/AppContainer.svelte +1 -1
- package/package/components/apps/components/layout/AppDecisionTree.svelte +31 -20
- package/package/components/apps/components/layout/AppDrawer.svelte +1 -1
- package/package/components/apps/components/layout/AppList.svelte +9 -8
- package/package/components/apps/components/layout/AppModal.svelte +1 -1
- package/package/components/apps/components/layout/AppSplitpanes.svelte +5 -2
- package/package/components/apps/components/layout/AppStepper.svelte +9 -5
- package/package/components/apps/components/layout/AppTabs.svelte +2 -2
- package/package/components/apps/editor/AppJobsDrawer.svelte +2 -2
- package/package/components/apps/editor/GridEditor.svelte +24 -19
- package/package/components/apps/editor/GridEditor.svelte.d.ts +4 -1
- package/package/components/apps/editor/GridViewer.svelte +1 -1
- package/package/components/apps/editor/SubGridEditor.svelte +7 -11
- package/package/components/apps/editor/SubGridEditor.svelte.d.ts +3 -19
- package/package/components/apps/editor/appUtils.js +17 -68
- package/package/components/apps/editor/component/ComponentInner.svelte +845 -694
- package/package/components/apps/editor/component/componentCallbacks.svelte.js +8 -1
- package/package/components/apps/editor/contextPanel/components/OutputHeader.svelte +9 -46
- package/package/components/apps/editor/settingsPanel/DecisionTreeGraphEditor.svelte +29 -43
- package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte +2 -1
- package/package/components/apps/editor/settingsPanel/InputsSpecEditor.svelte.d.ts +1 -0
- package/package/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte +2 -2
- package/package/components/apps/editor/settingsPanel/inputEditor/EvalV2InputEditor.svelte.d.ts +1 -0
- package/package/components/apps/svelte-grid/Grid.svelte +23 -25
- package/package/components/apps/svelte-grid/Grid.svelte.d.ts +21 -9
- package/package/components/apps/svelte-grid/MoveResize.svelte +13 -15
- package/package/components/apps/svelte-grid/MoveResize.svelte.d.ts +17 -24
- package/package/components/apps/utils.d.ts +2 -0
- package/package/components/apps/utils.js +22 -0
- package/package/components/auditLogs/AuditLogsFilters.svelte.d.ts +1 -1
- package/package/components/common/fileDownload/FileDownload.svelte +1 -3
- package/package/components/common/fileDownload/FileDownload.svelte.d.ts +4 -18
- package/package/components/common/languageIcons/LanguageIcon.svelte +5 -2
- package/package/components/copilot/FlowInlineScriptAIButton.svelte +58 -0
- package/package/components/copilot/FlowInlineScriptAIButton.svelte.d.ts +3 -0
- package/package/components/copilot/MetadataGen.svelte +19 -1
- package/package/components/copilot/MetadataGen.svelte.d.ts +1 -1
- package/package/components/copilot/ScriptGen.svelte +23 -31
- package/package/components/copilot/ScriptGen.svelte.d.ts +0 -1
- package/package/components/copilot/autocomplete/Autocompletor.js +2 -0
- package/package/components/copilot/chat/AIChatDisplay.svelte +4 -4
- package/package/components/copilot/chat/AIChatInput.svelte +29 -6
- package/package/components/copilot/chat/AIChatManager.svelte.js +110 -26
- package/package/components/copilot/chat/AIChatMessage.svelte +3 -0
- package/package/components/copilot/chat/ToolContentDisplay.svelte +84 -0
- package/package/components/copilot/chat/ToolContentDisplay.svelte.d.ts +11 -0
- package/package/components/copilot/chat/ToolExecutionDisplay.svelte +105 -0
- package/package/components/copilot/chat/ToolExecutionDisplay.svelte.d.ts +7 -0
- package/package/components/copilot/chat/api/apiTools.d.ts +7 -0
- package/package/components/copilot/chat/api/apiTools.js +192 -0
- package/package/components/copilot/chat/api/core.d.ts +7 -0
- package/package/components/copilot/chat/api/core.js +61 -0
- package/package/components/copilot/chat/flow/FlowAIChat.svelte +4 -6
- package/package/components/copilot/chat/flow/core.js +213 -42
- package/package/components/copilot/chat/flow/utils.js +3 -0
- package/package/components/copilot/chat/monaco-adapter.d.ts +1 -1
- package/package/components/copilot/chat/monaco-adapter.js +10 -4
- package/package/components/copilot/chat/navigator/core.d.ts +1 -1
- package/package/components/copilot/chat/navigator/core.js +20 -22
- package/package/components/copilot/chat/script/core.d.ts +11 -3
- package/package/components/copilot/chat/script/core.js +92 -15
- package/package/components/copilot/chat/shared.d.ts +30 -3
- package/package/components/copilot/chat/shared.js +228 -9
- package/package/components/copilot/lib.d.ts +1 -1
- package/package/components/copilot/lib.js +15 -6
- package/package/components/custom_ui.d.ts +2 -0
- package/package/components/details/DetailPageLayout.svelte +34 -33
- package/package/components/flow_builder.d.ts +1 -2
- package/package/components/flows/FlowEditor.svelte +3 -3
- package/package/components/flows/FlowEditor.svelte.d.ts +7 -6
- package/package/components/flows/common/FlowCard.svelte +2 -2
- package/package/components/flows/common/FlowCard.svelte.d.ts +1 -0
- package/package/components/flows/common/FlowCardHeader.svelte +13 -4
- package/package/components/flows/common/FlowCardHeader.svelte.d.ts +1 -0
- package/package/components/flows/content/BranchPredicateEditor.svelte +4 -7
- package/package/components/flows/content/BranchPredicateEditor.svelte.d.ts +12 -11
- package/package/components/flows/content/FlowConstants.svelte +3 -3
- package/package/components/flows/content/FlowEditorPanel.svelte +3 -3
- package/package/components/flows/content/FlowEditorPanel.svelte.d.ts +2 -4
- package/package/components/flows/content/FlowInputsQuick.svelte +2 -1
- package/package/components/flows/content/FlowLoop.svelte +2 -2
- package/package/components/flows/content/FlowModuleComponent.svelte +130 -108
- package/package/components/flows/content/FlowModuleComponent.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowModuleEarlyStop.svelte +2 -2
- package/package/components/flows/content/FlowModuleSkip.svelte +1 -1
- package/package/components/flows/content/FlowModuleSleep.svelte +1 -1
- package/package/components/flows/content/FlowModuleSuspend.svelte +1 -1
- package/package/components/flows/content/FlowModuleWrapper.svelte +15 -5
- package/package/components/flows/content/FlowModuleWrapper.svelte.d.ts +1 -0
- package/package/components/flows/content/FlowResult.svelte +2 -3
- package/package/components/flows/content/FlowResult.svelte.d.ts +2 -4
- package/package/components/flows/content/FlowWhileLoop.svelte +1 -1
- package/package/components/flows/dfs.d.ts +3 -1
- package/package/components/flows/dfs.js +5 -1
- package/package/components/flows/flowInfers.js +78 -0
- package/package/components/flows/flowState.d.ts +2 -3
- package/package/components/flows/flowState.js +2 -2
- package/package/components/flows/flowStateUtils.svelte.d.ts +4 -4
- package/package/components/flows/flowStateUtils.svelte.js +14 -13
- package/package/components/flows/flowStore.d.ts +3 -4
- package/package/components/flows/header/FlowPreviewButtons.svelte +2 -1
- package/package/components/flows/header/FlowYamlEditor.svelte +10 -1
- package/package/components/flows/map/FlowGraphPreviewButton.svelte +1 -1
- package/package/components/flows/map/FlowJobsMenu.svelte +7 -3
- package/package/components/flows/map/FlowJobsMenu.svelte.d.ts +1 -0
- package/package/components/flows/map/FlowModuleSchemaItem.svelte +12 -12
- package/package/components/flows/map/FlowModuleSchemaMap.svelte +26 -19
- package/package/components/flows/map/FlowModuleSchemaMap.svelte.d.ts +6 -4
- package/package/components/flows/map/InsertModuleInner.svelte +9 -1
- package/package/components/flows/map/InsertModuleInner.svelte.d.ts +1 -0
- package/package/components/flows/map/MapItem.svelte +4 -2
- package/package/components/flows/pickers/TopLevelNode.svelte +4 -1
- package/package/components/flows/propPicker/InputPickerInner.svelte +5 -4
- package/package/components/flows/propPicker/OutputBadge.svelte +11 -9
- package/package/components/flows/propPicker/OutputPickerInner.svelte +10 -1
- package/package/components/flows/propPicker/OutputPickerInner.svelte.d.ts +1 -1
- package/package/components/flows/testSteps.svelte.d.ts +3 -2
- package/package/components/flows/testSteps.svelte.js +26 -23
- package/package/components/flows/types.d.ts +1 -1
- package/package/components/flows/utils.d.ts +3 -5
- package/package/components/flows/utils.js +3 -4
- package/package/components/git_sync/GitSyncContext.svelte.js +2 -1
- package/package/components/graph/FlowGraphV2.svelte +44 -24
- package/package/components/graph/FlowGraphV2.svelte.d.ts +5 -2
- package/package/components/graph/graphBuilder.svelte.d.ts +49 -17
- package/package/components/graph/graphBuilder.svelte.js +30 -14
- package/package/components/graph/model.d.ts +9 -6
- package/package/components/graph/renderers/edges/BaseEdge.svelte +3 -3
- package/package/components/graph/renderers/edges/BaseEdge.svelte.d.ts +2 -3
- package/package/components/graph/renderers/nodes/AIToolNode.svelte +234 -0
- package/package/components/graph/renderers/nodes/AIToolNode.svelte.d.ts +24 -0
- package/package/components/graph/renderers/nodes/AssetNode.svelte +15 -10
- package/package/components/graph/renderers/nodes/AssetNode.svelte.d.ts +18 -1
- package/package/components/graph/renderers/nodes/BranchAllEndNode.svelte +1 -1
- package/package/components/graph/renderers/nodes/BranchAllStart.svelte +1 -1
- package/package/components/graph/renderers/nodes/BranchOneStart.svelte +1 -1
- package/package/components/graph/renderers/nodes/ForLoopEndNode.svelte +2 -2
- package/package/components/graph/renderers/nodes/ForLoopStartNode.svelte +1 -1
- package/package/components/graph/renderers/nodes/ModuleNode.svelte +21 -21
- package/package/components/graph/renderers/nodes/NewAIToolNode.svelte +64 -0
- package/package/components/graph/renderers/nodes/NewAIToolNode.svelte.d.ts +7 -0
- package/package/components/graph/renderers/nodes/branchOneEndNode.svelte +1 -1
- package/package/components/icons/RubyIcon.svelte +656 -0
- package/package/components/icons/RubyIcon.svelte.d.ts +7 -0
- package/package/components/instanceSettings.js +9 -0
- package/package/components/modulesTest.svelte.d.ts +6 -3
- package/package/components/modulesTest.svelte.js +32 -0
- package/package/components/preview/FlowPreviewStatus.svelte +3 -1
- package/package/components/raw_apps/RawAppEditor.svelte +27 -26
- package/package/components/raw_apps/RawAppEditor.svelte.d.ts +17 -17
- package/package/components/runs/{JobPreview.svelte → JobRunsPreview.svelte} +1 -4
- package/package/components/runs/{JobPreview.svelte.d.ts → JobRunsPreview.svelte.d.ts} +3 -3
- package/package/components/runs/RunRow.svelte +5 -1
- package/package/components/schema/AddProperty.svelte +41 -36
- package/package/components/schema/AddProperty.svelte.d.ts +2 -2
- package/package/components/schema/AddPropertyV2.svelte +41 -37
- package/package/components/schema/AddPropertyV2.svelte.d.ts +1 -1
- package/package/components/schema/FlowPropertyEditor.svelte +8 -6
- package/package/components/search/RunsSearch.svelte +1 -1
- package/package/components/settings/CreateToken.svelte +132 -12
- package/package/components/settings/CreateToken.svelte.d.ts +3 -20
- package/package/components/settings/TokenDisplay.svelte +18 -42
- package/package/components/settings/TokenDisplay.svelte.d.ts +0 -1
- package/package/components/settings/TokensTable.svelte +2 -4
- package/package/components/settings/TokensTable.svelte.d.ts +3 -19
- package/package/components/settings/WorkspaceUserSettings.svelte +428 -69
- package/package/components/sidebar/MenuButton.svelte +12 -10
- package/package/components/stepHistoryLoader.svelte.d.ts +2 -2
- package/package/components/stepHistoryLoader.svelte.js +7 -12
- package/package/components/triggers/http/OpenAPISpecGenerator.svelte +2 -2
- package/package/components/tutorials/FlowBuilderTutorialBranchOne.svelte +1 -1
- package/package/components/tutorials/FlowBuilderTutorialForLoop.svelte +4 -4
- package/package/components/tutorials/utils.js +3 -0
- package/package/components/worker_group.d.ts +4 -1
- package/package/components/worker_group.js +3 -2
- package/package/editorLangUtils.d.ts +1 -1
- package/package/editorLangUtils.js +2 -0
- package/package/editorUtils.d.ts +2 -1
- package/package/editorUtils.js +2 -1
- package/package/gen/core/OpenAPI.js +1 -1
- package/package/gen/schemas.gen.d.ts +296 -8
- package/package/gen/schemas.gen.js +364 -70
- package/package/gen/services.gen.d.ts +118 -16
- package/package/gen/services.gen.js +226 -19
- package/package/gen/types.gen.d.ts +660 -16
- package/package/hubPaths.json +7 -4
- package/package/infer.js +10 -1
- package/package/monaco_workers/graphql.worker.bundle.js +144 -110
- package/package/script_helpers.d.ts +3 -0
- package/package/script_helpers.js +58 -3
- package/package/scripts.d.ts +1 -1
- package/package/scripts.js +3 -2
- package/package/stores.d.ts +2 -0
- package/package/stores.js +2 -0
- package/package/svelte5Utils.svelte.d.ts +16 -0
- package/package/svelte5Utils.svelte.js +26 -0
- package/package/utils.d.ts +1 -1
- package/package.json +20 -19
- package/package/components/AllFlowLogs.svelte +0 -31
- package/package/components/AllFlowLogs.svelte.d.ts +0 -8
- package/package/components/copilot/chat/navigator/apiTools.d.ts +0 -68
- package/package/components/copilot/chat/navigator/apiTools.js +0 -258
|
@@ -0,0 +1,660 @@
|
|
|
1
|
+
<script lang="ts">import { ChevronDown, ChevronRight, GitBranch, Repeat, Code, ArrowDownToLine, ArrowDownFromLine, FoldVertical, UnfoldVertical } from 'lucide-svelte';
|
|
2
|
+
import { base } from '../base';
|
|
3
|
+
import { workspaceStore } from '../stores';
|
|
4
|
+
import { truncateRev } from '../utils';
|
|
5
|
+
import ObjectViewer from './propertyPicker/ObjectViewer.svelte';
|
|
6
|
+
import LogViewer from './LogViewer.svelte';
|
|
7
|
+
import FlowLogViewer from './FlowLogViewer.svelte';
|
|
8
|
+
import { twMerge } from 'tailwind-merge';
|
|
9
|
+
import FlowJobsMenu from './flows/map/FlowJobsMenu.svelte';
|
|
10
|
+
import BarsStaggered from './icons/BarsStaggered.svelte';
|
|
11
|
+
let { modules, localModuleStates, rootJob, flowStatus, expandedRows, allExpanded, showResultsInputs, toggleExpanded, toggleExpandAll, workspaceId, render, level = 0, flowId = 'root', onSelectedIteration, getSelectedIteration, flowSummary, mode = 'flow' } = $props();
|
|
12
|
+
function getJobLink(jobId) {
|
|
13
|
+
if (!jobId)
|
|
14
|
+
return '';
|
|
15
|
+
return `${base}/run/${jobId}?workspace=${workspaceId ?? $workspaceStore}`;
|
|
16
|
+
}
|
|
17
|
+
function getStatusColor(status) {
|
|
18
|
+
const statusColors = {
|
|
19
|
+
Success: 'text-green-500',
|
|
20
|
+
Failure: 'text-red-500',
|
|
21
|
+
InProgress: 'text-yellow-500',
|
|
22
|
+
WaitingForPriorSteps: 'text-gray-400',
|
|
23
|
+
WaitingForEvents: 'text-purple-400',
|
|
24
|
+
WaitingForExecutor: 'text-gray-400'
|
|
25
|
+
};
|
|
26
|
+
return status ? statusColors[status] : 'text-gray-400';
|
|
27
|
+
}
|
|
28
|
+
function getFlowStatus(job) {
|
|
29
|
+
if (job.type === 'CompletedJob') {
|
|
30
|
+
return job.success ? 'Success' : 'Failure';
|
|
31
|
+
}
|
|
32
|
+
else if (job.type === 'QueuedJob') {
|
|
33
|
+
return 'InProgress';
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function getStepProgress(job, totalSteps) {
|
|
40
|
+
if (totalSteps === 0)
|
|
41
|
+
return '';
|
|
42
|
+
const stepWord = mode === 'aiagent' ? 'action' : 'step';
|
|
43
|
+
// If flow is completed, show total steps
|
|
44
|
+
if (job.type === 'CompletedJob') {
|
|
45
|
+
return ` (${totalSteps} ${stepWord}${totalSteps === 1 ? '' : 's'})`;
|
|
46
|
+
}
|
|
47
|
+
// If flow is running, use flow_status.step if available (like JobStatus.svelte)
|
|
48
|
+
if (job.type === 'QueuedJob') {
|
|
49
|
+
if (job.flow_status?.step !== undefined) {
|
|
50
|
+
const currentStep = (job.flow_status.step ?? 0) + 1;
|
|
51
|
+
return ` (${stepWord} ${currentStep} of ${totalSteps})`;
|
|
52
|
+
}
|
|
53
|
+
return '';
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
function isExpanded(id, isRunning = false) {
|
|
58
|
+
// If explicitly set in expandedRows, use that value
|
|
59
|
+
// Otherwise, fall back to allExpanded
|
|
60
|
+
return expandedRows[id] ?? (allExpanded || isRunning);
|
|
61
|
+
}
|
|
62
|
+
function hasEmptySubflow(stepId, stepType) {
|
|
63
|
+
const state = localModuleStates[stepId];
|
|
64
|
+
if (!state || !stepType)
|
|
65
|
+
return false;
|
|
66
|
+
return (['forloopflow', 'whileloopflow'].includes(stepType) &&
|
|
67
|
+
(!state.flow_jobs || state.flow_jobs.length === 0));
|
|
68
|
+
}
|
|
69
|
+
// Find all parents of error steps
|
|
70
|
+
function findParentsOfErrors(modules) {
|
|
71
|
+
const parentsWithErrors = new Set();
|
|
72
|
+
function traverseModules(modules, parentId) {
|
|
73
|
+
let hasChildError = false;
|
|
74
|
+
for (const module of modules) {
|
|
75
|
+
let currentEntryHasError = false;
|
|
76
|
+
// Check if this entry has subflows with errors
|
|
77
|
+
if (module.value.type === 'forloopflow' ||
|
|
78
|
+
(module.value.type === 'whileloopflow' && module.value.modules.length > 0)) {
|
|
79
|
+
const subflowHasError = traverseModules(module.value.modules, module.id);
|
|
80
|
+
if (subflowHasError) {
|
|
81
|
+
currentEntryHasError = true;
|
|
82
|
+
parentsWithErrors.add(module.id);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (module.value.type === 'branchone' || module.value.type === 'branchall') {
|
|
86
|
+
if (module.value.branches.length > 0) {
|
|
87
|
+
for (const branch of module.value.branches) {
|
|
88
|
+
const subflowHasError = traverseModules(branch.modules, module.id);
|
|
89
|
+
if (subflowHasError) {
|
|
90
|
+
currentEntryHasError = true;
|
|
91
|
+
parentsWithErrors.add(module.id);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (module.value.type === 'branchone' && module.value.default.length > 0) {
|
|
96
|
+
// Also check default branch
|
|
97
|
+
const subflowHasError = traverseModules(module.value.default, module.id);
|
|
98
|
+
if (subflowHasError) {
|
|
99
|
+
currentEntryHasError = true;
|
|
100
|
+
parentsWithErrors.add(module.id);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// Check if this entry itself has an error (but don't flag it - only its parents)
|
|
105
|
+
const stepStatus = localModuleStates[module.id]?.type;
|
|
106
|
+
if (stepStatus === 'Failure') {
|
|
107
|
+
currentEntryHasError = true;
|
|
108
|
+
// Don't add the entry itself to parentsWithErrors
|
|
109
|
+
}
|
|
110
|
+
// If this entry has an error, mark its parent
|
|
111
|
+
if (currentEntryHasError && parentId) {
|
|
112
|
+
parentsWithErrors.add(parentId);
|
|
113
|
+
hasChildError = true;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return hasChildError;
|
|
117
|
+
}
|
|
118
|
+
traverseModules(modules, flowId);
|
|
119
|
+
return parentsWithErrors;
|
|
120
|
+
}
|
|
121
|
+
// Get flow info for display
|
|
122
|
+
const flowInfo = $derived.by(() => {
|
|
123
|
+
const parentsWithErrors = findParentsOfErrors(modules);
|
|
124
|
+
return {
|
|
125
|
+
jobId: rootJob.id,
|
|
126
|
+
inputs: rootJob.args || {},
|
|
127
|
+
result: rootJob.type === 'CompletedJob' ? rootJob.result : undefined,
|
|
128
|
+
logs: rootJob.logs || '',
|
|
129
|
+
status: rootJob.type,
|
|
130
|
+
label: flowSummary,
|
|
131
|
+
hasErrors: parentsWithErrors.has(flowId),
|
|
132
|
+
parentsWithErrors
|
|
133
|
+
};
|
|
134
|
+
});
|
|
135
|
+
function hasSubflows(module) {
|
|
136
|
+
return (module.value.type === 'forloopflow' ||
|
|
137
|
+
module.value.type === 'whileloopflow' ||
|
|
138
|
+
module.value.type === 'branchall' ||
|
|
139
|
+
module.value.type === 'branchone');
|
|
140
|
+
}
|
|
141
|
+
function getSubflows(module) {
|
|
142
|
+
const subflows = [];
|
|
143
|
+
if (module.value.type === 'forloopflow' || module.value.type === 'whileloopflow') {
|
|
144
|
+
subflows.push({
|
|
145
|
+
modules: module.value.modules,
|
|
146
|
+
label: module.summary || '',
|
|
147
|
+
flowId: `${module.id}-subflow`
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
else if (module.value.type === 'branchall' || module.value.type === 'branchone') {
|
|
151
|
+
// Add all branches
|
|
152
|
+
for (let i = 0; i < module.value.branches.length; i++) {
|
|
153
|
+
const branch = module.value.branches[i];
|
|
154
|
+
subflows.push({
|
|
155
|
+
modules: branch.modules,
|
|
156
|
+
label: branch.summary || `branch ${i + 1}`,
|
|
157
|
+
flowId: `${module.id}-subflow-${i}`
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Add default branch for branchone
|
|
161
|
+
if (module.value.type === 'branchone') {
|
|
162
|
+
subflows.push({
|
|
163
|
+
modules: module.value.default,
|
|
164
|
+
label: 'default',
|
|
165
|
+
flowId: `${module.id}-subflow-default`
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return subflows;
|
|
170
|
+
}
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
{#if render}
|
|
174
|
+
{#if level === 0 && toggleExpandAll}
|
|
175
|
+
<div class="flex justify-end gap-4 items-center p-2 bg-surface-secondary border-b">
|
|
176
|
+
<div class="flex items-center gap-2 whitespace-nowrap">
|
|
177
|
+
<label
|
|
178
|
+
for="showResultsInputs"
|
|
179
|
+
class="text-xs text-tertiary hover:text-primary transition-colors"
|
|
180
|
+
>Show inputs/results</label
|
|
181
|
+
>
|
|
182
|
+
<div class="flex-shrink-0">
|
|
183
|
+
<input
|
|
184
|
+
type="checkbox"
|
|
185
|
+
name="showResultsInputs"
|
|
186
|
+
id="showResultsInputs"
|
|
187
|
+
bind:checked={showResultsInputs}
|
|
188
|
+
class="w-3 h-4 accent-primary -my-1"
|
|
189
|
+
/>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
192
|
+
<button
|
|
193
|
+
onclick={toggleExpandAll}
|
|
194
|
+
class="text-xs text-tertiary hover:text-primary transition-colors flex items-center gap-2 min-w-24 justify-end"
|
|
195
|
+
>
|
|
196
|
+
{allExpanded ? 'Collapse All' : 'Expand All'}
|
|
197
|
+
{#if allExpanded}
|
|
198
|
+
<FoldVertical size={16} />
|
|
199
|
+
{:else}
|
|
200
|
+
<UnfoldVertical size={16} />
|
|
201
|
+
{/if}
|
|
202
|
+
</button>
|
|
203
|
+
</div>
|
|
204
|
+
{/if}
|
|
205
|
+
<ul class="w-full font-mono text-xs bg-surface-secondary list-none">
|
|
206
|
+
<!-- Flow entry -->
|
|
207
|
+
<li class="border-b flex flex-row">
|
|
208
|
+
<div class="py-2 leading-tight align-top">
|
|
209
|
+
{#if level > 0}
|
|
210
|
+
<button
|
|
211
|
+
class="w-4 flex items-center justify-center text-xs text-tertiary hover:text-primary transition-colors"
|
|
212
|
+
onclick={() => toggleExpanded(`flow-${flowId}`)}
|
|
213
|
+
>
|
|
214
|
+
{#if isExpanded(`flow-${flowId}`, rootJob.type === 'QueuedJob')}
|
|
215
|
+
<ChevronDown size={8} />
|
|
216
|
+
{:else}
|
|
217
|
+
<ChevronRight size={8} />
|
|
218
|
+
{/if}
|
|
219
|
+
</button>
|
|
220
|
+
{:else}
|
|
221
|
+
<!-- Root flow - no collapse button, just spacing -->
|
|
222
|
+
<div class="w-4"></div>
|
|
223
|
+
{/if}
|
|
224
|
+
</div>
|
|
225
|
+
<div class="grow min-w-0 leading-tight">
|
|
226
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
227
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
228
|
+
<div
|
|
229
|
+
class={twMerge(
|
|
230
|
+
'py-1 flex items-center justify-between pr-2',
|
|
231
|
+
level > 0 ? 'cursor-pointer' : '',
|
|
232
|
+
rootJob.type === undefined ? 'opacity-50' : ''
|
|
233
|
+
)}
|
|
234
|
+
onclick={level > 0 ? () => toggleExpanded(`flow-${flowId}`) : undefined}
|
|
235
|
+
>
|
|
236
|
+
<div class="flex items-center gap-2 grow min-w-0">
|
|
237
|
+
<!-- Flow icon -->
|
|
238
|
+
{@render flowIcon(level == 0 ? getFlowStatus(rootJob) : flowStatus, flowInfo.hasErrors)}
|
|
239
|
+
|
|
240
|
+
<div class="flex items-center gap-2">
|
|
241
|
+
<span class="text-xs font-mono">
|
|
242
|
+
{mode === 'aiagent' ? 'AI Agent' : level == 0 ? 'Flow' : 'Subflow'}
|
|
243
|
+
{#if flowInfo.label}
|
|
244
|
+
: {flowInfo.label}
|
|
245
|
+
{/if}
|
|
246
|
+
<span class="text-tertiary">{getStepProgress(rootJob, modules.length)}</span>
|
|
247
|
+
</span>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
{#if flowInfo.jobId}
|
|
252
|
+
<a
|
|
253
|
+
href={getJobLink(flowInfo.jobId)}
|
|
254
|
+
class="text-xs text-primary hover:underline font-mono"
|
|
255
|
+
target="_blank"
|
|
256
|
+
rel="noopener noreferrer"
|
|
257
|
+
onclick={(e) => e.stopPropagation()}
|
|
258
|
+
>
|
|
259
|
+
{truncateRev(flowInfo.jobId, 6)}
|
|
260
|
+
</a>
|
|
261
|
+
{/if}
|
|
262
|
+
</div>
|
|
263
|
+
|
|
264
|
+
{#if level === 0 || isExpanded(`flow-${flowId}`, rootJob.type === 'QueuedJob')}
|
|
265
|
+
<div class="mb-2 transition-all duration-200 ease-in-out w-full">
|
|
266
|
+
<!-- Flow logs -->
|
|
267
|
+
{#if flowInfo.logs}
|
|
268
|
+
<LogViewer
|
|
269
|
+
content={flowInfo.logs}
|
|
270
|
+
jobId={flowInfo.jobId}
|
|
271
|
+
isLoading={false}
|
|
272
|
+
small={true}
|
|
273
|
+
download={false}
|
|
274
|
+
noAutoScroll={true}
|
|
275
|
+
tag={undefined}
|
|
276
|
+
noPadding
|
|
277
|
+
wrapperClass="w-full mb-2 pr-2"
|
|
278
|
+
/>
|
|
279
|
+
{/if}
|
|
280
|
+
|
|
281
|
+
<!-- Flow steps - nested as children -->
|
|
282
|
+
<ul class="w-full font-mono text-xs bg-surface-secondary list-none border-l">
|
|
283
|
+
<!-- Flow inputs as first row entry -->
|
|
284
|
+
{#if showResultsInputs && flowInfo.inputs && Object.keys(flowInfo.inputs).length > 0}
|
|
285
|
+
<li class="border-b flex flex-row w-full">
|
|
286
|
+
<div class="py-2 leading-tight align-top">
|
|
287
|
+
<button
|
|
288
|
+
class="w-4 flex items-center justify-center text-xs text-tertiary hover:text-primary transition-colors"
|
|
289
|
+
onclick={() => toggleExpanded(`flow-${flowId}-input`)}
|
|
290
|
+
>
|
|
291
|
+
{#if isExpanded(`flow-${flowId}-input`)}
|
|
292
|
+
<ChevronDown size={8} />
|
|
293
|
+
{:else}
|
|
294
|
+
<ChevronRight size={8} />
|
|
295
|
+
{/if}
|
|
296
|
+
</button>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div class="grow min-w-0 leading-tight">
|
|
300
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
301
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
302
|
+
<div
|
|
303
|
+
class="py-1 flex items-center justify-between pr-2 cursor-pointer"
|
|
304
|
+
onclick={() => toggleExpanded(`flow-${flowId}-input`)}
|
|
305
|
+
>
|
|
306
|
+
<div class="flex items-center gap-2 grow min-w-0">
|
|
307
|
+
<ArrowDownToLine size={10} />
|
|
308
|
+
<span class="text-xs font-mono">Inputs</span>
|
|
309
|
+
</div>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
{#if isExpanded(`flow-${flowId}-input`)}
|
|
313
|
+
<div class="my-1 transition-all duration-200 ease-in-out">
|
|
314
|
+
<div class="pl-4">
|
|
315
|
+
<ObjectViewer json={flowInfo.inputs} pureViewer={true} />
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
{/if}
|
|
319
|
+
</div>
|
|
320
|
+
</li>
|
|
321
|
+
{/if}
|
|
322
|
+
|
|
323
|
+
{#if modules.length > 0}
|
|
324
|
+
{#each modules as module (module.id)}
|
|
325
|
+
{@const isLeafStep = !hasSubflows(module)}
|
|
326
|
+
{@const status = localModuleStates[module.id]?.type}
|
|
327
|
+
{@const isRunning = status === 'InProgress' || status === 'WaitingForExecutor'}
|
|
328
|
+
{@const hasEmptySubflowValue = hasEmptySubflow(module.id, module.value.type)}
|
|
329
|
+
{@const isCollapsible = !hasEmptySubflowValue}
|
|
330
|
+
<li class="border-b flex flex-row">
|
|
331
|
+
<div class="py-2 leading-tight align-top">
|
|
332
|
+
{#if isCollapsible}
|
|
333
|
+
<button
|
|
334
|
+
class="w-4 flex items-center justify-center text-xs text-tertiary hover:text-primary transition-colors"
|
|
335
|
+
onclick={() => toggleExpanded(module.id)}
|
|
336
|
+
>
|
|
337
|
+
{#if isExpanded(module.id, isRunning)}
|
|
338
|
+
<ChevronDown size={8} />
|
|
339
|
+
{:else}
|
|
340
|
+
<ChevronRight size={8} />
|
|
341
|
+
{/if}
|
|
342
|
+
</button>
|
|
343
|
+
{:else}
|
|
344
|
+
<!-- Empty subflow - no collapse button, just spacing -->
|
|
345
|
+
<div class="w-4"></div>
|
|
346
|
+
{/if}
|
|
347
|
+
</div>
|
|
348
|
+
<div class="w-full leading-tight grow min-w-0">
|
|
349
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
350
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
351
|
+
<div
|
|
352
|
+
class={twMerge(
|
|
353
|
+
'py-1 flex items-center justify-between pr-2',
|
|
354
|
+
isCollapsible ? 'cursor-pointer' : '',
|
|
355
|
+
status === 'WaitingForPriorSteps' ||
|
|
356
|
+
status === 'WaitingForEvents' ||
|
|
357
|
+
status === 'WaitingForExecutor' ||
|
|
358
|
+
status === undefined
|
|
359
|
+
? 'opacity-50'
|
|
360
|
+
: ''
|
|
361
|
+
)}
|
|
362
|
+
onclick={isCollapsible ? () => toggleExpanded(module.id) : undefined}
|
|
363
|
+
>
|
|
364
|
+
<div class="flex items-center gap-2 grow min-w-0">
|
|
365
|
+
<!-- Step icon -->
|
|
366
|
+
{@render stepIcon(
|
|
367
|
+
module.value.type,
|
|
368
|
+
status as FlowStatusModule['type'],
|
|
369
|
+
flowInfo.parentsWithErrors.has(module.id)
|
|
370
|
+
)}
|
|
371
|
+
|
|
372
|
+
<div class="flex items-center gap-2">
|
|
373
|
+
<span class="text-xs font-mono">
|
|
374
|
+
<b>
|
|
375
|
+
{mode === 'aiagent'
|
|
376
|
+
? module.summary
|
|
377
|
+
? 'Tool call'
|
|
378
|
+
: 'Message'
|
|
379
|
+
: module.id}
|
|
380
|
+
</b>
|
|
381
|
+
{#if mode === 'flow'}
|
|
382
|
+
{#if module.value.type === 'forloopflow'}
|
|
383
|
+
For loop
|
|
384
|
+
{:else if module.value.type === 'whileloopflow'}
|
|
385
|
+
While loop
|
|
386
|
+
{:else if module.value.type === 'branchall'}
|
|
387
|
+
Branch to all
|
|
388
|
+
{:else if module.value.type === 'branchone'}
|
|
389
|
+
Branch to one
|
|
390
|
+
{:else if module.value.type === 'flow'}
|
|
391
|
+
Subflow
|
|
392
|
+
{:else}
|
|
393
|
+
Step
|
|
394
|
+
{/if}
|
|
395
|
+
{/if}
|
|
396
|
+
{#if module.summary}
|
|
397
|
+
: {module.summary}
|
|
398
|
+
{/if}
|
|
399
|
+
{#if hasEmptySubflowValue}
|
|
400
|
+
<span class="text-tertiary">
|
|
401
|
+
{#if module.value.type === 'forloopflow' || module.value.type === 'whileloopflow'}
|
|
402
|
+
(empty loop)
|
|
403
|
+
{:else if module.value.type === 'branchall' || module.value.type === 'branchone'}
|
|
404
|
+
(no branch)
|
|
405
|
+
{/if}
|
|
406
|
+
</span>
|
|
407
|
+
{/if}
|
|
408
|
+
</span>
|
|
409
|
+
{#if !hasEmptySubflowValue && localModuleStates[module.id]?.flow_jobs && (module.value.type === 'forloopflow' || module.value.type === 'whileloopflow')}
|
|
410
|
+
<span
|
|
411
|
+
class="text-xs font-mono font-medium inline-flex items-center grow min-w-0 -my-2"
|
|
412
|
+
>
|
|
413
|
+
<span onclick={(e) => e.stopPropagation()}>
|
|
414
|
+
<FlowJobsMenu
|
|
415
|
+
moduleId={module.id}
|
|
416
|
+
id={module.id}
|
|
417
|
+
{onSelectedIteration}
|
|
418
|
+
flowJobsSuccess={localModuleStates[module.id]
|
|
419
|
+
?.flow_jobs_success}
|
|
420
|
+
flowJobs={localModuleStates[module.id]?.flow_jobs}
|
|
421
|
+
selected={localModuleStates[module.id]?.selectedForloopIndex ??
|
|
422
|
+
0}
|
|
423
|
+
selectedManually={localModuleStates[module.id]
|
|
424
|
+
?.selectedForLoopSetManually ?? false}
|
|
425
|
+
showIcon={false}
|
|
426
|
+
/>
|
|
427
|
+
</span>
|
|
428
|
+
{#if module.value.type === 'forloopflow'}
|
|
429
|
+
{`/${localModuleStates[module.id]?.iteration_total ?? 0}`}
|
|
430
|
+
{/if}
|
|
431
|
+
</span>
|
|
432
|
+
{/if}
|
|
433
|
+
</div>
|
|
434
|
+
</div>
|
|
435
|
+
|
|
436
|
+
{#if isLeafStep}
|
|
437
|
+
{@const jobId = localModuleStates[module.id]?.job_id}
|
|
438
|
+
{#if jobId}
|
|
439
|
+
<a
|
|
440
|
+
href={getJobLink(jobId ?? '')}
|
|
441
|
+
class="text-xs text-primary hover:underline font-mono"
|
|
442
|
+
target="_blank"
|
|
443
|
+
rel="noopener noreferrer"
|
|
444
|
+
>
|
|
445
|
+
{truncateRev(jobId ?? '', 6)}
|
|
446
|
+
</a>
|
|
447
|
+
{/if}
|
|
448
|
+
{/if}
|
|
449
|
+
</div>
|
|
450
|
+
|
|
451
|
+
{#if isCollapsible && isExpanded(module.id, isRunning)}
|
|
452
|
+
{@const args = localModuleStates[module.id]?.args}
|
|
453
|
+
{@const logs = localModuleStates[module.id]?.logs}
|
|
454
|
+
{@const result = localModuleStates[module.id]?.result}
|
|
455
|
+
{@const jobId = localModuleStates[module.id]?.job_id}
|
|
456
|
+
<div class="my-1 transition-all duration-200 ease-in-out">
|
|
457
|
+
<!-- Show child steps if they exist -->
|
|
458
|
+
{#each getSubflows(module) as subflow}
|
|
459
|
+
{@const subflowJob = {
|
|
460
|
+
id: jobId,
|
|
461
|
+
type:
|
|
462
|
+
localModuleStates[module.id]?.type === 'Failure' ||
|
|
463
|
+
localModuleStates[module.id]?.type === 'Success'
|
|
464
|
+
? 'CompletedJob'
|
|
465
|
+
: ('QueuedJob' as Job['type']),
|
|
466
|
+
logs,
|
|
467
|
+
result,
|
|
468
|
+
args,
|
|
469
|
+
success: localModuleStates[module.id]?.type === 'Success'
|
|
470
|
+
}}
|
|
471
|
+
<div class="border-l mb-2">
|
|
472
|
+
<!-- Recursively render child steps using FlowLogViewer -->
|
|
473
|
+
<FlowLogViewer
|
|
474
|
+
modules={subflow.modules}
|
|
475
|
+
{localModuleStates}
|
|
476
|
+
rootJob={subflowJob}
|
|
477
|
+
flowStatus={localModuleStates[module.id]?.type}
|
|
478
|
+
{expandedRows}
|
|
479
|
+
{allExpanded}
|
|
480
|
+
{showResultsInputs}
|
|
481
|
+
{toggleExpanded}
|
|
482
|
+
toggleExpandAll={undefined}
|
|
483
|
+
{workspaceId}
|
|
484
|
+
{render}
|
|
485
|
+
level={level + 1}
|
|
486
|
+
flowId={subflow.flowId}
|
|
487
|
+
flowSummary={subflow.label}
|
|
488
|
+
{onSelectedIteration}
|
|
489
|
+
{getSelectedIteration}
|
|
490
|
+
/>
|
|
491
|
+
</div>
|
|
492
|
+
{/each}
|
|
493
|
+
<!-- Show input arguments -->
|
|
494
|
+
{#if getSubflows(module).length === 0}
|
|
495
|
+
{#if showResultsInputs && isLeafStep && args && Object.keys(args).length > 0}
|
|
496
|
+
<div class="mb-2">
|
|
497
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
498
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
499
|
+
<div
|
|
500
|
+
class="flex items-center gap-1 cursor-pointer hover:text-primary text-xs font-mono font-medium mb-1"
|
|
501
|
+
onclick={() => toggleExpanded(`${module.id}-input`)}
|
|
502
|
+
>
|
|
503
|
+
{#if isExpanded(`${module.id}-input`)}
|
|
504
|
+
<ChevronDown size={8} />
|
|
505
|
+
{:else}
|
|
506
|
+
<ChevronRight size={8} />
|
|
507
|
+
{/if}
|
|
508
|
+
Input
|
|
509
|
+
</div>
|
|
510
|
+
{#if isExpanded(`${module.id}-input`)}
|
|
511
|
+
<div class="pl-4">
|
|
512
|
+
<ObjectViewer json={args} pureViewer={true} />
|
|
513
|
+
</div>
|
|
514
|
+
{/if}
|
|
515
|
+
</div>
|
|
516
|
+
{/if}
|
|
517
|
+
|
|
518
|
+
<!-- Show logs if they exist -->
|
|
519
|
+
{#if logs}
|
|
520
|
+
<LogViewer
|
|
521
|
+
content={logs}
|
|
522
|
+
jobId={jobId ?? ''}
|
|
523
|
+
isLoading={false}
|
|
524
|
+
small={true}
|
|
525
|
+
download={false}
|
|
526
|
+
noAutoScroll={true}
|
|
527
|
+
tag={undefined}
|
|
528
|
+
noPadding
|
|
529
|
+
wrapperClass="w-full mb-2 pr-2"
|
|
530
|
+
/>
|
|
531
|
+
{:else if jobId && !hasSubflows(module)}
|
|
532
|
+
<div class="mb-2">
|
|
533
|
+
<div class="text-xs text-tertiary font-mono">
|
|
534
|
+
No logs available
|
|
535
|
+
</div>
|
|
536
|
+
</div>
|
|
537
|
+
{/if}
|
|
538
|
+
|
|
539
|
+
<!-- Show result if completed -->
|
|
540
|
+
|
|
541
|
+
{#if showResultsInputs && isLeafStep && result !== undefined && (status === 'Success' || status === 'Failure')}
|
|
542
|
+
<div class="mb-2 mt-2">
|
|
543
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
544
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
545
|
+
<div
|
|
546
|
+
class="flex items-center gap-1 cursor-pointer hover:text-primary text-xs font-mono font-medium mb-1"
|
|
547
|
+
onclick={() => toggleExpanded(`${module.id}-result`)}
|
|
548
|
+
>
|
|
549
|
+
{#if isExpanded(`${module.id}-result`)}
|
|
550
|
+
<ChevronDown size={8} />
|
|
551
|
+
{:else}
|
|
552
|
+
<ChevronRight size={8} />
|
|
553
|
+
{/if}
|
|
554
|
+
Result
|
|
555
|
+
</div>
|
|
556
|
+
{#if isExpanded(`${module.id}-result`)}
|
|
557
|
+
<div class="pl-4">
|
|
558
|
+
<ObjectViewer json={result} pureViewer={true} />
|
|
559
|
+
</div>
|
|
560
|
+
{/if}
|
|
561
|
+
</div>
|
|
562
|
+
{/if}
|
|
563
|
+
{/if}
|
|
564
|
+
</div>
|
|
565
|
+
{/if}
|
|
566
|
+
</div>
|
|
567
|
+
</li>
|
|
568
|
+
{/each}
|
|
569
|
+
{/if}
|
|
570
|
+
|
|
571
|
+
<!-- Flow result as last row entry -->
|
|
572
|
+
{#if showResultsInputs && flowInfo.result !== undefined && rootJob.type === 'CompletedJob'}
|
|
573
|
+
<li class="border-b flex">
|
|
574
|
+
<div class="py-2 leading-tight align-top">
|
|
575
|
+
<button
|
|
576
|
+
class="w-4 flex items-center justify-center text-xs text-tertiary hover:text-primary transition-colors"
|
|
577
|
+
onclick={() => toggleExpanded(`flow-${flowId}-result`)}
|
|
578
|
+
>
|
|
579
|
+
{#if isExpanded(`flow-${flowId}-result`)}
|
|
580
|
+
<ChevronDown size={8} />
|
|
581
|
+
{:else}
|
|
582
|
+
<ChevronRight size={8} />
|
|
583
|
+
{/if}
|
|
584
|
+
</button>
|
|
585
|
+
</div>
|
|
586
|
+
<div class="w-full leading-tight">
|
|
587
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
588
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
589
|
+
<div
|
|
590
|
+
class="py-1 flex items-center justify-between pr-2 cursor-pointer"
|
|
591
|
+
onclick={() => toggleExpanded(`flow-${flowId}-result`)}
|
|
592
|
+
>
|
|
593
|
+
<div class="flex items-center gap-2 grow min-w-0">
|
|
594
|
+
<ArrowDownFromLine size={10} />
|
|
595
|
+
<span class="text-xs font-mono">Results</span>
|
|
596
|
+
</div>
|
|
597
|
+
</div>
|
|
598
|
+
|
|
599
|
+
{#if isExpanded(`flow-${flowId}-result`)}
|
|
600
|
+
<div class="my-1 transition-all duration-200 ease-in-out">
|
|
601
|
+
<div class="pl-4">
|
|
602
|
+
<ObjectViewer json={flowInfo.result} pureViewer={true} />
|
|
603
|
+
</div>
|
|
604
|
+
</div>
|
|
605
|
+
{/if}
|
|
606
|
+
</div>
|
|
607
|
+
</li>
|
|
608
|
+
{/if}
|
|
609
|
+
</ul>
|
|
610
|
+
</div>
|
|
611
|
+
{/if}
|
|
612
|
+
</div>
|
|
613
|
+
</li>
|
|
614
|
+
</ul>
|
|
615
|
+
{/if}
|
|
616
|
+
|
|
617
|
+
{#snippet flowIcon(status: FlowStatusModule['type'] | undefined, hasErrors: boolean)}
|
|
618
|
+
{@const colorClass = getStatusColor(status)}
|
|
619
|
+
<div class="relative flex items-center">
|
|
620
|
+
<BarsStaggered
|
|
621
|
+
size={10}
|
|
622
|
+
class={twMerge(colorClass, status === 'InProgress' ? 'animate-pulse' : '', 'flex-shrink-0')}
|
|
623
|
+
/>
|
|
624
|
+
{#if hasErrors && status !== 'Failure'}
|
|
625
|
+
<span
|
|
626
|
+
class="text-red-500 -ml-0.5 -mr-1.5"
|
|
627
|
+
title="A subflow or a step has failed but failure was skipped">!</span
|
|
628
|
+
>
|
|
629
|
+
{/if}
|
|
630
|
+
</div>
|
|
631
|
+
{/snippet}
|
|
632
|
+
|
|
633
|
+
{#snippet stepIcon(
|
|
634
|
+
stepType: string | undefined,
|
|
635
|
+
status: FlowStatusModule['type'] | undefined,
|
|
636
|
+
hasErrors: boolean
|
|
637
|
+
)}
|
|
638
|
+
{@const colorClass = getStatusColor(status)}
|
|
639
|
+
{@const animationClass = status === 'InProgress' ? 'animate-pulse' : ''}
|
|
640
|
+
{@const classes = `${colorClass} ${animationClass} flex-shrink-0`}
|
|
641
|
+
<div class="relative flex items-center">
|
|
642
|
+
{#if stepType === 'flow'}
|
|
643
|
+
<BarsStaggered size={10} class={classes} />
|
|
644
|
+
{:else if stepType === 'forloopflow' || stepType === 'whileloopflow'}
|
|
645
|
+
<Repeat size={10} class={classes} />
|
|
646
|
+
{:else if stepType === 'branchall' || stepType === 'branchone'}
|
|
647
|
+
<GitBranch size={10} class={classes} />
|
|
648
|
+
{:else}
|
|
649
|
+
<Code strokeWidth={2.5} size={10} class={classes} />
|
|
650
|
+
{/if}
|
|
651
|
+
{#if hasErrors && status !== 'Failure'}
|
|
652
|
+
<span class="text-red-500 -ml-0.5 -mr-1.5" title="A subflow or a step has failed">!</span>
|
|
653
|
+
{/if}
|
|
654
|
+
</div>
|
|
655
|
+
{/snippet}
|
|
656
|
+
|
|
657
|
+
<style>
|
|
658
|
+
.transition-all {
|
|
659
|
+
transition: all 0.2s ease-in-out;
|
|
660
|
+
}</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import FlowLogViewer from './FlowLogViewer.svelte';
|
|
2
|
+
import type { FlowModule, FlowStatusModule, Job } from '../gen';
|
|
3
|
+
import type { GraphModuleState } from './graph/model';
|
|
4
|
+
type RootJobData = Partial<Job>;
|
|
5
|
+
interface Props {
|
|
6
|
+
modules: FlowModule[];
|
|
7
|
+
localModuleStates: Record<string, GraphModuleState>;
|
|
8
|
+
rootJob: RootJobData;
|
|
9
|
+
flowStatus: FlowStatusModule['type'] | undefined;
|
|
10
|
+
expandedRows: Record<string, boolean>;
|
|
11
|
+
allExpanded?: boolean;
|
|
12
|
+
showResultsInputs?: boolean;
|
|
13
|
+
toggleExpanded: (id: string) => void;
|
|
14
|
+
toggleExpandAll?: () => void;
|
|
15
|
+
workspaceId: string | undefined;
|
|
16
|
+
render: boolean;
|
|
17
|
+
level?: number;
|
|
18
|
+
flowId: string;
|
|
19
|
+
onSelectedIteration: (detail: {
|
|
20
|
+
id: string;
|
|
21
|
+
index: number;
|
|
22
|
+
manuallySet: true;
|
|
23
|
+
moduleId: string;
|
|
24
|
+
} | {
|
|
25
|
+
manuallySet: false;
|
|
26
|
+
moduleId: string;
|
|
27
|
+
}) => Promise<void>;
|
|
28
|
+
getSelectedIteration: (stepId: string) => number;
|
|
29
|
+
flowSummary?: string;
|
|
30
|
+
mode?: 'flow' | 'aiagent';
|
|
31
|
+
}
|
|
32
|
+
declare const FlowLogViewer: import("svelte").Component<Props, {}, "">;
|
|
33
|
+
type FlowLogViewer = ReturnType<typeof FlowLogViewer>;
|
|
34
|
+
export default FlowLogViewer;
|