diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9e8eff118..51bda84d5 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -13,3 +13,4 @@ A clear and concise description of what the bug is. **Desktop (please complete the following information):** - OS: [e.g. Windows] - Browser [e.g. chrome, brave] + - ChatHub Version [you can find it in ChatHub Settings] diff --git a/.github/workflows/close-inactive-issues.yml b/.github/workflows/close-inactive-issues.yml new file mode 100644 index 000000000..d5cd3cf15 --- /dev/null +++ b/.github/workflows/close-inactive-issues.yml @@ -0,0 +1,22 @@ +name: Close inactive issues +on: + schedule: + - cron: "30 1 * * *" + +jobs: + close-issues: + runs-on: ubuntu-latest + permissions: + issues: write + pull-requests: write + steps: + - uses: actions/stale@v5 + with: + days-before-issue-stale: 30 + days-before-issue-close: 14 + stale-issue-label: "stale" + stale-issue-message: "This issue is stale because it has been open for 30 days with no activity." + close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale." + days-before-pr-stale: -1 + days-before-pr-close: -1 + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..c2632a15a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release Workflow + +permissions: + contents: write + +on: + push: + tags: + - 'v*.*.*' + +env: + VITE_PLAUSIBLE_API_HOST: ${{ vars.VITE_PLAUSIBLE_API_HOST }} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: '20' + + - name: Setup yarn + run: corepack enable + + - name: Install dependencies + run: yarn install + + - name: Build + run: yarn build + + - name: Package + uses: vimtor/action-zip@v1.1 + with: + files: dist/ + dest: chathub.zip + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: chathub.zip diff --git a/.gitignore b/.gitignore index 50c8dda2a..704ad2b69 100644 --- a/.gitignore +++ b/.gitignore @@ -2,8 +2,6 @@ logs *.log npm-debug.log* -yarn-debug.log* -yarn-error.log* pnpm-debug.log* lerna-debug.log* @@ -24,3 +22,11 @@ dist-ssr *.sw? .env + +.yarn/* +!.yarn/cache +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..05e796717 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +geeguard.js diff --git a/.yarnrc.yml b/.yarnrc.yml new file mode 100644 index 000000000..3186f3f07 --- /dev/null +++ b/.yarnrc.yml @@ -0,0 +1 @@ +nodeLinker: node-modules diff --git a/README.md b/README.md index e1527c04e..5f093047e 100644 --- a/README.md +++ b/README.md @@ -6,48 +6,25 @@
-
-
-##
-
-[Screenshot](#-screenshot) | [Features](#-features) | [Supported Bots](#-supported-bots) | [Manual Installation](#-manual-installation) | [Build from Source](#-build-from-source) | [Changelog](#-changelog)
-
-[author-image]: https://img.shields.io/badge/author-wong2-blue.svg
-[author-url]: https://github.com/wong2
-[license-image]: https://img.shields.io/github/license/chathub-dev/chathub?color=blue
-[license-url]: https://github.com/chathub-dev/chathub/blob/main/LICENSE
-[release-image]: https://img.shields.io/github/v/release/chathub-dev/chathub?color=blue
-[release-url]: https://github.com/chathub-dev/chathub/releases/latest
-[last-commit-image]: https://img.shields.io/github/last-commit/chathub-dev/chathub?label=last%20commit
-[last-commit-url]: https://github.com/chathub-dev/chathub/commits
+
## ✨ Features
-- 🤖 Use different chatbots in one app, currently supporting ChatGPT, new Bing Chat, Google Bard, Claude, and 10+ open-source models including Alpaca, Vicuna, ChatGLM etc
+- 🤖 Use different chatbots in one app, currently supporting ChatGPT, new Bing Chat, Google Bard, Claude, and open-source models including LLama2, Vicuna, ChatGLM etc
- 💬 Chat with multiple chatbots at the same time, making it easy to compare their answers
- 🚀 Support ChatGPT API and GPT-4 Browsing
- 🔍 Shortcut to quickly activate the app anywhere in the browser
@@ -57,148 +34,30 @@ English | [Indonesia](README_IN.md) | &
- 📥 Export and Import all your data
- 🔗 Share conversation to markdown
- 🌙 Dark mode
+- 🌐 Web access
## 🤖 Supported Bots
-* ChatGPT (via Webapp/API/Azure/Poe)
-* Bing Chat
-* Google Bard
-* Claude (via Poe)
-* iFlytek Spark
-* ChatGLM
-* Alpaca
-* Vicuna
-* Koala
-* Dolly
-* LLaMA
-* StableLM
-* OpenAssistant
-* ChatRWKV
-* ...
-
-## 🔧 Manual Installation
-
-- Download chathub.zip from [Releases](https://github.com/chathub-dev/chathub/releases)
-- Unzip the file
-- In Chrome/Edge go to the extensions page (chrome://extensions or edge://extensions)
-- Enable Developer Mode
-- Drag the unzipped folder anywhere on the page to import it (do not delete the folder afterward)
+- ChatGPT (via Webapp/API/Azure/Poe)
+- Bing Chat
+- Google Bard
+- Claude 2 (via Webapp/API/Poe)
+- LLaMA 2
+- ChatGLM
+- Pi by Inflection
+- Vicuna
+- WizardLM
+- iFlytek Spark
+- Tongyi Qianwen
+- Baichuan
+- ...
## 🔨 Build from Source
- Clone the source code
+- `corepack enable`
- `yarn install`
- `yarn build`
-- Load `dist` folder to browser by following steps in _Manual Installation_
-
-## 📜 Changelog
-
-### v1.22.0
-
-- Support Claude API
-
-### v1.21.0
-
-- Add more open-source models
-
-### v1.20.0
-
-- Access from Chrome side panel
-
-### v1.19.0
-
-- Quick access to prompts
-
-### v1.18.0
-
-- Support Alpaca, Vicuna and ChatGLM
-
-### v1.17.0
-
-- Support GPT-4 Browsing model
-
-### v1.16.5
-
-- Add Azure OpenAI service support
-
-### v1.16.0
-
-- Add custom theme setting
-
-### v1.15.0
-
-- Add Xunfei Spark bot
-
-### v1.14.0
-
-- Support more bots in all-in-one mode for premium users
-
-### v1.12.0
-
-- Add premium license
-
-### v1.11.0
-
-- Support Claude (via Poe)
-
-### v1.10.0
-
-- Command + K
-
-### v1.9.4
-
-- Dark mode
-
-### v1.9.3
-
-- Support math formula with katex
-- Save community prompt to local
-
-### v1.9.2
-
-- Delete history messages
-
-### v1.9.0
-
-- Share chat as markdown or via sharegpt.com
-
-### v1.8.0
-
-- Import/Export all data
-- Edit local prompts
-- Switch chatbots for comparison
-
-### v1.7.0
-
-- Add conversation history
-
-### v1.6.0
-
-- Add support for Google Bard
-
-### v1.5.4
-
-- Support GPT-4 model in ChatGPT api mode
-
-### v1.5.1
-
-- Add i18n settings
-
-### v1.5.0
-
-- Support GPT-4 model in ChatGPT Webapp mode
-
-### v1.4.0
-
-- Add Prompt Library
-
-### v1.3.0
-
-- Add copy code button
-- Sync chat state between all-in-one and standalone mode
-- Allows input while generating answer
-
-### v1.2.0
-
-- Support copy message text
-- Improve setting page form element style
+- In Chrome/Edge go to the Extensions page (chrome://extensions or edge://extensions)
+- Enable Developer Mode
+- Drag the `dist` folder anywhere on the page to import it (do not delete the folder afterward)
diff --git a/_locales/en/messages.json b/_locales/en/messages.json
index 0fc3bfdd4..c7718fb5b 100644
--- a/_locales/en/messages.json
+++ b/_locales/en/messages.json
@@ -3,6 +3,6 @@
"message": "ChatHub - All-in-one chatbot client"
},
"appDesc": {
- "message": "All your favourite chatbots in one place"
+ "message": "Use ChatGPT, Bing, Bard, Claude and more chatbots simultaneously"
}
}
diff --git a/_locales/es/messages.json b/_locales/es/messages.json
index 64d273f0b..9def36532 100644
--- a/_locales/es/messages.json
+++ b/_locales/es/messages.json
@@ -3,6 +3,6 @@
"message": "ChatHub - Cliente de chatbot todo en uno"
},
"appDesc": {
- "message": "Mejora la interfaz de usuario de tus chatbots favoritos"
+ "message": "Utiliza ChatGPT, Bing, Bard, Claude y más chatbots simultáneamente"
}
-}
\ No newline at end of file
+}
diff --git a/_locales/pt_BR/messages.json b/_locales/pt_BR/messages.json
new file mode 100644
index 000000000..dc0159cfd
--- /dev/null
+++ b/_locales/pt_BR/messages.json
@@ -0,0 +1,8 @@
+{
+ "appName": {
+ "message": "ChatHub - All-in-one chatbot client"
+ },
+ "appDesc": {
+ "message": "Use o ChatGPT, Bing, Bard, Claude e mais chatbots simultaneamente"
+ }
+}
diff --git a/_locales/pt_PT/messages.json b/_locales/pt_PT/messages.json
new file mode 100644
index 000000000..dc0159cfd
--- /dev/null
+++ b/_locales/pt_PT/messages.json
@@ -0,0 +1,8 @@
+{
+ "appName": {
+ "message": "ChatHub - All-in-one chatbot client"
+ },
+ "appDesc": {
+ "message": "Use o ChatGPT, Bing, Bard, Claude e mais chatbots simultaneamente"
+ }
+}
diff --git a/manifest.config.ts b/manifest.config.ts
index 90a70f090..1d162b91b 100644
--- a/manifest.config.ts
+++ b/manifest.config.ts
@@ -1,12 +1,12 @@
import { defineManifest } from '@crxjs/vite-plugin'
-export default defineManifest(async (env) => {
+export default defineManifest(async () => {
return {
manifest_version: 3,
name: '__MSG_appName__',
description: '__MSG_appDesc__',
default_locale: 'en',
- version: '1.26.1',
+ version: '1.45.7',
icons: {
'16': 'src/assets/icon.png',
'32': 'src/assets/icon.png',
@@ -23,9 +23,13 @@ export default defineManifest(async (env) => {
'https://*.openai.com/',
'https://bard.google.com/',
'https://*.chathub.gg/',
+ 'https://*.duckduckgo.com/',
+ 'https://*.poe.com/',
+ 'https://*.anthropic.com/',
+ 'https://*.claude.ai/',
],
- optional_host_permissions: ['https://*/*'],
- permissions: ['storage', 'unlimitedStorage', 'sidePanel'],
+ optional_host_permissions: ['https://*/*', 'wss://*/*'],
+ permissions: ['storage', 'unlimitedStorage', 'sidePanel', 'declarativeNetRequestWithHostAccess', 'scripting'],
content_scripts: [
{
matches: ['https://chat.openai.com/*'],
@@ -46,5 +50,34 @@ export default defineManifest(async (env) => {
side_panel: {
default_path: 'sidepanel.html',
},
+ declarative_net_request: {
+ rule_resources: [
+ {
+ id: 'ruleset_bing',
+ enabled: true,
+ path: 'src/rules/bing.json',
+ },
+ {
+ id: 'ruleset_ddg',
+ enabled: true,
+ path: 'src/rules/ddg.json',
+ },
+ {
+ id: 'ruleset_qianwen',
+ enabled: true,
+ path: 'src/rules/qianwen.json',
+ },
+ {
+ id: 'ruleset_baichuan',
+ enabled: true,
+ path: 'src/rules/baichuan.json',
+ },
+ {
+ id: 'ruleset_pplx',
+ enabled: true,
+ path: 'src/rules/pplx.json',
+ },
+ ],
+ },
}
})
diff --git a/package.json b/package.json
index dbd6c45f7..bda8ab1e2 100644
--- a/package.json
+++ b/package.json
@@ -8,93 +8,107 @@
"build": "tsc && vite build"
},
"devDependencies": {
- "@crxjs/vite-plugin": "^2.0.0-beta.18",
- "@headlessui/tailwindcss": "^0.1.3",
- "@types/lodash-es": "^4.17.7",
- "@types/md5": "^2.3.2",
- "@types/react": "^18.2.7",
- "@types/react-color": "^3.0.6",
- "@types/react-copy-to-clipboard": "^5.0.4",
- "@types/react-dom": "^18.2.4",
- "@types/react-scroll-to-bottom": "^4.2.0",
- "@types/turndown": "^5.0.1",
- "@types/uuid": "^9.0.1",
- "@types/webextension-polyfill": "^0.10.0",
- "@typescript-eslint/eslint-plugin": "^5.60.1",
- "@typescript-eslint/parser": "^5.60.1",
- "@vitejs/plugin-react": "^4.0.0",
- "autoprefixer": "^10.4.14",
- "eslint": "^8.41.0",
- "eslint-config-prettier": "^8.8.0",
- "eslint-plugin-react": "^7.32.2",
+ "@crxjs/vite-plugin": "2.0.0-beta.21",
+ "@headlessui/tailwindcss": "^0.2.0",
+ "@types/cookie": "^0.6.0",
+ "@types/humanize-duration": "^3.27.3",
+ "@types/lodash-es": "^4.17.12",
+ "@types/md5": "^2.3.5",
+ "@types/react": "18.2.18",
+ "@types/react-color": "^3.0.10",
+ "@types/react-copy-to-clipboard": "^5.0.7",
+ "@types/react-dom": "^18.2.18",
+ "@types/react-scroll-to-bottom": "^4.2.4",
+ "@types/turndown": "^5.0.4",
+ "@types/uuid": "^9.0.7",
+ "@types/webextension-polyfill": "^0.10.7",
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
+ "@typescript-eslint/parser": "^6.15.0",
+ "@vitejs/plugin-react": "^4.2.1",
+ "autoprefixer": "^10.4.16",
+ "chrome-types": "^0.1.246",
+ "eslint": "^8.56.0",
+ "eslint-config-prettier": "^9.1.0",
+ "eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
- "postcss": "^8.4.24",
+ "postcss": "^8.4.32",
"postcss-import": "^15.1.0",
- "postcss-nesting": "^11.2.2",
- "prettier": "^2.8.8",
+ "postcss-nesting": "^12.0.2",
+ "prettier": "^3.1.1",
"process": "^0.11.10",
- "sass": "^1.62.1",
- "tailwind-scrollbar": "^3.0.4",
- "tailwindcss": "^3.3.2",
- "typescript": "^5.0.4",
- "vite": "4.2",
- "vite-tsconfig-paths": "^4.2.0"
+ "sass": "^1.69.5",
+ "tailwind-scrollbar": "^3.0.5",
+ "tailwindcss": "^3.4.0",
+ "typescript": "^5.3.3",
+ "vite": "4.5.1",
+ "vite-tsconfig-paths": "^4.2.2"
},
"dependencies": {
- "@floating-ui/react": "^0.24.2",
- "@headlessui/react": "^1.7.14",
- "@heroicons/react": "^2.0.18",
- "@radix-ui/react-dialog": "^1.0.4",
- "@radix-ui/react-tooltip": "^1.0.6",
- "@sentry/integrations": "^7.54.0",
- "@sentry/react": "^7.54.0",
- "@tanstack/react-router": "^0.0.1-beta.83",
- "browser-fs-access": "^0.34.1",
- "classnames": "^2.3.2",
- "cmdk": "^0.2.0",
- "eventsource-parser": "^1.0.0",
- "fuse.js": "^6.6.2",
- "github-markdown-css": "^5.2.0",
+ "@epic-web/cachified": "^4.0.0",
+ "@floating-ui/react": "^0.26.4",
+ "@google/generative-ai": "^0.1.3",
+ "@headlessui/react": "^1.7.17",
+ "@heroicons/react": "^2.1.1",
+ "@radix-ui/react-tooltip": "^1.0.7",
+ "@sentry/integrations": "^7.90.0",
+ "@sentry/react": "^7.90.0",
+ "@tanstack/react-router": "^1.43.6",
+ "async-cache-dedupe": "^2.0.0",
+ "browser-fs-access": "^0.35.0",
+ "browser-image-compression": "^2.0.2",
+ "clsx": "^2.0.0",
+ "compare-versions": "^6.1.0",
+ "cookie": "^0.6.0",
+ "dayjs": "^1.11.10",
+ "eventsource-parser": "^1.1.1",
+ "framer-motion": "^10.16.16",
+ "fuse.js": "^7.0.0",
+ "github-markdown-css": "^5.5.0",
"gpt3-tokenizer": "^1.1.5",
- "highlight.js": "^11.8.0",
- "i18next": "^22.5.0",
- "i18next-browser-languagedetector": "^7.0.2",
- "immer": "^9.0.19",
+ "highlight.js": "^11.9.0",
+ "humanize-duration": "^3.31.0",
+ "i18next": "^23.7.11",
+ "i18next-browser-languagedetector": "^7.2.0",
+ "immer": "^10.0.3",
"inter-ui": "^3.19.3",
- "jotai": "^2.2.1",
+ "jotai": "^2.6.0",
"jotai-immer": "^0.2.0",
"js-base64": "^3.7.5",
"lodash-es": "^4.17.21",
- "lucide-react": "^0.252.0",
"md5": "^2.3.0",
- "ofetch": "^1.0.1",
+ "nanoid": "^5.0.4",
+ "ofetch": "^1.3.3",
"plausible-tracker": "^0.3.8",
"react": "^18.2.0",
"react-color": "^2.19.3",
+ "react-confetti-explosion": "^2.1.2",
"react-copy-to-clipboard": "^5.1.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
- "react-i18next": "^12.3.1",
- "react-icons": "^4.9.0",
+ "react-i18next": "^13.5.0",
+ "react-icons": "^4.12.0",
"react-markdown": "^8.0.7",
- "react-node-to-string": "^0.1.1",
+ "react-node-to-string": "^0.1.2",
"react-scroll-to-bottom": "^4.2.0",
"react-spinners": "^0.13.8",
- "react-textarea-autosize": "^8.5.0",
- "react-viewport-list": "^7.1.1",
+ "react-textarea-autosize": "^8.5.3",
+ "react-viewport-list": "^7.1.2",
"rehype-highlight": "^6.0.0",
- "rehype-stringify": "^9.0.3",
+ "rehype-stringify": "^9.0.4",
"remark-breaks": "^3.0.3",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"remark-parse": "^10.0.2",
"remark-rehype": "^10.1.0",
"remark-supersub": "^1.0.0",
- "swr": "^2.1.5",
+ "slashes": "^3.0.12",
+ "swr": "^2.2.4",
+ "tailwind-merge": "^2.1.0",
"turndown": "^7.1.2",
"unified": "^10.1.2",
- "uuid": "^9.0.0",
+ "uuid": "^9.0.1",
"webextension-polyfill": "^0.10.0",
"websocket-as-promised": "^2.0.1"
- }
+ },
+ "packageManager": "yarn@4.0.1"
}
diff --git a/public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js b/public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js
new file mode 100644
index 000000000..dd8aac17f
--- /dev/null
+++ b/public/js/v2/35536E1E-65B4-4D96-9D97-6ADB7EFF8147/api.js
@@ -0,0 +1 @@
+var arkoseLabsClientApi2c145230;!function(){var e={7983:function(e,t){"use strict";t.N=void 0;var n=/^([^\w]*)(javascript|data|vbscript)/im,r=/(\w+)(^\w|;)?/g,i=/&tab;/gi,o=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim,a=/^.+(:|:)/gim,c=[".","/"];t.N=function(e){var t,s=(t=e||"",(t=t.replace(i," ")).replace(r,(function(e,t){return String.fromCharCode(t)}))).replace(o,"").trim();if(!s)return"about:blank";if(function(e){return c.indexOf(e[0])>-1}(s))return s;var u=s.match(a);if(!u)return s;var l=u[0];return n.test(l)?"about:blank":s}},3940:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t