Skip to content

Add Windows host providers for WSL - #631

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 Windows host control through the existing nut.js providers when Node.js runs in Windows Subsystem for Linux (WSL).

Detailed description (motivation, use-case etc.)

WSL currently selects Linux native providers. This draft directs mouse, keyboard, screen, clipboard and window operations to one persistent, precompiled Windows helper instead. Screenshots return pixel data directly as nut.js Images. The helper uses standard input/output and requires neither a network listener nor runtime compilation.

NUT_JS_DISABLE_WSL retains Linux desktop control. Existing default-provider disable settings remain respected. Capture follows the documented primary-screen contract with physical pixel coordinates. Interrupted input commands are never automatically retried.

The companion native implementation is on inayayousfi/libnut-core, branch feature/wsl-windows-host. Before integration, that helper must be released and the native dependency pin updated. NUT_JS_WSL_HELPER supports testing a local build in the meantime.

Validation: the complete TypeScript library compiles and 38 focused tests pass. Linux Node.js in WSL selected all five providers without loading Linux native libraries, reused one Windows helper for 100 protocol commands, and exited normally without leaving that helper running.

This remains a draft. Actual screenshots, input, clipboard changes and window operations have not been tested because the available Windows host has no signed-in interactive desktop. ARM64 builds, antivirus behavior and installation from a released package remain unverified. The existing full suite is blocked by private native dependencies unavailable from the public registry.

Screenshots (if appropriate)

None. No desktop capture or input was performed.

Checklist

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

Route the five default desktop providers through one persistent Windows
helper without loading Linux native libraries. Return screenshot pixels
directly and preserve provider-disable settings and a Linux desktop opt-out.

Add provider, protocol-client and WSL selection tests. Document the
companion libnut-core release required before integration.
Include configured input delays in command timeouts and reject timer
overflow before sending actions. Remove the extra string-typing delay
without changing shared keyboard timing.

Add regression tests for long delays, timer limits and public string
typing configuration, and document the limits.

This branch has not been deployed

No deployments
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