diff --git a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx index db6025ee..04decdb3 100644 --- a/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx +++ b/apps/rowboat/app/projects/[projectId]/workflow/entity_list.tsx @@ -2,7 +2,7 @@ import { z } from "zod"; import { WorkflowPrompt, WorkflowAgent, WorkflowTool } from "../../../lib/types/workflow_types"; import { Dropdown, DropdownItem, DropdownTrigger, DropdownMenu } from "@heroui/react"; import { useRef, useEffect, useState } from "react"; -import { EllipsisVerticalIcon, ImportIcon, PlusIcon, Brain, Boxes, Wrench, PenLine, Library, ChevronDown, ChevronRight, ServerIcon, Component, ScrollText, GripVertical } from "lucide-react"; +import { EllipsisVerticalIcon, ImportIcon, PlusIcon, Brain, Boxes, Wrench, PenLine, Library, ChevronDown, ChevronRight, ServerIcon, Component, ScrollText, GripVertical, Users, Cog, CheckCircle2 } from "lucide-react"; import { DndContext, DragEndEvent, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from '@dnd-kit/core'; import { SortableContext, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable'; import { CSS } from '@dnd-kit/utilities'; @@ -12,6 +12,7 @@ import { PictureImg } from "@/components/ui/picture-img"; import { clsx } from "clsx"; import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "@/components/ui/resizable"; import { ServerLogo } from '../tools/components/MCPServersCommon'; +import { Modal, ModalContent, ModalHeader, ModalBody, ModalFooter } from "@heroui/react"; // Reduced gap size to match Cursor's UI const GAP_SIZE = 4; // 1 unit * 4px (tailwind's default spacing unit) @@ -236,6 +237,13 @@ export function EntityList({ projectId: string, onReorderAgents: (agents: z.infer[]) => void }) { + const [showAgentTypeModal, setShowAgentTypeModal] = useState(false); + + const handleAddAgentWithType = (agentType: 'internal' | 'user_facing') => { + onAddAgent({ + outputVisibility: agentType + }); + }; // Merge workflow tools with project tools const mergedTools = [...tools, ...projectTools]; const selectedRef = useRef(null); @@ -388,7 +396,7 @@ export function EntityList({ onClick={(e) => { e.stopPropagation(); setExpandedPanels(prev => ({ ...prev, agents: true })); - onAddAgent({}); + setShowAgentTypeModal(true); }} className={`group ${buttonClasses}`} showHoverContent={true} @@ -648,6 +656,12 @@ export function EntityList({ + + setShowAgentTypeModal(false)} + onConfirm={handleAddAgentWithType} + /> ); } @@ -864,4 +878,140 @@ const SortableAgentItem = ({ agent, isSelected, onClick, selectedRef, statusLabe /> ); -}; \ No newline at end of file +}; + +interface AgentTypeModalProps { + isOpen: boolean; + onClose: () => void; + onConfirm: (agentType: 'internal' | 'user_facing') => void; +} + +function AgentTypeModal({ isOpen, onClose, onConfirm }: AgentTypeModalProps) { + const [selectedType, setSelectedType] = useState<'internal' | 'user_facing'>('internal'); + + const handleConfirm = () => { + onConfirm(selectedType); + onClose(); + }; + + return ( + + + +
+ + Create New Agent +
+
+ +
+

+ Choose the type of agent you want to create: +

+
+ {/* Task Agent (Internal) */} + + + {/* Conversation Agent (User-facing) */} + +
+
+
+ + + + +
+
+ ); +} \ No newline at end of file