Compare commits

...

71 Commits
v2.8 ... v2.8.3

Author SHA1 Message Date
Yifei Zhang
514ed03378 Merge pull request #2065 from macvip/window-state
restore last window state (position and size) on startup
2023-06-21 02:30:25 +08:00
Yifei Zhang
078b039cf1 Merge pull request #2064 from mushan0x0/patch-1
fix: #2061 RequestInit TypeError
2023-06-20 18:04:24 +08:00
macvip
a120670785 restore last window state (position and size) on startup 2023-06-20 13:06:54 +08:00
mushan0x0
9c05d136f5 fix: #2061 RequestInit TypeError 2023-06-20 11:57:31 +08:00
Yifei Zhang
daeb8a67a3 Merge pull request #2048 from ilizhu/main
feat: i18n in message exporter
2023-06-20 02:45:48 +08:00
Yifei Zhang
c64888cccd Merge pull request #2051 from Yidadaa/dependabot/npm_and_yarn/next-13.4.6
chore(deps): bump next from 13.4.3 to 13.4.6
2023-06-20 02:40:23 +08:00
Yifei Zhang
6fc2637870 Merge pull request #2050 from Yidadaa/dependabot/npm_and_yarn/zustand-4.3.8
chore(deps): bump zustand from 4.3.6 to 4.3.8
2023-06-20 02:40:14 +08:00
Yifei Zhang
fc4df23075 Merge pull request #2053 from Yidadaa/dependabot/npm_and_yarn/lint-staged-13.2.2
chore(deps-dev): bump lint-staged from 13.2.0 to 13.2.2
2023-06-20 02:40:00 +08:00
Yifei Zhang
3ae502986b Merge pull request #2054 from Yidadaa/dependabot/npm_and_yarn/types/react-18.2.12
chore(deps-dev): bump @types/react from 18.0.31 to 18.2.12
2023-06-20 02:39:50 +08:00
Yifei Zhang
67f23d202a Merge pull request #2056 from Yidadaa/bugfix-0620
fix: #2055 should render mermaid completely
2023-06-20 02:38:59 +08:00
Yidadaa
3c38b9c93b fix: #2055 should render mermaid completely 2023-06-20 02:37:38 +08:00
dependabot[bot]
152a00baf5 chore(deps-dev): bump @types/react from 18.0.31 to 18.2.12
Bumps [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react) from 18.0.31 to 18.2.12.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react)

