dsh-plugin-wsl-env 0.26.3 → 0.26.4
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 +81 -0
- package/CONTRIBUTING.md +25 -21
- package/SUPPORT.md +2 -2
- package/SUPPORT.zh.md +2 -2
- package/docs/AGENT-PROTOCOL-V7.md +4 -2
- package/docs/API.md +1 -0
- package/docs/API.zh.md +1 -0
- package/docs/CONFIGURATION.md +21 -5
- package/docs/CONFIGURATION.zh.md +17 -3
- package/docs/PARITY.md +3 -1
- package/docs/RELEASING.md +25 -3
- package/docs/REQUIREMENTS.zh.md +4 -4
- package/docs/ROADMAP-1.0.md +11 -7
- package/lib/agent.d.ts +54 -18
- package/lib/agent.js +86 -19
- package/lib/fs-routing.d.ts +3 -0
- package/lib/fs-routing.js +5 -0
- package/lib/fs-substrate.d.ts +1 -1
- package/lib/fs-substrate.js +10 -18
- package/lib/fsio-agent.d.ts +4 -0
- package/lib/fsio-agent.js +37 -10
- package/lib/listing.d.ts +2 -2
- package/lib/listing.js +5 -4
- package/lib/messages.d.ts +70 -0
- package/lib/messages.js +80 -0
- package/lib/open-in-app.js +12 -9
- package/lib/picker.d.ts +4 -1
- package/lib/picker.js +35 -11
- package/lib/ports.js +8 -1
- package/lib/provider-common.d.ts +22 -0
- package/lib/provider-common.js +18 -0
- package/lib/provider-marker.d.ts +23 -0
- package/lib/provider-marker.js +21 -0
- package/lib/status.js +8 -5
- package/lib/subprocess.d.ts +3 -0
- package/lib/subprocess.js +5 -0
- package/lib/takeover-report.js +4 -11
- package/lib/watcher.d.ts +1 -1
- package/lib/watcher.js +1 -1
- package/lib/wsl-doctor-command.d.ts +6 -2
- package/lib/wsl-doctor-command.js +24 -15
- package/lib/wsl-filesystem.d.ts +14 -11
- package/lib/wsl-filesystem.js +39 -27
- package/lib/wsl-shell.d.ts +42 -37
- package/lib/wsl-shell.js +53 -42
- package/package.json +1 -1
package/lib/wsl-filesystem.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import type { SessionRuntimeEntry } from "./session-runtime.js";
|
|
|
9
9
|
import type { Context } from "@deepseek-ai/cordis";
|
|
10
10
|
import type { FileSystem, FsDeleteOutcome, FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsMoveOutcome, FsPathInfo, FsTarget, FsVersion, FsWriteIntent, FsWriteOutcome } from "@deepseek-ai/dsh-fs";
|
|
11
11
|
import type { SandboxExecutionPolicy, SandboxMode } from "@deepseek-ai/dsh-sandbox";
|
|
12
|
+
import { ProviderRuntimeBook } from "./provider-common.js";
|
|
12
13
|
type PatchHunks = Parameters<FileSystem["patchText"]>[1];
|
|
13
14
|
type MoveFileOptions = Parameters<FileSystem["moveFile"]>[2];
|
|
14
15
|
/**
|
|
@@ -246,8 +247,8 @@ export declare class WslFileSystem extends LocalFileSystem {
|
|
|
246
247
|
resolvedDistro: string;
|
|
247
248
|
/** Cached distro-user home, the base for relative input when `cwd` is empty. */
|
|
248
249
|
resolvedHome: string | undefined;
|
|
249
|
-
/**
|
|
250
|
-
|
|
250
|
+
/** Shared per-provider bookkeeping (homes, session runtimes, preflight caches). */
|
|
251
|
+
runtimeBook: ProviderRuntimeBook;
|
|
251
252
|
/** The deployment default mode — the capability fact the tool layer reads. */
|
|
252
253
|
defaultMode: SandboxMode;
|
|
253
254
|
/** The lazy default-distro substrate, kept for the legacy accessor and tests. */
|
|
@@ -262,21 +263,23 @@ export declare class WslFileSystem extends LocalFileSystem {
|
|
|
262
263
|
agentInstances: Map<string, WslAgent>;
|
|
263
264
|
/** The session-runtime registry; tests substitute it. */
|
|
264
265
|
sessionRuntimes: SessionRuntimes;
|
|
265
|
-
/** The runtimes this provider holds, by registry key. */
|
|
266
|
-
sessionRuntimeEntries: Map<string, SessionRuntimeEntry>;
|
|
267
266
|
/** Isolates calls that have no session identity. */
|
|
268
267
|
sessionRuntimeOwner: string;
|
|
269
268
|
/** The preflight's host runner; tests substitute it. */
|
|
270
269
|
sessionScopeProbe: (argv: string[]) => Promise<string>;
|
|
271
270
|
/** The one-time writable-root check's runner; tests substitute it. */
|
|
272
271
|
writableRootsProbe: (argv: string[]) => Promise<string>;
|
|
273
|
-
/**
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
272
|
+
/**
|
|
273
|
+
* Per-distro homes, delegated to the shared runtime book: `provider-common`'s
|
|
274
|
+
* `distroHome` reads this view, and tests pin the cache through it.
|
|
275
|
+
*/
|
|
276
|
+
get resolvedHomes(): Map<string, string>;
|
|
277
|
+
/**
|
|
278
|
+
* The row's config without the peer's volatile wrapper. The schema validates
|
|
279
|
+
* the plain shape; the wrapper only widens the type, so one accessor states
|
|
280
|
+
* the cast instead of every method repeating it.
|
|
281
|
+
*/
|
|
282
|
+
private get wslConfig();
|
|
280
283
|
/**
|
|
281
284
|
* @param ctx - the composition context.
|
|
282
285
|
* @param config - the validated plugin config.
|
package/lib/wsl-filesystem.js
CHANGED
|
@@ -18,7 +18,7 @@ import { ensureNativeSessionAgent } from "./native-agent.js";
|
|
|
18
18
|
import { installMessagesLocale } from "./messages.js";
|
|
19
19
|
import { defaultDistro, runCapture } from "./wsl.js";
|
|
20
20
|
import { validateWritableRootsConfig } from "./writable-roots.js";
|
|
21
|
-
import { distroHome, effectiveWritableRoots, resolveOperationDistro, sessionRuntimeWanted, wslWritableRoots } from "./provider-common.js";
|
|
21
|
+
import { ProviderRuntimeBook, distroHome, effectiveWritableRoots, resolveOperationDistro, sessionRuntimeWanted, wslWritableRoots } from "./provider-common.js";
|
|
22
22
|
/**
|
|
23
23
|
* Filesystem backend over a WSL distro's UNC share.
|
|
24
24
|
*
|
|
@@ -131,6 +131,21 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
131
131
|
*/
|
|
132
132
|
substrate: z.union(["share", "agent"]).default("agent"),
|
|
133
133
|
});
|
|
134
|
+
/**
|
|
135
|
+
* Per-distro homes, delegated to the shared runtime book: `provider-common`'s
|
|
136
|
+
* `distroHome` reads this view, and tests pin the cache through it.
|
|
137
|
+
*/
|
|
138
|
+
get resolvedHomes() {
|
|
139
|
+
return this.runtimeBook.homes;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* The row's config without the peer's volatile wrapper. The schema validates
|
|
143
|
+
* the plain shape; the wrapper only widens the type, so one accessor states
|
|
144
|
+
* the cast instead of every method repeating it.
|
|
145
|
+
*/
|
|
146
|
+
get wslConfig() {
|
|
147
|
+
return this.config;
|
|
148
|
+
}
|
|
134
149
|
/**
|
|
135
150
|
* @param ctx - the composition context.
|
|
136
151
|
* @param config - the validated plugin config.
|
|
@@ -147,7 +162,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
147
162
|
installMessagesLocale(ctx);
|
|
148
163
|
this.resolvedDistro = pinnedDistro(config.distro) ?? "";
|
|
149
164
|
this.resolvedHome = undefined;
|
|
150
|
-
this.
|
|
165
|
+
this.runtimeBook = new ProviderRuntimeBook();
|
|
151
166
|
this.defaultMode = ctx.sandboxPolicy.defaultMode;
|
|
152
167
|
this.agentSubstrateInstance = undefined;
|
|
153
168
|
this.agentSubstrates = new Map();
|
|
@@ -155,12 +170,9 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
155
170
|
this.agentInstance = undefined;
|
|
156
171
|
this.agentInstances = new Map();
|
|
157
172
|
this.sessionRuntimes = sessionRuntimes;
|
|
158
|
-
this.sessionRuntimeEntries = new Map();
|
|
159
173
|
this.sessionRuntimeOwner = randomUUID();
|
|
160
174
|
this.sessionScopeProbe = (argv) => runCapture(argv);
|
|
161
175
|
this.writableRootsProbe = (argv) => runCapture(argv);
|
|
162
|
-
this.sessionRuntimePreflight = new Set();
|
|
163
|
-
this.autoSessionScope = new Map();
|
|
164
176
|
// The preset's disposer releases the runtime; the shell executor's effect
|
|
165
177
|
// releases its own reference, so the scope stops after the last one.
|
|
166
178
|
ctx.effect(() => () => this.disposeSessionRuntimes().catch(() => { }), "wsl fs session runtimes");
|
|
@@ -174,7 +186,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
174
186
|
* @returns the deployment default mode, or `undefined` when unfenced.
|
|
175
187
|
*/
|
|
176
188
|
get sandboxMode() {
|
|
177
|
-
const config = this.
|
|
189
|
+
const config = this.wslConfig;
|
|
178
190
|
return config.sandbox ? this.defaultMode : undefined;
|
|
179
191
|
}
|
|
180
192
|
/**
|
|
@@ -214,7 +226,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
214
226
|
* @returns the substrate.
|
|
215
227
|
*/
|
|
216
228
|
async agentSubstrate() {
|
|
217
|
-
const config = this.
|
|
229
|
+
const config = this.wslConfig;
|
|
218
230
|
if (this.agentSubstrateInstance === undefined) {
|
|
219
231
|
this.agentSubstrateInstance = new AgentSubstrate({
|
|
220
232
|
agent: await this.publicationAgent(),
|
|
@@ -240,7 +252,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
240
252
|
const cached = this.agentSubstrates.get(distro);
|
|
241
253
|
if (cached !== undefined)
|
|
242
254
|
return cached;
|
|
243
|
-
const config = this.
|
|
255
|
+
const config = this.wslConfig;
|
|
244
256
|
const substrate = new AgentSubstrate({
|
|
245
257
|
agent: await this.publicationAgentFor(distro),
|
|
246
258
|
distro,
|
|
@@ -271,7 +283,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
271
283
|
* @throws {SandboxInvalidRootError} when an entry cannot be granted or checked.
|
|
272
284
|
*/
|
|
273
285
|
async writableRootsFor(distro, policy, check = true) {
|
|
274
|
-
const config = this.
|
|
286
|
+
const config = this.wslConfig;
|
|
275
287
|
if (!config.sandbox || policy === undefined || policy.mode !== "workspace-write")
|
|
276
288
|
return [];
|
|
277
289
|
if ((config.writableRoots?.length ?? 0) === 0 && (policy.additionalWritableRoots?.length ?? 0) === 0)
|
|
@@ -304,13 +316,13 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
304
316
|
* @returns the runtime entry, or undefined when the mode is off.
|
|
305
317
|
*/
|
|
306
318
|
sessionRuntimeFor(policy, distro, writableRoots = []) {
|
|
307
|
-
const config = this.
|
|
319
|
+
const config = this.wslConfig;
|
|
308
320
|
if (!config.sessionSandbox)
|
|
309
321
|
return undefined;
|
|
310
322
|
const workspaceRoot = policy.workspaceRoot || config.cwd;
|
|
311
323
|
const sessionId = policy.sessionId || this.sessionRuntimeOwner;
|
|
312
324
|
const key = SessionRuntimes.key({ sessionId, distro, workspaceRoot, mode: policy.mode, maskWindowsDrive: config.maskWindowsDrive, writableRoots });
|
|
313
|
-
const held = this.sessionRuntimeEntries.get(key);
|
|
325
|
+
const held = this.runtimeBook.sessionRuntimeEntries.get(key);
|
|
314
326
|
if (held !== undefined)
|
|
315
327
|
return held;
|
|
316
328
|
const entry = this.sessionRuntimes.acquire({
|
|
@@ -322,7 +334,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
322
334
|
maskWindowsDrive: config.maskWindowsDrive,
|
|
323
335
|
writableRoots,
|
|
324
336
|
});
|
|
325
|
-
this.sessionRuntimeEntries.set(key, entry);
|
|
337
|
+
this.runtimeBook.sessionRuntimeEntries.set(key, entry);
|
|
326
338
|
return entry;
|
|
327
339
|
}
|
|
328
340
|
/**
|
|
@@ -334,14 +346,14 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
334
346
|
* @throws {Error} with the remedy when it cannot.
|
|
335
347
|
*/
|
|
336
348
|
async ensureSessionRuntimeUsable(distro) {
|
|
337
|
-
if (this.sessionRuntimePreflight.has(distro))
|
|
349
|
+
if (this.runtimeBook.sessionRuntimePreflight.has(distro))
|
|
338
350
|
return;
|
|
339
|
-
const config = this.
|
|
351
|
+
const config = this.wslConfig;
|
|
340
352
|
const problem = await probeSessionRuntime({ wslPath: config.wslPath, distro, run: this.sessionScopeProbe });
|
|
341
353
|
if (problem !== null)
|
|
342
354
|
throw new Error(problem);
|
|
343
355
|
await ensureNativeSessionAgent({ wslPath: config.wslPath, distro, setNative: setSessionNativeAgent });
|
|
344
|
-
this.sessionRuntimePreflight.add(distro);
|
|
356
|
+
this.runtimeBook.sessionRuntimePreflight.add(distro);
|
|
345
357
|
}
|
|
346
358
|
/**
|
|
347
359
|
* Whether this provider should use the session runtime for one distro, with
|
|
@@ -352,8 +364,8 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
352
364
|
* @returns whether to acquire the per-session scope.
|
|
353
365
|
*/
|
|
354
366
|
async wantsSessionRuntime(distro) {
|
|
355
|
-
const config = this.
|
|
356
|
-
return sessionRuntimeWanted(config.sessionSandbox, distro, () => this.ensureSessionRuntimeUsable(distro), this.autoSessionScope);
|
|
367
|
+
const config = this.wslConfig;
|
|
368
|
+
return sessionRuntimeWanted(config.sessionSandbox, distro, () => this.ensureSessionRuntimeUsable(distro), this.runtimeBook.autoSessionScope);
|
|
357
369
|
}
|
|
358
370
|
/**
|
|
359
371
|
* Release every runtime this provider holds. Called from the preset's
|
|
@@ -362,8 +374,8 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
362
374
|
* @returns resolved once every reference is released.
|
|
363
375
|
*/
|
|
364
376
|
async disposeSessionRuntimes() {
|
|
365
|
-
const entries = [...this.sessionRuntimeEntries.values()];
|
|
366
|
-
this.sessionRuntimeEntries.clear();
|
|
377
|
+
const entries = [...this.runtimeBook.sessionRuntimeEntries.values()];
|
|
378
|
+
this.runtimeBook.sessionRuntimeEntries.clear();
|
|
367
379
|
for (const entry of entries)
|
|
368
380
|
await this.sessionRuntimes.release(entry.key);
|
|
369
381
|
}
|
|
@@ -383,7 +395,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
383
395
|
* @returns the agent to publish through.
|
|
384
396
|
*/
|
|
385
397
|
async mutationAgent(policy, forDistro) {
|
|
386
|
-
const config = this.
|
|
398
|
+
const config = this.wslConfig;
|
|
387
399
|
const distro = forDistro ?? await this.distroForPolicy(policy);
|
|
388
400
|
if (!isConfinedMutation({ policy, sandboxEnabled: config.sandbox })) {
|
|
389
401
|
return this.publicationAgentFor(distro);
|
|
@@ -441,7 +453,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
441
453
|
* @returns the distro name.
|
|
442
454
|
*/
|
|
443
455
|
async distro() {
|
|
444
|
-
const config = this.
|
|
456
|
+
const config = this.wslConfig;
|
|
445
457
|
if (this.resolvedDistro.length === 0)
|
|
446
458
|
this.resolvedDistro = await defaultDistro({ wslPath: config.wslPath });
|
|
447
459
|
return this.resolvedDistro;
|
|
@@ -456,7 +468,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
456
468
|
* @returns the distro name.
|
|
457
469
|
*/
|
|
458
470
|
async distroForPath(path, cwd) {
|
|
459
|
-
const config = this.
|
|
471
|
+
const config = this.wslConfig;
|
|
460
472
|
return resolveOperationDistro(config.distro, [path, cwd ?? config.cwd], () => this.distro());
|
|
461
473
|
}
|
|
462
474
|
/**
|
|
@@ -477,7 +489,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
477
489
|
* @returns the distro name.
|
|
478
490
|
*/
|
|
479
491
|
async distroForPolicy(policy) {
|
|
480
|
-
const config = this.
|
|
492
|
+
const config = this.wslConfig;
|
|
481
493
|
return resolveOperationDistro(config.distro, [policy?.workspaceRoot, config.cwd], () => this.distro());
|
|
482
494
|
}
|
|
483
495
|
/**
|
|
@@ -488,7 +500,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
488
500
|
* @returns the host path to operate on.
|
|
489
501
|
*/
|
|
490
502
|
async worldPath(path, cwd) {
|
|
491
|
-
const config = this.
|
|
503
|
+
const config = this.wslConfig;
|
|
492
504
|
const distro = await this.distroForPath(path, cwd);
|
|
493
505
|
let base = cwd ?? config.cwd;
|
|
494
506
|
if (String(base ?? "").trim().length === 0 && isRelativeWorldPath(path)) {
|
|
@@ -550,7 +562,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
550
562
|
* @throws {FsError} with `FS_SANDBOX_DENIED` when the policy refuses it.
|
|
551
563
|
*/
|
|
552
564
|
async checkedTarget(target, sandboxPolicy) {
|
|
553
|
-
const config = this.
|
|
565
|
+
const config = this.wslConfig;
|
|
554
566
|
if (!config.sandbox)
|
|
555
567
|
return target;
|
|
556
568
|
const policy = sandboxPolicy ?? this.ctx.sandboxPolicy.resolve();
|
|
@@ -715,7 +727,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
715
727
|
* mapped with what is already known.
|
|
716
728
|
*/
|
|
717
729
|
processPathFromHostPath(hostPath) {
|
|
718
|
-
const config = this.
|
|
730
|
+
const config = this.wslConfig;
|
|
719
731
|
const choice = selectDistro({
|
|
720
732
|
configured: config.distro,
|
|
721
733
|
candidates: [hostPath, config.cwd],
|
|
@@ -752,7 +764,7 @@ export class WslFileSystem extends LocalFileSystem {
|
|
|
752
764
|
*/
|
|
753
765
|
async watch(target, changed, signal) {
|
|
754
766
|
signal.throwIfAborted();
|
|
755
|
-
const config = this.
|
|
767
|
+
const config = this.wslConfig;
|
|
756
768
|
const parsed = uncToPosix(target.targetKey);
|
|
757
769
|
if (parsed === undefined) {
|
|
758
770
|
throw new FsError(`cannot watch "${target.displayPath}": not a path inside the distro`, "FS_IO_ERROR");
|
package/lib/wsl-shell.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { WslAgent } from "./agent.js";
|
|
|
5
5
|
import { SessionRuntimes } from "./session-runtime.js";
|
|
6
6
|
import type { AgentBackend } from "./native-agent.js";
|
|
7
7
|
import type { SessionRuntimeEntry } from "./session-runtime.js";
|
|
8
|
+
import { ProviderRuntimeBook } from "./provider-common.js";
|
|
8
9
|
import type { Context } from "@deepseek-ai/cordis";
|
|
9
10
|
import type { SandboxExecutionPolicy, SandboxMode } from "@deepseek-ai/dsh-sandbox";
|
|
10
11
|
import type { SubprocessSpawnSpec } from "@deepseek-ai/dsh-subprocess";
|
|
@@ -151,19 +152,6 @@ export declare class WslShellExecutor extends LocalBashExecutor {
|
|
|
151
152
|
* unconfined and `sandboxMode` is `undefined`, so the model is told so.
|
|
152
153
|
*/
|
|
153
154
|
sandbox: z<boolean, boolean, "defined">;
|
|
154
|
-
/**
|
|
155
|
-
* Shadow `/mnt` with an empty tmpfs in every confined profile, hiding the
|
|
156
|
-
* Windows drive from confined commands: its files cannot be read or
|
|
157
|
-
* exfiltrated and its executables cannot be launched through interop —
|
|
158
|
-
* the hole that lets a "sandboxed" command reach your full Windows token.
|
|
159
|
-
* A narrowing, not a closure (a command can still write an executable
|
|
160
|
-
* into the workspace and run it — binfmt dispatches on content, not
|
|
161
|
-
* location), so enforcement stays `partial` and the sandbox fact reports
|
|
162
|
-
* `windowsDrive: "masked"`. Costs: confined commands cannot read or touch
|
|
163
|
-
* anything under `/mnt`, and tools that probe the drive degrade. The
|
|
164
|
-
* complete closure is distro-level: `[interop] enabled=false` in
|
|
165
|
-
* `wsl.conf`.
|
|
166
|
-
*/
|
|
167
155
|
/**
|
|
168
156
|
* The interop stance in one key (WSL-314), expanding to the per-key
|
|
169
157
|
* values the measured matrix documents:
|
|
@@ -184,6 +172,20 @@ export declare class WslShellExecutor extends LocalBashExecutor {
|
|
|
184
172
|
* boolean answer); the boolean remains for existing profiles.
|
|
185
173
|
*/
|
|
186
174
|
interopVisibility: z<"masked" | "visible" | "disabled", "masked" | "visible" | "disabled", "plain">;
|
|
175
|
+
/**
|
|
176
|
+
* Shadow `/mnt` with an empty tmpfs in every confined profile, hiding the
|
|
177
|
+
* Windows drive from confined commands: its files cannot be read or
|
|
178
|
+
* exfiltrated and its executables cannot be launched through interop —
|
|
179
|
+
* the hole that lets a "sandboxed" command reach your full Windows token.
|
|
180
|
+
* A narrowing, not a closure (a command can still write an executable
|
|
181
|
+
* into the workspace and run it — binfmt dispatches on content, not
|
|
182
|
+
* location), so enforcement stays `partial` and the sandbox fact reports
|
|
183
|
+
* `windowsDrive: "masked"`. Costs: confined commands cannot read or touch
|
|
184
|
+
* anything under `/mnt`, and tools that probe the drive degrade. The
|
|
185
|
+
* complete closure is distro-level: `[interop] enabled=false` in
|
|
186
|
+
* `wsl.conf`. The mask covers the COMMAND path only; the file tools'
|
|
187
|
+
* read side still reaches `/mnt` through the shared read agent.
|
|
188
|
+
*/
|
|
187
189
|
maskWindowsDrive: z<boolean, boolean, "defined">;
|
|
188
190
|
/**
|
|
189
191
|
* Extra directories under `workspace-write`, in distro spelling. The
|
|
@@ -262,19 +264,6 @@ export declare class WslShellExecutor extends LocalBashExecutor {
|
|
|
262
264
|
* unconfined and `sandboxMode` is `undefined`, so the model is told so.
|
|
263
265
|
*/
|
|
264
266
|
sandbox: z<boolean, boolean, "defined">;
|
|
265
|
-
/**
|
|
266
|
-
* Shadow `/mnt` with an empty tmpfs in every confined profile, hiding the
|
|
267
|
-
* Windows drive from confined commands: its files cannot be read or
|
|
268
|
-
* exfiltrated and its executables cannot be launched through interop —
|
|
269
|
-
* the hole that lets a "sandboxed" command reach your full Windows token.
|
|
270
|
-
* A narrowing, not a closure (a command can still write an executable
|
|
271
|
-
* into the workspace and run it — binfmt dispatches on content, not
|
|
272
|
-
* location), so enforcement stays `partial` and the sandbox fact reports
|
|
273
|
-
* `windowsDrive: "masked"`. Costs: confined commands cannot read or touch
|
|
274
|
-
* anything under `/mnt`, and tools that probe the drive degrade. The
|
|
275
|
-
* complete closure is distro-level: `[interop] enabled=false` in
|
|
276
|
-
* `wsl.conf`.
|
|
277
|
-
*/
|
|
278
267
|
/**
|
|
279
268
|
* The interop stance in one key (WSL-314), expanding to the per-key
|
|
280
269
|
* values the measured matrix documents:
|
|
@@ -295,6 +284,20 @@ export declare class WslShellExecutor extends LocalBashExecutor {
|
|
|
295
284
|
* boolean answer); the boolean remains for existing profiles.
|
|
296
285
|
*/
|
|
297
286
|
interopVisibility: z<"masked" | "visible" | "disabled", "masked" | "visible" | "disabled", "plain">;
|
|
287
|
+
/**
|
|
288
|
+
* Shadow `/mnt` with an empty tmpfs in every confined profile, hiding the
|
|
289
|
+
* Windows drive from confined commands: its files cannot be read or
|
|
290
|
+
* exfiltrated and its executables cannot be launched through interop —
|
|
291
|
+
* the hole that lets a "sandboxed" command reach your full Windows token.
|
|
292
|
+
* A narrowing, not a closure (a command can still write an executable
|
|
293
|
+
* into the workspace and run it — binfmt dispatches on content, not
|
|
294
|
+
* location), so enforcement stays `partial` and the sandbox fact reports
|
|
295
|
+
* `windowsDrive: "masked"`. Costs: confined commands cannot read or touch
|
|
296
|
+
* anything under `/mnt`, and tools that probe the drive degrade. The
|
|
297
|
+
* complete closure is distro-level: `[interop] enabled=false` in
|
|
298
|
+
* `wsl.conf`. The mask covers the COMMAND path only; the file tools'
|
|
299
|
+
* read side still reaches `/mnt` through the shared read agent.
|
|
300
|
+
*/
|
|
298
301
|
maskWindowsDrive: z<boolean, boolean, "defined">;
|
|
299
302
|
/**
|
|
300
303
|
* Extra directories under `workspace-write`, in distro spelling. The
|
|
@@ -352,35 +355,37 @@ export declare class WslShellExecutor extends LocalBashExecutor {
|
|
|
352
355
|
resolvedShells: Map<string, string>;
|
|
353
356
|
/** Cached distro-user home, the workdir when `cwd` is empty. */
|
|
354
357
|
resolvedHome: string | undefined;
|
|
355
|
-
/**
|
|
356
|
-
|
|
358
|
+
/** Shared per-provider bookkeeping (homes, session runtimes, preflight caches). */
|
|
359
|
+
runtimeBook: ProviderRuntimeBook;
|
|
357
360
|
/** The default mode — the capability fact the tool layer reads. */
|
|
358
361
|
mode: SandboxMode | undefined;
|
|
359
362
|
/** The distro-side confinement, or nothing when the operator opted out. */
|
|
360
363
|
sandbox: InstanceType<typeof WslSandbox> | undefined;
|
|
361
364
|
/** The session-runtime registry; tests substitute it. */
|
|
362
365
|
sessionRuntimes: SessionRuntimes;
|
|
363
|
-
/** The runtimes this executor holds, by registry key. */
|
|
364
|
-
sessionRuntimeEntries: Map<string, SessionRuntimeEntry>;
|
|
365
366
|
/** Isolates calls that have no session identity. */
|
|
366
367
|
sessionRuntimeOwner: string;
|
|
367
368
|
/** The preflight's host runner; tests substitute it. */
|
|
368
369
|
sessionScopeProbe: (argv: string[]) => Promise<string>;
|
|
369
370
|
/** The one-time writable-root check's runner; tests substitute it. */
|
|
370
371
|
writableRootsProbe: (argv: string[]) => Promise<string>;
|
|
371
|
-
/** Distros whose session-runtime preflight has succeeded. */
|
|
372
|
-
sessionRuntimePreflight: Set<string>;
|
|
373
|
-
/** Per-distro `auto` verdicts, re-probed when they were negative and stale. */
|
|
374
|
-
autoSessionScope: Map<string, {
|
|
375
|
-
usable: boolean;
|
|
376
|
-
checkedAt: number;
|
|
377
|
-
}>;
|
|
378
372
|
/**
|
|
379
373
|
* Per-process confinement facts retained until settlement. Overlapping calls
|
|
380
374
|
* can carry different policies, so a shared latest-wrap value would classify
|
|
381
375
|
* a process against the wrong facts. Unconfined processes have no entry.
|
|
382
376
|
*/
|
|
383
377
|
processFacts: Map<ShellExecution, ProcessFacts>;
|
|
378
|
+
/**
|
|
379
|
+
* Per-distro homes, delegated to the shared runtime book: `provider-common`'s
|
|
380
|
+
* `distroHome` reads this view, and tests pin the cache through it.
|
|
381
|
+
*/
|
|
382
|
+
get resolvedHomes(): Map<string, string>;
|
|
383
|
+
/**
|
|
384
|
+
* The row's config without the peer's volatile wrapper. The schema validates
|
|
385
|
+
* the plain shape; the wrapper only widens the type, so one accessor states
|
|
386
|
+
* the cast instead of every method repeating it.
|
|
387
|
+
*/
|
|
388
|
+
private get wslConfig();
|
|
384
389
|
/**
|
|
385
390
|
* @param ctx - the composition context.
|
|
386
391
|
* @param config - the validated plugin config.
|