feat: last run frontend (#21369)

The frontend of feat: Persist Variables for Enhanced Debugging Workflow (#20699).

Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel
2025-06-24 09:10:30 +08:00
committed by GitHub
parent 10b738a296
commit 1a1bfd4048
122 changed files with 5888 additions and 2061 deletions

View File

@@ -0,0 +1,25 @@
import type { VarInInspect } from '@/types/workflow'
import { VarInInspectType } from '@/types/workflow'
import { VarType } from '../types'
type OutputToVarInInspectParams = {
nodeId: string
name: string
value: any
}
export const outputToVarInInspect = ({
nodeId,
name,
value,
}: OutputToVarInInspectParams): VarInInspect => {
return {
id: `${Date.now()}`, // TODO: wait for api
type: VarInInspectType.node,
name,
description: '',
selector: [nodeId, name],
value_type: VarType.string, // TODO: wait for api or get from node
value,
edited: false,
}
}

View File

@@ -19,7 +19,10 @@ import {
import type { IterationNodeType } from '../nodes/iteration/types'
import type { LoopNodeType } from '../nodes/loop/types'
export const canRunBySingle = (nodeType: BlockEnum) => {
export const canRunBySingle = (nodeType: BlockEnum, isChildNode: boolean) => {
// child node means in iteration or loop. Set value to iteration(or loop) may cause variable not exit problem in backend.
if(isChildNode && nodeType === BlockEnum.Assigner)
return false
return nodeType === BlockEnum.LLM
|| nodeType === BlockEnum.KnowledgeRetrieval
|| nodeType === BlockEnum.Code
@@ -32,6 +35,10 @@ export const canRunBySingle = (nodeType: BlockEnum) => {
|| nodeType === BlockEnum.Agent
|| nodeType === BlockEnum.DocExtractor
|| nodeType === BlockEnum.Loop
|| nodeType === BlockEnum.Start
|| nodeType === BlockEnum.IfElse
|| nodeType === BlockEnum.VariableAggregator
|| nodeType === BlockEnum.Assigner
}
type ConnectedSourceOrTargetNodesChange = {