# ResearchPad Agent Windows Preview

This preview package runs ResearchPad Agent through WSL2.

## Requirements

- Windows 10 / 11 x64.
- WSL2 with Ubuntu, or permission to let the installer start `wsl --install -d Ubuntu`.
- Node.js LTS on Windows. The installer will try `winget install OpenJS.NodeJS.LTS` if Node.js is missing.

## Install

Open PowerShell and run:

```powershell
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
.\install.ps1
```

If WSL is installed for the first time, Windows may ask you to reboot or complete Ubuntu first-run user setup. After that, run `install.ps1` again.

## Start / Stop

```powershell
.\start-agent.ps1
.\stop-agent.ps1
```

The installer also creates a per-user Scheduled Task named `ResearchPadAgent` so the local service starts after login.

## First Pairing

1. Open `https://agent.researchpad.org/`.
2. Wait for the IDE to be detected.
3. The local IDE will ask whether ResearchPad Web can connect.
4. Click `Allow` / `允许连接`.

The pairing token is saved locally, so future visits connect automatically.

## Notes

This is a preview package. The production Windows `.exe` installer will wrap these same scripts with Inno Setup or WiX and add code signing.
