@lobehub/lobehub 2.0.13 → 2.1.1

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 (27) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v2.json +18 -0
  3. package/docker-compose/deploy/.env.example +35 -0
  4. package/docker-compose/deploy/.env.zh-CN.example +31 -0
  5. package/docker-compose/deploy/bucket.config.json +18 -0
  6. package/docker-compose/deploy/docker-compose.yml +148 -0
  7. package/docker-compose/deploy/searxng-settings.yml +2582 -0
  8. package/docker-compose/setup.sh +37 -88
  9. package/docs/self-hosting/advanced/auth/providers/casdoor.mdx +110 -0
  10. package/docs/self-hosting/advanced/auth/providers/casdoor.zh-CN.mdx +165 -0
  11. package/docs/self-hosting/platform/docker-compose.mdx +43 -561
  12. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +40 -537
  13. package/locales/en-US/setting.json +16 -0
  14. package/locales/zh-CN/setting.json +16 -0
  15. package/package.json +1 -1
  16. package/packages/const/src/url.ts +1 -1
  17. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/index.tsx +4 -2
  18. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobContentEditor.tsx +39 -44
  19. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobHeader.tsx +27 -20
  20. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobSaveButton.tsx +4 -2
  21. package/src/app/[variants]/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx +183 -145
  22. package/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/hooks/useAgentCronJobs.ts +3 -4
  23. package/src/app/[variants]/(main)/agent/profile/features/AgentCronJobs/index.tsx +4 -3
  24. package/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/index.tsx +4 -3
  25. package/src/features/Conversation/Messages/AssistantGroup/components/MessageContent.tsx +6 -1
  26. package/src/locales/default/setting.ts +16 -0
  27. package/src/store/agent/slices/cron/action.ts +6 -4
@@ -34,11 +34,20 @@
34
34
  "agentCronJobs.empty.description": "Create your first scheduled task to automate your agent",
35
35
  "agentCronJobs.empty.title": "No scheduled tasks yet",
36
36
  "agentCronJobs.enable": "Enable",
37
+ "agentCronJobs.form.at": "at",
37
38
  "agentCronJobs.form.content.placeholder": "Enter the prompt or instruction for the agent",
39
+ "agentCronJobs.form.every": "Every",
40
+ "agentCronJobs.form.frequency": "Frequency",
41
+ "agentCronJobs.form.hours": "hour(s)",
42
+ "agentCronJobs.form.maxExecutions": "Stop after",
38
43
  "agentCronJobs.form.maxExecutions.placeholder": "Leave empty for unlimited",
39
44
  "agentCronJobs.form.name.placeholder": "Enter task name",
45
+ "agentCronJobs.form.time": "Time",
40
46
  "agentCronJobs.form.timeRange.end": "End Time",
41
47
  "agentCronJobs.form.timeRange.start": "Start Time",
48
+ "agentCronJobs.form.times": "times",
49
+ "agentCronJobs.form.timezone": "Timezone",
50
+ "agentCronJobs.form.unlimited": "Run continuously",
42
51
  "agentCronJobs.form.validation.contentRequired": "Task content is required",
43
52
  "agentCronJobs.form.validation.invalidTimeRange": "Start time must be before end time",
44
53
  "agentCronJobs.form.validation.nameRequired": "Task name is required",
@@ -83,6 +92,13 @@
83
92
  "agentCronJobs.weekday.tuesday": "Tuesday",
84
93
  "agentCronJobs.weekday.wednesday": "Wednesday",
85
94
  "agentCronJobs.weekdays": "Weekdays",
95
+ "agentCronJobs.weekdays.fri": "Fri",
96
+ "agentCronJobs.weekdays.mon": "Mon",
97
+ "agentCronJobs.weekdays.sat": "Sat",
98
+ "agentCronJobs.weekdays.sun": "Sun",
99
+ "agentCronJobs.weekdays.thu": "Thu",
100
+ "agentCronJobs.weekdays.tue": "Tue",
101
+ "agentCronJobs.weekdays.wed": "Wed",
86
102
  "agentInfoDescription.basic.avatar": "Avatar",
