ai-remote 0.4.17 → 0.4.18
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 +4 -4
- package/SKILL.md +12 -14
- package/dist/{cli-chunk-ZQ32C4LC.mjs → cli-chunk-R2ZEHRBG.mjs} +1 -1
- package/dist/{cli-chunk-DGHEB4P5.mjs → cli-chunk-SGEG6DMQ.mjs} +1 -1
- package/dist/{cli-daemon-4YPQAC5X.mjs → cli-daemon-6XQDFK3P.mjs} +4 -4
- package/dist/{cli-window-H5VHVL4I.mjs → cli-window-B6ICRJVI.mjs} +2 -2
- package/dist/cli.mjs +9 -12
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -91,10 +91,10 @@ Silencing them is a choice made where the command is run:
|
|
|
91
91
|
npx --silent ai-remote list # this invocation only
|
|
92
92
|
NPM_CONFIG_LOGLEVEL=error npx ... # this shell only
|
|
93
93
|
npm config set loglevel error # this machine, all npm commands
|
|
94
|
-
npm install -g ai-remote # no npm in the path at all; use `
|
|
94
|
+
npm install -g ai-remote # no npm in the path at all; use `ai-remote`
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
The last one also skips the 300 ms: `
|
|
97
|
+
The last one also skips the 300 ms: `ai-remote list` answers in about 27 ms. It
|
|
98
98
|
is a per-machine decision rather than something the package can carry, which is
|
|
99
99
|
why `npx` is still what the examples here use.
|
|
100
100
|
|
|
@@ -439,8 +439,8 @@ where a decrypted key belongs, and it is offered from there.
|
|
|
439
439
|
- `--max-edge N`: Shrink a screenshot to fit N.
|
|
440
440
|
- `--json`: Output machine-readable JSON results on stdout.
|
|
441
441
|
|
|
442
|
-
The password, where one is wanted, comes from `AI_REMOTE_PASSWORD
|
|
443
|
-
|
|
442
|
+
The password, where one is wanted, comes from `AI_REMOTE_PASSWORD`. There is no
|
|
443
|
+
`--password` flag: a command line is visible
|
|
444
444
|
to every process on the machine.
|
|
445
445
|
|
|
446
446
|
---
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ai-remote
|
|
3
|
-
description: Drive a remote Windows, Linux or macOS desktop from the command line with `npx ai-remote`
|
|
3
|
+
description: Drive a remote Windows, Linux or macOS desktop from the command line with `npx ai-remote` — open one session, then screenshot it, click, type, press keys, run shell commands over SSH, and watch it in a window. Use this skill whenever the user wants to control, inspect, automate or screenshot a machine over RDP/VNC/SSH — including when they never name the tool and just say "click the button on that Windows box", "what's on the screen of 192.168.x.x", "log into the VM and run this", or "take a screenshot of the remote desktop".
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Driving a remote desktop with ai-remote
|
|
@@ -286,8 +286,7 @@ agent.
|
|
|
286
286
|
A desktop always wants one; a terminal usually does not, because of the keys
|
|
287
287
|
above. Three places are tried, in this order:
|
|
288
288
|
|
|
289
|
-
1. `AI_REMOTE_PASSWORD` in this shell
|
|
290
|
-
name.
|
|
289
|
+
1. `AI_REMOTE_PASSWORD` in this shell.
|
|
291
290
|
2. Whatever `--save` kept for that machine.
|
|
292
291
|
3. You, at the terminal — only when one is attached, and only after the first
|
|
293
292
|
two have come up empty.
|
|
@@ -453,19 +452,18 @@ Every command takes `--session NAME` to pick between open sessions, and `--json`
|
|
|
453
452
|
for machine-readable output. `ai-remote --help` is the authority; this file is
|
|
454
453
|
the map.
|
|
455
454
|
|
|
456
|
-
## Working
|
|
455
|
+
## Working with the installed package
|
|
457
456
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
457
|
+
The published package does not include its TypeScript source tree. The CLI and
|
|
458
|
+
its internal modules are bundled into `dist`, so paths such as
|
|
459
|
+
`packages/core/src/cli/cli.ts` will not exist in an installed copy. Use the
|
|
460
|
+
public command when driving a machine:
|
|
461
461
|
|
|
462
462
|
```bash
|
|
463
|
-
|
|
464
|
-
node packages/core/dist/cli.mjs open HOST -u USER --headless
|
|
463
|
+
npx ai-remote open HOST -u USER --headless
|
|
465
464
|
```
|
|
466
465
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
`viewer.ts` plus `window.ts` are the window. `pnpm test` covers them.
|
|
466
|
+
Do not edit or import files under `dist`; they are generated implementation
|
|
467
|
+
artifacts, not public entry points. To change ai-remote itself, work from a
|
|
468
|
+
source checkout, rebuild the package there, and test the generated CLI before
|
|
469
|
+
publishing a new version.
|
|
@@ -7,13 +7,13 @@ import {
|
|
|
7
7
|
downscale,
|
|
8
8
|
encodePng,
|
|
9
9
|
openWindow
|
|
10
|
-
} from "./cli-chunk-
|
|
10
|
+
} from "./cli-chunk-SGEG6DMQ.mjs";
|
|
11
11
|
import {
|
|
12
12
|
SIDE_PANEL_WIDTH,
|
|
13
13
|
ensureRunDir,
|
|
14
14
|
metaPath,
|
|
15
15
|
socketPath
|
|
16
|
-
} from "./cli-chunk-
|
|
16
|
+
} from "./cli-chunk-R2ZEHRBG.mjs";
|
|
17
17
|
import {
|
|
18
18
|
Shell,
|
|
19
19
|
bareUsername
|
|
@@ -7555,7 +7555,7 @@ var WebSocketPeer = class extends EventTarget {
|
|
|
7555
7555
|
this.dispatchEvent(new Event("close"));
|
|
7556
7556
|
}
|
|
7557
7557
|
#onData(chunk) {
|
|
7558
|
-
if (process.env.
|
|
7558
|
+
if (process.env.AI_REMOTE_DEBUG) console.log("[ws] data", chunk.length, "bytes");
|
|
7559
7559
|
this.#buffer = Buffer.concat([this.#buffer, chunk]);
|
|
7560
7560
|
for (; ; ) {
|
|
7561
7561
|
const parsed = readFrame(this.#buffer);
|
|
@@ -7975,7 +7975,7 @@ async function startViewer(session, port, {
|
|
|
7975
7975
|
if (clipboard) void clipboard.state().then((state) => sendClipboard(state, peer));
|
|
7976
7976
|
peer.addEventListener("message", (event) => {
|
|
7977
7977
|
const raw = event.data;
|
|
7978
|
-
if (process.env.
|
|
7978
|
+
if (process.env.AI_REMOTE_DEBUG) console.log("[viewer] <-", raw);
|
|
7979
7979
|
try {
|
|
7980
7980
|
const message = JSON.parse(raw);
|
|
7981
7981
|
if (message.type === "control") {
|
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
openWindow,
|
|
5
5
|
readCurrentDisplaySize,
|
|
6
6
|
runWindow
|
|
7
|
-
} from "./cli-chunk-
|
|
8
|
-
import "./cli-chunk-
|
|
7
|
+
} from "./cli-chunk-SGEG6DMQ.mjs";
|
|
8
|
+
import "./cli-chunk-R2ZEHRBG.mjs";
|
|
9
9
|
export {
|
|
10
10
|
detectCurrentDisplaySize,
|
|
11
11
|
nativeWindowAvailable,
|
package/dist/cli.mjs
CHANGED
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
metaPath,
|
|
14
14
|
sessionName,
|
|
15
15
|
socketPath
|
|
16
|
-
} from "./cli-chunk-
|
|
16
|
+
} from "./cli-chunk-R2ZEHRBG.mjs";
|
|
17
17
|
|
|
18
18
|
// src/cli/cli.ts
|
|
19
|
-
import {
|
|
19
|
+
import { resolve as resolvePath } from "node:path";
|
|
20
20
|
import { readFileSync as readFileSync2, openSync } from "node:fs";
|
|
21
21
|
|
|
22
22
|
// src/cli/prompt.ts
|
|
@@ -150,10 +150,7 @@ function readLog(name) {
|
|
|
150
150
|
return "";
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
var NAME =
|
|
154
|
-
const invoked = basename(process.argv[1] ?? "").replace(/\.mjs$/, "");
|
|
155
|
-
return invoked === "ai-remote" || invoked === "remotectl" ? invoked : "ai-remote";
|
|
156
|
-
})();
|
|
153
|
+
var NAME = "ai-remote";
|
|
157
154
|
var USAGE = `${NAME} -- drive a remote desktop, with a window you can watch
|
|
158
155
|
|
|
159
156
|
One command names the machine:
|
|
@@ -250,7 +247,7 @@ Signing in
|
|
|
250
247
|
read if they have no passphrase. A desktop -- RDP or VNC -- has no such thing
|
|
251
248
|
and always wants a password.
|
|
252
249
|
|
|
253
|
-
The password comes from AI_REMOTE_PASSWORD
|
|
250
|
+
The password comes from AI_REMOTE_PASSWORD, then from
|
|
254
251
|
whatever --save kept for that machine, and last from asking you -- once the
|
|
255
252
|
ways that need no asking have been tried, and only when a terminal is there to
|
|
256
253
|
be asked. There is no --password flag: a command line is visible to every
|
|
@@ -338,7 +335,7 @@ var CliError = class extends Error {
|
|
|
338
335
|
}
|
|
339
336
|
code;
|
|
340
337
|
};
|
|
341
|
-
var password = () => process.env.AI_REMOTE_PASSWORD ??
|
|
338
|
+
var password = () => process.env.AI_REMOTE_PASSWORD ?? "";
|
|
342
339
|
function splitKey(key) {
|
|
343
340
|
const at = key.lastIndexOf("@");
|
|
344
341
|
return at === -1 ? ["", key] : [key.slice(0, at), key.slice(at + 1)];
|
|
@@ -439,7 +436,7 @@ async function startSession(args, name, host, port, secret) {
|
|
|
439
436
|
const explicitHeight = flag(args, "H", "height");
|
|
440
437
|
let fullscreenSize = null;
|
|
441
438
|
if (mode === "rdp" && has(args, "fullscreen") && (!explicitWidth || !explicitHeight)) {
|
|
442
|
-
const { detectCurrentDisplaySize } = await import("./cli-window-
|
|
439
|
+
const { detectCurrentDisplaySize } = await import("./cli-window-B6ICRJVI.mjs");
|
|
443
440
|
const display = await detectCurrentDisplaySize();
|
|
444
441
|
if (display) fullscreenSize = fullscreenRdpSize(display, has(args, "side-panel"));
|
|
445
442
|
}
|
|
@@ -562,7 +559,7 @@ async function main() {
|
|
|
562
559
|
}
|
|
563
560
|
const json = has(args, "json");
|
|
564
561
|
if (args.command === "__display-size") {
|
|
565
|
-
const { readCurrentDisplaySize } = await import("./cli-window-
|
|
562
|
+
const { readCurrentDisplaySize } = await import("./cli-window-B6ICRJVI.mjs");
|
|
566
563
|
const size = await readCurrentDisplaySize();
|
|
567
564
|
if (size) process.stdout.write(`${JSON.stringify(size)}
|
|
568
565
|
`);
|
|
@@ -571,7 +568,7 @@ async function main() {
|
|
|
571
568
|
if (args.command === "__session") {
|
|
572
569
|
const mode = modeFor(args, args.rest[0]);
|
|
573
570
|
const { host, port } = splitTarget(args.rest[0] ?? "", defaultPort(mode));
|
|
574
|
-
const { runDaemon } = await import("./cli-daemon-
|
|
571
|
+
const { runDaemon } = await import("./cli-daemon-6XQDFK3P.mjs");
|
|
575
572
|
await runDaemon({
|
|
576
573
|
name: sessionName(host, port, flag(args, "name", "session")),
|
|
577
574
|
host,
|
|
@@ -604,7 +601,7 @@ async function main() {
|
|
|
604
601
|
return;
|
|
605
602
|
}
|
|
606
603
|
if (args.command === "__window") {
|
|
607
|
-
const { runWindow } = await import("./cli-window-
|
|
604
|
+
const { runWindow } = await import("./cli-window-B6ICRJVI.mjs");
|
|
608
605
|
await runWindow(process.argv.slice(3));
|
|
609
606
|
return;
|
|
610
607
|
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-remote",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.18",
|
|
4
4
|
"description": "RDP, VNC and SSH protocol engines that run in Node, a Worker or a browser -- plus `npx ai-remote`, a CLI that drives a machine and shows you what it is doing",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ai-remote": "dist/cli.mjs"
|
|
8
|
-
"remotectl": "dist/cli.mjs"
|
|
7
|
+
"ai-remote": "dist/cli.mjs"
|
|
9
8
|
},
|
|
10
9
|
"license": "MIT",
|
|
11
10
|
"author": {
|