From 3a3399af94e0b0c83812deb91ef48fb6a7f49f04 Mon Sep 17 00:00:00 2001 From: Timothy Carambat Date: Thu, 22 Aug 2024 15:31:36 -0700 Subject: [PATCH] Move `embed` to submodule (#2163) * Move `embed` to submodule * update README --- .gitmodules | 4 + README.md | 2 +- embed | 1 + embed/.gitignore | 25 - embed/README.md | 112 - embed/index.html | 17 - embed/jsconfig.json | 10 - embed/package.json | 51 - embed/postcss.config.js | 10 - embed/scripts/updateHljs.mjs | 35 - embed/src/App.jsx | 71 - embed/src/assets/anything-llm-dark.png | Bin 8413 -> 0 bytes embed/src/assets/anything-llm-icon.svg | 5 - .../HistoricalMessage/Actions/index.jsx | 43 - .../ChatHistory/HistoricalMessage/index.jsx | 97 - .../ChatHistory/PromptReply/index.jsx | 111 - .../ChatContainer/ChatHistory/index.jsx | 163 - .../ChatContainer/PromptInput/index.jsx | 102 - .../ChatWindow/ChatContainer/index.jsx | 145 - .../components/ChatWindow/Header/index.jsx | 155 - embed/src/components/ChatWindow/index.jsx | 99 - embed/src/components/Head.jsx | 131 - embed/src/components/OpenButton/index.jsx | 35 - embed/src/components/ResetChat/index.jsx | 20 - embed/src/components/SessionId/index.jsx | 12 - embed/src/components/Sponsor/index.jsx | 17 - embed/src/hooks/chat/useChatHistory.js | 27 - embed/src/hooks/useOpen.js | 16 - embed/src/hooks/useScriptAttributes.js | 104 - embed/src/hooks/useSessionId.js | 29 - embed/src/index.css | 32 - embed/src/main.jsx | 31 - embed/src/models/chatService.js | 109 - embed/src/utils/chat/hljs.js | 88 - embed/src/utils/chat/index.js | 96 - embed/src/utils/chat/markdown.js | 49 - embed/src/utils/constants.js | 15 - embed/src/utils/date.js | 9 - embed/tailwind.config.js | 103 - embed/vite.config.js | 68 - embed/yarn.lock | 3430 ----------------- 41 files changed, 6 insertions(+), 5673 deletions(-) create mode 100644 .gitmodules create mode 160000 embed delete mode 100644 embed/.gitignore delete mode 100644 embed/README.md delete mode 100644 embed/index.html delete mode 100644 embed/jsconfig.json delete mode 100644 embed/package.json delete mode 100644 embed/postcss.config.js delete mode 100644 embed/scripts/updateHljs.mjs delete mode 100644 embed/src/App.jsx delete mode 100644 embed/src/assets/anything-llm-dark.png delete mode 100644 embed/src/assets/anything-llm-icon.svg delete mode 100644 embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/Actions/index.jsx delete mode 100644 embed/src/components/ChatWindow/ChatContainer/ChatHistory/HistoricalMessage/index.jsx delete mode 100644 embed/src/components/ChatWindow/ChatContainer/ChatHistory/PromptReply/index.jsx delete mode 100644 embed/src/components/ChatWindow/ChatContainer/ChatHistory/index.jsx delete mode 100644 embed/src/components/ChatWindow/ChatContainer/PromptInput/index.jsx delete mode 100644 embed/src/components/ChatWindow/ChatContainer/index.jsx delete mode 100644 embed/src/components/ChatWindow/Header/index.jsx delete mode 100644 embed/src/components/ChatWindow/index.jsx delete mode 100644 embed/src/components/Head.jsx delete mode 100644 embed/src/components/OpenButton/index.jsx delete mode 100644 embed/src/components/ResetChat/index.jsx delete mode 100644 embed/src/components/SessionId/index.jsx delete mode 100644 embed/src/components/Sponsor/index.jsx delete mode 100644 embed/src/hooks/chat/useChatHistory.js delete mode 100644 embed/src/hooks/useOpen.js delete mode 100644 embed/src/hooks/useScriptAttributes.js delete mode 100644 embed/src/hooks/useSessionId.js delete mode 100644 embed/src/index.css delete mode 100644 embed/src/main.jsx delete mode 100644 embed/src/models/chatService.js delete mode 100644 embed/src/utils/chat/hljs.js delete mode 100644 embed/src/utils/chat/index.js delete mode 100644 embed/src/utils/chat/markdown.js delete mode 100644 embed/src/utils/constants.js delete mode 100644 embed/src/utils/date.js delete mode 100644 embed/tailwind.config.js delete mode 100644 embed/vite.config.js delete mode 100644 embed/yarn.lock diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..dfb4bfcaa --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "embed"] + branch = main + path = embed + url = git@github.com:Mintplex-Labs/anythingllm-embed.git diff --git a/README.md b/README.md index 178fef08e..e5acb7a03 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ This monorepo consists of three main sections: - `server`: A NodeJS express server to handle all the interactions and do all the vectorDB management and LLM interactions. - `collector`: NodeJS express server that process and parses documents from the UI. - `docker`: Docker instructions and build process + information for building from source. -- `embed`: Code specifically for generation of the [embed widget](./embed/README.md). +- `embed`: Submodule specifically for generation & creation of the [web embed widget](https://github.com/Mintplex-Labs/anythingllm-embed). ## 🛳 Self Hosting diff --git a/embed b/embed new file mode 160000 index 000000000..22a0848d5 --- /dev/null +++ b/embed @@ -0,0 +1 @@ +Subproject commit 22a0848d58e3a758d85d93d9204a72a65854ea94 diff --git a/embed/.gitignore b/embed/.gitignore deleted file mode 100644 index 4d3751d9a..000000000 --- a/embed/.gitignore +++ /dev/null @@ -1,25 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -!yarn.lock -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/embed/README.md b/embed/README.md deleted file mode 100644 index af6621ba1..000000000 --- a/embed/README.md +++ /dev/null @@ -1,112 +0,0 @@ -# AnythingLLM Embedded Chat Widget - -> [!WARNING] -> The use of the AnythingLLM embed is currently in beta. Please request a feature or -> report a bug via a Github Issue if you have any issues. - -> [!WARNING] -> The core AnythingLLM team publishes a pre-built version of the script that is bundled -> with the main application. You can find it at the frontend URL `/embed/anythingllm-chat-widget.min.js`. -> You should only be working in this repo if you are wanting to build your own custom embed. - -This folder of AnythingLLM contains the source code for how the embedded version of AnythingLLM works to provide a public facing interface of your workspace. - -The AnythingLLM Embedded chat widget allows you to expose a workspace and its embedded knowledge base as a chat bubble via a ` -``` - -### `