fix: 替换 web 端 crypto.randomUUID 为 uuid 库以支持 HTTP 环境

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
claude-code-best
2026-04-19 10:32:18 +08:00
parent 481e2a58a9
commit f9d011164a
5 changed files with 8 additions and 8 deletions

View File

@@ -1,4 +1,5 @@
import type { ChatTransport, UIMessage, UIMessageChunk } from "ai";
import { v4 as uuidv4 } from "uuid";
import { getUuid } from "../api/client";
import type { SessionEvent, EventPayload } from "../types";
@@ -112,7 +113,7 @@ export class RCSTransport implements ChatTransport<UIMessage> {
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
type: "user",
uuid: crypto.randomUUID(),
uuid: uuidv4(),
content: text,
message: { content: text },
}),