@lobehub/lobehub 2.0.0-next.303 → 2.0.0-next.304
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/CHANGELOG.md +25 -0
- package/apps/desktop/src/common/routes.ts +8 -8
- package/apps/desktop/src/main/const/dir.ts +2 -2
- package/apps/desktop/src/main/const/env.ts +4 -4
- package/apps/desktop/src/main/const/store.ts +3 -3
- package/apps/desktop/src/main/controllers/AuthCtr.ts +1 -1
- package/apps/desktop/src/main/controllers/McpInstallCtr.ts +8 -8
- package/apps/desktop/src/main/controllers/NetworkProxyCtr.ts +9 -9
- package/apps/desktop/src/main/controllers/RemoteServerSyncCtr.ts +8 -8
- package/apps/desktop/src/main/core/App.ts +9 -9
- package/apps/desktop/src/main/core/infrastructure/StaticFileServerManager.ts +2 -2
- package/apps/desktop/src/main/core/ui/ShortcutManager.ts +10 -10
- package/apps/desktop/src/main/core/ui/TrayManager.ts +12 -12
- package/apps/desktop/src/main/locales/resources.ts +4 -4
- package/apps/desktop/src/main/menus/impls/macOS.ts +1 -1
- package/apps/desktop/src/main/menus/types.ts +5 -5
- package/apps/desktop/src/main/modules/updater/configs.ts +10 -10
- package/apps/desktop/src/main/modules/updater/utils.ts +9 -9
- package/apps/desktop/src/main/services/fileSrv.ts +62 -62
- package/apps/desktop/src/main/shortcuts/config.ts +3 -3
- package/apps/desktop/src/main/types/protocol.ts +12 -12
- package/apps/desktop/src/main/utils/file-system.ts +2 -2
- package/apps/desktop/src/main/utils/logger.ts +5 -5
- package/apps/desktop/src/main/utils/protocol.ts +32 -32
- package/changelog/v1.json +9 -0
- package/locales/en-US/plugin.json +1 -0
- package/locales/zh-CN/discover.json +4 -4
- package/locales/zh-CN/plugin.json +1 -0
- package/package.json +1 -1
- package/packages/builtin-tool-group-management/src/client/Inspector/ExecuteAgentTask/index.tsx +78 -0
- package/packages/builtin-tool-group-management/src/client/Inspector/{ExecuteTasks → ExecuteAgentTasks}/index.tsx +1 -5
- package/packages/builtin-tool-group-management/src/client/Inspector/index.ts +4 -2
- package/packages/database/src/schemas/relations.ts +4 -4
- package/src/features/Conversation/ChatList/components/AutoScroll.tsx +3 -9
- package/src/features/Conversation/ChatList/components/VirtualizedList.tsx +2 -6
- package/src/locales/default/plugin.ts +1 -0
|
@@ -5,16 +5,16 @@ import { McpSchema, ProtocolUrlParsed } from '../types/protocol';
|
|
|
5
5
|
export type AppChannel = 'stable' | 'beta' | 'nightly';
|
|
6
6
|
|
|
7
7
|
export const getProtocolScheme = (): string => {
|
|
8
|
-
//
|
|
8
|
+
// In Electron environment, version can be determined in multiple ways
|
|
9
9
|
const bundleId = app.name;
|
|
10
10
|
const appPath = app.getPath('exe');
|
|
11
11
|
|
|
12
|
-
//
|
|
12
|
+
// Determine by bundle identifier
|
|
13
13
|
if (bundleId?.toLowerCase().includes('nightly')) return 'lobehub-nightly';
|
|
14
14
|
if (bundleId?.toLowerCase().includes('beta')) return 'lobehub-beta';
|
|
15
15
|
if (bundleId?.includes('dev')) return 'lobehub-dev';
|
|
16
16
|
|
|
17
|
-
//
|
|
17
|
+
// Determine by executable file path
|
|
18
18
|
if (appPath?.toLowerCase().includes('nightly')) return 'lobehub-nightly';
|
|
19
19
|
if (appPath?.toLowerCase().includes('beta')) return 'lobehub-beta';
|
|
20
20
|
if (appPath?.includes('dev')) return 'lobehub-dev';
|
|
@@ -39,25 +39,25 @@ export const getVersionInfo = (): { channel: AppChannel; protocolScheme: string
|
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
* @param schema
|
|
44
|
-
* @returns
|
|
42
|
+
* Validate MCP Schema object structure
|
|
43
|
+
* @param schema Object to validate
|
|
44
|
+
* @returns Whether it's a valid MCP Schema
|
|
45
45
|
*/
|
|
46
46
|
function validateMcpSchema(schema: any): schema is McpSchema {
|
|
47
47
|
if (!schema || typeof schema !== 'object') return false;
|
|
48
48
|
|
|
49
|
-
//
|
|
49
|
+
// Required field validation
|
|
50
50
|
if (typeof schema.identifier !== 'string' || !schema.identifier) return false;
|
|
51
51
|
if (typeof schema.name !== 'string' || !schema.name) return false;
|
|
52
52
|
if (typeof schema.author !== 'string' || !schema.author) return false;
|
|
53
53
|
if (typeof schema.description !== 'string' || !schema.description) return false;
|
|
54
54
|
if (typeof schema.version !== 'string' || !schema.version) return false;
|
|
55
55
|
|
|
56
|
-
//
|
|
56
|
+
// Optional field validation
|
|
57
57
|
if (schema.homepage !== undefined && typeof schema.homepage !== 'string') return false;
|
|
58
58
|
if (schema.icon !== undefined && typeof schema.icon !== 'string') return false;
|
|
59
59
|
|
|
60
|
-
// config
|
|
60
|
+
// config field validation
|
|
61
61
|
if (!schema.config || typeof schema.config !== 'object') return false;
|
|
62
62
|
const config = schema.config;
|
|
63
63
|
|
|
@@ -68,42 +68,42 @@ function validateMcpSchema(schema: any): schema is McpSchema {
|
|
|
68
68
|
} else if (config.type === 'http') {
|
|
69
69
|
if (typeof config.url !== 'string' || !config.url) return false;
|
|
70
70
|
try {
|
|
71
|
-
new URL(config.url); //
|
|
71
|
+
new URL(config.url); // Validate URL format
|
|
72
72
|
} catch {
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
75
|
if (config.headers !== undefined && typeof config.headers !== 'object') return false;
|
|
76
76
|
} else {
|
|
77
|
-
return false; //
|
|
77
|
+
return false; // Unknown config type
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
return true;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* Parse lobehub:// protocol URL (supports multi-version protocols)
|
|
85
85
|
*
|
|
86
|
-
*
|
|
86
|
+
* Supported URL formats:
|
|
87
87
|
* - lobehub://plugin/install?id=figma&schema=xxx&marketId=lobehub
|
|
88
88
|
* - lobehub://plugin/configure?id=xxx&...
|
|
89
89
|
* - lobehub-bet://plugin/install?id=figma&schema=xxx&marketId=lobehub
|
|
90
90
|
* - lobehub-nightly://plugin/install?id=figma&schema=xxx&marketId=lobehub
|
|
91
91
|
* - lobehub-dev://plugin/install?id=figma&schema=xxx&marketId=lobehub
|
|
92
92
|
*
|
|
93
|
-
* @param url
|
|
94
|
-
* @returns
|
|
93
|
+
* @param url Protocol URL
|
|
94
|
+
* @returns Parse result, including basic structure and all query parameters
|
|
95
95
|
*/
|
|
96
96
|
export const parseProtocolUrl = (url: string): ProtocolUrlParsed | null => {
|
|
97
97
|
try {
|
|
98
98
|
const parsedUrl = new URL(url);
|
|
99
99
|
|
|
100
|
-
//
|
|
100
|
+
// Support multiple protocol schemes
|
|
101
101
|
const validProtocols = ['lobehub:', 'lobehub-dev:', 'lobehub-nightly:', 'lobehub-beta:'];
|
|
102
102
|
if (!validProtocols.includes(parsedUrl.protocol)) {
|
|
103
103
|
return null;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
//
|
|
106
|
+
// For custom protocols, after URL parsing:
|
|
107
107
|
// lobehub://plugin/install -> hostname: "plugin", pathname: "/install"
|
|
108
108
|
const urlType = parsedUrl.hostname; // "plugin"
|
|
109
109
|
const pathParts = parsedUrl.pathname.split('/').filter(Boolean); // ["install"]
|
|
@@ -114,7 +114,7 @@ export const parseProtocolUrl = (url: string): ProtocolUrlParsed | null => {
|
|
|
114
114
|
|
|
115
115
|
const action = pathParts[0]; // "install"
|
|
116
116
|
|
|
117
|
-
//
|
|
117
|
+
// Parse all query parameters
|
|
118
118
|
const params: Record<string, string> = {};
|
|
119
119
|
const searchParams = new URLSearchParams(parsedUrl.search);
|
|
120
120
|
|
|
@@ -135,48 +135,48 @@ export const parseProtocolUrl = (url: string): ProtocolUrlParsed | null => {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
/**
|
|
138
|
-
*
|
|
138
|
+
* Generate RFC 0001 compliant protocol URL
|
|
139
139
|
*
|
|
140
|
-
* @param params
|
|
141
|
-
* @returns
|
|
140
|
+
* @param params Protocol parameters
|
|
141
|
+
* @returns Generated protocol URL
|
|
142
142
|
*/
|
|
143
143
|
export function generateRFCProtocolUrl(params: {
|
|
144
|
-
/**
|
|
144
|
+
/** Plugin unique identifier */
|
|
145
145
|
id: string;
|
|
146
146
|
/** Marketplace ID */
|
|
147
147
|
marketId?: string;
|
|
148
|
-
/** MCP Schema
|
|
148
|
+
/** MCP Schema object */
|
|
149
149
|
schema: McpSchema;
|
|
150
|
-
/**
|
|
150
|
+
/** Protocol scheme (default: lobehub) */
|
|
151
151
|
scheme?: string;
|
|
152
152
|
}): string {
|
|
153
153
|
const { id, schema, marketId, scheme = 'lobehub' } = params;
|
|
154
154
|
|
|
155
|
-
//
|
|
155
|
+
// Validate schema.identifier matches id
|
|
156
156
|
if (schema.identifier !== id) {
|
|
157
157
|
throw new Error('Schema identifier must match the id parameter');
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
//
|
|
160
|
+
// Validate schema structure
|
|
161
161
|
if (!validateMcpSchema(schema)) {
|
|
162
162
|
throw new Error('Invalid MCP Schema structure');
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
-
//
|
|
165
|
+
// Build base URL
|
|
166
166
|
const baseUrl = `${scheme}://plugin/install`;
|
|
167
167
|
|
|
168
|
-
//
|
|
168
|
+
// Build query parameters
|
|
169
169
|
const searchParams = new URLSearchParams();
|
|
170
170
|
|
|
171
|
-
//
|
|
171
|
+
// Required parameters
|
|
172
172
|
searchParams.set('type', 'mcp');
|
|
173
173
|
searchParams.set('id', id);
|
|
174
174
|
|
|
175
|
-
//
|
|
175
|
+
// Encode schema - pass JSON string directly, let URLSearchParams auto-encode
|
|
176
176
|
const schemaJson = JSON.stringify(schema);
|
|
177
177
|
searchParams.set('schema', schemaJson);
|
|
178
178
|
|
|
179
|
-
//
|
|
179
|
+
// Optional parameters
|
|
180
180
|
if (marketId) {
|
|
181
181
|
searchParams.set('marketId', marketId);
|
|
182
182
|
}
|
|
@@ -185,7 +185,7 @@ export function generateRFCProtocolUrl(params: {
|
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
|
-
*
|
|
188
|
+
* Generate protocol URL example
|
|
189
189
|
*
|
|
190
190
|
* @example
|
|
191
191
|
* ```typescript
|
package/changelog/v1.json
CHANGED
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"builtins.lobe-group-management.apiName.summarize": "Summarize conversation",
|
|
71
71
|
"builtins.lobe-group-management.apiName.vote": "Start vote",
|
|
72
72
|
"builtins.lobe-group-management.inspector.broadcast.title": "Following Agents speak:",
|
|
73
|
+
"builtins.lobe-group-management.inspector.executeAgentTask.title": "Assigning task to:",
|
|
73
74
|
"builtins.lobe-group-management.inspector.executeAgentTasks.title": "Assigning tasks to:",
|
|
74
75
|
"builtins.lobe-group-management.inspector.speak.title": "Designated Agent speaks:",
|
|
75
76
|
"builtins.lobe-group-management.title": "Group Coordinator",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"assistants.details.overview.title": "概览",
|
|
28
28
|
"assistants.details.related.listTitle": "相关助理",
|
|
29
29
|
"assistants.details.related.more": "查看更多",
|
|
30
|
-
"assistants.details.related.title": "
|
|
30
|
+
"assistants.details.related.title": "相似助理",
|
|
31
31
|
"assistants.details.sidebar.toc": "目录",
|
|
32
32
|
"assistants.details.summary.title": "你可以使用该助理做什么?",
|
|
33
33
|
"assistants.details.systemRole.openingMessage": "开场消息",
|
|
34
34
|
"assistants.details.systemRole.openingQuestions": "开场问题",
|
|
35
|
-
"assistants.details.systemRole.title": "
|
|
35
|
+
"assistants.details.systemRole.title": "助理简介",
|
|
36
36
|
"assistants.details.version.empty": "暂无历史版本",
|
|
37
37
|
"assistants.details.version.status.archived": "已归档",
|
|
38
38
|
"assistants.details.version.status.deprecated": "已拒绝",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"assistants.status.support": "有问题请复制链接发送到 <email>support@lobehub.com</email> 咨询",
|
|
77
77
|
"assistants.status.unpublished.subtitle": "该助理正在审核中。若你需要确认状态,请复制链接并发送至 <email>support@lobehub.com</email>",
|
|
78
78
|
"assistants.status.unpublished.title": "该助理正在审核",
|
|
79
|
-
"assistants.suggestions": "
|
|
80
|
-
"assistants.systemRole": "
|
|
79
|
+
"assistants.suggestions": "相似助理",
|
|
80
|
+
"assistants.systemRole": "助理简介",
|
|
81
81
|
"assistants.tokenUsage": "助理提示词 Token 使用量",
|
|
82
82
|
"assistants.try": "试一下",
|
|
83
83
|
"assistants.withKnowledge": "该助理附带资源库",
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"builtins.lobe-group-management.apiName.summarize": "总结对话",
|
|
71
71
|
"builtins.lobe-group-management.apiName.vote": "发起投票",
|
|
72
72
|
"builtins.lobe-group-management.inspector.broadcast.title": "以下 Agent 发言:",
|
|
73
|
+
"builtins.lobe-group-management.inspector.executeAgentTask.title": "分配任务给:",
|
|
73
74
|
"builtins.lobe-group-management.inspector.executeAgentTasks.title": "分配任务给:",
|
|
74
75
|
"builtins.lobe-group-management.inspector.speak.title": "指定 Agent 发言:",
|
|
75
76
|
"builtins.lobe-group-management.title": "群组协调",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/lobehub",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.304",
|
|
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",
|
package/packages/builtin-tool-group-management/src/client/Inspector/ExecuteAgentTask/index.tsx
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_AVATAR } from '@lobechat/const';
|
|
4
|
+
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
5
|
+
import { Avatar, Flexbox } from '@lobehub/ui';
|
|
6
|
+
import { createStaticStyles, cx, useTheme } from 'antd-style';
|
|
7
|
+
import { memo } from 'react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
|
|
10
|
+
import { useAgentGroupStore } from '@/store/agentGroup';
|
|
11
|
+
import { agentGroupSelectors } from '@/store/agentGroup/selectors';
|
|
12
|
+
import { highlightTextStyles, shinyTextStyles } from '@/styles';
|
|
13
|
+
|
|
14
|
+
import type { ExecuteTaskParams } from '../../../types';
|
|
15
|
+
|
|
16
|
+
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
17
|
+
root: css`
|
|
18
|
+
overflow: hidden;
|
|
19
|
+
display: flex;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
align-items: center;
|
|
22
|
+
`,
|
|
23
|
+
title: css`
|
|
24
|
+
flex-shrink: 0;
|
|
25
|
+
color: ${cssVar.colorTextSecondary};
|
|
26
|
+
white-space: nowrap;
|
|
27
|
+
`,
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
export const ExecuteAgentTaskInspector = memo<BuiltinInspectorProps<ExecuteTaskParams>>(
|
|
31
|
+
({ args, partialArgs, isArgumentsStreaming }) => {
|
|
32
|
+
const { t } = useTranslation('plugin');
|
|
33
|
+
|
|
34
|
+
const agentId = args?.agentId || partialArgs?.agentId;
|
|
35
|
+
|
|
36
|
+
// Get active group ID and agent from store
|
|
37
|
+
const activeGroupId = useAgentGroupStore(agentGroupSelectors.activeGroupId);
|
|
38
|
+
const agent = useAgentGroupStore((s) =>
|
|
39
|
+
activeGroupId && agentId
|
|
40
|
+
? agentGroupSelectors.getAgentByIdFromGroup(activeGroupId, agentId)(s)
|
|
41
|
+
: undefined,
|
|
42
|
+
);
|
|
43
|
+
const theme = useTheme();
|
|
44
|
+
|
|
45
|
+
if (isArgumentsStreaming && !agent) {
|
|
46
|
+
return (
|
|
47
|
+
<div className={cx(styles.root, shinyTextStyles.shinyText)}>
|
|
48
|
+
<span>{t('builtins.lobe-group-management.apiName.executeAgentTask')}</span>
|
|
49
|
+
</div>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const agentName = agent?.title || agentId;
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<Flexbox
|
|
57
|
+
align={'center'}
|
|
58
|
+
className={cx(styles.root, isArgumentsStreaming && shinyTextStyles.shinyText)}
|
|
59
|
+
gap={8}
|
|
60
|
+
horizontal
|
|
61
|
+
>
|
|
62
|
+
<span className={styles.title}>
|
|
63
|
+
{t('builtins.lobe-group-management.inspector.executeAgentTask.title')}
|
|
64
|
+
</span>
|
|
65
|
+
{agent && (
|
|
66
|
+
<Avatar
|
|
67
|
+
avatar={agent.avatar || DEFAULT_AVATAR}
|
|
68
|
+
background={agent.backgroundColor || theme.colorBgContainer}
|
|
69
|
+
shape={'square'}
|
|
70
|
+
size={24}
|
|
71
|
+
title={agent.title || undefined}
|
|
72
|
+
/>
|
|
73
|
+
)}
|
|
74
|
+
{agentName && <span className={highlightTextStyles.primary}>{agentName}</span>}
|
|
75
|
+
</Flexbox>
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
);
|
|
@@ -27,7 +27,7 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
|
27
27
|
`,
|
|
28
28
|
}));
|
|
29
29
|
|
|
30
|
-
export const
|
|
30
|
+
export const ExecuteAgentTasksInspector = memo<BuiltinInspectorProps<ExecuteTasksParams>>(
|
|
31
31
|
({ args, partialArgs, isArgumentsStreaming }) => {
|
|
32
32
|
const { t } = useTranslation('plugin');
|
|
33
33
|
|
|
@@ -84,7 +84,3 @@ export const ExecuteTasksInspector = memo<BuiltinInspectorProps<ExecuteTasksPara
|
|
|
84
84
|
);
|
|
85
85
|
},
|
|
86
86
|
);
|
|
87
|
-
|
|
88
|
-
ExecuteTasksInspector.displayName = 'ExecuteTasksInspector';
|
|
89
|
-
|
|
90
|
-
export default ExecuteTasksInspector;
|
|
@@ -2,7 +2,8 @@ import { type BuiltinInspector } from '@lobechat/types';
|
|
|
2
2
|
|
|
3
3
|
import { GroupManagementApiName } from '../../types';
|
|
4
4
|
import { BroadcastInspector } from './Broadcast';
|
|
5
|
-
import {
|
|
5
|
+
import { ExecuteAgentTaskInspector } from './ExecuteAgentTask';
|
|
6
|
+
import { ExecuteAgentTasksInspector } from './ExecuteAgentTasks';
|
|
6
7
|
import { SpeakInspector } from './Speak';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -13,6 +14,7 @@ import { SpeakInspector } from './Speak';
|
|
|
13
14
|
*/
|
|
14
15
|
export const GroupManagementInspectors: Record<string, BuiltinInspector> = {
|
|
15
16
|
[GroupManagementApiName.broadcast]: BroadcastInspector as BuiltinInspector,
|
|
16
|
-
[GroupManagementApiName.
|
|
17
|
+
[GroupManagementApiName.executeAgentTask]: ExecuteAgentTaskInspector as BuiltinInspector,
|
|
18
|
+
[GroupManagementApiName.executeAgentTasks]: ExecuteAgentTasksInspector as BuiltinInspector,
|
|
17
19
|
[GroupManagementApiName.speak]: SpeakInspector as BuiltinInspector,
|
|
18
20
|
};
|
|
@@ -220,7 +220,7 @@ export const filesRelations = relations(files, ({ many, one }) => ({
|
|
|
220
220
|
}),
|
|
221
221
|
}));
|
|
222
222
|
|
|
223
|
-
// Document
|
|
223
|
+
// Document-related relation definitions
|
|
224
224
|
export const documentsRelations = relations(documents, ({ one, many }) => ({
|
|
225
225
|
file: one(files, {
|
|
226
226
|
fields: [documents.fileId],
|
|
@@ -249,7 +249,7 @@ export const documentChunksRelations = relations(documentChunks, ({ one }) => ({
|
|
|
249
249
|
}),
|
|
250
250
|
}));
|
|
251
251
|
|
|
252
|
-
// Generation
|
|
252
|
+
// Generation-related relation definitions
|
|
253
253
|
export const generationTopicsRelations = relations(generationTopics, ({ one, many }) => ({
|
|
254
254
|
user: one(users, {
|
|
255
255
|
fields: [generationTopics.userId],
|
|
@@ -289,7 +289,7 @@ export const generationsRelations = relations(generations, ({ one }) => ({
|
|
|
289
289
|
}),
|
|
290
290
|
}));
|
|
291
291
|
|
|
292
|
-
// Chat Groups
|
|
292
|
+
// Chat Groups-related relation definitions
|
|
293
293
|
export const chatGroupsRelations = relations(chatGroups, ({ many, one }) => ({
|
|
294
294
|
user: one(users, {
|
|
295
295
|
fields: [chatGroups.userId],
|
|
@@ -313,7 +313,7 @@ export const chatGroupsAgentsRelations = relations(chatGroupsAgents, ({ one }) =
|
|
|
313
313
|
}),
|
|
314
314
|
}));
|
|
315
315
|
|
|
316
|
-
// Message Groups
|
|
316
|
+
// Message Groups-related relation definitions
|
|
317
317
|
export const messageGroupsRelations = relations(messageGroups, ({ many, one }) => ({
|
|
318
318
|
user: one(users, {
|
|
319
319
|
fields: [messageGroups.userId],
|
|
@@ -2,19 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { memo, useEffect } from 'react';
|
|
4
4
|
|
|
5
|
-
import { useConversationStore, virtuaListSelectors } from '../../store';
|
|
5
|
+
import { messageStateSelectors, useConversationStore, virtuaListSelectors } from '../../store';
|
|
6
6
|
import BackBottom from './BackBottom';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Whether AI is generating (for auto-scroll during generation)
|
|
11
|
-
*/
|
|
12
|
-
isGenerating?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const AutoScroll = memo<AutoScrollProps>(({ isGenerating }) => {
|
|
8
|
+
const AutoScroll = memo(() => {
|
|
16
9
|
const atBottom = useConversationStore(virtuaListSelectors.atBottom);
|
|
17
10
|
const isScrolling = useConversationStore(virtuaListSelectors.isScrolling);
|
|
11
|
+
const isGenerating = useConversationStore(messageStateSelectors.isAIGenerating);
|
|
18
12
|
const scrollToBottom = useConversationStore((s) => s.scrollToBottom);
|
|
19
13
|
|
|
20
14
|
useEffect(() => {
|
|
@@ -10,10 +10,6 @@ import AutoScroll from './AutoScroll';
|
|
|
10
10
|
|
|
11
11
|
interface VirtualizedListProps {
|
|
12
12
|
dataSource: string[];
|
|
13
|
-
/**
|
|
14
|
-
* Whether AI is generating (for auto-scroll)
|
|
15
|
-
*/
|
|
16
|
-
isGenerating?: boolean;
|
|
17
13
|
itemContent: (index: number, data: string) => ReactNode;
|
|
18
14
|
}
|
|
19
15
|
|
|
@@ -22,7 +18,7 @@ interface VirtualizedListProps {
|
|
|
22
18
|
*
|
|
23
19
|
* Based on ConversationStore data flow, no dependency on global ChatStore.
|
|
24
20
|
*/
|
|
25
|
-
const VirtualizedList = memo<VirtualizedListProps>(({ dataSource, itemContent
|
|
21
|
+
const VirtualizedList = memo<VirtualizedListProps>(({ dataSource, itemContent }) => {
|
|
26
22
|
const virtuaRef = useRef<VListHandle>(null);
|
|
27
23
|
const prevDataLengthRef = useRef(dataSource.length);
|
|
28
24
|
const scrollEndTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
@@ -154,7 +150,7 @@ const VirtualizedList = memo<VirtualizedListProps>(({ dataSource, itemContent, i
|
|
|
154
150
|
position: 'relative',
|
|
155
151
|
}}
|
|
156
152
|
>
|
|
157
|
-
<AutoScroll
|
|
153
|
+
<AutoScroll />
|
|
158
154
|
</WideScreenContainer>
|
|
159
155
|
</>
|
|
160
156
|
);
|
|
@@ -70,6 +70,7 @@ export default {
|
|
|
70
70
|
'builtins.lobe-group-management.apiName.summarize': 'Summarize conversation',
|
|
71
71
|
'builtins.lobe-group-management.apiName.vote': 'Start vote',
|
|
72
72
|
'builtins.lobe-group-management.inspector.broadcast.title': 'Following Agents speak:',
|
|
73
|
+
'builtins.lobe-group-management.inspector.executeAgentTask.title': 'Assigning task to:',
|
|
73
74
|
'builtins.lobe-group-management.inspector.executeAgentTasks.title': 'Assigning tasks to:',
|
|
74
75
|
'builtins.lobe-group-management.inspector.speak.title': 'Designated Agent speaks:',
|
|
75
76
|
'builtins.lobe-group-management.title': 'Group Coordinator',
|