@lobehub/lobehub 2.0.0-next.61 → 2.0.0-next.63
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 +14 -0
- package/locales/ar/plugin.json +2 -0
- package/locales/bg-BG/plugin.json +2 -0
- package/locales/de-DE/plugin.json +2 -0
- package/locales/en-US/plugin.json +8 -1
- package/locales/es-ES/plugin.json +2 -0
- package/locales/fa-IR/plugin.json +2 -0
- package/locales/fr-FR/plugin.json +2 -0
- package/locales/it-IT/plugin.json +2 -0
- package/locales/ja-JP/plugin.json +2 -0
- package/locales/ko-KR/plugin.json +2 -0
- package/locales/nl-NL/plugin.json +2 -0
- package/locales/pl-PL/plugin.json +2 -0
- package/locales/pt-BR/plugin.json +2 -0
- package/locales/ru-RU/plugin.json +2 -0
- package/locales/tr-TR/plugin.json +2 -0
- package/locales/vi-VN/plugin.json +2 -0
- package/locales/zh-CN/plugin.json +8 -1
- package/locales/zh-TW/plugin.json +2 -0
- package/package.json +1 -1
- package/src/app/(backend)/middleware/auth/index.ts +7 -2
- package/src/app/(backend)/trpc/async/[trpc]/route.ts +9 -3
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +9 -3
- package/src/app/(backend)/trpc/lambda/[trpc]/route.ts +9 -3
- package/src/app/(backend)/trpc/mobile/[trpc]/route.ts +9 -3
- package/src/app/(backend)/trpc/tools/[trpc]/route.ts +9 -3
- package/src/components/FileIcon/index.tsx +0 -2
- package/src/features/Conversation/Messages/Assistant/MessageContent.tsx +0 -18
- package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +26 -5
- package/src/features/Conversation/Messages/Group/Tool/index.tsx +1 -1
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/ToolTitle.tsx +1 -7
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/index.tsx +2 -15
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/CustomRender.tsx +1 -1
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/PluginSettings.tsx +2 -2
- package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/index.tsx +2 -31
- package/src/features/Conversation/Messages/Tool/ToolItem.tsx +51 -0
- package/src/features/Conversation/Messages/Tool/index.tsx +58 -0
- package/src/features/Conversation/Messages/index.tsx +5 -0
- package/src/features/ShareModal/ShareJSON/index.tsx +2 -2
- package/src/libs/trpc/utils/request-adapter.ts +20 -0
- package/src/locales/default/plugin.ts +8 -0
- package/src/store/chat/slices/message/action.test.ts +8 -4
- package/src/store/chat/slices/message/actions/optimisticUpdate.ts +12 -0
- package/src/store/chat/slices/message/actions/publicApi.ts +19 -17
- package/src/tools/local-system/index.ts +27 -27
- package/src/tools/local-system/systemRole.ts +7 -7
- package/src/features/Conversation/Messages/Assistant/Tool/Render/LoadingPlaceholder/index.tsx +0 -29
- package/src/features/Conversation/Messages/Assistant/Tool/index.tsx +0 -76
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/BuiltinPluginTitle.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Debug.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginResult.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginState.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Settings.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ObjectEntity.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ValueCell.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/index.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/ErrorResponse.tsx +0 -0
- /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/KeyValueEditor.tsx +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, memo, useEffect, useState } from 'react';
|
|
2
|
-
import { Flexbox } from 'react-layout-kit';
|
|
3
|
-
|
|
4
|
-
import AnimatedCollapsed from '@/components/AnimatedCollapsed';
|
|
5
|
-
import { useChatStore } from '@/store/chat';
|
|
6
|
-
import { messageStateSelectors } from '@/store/chat/selectors';
|
|
7
|
-
|
|
8
|
-
import Inspectors from './Inspector';
|
|
9
|
-
import Render from './Render';
|
|
10
|
-
|
|
11
|
-
export interface InspectorProps {
|
|
12
|
-
apiName: string;
|
|
13
|
-
arguments?: string;
|
|
14
|
-
id: string;
|
|
15
|
-
identifier: string;
|
|
16
|
-
index: number;
|
|
17
|
-
messageId: string;
|
|
18
|
-
payload: object;
|
|
19
|
-
style?: CSSProperties;
|
|
20
|
-
type?: string;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const Tool = memo<InspectorProps>(
|
|
24
|
-
({ arguments: requestArgs, apiName, messageId, id, index, identifier, style, payload, type }) => {
|
|
25
|
-
const [showDetail, setShowDetail] = useState(type !== 'mcp');
|
|
26
|
-
const [showPluginRender, setShowPluginRender] = useState(false);
|
|
27
|
-
const isLoading = useChatStore(messageStateSelectors.isInToolsCalling(messageId, index));
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
if (type !== 'mcp') return;
|
|
31
|
-
|
|
32
|
-
setTimeout(
|
|
33
|
-
() => {
|
|
34
|
-
setShowDetail(isLoading);
|
|
35
|
-
},
|
|
36
|
-
isLoading ? 1 : 1500,
|
|
37
|
-
);
|
|
38
|
-
}, [isLoading]);
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Flexbox gap={8} style={style}>
|
|
42
|
-
<Inspectors
|
|
43
|
-
apiName={apiName}
|
|
44
|
-
arguments={requestArgs}
|
|
45
|
-
// mcp don't have ui render
|
|
46
|
-
hidePluginUI={type === 'mcp'}
|
|
47
|
-
id={id}
|
|
48
|
-
identifier={identifier}
|
|
49
|
-
index={index}
|
|
50
|
-
messageId={messageId}
|
|
51
|
-
payload={payload}
|
|
52
|
-
setShowPluginRender={setShowPluginRender}
|
|
53
|
-
setShowRender={setShowDetail}
|
|
54
|
-
showPluginRender={showPluginRender}
|
|
55
|
-
showRender={showDetail}
|
|
56
|
-
/>
|
|
57
|
-
<AnimatedCollapsed open={showDetail}>
|
|
58
|
-
<Render
|
|
59
|
-
apiName={apiName}
|
|
60
|
-
identifier={identifier}
|
|
61
|
-
messageId={messageId}
|
|
62
|
-
requestArgs={requestArgs}
|
|
63
|
-
setShowPluginRender={setShowPluginRender}
|
|
64
|
-
showPluginRender={showPluginRender}
|
|
65
|
-
toolCallId={id}
|
|
66
|
-
toolIndex={index}
|
|
67
|
-
/>
|
|
68
|
-
</AnimatedCollapsed>
|
|
69
|
-
</Flexbox>
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
Tool.displayName = 'AssistantTool';
|
|
75
|
-
|
|
76
|
-
export default Tool;
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/BuiltinPluginTitle.tsx
RENAMED
|
File without changes
|
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginResult.tsx
RENAMED
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginState.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ValueCell.tsx
RENAMED
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/index.tsx
RENAMED
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/ErrorResponse.tsx
RENAMED
|
File without changes
|
/package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/KeyValueEditor.tsx
RENAMED
|
File without changes
|