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.
Files changed (48) hide show
  1. package/README.md +69 -20
  2. package/dist/cli.mjs +8073 -0
  3. package/dist/index.js +6 -6
  4. package/dist/protocols/index.js +2 -2
  5. package/dist/protocols/rdp/caps.js +1 -1
  6. package/dist/protocols/rdp/cert.js +1 -1
  7. package/dist/protocols/rdp/client.js +18 -16
  8. package/dist/protocols/rdp/client.js.map +2 -2
  9. package/dist/protocols/rdp/cliprdr.js +1 -1
  10. package/dist/protocols/rdp/credssp.js +2 -2
  11. package/dist/protocols/rdp/display.js +2 -2
  12. package/dist/protocols/rdp/gcc.js +2 -2
  13. package/dist/protocols/rdp/mcs.js +2 -2
  14. package/dist/protocols/rdp/ntlm.js +2 -2
  15. package/dist/protocols/rdp/pdu.js +1 -1
  16. package/dist/protocols/rdp/rail.js +1 -1
  17. package/dist/protocols/rdp/sec.js +3 -3
  18. package/dist/protocols/rdp/session.js +3 -3
  19. package/dist/protocols/rdp/tls.js +3 -3
  20. package/dist/protocols/rdp/vchannel.js +1 -1
  21. package/dist/protocols/rdp/x224.js +1 -1
  22. package/dist/protocols/ssh/kex.js +1 -1
  23. package/dist/protocols/ssh/session.js +4 -3
  24. package/dist/protocols/ssh/session.js.map +2 -2
  25. package/dist/protocols/ssh/transport.js +8 -6
  26. package/dist/protocols/ssh/transport.js.map +2 -2
  27. package/dist/protocols/vnc/session.js +3 -3
  28. package/dist/shared/connection.js +1 -1
  29. package/dist/shared/hosts.js +1 -1
  30. package/package.json +13 -3
  31. package/src/cli/cli.ts +452 -0
  32. package/src/cli/daemon.ts +295 -0
  33. package/src/cli/framebuffer.ts +115 -0
  34. package/src/cli/generated/viewer-bundle.ts +5 -0
  35. package/src/cli/ipc.ts +78 -0
  36. package/src/cli/paths.ts +28 -0
  37. package/src/cli/png.ts +106 -0
  38. package/src/cli/session.ts +263 -0
  39. package/src/cli/shell.ts +184 -0
  40. package/src/cli/transport.ts +86 -0
  41. package/src/cli/viewer-client/assets.d.ts +4 -0
  42. package/src/cli/viewer-client/main.ts +300 -0
  43. package/src/cli/viewer-page.ts +102 -0
  44. package/src/cli/viewer.ts +272 -0
  45. package/src/cli/wsserver.ts +144 -0
  46. package/src/protocols/rdp/client.ts +9 -1
  47. package/src/protocols/ssh/session.ts +1 -0
  48. 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 desktop vocabulary for AI agents, Node.js, and web browsers.
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
  [![npm version](https://img.shields.io/npm/v/ai-remote.svg)](https://www.npmjs.com/package/ai-remote)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
7
 
8
- ## Overview
8
+ ## 🚀 Quick Start (CLI)
9
9
 
10
- `ai-remote` is an environment-neutral core protocol library providing client-side implementations for **RDP**, **VNC**, and **SSH**. It powers browser-based remote gateways, terminal sessions, and automated AI agents driving remote desktops.
10
+ Run immediately with `npx` (zero install):
11
11
 
12
- ## Features
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
- - **RDP Engine:**
15
- - Complete X.224, MCS, and GCC capability negotiation.
16
- - CredSSP v6 with NTLMv2 and TLS 1.2 client implementation over WebCrypto.
17
- - Fast-path 16-bit interleaved RLE bitmap decoding.
18
- - Shared clipboard support (`cliprdr` virtual channel).
19
- - RemoteApp (RAIL) window orders and execution.
20
- - **SSH Engine:**
21
- - RFC 4253 binary packet protocol with `curve25519-sha256` / `ecdh-sha2-nistp256`.
22
- - AEAD ciphers (`aes256-gcm@openssh.com`, `aes128-gcm@openssh.com`).
23
- - Terminal interactive and agent command execution.
24
- - **VNC Engine:**
25
- - RFB protocol integration with Apple Diffie-Hellman handshake support.
26
- - **AI Agent Tool Vocabulary:**
27
- - Standardized connection, device, protocol, and signal definitions.
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
- ## Subpath Exports
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