@lobehub/lobehub 2.0.0-next.67 → 2.0.0-next.69

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +18 -0
  3. package/package.json +2 -8
  4. package/packages/const/src/version.ts +0 -5
  5. package/packages/database/src/models/__tests__/chunk.test.ts +38 -0
  6. package/packages/model-runtime/src/core/streams/ollama.test.ts +67 -0
  7. package/packages/model-runtime/src/core/streams/ollama.ts +5 -5
  8. package/src/app/(backend)/api/webhooks/clerk/route.ts +1 -2
  9. package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +0 -20
  10. package/src/app/[variants]/(main)/(mobile)/me/(home)/features/useCategory.tsx +4 -33
  11. package/src/app/[variants]/(main)/(mobile)/me/profile/features/Category.tsx +18 -23
  12. package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +5 -15
  13. package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/features/Sidebar/ActionButton/ProviderConfig.tsx +4 -11
  14. package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx +12 -27
  15. package/src/app/[variants]/(main)/image/layout.tsx +0 -4
  16. package/src/app/[variants]/(main)/profile/hooks/useCategory.tsx +10 -13
  17. package/src/app/[variants]/(main)/profile/stats/features/ShareButton/Preview.tsx +2 -14
  18. package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +2 -3
  19. package/src/app/[variants]/(main)/settings/_layout/SettingsContent.tsx +1 -12
  20. package/src/app/[variants]/(main)/settings/_layout/type.ts +0 -1
  21. package/src/app/[variants]/(main)/settings/hooks/useCategory.tsx +8 -16
  22. package/src/app/[variants]/(main)/settings/page.tsx +3 -7
  23. package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +2 -4
  24. package/src/app/[variants]/(main)/settings/storage/index.tsx +1 -9
  25. package/src/app/[variants]/(main)/settings/system-agent/index.tsx +1 -2
  26. package/src/components/InvalidAPIKey/APIKeyForm/useApiKey.ts +0 -12
  27. package/src/config/featureFlags/schema.test.ts +1 -3
  28. package/src/config/featureFlags/schema.ts +0 -3
  29. package/src/features/ChatInput/ActionBar/Knowledge/index.tsx +2 -3
  30. package/src/features/ChatInput/ActionBar/Search/index.tsx +5 -7
  31. package/src/features/ChatInput/ActionBar/Upload/index.tsx +1 -3
  32. package/src/features/Conversation/Messages/Assistant/index.tsx +1 -1
  33. package/src/features/Conversation/components/ShareMessageModal/index.tsx +3 -8
  34. package/src/features/DevPanel/PostgresViewer/usePgTable.ts +3 -11
  35. package/src/features/ModelSwitchPanel/index.tsx +9 -24
  36. package/src/features/ShareModal/index.tsx +7 -13
  37. package/src/features/User/UserPanel/PanelContent.tsx +6 -8
  38. package/src/hooks/useCheckPluginsIsInstalled.ts +1 -4
  39. package/src/hooks/useFetchGroups.ts +1 -4
  40. package/src/hooks/useFetchInstalledPlugins.ts +1 -4
  41. package/src/hooks/useFetchMessages.ts +1 -4
  42. package/src/hooks/useFetchSessions.ts +1 -4
  43. package/src/hooks/useFetchThreads.ts +1 -5
  44. package/src/hooks/useFetchTopics.ts +1 -4
  45. package/src/hooks/useInterceptingRoutes.test.ts +0 -19
  46. package/src/hooks/useInterceptingRoutes.ts +1 -7
  47. package/src/layout/GlobalProvider/StoreInitialization.tsx +2 -4
  48. package/src/services/_auth.ts +2 -11
  49. package/src/services/_header.ts +2 -10
  50. package/src/services/chat/chat.test.ts +53 -10
  51. package/src/services/chat/clientModelRuntime.test.ts +108 -172
  52. package/src/services/chat/contextEngineering.ts +2 -2
  53. package/src/services/config.ts +2 -2
  54. package/src/store/aiInfra/slices/aiProvider/action.ts +3 -4
  55. package/src/store/chat/slices/thread/action.ts +2 -2
  56. package/src/store/global/selectors/systemStatus.test.ts +0 -98
  57. package/src/store/global/selectors/systemStatus.ts +0 -30
  58. package/src/store/serverConfig/selectors.test.ts +2 -2
  59. package/src/store/serverConfig/store.test.ts +0 -1
  60. package/src/app/[variants]/(main)/settings/storage/IndexedDBStorage.tsx +0 -55
  61. package/src/features/ChatInput/ActionBar/Upload/ClientMode.tsx +0 -62
