@lobehub/chat 1.33.4 → 1.34.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/.i18nrc.js +8 -2
- package/.releaserc.js +10 -1
- package/CHANGELOG.md +51 -16624
- package/changelog/CHANGELOG.v0.md +16621 -0
- package/changelog/v0.json +6064 -0
- package/changelog/v1.json +3356 -0
- package/docs/changelog/2024-11-25-november-providers.mdx +19 -0
- package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +17 -0
- package/docs/changelog/index.json +12 -0
- package/docs/changelog/schema.json +70 -0
- package/docs/self-hosting/advanced/auth/clerk.mdx +19 -23
- package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +5 -4
- package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +2 -4
- package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +3 -5
- package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +2 -2
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +49 -44
- package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +42 -41
- package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +29 -21
- package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +2 -1
- package/docs/self-hosting/advanced/auth.mdx +10 -10
- package/docs/self-hosting/advanced/auth.zh-CN.mdx +10 -10
- package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +1 -1
- package/docs/self-hosting/advanced/model-list.mdx +1 -1
- package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +17 -12
- package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +33 -20
- package/docs/self-hosting/advanced/s3.mdx +31 -28
- package/docs/self-hosting/advanced/s3.zh-CN.mdx +1 -0
- package/docs/self-hosting/advanced/webrtc.mdx +1 -0
- package/docs/self-hosting/environment-variables/s3.mdx +4 -3
- package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +1 -0
- package/docs/self-hosting/environment-variables.mdx +6 -9
- package/docs/self-hosting/platform/alibaba-cloud.mdx +1 -2
- package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +1 -2
- package/docs/self-hosting/platform/btpanel.mdx +7 -13
- package/docs/self-hosting/platform/btpanel.zh-CN.mdx +8 -13
- package/docs/self-hosting/platform/docker.zh-CN.mdx +2 -1
- package/docs/self-hosting/platform/netlify.zh-CN.mdx +2 -1
- package/docs/self-hosting/server-database/docker.mdx +18 -5
- package/docs/self-hosting/server-database/docker.zh-CN.mdx +9 -6
- package/docs/self-hosting/server-database/netlify.mdx +0 -1
- package/docs/self-hosting/server-database/railway.mdx +0 -1
- package/docs/self-hosting/server-database/repocloud.mdx +5 -2
- package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +23 -3
- package/docs/self-hosting/server-database/sealos.mdx +3 -0
- package/docs/self-hosting/server-database/vercel.mdx +35 -32
- package/docs/self-hosting/server-database/vercel.zh-CN.mdx +25 -25
- package/docs/self-hosting/server-database/zeabur.mdx +2 -2
- package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +3 -4
- package/docs/self-hosting/server-database.mdx +23 -8
- package/docs/self-hosting/start.mdx +8 -2
- package/docs/usage/features/database.zh-CN.mdx +1 -1
- package/docs/usage/foundation/text2image.mdx +1 -2
- package/docs/usage/foundation/text2image.zh-CN.mdx +1 -3
- package/docs/usage/providers/ai21.mdx +14 -15
- package/docs/usage/providers/ai21.zh-CN.mdx +1 -3
- package/docs/usage/providers/ai360.mdx +14 -15
- package/docs/usage/providers/ai360.zh-CN.mdx +1 -3
- package/docs/usage/providers/cloudflare.mdx +1 -1
- package/docs/usage/providers/fireworksai.mdx +19 -19
- package/docs/usage/providers/fireworksai.zh-CN.mdx +1 -3
- package/docs/usage/providers/github.mdx +22 -21
- package/docs/usage/providers/github.zh-CN.mdx +6 -6
- package/docs/usage/providers/hunyuan.mdx +17 -18
- package/docs/usage/providers/hunyuan.zh-CN.mdx +1 -3
- package/docs/usage/providers/siliconcloud.mdx +14 -15
- package/docs/usage/providers/siliconcloud.zh-CN.mdx +3 -5
- package/docs/usage/providers/spark.mdx +17 -18
- package/docs/usage/providers/spark.zh-CN.mdx +1 -3
- package/docs/usage/providers/upstage.mdx +14 -15
- package/docs/usage/providers/upstage.zh-CN.mdx +1 -3
- package/docs/usage/providers/wenxin.mdx +17 -18
- package/docs/usage/providers/wenxin.zh-CN.mdx +1 -3
- package/docs/usage/providers/zeroone.mdx +2 -2
- package/locales/ar/chat.json +7 -0
- package/locales/ar/common.json +2 -0
- package/locales/ar/models.json +24 -0
- package/locales/ar/providers.json +3 -0
- package/locales/ar/setting.json +5 -0
- package/locales/ar/thread.json +5 -0
- package/locales/bg-BG/chat.json +7 -0
- package/locales/bg-BG/common.json +2 -0
- package/locales/bg-BG/models.json +24 -0
- package/locales/bg-BG/providers.json +3 -0
- package/locales/bg-BG/setting.json +5 -0
- package/locales/bg-BG/thread.json +5 -0
- package/locales/de-DE/chat.json +7 -0
- package/locales/de-DE/common.json +2 -0
- package/locales/de-DE/models.json +24 -0
- package/locales/de-DE/providers.json +3 -0
- package/locales/de-DE/setting.json +5 -0
- package/locales/de-DE/thread.json +5 -0
- package/locales/en-US/chat.json +7 -0
- package/locales/en-US/common.json +2 -0
- package/locales/en-US/models.json +24 -0
- package/locales/en-US/providers.json +3 -0
- package/locales/en-US/setting.json +5 -0
- package/locales/en-US/thread.json +5 -0
- package/locales/es-ES/chat.json +7 -0
- package/locales/es-ES/common.json +2 -0
- package/locales/es-ES/models.json +24 -0
- package/locales/es-ES/providers.json +3 -0
- package/locales/es-ES/setting.json +5 -0
- package/locales/es-ES/thread.json +5 -0
- package/locales/fa-IR/chat.json +7 -0
- package/locales/fa-IR/common.json +2 -0
- package/locales/fa-IR/models.json +24 -0
- package/locales/fa-IR/providers.json +3 -0
- package/locales/fa-IR/setting.json +5 -0
- package/locales/fa-IR/thread.json +5 -0
- package/locales/fr-FR/chat.json +7 -0
- package/locales/fr-FR/common.json +2 -0
- package/locales/fr-FR/models.json +24 -0
- package/locales/fr-FR/providers.json +3 -0
- package/locales/fr-FR/setting.json +5 -0
- package/locales/fr-FR/thread.json +5 -0
- package/locales/it-IT/chat.json +7 -0
- package/locales/it-IT/common.json +2 -0
- package/locales/it-IT/models.json +24 -0
- package/locales/it-IT/providers.json +3 -0
- package/locales/it-IT/setting.json +5 -0
- package/locales/it-IT/thread.json +5 -0
- package/locales/ja-JP/chat.json +7 -0
- package/locales/ja-JP/common.json +2 -0
- package/locales/ja-JP/models.json +24 -0
- package/locales/ja-JP/providers.json +3 -0
- package/locales/ja-JP/setting.json +5 -0
- package/locales/ja-JP/thread.json +5 -0
- package/locales/ko-KR/chat.json +7 -0
- package/locales/ko-KR/common.json +2 -0
- package/locales/ko-KR/models.json +24 -0
- package/locales/ko-KR/providers.json +3 -0
- package/locales/ko-KR/setting.json +5 -0
- package/locales/ko-KR/thread.json +5 -0
- package/locales/nl-NL/chat.json +7 -0
- package/locales/nl-NL/common.json +2 -0
- package/locales/nl-NL/models.json +24 -0
- package/locales/nl-NL/providers.json +3 -0
- package/locales/nl-NL/setting.json +5 -0
- package/locales/nl-NL/thread.json +5 -0
- package/locales/pl-PL/chat.json +7 -0
- package/locales/pl-PL/common.json +2 -0
- package/locales/pl-PL/models.json +24 -0
- package/locales/pl-PL/providers.json +3 -0
- package/locales/pl-PL/setting.json +5 -0
- package/locales/pl-PL/thread.json +5 -0
- package/locales/pt-BR/chat.json +7 -0
- package/locales/pt-BR/common.json +2 -0
- package/locales/pt-BR/models.json +24 -0
- package/locales/pt-BR/providers.json +3 -0
- package/locales/pt-BR/setting.json +5 -0
- package/locales/pt-BR/thread.json +5 -0
- package/locales/ru-RU/chat.json +7 -0
- package/locales/ru-RU/common.json +2 -0
- package/locales/ru-RU/models.json +24 -0
- package/locales/ru-RU/providers.json +3 -0
- package/locales/ru-RU/setting.json +5 -0
- package/locales/ru-RU/thread.json +5 -0
- package/locales/tr-TR/chat.json +7 -0
- package/locales/tr-TR/common.json +2 -0
- package/locales/tr-TR/models.json +24 -0
- package/locales/tr-TR/providers.json +3 -0
- package/locales/tr-TR/setting.json +5 -0
- package/locales/tr-TR/thread.json +5 -0
- package/locales/vi-VN/chat.json +7 -0
- package/locales/vi-VN/common.json +2 -0
- package/locales/vi-VN/models.json +24 -0
- package/locales/vi-VN/providers.json +3 -0
- package/locales/vi-VN/setting.json +5 -0
- package/locales/vi-VN/thread.json +5 -0
- package/locales/zh-CN/chat.json +7 -0
- package/locales/zh-CN/common.json +2 -0
- package/locales/zh-CN/models.json +24 -0
- package/locales/zh-CN/providers.json +3 -0
- package/locales/zh-CN/setting.json +5 -0
- package/locales/zh-CN/thread.json +5 -0
- package/locales/zh-TW/chat.json +7 -0
- package/locales/zh-TW/common.json +2 -0
- package/locales/zh-TW/models.json +24 -0
- package/locales/zh-TW/providers.json +3 -0
- package/locales/zh-TW/setting.json +5 -0
- package/locales/zh-TW/thread.json +5 -0
- package/package.json +6 -1
- package/scripts/changelogWorkflow/buildStaticChangelog.ts +135 -0
- package/scripts/changelogWorkflow/const.ts +11 -0
- package/scripts/changelogWorkflow/index.ts +10 -0
- package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +2 -0
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatHydration/index.tsx +11 -2
- package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/index.tsx +7 -9
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx +7 -2
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/Thread.tsx +62 -0
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/ThreadItem.tsx +68 -0
- package/src/app/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +62 -2
- package/src/app/(main)/chat/(workspace)/@conversation/features/ThreadHydration.tsx +47 -0
- package/src/app/(main)/chat/(workspace)/@portal/_layout/Desktop.tsx +3 -2
- package/src/app/(main)/chat/(workspace)/@portal/_layout/Mobile.tsx +47 -6
- package/src/app/(main)/chat/(workspace)/@topic/features/SkeletonList.tsx +3 -2
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ByTimeMode/index.tsx +10 -3
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/FlatMode/index.tsx +1 -1
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ThreadItem/Content.tsx +164 -0
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ThreadItem/index.tsx +98 -0
- package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{TopicItem.tsx → TopicItem/index.tsx} +33 -22
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/Portal.tsx +12 -5
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +1 -2
- package/src/const/message.ts +2 -0
- package/src/const/settings/systemAgent.ts +1 -0
- package/src/database/server/migrations/0012_add_thread.sql +39 -0
- package/src/database/server/migrations/meta/0012_snapshot.json +3671 -0
- package/src/database/server/migrations/meta/_journal.json +7 -0
- package/src/database/server/models/_template.ts +2 -2
- package/src/database/server/models/message.ts +1 -0
- package/src/database/server/models/thread.ts +79 -0
- package/src/database/server/schemas/lobechat/message.ts +2 -1
- package/src/database/server/schemas/lobechat/relations.ts +13 -1
- package/src/database/server/schemas/lobechat/topic.ts +30 -1
- package/src/database/server/utils/idGenerator.ts +1 -0
- package/src/features/ChatInput/ActionBar/Token/TokenTag.tsx +6 -4
- package/src/features/ChatInput/ActionBar/Token/index.tsx +24 -5
- package/src/features/ChatInput/ActionBar/config.ts +3 -2
- package/src/features/ChatInput/Desktop/index.tsx +15 -7
- package/src/features/ChatInput/Mobile/index.tsx +4 -4
- package/src/features/Conversation/Actions/Assistant.tsx +24 -5
- package/src/features/Conversation/Actions/User.tsx +21 -4
- package/src/features/Conversation/Actions/index.ts +1 -66
- package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/index.tsx +3 -1
- package/src/features/Conversation/Messages/{Tool/index.tsx → Assistant/ToolCallItem/Tool.tsx} +10 -11
- package/src/features/Conversation/Messages/Assistant/ToolCallItem/index.tsx +5 -3
- package/src/features/Conversation/Messages/Assistant/index.tsx +22 -14
- package/src/features/Conversation/Messages/index.ts +0 -2
- package/src/features/Conversation/components/AutoScroll.tsx +1 -1
- package/src/features/Conversation/components/ChatItem/ActionsBar.tsx +79 -5
- package/src/features/Conversation/components/ChatItem/InPortalThreadContext.ts +3 -0
- package/src/features/Conversation/components/ChatItem/index.tsx +16 -5
- package/src/features/Conversation/components/MarkdownElements/LobeArtifact/Render/index.tsx +9 -1
- package/src/features/Conversation/components/ThreadDivider/index.tsx +19 -0
- package/src/features/Conversation/hooks/useChatListActionsBar.tsx +19 -4
- package/src/features/Portal/Thread/Chat/ChatInput/Footer.tsx +90 -0
- package/src/features/Portal/Thread/Chat/ChatInput/TextArea.tsx +30 -0
- package/src/features/Portal/Thread/Chat/ChatInput/index.tsx +66 -0
- package/src/features/Portal/Thread/Chat/ChatInput/useSend.ts +50 -0
- package/src/features/Portal/Thread/Chat/ChatItem.tsx +62 -0
- package/src/features/Portal/Thread/Chat/ChatList.tsx +49 -0
- package/src/features/Portal/Thread/Chat/ThreadDivider/index.tsx +19 -0
- package/src/features/Portal/Thread/Chat/index.tsx +28 -0
- package/src/features/Portal/Thread/Header/Active.tsx +35 -0
- package/src/features/Portal/Thread/Header/New.tsx +37 -0
- package/src/features/Portal/Thread/Header/Title.tsx +18 -0
- package/src/features/Portal/Thread/Header/index.tsx +20 -0
- package/src/features/Portal/Thread/hook.ts +8 -0
- package/src/features/Portal/Thread/index.ts +12 -0
- package/src/features/Portal/router.tsx +2 -1
- package/src/hooks/useFetchTopics.ts +7 -1
- package/src/locales/default/chat.ts +8 -1
- package/src/locales/default/common.ts +3 -0
- package/src/locales/default/index.ts +2 -0
- package/src/locales/default/setting.ts +5 -0
- package/src/locales/default/thread.ts +5 -0
- package/src/server/routers/lambda/index.ts +2 -0
- package/src/server/routers/lambda/thread.ts +83 -0
- package/src/services/thread.ts +54 -0
- package/src/store/chat/initialState.ts +3 -0
- package/src/store/chat/selectors.ts +2 -1
- package/src/store/chat/slices/aiChat/actions/__tests__/generateAIChat.test.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/__tests__/rag.test.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/generateAIChat.ts +31 -8
- package/src/store/chat/slices/aiChat/actions/rag.ts +1 -1
- package/src/store/chat/slices/message/selectors.test.ts +3 -3
- package/src/store/chat/slices/message/selectors.ts +50 -29
- package/src/store/chat/slices/plugin/action.ts +26 -8
- package/src/store/chat/slices/portal/action.ts +1 -0
- package/src/store/chat/slices/portal/initialState.ts +1 -0
- package/src/store/chat/slices/portal/selectors/thread.ts +17 -0
- package/src/store/chat/slices/portal/selectors.ts +2 -0
- package/src/store/chat/slices/thread/action.ts +326 -0
- package/src/store/chat/slices/thread/initialState.ts +34 -0
- package/src/store/chat/slices/thread/reducer.ts +48 -0
- package/src/store/chat/slices/thread/selectors/index.ts +202 -0
- package/src/store/chat/slices/thread/selectors/util.ts +22 -0
- package/src/store/chat/slices/topic/action.ts +5 -1
- package/src/store/chat/store.ts +5 -2
- package/src/store/global/initialState.ts +4 -0
- package/src/store/global/selectors.ts +4 -0
- package/src/store/user/slices/settings/selectors/systemAgent.ts +2 -0
- package/src/types/message/index.ts +17 -1
- package/src/types/topic/index.ts +1 -0
- package/src/types/topic/thread.ts +42 -0
- package/src/types/user/settings/systemAgent.ts +1 -0
- package/src/app/(main)/chat/(workspace)/@portal/features/Header.tsx +0 -11
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/PortalModal.tsx +0 -35
- /package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/SendMore.tsx +0 -0
- /package/src/{features → app/(main)/chat/(workspace)/@conversation/features}/ChatInput/Desktop/Footer/ShortcutHint.tsx +0 -0
- /package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{DefaultContent.tsx → TopicItem/DefaultContent.tsx} +0 -0
- /package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/{TopicContent.tsx → TopicItem/TopicContent.tsx} +0 -0
- /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/PluginResultJSON.tsx +0 -0
- /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/Settings.tsx +0 -0
- /package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/style.ts +0 -0
@@ -35,6 +35,7 @@ export interface SystemStatus {
|
|
35
35
|
expandSessionGroupKeys: string[];
|
36
36
|
filePanelWidth: number;
|
37
37
|
hidePWAInstaller?: boolean;
|
38
|
+
hideThreadLimitAlert?: boolean;
|
38
39
|
inputHeight: number;
|
39
40
|
mobileShowPortal?: boolean;
|
40
41
|
mobileShowTopic?: boolean;
|
@@ -43,6 +44,7 @@ export interface SystemStatus {
|
|
43
44
|
showFilePanel?: boolean;
|
44
45
|
showSessionPanel?: boolean;
|
45
46
|
showSystemRole?: boolean;
|
47
|
+
threadInputHeight: number;
|
46
48
|
zenMode?: boolean;
|
47
49
|
}
|
48
50
|
|
@@ -61,6 +63,7 @@ export const INITIAL_STATUS = {
|
|
61
63
|
expandSessionGroupKeys: [SessionDefaultGroup.Pinned, SessionDefaultGroup.Default],
|
62
64
|
filePanelWidth: 320,
|
63
65
|
hidePWAInstaller: false,
|
66
|
+
hideThreadLimitAlert: false,
|
64
67
|
inputHeight: 200,
|
65
68
|
mobileShowTopic: false,
|
66
69
|
sessionsWidth: 320,
|
@@ -68,6 +71,7 @@ export const INITIAL_STATUS = {
|
|
68
71
|
showFilePanel: true,
|
69
72
|
showSessionPanel: true,
|
70
73
|
showSystemRole: false,
|
74
|
+
threadInputHeight: 200,
|
71
75
|
zenMode: false,
|
72
76
|
} satisfies SystemStatus;
|
73
77
|
|
@@ -18,6 +18,8 @@ const inZenMode = (s: GlobalStore) => s.status.zenMode;
|
|
18
18
|
const sessionWidth = (s: GlobalStore) => s.status.sessionsWidth;
|
19
19
|
const filePanelWidth = (s: GlobalStore) => s.status.filePanelWidth;
|
20
20
|
const inputHeight = (s: GlobalStore) => s.status.inputHeight;
|
21
|
+
const threadInputHeight = (s: GlobalStore) => s.status.threadInputHeight;
|
22
|
+
const systemStatus = (s: GlobalStore) => s.status;
|
21
23
|
|
22
24
|
export const systemStatusSelectors = {
|
23
25
|
filePanelWidth,
|
@@ -33,4 +35,6 @@ export const systemStatusSelectors = {
|
|
33
35
|
showFilePanel,
|
34
36
|
showSessionPanel,
|
35
37
|
showSystemRole,
|
38
|
+
systemStatus,
|
39
|
+
threadInputHeight,
|
36
40
|
};
|
@@ -9,6 +9,7 @@ const currentSystemAgent = (s: UserStore) =>
|
|
9
9
|
|
10
10
|
const translation = (s: UserStore) => currentSystemAgent(s).translation;
|
11
11
|
const topic = (s: UserStore) => currentSystemAgent(s).topic;
|
12
|
+
const thread = (s: UserStore) => currentSystemAgent(s).thread;
|
12
13
|
const agentMeta = (s: UserStore) => currentSystemAgent(s).agentMeta;
|
13
14
|
const queryRewrite = (s: UserStore) => currentSystemAgent(s).queryRewrite;
|
14
15
|
const historyCompress = (s: UserStore) => currentSystemAgent(s).historyCompress;
|
@@ -17,6 +18,7 @@ export const systemAgentSelectors = {
|
|
17
18
|
agentMeta,
|
18
19
|
historyCompress,
|
19
20
|
queryRewrite,
|
21
|
+
thread,
|
20
22
|
topic,
|
21
23
|
translation,
|
22
24
|
};
|
@@ -104,8 +104,9 @@ export interface ChatMessage extends BaseDataModel {
|
|
104
104
|
role: MessageRoleType;
|
105
105
|
|
106
106
|
sessionId?: string;
|
107
|
-
|
107
|
+
threadId?: string | null;
|
108
108
|
|
109
|
+
tool_call_id?: string;
|
109
110
|
tools?: ChatToolPayload[];
|
110
111
|
/**
|
111
112
|
* 保存到主题的消息
|
@@ -129,11 +130,16 @@ export interface CreateMessageParams
|
|
129
130
|
fromProvider?: string;
|
130
131
|
role: MessageRoleType;
|
131
132
|
sessionId: string;
|
133
|
+
threadId?: string | null;
|
132
134
|
topicId?: string;
|
133
135
|
traceId?: string;
|
134
136
|
}
|
135
137
|
|
136
138
|
export interface SendMessageParams {
|
139
|
+
/**
|
140
|
+
* create a thread
|
141
|
+
*/
|
142
|
+
createThread?: boolean;
|
137
143
|
files?: UploadFileItem[];
|
138
144
|
/**
|
139
145
|
*
|
@@ -143,3 +149,13 @@ export interface SendMessageParams {
|
|
143
149
|
message: string;
|
144
150
|
onlyAddUserMessage?: boolean;
|
145
151
|
}
|
152
|
+
|
153
|
+
export interface SendThreadMessageParams {
|
154
|
+
/**
|
155
|
+
* create a thread
|
156
|
+
*/
|
157
|
+
createNewThread?: boolean;
|
158
|
+
// files?: UploadFileItem[];
|
159
|
+
message: string;
|
160
|
+
onlyAddUserMessage?: boolean;
|
161
|
+
}
|
package/src/types/topic/index.ts
CHANGED
@@ -0,0 +1,42 @@
|
|
1
|
+
import { z } from 'zod';
|
2
|
+
|
3
|
+
export enum ThreadType {
|
4
|
+
Continuation = 'continuation',
|
5
|
+
Standalone = 'standalone',
|
6
|
+
}
|
7
|
+
|
8
|
+
export enum ThreadStatus {
|
9
|
+
Active = 'active',
|
10
|
+
Archived = 'archived',
|
11
|
+
Deprecated = 'deprecated',
|
12
|
+
}
|
13
|
+
|
14
|
+
export interface ThreadItem {
|
15
|
+
createdAt: Date;
|
16
|
+
id: string;
|
17
|
+
lastActiveAt: Date;
|
18
|
+
parentThreadId?: string;
|
19
|
+
sourceMessageId: string;
|
20
|
+
status: ThreadStatus;
|
21
|
+
title: string;
|
22
|
+
topicId: string;
|
23
|
+
type: ThreadType;
|
24
|
+
updatedAt: Date;
|
25
|
+
userId: string;
|
26
|
+
}
|
27
|
+
|
28
|
+
export interface CreateThreadParams {
|
29
|
+
parentThreadId?: string;
|
30
|
+
sourceMessageId: string;
|
31
|
+
title?: string;
|
32
|
+
topicId: string;
|
33
|
+
type: ThreadType;
|
34
|
+
}
|
35
|
+
|
36
|
+
export const createThreadSchema = z.object({
|
37
|
+
parentThreadId: z.string().optional(),
|
38
|
+
sourceMessageId: z.string(),
|
39
|
+
title: z.string().optional(),
|
40
|
+
topicId: z.string(),
|
41
|
+
type: z.nativeEnum(ThreadType),
|
42
|
+
});
|
@@ -1,35 +0,0 @@
|
|
1
|
-
'use client';
|
2
|
-
|
3
|
-
import { Modal } from '@lobehub/ui';
|
4
|
-
import { PropsWithChildren, memo } from 'react';
|
5
|
-
import { useTranslation } from 'react-i18next';
|
6
|
-
|
7
|
-
import { useGlobalStore } from '@/store/global';
|
8
|
-
import { systemStatusSelectors } from '@/store/global/selectors';
|
9
|
-
|
10
|
-
import { useWorkspaceModal } from '../../features/useWorkspaceModal';
|
11
|
-
|
12
|
-
const PortalModal = memo(({ children }: PropsWithChildren) => {
|
13
|
-
const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
|
14
|
-
systemStatusSelectors.mobileShowPortal(s),
|
15
|
-
s.toggleMobilePortal,
|
16
|
-
]);
|
17
|
-
const [open, setOpen] = useWorkspaceModal(showAgentSettings, toggleConfig);
|
18
|
-
const { t } = useTranslation('portal');
|
19
|
-
|
20
|
-
return (
|
21
|
-
<Modal
|
22
|
-
height={'95%'}
|
23
|
-
onCancel={() => setOpen(false)}
|
24
|
-
open={open}
|
25
|
-
styles={{
|
26
|
-
body: { padding: 0 },
|
27
|
-
}}
|
28
|
-
title={t('title')}
|
29
|
-
>
|
30
|
-
{children}
|
31
|
-
</Modal>
|
32
|
-
);
|
33
|
-
});
|
34
|
-
|
35
|
-
export default PortalModal;
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/Settings.tsx
RENAMED
File without changes
|
/package/src/features/Conversation/Messages/{Tool → Assistant/ToolCallItem}/Inspector/style.ts
RENAMED
File without changes
|