feat(agent): 添加对持久化子智能体的支持并增强委派管理 添加了持久化子智能体的完整生命周期管理功能,包括创建、更新、删除和查询API接口。 新增了子智能体的JSON-RPC通信协议支持,实现了远程调用和任务管理功能。 同时增强了委派管理器的功能: - 添加了对本地委派、插件委派和本地回退的开关控制 - 实现了持久化子智能体任务的自动检测和本地执行保护 - 增加了对不同委派类型的权限验证机制 修改了智能体注册表以支持插件智能体的条件性包含,并更新了工具注册逻辑以支持可选工具。 BREAKING CHANGE: 委派管理器的构造函数签名已更改,添加了新的控制参数。 ```
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
'use client';
|
|
|
|
import Link from 'next/link';
|
|
import { usePathname } from 'next/navigation';
|
|
import { Building2, Clock3 } from 'lucide-react';
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
const TASK_MANAGEMENT_TABS = [
|
|
{
|
|
label: 'Office',
|
|
href: '/office',
|
|
icon: Building2,
|
|
match: (pathname: string) => pathname === '/office' || pathname.startsWith('/office/'),
|
|
},
|
|
{
|
|
label: '定时任务',
|
|
href: '/cron',
|
|
icon: Clock3,
|
|
match: (pathname: string) => pathname === '/cron' || pathname.startsWith('/cron/'),
|
|
},
|
|
] as const;
|
|
|
|
export function TaskManagementTabs() {
|
|
const pathname = usePathname();
|
|
|
|
return (
|
|
<div className="rounded-2xl border border-border/70 bg-muted/20 p-1">
|
|
<div className="flex flex-wrap gap-1">
|
|
{TASK_MANAGEMENT_TABS.map((tab) => {
|
|
const isActive = tab.match(pathname);
|
|
const Icon = tab.icon;
|
|
|
|
return (
|
|
<Link
|
|
key={tab.href}
|
|
href={tab.href}
|
|
className={cn(
|
|
'inline-flex items-center gap-2 rounded-xl px-4 py-2 text-sm font-medium transition-colors',
|
|
isActive
|
|
? 'bg-background text-foreground shadow-sm'
|
|
: 'text-muted-foreground hover:bg-background/70 hover:text-foreground'
|
|
)}
|
|
>
|
|
<Icon className="h-4 w-4" />
|
|
{tab.label}
|
|
</Link>
|
|
);
|
|
})}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|