@lobehub/lobehub 2.0.0-next.97 → 2.0.0-next.98
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/.console-log-whitelist.json +14 -0
- package/.github/workflows/check-console-log.yml +117 -0
- package/.github/workflows/desktop-pr-build.yml +4 -4
- package/.github/workflows/release-desktop-beta.yml +4 -4
- package/.github/workflows/release.yml +1 -1
- package/.github/workflows/test.yml +5 -5
- package/CHANGELOG.md +33 -0
- package/changelog/v1.json +12 -0
- package/docs/development/database-schema.dbml +1 -0
- package/e2e/package.json +1 -1
- package/locales/ar/file.json +9 -11
- package/locales/bg-BG/file.json +8 -10
- package/locales/de-DE/file.json +9 -11
- package/locales/en-US/file.json +12 -14
- package/locales/es-ES/file.json +7 -9
- package/locales/fa-IR/file.json +9 -11
- package/locales/fr-FR/file.json +6 -8
- package/locales/it-IT/file.json +8 -10
- package/locales/ja-JP/file.json +10 -12
- package/locales/ko-KR/file.json +8 -10
- package/locales/nl-NL/file.json +8 -10
- package/locales/pl-PL/file.json +7 -9
- package/locales/pt-BR/file.json +7 -9
- package/locales/ru-RU/file.json +9 -11
- package/locales/tr-TR/file.json +8 -10
- package/locales/vi-VN/file.json +9 -11
- package/locales/zh-CN/file.json +10 -12
- package/locales/zh-TW/file.json +10 -12
- package/package.json +3 -2
- package/packages/database/migrations/0047_add_slug_document.sql +6 -0
- package/packages/database/migrations/meta/0047_snapshot.json +7891 -0
- package/packages/database/migrations/meta/_journal.json +7 -0
- package/packages/database/src/core/migrations.json +16 -7
- package/packages/database/src/models/document.ts +2 -2
- package/packages/database/src/schemas/file.ts +7 -1
- package/packages/model-bank/src/aiModels/qwen.ts +5 -3
- package/packages/model-runtime/src/core/openaiCompatibleFactory/index.ts +21 -21
- package/packages/obervability-otel/package.json +2 -2
- package/scripts/checkConsoleLog.mts +148 -0
- package/scripts/prebuild.mts +5 -5
- package/src/app/[variants]/(main)/changelog/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +20 -16
- package/src/app/[variants]/(main)/settings/provider/(list)/ProviderGrid/Card.tsx +6 -3
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +3 -2
- package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +14 -4
- package/src/app/[variants]/desktopRouter.config.tsx +23 -0
- package/src/app/[variants]/mobileRouter.config.tsx +23 -0
- package/src/features/KnowledgeManager/DocumentExplorer/NoteEditorModal.tsx +0 -20
- package/src/features/KnowledgeManager/DocumentExplorer/index.tsx +3 -3
- package/src/features/KnowledgeManager/FileExplorer/MasonryFileItem/index.tsx +0 -20
- package/src/features/KnowledgeManager/Header/AddButton.tsx +0 -1
- package/src/features/KnowledgeManager/Header/NewNoteButton.tsx +1 -1
- package/src/features/KnowledgeManager/Header/TogglePanelButton.tsx +2 -2
- package/src/features/KnowledgeManager/Home/UploadEntries.tsx +2 -2
- package/src/features/KnowledgeManager/Home/index.tsx +4 -4
- package/src/features/User/UserPanel/useMenu.tsx +7 -3
- package/src/locales/default/file.ts +11 -13
- package/src/store/chat/agents/__tests__/createAgentExecutors/helpers/testExecutor.ts +1 -4
|
@@ -228,7 +228,7 @@ const DocumentExplorer = memo<DocumentExplorerProps>(({ knowledgeBaseId, documen
|
|
|
228
228
|
<SearchBar
|
|
229
229
|
allowClear
|
|
230
230
|
onChange={(e) => setSearchKeywords(e.target.value)}
|
|
231
|
-
placeholder={t('
|
|
231
|
+
placeholder={t('searchPagePlaceholder')}
|
|
232
232
|
style={{ flex: 1 }}
|
|
233
233
|
value={searchKeywords}
|
|
234
234
|
variant={'borderless'}
|
|
@@ -236,7 +236,7 @@ const DocumentExplorer = memo<DocumentExplorerProps>(({ knowledgeBaseId, documen
|
|
|
236
236
|
<ActionIcon
|
|
237
237
|
icon={PlusIcon}
|
|
238
238
|
onClick={handleNewDocument}
|
|
239
|
-
title={t('header.
|
|
239
|
+
title={t('header.newPageButton')}
|
|
240
240
|
/>
|
|
241
241
|
</div>
|
|
242
242
|
<div className={styles.documentList}>
|
|
@@ -252,7 +252,7 @@ const DocumentExplorer = memo<DocumentExplorerProps>(({ knowledgeBaseId, documen
|
|
|
252
252
|
Footer: () => (
|
|
253
253
|
<Center style={{ paddingBlock: 16 }}>
|
|
254
254
|
<Text style={{ fontSize: 12 }} type={'secondary'}>
|
|
255
|
-
{t('documentList.
|
|
255
|
+
{t('documentList.pageCount', { count: filteredDocuments.length })}
|
|
256
256
|
</Text>
|
|
257
257
|
</Center>
|
|
258
258
|
),
|
|
@@ -177,19 +177,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
177
177
|
const isMarkdown = isMarkdownFile(name, fileType);
|
|
178
178
|
const isNote = isCustomNote(fileType);
|
|
179
179
|
|
|
180
|
-
// Debug: Log editorData for notes
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
if (isNote) {
|
|
183
|
-
console.log('[MasonryFileItem] Note item:', {
|
|
184
|
-
editorDataPreview: editorData ? JSON.stringify(editorData).slice(0, 100) : null,
|
|
185
|
-
editorDataType: typeof editorData,
|
|
186
|
-
hasEditorData: !!editorData,
|
|
187
|
-
id,
|
|
188
|
-
name,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
}, [isNote, id, name, editorData]);
|
|
192
|
-
|
|
193
180
|
const cardRef = useRef<HTMLDivElement>(null);
|
|
194
181
|
const [isInView, setIsInView] = useState(false);
|
|
195
182
|
|
|
@@ -288,12 +275,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
288
275
|
)}
|
|
289
276
|
onClick={() => {
|
|
290
277
|
if (isNote) {
|
|
291
|
-
console.log('[MasonryFileItem] Opening note modal with:', {
|
|
292
|
-
editorDataType: typeof editorData,
|
|
293
|
-
hasEditorData: !!editorData,
|
|
294
|
-
id,
|
|
295
|
-
name,
|
|
296
|
-
});
|
|
297
278
|
setIsNoteModalOpen(true);
|
|
298
279
|
} else {
|
|
299
280
|
onOpen(id);
|
|
@@ -384,7 +365,6 @@ const MasonryFileItem = memo<MasonryFileItemProps>(
|
|
|
384
365
|
editorData={editorData}
|
|
385
366
|
knowledgeBaseId={knowledgeBaseId}
|
|
386
367
|
onClose={() => {
|
|
387
|
-
console.log('[MasonryFileItem] Closing note modal');
|
|
388
368
|
setIsNoteModalOpen(false);
|
|
389
369
|
}}
|
|
390
370
|
open={isNoteModalOpen}
|
|
@@ -22,7 +22,7 @@ const NewNoteButton = ({ knowledgeBaseId }: { knowledgeBaseId?: string }) => {
|
|
|
22
22
|
return (
|
|
23
23
|
<>
|
|
24
24
|
<Button icon={FilePenLine} onClick={handleOpen} type="primary">
|
|
25
|
-
{t('header.
|
|
25
|
+
{t('header.newPageButton')}
|
|
26
26
|
</Button>
|
|
27
27
|
|
|
28
28
|
<NoteEditorModal knowledgeBaseId={knowledgeBaseId} onClose={handleClose} open={isModalOpen} />
|
|
@@ -17,13 +17,13 @@ export const TOOGLE_PANEL_BUTTON_ID = 'toggle-panel-button';
|
|
|
17
17
|
const TogglePanelButton = memo(() => {
|
|
18
18
|
const hotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.ToggleLeftPanel));
|
|
19
19
|
|
|
20
|
-
const { t } = useTranslation(['file'
|
|
20
|
+
const { t } = useTranslation(['file']);
|
|
21
21
|
|
|
22
22
|
const showFilePanel = useGlobalStore(systemStatusSelectors.showFilePanel);
|
|
23
23
|
const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
|
|
24
24
|
|
|
25
25
|
return (
|
|
26
|
-
<Tooltip hotkey={hotkey} title={t('toggleLeftPanel
|
|
26
|
+
<Tooltip hotkey={hotkey} title={t('toggleLeftPanel')}>
|
|
27
27
|
<ActionIcon
|
|
28
28
|
icon={showFilePanel ? PanelLeftClose : PanelLeftOpen}
|
|
29
29
|
id={TOOGLE_PANEL_BUTTON_ID}
|
|
@@ -97,7 +97,7 @@ const UploadEntries = memo<UploadEntriesProps>(({ knowledgeBaseId }) => {
|
|
|
97
97
|
const newDoc = await createDocument({
|
|
98
98
|
content: '',
|
|
99
99
|
knowledgeBaseId,
|
|
100
|
-
title: t('home.uploadEntries.
|
|
100
|
+
title: t('home.uploadEntries.newPage.title'),
|
|
101
101
|
});
|
|
102
102
|
// Navigate to the newly created document
|
|
103
103
|
// The KnowledgeHomePage will automatically set category to 'documents' when it detects the id param
|
|
@@ -137,7 +137,7 @@ const UploadEntries = memo<UploadEntriesProps>(({ knowledgeBaseId }) => {
|
|
|
137
137
|
<div className={styles.grid}>
|
|
138
138
|
{/* Create New Note */}
|
|
139
139
|
<Flexbox className={styles.card} onClick={handleCreateNote} padding={16}>
|
|
140
|
-
<span className={styles.actionTitle}>{t('home.uploadEntries.
|
|
140
|
+
<span className={styles.actionTitle}>{t('home.uploadEntries.newPage.title')}</span>
|
|
141
141
|
<div className={styles.glow} style={{ background: theme.purple }} />
|
|
142
142
|
<FileTypeIcon
|
|
143
143
|
className={styles.icon}
|
|
@@ -165,7 +165,7 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
165
165
|
</div>
|
|
166
166
|
)}
|
|
167
167
|
|
|
168
|
-
{/* Recent
|
|
168
|
+
{/* Recent Pages Section */}
|
|
169
169
|
{(isLoading || topRecentDocuments.length > 0) && (
|
|
170
170
|
<div
|
|
171
171
|
className={styles.section}
|
|
@@ -179,7 +179,7 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
179
179
|
<div className={styles.sectionTitleWrapper}>
|
|
180
180
|
<Text className={styles.sectionTitle} style={{ marginBottom: 0 }}>
|
|
181
181
|
<FileTextIcon size={18} />
|
|
182
|
-
{t('home.
|
|
182
|
+
{t('home.recentPages')}
|
|
183
183
|
</Text>
|
|
184
184
|
<div
|
|
185
185
|
className={styles.sectionActions}
|
|
@@ -192,9 +192,9 @@ const Home = memo<HomeProps>(({ knowledgeBaseId, onOpenFile }) => {
|
|
|
192
192
|
items: [
|
|
193
193
|
{
|
|
194
194
|
key: 'all-documents',
|
|
195
|
-
label: t('menu.
|
|
195
|
+
label: t('menu.allPages'),
|
|
196
196
|
onClick: () => {
|
|
197
|
-
setActiveKey(FilesTabs.
|
|
197
|
+
setActiveKey(FilesTabs.Pages);
|
|
198
198
|
},
|
|
199
199
|
},
|
|
200
200
|
],
|
|
@@ -17,8 +17,8 @@ import {
|
|
|
17
17
|
} from 'lucide-react';
|
|
18
18
|
import { PropsWithChildren, memo } from 'react';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
|
-
import { Link } from 'react-router-dom';
|
|
21
20
|
import { Flexbox } from 'react-layout-kit';
|
|
21
|
+
import { Link } from 'react-router-dom';
|
|
22
22
|
|
|
23
23
|
import type { MenuProps } from '@/components/Menu';
|
|
24
24
|
import { enableAuth } from '@/const/auth';
|
|
@@ -135,7 +135,11 @@ export const useMenu = () => {
|
|
|
135
135
|
icon: <Icon icon={Cloudy} />,
|
|
136
136
|
key: 'cloud',
|
|
137
137
|
label: (
|
|
138
|
-
<a
|
|
138
|
+
<a
|
|
139
|
+
href={`${OFFICIAL_URL}?utm_source=${UTM_SOURCE}`}
|
|
140
|
+
rel="noopener noreferrer"
|
|
141
|
+
target="_blank"
|
|
142
|
+
>
|
|
139
143
|
{t('userPanel.cloud', { name: LOBE_CHAT_CLOUD })}
|
|
140
144
|
</a>
|
|
141
145
|
),
|
|
@@ -148,7 +152,7 @@ export const useMenu = () => {
|
|
|
148
152
|
{t('changelog')}
|
|
149
153
|
</a>
|
|
150
154
|
) : (
|
|
151
|
-
<Link to="/changelog
|
|
155
|
+
<Link to="/changelog">{t('changelog')}</Link>
|
|
152
156
|
),
|
|
153
157
|
},
|
|
154
158
|
{
|
|
@@ -55,11 +55,11 @@ export default {
|
|
|
55
55
|
},
|
|
56
56
|
documentList: {
|
|
57
57
|
copyContent: '复制全文',
|
|
58
|
-
documentCount: '共 {{count}} 个文档',
|
|
59
58
|
duplicate: '创建副本',
|
|
60
|
-
empty: '
|
|
61
|
-
noResults: '
|
|
62
|
-
|
|
59
|
+
empty: '暂无文稿,点击上方按钮创建你的第一篇文稿',
|
|
60
|
+
noResults: '未找到匹配的文稿',
|
|
61
|
+
pageCount: '共 {{count}} 个文稿',
|
|
62
|
+
selectNote: '选择一个文稿开始编辑',
|
|
63
63
|
untitled: '无标题',
|
|
64
64
|
},
|
|
65
65
|
empty: '暂无已上传文件/文件夹',
|
|
@@ -70,7 +70,6 @@ export default {
|
|
|
70
70
|
uploadFile: '上传文件',
|
|
71
71
|
uploadFolder: '上传文件夹',
|
|
72
72
|
},
|
|
73
|
-
newDocumentButton: '新建文档',
|
|
74
73
|
newNoteDialog: {
|
|
75
74
|
cancel: '取消',
|
|
76
75
|
editTitle: '编辑文档',
|
|
@@ -83,14 +82,15 @@ export default {
|
|
|
83
82
|
title: '新建文档',
|
|
84
83
|
updateSuccess: '文档更新成功',
|
|
85
84
|
},
|
|
85
|
+
newPageButton: '新建文稿',
|
|
86
86
|
uploadButton: '上传',
|
|
87
87
|
},
|
|
88
88
|
home: {
|
|
89
89
|
getStarted: '开始使用',
|
|
90
90
|
greeting: '开始',
|
|
91
91
|
quickActions: '快捷操作',
|
|
92
|
-
recentDocuments: '最近文档',
|
|
93
92
|
recentFiles: '最近文件',
|
|
93
|
+
recentPages: '最近文稿',
|
|
94
94
|
subtitle: '欢迎使用知识库,从这里开始管理你的文档和文档',
|
|
95
95
|
uploadEntries: {
|
|
96
96
|
files: {
|
|
@@ -102,8 +102,8 @@ export default {
|
|
|
102
102
|
knowledgeBase: {
|
|
103
103
|
title: '新建知识库',
|
|
104
104
|
},
|
|
105
|
-
|
|
106
|
-
title: '
|
|
105
|
+
newPage: {
|
|
106
|
+
title: '新建文稿',
|
|
107
107
|
},
|
|
108
108
|
},
|
|
109
109
|
},
|
|
@@ -117,8 +117,8 @@ export default {
|
|
|
117
117
|
title: '知识库',
|
|
118
118
|
},
|
|
119
119
|
menu: {
|
|
120
|
-
allDocuments: '全部文档',
|
|
121
120
|
allFiles: '全部文件',
|
|
121
|
+
allPages: '全部文稿',
|
|
122
122
|
},
|
|
123
123
|
networkError: '获取知识库失败,请检测网络连接后重试',
|
|
124
124
|
notSupportGuide: {
|
|
@@ -143,8 +143,8 @@ export default {
|
|
|
143
143
|
downloadFile: '下载文件',
|
|
144
144
|
unsupportedFileAndContact: '此文件格式暂不支持在线预览,如有预览诉求,欢迎<1>反馈给我们</1>',
|
|
145
145
|
},
|
|
146
|
-
searchDocumentPlaceholder: '搜索文档',
|
|
147
146
|
searchFilePlaceholder: '搜索文件',
|
|
147
|
+
searchPagePlaceholder: '搜索文稿',
|
|
148
148
|
tab: {
|
|
149
149
|
all: '全部',
|
|
150
150
|
audios: '语音',
|
|
@@ -157,9 +157,7 @@ export default {
|
|
|
157
157
|
websites: '网页',
|
|
158
158
|
},
|
|
159
159
|
title: '知识库',
|
|
160
|
-
toggleLeftPanel:
|
|
161
|
-
title: '显示/隐藏左侧面板',
|
|
162
|
-
},
|
|
160
|
+
toggleLeftPanel: '显示/隐藏左侧面板',
|
|
163
161
|
uploadDock: {
|
|
164
162
|
body: {
|
|
165
163
|
collapse: '收起',
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
AgentInstruction,
|
|
3
|
-
AgentState,
|
|
4
|
-
} from '@lobechat/agent-runtime';
|
|
1
|
+
import type { AgentInstruction, AgentState } from '@lobechat/agent-runtime';
|
|
5
2
|
|
|
6
3
|
import { createAgentExecutors } from '@/store/chat/agents/createAgentExecutors';
|
|
7
4
|
import type { OperationType } from '@/store/chat/slices/operation/types';
|