87
103
  "agentInfoDescription.basic.description": "Description",
88
104
  "agentInfoDescription.basic.name": "Name",
@@ -34,11 +34,20 @@
34
34
  "agentCronJobs.empty.description": "创建您的第一个定时任务以实现智能体自动化",
35
35
  "agentCronJobs.empty.title": "暂无定时任务",
36
36
  "agentCronJobs.enable": "启用",
37
+ "agentCronJobs.form.at": "于",
37
38
  "agentCronJobs.form.content.placeholder": "输入智能体的提示词或指令",
39
+ "agentCronJobs.form.every": "每",
40
+ "agentCronJobs.form.frequency": "执行频率",
41
+ "agentCronJobs.form.hours": "小时",
42
+ "agentCronJobs.form.maxExecutions": "执行",
38
43
  "agentCronJobs.form.maxExecutions.placeholder": "留空表示无限次",
39
44
  "agentCronJobs.form.name.placeholder": "输入任务名称",
45
+ "agentCronJobs.form.time": "时间",
40
46
  "agentCronJobs.form.timeRange.end": "结束时间",
41
47
  "agentCronJobs.form.timeRange.start": "开始时间",
48
+ "agentCronJobs.form.times": "次后停止",
49
+ "agentCronJobs.form.timezone": "时区",
50
+ "agentCronJobs.form.unlimited": "持续执行",
42
51
  "agentCronJobs.form.validation.contentRequired": "任务内容不能为空",
43
52
  "agentCronJobs.form.validation.invalidTimeRange": "开始时间必须早于结束时间",
44
53
  "agentCronJobs.form.validation.nameRequired": "任务名称不能为空",
@@ -83,6 +92,13 @@
83
92
  "agentCronJobs.weekday.tuesday": "星期二",
84
93
  "agentCronJobs.weekday.wednesday": "星期三",
85
94
  "agentCronJobs.weekdays": "工作日",
95
+ "agentCronJobs.weekdays.fri": "周五",
96
+ "agentCronJobs.weekdays.mon": "周一",
97
+ "agentCronJobs.weekdays.sat": "周六",
98
+ "agentCronJobs.weekdays.sun": "周日",
99
+ "agentCronJobs.weekdays.thu": "周四",
100
+ "agentCronJobs.weekdays.tue": "周二",
101
+ "agentCronJobs.weekdays.wed": "周三",
86
102
  "agentInfoDescription.basic.avatar": "头像",
87
103
  "agentInfoDescription.basic.description": "描述",
88
104
  "agentInfoDescription.basic.name": "名称",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/lobehub",
3
- "version": "2.0.13",
3
+ "version": "2.1.1",
4
4
  "description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -66,6 +66,6 @@ export const CHANGELOG_URL = urlJoin(OFFICIAL_SITE, 'changelog/versions');
66
66
 
67
67
  export const DOWNLOAD_URL = {
68
68
  android: 'https://play.google.com/store/apps/details?id=com.lobehub.app',
69
- default: urlJoin(OFFICIAL_SITE, '/download'),
69
+ default: urlJoin(OFFICIAL_SITE, '/downloads'),
70
70
  ios: 'https://testflight.apple.com/join/2ZbjX4Qp',
71
71
  } as const;
@@ -26,9 +26,11 @@ const CronTopicList = memo<CronTopicListProps>(({ itemKey }) => {
26
26
  s.activeAgentId,
27
27
  s.useFetchCronTopicsWithJobInfo,
28
28
  ]);
29
- const { data: cronTopicsGroupsWithJobInfo = [], isLoading } =
30
- useFetchCronTopicsWithJobInfo(agentId);
31
29
  const enableBusinessFeatures = useServerConfigStore(serverConfigSelectors.enableBusinessFeatures);
30
+ const { data: cronTopicsGroupsWithJobInfo = [], isLoading } = useFetchCronTopicsWithJobInfo(
31
+ agentId,
32
+ enableBusinessFeatures,
33
+ );
32
34
 
