@lobehub/chat 1.116.2 → 1.116.3
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 +25 -0
- package/apps/desktop/package.json +1 -1
- package/changelog/v1.json +9 -0
- package/package.json +1 -1
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +26 -0
- package/src/app/(backend)/trpc/trpc.test.ts +10 -0
- package/src/app/desktop/devtools/page.tsx +89 -0
- package/src/app/desktop/layout.tsx +31 -0
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
# Changelog
|
4
4
|
|
5
|
+
### [Version 1.116.3](https://github.com/lobehub/lobe-chat/compare/v1.116.2...v1.116.3)
|
6
|
+
|
7
|
+
<sup>Released on **2025-08-28**</sup>
|
8
|
+
|
9
|
+
#### 🐛 Bug Fixes
|
10
|
+
|
11
|
+
- **misc**: Fix desktop route error.
|
12
|
+
|
13
|
+
<br/>
|
14
|
+
|
15
|
+
<details>
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
17
|
+
|
18
|
+
#### What's fixed
|
19
|
+
|
20
|
+
- **misc**: Fix desktop route error, closes [#8962](https://github.com/lobehub/lobe-chat/issues/8962) ([27a4b34](https://github.com/lobehub/lobe-chat/commit/27a4b34))
|
21
|
+
|
22
|
+
</details>
|
23
|
+
|
24
|
+
<div align="right">
|
25
|
+
|
26
|
+
[](#readme-top)
|
27
|
+
|
28
|
+
</div>
|
29
|
+
|
5
30
|
### [Version 1.116.2](https://github.com/lobehub/lobe-chat/compare/v1.116.1...v1.116.2)
|
6
31
|
|
7
32
|
<sup>Released on **2025-08-28**</sup>
|
package/changelog/v1.json
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lobehub/chat",
|
3
|
-
"version": "1.116.
|
3
|
+
"version": "1.116.3",
|
4
4
|
"description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
|
5
5
|
"keywords": [
|
6
6
|
"framework",
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { fetchRequestHandler } from '@trpc/server/adapters/fetch';
|
2
|
+
import type { NextRequest } from 'next/server';
|
3
|
+
|
4
|
+
import { pino } from '@/libs/logger';
|
5
|
+
import { createLambdaContext } from '@/libs/trpc/lambda/context';
|
6
|
+
import { desktopRouter } from '@/server/routers/desktop';
|
7
|
+
|
8
|
+
const handler = (req: NextRequest) =>
|
9
|
+
fetchRequestHandler({
|
10
|
+
/**
|
11
|
+
* @link https://trpc.io/docs/v11/context
|
12
|
+
*/
|
13
|
+
createContext: () => createLambdaContext(req),
|
14
|
+
|
15
|
+
endpoint: '/trpc/desktop',
|
16
|
+
|
17
|
+
onError: ({ error, path, type }) => {
|
18
|
+
pino.info(`Error in tRPC handler (desktop) on path: ${path}, type: ${type}`);
|
19
|
+
console.error(error);
|
20
|
+
},
|
21
|
+
|
22
|
+
req,
|
23
|
+
router: desktopRouter,
|
24
|
+
});
|
25
|
+
|
26
|
+
export { handler as GET, handler as POST };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { existsSync } from 'fs';
|
2
|
+
import { join } from 'path';
|
3
|
+
import { describe, expect, it } from 'vitest';
|
4
|
+
|
5
|
+
describe('Desktop TRPC Route', () => {
|
6
|
+
it('should have desktop directory', () => {
|
7
|
+
const desktopPath = join(__dirname, 'desktop');
|
8
|
+
expect(existsSync(desktopPath)).toBe(true);
|
9
|
+
});
|
10
|
+
});
|
@@ -0,0 +1,89 @@
|
|
1
|
+
'use client';
|
2
|
+
|
3
|
+
import { ActionIcon, SideNav } from '@lobehub/ui';
|
4
|
+
import { Cog, DatabaseIcon } from 'lucide-react';
|
5
|
+
import { memo, useState } from 'react';
|
6
|
+
import { Flexbox } from 'react-layout-kit';
|
7
|
+
|
8
|
+
import { BRANDING_NAME } from '@/const/branding';
|
9
|
+
import PostgresViewer from '@/features/DevPanel/PostgresViewer';
|
10
|
+
import SystemInspector from '@/features/DevPanel/SystemInspector';
|
11
|
+
import { useStyles } from '@/features/DevPanel/features/FloatPanel';
|
12
|
+
import { electronStylish } from '@/styles/electron';
|
13
|
+
|
14
|
+
const DevTools = memo(() => {
|
15
|
+
const { styles, theme, cx } = useStyles();
|
16
|
+
|
17
|
+
const items = [
|
18
|
+
{
|
19
|
+
children: <PostgresViewer />,
|
20
|
+
icon: <DatabaseIcon size={16} />,
|
21
|
+
key: 'Postgres Viewer',
|
22
|
+
},
|
23
|
+
{
|
24
|
+
children: <SystemInspector />,
|
25
|
+
icon: <Cog size={16} />,
|
26
|
+
key: 'System Status',
|
27
|
+
},
|
28
|
+
];
|
29
|
+
|
30
|
+
const [tab, setTab] = useState<string>(items[0].key);
|
31
|
+
|
32
|
+
return (
|
33
|
+
<Flexbox height={'100%'} style={{ overflow: 'hidden', position: 'relative' }} width={'100%'}>
|
34
|
+
<Flexbox
|
35
|
+
align={'center'}
|
36
|
+
className={cx(`panel-drag-handle`, styles.header, electronStylish.draggable)}
|
37
|
+
horizontal
|
38
|
+
justify={'center'}
|
39
|
+
>
|
40
|
+
<Flexbox align={'baseline'} gap={6} horizontal>
|
41
|
+
<b>{BRANDING_NAME} Dev Tools</b>
|
42
|
+
<span style={{ color: theme.colorTextDescription }}>/</span>
|
43
|
+
<span style={{ color: theme.colorTextDescription }}>{tab}</span>
|
44
|
+
</Flexbox>
|
45
|
+
</Flexbox>
|
46
|
+
<Flexbox
|
47
|
+
height={'100%'}
|
48
|
+
horizontal
|
49
|
+
style={{ background: theme.colorBgLayout, overflow: 'hidden', position: 'relative' }}
|
50
|
+
width={'100%'}
|
51
|
+
>
|
52
|
+
<SideNav
|
53
|
+
bottomActions={[]}
|
54
|
+
style={{
|
55
|
+
background: 'transparent',
|
56
|
+
width: 48,
|
57
|
+
}}
|
58
|
+
topActions={items.map((item) => (
|
59
|
+
<ActionIcon
|
60
|
+
active={tab === item.key}
|
61
|
+
icon={item.icon}
|
62
|
+
key={item.key}
|
63
|
+
onClick={() => setTab(item.key)}
|
64
|
+
title={item.key}
|
65
|
+
tooltipProps={{
|
66
|
+
placement: 'right',
|
67
|
+
}}
|
68
|
+
/>
|
69
|
+
))}
|
70
|
+
/>
|
71
|
+
{items.map((item) => (
|
72
|
+
<Flexbox
|
73
|
+
flex={1}
|
74
|
+
height={'100%'}
|
75
|
+
key={item.key}
|
76
|
+
style={{
|
77
|
+
display: tab === item.key ? 'flex' : 'none',
|
78
|
+
overflow: 'hidden',
|
79
|
+
}}
|
80
|
+
>
|
81
|
+
{item.children}
|
82
|
+
</Flexbox>
|
83
|
+
))}
|
84
|
+
</Flexbox>
|
85
|
+
</Flexbox>
|
86
|
+
);
|
87
|
+
});
|
88
|
+
|
89
|
+
export default DevTools;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { notFound } from 'next/navigation';
|
2
|
+
import { NuqsAdapter } from 'nuqs/adapters/next/app';
|
3
|
+
import { ReactNode } from 'react';
|
4
|
+
|
5
|
+
import { isDesktop } from '@/const/version';
|
6
|
+
import GlobalLayout from '@/layout/GlobalProvider';
|
7
|
+
import { ServerConfigStoreProvider } from '@/store/serverConfig/Provider';
|
8
|
+
|
9
|
+
interface RootLayoutProps {
|
10
|
+
children: ReactNode;
|
11
|
+
}
|
12
|
+
|
13
|
+
const RootLayout = async ({ children }: RootLayoutProps) => {
|
14
|
+
if (!isDesktop) return notFound();
|
15
|
+
|
16
|
+
return (
|
17
|
+
<html dir="ltr" suppressHydrationWarning>
|
18
|
+
<body>
|
19
|
+
<NuqsAdapter>
|
20
|
+
<ServerConfigStoreProvider>
|
21
|
+
<GlobalLayout appearance={'auto'} isMobile={false} locale={''}>
|
22
|
+
{children}
|
23
|
+
</GlobalLayout>
|
24
|
+
</ServerConfigStoreProvider>
|
25
|
+
</NuqsAdapter>
|
26
|
+
</body>
|
27
|
+
</html>
|
28
|
+
);
|
29
|
+
};
|
30
|
+
|
31
|
+
export default RootLayout;
|