@lobehub/lobehub 2.0.0-next.294 → 2.0.0-next.296
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/apps/desktop/src/main/__mocks__/node-mac-permissions.ts +0 -1
- package/apps/desktop/src/main/__mocks__/setup.ts +0 -1
- package/apps/desktop/src/main/controllers/__tests__/SystemCtr.test.ts +1 -4
- package/apps/desktop/tsconfig.json +4 -10
- package/changelog/v1.json +18 -0
- package/e2e/scripts/setup.ts +45 -32
- package/locales/en-US/plugin.json +4 -0
- package/locales/zh-CN/plugin.json +4 -0
- package/package.json +1 -1
- 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/database/src/models/__tests__/knowledgeBase.test.ts +1 -1
- package/packages/database/src/repositories/knowledge/index.ts +1 -4
- package/packages/prompts/src/prompts/gtd/index.test.ts +32 -16
- package/packages/prompts/src/prompts/gtd/index.ts +9 -5
- package/packages/types/src/discover/assistants.ts +2 -2
- package/packages/types/src/stepContext.ts +4 -1
- package/scripts/migrate-spa-navigation.ts +129 -0
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-topics/route.ts +112 -109
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-user-topics/route.ts +125 -113
- package/src/app/(backend)/api/workflows/memory-user-memory/pipelines/chat-topic/process-users/route.ts +74 -65
- package/src/app/[variants]/(auth)/auth-error/page.tsx +1 -1
- package/src/app/[variants]/(auth)/login/[[...login]]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/next-auth/error/AuthErrorPage.tsx +1 -1
- package/src/app/[variants]/(auth)/next-auth/signin/AuthSignInBox.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/callback/error/page.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/callback/success/page.tsx +1 -1
- package/src/app/[variants]/(auth)/oauth/consent/[uid]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/reset-password/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/reset-password/page.tsx +2 -2
- package/src/app/[variants]/(auth)/signin/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/signin/useSignIn.ts +1 -1
- package/src/app/[variants]/(auth)/signup/[[...signup]]/BetterAuthSignUpForm.tsx +2 -2
- package/src/app/[variants]/(auth)/signup/[[...signup]]/page.tsx +1 -1
- package/src/app/[variants]/(auth)/signup/[[...signup]]/useSignUp.tsx +1 -1
- package/src/app/[variants]/(auth)/verify-email/layout.tsx +1 -1
- package/src/app/[variants]/(auth)/verify-email/page.tsx +2 -2
- package/src/app/[variants]/(main)/_layout/index.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/CronTopicGroup.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/AddTopicButon.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/AllTopicsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/hooks/useThreadNavigation.ts +1 -1
- package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/hooks/useTopicNavigation.ts +1 -1
- package/src/app/[variants]/(main)/agent/features/TelemetryNotification.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Nav.tsx +9 -9
- package/src/app/[variants]/(main)/community/(detail)/assistant/features/Details/Versions/index.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/features/MakedownRender.tsx +1 -2
- package/src/app/[variants]/(main)/community/(detail)/features/ShareButton.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/features/Toc/Heading.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/mcp/features/Details/Versions/index.tsx +2 -2
- package/src/app/[variants]/(main)/community/(detail)/model/features/Details/Nav.tsx +12 -11
- package/src/app/[variants]/(main)/community/(detail)/model/features/Details/Parameter/ParameterItem.tsx +2 -3
- package/src/app/[variants]/(main)/community/(detail)/provider/features/Details/Nav.tsx +11 -10
- package/src/app/[variants]/(main)/community/(detail)/provider/features/Header.tsx +10 -9
- package/src/app/[variants]/(main)/community/(list)/(home)/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/assistant/features/Category/useCategory.tsx +1 -1
- package/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx +2 -3
- package/src/app/[variants]/(main)/community/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/CreateButton/Inner.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/CreateButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/community/features/Search.tsx +1 -2
- package/src/app/[variants]/(main)/community/features/Title.tsx +5 -5
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/AllTopicsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/hooks/useThreadNavigation.ts +1 -1
- package/src/app/[variants]/(main)/group/features/Conversation/Header/ShareButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/group/features/TelemetryNotification.tsx +2 -3
- package/src/app/[variants]/(main)/home/_layout/Body/Agent/AllAgentsDrawer/index.tsx +1 -1
- package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +6 -11
- package/src/app/[variants]/(main)/image/NotSupportClient.tsx +4 -3
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/ImageUpload.tsx +1 -1
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/ImageManageModal.tsx +1 -1
- package/src/app/[variants]/(main)/image/_layout/ConfigPanel/components/MultiImagesUpload/index.tsx +1 -1
- package/src/app/[variants]/(main)/memory/(home)/features/RoleTagCloud/index.tsx +1 -1
- package/src/app/[variants]/(main)/memory/_layout/Sidebar/Header/Nav.tsx +1 -1
- package/src/app/[variants]/(main)/memory/features/SourceLink.tsx +1 -1
- package/src/app/[variants]/(main)/page/_layout/Body/AllPagesDrawer/index.tsx +1 -1
- 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]/(main)/settings/about/features/ItemCard.tsx +2 -3
- package/src/app/[variants]/(main)/settings/about/features/ItemLink.tsx +2 -3
- package/src/app/[variants]/(main)/settings/about/features/Version.tsx +6 -7
- package/src/app/[variants]/(main)/settings/features/SettingsContent.tsx +1 -1
- package/src/app/[variants]/(main)/settings/features/UpgradeAlert.tsx +4 -4
- package/src/app/[variants]/(main)/settings/provider/(list)/Footer.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/detail/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/detail/ollama/CheckError.tsx +1 -1
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/index.tsx +12 -6
- package/src/app/[variants]/(main)/settings/security/index.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/overview/ShareButton/ShareModal.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/rankings/AssistantsRank.tsx +1 -1
- package/src/app/[variants]/(main)/settings/stats/features/rankings/TopicsRank.tsx +1 -1
- package/src/app/[variants]/(mobile)/_layout/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/chat/settings/features/AgentInfoDescription/index.tsx +1 -1
- package/src/app/[variants]/(mobile)/chat/settings/features/SettingButton.tsx +1 -1
- package/src/app/[variants]/(mobile)/router/index.tsx +1 -1
- package/src/app/[variants]/page.tsx +1 -1
- package/src/app/[variants]/router/index.tsx +1 -1
- package/src/components/404/index.tsx +4 -4
- package/src/components/Analytics/index.tsx +1 -1
- package/src/components/BrandWatermark/index.tsx +4 -4
- package/src/components/Branding/ProductLogo/Custom.tsx +1 -1
- package/src/components/Error/index.tsx +3 -4
- package/src/components/GoBack/index.tsx +2 -2
- package/src/components/LabsModal/LabCard.tsx +1 -1
- package/src/components/Link.tsx +25 -5
- package/src/components/OllamaSetupGuide/index.tsx +5 -4
- package/src/components/WebFavicon/index.tsx +1 -1
- package/src/components/client/ClientResponsiveContent/index.tsx +1 -1
- package/src/components/client/ClientResponsiveLayout.tsx +1 -1
- package/src/components/mdx/Image.tsx +1 -1
- package/src/components/mdx/Link.tsx +26 -9
- package/src/features/AlertBanner/CloudBanner.tsx +2 -3
- package/src/features/ChatInput/ActionBar/Model/ControlsForm.tsx +8 -7
- package/src/features/ChatInput/ActionBar/Params/Controls.tsx +1 -3
- package/src/features/ChatInput/ActionBar/Token/index.tsx +1 -1
- package/src/features/ChatInput/Mobile/index.tsx +1 -1
- package/src/features/Conversation/ChatItem/components/MessageContent/index.tsx +1 -1
- package/src/features/Conversation/Error/OllamaBizError/index.tsx +1 -1
- package/src/features/Conversation/Error/OllamaSetupGuide/Desktop.tsx +1 -2
- package/src/features/Conversation/Error/index.tsx +1 -1
- package/src/features/Conversation/Messages/AssistantGroup/Tool/Actions/Settings.tsx +1 -1
- 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 +18 -18
- package/src/features/Conversation/Messages/AssistantGroup/index.tsx +1 -1
- package/src/features/Conversation/Messages/Tool/Tool/index.tsx +11 -10
- package/src/features/Conversation/Messages/components/SearchGrounding.tsx +1 -1
- package/src/features/Conversation/TodoProgress/index.tsx +56 -23
- package/src/features/DataImporter/Error.tsx +3 -3
- package/src/features/DevPanel/CacheViewer/cacheProvider.tsx +2 -1
- package/src/features/DevPanel/MetadataViewer/Og.tsx +1 -1
- package/src/features/DevPanel/features/FloatPanel.tsx +1 -1
- package/src/features/DevPanel/features/Table/TooltipContent.tsx +3 -4
- package/src/features/DevPanel/index.tsx +1 -1
- package/src/features/EditorCanvas/InlineToolbar.tsx +1 -6
- package/src/features/FileViewer/NotSupport/index.tsx +2 -3
- package/src/features/Follow/index.tsx +8 -9
- package/src/features/LibraryModal/AddFilesToKnowledgeBase/SelectForm.tsx +2 -2
- package/src/features/MCP/Scores.tsx +1 -1
- package/src/features/MCPPluginDetail/Nav.tsx +8 -8
- package/src/features/MCPPluginDetail/Overview/TagList.tsx +1 -1
- package/src/features/MobileTabBar/index.tsx +2 -1
- package/src/features/OllamaSetupGuide/Desktop.tsx +1 -2
- package/src/features/PWAInstall/Install.tsx +1 -1
- package/src/features/PWAInstall/index.tsx +1 -1
- package/src/features/PluginStore/McpList/index.tsx +1 -1
- package/src/features/PluginStore/PluginList/Detail/Header.tsx +6 -6
- package/src/features/PluginsUI/Render/DefaultType/index.tsx +1 -1
- package/src/features/PluginsUI/Render/MCPType/index.tsx +1 -1
- package/src/features/Portal/Artifacts/Body/Renderer/index.tsx +1 -1
- package/src/features/ResourceManager/components/ChunkDrawer/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/Skeleton.tsx +26 -26
- package/src/features/ResourceManager/components/Explorer/ListView/index.tsx +16 -5
- package/src/features/ResourceManager/components/Explorer/ToolBar/BatchActionsDropdown.tsx +147 -149
- package/src/features/ResourceManager/components/LibraryHierarchy/styles.ts +5 -4
- package/src/features/ResourceManager/index.tsx +1 -1
- package/src/features/Setting/Footer.tsx +4 -5
- package/src/features/User/UserPanel/PanelContent.tsx +1 -1
- package/src/hooks/useActiveTabKey.ts +6 -4
- package/src/hooks/useIsSingleMode.test.ts +10 -24
- package/src/hooks/useIsSingleMode.ts +4 -2
- package/src/hooks/useIsSubSlug.ts +2 -1
- package/src/hooks/useQuery.ts +5 -5
- package/src/layout/GlobalProvider/AppTheme.tsx +2 -2
- package/src/layout/GlobalProvider/StyleRegistry.tsx +1 -1
- package/src/layout/GlobalProvider/useUserStateRedirect.ts +13 -25
- package/src/libs/next/Image.tsx +13 -0
- package/src/libs/next/Link.tsx +13 -0
- package/src/libs/next/dynamic.tsx +13 -0
- package/src/libs/next/index.ts +22 -0
- package/src/libs/next/navigation.ts +22 -0
- package/src/libs/router/Link.tsx +30 -0
- package/src/libs/router/index.ts +18 -0
- package/src/libs/router/navigation.ts +72 -0
- package/src/locales/default/plugin.ts +1 -0
- package/src/server/modules/AgentRuntime/AgentStateManager.ts +5 -1
- package/src/store/chat/slices/message/selectors/dbMessage.test.ts +11 -11
- package/src/store/chat/slices/portal/selectors.test.ts +5 -15
- package/src/store/file/slices/resource/action.ts +4 -2
- package/src/store/page/index.ts +1 -1
- package/src/store/page/slices/crud/index.ts +1 -1
- 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/app/[variants]/(main)/hooks/usePathname.ts +0 -10
- package/src/app/[variants]/(main)/hooks/useQuery.ts +0 -12
- package/src/app/[variants]/(main)/hooks/useRouter.ts +0 -22
- package/src/app/[variants]/(main)/hooks/useSearchParams.ts +0 -11
- 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
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import type { BuiltinInspectorProps } from '@lobechat/types';
|
|
4
|
-
import { Icon, Text } from '@lobehub/ui';
|
|
5
|
-
import { createStaticStyles, cssVar, cx } from 'antd-style';
|
|
6
|
-
import { Minus } from 'lucide-react';
|
|
7
|
-
import { memo } from 'react';
|
|
8
|
-
import { useTranslation } from 'react-i18next';
|
|
9
|
-
|
|
10
|
-
import { oneLineEllipsis, shinyTextStyles } from '@/styles';
|
|
11
|
-
|
|
12
|
-
import type { RemoveTodosParams, RemoveTodosState } from '../../../types';
|
|
13
|
-
|
|
14
|
-
const styles = createStaticStyles(({ css, cssVar }) => ({
|
|
15
|
-
title: css`
|
|
16
|
-
margin-inline-end: 8px;
|
|
17
|
-
color: ${cssVar.colorText};
|
|
18
|
-
`,
|
|
19
|
-
}));
|
|
20
|
-
|
|
21
|
-
export const RemoveTodosInspector = memo<
|
|
22
|
-
BuiltinInspectorProps<RemoveTodosParams, RemoveTodosState>
|
|
23
|
-
>(({ args, partialArgs, isArgumentsStreaming }) => {
|
|
24
|
-
const { t } = useTranslation('plugin');
|
|
25
|
-
|
|
26
|
-
const indices = args?.indices || partialArgs?.indices || [];
|
|
27
|
-
const count = indices.length;
|
|
28
|
-
|
|
29
|
-
if (isArgumentsStreaming && count === 0) {
|
|
30
|
-
return (
|
|
31
|
-
<div className={cx(oneLineEllipsis, shinyTextStyles.shinyText)}>
|
|
32
|
-
<span>{t('builtins.lobe-gtd.apiName.removeTodos')}</span>
|
|
33
|
-
</div>
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div className={cx(oneLineEllipsis, isArgumentsStreaming && shinyTextStyles.shinyText)}>
|
|
39
|
-
<span className={styles.title}>{t('builtins.lobe-gtd.apiName.removeTodos')}</span>
|
|
40
|
-
{count > 0 && (
|
|
41
|
-
<Text as={'span'} code color={cssVar.colorError} fontSize={12}>
|
|
42
|
-
<Icon icon={Minus} size={12} />
|
|
43
|
-
{count}
|
|
44
|
-
</Text>
|
|
45
|
-
)}
|
|
46
|
-
</div>
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
RemoveTodosInspector.displayName = 'RemoveTodosInspector';
|
|
51
|
-
|
|
52
|
-
export default RemoveTodosInspector;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import qs from 'query-string';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import { useSearchParams } from 'react-router-dom';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Hook to get query parameters
|
|
7
|
-
* React Router version for (main) directory
|
|
8
|
-
*/
|
|
9
|
-
export const useQuery = () => {
|
|
10
|
-
const [searchParams] = useSearchParams();
|
|
11
|
-
return useMemo(() => qs.parse(searchParams.toString()), [searchParams]);
|
|
12
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { useNavigate } from 'react-router-dom';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Hook to get router navigation functions
|
|
5
|
-
* React Router version for (main) directory
|
|
6
|
-
*
|
|
7
|
-
* Provides a Next.js-like API using React Router
|
|
8
|
-
*/
|
|
9
|
-
export const useRouter = () => {
|
|
10
|
-
const navigate = useNavigate();
|
|
11
|
-
|
|
12
|
-
return {
|
|
13
|
-
back: () => navigate(-1),
|
|
14
|
-
forward: () => navigate(1),
|
|
15
|
-
// Note: prefetch is not supported in React Router
|
|
16
|
-
prefetch: () => {},
|
|
17
|
-
|
|
18
|
-
push: (href: string) => navigate(href),
|
|
19
|
-
|
|
20
|
-
replace: (href: string) => navigate(href, { replace: true }),
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useSearchParams as useReactRouterSearchParams } from 'react-router-dom';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Hook to get search params
|
|
5
|
-
* React Router version for (main) directory
|
|
6
|
-
*
|
|
7
|
-
* Returns [searchParams, setSearchParams] tuple similar to React Router
|
|
8
|
-
*/
|
|
9
|
-
export const useSearchParams = () => {
|
|
10
|
-
return useReactRouterSearchParams();
|
|
11
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { type ChatPluginPayload } from '@lobechat/types';
|
|
2
|
-
import { Block, Flexbox, Highlighter } from '@lobehub/ui';
|
|
3
|
-
import { Divider } from 'antd';
|
|
4
|
-
import { memo, useEffect, useMemo } from 'react';
|
|
5
|
-
|
|
6
|
-
import PluginRender from '@/features/PluginsUI/Render';
|
|
7
|
-
|
|
8
|
-
import Arguments from './Arguments';
|
|
9
|
-
|
|
10
|
-
interface CustomRenderProps {
|
|
11
|
-
content: string;
|
|
12
|
-
/**
|
|
13
|
-
* The real message ID (tool message ID)
|
|
14
|
-
*/
|
|
15
|
-
messageId?: string;
|
|
16
|
-
plugin?: ChatPluginPayload;
|
|
17
|
-
pluginState?: any;
|
|
18
|
-
requestArgs?: string;
|
|
19
|
-
setShowPluginRender: (value: boolean) => void;
|
|
20
|
-
showPluginRender: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The tool call ID from the assistant message
|
|
23
|
-
*/
|
|
24
|
-
toolCallId: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Custom Render for Group Messages
|
|
29
|
-
*
|
|
30
|
-
* Group messages are already completed, so:
|
|
31
|
-
* - No loading state needed
|
|
32
|
-
* - No edit/re-run functionality
|
|
33
|
-
* - Results are directly available in content prop
|
|
34
|
-
*/
|
|
35
|
-
const CustomRender = memo<CustomRenderProps>(
|
|
36
|
-
({
|
|
37
|
-
toolCallId,
|
|
38
|
-
messageId,
|
|
39
|
-
content,
|
|
40
|
-
pluginState,
|
|
41
|
-
plugin,
|
|
42
|
-
requestArgs,
|
|
43
|
-
showPluginRender,
|
|
44
|
-
setShowPluginRender,
|
|
45
|
-
}) => {
|
|
46
|
-
// Determine if plugin UI should be shown based on plugin type
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
if (!plugin?.type) return;
|
|
49
|
-
setShowPluginRender(plugin.type !== 'default');
|
|
50
|
-
}, [plugin?.type, setShowPluginRender]);
|
|
51
|
-
|
|
52
|
-
// Parse and display result content
|
|
53
|
-
const { data, language } = useMemo(() => {
|
|
54
|
-
try {
|
|
55
|
-
const parsed = JSON.parse(content || '');
|
|
56
|
-
// If parsed result is a string, return it directly
|
|
57
|
-
if (typeof parsed === 'string') {
|
|
58
|
-
return { data: parsed, language: 'plaintext' };
|
|
59
|
-
}
|
|
60
|
-
return { data: JSON.stringify(parsed, null, 2), language: 'json' };
|
|
61
|
-
} catch {
|
|
62
|
-
return { data: content || '', language: 'plaintext' };
|
|
63
|
-
}
|
|
64
|
-
}, [content]);
|
|
65
|
-
|
|
66
|
-
// Show plugin custom UI if applicable
|
|
67
|
-
if (showPluginRender) {
|
|
68
|
-
return (
|
|
69
|
-
<Flexbox gap={12} id={toolCallId} width={'100%'}>
|
|
70
|
-
<PluginRender
|
|
71
|
-
arguments={plugin?.arguments}
|
|
72
|
-
content={content}
|
|
73
|
-
identifier={plugin?.identifier}
|
|
74
|
-
loading={false}
|
|
75
|
-
messageId={messageId}
|
|
76
|
-
payload={plugin}
|
|
77
|
-
pluginState={pluginState}
|
|
78
|
-
toolCallId={toolCallId}
|
|
79
|
-
type={plugin?.type}
|
|
80
|
-
/>
|
|
81
|
-
</Flexbox>
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// Default render: show arguments and result
|
|
86
|
-
return (
|
|
87
|
-
<Block id={toolCallId} variant={'outlined'} width={'100%'}>
|
|
88
|
-
<Arguments arguments={requestArgs} />
|
|
89
|
-
{content && (
|
|
90
|
-
<>
|
|
91
|
-
<Divider dashed style={{ marginBlock: 0 }} />
|
|
92
|
-
<Highlighter
|
|
93
|
-
language={language}
|
|
94
|
-
style={{
|
|
95
|
-
background: 'transparent',
|
|
96
|
-
borderRadius: 0,
|
|
97
|
-
maxHeight: 300,
|
|
98
|
-
overflow: 'auto',
|
|
99
|
-
}}
|
|
100
|
-
variant={'filled'}
|
|
101
|
-
>
|
|
102
|
-
{data}
|
|
103
|
-
</Highlighter>
|
|
104
|
-
</>
|
|
105
|
-
)}
|
|
106
|
-
</Block>
|
|
107
|
-
);
|
|
108
|
-
},
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
CustomRender.displayName = 'GroupCustomRender';
|
|
112
|
-
|
|
113
|
-
export default CustomRender;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Suspense, memo } from 'react';
|
|
2
|
-
|
|
3
|
-
import { dataSelectors, messageStateSelectors, useConversationStore } from '../../../store';
|
|
4
|
-
import CustomRender from '../../AssistantGroup/Tool/Render/CustomRender';
|
|
5
|
-
import ErrorResponse from '../../AssistantGroup/Tool/Render/ErrorResponse';
|
|
6
|
-
|
|
7
|
-
interface RenderProps {
|
|
8
|
-
messageId: string;
|
|
9
|
-
requestArgs?: string;
|
|
10
|
-
setShowPluginRender: (show: boolean) => void;
|
|
11
|
-
showPluginRender: boolean;
|
|
12
|
-
toolCallId: string;
|
|
13
|
-
toolIndex: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const Render = memo<RenderProps>(
|
|
17
|
-
({ toolCallId, toolIndex, messageId, requestArgs, showPluginRender, setShowPluginRender }) => {
|
|
18
|
-
const loading = useConversationStore(
|
|
19
|
-
messageStateSelectors.isToolCallStreaming(messageId, toolIndex),
|
|
20
|
-
);
|
|
21
|
-
const toolMessage = useConversationStore(dataSelectors.getDbMessageByToolCallId(toolCallId));
|
|
22
|
-
|
|
23
|
-
if (loading || !toolMessage) return null;
|
|
24
|
-
|
|
25
|
-
if (!!toolMessage) {
|
|
26
|
-
if (toolMessage.error) {
|
|
27
|
-
return <ErrorResponse {...toolMessage.error} id={messageId} plugin={toolMessage.plugin} />;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return (
|
|
31
|
-
<Suspense>
|
|
32
|
-
<CustomRender
|
|
33
|
-
{...toolMessage}
|
|
34
|
-
requestArgs={requestArgs}
|
|
35
|
-
setShowPluginRender={setShowPluginRender}
|
|
36
|
-
showPluginRender={showPluginRender}
|
|
37
|
-
toolCallId={toolCallId}
|
|
38
|
-
/>
|
|
39
|
-
</Suspense>
|
|
40
|
-
);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
Render.displayName = 'ToolRender';
|
|
46
|
-
|
|
47
|
-
export default Render;
|
/package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/AbortResponse.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/ErrorResponse.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/features/Conversation/Messages/AssistantGroup/Tool/{Render → Detail}/PluginSettings.tsx
RENAMED
|
File without changes
|
|
File without changes
|