{ "project": "AI MCP Web UI - json-render 官方 Hook 重构", "date": "2026-03-23", "status": "completed", "tasks": [ { "id": 1, "name": "安装 Vercel AI SDK 依赖", "status": "completed", "notes": "依赖已存在: ai@6.0.116, @ai-sdk/anthropic@3.0.58, @ai-sdk/mcp@1.0.25" }, { "id": 2, "name": "创建 Next.js API Route", "status": "completed", "file": "app/api/chat/route.ts", "notes": "使用 toTextStreamResponse() 返回混合流(文本 + JSONL)" }, { "id": 3, "name": "更新前端使用官方 useChatUI hook", "status": "completed", "file": "app/page.tsx", "notes": "已使用 @json-render/react 的 useChatUI" }, { "id": 4, "name": "配置 Anthropic API Key", "status": "completed", "file": ".env.local", "notes": "支持自定义 ANTHROPIC_BASE_URL" }, { "id": 5, "name": "清理废弃代码", "status": "completed", "file": "lib/hooks.ts", "notes": "useChat hook 标记为废弃" }, { "id": 6, "name": "更新组件引用", "status": "completed", "file": "lib/json-render-catalog.tsx", "notes": "specFromToolCall 标记为废弃" } ], "acceptance_criteria": { "AC1": "passed - API Route 返回文本流响应", "AC2": "passed - 前端使用 useChatUI", "AC3": "passed - useChatUI 内部解析 JSONL patches", "AC4": "pending - 需要运行时测试 NovelList $state 引用", "AC5": "pending - 需要运行时测试流式更新", "AC6": "pending - 需要运行时测试 MCP 工具调用", "AC7": "passed - npm run build 成功", "AC8": "pending - 需要测试 API Key 未配置场景", "AC9": "pending - 需要测试网络错误处理", "AC10": "pending - 需要测试无效 JSON 处理" }, "modified_files": [ "app/api/chat/route.ts", "lib/hooks.ts", "lib/json-render-catalog.tsx" ] }