- 薄自建 LLM 网关:OpenAI 兼容适配器(DeepSeek) + instructor 结构化输出 + usage_ledger 记账 + 档位路由 - 记忆服务 assemble:确定性选择(显式+主角+近况) + 渲染卡 + 缓存断点(中性文本) - LangGraph 写章节点 + Postgres checkpointer + SSE 归一(token/done/error) - API:立项 + 写章 draft(SSE) + PUT 自动保存 + 提供商凭据(Fernet 加密/测试连接) - 前端:AppShell + 作品库 + 5 步立项向导 + 写作工作台(流式打字机+自动保存) + 设置页 - M1 E2E:真实 DB + mock 网关零 token 走通闭环
20 lines
550 B
TypeScript
20 lines
550 B
TypeScript
import { notFound } from "next/navigation";
|
||
|
||
import { Workbench } from "@/components/workbench/Workbench";
|
||
import { fetchProject } from "@/lib/api/server";
|
||
|
||
interface PageProps {
|
||
params: Promise<{ id: string }>;
|
||
}
|
||
|
||
// 写作工作台页(UX §6.3)。Server Component 取项目,Workbench 负责编辑/流式/保存。
|
||
export default async function WritePage({ params }: PageProps) {
|
||
const { id } = await params;
|
||
try {
|
||
const project = await fetchProject(id);
|
||
return <Workbench project={project} />;
|
||
} catch {
|
||
notFound();
|
||
}
|
||
}
|