Change server-side shell running implementation

This commit is contained in:
Zef Hemel
2023-12-17 15:25:44 +01:00
parent 7bd58ae0e8
commit b3d5af360b
5 changed files with 23 additions and 26 deletions
+16
View File
@@ -0,0 +1,16 @@
import { shell } from "$sb/syscalls.ts";
import { SysCallMapping } from "../../plugos/system.ts";
import { ShellResponse } from "../../server/rpc.ts";
import { ShellBackend } from "../shell_backend.ts";
export function shellSyscalls(shellBackend: ShellBackend): SysCallMapping {
return {
"shell.run": (
_ctx,
cmd: string,
args: string[],
): Promise<ShellResponse> => {
return shellBackend.handle({ cmd, args });
},
};
}