33
35
  const handleCreateCronJob = useCallback(() => {
34
36
  if (!agentId) return;
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import {
2
4
  ReactCodePlugin,
3
5
  ReactCodemirrorPlugin,
@@ -8,12 +10,19 @@ import {
8
10
  ReactTablePlugin,
9
11
  } from '@lobehub/editor';
10
12
  import { Editor, useEditor } from '@lobehub/editor/react';
11
- import { Flexbox, Icon, Text } from '@lobehub/ui';
12
- import { Card } from 'antd';
13
- import { Clock } from 'lucide-react';
13
+ import { FormGroup } from '@lobehub/ui';
14
+ import { createStaticStyles } from 'antd-style';
14
15
  import { memo, useCallback, useEffect, useRef } from 'react';
15
16
  import { useTranslation } from 'react-i18next';
16
17
 
18
+ const styles = createStaticStyles(({ css }) => ({
19
+ editorWrapper: css`
20
+ min-height: 200px;
21
+ padding-block: 8px;
22
+ padding-inline: 0;
23
+ `,
24
+ }));
25
+
17
26
  interface CronJobContentEditorProps {
18
27
  enableRichRender: boolean;
19
28
  initialValue: string;
@@ -26,12 +35,10 @@ const CronJobContentEditor = memo<CronJobContentEditorProps>(
26
35
  const editor = useEditor();
27
36
  const currentValueRef = useRef(initialValue);
28
37
 
29
- // Update currentValueRef when initialValue changes
30
38
  useEffect(() => {
31
39
  currentValueRef.current = initialValue;
32
40
  }, [initialValue]);
33
41
 
34
- // Initialize editor content when editor is ready
35
42
  useEffect(() => {
36
43
  if (!editor) return;
37
44
  try {
@@ -48,7 +55,6 @@ const CronJobContentEditor = memo<CronJobContentEditorProps>(
48
55
  }
49
56
  }, [editor, enableRichRender, initialValue]);
50
57
 
51
- // Handle content changes
52
58
  const handleContentChange = useCallback(
53
59
  (e: any) => {
54
60
  const nextContent = enableRichRender
@@ -57,7 +63,6 @@ const CronJobContentEditor = memo<CronJobContentEditorProps>(
57
63
 
58
64
  const finalContent = nextContent || '';
59
65
 
60
- // Only call onChange if content actually changed
61
66
  if (finalContent !== currentValueRef.current) {
62
67
  currentValueRef.current = finalContent;
63
68
  onChange(finalContent);
@@ -67,43 +72,33 @@ const CronJobContentEditor = memo<CronJobContentEditorProps>(
67
72
  );
68
73
 
69
74
  return (
70
- <Flexbox gap={12}>
71
- <Flexbox align="center" gap={6} horizontal>
72
- <Icon icon={Clock} size={16} />
73
- <Text style={{ fontWeight: 600 }}>{t('agentCronJobs.content')}</Text>
74
- </Flexbox>
75
- <Card
76
- size="small"
77
- style={{ borderRadius: 12, overflow: 'hidden' }}
78
- styles={{ body: { padding: 0 } }}
79
- >
80
- <Flexbox padding={16} style={{ minHeight: 220 }}>
81
- <Editor
82
- content={''}
83
- editor={editor}
84
- lineEmptyPlaceholder={t('agentCronJobs.form.content.placeholder')}
85
- onTextChange={handleContentChange}
86
- placeholder={t('agentCronJobs.form.content.placeholder')}
87
- plugins={
88
- enableRichRender
89
- ? [
90
- ReactListPlugin,
91
- ReactCodePlugin,
92
- ReactCodemirrorPlugin,
93
- ReactHRPlugin,
94
- ReactLinkPlugin,
95
- ReactTablePlugin,
96
- ReactMathPlugin,
97
- ]
98
- : undefined
99
- }
100
- style={{ paddingBottom: 48 }}
101
- type={'text'}
102
- variant={'chat'}
103
- />
104
- </Flexbox>
105
- </Card>
106
- </Flexbox>
75
+ <FormGroup title={t('agentCronJobs.content')} variant="filled">
76
+ <div className={styles.editorWrapper}>
77
+ <Editor
78
+ content={''}
79
+ editor={editor}
80
+ lineEmptyPlaceholder={t('agentCronJobs.form.content.placeholder')}
81
+ onTextChange={handleContentChange}
82
+ placeholder={t('agentCronJobs.form.content.placeholder')}
83
+ plugins={
84
+ enableRichRender
85
+ ? [
86
+ ReactListPlugin,
87
+ ReactCodePlugin,
88
+ ReactCodemirrorPlugin,
89
+ ReactHRPlugin,
90
+ ReactLinkPlugin,
91
+ ReactTablePlugin,
92
+ ReactMathPlugin,
93
+ ]
94
+ : undefined
95
+ }
96
+ style={{ paddingBottom: 48 }}
97
+ type={'text'}
98
+ variant={'chat'}
99
+ />
100
+ </div>
101
+ </FormGroup>
107
102
  );
108
103
  },
109
104
  );
@@ -1,8 +1,19 @@
1
- import { Flexbox, Input } from '@lobehub/ui';
2
- import { Switch } from 'antd';
1
+ 'use client';
2
+
3
+ import { Flexbox, Input, LobeSwitch as Switch } from '@lobehub/ui';
4
+ import { createStaticStyles } from 'antd-style';
3
5
  import { memo } from 'react';
4
6
  import { useTranslation } from 'react-i18next';
5
7
 
8
+ const styles = createStaticStyles(({ css }) => ({
9
+ titleInput: css`
10
+ flex: 1;
11
+ font-size: 28px;
12
+ font-weight: 500;
13
+ line-height: 1.4;
14
+ `,
15
+ }));
16
+
6
17
  interface CronJobHeaderProps {
7
18
  enabled?: boolean;
8
19
  isNewJob?: boolean;
@@ -17,30 +28,26 @@ const CronJobHeader = memo<CronJobHeaderProps>(
17
28
  const { t } = useTranslation(['setting', 'common']);
18
29
 
19
30
  return (
20
- <Flexbox gap={16}>
21
- {/* Title Input */}
31
+ <Flexbox
32
+ align="center"
33
+ gap={16}
34
+ horizontal
35
+ justify="space-between"
36
+ style={{ marginBottom: 8 }}
37
+ >
22
38
  <Input
39
+ className={styles.titleInput}
23
40
  onChange={(e) => onNameChange(e.target.value)}
24
41
  placeholder={t('agentCronJobs.form.name.placeholder')}
25
- style={{
26
- fontSize: 28,
27
- fontWeight: 600,
28
- padding: 0,
29
- }}
30
42
  value={name}
31
- variant={'borderless'}
43
+ variant="borderless"
32
44
  />
33
-
34
- {/* Controls Row */}
35
45
  {!isNewJob && (
36
- <Flexbox align="center" gap={12} horizontal>
37
- {/* Enable/Disable Switch */}
38
- <Switch
39
- checked={enabled ?? false}
40
- loading={isTogglingEnabled}
41
- onChange={onToggleEnabled}
42
- />
43
- </Flexbox>
46
+ <Switch
47
+ checked={enabled ?? false}
48
+ loading={isTogglingEnabled}
49
+ onChange={onToggleEnabled}
50
+ />
44
51
  )}
45
52
  </Flexbox>
46
53
  );
@@ -1,3 +1,5 @@
1
+ 'use client';
2
+
1
3
  import { Button, Flexbox } from '@lobehub/ui';
2
4
  import { Save } from 'lucide-react';
3
5
  import { memo } from 'react';
@@ -13,13 +15,13 @@ const CronJobSaveButton = memo<CronJobSaveButtonProps>(({ disabled, loading, onS
13
15
  const { t } = useTranslation('setting');
14
16
 
15
17
  return (
16
- <Flexbox paddingBlock={16}>
18
+ <Flexbox paddingBlock={8}>
17
19
  <Button
18
20
  disabled={disabled}
19
21
  icon={Save}
20
22
  loading={loading}
21
23
  onClick={onSave}
22
- style={{ width: 200 }}
24
+ style={{ maxWidth: 200, width: '100%' }}
23
25
  type="primary"
24
26
  >
25
27
  {t('agentCronJobs.saveAsNew')}