@lobehub/lobehub 2.0.0-next.295 → 2.0.0-next.297
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 +50 -0
- package/changelog/v1.json +18 -0
- package/locales/en-US/plugin.json +4 -0
- package/locales/zh-CN/plugin.json +4 -0
- package/package.json +2 -2
- package/packages/agent-runtime/src/core/__tests__/runtime.test.ts +5 -5
- package/packages/agent-runtime/src/utils/stepContextComputer.test.ts +5 -5
- package/packages/builtin-tool-gtd/src/client/Inspector/index.ts +0 -4
- package/packages/builtin-tool-gtd/src/client/Intervention/AddTodo.tsx +1 -1
- package/packages/builtin-tool-gtd/src/client/Render/TodoList/index.tsx +39 -10
- package/packages/builtin-tool-gtd/src/client/Render/index.ts +0 -2
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/TodoItemRow.tsx +26 -12
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/actions.ts +5 -5
- package/packages/builtin-tool-gtd/src/client/components/SortableTodoList/store/store.test.ts +14 -8
- package/packages/builtin-tool-gtd/src/executor/index.test.ts +48 -227
- package/packages/builtin-tool-gtd/src/executor/index.ts +15 -158
- package/packages/builtin-tool-gtd/src/manifest.ts +12 -42
- package/packages/builtin-tool-gtd/src/systemRole.ts +14 -8
- package/packages/builtin-tool-gtd/src/types.ts +47 -41
- package/packages/builtin-tool-memory/package.json +8 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddContextMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddExperienceMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/AddPreferenceMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/RemoveIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/SearchUserMemory/index.tsx +67 -0
- package/packages/builtin-tool-memory/src/client/Inspector/UpdateIdentityMemory/index.tsx +60 -0
- package/packages/builtin-tool-memory/src/client/Inspector/index.ts +35 -0
- package/packages/builtin-tool-memory/src/client/Intervention/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Intervention/index.ts +13 -0
- package/packages/builtin-tool-memory/src/client/Render/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Render/SearchUserMemory/index.tsx +217 -0
- package/packages/builtin-tool-memory/src/client/Render/index.ts +15 -0
- package/packages/builtin-tool-memory/src/client/Streaming/AddExperienceMemory/index.tsx +17 -0
- package/packages/builtin-tool-memory/src/client/Streaming/index.ts +18 -0
- package/packages/builtin-tool-memory/src/client/components/ExperienceMemoryCard.tsx +231 -0
- package/packages/builtin-tool-memory/src/client/components/index.ts +1 -0
- package/packages/builtin-tool-memory/src/client/index.ts +27 -0
- package/packages/builtin-tool-memory/src/executor/index.ts +9 -1
- package/packages/builtin-tool-memory/src/types.ts +61 -0
- package/packages/context-engine/src/providers/GTDTodoInjector.ts +15 -7
- package/packages/conversation-flow/src/__tests__/fixtures/outputs/assistantGroup/tools-with-branches.json +4 -0
- package/packages/conversation-flow/src/transformation/FlatListBuilder.ts +1 -0
- package/packages/prompts/src/prompts/gtd/index.test.ts +32 -16
- package/packages/prompts/src/prompts/gtd/index.ts +9 -5
- package/packages/types/package.json +1 -1
- package/packages/types/src/discover/assistants.ts +4 -0
- package/packages/types/src/discover/groupAgents.ts +196 -0
- package/packages/types/src/discover/index.ts +5 -1
- package/packages/types/src/stepContext.ts +4 -1
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/DetailProvider.tsx +19 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Members/index.tsx +137 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Nav.tsx +88 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Overview/index.tsx +213 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx +85 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/TagList.tsx +20 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/SystemRole/index.tsx +71 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Versions/index.tsx +119 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/index.tsx +51 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Header.tsx +253 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/AddGroupAgent.tsx +222 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/ActionButton/index.tsx +34 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/Summary/index.tsx +42 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Sidebar/index.tsx +41 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/features/StatusPage/index.tsx +104 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/index.tsx +103 -0
- package/src/app/[variants]/(main)/community/(detail)/group_agent/loading.tsx +1 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/DetailProvider.tsx +7 -1
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserContent.tsx +2 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupCard.tsx +186 -0
- package/src/app/[variants]/(main)/community/(detail)/user/features/UserGroupList.tsx +59 -0
- package/src/app/[variants]/(main)/community/(detail)/user/index.tsx +3 -1
- package/src/app/[variants]/(main)/community/(list)/assistant/features/List/Item.tsx +26 -8
- package/src/app/[variants]/(main)/community/(list)/assistant/index.tsx +1 -0
- package/src/app/[variants]/(main)/community/features/Search.tsx +1 -1
- package/src/app/[variants]/(main)/group/profile/features/GroupProfile/index.tsx +2 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/AgentPublishButton/PublishResultModal.tsx +2 -1
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupForkConfirmModal.tsx +60 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/GroupPublishResultModal.tsx +62 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/PublishButton.tsx +122 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/index.tsx +46 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/types.ts +12 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/useMarketGroupPublish.ts +211 -0
- package/src/app/[variants]/(main)/group/profile/features/Header/GroupPublishButton/utils.ts +22 -0
- package/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx +4 -2
- package/src/app/[variants]/(main)/resource/library/_layout/Header/LibraryHead.tsx +30 -35
- package/src/app/[variants]/(main)/resource/library/_layout/Header/index.tsx +9 -11
- package/src/app/[variants]/router/desktopRouter.config.tsx +7 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/index.tsx +11 -17
- package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/LoadingPlaceholder/index.tsx +13 -3
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/CustomRender.tsx +43 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/FallbacktArgumentRender.tsx +59 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Render/index.tsx +46 -0
- package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/index.tsx +13 -19
- package/src/features/Conversation/Messages/AssistantGroup/Tool/index.tsx +17 -17
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +10 -9
- package/src/features/Conversation/TodoProgress/index.tsx +56 -23
- package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
- package/src/features/ResourceManager/components/Explorer/Header/index.tsx +57 -4
- package/src/features/ResourceManager/components/Explorer/ListView/ListItem/index.tsx +6 -4
- package/src/features/ResourceManager/components/Explorer/ListView/index.tsx +16 -5
- package/src/features/ResourceManager/components/LibraryHierarchy/styles.ts +5 -4
- package/src/hooks/useActiveTabKey.ts +1 -2
- package/src/locales/default/plugin.ts +1 -0
- package/src/locales/default/setting.ts +12 -0
- package/src/server/routers/lambda/market/agentGroup.ts +296 -0
- package/src/server/routers/lambda/market/index.ts +134 -4
- package/src/server/services/discover/index.ts +123 -7
- package/src/services/discover.ts +55 -0
- package/src/store/chat/slices/message/selectors/dbMessage.test.ts +11 -11
- package/src/store/discover/slices/groupAgent/action.ts +80 -0
- package/src/store/discover/store.ts +3 -0
- package/src/store/file/slices/resource/action.ts +4 -2
- package/src/tools/inspectors.ts +2 -0
- package/src/tools/interventions.ts +2 -0
- package/src/tools/renders.ts +3 -1
- package/src/tools/streamings.ts +2 -0
- package/packages/builtin-tool-gtd/src/client/Inspector/CompleteTodos/index.tsx +0 -52
- package/packages/builtin-tool-gtd/src/client/Inspector/RemoveTodos/index.tsx +0 -52
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Render/CustomRender.tsx +0 -113
- package/src/features/Conversation/Messages/Tool/Tool/Render.tsx +0 -47
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/AbortResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Arguments/index.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/ErrorResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ApprovalActions.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/Fallback.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/KeyValueEditor.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/ModeSelector.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/Intervention/index.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/PluginSettings.tsx +0 -0
- /package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/RejectedResponse.tsx +0 -0
|
@@ -41,6 +41,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
41
41
|
} catch (error) {
|
|
42
42
|
const err = error as Error;
|
|
43
43
|
return {
|
|
44
|
+
content: `searchUserMemory with error detail: ${err.message}`,
|
|
44
45
|
error: {
|
|
45
46
|
body: error,
|
|
46
47
|
message: err.message,
|
|
@@ -80,6 +81,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
80
81
|
} catch (error) {
|
|
81
82
|
const err = error as Error;
|
|
82
83
|
return {
|
|
84
|
+
content: `addContextMemory with error detail: ${err.message}`,
|
|
83
85
|
error: {
|
|
84
86
|
body: error,
|
|
85
87
|
message: err.message,
|
|
@@ -110,13 +112,15 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
110
112
|
}
|
|
111
113
|
|
|
112
114
|
return {
|
|
113
|
-
content:
|
|
115
|
+
content: `Experience memory "${params.title}" saved with memoryId: "${result.memoryId}" and experienceId: "${result.experienceId}"`,
|
|
114
116
|
state: { experienceId: result.experienceId, memoryId: result.memoryId },
|
|
115
117
|
success: true,
|
|
116
118
|
};
|
|
117
119
|
} catch (error) {
|
|
118
120
|
const err = error as Error;
|
|
121
|
+
|
|
119
122
|
return {
|
|
123
|
+
content: `addExperienceMemory with error detail: ${err.message}`,
|
|
120
124
|
error: {
|
|
121
125
|
body: error,
|
|
122
126
|
message: err.message,
|
|
@@ -154,6 +158,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
154
158
|
} catch (error) {
|
|
155
159
|
const err = error as Error;
|
|
156
160
|
return {
|
|
161
|
+
content: `addIdentityMemory with error detail: ${err.message}`,
|
|
157
162
|
error: {
|
|
158
163
|
body: error,
|
|
159
164
|
message: err.message,
|
|
@@ -191,6 +196,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
191
196
|
} catch (error) {
|
|
192
197
|
const err = error as Error;
|
|
193
198
|
return {
|
|
199
|
+
content: `addPreferenceMemory with error detail: ${err.message}`,
|
|
194
200
|
error: {
|
|
195
201
|
body: error,
|
|
196
202
|
message: err.message,
|
|
@@ -230,6 +236,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
230
236
|
} catch (error) {
|
|
231
237
|
const err = error as Error;
|
|
232
238
|
return {
|
|
239
|
+
content: `updateIdentityMemory with error detail: ${err.message}`,
|
|
233
240
|
error: {
|
|
234
241
|
body: error,
|
|
235
242
|
message: err.message,
|
|
@@ -264,6 +271,7 @@ class MemoryExecutor extends BaseExecutor<typeof MemoryApiName> {
|
|
|
264
271
|
} catch (error) {
|
|
265
272
|
const err = error as Error;
|
|
266
273
|
return {
|
|
274
|
+
content: `removeIdentityMemory with error detail: ${err.message}`,
|
|
267
275
|
error: {
|
|
268
276
|
body: error,
|
|
269
277
|
message: err.message,
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AddIdentityActionSchema,
|
|
3
|
+
ContextMemoryItemSchema,
|
|
4
|
+
ExperienceMemoryItemSchema,
|
|
5
|
+
PreferenceMemoryItemSchema,
|
|
6
|
+
RemoveIdentityActionSchema,
|
|
7
|
+
UpdateIdentityActionSchema,
|
|
8
|
+
} from '@lobechat/memory-user-memory/schemas';
|
|
9
|
+
import type { SearchMemoryResult } from '@lobechat/types';
|
|
10
|
+
import type { z } from 'zod';
|
|
11
|
+
|
|
1
12
|
export const MemoryApiName = {
|
|
2
13
|
addContextMemory: 'addContextMemory',
|
|
3
14
|
addExperienceMemory: 'addExperienceMemory',
|
|
@@ -12,3 +23,53 @@ export type MemoryApiNameType = (typeof MemoryApiName)[keyof typeof MemoryApiNam
|
|
|
12
23
|
|
|
13
24
|
/** @deprecated Use MemoryApiName instead */
|
|
14
25
|
export const UserMemoryApiName = MemoryApiName;
|
|
26
|
+
|
|
27
|
+
// ==================== Inspector Types ====================
|
|
28
|
+
|
|
29
|
+
// Search
|
|
30
|
+
|
|
31
|
+
// SearchUserMemoryState is the same as SearchMemoryResult (executor returns result directly as state)
|
|
32
|
+
export type SearchUserMemoryState = SearchMemoryResult;
|
|
33
|
+
|
|
34
|
+
// Add Context
|
|
35
|
+
export type AddContextMemoryParams = z.infer<typeof ContextMemoryItemSchema>;
|
|
36
|
+
export interface AddContextMemoryState {
|
|
37
|
+
contextId?: string;
|
|
38
|
+
memoryId?: string;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Add Experience
|
|
42
|
+
export type AddExperienceMemoryParams = z.infer<typeof ExperienceMemoryItemSchema>;
|
|
43
|
+
export interface AddExperienceMemoryState {
|
|
44
|
+
experienceId?: string;
|
|
45
|
+
memoryId?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Add Identity
|
|
49
|
+
export type AddIdentityMemoryParams = z.infer<typeof AddIdentityActionSchema>;
|
|
50
|
+
export interface AddIdentityMemoryState {
|
|
51
|
+
identityId?: string;
|
|
52
|
+
memoryId?: string;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Add Preference
|
|
56
|
+
export type AddPreferenceMemoryParams = z.infer<typeof PreferenceMemoryItemSchema>;
|
|
57
|
+
export interface AddPreferenceMemoryState {
|
|
58
|
+
memoryId?: string;
|
|
59
|
+
preferenceId?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Update Identity
|
|
63
|
+
export type UpdateIdentityMemoryParams = z.infer<typeof UpdateIdentityActionSchema>;
|
|
64
|
+
export interface UpdateIdentityMemoryState {
|
|
65
|
+
identityId?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Remove Identity
|
|
69
|
+
export type RemoveIdentityMemoryParams = z.infer<typeof RemoveIdentityActionSchema>;
|
|
70
|
+
export interface RemoveIdentityMemoryState {
|
|
71
|
+
identityId?: string;
|
|
72
|
+
reason?: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {type SearchMemoryParams, type SearchMemoryResult} from '@lobechat/types';
|
|
@@ -5,12 +5,15 @@ import type { PipelineContext, ProcessorOptions } from '../types';
|
|
|
5
5
|
|
|
6
6
|
const log = debug('context-engine:provider:GTDTodoInjector');
|
|
7
7
|
|
|
8
|
+
/** Status of a todo item */
|
|
9
|
+
export type GTDTodoStatus = 'todo' | 'processing' | 'completed';
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* GTD Todo item structure
|
|
10
13
|
*/
|
|
11
14
|
export interface GTDTodoItem {
|
|
12
|
-
/**
|
|
13
|
-
|
|
15
|
+
/** Status of the todo item */
|
|
16
|
+
status: GTDTodoStatus;
|
|
14
17
|
/** The todo item text */
|
|
15
18
|
text: string;
|
|
16
19
|
}
|
|
@@ -43,13 +46,15 @@ function formatGTDTodos(todos: GTDTodoList): string | null {
|
|
|
43
46
|
const lines: string[] = ['<gtd_todos>'];
|
|
44
47
|
|
|
45
48
|
items.forEach((item, index) => {
|
|
46
|
-
|
|
47
|
-
lines.push(`<todo index="${index}" status="${status}">${item.text}</todo>`);
|
|
49
|
+
lines.push(`<todo index="${index}" status="${item.status}">${item.text}</todo>`);
|
|
48
50
|
});
|
|
49
51
|
|
|
50
|
-
const completedCount = items.filter((item) => item.completed).length;
|
|
52
|
+
const completedCount = items.filter((item) => item.status === 'completed').length;
|
|
53
|
+
const processingCount = items.filter((item) => item.status === 'processing').length;
|
|
51
54
|
const totalCount = items.length;
|
|
52
|
-
lines.push(
|
|
55
|
+
lines.push(
|
|
56
|
+
`<progress completed="${completedCount}" processing="${processingCount}" total="${totalCount}" />`,
|
|
57
|
+
);
|
|
53
58
|
|
|
54
59
|
lines.push('</gtd_todos>');
|
|
55
60
|
|
|
@@ -117,7 +122,10 @@ export class GTDTodoInjector extends BaseLastUserContentProvider {
|
|
|
117
122
|
clonedContext.metadata.gtdTodoInjected = true;
|
|
118
123
|
clonedContext.metadata.gtdTodoCount = this.config.todos.items.length;
|
|
119
124
|
clonedContext.metadata.gtdTodoCompletedCount = this.config.todos.items.filter(
|
|
120
|
-
(item) => item.completed,
|
|
125
|
+
(item) => item.status === 'completed',
|
|
126
|
+
).length;
|
|
127
|
+
clonedContext.metadata.gtdTodoProcessingCount = this.config.todos.items.filter(
|
|
128
|
+
(item) => item.status === 'processing',
|
|
121
129
|
).length;
|
|
122
130
|
|
|
123
131
|
log('GTD Todo context appended to last user message');
|
|
@@ -644,6 +644,7 @@ export class FlatListBuilder {
|
|
|
644
644
|
id: toolMsg.id,
|
|
645
645
|
};
|
|
646
646
|
if (toolMsg.error) result.error = toolMsg.error;
|
|
647
|
+
if (toolMsg.pluginError) result.error = toolMsg.pluginError;
|
|
647
648
|
if (toolMsg.pluginState) result.state = toolMsg.pluginState;
|
|
648
649
|
|
|
649
650
|
const toolWithResult: ChatToolPayloadWithResult = {
|
|
@@ -15,12 +15,12 @@ describe('formatTodoStateSummary', () => {
|
|
|
15
15
|
|
|
16
16
|
it('should format todo list with only pending items', () => {
|
|
17
17
|
const todos = [
|
|
18
|
-
{ text: 'Task A',
|
|
19
|
-
{ text: 'Task B',
|
|
20
|
-
{ text: 'Task C',
|
|
18
|
+
{ text: 'Task A', status: 'todo' as const },
|
|
19
|
+
{ text: 'Task B', status: 'todo' as const },
|
|
20
|
+
{ text: 'Task C', status: 'todo' as const },
|
|
21
21
|
];
|
|
22
22
|
expect(formatTodoStateSummary(todos)).toMatchInlineSnapshot(`
|
|
23
|
-
"📋 Current Todo List (3
|
|
23
|
+
"📋 Current Todo List (3 todo, 0 processing, 0 completed):
|
|
24
24
|
- [ ] Task A
|
|
25
25
|
- [ ] Task B
|
|
26
26
|
- [ ] Task C"
|
|
@@ -29,11 +29,11 @@ describe('formatTodoStateSummary', () => {
|
|
|
29
29
|
|
|
30
30
|
it('should format todo list with only completed items', () => {
|
|
31
31
|
const todos = [
|
|
32
|
-
{ text: 'Done task 1',
|
|
33
|
-
{ text: 'Done task 2',
|
|
32
|
+
{ text: 'Done task 1', status: 'completed' as const },
|
|
33
|
+
{ text: 'Done task 2', status: 'completed' as const },
|
|
34
34
|
];
|
|
35
35
|
expect(formatTodoStateSummary(todos)).toMatchInlineSnapshot(`
|
|
36
|
-
"📋 Current Todo List (0
|
|
36
|
+
"📋 Current Todo List (0 todo, 0 processing, 2 completed):
|
|
37
37
|
- [x] Done task 1
|
|
38
38
|
- [x] Done task 2"
|
|
39
39
|
`);
|
|
@@ -41,12 +41,12 @@ describe('formatTodoStateSummary', () => {
|
|
|
41
41
|
|
|
42
42
|
it('should format todo list with mixed items', () => {
|
|
43
43
|
const todos = [
|
|
44
|
-
{ text: 'Pending task',
|
|
45
|
-
{ text: 'Completed task',
|
|
46
|
-
{ text: 'Another pending',
|
|
44
|
+
{ text: 'Pending task', status: 'todo' as const },
|
|
45
|
+
{ text: 'Completed task', status: 'completed' as const },
|
|
46
|
+
{ text: 'Another pending', status: 'todo' as const },
|
|
47
47
|
];
|
|
48
48
|
expect(formatTodoStateSummary(todos)).toMatchInlineSnapshot(`
|
|
49
|
-
"📋 Current Todo List (2
|
|
49
|
+
"📋 Current Todo List (2 todo, 0 processing, 1 completed):
|
|
50
50
|
- [ ] Pending task
|
|
51
51
|
- [x] Completed task
|
|
52
52
|
- [ ] Another pending"
|
|
@@ -55,21 +55,37 @@ describe('formatTodoStateSummary', () => {
|
|
|
55
55
|
|
|
56
56
|
it('should format todo list with timestamp', () => {
|
|
57
57
|
const todos = [
|
|
58
|
-
{ text: 'Task 1',
|
|
59
|
-
{ text: 'Task 2',
|
|
58
|
+
{ text: 'Task 1', status: 'todo' as const },
|
|
59
|
+
{ text: 'Task 2', status: 'completed' as const },
|
|
60
60
|
];
|
|
61
61
|
expect(formatTodoStateSummary(todos, '2025-01-15T10:30:00.000Z')).toMatchInlineSnapshot(`
|
|
62
|
-
"📋 Current Todo List (1
|
|
62
|
+
"📋 Current Todo List (1 todo, 0 processing, 1 completed) | Updated: 2025-01-15T10:30:00.000Z:
|
|
63
63
|
- [ ] Task 1
|
|
64
64
|
- [x] Task 2"
|
|
65
65
|
`);
|
|
66
66
|
});
|
|
67
67
|
|
|
68
68
|
it('should handle single item', () => {
|
|
69
|
-
const todos = [{ text: 'Only task',
|
|
69
|
+
const todos = [{ text: 'Only task', status: 'todo' as const }];
|
|
70
70
|
expect(formatTodoStateSummary(todos)).toMatchInlineSnapshot(`
|
|
71
|
-
"📋 Current Todo List (1
|
|
71
|
+
"📋 Current Todo List (1 todo, 0 processing, 0 completed):
|
|
72
72
|
- [ ] Only task"
|
|
73
73
|
`);
|
|
74
74
|
});
|
|
75
|
+
|
|
76
|
+
it('should format todo list with processing items', () => {
|
|
77
|
+
const todos = [
|
|
78
|
+
{ text: 'Todo task', status: 'todo' as const },
|
|
79
|
+
{ text: 'Processing task 1', status: 'processing' as const },
|
|
80
|
+
{ text: 'Processing task 2', status: 'processing' as const },
|
|
81
|
+
{ text: 'Done task', status: 'completed' as const },
|
|
82
|
+
];
|
|
83
|
+
expect(formatTodoStateSummary(todos)).toMatchInlineSnapshot(`
|
|
84
|
+
"📋 Current Todo List (1 todo, 2 processing, 1 completed):
|
|
85
|
+
- [ ] Todo task
|
|
86
|
+
- [~] Processing task 1
|
|
87
|
+
- [~] Processing task 2
|
|
88
|
+
- [x] Done task"
|
|
89
|
+
`);
|
|
90
|
+
});
|
|
75
91
|
});
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
export type TodoStatus = 'todo' | 'processing' | 'completed';
|
|
2
|
+
|
|
1
3
|
export interface TodoItem {
|
|
2
|
-
|
|
4
|
+
status: TodoStatus;
|
|
3
5
|
text: string;
|
|
4
6
|
}
|
|
5
7
|
|
|
@@ -17,13 +19,15 @@ export const formatTodoStateSummary = (todos: TodoItem[], updatedAt?: string): s
|
|
|
17
19
|
return `📋 Current Todo List: (empty)${timeInfo}`;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
const completed = todos.filter((t) => t.completed).length;
|
|
21
|
-
const
|
|
22
|
+
const completed = todos.filter((t) => t.status === 'completed').length;
|
|
23
|
+
const processing = todos.filter((t) => t.status === 'processing').length;
|
|
24
|
+
const pending = todos.length - completed - processing;
|
|
22
25
|
|
|
23
26
|
const lines = todos.map((item) => {
|
|
24
|
-
const checkbox =
|
|
27
|
+
const checkbox =
|
|
28
|
+
item.status === 'completed' ? '- [x]' : item.status === 'processing' ? '- [~]' : '- [ ]';
|
|
25
29
|
return `${checkbox} ${item.text}`;
|
|
26
30
|
});
|
|
27
31
|
|
|
28
|
-
return `📋 Current Todo List (${pending}
|
|
32
|
+
return `📋 Current Todo List (${pending} todo, ${processing} processing, ${completed} completed)${timeInfo}:\n${lines.join('\n')}`;
|
|
29
33
|
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@lobechat/python-interpreter": "workspace:*",
|
|
9
9
|
"@lobechat/web-crawler": "workspace:*",
|
|
10
10
|
"@lobehub/chat-plugin-sdk": "^1.32.4",
|
|
11
|
-
"@lobehub/market-sdk": "0.
|
|
11
|
+
"@lobehub/market-sdk": "0.29.0",
|
|
12
12
|
"@lobehub/market-types": "^1.12.3",
|
|
13
13
|
"model-bank": "workspace:*",
|
|
14
14
|
"type-fest": "^4.41.0",
|
|
@@ -42,6 +42,8 @@ export enum AssistantNavKey {
|
|
|
42
42
|
|
|
43
43
|
export type AgentStatus = 'published' | 'unpublished' | 'archived' | 'deprecated';
|
|
44
44
|
|
|
45
|
+
export type AgentType = 'agent' | 'agent-group';
|
|
46
|
+
|
|
45
47
|
export interface DiscoverAssistantItem extends Omit<LobeAgentSettings, 'meta'>, MetaData {
|
|
46
48
|
author: string;
|
|
47
49
|
category?: AssistantCategory;
|
|
@@ -53,6 +55,7 @@ export interface DiscoverAssistantItem extends Omit<LobeAgentSettings, 'meta'>,
|
|
|
53
55
|
pluginCount: number;
|
|
54
56
|
status?: AgentStatus;
|
|
55
57
|
tokenUsage: number;
|
|
58
|
+
type?: AgentType;
|
|
56
59
|
userName?: string;
|
|
57
60
|
}
|
|
58
61
|
|
|
@@ -60,6 +63,7 @@ export type AssistantMarketSource = 'legacy' | 'new';
|
|
|
60
63
|
|
|
61
64
|
export interface AssistantQueryParams {
|
|
62
65
|
category?: string;
|
|
66
|
+
includeAgentGroup?: boolean;
|
|
63
67
|
locale?: string;
|
|
64
68
|
order?: 'asc' | 'desc';
|
|
65
69
|
ownerId?: string;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { MetaData } from '../meta';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Group Agent Member - represents a member agent in a group
|
|
5
|
+
*/
|
|
6
|
+
export interface GroupAgentMember {
|
|
7
|
+
avatar?: string;
|
|
8
|
+
category?: string;
|
|
9
|
+
config?: Record<string, any>;
|
|
10
|
+
description: string;
|
|
11
|
+
displayOrder?: number;
|
|
12
|
+
enabled?: boolean;
|
|
13
|
+
identifier: string;
|
|
14
|
+
name: string;
|
|
15
|
+
role: 'supervisor' | 'participant';
|
|
16
|
+
url: string;
|
|
17
|
+
version?: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Group Agent Status
|
|
22
|
+
*/
|
|
23
|
+
export type GroupAgentStatus = 'published' | 'unpublished' | 'archived' | 'deprecated';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Group Agent Visibility
|
|
27
|
+
*/
|
|
28
|
+
export type GroupAgentVisibility = 'public' | 'private' | 'internal';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Group Agent Category
|
|
32
|
+
*/
|
|
33
|
+
export type GroupAgentCategory =
|
|
34
|
+
| 'productivity'
|
|
35
|
+
| 'entertainment'
|
|
36
|
+
| 'education'
|
|
37
|
+
| 'development'
|
|
38
|
+
| 'business'
|
|
39
|
+
| 'other';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Group Agent Config - similar to LobeAgentConfig but for groups
|
|
43
|
+
*/
|
|
44
|
+
export interface GroupAgentConfig {
|
|
45
|
+
/**
|
|
46
|
+
* Opening message when starting a conversation with the group
|
|
47
|
+
*/
|
|
48
|
+
openingMessage?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Opening questions to guide users
|
|
51
|
+
*/
|
|
52
|
+
openingQuestions?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* System role/prompt for the group
|
|
55
|
+
*/
|
|
56
|
+
systemRole?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Additional configuration
|
|
59
|
+
*/
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Group Agent Item - basic info for list display
|
|
65
|
+
*/
|
|
66
|
+
export interface DiscoverGroupAgentItem extends MetaData {
|
|
67
|
+
author?: string;
|
|
68
|
+
avatar?: string;
|
|
69
|
+
backgroundColor?: string;
|
|
70
|
+
category?: GroupAgentCategory;
|
|
71
|
+
config?: GroupAgentConfig;
|
|
72
|
+
createdAt: string;
|
|
73
|
+
description?: string;
|
|
74
|
+
homepage?: string;
|
|
75
|
+
identifier: string;
|
|
76
|
+
installCount?: number;
|
|
77
|
+
isFeatured?: boolean;
|
|
78
|
+
isOfficial?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Number of knowledge bases across all member agents
|
|
81
|
+
*/
|
|
82
|
+
knowledgeCount?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Number of member agents in the group
|
|
85
|
+
*/
|
|
86
|
+
memberCount: number;
|
|
87
|
+
/**
|
|
88
|
+
* Number of plugins across all member agents
|
|
89
|
+
*/
|
|
90
|
+
pluginCount?: number;
|
|
91
|
+
status?: GroupAgentStatus;
|
|
92
|
+
tags?: string[];
|
|
93
|
+
title: string;
|
|
94
|
+
/**
|
|
95
|
+
* Estimated token usage for the group
|
|
96
|
+
*/
|
|
97
|
+
tokenUsage?: number;
|
|
98
|
+
updatedAt: string;
|
|
99
|
+
userName?: string;
|
|
100
|
+
version?: string;
|
|
101
|
+
versionNumber?: number;
|
|
102
|
+
visibility?: GroupAgentVisibility;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Group Agent Version
|
|
107
|
+
*/
|
|
108
|
+
export interface DiscoverGroupAgentVersion {
|
|
109
|
+
changelog?: string;
|
|
110
|
+
createdAt?: string;
|
|
111
|
+
isLatest?: boolean;
|
|
112
|
+
isValidated?: boolean;
|
|
113
|
+
status?: GroupAgentStatus;
|
|
114
|
+
version: string;
|
|
115
|
+
versionNumber: number;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Group Agent Detail - complete info for detail page
|
|
120
|
+
*/
|
|
121
|
+
export interface DiscoverGroupAgentDetail extends DiscoverGroupAgentItem {
|
|
122
|
+
/**
|
|
123
|
+
* Current version string
|
|
124
|
+
*/
|
|
125
|
+
currentVersion?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Current version number
|
|
128
|
+
*/
|
|
129
|
+
currentVersionNumber?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Example conversations (if available from config)
|
|
132
|
+
*/
|
|
133
|
+
examples?: any;
|
|
134
|
+
/**
|
|
135
|
+
* Member agents in the group
|
|
136
|
+
*/
|
|
137
|
+
memberAgents: GroupAgentMember[];
|
|
138
|
+
/**
|
|
139
|
+
* Owner ID
|
|
140
|
+
*/
|
|
141
|
+
ownerId?: string;
|
|
142
|
+
/**
|
|
143
|
+
* Related group agents
|
|
144
|
+
*/
|
|
145
|
+
related?: DiscoverGroupAgentItem[];
|
|
146
|
+
/**
|
|
147
|
+
* Summary text (extracted from description or config)
|
|
148
|
+
*/
|
|
149
|
+
summary?: string;
|
|
150
|
+
/**
|
|
151
|
+
* Version history
|
|
152
|
+
*/
|
|
153
|
+
versions?: DiscoverGroupAgentVersion[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Group Agent List Response
|
|
158
|
+
*/
|
|
159
|
+
export interface GroupAgentListResponse {
|
|
160
|
+
currentPage: number;
|
|
161
|
+
items: DiscoverGroupAgentItem[];
|
|
162
|
+
totalCount: number;
|
|
163
|
+
totalPages: number;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Group Agent Query Parameters
|
|
168
|
+
*/
|
|
169
|
+
export interface GroupAgentQueryParams {
|
|
170
|
+
category?: string;
|
|
171
|
+
locale?: string;
|
|
172
|
+
order?: 'asc' | 'desc';
|
|
173
|
+
ownerId?: string;
|
|
174
|
+
page?: number;
|
|
175
|
+
pageSize?: number;
|
|
176
|
+
q?: string;
|
|
177
|
+
sort?: 'createdAt' | 'updatedAt' | 'name' | 'recommended';
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Group Agent Detail Query Parameters
|
|
182
|
+
*/
|
|
183
|
+
export interface GroupAgentDetailParams {
|
|
184
|
+
identifier: string;
|
|
185
|
+
locale?: string;
|
|
186
|
+
version?: string;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Group Agent Category Item
|
|
191
|
+
*/
|
|
192
|
+
export interface GroupAgentCategoryItem {
|
|
193
|
+
category: GroupAgentCategory;
|
|
194
|
+
count: number;
|
|
195
|
+
name: string;
|
|
196
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { DiscoverAssistantItem } from './assistants';
|
|
2
|
+
import { DiscoverGroupAgentItem } from './groupAgents';
|
|
2
3
|
|
|
3
4
|
export * from './assistants';
|
|
5
|
+
export * from './groupAgents';
|
|
4
6
|
export * from './mcp';
|
|
5
7
|
export * from './models';
|
|
6
8
|
export * from './plugins';
|
|
@@ -8,6 +10,7 @@ export * from './providers';
|
|
|
8
10
|
|
|
9
11
|
export enum DiscoverTab {
|
|
10
12
|
Assistants = 'assistant',
|
|
13
|
+
GroupAgents = 'group_agent',
|
|
11
14
|
Home = 'home',
|
|
12
15
|
Mcp = 'mcp',
|
|
13
16
|
Models = 'model',
|
|
@@ -58,9 +61,10 @@ export interface DiscoverUserInfo {
|
|
|
58
61
|
}
|
|
59
62
|
|
|
60
63
|
/**
|
|
61
|
-
* User profile with their published agents
|
|
64
|
+
* User profile with their published agents and groups
|
|
62
65
|
*/
|
|
63
66
|
export interface DiscoverUserProfile {
|
|
67
|
+
agentGroups?: DiscoverGroupAgentItem[];
|
|
64
68
|
agents: DiscoverAssistantItem[];
|
|
65
69
|
user: DiscoverUserInfo;
|
|
66
70
|
}
|
|
@@ -10,12 +10,15 @@
|
|
|
10
10
|
* 3. Replaces the deprecated pluginState passing pattern
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/** Status of a todo item */
|
|
14
|
+
export type StepContextTodoStatus = 'todo' | 'processing' | 'completed';
|
|
15
|
+
|
|
13
16
|
/**
|
|
14
17
|
* Todo item structure
|
|
15
18
|
* Duplicated here to avoid circular dependency with builtin-tool-gtd
|
|
16
19
|
*/
|
|
17
20
|
export interface StepContextTodoItem {
|
|
18
|
-
|
|
21
|
+
status: StepContextTodoStatus;
|
|
19
22
|
text: string;
|
|
20
23
|
}
|
|
21
24
|
|
package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx
CHANGED
|
@@ -5,10 +5,10 @@ import qs from 'query-string';
|
|
|
5
5
|
import { memo, useMemo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
|
|
8
|
-
import Link from '@/libs/router/Link';
|
|
9
|
-
import { usePathname , useQuery } from '@/libs/router/navigation';
|
|
10
8
|
import InlineTable from '@/components/InlineTable';
|
|
11
9
|
import PublishedTime from '@/components/PublishedTime';
|
|
10
|
+
import Link from '@/libs/router/Link';
|
|
11
|
+
import { usePathname, useQuery } from '@/libs/router/navigation';
|
|
12
12
|
import { type AssistantMarketSource, AssistantNavKey } from '@/types/discover';
|
|
13
13
|
|
|
14
14
|
import Title from '../../../../../features/Title';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { type ReactNode, createContext, memo, use } from 'react';
|
|
4
|
+
|
|
5
|
+
import { type DiscoverGroupAgentDetail } from '@/types/discover';
|
|
6
|
+
|
|
7
|
+
export type DetailContextConfig = Partial<DiscoverGroupAgentDetail>;
|
|
8
|
+
|
|
9
|
+
export const DetailContext = createContext<DetailContextConfig>({});
|
|
10
|
+
|
|
11
|
+
export const DetailProvider = memo<{ children: ReactNode; config?: DetailContextConfig }>(
|
|
12
|
+
({ children, config = {} }) => {
|
|
13
|
+
return <DetailContext value={config}>{children}</DetailContext>;
|
|
14
|
+
},
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export const useDetailContext = () => {
|
|
18
|
+
return use(DetailContext);
|
|
19
|
+
};
|