Skip to content

Commit 6c0cfb9

Browse files
committed
feat: remove python code run on js
1 parent 2c52888 commit 6c0cfb9

File tree

10 files changed

+581
-845
lines changed

10 files changed

+581
-845
lines changed

electron.vite.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default defineConfig({
1212
main: {
1313
plugins: [
1414
externalizeDepsPlugin({
15-
exclude: ['mermaid', 'dompurify', 'pyodide']
15+
exclude: ['mermaid', 'dompurify']
1616
})
1717
],
1818
resolve: {
@@ -23,7 +23,7 @@ export default defineConfig({
2323
},
2424
build: {
2525
rollupOptions: {
26-
external: ['sharp', 'pyodide']
26+
external: ['sharp']
2727
}
2828
}
2929
},

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"ollama": "^0.5.16",
8181
"openai": "^5.3.0",
8282
"pdf-parse-new": "^1.3.9",
83-
"pyodide": "^0.27.5",
8483
"run-applescript": "^7.0.0",
8584
"sharp": "^0.33.5",
8685
"together-ai": "^0.16.0",

src/main/presenter/configPresenter/mcpConfHelper.ts

Lines changed: 48 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,52 @@ function isLinux(): boolean {
3131
// 平台特有的 MCP 服务器配置
3232
const PLATFORM_SPECIFIC_SERVERS: Record<string, MCPServerConfig> = {
3333
// macOS 特有服务
34-
...(isMacOS() ? {
35-
'deepchat/apple-server': {
36-
args: [],
37-
descriptions: 'DeepChat内置Apple系统集成服务 (仅macOS)',
38-
icons: '🍎',
39-
autoApprove: ['all'],
40-
type: 'inmemory' as MCPServerType,
41-
command: 'deepchat/apple-server',
42-
env: {},
43-
disable: false
44-
}
45-
} : {}),
46-
34+
...(isMacOS()
35+
? {
36+
'deepchat/apple-server': {
37+
args: [],
38+
descriptions: 'DeepChat内置Apple系统集成服务 (仅macOS)',
39+
icons: '🍎',
40+
autoApprove: ['all'],
41+
type: 'inmemory' as MCPServerType,
42+
command: 'deepchat/apple-server',
43+
env: {},
44+
disable: false
45+
}
46+
}
47+
: {}),
48+
4749
// Windows 特有服务 (预留)
48-
...(isWindows() ? {
49-
// 'deepchat-inmemory/windows-server': {
50-
// args: [],
51-
// descriptions: 'DeepChat内置Windows系统集成服务 (仅Windows)',
52-
// icons: '🪟',
53-
// autoApprove: ['all'],
54-
// type: 'inmemory' as MCPServerType,
55-
// command: 'deepchat-inmemory/windows-server',
56-
// env: {},
57-
// disable: false
58-
// }
59-
} : {}),
60-
50+
...(isWindows()
51+
? {
52+
// 'deepchat-inmemory/windows-server': {
53+
// args: [],
54+
// descriptions: 'DeepChat内置Windows系统集成服务 (仅Windows)',
55+
// icons: '🪟',
56+
// autoApprove: ['all'],
57+
// type: 'inmemory' as MCPServerType,
58+
// command: 'deepchat-inmemory/windows-server',
59+
// env: {},
60+
// disable: false
61+
// }
62+
}
63+
: {}),
64+
6165
// Linux 特有服务 (预留)
62-
...(isLinux() ? {
63-
// 'deepchat-inmemory/linux-server': {
64-
// args: [],
65-
// descriptions: 'DeepChat内置Linux系统集成服务 (仅Linux)',
66-
// icons: '🐧',
67-
// autoApprove: ['all'],
68-
// type: 'inmemory' as MCPServerType,
69-
// command: 'deepchat-inmemory/linux-server',
70-
// env: {},
71-
// disable: false
72-
// }
73-
} : {})
66+
...(isLinux()
67+
? {
68+
// 'deepchat-inmemory/linux-server': {
69+
// args: [],
70+
// descriptions: 'DeepChat内置Linux系统集成服务 (仅Linux)',
71+
// icons: '🐧',
72+
// autoApprove: ['all'],
73+
// type: 'inmemory' as MCPServerType,
74+
// command: 'deepchat-inmemory/linux-server',
75+
// env: {},
76+
// disable: false
77+
// }
78+
}
79+
: {})
7480
}
7581

7682
// 抽取inmemory类型的服务为常量
@@ -335,8 +341,10 @@ export class McpConfHelper {
335341
}
336342

337343
// 如果有变化,更新存储
338-
if (Object.keys(updatedServers).length !== Object.keys(storedServers).length ||
339-
serversToRemove.length > 0) {
344+
if (
345+
Object.keys(updatedServers).length !== Object.keys(storedServers).length ||
346+
serversToRemove.length > 0
347+
) {
340348
this.mcpStore.set('mcpServers', updatedServers)
341349
}
342350

0 commit comments

Comments
 (0)