@lobehub/lobehub 2.0.0-next.342 → 2.0.0-next.344

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 (80) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/changelog/v1.json +21 -0
  3. package/package.json +1 -1
  4. package/packages/builtin-tool-cloud-sandbox/src/ExecutionRuntime/index.ts +161 -12
  5. package/packages/database/src/models/__tests__/userMemories.test.ts +62 -5
  6. package/packages/database/src/models/agentCronJob.ts +9 -9
  7. package/packages/database/src/models/userMemory/__tests__/identity.test.ts +5 -5
  8. package/packages/database/src/models/userMemory/experience.ts +91 -1
  9. package/packages/database/src/models/userMemory/identity.ts +93 -2
  10. package/packages/database/src/models/userMemory/model.ts +27 -8
  11. package/packages/types/src/userMemory/experience.ts +25 -0
  12. package/packages/types/src/userMemory/identity.ts +27 -0
  13. package/packages/types/src/userMemory/index.ts +1 -0
  14. package/packages/types/src/userMemory/shared.ts +30 -0
  15. package/src/app/[variants]/(main)/group/profile/features/Header/index.tsx +3 -4
  16. package/src/app/[variants]/(main)/home/features/InputArea/SkillInstallBanner.tsx +7 -8
  17. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaDetail.tsx +58 -0
  18. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaHeader.tsx +22 -0
  19. package/src/app/[variants]/(main)/memory/(home)/features/Persona/PersonaSummary.tsx +43 -0
  20. package/src/app/[variants]/(main)/memory/(home)/features/Persona/index.tsx +53 -0
  21. package/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx +2 -2
  22. package/src/app/[variants]/(main)/memory/(home)/index.tsx +15 -3
  23. package/src/app/[variants]/(main)/memory/experiences/features/List/GridView/ExperienceCard.tsx +3 -3
  24. package/src/app/[variants]/(main)/memory/experiences/features/List/GridView/index.tsx +3 -3
  25. package/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/ExperienceCard.tsx +3 -3
  26. package/src/app/[variants]/(main)/memory/experiences/features/List/TimelineView/index.tsx +3 -3
  27. package/src/app/[variants]/(main)/memory/features/SourceLink.tsx +2 -11
  28. package/src/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard.tsx +2 -9
  29. package/src/app/[variants]/(main)/memory/identities/features/IdentityRightPanel.tsx +1 -1
  30. package/src/app/[variants]/(main)/memory/identities/features/List/GridView/IdentityCard.tsx +5 -4
  31. package/src/app/[variants]/(main)/memory/identities/features/List/GridView/index.tsx +3 -3
  32. package/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/IdentityCard.tsx +6 -6
  33. package/src/app/[variants]/(main)/memory/identities/features/List/TimelineView/index.tsx +6 -4
  34. package/src/app/[variants]/(main)/settings/profile/index.tsx +8 -8
  35. package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +0 -1
  36. package/src/app/[variants]/(main)/settings/skill/features/Actions.tsx +0 -1
  37. package/src/app/[variants]/(main)/settings/skill/features/KlavisSkillItem.tsx +9 -10
  38. package/src/app/[variants]/(main)/settings/skill/features/LobehubSkillItem.tsx +9 -10
  39. package/src/app/[variants]/(main)/settings/skill/features/McpSkillItem.tsx +4 -5
  40. package/src/app/[variants]/(main)/settings/skill/features/SkillList.tsx +4 -5
  41. package/src/app/[variants]/share/t/[id]/SharedMessageList.tsx +1 -4
  42. package/src/app/[variants]/share/t/[id]/_layout/index.tsx +47 -121
  43. package/src/app/[variants]/share/t/[id]/_layout/style.ts +59 -0
  44. package/src/app/[variants]/share/t/[id]/features/Portal/index.tsx +4 -5
  45. package/src/app/[variants]/share/t/[id]/index.tsx +30 -37
  46. package/src/components/404/index.tsx +15 -9
  47. package/src/components/DragUpload/index.tsx +15 -16
  48. package/src/features/EditorCanvas/DocumentIdMode.tsx +1 -2
  49. package/src/features/IntegrationDetailModal/index.tsx +11 -12
  50. package/src/features/ResourceManager/index.tsx +13 -6
  51. package/src/features/ShareModal/ShareImage/Preview.tsx +19 -28
  52. package/src/features/ShareModal/ShareImage/style.ts +4 -2
  53. package/src/features/ShareModal/index.tsx +5 -1
  54. package/src/features/ShareModal/style.ts +1 -0
  55. package/src/features/ShareModal/useContainerStyles.ts +1 -1
  56. package/src/features/SharePopover/index.tsx +16 -9
  57. package/src/features/SharePopover/style.ts +2 -2
  58. package/src/features/SkillStore/CommunityList/Item.tsx +2 -2
  59. package/src/features/SkillStore/LobeHubList/Item.tsx +2 -2
  60. package/src/features/SkillStore/LobeHubList/index.tsx +2 -3
  61. package/src/features/SkillStore/style.ts +4 -4
  62. package/src/layout/GlobalProvider/ServerVersionOutdatedAlert.tsx +28 -20
  63. package/src/server/routers/lambda/userMemories.ts +61 -5
  64. package/src/server/routers/lambda/userMemory.ts +5 -1
  65. package/src/services/chat/index.ts +2 -2
  66. package/src/services/userMemory/index.ts +25 -1
  67. package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +0 -1
  68. package/src/store/userMemory/initialState.ts +22 -52
  69. package/src/store/userMemory/slices/context/action.ts +1 -1
  70. package/src/store/userMemory/slices/context/index.ts +1 -0
  71. package/src/store/userMemory/slices/context/initialState.ts +22 -0
  72. package/src/store/userMemory/slices/experience/action.ts +10 -22
  73. package/src/store/userMemory/slices/experience/index.ts +1 -0
  74. package/src/store/userMemory/slices/experience/initialState.ts +22 -0
  75. package/src/store/userMemory/slices/home/action.ts +17 -0
  76. package/src/store/userMemory/slices/identity/action.ts +36 -24
  77. package/src/store/userMemory/slices/identity/initialState.ts +7 -4
  78. package/src/store/userMemory/slices/preference/action.ts +1 -1
  79. package/src/store/userMemory/slices/preference/index.ts +1 -0
  80. package/src/store/userMemory/slices/preference/initialState.ts +22 -0
