M3b:世谱激活接入组装管线(关键词命中/常驻/预算/符文展开)与前端记忆治理页(候选箱/重忆确认/正影/删除/实录溯源)

This commit is contained in:
chenxin committed 2026-08-27 09:22:20 +08:00
1 parent eb0027757d
commit e914aec9c4
8 files changed
+569 -1

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
import { PageContainer } from "@/components/layout/PageContainer";
import { ErrorState } from "@/components/shared/StateViews";
import { MemoryGovernance } from "@/components/memories/MemoryGovernance";
import { serverApi } from "@/lib/api/server-client";
import { describeError } from "@/lib/utils/error";
import type { Character } from "@/types/api";
import type { FactualRecordView, XirangMemory } from "@/lib/api/memories";
export const dynamic = "force-dynamic";
export default async function MemoriesPage() {
let error: string | null = null;
let characterId: string | undefined;
try {
const active = await serverApi
.get<Character>("/characters/active")
.catch(() => null);
characterId = active?.id;
} catch (e) {
error = describeError(e);
}
if (error || !characterId) {
return (
<PageContainer
title="记忆"
description="三级记忆治理:确认、正影与删除。"
>
<ErrorState
message={error ?? "尚未激活人物——启镜后这里会生长出记忆。"}
/>
</PageContainer>
);
}
const [memories, records] = await Promise.all([
serverApi
.get<XirangMemory[]>(`/characters/${characterId}/memories`)
.catch(() => []),
serverApi
.get<FactualRecordView[]>(`/characters/${characterId}/factual-records`)
.catch(() => []),
]);
return (
<PageContainer
title="记忆"
description="候选箱审阅 · 重忆确认 · 正影与删除 · 实录溯源。删除权高于召回便利。"
>
<MemoryGovernance
characterId={characterId}
initialMemories={memories}
initialRecords={records}
/>
</PageContainer>
);
}