@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.
Files changed (59) hide show
  1. package/CHANGELOG.md +50 -0
  2. package/changelog/v1.json +14 -0
  3. package/locales/ar/plugin.json +2 -0
  4. package/locales/bg-BG/plugin.json +2 -0
  5. package/locales/de-DE/plugin.json +2 -0
  6. package/locales/en-US/plugin.json +8 -1
  7. package/locales/es-ES/plugin.json +2 -0
  8. package/locales/fa-IR/plugin.json +2 -0
  9. package/locales/fr-FR/plugin.json +2 -0
  10. package/locales/it-IT/plugin.json +2 -0
  11. package/locales/ja-JP/plugin.json +2 -0
  12. package/locales/ko-KR/plugin.json +2 -0
  13. package/locales/nl-NL/plugin.json +2 -0
  14. package/locales/pl-PL/plugin.json +2 -0
  15. package/locales/pt-BR/plugin.json +2 -0
  16. package/locales/ru-RU/plugin.json +2 -0
  17. package/locales/tr-TR/plugin.json +2 -0
  18. package/locales/vi-VN/plugin.json +2 -0
  19. package/locales/zh-CN/plugin.json +8 -1
  20. package/locales/zh-TW/plugin.json +2 -0
  21. package/package.json +1 -1
  22. package/src/app/(backend)/middleware/auth/index.ts +7 -2
  23. package/src/app/(backend)/trpc/async/[trpc]/route.ts +9 -3
  24. package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +9 -3
  25. package/src/app/(backend)/trpc/lambda/[trpc]/route.ts +9 -3
  26. package/src/app/(backend)/trpc/mobile/[trpc]/route.ts +9 -3
  27. package/src/app/(backend)/trpc/tools/[trpc]/route.ts +9 -3
  28. package/src/components/FileIcon/index.tsx +0 -2
  29. package/src/features/Conversation/Messages/Assistant/MessageContent.tsx +0 -18
  30. package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +26 -5
  31. package/src/features/Conversation/Messages/Group/Tool/index.tsx +1 -1
  32. package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/ToolTitle.tsx +1 -7
  33. package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/index.tsx +2 -15
  34. package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/CustomRender.tsx +1 -1
  35. package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/PluginSettings.tsx +2 -2
  36. package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/index.tsx +2 -31
  37. package/src/features/Conversation/Messages/Tool/ToolItem.tsx +51 -0
  38. package/src/features/Conversation/Messages/Tool/index.tsx +58 -0
  39. package/src/features/Conversation/Messages/index.tsx +5 -0
  40. package/src/features/ShareModal/ShareJSON/index.tsx +2 -2
  41. package/src/libs/trpc/utils/request-adapter.ts +20 -0
  42. package/src/locales/default/plugin.ts +8 -0
  43. package/src/store/chat/slices/message/action.test.ts +8 -4
  44. package/src/store/chat/slices/message/actions/optimisticUpdate.ts +12 -0
  45. package/src/store/chat/slices/message/actions/publicApi.ts +19 -17
  46. package/src/tools/local-system/index.ts +27 -27
  47. package/src/tools/local-system/systemRole.ts +7 -7
  48. package/src/features/Conversation/Messages/Assistant/Tool/Render/LoadingPlaceholder/index.tsx +0 -29
  49. package/src/features/Conversation/Messages/Assistant/Tool/index.tsx +0 -76
  50. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/BuiltinPluginTitle.tsx +0 -0
  51. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Debug.tsx +0 -0
  52. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginResult.tsx +0 -0
  53. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/PluginState.tsx +0 -0
  54. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Inspector/Settings.tsx +0 -0
  55. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ObjectEntity.tsx +0 -0
  56. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/ValueCell.tsx +0 -0
  57. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/Arguments/index.tsx +0 -0
  58. /package/src/features/Conversation/Messages/{Assistant/Tool → Tool}/Render/ErrorResponse.tsx +0 -0
  59. /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;