feat: add web master-agent chat menu

This commit is contained in:
kris
2026-04-01 07:42:17 +08:00
parent a27c7da7d4
commit 87093677b8
5 changed files with 111 additions and 3 deletions

View File

@@ -14,6 +14,7 @@ import {
popAppHistoryEntry,
resolveAppBackAction,
} from "@/lib/boss-app-client";
import { getMasterAgentChatMenuItems } from "@/lib/master-agent-chat-menu";
import {
extractApprovedTargetProjectIds,
summarizeDispatchPlan,
@@ -810,6 +811,52 @@ export function MasterIdentityPill({ identity }: { identity: MasterIdentitySumma
);
}
export function MasterAgentChatMenu({ projectId }: { projectId: string }) {
const router = useRouter();
const items = getMasterAgentChatMenuItems(projectId);
if (items.length === 0) {
return null;
}
return (
<details className="relative">
<summary
className="flex h-9 w-9 list-none items-center justify-center rounded-full border border-[#E5E5EA] bg-white text-[18px] font-semibold leading-none text-[#57606A] shadow-sm marker:content-none"
aria-label="更多"
>
</summary>
<div className="absolute right-0 top-11 z-20 min-w-[116px] rounded-2xl border border-[#E5E5EA] bg-white p-2 shadow-[0_12px_28px_rgba(15,23,42,0.14)]">
{items.map((item) =>
item.href ? (
<Link
key={item.key}
href={item.href}
className="flex rounded-xl px-3 py-2 text-[13px] text-[#111111] hover:bg-[#F7F8FA]"
>
{item.label}
</Link>
) : (
<button
key={item.key}
type="button"
onClick={() => {
if (item.action === "refresh") {
router.refresh();
}
}}
className="flex w-full rounded-xl px-3 py-2 text-left text-[13px] text-[#111111] hover:bg-[#F7F8FA]"
>
{item.label}
</button>
),
)}
</div>
</details>
);
}
type PendingDispatchPlanState = {
planId: string;
summary?: string;

View File

@@ -326,7 +326,7 @@ export function MasterAgentPromptMemoryClient({
return (
<div className="flex flex-col gap-4 px-[18px] pb-6">
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div id="prompt-section" className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4 scroll-mt-4">
<div className="text-[16px] font-semibold text-[#111111]"> Agent </div>
<div className="mt-2 text-[12px] leading-6 text-[#8C8C8C]">
@@ -453,7 +453,7 @@ export function MasterAgentPromptMemoryClient({
</div>
</div>
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div id="memory-section" className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4 scroll-mt-4">
<div className="text-[16px] font-semibold text-[#111111]"></div>
<div className="mt-2 text-[12px] leading-6 text-[#8C8C8C]">
master-agent