feat(core): Refactor codebase and update dependencies.

This commit is contained in:
2024-12-09 02:39:31 +01:00
parent c9a3de2207
commit 35f59054f8
10 changed files with 3490 additions and 299 deletions

View File

@@ -0,0 +1,24 @@
import * as plugins from './plugins.js'
import { Smartshell, type IExecResultStreaming } from './classes.smartshell.js';
export class SmartExecution {
public smartshell: Smartshell;
public currentStreamingExecution: IExecResultStreaming;
public commandString: string;
constructor(commandStringArg: string) {
this.commandString = commandStringArg;
}
public async restart() {
if (!this.smartshell) {
this.smartshell = new Smartshell({
executor: 'bash',
});
}
if (this.currentStreamingExecution) {
await this.currentStreamingExecution.kill();
}
this.currentStreamingExecution = await this.smartshell.execStreaming(this.commandString);
}
}