diff --git a/frontend/package-lock.json b/frontend/package-lock.json index a0140e8..0be2121 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -26,6 +26,7 @@ "react-markdown": "^9.0.1", "react-query": "3.39.3", "reactflow": "^11.11.1", + "uuid": "^10.0.0", "zustand": "4.5.0" }, "devDependencies": { @@ -35,6 +36,7 @@ "@types/node": "20.10.5", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", + "@types/uuid": "^10.0.0", "@vitejs/plugin-react-swc": "^3.5.0", "openapi-typescript-codegen": "0.25.0", "typescript": "^5.2.2", @@ -3051,6 +3053,12 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" }, + "node_modules/@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "dev": true + }, "node_modules/@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -5794,6 +5802,18 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/vfile": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", @@ -8081,6 +8101,12 @@ "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.2.tgz", "integrity": "sha512-dqId9J8K/vGi5Zr7oo212BGii5m3q5Hxlkwy3WpYuKPklmBEvsbMYYyLxAQpSffdLl/gdW0XUpKWFvYmyoWCoQ==" }, + "@types/uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ==", + "dev": true + }, "@ungap/structured-clone": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", @@ -9948,6 +9974,11 @@ "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", "requires": {} }, + "uuid": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-10.0.0.tgz", + "integrity": "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ==" + }, "vfile": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.1.tgz", diff --git a/frontend/package.json b/frontend/package.json index c3e3eb0..d9e6363 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,6 +29,7 @@ "react-markdown": "^9.0.1", "react-query": "3.39.3", "reactflow": "^11.11.1", + "uuid": "^10.0.0", "zustand": "4.5.0" }, "devDependencies": { @@ -38,6 +39,7 @@ "@types/node": "20.10.5", "@types/react": "^18.2.37", "@types/react-dom": "^18.2.15", + "@types/uuid": "^10.0.0", "@vitejs/plugin-react-swc": "^3.5.0", "openapi-typescript-codegen": "0.25.0", "typescript": "^5.2.2", diff --git a/frontend/src/components/Teams/ChatTeam.tsx b/frontend/src/components/Teams/ChatTeam.tsx index ee63e4e..5febfa0 100644 --- a/frontend/src/components/Teams/ChatTeam.tsx +++ b/frontend/src/components/Teams/ChatTeam.tsx @@ -49,6 +49,7 @@ import { IoCreateOutline } from "react-icons/io5" import { FaCheck, FaTimes } from "react-icons/fa" import { fetchEventSource } from "@microsoft/fetch-event-source" import { FiCopy } from "react-icons/fi" +import { v4 } from "uuid" // possible message types: "ai" | "human" | "tool" | "error" | "interrupt" @@ -366,7 +367,7 @@ const ChatTeam = () => { ...prev, { type: "human", - id: self.crypto.randomUUID(), + id: v4(), content: data.messages[0].content, name: "user", },