---
updated-dependencies:
- dependency-name: "@types/react"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:10:39 +00:00
dependabot[bot]
405d02023c chore(deps-dev): bump lint-staged from 13.2.0 to 13.2.2
Bumps [lint-staged](https://github.com/okonet/lint-staged) from 13.2.0 to 13.2.2.
- [Release notes](https://github.com/okonet/lint-staged/releases)
- [Commits](https://github.com/okonet/lint-staged/compare/v13.2.0...v13.2.2)

---
updated-dependencies:
- dependency-name: lint-staged
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:10:15 +00:00
dependabot[bot]
4ba2d0d7e0 chore(deps): bump next from 13.4.3 to 13.4.6
Bumps [next](https://github.com/vercel/next.js) from 13.4.3 to 13.4.6.
- [Release notes](https://github.com/vercel/next.js/releases)
- [Changelog](https://github.com/vercel/next.js/blob/canary/release.js)
- [Commits](https://github.com/vercel/next.js/compare/v13.4.3...v13.4.6)

---
updated-dependencies:
- dependency-name: next
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:09:00 +00:00
dependabot[bot]
38ce230cf5 chore(deps): bump zustand from 4.3.6 to 4.3.8
Bumps [zustand](https://github.com/pmndrs/zustand) from 4.3.6 to 4.3.8.
- [Release notes](https://github.com/pmndrs/zustand/releases)
- [Commits](https://github.com/pmndrs/zustand/compare/v4.3.6...v4.3.8)

---
updated-dependencies:
- dependency-name: zustand
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-19 11:06:59 +00:00
zhuge
c6696313bf 聊天记录导出格式为image时预览聊天信息项使用设置的语言 chat information items using the language in the settings when exporting chat records in image format 2023-06-19 16:16:09 +08:00
Yifei Zhang
89717c9b15 Update issue-translator.yml 2023-06-18 18:28:31 +08:00
Yifei Zhang
3aca699ad9 Create issue-translator.yml 2023-06-18 18:27:18 +08:00
Yifei Zhang
f3ec9f02eb Merge pull request #1807 from AngelLiang/feat/frequency_penalty
feat: Add frequency_penalty request parameter
2023-06-18 14:36:55 +08:00
Yifei Zhang
1c7f3e6057 Merge pull request #2028 from Yidadaa/bugfix-0618
fix: #1771 should not lose chat context when sumindex > n - count
2023-06-18 00:52:41 +08:00
Yidadaa
db63a5a670 fix: #1771 should not lose chat context when sumindex > n - count 2023-06-18 00:51:16 +08:00
Yifei Zhang
0a2cccfd6e Merge pull request #2018 from Yidadaa/bugfix-0617
feat: add nynorsk option
2023-06-17 01:20:06 +08:00
Yidadaa
113bd24796 feat: add nynorsk option 2023-06-17 01:03:06 +08:00
Yifei Zhang
374a27a72e Merge pull request #1065 from perandre/norwegian-translation
Add Norwegian translation
2023-06-17 00:33:26 +08:00
Xavier Barbosa
567eff9ef4 Remove deprecated keys 2023-06-16 16:00:57 +01:00
Xavier Barbosa
bfe33af03d Merge branch 'main' into norwegian-translation 2023-06-16 16:00:17 +01:00
Yifei Zhang
7ebc5eb70f Merge pull request #2002 from yeenbean/CVE-2023-2251
Remediation of CVE-2023-2251
2023-06-16 18:11:09 +08:00
Yifei Zhang
52287fd01d Merge pull request #2009 from taro-ishihara/i18n/japanese-translation
Fix Japanese language file
2023-06-16 18:10:56 +08:00
Yifei Zhang
e0f2bc2725 Merge pull request #2005 from Yidadaa/dependabot/npm_and_yarn/use-debounce-9.0.4
chore(deps): bump use-debounce from 9.0.3 to 9.0.4
2023-06-16 16:51:48 +08:00
Yifei Zhang
4355ec3b44 Merge pull request #2007 from Yidadaa/dependabot/npm_and_yarn/types/node-20.3.1
chore(deps-dev): bump @types/node from 18.15.11 to 20.3.1
2023-06-16 16:51:21 +08:00
Yifei Zhang
0c2f11ffd7 Merge pull request #2008 from Yidadaa/dependabot/npm_and_yarn/react-markdown-8.0.7
chore(deps): bump react-markdown from 8.0.6 to 8.0.7
2023-06-16 16:51:10 +08:00
Yifei Zhang
65e2f38fac Merge pull request #2004 from Yidadaa/dependabot/npm_and_yarn/mermaid-10.2.3
chore(deps): bump mermaid from 10.1.0 to 10.2.3
2023-06-16 16:50:51 +08:00
Taro Ishihara
aeaefbf8a9 Fix Japanese language file 2023-06-16 00:23:56 -07:00
dependabot[bot]
719cb3ae05 chore(deps): bump react-markdown from 8.0.6 to 8.0.7
Bumps [react-markdown](https://github.com/remarkjs/react-markdown) from 8.0.6 to 8.0.7.
- [Release notes](https://github.com/remarkjs/react-markdown/releases)
- [Changelog](https://github.com/remarkjs/react-markdown/blob/main/changelog.md)
- [Commits](https://github.com/remarkjs/react-markdown/compare/8.0.6...8.0.7)

---
updated-dependencies:
- dependency-name: react-markdown
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 07:22:32 +00:00
dependabot[bot]
08816c8f7d chore(deps-dev): bump @types/node from 18.15.11 to 20.3.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 18.15.11 to 20.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 07:22:15 +00:00
dependabot[bot]
1031203e3f chore(deps): bump use-debounce from 9.0.3 to 9.0.4
Bumps [use-debounce](https://github.com/xnimorz/use-debounce) from 9.0.3 to 9.0.4.
- [Release notes](https://github.com/xnimorz/use-debounce/releases)
- [Changelog](https://github.com/xnimorz/use-debounce/blob/master/CHANGELOG.md)
- [Commits](https://github.com/xnimorz/use-debounce/compare/9.0.3...9.0.4)

---
updated-dependencies:
- dependency-name: use-debounce
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 07:21:24 +00:00
dependabot[bot]
63ef6e7d3d chore(deps): bump mermaid from 10.1.0 to 10.2.3
Bumps [mermaid](https://github.com/mermaid-js/mermaid) from 10.1.0 to 10.2.3.
- [Release notes](https://github.com/mermaid-js/mermaid/releases)
- [Changelog](https://github.com/mermaid-js/mermaid/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/mermaid-js/mermaid/compare/v10.1.0...v10.2.3)

---
updated-dependencies:
- dependency-name: mermaid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-16 07:20:57 +00:00
Yifei Zhang
590c9bb978 Create dependabot.yml 2023-06-16 15:12:47 +08:00
Joshua
5055a8c7a3 yarn.lock also required for CVE-2023-2251 🙃 2023-06-15 23:54:53 -07:00
Joshua
284c3f27e7 Resolves found vuln CVE-2023-2251 2023-06-15 23:33:08 -07:00
Yifei Zhang
468f198a6b Update README.md 2023-06-16 01:42:51 +08:00
Yifei Zhang
b0c6f6d4d3 Update tauri.conf.json 2023-06-16 00:53:10 +08:00
Yidadaa
473061b4d5 fixup: add TAURI_KEY_PASSWORD secrets 2023-06-16 00:18:54 +08:00
Yifei Zhang
c4921f3da7 Merge pull request #1990 from Yidadaa/bugfix-0615
fix: #1982 should not fullscreen on standlone build
2023-06-16 00:02:17 +08:00
Yidadaa
91b871ef3b feat: try to add auto updater 2023-06-15 23:55:18 +08:00
Yidadaa
698be6671c feat: enable drag area for tauri apps 2023-06-15 23:20:14 +08:00
Yidadaa
47c546fafa fix: #1982 should not fullscreen on standlone build 2023-06-15 22:34:50 +08:00
Yifei Zhang
9d1a84858c Merge pull request #1973 from Jiacheng787/patch-1
fix: updating the array using push in zustand does not actually trigger component updates
2023-06-15 14:42:33 +08:00
Jiacheng Dong
4dd5bf71ea Update chat.ts 2023-06-15 13:59:38 +08:00
Yidadaa
ea253e3bae fixup: tauri app name 2023-06-15 11:01:37 +08:00
Jiacheng Dong
1d42e955fc fix: updating the array using push in zustand does not actually trigger component updates 2023-06-15 10:55:25 +08:00
Jiacheng Dong
e636d486f5 fix: updating the array using push in zustand does not actually trigger component updates 2023-06-15 10:23:01 +08:00
Yifei Zhang
818cc545eb Merge pull request #1970 from Yidadaa/app
feat: update app release workflow
2023-06-15 03:32:18 +08:00
Yidadaa
e7858495e6 feat: update app release workflow 2023-06-15 03:28:53 +08:00
Yifei Zhang
af3a273a56 Merge pull request #1969 from Yidadaa/app
feat: ready to release desktop app
2023-06-15 02:53:42 +08:00
Yidadaa
6264c02543 feat: add app logo and
release workflow
2023-06-15 02:49:08 +08:00
Yidadaa
80d5bfd7c0 feat: add app dev mode 2023-06-15 01:48:56 +08:00
Yifei Zhang
3fa8b0ad14 Merge pull request #1968 from Yidadaa/bugfix-0614
fix: #1954 lazy render bugs
2023-06-15 01:40:51 +08:00
Yidadaa
184a0b9481 fix: #1954 lazy render bugs 2023-06-15 01:34:21 +08:00
Yifei Zhang
4e80096ee4 Merge pull request #1967 from Yidadaa/bugfix-0614
fix: #1931 try to fix cors issues
2023-06-15 00:31:00 +08:00
Yidadaa
0fb775d71a fix: #1931 try to fix cors issues 2023-06-15 00:28:47 +08:00
Yidadaa
76fdd047e7 feat: new token count function 2023-06-15 00:14:38 +08:00
Yidadaa
8590750e4c feat: close #1960 add gpt-3.5-turbo-16k-0613 2023-06-14 23:22:59 +08:00
Yifei Zhang
590bd8e4bb Merge pull request #1946 from cesaryuan/fix-selection
fix: remove selection range when user blured
2023-06-14 15:42:24 +08:00
Cesaryuan
b4cb8c3d75 chore: translate comment to english 2023-06-14 14:40:51 +08:00
Cesaryuan
21aa015a79 fix: remove slection range when user blured 2023-06-14 14:30:08 +08:00
Yifei Zhang
dd5b9d420b Merge pull request #1928 from samelamin/fix_chat_time
fix date time bug on chat lists
2023-06-14 11:31:00 +08:00
samelamin
c56c6074e9 fix date time bug 2023-06-13 18:32:51 +01:00
AngelLiang
72cbb156ae feat: Add frequency_penalty request parameter 2023-06-04 16:05:35 +08:00
Per André Rønsen
5a10b2a75f Update no.ts with const no: LocaleType 2023-05-10 14:59:57 +01:00
Per André Rønsen
72b553efe8 Add files for Norwegian translation 2023-05-10 14:59:36 +01:00
70 changed files with 1302 additions and 379 deletions

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"

88
.github/workflows/app.yml vendored Normal file
View File

@@ -0,0 +1,88 @@
name: Release App
on:
workflow_dispatch:
release:
types: [published]
jobs:
create-release:
permissions:
contents: write
runs-on: ubuntu-20.04
outputs:
release_id: ${{ steps.create-release.outputs.result }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./src-tauri/tauri.conf.json').package.version")" >> $GITHUB_ENV
- name: create release
id: create-release
uses: actions/github-script@v6
with:
script: |
const { data } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo,
})
return data.id
build-tauri:
needs: create-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: install frontend dependencies
run: yarn install # change this to npm or pnpm depending on which one you use
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}
publish-release:
permissions:
contents: write
runs-on: ubuntu-20.04
needs: [create-release, build-tauri]
steps:
- name: publish release
id: publish-release
uses: actions/github-script@v6
env:
release_id: ${{ needs.create-release.outputs.release_id }}
with:
script: |
github.rest.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: process.env.release_id,
draft: false,
prerelease: false
})

15
.github/workflows/issue-translator.yml vendored Normal file
View File

@@ -0,0 +1,15 @@
name: Issue Translator
on:
issue_comment:
types: [created]
issues:
types: [opened]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: usthe/issues-translate-action@v2.7
with:
IS_MODIFY_TITLE: false
CUSTOM_BOT_NOTE: Bot detected the issue body's language is not English, translate it automatically.

View File

@@ -35,6 +35,6 @@ jobs:
- name: Sync check - name: Sync check
if: failure() if: failure()
run: | run: |
echo "::error::由于权限不足,导致同步失败(这是预期的行为),请前往仓库首页手动执行[Sync fork]。" echo "[Error] 由于上游仓库的 workflow 文件变更,导致 GitHub 自动暂停了本次自动更新,你需要手动 Sync Fork 一次详细教程请查看https://github.com/Yidadaa/ChatGPT-Next-Web/blob/main/README_CN.md#%E6%89%93%E5%BC%80%E8%87%AA%E5%8A%A8%E6%9B%B4%E6%96%B0"
echo "::error::Due to insufficient permissions, synchronization failed (as expected). Please go to the repository homepage and manually perform [Sync fork]." echo "[Error] Due to a change in the workflow file of the upstream repository, GitHub has automatically suspended the scheduled automatic update. You need to manually sync your fork. Please refer to the detailed tutorial for instructions: https://github.com/Yidadaa/ChatGPT-Next-Web#enable-automatic-updates"
exit 1 exit 1

3
.gitignore vendored
View File

@@ -41,3 +41,6 @@ dev
# docker-compose env files # docker-compose env files
.env .env
*.key
*.key.pub

View File

@@ -5,13 +5,30 @@
English / [简体中文](./README_CN.md) English / [简体中文](./README_CN.md)
One-Click to deploy well-designed ChatGPT web UI on Vercel. One-Click to get well-designed cross-platform ChatGPT web UI.
一键免费部署你的私人 ChatGPT 网页应用。 一键免费部署你的跨平台私人 ChatGPT 应用。
[Demo](https://chatgpt.nextweb.fun/) / [Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa) [![Web][Web-image]][web-url]
[![Windows][Windows-image]][download-url]
[![MacOS][MacOS-image]][download-url]
[![Linux][Linux-image]][download-url]
[演示](https://chatgpt.nextweb.fun/) / [反馈](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [QQ 群](https://github.com/Yidadaa/ChatGPT-Next-Web/discussions/1724) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg) [Web App](https://chatgpt.nextweb.fun/) / [Desktop App](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [Issues](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [Buy Me a Coffee](https://www.buymeacoffee.com/yidadaa)
[网页版](https://chatgpt.nextweb.fun/) / [客户端](https://github.com/Yidadaa/ChatGPT-Next-Web/releases) / [反馈](https://github.com/Yidadaa/ChatGPT-Next-Web/issues) / [QQ 群](https://github.com/Yidadaa/ChatGPT-Next-Web/discussions/1724) / [打赏开发者](https://user-images.githubusercontent.com/16968934/227772541-5bcd52d8-61b7-488c-a203-0330d8006e2b.jpg)
[web-url]: https://chatgpt.nextweb.fun
[download-url]: https://github.com/Yidadaa/ChatGPT-Next-Web/releases
[Web-image]: https://img.shields.io/badge/Web-PWA-orange?logo=microsoftedge
[Windows-image]: https://img.shields.io/badge/-Windows-blue?logo=windows
[MacOS-image]: https://img.shields.io/badge/-MacOS-black?logo=apple
[Linux-image]: https://img.shields.io/badge/-Linux-333?logo=ubuntu
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web) [![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2FYidadaa%2FChatGPT-Next-Web&env=OPENAI_API_KEY&env=CODE&project-name=chatgpt-next-web&repository-name=ChatGPT-Next-Web)
@@ -24,6 +41,8 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
## Features ## Features
- **Deploy for free with one-click** on Vercel in under 1 minute - **Deploy for free with one-click** on Vercel in under 1 minute
- Compact client (~5MB) on Linux/Windows/MacOS, [download it now](https://github.com/Yidadaa/ChatGPT-Next-Web/releases)
- Fully compatible with self-deployed llms, recommended for use with [RWKV-Runner](https://github.com/josStorer/RWKV-Runner) or [LocalAI](https://github.com/go-skynet/LocalAI)
- Privacy first, all data stored locally in the browser - Privacy first, all data stored locally in the browser
- Markdown support: LaTex, mermaid, code highlight, etc. - Markdown support: LaTex, mermaid, code highlight, etc.
- Responsive design, dark mode and PWA - Responsive design, dark mode and PWA
@@ -39,23 +58,20 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
- [x] User Prompt: user can edit and save custom prompts to prompt list - [x] User Prompt: user can edit and save custom prompts to prompt list
- [x] Prompt Template: create a new chat with pre-defined in-context prompts [#993](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/993) - [x] Prompt Template: create a new chat with pre-defined in-context prompts [#993](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/993)
- [x] Share as image, share to ShareGPT [#1741](https://github.com/Yidadaa/ChatGPT-Next-Web/pull/1741) - [x] Share as image, share to ShareGPT [#1741](https://github.com/Yidadaa/ChatGPT-Next-Web/pull/1741)
- [ ] Desktop App with tauri - [x] Desktop App with tauri
- [ ] Self-host Model: support llama, alpaca, ChatGLM, BELLE etc. - [x] Self-host Model: Fully compatible with [RWKV-Runner](https://github.com/josStorer/RWKV-Runner), as well as server deployment of [LocalAI](https://github.com/go-skynet/LocalAI): llama/gpt4all/rwkv/vicuna/koala/gpt4all-j/cerebras/falcon/dolly etc.
- [ ] Plugins: support network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) - [ ] Plugins: support network search, calculator, any other apis etc. [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165)
### Not in Plan
- User login, accounts, cloud sync
- UI text customize
## What's New ## What's New
- 🚀 v2.0 is released, now you can create prompt templates, turn your ideas into reality! Read this: [ChatGPT Prompt Engineering Tips: Zero, One and Few Shot Prompting](https://www.allabtai.com/prompt-engineering-tips-zero-one-and-few-shot-prompting/). - 🚀 v2.0 is released, now you can create prompt templates, turn your ideas into reality! Read this: [ChatGPT Prompt Engineering Tips: Zero, One and Few Shot Prompting](https://www.allabtai.com/prompt-engineering-tips-zero-one-and-few-shot-prompting/).
- 🚀 v2.7 let's share conversations as image, or share to ShareGPT! - 🚀 v2.7 let's share conversations as image, or share to ShareGPT!
- 🚀 v2.8 now we have a client that runs across all platforms!
## 主要功能 ## 主要功能
- 在 1 分钟内使用 Vercel **免费一键部署** - 在 1 分钟内使用 Vercel **免费一键部署**
- 提供体积极小(~5MB的跨平台客户端Linux/Windows/MacOS, [下载地址](https://github.com/Yidadaa/ChatGPT-Next-Web/releases)
- 完整的 Markdown 支持LaTex 公式、Mermaid 流程图、代码高亮等等 - 完整的 Markdown 支持LaTex 公式、Mermaid 流程图、代码高亮等等
- 精心设计的 UI响应式设计支持深色模式支持 PWA - 精心设计的 UI响应式设计支持深色模式支持 PWA
- 极快的首屏加载速度(~100kb支持流式响应 - 极快的首屏加载速度(~100kb支持流式响应
@@ -72,20 +88,16 @@ One-Click to deploy well-designed ChatGPT web UI on Vercel.
- [x] 允许用户自行编辑内置 Prompt 列表 - [x] 允许用户自行编辑内置 Prompt 列表
- [x] 预制角色:使用预制角色快速定制新对话 [#993](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/993) - [x] 预制角色:使用预制角色快速定制新对话 [#993](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/993)
- [x] 分享为图片,分享到 ShareGPT 链接 [#1741](https://github.com/Yidadaa/ChatGPT-Next-Web/pull/1741) - [x] 分享为图片,分享到 ShareGPT 链接 [#1741](https://github.com/Yidadaa/ChatGPT-Next-Web/pull/1741)
- [ ] 使用 tauri 打包桌面应用 - [x] 使用 tauri 打包桌面应用
- [ ] 支持自部署的大语言模型 - [x] 支持自部署的大语言模型:开箱即用 [RWKV-Runner](https://github.com/josStorer/RWKV-Runner) ,服务端部署 [LocalAI 项目](https://github.com/go-skynet/LocalAI) llama / gpt4all / rwkv / vicuna / koala / gpt4all-j / cerebras / falcon / dolly 等等
- [ ] 插件机制,支持联网搜索、计算器、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165) - [ ] 插件机制,支持联网搜索、计算器、调用其他平台 api [#165](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/165)
### 不会开发的功能
- 界面文字自定义
- 用户登录、账号管理、消息云同步
## 最新动态 ## 最新动态
- 🚀 v2.0 已经发布,现在你可以使用面具功能快速创建预制对话了! 了解更多: [ChatGPT 提示词高阶技能:零次、一次和少样本提示](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/138)。 - 🚀 v2.0 已经发布,现在你可以使用面具功能快速创建预制对话了! 了解更多: [ChatGPT 提示词高阶技能:零次、一次和少样本提示](https://github.com/Yidadaa/ChatGPT-Next-Web/issues/138)。
- 💡 想要更方便地随时随地使用本项目可以试下这款桌面插件https://github.com/mushan0x0/AI0x0.com - 💡 想要更方便地随时随地使用本项目可以试下这款桌面插件https://github.com/mushan0x0/AI0x0.com
- 🚀 v2.7 现在可以将会话分享为图片了,也可以分享到 ShareGPT 的在线链接。 - 🚀 v2.7 现在可以将会话分享为图片了,也可以分享到 ShareGPT 的在线链接。
- 🚀 v2.8 发布了横跨 Linux/Windows/MacOS 的体积极小的客户端。
## Get Started ## Get Started
@@ -188,6 +200,9 @@ Before starting development, you must create a new `.env.local` file at project
``` ```
OPENAI_API_KEY=<your api key here> OPENAI_API_KEY=<your api key here>
# if you are not able to access openai service, use this BASE_URL
BASE_URL=https://chatgpt1.nextweb.fun/api/proxy
``` ```
### Local Development ### Local Development

View File

@@ -100,8 +100,6 @@ OpenAI 接口代理 URL如果你手动配置了 openai 接口代理,请填
## 开发 ## 开发
> 强烈不建议在本地进行开发或者部署,由于一些技术原因,很难在本地配置好 OpenAI API 代理,除非你能保证可以直连 OpenAI 服务器。
点击下方按钮,开始二次开发: 点击下方按钮,开始二次开发:
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Yidadaa/ChatGPT-Next-Web) [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/Yidadaa/ChatGPT-Next-Web)
@@ -110,6 +108,9 @@ OpenAI 接口代理 URL如果你手动配置了 openai 接口代理,请填
``` ```
OPENAI_API_KEY=<your api key here> OPENAI_API_KEY=<your api key here>
# 中国大陆用户,可以使用本项目自带的代理进行开发,你也可以自由选择其他代理地址
BASE_URL=https://chatgpt1.nextweb.fun/api/proxy
``` ```
### 本地开发 ### 本地开发

View File

@@ -2,7 +2,6 @@ import { NextRequest } from "next/server";
import { getServerSideConfig } from "../config/server"; import { getServerSideConfig } from "../config/server";
import md5 from "spark-md5"; import md5 from "spark-md5";
import { ACCESS_CODE_PREFIX } from "../constant"; import { ACCESS_CODE_PREFIX } from "../constant";
import { OPENAI_URL } from "./common";
function getIP(req: NextRequest) { function getIP(req: NextRequest) {
let ip = req.ip ?? req.headers.get("x-real-ip"); let ip = req.ip ?? req.headers.get("x-real-ip");

View File

@@ -43,6 +43,8 @@ export async function requestOpenai(req: NextRequest) {
cache: "no-store", cache: "no-store",
method: req.method, method: req.method,
body: req.body, body: req.body,
// @ts-ignore
duplex: "half",
signal: controller.signal, signal: controller.signal,
}; };

View File

@@ -12,6 +12,10 @@ async function handle(
) { ) {
console.log("[OpenAI Route] params ", params); console.log("[OpenAI Route] params ", params);
if (req.method === "OPTIONS") {
return NextResponse.json({ body: "OK" }, { status: 200 });
}
const subpath = params.path.join("/"); const subpath = params.path.join("/");
if (!ALLOWD_PATH.has(subpath)) { if (!ALLOWD_PATH.has(subpath)) {

View File

@@ -1,3 +1,4 @@
import { getClientConfig } from "../config/client";
import { ACCESS_CODE_PREFIX } from "../constant"; import { ACCESS_CODE_PREFIX } from "../constant";
import { ChatMessage, ModelType, useAccessStore } from "../store"; import { ChatMessage, ModelType, useAccessStore } from "../store";
import { ChatGPTApi } from "./platforms/openai"; import { ChatGPTApi } from "./platforms/openai";
@@ -93,7 +94,11 @@ export class ClientApi {
// Please do not modify this message // Please do not modify this message
console.log("[Share]", msgs); console.log("[Share]", msgs);
const res = await fetch("/sharegpt", { const clientConfig = getClientConfig();
const proxyUrl = "/sharegpt";
const rawUrl = "https://sharegpt.com/api/conversations";
const shareUrl = clientConfig?.isApp ? rawUrl : proxyUrl;
const res = await fetch(shareUrl, {
body: JSON.stringify({ body: JSON.stringify({
avatarUrl, avatarUrl,
items: msgs, items: msgs,

View File

@@ -42,6 +42,7 @@ export class ChatGPTApi implements LLMApi {
model: modelConfig.model, model: modelConfig.model,
temperature: modelConfig.temperature, temperature: modelConfig.temperature,
presence_penalty: modelConfig.presence_penalty, presence_penalty: modelConfig.presence_penalty,
frequency_penalty: modelConfig.frequency_penalty,
}; };
console.log("[Request] openai payload: ", requestPayload); console.log("[Request] openai payload: ", requestPayload);

View File

@@ -72,9 +72,7 @@ export function ChatItem(props: {
<div className={styles["chat-item-count"]}> <div className={styles["chat-item-count"]}>
{Locale.ChatItem.ChatItemCount(props.count)} {Locale.ChatItem.ChatItemCount(props.count)}
</div> </div>
<div className={styles["chat-item-date"]}> <div className={styles["chat-item-date"]}>{props.time}</div>
{new Date(props.time).toLocaleString()}
</div>
</div> </div>
</> </>
)} )}

View File

@@ -1,5 +1,11 @@
import { useDebouncedCallback } from "use-debounce"; import { useDebouncedCallback } from "use-debounce";
import React, { useState, useRef, useEffect, useLayoutEffect } from "react"; import React, {
useState,
useRef,
useEffect,
useLayoutEffect,
useMemo,
} from "react";
import SendWhiteIcon from "../icons/send-white.svg"; import SendWhiteIcon from "../icons/send-white.svg";
import BrainIcon from "../icons/brain.svg"; import BrainIcon from "../icons/brain.svg";
@@ -61,6 +67,7 @@ import { useMaskStore } from "../store/mask";
import { useCommand } from "../command"; import { useCommand } from "../command";
import { prettyObject } from "../utils/format"; import { prettyObject } from "../utils/format";
import { ExportMessageModal } from "./exporter"; import { ExportMessageModal } from "./exporter";
import { getClientConfig } from "../config/client";
const Markdown = dynamic(async () => (await import("./markdown")).Markdown, { const Markdown = dynamic(async () => (await import("./markdown")).Markdown, {
loading: () => <LoadingIcon />, loading: () => <LoadingIcon />,
@@ -704,9 +711,13 @@ export function Chat() {
} }
}; };
const clientConfig = useMemo(() => getClientConfig(), []);
const location = useLocation(); const location = useLocation();
const isChat = location.pathname === Path.Chat; const isChat = location.pathname === Path.Chat;
const autoFocus = !isMobileScreen || isChat; // only focus in chat page const autoFocus = !isMobileScreen || isChat; // only focus in chat page
const showMaxIcon = !isMobileScreen && !clientConfig?.isApp;
useCommand({ useCommand({
fill: setUserInput, fill: setUserInput,
@@ -717,7 +728,7 @@ export function Chat() {
return ( return (
<div className={styles.chat} key={session.id}> <div className={styles.chat} key={session.id}>
<div className="window-header"> <div className="window-header" data-tauri-drag-region>
<div className="window-header-title"> <div className="window-header-title">
<div <div
className={`window-header-main-title " ${styles["chat-body-title"]}`} className={`window-header-main-title " ${styles["chat-body-title"]}`}
@@ -755,7 +766,7 @@ export function Chat() {
}} }}
/> />
</div> </div>
{!isMobileScreen && ( {showMaxIcon && (
<div className="window-action-button"> <div className="window-action-button">
<IconButton <IconButton
icon={config.tightBorder ? <MinIcon /> : <MaxIcon />} icon={config.tightBorder ? <MinIcon /> : <MaxIcon />}

View File

@@ -449,16 +449,16 @@ export function ImagePreviewer(props: {
</div> </div>
<div> <div>
<div className={styles["chat-info-item"]}> <div className={styles["chat-info-item"]}>
Model: {mask.modelConfig.model} {Locale.Exporter.Model}: {mask.modelConfig.model}
</div> </div>
<div className={styles["chat-info-item"]}> <div className={styles["chat-info-item"]}>
Messages: {props.messages.length} {Locale.Exporter.Messages}: {props.messages.length}
</div> </div>
<div className={styles["chat-info-item"]}> <div className={styles["chat-info-item"]}>
Topic: {session.topic} {Locale.Exporter.Topic}: {session.topic}
</div> </div>
<div className={styles["chat-info-item"]}> <div className={styles["chat-info-item"]}>
Time:{" "} {Locale.Exporter.Time}:{" "}
{new Date( {new Date(
props.messages.at(-1)?.date ?? Date.now(), props.messages.at(-1)?.date ?? Date.now(),
).toLocaleString()} ).toLocaleString()}

View File

@@ -94,9 +94,14 @@ const useHasHydrated = () => {
const loadAsyncGoogleFont = () => { const loadAsyncGoogleFont = () => {
const linkEl = document.createElement("link"); const linkEl = document.createElement("link");
const proxyFontUrl = "/google-fonts";
const remoteFontUrl = "https://fonts.googleapis.com";
const googleFontUrl =
getClientConfig()?.buildMode === "export" ? remoteFontUrl : proxyFontUrl;
linkEl.rel = "stylesheet"; linkEl.rel = "stylesheet";
linkEl.href = linkEl.href =
"/google-fonts/css2?family=Noto+Sans+SC:wght@300;400;700;900&display=swap"; googleFontUrl +
"/css2?family=Noto+Sans+SC:wght@300;400;700;900&display=swap";
document.head.appendChild(linkEl); document.head.appendChild(linkEl);
}; };

View File

@@ -11,18 +11,21 @@ import mermaid from "mermaid";
import LoadingIcon from "../icons/three-dots.svg"; import LoadingIcon from "../icons/three-dots.svg";
import React from "react"; import React from "react";
import { useDebouncedCallback, useThrottledCallback } from "use-debounce";
export function Mermaid(props: { code: string; onError: () => void }) { export function Mermaid(props: { code: string }) {
const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLDivElement>(null);
const [hasError, setHasError] = useState(false);
useEffect(() => { useEffect(() => {
if (props.code && ref.current) { if (props.code && ref.current) {
mermaid mermaid
.run({ .run({
nodes: [ref.current], nodes: [ref.current],
suppressErrors: true,
}) })
.catch((e) => { .catch((e) => {
props.onError(); setHasError(true);
console.error("[Mermaid] ", e.message); console.error("[Mermaid] ", e.message);
}); });
} }
@@ -41,10 +44,17 @@ export function Mermaid(props: { code: string; onError: () => void }) {
} }
} }
if (hasError) {
return null;
}
return ( return (
<div <div
className="no-dark" className="no-dark mermaid"
style={{ cursor: "pointer", overflow: "auto" }} style={{
cursor: "pointer",
overflow: "auto",
}}
ref={ref} ref={ref}
onClick={() => viewSvgInNewWindow()} onClick={() => viewSvgInNewWindow()}
> >
@@ -55,33 +65,40 @@ export function Mermaid(props: { code: string; onError: () => void }) {
export function PreCode(props: { children: any }) { export function PreCode(props: { children: any }) {
const ref = useRef<HTMLPreElement>(null); const ref = useRef<HTMLPreElement>(null);
const refText = ref.current?.innerText;
const [mermaidCode, setMermaidCode] = useState(""); const [mermaidCode, setMermaidCode] = useState("");
useEffect(() => { const renderMermaid = useDebouncedCallback(() => {
if (!ref.current) return; if (!ref.current) return;
const mermaidDom = ref.current.querySelector("code.language-mermaid"); const mermaidDom = ref.current.querySelector("code.language-mermaid");
if (mermaidDom) { if (mermaidDom) {
setMermaidCode((mermaidDom as HTMLElement).innerText); setMermaidCode((mermaidDom as HTMLElement).innerText);
} }
}, [props.children]); }, 600);
if (mermaidCode) { useEffect(() => {
return <Mermaid code={mermaidCode} onError={() => setMermaidCode("")} />; setTimeout(renderMermaid, 1);
} // eslint-disable-next-line react-hooks/exhaustive-deps
}, [refText]);
return ( return (
<pre ref={ref}> <>
<span {mermaidCode.length > 0 && (
className="copy-code-button" <Mermaid code={mermaidCode} key={mermaidCode} />
onClick={() => { )}
if (ref.current) { <pre ref={ref}>
const code = ref.current.innerText; <span
copyToClipboard(code); className="copy-code-button"
} onClick={() => {
}} if (ref.current) {
></span> const code = ref.current.innerText;
{props.children} copyToClipboard(code);
</pre> }
}}
></span>
{props.children}
</pre>
</>
); );
} }
@@ -127,43 +144,57 @@ export function Markdown(
) { ) {
const mdRef = useRef<HTMLDivElement>(null); const mdRef = useRef<HTMLDivElement>(null);
const renderedHeight = useRef(0); const renderedHeight = useRef(0);
const renderedWidth = useRef(0);
const inView = useRef(!!props.defaultShow); const inView = useRef(!!props.defaultShow);
const [_, triggerRender] = useState(0);
const checkInView = useThrottledCallback(
() => {
const parent = props.parentRef?.current;
const md = mdRef.current;
if (parent && md && !props.defaultShow) {
const parentBounds = parent.getBoundingClientRect();
const twoScreenHeight = Math.max(500, parentBounds.height * 2);
const mdBounds = md.getBoundingClientRect();
const parentTop = parentBounds.top - twoScreenHeight;
const parentBottom = parentBounds.bottom + twoScreenHeight;
const isOverlap =
Math.max(parentTop, mdBounds.top) <=
Math.min(parentBottom, mdBounds.bottom);
inView.current = isOverlap;
triggerRender(Date.now());
}
const parent = props.parentRef?.current; if (inView.current && md) {
const md = mdRef.current; const rect = md.getBoundingClientRect();
renderedHeight.current = Math.max(renderedHeight.current, rect.height);
renderedWidth.current = Math.max(renderedWidth.current, rect.width);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
},
300,
{
leading: true,
trailing: true,
},
);
const checkInView = () => { useEffect(() => {
if (parent && md) { props.parentRef?.current?.addEventListener("scroll", checkInView);
const parentBounds = parent.getBoundingClientRect(); checkInView();
const twoScreenHeight = Math.max(500, parentBounds.height * 2); return () =>
const mdBounds = md.getBoundingClientRect(); props.parentRef?.current?.removeEventListener("scroll", checkInView);
const parentTop = parentBounds.top - twoScreenHeight; // eslint-disable-next-line react-hooks/exhaustive-deps
const parentBottom = parentBounds.bottom + twoScreenHeight; }, []);
const isOverlap =
Math.max(parentTop, mdBounds.top) <=
Math.min(parentBottom, mdBounds.bottom);
inView.current = isOverlap;
}
if (inView.current && md) { const getSize = (x: number) => (!inView.current && x > 0 ? x : "auto");
renderedHeight.current = Math.max(
renderedHeight.current,
md.getBoundingClientRect().height,
);
}
};
setTimeout(() => checkInView(), 1);
return ( return (
<div <div
className="markdown-body" className="markdown-body"
style={{ style={{
fontSize: `${props.fontSize ?? 14}px`, fontSize: `${props.fontSize ?? 14}px`,
height: height: getSize(renderedHeight.current),
!inView.current && renderedHeight.current > 0 width: getSize(renderedWidth.current),
? renderedHeight.current
: "auto",
}} }}
ref={mdRef} ref={mdRef}
onContextMenu={props.onContextMenu} onContextMenu={props.onContextMenu}

View File

@@ -185,7 +185,12 @@ function ContextPromptItem(props: {
className={chatStyle["context-content"]} className={chatStyle["context-content"]}
rows={focusingInput ? 5 : 1} rows={focusingInput ? 5 : 1}
onFocus={() => setFocusingInput(true)} onFocus={() => setFocusingInput(true)}
onBlur={() => setFocusingInput(false)} onBlur={() => {
setFocusingInput(false);
// If the selection is not removed when the user loses focus, some
// extensions like "Translate" will always display a floating bar
window?.getSelection()?.removeAllRanges();
}}
onInput={(e) => onInput={(e) =>
props.update({ props.update({
...props.prompt, ...props.prompt,

View File

@@ -88,6 +88,27 @@ export function ModelConfigList(props: {
></InputRange> ></InputRange>
</ListItem> </ListItem>
<ListItem
title={Locale.Settings.FrequencyPenalty.Title}
subTitle={Locale.Settings.FrequencyPenalty.SubTitle}
>
<InputRange
value={props.modelConfig.frequency_penalty?.toFixed(1)}
min="-2"
max="2"
step="0.1"
onChange={(e) => {
props.updateConfig(
(config) =>
(config.frequency_penalty =
ModalConfigValidator.frequency_penalty(
e.currentTarget.valueAsNumber,
)),
);
}}
></InputRange>
</ListItem>
<ListItem <ListItem
title={Locale.Settings.HistoryCount.Title} title={Locale.Settings.HistoryCount.Title}
subTitle={Locale.Settings.HistoryCount.SubTitle} subTitle={Locale.Settings.HistoryCount.SubTitle}

View File

@@ -286,9 +286,12 @@ export function Settings() {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
const clientConfig = useMemo(() => getClientConfig(), []);
const showAccessCode = enabledAccessControl && !clientConfig?.isApp;
return ( return (
<ErrorBoundary> <ErrorBoundary>
<div className="window-header"> <div className="window-header" data-tauri-drag-region>
<div className="window-header-title"> <div className="window-header-title">
<div className="window-header-main-title"> <div className="window-header-main-title">
{Locale.Settings.Title} {Locale.Settings.Title}
@@ -485,7 +488,7 @@ export function Settings() {
</List> </List>
<List> <List>
{enabledAccessControl ? ( {showAccessCode ? (
<ListItem <ListItem
title={Locale.Settings.AccessCode.Title} title={Locale.Settings.AccessCode.Title}
subTitle={Locale.Settings.AccessCode.SubTitle} subTitle={Locale.Settings.AccessCode.SubTitle}

View File

@@ -118,8 +118,10 @@ export function SideBar(props: { className?: string }) {
shouldNarrow && styles["narrow-sidebar"] shouldNarrow && styles["narrow-sidebar"]
}`} }`}
> >
<div className={styles["sidebar-header"]}> <div className={styles["sidebar-header"]} data-tauri-drag-region>
<div className={styles["sidebar-title"]}>ChatGPT Next</div> <div className={styles["sidebar-title"]} data-tauri-drag-region>
ChatGPT Next
</div>
<div className={styles["sidebar-sub-title"]}> <div className={styles["sidebar-sub-title"]}>
Build your own AI assistant. Build your own AI assistant.
</div> </div>

View File

@@ -21,6 +21,7 @@ export const getBuildConfig = () => {
return { return {
commitId: COMMIT_ID, commitId: COMMIT_ID,
buildMode: process.env.BUILD_MODE ?? "standalone", buildMode: process.env.BUILD_MODE ?? "standalone",
isApp: !!process.env.BUILD_APP,
}; };
}; };

View File

@@ -11,6 +11,7 @@ declare global {
HIDE_USER_API_KEY?: string; // disable user's api key input HIDE_USER_API_KEY?: string; // disable user's api key input
DISABLE_GPT4?: string; // allow user to use gpt-4 or not DISABLE_GPT4?: string; // allow user to use gpt-4 or not
BUILD_MODE?: "standalone" | "export"; BUILD_MODE?: "standalone" | "export";
BUILD_APP?: string; // is building desktop app
} }
} }
} }

View File

@@ -6,7 +6,7 @@ export const UPDATE_URL = `${REPO_URL}#keep-updated`;
export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/commits?per_page=1`; export const FETCH_COMMIT_URL = `https://api.github.com/repos/${OWNER}/${REPO}/commits?per_page=1`;
export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`; export const FETCH_TAG_URL = `https://api.github.com/repos/${OWNER}/${REPO}/tags?per_page=1`;
export const RUNTIME_CONFIG_DOM = "danger-runtime-config"; export const RUNTIME_CONFIG_DOM = "danger-runtime-config";
export const DEFAULT_API_HOST = "https://chatgpt.nextweb.fun/api/proxy"; export const DEFAULT_API_HOST = "https://chatgpt1.nextweb.fun/api/proxy";
export enum Path { export enum Path {
Home = "/", Home = "/",

View File

@@ -2,7 +2,6 @@
import "./styles/globals.scss"; import "./styles/globals.scss";
import "./styles/markdown.scss"; import "./styles/markdown.scss";
import "./styles/highlight.scss"; import "./styles/highlight.scss";
import { getBuildConfig } from "./config/build";
import { getClientConfig } from "./config/client"; import { getClientConfig } from "./config/client";
export const metadata = { export const metadata = {

View File

@@ -197,6 +197,10 @@ const cn = {
Title: "话题新鲜度 (presence_penalty)", Title: "话题新鲜度 (presence_penalty)",
SubTitle: "值越大,越有可能扩展到新话题", SubTitle: "值越大,越有可能扩展到新话题",
}, },
FrequencyPenalty: {
Title: "频率惩罚度 (frequency_penalty)",
SubTitle: "值越大,越有可能降低重复字词",
},
}, },
Store: { Store: {
DefaultTopic: "新的聊天", DefaultTopic: "新的聊天",
@@ -277,6 +281,12 @@ const cn = {
Create: "新建", Create: "新建",
Edit: "编辑", Edit: "编辑",
}, },
Exporter: {
Model: "模型",
Messages: "消息",
Topic: "主题",
Time: "时间",
},
}; };
type DeepPartial<T> = T extends object type DeepPartial<T> = T extends object
@@ -284,7 +294,8 @@ type DeepPartial<T> = T extends object
[P in keyof T]?: DeepPartial<T[P]>; [P in keyof T]?: DeepPartial<T[P]>;
} }
: T; : T;
export type LocaleType = DeepPartial<typeof cn>;
export type RequiredLocaleType = typeof cn; export type LocaleType = typeof cn;
export type PartialLocaleType = DeepPartial<typeof cn>;
export default cn; export default cn;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const cs: LocaleType = { const cs: PartialLocaleType = {
WIP: "V přípravě...", WIP: "V přípravě...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -155,6 +155,11 @@ const cs: LocaleType = {
Title: "Přítomnostní korekce", Title: "Přítomnostní korekce",
SubTitle: "Větší hodnota zvyšuje pravděpodobnost nových témat.", SubTitle: "Větší hodnota zvyšuje pravděpodobnost nových témat.",
}, },
FrequencyPenalty: {
Title: "Frekvenční penalizace",
SubTitle:
"Větší hodnota snižující pravděpodobnost opakování stejného řádku",
},
}, },
Store: { Store: {
DefaultTopic: "Nová konverzace", DefaultTopic: "Nová konverzace",
@@ -226,6 +231,12 @@ const cs: LocaleType = {
Create: "Vytvořit", Create: "Vytvořit",
Edit: "Upravit", Edit: "Upravit",
}, },
Exporter: {
Model: "Model",
Messages: "Zprávy",
Topic: "Téma",
Time: "Čas",
},
}; };
export default cs; export default cs;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const de: LocaleType = { const de: PartialLocaleType = {
WIP: "In Bearbeitung...", WIP: "In Bearbeitung...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -158,6 +158,11 @@ const de: LocaleType = {
SubTitle: SubTitle:
"Ein größerer Wert erhöht die Wahrscheinlichkeit, dass über neue Themen gesprochen wird", "Ein größerer Wert erhöht die Wahrscheinlichkeit, dass über neue Themen gesprochen wird",
}, },
FrequencyPenalty: {
Title: "Frequency Penalty", // HäufigkeitStrafe
SubTitle:
"Ein größerer Wert, der die Wahrscheinlichkeit verringert, dass dieselbe Zeile wiederholt wird",
},
}, },
Store: { Store: {
DefaultTopic: "Neues Gespräch", DefaultTopic: "Neues Gespräch",
@@ -231,6 +236,12 @@ const de: LocaleType = {
Create: "Create", Create: "Create",
Edit: "Edit", Edit: "Edit",
}, },
Exporter: {
Model: "Modell",
Messages: "Nachrichten",
Topic: "Thema",
Time: "Zeit",
},
}; };
export default de; export default de;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import { RequiredLocaleType } from "./index"; import { LocaleType } from "./index";
const en: RequiredLocaleType = { const en: LocaleType = {
WIP: "Coming Soon...", WIP: "Coming Soon...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -199,6 +199,11 @@ const en: RequiredLocaleType = {
SubTitle: SubTitle:
"A larger value increases the likelihood to talk about new topics", "A larger value increases the likelihood to talk about new topics",
}, },
FrequencyPenalty: {
Title: "Frequency Penalty",
SubTitle:
"A larger value decreasing the likelihood to repeat the same line",
},
}, },
Store: { Store: {
DefaultTopic: "New Conversation", DefaultTopic: "New Conversation",
@@ -280,6 +285,12 @@ const en: RequiredLocaleType = {
Create: "Create", Create: "Create",
Edit: "Edit", Edit: "Edit",
}, },
Exporter: {
Model: "Model",
Messages: "Messages",
Topic: "Topic",
Time: "Time",
},
}; };
export default en; export default en;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const es: LocaleType = { const es: PartialLocaleType = {
WIP: "En construcción...", WIP: "En construcción...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -156,6 +156,11 @@ const es: LocaleType = {
SubTitle: SubTitle:
"Un valor mayor aumenta la probabilidad de hablar sobre nuevos temas", "Un valor mayor aumenta la probabilidad de hablar sobre nuevos temas",
}, },
FrequencyPenalty: {
Title: "Penalización de frecuencia",
SubTitle:
"Un valor mayor que disminuye la probabilidad de repetir la misma línea",
},
}, },
Store: { Store: {
DefaultTopic: "Nueva conversación", DefaultTopic: "Nueva conversación",
@@ -228,6 +233,12 @@ const es: LocaleType = {
Create: "Create", Create: "Create",
Edit: "Edit", Edit: "Edit",
}, },
Exporter: {
Model: "Modelo",
Messages: "Mensajes",
Topic: "Tema",
Time: "Time",
},
}; };
export default es; export default es;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const fr: LocaleType = { const fr: PartialLocaleType = {
WIP: "Prochainement...", WIP: "Prochainement...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -159,6 +159,11 @@ const fr: LocaleType = {
SubTitle: SubTitle:
"Une valeur plus élevée augmentera la probabilité d'introduire de nouveaux sujets", "Une valeur plus élevée augmentera la probabilité d'introduire de nouveaux sujets",
}, },
FrequencyPenalty: {
Title: "Pénalité de fréquence",
SubTitle:
"Une valeur plus élevée diminuant la probabilité de répéter la même ligne",
},
}, },
Store: { Store: {
DefaultTopic: "Nouvelle conversation", DefaultTopic: "Nouvelle conversation",
@@ -232,6 +237,12 @@ const fr: LocaleType = {
Create: "Créer", Create: "Créer",
Edit: "Éditer", Edit: "Éditer",
}, },
Exporter: {
Model: "Modèle",
Messages: "Messages",
Topic: "Sujet",
Time: "Temps",
},
}; };
export default fr; export default fr;

View File

@@ -1,56 +1,71 @@
import CN from "./cn"; import cn from "./cn";
import EN from "./en"; import en from "./en";
import TW from "./tw"; import tw from "./tw";
import FR from "./fr"; import fr from "./fr";
import ES from "./es"; import es from "./es";
import IT from "./it"; import it from "./it";
import TR from "./tr"; import tr from "./tr";
import JP from "./jp"; import jp from "./jp";
import DE from "./de"; import de from "./de";
import VI from "./vi"; import vi from "./vi";
import RU from "./ru"; import ru from "./ru";
import CS from "./cs"; import no from "./no";
import KO from "./ko"; import cs from "./cs";
import ko from "./ko";
import { merge } from "../utils/merge"; import { merge } from "../utils/merge";
export type { LocaleType, RequiredLocaleType } from "./cn"; import type { LocaleType } from "./cn";
export type { LocaleType, PartialLocaleType } from "./cn";
export const AllLangs = [ const ALL_LANGS = {
"en", cn,
"cn", en,
"tw", tw,
"fr", jp,
"es", ko,
"it", fr,
"tr", es,
"jp", it,
"de", tr,
"vi", de,
"ru", vi,
"cs", ru,
"ko", cs,
] as const; no,
export type Lang = (typeof AllLangs)[number]; };
export type Lang = keyof typeof ALL_LANGS;
export const AllLangs = Object.keys(ALL_LANGS) as Lang[];
export const ALL_LANG_OPTIONS: Record<Lang, string> = { export const ALL_LANG_OPTIONS: Record<Lang, string> = {
cn: "简体中文", cn: "简体中文",
en: "English", en: "English",
tw: "繁體中文", tw: "繁體中文",
jp: "日本語",
ko: "한국어",
fr: "Français", fr: "Français",
es: "Español", es: "Español",
it: "Italiano", it: "Italiano",
tr: "Türkçe", tr: "Türkçe",
jp: "日本語",
de: "Deutsch", de: "Deutsch",
vi: "Tiếng Việt", vi: "Tiếng Việt",
ru: "Русский", ru: "Русский",
cs: "Čeština", cs: "Čeština",
ko: "한국어", no: "Nynorsk",
}; };
const LANG_KEY = "lang"; const LANG_KEY = "lang";
const DEFAULT_LANG = "en"; const DEFAULT_LANG = "en";
const fallbackLang = en;
const targetLang = ALL_LANGS[getLang()] as LocaleType;
// if target lang missing some fields, it will use fallback lang string
merge(fallbackLang, targetLang);
export default fallbackLang as LocaleType;
function getItem(key: string) { function getItem(key: string) {
try { try {
return localStorage.getItem(key); return localStorage.getItem(key);
@@ -69,7 +84,6 @@ function getLanguage() {
try { try {
return navigator.language.toLowerCase(); return navigator.language.toLowerCase();
} catch { } catch {
console.log("[Lang] failed to detect user lang.");
return DEFAULT_LANG; return DEFAULT_LANG;
} }
} }
@@ -96,25 +110,3 @@ export function changeLang(lang: Lang) {
setItem(LANG_KEY, lang); setItem(LANG_KEY, lang);
location.reload(); location.reload();
} }
const fallbackLang = EN;
const targetLang = {
en: EN,
cn: CN,
tw: TW,
fr: FR,
es: ES,
it: IT,
tr: TR,
jp: JP,
de: DE,
vi: VI,
ru: RU,
cs: CS,
ko: KO,
}[getLang()] as typeof CN;
// if target lang missing some fields, it will use fallback lang string
merge(fallbackLang, targetLang);
export default fallbackLang as typeof CN;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const it: LocaleType = { const it: PartialLocaleType = {
WIP: "Work in progress...", WIP: "Work in progress...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -157,6 +157,11 @@ const it: LocaleType = {
SubTitle: SubTitle:
"Un valore maggiore aumenta la probabilità di parlare di nuovi argomenti", "Un valore maggiore aumenta la probabilità di parlare di nuovi argomenti",
}, },
FrequencyPenalty: {
Title: "Penalità di frequenza",
SubTitle:
"Un valore maggiore che diminuisce la probabilità di ripetere la stessa riga",
},
}, },
Store: { Store: {
DefaultTopic: "Nuova conversazione", DefaultTopic: "Nuova conversazione",
@@ -229,6 +234,12 @@ const it: LocaleType = {
Create: "Create", Create: "Create",
Edit: "Edit", Edit: "Edit",
}, },
Exporter: {
Model: "Modello",
Messages: "Messaggi",
Topic: "Argomento",
Time: "Tempo",
},
}; };
export default it; export default it;

View File

@@ -1,11 +1,11 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const jp: LocaleType = { const jp: PartialLocaleType = {
WIP: "この機能は開発中です……", WIP: "この機能は開発中です",
Error: { Error: {
Unauthorized: Unauthorized:
"現在は未承認状態です。左下の設定ボタンをクリックし、アクセスパスワードを入力してください。", "現在は未承認状態です。左下の設定ボタンをクリックし、アクセスパスワードかOpenAIのAPIキーを入力してください。",
}, },
ChatItem: { ChatItem: {
ChatItemCount: (count: number) => `${count} 通のチャット`, ChatItemCount: (count: number) => `${count} 通のチャット`,
@@ -19,7 +19,7 @@ const jp: LocaleType = {
Copy: "コピー", Copy: "コピー",
Stop: "停止", Stop: "停止",
Retry: "リトライ", Retry: "リトライ",
Delete: "Delete", Delete: "削除",
}, },
Rename: "チャットの名前を変更", Rename: "チャットの名前を変更",
Typing: "入力中…", Typing: "入力中…",
@@ -32,7 +32,7 @@ const jp: LocaleType = {
}, },
Send: "送信", Send: "送信",
Config: { Config: {
Reset: "重置默认", Reset: "リセット",
SaveAs: "另存为面具", SaveAs: "另存为面具",
}, },
}, },
@@ -70,7 +70,7 @@ const jp: LocaleType = {
}, },
Lang: { Lang: {
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language` Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
All: "所有语言", All: "全ての言語",
}, },
Avatar: "アバター", Avatar: "アバター",
FontSize: { FontSize: {
@@ -91,11 +91,11 @@ const jp: LocaleType = {
TightBorder: "ボーダーレスモード", TightBorder: "ボーダーレスモード",
SendPreviewBubble: { SendPreviewBubble: {
Title: "プレビューバブルの送信", Title: "プレビューバブルの送信",
SubTitle: "在预览气泡中预览 Markdown 内容", SubTitle: "プレビューバブルでマークダウンコンテンツをプレビュー",
}, },
Mask: { Mask: {
Title: "面具启动页", Title: "キャラクターページ",
SubTitle: "新建聊天时,展示面具启动页", SubTitle: "新規チャット作成時にキャラクターページを表示する",
}, },
Prompt: { Prompt: {
Disable: { Disable: {
@@ -113,7 +113,7 @@ const jp: LocaleType = {
Search: "プロンプトワード検索", Search: "プロンプトワード検索",
}, },
EditModal: { EditModal: {
Title: "编辑提示词", Title: "編集",
}, },
}, },
HistoryCount: { HistoryCount: {
@@ -158,6 +158,10 @@ const jp: LocaleType = {
Title: "トピックの新鮮度 (presence_penalty)", Title: "トピックの新鮮度 (presence_penalty)",
SubTitle: "値が大きいほど、新しいトピックへの展開が可能になります。", SubTitle: "値が大きいほど、新しいトピックへの展開が可能になります。",
}, },
FrequencyPenalty: {
Title: "話題の頻度 (frequency_penalty)",
SubTitle: "値が大きいほど、重複語を低減する可能性が高くなります",
},
}, },
Store: { Store: {
DefaultTopic: "新しいチャット", DefaultTopic: "新しいチャット",
@@ -178,54 +182,70 @@ const jp: LocaleType = {
Failed: "コピーに失敗しました。クリップボード許可を与えてください。", Failed: "コピーに失敗しました。クリップボード許可を与えてください。",
}, },
Context: { Context: {
Toast: (x: any) => `前置コンテキスト${x} 件設定されました`, Toast: (x: any) => `キャラクター${x} 件設定されました`,
Edit: "前置コンテキストと履歴メモリ", Edit: "キャラクタープリセットとモデル設定",
Add: "新規追加", Add: "追加",
}, },
Plugin: { Name: "插件" }, Plugin: { Name: "プラグイン" },
Mask: { Mask: {
Name: "面具", Name: "キャラクタープリセット",
Page: { Page: {
Title: "预设角色面具", Title: "キャラクタープリセット",
SubTitle: (count: number) => `${count} 个预设角色定义`, SubTitle: (count: number) => `${count} 件見つかりました。`,
Search: "搜索角色面具", Search: "検索",
Create: "新", Create: "新",
}, },
Item: { Item: {
Info: (count: number) => `包含 ${count} 条预设对话`, Info: (count: number) => `包含 ${count} 条预设对话`,
Chat: "对话", Chat: "会話",
View: "查看", View: "詳細",
Edit: "编辑", Edit: "編集",
Delete: "除", Delete: "除",
DeleteConfirm: "确认删除", DeleteConfirm: "本当に削除しますか",
}, },
EditModal: { EditModal: {
Title: (readonly: boolean) => Title: (readonly: boolean) =>
`编辑预设面具 ${readonly ? "只读" : ""}`, `キャラクタープリセットを編集 ${readonly ? "読み取り専用" : ""}`,
Download: "下载预设", Download: "ダウンロード",
Clone: "克隆预设", Clone: "複製",
}, },
Config: { Config: {
Avatar: "角色头像", Avatar: "キャラクターのアイコン",
Name: "角色名称", Name: "キャラクターの名前",
Sync: {
Title: "グローバル設定を利用する",
SubTitle: "このチャットでグローバル設定を利用します。",
Confirm:
"カスタム設定を上書きしてグローバル設定を使用します、よろしいですか?",
},
HideContext: {
Title: "キャラクター設定を表示しない",
SubTitle: "チャット画面でのキャラクター設定を非表示にします。",
},
}, },
}, },
NewChat: { NewChat: {
Return: "返回", Return: "戻る",
Skip: "跳过", Skip: "スキップ",
Title: "挑选一个面具", Title: "キャラクター",
SubTitle: "现在开始,与面具背后的灵魂思维碰撞", SubTitle: "さあ、AIにキャラクターを設定して会話を始めてみましょう",
More: "搜索更多", More: "もっと探す",
NotShow: "不再展示", NotShow: "今後は表示しない",
ConfirmNoShow: "确认禁用?禁用后可以随时在设置中重新启用。", ConfirmNoShow: "いつでも設定から有効化できます。",
}, },
UI: { UI: {
Confirm: "确认", Confirm: "確認",
Cancel: "取消", Cancel: "キャンセル",
Close: "关闭", Close: "閉じる",
Create: "新", Create: "新",
Edit: "编辑", Edit: "編集",
},
Exporter: {
Model: "モデル",
Messages: "メッセージ",
Topic: "トピック",
Time: "時間",
}, },
}; };

View File

@@ -1,8 +1,8 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const ko: LocaleType = { const ko: PartialLocaleType = {
WIP: "곧 출시 예정...", WIP: "곧 출시 예정...",
Error: { Error: {
Unauthorized: "권한이 없습니다. 설정 페이지에서 액세스 코드를 입력하세요.", Unauthorized: "권한이 없습니다. 설정 페이지에서 액세스 코드를 입력하세요.",
@@ -154,6 +154,10 @@ const ko: LocaleType = {
Title: "존재 페널티 (presence_penalty)", Title: "존재 페널티 (presence_penalty)",
SubTitle: "값이 클수록 새로운 주제에 대해 대화할 가능성이 높아집니다.", SubTitle: "값이 클수록 새로운 주제에 대해 대화할 가능성이 높아집니다.",
}, },
FrequencyPenalty: {
Title: "빈도 페널티(frequency penalty)",
SubTitle: "값이 클수록 같은 줄이 반복될 가능성이 줄어듭니다.",
},
}, },
Store: { Store: {
DefaultTopic: "새 대화", DefaultTopic: "새 대화",
@@ -225,6 +229,12 @@ const ko: LocaleType = {
Create: "생성", Create: "생성",
Edit: "편집", Edit: "편집",
}, },
Exporter: {
Model: "모델",
Messages: "메시지",
Topic: "주제",
Time: "시간",
},
}; };
export default ko; export default ko;

168
app/locales/no.ts Normal file
View File

@@ -0,0 +1,168 @@
import { SubmitKey } from "../store/config";
import type { PartialLocaleType } from "./index";
const no: PartialLocaleType = {
WIP: "Arbeid pågår ...",
Error: {
Unauthorized: "Du har ikke tilgang. Vennlig oppgi tildelt adgangskode.",
},
ChatItem: {
ChatItemCount: (count: number) => `${count} meldinger`,
},
Chat: {
SubTitle: (count: number) => `${count} meldinger med ChatGPT`,
Actions: {
ChatList: "Gå til chatlisten",
CompressedHistory: "Komprimert historikk for instrukser",
Export: "Eksporter alle meldinger i markdown-format",
Copy: "Kopier",
Stop: "Stopp",
Retry: "Prøv igjen",
Delete: "Slett",
},
Rename: "Gi nytt navn",
Typing: "Skriver …",
Input: (submitKey: string) => {
var inputHints = `${submitKey} for å sende`;
if (submitKey === String(SubmitKey.Enter)) {
inputHints += ", Shift + Enter for å omgi";
}
return inputHints + ", / for å søke instrukser";
},
Send: "Send",
},
Export: {
Title: "Alle meldinger",
Copy: "Kopiere alle",
Download: "Last ned",
MessageFromYou: "Melding fra deg",
MessageFromChatGPT: "Melding fra ChatGPT",
},
Memory: {
Title: "Minneinstruks",
EmptyContent: "Ingen sålant.",
Send: "Send minne",
Copy: "Kopiere minne",
Reset: "Nulstill sesjon",
ResetConfirm:
"Om du nillstiller vil du slette hele historikken. Er du sikker på at du vil nullstille?",
},
Home: {
NewChat: "Ny chat",
DeleteChat: "Bekreft for å slette det valgte dialogen",
DeleteToast: "Samtale slettet",
Revert: "Tilbakestill",
},
Settings: {
Title: "Innstillinger",
SubTitle: "Alle innstillinger",
Actions: {
ClearAll: "Fjern alle data",
ResetAll: "Nullstill innstillinger",
Close: "Lukk",
},
Lang: {
Name: "Language", // ATTENTION: if you wanna add a new translation, please do not translate this value, leave it as `Language`
},
Avatar: "Avatar",
FontSize: {
Title: "Fontstørrelsen",
SubTitle: "Juster fontstørrelsen for samtaleinnholdet.",
},
Update: {
Version: (x: string) => `Versjon: ${x}`,
IsLatest: "Siste versjon",
CheckUpdate: "Se etter oppdatering",
IsChecking: "Ser etter oppdatering ...",
FoundUpdate: (x: string) => `Fant ny versjon: ${x}`,
GoToUpdate: "Oppdater",
},
SendKey: "Send nøkkel",
Theme: "Tema",
TightBorder: "Stram innramming",
Prompt: {
Disable: {
Title: "Skru av autofullfør",
SubTitle: "Skriv / for å trigge autofullfør",
},
List: "Instruksliste",
ListCount: (builtin: number, custom: number) =>
`${builtin} innebygde, ${custom} brukerdefinerte`,
Edit: "Endre",
Modal: {
Title: "Instruksliste",
Add: "Legg til",
Search: "Søk instrukser",
},
},
HistoryCount: {
Title: "Tall på tilhørende meldinger",
SubTitle: "Antall sendte meldinger tilknyttet hver spørring",
},
CompressThreshold: {
Title: "Terskeverdi for komprimering av historikk",
SubTitle:
"Komprimer dersom ikke-komprimert lengde på meldinger overskrider denne verdien",
},
Token: {
Title: "API Key",
SubTitle:
"Bruk din egen API-nøkkel for å ignorere tilgangskoden begrensning",
Placeholder: "OpenAI API-nøkkel",
},
Usage: {
Title: "Saldo for konto",
SubTitle(used: any, total: any) {
return `Brukt denne måneden $${used}, abonnement $${total}`;
},
IsChecking: "Sjekker ...",
Check: "Sjekk",
NoAccess: "Skriv inn API-nøkkelen for å sjekke saldo",
},
AccessCode: {
Title: "Tilgangskode",
SubTitle: "Tilgangskontroll på",
Placeholder: "Trenger tilgangskode",
},
Model: "Model",
Temperature: {
Title: "Temperatur",
SubTitle: "Høyere verdi gir mer kreative svar",
},
MaxTokens: {
Title: "Maks tokens",
SubTitle: "Maksimum lengde på tokens for instrukser og svar",
},
},
Store: {
DefaultTopic: "Ny samtale",
BotHello: "Hei! Hva kan jeg hjelpe deg med i dag?",
Error: "Noe gikk galt, vennligst prøv igjen senere.",
Prompt: {
History: (content: string) =>
"Dette er et sammendrag av chatthistorikken mellom AI-en og brukeren som en oppsummering: " +
content,
Topic:
"Vennligst lag en fire til fem ords tittel som oppsummerer samtalen vår uten innledning, punktsetting, anførselstegn, punktum, symboler eller tillegg tekst. Fjern innrammende anførselstegn.",
Summarize:
"Oppsummer diskusjonen vår kort i 200 ord eller mindre for å bruke som en oppfordring til fremtidig sammenheng.",
},
},
Copy: {
Success: "Kopiert til utklippstavle",
Failed: "Kopiering feilet. Vennligst gi tilgang til utklippstavlen.",
},
Context: {
Toast: (x: any) => `Med ${x} kontekstuelle instrukser`,
Edit: "Kontekstuelle -og minneinstrukser",
Add: "Legg til",
},
Exporter: {
Model: "Model",
Messages: "Meldingar",
Topic: "Emne",
Time: "Tid",
},
};
export default no;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const ru: LocaleType = { const ru: PartialLocaleType = {
WIP: "Скоро...", WIP: "Скоро...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -157,6 +157,11 @@ const ru: LocaleType = {
SubTitle: SubTitle:
"Чем выше значение, тем больше вероятность общения на новые темы", "Чем выше значение, тем больше вероятность общения на новые темы",
}, },
FrequencyPenalty: {
Title: "Штраф за частоту",
SubTitle:
"Большее значение снижает вероятность повторения одной и той же строки",
},
}, },
Store: { Store: {
DefaultTopic: "Новый разговор", DefaultTopic: "Новый разговор",
@@ -232,6 +237,12 @@ const ru: LocaleType = {
Create: "Создать", Create: "Создать",
Edit: "Редактировать", Edit: "Редактировать",
}, },
Exporter: {
Model: "Модель",
Messages: "Сообщения",
Topic: "Тема",
Time: "Время",
},
}; };
export default ru; export default ru;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const tr: LocaleType = { const tr: PartialLocaleType = {
WIP: "Çalışma devam ediyor...", WIP: "Çalışma devam ediyor...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -158,6 +158,11 @@ const tr: LocaleType = {
SubTitle: SubTitle:
"Daha büyük bir değer, yeni konular hakkında konuşma olasılığını artırır", "Daha büyük bir değer, yeni konular hakkında konuşma olasılığını artırır",
}, },
FrequencyPenalty: {
Title: "Frekans Cezası",
SubTitle:
"Aynı satırı tekrar etme olasılığını azaltan daha büyük bir değer",
},
}, },
Store: { Store: {
DefaultTopic: "Yeni Konuşma", DefaultTopic: "Yeni Konuşma",
@@ -229,6 +234,12 @@ const tr: LocaleType = {
Create: "Create", Create: "Create",
Edit: "Edit", Edit: "Edit",
}, },
Exporter: {
Model: "Model",
Messages: "Mesajlar",
Topic: "Konu",
Time: "Zaman",
},
}; };
export default tr; export default tr;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const tw: LocaleType = { const tw: PartialLocaleType = {
WIP: "該功能仍在開發中……", WIP: "該功能仍在開發中……",
Error: { Error: {
Unauthorized: "目前您的狀態是未授權,請前往設定頁面輸入授權碼。", Unauthorized: "目前您的狀態是未授權,請前往設定頁面輸入授權碼。",
@@ -152,6 +152,10 @@ const tw: LocaleType = {
Title: "話題新穎度 (presence_penalty)", Title: "話題新穎度 (presence_penalty)",
SubTitle: "值越大,越有可能擴展到新話題", SubTitle: "值越大,越有可能擴展到新話題",
}, },
FrequencyPenalty: {
Title: "頻率懲罰度 (frequency_penalty)",
SubTitle: "值越大,越有可能降低重複字詞",
},
}, },
Store: { Store: {
DefaultTopic: "新的對話", DefaultTopic: "新的對話",
@@ -219,6 +223,12 @@ const tw: LocaleType = {
Create: "新建", Create: "新建",
Edit: "编辑", Edit: "编辑",
}, },
Exporter: {
Model: "模型",
Messages: "消息",
Topic: "主題",
Time: "時間",
},
}; };
export default tw; export default tw;

View File

@@ -1,7 +1,7 @@
import { SubmitKey } from "../store/config"; import { SubmitKey } from "../store/config";
import type { LocaleType } from "./index"; import type { PartialLocaleType } from "./index";
const vi: LocaleType = { const vi: PartialLocaleType = {
WIP: "Sắp ra mắt...", WIP: "Sắp ra mắt...",
Error: { Error: {
Unauthorized: Unauthorized:
@@ -154,6 +154,10 @@ const vi: LocaleType = {
Title: "Chủ đề mới (presence_penalty)", Title: "Chủ đề mới (presence_penalty)",
SubTitle: "Giá trị càng lớn tăng khả năng mở rộng sang các chủ đề mới", SubTitle: "Giá trị càng lớn tăng khả năng mở rộng sang các chủ đề mới",
}, },
FrequencyPenalty: {
Title: "Hình phạt tần suất",
SubTitle: "Giá trị lớn hơn làm giảm khả năng lặp lại cùng một dòng",
},
}, },
Store: { Store: {
DefaultTopic: "Cuộc trò chuyện mới", DefaultTopic: "Cuộc trò chuyện mới",
@@ -225,6 +229,12 @@ const vi: LocaleType = {
Create: "Tạo", Create: "Tạo",
Edit: "Chỉnh sửa", Edit: "Chỉnh sửa",
}, },
Exporter: {
Model: "Mô hình",
Messages: "Thông điệp",
Topic: "Chủ đề",
Time: "Thời gian",
},
}; };
export default vi; export default vi;

View File

@@ -29,6 +29,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 32, historyMessageCount: 32,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -52,6 +53,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -75,6 +77,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -98,6 +101,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -121,6 +125,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -144,6 +149,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -167,6 +173,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -190,6 +197,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 0, historyMessageCount: 0,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -218,6 +226,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -241,6 +250,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -270,6 +280,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -299,6 +310,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -349,6 +361,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 1, temperature: 1,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: false, sendMemory: false,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -377,6 +390,7 @@ export const CN_MASKS: BuiltinMask[] = [
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,

View File

@@ -17,6 +17,7 @@ export const EN_MASKS: BuiltinMask[] = [
temperature: 0.3, temperature: 0.3,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -57,6 +58,7 @@ export const EN_MASKS: BuiltinMask[] = [
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -80,6 +82,7 @@ export const EN_MASKS: BuiltinMask[] = [
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -108,6 +111,7 @@ export const EN_MASKS: BuiltinMask[] = [
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 2000, compressMessageLengthThreshold: 2000,

View File

@@ -60,7 +60,7 @@ export const useAccessStore = create<AccessControlStore>()(
); );
}, },
fetch() { fetch() {
if (fetchState > 0) return; if (fetchState > 0 || getClientConfig()?.buildMode === "export") return;
fetchState = 1; fetchState = 1;
fetch("/api/config", { fetch("/api/config", {
method: "post", method: "post",

View File

@@ -11,6 +11,7 @@ import { StoreKey } from "../constant";
import { api, RequestMessage } from "../client/api"; import { api, RequestMessage } from "../client/api";
import { ChatControllerPool } from "../client/controller"; import { ChatControllerPool } from "../client/controller";
import { prettyObject } from "../utils/format"; import { prettyObject } from "../utils/format";
import { estimateTokenLength } from "../utils/token";
export type ChatMessage = RequestMessage & { export type ChatMessage = RequestMessage & {
date: string; date: string;
@@ -102,7 +103,7 @@ interface ChatStore {
} }
function countMessages(msgs: ChatMessage[]) { function countMessages(msgs: ChatMessage[]) {
return msgs.reduce((pre, cur) => pre + cur.content.length, 0); return msgs.reduce((pre, cur) => pre + estimateTokenLength(cur.content), 0);
} }
export const useChatStore = create<ChatStore>()( export const useChatStore = create<ChatStore>()(
@@ -226,6 +227,7 @@ export const useChatStore = create<ChatStore>()(
onNewMessage(message) { onNewMessage(message) {
get().updateCurrentSession((session) => { get().updateCurrentSession((session) => {
session.messages = session.messages.concat();
session.lastUpdate = Date.now(); session.lastUpdate = Date.now();
}); });
get().updateStat(message); get().updateStat(message);
@@ -272,8 +274,7 @@ export const useChatStore = create<ChatStore>()(
// save user's and bot's message // save user's and bot's message
get().updateCurrentSession((session) => { get().updateCurrentSession((session) => {
session.messages.push(userMessage); session.messages = session.messages.concat([userMessage, botMessage]);
session.messages.push(botMessage);
}); });
// make request // make request
@@ -286,7 +287,9 @@ export const useChatStore = create<ChatStore>()(
if (message) { if (message) {
botMessage.content = message; botMessage.content = message;
} }
set(() => ({})); get().updateCurrentSession((session) => {
session.messages = session.messages.concat();
});
}, },
onFinish(message) { onFinish(message) {
botMessage.streaming = false; botMessage.streaming = false;
@@ -298,7 +301,6 @@ export const useChatStore = create<ChatStore>()(
sessionIndex, sessionIndex,
botMessage.id ?? messageIndex, botMessage.id ?? messageIndex,
); );
set(() => ({}));
}, },
onError(error) { onError(error) {
const isAborted = error.message.includes("aborted"); const isAborted = error.message.includes("aborted");
@@ -311,8 +313,9 @@ export const useChatStore = create<ChatStore>()(
botMessage.streaming = false; botMessage.streaming = false;
userMessage.isError = !isAborted; userMessage.isError = !isAborted;
botMessage.isError = !isAborted; botMessage.isError = !isAborted;
get().updateCurrentSession((session) => {
set(() => ({})); session.messages = session.messages.concat();
});
ChatControllerPool.remove( ChatControllerPool.remove(
sessionIndex, sessionIndex,
botMessage.id ?? messageIndex, botMessage.id ?? messageIndex,
@@ -367,28 +370,30 @@ export const useChatStore = create<ChatStore>()(
context.push(memoryPrompt); context.push(memoryPrompt);
} }
// get short term and unmemoried long term memory // get short term and unmemorized long term memory
const shortTermMemoryMessageIndex = Math.max( const shortTermMemoryMessageIndex = Math.max(
0, 0,
n - modelConfig.historyMessageCount, n - modelConfig.historyMessageCount,
); );
const longTermMemoryMessageIndex = session.lastSummarizeIndex; const longTermMemoryMessageIndex = session.lastSummarizeIndex;
const mostRecentIndex = Math.max(
// try to concat history messages
const memoryStartIndex = Math.min(
shortTermMemoryMessageIndex, shortTermMemoryMessageIndex,
longTermMemoryMessageIndex, longTermMemoryMessageIndex,
); );
const threshold = modelConfig.compressMessageLengthThreshold * 2; const threshold = modelConfig.max_tokens;
// get recent messages as many as possible // get recent messages as many as possible
const reversedRecentMessages = []; const reversedRecentMessages = [];
for ( for (
let i = n - 1, count = 0; let i = n - 1, count = 0;
i >= mostRecentIndex && count < threshold; i >= memoryStartIndex && count < threshold;
i -= 1 i -= 1
) { ) {
const msg = messages[i]; const msg = messages[i];
if (!msg || msg.isError) continue; if (!msg || msg.isError) continue;
count += msg.content.length; count += estimateTokenLength(msg.content);
reversedRecentMessages.push(msg); reversedRecentMessages.push(msg);
} }

View File

@@ -1,5 +1,6 @@
import { create } from "zustand"; import { create } from "zustand";
import { persist } from "zustand/middleware"; import { persist } from "zustand/middleware";
import { getClientConfig } from "../config/client";
import { StoreKey } from "../constant"; import { StoreKey } from "../constant";
export enum SubmitKey { export enum SubmitKey {
@@ -21,7 +22,7 @@ export const DEFAULT_CONFIG = {
avatar: "1f603", avatar: "1f603",
fontSize: 14, fontSize: 14,
theme: Theme.Auto as Theme, theme: Theme.Auto as Theme,
tightBorder: false, tightBorder: !!getClientConfig()?.isApp,
sendPreviewBubble: true, sendPreviewBubble: true,
sidebarWidth: 300, sidebarWidth: 300,
@@ -34,6 +35,7 @@ export const DEFAULT_CONFIG = {
temperature: 0.5, temperature: 0.5,
max_tokens: 2000, max_tokens: 2000,
presence_penalty: 0, presence_penalty: 0,
frequency_penalty: 0,
sendMemory: true, sendMemory: true,
historyMessageCount: 4, historyMessageCount: 4,
compressMessageLengthThreshold: 1000, compressMessageLengthThreshold: 1000,
@@ -92,6 +94,10 @@ export const ALL_MODELS = [
name: "gpt-3.5-turbo-16k", name: "gpt-3.5-turbo-16k",
available: true, available: true,
}, },
{
name: "gpt-3.5-turbo-16k-0613",
available: true,
},
{ {
name: "qwen-v1", // 通义千问 name: "qwen-v1", // 通义千问
available: false, available: false,
@@ -145,6 +151,9 @@ export const ModalConfigValidator = {
presence_penalty(x: number) { presence_penalty(x: number) {
return limitNumber(x, -2, 2, 0); return limitNumber(x, -2, 2, 0);
}, },
frequency_penalty(x: number) {
return limitNumber(x, -2, 2, 0);
},
temperature(x: number) { temperature(x: number) {
return limitNumber(x, 0, 1, 1); return limitNumber(x, 0, 1, 1);
}, },

View File

@@ -1116,4 +1116,16 @@
.markdown-body ::-webkit-calendar-picker-indicator { .markdown-body ::-webkit-calendar-picker-indicator {
filter: invert(50%); filter: invert(50%);
} }
.markdown-body .mermaid {
border: var(--border-in-light);
margin-bottom: 10px;
border-radius: 4px;
padding: 10px;
background-color: var(--white);
}
#dmermaid {
display: none;
}

22
app/utils/token.ts Normal file
View File

@@ -0,0 +1,22 @@
export function estimateTokenLength(input: string): number {
let tokenLength = 0;
for (let i = 0; i < input.length; i++) {
const charCode = input.charCodeAt(i);
if (charCode < 128) {
// ASCII character
if (charCode <= 122 && charCode >= 65) {
// a-Z
tokenLength += 0.25;
} else {
tokenLength += 0.5;
}
} else {
// Unicode character
tokenLength += 1.5;
}
}
return tokenLength;
}

View File

@@ -12,24 +12,30 @@ const nextConfig = {
return config; return config;
}, },
output: mode, output: mode,
images: {
unoptimized: mode === "export",
},
}; };
if (mode !== "export") { if (mode !== "export") {
nextConfig.headers = async () => { nextConfig.headers = async () => {
return [ return [
{ {
source: "/:path*", source: "/api/:path*",
headers: [ headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" }, { key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" }, { key: "Access-Control-Allow-Origin", value: "*" },
{ {
key: "Access-Control-Allow-Methods", key: "Access-Control-Allow-Methods",
value: "GET,OPTIONS,PATCH,DELETE,POST,PUT", value: "*",
}, },
{ {
key: "Access-Control-Allow-Headers", key: "Access-Control-Allow-Headers",
value: value: "*",
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version", },
{
key: "Access-Control-Max-Age",
value: "86400",
}, },
], ],
}, },

View File

@@ -1,14 +1,16 @@
{ {
"name": "chatgpt-next-web", "name": "chatgpt-next-web",
"version": "1.9.3",
"private": false, "private": false,
"license": "Anti 996", "license": "mit",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint",
"export": "BUILD_MODE=export yarn build", "export": "cross-env BUILD_MODE=export BUILD_APP=1 yarn build",
"export:dev": "cross-env BUILD_MODE=export BUILD_APP=1 yarn dev",
"app:dev": "yarn tauri dev",
"app:build": "yarn tauri build",
"prompts": "node ./scripts/fetch-prompts.mjs", "prompts": "node ./scripts/fetch-prompts.mjs",
"prepare": "husky install", "prepare": "husky install",
"proxy-dev": "sh ./scripts/init-proxy.sh && proxychains -f ./scripts/proxychains.conf yarn dev" "proxy-dev": "sh ./scripts/init-proxy.sh && proxychains -f ./scripts/proxychains.conf yarn dev"
@@ -21,12 +23,12 @@
"emoji-picker-react": "^4.4.7", "emoji-picker-react": "^4.4.7",
"fuse.js": "^6.6.2", "fuse.js": "^6.6.2",
"html-to-image": "^1.11.11", "html-to-image": "^1.11.11",
"mermaid": "^10.1.0", "mermaid": "^10.2.3",
"next": "^13.4.3", "next": "^13.4.6",
"node-fetch": "^3.3.1", "node-fetch": "^3.3.1",
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-markdown": "^8.0.5", "react-markdown": "^8.0.7",
"react-router-dom": "^6.10.0", "react-router-dom": "^6.10.0",
"rehype-highlight": "^6.0.0", "rehype-highlight": "^6.0.0",
"rehype-katex": "^6.0.2", "rehype-katex": "^6.0.2",
@@ -35,12 +37,13 @@
"remark-math": "^5.1.1", "remark-math": "^5.1.1",
"sass": "^1.59.2", "sass": "^1.59.2",
"spark-md5": "^3.0.2", "spark-md5": "^3.0.2",
"use-debounce": "^9.0.3", "use-debounce": "^9.0.4",
"zustand": "^4.3.6" "zustand": "^4.3.8"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.14.6", "@tauri-apps/cli": "^1.3.1",
"@types/react": "^18.0.28", "@types/node": "^20.3.1",
"@types/react": "^18.2.12",
"@types/react-dom": "^18.0.11", "@types/react-dom": "^18.0.11",
"@types/react-katex": "^3.0.0", "@types/react-katex": "^3.0.0",
"@types/spark-md5": "^3.0.2", "@types/spark-md5": "^3.0.2",
@@ -50,9 +53,11 @@
"eslint-config-prettier": "^8.8.0", "eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0", "husky": "^8.0.0",
"lint-staged": "^13.2.0", "lint-staged": "^13.2.2",
"prettier": "^2.8.7", "prettier": "^2.8.7",
"typescript": "4.9.5", "typescript": "4.9.5"
"@tauri-apps/cli": "^1.3.1" },
"resolutions": {
"lint-staged/yaml": "^2.2.2"
} }
} }

285
src-tauri/Cargo.lock generated
View File

@@ -80,6 +80,22 @@ dependencies = [
"system-deps 6.1.0", "system-deps 6.1.0",
] ]
[[package]]
name = "attohttpc"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fcf00bc6d5abb29b5f97e3c61a90b6d3caa12f3faf897d4a3e3607c050a35a7"
dependencies = [
"flate2",
"http",
"log",
"native-tls",
"serde",
"serde_json",
"serde_urlencoded",
"url",
]
[[package]] [[package]]
name = "autocfg" name = "autocfg"
version = "1.1.0" version = "1.1.0"
@@ -1472,6 +1488,12 @@ dependencies = [
"autocfg", "autocfg",
] ]
[[package]]
name = "minisign-verify"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.7.1" version = "0.7.1"
@@ -1482,6 +1504,24 @@ dependencies = [
"simd-adler32", "simd-adler32",
] ]
[[package]]
name = "native-tls"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
dependencies = [
"lazy_static",
"libc",
"log",
"openssl",
"openssl-probe",
"openssl-sys",
"schannel",
"security-framework",
"security-framework-sys",
"tempfile",
]
[[package]] [[package]]
name = "ndk" name = "ndk"
version = "0.6.0" version = "0.6.0"
@@ -1612,6 +1652,17 @@ dependencies = [
"objc_exception", "objc_exception",
] ]
[[package]]
name = "objc-foundation"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
dependencies = [
"block",
"objc",
"objc_id",
]
[[package]] [[package]]
name = "objc_exception" name = "objc_exception"
version = "0.1.2" version = "0.1.2"
@@ -1636,6 +1687,60 @@ version = "1.17.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
[[package]]
name = "open"
version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2078c0039e6a54a0c42c28faa984e115fb4c2d5bf2208f77d1961002df8576f8"
dependencies = [
"pathdiff",
"windows-sys 0.42.0",
]
[[package]]
name = "openssl"
version = "0.10.52"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56"
dependencies = [
"bitflags",
"cfg-if",
"foreign-types",
"libc",
"once_cell",
"openssl-macros",
"openssl-sys",
]
[[package]]
name = "openssl-macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.16",
]
[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]]
name = "openssl-sys"
version = "0.9.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e"
dependencies = [
"cc",
"libc",
"pkg-config",
"vcpkg",
]
[[package]] [[package]]
name = "overload" name = "overload"
version = "0.1.1" version = "0.1.1"
@@ -1690,6 +1795,12 @@ dependencies = [
"windows-sys 0.45.0", "windows-sys 0.45.0",
] ]
[[package]]
name = "pathdiff"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
[[package]] [[package]]
name = "percent-encoding" name = "percent-encoding"
version = "2.2.0" version = "2.2.0"
@@ -2069,6 +2180,30 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c"
[[package]]
name = "rfd"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0149778bd99b6959285b0933288206090c50e2327f47a9c463bfdbf45c8823ea"
dependencies = [
"block",
"dispatch",
"glib-sys",
"gobject-sys",
"gtk-sys",
"js-sys",
"lazy_static",
"log",
"objc",
"objc-foundation",
"objc_id",
"raw-window-handle",
"wasm-bindgen",
"wasm-bindgen-futures",
"web-sys",
"windows 0.37.0",
]
[[package]] [[package]]
name = "rustc_version" name = "rustc_version"
version = "0.4.0" version = "0.4.0"
@@ -2119,6 +2254,15 @@ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]]
name = "schannel"
version = "0.1.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3"
dependencies = [
"windows-sys 0.42.0",
]
[[package]] [[package]]
name = "scoped-tls" name = "scoped-tls"
version = "1.0.1" version = "1.0.1"
@@ -2131,6 +2275,29 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "security-framework"
version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8"
dependencies = [
"bitflags",
"core-foundation",
"core-foundation-sys",
"libc",
"security-framework-sys",
]
[[package]]
name = "security-framework-sys"
version = "2.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]] [[package]]
name = "selectors" name = "selectors"
version = "0.22.0" version = "0.22.0"
@@ -2211,6 +2378,18 @@ dependencies = [
"serde", "serde",
] ]
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
"itoa 1.0.6",
"ryu",
"serde",
]
[[package]] [[package]]
name = "serde_with" name = "serde_with"
version = "2.3.3" version = "2.3.3"
@@ -2523,6 +2702,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d42ba3a2e8556722f31336a0750c10dbb6a81396a1c452977f515da83f69f842" checksum = "d42ba3a2e8556722f31336a0750c10dbb6a81396a1c452977f515da83f69f842"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"attohttpc",
"base64 0.21.0",
"cocoa", "cocoa",
"dirs-next", "dirs-next",
"embed_plist", "embed_plist",
@@ -2535,11 +2716,15 @@ dependencies = [
"heck 0.4.1", "heck 0.4.1",
"http", "http",
"ignore", "ignore",
"minisign-verify",
"objc", "objc",
"once_cell", "once_cell",
"open",
"percent-encoding", "percent-encoding",
"rand 0.8.5", "rand 0.8.5",
"raw-window-handle", "raw-window-handle",
"regex",
"rfd",
"semver", "semver",
"serde", "serde",
"serde_json", "serde_json",
@@ -2553,12 +2738,14 @@ dependencies = [
"tauri-utils", "tauri-utils",
"tempfile", "tempfile",
"thiserror", "thiserror",
"time",
"tokio", "tokio",
"url", "url",
"uuid", "uuid",
"webkit2gtk", "webkit2gtk",
"webview2-com", "webview2-com",
"windows 0.39.0", "windows 0.39.0",
"zip",
] ]
[[package]] [[package]]
@@ -2593,6 +2780,7 @@ dependencies = [
"png", "png",
"proc-macro2", "proc-macro2",
"quote", "quote",
"regex",
"semver", "semver",
"serde", "serde",
"serde_json", "serde_json",
@@ -2977,6 +3165,12 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]] [[package]]
name = "version-compare" name = "version-compare"
version = "0.0.11" version = "0.0.11"
@@ -3062,6 +3256,18 @@ dependencies = [
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
[[package]]
name = "wasm-bindgen-futures"
version = "0.4.36"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e"
dependencies = [
"cfg-if",
"js-sys",
"wasm-bindgen",
"web-sys",
]
[[package]] [[package]]
name = "wasm-bindgen-macro" name = "wasm-bindgen-macro"
version = "0.2.86" version = "0.2.86"
@@ -3091,6 +3297,16 @@ version = "0.2.86"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
[[package]]
name = "web-sys"
version = "0.3.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]] [[package]]
name = "webkit2gtk" name = "webkit2gtk"
version = "0.18.2" version = "0.18.2"
@@ -3207,6 +3423,19 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647"
dependencies = [
"windows_aarch64_msvc 0.37.0",
"windows_i686_gnu 0.37.0",
"windows_i686_msvc 0.37.0",
"windows_x86_64_gnu 0.37.0",
"windows_x86_64_msvc 0.37.0",
]
[[package]] [[package]]
name = "windows" name = "windows"
version = "0.39.0" version = "0.39.0"
@@ -3256,6 +3485,21 @@ version = "0.39.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278"
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.45.0" version = "0.45.0"
@@ -3322,6 +3566,12 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
[[package]]
name = "windows_aarch64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a"
[[package]] [[package]]
name = "windows_aarch64_msvc" name = "windows_aarch64_msvc"
version = "0.39.0" version = "0.39.0"
@@ -3340,6 +3590,12 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
[[package]]
name = "windows_i686_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1"
[[package]] [[package]]
name = "windows_i686_gnu" name = "windows_i686_gnu"
version = "0.39.0" version = "0.39.0"
@@ -3358,6 +3614,12 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
[[package]]
name = "windows_i686_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c"
[[package]] [[package]]
name = "windows_i686_msvc" name = "windows_i686_msvc"
version = "0.39.0" version = "0.39.0"
@@ -3376,6 +3638,12 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
[[package]]
name = "windows_x86_64_gnu"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d"
[[package]] [[package]]
name = "windows_x86_64_gnu" name = "windows_x86_64_gnu"
version = "0.39.0" version = "0.39.0"
@@ -3406,6 +3674,12 @@ version = "0.48.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
[[package]]
name = "windows_x86_64_msvc"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d"
[[package]] [[package]]
name = "windows_x86_64_msvc" name = "windows_x86_64_msvc"
version = "0.39.0" version = "0.39.0"
@@ -3510,3 +3784,14 @@ checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc"
dependencies = [ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "zip"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
dependencies = [
"byteorder",
"crc32fast",
"crossbeam-utils",
]

View File

@@ -1,9 +1,9 @@
[package] [package]
name = "chatgpt-next-web" name = "chatgpt-next-web"
version = "0.1.0" version = "0.1.0"
description = "A Tauri App" description = "A cross platform app for LLM ChatBot."
authors = ["Yidadaa"] authors = ["Yidadaa"]
license = "anti-996" license = "mit"
repository = "" repository = ""
default-run = "chatgpt-next-web" default-run = "chatgpt-next-web"
edition = "2021" edition = "2021"
@@ -17,7 +17,8 @@ tauri-build = { version = "1.3.0", features = [] }
[dependencies] [dependencies]
serde_json = "1.0" serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.3.0", features = [] } tauri = { version = "1.3.0", features = ["clipboard-all", "shell-open", "updater", "window-close", "window-hide", "window-maximize", "window-minimize", "window-set-icon", "window-set-ignore-cursor-events", "window-set-resizable", "window-show", "window-start-dragging", "window-unmaximize", "window-unminimize"] }
tauri-plugin-window-state = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" }
[features] [features]
# this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled. # this feature is used for production builds or when `devPath` points to the filesystem and the built-in dev server is disabled.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@@ -3,6 +3,7 @@
fn main() { fn main() {
tauri::Builder::default() tauri::Builder::default()
.plugin(tauri_plugin_window_state::Builder::default().build())
.run(tauri::generate_context!()) .run(tauri::generate_context!())
.expect("error while running tauri application"); .expect("error while running tauri application");
} }

View File

@@ -1,23 +1,44 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/schema.json", "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"build": { "build": {
"beforeBuildCommand": "yarn build", "beforeBuildCommand": "yarn export",
"beforeDevCommand": "yarn dev", "beforeDevCommand": "yarn export:dev",
"devPath": "http://localhost:3000", "devPath": "http://localhost:3000",
"distDir": "../out" "distDir": "../out"
}, },
"package": { "package": {
"productName": "chatgpt-next-web", "productName": "chatgpt-next-web",
"version": "2.8" "version": "2.8.2"
}, },
"tauri": { "tauri": {
"allowlist": { "allowlist": {
"all": false "all": false,
"shell": {
"all": false,
"open": true
},
"clipboard": {
"all": true
},
"window": {
"all": false,
"close": true,
"hide": true,
"maximize": true,
"minimize": true,
"setIcon": true,
"setIgnoreCursorEvents": true,
"setResizable": true,
"show": true,
"startDragging": true,
"unmaximize": true,
"unminimize": true
}
}, },
"bundle": { "bundle": {
"active": true, "active": true,
"category": "DeveloperTool", "category": "DeveloperTool",
"copyright": "", "copyright": "2023, Zhang Yifei All Rights Reserved.",
"deb": { "deb": {
"depends": [] "depends": []
}, },
@@ -29,8 +50,8 @@
"icons/icon.icns", "icons/icon.icns",
"icons/icon.ico" "icons/icon.ico"
], ],
"identifier": "com.yida.chatgpt.nextweb", "identifier": "com.yida.chatgpt.next.web",
"longDescription": "", "longDescription": "ChatGPT Next Web is a cross-platform ChatGPT client, including Web/Win/Linux/OSX/PWA.",
"macOS": { "macOS": {
"entitlements": null, "entitlements": null,
"exceptionDomain": "", "exceptionDomain": "",
@@ -39,7 +60,7 @@
"signingIdentity": null "signingIdentity": null
}, },
"resources": [], "resources": [],
"shortDescription": "", "shortDescription": "ChatGPT Next Web App",
"targets": "all", "targets": "all",
"windows": { "windows": {
"certificateThumbprint": null, "certificateThumbprint": null,
@@ -51,15 +72,25 @@
"csp": null "csp": null
}, },
"updater": { "updater": {
"active": false "active": true,
"endpoints": [
"https://github.com/Yidadaa/ChatGPT-Next-Web/releases/download/{{current_version}}/latest.json"
],
"dialog": false,
"windows": {
"installMode": "passive"
},
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IERFNDE4MENFM0Y1RTZBOTQKUldTVWFsNC96b0JCM3RqM2NmMnlFTmxIaStRaEJrTHNOU2VqRVlIV1hwVURoWUdVdEc1eDcxVEYK"
}, },
"windows": [ "windows": [
{ {
"fullscreen": false, "fullscreen": false,
"height": 600, "height": 600,
"resizable": true, "resizable": true,
"title": "tauri-next", "title": "ChatGPT Next Web",
"width": 800 "width": 960,
"hiddenTitle": true,
"titleBarStyle": "Overlay"
} }
] ]
} }

242
yarn.lock
View File

@@ -995,9 +995,9 @@
"@babel/helper-validator-identifier" "^7.19.1" "@babel/helper-validator-identifier" "^7.19.1"
to-fast-properties "^2.0.0" to-fast-properties "^2.0.0"
"@braintree/sanitize-url@^6.0.0": "@braintree/sanitize-url@^6.0.2":
version "6.0.2" version "6.0.2"
resolved "https://registry.npmmirror.com/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz#6110f918d273fe2af8ea1c4398a88774bb9fc12f" resolved "https://registry.yarnpkg.com/@braintree/sanitize-url/-/sanitize-url-6.0.2.tgz#6110f918d273fe2af8ea1c4398a88774bb9fc12f"
integrity sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg== integrity sha512-Tbsj02wXCbqGmzdnXNk0SOF19ChhRU70BsroIi4Pm6Ehp56in6vch94mfbdQ17DozxkL3BAVjbZ4Qc1a0HFRAg==
"@eslint-community/eslint-utils@^4.2.0": "@eslint-community/eslint-utils@^4.2.0":
@@ -1109,17 +1109,10 @@
"@jridgewell/resolve-uri" "3.1.0" "@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14" "@jridgewell/sourcemap-codec" "1.4.14"
"@khanacademy/simple-markdown@^0.8.6": "@next/env@13.4.6":
version "0.8.6" version "13.4.6"
resolved "https://registry.npmmirror.com/@khanacademy/simple-markdown/-/simple-markdown-0.8.6.tgz#9c9aef1f5ce2ce60292d13849165965a57c26f25" resolved "https://registry.yarnpkg.com/@next/env/-/env-13.4.6.tgz#3f2041c7758660d7255707ae4cb9166519113dea"
integrity sha512-mAUlR9lchzfqunR89pFvNI51jQKsMpJeWYsYWw0DQcUXczn/T/V6510utgvm7X0N3zN87j1SvuKk8cMbl9IAFw== integrity sha512-nqUxEtvDqFhmV1/awSg0K2XHNwkftNaiUqCYO9e6+MYmqNObpKVl7OgMkGaQ2SZnFx5YqF0t60ZJTlyJIDAijg==
dependencies:
"@types/react" ">=16.0.0"
"@next/env@13.4.3":
version "13.4.3"
resolved "https://registry.npmmirror.com/@next/env/-/env-13.4.3.tgz#cb00bdd43a0619a79a52c9336df8a0aa84f8f4bf"
integrity sha512-pa1ErjyFensznttAk3EIv77vFbfSYT6cLzVRK5jx4uiRuCQo+m2wCFAREaHKIy63dlgvOyMlzh6R8Inu8H3KrQ==
"@next/eslint-plugin-next@13.2.3": "@next/eslint-plugin-next@13.2.3":
version "13.2.3" version "13.2.3"
@@ -1128,50 +1121,50 @@
dependencies: dependencies:
glob "7.1.7" glob "7.1.7"
"@next/swc-darwin-arm64@13.4.3": "@next/swc-darwin-arm64@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.3.tgz#2d6c99dd5afbcce37e4ba0f64196317a1259034d" resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-13.4.6.tgz#47485f3deaee6681b4a4036c74bb9c4b728d5ddd"
integrity sha512-yx18udH/ZmR4Bw4M6lIIPE3JxsAZwo04iaucEfA2GMt1unXr2iodHUX/LAKNyi6xoLP2ghi0E+Xi1f4Qb8f1LQ== integrity sha512-ahi6VP98o4HV19rkOXPSUu+ovfHfUxbJQ7VVJ7gL2FnZRr7onEFC1oGQ6NQHpm8CxpIzSSBW79kumlFMOmZVjg==
"@next/swc-darwin-x64@13.4.3": "@next/swc-darwin-x64@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.3.tgz#162b15fb8a54d9f64e69c898ebeb55b7dac9bddd" resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-13.4.6.tgz#a6a5b232ec0f2079224fb8ed6bf11dc479af1acf"
integrity sha512-Mi8xJWh2IOjryAM1mx18vwmal9eokJ2njY4nDh04scy37F0LEGJ/diL6JL6kTXi0UfUCGbMsOItf7vpReNiD2A== integrity sha512-13cXxKFsPJIJKzUqrU5XB1mc0xbUgYsRcdH6/rB8c4NMEbWGdtD4QoK9ShN31TZdePpD4k416Ur7p+deMIxnnA==
"@next/swc-linux-arm64-gnu@13.4.3": "@next/swc-linux-arm64-gnu@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.3.tgz#aee57422f11183d6a2e4a2e8aa23b9285873e18f" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-13.4.6.tgz#2a67144e863d9c45fdbd13c7827370e7f2a28405"
integrity sha512-aBvtry4bxJ1xwKZ/LVPeBGBwWVwxa4bTnNkRRw6YffJnn/f4Tv4EGDPaVeYHZGQVA56wsGbtA6nZMuWs/EIk4Q== integrity sha512-Ti+NMHEjTNktCVxNjeWbYgmZvA2AqMMI2AMlzkXsU7W4pXCMhrryAmAIoo+7YdJbsx01JQWYVxGe62G6DoCLaA==
"@next/swc-linux-arm64-musl@13.4.3": "@next/swc-linux-arm64-musl@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.3.tgz#c10b6aaaa47b341c6c9ea15f8b0ddb37e255d035" resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-13.4.6.tgz#5a191ac3575a70598e9e9c6e7264fc0b8a90b2db"
integrity sha512-krT+2G3kEsEUvZoYte3/2IscscDraYPc2B+fDJFipPktJmrv088Pei/RjrhWm5TMIy5URYjZUoDZdh5k940Dyw== integrity sha512-OHoC6gO7XfjstgwR+z6UHKlvhqJfyMtNaJidjx3sEcfaDwS7R2lqR5AABi8PuilGgi0BO0O0sCXqLlpp3a0emQ==
"@next/swc-linux-x64-gnu@13.4.3": "@next/swc-linux-x64-gnu@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.3.tgz#3f85bc5591c6a0d4908404f7e88e3c04f4462039" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-13.4.6.tgz#d38adf842a8b8f9de492454328fd32a2c53350f3"
integrity sha512-AMdFX6EKJjC0G/CM6hJvkY8wUjCcbdj3Qg7uAQJ7PVejRWaVt0sDTMavbRfgMchx8h8KsAudUCtdFkG9hlEClw== integrity sha512-zHZxPGkUlpfNJCboUrFqwlwEX5vI9LSN70b8XEb0DYzzlrZyCyOi7hwDp/+3Urm9AB7YCAJkgR5Sp1XBVjHdfQ==
"@next/swc-linux-x64-musl@13.4.3": "@next/swc-linux-x64-musl@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.3.tgz#f4535adc2374a86bc8e43af149b551567df065de" resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-13.4.6.tgz#74c745774358b78be7f958e7a8b7d93936cd6ebc"
integrity sha512-jySgSXE48shaLtcQbiFO9ajE9mqz7pcAVLnVLvRIlUHyQYR/WyZdK8ehLs65Mz6j9cLrJM+YdmdJPyV4WDaz2g== integrity sha512-K/Y8lYGTwTpv5ME8PSJxwxLolaDRdVy+lOd9yMRMiQE0BLUhtxtCWC9ypV42uh9WpLjoaD0joOsB9Q6mbrSGJg==
"@next/swc-win32-arm64-msvc@13.4.3": "@next/swc-win32-arm64-msvc@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.3.tgz#e76106d85391c308c5ed70cda2bca2c582d65536" resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-13.4.6.tgz#1e1e02c175573e64808fc1a7e8650e3e217f1edc"
integrity sha512-5DxHo8uYcaADiE9pHrg8o28VMt/1kR8voDehmfs9AqS0qSClxAAl+CchjdboUvbCjdNWL1MISCvEfKY2InJ3JA== integrity sha512-U6LtxEUrjBL2tpW+Kr1nHCSJWNeIed7U7l5o7FiKGGwGgIlFi4UHDiLI6TQ2lxi20fAU33CsruV3U0GuzMlXIw==
"@next/swc-win32-ia32-msvc@13.4.3": "@next/swc-win32-ia32-msvc@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.3.tgz#8eb5d9dd71ed7a971671291605ad64ad522fb3bc" resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-13.4.6.tgz#2b528ae3ec7f6e727f4f0d81a1015f63da55c7a6"
integrity sha512-LaqkF3d+GXRA5X6zrUjQUrXm2MN/3E2arXBtn5C7avBCNYfm9G3Xc646AmmmpN3DJZVaMYliMyCIQCMDEzk80w== integrity sha512-eEBeAqpCfhdPSlCZCayjCiyIllVqy4tcqvm1xmg3BgJG0G5ITiMM4Cw2WVeRSgWDJqQGRyyb+q8Y2ltzhXOWsQ==
"@next/swc-win32-x64-msvc@13.4.3": "@next/swc-win32-x64-msvc@13.4.6":
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.3.tgz#c7b2b1b9e158fd7749f8209e68ee8e43a997eb4c" resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-13.4.6.tgz#38620bd68267ff13e50ecd432f1822eac51382a8"
integrity sha512-jglUk/x7ZWeOJWlVoKyIAkHLTI+qEkOriOOV+3hr1GyiywzcqfI7TpFSiwC7kk1scOiH7NTFKp8mA3XPNO9bDw== integrity sha512-OrZs94AuO3ZS5tnqlyPRNgfWvboXaDQCi5aXGve3o3C+Sj0ctMUV9+Do+0zMvvLRumR8E0PTWKvtz9n5vzIsWw==
"@nodelib/fs.scandir@2.1.5": "@nodelib/fs.scandir@2.1.5":
version "2.1.5" version "2.1.5"
@@ -1438,10 +1431,10 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197"
integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA==
"@types/node@^18.14.6": "@types/node@^20.3.1":
version "18.15.11" version "20.3.1"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" resolved "https://registry.yarnpkg.com/@types/node/-/node-20.3.1.tgz#e8a83f1aa8b649377bb1fb5d7bac5cb90e784dfe"
integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== integrity sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==
"@types/parse-json@^4.0.0": "@types/parse-json@^4.0.0":
version "4.0.0" version "4.0.0"
@@ -1467,19 +1460,10 @@
dependencies: dependencies:
"@types/react" "*" "@types/react" "*"
"@types/react@*", "@types/react@^18.0.28": "@types/react@*", "@types/react@^18.2.12":
version "18.0.31" version "18.2.12"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.31.tgz#a69ef8dd7bfa849734d258c793a8fe343a338205" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.12.tgz#95d584338610b78bb9ba0415e3180fb03debdf97"
integrity sha512-EEG67of7DsvRDU6BLLI0p+k1GojDLz9+lZsnCpCRTa/lOokvyPBvp8S5x+A24hME3yyQuIipcP70KJ6H7Qupww== integrity sha512-ndmBMLCgn38v3SntMeoJaIrO6tGHYKMEBohCUmw8HoLLQdRMOIGXfeYaBTLe2lsFaSB3MOK1VXscYFnmLtTSmw==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"
"@types/react@>=16.0.0":
version "18.2.5"
resolved "https://registry.npmmirror.com/@types/react/-/react-18.2.5.tgz#f9403e1113b12b53f7edcdd9a900c10dd4b49a59"
integrity sha512-RuoMedzJ5AOh23Dvws13LU9jpZHIc/k90AgmK7CecAYeWmSr3553L4u5rk4sWAPBuQosfT7HmTfG4Rg5o4nGEA==
dependencies: dependencies:
"@types/prop-types" "*" "@types/prop-types" "*"
"@types/scheduler" "*" "@types/scheduler" "*"
@@ -2469,10 +2453,10 @@ domhandler@^4.2.0, domhandler@^4.3.1:
dependencies: dependencies:
domelementtype "^2.2.0" domelementtype "^2.2.0"
dompurify@2.4.5: dompurify@3.0.3:
version "2.4.5" version "3.0.3"
resolved "https://registry.npmmirror.com/dompurify/-/dompurify-2.4.5.tgz#0e89a27601f0bad978f9a924e7a05d5d2cccdd87" resolved "https://registry.yarnpkg.com/dompurify/-/dompurify-3.0.3.tgz#4b115d15a091ddc96f232bcef668550a2f6f1430"
integrity sha512-jggCCd+8Iqp4Tsz0nIvpcb22InKEBrGz5dw3EQJMs8HPJDsKbFIO3STYtAvCfDx26Muevn1MHVI0XxjgFfmiSA== integrity sha512-axQ9zieHLnAnHh0sfAamKYiqXMJAVwu+LM/alQ7WDagoWessyWvMSFyW65CqF3owufNu8HBcE4cM2Vflu7YWcQ==
domutils@^2.8.0: domutils@^2.8.0:
version "2.8.0" version "2.8.0"
@@ -3065,6 +3049,11 @@ glob-parent@^6.0.2:
dependencies: dependencies:
is-glob "^4.0.3" is-glob "^4.0.3"
glob-to-regexp@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e"
integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==
glob@7.1.7: glob@7.1.7:
version "7.1.7" version "7.1.7"
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90"
@@ -3148,7 +3137,7 @@ gopd@^1.0.1:
dependencies: dependencies:
get-intrinsic "^1.1.3" get-intrinsic "^1.1.3"
graceful-fs@^4.2.4: graceful-fs@^4.1.2, graceful-fs@^4.2.4:
version "4.2.11" version "4.2.11"
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3"
integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==
@@ -3697,10 +3686,10 @@ lines-and-columns@^1.1.6:
resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632"
integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==
lint-staged@^13.2.0: lint-staged@^13.2.2:
version "13.2.0" version "13.2.2"
resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.2.0.tgz#b7abaf79c91cd36d824f17b23a4ce5209206126a" resolved "https://registry.yarnpkg.com/lint-staged/-/lint-staged-13.2.2.tgz#5e711d3139c234f73402177be2f8dd312e6508ca"
integrity sha512-GbyK5iWinax5Dfw5obm2g2ccUiZXNGtAS4mCbJ0Lv4rq6iEtfBSjOYdcbOtAIFtM114t0vdpViDDetjVTSd8Vw== integrity sha512-71gSwXKy649VrSU09s10uAT0rWCcY3aewhMaHyl2N84oBk4Xs9HgxvUp3AYu+bNsK4NrOYYxvSgg7FyGJ+jGcA==
dependencies: dependencies:
chalk "5.2.0" chalk "5.2.0"
cli-truncate "^3.1.0" cli-truncate "^3.1.0"
@@ -3714,7 +3703,7 @@ lint-staged@^13.2.0:
object-inspect "^1.12.3" object-inspect "^1.12.3"
pidtree "^0.6.0" pidtree "^0.6.0"
string-argv "^0.3.1" string-argv "^0.3.1"
yaml "^2.2.1" yaml "^2.2.2"
listr2@^5.0.7: listr2@^5.0.7:
version "5.0.8" version "5.0.8"
@@ -3826,10 +3815,10 @@ mdast-util-find-and-replace@^2.0.0:
unist-util-is "^5.0.0" unist-util-is "^5.0.0"
unist-util-visit-parents "^5.0.0" unist-util-visit-parents "^5.0.0"
mdast-util-from-markdown@^1.0.0: mdast-util-from-markdown@^1.0.0, mdast-util-from-markdown@^1.3.0:
version "1.3.0" version "1.3.1"
resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.0.tgz#0214124154f26154a2b3f9d401155509be45e894" resolved "https://registry.yarnpkg.com/mdast-util-from-markdown/-/mdast-util-from-markdown-1.3.1.tgz#9421a5a247f10d31d2faed2a30df5ec89ceafcf0"
integrity sha512-HN3W1gRIuN/ZW295c7zi7g9lVBllMgZE40RxCX37wrTPWXCWtpvOZdfnuK+1WNpvZje6XuJeI3Wnb4TJEUem+g== integrity sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==
dependencies: dependencies:
"@types/mdast" "^3.0.0" "@types/mdast" "^3.0.0"
"@types/unist" "^2.0.0" "@types/unist" "^2.0.0"
@@ -3974,25 +3963,25 @@ merge2@^1.3.0, merge2@^1.4.1:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
mermaid@^10.1.0: mermaid@^10.2.3:
version "10.1.0" version "10.2.3"
resolved "https://registry.npmmirror.com/mermaid/-/mermaid-10.1.0.tgz#6e40d5250174f4750ca6548e4ee00f6ae210855a" resolved "https://registry.yarnpkg.com/mermaid/-/mermaid-10.2.3.tgz#789d3b582c5da8c69aa4a7c0e2b826562c8c8b12"
integrity sha512-LYekSMNJygI1VnMizAPUddY95hZxOjwZxr7pODczILInO0dhQKuhXeu4sargtnuTwCilSuLS7Uiq/Qn7HTVrmA== integrity sha512-cMVE5s9PlQvOwfORkyVpr5beMsLdInrycAosdr+tpZ0WFjG4RJ/bUHST7aTgHNJbujHkdBRAm+N50P3puQOfPw==
dependencies: dependencies:
"@braintree/sanitize-url" "^6.0.0" "@braintree/sanitize-url" "^6.0.2"
"@khanacademy/simple-markdown" "^0.8.6"
cytoscape "^3.23.0" cytoscape "^3.23.0"
cytoscape-cose-bilkent "^4.1.0" cytoscape-cose-bilkent "^4.1.0"
cytoscape-fcose "^2.1.0" cytoscape-fcose "^2.1.0"
d3 "^7.4.0" d3 "^7.4.0"
dagre-d3-es "7.0.10" dagre-d3-es "7.0.10"
dayjs "^1.11.7" dayjs "^1.11.7"
dompurify "2.4.5" dompurify "3.0.3"
elkjs "^0.8.2" elkjs "^0.8.2"
khroma "^2.0.0" khroma "^2.0.0"
lodash-es "^4.17.21" lodash-es "^4.17.21"
mdast-util-from-markdown "^1.3.0"
non-layered-tidy-tree-layout "^2.0.2" non-layered-tidy-tree-layout "^2.0.2"
stylis "^4.1.2" stylis "^4.1.3"
ts-dedent "^2.2.0" ts-dedent "^2.2.0"
uuid "^9.0.0" uuid "^9.0.0"
web-worker "^1.2.0" web-worker "^1.2.0"
@@ -4340,28 +4329,29 @@ natural-compare@^1.4.0:
resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7"
integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==
next@^13.4.3: next@^13.4.6:
version "13.4.3" version "13.4.6"
resolved "https://registry.npmmirror.com/next/-/next-13.4.3.tgz#7f417dec9fa2731d8c1d1819a1c7d0919ad6fc75" resolved "https://registry.yarnpkg.com/next/-/next-13.4.6.tgz#ebe52f5c74d60176d45b45e73f25a51103713ea4"
integrity sha512-FV3pBrAAnAIfOclTvncw9dDohyeuEEXPe5KNcva91anT/rdycWbgtu3IjUj4n5yHnWK8YEPo0vrUecHmnmUNbA== integrity sha512-sjVqjxU+U2aXZnYt4Ud6CTLNNwWjdSfMgemGpIQJcN3Z7Jni9xRWbR0ie5fQzCg87aLqQVhKA2ud2gPoqJ9lGw==
dependencies: dependencies:
"@next/env" "13.4.3" "@next/env" "13.4.6"
"@swc/helpers" "0.5.1" "@swc/helpers" "0.5.1"
busboy "1.6.0" busboy "1.6.0"
caniuse-lite "^1.0.30001406" caniuse-lite "^1.0.30001406"
postcss "8.4.14" postcss "8.4.14"
styled-jsx "5.1.1" styled-jsx "5.1.1"
watchpack "2.4.0"
zod "3.21.4" zod "3.21.4"
optionalDependencies: optionalDependencies:
"@next/swc-darwin-arm64" "13.4.3" "@next/swc-darwin-arm64" "13.4.6"
"@next/swc-darwin-x64" "13.4.3" "@next/swc-darwin-x64" "13.4.6"
"@next/swc-linux-arm64-gnu" "13.4.3" "@next/swc-linux-arm64-gnu" "13.4.6"
"@next/swc-linux-arm64-musl" "13.4.3" "@next/swc-linux-arm64-musl" "13.4.6"
"@next/swc-linux-x64-gnu" "13.4.3" "@next/swc-linux-x64-gnu" "13.4.6"
"@next/swc-linux-x64-musl" "13.4.3" "@next/swc-linux-x64-musl" "13.4.6"
"@next/swc-win32-arm64-msvc" "13.4.3" "@next/swc-win32-arm64-msvc" "13.4.6"
"@next/swc-win32-ia32-msvc" "13.4.3" "@next/swc-win32-ia32-msvc" "13.4.6"
"@next/swc-win32-x64-msvc" "13.4.3" "@next/swc-win32-x64-msvc" "13.4.6"
node-domexception@^1.0.0: node-domexception@^1.0.0:
version "1.0.0" version "1.0.0"
@@ -4677,10 +4667,10 @@ react-is@^18.0.0:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
react-markdown@^8.0.5: react-markdown@^8.0.7:
version "8.0.6" version "8.0.7"
resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.6.tgz#3e939018f8bfce800ffdf22cf50aba3cdded7ad1" resolved "https://registry.yarnpkg.com/react-markdown/-/react-markdown-8.0.7.tgz#c8dbd1b9ba5f1c5e7e5f2a44de465a3caafdf89b"
integrity sha512-KgPWsYgHuftdx510wwIzpwf+5js/iHqBR+fzxefv8Khk3mFbnioF1bmL2idHN3ler0LMQmICKeDrWnZrX9mtbQ== integrity sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==
dependencies: dependencies:
"@types/hast" "^2.0.0" "@types/hast" "^2.0.0"
"@types/prop-types" "^15.0.0" "@types/prop-types" "^15.0.0"
@@ -5208,10 +5198,10 @@ styled-jsx@5.1.1:
dependencies: dependencies:
client-only "0.0.1" client-only "0.0.1"
stylis@^4.1.2: stylis@^4.1.3:
version "4.1.4" version "4.2.0"
resolved "https://registry.npmmirror.com/stylis/-/stylis-4.1.4.tgz#9cb60e7153d8ac6d02d773552bf51c7a0344535b" resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.2.0.tgz#79daee0208964c8fe695a42fcffcac633a211a51"
integrity sha512-USf5pszRYwuE6hg9by0OkKChkQYEXfkeTtm0xKw+jqQhwyjCVLdYyMBK7R+n7dhzsblAWJnGxju4vxq5eH20GQ== integrity sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==
supports-color@^5.3.0: supports-color@^5.3.0:
version "5.5.0" version "5.5.0"
@@ -5491,10 +5481,10 @@ uri-js@^4.2.2:
dependencies: dependencies:
punycode "^2.1.0" punycode "^2.1.0"
use-debounce@^9.0.3: use-debounce@^9.0.4:
version "9.0.3" version "9.0.4"
resolved "https://registry.yarnpkg.com/use-debounce/-/use-debounce-9.0.3.tgz#bac660c19ab7b38662e08608fee23c7ad303f532" resolved "https://registry.yarnpkg.com/use-debounce/-/use-debounce-9.0.4.tgz#51d25d856fbdfeb537553972ce3943b897f1ac85"
integrity sha512-FhtlbDtDXILJV7Lix5OZj5yX/fW1tzq+VrvK1fnT2bUrPOGruU9Rw8NCEn+UI9wopfERBEZAOQ8lfeCJPllgnw== integrity sha512-6X8H/mikbrt0XE8e+JXRtZ8yYVvKkdYRfmIhWZYsP8rcNs9hk3APV8Ua2mFkKRLcJKVdnX2/Vwrmg2GWKUQEaQ==
use-memo-one@^1.1.3: use-memo-one@^1.1.3:
version "1.1.3" version "1.1.3"
@@ -5547,6 +5537,14 @@ vfile@^5.0.0:
unist-util-stringify-position "^3.0.0" unist-util-stringify-position "^3.0.0"
vfile-message "^3.0.0" vfile-message "^3.0.0"
watchpack@2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d"
integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==
dependencies:
glob-to-regexp "^0.4.1"
graceful-fs "^4.1.2"
web-namespaces@^2.0.0: web-namespaces@^2.0.0:
version "2.0.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-2.0.1.tgz#1010ff7c650eccb2592cebeeaf9a1b253fd40692"
@@ -5645,10 +5643,10 @@ yaml@^1.10.0:
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"
integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==
yaml@^2.2.1: yaml@^2.2.2:
version "2.2.1" version "2.3.1"
resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.3.1.tgz#02fe0975d23cd441242aa7204e09fc28ac2ac33b"
integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== integrity sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==
yocto-queue@^0.1.0: yocto-queue@^0.1.0:
version "0.1.0" version "0.1.0"
@@ -5660,10 +5658,10 @@ zod@3.21.4:
resolved "https://registry.npmmirror.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" resolved "https://registry.npmmirror.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db"
integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==
zustand@^4.3.6: zustand@^4.3.8:
version "4.3.6" version "4.3.8"
resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.3.6.tgz#ce7804eb75361af0461a2d0536b65461ec5de86f" resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.3.8.tgz#37113df8e9e1421b0be1b2dca02b49b76210e7c4"
integrity sha512-6J5zDxjxLE+yukC2XZWf/IyWVKnXT9b9HUv09VJ/bwGCpKNcaTqp7Ws28Xr8jnbvnZcdRaidztAPsXFBIqufiw== integrity sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==
dependencies: dependencies:
use-sync-external-store "1.2.0" use-sync-external-store "1.2.0"