diff --git a/apps/remixdesktop/src/lib/InferenceServerManager.ts b/apps/remixdesktop/src/lib/InferenceServerManager.ts index 437f8ba4e6..70af0907fb 100644 --- a/apps/remixdesktop/src/lib/InferenceServerManager.ts +++ b/apps/remixdesktop/src/lib/InferenceServerManager.ts @@ -7,6 +7,7 @@ import { ICompletions, IModel, IParams, InsertionParams, CompletionParams, GenerationParams, ModelType, AIRequestType, IStreamResponse, ChatHistory, downloadLatestReleaseExecutable, buildSolgptPromt } from "@remix/remix-ai-core" +import { platform } from 'os'; class ServerStatusTimer { private intervalId: NodeJS.Timeout | null = null; @@ -265,11 +266,11 @@ export class InferenceManager implements ICompletions { // get platform name and return the path to the python script let exec_name = '' if (process.platform === 'win32') { - exec_name = 'InferenceServer_' + process.platform + '.exe' + exec_name = 'InferenceServer_' + process.platform + '_' + exec_suffix + '.exe' } else if (process.platform === 'linux') { - exec_name = 'InferenceServer_' + process.platform + exec_name = 'InferenceServer_' + process.platform + '_' + exec_suffix } else if (process.platform === 'darwin') { - exec_name = 'InferenceServer_' + process.platform + exec_name = 'InferenceServer_' + process.platform + '_' + exec_suffix } else { throw new Error('Unsupported platform') } diff --git a/libs/remix-ai-core/src/agents/codeExplainAgent.ts b/libs/remix-ai-core/src/agents/codeExplainAgent.ts new file mode 100644 index 0000000000..8d1d02b89f --- /dev/null +++ b/libs/remix-ai-core/src/agents/codeExplainAgent.ts @@ -0,0 +1,29 @@ +// interactive code explaining and highlight security vunerabilities +import * as fs from 'fs'; + +class CodeExplainAgent { + private codebase: string[]; // list of code base file + public currentFile: string; + + constructor(codebasePath: string) { + // git or fs + this.codebase = this.loadCodebase(codebasePath); + } + + private loadCodebase(path: string): string[] { + const files = fs.readdirSync(path); + return files + .filter(file => file.endsWith('.ts')) + .flatMap(file => fs.readFileSync(`${path}/${file}`, 'utf-8').split('\n')); + } + + public update(currentFile, lineNumber){ + + } + + public getExplanations(currentLine: string, numSuggestions: number = 3): string[] { + // process the code base explaining the current file and highlight some details + const suggestions: string[] = []; + return suggestions; + } +} diff --git a/libs/remix-ai-core/src/agents/completionAgent.ts b/libs/remix-ai-core/src/agents/completionAgent.ts new file mode 100644 index 0000000000..1bf14005c7 --- /dev/null +++ b/libs/remix-ai-core/src/agents/completionAgent.ts @@ -0,0 +1,23 @@ +import * as fs from 'fs'; + +class CodeCompletionAgent { + private codebase: string[]; + + constructor(codebasePath: string) { + // git or fs + this.codebase = this.loadCodebase(codebasePath); + } + + private loadCodebase(path: string): string[] { + const files = fs.readdirSync(path); + return files + .filter(file => file.endsWith('.ts')) + .flatMap(file => fs.readFileSync(`${path}/${file}`, 'utf-8').split('\n')); + } + + public getSuggestions(currentLine: string, numSuggestions: number = 3): string[] { + const suggestions: string[] = []; + // get `numSuggestions` from the llm + return suggestions; + } +} diff --git a/libs/remix-ai-core/src/agents/securityAgent.ts b/libs/remix-ai-core/src/agents/securityAgent.ts new file mode 100644 index 0000000000..32387b1209 --- /dev/null +++ b/libs/remix-ai-core/src/agents/securityAgent.ts @@ -0,0 +1,29 @@ +// security checks +import * as fs from 'fs'; + +class SecurityAgent { + private codebase: string[]; // list of code base file + public currentFile: string; + + constructor(codebasePath: string) { + // git or fs + this.codebase = this.loadCodebase(codebasePath); + } + + private loadCodebase(path: string): string[] { + const files = fs.readdirSync(path); + return files + .filter(file => file.endsWith('.ts')) + .flatMap(file => fs.readFileSync(`${path}/${file}`, 'utf-8').split('\n')); + } + + public update(currentFile, lineNumber){ + + } + + public getRecommendations(currentLine: string, numSuggestions: number = 3): string[] { + // process the code base highlighting security vunerabilities and deliver recommendations + const suggestions: string[] = []; + return suggestions; + } +}