@lobehub/lobehub 2.0.0-next.280 → 2.0.0-next.282
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/e2e/src/steps/agent/conversation-mgmt.steps.ts +47 -3
- package/package.json +1 -1
- package/packages/builtin-tool-group-agent-builder/src/client/Render/BatchCreateAgents.tsx +19 -3
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/BatchCreateAgents/index.tsx +19 -4
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/UpdateAgentPrompt/index.tsx +3 -13
- package/packages/builtin-tool-group-agent-builder/src/client/Streaming/UpdateGroupPrompt/index.tsx +1 -1
- package/packages/builtin-tool-group-agent-builder/src/systemRole.ts +83 -121
- package/packages/builtin-tool-local-system/src/client/Inspector/ReadLocalFile/index.tsx +20 -2
- package/packages/observability-otel/src/node.ts +40 -3
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/List/Item/index.tsx +9 -1
- package/src/app/[variants]/(main)/agent/features/Conversation/ConversationArea.tsx +1 -28
- package/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx +3 -3
- package/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/GroupMember.tsx +8 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/GroupConfig/Header/Avatar.tsx +2 -13
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Agent/index.tsx +3 -4
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/List/Item/index.tsx +17 -8
- package/src/app/[variants]/(main)/group/features/Conversation/ConversationArea.tsx +1 -29
- package/src/app/[variants]/(main)/group/features/Conversation/Header/ShareButton/index.tsx +0 -2
- package/src/app/[variants]/(main)/group/features/GroupAvatar.tsx +17 -9
- package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/TopicSelector.tsx +8 -5
- package/src/app/[variants]/(main)/group/profile/features/Header/ChromeTabs/index.tsx +20 -2
- package/src/app/[variants]/(main)/group/profile/features/MemberProfile/AgentTool.tsx +4 -2
- package/src/app/[variants]/(main)/group/profile/features/ProfileHydration.tsx +5 -25
- package/src/features/AgentGroupAvatar/index.tsx +38 -0
- package/src/features/Conversation/Messages/Supervisor/index.tsx +8 -2
- package/src/features/Conversation/Messages/User/useMarkdown.tsx +1 -2
- package/src/features/EditorModal/EditorCanvas.tsx +62 -0
- package/src/features/EditorModal/TextArea.tsx +30 -0
- package/src/features/EditorModal/Typobar.tsx +139 -0
- package/src/features/EditorModal/index.tsx +18 -8
- package/src/features/NavPanel/components/EmptyNavItem.tsx +2 -2
- package/src/features/NavPanel/components/NavItem.tsx +27 -3
- package/src/features/ToolTag/index.tsx +167 -0
- package/src/server/routers/lambda/topic.ts +8 -1
- package/src/services/chat/mecha/contextEngineering.test.ts +1 -1
- package/src/services/chat/mecha/contextEngineering.ts +3 -4
- package/src/services/chat/mecha/memoryManager.ts +9 -38
- package/src/store/agentGroup/initialState.ts +1 -1
- package/src/store/agentGroup/slices/lifecycle.ts +15 -2
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/hooks/useTopicNavigation.ts +0 -49
|
@@ -14,10 +14,16 @@ export interface ChatGroupLifecycleAction {
|
|
|
14
14
|
silent?: boolean,
|
|
15
15
|
) => Promise<string>;
|
|
16
16
|
/**
|
|
17
|
+
* @deprecated Use switchTopic(undefined) instead
|
|
17
18
|
* Switch to a new topic in the group
|
|
18
19
|
* Clears activeTopicId and navigates to group root
|
|
19
20
|
*/
|
|
20
21
|
switchToNewTopic: () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Switch to a topic in the group with proper route handling
|
|
24
|
+
* @param topicId - Topic ID to switch to, or undefined/null for new topic
|
|
25
|
+
*/
|
|
26
|
+
switchTopic: (topicId?: string | null) => void;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export const chatGroupLifecycleSlice: StateCreator<
|
|
@@ -57,13 +63,20 @@ export const chatGroupLifecycleSlice: StateCreator<
|
|
|
57
63
|
},
|
|
58
64
|
|
|
59
65
|
switchToNewTopic: () => {
|
|
66
|
+
get().switchTopic(undefined);
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
switchTopic: (topicId) => {
|
|
60
70
|
const { activeGroupId, router } = get();
|
|
61
71
|
if (!activeGroupId || !router) return;
|
|
62
72
|
|
|
63
|
-
|
|
73
|
+
// Update chat store's activeTopicId
|
|
74
|
+
useChatStore.getState().switchTopic(topicId ?? undefined);
|
|
64
75
|
|
|
76
|
+
// Navigate with replace to avoid stale query params
|
|
65
77
|
router.push(urlJoin('/group', activeGroupId), {
|
|
66
|
-
query: {
|
|
78
|
+
query: { topic: topicId ?? null },
|
|
79
|
+
replace: true,
|
|
67
80
|
});
|
|
68
81
|
},
|
|
69
82
|
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { usePathname } from 'next/navigation';
|
|
2
|
-
import { useCallback } from 'react';
|
|
3
|
-
import urlJoin from 'url-join';
|
|
4
|
-
|
|
5
|
-
import { useQueryRoute } from '@/hooks/useQueryRoute';
|
|
6
|
-
import { useAgentGroupStore } from '@/store/agentGroup';
|
|
7
|
-
import { useChatStore } from '@/store/chat';
|
|
8
|
-
import { useGlobalStore } from '@/store/global';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Hook to handle topic navigation with automatic route detection
|
|
12
|
-
* If in agent sub-route (e.g., /agent/:aid/profile), navigate back to chat first
|
|
13
|
-
*/
|
|
14
|
-
export const useTopicNavigation = () => {
|
|
15
|
-
const pathname = usePathname();
|
|
16
|
-
const activeGroupId = useAgentGroupStore((s) => s.activeGroupId);
|
|
17
|
-
const router = useQueryRoute();
|
|
18
|
-
const toggleConfig = useGlobalStore((s) => s.toggleMobileTopic);
|
|
19
|
-
const switchTopic = useChatStore((s) => s.switchTopic);
|
|
20
|
-
|
|
21
|
-
const isInAgentSubRoute = useCallback(() => {
|
|
22
|
-
if (!activeGroupId) return false;
|
|
23
|
-
const agentBasePath = `/group/${activeGroupId}`;
|
|
24
|
-
// If pathname has more segments after /agent/:aid, it's a sub-route
|
|
25
|
-
return (
|
|
26
|
-
pathname.startsWith(agentBasePath) &&
|
|
27
|
-
pathname !== agentBasePath &&
|
|
28
|
-
pathname !== `${agentBasePath}/`
|
|
29
|
-
);
|
|
30
|
-
}, [pathname, activeGroupId]);
|
|
31
|
-
|
|
32
|
-
const navigateToTopic = useCallback(
|
|
33
|
-
(topicId?: string) => {
|
|
34
|
-
// If in agent sub-route, navigate back to agent chat first
|
|
35
|
-
if (isInAgentSubRoute() && activeGroupId) {
|
|
36
|
-
router.push(urlJoin('/group', activeGroupId as string));
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
switchTopic(topicId);
|
|
40
|
-
toggleConfig(false);
|
|
41
|
-
},
|
|
42
|
-
[activeGroupId, router, switchTopic, toggleConfig, isInAgentSubRoute],
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
return {
|
|
46
|
-
isInAgentSubRoute: isInAgentSubRoute(),
|
|
47
|
-
navigateToTopic,
|
|
48
|
-
};
|
|
49
|
-
};
|