@@ -0,0 +1,53 @@
1
+ import { Flexbox } from '@lobehub/ui';
2
+ import { cx } from 'antd-style';
3
+ import { memo, useState } from 'react';
4
+
5
+ import { EditorModal } from '@/features/EditorModal';
6
+ import { useUserMemoryStore } from '@/store/userMemory';
7
+
8
+ import PersonaDetail from './PersonaDetail';
9
+ import PersonaSummary from './PersonaSummary';
10
+
11
+ interface PersonaProps {
12
+ className?: string;
13
+ onEditClick?: () => void;
14
+ }
15
+
16
+ export const usePersonaEditor = () => {
17
+ const [editOpen, setEditOpen] = useState(false);
18
+ const persona = useUserMemoryStore((s) => s.persona);
19
+
20
+ const openEditor = () => setEditOpen(true);
21
+ const closeEditor = () => setEditOpen(false);
22
+
23
+ const EditorModalElement = persona ? (
24
+ <EditorModal
25
+ onCancel={closeEditor}
26
+ onConfirm={async () => {
27
+ closeEditor();
28
+ }}
29
+ open={editOpen}
30
+ value={persona.content}
31
+ />
32
+ ) : null;
33
+
34
+ return { EditorModalElement, openEditor };
35
+ };
36
+
37
+ const Persona = memo<PersonaProps>(({ className }) => {
38
+ const useFetchPersona = useUserMemoryStore((s) => s.useFetchPersona);
39
+ const persona = useUserMemoryStore((s) => s.persona);
40
+
41
+ const { isLoading } = useFetchPersona();
42
+
43
+ if (isLoading || !persona) return null;
44
+
45
+ return (
46
+ <Flexbox className={cx(className)} gap={24}>
47
+ {persona.summary && <PersonaSummary>{persona.summary}</PersonaSummary>}
48
+ <PersonaDetail>{persona.content}</PersonaDetail>
49
+ </Flexbox>
50
+ );
51
+ });
52
+
53
+ export default Persona;
@@ -1,12 +1,12 @@
1
1
  import { ActionIcon, Block } from '@lobehub/ui';
2
2
  import { createStaticStyles, cx } from 'antd-style';
3
3
  import { MaximizeIcon, MinimizeIcon } from 'lucide-react';
4
- import dynamic from '@/libs/next/dynamic';
5
4
  import { memo, useEffect, useState } from 'react';
6
5
 
7
6
  import Loading from '@/components/Loading/BrandTextLoading';
8
7
  import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
9
8
  import { type QueryTagsResult } from '@/database/models/userMemory';
9
+ import dynamic from '@/libs/next/dynamic';
10
10
 
