| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  | import { RetryResultPanel } from './retry-log' | 
					
						
							|  |  |  | import { IterationResultPanel } from './iteration-log' | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  | import { LoopResultPanel } from './loop-log' | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  | import { AgentResultPanel } from './agent-log' | 
					
						
							|  |  |  | import type { | 
					
						
							|  |  |  |   AgentLogItemWithChildren, | 
					
						
							|  |  |  |   IterationDurationMap, | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |   LoopDurationMap, | 
					
						
							| 
									
										
										
										
											2025-04-01 16:52:07 +08:00
										 |  |  |   LoopVariableMap, | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |   NodeTracing, | 
					
						
							|  |  |  | } from '@/types/workflow' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export type SpecialResultPanelProps = { | 
					
						
							|  |  |  |   showRetryDetail?: boolean | 
					
						
							|  |  |  |   setShowRetryDetailFalse?: () => void | 
					
						
							|  |  |  |   retryResultList?: NodeTracing[] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   showIteratingDetail?: boolean | 
					
						
							|  |  |  |   setShowIteratingDetailFalse?: () => void | 
					
						
							|  |  |  |   iterationResultList?: NodeTracing[][] | 
					
						
							|  |  |  |   iterationResultDurationMap?: IterationDurationMap | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |   showLoopingDetail?: boolean | 
					
						
							|  |  |  |   setShowLoopingDetailFalse?: () => void | 
					
						
							|  |  |  |   loopResultList?: NodeTracing[][] | 
					
						
							|  |  |  |   loopResultDurationMap?: LoopDurationMap | 
					
						
							| 
									
										
										
										
											2025-04-01 16:52:07 +08:00
										 |  |  |   loopResultVariableMap?: LoopVariableMap | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |   agentOrToolLogItemStack?: AgentLogItemWithChildren[] | 
					
						
							|  |  |  |   agentOrToolLogListMap?: Record<string, AgentLogItemWithChildren[]> | 
					
						
							|  |  |  |   handleShowAgentOrToolLog?: (detail?: AgentLogItemWithChildren) => void | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | const SpecialResultPanel = ({ | 
					
						
							|  |  |  |   showRetryDetail, | 
					
						
							|  |  |  |   setShowRetryDetailFalse, | 
					
						
							|  |  |  |   retryResultList, | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   showIteratingDetail, | 
					
						
							|  |  |  |   setShowIteratingDetailFalse, | 
					
						
							|  |  |  |   iterationResultList, | 
					
						
							|  |  |  |   iterationResultDurationMap, | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |   showLoopingDetail, | 
					
						
							|  |  |  |   setShowLoopingDetailFalse, | 
					
						
							|  |  |  |   loopResultList, | 
					
						
							|  |  |  |   loopResultDurationMap, | 
					
						
							| 
									
										
										
										
											2025-04-01 16:52:07 +08:00
										 |  |  |   loopResultVariableMap, | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |   agentOrToolLogItemStack, | 
					
						
							|  |  |  |   agentOrToolLogListMap, | 
					
						
							|  |  |  |   handleShowAgentOrToolLog, | 
					
						
							|  |  |  | }: SpecialResultPanelProps) => { | 
					
						
							|  |  |  |   return ( | 
					
						
							|  |  |  |     <div onClick={(e) => { | 
					
						
							|  |  |  |       e.stopPropagation() | 
					
						
							|  |  |  |       e.nativeEvent.stopImmediatePropagation() | 
					
						
							|  |  |  |     }}> | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         !!showRetryDetail && !!retryResultList?.length && setShowRetryDetailFalse && ( | 
					
						
							|  |  |  |           <RetryResultPanel | 
					
						
							|  |  |  |             list={retryResultList} | 
					
						
							|  |  |  |             onBack={setShowRetryDetailFalse} | 
					
						
							|  |  |  |           /> | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         showIteratingDetail && !!iterationResultList?.length && setShowIteratingDetailFalse && ( | 
					
						
							|  |  |  |           <IterationResultPanel | 
					
						
							|  |  |  |             list={iterationResultList} | 
					
						
							|  |  |  |             onBack={setShowIteratingDetailFalse} | 
					
						
							|  |  |  |             iterDurationMap={iterationResultDurationMap} | 
					
						
							|  |  |  |           /> | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |       { | 
					
						
							|  |  |  |         showLoopingDetail && !!loopResultList?.length && setShowLoopingDetailFalse && ( | 
					
						
							|  |  |  |           <LoopResultPanel | 
					
						
							|  |  |  |             list={loopResultList} | 
					
						
							|  |  |  |             onBack={setShowLoopingDetailFalse} | 
					
						
							|  |  |  |             loopDurationMap={loopResultDurationMap} | 
					
						
							| 
									
										
										
										
											2025-04-01 16:52:07 +08:00
										 |  |  |             loopVariableMap={loopResultVariableMap} | 
					
						
							| 
									
										
										
										
											2025-03-05 17:41:15 +08:00
										 |  |  |           /> | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2025-02-17 17:05:13 +08:00
										 |  |  |       { | 
					
						
							|  |  |  |         !!agentOrToolLogItemStack?.length && agentOrToolLogListMap && handleShowAgentOrToolLog && ( | 
					
						
							|  |  |  |           <AgentResultPanel | 
					
						
							|  |  |  |             agentOrToolLogItemStack={agentOrToolLogItemStack} | 
					
						
							|  |  |  |             agentOrToolLogListMap={agentOrToolLogListMap} | 
					
						
							|  |  |  |             onShowAgentOrToolLog={handleShowAgentOrToolLog} | 
					
						
							|  |  |  |           /> | 
					
						
							|  |  |  |         ) | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     </div> | 
					
						
							|  |  |  |   ) | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | export default SpecialResultPanel |