@lobehub/lobehub 2.0.0-next.232 → 2.0.0-next.234
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/.github/workflows/bundle-analyzer.yml +1 -1
- package/.github/workflows/e2e.yml +62 -53
- package/.github/workflows/manual-build-desktop.yml +5 -5
- package/.github/workflows/pr-build-desktop.yml +4 -4
- package/.github/workflows/pr-build-docker.yml +2 -2
- package/.github/workflows/release-desktop-beta.yml +4 -4
- package/.github/workflows/release-docker.yml +2 -2
- package/.github/workflows/test.yml +44 -7
- package/CHANGELOG.md +59 -0
- package/CLAUDE.md +1 -1
- package/changelog/v1.json +14 -0
- package/docs/development/basic/feature-development.mdx +4 -5
- package/docs/development/basic/feature-development.zh-CN.mdx +4 -5
- package/docs/self-hosting/environment-variables/auth.mdx +7 -0
- package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +7 -0
- package/e2e/README.md +6 -6
- package/e2e/src/features/community/detail-pages.feature +9 -9
- package/e2e/src/features/community/interactions.feature +13 -13
- package/e2e/src/features/community/smoke.feature +6 -6
- package/e2e/src/steps/agent/conversation-mgmt.steps.ts +196 -25
- package/e2e/src/steps/agent/conversation.steps.ts +58 -0
- package/e2e/src/steps/agent/message-ops.steps.ts +20 -15
- package/e2e/src/steps/community/detail-pages.steps.ts +60 -19
- package/e2e/src/steps/community/interactions.steps.ts +145 -32
- package/e2e/src/steps/hooks.ts +12 -2
- package/locales/en-US/setting.json +3 -0
- package/locales/zh-CN/file.json +4 -0
- package/locales/zh-CN/setting.json +3 -0
- package/package.json +5 -5
- package/packages/business/config/src/llm.ts +6 -1
- package/packages/const/src/index.ts +1 -0
- package/packages/const/src/lobehubSkill.ts +55 -0
- package/packages/const/src/settings/image.ts +1 -1
- package/packages/model-bank/src/aiModels/azure.ts +2 -2
- package/packages/model-bank/src/aiModels/google.ts +1 -0
- package/packages/model-bank/src/aiModels/lobehub.ts +33 -13
- package/packages/model-bank/src/aiModels/openai.ts +21 -4
- package/packages/model-runtime/src/core/openaiCompatibleFactory/createImage.ts +4 -1
- package/packages/model-runtime/src/providers/openai/__snapshots__/index.test.ts.snap +1 -1
- package/packages/ssrf-safe-fetch/index.test.ts +5 -34
- package/packages/ssrf-safe-fetch/index.ts +12 -2
- package/packages/types/package.json +1 -1
- package/packages/types/src/files/upload.ts +11 -1
- package/packages/types/src/message/common/tools.ts +1 -1
- package/packages/types/src/serverConfig.ts +1 -0
- package/public/not-compatible.html +1296 -0
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx +3 -3
- package/src/app/[variants]/(main)/image/features/GenerationFeed/index.tsx +3 -10
- package/src/app/[variants]/(main)/image/index.tsx +1 -1
- package/src/app/[variants]/(main)/resource/features/FileDetail.tsx +20 -12
- package/src/app/[variants]/(main)/resource/features/modal/FullscreenModal.tsx +2 -4
- package/src/app/[variants]/layout.tsx +50 -1
- package/src/envs/auth.ts +15 -0
- package/src/features/ChatInput/ActionBar/Tools/LobehubSkillServerItem.tsx +304 -0
- package/src/features/ChatInput/ActionBar/Tools/useControls.tsx +74 -10
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Inspector/ToolTitle.tsx +9 -0
- package/src/features/FileViewer/Renderer/Code/index.tsx +224 -0
- package/src/features/FileViewer/Renderer/Image/index.tsx +8 -1
- package/src/features/FileViewer/Renderer/PDF/index.tsx +3 -1
- package/src/features/FileViewer/Renderer/PDF/style.ts +2 -1
- package/src/features/FileViewer/index.tsx +135 -24
- package/src/features/PageEditor/EditorCanvas/useSlashItems.tsx +7 -4
- package/src/features/PageEditor/store/initialState.ts +2 -1
- package/src/features/ResourceManager/components/Editor/FileContent.tsx +1 -4
- package/src/features/ResourceManager/components/Editor/FileCopilot.tsx +64 -0
- package/src/features/ResourceManager/components/Editor/index.tsx +98 -31
- package/src/features/ResourceManager/components/Explorer/ItemDropdown/useFileItemDropdown.tsx +3 -2
- package/src/features/ResourceManager/components/Explorer/ListView/ColumnResizeHandle.tsx +119 -0
- package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +67 -22
- package/src/features/ResourceManager/components/Explorer/ListView/Skeleton.tsx +46 -11
- package/src/features/ResourceManager/components/Explorer/ListView/index.tsx +140 -81
- package/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx +20 -12
- package/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx +18 -10
- package/src/features/ResourceManager/components/UploadDock/Item.tsx +38 -6
- package/src/features/ResourceManager/components/UploadDock/index.tsx +62 -41
- package/src/features/ResourceManager/index.tsx +1 -0
- package/src/helpers/toolEngineering/index.test.ts +3 -0
- package/src/helpers/toolEngineering/index.ts +12 -1
- package/src/hooks/useFetchAiImageConfig.ts +54 -10
- package/src/libs/trpc/utils/internalJwt.ts +2 -2
- package/src/locales/default/file.ts +4 -0
- package/src/locales/default/setting.ts +3 -0
- package/src/server/globalConfig/index.ts +1 -0
- package/src/server/modules/ModelRuntime/index.test.ts +214 -1
- package/src/server/modules/ModelRuntime/index.ts +43 -7
- package/src/server/routers/lambda/document.ts +44 -0
- package/src/server/routers/tools/market.ts +261 -0
- package/src/server/services/document/index.ts +22 -0
- package/src/services/document/index.ts +4 -0
- package/src/services/upload.ts +22 -2
- package/src/store/chat/slices/plugin/actions/internals.ts +15 -2
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +104 -0
- package/src/store/file/slices/fileManager/action.test.ts +9 -3
- package/src/store/file/slices/fileManager/action.ts +165 -70
- package/src/store/file/slices/upload/action.ts +3 -0
- package/src/store/global/actions/general.ts +15 -0
- package/src/store/global/initialState.ts +13 -0
- package/src/store/image/slices/generationConfig/initialState.ts +5 -5
- package/src/store/image/slices/generationConfig/selectors.test.ts +11 -4
- package/src/store/serverConfig/selectors.ts +1 -0
- package/src/store/tool/initialState.ts +11 -2
- package/src/store/tool/selectors/index.ts +1 -0
- package/src/store/tool/selectors/tool.ts +3 -1
- package/src/store/tool/slices/lobehubSkillStore/action.ts +361 -0
- package/src/store/tool/slices/lobehubSkillStore/index.ts +4 -0
- package/src/store/tool/slices/lobehubSkillStore/initialState.ts +24 -0
- package/src/store/tool/slices/lobehubSkillStore/selectors.ts +145 -0
- package/src/store/tool/slices/lobehubSkillStore/types.ts +100 -0
- package/src/store/tool/store.ts +8 -2
- package/vitest.config.mts +11 -6
- package/src/features/FileViewer/Renderer/JavaScript/index.tsx +0 -66
- package/src/features/FileViewer/Renderer/TXT/index.tsx +0 -50
package/vitest.config.mts
CHANGED
|
@@ -2,6 +2,10 @@ import { dirname, join, resolve } from 'node:path';
|
|
|
2
2
|
import { coverageConfigDefaults, defineConfig } from 'vitest/config';
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
|
+
optimizeDeps: {
|
|
6
|
+
exclude: ['crypto', 'util', 'tty'],
|
|
7
|
+
include: ['@lobehub/tts'],
|
|
8
|
+
},
|
|
5
9
|
plugins: [
|
|
6
10
|
/**
|
|
7
11
|
* @lobehub/fluent-emoji@4.0.0 ships `es/FluentEmoji/style.js` but its `es/FluentEmoji/index.js`
|
|
@@ -27,16 +31,13 @@ export default defineConfig({
|
|
|
27
31
|
id.endsWith('/FluentEmoji/style/index.js') ||
|
|
28
32
|
id.endsWith('/FluentEmoji/style/index.js?');
|
|
29
33
|
|
|
30
|
-
if (isFluentEmojiEntry && isMissingStyleIndex)
|
|
34
|
+
if (isFluentEmojiEntry && isMissingStyleIndex)
|
|
35
|
+
return resolve(dirname(importer), 'style.js');
|
|
31
36
|
|
|
32
37
|
return null;
|
|
33
38
|
},
|
|
34
39
|
},
|
|
35
40
|
],
|
|
36
|
-
optimizeDeps: {
|
|
37
|
-
exclude: ['crypto', 'util', 'tty'],
|
|
38
|
-
include: ['@lobehub/tts'],
|
|
39
|
-
},
|
|
40
41
|
test: {
|
|
41
42
|
alias: {
|
|
42
43
|
/* eslint-disable sort-keys-fix/sort-keys-fix */
|
|
@@ -77,17 +78,21 @@ export default defineConfig({
|
|
|
77
78
|
environment: 'happy-dom',
|
|
78
79
|
exclude: [
|
|
79
80
|
'**/node_modules/**',
|
|
81
|
+
'**/.*/**',
|
|
80
82
|
'**/dist/**',
|
|
81
83
|
'**/build/**',
|
|
82
84
|
'**/tmp/**',
|
|
83
85
|
'**/temp/**',
|
|
84
|
-
'
|
|
86
|
+
'**/docs/**',
|
|
87
|
+
'**/locales/**',
|
|
88
|
+
'**/public/**',
|
|
85
89
|
'**/apps/desktop/**',
|
|
86
90
|
'**/apps/mobile/**',
|
|
87
91
|
'**/packages/**',
|
|
88
92
|
'**/e2e/**',
|
|
89
93
|
],
|
|
90
94
|
globals: true,
|
|
95
|
+
reporters: ['default', 'blob'],
|
|
91
96
|
server: {
|
|
92
97
|
deps: {
|
|
93
98
|
inline: ['vitest-canvas-mock', '@lobehub/ui', '@lobehub/fluent-emoji'],
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Center, Flexbox, Highlighter } from '@lobehub/ui';
|
|
4
|
-
import { createStaticStyles } from 'antd-style';
|
|
5
|
-
import { memo } from 'react';
|
|
6
|
-
|
|
7
|
-
import CircleLoading from '@/components/Loading/CircleLoading';
|
|
8
|
-
|
|
9
|
-
import { useTextFileLoader } from '../../hooks/useTextFileLoader';
|
|
10
|
-
|
|
11
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
12
|
-
page: css`
|
|
13
|
-
width: 100%;
|
|
14
|
-
padding: 24px;
|
|
15
|
-
border-radius: 4px;
|
|
16
|
-
|
|
17
|
-
background: ${cssVar.colorBgContainer};
|
|
18
|
-
box-shadow: ${cssVar.boxShadowTertiary};
|
|
19
|
-
`,
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
const getLanguage = (fileName?: string): string => {
|
|
23
|
-
if (!fileName) return 'javascript';
|
|
24
|
-
const ext = fileName.toLowerCase().split('.').pop();
|
|
25
|
-
switch (ext) {
|
|
26
|
-
case 'ts': {
|
|
27
|
-
return 'typescript';
|
|
28
|
-
}
|
|
29
|
-
case 'tsx': {
|
|
30
|
-
return 'tsx';
|
|
31
|
-
}
|
|
32
|
-
case 'jsx': {
|
|
33
|
-
return 'jsx';
|
|
34
|
-
}
|
|
35
|
-
default: {
|
|
36
|
-
return 'javascript';
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
interface JavaScriptViewerProps {
|
|
42
|
-
fileId: string;
|
|
43
|
-
fileName?: string;
|
|
44
|
-
url: string | null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const JavaScriptViewer = memo<JavaScriptViewerProps>(({ url, fileName }) => {
|
|
48
|
-
const { fileData, loading } = useTextFileLoader(url);
|
|
49
|
-
const language = getLanguage(fileName);
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<Flexbox className={styles.page} id="javascript-renderer">
|
|
53
|
-
{!loading && fileData ? (
|
|
54
|
-
<Highlighter language={language} showLanguage={false} variant={'borderless'}>
|
|
55
|
-
{fileData}
|
|
56
|
-
</Highlighter>
|
|
57
|
-
) : (
|
|
58
|
-
<Center height={'100%'}>
|
|
59
|
-
<CircleLoading />
|
|
60
|
-
</Center>
|
|
61
|
-
)}
|
|
62
|
-
</Flexbox>
|
|
63
|
-
);
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export default JavaScriptViewer;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Center, Flexbox, Highlighter } from '@lobehub/ui';
|
|
4
|
-
import { createStaticStyles } from 'antd-style';
|
|
5
|
-
import { memo } from 'react';
|
|
6
|
-
|
|
7
|
-
import CircleLoading from '@/components/Loading/CircleLoading';
|
|
8
|
-
|
|
9
|
-
import { useTextFileLoader } from '../../hooks/useTextFileLoader';
|
|
10
|
-
|
|
11
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
12
|
-
page: css`
|
|
13
|
-
width: 100%;
|
|
14
|
-
padding: 24px;
|
|
15
|
-
border-radius: 4px;
|
|
16
|
-
|
|
17
|
-
background: ${cssVar.colorBgContainer};
|
|
18
|
-
box-shadow: ${cssVar.boxShadowTertiary};
|
|
19
|
-
`,
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
interface TXTViewerProps {
|
|
23
|
-
fileId: string;
|
|
24
|
-
url: string | null;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const TXTViewer = memo<TXTViewerProps>(({ url }) => {
|
|
28
|
-
const { fileData, loading } = useTextFileLoader(url);
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Flexbox className={styles.page} id="txt-renderer">
|
|
32
|
-
{!loading && fileData ? (
|
|
33
|
-
<Highlighter
|
|
34
|
-
language={'txt'}
|
|
35
|
-
showLanguage={false}
|
|
36
|
-
style={{ height: '100%' }}
|
|
37
|
-
variant={'borderless'}
|
|
38
|
-
>
|
|
39
|
-
{fileData}
|
|
40
|
-
</Highlighter>
|
|
41
|
-
) : (
|
|
42
|
-
<Center height={'100%'}>
|
|
43
|
-
<CircleLoading />
|
|
44
|
-
</Center>
|
|
45
|
-
)}
|
|
46
|
-
</Flexbox>
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export default TXTViewer;
|