feat(agents): 添加 Agent 预设管理功能

- 创建 Server Agents API 路由 (CRUD + presets + defaults)
- 添加 UI Agent 类型定义和 API 客户端函数
- 实现 AgentsPanel 组件 (预设/自定义 Agent 列表)
- 实现 AgentEditor 组件 (创建/编辑 Agent)
- 实现 AgentDefaultsEditor 组件 (全局默认配置)
- 集成 AgentsPanel 到 Web 和 Desktop 应用
This commit is contained in:
2025-12-12 21:23:01 +08:00
parent 9365e07df1
commit a225e66ad7
13 changed files with 2447 additions and 5 deletions
+6
View File
@@ -10,6 +10,7 @@ import {
CommandPanel,
MCPPanel,
HooksPanel,
AgentsPanel,
Toaster,
listSessions,
createSession,
@@ -25,6 +26,7 @@ export function App() {
const [showCommands, setShowCommands] = useState(false);
const [showMCP, setShowMCP] = useState(false);
const [showHooks, setShowHooks] = useState(false);
const [showAgents, setShowAgents] = useState(false);
const [sessionTitleUpdate, setSessionTitleUpdate] = useState<{ sessionId: string; name: string } | null>(null);
// 初始化:加载或创建会话
@@ -98,6 +100,7 @@ export function App() {
onOpenCommands={() => setShowCommands(true)}
onOpenMCP={() => setShowMCP(true)}
onOpenHooks={() => setShowHooks(true)}
onOpenAgents={() => setShowAgents(true)}
/>
) : (
<div className="flex-1 flex items-center justify-center h-full">
@@ -130,6 +133,9 @@ export function App() {
{/* Hooks 面板 */}
{showHooks && <HooksPanel onClose={() => setShowHooks(false)} />}
{/* Agents 面板 */}
{showAgents && <AgentsPanel onClose={() => setShowAgents(false)} />}
{/* Toast 通知 */}
<Toaster />
</div>