From 7b9448f72eb821793b3f181725b98be00551b647 Mon Sep 17 00:00:00 2001
From: 1600822305 <1600822305@qq.com>
Date: Sat, 12 Apr 2025 18:53:47 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=20TTS=20=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3=E6=9C=8D=E5=8A=A1=E5=B9=B6=E6=9B=B4=E6=96=B0=E4=BA=86?=
=?UTF-8?q?=E8=AE=BE=E7=BD=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
asr-server/embedded.js | 123 ++
asr-server/index.html | 425 +++++
asr-server/package-lock.json | 854 +++++++++
asr-server/package.json | 10 +
asr-server/server.js | 269 +++
asr-server/standalone.js | 114 ++
asr-server/start-server.bat | 5 +
electron-builder.yml | 16 +-
index.html | 425 +++++
public/asr-server/embedded.js | 123 ++
public/asr-server/index.html | 281 ++-
public/asr-server/package-lock.json | 854 +++++++++
public/asr-server/package.json | 10 +
public/asr-server/server.js | 141 +-
public/asr-server/standalone.js | 114 ++
public/asr-server/start-server.bat | 5 +
resources/asr-server/embedded.js | 123 ++
resources/asr-server/index.html | 425 +++++
resources/asr-server/package-lock.json | 854 +++++++++
resources/asr-server/package.json | 10 +
resources/asr-server/server.js | 269 +++
resources/asr-server/standalone.js | 114 ++
resources/asr-server/start-server.bat | 5 +
src/main/services/ASRServerService.ts | 43 +-
src/main/utils/index.ts | 3 +-
src/renderer/src/assets/asr-server/server.js | 2 +-
.../src/components/TTSProgressBar.tsx | 64 +-
src/renderer/src/config/prompts.ts | 61 +
src/renderer/src/i18n/locales/en-us.json | 16 +-
src/renderer/src/i18n/locales/ja-jp.json | 208 ++-
src/renderer/src/i18n/locales/ru-ru.json | 30 +-
src/renderer/src/i18n/locales/zh-cn.json | 12 +
src/renderer/src/i18n/locales/zh-cn.json.bak | 1576 +++++++++++++++++
src/renderer/src/i18n/locales/zh-tw.json | 30 +-
.../src/pages/home/Inputbar/Inputbar.tsx | 20 +-
.../settings/TTSSettings/ASRSettings.tsx | 31 +-
.../settings/TTSSettings/TTSSettings.tsx | 44 +-
.../TTSSettings/VoiceCallSettings.tsx | 44 +-
src/renderer/src/services/ASRServerService.ts | 69 +-
src/renderer/src/services/ASRService.ts | 19 +-
src/renderer/src/services/VoiceCallService.ts | 50 +-
src/renderer/src/services/tts/MsTTSService.ts | 12 +-
src/renderer/src/services/tts/TTSService.ts | 29 +-
.../src/services/tts/TTSServiceFactory.ts | 13 +-
.../src/services/tts/TTSTextFilter.ts | 20 +
src/renderer/src/store/settings.ts | 22 +
yarn.lock | 36 +-
47 files changed, 7752 insertions(+), 271 deletions(-)
create mode 100644 asr-server/embedded.js
create mode 100644 asr-server/index.html
create mode 100644 asr-server/package-lock.json
create mode 100644 asr-server/package.json
create mode 100644 asr-server/server.js
create mode 100644 asr-server/standalone.js
create mode 100644 asr-server/start-server.bat
create mode 100644 index.html
create mode 100644 public/asr-server/embedded.js
create mode 100644 public/asr-server/package-lock.json
create mode 100644 public/asr-server/package.json
create mode 100644 public/asr-server/standalone.js
create mode 100644 public/asr-server/start-server.bat
create mode 100644 resources/asr-server/embedded.js
create mode 100644 resources/asr-server/index.html
create mode 100644 resources/asr-server/package-lock.json
create mode 100644 resources/asr-server/package.json
create mode 100644 resources/asr-server/server.js
create mode 100644 resources/asr-server/standalone.js
create mode 100644 resources/asr-server/start-server.bat
create mode 100644 src/renderer/src/i18n/locales/zh-cn.json.bak
diff --git a/asr-server/embedded.js b/asr-server/embedded.js
new file mode 100644
index 0000000000..68ae30e239
--- /dev/null
+++ b/asr-server/embedded.js
@@ -0,0 +1,123 @@
+/**
+ * 内置的ASR服务器模块
+ * 这个文件可以直接在Electron中运行,不需要外部依赖
+ */
+
+// 使用Electron内置的Node.js模块
+const http = require('http')
+const path = require('path')
+const fs = require('fs')
+
+// 输出环境信息
+console.log('ASR Server (Embedded) starting...')
+console.log('Node.js version:', process.version)
+console.log('Current directory:', __dirname)
+console.log('Current working directory:', process.cwd())
+console.log('Command line arguments:', process.argv)
+
+// 创建HTTP服务器
+const server = http.createServer((req, res) => {
+ try {
+ if (req.url === '/' || req.url === '/index.html') {
+ // 尝试多个可能的路径
+ const possiblePaths = [
+ // 当前目录
+ path.join(__dirname, 'index.html'),
+ // 上级目录
+ path.join(__dirname, '..', 'index.html'),
+ // 应用根目录
+ path.join(process.cwd(), 'index.html')
+ ]
+
+ console.log('Possible index.html paths:', possiblePaths)
+
+ // 查找第一个存在的文件
+ let indexPath = null
+ for (const p of possiblePaths) {
+ try {
+ if (fs.existsSync(p)) {
+ indexPath = p
+ console.log(`Found index.html at: ${p}`)
+ break
+ }
+ } catch (e) {
+ console.error(`Error checking existence of ${p}:`, e)
+ }
+ }
+
+ if (indexPath) {
+ // 读取文件内容并发送
+ fs.readFile(indexPath, (err, data) => {
+ if (err) {
+ console.error('Error reading index.html:', err)
+ res.writeHead(500)
+ res.end('Error reading index.html')
+ return
+ }
+
+ res.writeHead(200, { 'Content-Type': 'text/html' })
+ res.end(data)
+ })
+ } else {
+ // 如果找不到文件,返回一个简单的HTML页面
+ console.error('Could not find index.html, serving fallback page')
+ res.writeHead(200, { 'Content-Type': 'text/html' })
+ res.end(`
+
+
+
+ ASR Server
+
+
+
+ ASR Server is running
+ This is a fallback page because the index.html file could not be found.
+ Server is running at: http://localhost:34515
+ Current directory: ${__dirname}
+ Working directory: ${process.cwd()}
+
+
+ `)
+ }
+ } else {
+ // 处理其他请求
+ res.writeHead(404)
+ res.end('Not found')
+ }
+ } catch (error) {
+ console.error('Error handling request:', error)
+ res.writeHead(500)
+ res.end('Server error')
+ }
+})
+
+// 添加进程错误处理
+process.on('uncaughtException', (error) => {
+ console.error('[Server] Uncaught exception:', error)
+ // 不立即退出,给日志输出的时间
+ setTimeout(() => process.exit(1), 1000)
+})
+
+process.on('unhandledRejection', (reason, promise) => {
+ console.error('[Server] Unhandled rejection at:', promise, 'reason:', reason)
+})
+
+// 尝试启动服务器
+try {
+ const port = 34515
+ server.listen(port, () => {
+ console.log(`[Server] Server running at http://localhost:${port}`)
+ })
+
+ // 处理服务器错误
+ server.on('error', (error) => {
+ console.error(`[Server] Failed to start server:`, error)
+ process.exit(1) // Exit if server fails to start
+ })
+} catch (error) {
+ console.error('[Server] Critical error starting server:', error)
+ process.exit(1)
+}
diff --git a/asr-server/index.html b/asr-server/index.html
new file mode 100644
index 0000000000..cfa0db82fb
--- /dev/null
+++ b/asr-server/index.html
@@ -0,0 +1,425 @@
+
+
+
+
+
+
+ Cherry Studio ASR
+
+
+
+
+ 浏览器语音识别中继页面
+ 这个页面需要在浏览器中保持打开,以便应用使用其语音识别功能。
+ 正在连接到服务器...
+
+
+
+
+
+
\ No newline at end of file
diff --git a/asr-server/package-lock.json b/asr-server/package-lock.json
new file mode 100644
index 0000000000..8d3eb4035d
--- /dev/null
+++ b/asr-server/package-lock.json
@@ -0,0 +1,854 @@
+{
+ "name": "cherry-asr-server",
+ "version": "1.0.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "cherry-asr-server",
+ "version": "1.0.0",
+ "dependencies": {
+ "express": "^4.18.2",
+ "ws": "^8.13.0"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "1.3.8",
+ "resolved": "https://registry.npmmirror.com/accepts/-/accepts-1.3.8.tgz",
+ "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "~2.1.34",
+ "negotiator": "0.6.3"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/array-flatten": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-1.1.1.tgz",
+ "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
+ "license": "MIT"
+ },
+ "node_modules/body-parser": {
+ "version": "1.20.3",
+ "resolved": "https://registry.npmmirror.com/body-parser/-/body-parser-1.20.3.tgz",
+ "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "content-type": "~1.0.5",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "on-finished": "2.4.1",
+ "qs": "6.13.0",
+ "raw-body": "2.5.2",
+ "type-is": "~1.6.18",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmmirror.com/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmmirror.com/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/content-disposition": {
+ "version": "0.5.4",
+ "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz",
+ "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "5.2.1"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmmirror.com/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.1",
+ "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.7.1.tgz",
+ "integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz",
+ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==",
+ "license": "MIT"
+ },
+ "node_modules/debug": {
+ "version": "2.6.9",
+ "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+ "license": "MIT",
+ "dependencies": {
+ "ms": "2.0.0"
+ }
+ },
+ "node_modules/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/destroy": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/destroy/-/destroy-1.2.0.tgz",
+ "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8",
+ "npm": "1.2.8000 || >= 1.4.16"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmmirror.com/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
+ "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmmirror.com/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "license": "MIT"
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmmirror.com/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/express": {
+ "version": "4.21.2",
+ "resolved": "https://registry.npmmirror.com/express/-/express-4.21.2.tgz",
+ "integrity": "sha512-28HqgMZAmih1Czt9ny7qr6ek2qddF4FclbMzwhCREB6OFfH+rXAnuNCwo1/wFvrtbgsQDb4kSbX9de9lFbrXnA==",
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "~1.3.8",
+ "array-flatten": "1.1.1",
+ "body-parser": "1.20.3",
+ "content-disposition": "0.5.4",
+ "content-type": "~1.0.4",
+ "cookie": "0.7.1",
+ "cookie-signature": "1.0.6",
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "finalhandler": "1.3.1",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "merge-descriptors": "1.0.3",
+ "methods": "~1.1.2",
+ "on-finished": "2.4.1",
+ "parseurl": "~1.3.3",
+ "path-to-regexp": "0.1.12",
+ "proxy-addr": "~2.0.7",
+ "qs": "6.13.0",
+ "range-parser": "~1.2.1",
+ "safe-buffer": "5.2.1",
+ "send": "0.19.0",
+ "serve-static": "1.16.2",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "type-is": "~1.6.18",
+ "utils-merge": "1.0.1",
+ "vary": "~1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.3.1.tgz",
+ "integrity": "sha512-6BN9trH7bp3qvnrRyzsBz+g3lZxTNZTbVO2EV1CS0WIcDbawYVdYvGflME/9QP0h0pYlCDBCTjYa9nZzMDpyxQ==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "on-finished": "2.4.1",
+ "parseurl": "~1.3.3",
+ "statuses": "2.0.1",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "0.5.2",
+ "resolved": "https://registry.npmmirror.com/fresh/-/fresh-0.5.2.tgz",
+ "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz",
+ "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/http-errors/-/http-errors-2.0.0.tgz",
+ "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "depd": "2.0.0",
+ "inherits": "2.0.4",
+ "setprototypeof": "1.2.0",
+ "statuses": "2.0.1",
+ "toidentifier": "1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.4.24",
+ "resolved": "https://registry.npmmirror.com/iconv-lite/-/iconv-lite-0.4.24.tgz",
+ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "license": "ISC"
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "0.3.0",
+ "resolved": "https://registry.npmmirror.com/media-typer/-/media-typer-0.3.0.tgz",
+ "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.3.tgz",
+ "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/methods": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmmirror.com/methods/-/methods-1.1.2.tgz",
+ "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmmirror.com/mime/-/mime-1.6.0.tgz",
+ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+ "license": "MIT",
+ "bin": {
+ "mime": "cli.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.52.0",
+ "resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "2.1.35",
+ "resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "1.52.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
+ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+ "license": "MIT"
+ },
+ "node_modules/negotiator": {
+ "version": "0.6.3",
+ "resolved": "https://registry.npmmirror.com/negotiator/-/negotiator-0.6.3.tgz",
+ "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmmirror.com/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmmirror.com/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmmirror.com/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/path-to-regexp": {
+ "version": "0.1.12",
+ "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
+ "integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
+ "license": "MIT"
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.7",
+ "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
+ "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.13.0",
+ "resolved": "https://registry.npmmirror.com/qs/-/qs-6.13.0.tgz",
+ "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "side-channel": "^1.0.6"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmmirror.com/range-parser/-/range-parser-1.2.1.tgz",
+ "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "2.5.2",
+ "resolved": "https://registry.npmmirror.com/raw-body/-/raw-body-2.5.2.tgz",
+ "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "3.1.2",
+ "http-errors": "2.0.0",
+ "iconv-lite": "0.4.24",
+ "unpipe": "1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmmirror.com/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "license": "MIT"
+ },
+ "node_modules/send": {
+ "version": "0.19.0",
+ "resolved": "https://registry.npmmirror.com/send/-/send-0.19.0.tgz",
+ "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "2.6.9",
+ "depd": "2.0.0",
+ "destroy": "1.2.0",
+ "encodeurl": "~1.0.2",
+ "escape-html": "~1.0.3",
+ "etag": "~1.8.1",
+ "fresh": "0.5.2",
+ "http-errors": "2.0.0",
+ "mime": "1.6.0",
+ "ms": "2.1.3",
+ "on-finished": "2.4.1",
+ "range-parser": "~1.2.1",
+ "statuses": "2.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/send/node_modules/encodeurl": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmmirror.com/encodeurl/-/encodeurl-1.0.2.tgz",
+ "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/send/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "license": "MIT"
+ },
+ "node_modules/serve-static": {
+ "version": "1.16.2",
+ "resolved": "https://registry.npmmirror.com/serve-static/-/serve-static-1.16.2.tgz",
+ "integrity": "sha512-VqpjJZKadQB/PEbEwvFdO43Ax5dFBZ2UECszz8bQ7pi7wt//PWe1P6MN7eCnjsatYtBT6EuiClbjSWP2WrIoTw==",
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "~2.0.0",
+ "escape-html": "~1.0.3",
+ "parseurl": "~1.3.3",
+ "send": "0.19.0"
+ },
+ "engines": {
+ "node": ">= 0.8.0"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmmirror.com/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "license": "ISC"
+ },
+ "node_modules/side-channel": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmmirror.com/side-channel/-/side-channel-1.1.0.tgz",
+ "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3",
+ "side-channel-list": "^1.0.0",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/side-channel-list/-/side-channel-list-1.0.0.tgz",
+ "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmmirror.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmmirror.com/statuses/-/statuses-2.0.1.tgz",
+ "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "1.6.18",
+ "resolved": "https://registry.npmmirror.com/type-is/-/type-is-1.6.18.tgz",
+ "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
+ "license": "MIT",
+ "dependencies": {
+ "media-typer": "0.3.0",
+ "mime-types": "~2.1.24"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmmirror.com/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/utils-merge": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmmirror.com/utils-merge/-/utils-merge-1.0.1.tgz",
+ "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmmirror.com/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/ws": {
+ "version": "8.18.1",
+ "resolved": "https://registry.npmmirror.com/ws/-/ws-8.18.1.tgz",
+ "integrity": "sha512-RKW2aJZMXeMxVpnZ6bck+RswznaxmzdULiBr6KY7XkTnW8uvt0iT9H5DkHUChXrc+uurzwa0rVI16n/Xzjdz1w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ }
+ }
+}
diff --git a/asr-server/package.json b/asr-server/package.json
new file mode 100644
index 0000000000..b09528cca8
--- /dev/null
+++ b/asr-server/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "cherry-asr-server",
+ "version": "1.0.0",
+ "description": "Cherry Studio ASR Server",
+ "main": "server.js",
+ "dependencies": {
+ "express": "^4.18.2",
+ "ws": "^8.13.0"
+ }
+}
\ No newline at end of file
diff --git a/asr-server/server.js b/asr-server/server.js
new file mode 100644
index 0000000000..ed73ecb022
--- /dev/null
+++ b/asr-server/server.js
@@ -0,0 +1,269 @@
+// 检查依赖项
+try {
+ console.log('ASR Server starting...')
+ console.log('Node.js version:', process.version)
+ console.log('Current directory:', __dirname)
+ console.log('Current working directory:', process.cwd())
+ console.log('Command line arguments:', process.argv)
+
+ // 检查必要的依赖项
+ const checkDependency = (name) => {
+ try {
+ require(name) // Removed unused variable 'module'
+ console.log(`Successfully loaded dependency: ${name}`)
+ return true
+ } catch (error) {
+ console.error(`Failed to load dependency: ${name}`, error.message)
+ return false
+ }
+ }
+
+ // 检查所有必要的依赖项
+ const dependencies = ['http', 'ws', 'express', 'path', 'fs']
+ const missingDeps = dependencies.filter((dep) => !checkDependency(dep))
+
+ if (missingDeps.length > 0) {
+ console.error(`Missing dependencies: ${missingDeps.join(', ')}. Server cannot start.`)
+ process.exit(1)
+ }
+} catch (error) {
+ console.error('Error during dependency check:', error)
+ process.exit(1)
+}
+
+// 加载依赖项
+const http = require('http')
+const WebSocket = require('ws')
+const express = require('express')
+const path = require('path') // Need path module
+// const fs = require('fs') // Commented out unused import 'fs'
+
+const app = express()
+const port = 34515 // Define the port
+
+// 获取index.html文件的路径
+function getIndexHtmlPath() {
+ const fs = require('fs')
+ console.log('Current directory:', __dirname)
+ console.log('Current working directory:', process.cwd())
+
+ // 尝试多个可能的路径
+ const possiblePaths = [
+ // 开发环境路径
+ path.join(__dirname, 'index.html'),
+ // 当前目录
+ path.join(process.cwd(), 'index.html'),
+ // 相对于可执行文件的路径
+ path.join(path.dirname(process.execPath), 'index.html'),
+ // 相对于可执行文件的上级目录的路径
+ path.join(path.dirname(path.dirname(process.execPath)), 'index.html'),
+ // 相对于可执行文件的resources目录的路径
+ path.join(path.dirname(process.execPath), 'resources', 'index.html'),
+ // 相对于可执行文件的resources/asr-server目录的路径
+ path.join(path.dirname(process.execPath), 'resources', 'asr-server', 'index.html'),
+ // 相对于可执行文件的asr-server目录的路径
+ path.join(path.dirname(process.execPath), 'asr-server', 'index.html'),
+ // 如果是pkg打包环境
+ process.pkg ? path.join(path.dirname(process.execPath), 'index.html') : null
+ ].filter(Boolean) // 过滤掉null值
+
+ console.log('Possible index.html paths:', possiblePaths)
+
+ // 检查每个路径,返回第一个存在的文件
+ for (const p of possiblePaths) {
+ try {
+ if (fs.existsSync(p)) {
+ console.log(`Found index.html at: ${p}`)
+ return p
+ }
+ } catch (e) {
+ console.error(`Error checking existence of ${p}:`, e)
+ }
+ }
+
+ // 如果没有找到文件,返回默认路径并记录错误
+ console.error('Could not find index.html in any of the expected locations')
+ return path.join(__dirname, 'index.html') // 返回默认路径,即使它可能不存在
+}
+
+// 提供网页给浏览器
+app.get('/', (req, res) => {
+ try {
+ const indexPath = getIndexHtmlPath()
+ console.log(`Serving index.html from: ${indexPath}`)
+
+ // 检查文件是否存在
+ const fs = require('fs')
+ if (!fs.existsSync(indexPath)) {
+ console.error(`Error: index.html not found at ${indexPath}`)
+ return res.status(404).send(`Error: index.html not found at ${indexPath}.
Please check the server logs.`)
+ }
+
+ res.sendFile(indexPath, (err) => {
+ if (err) {
+ console.error('Error sending index.html:', err)
+ res.status(500).send(`Error serving index.html: ${err.message}`)
+ }
+ })
+ } catch (error) {
+ console.error('Error in route handler:', error)
+ res.status(500).send(`Server error: ${error.message}`)
+ }
+})
+
+const server = http.createServer(app)
+const wss = new WebSocket.Server({ server })
+
+let browserConnection = null
+let electronConnection = null
+
+wss.on('connection', (ws) => {
+ console.log('[Server] WebSocket client connected') // Add log
+
+ ws.on('message', (message) => {
+ let data
+ try {
+ // Ensure message is treated as string before parsing
+ data = JSON.parse(message.toString())
+ console.log('[Server] Received message:', data) // Log parsed data
+ } catch (e) {
+ console.error('[Server] Failed to parse message or message is not JSON:', message.toString(), e)
+ return // Ignore non-JSON messages
+ }
+
+ // 识别客户端类型
+ if (data.type === 'identify') {
+ if (data.role === 'browser') {
+ browserConnection = ws
+ console.log('[Server] Browser identified and connected')
+ // Notify Electron that the browser is ready
+ if (electronConnection && electronConnection.readyState === WebSocket.OPEN) {
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'browser_ready' }))
+ console.log('[Server] Sent browser_ready status to Electron')
+ }
+ // Notify Electron if it's already connected
+ if (electronConnection) {
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'Browser connected' }))
+ }
+ ws.on('close', () => {
+ console.log('[Server] Browser disconnected')
+ browserConnection = null
+ // Notify Electron
+ if (electronConnection) {
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'Browser disconnected' }))
+ }
+ })
+ ws.on('error', (error) => {
+ console.error('[Server] Browser WebSocket error:', error)
+ browserConnection = null // Assume disconnected on error
+ if (electronConnection) {
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'Browser connection error' }))
+ }
+ })
+ } else if (data.role === 'electron') {
+ electronConnection = ws
+ console.log('[Server] Electron identified and connected')
+ // If browser is already connected when Electron connects, notify Electron immediately
+ if (browserConnection && browserConnection.readyState === WebSocket.OPEN) {
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'browser_ready' }))
+ console.log('[Server] Sent initial browser_ready status to Electron')
+ }
+ ws.on('close', () => {
+ console.log('[Server] Electron disconnected')
+ electronConnection = null
+ // Maybe send stop to browser if electron disconnects?
+ // if (browserConnection) browserConnection.send(JSON.stringify({ type: 'stop' }));
+ })
+ ws.on('error', (error) => {
+ console.error('[Server] Electron WebSocket error:', error)
+ electronConnection = null // Assume disconnected on error
+ })
+ }
+ }
+ // Electron 控制开始/停止
+ else if (data.type === 'start' && ws === electronConnection) {
+ if (browserConnection && browserConnection.readyState === WebSocket.OPEN) {
+ console.log('[Server] Relaying START command to browser')
+ browserConnection.send(JSON.stringify({ type: 'start' }))
+ } else {
+ console.log('[Server] Cannot relay START: Browser not connected')
+ // Optionally notify Electron back
+ electronConnection.send(JSON.stringify({ type: 'error', message: 'Browser not connected for ASR' }))
+ }
+ } else if (data.type === 'stop' && ws === electronConnection) {
+ if (browserConnection && browserConnection.readyState === WebSocket.OPEN) {
+ console.log('[Server] Relaying STOP command to browser')
+ browserConnection.send(JSON.stringify({ type: 'stop' }))
+ } else {
+ console.log('[Server] Cannot relay STOP: Browser not connected')
+ }
+ } else if (data.type === 'reset' && ws === electronConnection) {
+ if (browserConnection && browserConnection.readyState === WebSocket.OPEN) {
+ console.log('[Server] Relaying RESET command to browser')
+ browserConnection.send(JSON.stringify({ type: 'reset' }))
+ } else {
+ console.log('[Server] Cannot relay RESET: Browser not connected')
+ }
+ }
+ // 浏览器发送识别结果
+ else if (data.type === 'result' && ws === browserConnection) {
+ if (electronConnection && electronConnection.readyState === WebSocket.OPEN) {
+ // console.log('[Server] Relaying RESULT to Electron:', data.data); // Log less frequently if needed
+ electronConnection.send(JSON.stringify({ type: 'result', data: data.data }))
+ } else {
+ // console.log('[Server] Cannot relay RESULT: Electron not connected');
+ }
+ }
+ // 浏览器发送状态更新 (例如 'stopped')
+ else if (data.type === 'status' && ws === browserConnection) {
+ if (electronConnection && electronConnection.readyState === WebSocket.OPEN) {
+ console.log('[Server] Relaying STATUS to Electron:', data.message) // Log status being relayed
+ electronConnection.send(JSON.stringify({ type: 'status', message: data.message }))
+ } else {
+ console.log('[Server] Cannot relay STATUS: Electron not connected')
+ }
+ } else {
+ console.log('[Server] Received unknown message type or from unknown source:', data)
+ }
+ })
+
+ ws.on('error', (error) => {
+ // Generic error handling for connection before identification
+ console.error('[Server] Initial WebSocket connection error:', error)
+ // Attempt to clean up based on which connection it might be (if identified)
+ if (ws === browserConnection) {
+ browserConnection = null
+ if (electronConnection)
+ electronConnection.send(JSON.stringify({ type: 'status', message: 'Browser connection error' }))
+ } else if (ws === electronConnection) {
+ electronConnection = null
+ }
+ })
+})
+
+// 添加进程错误处理
+process.on('uncaughtException', (error) => {
+ console.error('[Server] Uncaught exception:', error)
+ // 不立即退出,给日志输出的时间
+ setTimeout(() => process.exit(1), 1000)
+})
+
+process.on('unhandledRejection', (reason, promise) => {
+ console.error('[Server] Unhandled rejection at:', promise, 'reason:', reason)
+})
+
+// 尝试启动服务器
+try {
+ server.listen(port, () => {
+ console.log(`[Server] Server running at http://localhost:${port}`)
+ })
+
+ // Handle server errors
+ server.on('error', (error) => {
+ console.error(`[Server] Failed to start server:`, error)
+ process.exit(1) // Exit if server fails to start
+ })
+} catch (error) {
+ console.error('[Server] Critical error starting server:', error)
+ process.exit(1)
+}
diff --git a/asr-server/standalone.js b/asr-server/standalone.js
new file mode 100644
index 0000000000..7b826d1f25
--- /dev/null
+++ b/asr-server/standalone.js
@@ -0,0 +1,114 @@
+/**
+ * 独立的ASR服务器
+ * 这个文件是一个简化版的server.js,用于在打包后的应用中运行
+ */
+
+// 基本依赖
+const http = require('http')
+const express = require('express')
+const path = require('path')
+const fs = require('fs')
+
+// 输出环境信息
+console.log('ASR Server starting...')
+console.log('Node.js version:', process.version)
+console.log('Current directory:', __dirname)
+console.log('Current working directory:', process.cwd())
+console.log('Command line arguments:', process.argv)
+
+// 创建Express应用
+const app = express()
+const port = 34515
+
+// 提供静态文件
+app.use(express.static(__dirname))
+
+// 提供网页给浏览器
+app.get('/', (req, res) => {
+ try {
+ // 尝试多个可能的路径
+ const possiblePaths = [
+ // 当前目录
+ path.join(__dirname, 'index.html'),
+ // 上级目录
+ path.join(__dirname, '..', 'index.html'),
+ // 应用根目录
+ path.join(process.cwd(), 'index.html')
+ ]
+
+ console.log('Possible index.html paths:', possiblePaths)
+
+ // 查找第一个存在的文件
+ let indexPath = null
+ for (const p of possiblePaths) {
+ try {
+ if (fs.existsSync(p)) {
+ indexPath = p
+ console.log(`Found index.html at: ${p}`)
+ break
+ }
+ } catch (e) {
+ console.error(`Error checking existence of ${p}:`, e)
+ }
+ }
+
+ if (indexPath) {
+ res.sendFile(indexPath)
+ } else {
+ // 如果找不到文件,返回一个简单的HTML页面
+ console.error('Could not find index.html, serving fallback page')
+ res.send(`
+
+
+
+ ASR Server
+
+
+
+ ASR Server is running
+ This is a fallback page because the index.html file could not be found.
+ Server is running at: http://localhost:${port}
+ Current directory: ${__dirname}
+ Working directory: ${process.cwd()}
+
+
+ `)
+ }
+ } catch (error) {
+ console.error('Error serving index.html:', error)
+ res.status(500).send(`Server error: ${error.message}`)
+ }
+})
+
+// 创建HTTP服务器
+const server = http.createServer(app)
+
+// 添加进程错误处理
+process.on('uncaughtException', (error) => {
+ console.error('[Server] Uncaught exception:', error)
+ // 不立即退出,给日志输出的时间
+ setTimeout(() => process.exit(1), 1000)
+})
+
+process.on('unhandledRejection', (reason, promise) => {
+ console.error('[Server] Unhandled rejection at:', promise, 'reason:', reason)
+})
+
+// 尝试启动服务器
+try {
+ server.listen(port, () => {
+ console.log(`[Server] Server running at http://localhost:${port}`)
+ })
+
+ // 处理服务器错误
+ server.on('error', (error) => {
+ console.error(`[Server] Failed to start server:`, error)
+ process.exit(1) // Exit if server fails to start
+ })
+} catch (error) {
+ console.error('[Server] Critical error starting server:', error)
+ process.exit(1)
+}
diff --git a/asr-server/start-server.bat b/asr-server/start-server.bat
new file mode 100644
index 0000000000..3f9628a75c
--- /dev/null
+++ b/asr-server/start-server.bat
@@ -0,0 +1,5 @@
+@echo off
+echo Starting ASR Server...
+cd /d %~dp0
+node standalone.js
+pause
diff --git a/electron-builder.yml b/electron-builder.yml
index 29c8c97e47..962202f3b0 100644
--- a/electron-builder.yml
+++ b/electron-builder.yml
@@ -29,14 +29,18 @@ files:
- '!node_modules/@tavily/core/node_modules/js-tiktoken'
- '!node_modules/pdf-parse/lib/pdf.js/{v1.9.426,v1.10.88,v2.0.550}'
- '!node_modules/mammoth/{mammoth.browser.js,mammoth.browser.min.js}'
- # 包含 ASR 服务器文件
- - src/renderer/src/assets/asr-server/**/*
- # 包含打包后的ASR服务器可执行文件
- - cherry-asr-server.exe
- - index.html
-asarUnpack:
+asarUnpack: # Removed ASR server rules from 'files' section
- resources/**
- '**/*.{node,dll,metal,exp,lib}'
+extraResources: # Add extraResources to copy the prepared asr-server directory
+ - from: asr-server # Copy the folder from project root
+ to: app/asr-server # Copy TO the 'app' subfolder within resources
+ filter:
+ - "**/*" # Include everything inside
+ - from: resources/data # Copy the data folder with agents.json
+ to: data # Copy TO the 'data' subfolder within resources
+ filter:
+ - "**/*" # Include everything inside
win:
executableName: Cherry Studio
artifactName: ${productName}-${version}-${arch}-setup.${ext}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000000..cfa0db82fb
--- /dev/null
+++ b/index.html
@@ -0,0 +1,425 @@
+
+
+
+
+
+
+ Cherry Studio ASR
+
+
+
+
+ 浏览器语音识别中继页面
+ 这个页面需要在浏览器中保持打开,以便应用使用其语音识别功能。
+ 正在连接到服务器...
+
+
+
+
+
+
\ No newline at end of file
diff --git a/public/asr-server/embedded.js b/public/asr-server/embedded.js
new file mode 100644
index 0000000000..68ae30e239
--- /dev/null
+++ b/public/asr-server/embedded.js
@@ -0,0 +1,123 @@
+/**
+ * 内置的ASR服务器模块
+ * 这个文件可以直接在Electron中运行,不需要外部依赖
+ */
+
+// 使用Electron内置的Node.js模块
+const http = require('http')
+const path = require('path')
+const fs = require('fs')
+
+// 输出环境信息
+console.log('ASR Server (Embedded) starting...')
+console.log('Node.js version:', process.version)
+console.log('Current directory:', __dirname)
+console.log('Current working directory:', process.cwd())
+console.log('Command line arguments:', process.argv)
+
+// 创建HTTP服务器
+const server = http.createServer((req, res) => {
+ try {
+ if (req.url === '/' || req.url === '/index.html') {
+ // 尝试多个可能的路径
+ const possiblePaths = [
+ // 当前目录
+ path.join(__dirname, 'index.html'),
+ // 上级目录
+ path.join(__dirname, '..', 'index.html'),
+ // 应用根目录
+ path.join(process.cwd(), 'index.html')
+ ]
+
+ console.log('Possible index.html paths:', possiblePaths)
+
+ // 查找第一个存在的文件
+ let indexPath = null
+ for (const p of possiblePaths) {
+ try {
+ if (fs.existsSync(p)) {
+ indexPath = p
+ console.log(`Found index.html at: ${p}`)
+ break
+ }
+ } catch (e) {
+ console.error(`Error checking existence of ${p}:`, e)
+ }
+ }
+
+ if (indexPath) {
+ // 读取文件内容并发送
+ fs.readFile(indexPath, (err, data) => {
+ if (err) {
+ console.error('Error reading index.html:', err)
+ res.writeHead(500)
+ res.end('Error reading index.html')
+ return
+ }
+
+ res.writeHead(200, { 'Content-Type': 'text/html' })
+ res.end(data)
+ })
+ } else {
+ // 如果找不到文件,返回一个简单的HTML页面
+ console.error('Could not find index.html, serving fallback page')
+ res.writeHead(200, { 'Content-Type': 'text/html' })
+ res.end(`
+
+
+
+ ASR Server
+
+
+
+ ASR Server is running
+ This is a fallback page because the index.html file could not be found.
+ Server is running at: http://localhost:34515
+ Current directory: ${__dirname}
+ Working directory: ${process.cwd()}
+
+
+ `)
+ }
+ } else {
+ // 处理其他请求
+ res.writeHead(404)
+ res.end('Not found')
+ }
+ } catch (error) {
+ console.error('Error handling request:', error)
+ res.writeHead(500)
+ res.end('Server error')
+ }
+})
+
+// 添加进程错误处理
+process.on('uncaughtException', (error) => {
+ console.error('[Server] Uncaught exception:', error)
+ // 不立即退出,给日志输出的时间
+ setTimeout(() => process.exit(1), 1000)
+})
+
+process.on('unhandledRejection', (reason, promise) => {
+ console.error('[Server] Unhandled rejection at:', promise, 'reason:', reason)
+})
+
+// 尝试启动服务器
+try {
+ const port = 34515
+ server.listen(port, () => {
+ console.log(`[Server] Server running at http://localhost:${port}`)
+ })
+
+ // 处理服务器错误
+ server.on('error', (error) => {
+ console.error(`[Server] Failed to start server:`, error)
+ process.exit(1) // Exit if server fails to start
+ })
+} catch (error) {
+ console.error('[Server] Critical error starting server:', error)
+ process.exit(1)
+}
diff --git a/public/asr-server/index.html b/public/asr-server/index.html
index 00a207f6de..cfa0db82fb 100644
--- a/public/asr-server/index.html
+++ b/public/asr-server/index.html
@@ -4,7 +4,7 @@
- Browser ASR (External)
+ Cherry Studio ASR
+
+
+ ASR Server is running
+ This is a fallback page because the index.html file could not be found.
+ Server is running at: http://localhost:${port}
+ Current directory: ${__dirname}
+ Working directory: ${process.cwd()}
+
+