silverbullet/server/syscalls/shell.ts

16 lines
422 B
TypeScript
Raw Normal View History

import { SysCallMapping } from "../../lib/plugos/system.ts";
2024-02-09 04:12:23 +08:00
import { ShellResponse } from "../../type/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 });
},
};
}