Skip to content

Add a persistent Windows host helper for WSL - #192

Draft
inayayousfi wants to merge 2 commits into
nut-tree:developfrom
inayayousfi:feature/wsl-windows-host
Draft

inayayousfi wants to merge 2 commits into
nut-tree:developfrom
inayayousfi:feature/wsl-windows-host

Conversation

@inayayousfi

Copy link
Copy Markdown

inayayousfi directed the work and made every decision.
GPT-6.1 Sol, running in OpenCode, carried inayayousfi's decisions out.

Short summary

Add a standalone C++17 Windows executable for the companion nut.js WSL providers.

Detailed description (motivation, use-case etc.)

The helper keeps one process running for mouse, keyboard, primary-screen capture, clipboard text and window operations. It reads ordered JSON requests from standard input and returns JSON replies followed by binary screenshot pixels when needed. Windows does not need Node.js or runtime compilation, and the helper opens no network listener.

Windows builds produce libnut-wsl-host.exe alongside the existing native addon. A helper-only build option avoids the Node-API build dependency. Closing the command pipe stops long typing or highlight operations and attempts to release input held by the helper.

The companion TypeScript implementation is on inayayousfi/nut.js, branch feature/wsl-windows-host. Its native package pin must be updated after a helper-containing release is available.

Validation: an x64 Release build passed on Windows with MSVC 19.44 and Windows SDK 10.0.26100.0, without compiler warnings. The five-request protocol smoke test passed both from Windows Node.js and from Linux Node.js in WSL. The WSL test also confirmed persistent process reuse and helper exit after the caller finished.

This remains a draft. Actual capture, input, clipboard changes and window operations are untested because the available host has no signed-in interactive desktop. ARM64, antivirus behavior, the combined addon/helper build and released-package installation remain unverified.

Screenshots (if appropriate)

None. The protocol test does not capture the desktop or send input.

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Build a standalone C++17 helper for mouse, keyboard, primary-screen capture,
clipboard and window operations over standard input/output.

Add a helper-only build option, protocol smoke tests and Windows workflow
checks. Document the protocol and interactive-session requirement.
Synchronize screenshot reads and use fixed US key mappings. Retain failed
input releases, bound JSON replies and use asynchronous window changes
with bounded waits.

Add native regression tests and workflow checks, exclude test build
artifacts from packages, and document failure behavior.
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