From 7e1d6ebd19fb62a4dfbded959efc9a51553ae958 Mon Sep 17 00:00:00 2001
From: OTYAK <118303871+OmarElKadri@users.noreply.github.com>
Date: Fri, 11 Apr 2025 18:46:03 +0100
Subject: [PATCH 01/36] bug(file upload): fixed an erro in uploading dox files.
---
package.json | 129 ++++++++++++++++++++++----------------------
yarn.lock | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 213 insertions(+), 66 deletions(-)
diff --git a/package.json b/package.json
index e68410f..38f22f9 100644
--- a/package.json
+++ b/package.json
@@ -1,65 +1,66 @@
{
- "name": "perplexica-frontend",
- "version": "1.10.2",
- "license": "MIT",
- "author": "ItzCrazyKns",
- "scripts": {
- "dev": "next dev",
- "build": "npm run db:push && next build",
- "start": "next start",
- "lint": "next lint",
- "format:write": "prettier . --write",
- "db:push": "drizzle-kit push"
- },
- "dependencies": {
- "@headlessui/react": "^2.2.0",
- "@iarna/toml": "^2.2.5",
- "@icons-pack/react-simple-icons": "^12.3.0",
- "@langchain/anthropic": "^0.3.15",
- "@langchain/community": "^0.3.36",
- "@langchain/core": "^0.3.42",
- "@langchain/google-genai": "^0.1.12",
- "@langchain/openai": "^0.0.25",
- "@langchain/textsplitters": "^0.1.0",
- "@tailwindcss/typography": "^0.5.12",
- "@xenova/transformers": "^2.17.2",
- "axios": "^1.8.3",
- "better-sqlite3": "^11.9.1",
- "clsx": "^2.1.0",
- "compute-cosine-similarity": "^1.1.0",
- "compute-dot": "^1.1.0",
- "drizzle-orm": "^0.40.1",
- "html-to-text": "^9.0.5",
- "langchain": "^0.1.30",
- "lucide-react": "^0.363.0",
- "markdown-to-jsx": "^7.7.2",
- "next": "^15.2.2",
- "next-themes": "^0.3.0",
- "pdf-parse": "^1.1.1",
- "react": "^18",
- "react-dom": "^18",
- "react-text-to-speech": "^0.14.5",
- "react-textarea-autosize": "^8.5.3",
- "sonner": "^1.4.41",
- "tailwind-merge": "^2.2.2",
- "winston": "^3.17.0",
- "yet-another-react-lightbox": "^3.17.2",
- "zod": "^3.22.4"
- },
- "devDependencies": {
- "@types/better-sqlite3": "^7.6.12",
- "@types/html-to-text": "^9.0.4",
- "@types/node": "^20",
- "@types/pdf-parse": "^1.1.4",
- "@types/react": "^18",
- "@types/react-dom": "^18",
- "autoprefixer": "^10.0.1",
- "drizzle-kit": "^0.30.5",
- "eslint": "^8",
- "eslint-config-next": "14.1.4",
- "postcss": "^8",
- "prettier": "^3.2.5",
- "tailwindcss": "^3.3.0",
- "typescript": "^5"
- }
-}
+ "name": "perplexica-frontend",
+ "version": "1.10.2",
+ "license": "MIT",
+ "author": "ItzCrazyKns",
+ "scripts": {
+ "dev": "next dev",
+ "build": "npm run db:push && next build",
+ "start": "next start",
+ "lint": "next lint",
+ "format:write": "prettier . --write",
+ "db:push": "drizzle-kit push"
+ },
+ "dependencies": {
+ "@headlessui/react": "^2.2.0",
+ "@iarna/toml": "^2.2.5",
+ "@icons-pack/react-simple-icons": "^12.3.0",
+ "@langchain/anthropic": "^0.3.15",
+ "@langchain/community": "^0.3.36",
+ "@langchain/core": "^0.3.42",
+ "@langchain/google-genai": "^0.1.12",
+ "@langchain/openai": "^0.0.25",
+ "@langchain/textsplitters": "^0.1.0",
+ "@tailwindcss/typography": "^0.5.12",
+ "@xenova/transformers": "^2.17.2",
+ "axios": "^1.8.3",
+ "better-sqlite3": "^11.9.1",
+ "clsx": "^2.1.0",
+ "compute-cosine-similarity": "^1.1.0",
+ "compute-dot": "^1.1.0",
+ "drizzle-orm": "^0.40.1",
+ "html-to-text": "^9.0.5",
+ "langchain": "^0.1.30",
+ "lucide-react": "^0.363.0",
+ "mammoth": "^1.7.0",
+ "markdown-to-jsx": "^7.7.2",
+ "next": "^15.2.2",
+ "next-themes": "^0.3.0",
+ "pdf-parse": "^1.1.1",
+ "react": "^18",
+ "react-dom": "^18",
+ "react-text-to-speech": "^0.14.5",
+ "react-textarea-autosize": "^8.5.3",
+ "sonner": "^1.4.41",
+ "tailwind-merge": "^2.2.2",
+ "winston": "^3.17.0",
+ "yet-another-react-lightbox": "^3.17.2",
+ "zod": "^3.22.4"
+ },
+ "devDependencies": {
+ "@types/better-sqlite3": "^7.6.12",
+ "@types/html-to-text": "^9.0.4",
+ "@types/node": "^20",
+ "@types/pdf-parse": "^1.1.4",
+ "@types/react": "^18",
+ "@types/react-dom": "^18",
+ "autoprefixer": "^10.0.1",
+ "drizzle-kit": "^0.30.5",
+ "eslint": "^8",
+ "eslint-config-next": "14.1.4",
+ "postcss": "^8",
+ "prettier": "^3.2.5",
+ "tailwindcss": "^3.3.0",
+ "typescript": "^5"
+ }
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 921186b..ffd6648 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1107,6 +1107,11 @@
optionalDependencies:
onnxruntime-node "1.14.0"
+"@xmldom/xmldom@^0.8.6":
+ version "0.8.10"
+ resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99"
+ integrity sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==
+
abort-controller@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392"
@@ -1191,6 +1196,13 @@ argparse@^2.0.1:
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
+argparse@~1.0.3:
+ version "1.0.10"
+ resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
+ integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
+ dependencies:
+ sprintf-js "~1.0.2"
+
aria-query@^5.3.0:
version "5.3.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e"
@@ -1444,6 +1456,11 @@ bl@^4.0.3:
inherits "^2.0.4"
readable-stream "^3.4.0"
+bluebird@~3.4.0:
+ version "3.4.7"
+ resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.7.tgz#f72d760be09b7f76d08ed8fae98b289a8d05fab3"
+ integrity sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==
+
brace-expansion@^1.1.7:
version "1.1.11"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
@@ -1691,6 +1708,11 @@ console-table-printer@^2.12.1:
dependencies:
simple-wcswidth "^1.0.1"
+core-util-is@~1.0.0:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
+ integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
+
cross-spawn@^7.0.0, cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -1834,6 +1856,11 @@ digest-fetch@^1.3.0:
base-64 "^0.1.0"
md5 "^2.3.0"
+dingbat-to-unicode@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/dingbat-to-unicode/-/dingbat-to-unicode-1.0.1.tgz#5091dd673241453e6b5865e26e5a4452cdef5c83"
+ integrity sha512-98l0sW87ZT58pU4i61wa2OHwxbiYSbuxsCBozaVnYX2iCnr3bLM3fIes1/ej7h1YdOKuKt/MLs706TVnALA65w==
+
dir-glob@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
@@ -1906,6 +1933,13 @@ drizzle-orm@^0.40.1:
resolved "https://registry.yarnpkg.com/drizzle-orm/-/drizzle-orm-0.40.1.tgz#15f1d970d4fb034db2b13e4a33fcbbccda9bf1cb"
integrity sha512-aPNhtiJiPfm3qxz1czrnIDkfvkSdKGXYeZkpG55NPTVI186LmK2fBLMi4dsHpPHlJrZeQ92D322YFPHADBALew==
+duck@^0.1.12:
+ version "0.1.12"
+ resolved "https://registry.yarnpkg.com/duck/-/duck-0.1.12.tgz#de7adf758421230b6d7aee799ce42670586b9efa"
+ integrity sha512-wkctla1O6VfP89gQ+J/yDesM0S7B7XLXjKGzXxMDVFg7uEn706niAtyYovKbyq1oT9YwDcly721/iUWoc8MVRg==
+ dependencies:
+ underscore "^1.13.1"
+
eastasianwidth@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb"
@@ -2788,6 +2822,11 @@ ignore@^5.2.0:
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.1.tgz#5073e554cd42c5b33b394375f538b8593e34d4ef"
integrity sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==
+immediate@~3.0.5:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b"
+ integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==
+
import-fresh@^3.2.1:
version "3.3.0"
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
@@ -2809,7 +2848,7 @@ inflight@^1.0.4:
once "^1.3.0"
wrappy "1"
-inherits@2, inherits@^2.0.3, inherits@^2.0.4:
+inherits@2, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
@@ -3035,6 +3074,11 @@ isarray@^2.0.5:
resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723"
integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==
+isarray@~1.0.0:
+ version "1.0.0"
+ resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
+ integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==
+
isexe@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@@ -3133,6 +3177,16 @@ jsonpointer@^5.0.1:
object.assign "^4.1.4"
object.values "^1.1.6"
+jszip@^3.7.1:
+ version "3.10.1"
+ resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2"
+ integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==
+ dependencies:
+ lie "~3.3.0"
+ pako "~1.0.2"
+ readable-stream "~2.3.6"
+ setimmediate "^1.0.5"
+
keyv@^4.5.3:
version "4.5.4"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93"
@@ -3240,6 +3294,13 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"
+lie@~3.3.0:
+ version "3.3.0"
+ resolved "https://registry.yarnpkg.com/lie/-/lie-3.3.0.tgz#dcf82dee545f46074daf200c7c1c5a08e0f40f6a"
+ integrity sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==
+ dependencies:
+ immediate "~3.0.5"
+
lilconfig@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
@@ -3301,6 +3362,15 @@ loose-envify@^1.1.0, loose-envify@^1.4.0:
dependencies:
js-tokens "^3.0.0 || ^4.0.0"
+lop@^0.4.2:
+ version "0.4.2"
+ resolved "https://registry.yarnpkg.com/lop/-/lop-0.4.2.tgz#c9c2f958a39b9da1c2f36ca9ad66891a9fe84640"
+ integrity sha512-RefILVDQ4DKoRZsJ4Pj22TxE3omDO47yFpkIBoDKzkqPRISs5U1cnAdg/5583YPkWPaLIYHOKRMQSvjFsO26cw==
+ dependencies:
+ duck "^0.1.12"
+ option "~0.2.1"
+ underscore "^1.13.1"
+
lru-cache@^10.2.0:
version "10.2.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3"
@@ -3318,6 +3388,22 @@ lucide-react@^0.363.0:
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.363.0.tgz#2bb1f9d09b830dda86f5118fcd097f87247fe0e3"
integrity sha512-AlsfPCsXQyQx7wwsIgzcKOL9LwC498LIMAo+c0Es5PkHJa33xwmYAkkSoKoJWWWSYQEStqu58/jT4tL2gi32uQ==
+mammoth@^1.7.0:
+ version "1.9.0"
+ resolved "https://registry.yarnpkg.com/mammoth/-/mammoth-1.9.0.tgz#71e34ca280735275788bfe95e653a058dcab4df2"
+ integrity sha512-F+0NxzankQV9XSUAuVKvkdQK0GbtGGuqVnND9aVf9VSeUA82LQa29GjLqYU6Eez8LHqSJG3eGiDW3224OKdpZg==
+ dependencies:
+ "@xmldom/xmldom" "^0.8.6"
+ argparse "~1.0.3"
+ base64-js "^1.5.1"
+ bluebird "~3.4.0"
+ dingbat-to-unicode "^1.0.1"
+ jszip "^3.7.1"
+ lop "^0.4.2"
+ path-is-absolute "^1.0.0"
+ underscore "^1.13.1"
+ xmlbuilder "^10.0.0"
+
markdown-to-jsx@^7.7.2:
version "7.7.2"
resolved "https://registry.yarnpkg.com/markdown-to-jsx/-/markdown-to-jsx-7.7.2.tgz#59c1dd64f48b53719311ab140be3cd51cdabccd3"
@@ -3708,6 +3794,11 @@ openapi-types@^12.1.3:
resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-12.1.3.tgz#471995eb26c4b97b7bd356aacf7b91b73e777dd3"
integrity sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==
+option@~0.2.1:
+ version "0.2.4"
+ resolved "https://registry.yarnpkg.com/option/-/option-0.2.4.tgz#fd475cdf98dcabb3cb397a3ba5284feb45edbfe4"
+ integrity sha512-pkEqbDyl8ou5cpq+VsnQbe/WlEy5qS7xPzMS1U55OCG9KPvwFD46zDbxQIj3egJSFc3D+XhYOPUzz49zQAVy7A==
+
optionator@^0.9.3:
version "0.9.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64"
@@ -3762,6 +3853,11 @@ p-timeout@^3.2.0:
dependencies:
p-finally "^1.0.0"
+pako@~1.0.2:
+ version "1.0.11"
+ resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
+ integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
+
parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
@@ -3951,6 +4047,11 @@ prettier@^3.2.5:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.5.tgz#e52bc3090586e824964a8813b09aba6233b28368"
integrity sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==
+process-nextick-args@~2.0.0:
+ version "2.0.1"
+ resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
+ integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
+
prop-types@^15.8.1:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
@@ -4062,6 +4163,19 @@ readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.2:
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
+readable-stream@~2.3.6:
+ version "2.3.8"
+ resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.8.tgz#91125e8042bba1b9887f49345f6277027ce8be9b"
+ integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==
+ dependencies:
+ core-util-is "~1.0.0"
+ inherits "~2.0.3"
+ isarray "~1.0.0"
+ process-nextick-args "~2.0.0"
+ safe-buffer "~5.1.1"
+ string_decoder "~1.1.1"
+ util-deprecate "~1.0.1"
+
readdirp@~3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7"
@@ -4164,6 +4278,11 @@ safe-buffer@^5.0.1, safe-buffer@~5.2.0:
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
+safe-buffer@~5.1.0, safe-buffer@~5.1.1:
+ version "5.1.2"
+ resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
+ integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
+
safe-regex-test@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/safe-regex-test/-/safe-regex-test-1.0.3.tgz#a5b4c0f06e0ab50ea2c395c14d8371232924c377"
@@ -4231,6 +4350,11 @@ set-function-name@^2.0.1, set-function-name@^2.0.2:
functions-have-names "^1.2.3"
has-property-descriptors "^1.0.2"
+setimmediate@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
+ integrity sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==
+
sharp@^0.32.0:
version "0.32.6"
resolved "https://registry.yarnpkg.com/sharp/-/sharp-0.32.6.tgz#6ad30c0b7cd910df65d5f355f774aa4fce45732a"
@@ -4365,6 +4489,11 @@ source-map@^0.6.0:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
+sprintf-js@~1.0.2:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
+ integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==
+
stack-trace@0.0.x:
version "0.0.10"
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
@@ -4465,6 +4594,13 @@ string_decoder@^1.1.1:
dependencies:
safe-buffer "~5.2.0"
+string_decoder@~1.1.1:
+ version "1.1.1"
+ resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
+ integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
+ dependencies:
+ safe-buffer "~5.1.0"
+
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
@@ -4775,6 +4911,11 @@ unbox-primitive@^1.0.2:
has-symbols "^1.0.3"
which-boxed-primitive "^1.0.2"
+underscore@^1.13.1:
+ version "1.13.7"
+ resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.13.7.tgz#970e33963af9a7dda228f17ebe8399e5fbe63a10"
+ integrity sha512-GMXzWtsc57XAtguZgaQViUOzs0KTkk8ojr3/xAxXLITqf/3EMwxC0inyETfDFjH/Krbhuep0HNbbjI9i/q3F3g==
+
undici-types@~5.26.4:
version "5.26.5"
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
@@ -4817,7 +4958,7 @@ use-latest@^1.2.1:
dependencies:
use-isomorphic-layout-effect "^1.1.1"
-util-deprecate@^1.0.1, util-deprecate@^1.0.2:
+util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
@@ -4978,6 +5119,11 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==
+xmlbuilder@^10.0.0:
+ version "10.1.1"
+ resolved "https://registry.yarnpkg.com/xmlbuilder/-/xmlbuilder-10.1.1.tgz#8cae6688cc9b38d850b7c8d3c0a4161dcaf475b0"
+ integrity sha512-OyzrcFLL/nb6fMGHbiRDuPup9ljBycsdCypwuyg5AAHvyWzGfChJpCXMG88AGTIMFhGZ9RccFN1e6lhg3hkwKg==
+
yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
From 701819d01834e8aefba42ec37ac0a85188851641 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Tue, 13 May 2025 20:14:08 +0530
Subject: [PATCH 02/36] Revert "Update README.md"
This reverts commit 68e151b2bda7490ad9c3f17ee27bf539326143b6.
---
README.md | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/README.md b/README.md
index 9e94028..18c9f84 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,21 @@
# 🚀 Perplexica - An AI-powered search engine 🔎
+
+
Special thanks to:
+
+
+
+
+
+
+### [Warp, the AI Devtool that lives in your terminal](https://www.warp.dev/perplexica)
+
+[Available for MacOS, Linux, & Windows](https://www.warp.dev/perplexica)
+
+
+
+
+
[](https://discord.gg/26aArMy8tT)

From 0c3740fdf2421d3ac9a1601ae133f35bafdb5b2f Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Tue, 27 May 2025 18:23:40 +0530
Subject: [PATCH 03/36] feat(groq-provider): dynamically fetch models
---
src/lib/providers/groq.ts | 98 ++++++---------------------------------
1 file changed, 14 insertions(+), 84 deletions(-)
diff --git a/src/lib/providers/groq.ts b/src/lib/providers/groq.ts
index 4b0ca92..5435de4 100644
--- a/src/lib/providers/groq.ts
+++ b/src/lib/providers/groq.ts
@@ -6,101 +6,31 @@ export const PROVIDER_INFO = {
key: 'groq',
displayName: 'Groq',
};
-import { BaseChatModel } from '@langchain/core/language_models/chat_models';
-const groqChatModels: Record[] = [
- {
- displayName: 'Gemma2 9B IT',
- key: 'gemma2-9b-it',
- },
- {
- displayName: 'Llama 3.3 70B Versatile',
- key: 'llama-3.3-70b-versatile',
- },
- {
- displayName: 'Llama 3.1 8B Instant',
- key: 'llama-3.1-8b-instant',
- },
- {
- displayName: 'Llama3 70B 8192',
- key: 'llama3-70b-8192',
- },
- {
- displayName: 'Llama3 8B 8192',
- key: 'llama3-8b-8192',
- },
- {
- displayName: 'Mixtral 8x7B 32768',
- key: 'mixtral-8x7b-32768',
- },
- {
- displayName: 'Qwen QWQ 32B (Preview)',
- key: 'qwen-qwq-32b',
- },
- {
- displayName: 'Mistral Saba 24B (Preview)',
- key: 'mistral-saba-24b',
- },
- {
- displayName: 'Qwen 2.5 Coder 32B (Preview)',
- key: 'qwen-2.5-coder-32b',
- },
- {
- displayName: 'Qwen 2.5 32B (Preview)',
- key: 'qwen-2.5-32b',
- },
- {
- displayName: 'DeepSeek R1 Distill Qwen 32B (Preview)',
- key: 'deepseek-r1-distill-qwen-32b',
- },
- {
- displayName: 'DeepSeek R1 Distill Llama 70B (Preview)',
- key: 'deepseek-r1-distill-llama-70b',
- },
- {
- displayName: 'Llama 3.3 70B SpecDec (Preview)',
- key: 'llama-3.3-70b-specdec',
- },
- {
- displayName: 'Llama 3.2 1B Preview (Preview)',
- key: 'llama-3.2-1b-preview',
- },
- {
- displayName: 'Llama 3.2 3B Preview (Preview)',
- key: 'llama-3.2-3b-preview',
- },
- {
- displayName: 'Llama 3.2 11B Vision Preview (Preview)',
- key: 'llama-3.2-11b-vision-preview',
- },
- {
- displayName: 'Llama 3.2 90B Vision Preview (Preview)',
- key: 'llama-3.2-90b-vision-preview',
- },
- /* {
- displayName: 'Llama 4 Maverick 17B 128E Instruct (Preview)',
- key: 'meta-llama/llama-4-maverick-17b-128e-instruct',
- }, */
- {
- displayName: 'Llama 4 Scout 17B 16E Instruct (Preview)',
- key: 'meta-llama/llama-4-scout-17b-16e-instruct',
- },
-];
+import { BaseChatModel } from '@langchain/core/language_models/chat_models';
export const loadGroqChatModels = async () => {
const groqApiKey = getGroqApiKey();
-
if (!groqApiKey) return {};
try {
+ const res = await fetch('https://api.groq.com/openai/v1/models', {
+ method: 'GET',
+ headers: {
+ Authorization: `bearer ${groqApiKey}`,
+ 'Content-Type': 'application/json',
+ },
+ });
+
+ const groqChatModels = (await res.json()).data;
const chatModels: Record = {};
- groqChatModels.forEach((model) => {
- chatModels[model.key] = {
- displayName: model.displayName,
+ groqChatModels.forEach((model: any) => {
+ chatModels[model.id] = {
+ displayName: model.id,
model: new ChatOpenAI({
openAIApiKey: groqApiKey,
- modelName: model.key,
+ modelName: model.id,
temperature: 0.7,
configuration: {
baseURL: 'https://api.groq.com/openai/v1',
From bb21184ea273dea127996040fb23f67d107c6a4d Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Tue, 27 May 2025 18:32:09 +0530
Subject: [PATCH 04/36] feat(settings): show loading spinner immediately
---
src/app/settings/page.tsx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx
index 05338c3..6f20f01 100644
--- a/src/app/settings/page.tsx
+++ b/src/app/settings/page.tsx
@@ -143,7 +143,7 @@ const Page = () => {
const [selectedEmbeddingModel, setSelectedEmbeddingModel] = useState<
string | null
>(null);
- const [isLoading, setIsLoading] = useState(false);
+ const [isLoading, setIsLoading] = useState(true);
const [automaticImageSearch, setAutomaticImageSearch] = useState(false);
const [automaticVideoSearch, setAutomaticVideoSearch] = useState(false);
const [systemInstructions, setSystemInstructions] = useState('');
@@ -151,7 +151,6 @@ const Page = () => {
useEffect(() => {
const fetchConfig = async () => {
- setIsLoading(true);
const res = await fetch(`/api/config`, {
headers: {
'Content-Type': 'application/json',
From c80ac1415dbb6760a076ac4e23faca72e49060a2 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Tue, 27 May 2025 18:42:02 +0530
Subject: [PATCH 05/36] feat(app): lint & beautify
---
package.json | 130 +++++++++++++++++++++++++--------------------------
1 file changed, 65 insertions(+), 65 deletions(-)
diff --git a/package.json b/package.json
index 38f22f9..147348c 100644
--- a/package.json
+++ b/package.json
@@ -1,66 +1,66 @@
{
- "name": "perplexica-frontend",
- "version": "1.10.2",
- "license": "MIT",
- "author": "ItzCrazyKns",
- "scripts": {
- "dev": "next dev",
- "build": "npm run db:push && next build",
- "start": "next start",
- "lint": "next lint",
- "format:write": "prettier . --write",
- "db:push": "drizzle-kit push"
- },
- "dependencies": {
- "@headlessui/react": "^2.2.0",
- "@iarna/toml": "^2.2.5",
- "@icons-pack/react-simple-icons": "^12.3.0",
- "@langchain/anthropic": "^0.3.15",
- "@langchain/community": "^0.3.36",
- "@langchain/core": "^0.3.42",
- "@langchain/google-genai": "^0.1.12",
- "@langchain/openai": "^0.0.25",
- "@langchain/textsplitters": "^0.1.0",
- "@tailwindcss/typography": "^0.5.12",
- "@xenova/transformers": "^2.17.2",
- "axios": "^1.8.3",
- "better-sqlite3": "^11.9.1",
- "clsx": "^2.1.0",
- "compute-cosine-similarity": "^1.1.0",
- "compute-dot": "^1.1.0",
- "drizzle-orm": "^0.40.1",
- "html-to-text": "^9.0.5",
- "langchain": "^0.1.30",
- "lucide-react": "^0.363.0",
- "mammoth": "^1.7.0",
- "markdown-to-jsx": "^7.7.2",
- "next": "^15.2.2",
- "next-themes": "^0.3.0",
- "pdf-parse": "^1.1.1",
- "react": "^18",
- "react-dom": "^18",
- "react-text-to-speech": "^0.14.5",
- "react-textarea-autosize": "^8.5.3",
- "sonner": "^1.4.41",
- "tailwind-merge": "^2.2.2",
- "winston": "^3.17.0",
- "yet-another-react-lightbox": "^3.17.2",
- "zod": "^3.22.4"
- },
- "devDependencies": {
- "@types/better-sqlite3": "^7.6.12",
- "@types/html-to-text": "^9.0.4",
- "@types/node": "^20",
- "@types/pdf-parse": "^1.1.4",
- "@types/react": "^18",
- "@types/react-dom": "^18",
- "autoprefixer": "^10.0.1",
- "drizzle-kit": "^0.30.5",
- "eslint": "^8",
- "eslint-config-next": "14.1.4",
- "postcss": "^8",
- "prettier": "^3.2.5",
- "tailwindcss": "^3.3.0",
- "typescript": "^5"
- }
-}
\ No newline at end of file
+ "name": "perplexica-frontend",
+ "version": "1.10.2",
+ "license": "MIT",
+ "author": "ItzCrazyKns",
+ "scripts": {
+ "dev": "next dev",
+ "build": "npm run db:push && next build",
+ "start": "next start",
+ "lint": "next lint",
+ "format:write": "prettier . --write",
+ "db:push": "drizzle-kit push"
+ },
+ "dependencies": {
+ "@headlessui/react": "^2.2.0",
+ "@iarna/toml": "^2.2.5",
+ "@icons-pack/react-simple-icons": "^12.3.0",
+ "@langchain/anthropic": "^0.3.15",
+ "@langchain/community": "^0.3.36",
+ "@langchain/core": "^0.3.42",
+ "@langchain/google-genai": "^0.1.12",
+ "@langchain/openai": "^0.0.25",
+ "@langchain/textsplitters": "^0.1.0",
+ "@tailwindcss/typography": "^0.5.12",
+ "@xenova/transformers": "^2.17.2",
+ "axios": "^1.8.3",
+ "better-sqlite3": "^11.9.1",
+ "clsx": "^2.1.0",
+ "compute-cosine-similarity": "^1.1.0",
+ "compute-dot": "^1.1.0",
+ "drizzle-orm": "^0.40.1",
+ "html-to-text": "^9.0.5",
+ "langchain": "^0.1.30",
+ "lucide-react": "^0.363.0",
+ "mammoth": "^1.7.0",
+ "markdown-to-jsx": "^7.7.2",
+ "next": "^15.2.2",
+ "next-themes": "^0.3.0",
+ "pdf-parse": "^1.1.1",
+ "react": "^18",
+ "react-dom": "^18",
+ "react-text-to-speech": "^0.14.5",
+ "react-textarea-autosize": "^8.5.3",
+ "sonner": "^1.4.41",
+ "tailwind-merge": "^2.2.2",
+ "winston": "^3.17.0",
+ "yet-another-react-lightbox": "^3.17.2",
+ "zod": "^3.22.4"
+ },
+ "devDependencies": {
+ "@types/better-sqlite3": "^7.6.12",
+ "@types/html-to-text": "^9.0.4",
+ "@types/node": "^20",
+ "@types/pdf-parse": "^1.1.4",
+ "@types/react": "^18",
+ "@types/react-dom": "^18",
+ "autoprefixer": "^10.0.1",
+ "drizzle-kit": "^0.30.5",
+ "eslint": "^8",
+ "eslint-config-next": "14.1.4",
+ "postcss": "^8",
+ "prettier": "^3.2.5",
+ "tailwindcss": "^3.3.0",
+ "typescript": "^5"
+ }
+}
From 18da75ad9790e790c0672a8648fa2ec68c613d3a Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Wed, 28 May 2025 10:35:19 +0530
Subject: [PATCH 06/36] feat(db): create migration files
---
drizzle/0000_fuzzy_randall.sql | 16 +++++
drizzle/meta/0000_snapshot.json | 116 ++++++++++++++++++++++++++++++++
drizzle/meta/_journal.json | 13 ++++
3 files changed, 145 insertions(+)
create mode 100644 drizzle/0000_fuzzy_randall.sql
create mode 100644 drizzle/meta/0000_snapshot.json
create mode 100644 drizzle/meta/_journal.json
diff --git a/drizzle/0000_fuzzy_randall.sql b/drizzle/0000_fuzzy_randall.sql
new file mode 100644
index 0000000..0a2ff07
--- /dev/null
+++ b/drizzle/0000_fuzzy_randall.sql
@@ -0,0 +1,16 @@
+CREATE TABLE IF NOT EXISTS `chats` (
+ `id` text PRIMARY KEY NOT NULL,
+ `title` text NOT NULL,
+ `createdAt` text NOT NULL,
+ `focusMode` text NOT NULL,
+ `files` text DEFAULT '[]'
+);
+--> statement-breakpoint
+CREATE TABLE IF NOT EXISTS `messages` (
+ `id` integer PRIMARY KEY NOT NULL,
+ `content` text NOT NULL,
+ `chatId` text NOT NULL,
+ `messageId` text NOT NULL,
+ `type` text,
+ `metadata` text
+);
diff --git a/drizzle/meta/0000_snapshot.json b/drizzle/meta/0000_snapshot.json
new file mode 100644
index 0000000..850bcd3
--- /dev/null
+++ b/drizzle/meta/0000_snapshot.json
@@ -0,0 +1,116 @@
+{
+ "version": "6",
+ "dialect": "sqlite",
+ "id": "ef3a044b-0f34-40b5-babb-2bb3a909ba27",
+ "prevId": "00000000-0000-0000-0000-000000000000",
+ "tables": {
+ "chats": {
+ "name": "chats",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "text",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "title": {
+ "name": "title",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "createdAt": {
+ "name": "createdAt",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "focusMode": {
+ "name": "focusMode",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "files": {
+ "name": "files",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false,
+ "default": "'[]'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ },
+ "messages": {
+ "name": "messages",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "chatId": {
+ "name": "chatId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "messageId": {
+ "name": "messageId",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "autoincrement": false
+ },
+ "type": {
+ "name": "type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ },
+ "metadata": {
+ "name": "metadata",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false,
+ "autoincrement": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "checkConstraints": {}
+ }
+ },
+ "views": {},
+ "enums": {},
+ "_meta": {
+ "schemas": {},
+ "tables": {},
+ "columns": {}
+ },
+ "internal": {
+ "indexes": {}
+ }
+}
diff --git a/drizzle/meta/_journal.json b/drizzle/meta/_journal.json
new file mode 100644
index 0000000..5db59d1
--- /dev/null
+++ b/drizzle/meta/_journal.json
@@ -0,0 +1,13 @@
+{
+ "version": "7",
+ "dialect": "sqlite",
+ "entries": [
+ {
+ "idx": 0,
+ "version": "6",
+ "when": 1748405503809,
+ "tag": "0000_fuzzy_randall",
+ "breakpoints": true
+ }
+ ]
+}
From 876487ad1185f3aed2e18e73a54a33aea7609f94 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Wed, 28 May 2025 10:41:12 +0530
Subject: [PATCH 07/36] feat(db): add migration script, migrate on each run
---
app.dockerfile | 10 +++++++++-
docker-compose.yaml | 1 +
drizzle.config.ts | 3 ++-
entrypoint.sh | 6 ++++++
src/lib/db/index.ts | 3 ++-
src/lib/db/migrate.ts | 5 +++++
6 files changed, 25 insertions(+), 3 deletions(-)
create mode 100644 entrypoint.sh
create mode 100644 src/lib/db/migrate.ts
diff --git a/app.dockerfile b/app.dockerfile
index 3433288..c3c0fd0 100644
--- a/app.dockerfile
+++ b/app.dockerfile
@@ -12,6 +12,9 @@ COPY public ./public
RUN mkdir -p /home/perplexica/data
RUN yarn build
+RUN yarn add --dev @vercel/ncc
+RUN yarn ncc build ./src/lib/db/migrate.ts -o migrator
+
FROM node:20.18.0-slim
WORKDIR /home/perplexica
@@ -21,7 +24,12 @@ COPY --from=builder /home/perplexica/.next/static ./public/_next/static
COPY --from=builder /home/perplexica/.next/standalone ./
COPY --from=builder /home/perplexica/data ./data
+COPY drizzle ./drizzle
+COPY --from=builder /home/perplexica/migrator/build ./build
+COPY --from=builder /home/perplexica/migrator/index.js ./migrate.js
RUN mkdir /home/perplexica/uploads
-CMD ["node", "server.js"]
\ No newline at end of file
+COPY entrypoint.sh ./entrypoint.sh
+RUN chmod +x ./entrypoint.sh
+CMD ["./entrypoint.sh"]
\ No newline at end of file
diff --git a/docker-compose.yaml b/docker-compose.yaml
index b702b4e..b32e0a9 100644
--- a/docker-compose.yaml
+++ b/docker-compose.yaml
@@ -16,6 +16,7 @@ services:
dockerfile: app.dockerfile
environment:
- SEARXNG_API_URL=http://searxng:8080
+ - DATA_DIR=/home/perplexica
ports:
- 3000:3000
networks:
diff --git a/drizzle.config.ts b/drizzle.config.ts
index 58de9e0..a029112 100644
--- a/drizzle.config.ts
+++ b/drizzle.config.ts
@@ -1,10 +1,11 @@
import { defineConfig } from 'drizzle-kit';
+import path from 'path';
export default defineConfig({
dialect: 'sqlite',
schema: './src/lib/db/schema.ts',
out: './drizzle',
dbCredentials: {
- url: './data/db.sqlite',
+ url: path.join(process.cwd(), 'data', 'db.sqlite'),
},
});
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644
index 0000000..9f9448a
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+set -e
+
+node migrate.js
+
+exec node server.js
\ No newline at end of file
diff --git a/src/lib/db/index.ts b/src/lib/db/index.ts
index 9b761d4..515cdb3 100644
--- a/src/lib/db/index.ts
+++ b/src/lib/db/index.ts
@@ -3,7 +3,8 @@ import Database from 'better-sqlite3';
import * as schema from './schema';
import path from 'path';
-const sqlite = new Database(path.join(process.cwd(), 'data/db.sqlite'));
+const DATA_DIR = process.env.DATA_DIR || process.cwd();
+const sqlite = new Database(path.join(DATA_DIR, './data/db.sqlite'));
const db = drizzle(sqlite, {
schema: schema,
});
diff --git a/src/lib/db/migrate.ts b/src/lib/db/migrate.ts
new file mode 100644
index 0000000..c3ebff6
--- /dev/null
+++ b/src/lib/db/migrate.ts
@@ -0,0 +1,5 @@
+import db from './';
+import { migrate } from 'drizzle-orm/better-sqlite3/migrator';
+import path from 'path';
+
+migrate(db, { migrationsFolder: path.join(process.cwd(), 'drizzle') });
From bcebdb5fd98bc13413596659823b82be00685315 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Wed, 28 May 2025 13:01:05 +0530
Subject: [PATCH 08/36] feat(chat): allow export as pdf or markdown
---
package.json | 2 +
src/components/Navbar.tsx | 155 ++++++++++++++++++++++++++++++++++++--
yarn.lock | 144 +++++++++++++++++++++++++++++++++++
3 files changed, 295 insertions(+), 6 deletions(-)
diff --git a/package.json b/package.json
index e68410f..5746fd3 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
"compute-dot": "^1.1.0",
"drizzle-orm": "^0.40.1",
"html-to-text": "^9.0.5",
+ "jspdf": "^3.0.1",
"langchain": "^0.1.30",
"lucide-react": "^0.363.0",
"markdown-to-jsx": "^7.7.2",
@@ -49,6 +50,7 @@
"devDependencies": {
"@types/better-sqlite3": "^7.6.12",
"@types/html-to-text": "^9.0.4",
+ "@types/jspdf": "^2.0.0",
"@types/node": "^20",
"@types/pdf-parse": "^1.1.4",
"@types/react": "^18",
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx
index 13f2da3..e406ade 100644
--- a/src/components/Navbar.tsx
+++ b/src/components/Navbar.tsx
@@ -1,8 +1,122 @@
-import { Clock, Edit, Share, Trash } from 'lucide-react';
+import { Clock, Edit, Share, Trash, FileText, FileDown } from 'lucide-react';
import { Message } from './ChatWindow';
-import { useEffect, useState } from 'react';
+import { useEffect, useState, Fragment } from 'react';
import { formatTimeDifference } from '@/lib/utils';
import DeleteChat from './DeleteChat';
+import {
+ Popover,
+ PopoverButton,
+ PopoverPanel,
+ Transition,
+} from '@headlessui/react';
+import jsPDF from 'jspdf';
+
+const downloadFile = (filename: string, content: string, type: string) => {
+ const blob = new Blob([content], { type });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = filename;
+ document.body.appendChild(a);
+ a.click();
+ setTimeout(() => {
+ document.body.removeChild(a);
+ URL.revokeObjectURL(url);
+ }, 0);
+};
+
+const exportAsMarkdown = (messages: Message[], title: string) => {
+ const date = new Date(messages[0]?.createdAt || Date.now()).toLocaleString();
+ let md = `# 💬 Chat Export: ${title}\n\n`;
+ md += `*Exported on: ${date}*\n\n---\n`;
+ messages.forEach((msg, idx) => {
+ md += `\n---\n`;
+ md += `**${msg.role === 'user' ? '🧑 User' : '🤖 Assistant'}**
+`;
+ md += `*${new Date(msg.createdAt).toLocaleString()}*\n\n`;
+ md += `> ${msg.content.replace(/\n/g, '\n> ')}\n`;
+ if (msg.sources && msg.sources.length > 0) {
+ md += `\n**Citations:**\n`;
+ msg.sources.forEach((src: any, i: number) => {
+ const url = src.metadata?.url || '';
+ md += `- [${i + 1}] [${url}](${url})\n`;
+ });
+ }
+ });
+ md += '\n---\n';
+ downloadFile(`${title || 'chat'}.md`, md, 'text/markdown');
+};
+
+const exportAsPDF = (messages: Message[], title: string) => {
+ const doc = new jsPDF();
+ const date = new Date(messages[0]?.createdAt || Date.now()).toLocaleString();
+ let y = 15;
+ const pageHeight = doc.internal.pageSize.height;
+ doc.setFontSize(18);
+ doc.text(`Chat Export: ${title}`, 10, y);
+ y += 8;
+ doc.setFontSize(11);
+ doc.setTextColor(100);
+ doc.text(`Exported on: ${date}`, 10, y);
+ y += 8;
+ doc.setDrawColor(200);
+ doc.line(10, y, 200, y);
+ y += 6;
+ doc.setTextColor(30);
+ messages.forEach((msg, idx) => {
+ if (y > pageHeight - 30) {
+ doc.addPage();
+ y = 15;
+ }
+ doc.setFont('helvetica', 'bold');
+ doc.text(`${msg.role === 'user' ? 'User' : 'Assistant'}`, 10, y);
+ doc.setFont('helvetica', 'normal');
+ doc.setFontSize(10);
+ doc.setTextColor(120);
+ doc.text(`${new Date(msg.createdAt).toLocaleString()}`, 40, y);
+ y += 6;
+ doc.setTextColor(30);
+ doc.setFontSize(12);
+ const lines = doc.splitTextToSize(msg.content, 180);
+ for (let i = 0; i < lines.length; i++) {
+ if (y > pageHeight - 20) {
+ doc.addPage();
+ y = 15;
+ }
+ doc.text(lines[i], 12, y);
+ y += 6;
+ }
+ if (msg.sources && msg.sources.length > 0) {
+ doc.setFontSize(11);
+ doc.setTextColor(80);
+ if (y > pageHeight - 20) {
+ doc.addPage();
+ y = 15;
+ }
+ doc.text('Citations:', 12, y);
+ y += 5;
+ msg.sources.forEach((src: any, i: number) => {
+ const url = src.metadata?.url || '';
+ if (y > pageHeight - 15) {
+ doc.addPage();
+ y = 15;
+ }
+ doc.text(`- [${i + 1}] ${url}`, 15, y);
+ y += 5;
+ });
+ doc.setTextColor(30);
+ }
+ y += 6;
+ doc.setDrawColor(230);
+ if (y > pageHeight - 10) {
+ doc.addPage();
+ y = 15;
+ }
+ doc.line(10, y, 200, y);
+ y += 4;
+ });
+ doc.save(`${title || 'chat'}.pdf`);
+};
const Navbar = ({
chatId,
@@ -59,10 +173,39 @@ const Navbar = ({
{title}
-
+
+
+
+
+
+
+
+ exportAsMarkdown(messages, title || '')}
+ >
+
+ Export as Markdown
+
+ exportAsPDF(messages, title || '')}
+ >
+
+ Export as PDF
+
+
+
+
+
{}} />
diff --git a/yarn.lock b/yarn.lock
index 921186b..58b53ac 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -40,6 +40,11 @@
node-fetch "^2.6.7"
web-streams-polyfill "^3.2.1"
+"@babel/runtime@^7.12.5", "@babel/runtime@^7.26.7":
+ version "7.27.3"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.3.tgz#10491113799fb8d77e1d9273384d5d68deeea8f6"
+ integrity sha512-7EYtGezsdiDMyY80+65EzwiGmcJqpmcZCojSXaRgdrBaGtWTgDZKq69cPIVped6MkIM78cTQ2GOiEYjwOlG4xw==
+
"@babel/runtime@^7.20.13", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.0":
version "7.24.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd"
@@ -966,6 +971,13 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
+"@types/jspdf@^2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@types/jspdf/-/jspdf-2.0.0.tgz#c64d63e9248a62849902085c1cd4753b33f8ee0c"
+ integrity sha512-oonYDXI4GegGaG7FFVtriJ+Yqlh4YR3L3NVDiwCEBVG7sbya19SoGx4MW4kg1MCMRPgkbbFTck8YKJL8PrkDfA==
+ dependencies:
+ jspdf "*"
+
"@types/long@^4.0.1":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
@@ -1010,6 +1022,11 @@
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==
+"@types/raf@^3.4.0":
+ version "3.4.3"
+ resolved "https://registry.yarnpkg.com/@types/raf/-/raf-3.4.3.tgz#85f1d1d17569b28b8db45e16e996407a56b0ab04"
+ integrity sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==
+
"@types/react-dom@^18":
version "18.2.24"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.24.tgz#8dda8f449ae436a7a6e91efed8035d4ab03ff759"
@@ -1035,6 +1052,11 @@
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c"
integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==
+"@types/trusted-types@^2.0.7":
+ version "2.0.7"
+ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
+ integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
+
"@types/uuid@^10.0.0":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d"
@@ -1317,6 +1339,11 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
+atob@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
+ integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
+
autoprefixer@^10.0.1:
version "10.4.19"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.19.tgz#ad25a856e82ee9d7898c59583c1afeb3fa65f89f"
@@ -1405,6 +1432,11 @@ base-64@^0.1.0:
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==
+base64-arraybuffer@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc"
+ integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==
+
base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
@@ -1476,6 +1508,11 @@ browserslist@^4.23.0:
node-releases "^2.0.14"
update-browserslist-db "^1.0.13"
+btoa@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73"
+ integrity sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==
+
buffer-from@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
@@ -1532,6 +1569,20 @@ caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001606.tgz#b4d5f67ab0746a3b8b5b6d1f06e39c51beb39a9e"
integrity sha512-LPbwnW4vfpJId225pwjZJOgX1m9sGfbw/RKJvw/t0QhYOOaTXHvkjVGFGPpvwEzufrjvTlsULnVTxdy4/6cqkg==
+canvg@^3.0.11:
+ version "3.0.11"
+ resolved "https://registry.yarnpkg.com/canvg/-/canvg-3.0.11.tgz#4b4290a6c7fa36871fac2b14e432eff33b33cf2b"
+ integrity sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+ "@types/raf" "^3.4.0"
+ core-js "^3.8.3"
+ raf "^3.4.1"
+ regenerator-runtime "^0.13.7"
+ rgbcolor "^1.0.1"
+ stackblur-canvas "^2.0.0"
+ svg-pathdata "^6.0.3"
+
chalk@^4.0.0, chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
@@ -1691,6 +1742,11 @@ console-table-printer@^2.12.1:
dependencies:
simple-wcswidth "^1.0.1"
+core-js@^3.6.0, core-js@^3.8.3:
+ version "3.42.0"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.42.0.tgz#edbe91f78ac8cfb6df8d997e74d368a68082fe37"
+ integrity sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==
+
cross-spawn@^7.0.0, cross-spawn@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
@@ -1705,6 +1761,13 @@ crypt@0.0.2:
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==
+css-line-break@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/css-line-break/-/css-line-break-2.1.0.tgz#bfef660dfa6f5397ea54116bb3cb4873edbc4fa0"
+ integrity sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==
+ dependencies:
+ utrie "^1.0.2"
+
cssesc@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
@@ -1881,6 +1944,13 @@ domhandler@^5.0.2, domhandler@^5.0.3:
dependencies:
domelementtype "^2.3.0"
+dompurify@^3.2.4:
+ version "3.2.6"
+ resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.6.tgz#ca040a6ad2b88e2a92dc45f38c79f84a714a1cad"
+ integrity sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==
+ optionalDependencies:
+ "@types/trusted-types" "^2.0.7"
+
domutils@^3.0.1:
version "3.2.2"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.2.2.tgz#edbfe2b668b0c1d97c24baf0f1062b132221bc78"
@@ -2424,6 +2494,11 @@ fecha@^4.2.0:
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd"
integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==
+fflate@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea"
+ integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==
+
file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
@@ -2761,6 +2836,14 @@ html-to-text@^9.0.5:
htmlparser2 "^8.0.2"
selderee "^0.11.0"
+html2canvas@^1.0.0-rc.5:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543"
+ integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==
+ dependencies:
+ css-line-break "^2.1.0"
+ text-segmentation "^1.0.3"
+
htmlparser2@^8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21"
@@ -3123,6 +3206,21 @@ jsonpointer@^5.0.1:
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559"
integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==
+jspdf@*, jspdf@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/jspdf/-/jspdf-3.0.1.tgz#d81e1964f354f60412516eb2449ea2cccd4d2a3b"
+ integrity sha512-qaGIxqxetdoNnFQQXxTKUD9/Z7AloLaw94fFsOiJMxbfYdBbrBuhWmbzI8TVjrw7s3jBY1PFHofBKMV/wZPapg==
+ dependencies:
+ "@babel/runtime" "^7.26.7"
+ atob "^2.1.2"
+ btoa "^1.2.1"
+ fflate "^0.8.1"
+ optionalDependencies:
+ canvg "^3.0.11"
+ core-js "^3.6.0"
+ dompurify "^3.2.4"
+ html2canvas "^1.0.0-rc.5"
+
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5:
version "3.3.5"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a"
@@ -3823,6 +3921,11 @@ peberminta@^0.9.0:
resolved "https://registry.yarnpkg.com/peberminta/-/peberminta-0.9.0.tgz#8ec9bc0eb84b7d368126e71ce9033501dca2a352"
integrity sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==
+performance-now@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
+ integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==
+
picocolors@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
@@ -4002,6 +4105,13 @@ queue-microtask@^1.2.2:
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
+raf@^3.4.1:
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
+ integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
+ dependencies:
+ performance-now "^2.1.0"
+
rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -4082,6 +4192,11 @@ reflect.getprototypeof@^1.0.4:
globalthis "^1.0.3"
which-builtin-type "^1.1.3"
+regenerator-runtime@^0.13.7:
+ version "0.13.11"
+ resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
+ integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
+
regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
@@ -4135,6 +4250,11 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
+rgbcolor@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/rgbcolor/-/rgbcolor-1.0.1.tgz#d6505ecdb304a6595da26fa4b43307306775945d"
+ integrity sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==
+
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
@@ -4370,6 +4490,11 @@ stack-trace@0.0.x:
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==
+stackblur-canvas@^2.0.0:
+ version "2.7.0"
+ resolved "https://registry.yarnpkg.com/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz#af931277d0b5096df55e1f91c530043e066989b6"
+ integrity sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==
+
streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
@@ -4538,6 +4663,11 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+svg-pathdata@^6.0.3:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz#80b0e0283b652ccbafb69ad4f8f73e8d3fbf2cac"
+ integrity sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==
+
tabbable@^6.0.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.2.0.tgz#732fb62bc0175cfcec257330be187dcfba1f3b97"
@@ -4636,6 +4766,13 @@ text-hex@1.0.x:
resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5"
integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==
+text-segmentation@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/text-segmentation/-/text-segmentation-1.0.3.tgz#52a388159efffe746b24a63ba311b6ac9f2d7943"
+ integrity sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==
+ dependencies:
+ utrie "^1.0.2"
+
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -4822,6 +4959,13 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
+utrie@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/utrie/-/utrie-1.0.2.tgz#d42fe44de9bc0119c25de7f564a6ed1b2c87a645"
+ integrity sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==
+ dependencies:
+ base64-arraybuffer "^1.0.2"
+
uuid@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294"
From 41fc5274ffc2fa6563db18c8aad94cccd0e0a627 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Thu, 29 May 2025 19:13:20 +0530
Subject: [PATCH 09/36] feat(package): update package files
---
package.json | 4 +-
yarn.lock | 152 +++++++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 151 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 147348c..a8fd416 100644
--- a/package.json
+++ b/package.json
@@ -30,9 +30,10 @@
"compute-dot": "^1.1.0",
"drizzle-orm": "^0.40.1",
"html-to-text": "^9.0.5",
+ "jspdf": "^3.0.1",
"langchain": "^0.1.30",
"lucide-react": "^0.363.0",
- "mammoth": "^1.7.0",
+ "mammoth": "^1.9.1",
"markdown-to-jsx": "^7.7.2",
"next": "^15.2.2",
"next-themes": "^0.3.0",
@@ -50,6 +51,7 @@
"devDependencies": {
"@types/better-sqlite3": "^7.6.12",
"@types/html-to-text": "^9.0.4",
+ "@types/jspdf": "^2.0.0",
"@types/node": "^20",
"@types/pdf-parse": "^1.1.4",
"@types/react": "^18",
diff --git a/yarn.lock b/yarn.lock
index ffd6648..f2b847c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -40,6 +40,11 @@
node-fetch "^2.6.7"
web-streams-polyfill "^3.2.1"
+"@babel/runtime@^7.12.5", "@babel/runtime@^7.26.7":
+ version "7.27.3"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.3.tgz#10491113799fb8d77e1d9273384d5d68deeea8f6"
+ integrity sha512-7EYtGezsdiDMyY80+65EzwiGmcJqpmcZCojSXaRgdrBaGtWTgDZKq69cPIVped6MkIM78cTQ2GOiEYjwOlG4xw==
+
"@babel/runtime@^7.20.13", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.0":
version "7.24.4"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd"
@@ -966,6 +971,13 @@
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==
+"@types/jspdf@^2.0.0":
+ version "2.0.0"
+ resolved "https://registry.yarnpkg.com/@types/jspdf/-/jspdf-2.0.0.tgz#c64d63e9248a62849902085c1cd4753b33f8ee0c"
+ integrity sha512-oonYDXI4GegGaG7FFVtriJ+Yqlh4YR3L3NVDiwCEBVG7sbya19SoGx4MW4kg1MCMRPgkbbFTck8YKJL8PrkDfA==
+ dependencies:
+ jspdf "*"
+
"@types/long@^4.0.1":
version "4.0.2"
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
@@ -1010,6 +1022,11 @@
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.12.tgz#12bb1e2be27293c1406acb6af1c3f3a1481d98c6"
integrity sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==
+"@types/raf@^3.4.0":
+ version "3.4.3"
+ resolved "https://registry.yarnpkg.com/@types/raf/-/raf-3.4.3.tgz#85f1d1d17569b28b8db45e16e996407a56b0ab04"
+ integrity sha512-c4YAvMedbPZ5tEyxzQdMoOhhJ4RD3rngZIdwC2/qDN3d7JpEhB6fiBRKVY1lg5B7Wk+uPBjn5f39j1/2MY1oOw==
+
"@types/react-dom@^18":
version "18.2.24"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.24.tgz#8dda8f449ae436a7a6e91efed8035d4ab03ff759"
@@ -1035,6 +1052,11 @@
resolved "https://registry.yarnpkg.com/@types/triple-beam/-/triple-beam-1.3.5.tgz#74fef9ffbaa198eb8b588be029f38b00299caa2c"
integrity sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==
+"@types/trusted-types@^2.0.7":
+ version "2.0.7"
+ resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.7.tgz#baccb07a970b91707df3a3e8ba6896c57ead2d11"
+ integrity sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==
+
"@types/uuid@^10.0.0":
version "10.0.0"
resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d"
@@ -1329,6 +1351,11 @@ asynckit@^0.4.0:
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
+atob@^2.1.2:
+ version "2.1.2"
+ resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
+ integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==
+
autoprefixer@^10.0.1:
version "10.4.19"
resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-10.4.19.tgz#ad25a856e82ee9d7898c59583c1afeb3fa65f89f"
@@ -1417,6 +1444,11 @@ base-64@^0.1.0:
resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb"
integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA==
+base64-arraybuffer@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc"
+ integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==
+
base64-js@^1.3.1, base64-js@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
@@ -1493,6 +1525,11 @@ browserslist@^4.23.0:
node-releases "^2.0.14"
update-browserslist-db "^1.0.13"
+btoa@^1.2.1:
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73"
+ integrity sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g==
+
buffer-from@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5"
@@ -1549,6 +1586,20 @@ caniuse-lite@^1.0.30001587, caniuse-lite@^1.0.30001599:
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001606.tgz#b4d5f67ab0746a3b8b5b6d1f06e39c51beb39a9e"
integrity sha512-LPbwnW4vfpJId225pwjZJOgX1m9sGfbw/RKJvw/t0QhYOOaTXHvkjVGFGPpvwEzufrjvTlsULnVTxdy4/6cqkg==
+canvg@^3.0.11:
+ version "3.0.11"
+ resolved "https://registry.yarnpkg.com/canvg/-/canvg-3.0.11.tgz#4b4290a6c7fa36871fac2b14e432eff33b33cf2b"
+ integrity sha512-5ON+q7jCTgMp9cjpu4Jo6XbvfYwSB2Ow3kzHKfIyJfaCAOHLbdKPQqGKgfED/R5B+3TFFfe8pegYA+b423SRyA==
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+ "@types/raf" "^3.4.0"
+ core-js "^3.8.3"
+ raf "^3.4.1"
+ regenerator-runtime "^0.13.7"
+ rgbcolor "^1.0.1"
+ stackblur-canvas "^2.0.0"
+ svg-pathdata "^6.0.3"
+
chalk@^4.0.0, chalk@^4.1.2:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
@@ -1708,6 +1759,11 @@ console-table-printer@^2.12.1:
dependencies:
simple-wcswidth "^1.0.1"
+core-js@^3.6.0, core-js@^3.8.3:
+ version "3.42.0"
+ resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.42.0.tgz#edbe91f78ac8cfb6df8d997e74d368a68082fe37"
+ integrity sha512-Sz4PP4ZA+Rq4II21qkNqOEDTDrCvcANId3xpIgB34NDkWc3UduWj2dqEtN9yZIq8Dk3HyPI33x9sqqU5C8sr0g==
+
core-util-is@~1.0.0:
version "1.0.3"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
@@ -1727,6 +1783,13 @@ crypt@0.0.2:
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b"
integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==
+css-line-break@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/css-line-break/-/css-line-break-2.1.0.tgz#bfef660dfa6f5397ea54116bb3cb4873edbc4fa0"
+ integrity sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==
+ dependencies:
+ utrie "^1.0.2"
+
cssesc@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee"
@@ -1908,6 +1971,13 @@ domhandler@^5.0.2, domhandler@^5.0.3:
dependencies:
domelementtype "^2.3.0"
+dompurify@^3.2.4:
+ version "3.2.6"
+ resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.2.6.tgz#ca040a6ad2b88e2a92dc45f38c79f84a714a1cad"
+ integrity sha512-/2GogDQlohXPZe6D6NOgQvXLPSYBqIWMnZ8zzOhn09REE4eyAzb+Hed3jhoM9OkuaJ8P6ZGTTVWQKAi8ieIzfQ==
+ optionalDependencies:
+ "@types/trusted-types" "^2.0.7"
+
domutils@^3.0.1:
version "3.2.2"
resolved "https://registry.yarnpkg.com/domutils/-/domutils-3.2.2.tgz#edbfe2b668b0c1d97c24baf0f1062b132221bc78"
@@ -2458,6 +2528,11 @@ fecha@^4.2.0:
resolved "https://registry.yarnpkg.com/fecha/-/fecha-4.2.3.tgz#4d9ccdbc61e8629b259fdca67e65891448d569fd"
integrity sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==
+fflate@^0.8.1:
+ version "0.8.2"
+ resolved "https://registry.yarnpkg.com/fflate/-/fflate-0.8.2.tgz#fc8631f5347812ad6028bbe4a2308b2792aa1dea"
+ integrity sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==
+
file-entry-cache@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027"
@@ -2795,6 +2870,14 @@ html-to-text@^9.0.5:
htmlparser2 "^8.0.2"
selderee "^0.11.0"
+html2canvas@^1.0.0-rc.5:
+ version "1.4.1"
+ resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543"
+ integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==
+ dependencies:
+ css-line-break "^2.1.0"
+ text-segmentation "^1.0.3"
+
htmlparser2@^8.0.2:
version "8.0.2"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-8.0.2.tgz#f002151705b383e62433b5cf466f5b716edaec21"
@@ -3167,6 +3250,21 @@ jsonpointer@^5.0.1:
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559"
integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ==
+jspdf@*, jspdf@^3.0.1:
+ version "3.0.1"
+ resolved "https://registry.yarnpkg.com/jspdf/-/jspdf-3.0.1.tgz#d81e1964f354f60412516eb2449ea2cccd4d2a3b"
+ integrity sha512-qaGIxqxetdoNnFQQXxTKUD9/Z7AloLaw94fFsOiJMxbfYdBbrBuhWmbzI8TVjrw7s3jBY1PFHofBKMV/wZPapg==
+ dependencies:
+ "@babel/runtime" "^7.26.7"
+ atob "^2.1.2"
+ btoa "^1.2.1"
+ fflate "^0.8.1"
+ optionalDependencies:
+ canvg "^3.0.11"
+ core-js "^3.6.0"
+ dompurify "^3.2.4"
+ html2canvas "^1.0.0-rc.5"
+
"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.5:
version "3.3.5"
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz#4766bd05a8e2a11af222becd19e15575e52a853a"
@@ -3388,10 +3486,10 @@ lucide-react@^0.363.0:
resolved "https://registry.yarnpkg.com/lucide-react/-/lucide-react-0.363.0.tgz#2bb1f9d09b830dda86f5118fcd097f87247fe0e3"
integrity sha512-AlsfPCsXQyQx7wwsIgzcKOL9LwC498LIMAo+c0Es5PkHJa33xwmYAkkSoKoJWWWSYQEStqu58/jT4tL2gi32uQ==
-mammoth@^1.7.0:
- version "1.9.0"
- resolved "https://registry.yarnpkg.com/mammoth/-/mammoth-1.9.0.tgz#71e34ca280735275788bfe95e653a058dcab4df2"
- integrity sha512-F+0NxzankQV9XSUAuVKvkdQK0GbtGGuqVnND9aVf9VSeUA82LQa29GjLqYU6Eez8LHqSJG3eGiDW3224OKdpZg==
+mammoth@^1.9.1:
+ version "1.9.1"
+ resolved "https://registry.yarnpkg.com/mammoth/-/mammoth-1.9.1.tgz#b544c26747a412b5b00a11aa80477c6796860eaf"
+ integrity sha512-4S2v1eP4Yo4so0zGNicJKcP93su3wDPcUk+xvkjSG75nlNjSkDJu8BhWQ+e54BROM0HfA6nPzJn12S6bq2Ko6w==
dependencies:
"@xmldom/xmldom" "^0.8.6"
argparse "~1.0.3"
@@ -3919,6 +4017,11 @@ peberminta@^0.9.0:
resolved "https://registry.yarnpkg.com/peberminta/-/peberminta-0.9.0.tgz#8ec9bc0eb84b7d368126e71ce9033501dca2a352"
integrity sha512-XIxfHpEuSJbITd1H3EeQwpcZbTLHc+VVr8ANI9t5sit565tsI4/xK3KWTUFE2e6QiangUkh3B0jihzmGnNrRsQ==
+performance-now@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
+ integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==
+
picocolors@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b"
@@ -4103,6 +4206,13 @@ queue-microtask@^1.2.2:
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==
+raf@^3.4.1:
+ version "3.4.1"
+ resolved "https://registry.yarnpkg.com/raf/-/raf-3.4.1.tgz#0742e99a4a6552f445d73e3ee0328af0ff1ede39"
+ integrity sha512-Sq4CW4QhwOHE8ucn6J34MqtZCeWFP2aQSmrlroYgqAV1PjStIhJXxYuTgUIfkEk7zTLjmIjLmU5q+fbD1NnOJA==
+ dependencies:
+ performance-now "^2.1.0"
+
rc@^1.2.7:
version "1.2.8"
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -4196,6 +4306,11 @@ reflect.getprototypeof@^1.0.4:
globalthis "^1.0.3"
which-builtin-type "^1.1.3"
+regenerator-runtime@^0.13.7:
+ version "0.13.11"
+ resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9"
+ integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==
+
regenerator-runtime@^0.14.0:
version "0.14.1"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f"
@@ -4249,6 +4364,11 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==
+rgbcolor@^1.0.1:
+ version "1.0.1"
+ resolved "https://registry.yarnpkg.com/rgbcolor/-/rgbcolor-1.0.1.tgz#d6505ecdb304a6595da26fa4b43307306775945d"
+ integrity sha512-9aZLIrhRaD97sgVhtJOW6ckOEh6/GnvQtdVNfdZ6s67+3/XwLS9lBcQYzEEhYVeUowN7pRzMLsyGhK2i/xvWbw==
+
rimraf@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a"
@@ -4499,6 +4619,11 @@ stack-trace@0.0.x:
resolved "https://registry.yarnpkg.com/stack-trace/-/stack-trace-0.0.10.tgz#547c70b347e8d32b4e108ea1a2a159e5fdde19c0"
integrity sha512-KGzahc7puUKkzyMt+IqAep+TVNbKP+k2Lmwhub39m1AsTSkaDutx56aDCo+HLDzf/D26BIHTJWNiTG1KAJiQCg==
+stackblur-canvas@^2.0.0:
+ version "2.7.0"
+ resolved "https://registry.yarnpkg.com/stackblur-canvas/-/stackblur-canvas-2.7.0.tgz#af931277d0b5096df55e1f91c530043e066989b6"
+ integrity sha512-yf7OENo23AGJhBriGx0QivY5JP6Y1HbrrDI6WLt6C5auYZXlQrheoY8hD4ibekFKz1HOfE48Ww8kMWMnJD/zcQ==
+
streamsearch@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764"
@@ -4674,6 +4799,11 @@ supports-preserve-symlinks-flag@^1.0.0:
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
+svg-pathdata@^6.0.3:
+ version "6.0.3"
+ resolved "https://registry.yarnpkg.com/svg-pathdata/-/svg-pathdata-6.0.3.tgz#80b0e0283b652ccbafb69ad4f8f73e8d3fbf2cac"
+ integrity sha512-qsjeeq5YjBZ5eMdFuUa4ZosMLxgr5RZ+F+Y1OrDhuOCEInRMA3x74XdBtggJcj9kOeInz0WE+LgCPDkZFlBYJw==
+
tabbable@^6.0.0:
version "6.2.0"
resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.2.0.tgz#732fb62bc0175cfcec257330be187dcfba1f3b97"
@@ -4772,6 +4902,13 @@ text-hex@1.0.x:
resolved "https://registry.yarnpkg.com/text-hex/-/text-hex-1.0.0.tgz#69dc9c1b17446ee79a92bf5b884bb4b9127506f5"
integrity sha512-uuVGNWzgJ4yhRaNSiubPY7OjISw4sw4E5Uv0wbjp+OzcbmVU/rsT8ujgcXJhn9ypzsgr5vlzpPqP+MBBKcGvbg==
+text-segmentation@^1.0.3:
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/text-segmentation/-/text-segmentation-1.0.3.tgz#52a388159efffe746b24a63ba311b6ac9f2d7943"
+ integrity sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==
+ dependencies:
+ utrie "^1.0.2"
+
text-table@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
@@ -4963,6 +5100,13 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
+utrie@^1.0.2:
+ version "1.0.2"
+ resolved "https://registry.yarnpkg.com/utrie/-/utrie-1.0.2.tgz#d42fe44de9bc0119c25de7f564a6ed1b2c87a645"
+ integrity sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==
+ dependencies:
+ base64-arraybuffer "^1.0.2"
+
uuid@^10.0.0:
version "10.0.0"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-10.0.0.tgz#5a95aa454e6e002725c79055fd42aaba30ca6294"
From 91306dc0c7b49c50f0af573855a7fdc898a1df17 Mon Sep 17 00:00:00 2001
From: alckasoc
Date: Thu, 29 May 2025 18:26:36 -0700
Subject: [PATCH 10/36] update gemini 2.5 pro key
---
src/lib/providers/gemini.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/lib/providers/gemini.ts b/src/lib/providers/gemini.ts
index 6cf2243..29b33b5 100644
--- a/src/lib/providers/gemini.ts
+++ b/src/lib/providers/gemini.ts
@@ -15,7 +15,7 @@ import { Embeddings } from '@langchain/core/embeddings';
const geminiChatModels: Record[] = [
{
displayName: 'Gemini 2.5 Pro Experimental',
- key: 'gemini-2.5-pro-exp-03-25',
+ key: 'gemini-2.5-pro-preview-05-06',
},
{
displayName: 'Gemini 2.0 Flash',
From 117a683d9a0cf7726aec24d5a0f688a7de00afa8 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 08:34:47 +0530
Subject: [PATCH 11/36] feat(assets): add weather icons
---
public/weather/clear-day.svg | 131 ++++++
public/weather/clear-night.svg | 159 ++++++++
public/weather/cloudy-1-day.svg | 178 +++++++++
public/weather/cloudy-1-night.svg | 206 ++++++++++
public/weather/fog-day.svg | 244 ++++++++++++
public/weather/fog-night.svg | 309 +++++++++++++++
public/weather/frost-day.svg | 204 ++++++++++
public/weather/frost-night.svg | 269 +++++++++++++
public/weather/rain-and-sleet-mix.svg | 141 +++++++
public/weather/rainy-1-day.svg | 179 +++++++++
public/weather/rainy-1-night.svg | 243 ++++++++++++
public/weather/rainy-2-day.svg | 204 ++++++++++
public/weather/rainy-2-night.svg | 256 ++++++++++++
public/weather/rainy-3-day.svg | 206 ++++++++++
public/weather/rainy-3-night.svg | 270 +++++++++++++
.../weather/scattered-thunderstorms-day.svg | 374 ++++++++++++++++++
.../weather/scattered-thunderstorms-night.svg | 283 +++++++++++++
public/weather/severe-thunderstorm.svg | 307 ++++++++++++++
public/weather/snowy-1-day.svg | 241 +++++++++++
public/weather/snowy-1-night.svg | 269 +++++++++++++
public/weather/snowy-2-day.svg | 273 +++++++++++++
public/weather/snowy-2-night.svg | 301 ++++++++++++++
public/weather/snowy-3-day.svg | 334 ++++++++++++++++
public/weather/snowy-3-night.svg | 361 +++++++++++++++++
24 files changed, 5942 insertions(+)
create mode 100644 public/weather/clear-day.svg
create mode 100644 public/weather/clear-night.svg
create mode 100644 public/weather/cloudy-1-day.svg
create mode 100644 public/weather/cloudy-1-night.svg
create mode 100644 public/weather/fog-day.svg
create mode 100644 public/weather/fog-night.svg
create mode 100644 public/weather/frost-day.svg
create mode 100644 public/weather/frost-night.svg
create mode 100644 public/weather/rain-and-sleet-mix.svg
create mode 100644 public/weather/rainy-1-day.svg
create mode 100644 public/weather/rainy-1-night.svg
create mode 100644 public/weather/rainy-2-day.svg
create mode 100644 public/weather/rainy-2-night.svg
create mode 100644 public/weather/rainy-3-day.svg
create mode 100644 public/weather/rainy-3-night.svg
create mode 100644 public/weather/scattered-thunderstorms-day.svg
create mode 100644 public/weather/scattered-thunderstorms-night.svg
create mode 100644 public/weather/severe-thunderstorm.svg
create mode 100644 public/weather/snowy-1-day.svg
create mode 100644 public/weather/snowy-1-night.svg
create mode 100644 public/weather/snowy-2-day.svg
create mode 100644 public/weather/snowy-2-night.svg
create mode 100644 public/weather/snowy-3-day.svg
create mode 100644 public/weather/snowy-3-night.svg
diff --git a/public/weather/clear-day.svg b/public/weather/clear-day.svg
new file mode 100644
index 0000000..d97d28b
--- /dev/null
+++ b/public/weather/clear-day.svg
@@ -0,0 +1,131 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/clear-night.svg b/public/weather/clear-night.svg
new file mode 100644
index 0000000..005ac63
--- /dev/null
+++ b/public/weather/clear-night.svg
@@ -0,0 +1,159 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/cloudy-1-day.svg b/public/weather/cloudy-1-day.svg
new file mode 100644
index 0000000..823fea1
--- /dev/null
+++ b/public/weather/cloudy-1-day.svg
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/cloudy-1-night.svg b/public/weather/cloudy-1-night.svg
new file mode 100644
index 0000000..3fe1541
--- /dev/null
+++ b/public/weather/cloudy-1-night.svg
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/fog-day.svg b/public/weather/fog-day.svg
new file mode 100644
index 0000000..ed834cf
--- /dev/null
+++ b/public/weather/fog-day.svg
@@ -0,0 +1,244 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ F
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/fog-night.svg b/public/weather/fog-night.svg
new file mode 100644
index 0000000..d59f98f
--- /dev/null
+++ b/public/weather/fog-night.svg
@@ -0,0 +1,309 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/frost-day.svg b/public/weather/frost-day.svg
new file mode 100644
index 0000000..16d591c
--- /dev/null
+++ b/public/weather/frost-day.svg
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ F
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/frost-night.svg b/public/weather/frost-night.svg
new file mode 100644
index 0000000..ff2c8dc
--- /dev/null
+++ b/public/weather/frost-night.svg
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rain-and-sleet-mix.svg b/public/weather/rain-and-sleet-mix.svg
new file mode 100644
index 0000000..172010d
--- /dev/null
+++ b/public/weather/rain-and-sleet-mix.svg
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-1-day.svg b/public/weather/rainy-1-day.svg
new file mode 100644
index 0000000..2faf06e
--- /dev/null
+++ b/public/weather/rainy-1-day.svg
@@ -0,0 +1,179 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-1-night.svg b/public/weather/rainy-1-night.svg
new file mode 100644
index 0000000..ee8ffd8
--- /dev/null
+++ b/public/weather/rainy-1-night.svg
@@ -0,0 +1,243 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-2-day.svg b/public/weather/rainy-2-day.svg
new file mode 100644
index 0000000..affdfff
--- /dev/null
+++ b/public/weather/rainy-2-day.svg
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-2-night.svg b/public/weather/rainy-2-night.svg
new file mode 100644
index 0000000..9c3ae20
--- /dev/null
+++ b/public/weather/rainy-2-night.svg
@@ -0,0 +1,256 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-3-day.svg b/public/weather/rainy-3-day.svg
new file mode 100644
index 0000000..b0b5754
--- /dev/null
+++ b/public/weather/rainy-3-day.svg
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/rainy-3-night.svg b/public/weather/rainy-3-night.svg
new file mode 100644
index 0000000..4078e7d
--- /dev/null
+++ b/public/weather/rainy-3-night.svg
@@ -0,0 +1,270 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/scattered-thunderstorms-day.svg b/public/weather/scattered-thunderstorms-day.svg
new file mode 100644
index 0000000..0cfbccc
--- /dev/null
+++ b/public/weather/scattered-thunderstorms-day.svg
@@ -0,0 +1,374 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/scattered-thunderstorms-night.svg b/public/weather/scattered-thunderstorms-night.svg
new file mode 100644
index 0000000..72cf7a6
--- /dev/null
+++ b/public/weather/scattered-thunderstorms-night.svg
@@ -0,0 +1,283 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/severe-thunderstorm.svg b/public/weather/severe-thunderstorm.svg
new file mode 100644
index 0000000..223198b
--- /dev/null
+++ b/public/weather/severe-thunderstorm.svg
@@ -0,0 +1,307 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-1-day.svg b/public/weather/snowy-1-day.svg
new file mode 100644
index 0000000..fb73943
--- /dev/null
+++ b/public/weather/snowy-1-day.svg
@@ -0,0 +1,241 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-1-night.svg b/public/weather/snowy-1-night.svg
new file mode 100644
index 0000000..039ea2e
--- /dev/null
+++ b/public/weather/snowy-1-night.svg
@@ -0,0 +1,269 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-2-day.svg b/public/weather/snowy-2-day.svg
new file mode 100644
index 0000000..323a616
--- /dev/null
+++ b/public/weather/snowy-2-day.svg
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-2-night.svg b/public/weather/snowy-2-night.svg
new file mode 100644
index 0000000..10dcbfa
--- /dev/null
+++ b/public/weather/snowy-2-night.svg
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-3-day.svg b/public/weather/snowy-3-day.svg
new file mode 100644
index 0000000..846c17a
--- /dev/null
+++ b/public/weather/snowy-3-day.svg
@@ -0,0 +1,334 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/weather/snowy-3-night.svg b/public/weather/snowy-3-night.svg
new file mode 100644
index 0000000..b3c8c24
--- /dev/null
+++ b/public/weather/snowy-3-night.svg
@@ -0,0 +1,361 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
From 740ff941a57351d6200700b3e45aee112e720a3a Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 08:35:15 +0530
Subject: [PATCH 12/36] feat(discover): add preview mode
---
src/app/api/discover/route.ts | 59 ++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 22 deletions(-)
diff --git a/src/app/api/discover/route.ts b/src/app/api/discover/route.ts
index 8c1f470..b1c761d 100644
--- a/src/app/api/discover/route.ts
+++ b/src/app/api/discover/route.ts
@@ -16,28 +16,43 @@ const topics = ['AI', 'tech']; /* TODO: Add UI to customize this */
export const GET = async (req: Request) => {
try {
- const data = (
- await Promise.all([
- ...new Array(articleWebsites.length * topics.length)
- .fill(0)
- .map(async (_, i) => {
- return (
- await searchSearxng(
- `site:${articleWebsites[i % articleWebsites.length]} ${
- topics[i % topics.length]
- }`,
- {
- engines: ['bing news'],
- pageno: 1,
- },
- )
- ).results;
- }),
- ])
- )
- .map((result) => result)
- .flat()
- .sort(() => Math.random() - 0.5);
+ const params = new URL(req.url).searchParams;
+ const mode: 'normal' | 'preview' =
+ (params.get('mode') as 'normal' | 'preview') || 'normal';
+
+ let data = [];
+
+ if (mode === 'normal') {
+ data = (
+ await Promise.all([
+ ...new Array(articleWebsites.length * topics.length)
+ .fill(0)
+ .map(async (_, i) => {
+ return (
+ await searchSearxng(
+ `site:${articleWebsites[i % articleWebsites.length]} ${
+ topics[i % topics.length]
+ }`,
+ {
+ engines: ['bing news'],
+ pageno: 1,
+ },
+ )
+ ).results;
+ }),
+ ])
+ )
+ .map((result) => result)
+ .flat()
+ .sort(() => Math.random() - 0.5);
+ } else {
+ data = (
+ await searchSearxng(
+ `site:${articleWebsites[Math.floor(Math.random() * articleWebsites.length)]} ${topics[Math.floor(Math.random() * topics.length)]}`,
+ { engines: ['bing news'], pageno: 1 },
+ )
+ ).results;
+ }
return Response.json(
{
From ccb72c8970691d1980692751bfc7ad2784b457cb Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 08:36:08 +0530
Subject: [PATCH 13/36] feat(app): add weather widget
---
src/app/api/weather/route.ts | 164 +++++++++++++++++++++++++++++++
src/components/EmptyChat.tsx | 10 +-
src/components/WeatherWidget.tsx | 145 +++++++++++++++++++++++++++
3 files changed, 316 insertions(+), 3 deletions(-)
create mode 100644 src/app/api/weather/route.ts
create mode 100644 src/components/WeatherWidget.tsx
diff --git a/src/app/api/weather/route.ts b/src/app/api/weather/route.ts
new file mode 100644
index 0000000..7594aa9
--- /dev/null
+++ b/src/app/api/weather/route.ts
@@ -0,0 +1,164 @@
+export const POST = async (req: Request) => {
+ try {
+ const body: { lat: number; lng: number } = await req.json();
+
+ if (!body.lat || !body.lng) {
+ return Response.json(
+ {
+ message: 'Invalid request.',
+ },
+ { status: 400 },
+ );
+ }
+
+ const res = await fetch(
+ `https://api.open-meteo.com/v1/forecast?latitude=${body.lat}&longitude=${body.lng}¤t=weather_code,temperature_2m,is_day,relative_humidity_2m,wind_speed_10m&timezone=auto`,
+ );
+
+ const data = await res.json();
+
+ if (data.error) {
+ console.error(`Error fetching weather data: ${data.reason}`);
+ return Response.json(
+ {
+ message: 'An error has occurred.',
+ },
+ { status: 500 },
+ );
+ }
+
+ const weather: {
+ temperature: number;
+ condition: string;
+ humidity: number;
+ windSpeed: number;
+ icon: string;
+ } = {
+ temperature: data.current.temperature_2m,
+ condition: '',
+ humidity: data.current.relative_humidity_2m,
+ windSpeed: data.current.wind_speed_10m,
+ icon: '',
+ };
+
+ const code = data.current.weather_code;
+ const isDay = data.current.is_day === 1;
+ const dayOrNight = isDay ? 'day' : 'night';
+
+ switch (code) {
+ case 0:
+ weather.icon = `clear-${dayOrNight}`;
+ weather.condition = 'Clear';
+ break;
+
+ case 1:
+ weather.condition = 'Mainly Clear';
+ case 2:
+ weather.condition = 'Partly Cloudy';
+ case 3:
+ weather.icon = `cloudy-1-${dayOrNight}`;
+ weather.condition = 'Cloudy';
+ break;
+
+ case 45:
+ weather.condition = 'Fog';
+ case 48:
+ weather.icon = `fog-${dayOrNight}`;
+ weather.condition = 'Fog';
+ break;
+
+ case 51:
+ weather.condition = 'Light Drizzle';
+ case 53:
+ weather.condition = 'Moderate Drizzle';
+ case 55:
+ weather.icon = `rainy-1-${dayOrNight}`;
+ weather.condition = 'Dense Drizzle';
+ break;
+
+ case 56:
+ weather.condition = 'Light Freezing Drizzle';
+ case 57:
+ weather.icon = `frost-${dayOrNight}`;
+ weather.condition = 'Dense Freezing Drizzle';
+ break;
+
+ case 61:
+ weather.condition = 'Slight Rain';
+ case 63:
+ weather.condition = 'Moderate Rain';
+ case 65:
+ weather.condition = 'Heavy Rain';
+ weather.icon = `rainy-2-${dayOrNight}`;
+ break;
+
+ case 66:
+ weather.condition = 'Light Freezing Rain';
+ case 67:
+ weather.condition = 'Heavy Freezing Rain';
+ weather.icon = 'rain-and-sleet-mix';
+ break;
+
+ case 71:
+ weather.condition = 'Slight Snow Fall';
+ case 73:
+ weather.condition = 'Moderate Snow Fall';
+ case 75:
+ weather.condition = 'Heavy Snow Fall';
+ weather.icon = `snowy-2-${dayOrNight}`;
+ break;
+
+ case 77:
+ weather.condition = 'Snow';
+ weather.icon = `snowy-1-${dayOrNight}`;
+ break;
+
+ case 80:
+ weather.condition = 'Slight Rain Showers';
+ case 81:
+ weather.condition = 'Moderate Rain Showers';
+ case 82:
+ weather.condition = 'Heavy Rain Showers';
+ weather.icon = `rainy-3-${dayOrNight}`;
+ break;
+
+ case 85:
+ weather.condition = 'Slight Snow Showers';
+ case 86:
+ weather.condition = 'Moderate Snow Showers';
+ case 87:
+ weather.condition = 'Heavy Snow Showers';
+ weather.icon = `snowy-3-${dayOrNight}`;
+ break;
+
+ case 95:
+ weather.condition = 'Thunderstorm';
+ weather.icon = `scattered-thunderstorms-${dayOrNight}`;
+ break;
+
+ case 96:
+ weather.condition = 'Thunderstorm with Slight Hail';
+ case 99:
+ weather.condition = 'Thunderstorm with Heavy Hail';
+ weather.icon = 'severe-thunderstorm';
+ break;
+
+ default:
+ weather.icon = `clear-${dayOrNight}`;
+ weather.condition = 'Clear';
+ break;
+ }
+
+ return Response.json(weather);
+ } catch (err) {
+ console.error('An error occurred while getting home widgets', err);
+ return Response.json(
+ {
+ message: 'An error has occurred.',
+ },
+ {
+ status: 500,
+ },
+ );
+ }
+};
diff --git a/src/components/EmptyChat.tsx b/src/components/EmptyChat.tsx
index 838849f..8c6bdab 100644
--- a/src/components/EmptyChat.tsx
+++ b/src/components/EmptyChat.tsx
@@ -1,8 +1,9 @@
import { Settings } from 'lucide-react';
import EmptyChatMessageInput from './EmptyChatMessageInput';
-import { useState } from 'react';
+import { useEffect, useState } from 'react';
import { File } from './ChatWindow';
import Link from 'next/link';
+import WeatherWidget from './WeatherWidget';
const EmptyChat = ({
sendMessage,
@@ -25,8 +26,6 @@ const EmptyChat = ({
files: File[];
setFiles: (files: File[]) => void;
}) => {
- const [isSettingsOpen, setIsSettingsOpen] = useState(false);
-
return (
@@ -49,6 +48,11 @@ const EmptyChat = ({
files={files}
setFiles={setFiles}
/>
+
);
diff --git a/src/components/WeatherWidget.tsx b/src/components/WeatherWidget.tsx
new file mode 100644
index 0000000..afbc94e
--- /dev/null
+++ b/src/components/WeatherWidget.tsx
@@ -0,0 +1,145 @@
+import { Cloud, Sun, CloudRain, CloudSnow, Wind } from 'lucide-react';
+import { useEffect, useState } from 'react';
+
+const WeatherWidget = () => {
+ const [data, setData] = useState({
+ temperature: 0,
+ condition: '',
+ location: '',
+ humidity: 0,
+ windSpeed: 0,
+ icon: '',
+ });
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ const getApproxLocation = async () => {
+ const res = await fetch('https://ipwhois.app/json/');
+ const data = await res.json();
+
+ return {
+ latitude: data.latitude,
+ longitude: data.longitude,
+ city: data.city,
+ };
+ };
+
+ const getLocation = async (
+ callback: (location: {
+ latitude: number;
+ longitude: number;
+ city: string;
+ }) => void,
+ ) => {
+ /*
+ // Geolocation doesn't give city so we'll country using ipapi for now
+ if (navigator.geolocation) {
+ const result = await navigator.permissions.query({
+ name: 'geolocation',
+ })
+
+ if (result.state === 'granted') {
+ navigator.geolocation.getCurrentPosition(position => {
+ callback({
+ latitude: position.coords.latitude,
+ longitude: position.coords.longitude,
+ })
+ })
+ } else if (result.state === 'prompt') {
+ callback(await getApproxLocation())
+ navigator.geolocation.getCurrentPosition(position => {})
+ } else if (result.state === 'denied') {
+ callback(await getApproxLocation())
+ }
+ } else {
+ callback(await getApproxLocation())
+ } */
+ callback(await getApproxLocation());
+ };
+
+ getLocation(async (location) => {
+ const res = await fetch(`/api/weather`, {
+ method: 'POST',
+ body: JSON.stringify({
+ lat: location.latitude,
+ lng: location.longitude,
+ }),
+ });
+
+ const data = await res.json();
+
+ if (res.status !== 200) {
+ console.error('Error fetching weather data');
+ setLoading(false);
+ return;
+ }
+
+ setData({
+ temperature: data.temperature,
+ condition: data.condition,
+ location: location.city,
+ humidity: data.humidity,
+ windSpeed: data.windSpeed,
+ icon: data.icon,
+ });
+ setLoading(false);
+ });
+ }, []);
+
+ return (
+
+ {loading ? (
+ <>
+
+
+ >
+ ) : (
+ <>
+
+
+
+ {data.temperature}°C
+
+
+
+
+
+ {data.location}
+
+
+
+ {data.windSpeed} km/h
+
+
+
+ {data.condition}
+
+
+ Humidity: {data.humidity}%
+ Now
+
+
+ >
+ )}
+
+ );
+};
+
+export default WeatherWidget;
From 2257e1df0cfd0a0dc4c3f296a57ab3db6d5c1b47 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 08:36:40 +0530
Subject: [PATCH 14/36] feat(empty-chat): add article widget
---
src/components/EmptyChat.tsx | 4 ++
src/components/NewsArticleWidget.tsx | 71 ++++++++++++++++++++++++++++
2 files changed, 75 insertions(+)
create mode 100644 src/components/NewsArticleWidget.tsx
diff --git a/src/components/EmptyChat.tsx b/src/components/EmptyChat.tsx
index 8c6bdab..2a06d1d 100644
--- a/src/components/EmptyChat.tsx
+++ b/src/components/EmptyChat.tsx
@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
import { File } from './ChatWindow';
import Link from 'next/link';
import WeatherWidget from './WeatherWidget';
+import NewsArticleWidget from './NewsArticleWidget';
const EmptyChat = ({
sendMessage,
@@ -52,6 +53,9 @@ const EmptyChat = ({
+
+
+
diff --git a/src/components/NewsArticleWidget.tsx b/src/components/NewsArticleWidget.tsx
new file mode 100644
index 0000000..eca6940
--- /dev/null
+++ b/src/components/NewsArticleWidget.tsx
@@ -0,0 +1,71 @@
+import { useEffect, useState } from 'react';
+
+interface Article {
+ title: string;
+ content: string;
+ url: string;
+ thumbnail: string;
+}
+
+const NewsArticleWidget = () => {
+ const [article, setArticle] = useState(null);
+ const [loading, setLoading] = useState(true);
+ const [error, setError] = useState(false);
+
+ useEffect(() => {
+ fetch('/api/discover?mode=preview')
+ .then((res) => res.json())
+ .then((data) => {
+ const articles = (data.blogs || []).filter((a: Article) => a.thumbnail);
+ setArticle(articles[Math.floor(Math.random() * articles.length)]);
+ setLoading(false);
+ })
+ .catch(() => {
+ setError(true);
+ setLoading(false);
+ });
+ }, []);
+
+ return (
+
+ );
+};
+
+export default NewsArticleWidget;
From a86a1a461cabf9ca249f6863a2a8b52fa9cf7896 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 09:24:54 +0530
Subject: [PATCH 15/36] feat(weather-icons): rename `weather` to `weather-ico`
---
public/{weather => weather-ico}/clear-day.svg | 0
public/{weather => weather-ico}/clear-night.svg | 0
public/{weather => weather-ico}/cloudy-1-day.svg | 0
public/{weather => weather-ico}/cloudy-1-night.svg | 0
public/{weather => weather-ico}/fog-day.svg | 0
public/{weather => weather-ico}/fog-night.svg | 0
public/{weather => weather-ico}/frost-day.svg | 0
public/{weather => weather-ico}/frost-night.svg | 0
public/{weather => weather-ico}/rain-and-sleet-mix.svg | 0
public/{weather => weather-ico}/rainy-1-day.svg | 0
public/{weather => weather-ico}/rainy-1-night.svg | 0
public/{weather => weather-ico}/rainy-2-day.svg | 0
public/{weather => weather-ico}/rainy-2-night.svg | 0
public/{weather => weather-ico}/rainy-3-day.svg | 0
public/{weather => weather-ico}/rainy-3-night.svg | 0
public/{weather => weather-ico}/scattered-thunderstorms-day.svg | 0
.../{weather => weather-ico}/scattered-thunderstorms-night.svg | 0
public/{weather => weather-ico}/severe-thunderstorm.svg | 0
public/{weather => weather-ico}/snowy-1-day.svg | 0
public/{weather => weather-ico}/snowy-1-night.svg | 0
public/{weather => weather-ico}/snowy-2-day.svg | 0
public/{weather => weather-ico}/snowy-2-night.svg | 0
public/{weather => weather-ico}/snowy-3-day.svg | 0
public/{weather => weather-ico}/snowy-3-night.svg | 0
src/components/WeatherWidget.tsx | 2 +-
25 files changed, 1 insertion(+), 1 deletion(-)
rename public/{weather => weather-ico}/clear-day.svg (100%)
rename public/{weather => weather-ico}/clear-night.svg (100%)
rename public/{weather => weather-ico}/cloudy-1-day.svg (100%)
rename public/{weather => weather-ico}/cloudy-1-night.svg (100%)
rename public/{weather => weather-ico}/fog-day.svg (100%)
rename public/{weather => weather-ico}/fog-night.svg (100%)
rename public/{weather => weather-ico}/frost-day.svg (100%)
rename public/{weather => weather-ico}/frost-night.svg (100%)
rename public/{weather => weather-ico}/rain-and-sleet-mix.svg (100%)
rename public/{weather => weather-ico}/rainy-1-day.svg (100%)
rename public/{weather => weather-ico}/rainy-1-night.svg (100%)
rename public/{weather => weather-ico}/rainy-2-day.svg (100%)
rename public/{weather => weather-ico}/rainy-2-night.svg (100%)
rename public/{weather => weather-ico}/rainy-3-day.svg (100%)
rename public/{weather => weather-ico}/rainy-3-night.svg (100%)
rename public/{weather => weather-ico}/scattered-thunderstorms-day.svg (100%)
rename public/{weather => weather-ico}/scattered-thunderstorms-night.svg (100%)
rename public/{weather => weather-ico}/severe-thunderstorm.svg (100%)
rename public/{weather => weather-ico}/snowy-1-day.svg (100%)
rename public/{weather => weather-ico}/snowy-1-night.svg (100%)
rename public/{weather => weather-ico}/snowy-2-day.svg (100%)
rename public/{weather => weather-ico}/snowy-2-night.svg (100%)
rename public/{weather => weather-ico}/snowy-3-day.svg (100%)
rename public/{weather => weather-ico}/snowy-3-night.svg (100%)
diff --git a/public/weather/clear-day.svg b/public/weather-ico/clear-day.svg
similarity index 100%
rename from public/weather/clear-day.svg
rename to public/weather-ico/clear-day.svg
diff --git a/public/weather/clear-night.svg b/public/weather-ico/clear-night.svg
similarity index 100%
rename from public/weather/clear-night.svg
rename to public/weather-ico/clear-night.svg
diff --git a/public/weather/cloudy-1-day.svg b/public/weather-ico/cloudy-1-day.svg
similarity index 100%
rename from public/weather/cloudy-1-day.svg
rename to public/weather-ico/cloudy-1-day.svg
diff --git a/public/weather/cloudy-1-night.svg b/public/weather-ico/cloudy-1-night.svg
similarity index 100%
rename from public/weather/cloudy-1-night.svg
rename to public/weather-ico/cloudy-1-night.svg
diff --git a/public/weather/fog-day.svg b/public/weather-ico/fog-day.svg
similarity index 100%
rename from public/weather/fog-day.svg
rename to public/weather-ico/fog-day.svg
diff --git a/public/weather/fog-night.svg b/public/weather-ico/fog-night.svg
similarity index 100%
rename from public/weather/fog-night.svg
rename to public/weather-ico/fog-night.svg
diff --git a/public/weather/frost-day.svg b/public/weather-ico/frost-day.svg
similarity index 100%
rename from public/weather/frost-day.svg
rename to public/weather-ico/frost-day.svg
diff --git a/public/weather/frost-night.svg b/public/weather-ico/frost-night.svg
similarity index 100%
rename from public/weather/frost-night.svg
rename to public/weather-ico/frost-night.svg
diff --git a/public/weather/rain-and-sleet-mix.svg b/public/weather-ico/rain-and-sleet-mix.svg
similarity index 100%
rename from public/weather/rain-and-sleet-mix.svg
rename to public/weather-ico/rain-and-sleet-mix.svg
diff --git a/public/weather/rainy-1-day.svg b/public/weather-ico/rainy-1-day.svg
similarity index 100%
rename from public/weather/rainy-1-day.svg
rename to public/weather-ico/rainy-1-day.svg
diff --git a/public/weather/rainy-1-night.svg b/public/weather-ico/rainy-1-night.svg
similarity index 100%
rename from public/weather/rainy-1-night.svg
rename to public/weather-ico/rainy-1-night.svg
diff --git a/public/weather/rainy-2-day.svg b/public/weather-ico/rainy-2-day.svg
similarity index 100%
rename from public/weather/rainy-2-day.svg
rename to public/weather-ico/rainy-2-day.svg
diff --git a/public/weather/rainy-2-night.svg b/public/weather-ico/rainy-2-night.svg
similarity index 100%
rename from public/weather/rainy-2-night.svg
rename to public/weather-ico/rainy-2-night.svg
diff --git a/public/weather/rainy-3-day.svg b/public/weather-ico/rainy-3-day.svg
similarity index 100%
rename from public/weather/rainy-3-day.svg
rename to public/weather-ico/rainy-3-day.svg
diff --git a/public/weather/rainy-3-night.svg b/public/weather-ico/rainy-3-night.svg
similarity index 100%
rename from public/weather/rainy-3-night.svg
rename to public/weather-ico/rainy-3-night.svg
diff --git a/public/weather/scattered-thunderstorms-day.svg b/public/weather-ico/scattered-thunderstorms-day.svg
similarity index 100%
rename from public/weather/scattered-thunderstorms-day.svg
rename to public/weather-ico/scattered-thunderstorms-day.svg
diff --git a/public/weather/scattered-thunderstorms-night.svg b/public/weather-ico/scattered-thunderstorms-night.svg
similarity index 100%
rename from public/weather/scattered-thunderstorms-night.svg
rename to public/weather-ico/scattered-thunderstorms-night.svg
diff --git a/public/weather/severe-thunderstorm.svg b/public/weather-ico/severe-thunderstorm.svg
similarity index 100%
rename from public/weather/severe-thunderstorm.svg
rename to public/weather-ico/severe-thunderstorm.svg
diff --git a/public/weather/snowy-1-day.svg b/public/weather-ico/snowy-1-day.svg
similarity index 100%
rename from public/weather/snowy-1-day.svg
rename to public/weather-ico/snowy-1-day.svg
diff --git a/public/weather/snowy-1-night.svg b/public/weather-ico/snowy-1-night.svg
similarity index 100%
rename from public/weather/snowy-1-night.svg
rename to public/weather-ico/snowy-1-night.svg
diff --git a/public/weather/snowy-2-day.svg b/public/weather-ico/snowy-2-day.svg
similarity index 100%
rename from public/weather/snowy-2-day.svg
rename to public/weather-ico/snowy-2-day.svg
diff --git a/public/weather/snowy-2-night.svg b/public/weather-ico/snowy-2-night.svg
similarity index 100%
rename from public/weather/snowy-2-night.svg
rename to public/weather-ico/snowy-2-night.svg
diff --git a/public/weather/snowy-3-day.svg b/public/weather-ico/snowy-3-day.svg
similarity index 100%
rename from public/weather/snowy-3-day.svg
rename to public/weather-ico/snowy-3-day.svg
diff --git a/public/weather/snowy-3-night.svg b/public/weather-ico/snowy-3-night.svg
similarity index 100%
rename from public/weather/snowy-3-night.svg
rename to public/weather-ico/snowy-3-night.svg
diff --git a/src/components/WeatherWidget.tsx b/src/components/WeatherWidget.tsx
index afbc94e..e6a631e 100644
--- a/src/components/WeatherWidget.tsx
+++ b/src/components/WeatherWidget.tsx
@@ -110,7 +110,7 @@ const WeatherWidget = () => {
<>
From 3a57261590a548d7edcc16f6420762d020fc8460 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 09:33:15 +0530
Subject: [PATCH 16/36] feat(package): bump version
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index a8fd416..f62543b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "perplexica-frontend",
- "version": "1.10.2",
+ "version": "1.11.0-rc1",
"license": "MIT",
"author": "ItzCrazyKns",
"scripts": {
From 8cfcc3e39c7323723c715d2e11a75f2544a2ccac Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 09:52:36 +0530
Subject: [PATCH 17/36] feat(chat): update margins and spacing
---
src/components/EmptyChat.tsx | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/src/components/EmptyChat.tsx b/src/components/EmptyChat.tsx
index 2a06d1d..b28b659 100644
--- a/src/components/EmptyChat.tsx
+++ b/src/components/EmptyChat.tsx
@@ -34,21 +34,23 @@ const EmptyChat = ({
-
-
- Research begins here.
-
-
+
+
+
+ Research begins here.
+
+
+
From 0b7989c3d3f3a5c21354c623f7bd98c70b6d7137 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Fri, 30 May 2025 09:55:06 +0530
Subject: [PATCH 18/36] feat(empty-chat): remove unused imports
---
src/components/EmptyChat.tsx | 1 -
1 file changed, 1 deletion(-)
diff --git a/src/components/EmptyChat.tsx b/src/components/EmptyChat.tsx
index b28b659..42e5a09 100644
--- a/src/components/EmptyChat.tsx
+++ b/src/components/EmptyChat.tsx
@@ -1,6 +1,5 @@
import { Settings } from 'lucide-react';
import EmptyChatMessageInput from './EmptyChatMessageInput';
-import { useEffect, useState } from 'react';
import { File } from './ChatWindow';
import Link from 'next/link';
import WeatherWidget from './WeatherWidget';
From 5c6018a0f9c498da28df3b08889b7c9ccf7a1f40 Mon Sep 17 00:00:00 2001
From: Dave
Date: Sun, 1 Jun 2025 06:35:16 +0200
Subject: [PATCH 19/36] docs: correct typo in npm start command
---
docs/installation/UPDATING.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/installation/UPDATING.md b/docs/installation/UPDATING.md
index 972142f..66edf5c 100644
--- a/docs/installation/UPDATING.md
+++ b/docs/installation/UPDATING.md
@@ -41,6 +41,6 @@ To update Perplexica to the latest version, follow these steps:
3. Check for changes in the configuration files. If the `sample.config.toml` file contains new fields, delete your existing `config.toml` file, rename `sample.config.toml` to `config.toml`, and update the configuration accordingly.
4. After populating the configuration run `npm i`.
5. Install the dependencies and then execute `npm run build`.
-6. Finally, start the app by running `npm rum start`
+6. Finally, start the app by running `npm run start`
---
From 772e461c0887f72d35d9ebef9fa500908b702dad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=93=E3=82=84=E3=81=97?=
<168693811+koyasi777@users.noreply.github.com>
Date: Mon, 2 Jun 2025 00:30:18 +0900
Subject: [PATCH 20/36] feat(gemini): add Gemini 2.5 Flash & Pro preview models
(May 2025)
---
src/lib/providers/gemini.ts | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/lib/providers/gemini.ts b/src/lib/providers/gemini.ts
index 6cf2243..2dcdc88 100644
--- a/src/lib/providers/gemini.ts
+++ b/src/lib/providers/gemini.ts
@@ -13,6 +13,14 @@ import { BaseChatModel } from '@langchain/core/language_models/chat_models';
import { Embeddings } from '@langchain/core/embeddings';
const geminiChatModels: Record[] = [
+ {
+ displayName: 'Gemini 2.5 Flash Preview 05-20',
+ key: 'gemini-2.5-flash-preview-05-20',
+ },
+ {
+ displayName: 'Gemini 2.5 Pro Preview',
+ key: 'gemini-2.5-pro-preview-05-06',
+ },
{
displayName: 'Gemini 2.5 Pro Experimental',
key: 'gemini-2.5-pro-exp-03-25',
From 3b46baca4f3ef35c7fa3c0605d2738b58976b2dd Mon Sep 17 00:00:00 2001
From: Dave
Date: Mon, 2 Jun 2025 05:52:31 +0200
Subject: [PATCH 21/36] docs(readme): fix typo in npm start command
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 18c9f84..8a0c78e 100644
--- a/README.md
+++ b/README.md
@@ -111,7 +111,7 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker.
2. Clone the repository and rename the `sample.config.toml` file to `config.toml` in the root directory. Ensure you complete all required fields in this file.
3. After populating the configuration run `npm i`.
4. Install the dependencies and then execute `npm run build`.
-5. Finally, start the app by running `npm rum start`
+5. Finally, start the app by running `npm run start`
**Note**: Using Docker is recommended as it simplifies the setup process, especially for managing environment variables and dependencies.
From 68c43ea372202d09ed3d78feddbe6f3334051044 Mon Sep 17 00:00:00 2001
From: Chris Scott
Date: Mon, 2 Jun 2025 21:52:41 -0400
Subject: [PATCH 22/36] Fix: IOS Input Zoom config for theme consistency and
iOS standalone mode - Modified manifest.ts to ensure proper metadata
- Added display: standalone for iOS PWA behavior
---
.assets/manifest.json | 0
public/icons8-search-100.png | Bin 0 -> 1531 bytes
public/icons8-search-50.png | Bin 0 -> 750 bytes
src/app/globals.css | 9 +++++++++
src/app/manifest.ts | 26 ++++++++++++++++++++++++++
5 files changed, 35 insertions(+)
create mode 100644 .assets/manifest.json
create mode 100644 public/icons8-search-100.png
create mode 100644 public/icons8-search-50.png
create mode 100644 src/app/manifest.ts
diff --git a/.assets/manifest.json b/.assets/manifest.json
new file mode 100644
index 0000000..e69de29
diff --git a/public/icons8-search-100.png b/public/icons8-search-100.png
new file mode 100644
index 0000000000000000000000000000000000000000..6bb6582310a28a061710535069cf40b620c932d9
GIT binary patch
literal 1531
zcmV!|bO$9!vnPvJCp_Sx6&~3)1pysB{sMO4f4QuFQvA^Rv
zp4-~{+dtSZGiRS~t-Zc)uWzrt_BxPABoc{4B9TZW62)a1umRWvd;%N>egsB=lhQ`z
zZ-?bG?z4AE-$a9)1*`|Q0YgBg!8R!0bqg>rS*Lb-fUR=3S6b9Yfj5Db$uRl!0y}`2
z78;`BX12JRTJTl~V^z*WE!U;$8)wm|;o{&$aj*7f>~b~mmq+d=h`@nspYc1e
z0{g5GS+lZFhwSJt07jHT?(OPw!r>B62xlzBSK^XqoiSy6n#$u^k54%m+T!s!&-`oA
zf!E4I9(|rBpxBhYqdp>h-uFE5LBzgvpm4~@I-?oulp{(v7o9du+4E?-4WU@L&7+?S
zTAF3ICpHxudzFs6Fuc>J?;f|nij8YL@h+1)k6V?X?oNu8{Yuv@7)(ge3n;gr5i4tz
zt|QhGCvH^&4!3A?$qHwB!YVFIWQO;Ya4!=-o0ZP*UPh427K0v@wjEd=Q2(;h{SXHDSqXJv9fP5F6f3g8><*wmvU8a2`x6Gx$pGh`=2Vw$
z9|zFiah~e;Ck8mFgsOFG^JtX;nFydi5-!R1J3*ud84sYp&me9rf}OIqR~e9j0Q&o;
zEa#Jgb?VD=PDwcfpC3SfpHp}F!RB6j>)Dj*76&>ZZJ>_9u+U#`R(+2F^xH}&v)J3s
zeHOE8HY%Z9D5WU8Xi;|^T>PBk@P*R-4h*nN2{jp7nq?Ei?~5?PU`V-2O=7ju*^Pl2
zwkhG<$=TR>P3inLhFD*~B!@qg&Mp(h4D&pTEK>qDnRT8sBPHvJa_$^>Q4;0ez#uC<
zbxPa@PHgll9cSv?)avL_1a~MuHui;*Y>mXRbg<54HO9j2o~PpqjI&b-eMAnsgw8oq
zal%~e>QpR|<6c?8U4?|u8Sq3Tf;iHKlsM8;*8_yh!=V=uC`pN47rY$mLpHp<~r&w_U(#KHly^aWg6<1)_~kbi;e37p40^Y57P>1$0+k+oxO
zF0j_NUBy|S;z}V|bl@jE^3JyL7>qI}$0)O}#Pf};GX|;{B08fu9?dE7H*BE9-(Zc#
z$QmVzW8Zz^Lwri^ZS!%sUQcYQUZX_uq%4*aM|q0wll_#g7HuxA^Muf|?Ld{vsnHsx
zBqfe?m_@%LZn(!CSyhr|FN9Q4~w%9QX^efIB2VZ!{tYW&V*s
z;E+U`-A^99Bt^%XwQrG(Vze&UNYNIL*6B$`u}4obianB143dmukYp5tB%>H48O0#U
zCoo*Dv@?iaKZMvRh-VaO=S7>10JjA6*p
hCkLKLBoYbQ!GHdQ*7*!5-&Ozs002ovPDHLkV1np5&N=`9
literal 0
HcmV?d00001
diff --git a/public/icons8-search-50.png b/public/icons8-search-50.png
new file mode 100644
index 0000000000000000000000000000000000000000..7d83950a048d2e2ca2ae07bcd59fe2b86f64491d
GIT binary patch
literal 750
zcmV@;wc9IzLdaXPmO
zyZ|l%2Y_y1n=ZRQ2wVnc^=$gTXFy-OoEQcc)sY{-ZD3au|2N0(087&N4h#{Q8_wID
z0D4-`+5=2FdSgW5mJF`xzT`>wBJewwGs7}u1}g#dPdm;G5^!OsYvNicBfzM$X38N9
z%s6WzBqe9f)I#hN4MmtK#J{oE{$EQX$11L}-*;&_1eM7H1iT<7sSO$@VE9Vu_QYcu5sDkfQAHB|5D)V~JcW?#kv9pQ48(x*R!;Ujz2}
z7Ee?8Nss6BEKK{UW6L{b9X}g7j)vm8Y#m^cE)%F?B{RV?o2vetWfX}c&m>)
zE85&X0Iz|2>eNpDO)i}Ah1HhVJ7d%FEFDOta3-fzijm1Fm11OaN;P9->;o;GKFw~@
g;Z!?$B-m2?0UfV5Z^;J0ga7~l07*qoM6N<$g6)P#ZvX%Q
literal 0
HcmV?d00001
diff --git a/src/app/globals.css b/src/app/globals.css
index f75daca..a8e6ae1 100644
--- a/src/app/globals.css
+++ b/src/app/globals.css
@@ -11,3 +11,12 @@
display: none;
}
}
+
+/* Add Fix for IOS to allow PWA and stop zooming on the page */
+@media screen and (-webkit-min-device-pixel-ratio: 0) {
+ select,
+ textarea,
+ input {
+ font-size: 16px !important;
+ }
+}
diff --git a/src/app/manifest.ts b/src/app/manifest.ts
new file mode 100644
index 0000000..204e58f
--- /dev/null
+++ b/src/app/manifest.ts
@@ -0,0 +1,26 @@
+import type { MetadataRoute } from 'next';
+
+export default function manifest(): MetadataRoute.Manifest {
+ return {
+ name: 'Perplexica - Chat with the internet',
+ short_name: 'Perplexica',
+ description:
+ 'Perplexica is an AI powered chatbot that is connected to the internet.',
+ start_url: '/',
+ display: 'standalone',
+ background_color: '#0a0a0a',
+ theme_color: '#0a0a0a',
+ icons: [
+ {
+ src: '/icons8-search-50.png',
+ sizes: '50x50',
+ type: 'image/png' as const,
+ },
+ {
+ src: '/icons8-search-100.png',
+ sizes: '100x100',
+ type: 'image/png',
+ },
+ ],
+ };
+}
From e2b9ffc072bbb1826719ec480338247d470173c9 Mon Sep 17 00:00:00 2001
From: Siddhesh Mhatre <157303637+glitchySid@users.noreply.github.com>
Date: Wed, 11 Jun 2025 22:52:13 +0530
Subject: [PATCH 23/36] Update README.md
Mentioned that Gemini api key can be used in perplexica.
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 18c9f84..07d5c2d 100644
--- a/README.md
+++ b/README.md
@@ -90,6 +90,7 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker.
- `OLLAMA`: Your Ollama API URL. You should enter it as `http://host.docker.internal:PORT_NUMBER`. If you installed Ollama on port 11434, use `http://host.docker.internal:11434`. For other ports, adjust accordingly. **You need to fill this if you wish to use Ollama's models instead of OpenAI's**.
- `GROQ`: Your Groq API key. **You only need to fill this if you wish to use Groq's hosted models**.
- `ANTHROPIC`: Your Anthropic API key. **You only need to fill this if you wish to use Anthropic models**.
+ - `Gemini`: Your Gemini API key. **You only need to fill this if you wish to use Google's models**.
**Note**: You can change these after starting Perplexica from the settings dialog.
From c6d084f5dc960c271c2c01464b13f93a769e1d88 Mon Sep 17 00:00:00 2001
From: D1m7asis
Date: Fri, 27 Jun 2025 13:43:20 +0200
Subject: [PATCH 24/36] feat: add AIML API provider
Introduces support for the AI/ML API provider, including configuration options, chat and embedding model loading, and UI integration. Updates documentation and sample config to reflect the new provider.
---
README.md | 4 +-
sample.config.toml | 3 ++
src/app/api/config/route.ts | 5 ++
src/app/settings/page.tsx | 20 ++++++++
src/lib/config.ts | 5 ++
src/lib/providers/aimlapi.ts | 94 ++++++++++++++++++++++++++++++++++++
src/lib/providers/index.ts | 8 +++
7 files changed, 138 insertions(+), 1 deletion(-)
create mode 100644 src/lib/providers/aimlapi.ts
diff --git a/README.md b/README.md
index 14a6193..9551250 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,9 @@ There are mainly 2 ways of installing Perplexica - With Docker, Without Docker.
- `OLLAMA`: Your Ollama API URL. You should enter it as `http://host.docker.internal:PORT_NUMBER`. If you installed Ollama on port 11434, use `http://host.docker.internal:11434`. For other ports, adjust accordingly. **You need to fill this if you wish to use Ollama's models instead of OpenAI's**.
- `GROQ`: Your Groq API key. **You only need to fill this if you wish to use Groq's hosted models**.
- `ANTHROPIC`: Your Anthropic API key. **You only need to fill this if you wish to use Anthropic models**.
- - `Gemini`: Your Gemini API key. **You only need to fill this if you wish to use Google's models**.
+ - `Gemini`: Your Gemini API key. **You only need to fill this if you wish to use Google's models**.
+ - `DEEPSEEK`: Your Deepseek API key. **Only needed if you want Deepseek models.**
+ - `AIMLAPI`: Your AI/ML API key. **Only needed if you want to use AI/ML API models and embeddings.**
**Note**: You can change these after starting Perplexica from the settings dialog.
diff --git a/sample.config.toml b/sample.config.toml
index 1db2125..ba3e98e 100644
--- a/sample.config.toml
+++ b/sample.config.toml
@@ -25,6 +25,9 @@ API_URL = "" # Ollama API URL - http://host.docker.internal:11434
[MODELS.DEEPSEEK]
API_KEY = ""
+[MODELS.AIMLAPI]
+API_KEY = "" # Required to use AI/ML API chat and embedding models
+
[MODELS.LM_STUDIO]
API_URL = "" # LM Studio API URL - http://host.docker.internal:1234
diff --git a/src/app/api/config/route.ts b/src/app/api/config/route.ts
index c1e5bbd..0c11b23 100644
--- a/src/app/api/config/route.ts
+++ b/src/app/api/config/route.ts
@@ -8,6 +8,7 @@ import {
getOllamaApiEndpoint,
getOpenaiApiKey,
getDeepseekApiKey,
+ getAimlApiKey,
getLMStudioApiEndpoint,
updateConfig,
} from '@/lib/config';
@@ -57,6 +58,7 @@ export const GET = async (req: Request) => {
config['groqApiKey'] = getGroqApiKey();
config['geminiApiKey'] = getGeminiApiKey();
config['deepseekApiKey'] = getDeepseekApiKey();
+ config['aimlApiKey'] = getAimlApiKey();
config['customOpenaiApiUrl'] = getCustomOpenaiApiUrl();
config['customOpenaiApiKey'] = getCustomOpenaiApiKey();
config['customOpenaiModelName'] = getCustomOpenaiModelName();
@@ -95,6 +97,9 @@ export const POST = async (req: Request) => {
DEEPSEEK: {
API_KEY: config.deepseekApiKey,
},
+ AIMLAPI: {
+ API_KEY: config.aimlApiKey,
+ },
LM_STUDIO: {
API_URL: config.lmStudioApiUrl,
},
diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx
index 6f20f01..b91519e 100644
--- a/src/app/settings/page.tsx
+++ b/src/app/settings/page.tsx
@@ -23,6 +23,7 @@ interface SettingsType {
ollamaApiUrl: string;
lmStudioApiUrl: string;
deepseekApiKey: string;
+ aimlApiKey: string;
customOpenaiApiKey: string;
customOpenaiApiUrl: string;
customOpenaiModelName: string;
@@ -862,6 +863,25 @@ const Page = () => {
/>
+
+
+ AI/ML API Key
+
+
{
+ setConfig((prev) => ({
+ ...prev!,
+ aimlApiKey: e.target.value,
+ }));
+ }}
+ onSave={(value) => saveConfig('aimlApiKey', value)}
+ />
+
+
LM Studio API URL
diff --git a/src/lib/config.ts b/src/lib/config.ts
index 78ad09c..d885e13 100644
--- a/src/lib/config.ts
+++ b/src/lib/config.ts
@@ -35,6 +35,9 @@ interface Config {
DEEPSEEK: {
API_KEY: string;
};
+ AIMLAPI: {
+ API_KEY: string;
+ };
LM_STUDIO: {
API_URL: string;
};
@@ -85,6 +88,8 @@ export const getOllamaApiEndpoint = () => loadConfig().MODELS.OLLAMA.API_URL;
export const getDeepseekApiKey = () => loadConfig().MODELS.DEEPSEEK.API_KEY;
+export const getAimlApiKey = () => loadConfig().MODELS.AIMLAPI.API_KEY;
+
export const getCustomOpenaiApiKey = () =>
loadConfig().MODELS.CUSTOM_OPENAI.API_KEY;
diff --git a/src/lib/providers/aimlapi.ts b/src/lib/providers/aimlapi.ts
new file mode 100644
index 0000000..e934362
--- /dev/null
+++ b/src/lib/providers/aimlapi.ts
@@ -0,0 +1,94 @@
+import { ChatOpenAI, OpenAIEmbeddings } from '@langchain/openai';
+import { getAimlApiKey } from '../config';
+import { ChatModel, EmbeddingModel } from '.';
+import { BaseChatModel } from '@langchain/core/language_models/chat_models';
+import { Embeddings } from '@langchain/core/embeddings';
+import axios from 'axios';
+
+export const PROVIDER_INFO = {
+ key: 'aimlapi',
+ displayName: 'AI/ML API',
+};
+
+interface AimlApiModel {
+ id: string;
+ name?: string;
+ type?: string;
+}
+
+const API_URL = 'https://api.aimlapi.com';
+
+export const loadAimlApiChatModels = async () => {
+ const apiKey = getAimlApiKey();
+
+ if (!apiKey) return {};
+
+ try {
+ const response = await axios.get(`${API_URL}/models`, {
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ });
+
+ const chatModels: Record = {};
+
+ response.data.data.forEach((model: AimlApiModel) => {
+ if (model.type === 'chat-completion') {
+ chatModels[model.id] = {
+ displayName: model.name || model.id,
+ model: new ChatOpenAI({
+ openAIApiKey: apiKey,
+ modelName: model.id,
+ temperature: 0.7,
+ configuration: {
+ baseURL: API_URL,
+ },
+ }) as unknown as BaseChatModel,
+ };
+ }
+ });
+
+ return chatModels;
+ } catch (err) {
+ console.error(`Error loading AI/ML API models: ${err}`);
+ return {};
+ }
+};
+
+export const loadAimlApiEmbeddingModels = async () => {
+ const apiKey = getAimlApiKey();
+
+ if (!apiKey) return {};
+
+ try {
+ const response = await axios.get(`${API_URL}/models`, {
+ headers: {
+ 'Content-Type': 'application/json',
+ Authorization: `Bearer ${apiKey}`,
+ },
+ });
+
+ const embeddingModels: Record = {};
+
+ response.data.data.forEach((model: AimlApiModel) => {
+ if (model.type === 'embedding') {
+ embeddingModels[model.id] = {
+ displayName: model.name || model.id,
+ model: new OpenAIEmbeddings({
+ openAIApiKey: apiKey,
+ modelName: model.id,
+ configuration: {
+ baseURL: API_URL,
+ },
+ }) as unknown as Embeddings,
+ };
+ }
+ });
+
+ return embeddingModels;
+ } catch (err) {
+ console.error(`Error loading AI/ML API embeddings models: ${err}`);
+ return {};
+ }
+};
diff --git a/src/lib/providers/index.ts b/src/lib/providers/index.ts
index e536431..4b8a090 100644
--- a/src/lib/providers/index.ts
+++ b/src/lib/providers/index.ts
@@ -35,6 +35,11 @@ import {
loadDeepseekChatModels,
PROVIDER_INFO as DeepseekInfo,
} from './deepseek';
+import {
+ loadAimlApiChatModels,
+ loadAimlApiEmbeddingModels,
+ PROVIDER_INFO as AimlApiInfo,
+} from './aimlapi';
import {
loadLMStudioChatModels,
loadLMStudioEmbeddingsModels,
@@ -49,6 +54,7 @@ export const PROVIDER_METADATA = {
gemini: GeminiInfo,
transformers: TransformersInfo,
deepseek: DeepseekInfo,
+ aimlapi: AimlApiInfo,
lmstudio: LMStudioInfo,
custom_openai: {
key: 'custom_openai',
@@ -76,6 +82,7 @@ export const chatModelProviders: Record<
anthropic: loadAnthropicChatModels,
gemini: loadGeminiChatModels,
deepseek: loadDeepseekChatModels,
+ aimlapi: loadAimlApiChatModels,
lmstudio: loadLMStudioChatModels,
};
@@ -87,6 +94,7 @@ export const embeddingModelProviders: Record<
ollama: loadOllamaEmbeddingModels,
gemini: loadGeminiEmbeddingModels,
transformers: loadTransformersEmbeddingsModels,
+ aimlapi: loadAimlApiEmbeddingModels,
lmstudio: loadLMStudioEmbeddingsModels,
};
From 0bb8b7ec5c22f8cc6f1c6ef943dbbacacdb28ba3 Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Sat, 28 Jun 2025 13:49:17 +0530
Subject: [PATCH 25/36] feat(weather-widget): enable geolocation for weather
data
Replaces the previous commented-out geolocation logic with an implementation that uses the browser's geolocation API and reverse geocoding to determine the user's city. Falls back to approximate location if permission is denied or unavailable.
---
src/components/WeatherWidget.tsx | 58 +++++++++++++++++++-------------
1 file changed, 34 insertions(+), 24 deletions(-)
diff --git a/src/components/WeatherWidget.tsx b/src/components/WeatherWidget.tsx
index e6a631e..d308bb4 100644
--- a/src/components/WeatherWidget.tsx
+++ b/src/components/WeatherWidget.tsx
@@ -31,30 +31,40 @@ const WeatherWidget = () => {
city: string;
}) => void,
) => {
- /*
- // Geolocation doesn't give city so we'll country using ipapi for now
- if (navigator.geolocation) {
- const result = await navigator.permissions.query({
- name: 'geolocation',
- })
-
- if (result.state === 'granted') {
- navigator.geolocation.getCurrentPosition(position => {
- callback({
- latitude: position.coords.latitude,
- longitude: position.coords.longitude,
- })
- })
- } else if (result.state === 'prompt') {
- callback(await getApproxLocation())
- navigator.geolocation.getCurrentPosition(position => {})
- } else if (result.state === 'denied') {
- callback(await getApproxLocation())
- }
- } else {
- callback(await getApproxLocation())
- } */
- callback(await getApproxLocation());
+ if (navigator.geolocation) {
+ const result = await navigator.permissions.query({
+ name: 'geolocation',
+ });
+
+ if (result.state === 'granted') {
+ navigator.geolocation.getCurrentPosition(async (position) => {
+ const res = await fetch(
+ `https://api-bdc.io/data/reverse-geocode-client?latitude=${position.coords.latitude}&longitude=${position.coords.longitude}&localityLanguage=en`,
+ {
+ method: 'GET',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ },
+ );
+
+ const data = await res.json();
+
+ callback({
+ latitude: position.coords.latitude,
+ longitude: position.coords.longitude,
+ city: data.locality,
+ });
+ });
+ } else if (result.state === 'prompt') {
+ callback(await getApproxLocation());
+ navigator.geolocation.getCurrentPosition((position) => {});
+ } else if (result.state === 'denied') {
+ callback(await getApproxLocation());
+ }
+ } else {
+ callback(await getApproxLocation());
+ }
};
getLocation(async (location) => {
From 809b625a34cd8fbf3b380b08650897bd0b48a0cf Mon Sep 17 00:00:00 2001
From: ItzCrazyKns <95534749+ItzCrazyKns@users.noreply.github.com>
Date: Mon, 30 Jun 2025 15:42:41 +0530
Subject: [PATCH 26/36] feat(widgets): fix size on smaller screens, closes #791
---
src/components/EmptyChat.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/EmptyChat.tsx b/src/components/EmptyChat.tsx
index 42e5a09..0eb76ac 100644
--- a/src/components/EmptyChat.tsx
+++ b/src/components/EmptyChat.tsx
@@ -51,10 +51,10 @@ const EmptyChat = ({
/>