diff options
Diffstat (limited to 'packages/exec-backend/src/backend.ts')
| -rw-r--r-- | packages/exec-backend/src/backend.ts | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/packages/exec-backend/src/backend.ts b/packages/exec-backend/src/backend.ts index f6a807f..3eea7c0 100644 --- a/packages/exec-backend/src/backend.ts +++ b/packages/exec-backend/src/backend.ts @@ -24,30 +24,30 @@ /** A spawned process's result. Mirrors tool-shell's `SpawnResult` exactly. */ export interface ExecResult { - readonly exitCode: number | null; - readonly timedOut: boolean; - readonly aborted: boolean; + readonly exitCode: number | null; + readonly timedOut: boolean; + readonly aborted: boolean; } /** Parameters for spawning a shell command. Mirrors tool-shell's `SpawnShell` params. */ export interface SpawnParams { - readonly command: string; - readonly cwd: string; - readonly signal: AbortSignal; - readonly timeout: number; - readonly onOutput: (data: string, stream: "stdout" | "stderr") => void; + readonly command: string; + readonly cwd: string; + readonly signal: AbortSignal; + readonly timeout: number; + readonly onOutput: (data: string, stream: "stdout" | "stderr") => void; } /** Stat result — the subset read_file / write_file / edit_file need. */ export interface StatResult { - readonly isFile: boolean; - readonly isDirectory: boolean; + readonly isFile: boolean; + readonly isDirectory: boolean; } /** A directory entry — the subset read_file lists. */ export interface DirEntry { - readonly name: string; - readonly isDirectory: boolean; + readonly name: string; + readonly isDirectory: boolean; } /** @@ -56,23 +56,23 @@ export interface DirEntry { * `ToolExecuteContext.computerId` via the injected resolver. */ export interface ExecBackend { - /** Run a shell command, streaming stdout/stderr. The shell-tool seam. */ - readonly spawn: (params: SpawnParams) => Promise<ExecResult>; + /** Run a shell command, streaming stdout/stderr. The shell-tool seam. */ + readonly spawn: (params: SpawnParams) => Promise<ExecResult>; - // --- filesystem (the read_file / write_file / edit_file surface) --- + // --- filesystem (the read_file / write_file / edit_file surface) --- - /** Read a file as utf8 text. Throws node:fs-style errors with `.code`. */ - readonly readFile: (path: string) => Promise<string>; + /** Read a file as utf8 text. Throws node:fs-style errors with `.code`. */ + readonly readFile: (path: string) => Promise<string>; - /** Write utf8 text to a file. Throws on failure (e.g. missing parent dir). */ - readonly writeFile: (path: string, content: string) => Promise<void>; + /** Write utf8 text to a file. Throws on failure (e.g. missing parent dir). */ + readonly writeFile: (path: string, content: string) => Promise<void>; - /** Stat a path. Throws node:fs-style errors with `.code` (e.g. `"ENOENT"`). */ - readonly stat: (path: string) => Promise<StatResult>; + /** Stat a path. Throws node:fs-style errors with `.code` (e.g. `"ENOENT"`). */ + readonly stat: (path: string) => Promise<StatResult>; - /** List directory entries. Throws node:fs-style errors with `.code`. */ - readonly readdir: (path: string) => Promise<readonly DirEntry[]>; + /** List directory entries. Throws node:fs-style errors with `.code`. */ + readonly readdir: (path: string) => Promise<readonly DirEntry[]>; - /** Check existence without throwing (returns `false` when the path is missing). */ - readonly exists: (path: string) => Promise<boolean>; + /** Check existence without throwing (returns `false` when the path is missing). */ + readonly exists: (path: string) => Promise<boolean>; } |
