dsh-plugin-wsl-env 0.23.1 → 0.25.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 +212 -0
- package/README.md +9 -5
- package/SECURITY.md +10 -0
- package/client.js +974 -165
- package/cordis.patch.yml +28 -3
- package/docs/API.md +2 -1
- package/docs/ARCHITECTURE.md +36 -13
- package/docs/COMPATIBILITY.md +5 -0
- package/docs/CONFIGURATION.md +80 -9
- package/docs/CONFIGURATION.zh.md +64 -8
- package/docs/DIAGNOSTICS.md +48 -20
- package/docs/DIAGNOSTICS.zh.md +36 -14
- package/docs/LIMITATIONS.md +36 -9
- package/docs/LIMITATIONS.zh.md +26 -7
- package/docs/MIGRATION.md +1 -1
- package/docs/PEER-PARITY.md +4 -4
- package/docs/QUICKSTART.md +42 -12
- package/docs/QUICKSTART.zh.md +29 -8
- package/docs/README.zh.md +9 -5
- package/docs/RELEASING.md +17 -13
- package/docs/REQUIREMENTS.zh.md +5 -4
- package/docs/UPSTREAM-FSIO-EXPORT.md +5 -4
- package/docs/UPSTREAM-PROMPT-ADAPTERS.md +85 -0
- package/docs/root-fs-routing.md +1 -1
- package/lib/agent-confined.d.ts +7 -1
- package/lib/agent-confined.js +3 -3
- package/lib/auto-preset.d.ts +27 -0
- package/lib/auto-preset.js +40 -3
- package/lib/bwrap.d.ts +14 -0
- package/lib/bwrap.js +11 -0
- package/lib/client-host.d.ts +2 -2
- package/lib/client-host.js +2 -2
- package/lib/cwd-prompt.d.ts +41 -3
- package/lib/cwd-prompt.js +125 -8
- package/lib/doctor-report.d.ts +50 -0
- package/lib/doctor-report.js +172 -0
- package/lib/fs-routing.d.ts +1 -1
- package/lib/fs-routing.js +1 -1
- package/lib/fs.d.ts +1 -1
- package/lib/fs.js +1 -1
- package/lib/index.d.ts +6 -1464
- package/lib/index.js +5 -2120
- package/lib/listing.d.ts +21 -9
- package/lib/listing.js +25 -21
- package/lib/messages.d.ts +1 -1
- package/lib/messages.js +3 -3
- package/lib/picker.d.ts +50 -16
- package/lib/picker.js +103 -23
- package/lib/preflight.d.ts +7 -4
- package/lib/preflight.js +27 -13
- package/lib/preset-choice.d.ts +22 -3
- package/lib/preset-choice.js +36 -3
- package/lib/provider-common.d.ts +58 -0
- package/lib/provider-common.js +123 -0
- package/lib/sandbox-core.d.ts +1 -0
- package/lib/sandbox-core.js +4 -2
- package/lib/session-runtime.d.ts +7 -1
- package/lib/session-runtime.js +9 -2
- package/lib/shell.d.ts +1 -1
- package/lib/shell.js +1 -1
- package/lib/status.d.ts +261 -0
- package/lib/status.js +425 -0
- package/lib/writable-roots.d.ts +109 -0
- package/lib/writable-roots.js +257 -0
- package/lib/wsl-doctor-tool.d.ts +8 -0
- package/lib/wsl-doctor-tool.js +18 -20
- package/lib/wsl-filesystem.d.ts +692 -0
- package/lib/wsl-filesystem.js +897 -0
- package/lib/wsl-shell.d.ts +742 -0
- package/lib/wsl-shell.js +965 -0
- package/lib/wsl.d.ts +13 -1
- package/lib/wsl.js +16 -1
- package/locale/doctor/en.json +3 -2
- package/locale/doctor/zh.json +3 -2
- package/package.json +12 -4
- package/scripts/doctor.mjs +436 -226
- package/scripts/profile-preset.mjs +17 -5
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* node scripts/profile-preset.mjs [--distro Debian] [--session-sandbox false|auto]
|
|
14
14
|
* [--sandbox false] [--mask-windows-drive true] [--agent-backend native]
|
|
15
|
+
* [--writable-roots '~/.npm,~/.cache']
|
|
15
16
|
* [--out <profile/cordis.patch.yml>] [--check <file>] [--force]
|
|
16
17
|
*
|
|
17
18
|
* With no `--out`/`--check`, the block (with the edits) goes to stdout.
|
|
@@ -110,7 +111,7 @@ function setKey(lines, id, key, value) {
|
|
|
110
111
|
/**
|
|
111
112
|
* Apply the supported edits to a preset block.
|
|
112
113
|
* @param {string} block - the block from {@link presetBlock}.
|
|
113
|
-
* @param {{ distro?: string, sessionSandbox?: boolean | "auto", sandbox?: boolean, maskWindowsDrive?: boolean, agentBackend?: string }} edits - the edits.
|
|
114
|
+
* @param {{ distro?: string, sessionSandbox?: boolean | "auto", sandbox?: boolean, maskWindowsDrive?: boolean, agentBackend?: string, writableRoots?: string[] }} edits - the edits.
|
|
114
115
|
* @returns {string} the edited block.
|
|
115
116
|
*/
|
|
116
117
|
export function applyEdits(block, edits) {
|
|
@@ -127,18 +128,25 @@ export function applyEdits(block, edits) {
|
|
|
127
128
|
setKey(lines, "wsl-fs", key, value);
|
|
128
129
|
}
|
|
129
130
|
if (edits.agentBackend !== undefined) setKey(lines, "wsl-shell", "agentBackend", edits.agentBackend);
|
|
131
|
+
if (edits.writableRoots !== undefined) {
|
|
132
|
+
// A flow sequence is valid YAML and keeps the helper's one-line-per-key
|
|
133
|
+
// edit shape; the rows themselves take a real list once the block is merged.
|
|
134
|
+
const value = JSON.stringify(edits.writableRoots);
|
|
135
|
+
setKey(lines, "wsl-shell", "writableRoots", value);
|
|
136
|
+
setKey(lines, "wsl-fs", "writableRoots", value);
|
|
137
|
+
}
|
|
130
138
|
return lines.join("\n");
|
|
131
139
|
}
|
|
132
140
|
|
|
133
141
|
/**
|
|
134
142
|
* Parse the helper's arguments.
|
|
135
143
|
* @param {string[]} argv - `process.argv.slice(2)`.
|
|
136
|
-
* @returns {{ edits: Record<string, string | boolean>, out?: string, check?: string, force: boolean }} the options.
|
|
144
|
+
* @returns {{ edits: Record<string, string | boolean | string[]>, out?: string, check?: string, force: boolean }} the options.
|
|
137
145
|
*/
|
|
138
146
|
function parseArgs(argv) {
|
|
139
|
-
/** @type {Record<string, string | boolean>} */
|
|
147
|
+
/** @type {Record<string, string | boolean | string[]>} */
|
|
140
148
|
const edits = {};
|
|
141
|
-
/** @type {{ edits: Record<string, string | boolean>, out?: string, check?: string, force: boolean }} */
|
|
149
|
+
/** @type {{ edits: Record<string, string | boolean | string[]>, out?: string, check?: string, force: boolean }} */
|
|
142
150
|
const options = { edits, force: false };
|
|
143
151
|
for (let i = 0; i < argv.length; i += 1) {
|
|
144
152
|
const arg = argv[i] ?? "";
|
|
@@ -153,13 +161,17 @@ function parseArgs(argv) {
|
|
|
153
161
|
else if (flag === "--agent-backend") {
|
|
154
162
|
if (!["auto", "native", "shell"].includes(value)) throw new Error(`profile-preset: --agent-backend must be auto, native or shell (got "${value}")`);
|
|
155
163
|
edits.agentBackend = value;
|
|
164
|
+
} else if (flag === "--writable-roots") {
|
|
165
|
+
const roots = value.split(",").map((root) => root.trim()).filter((root) => root.length > 0);
|
|
166
|
+
if (roots.length === 0) throw new Error("profile-preset: --writable-roots needs a comma-separated list of distro paths");
|
|
167
|
+
edits.writableRoots = roots;
|
|
156
168
|
} else if (flag === "--out") options.out = value;
|
|
157
169
|
else if (flag === "--check") options.check = value;
|
|
158
170
|
else if (flag === "--force") {
|
|
159
171
|
options.force = true;
|
|
160
172
|
i -= 1;
|
|
161
173
|
} else if (flag === "--help" || flag === "-h") {
|
|
162
|
-
console.log("node scripts/profile-preset.mjs [--distro NAME] [--session-sandbox true|false|auto] [--sandbox true|false] [--mask-windows-drive true|false] [--agent-backend auto|native|shell] [--out FILE] [--check FILE] [--force]");
|
|
174
|
+
console.log("node scripts/profile-preset.mjs [--distro NAME] [--session-sandbox true|false|auto] [--sandbox true|false] [--mask-windows-drive true|false] [--agent-backend auto|native|shell] [--writable-roots 'PATH,...'] [--out FILE] [--check FILE] [--force]");
|
|
163
175
|
process.exit(0);
|
|
164
176
|
} else throw new Error(`profile-preset: unknown option "${arg}"`);
|
|
165
177
|
}
|