Skip to content

Self-improving AI Employees for everyone

chore(client): delete unreachable modules and correct the docs that described them as live

trohitg25a148bf30e6
diff --git a/CLAUDE.md b/CLAUDE.md
index ac6451d5..dee6ddaa 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -620,7 +620,7 @@ AI model nodes route through `SquareNode` via `Dashboard.tsx`'s `COMPONENT_BY_KI
### Hooks & State
- `src/hooks/useParameterPanel.ts` - Parameter management via WebSocket
-- `src/hooks/useExecution.ts` - Node execution via WebSocket
+- `src/services/executionService.ts` - Node execution via WebSocket (`executeNodeViaWebSocket`)
- `src/hooks/useApiKeys.ts` - API key management via WebSocket
- `src/hooks/useAndroidOperations.ts` - Android device operations via WebSocket
- `src/hooks/useWhatsApp.ts` - WhatsApp operations via WebSocket
@@ -2489,11 +2489,12 @@ Hook for WhatsApp operations via WebSocket:
const { getStatus, getQRCode, sendMessage, startConnection, isLoading, connectionStatus } = useWhatsApp();
```
-### useExecution (`client/src/hooks/useExecution.ts`)
-Hook for node execution via WebSocket:
-```typescript
-const { executeNode, cancelExecution, isExecuting, lastResult } = useExecution();
-```
+### Node execution (`client/src/services/executionService.ts`)
+`ExecutionService.executeNodeViaWebSocket()` is the live path, called from
+[`ParameterPanel.tsx`](./client/src/ParameterPanel.tsx). It delegates to the
+context's `executeNode`, which sizes its request budget from the node's own
+`uiHints.executionTimeoutMs` rather than any local list of "slow" node types.
+(A `useExecution` hook once wrapped this; it was unreachable and was deleted.)
### useApiKeys (`client/src/hooks/useApiKeys.ts`)
Hook for API key management via WebSocket:
@@ -2618,7 +2619,7 @@ This function:
- **AI Architecture**: 5-layer system with factory pattern and secure credential management
- **Android Architecture**: Factory-based node creation with ADB integration for device automation
- **WebSocket-First Architecture**: most frontend-backend RPC (parameters, execution, API keys, Android, WhatsApp, skill operations) goes through WebSocket. Live handler set lives in the `MESSAGE_HANDLERS` dict in `server/routers/websocket.py` plus plugin-registered handlers via `services.ws_handler_registry`.
-- **WebSocket Hooks**: Dedicated React hooks (useWhatsApp, useExecution, useApiKeys, useAndroidOperations, useParameterPanel) for clean component integration
+- **WebSocket Hooks**: Dedicated React hooks (useWhatsApp, useApiKeys, useParameterPanel) for clean component integration; node execution goes through `services/executionService.ts`
- **WebSocket Support**: Persistent remote Android device connections via WebSocket proxy with background tasks
- Connection stays alive across multiple API requests until switched to local ADB
- Background message receiver and keepalive loop (25s interval)
diff --git a/client/src/components/ParameterRenderer.tsx b/client/src/components/ParameterRenderer.tsx
index ea96229b..a58dc6d4 100644
--- a/client/src/components/ParameterRenderer.tsx
+++ b/client/src/components/ParameterRenderer.tsx
@@ -86,9 +86,14 @@ const applySelectChange = (
// aliases below cover renamed-but-still-saved-in-old-workflows types.
const NODE_TYPE_TO_PROVIDER: Record<string, string> = {
...AI_MODEL_PROVIDER_MAP,
- // Legacy aliases for backward compatibility
+ // Legacy aliases: node types that are NOT in the backend registry but may
+ // still sit in an old saved workflow. They cannot execute; this only keeps
+ // the credential lookup sane if someone opens one's panel.
+ //
+ // `googleChatModel` is deliberately absent — `migrateNodes` in
+ // store/useAppStore.ts rewrites it to `geminiChatModel` on load, so the key
+ // could never be reached here.
'claudeChatModel': 'anthropic',
- 'googleChatModel': 'gemini',
'azureChatModel': 'azure_openai',
'cohereChatModel': 'cohere',
};
@@ -1235,11 +1240,6 @@ const ParameterRenderer: React.FC<ParameterRendererProps> = ({
onChange(newValue);
return;
}
- if (parsedData.type === 'nodeOutput') {
- // Handle node output data - use the actual value for direct mapping
- onChange(parsedData.value);
- return;
- }
if (parsedData.type === WORKSPACE_FILE_DRAG_TYPE) {
// Same function the "Choose from workspace" picker calls. WCAG 2.2
// SC 2.5.7 requires the non-drag alternative to operate *the same*
diff --git a/client/src/components/ui/DropCap.tsx b/client/src/components/ui/DropCap.tsx
deleted file mode 100644
index 0e12cac8..00000000
--- a/client/src/components/ui/DropCap.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-/**
- * Wraps content (typically a heading or first paragraph) with the
- * `v-display drop-cap` className so theme CSS rules like the
- * Renaissance `.v-display.drop-cap::first-letter` rule fire on the
- * first letter. Under themes that don't define a drop-cap rule it's a
- * no-op (just two extra class names on the wrapper).
- */
-import React from 'react';
-
-export interface DropCapProps {
- as?: 'h1' | 'h2' | 'h3' | 'p' | 'span' | 'div';
- className?: string;
- children: React.ReactNode;
-}
-
-export const DropCap: React.FC<DropCapProps> = ({
- as: Tag = 'span',
- className = '',
- children,
-}) => {
- return (
- <Tag className={`v-display drop-cap ${className}`.trim()}>
- {children}
- </Tag>
- );
-};
-
-export default DropCap;
diff --git a/client/src/components/ui/popover.tsx b/client/src/components/ui/popover.tsx
deleted file mode 100644
index 824bd746..00000000
--- a/client/src/components/ui/popover.tsx
+++ /dev/null
@@ -1,89 +0,0 @@
-"use client"
-
-import * as React from "react"
-import { Popover as PopoverPrimitive } from "radix-ui"
-
-import { cn } from "@/lib/utils"
-
-function Popover({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Root>) {
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
-}
-
-function PopoverTrigger({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
-}
-
-function PopoverContent({
- className,
- align = "center",
- sideOffset = 4,
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Content>) {
- return (
- <PopoverPrimitive.Portal>
- <PopoverPrimitive.Content
- data-slot="popover-content"
- align={align}
- sideOffset={sideOffset}
- className={cn(
- "z-50 flex w-72 origin-(--radix-popover-content-transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
- className
- )}
- {...props}
- />
- </PopoverPrimitive.Portal>
- )
-}
-
-function PopoverAnchor({
- ...props
-}: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
- return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
-}
-
-function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- data-slot="popover-header"
- className={cn("flex flex-col gap-0.5 text-sm", className)}
- {...props}
- />
- )
-}
-
-function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
- return (
- <div
- data-slot="popover-title"
- className={cn("font-medium", className)}
- {...props}
- />
- )
-}
-
-function PopoverDescription({
- className,
- ...props
-}: React.ComponentProps<"p">) {
- return (
- <p
- data-slot="popover-description"
- className={cn("text-muted-foreground", className)}
- {...props}
- />
- )
-}
-
-export {
- Popover,
- PopoverAnchor,
- PopoverContent,
- PopoverDescription,
- PopoverHeader,
- PopoverTitle,
- PopoverTrigger,
-}
diff --git a/client/src/hooks/useExecution.ts b/client/src/hooks/useExecution.ts
deleted file mode 100644
index 3c1c3cdd..00000000
--- a/client/src/hooks/useExecution.ts
+++ /dev/null
@@ -1,319 +0,0 @@
-/**
- * useExecution Hook - WebSocket-based node execution
- *
- * Provides node execution functionality via WebSocket instead of REST API.
- * This replaces the REST-based ExecutionService for real-time execution.
- */
-
-import { useCallback, useState } from 'react';
-import { Node, Edge } from 'reactflow';
-import { useWebSocket } from '../contexts/WebSocketContext';
-import { INodeExecutionData } from '../types/INodeProperties';
-
-import { resolveNodeDescription } from '../lib/nodeSpec';
-// Execution result interface (compatible with ExecutionService)
-export interface ExecutionResult {
- success: boolean;
- nodeId: string;
- nodeType: string;
- nodeName: string;
- timestamp: string;
- executionTime: number;
- outputs?: Record<string, any>;
- error?: string;
- data?: any;
- nodeData: INodeExecutionData[][];
-}
-
-export interface UseExecutionResult {
- // Execute a node via WebSocket
- executeNode: (
- nodeId: string,
- nodeType: string,
- nodes?: Node[],
- edges?: Edge[]
- ) => Promise<ExecutionResult>;
-
- // Execute AI node via WebSocket
- executeAiNode: (
- nodeId: string,
- nodeType: string,
- parameters: Record<string, any>,
- model: string,
- workflowId: string,
- nodes: Node[],
- edges: Edge[]
- ) => Promise<ExecutionResult>;
-
- // Execution state
- isExecuting: boolean;
- executingNodeId: string | null;
- lastError: string | null;
-
- // Connection status
- isConnected: boolean;
-}
-
-export const useExecution = (): UseExecutionResult => {
- const {
- executeNode: wsExecuteNode,
- executeAiNode: wsExecuteAiNode,
- getNodeParameters,
- isConnected
- } = useWebSocket();
-
- const [isExecuting, setIsExecuting] = useState(false);
- const [executingNodeId, setExecutingNodeId] = useState<string | null>(null);
- const [lastError, setLastError] = useState<string | null>(null);
-
- /**
- * Execute a workflow node via WebSocket
- */
- const executeNode = useCallback(async (
- nodeId: string,
- nodeType: string,
- nodes?: Node[],
- edges?: Edge[]
- ): Promise<ExecutionResult> => {
- const startTime = Date.now();
-
- try {
- console.log(`[WebSocket Execution] Starting: ${nodeId} (type: ${nodeType})`);
-
- setIsExecuting(true);
- setExecutingNodeId(nodeId);
- setLastError(null);
-
- // Load parameters from WebSocket/backend
- const paramsResult = await getNodeParameters(nodeId);
- const parameters = paramsResult?.parameters || {};
-
- console.log(`[WebSocket Execution] Parameters for ${nodeId}:`, parameters);
-
- // Prepare nodes and edges for execution
- const nodeData = nodes?.map(node => ({
- id: node.id,
- type: node.type || '',
- data: node.data || {}
- })) || [];
-
- const edgeData = edges?.map(edge => ({
- id: edge.id,
- source: edge.source,
- target: edge.target,
- sourceHandle: edge.sourceHandle || undefined,
- targetHandle: edge.targetHandle || undefined
- })) || [];
-
- // Execute via WebSocket
- const result = await wsExecuteNode(nodeId, nodeType, parameters, nodeData, edgeData);
-
- console.log(`[WebSocket Execution] Result:`, result);
-
- const executionTime = Date.now() - startTime;
-
- if (result.success) {
- // Extract output data
- const outputData = result.result || {
- nodeId,
- success: true,
- message: 'Execution completed successfully',
- timestamp: result.timestamp || new Date().toISOString()
- };
-
- const nodeExecutionData: INodeExecutionData[][] = [[{
- json: outputData
- }]];
-
- return {
- success: true,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: result.timestamp || new Date().toISOString(),
- executionTime: result.execution_time || executionTime,
- outputs: outputData,
- data: outputData,
- nodeData: nodeExecutionData
- };
- } else {
- // Handle error
- const errorOutputData = result.result || {
- error: result.error,
- nodeId,
- success: false,
- timestamp: result.timestamp || new Date().toISOString()
- };
-
- const errorData: INodeExecutionData[][] = [[{
- json: errorOutputData
- }]];
-
- setLastError(result.error || 'Execution failed');
-
- return {
- success: false,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: result.timestamp || new Date().toISOString(),
- executionTime: result.execution_time || executionTime,
- error: result.error,
- outputs: errorOutputData,
- data: errorOutputData,
- nodeData: errorData
- };
- }
-
- } catch (error: any) {
- console.error(`[WebSocket Execution] Failed for node ${nodeId}:`, error);
-
- const errorMessage = error.message || 'WebSocket execution failed';
- setLastError(errorMessage);
-
- const catchErrorData = {
- error: errorMessage,
- nodeId,
- success: false,
- timestamp: new Date().toISOString()
- };
-
- return {
- success: false,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: new Date().toISOString(),
- executionTime: Date.now() - startTime,
- error: errorMessage,
- outputs: catchErrorData,
- data: catchErrorData,
- nodeData: [[{ json: catchErrorData }]]
- };
-
- } finally {
- setIsExecuting(false);
- setExecutingNodeId(null);
- }
- }, [wsExecuteNode, getNodeParameters]);
-
- /**
- * Execute an AI node via WebSocket
- */
- const executeAiNode = useCallback(async (
- nodeId: string,
- nodeType: string,
- parameters: Record<string, any>,
- model: string,
- workflowId: string,
- nodes: Node[],
- edges: Edge[]
- ): Promise<ExecutionResult> => {
- const startTime = Date.now();
-
- try {
- console.log(`[WebSocket AI Execution] Starting: ${nodeId} (type: ${nodeType}), workflow: ${workflowId}`);
-
- setIsExecuting(true);
- setExecutingNodeId(nodeId);
- setLastError(null);
-
- // Execute AI node via WebSocket with workflow context for tool node glowing
- const result = await wsExecuteAiNode(nodeId, nodeType, parameters, model, workflowId, nodes, edges);
-
- console.log(`[WebSocket AI Execution] Result:`, result);
-
- const executionTime = Date.now() - startTime;
-
- if (result.success) {
- const outputData = result.result || {
- nodeId,
- success: true,
- message: 'AI execution completed successfully',
- timestamp: result.timestamp || new Date().toISOString()
- };
-
- const nodeExecutionData: INodeExecutionData[][] = [[{
- json: outputData
- }]];
-
- return {
- success: true,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: result.timestamp || new Date().toISOString(),
- executionTime: result.execution_time || executionTime,
- outputs: outputData,
- data: outputData,
- nodeData: nodeExecutionData
- };
- } else {
- const errorOutputData = result.result || {
- error: result.error,
- nodeId,
- success: false,
- timestamp: result.timestamp || new Date().toISOString()
- };
-
- const errorData: INodeExecutionData[][] = [[{
- json: errorOutputData
- }]];
-
- setLastError(result.error || 'AI execution failed');
-
- return {
- success: false,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: result.timestamp || new Date().toISOString(),
- executionTime: result.execution_time || executionTime,
- error: result.error,
- outputs: errorOutputData,
- data: errorOutputData,
- nodeData: errorData
- };
- }
-
- } catch (error: any) {
- console.error(`[WebSocket AI Execution] Failed for node ${nodeId}:`, error);
-
- const errorMessage = error.message || 'WebSocket AI execution failed';
- setLastError(errorMessage);
-
- const catchErrorData = {
- error: errorMessage,
- nodeId,
- success: false,
- timestamp: new Date().toISOString()
- };
-
- return {
- success: false,
- nodeId,
- nodeType,
- nodeName: resolveNodeDescription(nodeType)?.displayName || nodeType,
- timestamp: new Date().toISOString(),
- executionTime: Date.now() - startTime,
- error: errorMessage,
- outputs: catchErrorData,
- data: catchErrorData,
- nodeData: [[{ json: catchErrorData }]]
- };
-
- } finally {
- setIsExecuting(false);
- setExecutingNodeId(null);
- }
- }, [wsExecuteAiNode]);
-
- return {
- executeNode,
- executeAiNode,
- isExecuting,
- executingNodeId,
- lastError,
- isConnected
- };
-};
diff --git a/client/src/styles/zIndex.ts b/client/src/styles/zIndex.ts
deleted file mode 100644
index 1df5a1da..00000000
--- a/client/src/styles/zIndex.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-// Centralized z-index management to prevent conflicts
-export const zIndex = {
- base: 0,
- dropdown: 1000,
- sticky: 1020,
- fixed: 1030,
- modalBackdrop: 1040,
- modal: 1050,
- popover: 1060,
- tooltip: 1070,
- // Specific application layers
- parameterPanel: 1100,
- locationPanel: 1200,
- aiConfigPanel: 1300,
- // Maximum z-index for critical overlays
- alert: 9999
-} as const;
\ No newline at end of file
diff --git a/client/src/utils/nodeUtils.ts b/client/src/utils/nodeUtils.ts
deleted file mode 100644
index 8bade4b1..00000000
--- a/client/src/utils/nodeUtils.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-// Utility functions for node operations
-
-// Generate short node name from nodeType for parameter references
-export const getShortNodeName = (nodeType: string): string => {
- const typeMap: { [key: string]: string } = {
- // AI Chat Models
- 'openaiChatModel': 'openai',
- 'anthropicChatModel': 'claude',
- 'geminiChatModel': 'gemini',
- // AI Agents
- 'aiAgent': 'ai',
- // Location Services
- 'gmaps_create': 'map',
- 'gmaps_locations': 'location',
- 'gmaps_nearby_places': 'places'
- };
-
- // If we have a specific mapping, use it
- if (typeMap[nodeType]) {
- return typeMap[nodeType];
- }
-
- // Otherwise, create a simplified version by removing capitals and common suffixes
- const simplified = nodeType
- .replace(/[A-Z]/g, '') // Remove capital letters
- .replace(/(Get|Set|Stop|Play|Record|Control)$/i, '') // Remove common suffixes
- .toLowerCase();
-
- // Return simplified name or fallback to 'node'
- return simplified || 'node';
-};
\ No newline at end of file
diff --git a/docs-internal/agent_architecture.md b/docs-internal/agent_architecture.md
index 9f7abd86..f0b3fcc6 100644
--- a/docs-internal/agent_architecture.md
+++ b/docs-internal/agent_architecture.md
@@ -26,7 +26,8 @@ Detailed architecture reference for how AI Agent (`aiAgent`) and Chat Agent (`ch
User clicks "Run" on AI Agent
|
v
-useExecution.executeNode() client/src/hooks/useExecution.ts
+ExecutionService.executeNodeViaWebSocket() client/src/services/executionService.ts
+ Called from ParameterPanel.tsx:71
Sends ALL workflow nodes + edges
|
v
@@ -77,7 +78,7 @@ Result broadcast via WebSocket
| File | Responsibility |
|------|---------------|
-| `client/src/hooks/useExecution.ts` | Frontend execution trigger, sends nodes + edges |
+| `client/src/services/executionService.ts` | Frontend execution trigger, sends nodes + edges (`executeNodeViaWebSocket`, called from `ParameterPanel.tsx`) |
| `server/routers/websocket.py` | WebSocket handler `handle_execute_node()` |
| `server/services/workflow.py` | Facade, builds context, delegates to NodeExecutor |
| `server/services/node_executor.py` | Plugin handler registry, plain dict dispatch (`self._handlers.get(node_type)`) |
diff --git a/docs-internal/frontend_architecture.md b/docs-internal/frontend_architecture.md
index f5779e85..7df562e2 100644
--- a/docs-internal/frontend_architecture.md
+++ b/docs-internal/frontend_architecture.md
@@ -147,7 +147,7 @@ client/src/
│ ├── useUserSettingsQuery.ts # user_settings row Query + save mutation
│ ├── useApiKeys.ts # WS-based API key CRUD
│ ├── useApiKeyValidation.ts # Provider-specific validation helpers
-│ ├── useComponentPalette.ts / useDragAndDrop.ts / useExecution.ts
+│ ├── useComponentPalette.ts / useDragAndDrop.ts / useDragWorkspaceFile.ts
│ ├── useOnboarding.ts # Reads via useUserSettingsQuery; writes via mutation
│ ├── useParameterPanel.ts # Thin orchestrator over useNodeParamsQuery + save mutation
│ ├── usePricing.ts / useToolSchema.ts / useWhatsApp.ts / useAndroidOperations.ts