Skip to content

Self-improving AI Employees for everyone

chore: delete dead pre-Wave-11 chat-model node wrappers

trohitg76b6575560fb
diff --git a/client/src/components/ClaudeChatModelNode.tsx b/client/src/components/ClaudeChatModelNode.tsx
deleted file mode 100644
index 6220e061..00000000
--- a/client/src/components/ClaudeChatModelNode.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from 'react';
-import { NodeProps } from 'reactflow';
-import { NodeData } from '../types/NodeTypes';
-import BaseChatModelNode from './base/BaseChatModelNode';
-
-const ClaudeChatModelNode: React.FC<NodeProps<NodeData>> = (props) => {
- return (
- <BaseChatModelNode
- {...props}
- providerId="anthropic"
- displayName="Claude"
- icon="🧠"
- color="#FF6B35"
- />
- );
-};
-
-export default ClaudeChatModelNode;
\ No newline at end of file
diff --git a/client/src/components/GeminiChatModelNode.tsx b/client/src/components/GeminiChatModelNode.tsx
deleted file mode 100644
index 40e32a83..00000000
--- a/client/src/components/GeminiChatModelNode.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from 'react';
-import { NodeProps } from 'reactflow';
-import { NodeData } from '../types/NodeTypes';
-import BaseChatModelNode from './base/BaseChatModelNode';
-
-const GeminiChatModelNode: React.FC<NodeProps<NodeData>> = (props) => {
- return (
- <BaseChatModelNode
- {...props}
- providerId="gemini"
- displayName="Gemini"
- icon="⭐"
- color="#4285F4"
- />
- );
-};
-
-export default GeminiChatModelNode;
\ No newline at end of file
diff --git a/client/src/components/ModelNode.tsx b/client/src/components/ModelNode.tsx
deleted file mode 100644
index 29a5f47d..00000000
--- a/client/src/components/ModelNode.tsx
+++ /dev/null
@@ -1,283 +0,0 @@
-import React, { useMemo } from 'react';
-import { Handle, Position, NodeProps } from 'reactflow';
-import { NodeData } from '../types/NodeTypes';
-import { useAppStore } from '../store/useAppStore';
-import { resolveNodeDescription } from '../lib/nodeSpec';
-import { useWebSocket, useNodeStatus } from '../contexts/WebSocketContext';
-import { useAppTheme } from '../hooks/useAppTheme';
-import { getAIProviderIcon } from './icons/AIProviderIcons';
-
-// Map credential names to provider keys
-const CREDENTIAL_TO_PROVIDER: Record<string, string> = {
- 'openaiApi': 'openai',
- 'anthropicApi': 'anthropic',
- 'googleAiApi': 'gemini',
- 'azureOpenaiApi': 'azure_openai',
- 'cohereApi': 'cohere',
- 'ollamaApi': 'ollama',
- 'mistralApi': 'mistral',
- 'openrouterApi': 'openrouter',
- 'groqApi': 'groq',
- 'cerebrasApi': 'cerebras'
-};
-
-const ModelNode: React.FC<NodeProps<NodeData>> = ({ id, type, data, isConnectable, selected }) => {
- const theme = useAppTheme();
- const { setSelectedNode } = useAppStore();
- const { apiKeyStatuses } = useWebSocket();
-
- // Get execution status from WebSocket
- const nodeStatus = useNodeStatus(id);
- const executionStatus = nodeStatus?.status || 'idle';
- const isExecuting = executionStatus === 'executing' || executionStatus === 'waiting';
-
- // Wave 6 Phase 3e: backend NodeSpec -> legacy fallback
- const definition = resolveNodeDescription(type || '');
-
- // Determine provider from node definition or type
- const provider = useMemo(() => {
- const credentials = definition?.credentials?.[0];
- if (credentials?.name && CREDENTIAL_TO_PROVIDER[credentials.name]) {
- return CREDENTIAL_TO_PROVIDER[credentials.name];
- }
-
- // Fallback: extract provider from node type
- if (type?.includes('deepseek')) return 'deepseek';
- if (type?.includes('kimi')) return 'kimi';
- if (type?.includes('mistral')) return 'mistral';
- if (type?.includes('cerebras')) return 'cerebras';
- if (type?.includes('groq')) return 'groq';
- if (type?.includes('openrouter')) return 'openrouter';
- if (type?.includes('openai')) return 'openai';
- if (type?.includes('claude')) return 'anthropic';
- if (type?.includes('gemini')) return 'gemini';
- if (type?.includes('azure')) return 'azure_openai';
- if (type?.includes('cohere')) return 'cohere';
- if (type?.includes('ollama')) return 'ollama';
-
- return '';
- }, [type, definition?.credentials]);
-
- // Reactive API key status from WebSocket context
- const hasApiKey = useMemo(() => {
- if (!provider) return false;
- const status = apiKeyStatuses[provider];
- return status?.hasKey || false;
- }, [provider, apiKeyStatuses]);
-
- // Memory nodes are always "configured" (they don't need API keys)
- const isMemoryNode = type === 'simpleMemory';
-
- // Get the output handle ID based on node type
- // Memory nodes use 'output-memory' to match their node definition output name
- // Other nodes use 'output-model' for AI model configuration output
- const outputHandleId = isMemoryNode ? 'output-memory' : 'output-model';
-
- // Check if model is configured
- const isConfigured = useMemo(() => {
- // Memory nodes are always ready
- if (isMemoryNode) return true;
- const hasModel = data?.model && data.model.trim() !== '';
- return hasModel && hasApiKey;
- }, [data?.model, hasApiKey, isMemoryNode]);
-
- const handleParametersClick = (e: React.MouseEvent) => {
- e.stopPropagation();
- setSelectedNode({ id, type, data, position: { x: 0, y: 0 } });
- };
-
- const nodeColor = definition?.defaults?.color || '#6b7280';
-
- // Get provider icon/text for circular display
- const getProviderDisplay = (): React.ReactNode => {
- // Try to get official brand icon from @lobehub/icons
- const IconComponent = getAIProviderIcon(provider);
- if (IconComponent) {
- return <IconComponent size={28} />;
- }
-
- // Use the icon from the node definition if available (emoji fallback)
- if (definition?.icon) {
- return <span>{definition.icon}</span>;
- }
-
- // Fallback logic based on node type (emojis for providers without @lobehub/icons)
- if (type?.includes('azure')) return <span>☁️</span>;
- if (type?.includes('cohere')) return <span>🌊</span>;
- if (type?.includes('ollama')) return <span>πŸ¦™</span>;
-
- return <span>AI</span>;
- };
-
- return (
- <div
- style={{
- position: 'relative',
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- fontFamily: 'system-ui, -apple-system, sans-serif',
- fontSize: theme.fontSize.xs,
- cursor: 'pointer',
- }}
- >
- {/* Main Circular Node */}
- <div
- style={{
- position: 'relative',
- width: theme.nodeSize.square,
- height: theme.nodeSize.square,
- borderRadius: '50%',
- background: theme.isDarkMode
- ? `linear-gradient(135deg, ${nodeColor}20 0%, ${theme.colors.backgroundAlt} 100%)`
- : `linear-gradient(145deg, #ffffff 0%, ${nodeColor}10 100%)`,
- border: `2px solid ${isExecuting
- ? (theme.isDarkMode ? theme.dracula.cyan : '#2563eb')
- : selected
- ? theme.colors.focus
- : isConfigured
- ? (theme.isDarkMode ? `${nodeColor}60` : `${nodeColor}50`)
- : theme.dracula.red}`,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- color: theme.colors.text,
- fontSize: type === 'aiAgent' ? theme.fontSize.lg : theme.iconSize.xl,
- fontWeight: theme.fontWeight.semibold,
- transition: theme.transitions.fast,
- boxShadow: isExecuting
- ? theme.isDarkMode
- ? `0 4px 12px ${theme.dracula.cyan}66, 0 0 0 3px ${theme.dracula.cyan}4D`
- : `0 0 0 3px rgba(37, 99, 235, 0.5), 0 4px 16px rgba(37, 99, 235, 0.35)`
- : selected
- ? `0 4px 12px ${theme.colors.focusRing}, 0 0 0 2px ${theme.colors.focusRing}`
- : isConfigured
- ? (theme.isDarkMode
- ? `0 2px 8px ${nodeColor}30`
- : `0 2px 8px ${nodeColor}25, 0 4px 12px rgba(0,0,0,0.06)`)
- : `0 2px 8px ${theme.dracula.red}4D`,
- animation: isExecuting ? 'pulse 1.5s ease-in-out infinite' : 'none',
- }}
- >
-
- {/* AI Text */}
- {getProviderDisplay()}
-
- {/* Parameters Button */}
- <button
- onClick={handleParametersClick}
- style={{
- position: 'absolute',
- top: '-8px',
- right: '-8px',
- width: theme.nodeSize.paramButton,
- height: theme.nodeSize.paramButton,
- borderRadius: '50%',
- backgroundColor: theme.isDarkMode ? theme.colors.backgroundAlt : '#ffffff',
- border: `1px solid ${theme.isDarkMode ? theme.colors.border : `${nodeColor}40`}`,
- cursor: 'pointer',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- fontSize: theme.fontSize.xs,
- color: theme.colors.textSecondary,
- fontWeight: '400',
- transition: theme.transitions.fast,
- zIndex: 30,
- boxShadow: theme.isDarkMode
- ? `0 1px 3px ${theme.colors.shadow}`
- : `0 1px 4px ${nodeColor}20`
- }}
- title="Edit Model Parameters"
- >
- βš™οΈ
- </button>
-
- {/* Configuration Status Indicator */}
- <div
- style={{
- position: 'absolute',
- top: '-4px',
- left: '-4px',
- width: theme.nodeSize.statusIndicator,
- height: theme.nodeSize.statusIndicator,
- borderRadius: '50%',
- backgroundColor: isExecuting
- ? theme.dracula.cyan
- : executionStatus === 'success'
- ? theme.dracula.green
- : executionStatus === 'error'
- ? theme.dracula.red
- : isConfigured
- ? theme.dracula.green
- : hasApiKey
- ? theme.dracula.orange
- : theme.dracula.red,
- border: `2px solid ${theme.isDarkMode ? theme.colors.background : '#ffffff'}`,
- boxShadow: isExecuting
- ? theme.isDarkMode
- ? `0 0 6px ${theme.dracula.cyan}80`
- : '0 0 4px rgba(37, 99, 235, 0.5)'
- : theme.isDarkMode
- ? `0 1px 3px ${theme.colors.shadow}`
- : '0 1px 3px rgba(0,0,0,0.15)',
- zIndex: 30,
- animation: isExecuting ? 'pulse 1s ease-in-out infinite' : 'none',
- }}
- title={
- isExecuting
- ? 'Executing...'
- : isMemoryNode
- ? 'Memory node ready'
- : isConfigured
- ? 'Model configured and ready'
- : hasApiKey
- ? 'API key found, model needs configuration'
- : 'API key required'
- }
- />
-
- {/* Diamond Output Handle */}
- <Handle
- id={outputHandleId}
- type="source"
- position={Position.Top}
- isConnectable={isConnectable && isConfigured}
- style={{
- position: 'absolute',
- top: '-6px',
- left: '50%',
- transform: 'translateX(-50%) rotate(45deg)',
- width: theme.nodeSize.statusIndicator,
- height: theme.nodeSize.statusIndicator,
- backgroundColor: isConfigured ? theme.dracula.cyan : theme.colors.textMuted,
- border: `2px solid ${theme.isDarkMode ? theme.colors.backgroundAlt : '#ffffff'}`,
- borderRadius: '0',
- opacity: isConfigured ? 1 : 0.6,
- zIndex: 20,
- boxShadow: theme.isDarkMode ? 'none' : '0 1px 2px rgba(0,0,0,0.1)'
- }}
- title={isMemoryNode ? 'Memory Output' : isConfigured ? 'Model Configuration Output' : 'Configure model to enable connection'}
- />
- </div>
-
- {/* Model Name Below Circle */}
- <div
- style={{
- marginTop: theme.spacing.sm,
- fontSize: theme.fontSize.sm,
- fontWeight: theme.fontWeight.medium,
- color: theme.colors.text,
- lineHeight: '1.2',
- textAlign: 'center',
- maxWidth: '120px'
- }}
- >
- {data?.label || definition?.displayName}
- </div>
-
- </div>
- );
-};
-
-export default ModelNode;
\ No newline at end of file
diff --git a/client/src/components/OpenAIChatModelNode.tsx b/client/src/components/OpenAIChatModelNode.tsx
deleted file mode 100644
index 40c61c42..00000000
--- a/client/src/components/OpenAIChatModelNode.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import React from 'react';
-import { NodeProps } from 'reactflow';
-import { NodeData } from '../types/NodeTypes';
-import BaseChatModelNode from './base/BaseChatModelNode';
-
-const OpenAIChatModelNode: React.FC<NodeProps<NodeData>> = (props) => {
- return (
- <BaseChatModelNode
- {...props}
- providerId="openai"
- displayName="OpenAI"
- icon="πŸ€–"
- color="#00A67E"
- />
- );
-};
-
-export default OpenAIChatModelNode;
\ No newline at end of file
diff --git a/client/src/components/base/BaseChatModelNode.tsx b/client/src/components/base/BaseChatModelNode.tsx
deleted file mode 100644
index a0c6d246..00000000
--- a/client/src/components/base/BaseChatModelNode.tsx
+++ /dev/null
@@ -1,271 +0,0 @@
-import React, { useState, useEffect } from 'react';
-import { Handle, Position, NodeProps } from 'reactflow';
-import { NodeData } from '../../types/NodeTypes';
-import { useAppStore } from '../../store/useAppStore';
-import { useWebSocket } from '../../contexts/WebSocketContext';
-import { useApiKeys } from '../../hooks/useApiKeys';
-import { useAppTheme } from '../../hooks/useAppTheme';
-
-interface BaseChatModelNodeProps extends NodeProps<NodeData> {
- providerId: string;
- displayName: string;
- icon: string;
- color: string;
-}
-
-const BaseChatModelNode: React.FC<BaseChatModelNodeProps> = ({
- id,
- type,
- data,
- isConnectable,
- selected,
- providerId,
- displayName,
- icon,
- color
-}) => {
- const theme = useAppTheme();
- const { setSelectedNode } = useAppStore();
- const [hasApiKey, setHasApiKey] = useState(false);
- const [isConfigured, setIsConfigured] = useState(false);
- const isDisabled = data?.disabled === true;
-
- // Get node status from WebSocket context
- const { getNodeStatus } = useWebSocket();
- const { getStoredApiKey } = useApiKeys();
- const nodeStatus = getNodeStatus(id);
- const executionStatus = nodeStatus?.status || 'idle';
-
- useEffect(() => {
- const checkConfiguration = async () => {
- try {
- const apiKey = await getStoredApiKey(providerId);
- const hasApiKeyStored = !!apiKey;
- setHasApiKey(hasApiKeyStored);
-
- const hasModel = data?.model && data.model.trim() !== '';
- const configured = hasModel && hasApiKeyStored;
-
- setIsConfigured(configured);
- } catch (error) {
- console.error(`[BaseChatModelNode] ${displayName} ${id}: Configuration check error:`, error);
- setHasApiKey(false);
- setIsConfigured(false);
- }
- };
-
- checkConfiguration();
- }, [data?.model, id, providerId, displayName, getStoredApiKey]);
-
- const handleParametersClick = (e: React.MouseEvent) => {
- e.stopPropagation();
- setSelectedNode({ id, type, data, position: { x: 0, y: 0 } });
- };
-
- // Get status indicator color based on execution state
- const getStatusIndicatorColor = () => {
- switch (executionStatus) {
- case 'executing':
- return theme.dracula.cyan; // Executing
- case 'success':
- return theme.dracula.green; // Success
- case 'error':
- return theme.dracula.red; // Error
- default:
- // Idle - use configuration status
- return isConfigured ? theme.dracula.green : hasApiKey ? theme.dracula.orange : theme.dracula.red;
- }
- };
-
- const getStatusTitle = () => {
- switch (executionStatus) {
- case 'executing':
- return 'Executing...';
- case 'success':
- return 'Execution successful';
- case 'error':
- return `Error: ${nodeStatus?.data?.error || 'Unknown error'}`;
- default:
- return isConfigured
- ? 'Model configured and ready'
- : hasApiKey
- ? 'API key found, model needs configuration'
- : 'API key required';
- }
- };
-
- const isExecuting = executionStatus === 'executing';
-
- return (
- <div
- style={{
- position: 'relative',
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- fontFamily: 'system-ui, -apple-system, sans-serif',
- fontSize: theme.fontSize.xs,
- cursor: 'pointer',
- }}
- >
- {/* Main Circular Node */}
- <div
- style={{
- position: 'relative',
- width: theme.nodeSize.square,
- height: theme.nodeSize.square,
- borderRadius: '50%',
- background: isConfigured ? color : theme.colors.textMuted,
- border: `2px solid ${selected ? theme.colors.focus : isExecuting ? theme.dracula.cyan : isConfigured ? color : theme.dracula.red}`,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- color: 'white',
- fontSize: type === 'aiAgent' ? theme.fontSize.lg : theme.nodeSize.squareIcon,
- fontWeight: theme.fontWeight.semibold,
- transition: theme.transitions.fast,
- boxShadow: selected
- ? `0 4px 12px ${theme.colors.focusRing}, 0 0 0 2px ${theme.colors.focusRing}`
- : isExecuting
- ? `0 4px 12px ${theme.dracula.cyan}66, 0 0 0 3px ${theme.dracula.cyan}4D`
- : isConfigured
- ? `0 2px 8px ${theme.colors.shadow}`
- : `0 2px 8px ${theme.dracula.red}4D`,
- animation: isExecuting ? 'pulse 1.5s ease-in-out infinite' : 'none',
- opacity: isDisabled ? 0.5 : 1,
- }}
- >
- {/* Disabled Overlay */}
- {isDisabled && (
- <div style={{
- position: 'absolute',
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- backgroundColor: 'rgba(128, 128, 128, 0.4)',
- borderRadius: 'inherit',
- zIndex: 35,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- pointerEvents: 'none',
- }}>
- <span style={{ fontSize: '20px', opacity: 0.8, color: theme.colors.textSecondary }}>||</span>
- </div>
- )}
-
- {/* Provider Icon */}
- {icon}
-
- {/* Parameters Button */}
- <button
- onClick={handleParametersClick}
- style={{
- position: 'absolute',
- top: '-8px',
- right: '-8px',
- width: theme.nodeSize.paramButton,
- height: theme.nodeSize.paramButton,
- borderRadius: '50%',
- backgroundColor: theme.colors.backgroundAlt,
- border: `1px solid ${theme.colors.border}`,
- cursor: 'pointer',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- fontSize: theme.fontSize.xs,
- color: theme.colors.textSecondary,
- fontWeight: '400',
- transition: theme.transitions.fast,
- zIndex: 30,
- boxShadow: `0 1px 3px ${theme.colors.shadow}`
- }}
- title="Edit Model Parameters"
- >
- βš™οΈ
- </button>
-
- {/* Configuration/Execution Status Indicator */}
- <div
- style={{
- position: 'absolute',
- top: '-4px',
- left: '-4px',
- width: theme.nodeSize.statusIndicator,
- height: theme.nodeSize.statusIndicator,
- borderRadius: '50%',
- backgroundColor: getStatusIndicatorColor(),
- border: `2px solid ${theme.colors.background}`,
- boxShadow: isExecuting
- ? `0 0 8px ${theme.dracula.cyan}99`
- : `0 1px 3px ${theme.colors.shadow}`,
- zIndex: 30,
- animation: isExecuting ? 'pulse 1s ease-in-out infinite' : 'none',
- }}
- title={getStatusTitle()}
- />
-
- {/* Diamond Output Handle */}
- <Handle
- id="output-model"
- type="source"
- position={Position.Top}
- isConnectable={isConnectable}
- style={{
- position: 'absolute',
- top: '-6px',
- left: '50%',
- transform: 'translateX(-50%) rotate(45deg)',
- width: theme.nodeSize.statusIndicator,
- height: theme.nodeSize.statusIndicator,
- backgroundColor: isConfigured ? color : theme.colors.textMuted,
- border: `2px solid ${theme.colors.background}`,
- borderRadius: '0',
- opacity: isConfigured ? 1 : 0.6,
- zIndex: 20
- }}
- title={isConfigured ? 'Model Configuration Output - Connect to AI Agent' : 'Connect to AI Agent (configure API key and model before running)'}
- />
-
- {/* Diamond Input Handle for Prompt */}
- <Handle
- id="input-prompt"
- type="target"
- position={Position.Bottom}
- isConnectable={isConnectable}
- style={{
- position: 'absolute',
- bottom: '-6px',
- left: '50%',
- transform: 'translateX(-50%) rotate(45deg)',
- width: theme.nodeSize.statusIndicator,
- height: theme.nodeSize.statusIndicator,
- backgroundColor: theme.colors.background,
- border: `2px solid ${theme.colors.textMuted}`,
- borderRadius: '0',
- zIndex: 20
- }}
- title="Prompt Input (optional)"
- />
- </div>
-
- {/* Model Name Below Circle */}
- <div
- style={{
- marginTop: theme.spacing.sm,
- fontSize: theme.fontSize.sm,
- fontWeight: theme.fontWeight.medium,
- color: theme.colors.text,
- lineHeight: '1.2',
- textAlign: 'center',
- maxWidth: '120px'
- }}
- >
- {data?.label || displayName}
- </div>
- </div>
- );
-};
-
-export default BaseChatModelNode;
\ No newline at end of file
diff --git a/client/src/styles/theme.ts b/client/src/styles/theme.ts
index 49403ab3..3ef46d03 100644
--- a/client/src/styles/theme.ts
+++ b/client/src/styles/theme.ts
@@ -256,7 +256,7 @@ export const theme = {
// Node sizes (fixed per industry standard)
nodeSize: {
- square: '60px', // SquareNode, BaseChatModelNode, ModelNode
+ square: '60px', // SquareNode
squareIcon: '28px', // Icon inside square node
toolkitWidth: '120px', // ToolkitNode width (rectangular, wider)
toolkitHeight: '50px', // ToolkitNode height (shorter)