11
11
  const TagCloudCanvas = dynamic(() => import('./TagCloudCanvas'), {
12
12
  loading: () => <Loading debugId={'TagCloud'} />,
@@ -36,7 +36,7 @@ const styles = createStaticStyles(({ css }) => ({
36
36
  position: relative;
37
37
  overflow: hidden;
38
38
  width: 100%;
39
- height: 480px;
39
+ height: 400px;
40
40
 
41
41
  .fullscreen-icon {
42
42
  opacity: 0;
@@ -1,20 +1,24 @@
1
1
  import { Flexbox } from '@lobehub/ui';
2
+ // import { PencilLineIcon } from 'lucide-react';
2
3
  import { type FC } from 'react';
3
4
 
4
- import MemoryEmpty from '@/app/[variants]/(main)/memory/features/MemoryEmpty';
5
- import { SCROLL_PARENT_ID } from '@/app/[variants]/(main)/memory/features/TimeLineView/useScrollParent';
6
5
  import Loading from '@/components/Loading/BrandTextLoading';
7
6
  import NavHeader from '@/features/NavHeader';
8
7
  import WideScreenContainer from '@/features/WideScreenContainer';
9
8
  import WideScreenButton from '@/features/WideScreenContainer/WideScreenButton';
10
9
  import { useUserMemoryStore } from '@/store/userMemory';
11
10
 
11
+ import MemoryEmpty from '../features/MemoryEmpty';
12
+ import { SCROLL_PARENT_ID } from '../features/TimeLineView/useScrollParent';
13
+ import Persona from './features/Persona';
14
+ import PersonaHeader from './features/Persona/PersonaHeader';
12
15
  import RoleTagCloud from './features/RoleTagCloud';
13
16
 
14
17
  const Home: FC = () => {
15
18
  const useFetchTags = useUserMemoryStore((s) => s.useFetchTags);
16
19
  const roles = useUserMemoryStore((s) => s.roles);
17
20
  const { isLoading } = useFetchTags();
21
+ // const { EditorModalElement, openEditor } = usePersonaEditor();
18
22
 
19
23
  if (isLoading) return <Loading debugId={'Home'} />;
20
24
 
@@ -25,7 +29,12 @@ const Home: FC = () => {
25
29
  return (
26
30
  <Flexbox flex={1} height={'100%'}>
27
31
  <NavHeader
28
- right={<WideScreenButton />}
32
+ right={
33
+ <Flexbox gap={8} horizontal>
34
+ {/* <ActionIcon icon={PencilLineIcon} onClick={openEditor} /> */}
35
+ <WideScreenButton />
36
+ </Flexbox>
37
+ }
29
38
  style={{
30
39
  zIndex: 1,
31
40
  }}
@@ -37,9 +46,12 @@ const Home: FC = () => {
37
46
  width={'100%'}
38
47
  >
39
48
  <WideScreenContainer gap={32} paddingBlock={48}>
49
+ <PersonaHeader />
40
50
  <RoleTagCloud tags={roles} />
51
+ <Persona />
41
52
  </WideScreenContainer>
42
53
  </Flexbox>
54
+ {/* {EditorModalElement} */}
43
55
  </Flexbox>
44
56
  );
45
57
  };
@@ -1,3 +1,4 @@
1
+ import type { ExperienceListItem } from '@lobechat/types';
1
2
  import dayjs from 'dayjs';
2
3
  import relativeTime from 'dayjs/plugin/relativeTime';
3
4
  import { memo } from 'react';
@@ -5,15 +6,14 @@ import { useTranslation } from 'react-i18next';
5
6
 
6
7
  import GridCard from '@/app/[variants]/(main)/memory/features/GridView/GridCard';
7
8
  import ProgressIcon from '@/app/[variants]/(main)/memory/features/ProgressIcon';
8
- import { type DisplayExperienceMemory } from '@/database/repositories/userMemory';
9
9
 
10
10
  import ExperienceDropdown from '../../ExperienceDropdown';
11
11
 
12
12
  dayjs.extend(relativeTime);
13
13
 
14
14
  interface ExperienceCardProps {
15
- experience: DisplayExperienceMemory;
16
- onClick: (experience: DisplayExperienceMemory) => void;
15
+ experience: ExperienceListItem;
16
+ onClick: (experience: ExperienceListItem) => void;
17
17
  }
18
18
 
19
19
  const ExperienceCard = memo<ExperienceCardProps>(({ experience, onClick }) => {
@@ -1,15 +1,15 @@
1
+ import type { ExperienceListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
- import { type DisplayExperienceMemory } from '@/database/repositories/userMemory';
4
4
  import { useUserMemoryStore } from '@/store/userMemory';
5
5
 
6
6
  import { GridView } from '../../../../features/GridView';
7
7
  import ExperienceCard from './ExperienceCard';
8
8
 
9
9
  interface GridViewProps {
10
- experiences: DisplayExperienceMemory[];
10
+ experiences: ExperienceListItem[];
11
11
  isLoading?: boolean;
12
- onClick: (experience: DisplayExperienceMemory) => void;
12
+ onClick: (experience: ExperienceListItem) => void;
13
13
  }
14
14
 
15
15
  const ExperiencesGridView = memo<GridViewProps>(({ experiences, isLoading, onClick }) => {
@@ -1,13 +1,13 @@
1
+ import type { ExperienceListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
4
  import TimeLineCard from '@/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard';
4
- import { type DisplayExperienceMemory } from '@/database/repositories/userMemory';
5
5
 
6
6
  import ExperienceDropdown from '../../ExperienceDropdown';
7
7
 
8
8
  interface ExperienceCardProps {
9
- experience: DisplayExperienceMemory;
10
- onClick: (experience: DisplayExperienceMemory) => void;
9
+ experience: ExperienceListItem;
10
+ onClick: (experience: ExperienceListItem) => void;
11
11
  }
12
12
 
13
13
  const ExperienceCard = memo<ExperienceCardProps>(({ experience, onClick }) => {
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
+ import type { ExperienceListItem } from '@lobechat/types';
3
4
  import { memo } from 'react';
4
5
 
5
- import { type DisplayExperienceMemory } from '@/database/repositories/userMemory';
6
6
  import { useUserMemoryStore } from '@/store/userMemory';
7
7
 
8
8
  import { TimelineView as GenericTimelineView } from '../../../../features/TimeLineView';
@@ -10,9 +10,9 @@ import { PeriodHeader, TimelineItemWrapper } from '../../../../features/TimeLine
10
10
  import ExperienceCard from './ExperienceCard';
11
11
 
12
12
  interface ExperienceTimelineViewProps {
13
- experiences: DisplayExperienceMemory[];
13
+ experiences: ExperienceListItem[];
14
14
  isLoading?: boolean;
15
- onCardClick: (experience: DisplayExperienceMemory) => void;
15
+ onCardClick: (experience: ExperienceListItem) => void;
16
16
  }
17
17
 
18
18
  const ExperienceTimelineView = memo<ExperienceTimelineViewProps>(
@@ -1,28 +1,19 @@
1
1
  import { Button, Icon, Text } from '@lobehub/ui';
2
2
  import { cssVar } from 'antd-style';
3
3
  import { Link2 } from 'lucide-react';
4
- import Link from '@/libs/router/Link';
5
4
  import { memo } from 'react';
6
- import { useNavigate } from 'react-router-dom';
7
5
 
8
6
  import { type MemorySource } from '@/database/repositories/userMemory';
7
+ import Link from '@/libs/router/Link';
9
8
 
10
9
  const SourceLink = memo<{ source?: MemorySource | null }>(({ source }) => {
11
- const navigate = useNavigate();
12
-
13
10
  if (!source) return;
14
11
 
15
12
  const title = source.title || source.id?.replace('tpc_', '').slice(0, 8);
16
13
 
17
14
  return (
18
15
  <Link
19
- href={`/agent/${source.agentId}?topicId=${source.id}`}
20
- onClick={(e) => {
21
- if (!source) return;
22
- e.stopPropagation();
23
- e.preventDefault();
24
- navigate(`/agent/${source.agentId}?topicId=${source.id}`);
25
- }}
16
+ href={`/agent/${source.agentId}?topic=${source.id}`}
26
17
  style={{
27
18
  flex: 1,
28
19
  maxWidth: '100%',
@@ -1,6 +1,5 @@
1
- import { Block, Flexbox, Icon, Tag, Text } from '@lobehub/ui';
1
+ import { Block, Flexbox, Tag, Text } from '@lobehub/ui';
2
2
  import { createStaticStyles, cssVar, cx } from 'antd-style';
3
- import { Link2 } from 'lucide-react';
4
3
  import { type ReactNode, memo } from 'react';
5
4
 
6
5
  import CateTag from '../CateTag';
@@ -67,13 +66,7 @@ const TimeLineCard = memo<TimeLineCardProps>(
67
66
  ) : (
68
67
  title
69
68
  )}
70
- {typeof titleAddon === 'string' ? (
71
- <Tag icon={<Icon icon={Link2} />} variant="borderless">
72
- {titleAddon}
73
- </Tag>
74
- ) : (
75
- titleAddon
76
- )}
69
+ {!!titleAddon ? <Tag>{titleAddon}</Tag> : titleAddon}
77
70
  </Flexbox>
78
71
  )}
79
72
  {typeof children === 'string' ? (
@@ -39,7 +39,7 @@ const IdentityRightPanel = memo(() => {
39
39
  }}
40
40
  weight={'bold'}
41
41
  >
42
- {identity.role || identity.relationship || 'Identity'}
42
+ {identity.title}
43
43
  </Text>
44
44
  <Time capturedAt={identity.capturedAt || identity.updatedAt || identity.createdAt} />
45
45
  {identity.description && <HighlightedContent>{identity.description}</HighlightedContent>}
@@ -1,13 +1,13 @@
1
+ import type { IdentityListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
4
  import GridCard from '@/app/[variants]/(main)/memory/features/GridView/GridCard';
4
- import { type DisplayIdentityMemory } from '@/database/repositories/userMemory';
5
5
 
6
6
  import IdentityDropdown from '../../IdentityDropdown';
7
7
 
8
8
  interface IdentityCardProps {
9
- identity: DisplayIdentityMemory;
10
- onClick?: (identity: DisplayIdentityMemory) => void;
9
+ identity: IdentityListItem;
10
+ onClick?: (identity: IdentityListItem) => void;
11
11
  }
12
12
 
13
13
  const IdentityCard = memo<IdentityCardProps>(({ identity, onClick }) => {
@@ -17,7 +17,8 @@ const IdentityCard = memo<IdentityCardProps>(({ identity, onClick }) => {
17
17
  cate={identity.type}
18
18
  hashTags={identity.tags}
19
19
  onClick={() => onClick?.(identity)}
20
- title={identity.role}
20
+ title={identity.title}
21
+ titleAddon={identity.role?.toLowerCase()}
21
22
  >
22
23
  {identity.description}
23
24
  </GridCard>
@@ -1,15 +1,15 @@
1
+ import type { IdentityListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
- import { type DisplayIdentityMemory } from '@/database/repositories/userMemory';
4
4
  import { useUserMemoryStore } from '@/store/userMemory';
5
5
 
6
6
  import { GridView } from '../../../../features/GridView';
7
7
  import IdentityCard from './IdentityCard';
8
8
 
9
9
  interface GridViewProps {
10
- identities: DisplayIdentityMemory[];
10
+ identities: IdentityListItem[];
11
11
  isLoading?: boolean;
12
- onClick?: (identity: DisplayIdentityMemory) => void;
12
+ onClick?: (identity: IdentityListItem) => void;
13
13
  }
14
14
 
15
15
  const IdentityGridView = memo<GridViewProps>(({ identities, isLoading, onClick }) => {
@@ -1,13 +1,12 @@
1
+ import type { IdentityListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
- import TimeLineCard from '@/app/[variants]/(main)/memory/features/TimeLineView/TimeLineCard';
4
- import { type DisplayIdentityMemory } from '@/database/repositories/userMemory';
5
-
4
+ import TimeLineCard from '../../../../features/TimeLineView/TimeLineCard';
6
5
  import IdentityDropdown from '../../IdentityDropdown';
7
6
 
8
7
  interface IdentityCardProps {
9
- identity: DisplayIdentityMemory;
10
- onClick?: (identity: DisplayIdentityMemory) => void;
8
+ identity: IdentityListItem;
9
+ onClick?: (identity: IdentityListItem) => void;
11
10
  }
12
11
 
13
12
  const IdentityCard = memo<IdentityCardProps>(({ identity, onClick }) => {
@@ -18,7 +17,8 @@ const IdentityCard = memo<IdentityCardProps>(({ identity, onClick }) => {
18
17
  cate={identity.type}
19
18
  hashTags={identity.tags}
20
19
  onClick={() => onClick?.(identity)}
21
- title={identity.role}
20
+ title={identity.title}
21
+ titleAddon={identity.role?.toLowerCase()}
22
22
  >
23
23
  {identity.description}
24
24
  </TimeLineCard>
@@ -1,6 +1,6 @@
1
+ import type { IdentityListItem } from '@lobechat/types';
1
2
  import { memo } from 'react';
2
3
 
3
- import { type DisplayIdentityMemory } from '@/database/repositories/userMemory';
4
4
  import { useUserMemoryStore } from '@/store/userMemory';
5
5
 
6
6
  import { TimelineView as GenericTimelineView } from '../../../../features/TimeLineView';
@@ -8,9 +8,9 @@ import { PeriodHeader, TimelineItemWrapper } from '../../../../features/TimeLine
8
8
  import IdentityCard from './IdentityCard';
9
9
 
10
10
  interface TimelineViewProps {
11
- identities: DisplayIdentityMemory[];
11
+ identities: IdentityListItem[];
12
12
  isLoading?: boolean;
13
- onClick?: (identity: DisplayIdentityMemory) => void;
13
+ onClick?: (identity: IdentityListItem) => void;
14
14
  }
15
15
 
16
16
  const TimelineView = memo<TimelineViewProps>(({ identities, isLoading, onClick }) => {
@@ -20,7 +20,9 @@ const TimelineView = memo<TimelineViewProps>(({ identities, isLoading, onClick }
20
20
  return (
21
21
  <GenericTimelineView
22
22
  data={identities}
23
- getDateForGrouping={(identity) => identity.episodicDate || identity.capturedAt || identity.createdAt}
23
+ getDateForGrouping={(identity) =>
24
+ identity.episodicDate || identity.capturedAt || identity.createdAt
25
+ }
24
26
  groupBy="month"
25
27
  hasMore={identitiesHasMore}
26
28
  isLoading={isLoading}
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { isDesktop } from '@lobechat/const';
4
- import { Flexbox, FormGroup, Text } from '@lobehub/ui';
5
- import { Skeleton as AntSkeleton, Divider } from 'antd';
4
+ import { Flexbox, FormGroup, Skeleton, Text } from '@lobehub/ui';
5
+ import { Divider } from 'antd';
6
6
  import { useEffect } from 'react';
7
7
  import { useTranslation } from 'react-i18next';
8
8
 
@@ -28,20 +28,20 @@ const SkeletonRow = ({ mobile }: { mobile?: boolean }) => {
28
28
  return (
29
29
  <Flexbox gap={12} style={rowStyle}>
30
30
  <Flexbox align="center" horizontal justify="space-between">
31
- <AntSkeleton.Input active size="small" style={{ height: 22, width: 60 }} />
32
- <AntSkeleton.Input active size="small" style={{ height: 22, width: 80 }} />
31
+ <Skeleton.Button active size="small" style={{ height: 22, width: 60 }} />
32
+ <Skeleton.Button active size="small" style={{ height: 22, width: 80 }} />
33
33
  </Flexbox>
34
- <AntSkeleton.Input active size="small" style={{ height: 22, width: 120 }} />
34
+ <Skeleton.Button active size="small" style={{ height: 22, width: 120 }} />
35
35
  </Flexbox>
36
36
  );
37
37
  }
38
38
  return (
39
39
  <Flexbox align="center" gap={24} horizontal justify="space-between" style={rowStyle}>
40
40
  <Flexbox align="center" gap={24} horizontal style={{ flex: 1 }}>
41
- <AntSkeleton.Input active size="small" style={{ ...labelStyle, height: 22 }} />
42
- <AntSkeleton.Input active size="small" style={{ height: 22, minWidth: 120, width: 160 }} />
41
+ <Skeleton.Button active size="small" style={{ ...labelStyle, height: 22 }} />
42
+ <Skeleton.Button active size="small" style={{ height: 22, minWidth: 120, width: 160 }} />
43
43
  </Flexbox>
44
- <AntSkeleton.Input active size="small" style={{ height: 22, width: 100 }} />
44
+ <Skeleton.Button active size="small" style={{ height: 22, width: 100 }} />
45
45
  </Flexbox>
46
46
  );
47
47
  };
@@ -394,7 +394,6 @@ const ProviderConfig = memo<ProviderConfigProps>(
394
394
  ),
395
395
  desc: t('providerModels.config.checker.desc'),
396
396
  label: t('providerModels.config.checker.title'),
397
- minWidth: undefined,
398
397
  }
399
398
  : undefined,
400
399
  showAceGcm && aceGcmItem,
@@ -64,7 +64,6 @@ const Actions = memo<ActionsProps>(({ identifier, type, isMCP }) => {
64
64
  setSettingsOpen(true);
65
65
  }
66
66
  }}
67
- type="default"
68
67
  >
69
68
  {t('store.actions.configure')}
70
69
  </Button>
@@ -3,7 +3,7 @@
3
3
  import { type KlavisServerType } from '@lobechat/const';
4
4
  import { ActionIcon, Avatar, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
5
5
  import { App, Button } from 'antd';
6
- import { createStyles, cssVar } from 'antd-style';
6
+ import { createStaticStyles, cssVar } from 'antd-style';
7
7
  import { Loader2, MoreVerticalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react';
8
8
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
9
9
  import { useTranslation } from 'react-i18next';
@@ -17,10 +17,10 @@ import { userProfileSelectors } from '@/store/user/selectors';
17
17
  const POLL_INTERVAL_MS = 1000;
18
18
  const POLL_TIMEOUT_MS = 15_000;
19
19
 
20
- const useStyles = createStyles(({ css, token }) => ({
20
+ const styles = createStaticStyles(({ css, cssVar }) => ({
21
21
  connected: css`
22
22
  font-size: 14px;
23
- color: ${token.colorSuccess};
23
+ color: ${cssVar.colorSuccess};
24
24
  `,
25
25
  container: css`
26
26
  padding-block: 12px;
@@ -28,11 +28,11 @@ const useStyles = createStyles(({ css, token }) => ({
28
28
  `,
29
29
  disconnected: css`
30
30
  font-size: 14px;
31
- color: ${token.colorTextTertiary};
31
+ color: ${cssVar.colorTextTertiary};
32
32
  `,
33
33
  error: css`
34
34
  font-size: 14px;
35
- color: ${token.colorError};
35
+ color: ${cssVar.colorError};
36
36
  `,
37
37
  icon: css`
38
38
  display: flex;
@@ -44,20 +44,20 @@ const useStyles = createStyles(({ css, token }) => ({
44
44
  height: 48px;
45
45
  border-radius: 12px;
46
46
 
47
- background: ${token.colorFillTertiary};
47
+ background: ${cssVar.colorFillTertiary};
48
48
  `,
49
49
  pending: css`
50
50
  font-size: 14px;
51
- color: ${token.colorWarning};
51
+ color: ${cssVar.colorWarning};
52
52
  `,
53
53
  title: css`
54
54
  cursor: pointer;
55
55
  font-size: 15px;
56
56
  font-weight: 500;
57
- color: ${token.colorText};
57
+ color: ${cssVar.colorText};
58
58
 
59
59
  &:hover {
60
- color: ${token.colorPrimary};
60
+ color: ${cssVar.colorPrimary};
61
61
  }
62
62
  `,
63
63
  }));
@@ -69,7 +69,6 @@ interface KlavisSkillItemProps {
69
69
 
70
70
  const KlavisSkillItem = memo<KlavisSkillItemProps>(({ serverType, server }) => {
71
71
  const { t } = useTranslation('setting');
72
- const { styles } = useStyles();
73
72
  const { modal } = App.useApp();
74
73
  const [isConnecting, setIsConnecting] = useState(false);
75
74
  const [isWaitingAuth, setIsWaitingAuth] = useState(false);
@@ -3,7 +3,7 @@
3
3
  import { type LobehubSkillProviderType } from '@lobechat/const';
4
4
  import { ActionIcon, Avatar, DropdownMenu, Flexbox, Icon } from '@lobehub/ui';
5
5
  import { App, Button } from 'antd';
6
- import { createStyles, cssVar } from 'antd-style';
6
+ import { createStaticStyles, cssVar } from 'antd-style';
7
7
  import { Loader2, MoreVerticalIcon, SquareArrowOutUpRight, Unplug } from 'lucide-react';
8
8
  import { memo, useCallback, useEffect, useRef, useState } from 'react';
9
9
  import { useTranslation } from 'react-i18next';
@@ -18,10 +18,10 @@ import {
18
18
  const POLL_INTERVAL_MS = 1000;
19
19
  const POLL_TIMEOUT_MS = 15_000;
20
20
 
21
- const useStyles = createStyles(({ css, token }) => ({
21
+ const styles = createStaticStyles(({ css, cssVar }) => ({
22
22
  connected: css`
23
23
  font-size: 14px;
24
- color: ${token.colorSuccess};
24
+ color: ${cssVar.colorSuccess};
25
25
  `,
26
26
  container: css`
27
27
  padding-block: 12px;
@@ -29,17 +29,17 @@ const useStyles = createStyles(({ css, token }) => ({
29
29
  `,
30
30
  disconnected: css`
31
31
  font-size: 14px;
32
- color: ${token.colorTextTertiary};
32
+ color: ${cssVar.colorTextTertiary};
33
33
  `,
34
34
  disconnectedIcon: css`
35
35
  opacity: 0.5;
36
36
  `,
37
37
  disconnectedTitle: css`
38
- color: ${token.colorTextTertiary};
38
+ color: ${cssVar.colorTextTertiary};
39
39
  `,
40
40
  error: css`
41
41
  font-size: 14px;
42
- color: ${token.colorError};
42
+ color: ${cssVar.colorError};
43
43
  `,
44
44
  icon: css`
45
45
  display: flex;
@@ -51,16 +51,16 @@ const useStyles = createStyles(({ css, token }) => ({
51
51
  height: 48px;
52
52
  border-radius: 12px;
53
53
 
54
- background: ${token.colorFillTertiary};
54
+ background: ${cssVar.colorFillTertiary};
55
55
  `,
56
56
  title: css`
57
57
  cursor: pointer;
58
58
  font-size: 15px;
59
59
  font-weight: 500;
60
- color: ${token.colorText};
60
+ color: ${cssVar.colorText};
61
61
 
62
62
  &:hover {
63
- color: ${token.colorPrimary};
63
+ color: ${cssVar.colorPrimary};
64
64
  }
65
65
  `,
66
66
  }));
@@ -72,7 +72,6 @@ interface LobehubSkillItemProps {
72
72
 
73
73
  const LobehubSkillItem = memo<LobehubSkillItemProps>(({ provider, server }) => {
74
74
  const { t } = useTranslation('setting');
75
- const { styles } = useStyles();
76
75
  const { modal } = App.useApp();
77
76
  const [isConnecting, setIsConnecting] = useState(false);
78
77
  const [isWaitingAuth, setIsWaitingAuth] = useState(false);
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { Block, Flexbox, Modal } from '@lobehub/ui';
4
- import { createStyles } from 'antd-style';
4
+ import { createStaticStyles } from 'antd-style';
5
5
  import { memo, useState } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
7
7
 
@@ -15,7 +15,7 @@ import { type LobeToolType } from '@/types/tool/tool';
15
15
 
16
16
  import Actions from './Actions';
17
17
 
18
- const useStyles = createStyles(({ css, token }) => ({
18
+ const styles = createStaticStyles(({ css, cssVar }) => ({
19
19
  container: css`
20
20
  padding-block: 12px;
21
21
  padding-inline: 0;
@@ -33,10 +33,10 @@ const useStyles = createStyles(({ css, token }) => ({
33
33
  cursor: pointer;
34
34
  font-size: 15px;
35
35
  font-weight: 500;
36
- color: ${token.colorText};
36
+ color: ${cssVar.colorText};
37
37
 
38
38
  &:hover {
39
- color: ${token.colorPrimary};
39
+ color: ${cssVar.colorPrimary};
40
40
  }
41
41
  `,
42
42
  }));
@@ -52,7 +52,6 @@ interface McpSkillItemProps {
52
52
 
53
53
  const McpSkillItem = memo<McpSkillItemProps>(
54
54
  ({ identifier, title, avatar, type, runtimeType, author }) => {
55
- const { styles } = useStyles();
56
55
  const { t } = useTranslation('plugin');
57
56
  const isMCP = runtimeType === 'mcp';
58
57
  const isCustomPlugin = type === 'customPlugin';
@@ -11,7 +11,7 @@ import {
11
11
  getLobehubSkillProviderById,
12
12
  } from '@lobechat/const';
13
13
  import { Divider } from 'antd';
14
- import { createStyles } from 'antd-style';
14
+ import { createStaticStyles } from 'antd-style';
15
15
  import isEqual from 'fast-deep-equal';
16
16
  import { memo, useMemo } from 'react';
17
17
  import { useTranslation } from 'react-i18next';
@@ -33,7 +33,7 @@ import McpSkillItem from './McpSkillItem';
33
33
  import KlavisSkillItem from './KlavisSkillItem';
34
34
  import LobehubSkillItem from './LobehubSkillItem';
35
35
 
36
- const useStyles = createStyles(({ css, token }) => ({
36
+ const styles = createStaticStyles(({ css, cssVar }) => ({
37
37
  container: css`
38
38
  display: flex;
39
39
  flex-direction: column;
@@ -41,18 +41,17 @@ const useStyles = createStyles(({ css, token }) => ({
41
41
  `,
42
42
  description: css`
43
43
  margin-block-end: 8px;
44
- color: ${token.colorTextSecondary};
44
+ color: ${cssVar.colorTextSecondary};
45
45
  `,
46
46
  empty: css`
47
47
  padding: 24px;
48
- color: ${token.colorTextTertiary};
48
+ color: ${cssVar.colorTextTertiary};
49
49
  text-align: center;
50
50
  `,
51
51
  }));
52
52
 
53
53
  const SkillList = memo(() => {
54
54
  const { t } = useTranslation('setting');
55
- const { styles } = useStyles();
56
55
 
57
56
  const isLobehubSkillEnabled = useServerConfigStore(serverConfigSelectors.enableLobehubSkill);
58
57
  const isKlavisEnabled = useServerConfigStore(serverConfigSelectors.enableKlavis);