Skip to content

feat: add WSL module to devcontainer-mcp-core#11

Merged
aniongithub merged 1 commit into
mainfrom
aniongithub/refactored-train
May 9, 2026
Merged

feat: add WSL module to devcontainer-mcp-core#11
aniongithub merged 1 commit into
mainfrom
aniongithub/refactored-train

Conversation

@aniongithub
Copy link
Copy Markdown
Owner

Summary

Adds a WSL (Windows Subsystem for Linux) backend module to devcontainer-mcp-core, gated behind #[cfg(target_os = "windows")].

Changes

crates/devcontainer-mcp-core/src/wsl.rs (new)

  • list() — parses wsl --list --verbose into structured WslDistro entries
  • exec(distro, command) — runs a command inside a WSL distro via wsl -d <distro> -- sh -c <command>
  • terminate(distro) — stops a running distro
  • shutdown() — shuts down all WSL distros
  • set_default(distro) — sets the default distribution
  • file_read/file_write/file_edit/file_list — file operations reusing file_ops helpers
  • Unit tests for list output parsing

cli.rs

  • Added CliBinary::Wsl variant (cfg-gated) mapping to "wsl" command

error.rs

  • Added Error::WslNotFound variant (cfg-gated) with install instructions

lib.rs

  • Added pub mod wsl (cfg-gated)

All WSL code is excluded on non-Windows targets. Verified with cargo check on Linux.

Phase 1 — Upgrade rmcp and split tools:
- Upgrade rmcp from 0.1 to 1.6 (composable #[tool_router] + #[tool_handler])
- Migrate all tools from #[tool(param)] to Parameters<T> pattern
- Split 1200-line monolithic tools.rs into ~40 focused files:
  tools/devpod/     - 12 files
  tools/devcontainer/ - 8 files
  tools/codespaces/ - 8 files
  tools/auth/       - 4 files
- Each tool gets its own #[tool_router] impl block
- Backend routers combined hierarchically with + operator

Phase 2 — Templated SKILL.md:
- Split SKILL.md into skills/ fragments (10 markdown files + 4 tool lists)
- build.rs assembles YAML frontmatter + body at build time
- Platform-specific sections (WSL) conditionally included on Windows

Phase 3 — WSL support (Windows-only):
- Add cfg-gated wsl.rs to core crate with list/exec/terminate/shutdown/
  set_default + file operations
- Add cfg-gated tools/wsl/ with 6 tool files (9 MCP tools total)
- WSL skill docs + tool names auto-included on Windows builds via build.rs
- Add Windows x64 build job to release.yml

All code gated with #[cfg(target_os = "windows")] — zero dead code on
Linux/macOS. WSL tools only ship in Windows binaries.
@aniongithub aniongithub force-pushed the aniongithub/refactored-train branch from 23e218d to 341df09 Compare May 9, 2026 16:32
@aniongithub aniongithub merged commit d93ec8e into main May 9, 2026
1 check passed
@aniongithub aniongithub deleted the aniongithub/refactored-train branch May 9, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant