diff --git a/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx b/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx index 3f39e980d0..0fd0917d08 100644 --- a/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx +++ b/apps/remix-ide/src/app/plugins/remixAIPlugin.tsx @@ -4,7 +4,6 @@ import { Plugin } from '@remixproject/engine'; import { RemixAITab } from '@remix-ui/remix-ai' import React from 'react'; import { ICompletions, IModel, RemoteInferencer, IRemoteModel } from '@remix/remix-ai-core'; -import { CustomRemixApi } from '@remix-api' const profile = { name: 'remixAI', @@ -12,7 +11,7 @@ const profile = { methods: ['code_generation', 'code_completion', "solidity_answer", "code_explaining", "code_insertion", "error_explaining", - "initialize", "chatPipe", "ProcessChatRequestBuffer"], + "initialize"], events: [], icon: 'assets/img/remix-logo-blue.png', description: 'RemixAI provides AI services to Remix IDE.', @@ -23,7 +22,7 @@ const profile = { maintainedBy: 'Remix' } -export class RemixAIPlugin extends Plugin { +export class RemixAIPlugin extends Plugin { isOnDesktop:boolean = false aiIsActivated:boolean = false readonly remixDesktopPluginName = 'remixAID' @@ -85,7 +84,7 @@ export class RemixAIPlugin extends Plugin { async code_generation(prompt: string): Promise { if (this.isInferencing) { - this.call('terminal', 'logHtml', "RemixAI is already busy!") + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI is already busy!" }) return } @@ -106,11 +105,11 @@ export class RemixAIPlugin extends Plugin { async solidity_answer(prompt: string): Promise { if (this.isInferencing) { - this.call('terminal', 'logHtml', "RemixAI is already busy!" ) + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI is already busy!" }) return } - this.call('terminal', 'logHtml', '\n\nWaiting for RemixAI answer...') + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for RemixAI answer...` }) let result if (this.isOnDesktop) { @@ -118,18 +117,18 @@ export class RemixAIPlugin extends Plugin { } else { result = await this.remoteInferencer.solidity_answer(prompt) } - if (result) this.call('terminal', 'logHtml', result) + if (result) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result }) // this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI Done" }) return result } async code_explaining(prompt: string): Promise { if (this.isInferencing) { - this.call('terminal', 'logHtml',"RemixAI is already busy!") + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI is already busy!" }) return } - this.call('terminal', 'logHtml', '\n\nWaiting for RemixAI answer...') + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for RemixAI answer...` }) let result if (this.isOnDesktop) { @@ -138,18 +137,18 @@ export class RemixAIPlugin extends Plugin { } else { result = await this.remoteInferencer.code_explaining(prompt) } - if (result) this.call('terminal', 'logHtml', result ) + if (result) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result }) // this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI Done" }) return result } async error_explaining(prompt: string): Promise { if (this.isInferencing) { - this.call('terminal', 'logHtml', "RemixAI is already busy!") + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI is already busy!" }) return } - this.call('terminal', 'logHtml', '\n\nWaiting for RemixAI answer...') + this.call('terminal', 'log', { type: 'aitypewriterwarning', value: `\n\nWaiting for RemixAI answer...` }) let result if (this.isOnDesktop) { @@ -157,7 +156,7 @@ export class RemixAIPlugin extends Plugin { } else { result = await this.remoteInferencer.error_explaining(prompt) } - if (result) this.call('terminal', 'logHtml', result) + if (result) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result }) // this.call('terminal', 'log', { type: 'aitypewriterwarning', value: "RemixAI Done" }) return result } diff --git a/libs/remix-api/src/lib/plugins/terminal-api.ts b/libs/remix-api/src/lib/plugins/terminal-api.ts index e7fc77bab5..7191f5f204 100644 --- a/libs/remix-api/src/lib/plugins/terminal-api.ts +++ b/libs/remix-api/src/lib/plugins/terminal-api.ts @@ -6,5 +6,6 @@ export interface IExtendedTerminalApi extends ITerminal { } & StatusEvents methods: ITerminal['methods'] & { logHtml(html: string): void + log(message: any): void } } \ No newline at end of file