feat: ship native boss android console

This commit is contained in:
kris
2026-03-26 23:16:56 +08:00
parent 90e904814d
commit 90cb6b7ff1
261 changed files with 40051 additions and 135 deletions

View File

@@ -0,0 +1,90 @@
import { notFound } from "next/navigation";
import Link from "next/link";
import { AppShell, PageNav, StatusBar } from "@/components/app-ui";
import { requirePageSession } from "@/lib/boss-auth";
import { getThreadContextDetailView } from "@/lib/boss-projections";
import { readState } from "@/lib/boss-data";
export const dynamic = "force-dynamic";
export default async function ThreadPage({
params,
}: {
params: Promise<{ threadId: string }>;
}) {
await requirePageSession();
const { threadId } = await params;
const state = await readState();
const detail = getThreadContextDetailView(state, threadId);
if (!detail) notFound();
return (
<AppShell bottomNav={false}>
<StatusBar />
<PageNav title="线程详情" backHref={`/conversations/${detail.snapshot.projectId}`} />
<div className="space-y-3 px-[18px] pb-6">
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div className="flex items-center justify-between gap-3">
<div>
<div className="text-[16px] font-semibold text-[#111111]">
{detail.snapshot.title}
</div>
<div className="mt-1 text-[12px] text-[#8C8C8C]">
{detail.snapshot.workerId} · {detail.snapshot.nodeId}
</div>
</div>
<div className="text-right">
<div className="text-[18px] font-semibold text-[#111111]">
{detail.snapshot.contextBudgetRemainingPct}%
</div>
<div className="text-[12px] text-[#8C8C8C]">
{detail.snapshot.contextBudgetLevel}
</div>
</div>
</div>
<div className="mt-3 text-[13px] leading-6 text-[#57606A]">
{detail.snapshot.summary}
</div>
</div>
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div className="text-[14px] font-semibold text-[#111111]"></div>
<div className="mt-2 text-[13px] leading-6 text-[#57606A]">
{detail.currentChecklist.map((item) => `${item}`).join("\n")}
</div>
</div>
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div className="text-[14px] font-semibold text-[#111111]"> Agent </div>
<div className="mt-2 text-[13px] leading-6 text-[#57606A]">
{detail.masterActions.map((item) => `${item}`).join("\n") || "当前无额外动作。"}
</div>
</div>
{detail.handoffPackage ? (
<div className="rounded-2xl border border-[#E5E5EA] bg-white px-4 py-4">
<div className="flex items-center justify-between gap-3">
<div className="text-[14px] font-semibold text-[#111111]">handoff package</div>
<div className="text-[12px] text-[#8C8C8C]">{detail.handoffPackage.packageStatus}</div>
</div>
<div className="mt-2 text-[13px] leading-6 text-[#57606A]">
{detail.handoffPackage.summaryText}
</div>
<div className="mt-2 text-[12px] leading-5 text-[#8C8C8C]">
critical commands{detail.handoffPackage.criticalCommands.join("") || "暂无"}
</div>
</div>
) : null}
{detail.alerts.map((alert) => (
<div key={alert.alertId} className="rounded-2xl bg-[#FFF7E6] px-4 py-4 text-[13px] leading-6 text-[#D46B08]">
{alert.summary}
</div>
))}
<Link
href={`/api/v1/threads/${threadId}/context-budget`}
className="block rounded-2xl bg-[#F5F5F7] px-4 py-4 text-[12px] text-[#57606A]"
>
JSON /api/v1/threads/{threadId}/context-budget
</Link>
</div>
</AppShell>
);
}