Cleanup: server

This commit is contained in:
Zef Hemel
2025-06-17 13:48:56 +02:00
parent 54e45f6179
commit 3d805383bb
25 changed files with 405 additions and 1550 deletions
-34
View File
@@ -1,26 +1,5 @@
import type { ShellStreamClient } from "../../web/shell_stream_client.ts";
import { syscall } from "../syscall.ts";
/**
* Interface for the shell stream client
*/
export interface ShellStream {
/**
* Send data to the process stdin
*/
send(data: string): void;
/**
* Send a signal to the process
*/
kill(signal: string): void;
/**
* Close the connection
*/
close(): void;
}
/**
* Runs a shell command.
* @param cmd the command to run
@@ -33,16 +12,3 @@ export function run(
): Promise<{ stdout: string; stderr: string; code: number }> {
return syscall("shell.run", cmd, args);
}
/**
* Runs a shell command with streaming I/O.
* @param cmd the command to run
* @param args the arguments to pass to the command
* @returns a shell stream client for interacting with the process
*/
export function spawn(
cmd: string,
args: string[],
): Promise<ShellStreamClient> {
return syscall("shell.spawn", cmd, args);
}