@tomradex/shell 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Context } from "cordis";
2
2
  import { z } from "zod";
3
3
  import type { SettingsSection } from "@tomradex/settings";
4
- export { OutputBuffer, describeResult, findBash, plain, runShell, type ShellResult, type ShellRun } from "./run.js";
4
+ export { OutputBuffer, describeResult, findBash, orphanSweep, plain, runShell, type ShellResult, type ShellRun } from "./run.js";
5
5
  export type Approval = "ask" | "auto" | "off";
6
6
  export interface ShellSettings {
7
7
  approval: Approval;
package/dist/run.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  export declare const DEFAULT_TIMEOUT_S = 120;
2
- /** The bash this machine has; on Windows only Git Bash counts, since WSL's bash.exe sees another filesystem. */
3
- export declare function findBash(): string | null;
2
+ /**
3
+ * The bash this machine has: a usual install place, else PATH. On Windows only Git Bash counts — found
4
+ * beside a git on PATH (Scoop, another drive) or as bash.exe on PATH — never WSL's launcher, which sees another filesystem.
5
+ */
6
+ export declare function findBash(platform?: NodeJS.Platform, env?: NodeJS.ProcessEnv, exists?: (file: string) => boolean): string | null;
4
7
  /** Terminal output as text: escapes stripped, and a line redrawn with \r (progress bars) kept at its last state. */
5
8
  export declare function plain(text: string): string;
6
9
  /** The start and the end of a long output; the end is where errors land, so it gets the larger share. */
@@ -11,6 +14,12 @@ export declare class OutputBuffer {
11
14
  push(chunk: string): void;
12
15
  text(): string;
13
16
  }
17
+ /**
18
+ * PowerShell that stops what a dead process left behind on Windows: taskkill /T cannot walk from a root that
19
+ * already exited, but its children still name it as their parent. Only processes born after it started count,
20
+ * so a recycled pid's own children are spared; the root's pid itself is never touched, since it may be reused.
21
+ */
22
+ export declare function orphanSweep(rootPid: number, startedAtMs: number): string;
14
23
  export interface ShellResult {
15
24
  exitCode: number | null;
16
25
  output: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/shell",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -27,10 +27,10 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@tomradex/contracts": "0.18.0",
31
- "@tomradex/domain": "0.2.26",
32
- "@tomradex/settings": "0.18.0",
33
- "@tomradex/tools": "0.18.0",
30
+ "@tomradex/contracts": "0.19.0",
31
+ "@tomradex/domain": "0.2.28",
32
+ "@tomradex/settings": "0.19.0",
33
+ "@tomradex/tools": "0.19.0",
34
34
  "cordis": "4.0.0-rc.8",
35
35
  "zod": "^4.4.3"
36
36
  }