chore: remove useless code
This commit is contained in:
@@ -2,10 +2,6 @@ import fs from 'node:fs'
|
||||
|
||||
export default class FileService {
|
||||
public static async readFile(_: Electron.IpcMainInvokeEvent, path: string) {
|
||||
const stats = fs.statSync(path)
|
||||
if (stats.isDirectory()) {
|
||||
throw new Error(`Cannot read directory: ${path}`)
|
||||
}
|
||||
return fs.readFileSync(path, 'utf8')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,11 +213,6 @@ class FileStorage {
|
||||
|
||||
public readFile = async (_: Electron.IpcMainInvokeEvent, id: string): Promise<string> => {
|
||||
const filePath = path.join(this.storageDir, id)
|
||||
const stats = await fs.promises.stat(filePath)
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
throw new Error(`Cannot read directory: ${filePath}`)
|
||||
}
|
||||
|
||||
if (documentExts.includes(path.extname(filePath))) {
|
||||
const originalCwd = process.cwd()
|
||||
|
||||
@@ -3,6 +3,7 @@ import { Client } from '@modelcontextprotocol/sdk/client/index.js'
|
||||
import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js'
|
||||
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
|
||||
import { MCPServer } from '@types'
|
||||
import { app } from 'electron'
|
||||
import Logger from 'electron-log'
|
||||
|
||||
class McpService {
|
||||
@@ -43,7 +44,7 @@ class McpService {
|
||||
}
|
||||
|
||||
// Create new client instance for each connection
|
||||
this.client = new Client({ name: 'McpService', version: '1.0.0' }, { capabilities: {} })
|
||||
this.client = new Client({ name: 'Cherry Studio', version: app.getVersion() }, { capabilities: {} })
|
||||
|
||||
const args = [...(server.args || [])]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user