dsh-plugin-wsl-env 0.24.0 → 0.26.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 +136 -0
- package/CODE_OF_CONDUCT.md +85 -0
- package/CODE_OF_CONDUCT.zh.md +85 -0
- package/CONTRIBUTING.md +19 -3
- package/CONTRIBUTING.zh.md +200 -0
- package/README.md +18 -6
- package/SECURITY.md +12 -0
- package/SECURITY.zh.md +108 -0
- package/SUPPORT.md +2 -0
- package/SUPPORT.zh.md +99 -0
- package/client.js +409 -8
- package/cordis.patch.yml +17 -0
- package/docs/AGENT-PROTOCOL-V7.md +2 -2
- package/docs/API.md +2 -0
- package/docs/API.zh.md +38 -0
- package/docs/ARCHITECTURE.md +30 -9
- package/docs/ARCHITECTURE.zh.md +511 -0
- package/docs/COMPATIBILITY.md +2 -0
- package/docs/COMPATIBILITY.zh.md +117 -0
- package/docs/CONFIGURATION.md +45 -2
- package/docs/CONFIGURATION.zh.md +39 -3
- package/docs/DIAGNOSTICS.md +12 -2
- package/docs/DIAGNOSTICS.zh.md +5 -1
- package/docs/LIMITATIONS.md +60 -9
- package/docs/LIMITATIONS.zh.md +45 -9
- package/docs/MIGRATION.md +6 -3
- package/docs/MIGRATION.zh.md +91 -0
- package/docs/PEER-PARITY.md +63 -51
- package/docs/PERFORMANCE.md +2 -0
- package/docs/PERFORMANCE.zh.md +59 -0
- package/docs/QUICKSTART.md +21 -6
- package/docs/QUICKSTART.zh.md +16 -4
- package/docs/README.zh.md +28 -19
- package/docs/RELEASING.md +19 -14
- package/docs/REQUIREMENTS.zh.md +6 -3
- package/docs/ROADMAP-1.0.md +1 -1
- package/docs/UPSTREAM-FILE-REFERENCE-SEAM.md +1 -1
- package/docs/UPSTREAM-FSIO-EXPORT.md +5 -4
- package/docs/UPSTREAM-OPEN-IN-APP.md +33 -11
- package/docs/UPSTREAM-PROMPT-ADAPTERS.md +85 -0
- package/docs/UPSTREAM-SESSION-NOTICE.md +7 -0
- package/docs/VALUE.md +146 -0
- package/docs/VALUE.zh.md +15 -13
- 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-seam.d.ts +45 -0
- package/lib/auto-preset-seam.js +47 -0
- package/lib/auto-preset.d.ts +33 -10
- package/lib/auto-preset.js +148 -44
- package/lib/bwrap.d.ts +14 -0
- package/lib/bwrap.js +11 -0
- package/lib/cwd-prompt.d.ts +41 -3
- package/lib/cwd-prompt.js +125 -8
- package/lib/doctor-live.d.ts +30 -0
- package/lib/doctor-live.js +37 -0
- 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/messages.d.ts +20 -1
- package/lib/messages.js +31 -3
- package/lib/open-in-app.d.ts +206 -0
- package/lib/open-in-app.js +300 -0
- package/lib/preflight.d.ts +7 -4
- package/lib/preflight.js +27 -13
- package/lib/preset-choice.d.ts +13 -0
- package/lib/preset-choice.js +18 -1
- 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.js +2 -1
- package/lib/writable-roots.d.ts +109 -0
- package/lib/writable-roots.js +257 -0
- package/lib/wsl-doctor-command.js +2 -1
- package/lib/wsl-doctor-tool.js +2 -2
- 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 +1 -1
- package/lib/wsl.js +1 -1
- package/package.json +48 -24
- package/scripts/doctor.mjs +1 -1
- package/scripts/profile-preset.mjs +17 -5
package/lib/wsl.d.ts
CHANGED
|
@@ -179,7 +179,7 @@ export interface WslTerminalOptions {
|
|
|
179
179
|
/**
|
|
180
180
|
* The `wsl.exe` argv that opens one interactive shell inside a distro.
|
|
181
181
|
*
|
|
182
|
-
* This is the terminal twin of the command form built in `lib/
|
|
182
|
+
* This is the terminal twin of the command form built in `lib/wsl-shell.js`, with
|
|
183
183
|
* three deliberate differences:
|
|
184
184
|
*
|
|
185
185
|
* - There is no command string. With no pinned shell the launch ends here and
|
package/lib/wsl.js
CHANGED
|
@@ -241,7 +241,7 @@ export function interactiveShellArgs(shellPath, login) {
|
|
|
241
241
|
/**
|
|
242
242
|
* The `wsl.exe` argv that opens one interactive shell inside a distro.
|
|
243
243
|
*
|
|
244
|
-
* This is the terminal twin of the command form built in `lib/
|
|
244
|
+
* This is the terminal twin of the command form built in `lib/wsl-shell.js`, with
|
|
245
245
|
* three deliberate differences:
|
|
246
246
|
*
|
|
247
247
|
* - There is no command string. With no pinned shell the launch ends here and
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-plugin-wsl-env",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "在 WSL 的 Linux 实例中打开项目工作区,在对应 Linux 空间中进行命令执行、运行 shell 脚本和文件访问,以获得全套 Linux Shell 工具链收益,并通过 bubblewrap 对命令进行沙箱隔离",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"deepseek-harness",
|
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
"types": "./lib/index.d.ts",
|
|
57
57
|
"default": "./lib/index.js"
|
|
58
58
|
},
|
|
59
|
+
"./open-in-app": {
|
|
60
|
+
"types": "./lib/open-in-app.d.ts",
|
|
61
|
+
"default": "./lib/open-in-app.js"
|
|
62
|
+
},
|
|
59
63
|
"./locale/en.json": "./locale/en.json",
|
|
60
64
|
"./locale/zh.json": "./locale/zh.json",
|
|
61
65
|
"./package.json": "./package.json",
|
|
@@ -124,7 +128,10 @@
|
|
|
124
128
|
"@deepseek-ai/dsh-client-ui-slots",
|
|
125
129
|
"@deepseek-ai/dsh-client-ui-layout",
|
|
126
130
|
"@deepseek-ai/dsh-client-ui-sidebar",
|
|
127
|
-
"@deepseek-ai/dsh-client-ui-workspace"
|
|
131
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
132
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
133
|
+
"@deepseek-ai/dsh-client-ui-context-menu",
|
|
134
|
+
"@deepseek-ai/dsh-client-ui-session"
|
|
128
135
|
]
|
|
129
136
|
}
|
|
130
137
|
},
|
|
@@ -154,6 +161,7 @@
|
|
|
154
161
|
"docs/root-fs-routing.md",
|
|
155
162
|
"docs/VALUE.zh.md",
|
|
156
163
|
"docs/UPSTREAM-OPEN-IN-APP.md",
|
|
164
|
+
"docs/UPSTREAM-PROMPT-ADAPTERS.md",
|
|
157
165
|
"docs/adr/0002-native-agent.md",
|
|
158
166
|
"docs/PARITY.md",
|
|
159
167
|
"docs/PEER-PARITY.md",
|
|
@@ -181,16 +189,28 @@
|
|
|
181
189
|
"scripts/diagnose.sh",
|
|
182
190
|
"scripts/doctor.mjs",
|
|
183
191
|
"scripts/open-wsl-vscode.ps1",
|
|
184
|
-
"scripts/profile-preset.mjs"
|
|
192
|
+
"scripts/profile-preset.mjs",
|
|
193
|
+
"docs/ARCHITECTURE.zh.md",
|
|
194
|
+
"docs/API.zh.md",
|
|
195
|
+
"docs/COMPATIBILITY.zh.md",
|
|
196
|
+
"docs/MIGRATION.zh.md",
|
|
197
|
+
"docs/PERFORMANCE.zh.md",
|
|
198
|
+
"docs/VALUE.md",
|
|
199
|
+
"CONTRIBUTING.zh.md",
|
|
200
|
+
"SECURITY.zh.md",
|
|
201
|
+
"SUPPORT.zh.md",
|
|
202
|
+
"CODE_OF_CONDUCT.md",
|
|
203
|
+
"CODE_OF_CONDUCT.zh.md"
|
|
185
204
|
],
|
|
186
205
|
"scripts": {
|
|
187
206
|
"test": "pnpm run lint:style && pnpm run lint:links && pnpm run lint:requirements && pnpm run lint:docs && pnpm run test:syntax && pnpm run lint:build && pnpm run lint:types && pnpm run test:unit",
|
|
188
207
|
"lint:types": "tsc --noEmit",
|
|
189
208
|
"build": "node scripts/build.mjs",
|
|
190
209
|
"lint:build": "node test/build-freshness.mjs",
|
|
191
|
-
"test:
|
|
210
|
+
"test:browser": "node --test --test-timeout=120000 test/browser/e2e.test.mjs",
|
|
211
|
+
"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/auto-preset.test.mjs test/probe-cache.test.mjs test/writable-roots.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/update-check.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 test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/status.test.mjs test/client-host.test.mjs test/messages.test.mjs test/client.test.mjs test/open-in-app.test.mjs",
|
|
192
212
|
"test:syntax": "node test/syntax.mjs",
|
|
193
|
-
"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/update-check.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 test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/status.test.mjs test/client-host.test.mjs test/messages.test.mjs",
|
|
213
|
+
"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/writable-roots.test.mjs test/preflight.test.mjs test/preset-choice.test.mjs test/auto-preset.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/update-check.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 test/cwd-prompt.test.mjs test/cwd-prompt-tool.test.mjs test/wsl-doctor-tool.test.mjs test/wsl-doctor-command.test.mjs test/status.test.mjs test/client-host.test.mjs test/messages.test.mjs test/client.test.mjs test/open-in-app.test.mjs",
|
|
194
214
|
"lint:style": "node test/style.mjs",
|
|
195
215
|
"lint:links": "node scripts/check-links.mjs",
|
|
196
216
|
"lint:requirements": "node scripts/check-requirements.mjs",
|
|
@@ -248,33 +268,37 @@
|
|
|
248
268
|
"@deepseek-ai/cordis": "4.1.0",
|
|
249
269
|
"@deepseek-ai/cordis-plugin-include": "1.1.0",
|
|
250
270
|
"@deepseek-ai/cordis-plugin-loader": "1.1.0",
|
|
251
|
-
"@deepseek-ai/dsh-bash-local": "0.2.2-rc.
|
|
252
|
-
"@deepseek-ai/dsh-fs": "0.2.2-rc.
|
|
253
|
-
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.
|
|
254
|
-
"@deepseek-ai/dsh-fs-patch": "0.2.2-rc.
|
|
255
|
-
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.
|
|
256
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.
|
|
257
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.
|
|
258
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.
|
|
259
|
-
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.
|
|
260
|
-
"@deepseek-ai/dsh-tools": "0.2.2-rc.
|
|
271
|
+
"@deepseek-ai/dsh-bash-local": "0.2.2-rc.2",
|
|
272
|
+
"@deepseek-ai/dsh-fs": "0.2.2-rc.2",
|
|
273
|
+
"@deepseek-ai/dsh-fs-local": "0.2.2-rc.2",
|
|
274
|
+
"@deepseek-ai/dsh-fs-patch": "0.2.2-rc.2",
|
|
275
|
+
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.2",
|
|
276
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
|
|
277
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.2-rc.2",
|
|
278
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-rc.2",
|
|
279
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.2-rc.2",
|
|
280
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
261
281
|
"@deepseek-ai/schemastery": "3.19.0",
|
|
262
282
|
"@types/js-yaml": "^4.0.9",
|
|
263
283
|
"@types/node": "~22.20.5",
|
|
284
|
+
"esbuild": "0.25.8",
|
|
264
285
|
"js-yaml": "4.3.2",
|
|
286
|
+
"playwright": "1.65.0",
|
|
287
|
+
"react": "19.1.1",
|
|
288
|
+
"react-dom": "19.1.1",
|
|
265
289
|
"typescript": "~6.0.3"
|
|
266
290
|
},
|
|
267
291
|
"peerDependencies": {
|
|
268
292
|
"@deepseek-ai/cordis": "^4.1.0",
|
|
269
|
-
"@deepseek-ai/dsh-bash-local": ">=0.2.2-rc.
|
|
270
|
-
"@deepseek-ai/dsh-fs": ">=0.2.2-rc.
|
|
271
|
-
"@deepseek-ai/dsh-fs-local": ">=0.2.2-rc.
|
|
272
|
-
"@deepseek-ai/dsh-fs-patch": ">=0.2.2-rc.
|
|
273
|
-
"@deepseek-ai/dsh-host-directory-picker": ">=0.2.2-rc.
|
|
274
|
-
"@deepseek-ai/dsh-sandbox": ">=0.2.2-rc.
|
|
275
|
-
"@deepseek-ai/dsh-subprocess": ">=0.2.2-rc.
|
|
276
|
-
"@deepseek-ai/dsh-tools": ">=0.2.2-rc.
|
|
277
|
-
"@deepseek-ai/dsh-subprocess-local": ">=0.2.2-rc.
|
|
293
|
+
"@deepseek-ai/dsh-bash-local": ">=0.2.2-rc.2",
|
|
294
|
+
"@deepseek-ai/dsh-fs": ">=0.2.2-rc.2",
|
|
295
|
+
"@deepseek-ai/dsh-fs-local": ">=0.2.2-rc.2",
|
|
296
|
+
"@deepseek-ai/dsh-fs-patch": ">=0.2.2-rc.2",
|
|
297
|
+
"@deepseek-ai/dsh-host-directory-picker": ">=0.2.2-rc.2",
|
|
298
|
+
"@deepseek-ai/dsh-sandbox": ">=0.2.2-rc.2",
|
|
299
|
+
"@deepseek-ai/dsh-subprocess": ">=0.2.2-rc.2",
|
|
300
|
+
"@deepseek-ai/dsh-tools": ">=0.2.2-rc.2",
|
|
301
|
+
"@deepseek-ai/dsh-subprocess-local": ">=0.2.2-rc.2",
|
|
278
302
|
"@deepseek-ai/schemastery": "^3.19.0"
|
|
279
303
|
},
|
|
280
304
|
"peerDependenciesMeta": {
|
package/scripts/doctor.mjs
CHANGED
|
@@ -84,7 +84,7 @@ import { parseListeningPorts, procNetScript } from "../lib/ports.js";
|
|
|
84
84
|
// `test/doctor.test.mjs` compares the copy against the lib export to pin it
|
|
85
85
|
// against drift.
|
|
86
86
|
//
|
|
87
|
-
// Inlined from `src/
|
|
87
|
+
// Inlined from `src/provider-common.ts` `effectiveMaskWindowsDrive`:
|
|
88
88
|
/**
|
|
89
89
|
* Whether confined profiles shadow `/mnt` under this config.
|
|
90
90
|
*
|
|
@@ -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
|
}
|