dsh-plugin-wsl-env 0.5.0 → 0.7.2
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 +256 -0
- package/CONTRIBUTING.md +4 -0
- package/README.md +9 -6
- package/agent/wsl-agent.sh +41 -8
- package/cordis.patch.yml +48 -0
- package/docs/ARCHITECTURE.md +36 -22
- package/docs/CONFIGURATION.md +3 -2
- package/docs/LIMITATIONS.md +52 -54
- package/docs/PARITY.md +18 -0
- package/docs/README.zh.md +10 -7
- package/lib/fs-decisions.js +22 -25
- package/lib/fs-routing.js +176 -0
- package/lib/git-route.js +142 -0
- package/lib/index.js +92 -306
- package/lib/listing.js +47 -0
- package/lib/picker.js +121 -17
- package/lib/sandbox-core.js +157 -0
- package/lib/sandbox.js +11 -131
- package/lib/search-exec.js +114 -0
- package/lib/search-route.js +95 -0
- package/lib/subprocess.js +153 -16
- package/lib/terminal-activity.js +121 -0
- package/lib/watcher.js +63 -12
- package/lib/workspace-files-route.js +205 -0
- package/lib/workspace-files-wsl.js +341 -0
- package/lib/wsl.js +24 -41
- package/package.json +23 -3
- package/lib/fs-publish.js +0 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wsl-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "让 DeepSeek Harness 以 WSL 子系统作为会话的执行环境:shell、文件读写与命令执行均在子系统内完成,目录选择器与 GUI 终端同样定位到子系统路径,并通过子系统内的 bubblewrap 对命令进行沙箱隔离",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
"./fs": "./lib/fs.js",
|
|
19
19
|
"./subprocess": "./lib/subprocess.js",
|
|
20
20
|
"./picker": "./lib/picker.js",
|
|
21
|
+
"./workspace-files-wsl": "./lib/workspace-files-wsl.js",
|
|
22
|
+
"./fs-routing": "./lib/fs-routing.js",
|
|
21
23
|
"./auto-preset": "./lib/auto-preset.js",
|
|
22
24
|
"./shell-env": "./lib/shell-env.js",
|
|
23
25
|
"./wsl": "./lib/wsl.js",
|
|
@@ -63,9 +65,9 @@
|
|
|
63
65
|
],
|
|
64
66
|
"scripts": {
|
|
65
67
|
"test": "npm run lint:style && npm run test:syntax && npm run test:unit",
|
|
66
|
-
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=85 --test-coverage-functions=70 test/agent-exec.test.mjs test/agent-fs-script.test.mjs test/agent-protocol.test.mjs test/agent.test.mjs test/fs-
|
|
68
|
+
"test:coverage": "node --test --experimental-test-coverage --test-coverage-lines=85 --test-coverage-branches=85 --test-coverage-functions=70 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/workspace-files-wsl.test.mjs test/composition.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/sandbox.test.mjs test/search-exec.test.mjs test/search-route.test.mjs test/fs.boot.test.mjs test/shell.test.mjs test/terminal-activity.test.mjs test/terminal.test.mjs test/watcher.test.mjs test/wsl.test.mjs test/fs-decisions.test.mjs",
|
|
67
69
|
"test:syntax": "node test/syntax.mjs",
|
|
68
|
-
"test:unit": "node --test test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/terminal.test.mjs test/probe-cache.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/
|
|
70
|
+
"test:unit": "node --test test/fs.boot.test.mjs test/fsio-text.test.mjs test/workspace-files-wsl.test.mjs test/composition.test.mjs test/paths.test.mjs test/listing.test.mjs test/shell.test.mjs test/terminal.test.mjs test/probe-cache.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/fsio-text.test.mjs test/search-route.test.mjs test/search-exec.test.mjs test/terminal-activity.test.mjs",
|
|
69
71
|
"lint:style": "node test/style.mjs",
|
|
70
72
|
"prepublishOnly": "npm test",
|
|
71
73
|
"probe": "bash test/probe/run.sh",
|
|
@@ -78,6 +80,7 @@
|
|
|
78
80
|
"probe:sandbox-shell": "bash test/probe/sandbox-shell.sh",
|
|
79
81
|
"sync:windows": "bash test/probe/sync-to-windows.sh",
|
|
80
82
|
"probe:watch": "bash test/probe/watch.sh",
|
|
83
|
+
"probe:agent": "bash test/probe/agent.sh",
|
|
81
84
|
"probe:substrate": "bash test/probe/substrate.sh",
|
|
82
85
|
"probe:exec": "bash test/probe/exec.sh",
|
|
83
86
|
"bootstrap": "bash scripts/bootstrap.sh"
|
|
@@ -102,6 +105,23 @@
|
|
|
102
105
|
"bugs": {
|
|
103
106
|
"url": "https://github.com/Big-Dao/dsh-plugin-wsl-env/issues"
|
|
104
107
|
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@deepseek-ai/cordis": "4.0.4",
|
|
110
|
+
"@deepseek-ai/cordis-plugin-include": "*",
|
|
111
|
+
"@deepseek-ai/cordis-plugin-loader": "*",
|
|
112
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.0-rc.2",
|
|
113
|
+
"@deepseek-ai/dsh-bash-local": "0.2.0-rc.2",
|
|
114
|
+
"@deepseek-ai/dsh-fs": "0.2.0-rc.2",
|
|
115
|
+
"@deepseek-ai/dsh-fs-local": "0.2.0-rc.2",
|
|
116
|
+
"@deepseek-ai/dsh-fs-sandbox": "0.2.0-rc.2",
|
|
117
|
+
"@deepseek-ai/dsh-host-directory-picker": "0.2.0-rc.2",
|
|
118
|
+
"@deepseek-ai/dsh-sandbox": "0.2.0-rc.2",
|
|
119
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.0-rc.2",
|
|
120
|
+
"@deepseek-ai/dsh-subprocess": "0.2.0-rc.2",
|
|
121
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.0-rc.2",
|
|
122
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.0-rc.2",
|
|
123
|
+
"js-yaml": "4.1.0"
|
|
124
|
+
},
|
|
105
125
|
"peerDependencies": {
|
|
106
126
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
107
127
|
"@deepseek-ai/dsh-bash-local": "0.2.0-rc.2",
|
package/lib/fs-publish.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The in-distro publication step for `WslFileSystem.writeText`/`editText`.
|
|
3
|
-
*
|
|
4
|
-
* Today's publication is two round trips: `copyModeInDistro` (one `wsl.exe`
|
|
5
|
-
* chmod) plus the staged file's rename over the 9p share. Under the resident
|
|
6
|
-
* agent it collapses into ONE `exec`: a small POSIX shell step that copies the
|
|
7
|
-
* replaced file's mode onto the staged temp (`chmod --reference`, skipped for
|
|
8
|
-
* a creation, where there is nothing to copy from) and renames it into place
|
|
9
|
-
* atomically — the rename preserving the inode's mode bits, exactly as the
|
|
10
|
-
* old path arranged.
|
|
11
|
-
*
|
|
12
|
-
* Pure by construction: this module only builds the argv; execution and
|
|
13
|
-
* fallback belong to the caller.
|
|
14
|
-
*
|
|
15
|
-
* @module dsh-plugin-wsl/fs-publish
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* The publication script. `$1` is the target's Linux path (may not exist —
|
|
20
|
-
* a creation), `$2` the staged temp's Linux path (always exists).
|
|
21
|
-
* @returns {string} the `sh -c` body.
|
|
22
|
-
*/
|
|
23
|
-
export function publicationScript() {
|
|
24
|
-
return [
|
|
25
|
-
// Creation: there is no source mode; the staged file keeps its umask mode,
|
|
26
|
-
// which is exactly what the old two-step path produced for new files.
|
|
27
|
-
'if [ -e "$1" ]; then',
|
|
28
|
-
' chmod --reference="$1" "$2" || exit 3',
|
|
29
|
-
'fi',
|
|
30
|
-
'mv -f "$2" "$1" || exit 4',
|
|
31
|
-
].join("\n");
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The argv to execute inside the distro for one publication.
|
|
36
|
-
* @param {string} targetLinuxPath - the file being written.
|
|
37
|
-
* @param {string} stagedLinuxPath - the staged temp holding the new content.
|
|
38
|
-
* @returns {string[]} the argv, ready for the agent (or a one-shot `wsl.exe`).
|
|
39
|
-
*/
|
|
40
|
-
export function publicationArgv(targetLinuxPath, stagedLinuxPath) {
|
|
41
|
-
return ["sh", "-c", publicationScript(), "publish", targetLinuxPath, stagedLinuxPath];
|
|
42
|
-
}
|