dsh-plugin-wsl-env 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/CHANGELOG.md +152 -0
- package/CONTRIBUTING.md +37 -5
- package/README.md +59 -4
- package/SUPPORT.md +3 -3
- package/agent/native/linux-aarch64/dsh-wsl-agent +0 -0
- package/agent/native/linux-x86_64/dsh-wsl-agent +0 -0
- package/agent/wsl-agent.sh +331 -11
- package/docs/AGENT-PROTOCOL-V7.md +175 -0
- package/docs/API.md +24 -0
- package/docs/ARCHITECTURE.md +14 -1
- package/docs/CONFIGURATION.md +12 -5
- package/docs/CONFIGURATION.zh.md +5 -3
- package/docs/LIMITATIONS.md +16 -4
- package/docs/LIMITATIONS.zh.md +20 -11
- package/docs/MIGRATION.md +4 -4
- package/docs/PEER-PARITY.md +50 -33
- package/docs/QUICKSTART.md +18 -1
- package/docs/QUICKSTART.zh.md +16 -1
- package/docs/README.zh.md +43 -4
- package/docs/RELEASING.md +1 -1
- package/docs/REQUIREMENTS.zh.md +3 -2
- package/docs/ROADMAP-1.0.md +27 -16
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +3 -1
- package/docs/UPSTREAM-SESSION-NOTICE.md +3 -1
- package/docs/UPSTREAM-TERMINAL-TITLE.md +3 -0
- package/docs/root-fs-routing.md +3 -3
- package/lib/agent-confined.js +4 -4
- package/lib/agent-errors.d.ts +1 -1
- package/lib/agent-errors.js +1 -1
- package/lib/agent-exec.d.ts +1 -1
- package/lib/agent-exec.js +1 -1
- package/lib/agent-protocol.d.ts +58 -8
- package/lib/agent-protocol.js +40 -7
- package/lib/agent-shared.d.ts +1 -1
- package/lib/agent-shared.js +1 -1
- package/lib/agent.d.ts +171 -1
- package/lib/agent.js +448 -288
- package/lib/auto-preset.d.ts +1 -1
- package/lib/auto-preset.js +1 -1
- package/lib/bwrap.d.ts +1 -1
- package/lib/bwrap.js +1 -1
- package/lib/distro-route.d.ts +1 -1
- package/lib/distro-route.js +1 -1
- package/lib/doctor-live.d.ts +53 -0
- package/lib/doctor-live.js +37 -0
- package/lib/file-reference-wsl.d.ts +1 -1
- package/lib/file-reference-wsl.js +1 -1
- package/lib/fs-decisions.d.ts +1 -1
- package/lib/fs-decisions.js +1 -1
- package/lib/fs-routing.d.ts +1 -1
- package/lib/fs-routing.js +1 -1
- package/lib/fs-substrate.d.ts +90 -11
- package/lib/fs-substrate.js +202 -1
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +1 -1
- package/lib/fsio-agent.d.ts +128 -4
- package/lib/fsio-agent.js +224 -15
- package/lib/fsio-text.d.ts +1 -1
- package/lib/fsio-text.js +1 -1
- package/lib/git-exec.d.ts +1 -1
- package/lib/git-exec.js +1 -1
- package/lib/git-route.d.ts +1 -1
- package/lib/git-route.js +1 -1
- package/lib/index.d.ts +105 -30
- package/lib/index.js +266 -122
- package/lib/listing.d.ts +1 -1
- package/lib/listing.js +1 -1
- package/lib/native-agent.d.ts +1 -1
- package/lib/native-agent.js +2 -2
- package/lib/paths.d.ts +6 -3
- package/lib/paths.js +4 -4
- package/lib/picker.d.ts +1 -1
- package/lib/picker.js +7 -7
- package/lib/ports.d.ts +1 -1
- package/lib/ports.js +1 -1
- package/lib/preflight.d.ts +1 -1
- package/lib/preflight.js +1 -1
- package/lib/sandbox-core.d.ts +1 -1
- package/lib/sandbox-core.js +2 -2
- package/lib/sandbox.d.ts +1 -1
- package/lib/sandbox.js +1 -1
- package/lib/search-exec.d.ts +1 -1
- package/lib/search-exec.js +1 -1
- package/lib/search-route.d.ts +1 -1
- package/lib/search-route.js +1 -1
- package/lib/session-runtime.d.ts +1 -1
- package/lib/session-runtime.js +2 -2
- package/lib/session-scope.d.ts +1 -1
- package/lib/session-scope.js +1 -1
- package/lib/shell-env.d.ts +1 -1
- package/lib/shell-env.js +1 -1
- package/lib/shell.d.ts +1 -1
- package/lib/shell.js +1 -1
- package/lib/subprocess.d.ts +1 -1
- package/lib/subprocess.js +2 -2
- package/lib/terminal-activity.d.ts +1 -1
- package/lib/terminal-activity.js +1 -1
- package/lib/terminal-route.d.ts +1 -1
- package/lib/terminal-route.js +1 -1
- package/lib/watcher.d.ts +1 -1
- package/lib/watcher.js +1 -1
- package/lib/wsl.d.ts +1 -31
- package/lib/wsl.js +1 -21
- package/package.json +15 -4
- package/scripts/doctor.mjs +34 -11
package/lib/picker.js
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
* `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
46
46
|
* fails when it drifts.
|
|
47
47
|
*
|
|
48
|
-
* @module dsh-plugin-wsl/picker
|
|
48
|
+
* @module dsh-plugin-wsl-env/picker
|
|
49
49
|
*/
|
|
50
50
|
import { mkdir, opendir, stat } from "node:fs/promises";
|
|
51
51
|
import { homedir } from "node:os";
|
|
@@ -327,7 +327,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
327
327
|
});
|
|
328
328
|
if (result.exitCode !== 0) {
|
|
329
329
|
const detail = result.stderr.toString("utf8").trim();
|
|
330
|
-
throw new DirectoryPickerError("directory-unreadable", target, `cannot list ${target}: ${detail.length > 0 ? detail : `ls exited ${result.exitCode}`}`);
|
|
330
|
+
throw new DirectoryPickerError("directory-unreadable", target, `cannot list "${target}": ${detail.length > 0 ? detail : `ls exited ${result.exitCode}`}`);
|
|
331
331
|
}
|
|
332
332
|
stdout = result.stdout;
|
|
333
333
|
}
|
|
@@ -338,7 +338,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
338
338
|
stdout = await runCapture([this.config.wslPath, "-d", parsed.distro, "--cd", linuxDir, "--exec", ...dirListingArgv(linuxDir)], signal);
|
|
339
339
|
}
|
|
340
340
|
catch (fallbackError) {
|
|
341
|
-
throw new DirectoryPickerError("directory-unreadable", target, `cannot list ${target}: ${messageOf(fallbackError)}`);
|
|
341
|
+
throw new DirectoryPickerError("directory-unreadable", target, `cannot list "${target}": ${messageOf(fallbackError)}`);
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
return parseDirListing(stdout, linuxDir, target, this.config.maxEntries);
|
|
@@ -377,7 +377,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
377
377
|
}
|
|
378
378
|
catch (error) {
|
|
379
379
|
signal?.throwIfAborted();
|
|
380
|
-
throw new DirectoryPickerError("directory-unreadable", target, `cannot list ${target}: ${messageOf(error)}`);
|
|
380
|
+
throw new DirectoryPickerError("directory-unreadable", target, `cannot list "${target}": ${messageOf(error)}`);
|
|
381
381
|
}
|
|
382
382
|
finally {
|
|
383
383
|
if (level !== undefined)
|
|
@@ -425,7 +425,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
425
425
|
if (typeof error === "object" && error !== null && "code" in error && error.code === "EEXIST") {
|
|
426
426
|
throw new DirectoryPickerError("directory-exists", target, `${target} already exists`);
|
|
427
427
|
}
|
|
428
|
-
throw new DirectoryPickerError("directory-create-failed", target, `cannot create ${target}: ${messageOf(error)}`);
|
|
428
|
+
throw new DirectoryPickerError("directory-create-failed", target, `cannot create "${target}": ${messageOf(error)}`);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
/**
|
|
@@ -450,7 +450,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
450
450
|
const detail = result.stderr.toString("utf8");
|
|
451
451
|
if (/File exists/i.test(detail))
|
|
452
452
|
throw new DirectoryPickerError("directory-exists", target, `${target} already exists`);
|
|
453
|
-
throw new DirectoryPickerError("directory-create-failed", target, `cannot create ${target}: ${detail.trim().length > 0 ? detail.trim() : `mkdir exited ${result.exitCode}`}`);
|
|
453
|
+
throw new DirectoryPickerError("directory-create-failed", target, `cannot create "${target}": ${detail.trim().length > 0 ? detail.trim() : `mkdir exited ${result.exitCode}`}`);
|
|
454
454
|
}
|
|
455
455
|
catch (error) {
|
|
456
456
|
if (error instanceof DirectoryPickerError)
|
|
@@ -465,7 +465,7 @@ export class WslDirectoryPicker extends DirectoryPicker {
|
|
|
465
465
|
const message = messageOf(fallbackError);
|
|
466
466
|
if (/File exists/i.test(message))
|
|
467
467
|
throw new DirectoryPickerError("directory-exists", target, `${target} already exists`);
|
|
468
|
-
throw new DirectoryPickerError("directory-create-failed", target, `cannot create ${target}: ${message}`);
|
|
468
|
+
throw new DirectoryPickerError("directory-create-failed", target, `cannot create "${target}": ${message}`);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
471
|
}
|
package/lib/ports.d.ts
CHANGED
package/lib/ports.js
CHANGED
package/lib/preflight.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
22
22
|
* `pnpm test` fails when it drifts.
|
|
23
23
|
*
|
|
24
|
-
* @module dsh-plugin-wsl/preflight
|
|
24
|
+
* @module dsh-plugin-wsl-env/preflight
|
|
25
25
|
*/
|
|
26
26
|
import z from "@deepseek-ai/schemastery";
|
|
27
27
|
import type { Context } from "@deepseek-ai/cordis";
|
package/lib/preflight.js
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
22
22
|
* `pnpm test` fails when it drifts.
|
|
23
23
|
*
|
|
24
|
-
* @module dsh-plugin-wsl/preflight
|
|
24
|
+
* @module dsh-plugin-wsl-env/preflight
|
|
25
25
|
*/
|
|
26
26
|
import z from "@deepseek-ai/schemastery";
|
|
27
27
|
import { isWslUnc } from "./paths.js";
|
package/lib/sandbox-core.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
15
15
|
* `pnpm test` fails when it drifts.
|
|
16
16
|
*
|
|
17
|
-
* @module dsh-plugin-wsl/sandbox-core
|
|
17
|
+
* @module dsh-plugin-wsl-env/sandbox-core
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
20
|
* The canonical remedy for a distro whose `bwrap` is missing — also the
|
package/lib/sandbox-core.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
15
15
|
* `pnpm test` fails when it drifts.
|
|
16
16
|
*
|
|
17
|
-
* @module dsh-plugin-wsl/sandbox-core
|
|
17
|
+
* @module dsh-plugin-wsl-env/sandbox-core
|
|
18
18
|
*/
|
|
19
19
|
import { createProbeCache } from "./probe-cache.js";
|
|
20
20
|
import { toLinuxPath } from "./paths.js";
|
|
@@ -295,7 +295,7 @@ export function createSandboxCore({ SandboxUnavailableError }) {
|
|
|
295
295
|
if (!(await this.usable(distro, signal))) {
|
|
296
296
|
throw new SandboxUnavailableError(policy.mode, bwrapFailure(this.wslPath, distro) ?? missingBwrapRemedy(distro));
|
|
297
297
|
}
|
|
298
|
-
const workspaceRoot = toLinuxPath(policy.workspaceRoot
|
|
298
|
+
const workspaceRoot = toLinuxPath(policy.workspaceRoot);
|
|
299
299
|
const prefix = bwrapArgvPrefix({ ...policy, workspaceRoot }, { maskWindowsDrive: this.maskWindowsDrive });
|
|
300
300
|
return {
|
|
301
301
|
argv: [...prefix, ...argv],
|
package/lib/sandbox.d.ts
CHANGED
package/lib/sandbox.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
35
35
|
* fails when it drifts.
|
|
36
36
|
*
|
|
37
|
-
* @module dsh-plugin-wsl/sandbox
|
|
37
|
+
* @module dsh-plugin-wsl-env/sandbox
|
|
38
38
|
*/
|
|
39
39
|
import { SandboxUnavailableError } from "@deepseek-ai/dsh-sandbox";
|
|
40
40
|
import { createSandboxCore } from "./sandbox-core.js";
|
package/lib/search-exec.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
28
28
|
* fails when it drifts.
|
|
29
29
|
*
|
|
30
|
-
* @module dsh-plugin-wsl/search-exec
|
|
30
|
+
* @module dsh-plugin-wsl-env/search-exec
|
|
31
31
|
*/
|
|
32
32
|
import type { AgentExecRunner } from "./agent-exec.js";
|
|
33
33
|
/**
|
package/lib/search-exec.js
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
28
28
|
* fails when it drifts.
|
|
29
29
|
*
|
|
30
|
-
* @module dsh-plugin-wsl/search-exec
|
|
30
|
+
* @module dsh-plugin-wsl-env/search-exec
|
|
31
31
|
*/
|
|
32
32
|
import { AgentUnavailableError } from "./agent-errors.js";
|
|
33
33
|
/**
|
package/lib/search-route.d.ts
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
38
38
|
* `pnpm test` fails when it drifts.
|
|
39
39
|
*
|
|
40
|
-
* @module dsh-plugin-wsl/search-route
|
|
40
|
+
* @module dsh-plugin-wsl-env/search-route
|
|
41
41
|
*/
|
|
42
42
|
/**
|
|
43
43
|
* Whether a spawn's program is the ripgrep binary.
|
package/lib/search-route.js
CHANGED
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
38
38
|
* `pnpm test` fails when it drifts.
|
|
39
39
|
*
|
|
40
|
-
* @module dsh-plugin-wsl/search-route
|
|
40
|
+
* @module dsh-plugin-wsl-env/search-route
|
|
41
41
|
*/
|
|
42
42
|
import { uncToPosix } from "./paths.js";
|
|
43
43
|
/** The one program this rewrite passes through to the distro. */
|
package/lib/session-runtime.d.ts
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
23
23
|
* `pnpm test` fails when it drifts.
|
|
24
24
|
*
|
|
25
|
-
* @module dsh-plugin-wsl/session-runtime
|
|
25
|
+
* @module dsh-plugin-wsl-env/session-runtime
|
|
26
26
|
*/
|
|
27
27
|
import { WslAgent } from "./agent.js";
|
|
28
28
|
/**
|
package/lib/session-runtime.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
23
23
|
* `pnpm test` fails when it drifts.
|
|
24
24
|
*
|
|
25
|
-
* @module dsh-plugin-wsl/session-runtime
|
|
25
|
+
* @module dsh-plugin-wsl-env/session-runtime
|
|
26
26
|
*/
|
|
27
27
|
import { spawn } from "node:child_process";
|
|
28
28
|
import { randomUUID } from "node:crypto";
|
|
@@ -165,7 +165,7 @@ export class SessionRuntimes {
|
|
|
165
165
|
const unit = sessionScopeUnit(request.distro, this.token());
|
|
166
166
|
const prefix = sessionScopePrefix(unit);
|
|
167
167
|
if (request.mode !== "danger-full-access") {
|
|
168
|
-
prefix.push(...bwrapArgvPrefix({ mode: request.mode, workspaceRoot: toLinuxPath(request.workspaceRoot
|
|
168
|
+
prefix.push(...bwrapArgvPrefix({ mode: request.mode, workspaceRoot: toLinuxPath(request.workspaceRoot) }, { maskWindowsDrive: request.maskWindowsDrive, realTmp: true, pidNamespace: false }));
|
|
169
169
|
}
|
|
170
170
|
const agent = this.spawnAgent({
|
|
171
171
|
distro: request.distro,
|
package/lib/session-scope.d.ts
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
18
18
|
* `pnpm test` fails when it drifts.
|
|
19
19
|
*
|
|
20
|
-
* @module dsh-plugin-wsl/session-scope
|
|
20
|
+
* @module dsh-plugin-wsl-env/session-scope
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
23
|
* Build the systemd user unit name for one session runtime.
|
package/lib/session-scope.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
18
18
|
* `pnpm test` fails when it drifts.
|
|
19
19
|
*
|
|
20
|
-
* @module dsh-plugin-wsl/session-scope
|
|
20
|
+
* @module dsh-plugin-wsl-env/session-scope
|
|
21
21
|
*/
|
|
22
22
|
/** The longest piece of a unit name this builder emits, per component. */
|
|
23
23
|
const MAX_COMPONENT = 64;
|
package/lib/shell-env.d.ts
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
25
25
|
* fails when it drifts.
|
|
26
26
|
*
|
|
27
|
-
* @module dsh-plugin-wsl/shell-env
|
|
27
|
+
* @module dsh-plugin-wsl-env/shell-env
|
|
28
28
|
*/
|
|
29
29
|
import z from "@deepseek-ai/schemastery";
|
|
30
30
|
import type { Context } from "@deepseek-ai/cordis";
|
package/lib/shell-env.js
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
25
25
|
* fails when it drifts.
|
|
26
26
|
*
|
|
27
|
-
* @module dsh-plugin-wsl/shell-env
|
|
27
|
+
* @module dsh-plugin-wsl-env/shell-env
|
|
28
28
|
*/
|
|
29
29
|
import z from "@deepseek-ai/schemastery";
|
|
30
30
|
import { uncToPosix } from "./paths.js";
|
package/lib/shell.d.ts
CHANGED
package/lib/shell.js
CHANGED
package/lib/subprocess.d.ts
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
81
81
|
* fails when it drifts.
|
|
82
82
|
*
|
|
83
|
-
* @module dsh-plugin-wsl/subprocess
|
|
83
|
+
* @module dsh-plugin-wsl-env/subprocess
|
|
84
84
|
*/
|
|
85
85
|
import z from "@deepseek-ai/schemastery";
|
|
86
86
|
import { LocalSubprocessRuntime } from "@deepseek-ai/dsh-subprocess-local";
|
package/lib/subprocess.js
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
81
81
|
* fails when it drifts.
|
|
82
82
|
*
|
|
83
|
-
* @module dsh-plugin-wsl/subprocess
|
|
83
|
+
* @module dsh-plugin-wsl-env/subprocess
|
|
84
84
|
*/
|
|
85
85
|
import { randomUUID } from "node:crypto";
|
|
86
86
|
import { Buffer } from "node:buffer";
|
|
@@ -224,7 +224,7 @@ export class WslSubprocessRuntime extends LocalSubprocessRuntime {
|
|
|
224
224
|
const mounted = windowsToLinuxMount(text);
|
|
225
225
|
if (mounted !== undefined)
|
|
226
226
|
return { distro, linuxCwd: mounted };
|
|
227
|
-
return { distro, linuxCwd: toLinuxPath(this.config.cwd
|
|
227
|
+
return { distro, linuxCwd: toLinuxPath(this.config.cwd) };
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
230
|
* Open one interactive shell inside the distro over the host's PTY.
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
34
34
|
* `pnpm test` fails when it drifts.
|
|
35
35
|
*
|
|
36
|
-
* @module dsh-plugin-wsl/terminal-activity
|
|
36
|
+
* @module dsh-plugin-wsl-env/terminal-activity
|
|
37
37
|
*/
|
|
38
38
|
import type { SubprocessTerminalHandle } from "@deepseek-ai/dsh-subprocess";
|
|
39
39
|
/** The env name that marks one terminal's process tree inside the distro. */
|
package/lib/terminal-activity.js
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* file and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
34
34
|
* `pnpm test` fails when it drifts.
|
|
35
35
|
*
|
|
36
|
-
* @module dsh-plugin-wsl/terminal-activity
|
|
36
|
+
* @module dsh-plugin-wsl-env/terminal-activity
|
|
37
37
|
*/
|
|
38
38
|
/** The env name that marks one terminal's process tree inside the distro. */
|
|
39
39
|
export const TERMINAL_ID_ENV = "DSH_TERMINAL_ID";
|
package/lib/terminal-route.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
16
16
|
* `pnpm test` fails when it drifts.
|
|
17
17
|
*
|
|
18
|
-
* @module dsh-plugin-wsl/terminal-route
|
|
18
|
+
* @module dsh-plugin-wsl-env/terminal-route
|
|
19
19
|
*/
|
|
20
20
|
/**
|
|
21
21
|
* The route decision for one terminal launch.
|
package/lib/terminal-route.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* and run `pnpm run build` — the artifact under `lib/` is generated, and
|
|
16
16
|
* `pnpm test` fails when it drifts.
|
|
17
17
|
*
|
|
18
|
-
* @module dsh-plugin-wsl/terminal-route
|
|
18
|
+
* @module dsh-plugin-wsl-env/terminal-route
|
|
19
19
|
*/
|
|
20
20
|
import { isPosixAbsolute, uncToPosix, windowsToLinuxMount } from "./paths.js";
|
|
21
21
|
/**
|
package/lib/watcher.d.ts
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
45
45
|
* fails when it drifts.
|
|
46
46
|
*
|
|
47
|
-
* @module dsh-plugin-wsl/watcher
|
|
47
|
+
* @module dsh-plugin-wsl-env/watcher
|
|
48
48
|
*/
|
|
49
49
|
import type { ChildProcess } from "node:child_process";
|
|
50
50
|
/**
|
package/lib/watcher.js
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
* run `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
45
45
|
* fails when it drifts.
|
|
46
46
|
*
|
|
47
|
-
* @module dsh-plugin-wsl/watcher
|
|
47
|
+
* @module dsh-plugin-wsl-env/watcher
|
|
48
48
|
*/
|
|
49
49
|
import { spawn } from "node:child_process";
|
|
50
50
|
import { createInterface } from "node:readline";
|
package/lib/wsl.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
11
11
|
* fails when it drifts.
|
|
12
12
|
*
|
|
13
|
-
* @module dsh-plugin-wsl/wsl
|
|
13
|
+
* @module dsh-plugin-wsl-env/wsl
|
|
14
14
|
*/
|
|
15
15
|
/**
|
|
16
16
|
* What every `wsl.exe` call may tune: the executable path and cancellation.
|
|
@@ -234,33 +234,3 @@ export interface WslShellProbeOptions {
|
|
|
234
234
|
* both probes failed.
|
|
235
235
|
*/
|
|
236
236
|
export declare function defaultShell(distro: string, options?: WslShellProbeOptions): Promise<string | undefined>;
|
|
237
|
-
/**
|
|
238
|
-
* What {@link runInDistro} reads: the `wsl.exe` path, an explicit shell, and
|
|
239
|
-
* optional cancellation and login mode.
|
|
240
|
-
*/
|
|
241
|
-
export interface WslRunOptions {
|
|
242
|
-
/** Executable name or absolute path. */
|
|
243
|
-
wslPath?: string;
|
|
244
|
-
/**
|
|
245
|
-
* An absolute path to the shell; resolved from the distro when omitted.
|
|
246
|
-
*/
|
|
247
|
-
shell?: string;
|
|
248
|
-
/** Optional cancellation. */
|
|
249
|
-
signal?: AbortSignal;
|
|
250
|
-
/**
|
|
251
|
-
* Whether login-shell semantics were requested; defaults to true.
|
|
252
|
-
*/
|
|
253
|
-
loginShell?: boolean;
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Run one command inside a distro and return raw stdout. Used by callers that
|
|
257
|
-
* want Linux semantics instead of the UNC share's.
|
|
258
|
-
*
|
|
259
|
-
* @param distro - distro name.
|
|
260
|
-
* @param command - a shell command string.
|
|
261
|
-
* @param options - the `wsl.exe` path, an explicit `shell`, and optional
|
|
262
|
-
* cancellation.
|
|
263
|
-
* @returns captured stdout.
|
|
264
|
-
* @throws when neither the caller nor the distro names a usable shell.
|
|
265
|
-
*/
|
|
266
|
-
export declare function runInDistro(distro: string, command: string, options?: WslRunOptions): Promise<string>;
|
package/lib/wsl.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* `pnpm run build` — the artifact under `lib/` is generated, and `pnpm test`
|
|
11
11
|
* fails when it drifts.
|
|
12
12
|
*
|
|
13
|
-
* @module dsh-plugin-wsl/wsl
|
|
13
|
+
* @module dsh-plugin-wsl-env/wsl
|
|
14
14
|
*/
|
|
15
15
|
import { execFile } from "node:child_process";
|
|
16
16
|
import { posixToUnc } from "./paths.js";
|
|
@@ -327,23 +327,3 @@ export async function defaultShell(distro, options = {}) {
|
|
|
327
327
|
(await ask('printf %s "$SHELL"')) ??
|
|
328
328
|
undefined);
|
|
329
329
|
}
|
|
330
|
-
/**
|
|
331
|
-
* Run one command inside a distro and return raw stdout. Used by callers that
|
|
332
|
-
* want Linux semantics instead of the UNC share's.
|
|
333
|
-
*
|
|
334
|
-
* @param distro - distro name.
|
|
335
|
-
* @param command - a shell command string.
|
|
336
|
-
* @param options - the `wsl.exe` path, an explicit `shell`, and optional
|
|
337
|
-
* cancellation.
|
|
338
|
-
* @returns captured stdout.
|
|
339
|
-
* @throws when neither the caller nor the distro names a usable shell.
|
|
340
|
-
*/
|
|
341
|
-
export async function runInDistro(distro, command, options = {}) {
|
|
342
|
-
const shell = options.shell ?? (await defaultShell(distro, options));
|
|
343
|
-
if (shell === undefined) {
|
|
344
|
-
throw new Error(`dsh-plugin-wsl: distro "${distro}" named no usable shell (passwd probe and $SHELL both failed). ` +
|
|
345
|
-
`Check the user's login shell in /etc/passwd (\`getent passwd "$(id -u)"\` inside the distro), ` +
|
|
346
|
-
`or point this row's \`shell\` at an existing absolute path.`);
|
|
347
|
-
}
|
|
348
|
-
return runCapture([options.wslPath ?? DEFAULT_WSL_PATH, "-d", distro, "--exec", shell, ...shellArgs(shell, options.loginShell !== false), command], options.signal);
|
|
349
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wsl-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"description": "在 WSL 的 Linux 实例中打开项目工作区,在对应 Linux 空间中进行命令执行、运行 shell 脚本和文件访问,以获得全套 Linux Shell 工具链收益,并通过 bubblewrap 对命令进行沙箱隔离",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -36,6 +36,10 @@
|
|
|
36
36
|
"types": "./lib/fs.d.ts",
|
|
37
37
|
"default": "./lib/fs.js"
|
|
38
38
|
},
|
|
39
|
+
"./index": {
|
|
40
|
+
"types": "./lib/index.d.ts",
|
|
41
|
+
"default": "./lib/index.js"
|
|
42
|
+
},
|
|
39
43
|
"./fs-routing": {
|
|
40
44
|
"types": "./lib/fs-routing.d.ts",
|
|
41
45
|
"default": "./lib/fs-routing.js"
|
|
@@ -103,9 +107,9 @@
|
|
|
103
107
|
"docs/LIMITATIONS.zh.md",
|
|
104
108
|
"docs/CONFIGURATION.zh.md",
|
|
105
109
|
"docs/QUICKSTART.zh.md",
|
|
110
|
+
"docs/REQUIREMENTS.zh.md",
|
|
106
111
|
"docs/LIMITATIONS.md",
|
|
107
112
|
"docs/RELEASING.md",
|
|
108
|
-
"docs/REQUIREMENTS.zh.md",
|
|
109
113
|
"docs/root-fs-routing.md",
|
|
110
114
|
"docs/VALUE.zh.md",
|
|
111
115
|
"docs/UPSTREAM-OPEN-IN-APP.md",
|
|
@@ -118,7 +122,9 @@
|
|
|
118
122
|
"docs/MIGRATION.md",
|
|
119
123
|
"docs/UPSTREAM-SESSION-NOTICE.md",
|
|
120
124
|
"docs/UPSTREAM-SERVICE-SWAP.md",
|
|
125
|
+
"docs/AGENT-PROTOCOL-V7.md",
|
|
121
126
|
"docs/UPSTREAM-TERMINAL-TITLE.md",
|
|
127
|
+
"docs/API.md",
|
|
122
128
|
"docs/ARCHITECTURE.md",
|
|
123
129
|
"docs/ROADMAP.md",
|
|
124
130
|
"docs/ROADMAP-1.0.md",
|
|
@@ -137,14 +143,16 @@
|
|
|
137
143
|
"lint:types": "tsc --noEmit",
|
|
138
144
|
"build": "node scripts/build.mjs",
|
|
139
145
|
"lint:build": "node test/build-freshness.mjs",
|
|
140
|
-
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 --test-coverage-exclude='scripts/**' --test-coverage-exclude='test/**' test/agent-exec.test.mjs test/agent-fs-script.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/fs-substrate.test.mjs test/fs.boot.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/fsio-agent.test.mjs test/fsio-text.test.mjs test/git-route.test.mjs test/listing.test.mjs test/paths.test.mjs test/ports.test.mjs test/preset-choice.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/sandbox.test.mjs test/search-exec.test.mjs test/search-route.test.mjs test/shell.test.mjs test/shell-env.test.mjs test/terminal-activity.test.mjs test/terminal.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs",
|
|
146
|
+
"test:coverage": "node scripts/coverage-gate.mjs -- node --test --test-timeout=60000 --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=84 --test-coverage-functions=70 --test-coverage-exclude='scripts/**' --test-coverage-exclude='test/**' test/agent-exec.test.mjs test/agent-fs-script.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/fs-substrate.test.mjs test/fs.boot.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/fsio-agent.test.mjs test/fsio-text.test.mjs test/git-exec.test.mjs test/git-route.test.mjs test/listing.test.mjs test/paths.test.mjs test/ports.test.mjs test/preset-choice.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/sandbox.test.mjs test/search-exec.test.mjs test/search-route.test.mjs test/shell.test.mjs test/shell-env.test.mjs test/terminal-activity.test.mjs test/terminal.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs",
|
|
141
147
|
"test:syntax": "node test/syntax.mjs",
|
|
142
|
-
"test:unit": "node --test test/fs.boot.test.mjs test/fsio-text.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/shell-env.test.mjs test/terminal.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/preset-choice.test.mjs test/sandbox.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/agent-fs-script.test.mjs test/fsio-agent.test.mjs test/fs-substrate.test.mjs test/agent-exec.test.mjs test/ports.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/git-route.test.mjs test/search-route.test.mjs test/search-exec.test.mjs test/terminal-activity.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs",
|
|
148
|
+
"test:unit": "node scripts/test-watchdog.mjs -- node --test --test-timeout=60000 test/fs.boot.test.mjs test/fsio-text.test.mjs test/composition.test.mjs test/provider.test.mjs test/file-reference-wsl.test.mjs test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/shell-env.test.mjs test/terminal.test.mjs test/probe-cache.test.mjs test/preflight.test.mjs test/preset-choice.test.mjs test/sandbox.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/agent-fs-script.test.mjs test/fsio-agent.test.mjs test/fs-substrate.test.mjs test/agent-exec.test.mjs test/ports.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs test/git-exec.test.mjs test/git-route.test.mjs test/search-route.test.mjs test/search-exec.test.mjs test/terminal-activity.test.mjs test/session-scope.test.mjs test/session-runtime.test.mjs test/native-agent.test.mjs test/peers.test.mjs test/agent-shared.test.mjs test/distro-route.test.mjs test/fs-routing.test.mjs test/doctor.test.mjs test/profile-preset.test.mjs test/packaging.test.mjs test/peer-canary.test.mjs test/probe-runner.test.mjs",
|
|
143
149
|
"lint:style": "node test/style.mjs",
|
|
144
150
|
"lint:links": "node scripts/check-links.mjs",
|
|
145
151
|
"lint:requirements": "node scripts/check-requirements.mjs",
|
|
146
152
|
"prepublishOnly": "pnpm test",
|
|
147
153
|
"probe": "bash test/probe/run.sh",
|
|
154
|
+
"probe:clean": "rm -rf test/probe/.scratch && mkdir -p test/probe/.scratch",
|
|
155
|
+
"probe:all-closed": "bash test/probe/run-all-when-closed.sh",
|
|
148
156
|
"probe:missing-wsl": "bash test/probe/missing-wsl.sh",
|
|
149
157
|
"probe:mode": "bash test/probe/mode.sh",
|
|
150
158
|
"probe:picker": "bash test/probe/picker.sh",
|
|
@@ -160,6 +168,7 @@
|
|
|
160
168
|
"probe:exec": "bash test/probe/exec.sh",
|
|
161
169
|
"probe:fs-routing": "bash test/probe/fs-routing.sh",
|
|
162
170
|
"probe:gui-preview": "bash test/probe/gui-preview.sh",
|
|
171
|
+
"probe:gui-preview-batch": "bash test/probe/gui-preview-batch.sh",
|
|
163
172
|
"probe:file-reference": "bash test/probe/file-reference-9p.sh",
|
|
164
173
|
"bootstrap": "bash scripts/bootstrap.sh",
|
|
165
174
|
"diagnose": "bash scripts/diagnose.sh",
|
|
@@ -196,6 +205,7 @@
|
|
|
196
205
|
"@deepseek-ai/dsh-bash-local": "0.2.2-rc.1",
|
|
197
206
|
"@deepseek-ai/dsh-fs": "0.2.2-rc.1",
|
|
198
207
|
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.1",
|
|
208
|
+
"@deepseek-ai/dsh-fs-patch": "0.2.2-rc.1",
|
|
199
209
|
"@deepseek-ai/dsh-fs-sandbox": "0.2.2-rc.1",
|
|
200
210
|
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.1",
|
|
201
211
|
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.1",
|
|
@@ -213,6 +223,7 @@
|
|
|
213
223
|
"@deepseek-ai/dsh-bash-local": ">=0.2.2-rc.1",
|
|
214
224
|
"@deepseek-ai/dsh-fs": ">=0.2.2-rc.1",
|
|
215
225
|
"@deepseek-ai/dsh-fs-local": ">=0.2.2-rc.1",
|
|
226
|
+
"@deepseek-ai/dsh-fs-patch": ">=0.2.2-rc.1",
|
|
216
227
|
"@deepseek-ai/dsh-host-directory-picker": ">=0.2.2-rc.1",
|
|
217
228
|
"@deepseek-ai/dsh-sandbox": ">=0.2.2-rc.1",
|
|
218
229
|
"@deepseek-ai/dsh-subprocess": ">=0.2.2-rc.1",
|