@lobehub/chat 1.114.6 → 1.116.0
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/.cursor/rules/add-provider-doc.mdc +183 -0
- package/.cursor/rules/project-introduce.mdc +1 -15
- package/.cursor/rules/project-structure.mdc +227 -0
- package/.cursor/rules/testing-guide/db-model-test.mdc +5 -3
- package/.cursor/rules/testing-guide/testing-guide.mdc +153 -168
- package/.env.example +8 -0
- package/.github/workflows/claude.yml +1 -1
- package/.github/workflows/release.yml +3 -3
- package/.github/workflows/test.yml +10 -5
- package/CHANGELOG.md +50 -0
- package/CLAUDE.md +17 -33
- package/Dockerfile +5 -1
- package/Dockerfile.database +5 -1
- package/Dockerfile.pglite +5 -1
- package/changelog/v1.json +14 -0
- package/docs/development/basic/feature-development.mdx +1 -1
- package/docs/development/basic/feature-development.zh-CN.mdx +1 -1
- package/docs/development/basic/setup-development.mdx +10 -13
- package/docs/development/basic/setup-development.zh-CN.mdx +9 -12
- package/docs/self-hosting/environment-variables/model-provider.mdx +27 -2
- package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +27 -2
- package/docs/usage/providers/bfl.mdx +68 -0
- package/docs/usage/providers/bfl.zh-CN.mdx +67 -0
- package/locales/ar/components.json +11 -0
- package/locales/ar/error.json +11 -0
- package/locales/ar/models.json +64 -4
- package/locales/ar/providers.json +3 -0
- package/locales/bg-BG/components.json +11 -0
- package/locales/bg-BG/error.json +11 -0
- package/locales/bg-BG/models.json +64 -4
- package/locales/bg-BG/providers.json +3 -0
- package/locales/de-DE/components.json +11 -0
- package/locales/de-DE/error.json +11 -12
- package/locales/de-DE/models.json +64 -4
- package/locales/de-DE/providers.json +3 -0
- package/locales/en-US/components.json +6 -0
- package/locales/en-US/error.json +11 -12
- package/locales/en-US/models.json +64 -4
- package/locales/en-US/providers.json +3 -0
- package/locales/es-ES/components.json +11 -0
- package/locales/es-ES/error.json +11 -0
- package/locales/es-ES/models.json +64 -6
- package/locales/es-ES/providers.json +3 -0
- package/locales/fa-IR/components.json +11 -0
- package/locales/fa-IR/error.json +11 -0
- package/locales/fa-IR/models.json +64 -4
- package/locales/fa-IR/providers.json +3 -0
- package/locales/fr-FR/components.json +11 -0
- package/locales/fr-FR/error.json +11 -12
- package/locales/fr-FR/models.json +64 -4
- package/locales/fr-FR/providers.json +3 -0
- package/locales/it-IT/components.json +11 -0
- package/locales/it-IT/error.json +11 -0
- package/locales/it-IT/models.json +64 -4
- package/locales/it-IT/providers.json +3 -0
- package/locales/ja-JP/components.json +11 -0
- package/locales/ja-JP/error.json +11 -12
- package/locales/ja-JP/models.json +64 -4
- package/locales/ja-JP/providers.json +3 -0
- package/locales/ko-KR/components.json +11 -0
- package/locales/ko-KR/error.json +11 -12
- package/locales/ko-KR/models.json +64 -6
- package/locales/ko-KR/providers.json +3 -0
- package/locales/nl-NL/components.json +11 -0
- package/locales/nl-NL/error.json +11 -0
- package/locales/nl-NL/models.json +62 -4
- package/locales/nl-NL/providers.json +3 -0
- package/locales/pl-PL/components.json +11 -0
- package/locales/pl-PL/error.json +11 -0
- package/locales/pl-PL/models.json +64 -4
- package/locales/pl-PL/providers.json +3 -0
- package/locales/pt-BR/components.json +11 -0
- package/locales/pt-BR/error.json +11 -0
- package/locales/pt-BR/models.json +64 -4
- package/locales/pt-BR/providers.json +3 -0
- package/locales/ru-RU/components.json +11 -0
- package/locales/ru-RU/error.json +11 -0
- package/locales/ru-RU/models.json +64 -4
- package/locales/ru-RU/providers.json +3 -0
- package/locales/tr-TR/components.json +11 -0
- package/locales/tr-TR/error.json +11 -0
- package/locales/tr-TR/models.json +64 -4
- package/locales/tr-TR/providers.json +3 -0
- package/locales/vi-VN/components.json +11 -0
- package/locales/vi-VN/error.json +11 -0
- package/locales/vi-VN/models.json +64 -4
- package/locales/vi-VN/providers.json +3 -0
- package/locales/zh-CN/components.json +6 -0
- package/locales/zh-CN/error.json +11 -0
- package/locales/zh-CN/models.json +64 -4
- package/locales/zh-CN/providers.json +3 -0
- package/locales/zh-TW/components.json +11 -0
- package/locales/zh-TW/error.json +11 -12
- package/locales/zh-TW/models.json +64 -6
- package/locales/zh-TW/providers.json +3 -0
- package/package.json +4 -4
- package/packages/const/src/image.ts +28 -0
- package/packages/const/src/index.ts +1 -0
- package/packages/database/package.json +4 -2
- package/packages/database/src/repositories/aiInfra/index.ts +1 -1
- package/packages/database/tests/setup-db.ts +3 -0
- package/packages/database/vitest.config.mts +33 -0
- package/packages/model-runtime/src/google/index.ts +3 -0
- package/packages/model-runtime/src/qwen/createImage.test.ts +0 -19
- package/packages/model-runtime/src/qwen/createImage.ts +1 -27
- package/packages/model-runtime/src/utils/modelParse.ts +1 -1
- package/packages/model-runtime/src/utils/streams/google-ai.ts +26 -14
- package/packages/types/src/aiModel.ts +2 -1
- package/packages/utils/src/client/imageDimensions.test.ts +95 -0
- package/packages/utils/src/client/imageDimensions.ts +54 -0
- package/packages/utils/src/number.test.ts +3 -1
- package/packages/utils/src/number.ts +1 -2
- package/src/app/[variants]/(main)/image/@menu/components/SeedNumberInput/index.tsx +1 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/DimensionControlGroup.tsx +0 -1
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUpload.tsx +16 -6
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrl.tsx +14 -2
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ImageUrlsUpload.tsx +27 -2
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/MultiImagesUpload/index.tsx +23 -5
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/hooks/useAutoDimensions.ts +56 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/index.tsx +82 -5
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/__tests__/dimensionConstraints.test.ts +235 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/__tests__/imageValidation.test.ts +401 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/utils/dimensionConstraints.ts +54 -0
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItem.tsx +3 -1
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicList.tsx +15 -2
- package/src/app/[variants]/(main)/image/features/GenerationFeed/GenerationItem/utils.ts +5 -4
- package/src/config/aiModels/google.ts +22 -1
- package/src/config/aiModels/qwen.ts +2 -2
- package/src/config/aiModels/vertexai.ts +22 -0
- package/src/libs/standard-parameters/index.ts +1 -1
- package/src/server/services/generation/index.ts +1 -1
- package/src/store/chat/slices/builtinTool/actions/dalle.test.ts +20 -13
- package/src/store/file/slices/upload/action.ts +18 -7
- package/src/store/image/slices/generationConfig/hooks.ts +1 -1
- package/tsconfig.json +1 -10
- package/.cursor/rules/debug.mdc +0 -193
- package/packages/const/src/imageGeneration.ts +0 -16
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +0 -26
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/AspectRatioSelect.tsx +0 -24
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/SizeSliderInput.tsx +0 -15
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicItemContainer.tsx +0 -91
- package/src/app/desktop/devtools/page.tsx +0 -89
- package/src/app/desktop/layout.tsx +0 -31
- /package/apps/desktop/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/database/{vitest.config.ts → vitest.config.server.mts} +0 -0
- /package/packages/electron-server-ipc/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/file-loaders/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/model-runtime/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/prompts/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/utils/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/packages/web-crawler/{vitest.config.ts → vitest.config.mts} +0 -0
- /package/{vitest.config.ts → vitest.config.mts} +0 -0
@@ -1,91 +0,0 @@
|
|
1
|
-
'use client';
|
2
|
-
|
3
|
-
import { Tooltip } from '@lobehub/ui';
|
4
|
-
import { createStyles } from 'antd-style';
|
5
|
-
import { type ReactNode } from 'react';
|
6
|
-
import { Center, CenterProps } from 'react-layout-kit';
|
7
|
-
|
8
|
-
const useStyles = createStyles(({ css, token }) => ({
|
9
|
-
activeContainer: css`
|
10
|
-
border: 2px solid ${token.colorPrimary};
|
11
|
-
background: ${token.colorPrimaryBg};
|
12
|
-
|
13
|
-
&:hover {
|
14
|
-
background: ${token.colorPrimaryBgHover};
|
15
|
-
}
|
16
|
-
`,
|
17
|
-
container: css`
|
18
|
-
cursor: pointer;
|
19
|
-
|
20
|
-
position: relative;
|
21
|
-
|
22
|
-
flex: none;
|
23
|
-
|
24
|
-
width: 50px;
|
25
|
-
height: 50px;
|
26
|
-
border-radius: 6px;
|
27
|
-
|
28
|
-
background: transparent;
|
29
|
-
|
30
|
-
transition: all 0.2s ease-in-out;
|
31
|
-
|
32
|
-
&::before {
|
33
|
-
pointer-events: none;
|
34
|
-
content: '';
|
35
|
-
|
36
|
-
position: absolute;
|
37
|
-
inset: 0;
|
38
|
-
|
39
|
-
border-radius: 6px;
|
40
|
-
|
41
|
-
opacity: 0;
|
42
|
-
background: radial-gradient(circle at center, ${token.colorPrimary}20 0%, transparent 70%);
|
43
|
-
|
44
|
-
transition: opacity 0.3s ease;
|
45
|
-
}
|
46
|
-
|
47
|
-
&:hover {
|
48
|
-
background: ${token.colorFillSecondary};
|
49
|
-
}
|
50
|
-
|
51
|
-
&:active {
|
52
|
-
background: ${token.colorFillTertiary};
|
53
|
-
}
|
54
|
-
|
55
|
-
&:active::before {
|
56
|
-
opacity: 1;
|
57
|
-
}
|
58
|
-
`,
|
59
|
-
}));
|
60
|
-
|
61
|
-
interface TopicItemContainerProps extends CenterProps {
|
62
|
-
active?: boolean;
|
63
|
-
children: ReactNode;
|
64
|
-
tooltip?: ReactNode;
|
65
|
-
}
|
66
|
-
|
67
|
-
const TopicItemContainer = ({
|
68
|
-
children,
|
69
|
-
className,
|
70
|
-
active,
|
71
|
-
tooltip,
|
72
|
-
...rest
|
73
|
-
}: TopicItemContainerProps) => {
|
74
|
-
const { styles, cx } = useStyles();
|
75
|
-
|
76
|
-
const content = (
|
77
|
-
<Center className={cx(styles.container, active && styles.activeContainer, className)} {...rest}>
|
78
|
-
{children}
|
79
|
-
</Center>
|
80
|
-
);
|
81
|
-
|
82
|
-
if (!tooltip) return content;
|
83
|
-
|
84
|
-
return (
|
85
|
-
<Tooltip arrow placement="left" title={tooltip}>
|
86
|
-
{content}
|
87
|
-
</Tooltip>
|
88
|
-
);
|
89
|
-
};
|
90
|
-
|
91
|
-
export default TopicItemContainer;
|
@@ -1,89 +0,0 @@
|
|
1
|
-
'use client';
|
2
|
-
|
3
|
-
import { ActionIcon, SideNav } from '@lobehub/ui';
|
4
|
-
import { Cog, DatabaseIcon } from 'lucide-react';
|
5
|
-
import { memo, useState } from 'react';
|
6
|
-
import { Flexbox } from 'react-layout-kit';
|
7
|
-
|
8
|
-
import { BRANDING_NAME } from '@/const/branding';
|
9
|
-
import PostgresViewer from '@/features/DevPanel/PostgresViewer';
|
10
|
-
import SystemInspector from '@/features/DevPanel/SystemInspector';
|
11
|
-
import { useStyles } from '@/features/DevPanel/features/FloatPanel';
|
12
|
-
import { electronStylish } from '@/styles/electron';
|
13
|
-
|
14
|
-
const DevTools = memo(() => {
|
15
|
-
const { styles, theme, cx } = useStyles();
|
16
|
-
|
17
|
-
const items = [
|
18
|
-
{
|
19
|
-
children: <PostgresViewer />,
|
20
|
-
icon: <DatabaseIcon size={16} />,
|
21
|
-
key: 'Postgres Viewer',
|
22
|
-
},
|
23
|
-
{
|
24
|
-
children: <SystemInspector />,
|
25
|
-
icon: <Cog size={16} />,
|
26
|
-
key: 'System Status',
|
27
|
-
},
|
28
|
-
];
|
29
|
-
|
30
|
-
const [tab, setTab] = useState<string>(items[0].key);
|
31
|
-
|
32
|
-
return (
|
33
|
-
<Flexbox height={'100%'} style={{ overflow: 'hidden', position: 'relative' }} width={'100%'}>
|
34
|
-
<Flexbox
|
35
|
-
align={'center'}
|
36
|
-
className={cx(`panel-drag-handle`, styles.header, electronStylish.draggable)}
|
37
|
-
horizontal
|
38
|
-
justify={'center'}
|
39
|
-
>
|
40
|
-
<Flexbox align={'baseline'} gap={6} horizontal>
|
41
|
-
<b>{BRANDING_NAME} Dev Tools</b>
|
42
|
-
<span style={{ color: theme.colorTextDescription }}>/</span>
|
43
|
-
<span style={{ color: theme.colorTextDescription }}>{tab}</span>
|
44
|
-
</Flexbox>
|
45
|
-
</Flexbox>
|
46
|
-
<Flexbox
|
47
|
-
height={'100%'}
|
48
|
-
horizontal
|
49
|
-
style={{ background: theme.colorBgLayout, overflow: 'hidden', position: 'relative' }}
|
50
|
-
width={'100%'}
|
51
|
-
>
|
52
|
-
<SideNav
|
53
|
-
bottomActions={[]}
|
54
|
-
style={{
|
55
|
-
background: 'transparent',
|
56
|
-
width: 48,
|
57
|
-
}}
|
58
|
-
topActions={items.map((item) => (
|
59
|
-
<ActionIcon
|
60
|
-
active={tab === item.key}
|
61
|
-
icon={item.icon}
|
62
|
-
key={item.key}
|
63
|
-
onClick={() => setTab(item.key)}
|
64
|
-
title={item.key}
|
65
|
-
tooltipProps={{
|
66
|
-
placement: 'right',
|
67
|
-
}}
|
68
|
-
/>
|
69
|
-
))}
|
70
|
-
/>
|
71
|
-
{items.map((item) => (
|
72
|
-
<Flexbox
|
73
|
-
flex={1}
|
74
|
-
height={'100%'}
|
75
|
-
key={item.key}
|
76
|
-
style={{
|
77
|
-
display: tab === item.key ? 'flex' : 'none',
|
78
|
-
overflow: 'hidden',
|
79
|
-
}}
|
80
|
-
>
|
81
|
-
{item.children}
|
82
|
-
</Flexbox>
|
83
|
-
))}
|
84
|
-
</Flexbox>
|
85
|
-
</Flexbox>
|
86
|
-
);
|
87
|
-
});
|
88
|
-
|
89
|
-
export default DevTools;
|
@@ -1,31 +0,0 @@
|
|
1
|
-
import { notFound } from 'next/navigation';
|
2
|
-
import { NuqsAdapter } from 'nuqs/adapters/next/app';
|
3
|
-
import { ReactNode } from 'react';
|
4
|
-
|
5
|
-
import { isDesktop } from '@/const/version';
|
6
|
-
import GlobalLayout from '@/layout/GlobalProvider';
|
7
|
-
import { ServerConfigStoreProvider } from '@/store/serverConfig/Provider';
|
8
|
-
|
9
|
-
interface RootLayoutProps {
|
10
|
-
children: ReactNode;
|
11
|
-
}
|
12
|
-
|
13
|
-
const RootLayout = async ({ children }: RootLayoutProps) => {
|
14
|
-
if (!isDesktop) return notFound();
|
15
|
-
|
16
|
-
return (
|
17
|
-
<html dir="ltr" suppressHydrationWarning>
|
18
|
-
<body>
|
19
|
-
<NuqsAdapter>
|
20
|
-
<ServerConfigStoreProvider>
|
21
|
-
<GlobalLayout appearance={'auto'} isMobile={false} locale={''}>
|
22
|
-
{children}
|
23
|
-
</GlobalLayout>
|
24
|
-
</ServerConfigStoreProvider>
|
25
|
-
</NuqsAdapter>
|
26
|
-
</body>
|
27
|
-
</html>
|
28
|
-
);
|
29
|
-
};
|
30
|
-
|
31
|
-
export default RootLayout;
|
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
|