@lobehub/chat 0.111.4 → 0.111.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +1 -1
- package/.i18nrc.js +7 -5
- package/CHANGELOG.md +50 -0
- package/README.md +3 -3
- package/README.zh-CN.md +4 -4
- package/docs/Deployment/Analytics.md +20 -0
- package/docs/{Analytics.zh-CN.md → Deployment/Analytics.zh-CN.md} +5 -0
- package/docs/{Docker-Deployment.md → Deployment/Docker-Deployment.md} +7 -0
- package/docs/{Docker-Deployment.zh-CN.md → Deployment/Docker-Deployment.zh-CN.md} +7 -0
- package/docs/{Environment-Variable.md → Deployment/Environment-Variable.md} +2 -2
- package/docs/{Environment-Variable.zh-CN.md → Deployment/Environment-Variable.zh-CN.md} +2 -2
- package/docs/{Upstream-Sync.md → Deployment/Upstream-Sync.md} +1 -1
- package/docs/{Upstream-Sync.zh-CN.md → Deployment/Upstream-Sync.zh-CN.md} +1 -1
- package/docs/Development/Architecture.md +47 -0
- package/docs/{Development-Guide → Development}/Architecture.zh-CN.md +11 -1
- package/docs/Development/Chat-API.md +136 -0
- package/docs/{Development-Guide → Development}/Chat-API.zh-CN.md +10 -1
- package/docs/Development/Data-Store-Selectors.md +68 -0
- package/docs/{Development-Guide/Data-Store/Selectors.zh-CN.md → Development/Data-Store-Selectors.zh-CN.md} +1 -1
- package/docs/Development/Feature-Development.md +126 -0
- package/docs/{Development-Guide → Development}/Feature-Development.zh-CN.md +9 -1
- package/docs/Development/Folder-Structure.md +40 -0
- package/docs/Development/Resources.md +19 -0
- package/docs/Development/Steup-Development.md +69 -0
- package/docs/{Development-Guide → Development}/Steup-Development.zh-CN.md +8 -1
- package/docs/Development/Test.md +87 -0
- package/docs/{Development-Guide → Development}/Test.zh-CN.md +9 -1
- package/docs/Development/index.md +43 -0
- package/docs/{Development-Guide → Development}/index.zh-CN.md +6 -1
- package/docs/Home.md +38 -25
- package/docs/{Plugin-Development.md → Plugins/Plugin-Development.md} +1 -1
- package/docs/{Plugin-Development.zh-CN.md → Plugins/Plugin-Development.zh-CN.md} +1 -1
- package/docs/_Sidebar.md +31 -21
- package/locales/en_US/chat.json +1 -1
- package/locales/en_US/common.json +12 -12
- package/locales/fr_FR/common.json +13 -13
- package/locales/ja_JP/common.json +2 -2
- package/locales/ko_KR/common.json +2 -2
- package/locales/ru_RU/common.json +2 -2
- package/locales/zh_CN/common.json +1 -1
- package/locales/zh_TW/common.json +2 -2
- package/package.json +9 -2
- package/scripts/docsWorkflow/const.ts +14 -0
- package/scripts/docsWorkflow/index.ts +76 -0
- package/scripts/docsWorkflow/toc.ts +60 -0
- package/scripts/docsWorkflow/utils.ts +38 -0
- package/src/app/settings/features/UpgradeAlert.tsx +2 -2
- package/src/const/url.ts +1 -0
- package/src/const/version.ts +0 -3
- package/src/locales/default/common.ts +1 -1
- /package/docs/{Deploy-with-Azure-OpenAI.md → Deployment/Deploy-with-Azure-OpenAI.md} +0 -0
- /package/docs/{Deploy-with-Azure-OpenAI.zh-CN.md → Deployment/Deploy-with-Azure-OpenAI.zh-CN.md} +0 -0
- /package/docs/{Development-Guide → Development}/Folder-Structure.zh-CN.md +0 -0
- /package/docs/{Development-Guide → Development}/Resources.zh-CN.md +0 -0
- /package/docs/{Lighthouse.md → Others/Lighthouse.md} +0 -0
- /package/docs/{Lighthouse.zh-CN.md → Others/Lighthouse.zh-CN.md} +0 -0
- /package/docs/{Usage-Agents.md → Usage/Usage-Agents.md} +0 -0
- /package/docs/{Usage-Agents.zh-CN.md → Usage/Usage-Agents.zh-CN.md} +0 -0
- /package/docs/{Usage-Topics.md → Usage/Usage-Topics.md} +0 -0
- /package/docs/{Usage-Topics.zh-CN.md → Usage/Usage-Topics.zh-CN.md} +0 -0
package/locales/en_US/chat.json
CHANGED
|
@@ -7,24 +7,24 @@
|
|
|
7
7
|
"appInitializing": "LobeChat is initializing, please wait...",
|
|
8
8
|
"archive": "Archive",
|
|
9
9
|
"autoGenerate": "Auto Generate",
|
|
10
|
-
"autoGenerateTooltip": "Auto-generate
|
|
10
|
+
"autoGenerateTooltip": "Auto-generate agent description based on prompts",
|
|
11
11
|
"cancel": "Cancel",
|
|
12
12
|
"changelog": "Changelog",
|
|
13
13
|
"close": "Close",
|
|
14
|
-
"confirmRemoveSessionItemAlert": "You are about to delete this
|
|
14
|
+
"confirmRemoveSessionItemAlert": "You are about to delete this agent. Once deleted, it cannot be recovered. Please confirm your action.",
|
|
15
15
|
"copy": "Copy",
|
|
16
16
|
"copySuccess": "Copied successfully",
|
|
17
|
-
"defaultAgent": "Default
|
|
18
|
-
"defaultSession": "Default
|
|
17
|
+
"defaultAgent": "Default Agent",
|
|
18
|
+
"defaultSession": "Default Agent",
|
|
19
19
|
"delete": "Delete",
|
|
20
20
|
"edit": "Edit",
|
|
21
21
|
"export": "Export Configuration",
|
|
22
22
|
"exportType": {
|
|
23
|
-
"agent": "Export
|
|
24
|
-
"agentWithMessage": "Export
|
|
25
|
-
"all": "Export Global Settings and All
|
|
26
|
-
"allAgent": "Export All
|
|
27
|
-
"allAgentWithMessage": "Export All
|
|
23
|
+
"agent": "Export Agent Settings",
|
|
24
|
+
"agentWithMessage": "Export Agent and Messages",
|
|
25
|
+
"all": "Export Global Settings and All Agent Data",
|
|
26
|
+
"allAgent": "Export All Agent Settings",
|
|
27
|
+
"allAgentWithMessage": "Export All Agents and Messages",
|
|
28
28
|
"globalSetting": "Export Global Settings"
|
|
29
29
|
},
|
|
30
30
|
"feedback": "Feedback",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"added": "Imported successfully",
|
|
43
43
|
"errors": "Import errors",
|
|
44
44
|
"messages": "Messages",
|
|
45
|
-
"sessions": "
|
|
45
|
+
"sessions": "Agents",
|
|
46
46
|
"skips": "Duplicates skipped",
|
|
47
47
|
"topics": "Topics",
|
|
48
48
|
"type": "Data Type"
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"temp": "Temporary",
|
|
83
83
|
"updateAgent": "Update Agent Information",
|
|
84
84
|
"upgradeVersion": {
|
|
85
|
-
"action": "Upgrade Now",
|
|
86
85
|
"hasNew": "New update available",
|
|
87
|
-
"newVersion": "New version available: {{version}}"
|
|
86
|
+
"newVersion": "New version available: {{version}}",
|
|
87
|
+
"action": "Upgrade"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
"advanceSettings": "Paramètres avancés",
|
|
4
4
|
"agentMaxToken": "Longueur maximale de la session",
|
|
5
5
|
"agentModel": "Modèle",
|
|
6
|
-
"agentProfile": "Profil de l'
|
|
6
|
+
"agentProfile": "Profil de l'agent",
|
|
7
7
|
"appInitializing": "LobeChat est en cours de démarrage, veuillez patienter...",
|
|
8
8
|
"archive": "Archiver",
|
|
9
9
|
"autoGenerate": "Générer automatiquement",
|
|
10
|
-
"autoGenerateTooltip": "Générer automatiquement la description de l'
|
|
10
|
+
"autoGenerateTooltip": "Générer automatiquement la description de l'agent basée sur les suggestions",
|
|
11
11
|
"cancel": "Annuler",
|
|
12
12
|
"changelog": "Journal des modifications",
|
|
13
13
|
"close": "Fermer",
|
|
14
|
-
"confirmRemoveSessionItemAlert": "Vous êtes sur le point de supprimer cet
|
|
14
|
+
"confirmRemoveSessionItemAlert": "Vous êtes sur le point de supprimer cet agent. Une fois supprimé, il ne pourra pas être récupéré. Veuillez confirmer votre action.",
|
|
15
15
|
"copy": "Copier",
|
|
16
16
|
"copySuccess": "Copie réussie",
|
|
17
|
-
"defaultAgent": "
|
|
17
|
+
"defaultAgent": "Agent par défaut",
|
|
18
18
|
"defaultSession": "Session par défaut",
|
|
19
19
|
"delete": "Supprimer",
|
|
20
20
|
"edit": "Modifier",
|
|
21
21
|
"export": "Exporter",
|
|
22
22
|
"exportType": {
|
|
23
|
-
"agent": "Exporter les paramètres de l'
|
|
24
|
-
"agentWithMessage": "Exporter l'
|
|
25
|
-
"all": "Exporter les paramètres globaux et toutes les données des
|
|
26
|
-
"allAgent": "Exporter tous les paramètres de l'
|
|
27
|
-
"allAgentWithMessage": "Exporter tous les
|
|
23
|
+
"agent": "Exporter les paramètres de l'agent",
|
|
24
|
+
"agentWithMessage": "Exporter l'agent et les messages",
|
|
25
|
+
"all": "Exporter les paramètres globaux et toutes les données des agents",
|
|
26
|
+
"allAgent": "Exporter tous les paramètres de l'agent",
|
|
27
|
+
"allAgentWithMessage": "Exporter tous les agents et les messages",
|
|
28
28
|
"globalSetting": "Exporter les paramètres globaux"
|
|
29
29
|
},
|
|
30
30
|
"feedback": "Retour d'information et suggestions",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"added": "Importation réussie",
|
|
43
43
|
"errors": "Erreurs d'importation",
|
|
44
44
|
"messages": "Messages",
|
|
45
|
-
"sessions": "
|
|
45
|
+
"sessions": "Agents",
|
|
46
46
|
"skips": "Éléments ignorés en double",
|
|
47
47
|
"topics": "Sujets",
|
|
48
48
|
"type": "Type de données"
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"setting": "Paramètre"
|
|
81
81
|
},
|
|
82
82
|
"temp": "Temporaire",
|
|
83
|
-
"updateAgent": "Mettre à jour les informations de l'
|
|
83
|
+
"updateAgent": "Mettre à jour les informations de l'agent",
|
|
84
84
|
"upgradeVersion": {
|
|
85
|
-
"action": "Mettre à jour maintenant",
|
|
86
85
|
"hasNew": "Nouvelle mise à jour disponible",
|
|
87
|
-
"newVersion": "Nouvelle version disponible : {{version}}"
|
|
86
|
+
"newVersion": "Nouvelle version disponible : {{version}}",
|
|
87
|
+
"action": "Mettre à jour"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"temp": "一時的",
|
|
83
83
|
"updateAgent": "エージェント情報を更新",
|
|
84
84
|
"upgradeVersion": {
|
|
85
|
-
"action": "今すぐアップグレード",
|
|
86
85
|
"hasNew": "利用可能な更新があります",
|
|
87
|
-
"newVersion": "新しいバージョンが利用可能です:{{version}}"
|
|
86
|
+
"newVersion": "新しいバージョンが利用可能です:{{version}}",
|
|
87
|
+
"action": "アップグレード"
|
|
88
88
|
}
|
|
89
89
|
}
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"temp": "Временный",
|
|
83
83
|
"updateAgent": "Обновить информацию об агенте",
|
|
84
84
|
"upgradeVersion": {
|
|
85
|
-
"action": "Обновить сейчас",
|
|
86
85
|
"hasNew": "Доступно обновление",
|
|
87
|
-
"newVersion": "Доступна новая версия: {{version}}"
|
|
86
|
+
"newVersion": "Доступна новая версия: {{version}}",
|
|
87
|
+
"action": "обновить"
|
|
88
88
|
}
|
|
89
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.111.
|
|
3
|
+
"version": "0.111.6",
|
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"framework",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"build:analyze": "ANALYZE=true next build",
|
|
31
31
|
"build:docker": "DOCKER=true next build",
|
|
32
32
|
"dev": "next dev -p 3010",
|
|
33
|
+
"docs": "lobe-i18n md && npm run workflow:docs",
|
|
33
34
|
"i18n": "npm run workflow:i18n && lobe-i18n",
|
|
34
35
|
"lint": "npm run lint:ts && npm run lint:style && npm run type-check && npm run lint:circular",
|
|
35
36
|
"lint:circular": "dpdm src/**/*.ts --warning false --tree false --exit-code circular:1 -T true",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"test:coverage": "vitest run --coverage --passWithNoTests",
|
|
47
48
|
"test:update": "vitest -u",
|
|
48
49
|
"type-check": "tsc --noEmit",
|
|
50
|
+
"workflow:docs": "bun scripts/docsWorkflow/index.ts",
|
|
49
51
|
"workflow:i18n": "ts-node --project ./tsconfig.json scripts/i18nWorkflow/index.ts",
|
|
50
52
|
"workflow:readme": "bun scripts/readmeWorkflow/index.ts"
|
|
51
53
|
},
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
"@ant-design/icons": "^5",
|
|
73
75
|
"@icons-pack/react-simple-icons": "^9",
|
|
74
76
|
"@lobehub/chat-plugin-sdk": "latest",
|
|
75
|
-
"@lobehub/chat-plugins-gateway": "
|
|
77
|
+
"@lobehub/chat-plugins-gateway": "1.8.1",
|
|
76
78
|
"@lobehub/tts": "latest",
|
|
77
79
|
"@lobehub/ui": "latest",
|
|
78
80
|
"@vercel/analytics": "^1",
|
|
@@ -153,18 +155,23 @@
|
|
|
153
155
|
"dpdm": "^3",
|
|
154
156
|
"eslint": "^8",
|
|
155
157
|
"fake-indexeddb": "^5",
|
|
158
|
+
"glob": "^10",
|
|
156
159
|
"husky": "^8",
|
|
157
160
|
"jsdom": "^23.0.0",
|
|
158
161
|
"lint-staged": "^15",
|
|
159
162
|
"lodash": "^4",
|
|
160
163
|
"markdown-table": "^3",
|
|
161
164
|
"node-fetch": "^3",
|
|
165
|
+
"p-map": "^7",
|
|
162
166
|
"prettier": "^3",
|
|
163
167
|
"remark-cli": "^11",
|
|
168
|
+
"remark-parse": "^10",
|
|
164
169
|
"semantic-release": "^21",
|
|
165
170
|
"stylelint": "^15",
|
|
166
171
|
"ts-node": "^10",
|
|
167
172
|
"typescript": "^5",
|
|
173
|
+
"unified": "^11",
|
|
174
|
+
"unist-util-visit": "^5",
|
|
168
175
|
"vitest": "0.34.6"
|
|
169
176
|
},
|
|
170
177
|
"publishConfig": {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { globSync } from 'glob';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
|
|
4
|
+
export const WIKI_URL = 'https://github.com/lobehub/lobe-chat/wiki/';
|
|
5
|
+
export const ROOT = resolve(__dirname, '../..');
|
|
6
|
+
export const DOCS_DIR = resolve(ROOT, 'docs');
|
|
7
|
+
export const HOME_PATH = resolve(DOCS_DIR, 'Home.md');
|
|
8
|
+
export const SIDEBAR_PATH = resolve(DOCS_DIR, '_Sidebar.md');
|
|
9
|
+
export const docsFiles = globSync(resolve(DOCS_DIR, '**/*.md'), {
|
|
10
|
+
ignore: ['Home.md', '_Sidebar.md', '_Footer.md'],
|
|
11
|
+
nodir: true,
|
|
12
|
+
}).filter((file) => !file.includes('.zh-CN.md'));
|
|
13
|
+
|
|
14
|
+
export const SPLIT = '<!-- DOCS LIST -->';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { consola } from 'consola';
|
|
2
|
+
import { relative, resolve } from 'node:path';
|
|
3
|
+
import pMap from 'p-map';
|
|
4
|
+
import urlJoin from 'url-join';
|
|
5
|
+
|
|
6
|
+
import { DOCS_DIR, HOME_PATH, SIDEBAR_PATH, WIKI_URL, docsFiles } from './const';
|
|
7
|
+
import toc from './toc';
|
|
8
|
+
import { genMdLink, getTitle, updateDocs } from './utils';
|
|
9
|
+
|
|
10
|
+
const run = async () => {
|
|
11
|
+
consola.info(`Find ${docsFiles.length} entry doc files`);
|
|
12
|
+
const docs: any = await pMap(toc, async (item) => {
|
|
13
|
+
const childrenFiles = docsFiles.filter((file) => file.includes(resolve(DOCS_DIR, item.dir)));
|
|
14
|
+
|
|
15
|
+
const children: any = await pMap(childrenFiles, async (path) => {
|
|
16
|
+
const paths = {
|
|
17
|
+
cn: path.replace('.md', '.zh-CN.md'),
|
|
18
|
+
en: path,
|
|
19
|
+
};
|
|
20
|
+
const links = {
|
|
21
|
+
cn: urlJoin(
|
|
22
|
+
WIKI_URL,
|
|
23
|
+
relative(DOCS_DIR, paths.cn).split('/')[1].replace('.zh-CN.md', '.zh-CN'),
|
|
24
|
+
),
|
|
25
|
+
en: urlJoin(WIKI_URL, relative(DOCS_DIR, paths.en).split('/')[1].replace('.md', '')),
|
|
26
|
+
};
|
|
27
|
+
const titles = {
|
|
28
|
+
cn: await getTitle(paths.cn),
|
|
29
|
+
en: await getTitle(paths.en),
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
links,
|
|
33
|
+
paths,
|
|
34
|
+
titles,
|
|
35
|
+
};
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
children: children,
|
|
39
|
+
...item,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
let homeContent = '';
|
|
44
|
+
let sidebarContent = '';
|
|
45
|
+
|
|
46
|
+
docs.forEach((item: any) => {
|
|
47
|
+
homeContent += `### ${item.title}\n\n`;
|
|
48
|
+
sidebarContent += `#### ${item.title}\n\n`;
|
|
49
|
+
const data = [...(item.children || []), ...(item.extra || [])];
|
|
50
|
+
data
|
|
51
|
+
.sort((a, b) => {
|
|
52
|
+
if (a.links.en.includes('index')) return -1;
|
|
53
|
+
if (b.links.en.includes('index')) return 1;
|
|
54
|
+
return a.titles.en.localeCompare(b.titles.en);
|
|
55
|
+
})
|
|
56
|
+
.forEach((child: any) => {
|
|
57
|
+
homeContent += ` - ${genMdLink(child.titles.en, child.links.en)} | ${genMdLink(
|
|
58
|
+
child.titles.cn,
|
|
59
|
+
child.links.cn,
|
|
60
|
+
)}\n`;
|
|
61
|
+
sidebarContent += `- ${genMdLink(child.titles.en, child.links.en)} | ${genMdLink(
|
|
62
|
+
'中文',
|
|
63
|
+
child.links.cn,
|
|
64
|
+
)}\n`;
|
|
65
|
+
});
|
|
66
|
+
homeContent += `\n\n<br/>\n\n`;
|
|
67
|
+
sidebarContent += `\n\n`;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
updateDocs(HOME_PATH, homeContent);
|
|
71
|
+
consola.success(`Update Home.md`);
|
|
72
|
+
updateDocs(SIDEBAR_PATH, sidebarContent);
|
|
73
|
+
consola.success(`Update _Sidebar.md`);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
run();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export default [
|
|
2
|
+
{
|
|
3
|
+
dir: 'Usage',
|
|
4
|
+
title: '🤯 Usage',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
dir: 'Deployment',
|
|
8
|
+
title: '🛳 Self-Hosting',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
dir: 'Development',
|
|
12
|
+
title: '⌨️ Development',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
dir: 'Agents',
|
|
16
|
+
extra: [
|
|
17
|
+
{
|
|
18
|
+
links: {
|
|
19
|
+
cn: 'https://github.com/lobehub/lobe-chat-agents/blob/main/README.zh-CN.md',
|
|
20
|
+
en: 'https://github.com/lobehub/lobe-chat-agents',
|
|
21
|
+
},
|
|
22
|
+
titles: {
|
|
23
|
+
cn: '助手索引与提交',
|
|
24
|
+
en: 'Agent Index and Submit',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
title: '🤖 Agents',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
dir: 'Plugins',
|
|
32
|
+
extra: [
|
|
33
|
+
{
|
|
34
|
+
links: {
|
|
35
|
+
cn: 'https://chat-plugin-sdk.lobehub.com',
|
|
36
|
+
en: 'https://chat-plugin-sdk.lobehub.com',
|
|
37
|
+
},
|
|
38
|
+
titles: {
|
|
39
|
+
cn: '插件 SDK 文档',
|
|
40
|
+
en: 'Plugin SDK Docs',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
links: {
|
|
45
|
+
cn: 'https://github.com/lobehub/lobe-chat-plugins/blob/main/README.zh-CN.md',
|
|
46
|
+
en: 'https://github.com/lobehub/lobe-chat-plugins',
|
|
47
|
+
},
|
|
48
|
+
titles: {
|
|
49
|
+
cn: '插件索引与提交',
|
|
50
|
+
en: 'Plugin Index and Submit',
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
title: '🧩 Plugins',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
dir: 'Others',
|
|
58
|
+
title: '📊 Others',
|
|
59
|
+
},
|
|
60
|
+
];
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import remarkGfm from 'remark-gfm';
|
|
3
|
+
import remarkParse from 'remark-parse';
|
|
4
|
+
import { unified } from 'unified';
|
|
5
|
+
import { visit } from 'unist-util-visit';
|
|
6
|
+
|
|
7
|
+
import { SPLIT } from './const';
|
|
8
|
+
|
|
9
|
+
export const updateDocs = (path: string, content: string) => {
|
|
10
|
+
const md = readFileSync(path, 'utf8');
|
|
11
|
+
const mds = md.split(SPLIT);
|
|
12
|
+
mds[1] = [' ', content, ' '].join('\n\n');
|
|
13
|
+
const result = mds.join(SPLIT);
|
|
14
|
+
writeFileSync(path, result, 'utf8');
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const convertMarkdownToMdast = async (md: string) => {
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
return unified().use(remarkParse).use(remarkGfm).parse(md.trim());
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const getTitle = async (path: string) => {
|
|
23
|
+
const md = readFileSync(path, 'utf8');
|
|
24
|
+
const mdast: any = await convertMarkdownToMdast(md);
|
|
25
|
+
|
|
26
|
+
let title = '';
|
|
27
|
+
visit(mdast, 'heading', (node) => {
|
|
28
|
+
if (node.depth !== 1) return;
|
|
29
|
+
visit(node, 'text', (heading) => {
|
|
30
|
+
title += heading.value;
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
return title;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const genMdLink = (title: string, url: string) => {
|
|
37
|
+
return `[${title}](${url})`;
|
|
38
|
+
};
|
|
@@ -4,7 +4,7 @@ import Link from 'next/link';
|
|
|
4
4
|
import { memo } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
7
|
-
import { MANUAL_UPGRADE_URL } from '@/const/
|
|
7
|
+
import { MANUAL_UPGRADE_URL } from '@/const/url';
|
|
8
8
|
import { useGlobalStore } from '@/store/global';
|
|
9
9
|
|
|
10
10
|
const UpgradeAlert = memo(() => {
|
|
@@ -22,7 +22,7 @@ const UpgradeAlert = memo(() => {
|
|
|
22
22
|
</Link>
|
|
23
23
|
}
|
|
24
24
|
closable
|
|
25
|
-
message={
|
|
25
|
+
message={t('upgradeVersion.newVersion', { version: latestVersion })}
|
|
26
26
|
showIcon={false}
|
|
27
27
|
style={{ marginBottom: 6 }}
|
|
28
28
|
type={'info'}
|
package/src/const/url.ts
CHANGED
|
@@ -44,3 +44,4 @@ export const AGENTS_INDEX_GITHUB_ISSUE = urlJoin(AGENTS_INDEX_GITHUB, 'issues/ne
|
|
|
44
44
|
|
|
45
45
|
export const SESSION_CHAT_URL = (id: string = INBOX_SESSION_ID, mobile?: boolean) =>
|
|
46
46
|
mobile ? `/chat/mobile#session=${id}` : `/chat#session=${id}`;
|
|
47
|
+
export const MANUAL_UPGRADE_URL = 'https://github.com/lobehub/lobe-chat/wiki/Upstream-Sync';
|
package/src/const/version.ts
CHANGED
|
File without changes
|
/package/docs/{Deploy-with-Azure-OpenAI.zh-CN.md → Deployment/Deploy-with-Azure-OpenAI.zh-CN.md}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|