ai-remote 0.1.0 → 0.3.1
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 +69 -20
- package/dist/cli.mjs +8073 -0
- package/dist/index.js +6 -6
- package/dist/protocols/index.js +2 -2
- package/dist/protocols/rdp/caps.js +1 -1
- package/dist/protocols/rdp/cert.js +1 -1
- package/dist/protocols/rdp/client.js +18 -16
- package/dist/protocols/rdp/client.js.map +2 -2
- package/dist/protocols/rdp/cliprdr.js +1 -1
- package/dist/protocols/rdp/credssp.js +2 -2
- package/dist/protocols/rdp/display.js +2 -2
- package/dist/protocols/rdp/gcc.js +2 -2
- package/dist/protocols/rdp/mcs.js +2 -2
- package/dist/protocols/rdp/ntlm.js +2 -2
- package/dist/protocols/rdp/pdu.js +1 -1
- package/dist/protocols/rdp/rail.js +1 -1
- package/dist/protocols/rdp/sec.js +3 -3
- package/dist/protocols/rdp/session.js +3 -3
- package/dist/protocols/rdp/tls.js +3 -3
- package/dist/protocols/rdp/vchannel.js +1 -1
- package/dist/protocols/rdp/x224.js +1 -1
- package/dist/protocols/ssh/kex.js +1 -1
- package/dist/protocols/ssh/session.js +4 -3
- package/dist/protocols/ssh/session.js.map +2 -2
- package/dist/protocols/ssh/transport.js +8 -6
- package/dist/protocols/ssh/transport.js.map +2 -2
- package/dist/protocols/vnc/session.js +3 -3
- package/dist/shared/connection.js +1 -1
- package/dist/shared/hosts.js +1 -1
- package/package.json +13 -3
- package/src/cli/cli.ts +452 -0
- package/src/cli/daemon.ts +295 -0
- package/src/cli/framebuffer.ts +115 -0
- package/src/cli/generated/viewer-bundle.ts +5 -0
- package/src/cli/ipc.ts +78 -0
- package/src/cli/paths.ts +28 -0
- package/src/cli/png.ts +106 -0
- package/src/cli/session.ts +263 -0
- package/src/cli/shell.ts +184 -0
- package/src/cli/transport.ts +86 -0
- package/src/cli/viewer-client/assets.d.ts +4 -0
- package/src/cli/viewer-client/main.ts +300 -0
- package/src/cli/viewer-page.ts +102 -0
- package/src/cli/viewer.ts +272 -0
- package/src/cli/wsserver.ts +144 -0
- package/src/protocols/rdp/client.ts +9 -1
- package/src/protocols/ssh/session.ts +1 -0
- package/src/protocols/ssh/transport.ts +15 -2
package/README.md
CHANGED
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
# ai-remote
|
|
2
2
|
|
|
3
|
-
> Pure TypeScript protocol engines (RDP, VNC, SSH) and remote
|
|
3
|
+
> Pure TypeScript protocol engines (RDP, VNC, SSH) for Node.js, Cloudflare Workers, and web browsers — plus `npx ai-remote`, a CLI that drives a remote desktop and shows you what it is doing.
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/ai-remote)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
|
-
##
|
|
8
|
+
## 🚀 Quick Start (CLI)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Run immediately with `npx` (zero install):
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
```bash
|
|
13
|
+
# Connect and open a live supervision window:
|
|
14
|
+
AI_REMOTE_PASSWORD=secret npx ai-remote open 192.168.1.50 -u Administrator
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
# Take a screenshot:
|
|
17
|
+
AI_REMOTE_PASSWORD=secret npx ai-remote shot 192.168.1.50 -u Administrator -o screen.png
|
|
18
|
+
|
|
19
|
+
# Click or type on the remote desktop:
|
|
20
|
+
npx ai-remote click 192.168.1.50 500,300
|
|
21
|
+
npx ai-remote type 192.168.1.50 "notepad"
|
|
22
|
+
npx ai-remote key 192.168.1.50 Enter
|
|
23
|
+
|
|
24
|
+
# Run commands in the remote terminal over SSH:
|
|
25
|
+
npx ai-remote exec 192.168.1.50 "dir"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### CLI Commands
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
ai-remote open <host[:port]> connect, show a window, and stay open
|
|
32
|
+
ai-remote shot <host[:port]> screenshot the desktop
|
|
33
|
+
ai-remote click <host[:port]> X,Y click, --button right|middle, --double
|
|
34
|
+
ai-remote type <host[:port]> "text" type into whatever has focus
|
|
35
|
+
ai-remote key <host[:port]> <Code> press keys, e.g. MetaLeft, ControlLeft+KeyA
|
|
36
|
+
ai-remote exec <host[:port]> "cmd" run a command in the terminal (SSH)
|
|
37
|
+
ai-remote shell <host[:port]> an interactive terminal
|
|
38
|
+
ai-remote do <host[:port]> "steps" several actions in one go
|
|
39
|
+
ai-remote view <host[:port]> open the window on a running session
|
|
40
|
+
ai-remote view <host[:port]> --close close the window, session keeps running
|
|
41
|
+
ai-remote status | list | close [<host>]
|
|
42
|
+
ai-remote probe <host[:port]> is anything listening?
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Common Options
|
|
46
|
+
|
|
47
|
+
- `-u, --user NAME`: Account name on the host.
|
|
48
|
+
- `-d, --domain NAME`: Windows domain or computer name.
|
|
49
|
+
- `--ssh-user NAME`: Account for the SSH terminal (defaults to `--user`).
|
|
50
|
+
- `--ssh-port N`: SSH port (default: 22).
|
|
51
|
+
- `-s, --security MODE`: `auto` | `nla` | `tls` | `rdp` (default: `auto`).
|
|
52
|
+
- `-W, --width N` / `-H, --height N`: Desktop resolution (default: 1280x800).
|
|
53
|
+
- `-o, --out FILE`: Screenshot output file path (default: `screen.png`).
|
|
54
|
+
- `--headless` / `--no-view`: Run headless without opening the viewer window.
|
|
55
|
+
- `--json`: Output machine-readable JSON results on stdout.
|
|
56
|
+
|
|
57
|
+
---
|
|
28
58
|
|
|
29
|
-
## Installation
|
|
59
|
+
## 📦 Library Installation
|
|
30
60
|
|
|
31
61
|
```bash
|
|
32
62
|
pnpm add ai-remote
|
|
@@ -34,7 +64,7 @@ pnpm add ai-remote
|
|
|
34
64
|
npm install ai-remote
|
|
35
65
|
```
|
|
36
66
|
|
|
37
|
-
|
|
67
|
+
### Subpath Exports
|
|
38
68
|
|
|
39
69
|
| Export | Description |
|
|
40
70
|
|---|---|
|
|
@@ -45,6 +75,25 @@ npm install ai-remote
|
|
|
45
75
|
| `ai-remote/protocols/vnc` | VNC session and input management |
|
|
46
76
|
| `ai-remote/shared/*` | Direct access to shared models and utilities |
|
|
47
77
|
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## ✨ Features
|
|
81
|
+
|
|
82
|
+
- **RDP Protocol Engine:**
|
|
83
|
+
- Full X.224, MCS, and GCC capability negotiation.
|
|
84
|
+
- CredSSP v6 with NTLMv2 and TLS 1.2 client implementation over WebCrypto.
|
|
85
|
+
- Fast-path 16-bit interleaved RLE bitmap decoding.
|
|
86
|
+
- Shared clipboard support (`cliprdr` virtual channel).
|
|
87
|
+
- RemoteApp (RAIL) window orders and execution.
|
|
88
|
+
- **SSH Engine:**
|
|
89
|
+
- RFC 4253 binary packet protocol with `curve25519-sha256` / `ecdh-sha2-nistp256`.
|
|
90
|
+
- AEAD ciphers (`aes256-gcm@openssh.com`, `aes128-gcm@openssh.com`).
|
|
91
|
+
- Terminal interactive and automated agent command execution.
|
|
92
|
+
- **VNC Engine:**
|
|
93
|
+
- RFB protocol integration with Apple Diffie-Hellman handshake support.
|
|
94
|
+
- **AI Agent Automation:**
|
|
95
|
+
- Fast headless actions, structured screen capture, and auto-attached SSH shells.
|
|
96
|
+
|
|
48
97
|
## License
|
|
49
98
|
|
|
50
99
|
MIT © Leon Guo
|