import { NodeCollapsible } from '@/components/collapse'; import { IMessageNode } from '@/interfaces/database/agent'; import { cn } from '@/lib/utils'; import { useGetVariableLabelOrTypeByValue } from '@/pages/agent/hooks/use-get-begin-query'; import { Handle, NodeProps, Position } from '@xyflow/react'; import classNames from 'classnames'; import { get } from 'lodash'; import { memo } from 'react'; import { NodeHandleId } from '../../constant'; import { LabelCard } from './card'; import { LeftEndHandle } from './handle'; import styles from './index.module.less'; import NodeHeader from './node-header'; import { NodeWrapper } from './node-wrapper'; import { ToolBar } from './toolbar'; import { VariableDisplay } from './variable-display'; function InnerMessageNode({ id, data, selected, isConnectable = true, }: NodeProps) { const messages: string[] = get(data, 'form.content', []); const { getLabel } = useGetVariableLabelOrTypeByValue({ nodeId: id }); return ( {/* v1 Message/Answer nodes are routable: they have a downstream too, so they need a source handle on the right with the "start" id that edges' sourceHandle field references. The original component only rendered a target handle, which silently dropped any edge with this node as the source. */} 0, })} >
{(x, idx) => ( )}
); } export const MessageNode = memo(InnerMessageNode);