@lobehub/lobehub 2.0.0-next.296 → 2.0.0-next.298
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/package.json +2 -2
- 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/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 +87 -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 +89 -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)/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)/home/_layout/HomeAgentIdSync.tsx +23 -0
- package/src/app/[variants]/(main)/home/_layout/index.tsx +2 -0
- package/src/app/[variants]/router/desktopRouter.config.tsx +7 -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 +58 -1
- package/src/store/discover/slices/groupAgent/action.ts +80 -0
- package/src/store/discover/store.ts +3 -0
- package/src/store/tool/slices/lobehubSkillStore/action.ts +1 -2
package/src/services/discover.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type CategoryItem,
|
|
3
|
+
type CategoryListQuery,
|
|
4
|
+
type PluginManifest,
|
|
5
|
+
} from '@lobehub/market-sdk';
|
|
2
6
|
import {
|
|
3
7
|
AgentEventRequest,
|
|
4
8
|
type CallReportRequest,
|
|
@@ -20,6 +24,7 @@ import {
|
|
|
20
24
|
type DiscoverPluginDetail,
|
|
21
25
|
type DiscoverProviderDetail,
|
|
22
26
|
type DiscoverUserProfile,
|
|
27
|
+
type GroupAgentQueryParams,
|
|
23
28
|
type IdentifiersResponse,
|
|
24
29
|
type McpListResponse,
|
|
25
30
|
type McpQueryParams,
|
|
@@ -448,6 +453,58 @@ class DiscoverService {
|
|
|
448
453
|
}
|
|
449
454
|
return null;
|
|
450
455
|
}
|
|
456
|
+
|
|
457
|
+
// ============================== Group Agent Market ==============================
|
|
458
|
+
|
|
459
|
+
getGroupAgentCategories = async (params: CategoryListQuery = {}): Promise<CategoryItem[]> => {
|
|
460
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
461
|
+
return lambdaClient.market.getGroupAgentCategories.query({
|
|
462
|
+
...params,
|
|
463
|
+
locale,
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
getGroupAgentDetail = async (params: {
|
|
468
|
+
identifier: string;
|
|
469
|
+
locale?: string;
|
|
470
|
+
version?: string;
|
|
471
|
+
}): Promise<any> => {
|
|
472
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
473
|
+
return lambdaClient.market.getGroupAgentDetail.query({
|
|
474
|
+
identifier: params.identifier,
|
|
475
|
+
locale,
|
|
476
|
+
version: params.version,
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
getGroupAgentIdentifiers = async (): Promise<IdentifiersResponse> => {
|
|
481
|
+
return lambdaClient.market.getGroupAgentIdentifiers.query();
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
getGroupAgentList = async (params: GroupAgentQueryParams = {}): Promise<any> => {
|
|
485
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
486
|
+
return lambdaClient.market.getGroupAgentList.query(
|
|
487
|
+
{
|
|
488
|
+
...params,
|
|
489
|
+
locale,
|
|
490
|
+
page: params.page ? Number(params.page) : 1,
|
|
491
|
+
pageSize: params.pageSize ? Number(params.pageSize) : 20,
|
|
492
|
+
},
|
|
493
|
+
{ context: { showNotification: false } },
|
|
494
|
+
);
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
reportGroupAgentEvent = async (params: {
|
|
498
|
+
event: 'add' | 'chat' | 'click';
|
|
499
|
+
identifier: string;
|
|
500
|
+
source?: string;
|
|
501
|
+
}): Promise<void> => {
|
|
502
|
+
await lambdaClient.market.reportGroupAgentEvent.mutate(params);
|
|
503
|
+
};
|
|
504
|
+
|
|
505
|
+
reportGroupAgentInstall = async (identifier: string): Promise<void> => {
|
|
506
|
+
await lambdaClient.market.reportGroupAgentInstall.mutate({ identifier });
|
|
507
|
+
};
|
|
451
508
|
}
|
|
452
509
|
|
|
453
510
|
export const discoverService = new DiscoverService();
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type CategoryItem, type CategoryListQuery } from '@lobehub/market-sdk';
|
|
2
|
+
import useSWR, { type SWRResponse } from 'swr';
|
|
3
|
+
import type { StateCreator } from 'zustand/vanilla';
|
|
4
|
+
|
|
5
|
+
import { discoverService } from '@/services/discover';
|
|
6
|
+
import { type DiscoverStore } from '@/store/discover';
|
|
7
|
+
import { globalHelpers } from '@/store/global/helpers';
|
|
8
|
+
import {
|
|
9
|
+
type DiscoverGroupAgentDetail,
|
|
10
|
+
type GroupAgentListResponse,
|
|
11
|
+
type GroupAgentQueryParams,
|
|
12
|
+
type IdentifiersResponse,
|
|
13
|
+
} from '@/types/discover';
|
|
14
|
+
|
|
15
|
+
export interface GroupAgentAction {
|
|
16
|
+
useGroupAgentCategories: (params?: CategoryListQuery) => SWRResponse<CategoryItem[]>;
|
|
17
|
+
useGroupAgentDetail: (params: {
|
|
18
|
+
identifier: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
}) => SWRResponse<DiscoverGroupAgentDetail | undefined>;
|
|
21
|
+
useGroupAgentIdentifiers: () => SWRResponse<IdentifiersResponse>;
|
|
22
|
+
useGroupAgentList: (params?: GroupAgentQueryParams) => SWRResponse<GroupAgentListResponse>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const createGroupAgentSlice: StateCreator<
|
|
26
|
+
DiscoverStore,
|
|
27
|
+
[['zustand/devtools', never]],
|
|
28
|
+
[],
|
|
29
|
+
GroupAgentAction
|
|
30
|
+
> = () => ({
|
|
31
|
+
useGroupAgentCategories: (params = {}) => {
|
|
32
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
33
|
+
return useSWR(
|
|
34
|
+
['group-agent-categories', locale, ...Object.values(params)].filter(Boolean).join('-'),
|
|
35
|
+
async () => discoverService.getGroupAgentCategories(params),
|
|
36
|
+
{
|
|
37
|
+
revalidateOnFocus: false,
|
|
38
|
+
},
|
|
39
|
+
);
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
useGroupAgentDetail: (params) => {
|
|
43
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
44
|
+
return useSWR(
|
|
45
|
+
['group-agent-details', locale, params.identifier, params.version]
|
|
46
|
+
.filter(Boolean)
|
|
47
|
+
.join('-'),
|
|
48
|
+
async () => discoverService.getGroupAgentDetail(params),
|
|
49
|
+
{
|
|
50
|
+
revalidateOnFocus: false,
|
|
51
|
+
},
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
useGroupAgentIdentifiers: () => {
|
|
56
|
+
return useSWR(
|
|
57
|
+
'group-agent-identifiers',
|
|
58
|
+
async () => discoverService.getGroupAgentIdentifiers(),
|
|
59
|
+
{
|
|
60
|
+
revalidateOnFocus: false,
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
useGroupAgentList: (params = {}) => {
|
|
66
|
+
const locale = globalHelpers.getCurrentLanguage();
|
|
67
|
+
return useSWR(
|
|
68
|
+
['group-agent-list', locale, ...Object.values(params)].filter(Boolean).join('-'),
|
|
69
|
+
async () =>
|
|
70
|
+
discoverService.getGroupAgentList({
|
|
71
|
+
...params,
|
|
72
|
+
page: params.page ? Number(params.page) : 1,
|
|
73
|
+
pageSize: params.pageSize ? Number(params.pageSize) : 20,
|
|
74
|
+
}),
|
|
75
|
+
{
|
|
76
|
+
revalidateOnFocus: false,
|
|
77
|
+
},
|
|
78
|
+
);
|
|
79
|
+
},
|
|
80
|
+
});
|
|
@@ -4,6 +4,7 @@ import { type StateCreator } from 'zustand/vanilla';
|
|
|
4
4
|
|
|
5
5
|
import { createDevtools } from '../middleware/createDevtools';
|
|
6
6
|
import { type AssistantAction, createAssistantSlice } from './slices/assistant/action';
|
|
7
|
+
import { type GroupAgentAction, createGroupAgentSlice } from './slices/groupAgent/action';
|
|
7
8
|
import { type MCPAction, createMCPSlice } from './slices/mcp';
|
|
8
9
|
import { type ModelAction, createModelSlice } from './slices/model/action';
|
|
9
10
|
import { type PluginAction, createPluginSlice } from './slices/plugin/action';
|
|
@@ -15,6 +16,7 @@ import { type UserAction, createUserSlice } from './slices/user';
|
|
|
15
16
|
|
|
16
17
|
export type DiscoverStore = MCPAction &
|
|
17
18
|
AssistantAction &
|
|
19
|
+
GroupAgentAction &
|
|
18
20
|
ProviderAction &
|
|
19
21
|
ModelAction &
|
|
20
22
|
PluginAction &
|
|
@@ -26,6 +28,7 @@ const createStore: StateCreator<DiscoverStore, [['zustand/devtools', never]]> =
|
|
|
26
28
|
) => ({
|
|
27
29
|
...createMCPSlice(...parameters),
|
|
28
30
|
...createAssistantSlice(...parameters),
|
|
31
|
+
...createGroupAgentSlice(...parameters),
|
|
29
32
|
...createProviderSlice(...parameters),
|
|
30
33
|
...createModelSlice(...parameters),
|
|
31
34
|
...createPluginSlice(...parameters),
|
|
@@ -315,11 +315,10 @@ export const createLobehubSkillStoreSlice: StateCreator<
|
|
|
315
315
|
const response = await toolsClient.market.connectListConnections.query();
|
|
316
316
|
|
|
317
317
|
// Debug logging
|
|
318
|
-
console.log('[useFetchLobehubSkillConnections] raw response:', response);
|
|
319
318
|
|
|
320
319
|
return response.connections.map((conn: any) => {
|
|
321
320
|
// Debug logging for each connection
|
|
322
|
-
|
|
321
|
+
|
|
323
322
|
// Get provider config from local definition for correct display name
|
|
324
323
|
const providerConfig = getLobehubSkillProviderById(conn.providerId);
|
|
325
324
|
return {
|