From 70e5318844ef18054821b05d4734712702ca60c0 Mon Sep 17 00:00:00 2001 From: Waleed Alzarooni Date: Thu, 11 Sep 2025 18:30:37 +0100 Subject: [PATCH 01/94] task hub allignment fix --- src/pages/History.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/History.tsx b/src/pages/History.tsx index 347bd54fa..12664f5b0 100644 --- a/src/pages/History.tsx +++ b/src/pages/History.tsx @@ -293,7 +293,7 @@ export default function Home() { }} className={`${ chatStore.activeTaskId === taskId ? "!bg-white-100%" : "" - } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center gap-md flex-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] px-6 shadow-history-item`} + } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center gap-md flex-grow-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] px-6 shadow-history-item`} >
@@ -553,7 +553,7 @@ export default function Home() { chatStore.activeTaskId === task.task_id ? "!bg-white-100%" : "" - } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center flex-wrap gap-md flex-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] p-6 shadow-history-item border border-solid border-border-disabled`} + } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center flex-wrap gap-md flex-grow-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] p-6 shadow-history-item border border-solid border-border-disabled`} >
Date: Tue, 16 Sep 2025 14:43:56 +0100 Subject: [PATCH 02/94] flex-intitial, valid tailwind method --- src/pages/History.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/History.tsx b/src/pages/History.tsx index 12664f5b0..68faf56c1 100644 --- a/src/pages/History.tsx +++ b/src/pages/History.tsx @@ -293,7 +293,7 @@ export default function Home() { }} className={`${ chatStore.activeTaskId === taskId ? "!bg-white-100%" : "" - } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center gap-md flex-grow-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] px-6 shadow-history-item`} + } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center gap-md flex-initial w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] px-6 shadow-history-item`} >
@@ -553,7 +553,7 @@ export default function Home() { chatStore.activeTaskId === task.task_id ? "!bg-white-100%" : "" - } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center flex-wrap gap-md flex-grow-1 w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] p-6 shadow-history-item border border-solid border-border-disabled`} + } relative cursor-pointer transition-all duration-300 bg-white-30% hover:bg-white-100% rounded-3xl flex justify-between items-center flex-wrap gap-md flex-initial w-[calc(33%-48px)] min-w-[300px] max-w-[500px] h-[180px] p-6 shadow-history-item border border-solid border-border-disabled`} >
Date: Wed, 17 Sep 2025 20:00:03 +0300 Subject: [PATCH 03/94] enhance: streamline store subscribers --- src/components/AddWorker/index.tsx | 32 +++++++++++++++--------------- src/store/authStore.ts | 4 ++-- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/components/AddWorker/index.tsx b/src/components/AddWorker/index.tsx index 270d92f19..33cae1cfe 100644 --- a/src/components/AddWorker/index.tsx +++ b/src/components/AddWorker/index.tsx @@ -26,6 +26,7 @@ import { fetchPost } from "@/api/http"; import { useChatStore } from "@/store/chatStore"; import { useAuthStore, useWorkerList } from "@/store/authStore"; import { useTranslation } from "react-i18next"; +import { TooltipSimple } from "../ui/tooltip"; interface EnvValue { value: string; @@ -57,7 +58,8 @@ export function AddWorker({ }) { const { t } = useTranslation(); const [dialogOpen, setDialogOpen] = useState(false); - const chatStore = useChatStore(); + const activeTaskId = useChatStore((state) => state.activeTaskId); + const tasks = useChatStore((state) => state.tasks); const [showEnvConfig, setShowEnvConfig] = useState(false); const [activeMcp, setActiveMcp] = useState(null); const [envValues, setEnvValues] = useState<{ [key: string]: EnvValue }>({}); @@ -79,7 +81,7 @@ export function AddWorker({ console.log(mcp); if (mcp?.install_command?.env) { const initialValues: { [key: string]: EnvValue } = {}; - Object.keys(mcp.install_command.env).forEach((key) => { + for(const key of Object.keys(mcp.install_command.env)) { initialValues[key] = { value: "", required: true, @@ -88,7 +90,7 @@ export function AddWorker({ ?.replace(/{{/g, "") ?.replace(/}}/g, "") || "", }; - }); + }; setEnvValues(initialValues); } }; @@ -189,21 +191,19 @@ export function AddWorker({ } const localTool: string[] = []; const mcpList: string[] = []; - selectedTools.map((tool: any) => { + selectedTools.forEach((tool: any) => { if (tool.isLocal) { localTool.push(tool.toolkit as string); } else { mcpList.push(tool?.key || tool?.mcp_name); } }); - Object.keys(mcpLocal.mcpServers).map((key) => { - console.log("mcpList", mcpList); - console.log("mcpLocal.mcpServers", mcpLocal.mcpServers); - + console.log("mcpLocal.mcpServers", mcpLocal.mcpServers); + for(const key of Object.keys(mcpLocal.mcpServers)) { if (!mcpList.includes(key)) { delete mcpLocal.mcpServers[key]; } - }); + } if (edit) { const newWorkerList = workerList.map((worker) => { if (worker.type === workerInfo?.type) { @@ -232,8 +232,7 @@ export function AddWorker({ }); setWorkerList(newWorkerList); } else if ( - chatStore.activeTaskId && - chatStore.tasks[chatStore.activeTaskId].messages.length === 0 + activeTaskId && tasks[activeTaskId].messages.length === 0 ) { const worker: Agent = { tasks: [], @@ -255,7 +254,7 @@ export function AddWorker({ }; setWorkerList([...workerList, worker]); } else { - fetchPost(`/task/${chatStore.activeTaskId}/add-agent`, { + fetchPost(`/task/${activeTaskId}/add-agent`, { name: workerName, description: workerDescription, tools: localTool, @@ -331,7 +330,7 @@ export function AddWorker({ ? t("workforce.configure-mcp-server") : t("workforce.add-your-mcp-server")}
- +
@@ -420,7 +419,7 @@ export function AddWorker({
{ setWorkerName(e.target.value); @@ -430,6 +429,7 @@ export function AddWorker({ className={`!border-none !bg-transparent !shadow-none text-xl leading-2xl font-bold !ring-0 !ring-offset-0 ${ nameError ? "border-red-500" : "" }`} + required />