Merge branch 'feat/windows-pwsh-default' into feat/windows-acl-sandbox

# Conflicts:
#	packages/bash/pwsh-local/src/index.ts
#	packages/sandbox/sandbox-local/src/index.ts
This commit is contained in:
Huanqi Cao
2026-08-09 17:50:55 +08:00
1197 changed files with 3013 additions and 2907 deletions

View File

@@ -45,9 +45,10 @@ export interface Config {
* Override the runner argv; bwrap-shaped profile arguments are appended. A
* non-empty override asserts full enforcement and skips built-in selection and
* probing. A runner that starts but refuses its profile must be identifiable by
* {@link runnerFailureSignatures}. Consumers classify spawn rejection; only
* attributable `ENOENT` or `EACCES` with runner argv[0] provenance becomes an
* infrastructure failure.
* {@link runnerFailureSignatures}. Consumers classify a spawn rejection only after
* confirming the workdir is usable. `ENOENT` or `EACCES` identifies the runner when
* `error.path` equals argv[0] and `error.syscall` is `spawn` or `spawn <runner>`, or
* when `error.path` is absent and `error.syscall` is exactly `spawn <runner>`.
*/
runnerCommand?: string[]
/**
@@ -109,7 +110,7 @@ function defaultProbeWindowsAcl(runnerInvocation: string[], timeoutMs: number):
return probe.status === 0
}
/** Test seam: inject probe verdicts / a fake launcher / a platform without real runners. */
/** Test hook: inject probe verdicts / a fake launcher / a platform without real runners. */
export interface SandboxInternals {
/** Replaces `process.platform` for chain selection (exercise any platform's chain from any host). */
platform?: string
@@ -244,7 +245,7 @@ export class LocalSandboxProvider extends SandboxProvider {
probeTimeoutMs: z.natural().default(5_000),
})
/** Test seam (mirrors the bash executors' `internals`). */
/** Test hook (mirrors the bash executors' `internals`). */
internals: SandboxInternals = {}
private readonly runnerCommand: string[] | undefined
@@ -556,12 +557,12 @@ export class LocalSandboxProvider extends SandboxProvider {
}
}
/** The Landlock launcher to probe and exec (test seam over the resolved one). */
/** The Landlock launcher to probe and exec (test hook over the resolved one). */
private landlockLauncher(): string {
return this.internals.landlockLauncher ?? landlockLauncherPath()
}
/** The `sandbox-exec` executable to probe and exec (test seam over the system one). */
/** The `sandbox-exec` executable to probe and exec (test hook over the system one). */
private seatbeltExec(): string {
return this.internals.seatbeltExec ?? 'sandbox-exec'
}