ai-remote 0.4.17 → 0.5.0
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-DGHEB4P5.mjs → cli-chunk-F2TSY3YW.mjs} +33 -1
- package/dist/{cli-chunk-ZQ32C4LC.mjs → cli-chunk-OZG2CODR.mjs} +1 -1
- package/dist/{cli-daemon-4YPQAC5X.mjs → cli-daemon-3BBFQCML.mjs} +5 -5
- package/dist/{cli-window-H5VHVL4I.mjs → cli-window-ZKAXEHQV.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.
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
VERSION,
|
|
4
4
|
isTitlebarDragPoint,
|
|
5
5
|
logicalDisplaySize
|
|
6
|
-
} from "./cli-chunk-
|
|
6
|
+
} from "./cli-chunk-OZG2CODR.mjs";
|
|
7
7
|
|
|
8
8
|
// src/cli/window.ts
|
|
9
9
|
import { spawn } from "node:child_process";
|
|
@@ -412,6 +412,29 @@ async function runWindow(argv) {
|
|
|
412
412
|
} catch {
|
|
413
413
|
}
|
|
414
414
|
const webview = window.createWebview({ url, enableDevtools: false });
|
|
415
|
+
const SETTLE_MS = 400;
|
|
416
|
+
let reportedFullscreen = null;
|
|
417
|
+
let seen = null;
|
|
418
|
+
let seenSince = 0;
|
|
419
|
+
let publishing = !flags.fullscreen;
|
|
420
|
+
function publishFullscreen(force = false) {
|
|
421
|
+
if (!publishing) return;
|
|
422
|
+
const on = window.fullscreen !== null;
|
|
423
|
+
const now = Date.now();
|
|
424
|
+
if (on !== seen) {
|
|
425
|
+
seen = on;
|
|
426
|
+
seenSince = now;
|
|
427
|
+
}
|
|
428
|
+
if (!force && (on === reportedFullscreen || now - seenSince < SETTLE_MS)) return;
|
|
429
|
+
reportedFullscreen = on;
|
|
430
|
+
try {
|
|
431
|
+
webview.evaluateScript(`window.aiRemoteFullscreen && window.aiRemoteFullscreen(${on})`);
|
|
432
|
+
} catch {
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
window.on("resize", () => publishFullscreen());
|
|
436
|
+
webview.on("page-load-finished", () => publishFullscreen(true));
|
|
437
|
+
setInterval(() => publishFullscreen(), 150).unref();
|
|
415
438
|
const debugDrag = process.env.AI_REMOTE_DEBUG_DRAG === "1";
|
|
416
439
|
let pageDrag = null;
|
|
417
440
|
let dragPointer = null;
|
|
@@ -427,6 +450,14 @@ async function runWindow(argv) {
|
|
|
427
450
|
pageDrag = null;
|
|
428
451
|
return;
|
|
429
452
|
}
|
|
453
|
+
if (note.t === "fullscreen") {
|
|
454
|
+
try {
|
|
455
|
+
window.setFullscreen(window.fullscreen !== null ? void 0 : FullscreenType.Borderless);
|
|
456
|
+
} catch {
|
|
457
|
+
}
|
|
458
|
+
publishFullscreen();
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
430
461
|
if (typeof note.x !== "number" || typeof note.y !== "number") return;
|
|
431
462
|
if (note.t === "drag-start") {
|
|
432
463
|
if (window.fullscreen !== null) return;
|
|
@@ -468,6 +499,7 @@ async function runWindow(argv) {
|
|
|
468
499
|
window.setFullscreen(FullscreenType.Borderless);
|
|
469
500
|
} catch {
|
|
470
501
|
}
|
|
502
|
+
publishing = true;
|
|
471
503
|
}, 400);
|
|
472
504
|
}
|
|
473
505
|
await application.whenReady({ interval: 33 });
|