@@ -1,55 +0,0 @@
1
- 'use client';
2
-
3
- import { Skeleton } from 'antd';
4
- import { DatabaseIcon } from 'lucide-react';
5
- import { memo } from 'react';
6
- import { useTranslation } from 'react-i18next';
7
- import { Flexbox } from 'react-layout-kit';
8
- import useSWR from 'swr';
9
-
10
- import GroupIcon from '@/components/GroupIcon';
11
- import IndexCard from '@/components/IndexCard';
12
- import ProgressItem from '@/components/ProgressItem';
13
- import { formatSize } from '@/utils/format';
14
-
15
- const IndexedDBStorage = memo(() => {
16
- const { t } = useTranslation('setting');
17
- const { data, isLoading } = useSWR('fetch-client-usage', async () => {
18
- const estimate = await navigator.storage.estimate();
19
- const quota = estimate.quota || 0;
20
- const usage = estimate.usage || 0;
21
-
22
- const percent = (usage / quota) * 100;
23
-
24
- return { percent: percent < 1 ? 1 : percent, total: quota, used: usage };
25
- });
26
-
27
- return (
28
- <IndexCard
29
- desc={t('storage.desc', { day: 15 })}
30
- icon={<GroupIcon icon={DatabaseIcon} />}
31
- padding={0}
32
- title={t('storage.title')}
33
- >
34
- {isLoading ? (
35
- <Flexbox padding={16}>
36
- <Skeleton active paragraph={{ rows: 1, width: '100%' }} title={false} />
37
- <Skeleton.Button active style={{ height: 48, width: '100%' }} />
38
- </Flexbox>
39
- ) : (
40
- <Flexbox gap={16} paddingBlock={16}>
41
- <ProgressItem
42
- percent={data?.percent || 0}
43
- title={t('storage.used')}
44
- usage={{
45
- total: data ? formatSize(data.total) : '-',
46
- used: data ? formatSize(data.used) : '-',
47
- }}
48
- />
49
- </Flexbox>
50
- )}
51
- </IndexCard>
52
- );
53
- });
54
-
55
- export default IndexedDBStorage;
@@ -1,62 +0,0 @@
1
- import { ActionIcon } from '@lobehub/ui';
2
- import { Upload } from 'antd';
3
- import { FileUp, LucideImage } from 'lucide-react';
4
- import { memo } from 'react';
5
- import { useTranslation } from 'react-i18next';
6
-
7
- import { message } from '@/components/AntdStaticMethods';
8
- import { useModelSupportFiles } from '@/hooks/useModelSupportFiles';
9
- import { useModelSupportVision } from '@/hooks/useModelSupportVision';
10
- import { useAgentStore } from '@/store/agent';
11
- import { agentSelectors } from '@/store/agent/slices/chat';
12
- import { useFileStore } from '@/store/file';
13
-
14
- const FileUpload = memo(() => {
15
- const { t } = useTranslation('chat');
16
-
17
- const upload = useFileStore((s) => s.uploadChatFiles);
18
-
19
- const model = useAgentStore(agentSelectors.currentAgentModel);
20
- const provider = useAgentStore(agentSelectors.currentAgentModelProvider);
21
-
22
- const enabledFiles = useModelSupportFiles(model, provider);
23
- const supportVision = useModelSupportVision(model, provider);
24
- const canUpload = enabledFiles || supportVision;
25
-
26
- return (
27
- <Upload
28
- accept={enabledFiles ? undefined : 'image/*'}
29
- beforeUpload={async (file) => {
30
- // Check if trying to upload non-image files in client mode
31
- if (!enabledFiles && !file.type.startsWith('image')) {
32
- message.warning(t('upload.clientMode.fileNotSupported'));
33
- return false;
34
- }
35
-
36
- await upload([file]);
37
-
38
- return false;
39
- }}
40
- disabled={!canUpload}
41
- multiple={true}
42
- showUploadList={false}
43
- >
44
- <ActionIcon
45
- disabled={!canUpload}
46
- icon={enabledFiles ? FileUp : LucideImage}
47
- title={t(
48
- canUpload
49
- ? enabledFiles
50
- ? 'upload.clientMode.actionFiletip'
51
- : 'upload.clientMode.actionTooltip'
52
- : 'upload.clientMode.disabled',
53
- )}
54
- tooltipProps={{
55
- placement: 'bottom',
56
- }}
57
- />
58
- </Upload>
59
- );
60
- });
61
-
62
- export default FileUpload;