Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e97be34
add new dependencies
xuyaqist Dec 31, 2025
5d6c35b
♻️ Refactoring Agent Config
xuyaqist Dec 31, 2025
4af75d1
Delete Useless Code
xuyaqist Dec 31, 2025
3688f91
delete useless import
xuyaqist Dec 31, 2025
eb4c7e4
adjust directory
xuyaqist Dec 31, 2025
fce7de4
adjust import
xuyaqist Dec 31, 2025
590e2c2
Upgrade ant design version
xuyaqist Jan 4, 2026
a0fe58d
Bugfix: fix agentlist scrollbar
xuyaqist Jan 4, 2026
d864aa1
Bugfix cannot delete agent is not avaliable
xuyaqist Jan 4, 2026
4d87ad0
Revert "Bugfix cannot delete agent is not avaliable"
xuyaqist Jan 4, 2026
40acc46
Bugfix cannot delete agent is not avaliable
xuyaqist Jan 4, 2026
dd82d3b
AgentManage import agents should pop out selection dialog
xuyaqist Jan 4, 2026
22b04a8
set agentInfo mask
xuyaqist Jan 4, 2026
e78ad35
bugfix: replace not existed i18n
xuyaqist Jan 4, 2026
ca1524a
Setting the agent configuration page can be saved in two ways
xuyaqist Jan 4, 2026
b4f58af
Merge branch 'develop' into xyq/refactoring_agent_config
xuyaqist Jan 4, 2026
f6035d9
upgrade ant desgin
xuyaqist Jan 4, 2026
8454899
Refresh the agent list so that it updates automatically once an agent…
xuyaqist Jan 5, 2026
9f389be
Set the agent info page to appear below the mask layer
xuyaqist Jan 5, 2026
106e39c
Make the agent deselectable
xuyaqist Jan 5, 2026
91f5fc8
Initialize the agent information
xuyaqist Jan 5, 2026
115d0ff
Bugfix:选择未配置过的且需要参数的工具应该主动弹出配置窗口
xuyaqist Jan 6, 2026
15d60bc
Merge branch 'develop' into xyq/refactoring_agent_config
xuyaqist Jan 6, 2026
d658b95
Delete ME connection test code
xuyaqist Jan 6, 2026
c253599
Delete repeat file
xuyaqist Jan 6, 2026
d402a30
删除注释
xuyaqist Jan 7, 2026
d520129
删除中文注释
xuyaqist Jan 7, 2026
c535a35
give tips when agent is unavaliable
xuyaqist Jan 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
653 changes: 0 additions & 653 deletions frontend/app/[locale]/agents/AgentConfiguration.tsx

This file was deleted.

70 changes: 70 additions & 0 deletions frontend/app/[locale]/agents/AgentSetupOrchestrator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
"use client";

import { Card, Row, Col } from "antd";

import AgentManageComp from "./components/AgentManageComp";
import AgentConfigComp from "./components/AgentConfigComp";
import AgentInfoComp from "./components/AgentInfoComp";

interface AgentSetupOrchestratorProps {
onImportAgent?: () => void;
}

export default function AgentSetupOrchestrator({
onImportAgent,
}: AgentSetupOrchestratorProps) {
return (
<Card
className="h-full min-h-0 w-full min-w-0"
style={{ minHeight: 400, maxHeight: "80vh" }}
>
<style jsx global>{`
.ant-card-body {
height: 100%;
}
`}</style>
{/* Three-column layout using Ant Design Grid */}
<Row
gutter={[16, 16]}
className="h-full min-h-0 w-full min-w-0"
align="stretch"
>
{/* Left column: Agent Management */}
<Col
xs={24}
sm={24}
md={24}
lg={24}
xl={8}
className="flex flex-col h-full w-full"
>
<AgentManageComp onImportAgent={onImportAgent} />
</Col>

{/* Middle column: Agent Config */}
<Col
xs={24}
sm={24}
md={24}
lg={24}
xl={8}
className="flex flex-col h-full w-full"
>
<AgentConfigComp />
</Col>

{/* Right column: Agent Info */}
<Col
xs={24}
sm={24}
md={24}
lg={24}
xl={8}
className="flex flex-col h-full w-full"
>
<AgentInfoComp />
</Col>
</Row>
</Card>
);
}
98 changes: 0 additions & 98 deletions frontend/app/[locale]/agents/AgentsContent.tsx

This file was deleted.

161 changes: 161 additions & 0 deletions frontend/app/[locale]/agents/components/AgentConfigComp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
"use client";

