dsh-wsl-workspace 0.3.2 → 0.4.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/README.md +12 -0
- package/TESTING.md +11 -5
- package/lib/client.js +1053 -1052
- package/lib/client.js.map +1 -1
- package/lib/fs.js +1 -1
- package/lib/index.js +116 -13
- package/lib/index.js.map +1 -1
- package/lib/shell.js +382 -382
- package/lib/{wsl-credentials-BI4v5TNZ.js → wsl-credentials-BwNmfX_y.js} +109 -109
- package/lib/{wsl-credentials-BI4v5TNZ.js.map → wsl-credentials-BwNmfX_y.js.map} +1 -1
- package/lib/{wsl-C5_mxGPM.js → wsl-qwxCKU5O.js} +229 -228
- package/lib/wsl-qwxCKU5O.js.map +1 -0
- package/package.json +13 -2
- package/src/host/wsl-skills.ts +134 -12
- package/src/shared/paths.ts +6 -3
- package/lib/wsl-C5_mxGPM.js.map +0 -1
package/README.md
CHANGED
|
@@ -34,10 +34,22 @@ Click "Create & open" to start a new session in the workspace. In the new sessio
|
|
|
34
34
|
|
|
35
35
|
- **bash tool**: runs inside the WSL distribution as the configured username (empty = the distro default user, often `root`), so it can read and write anywhere in the distro. The Windows ACL sandbox cannot wrap `wsl.exe` — its children run on the Linux kernel side — so WSL itself is the isolation boundary and the DSH file policy does not apply to bash.
|
|
36
36
|
- **File tools (`read`/`write`/`edit`)**: go through the Windows-side WSL 9P share and run under the DSH file policy. Under `workspace-write`, reads work anywhere but writes are restricted to the session workspace; switch the file policy to `danger-full-access` to also allow writes outside it. The username field does not affect the file tools.
|
|
37
|
+
- **Skill catalog**: the session's skill catalog is discovered starting at the session cwd's nearest `.git` ancestor (falling back to the cwd itself), then scanning downward for `.dsh/skills` / `.agents/skills` — including nested projects — bounded to 4 directory levels, 64 skill directories and 4096 visited directories. Register the workspace at the project root you work in; if the registered workspace itself sits inside a larger git repository, the scan starts at that repository's root (matching the host's own rule) and sibling projects may surface. Results are cached per scan root and served stale-while-revalidate: a fresh scan (the first lookup, and a background refresh every 10 seconds) may take a moment on very large trees — a workspace registered at the distro root `/` scans the whole filesystem — but repeated lookups always answer instantly and never block on a refresh. Skill bodies always load live. One substrate limit to know: the Windows-side `\\wsl.localhost` share cannot resolve Linux symlinks (they read back as unresolvable entries), so a project linked into the workspace via `ln -s` is not discoverable — the scan walks past it without failing; register the workspace at a level that contains the real project directories instead.
|
|
37
38
|
- The garbled `localhost` port-forwarding banner `wsl.exe` prints to stderr when the distro was not running yet is harmless.
|
|
38
39
|
|
|
39
40
|
## Changelog
|
|
40
41
|
|
|
42
|
+
### 0.4.0 — 2026-08-29
|
|
43
|
+
|
|
44
|
+
Follow-ups from the [#12](https://github.com/6Mikao9/dsh-wsl-workspace/issues/12) limitation list and the [#13](https://github.com/6Mikao9/dsh-wsl-workspace/issues/13) compatibility work:
|
|
45
|
+
|
|
46
|
+
- **Lookup cache**: completed skill-catalog lookups are cached per scan root and served **stale-while-revalidate** — the first scan of a workspace is real (seconds on large trees), every later lookup answers instantly, an expired entry never blocks (it is served immediately while a background refresh runs, so even a workspace registered at the distro root stays responsive), and `get()` keeps reading skill bodies live.
|
|
47
|
+
- **Boundary hardening**: UNC spellings with double separators, trailing slashes, uppercase hosts, the legacy `\\wsl$` form and distro-root cwds all parse and scan correctly; skill files saved as UTF-8 with a BOM or with CRLF line endings (including CRLF block scalars) now parse; unreadable directories prune without failing the scan; a name+description+body fingerprint guarantees aliased skill files never publish twice.
|
|
48
|
+
- **Symlinked projects — investigated, substrate-limited**: the discovery walk now recognizes directory symlinks explicitly and prunes them safely (no crashes, no loops). Following them is not possible over the `\\wsl.localhost` 9P share — the Windows side cannot resolve Linux symlink targets (probed: `readlink` → `EISDIR`, `stat`/`readdir` → `ENOENT`) — so a project linked into the workspace via `ln -s` stays undiscoverable; a name+body fingerprint dedupe also guarantees aliased skill files can never publish twice on substrates that do resolve links.
|
|
49
|
+
- **Block-scalar frontmatter**: `description:` / `whenToUse:` written as YAML block scalars (`|` literal, `>` folded) now parse — such skills were silently dropped before.
|
|
50
|
+
- **Compatibility manifest**: `dsh.compatibility.dshReleases` declares per-release compatibility with the official DSH versions, backed by reproducible disposable-Profile install/start/uninstall evidence (`scripts/verify-dsh-compat.sh`), and `engines` declares the Node.js floor.
|
|
51
|
+
- **Guard scripts**: `scripts/check-rank-parity.mjs` fails the release when the copied project-rank constants drift from the host's `dsh-skill-filesystem`.
|
|
52
|
+
|
|
41
53
|
### 0.3.2 — 2026-08-29
|
|
42
54
|
|
|
43
55
|
- **WSL workspace sessions now inject nested-project skill catalogs** ([#10](https://github.com/6Mikao9/dsh-wsl-workspace/issues/10)): `.dsh/skills` and `.agents/skills` directories of projects nested below the registered workspace root are discovered and published with the host's project ranks and sources, so the model sees the same skill catalog it would see when the session cwd is the project folder itself. Discovery is depth- and budget-bounded, prunes `node_modules`/dot-directories, and leaves non-WSL sessions untouched.
|
package/TESTING.md
CHANGED
|
@@ -24,7 +24,12 @@ Coverage:
|
|
|
24
24
|
| `tests/fs-execution-context.test.ts` | `WslFileSystem` inherits the calling session's cwd through `AsyncLocalStorage` on `tools/execute`; agentless calls fall back to the configured distro. |
|
|
25
25
|
| `tests/shell.test.ts` | The login-shell `cd` prefix preserves the resolved workdir (including single-quote escaping); non-login shells leave the command unchanged. |
|
|
26
26
|
| `tests/paths.test.ts` | UNC ↔ Linux path translation, `/mnt/<drive>` mapping, canonical Windows path keys, WSL username validation. |
|
|
27
|
-
| `tests/wsl-skills.test.ts` | The WSL skill provider (issue #10): non-WSL lookups return nothing, nested `.dsh/skills` / `.agents/skills` discovery with host ranks/sources, `get()` body loading, pruning of `node_modules` / dot-directories, frontmatter validation, depth and skill-root budgets, the nearest-`.git`-ancestor rule (a cwd deeper than the project root still sees the project's skills, and skills above that ancestor do not leak),
|
|
27
|
+
| `tests/wsl-skills.test.ts` | The WSL skill provider (issue #10): non-WSL lookups return nothing, nested `.dsh/skills` / `.agents/skills` discovery with host ranks/sources, `get()` body loading, pruning of `node_modules` / dot-directories and unreadable directories, frontmatter validation **including block scalars, CRLF files and UTF-8 BOMs**, depth and skill-root budgets, the nearest-`.git`-ancestor rule (a cwd deeper than the project root still sees the project's skills, and skills above that ancestor do not leak), the skill-root cap, the **per-scan-root lookup cache with stale-while-revalidate** (copy semantics, TTL expiry serving stale + background refresh, overlapping lookups sharing one refresh, `get()` staying live), **UNC spelling forms** (legacy `\\wsl$`, uppercase hosts, trailing slashes, distro-root cwds) and **directory-symlink handling** (unresolvable links pruned per the 9P substrate, aliasing deduplicated, hops bounded by depth). |
|
|
28
|
+
|
|
29
|
+
## Provider parity and compatibility checks
|
|
30
|
+
|
|
31
|
+
- `node scripts/check-rank-parity.mjs` — the provider's project ranks are copied from `@deepseek-ai/dsh-skill-filesystem` (the host does not export them). This script parses the host's built lib when the package is resolvable on this machine and fails on drift. Run it before every release on a machine with the harness installed.
|
|
32
|
+
- `scripts/verify-dsh-compat.sh <version>...` — disposable-Profile install/start/uninstall evidence against specific `@deepseek-ai/dsh` releases: fully isolated (`DSH_HOME` redirected to a temp tree, own port), boots the published harness version with the plugin added by name, probes `POST /wsl-workspace/api`, then removes the plugin and verifies the route disappears. Emits per-version verdict lines used for the `dsh.compatibility.dshReleases` manifest records.
|
|
28
33
|
|
|
29
34
|
## Preset materialization integration test
|
|
30
35
|
|
|
@@ -71,7 +76,7 @@ The WSL skill provider publishes `.dsh/skills` / `.agents/skills` from nested pr
|
|
|
71
76
|
wsl -d <distro> -- bash -c "bash /tmp/repro-setup.sh"
|
|
72
77
|
```
|
|
73
78
|
|
|
74
|
-
2. Drive the provider against the real `\\wsl.localhost` share — four assertions print (workspace-root cwd finds root + nested skills; nested-project cwd finds only that project; `get()` loads a body; non-WSL cwd returns nothing)
|
|
79
|
+
2. Drive the provider against the real `\\wsl.localhost` share — four assertions print (workspace-root cwd finds root + nested skills; nested-project cwd finds only that project; `get()` loads a body; non-WSL cwd returns nothing). Override the target with `WSL_COMPAT_DISTRO` / `WSL_COMPAT_USER` / `WSL_COMPAT_ROOT`:
|
|
75
80
|
|
|
76
81
|
```powershell
|
|
77
82
|
node scripts/repro-e2e.mjs
|
|
@@ -98,6 +103,7 @@ After installing the plugin into a profile and restarting `dsh web`:
|
|
|
98
103
|
2. `node --experimental-strip-types --test tests/variants.test.ts tests/fs-execution-context.test.ts tests/shell.test.ts tests/paths.test.ts tests/wsl-skills.test.ts` — all green.
|
|
99
104
|
3. `node tests/host-materialize.mjs` — all assertions pass.
|
|
100
105
|
4. `node --experimental-strip-types tests/smoke.ts` — real-WSL round-trip passes.
|
|
101
|
-
5. `node scripts/
|
|
102
|
-
6. `
|
|
103
|
-
7.
|
|
106
|
+
5. `node scripts/check-rank-parity.mjs` — host rank constants still match our copies.
|
|
107
|
+
6. `node scripts/repro-e2e.mjs` (after `scripts/repro-setup.sh`) — nested skill-catalog assertions pass.
|
|
108
|
+
7. `npm pack --dry-run` — confirm the tarball carries only live `lib/` chunks, `src/`, `cordis.patch.yml`, READMEs, `LICENSE`, and `NOTICE` (`pnpm build` prunes unreferenced chunks automatically via `scripts/prune-lib.mjs`).
|
|
109
|
+
8. Install the tarball into a clean profile (`dsh plugin --profile web add <tarball>`), restart `dsh web`, and run the end-to-end checks above plus the nested-skill probe. When the compatibility manifest changes, also run `scripts/verify-dsh-compat.sh` for every declared release.
|