import { useState, useCallback } from "react";
import { useTranslation } from "react-i18next";
import { App, Button, Row, Col, Flex, Tooltip, Badge, Divider } from "antd";
import CollaborativeAgent from "./agentConfig/CollaborativeAgent";
import ToolManagement from "./agentConfig/ToolManagement";

import { updateToolList } from "@/services/mcpService";
import { useAgentConfigStore } from "@/stores/agentConfigStore";
import { useToolList } from "@/hooks/agent/useToolList";
import McpConfigModal from "./agentConfig/McpConfigModal";

import { RefreshCw, Lightbulb, Plug } from "lucide-react";

interface AgentConfigCompProps {}

export default function AgentConfigComp({}: AgentConfigCompProps) {
const { t } = useTranslation("common");
const { message } = App.useApp();

// Get state from store
const currentAgentId = useAgentConfigStore((state) => state.currentAgentId);

const isCreatingMode = useAgentConfigStore((state) => state.isCreatingMode);

const editable = !!(currentAgentId || isCreatingMode);

const [isMcpModalOpen, setIsMcpModalOpen] = useState(false);
const [isRefreshing, setIsRefreshing] = useState(false);

// Use tool list hook for data management
const { groupedTools, invalidate } = useToolList();

const handleRefreshTools = useCallback(async () => {
setIsRefreshing(true);
try {
// Step 1: Update backend tool status, rescan MCP and local tools
const updateResult = await updateToolList();
if (!updateResult.success) {
message.warning(t("toolManagement.message.updateStatusFailed"));
}

// Step 2: Invalidate and refresh tool list cache
invalidate();
message.success(t("toolManagement.message.refreshSuccess"));
} catch (error) {
message.error(t("toolManagement.message.refreshFailedRetry"));
} finally {
setIsRefreshing(false);
}
}, [invalidate]);


return (
<>
{/* Import handled by Ant Design Upload (no hidden input required) */}
<Flex vertical className="h-full overflow-hidden">
<Row>
<Col>
<Flex
justify="flex-start"
align="center"
gap={8}
style={{ marginBottom: "4px" }}
>
<Badge count={2} color="blue" />
<h2 className="text-lg font-medium">
{t("businessLogic.config.title")}
</h2>
</Flex>
</Col>
</Row>

<Divider style={{ margin: "10px 0" }} />

<Row gutter={[12, 12]} className="mb-4">
<CollaborativeAgent />
</Row>

<Row gutter={[12, 12]}>
<Col xs={12}>
<Flex justify="flex-start" align="center">
<h4 className="text-md font-medium text-gray-700">
{t("toolPool.title")}
</h4>
<Tooltip
title={
<div style={{ whiteSpace: "pre-line" }}>
{t("toolPool.tooltip.functionGuide")}
</div>
}
color="#ffffff"
styles={{
root: {
backgroundColor: "#ffffff",
color: "#374151",
border: "1px solid #e5e7eb",
borderRadius: "6px",
boxShadow:
"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",
padding: "12px",
maxWidth: "800px",
minWidth: "700px",
width: "fit-content",
},
}}
>
<Lightbulb className="ml-2 text-yellow-500" size={16} />
</Tooltip>
</Flex>
</Col>
<Col xs={12}>
<Flex justify="flex-end" align="center">
<Button
type="text"
size="small"
icon={<RefreshCw size={16} />}
onClick={handleRefreshTools}
disabled={!editable}
loading={isRefreshing}
className="text-green-500 hover:!text-green-600 hover:!bg-green-50"
title={t("toolManagement.refresh.title")}
>
{t("toolManagement.refresh.button.refresh")}
</Button>
<Button
type="text"
size="small"
icon={<Plug size={16} />}
onClick={() => setIsMcpModalOpen(true)}
disabled={!editable}
className="text-blue-500 hover:!text-blue-600 hover:!bg-blue-50"
title={t("toolManagement.mcp.title")}
>
{t("toolManagement.mcp.button")}
</Button>
</Flex>
</Col>
</Row>

<Divider style={{ margin: "10px 0" }} />

<Row className="flex:1 min-h-0">
<Col xs={24} className="h-full">
<ToolManagement
toolGroups={groupedTools}
editable={editable}
currentAgentId={currentAgentId?? undefined}
/>
</Col>
</Row>
</Flex>

<McpConfigModal
visible={isMcpModalOpen}
onCancel={() => setIsMcpModalOpen(false)}
/>
</>
);
}
Loading