@phnx-labs/agents-cli 1.22.74 → 1.22.76
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/CHANGELOG.md +152 -0
- package/README.md +21 -9
- package/dist/bootstrap.js +7 -7
- package/dist/cli/command-registry.js +5 -0
- package/dist/commands/artifacts-setup.js +1 -1
- package/dist/commands/artifacts.js +1 -1
- package/dist/commands/auth.js +7 -1
- package/dist/commands/browser.js +104 -10
- package/dist/commands/commands.js +7 -6
- package/dist/commands/computer.d.ts +1 -0
- package/dist/commands/computer.js +26 -7
- package/dist/commands/config.js +27 -4
- package/dist/commands/cost.js +6 -4
- package/dist/commands/doctor.d.ts +6 -5
- package/dist/commands/doctor.js +32 -274
- package/dist/commands/exec.d.ts +2 -0
- package/dist/commands/exec.js +9 -2
- package/dist/commands/harness.d.ts +1 -0
- package/dist/commands/harness.js +11 -3
- package/dist/commands/hooks.js +7 -6
- package/dist/commands/mcp.js +7 -6
- package/dist/commands/memory.js +7 -7
- package/dist/commands/monitors.js +3 -2
- package/dist/commands/open.d.ts +25 -12
- package/dist/commands/open.js +24 -10
- package/dist/commands/permissions.js +7 -6
- package/dist/commands/plugins.js +21 -17
- package/dist/commands/route.js +33 -16
- package/dist/commands/rules.js +7 -12
- package/dist/commands/sessions-share.js +1 -1
- package/dist/commands/setup-watchdog.js +2 -2
- package/dist/commands/setup.js +22 -1
- package/dist/commands/share.js +26 -10
- package/dist/commands/skills.js +7 -6
- package/dist/commands/subagents.js +7 -6
- package/dist/commands/sync.js +81 -10
- package/dist/commands/view.js +4 -1
- package/dist/commands/watchdog.d.ts +1 -1
- package/dist/commands/watchdog.js +10 -10
- package/dist/commands/webhook.d.ts +4 -0
- package/dist/commands/webhook.js +22 -4
- package/dist/commands/workflows.js +7 -6
- package/dist/lib/account-registry.js +27 -6
- package/dist/lib/accounting/rotate.d.ts +3 -1
- package/dist/lib/accounting/rotate.js +8 -4
- package/dist/lib/auth-health.d.ts +2 -0
- package/dist/lib/auth-health.js +2 -0
- package/dist/lib/browser/chrome.d.ts +21 -0
- package/dist/lib/browser/chrome.js +60 -3
- package/dist/lib/browser/drivers/local.d.ts +21 -0
- package/dist/lib/browser/drivers/local.js +102 -9
- package/dist/lib/browser/profiles.d.ts +29 -1
- package/dist/lib/browser/profiles.js +50 -1
- package/dist/lib/browser/types.d.ts +18 -0
- package/dist/lib/computer/computer-rpc.d.ts +6 -1
- package/dist/lib/computer/computer-rpc.js +23 -3
- package/dist/lib/computer/des.d.ts +1 -0
- package/dist/lib/computer/des.js +114 -0
- package/dist/lib/computer/rfb-client.d.ts +53 -0
- package/dist/lib/computer/rfb-client.js +562 -0
- package/dist/lib/config-keys.d.ts +7 -2
- package/dist/lib/config-keys.js +17 -2
- package/dist/lib/daemon/auth-sync-service.js +3 -0
- package/dist/lib/daemon/daemon.js +17 -10
- package/dist/lib/daemon/session-summarizer-service.d.ts +24 -0
- package/dist/lib/daemon/session-summarizer-service.js +39 -0
- package/dist/lib/daemon/usage-sync-service.js +3 -0
- package/dist/lib/daemon-services.d.ts +1 -1
- package/dist/lib/daemon-services.js +5 -0
- package/dist/lib/daemon-ticks.d.ts +2 -2
- package/dist/lib/daemon-ticks.js +2 -1
- package/dist/lib/daemon-webhooks.js +15 -2
- package/dist/lib/deeplink/register.js +10 -9
- package/dist/lib/deeplink/url.d.ts +4 -4
- package/dist/lib/deeplink/url.js +4 -4
- package/dist/lib/device-config.js +25 -0
- package/dist/lib/devices/doctor-findings.d.ts +4 -4
- package/dist/lib/devices/doctor-findings.js +14 -8
- package/dist/lib/devices/registry.js +2 -0
- package/dist/lib/devices/stats-cache.d.ts +4 -0
- package/dist/lib/devices/stats-cache.js +19 -0
- package/dist/lib/drift-sync.d.ts +3 -1
- package/dist/lib/drift-sync.js +16 -5
- package/dist/lib/exec.d.ts +2 -0
- package/dist/lib/exec.js +16 -1
- package/dist/lib/fleet-shared-repo-sync.d.ts +12 -0
- package/dist/lib/fleet-shared-repo-sync.js +101 -4
- package/dist/lib/fleet-shared-state.d.ts +8 -0
- package/dist/lib/heal.d.ts +4 -3
- package/dist/lib/heal.js +5 -4
- package/dist/lib/hosts/ready.d.ts +1 -1
- package/dist/lib/hosts/ready.js +16 -4
- package/dist/lib/hosts/reconnect.js +4 -2
- package/dist/lib/identity/client.d.ts +6 -0
- package/dist/lib/identity/index.d.ts +16 -0
- package/dist/lib/identity/index.js +25 -1
- package/dist/lib/profiles.d.ts +2 -0
- package/dist/lib/profiles.js +28 -9
- package/dist/lib/reconcile-and-repair.d.ts +109 -0
- package/dist/lib/reconcile-and-repair.js +267 -0
- package/dist/lib/routers.d.ts +12 -1
- package/dist/lib/routers.js +30 -1
- package/dist/lib/scheduling/routines.js +8 -2
- package/dist/lib/session/active.d.ts +13 -0
- package/dist/lib/session/db.d.ts +47 -7
- package/dist/lib/session/db.js +114 -12
- package/dist/lib/session/mirror.js +58 -0
- package/dist/lib/session/remote/remote-list.d.ts +2 -0
- package/dist/lib/session/remote/remote-list.js +4 -0
- package/dist/lib/session/remote/watch.js +22 -2
- package/dist/lib/session/session-cache.d.ts +19 -0
- package/dist/lib/session/session-cache.js +46 -0
- package/dist/lib/session/types.d.ts +34 -0
- package/dist/lib/share/backend.d.ts +6 -4
- package/dist/lib/share/backend.js +10 -8
- package/dist/lib/share/config.d.ts +4 -3
- package/dist/lib/share/config.js +10 -1
- package/dist/lib/share/delete.d.ts +1 -1
- package/dist/lib/share/delete.js +1 -1
- package/dist/lib/share/html.d.ts +1 -1
- package/dist/lib/share/html.js +1 -1
- package/dist/lib/share/provision.d.ts +1 -1
- package/dist/lib/share/provision.js +2 -2
- package/dist/lib/share/publish.d.ts +23 -7
- package/dist/lib/share/publish.js +58 -12
- package/dist/lib/share/worker-template.js +221 -60
- package/dist/lib/startup/command-registry.js +2 -2
- package/dist/lib/state.d.ts +15 -0
- package/dist/lib/state.js +29 -7
- package/dist/lib/summarizer/config.d.ts +46 -0
- package/dist/lib/summarizer/config.js +83 -0
- package/dist/lib/summarizer/pass.d.ts +45 -0
- package/dist/lib/summarizer/pass.js +112 -0
- package/dist/lib/summarizer/summarize.d.ts +68 -0
- package/dist/lib/summarizer/summarize.js +120 -0
- package/dist/lib/teams/agents.d.ts +4 -3
- package/dist/lib/teams/agents.js +12 -4
- package/dist/lib/teams/scheduler.d.ts +4 -2
- package/dist/lib/teams/scheduler.js +6 -6
- package/dist/lib/tmux/session.d.ts +2 -0
- package/dist/lib/tmux/session.js +7 -1
- package/dist/lib/types.d.ts +20 -0
- package/dist/lib/verbs.d.ts +23 -0
- package/dist/lib/verbs.js +24 -0
- package/dist/lib/view-types.d.ts +4 -0
- package/dist/lib/watchdog/rotate.d.ts +1 -1
- package/dist/lib/watchdog/rotate.js +1 -1
- package/package.json +1 -1
|
@@ -17,6 +17,7 @@ import * as fs from 'fs';
|
|
|
17
17
|
import * as path from 'path';
|
|
18
18
|
import { fileURLToPath } from 'url';
|
|
19
19
|
import { getHelpersDir, getLogsDir, getUserPermissionsDir, getPermissionsDir } from '../state.js';
|
|
20
|
+
import { RfbClient, parseVncEndpoint } from './rfb-client.js';
|
|
20
21
|
// Resolve the socket path used by the launchd-managed daemon. Internal
|
|
21
22
|
// scratch — lives under getHelpersDir() (~/.agents/.cache/helpers/),
|
|
22
23
|
// matching browser.sock.
|
|
@@ -209,11 +210,28 @@ export function resolveTcpEndpoint() {
|
|
|
209
210
|
const token = process.env.COMPUTER_HELPER_TOKEN;
|
|
210
211
|
return { host: hostPart || '127.0.0.1', port, token: token && token.length > 0 ? token : null };
|
|
211
212
|
}
|
|
213
|
+
// Resolve the VNC/RFB endpoint for driving a remote GUI desktop over the RFB
|
|
214
|
+
// protocol (an x11vnc/Xvnc server — e.g. a headless Linux desktop or an LXD
|
|
215
|
+
// container exposing x11vnc on the host's Tailscale IP). COMPUTER_HELPER_VNC is
|
|
216
|
+
// "host:port" (port defaults to 5901); COMPUTER_HELPER_VNC_PASSWORD is the VNC
|
|
217
|
+
// password. Unlike the native helpers this transport carries a framebuffer, not
|
|
218
|
+
// an accessibility tree, so it is coordinate-based (see rfb-client.ts).
|
|
219
|
+
export function resolveVncEndpoint() {
|
|
220
|
+
const parsed = parseVncEndpoint(process.env.COMPUTER_HELPER_VNC);
|
|
221
|
+
if (!parsed)
|
|
222
|
+
return null;
|
|
223
|
+
return { ...parsed, password: process.env.COMPUTER_HELPER_VNC_PASSWORD ?? '' };
|
|
224
|
+
}
|
|
212
225
|
// Pick the best transport. Precedence:
|
|
213
|
-
// 1.
|
|
214
|
-
// 2. the
|
|
215
|
-
// 3.
|
|
226
|
+
// 1. COMPUTER_HELPER_VNC -> an RFB/VNC desktop (Linux GUI over the wire).
|
|
227
|
+
// 2. COMPUTER_HELPER_TCP -> the Windows daemon over a (tunneled) TCP port.
|
|
228
|
+
// 3. the macOS launchd socket if it exists.
|
|
229
|
+
// 4. spawning the helper as a subprocess (legacy/dev fallback).
|
|
216
230
|
export function openComputerClient() {
|
|
231
|
+
const vnc = resolveVncEndpoint();
|
|
232
|
+
if (vnc) {
|
|
233
|
+
return new RfbClient(vnc.host, vnc.port, vnc.password);
|
|
234
|
+
}
|
|
217
235
|
const tcp = resolveTcpEndpoint();
|
|
218
236
|
if (tcp) {
|
|
219
237
|
return new TcpClient(tcp.host, tcp.port, tcp.token);
|
|
@@ -415,6 +433,8 @@ class StdioClient extends BaseClient {
|
|
|
415
433
|
// .app) must not be told "no transport". `path` is null: the endpoint is an
|
|
416
434
|
// env-configured host:port, not an on-disk path.
|
|
417
435
|
export function describeTransport() {
|
|
436
|
+
if (resolveVncEndpoint())
|
|
437
|
+
return { kind: 'vnc', path: null };
|
|
418
438
|
if (resolveTcpEndpoint())
|
|
419
439
|
return { kind: 'tcp', path: null };
|
|
420
440
|
const sockPath = resolveSocketPath();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function desEncryptBlock(key8: Buffer, block8: Buffer): Buffer;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Minimal, dependency-free single-block DES (ECB) — used only for VNC
|
|
2
|
+
// authentication's challenge/response. Node 24 ships OpenSSL 3, whose DES lives
|
|
3
|
+
// in the legacy provider that is off by default, so `createCipheriv('des-ecb')`
|
|
4
|
+
// throws `digital envelope routines::unsupported`. VNC clients have always
|
|
5
|
+
// bundled their own DES for exactly this reason. This is a textbook FIPS-46 DES
|
|
6
|
+
// implementation over bit arrays — verified against the standard test vector in
|
|
7
|
+
// des.test.ts. It encrypts one 8-byte block; VNC auth encrypts the two halves
|
|
8
|
+
// of the 16-byte challenge independently (see rfb-client.ts).
|
|
9
|
+
const IP = [
|
|
10
|
+
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
|
|
11
|
+
62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
|
|
12
|
+
57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3,
|
|
13
|
+
61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7,
|
|
14
|
+
];
|
|
15
|
+
const FP = [
|
|
16
|
+
40, 8, 48, 16, 56, 24, 64, 32, 39, 7, 47, 15, 55, 23, 63, 31,
|
|
17
|
+
38, 6, 46, 14, 54, 22, 62, 30, 37, 5, 45, 13, 53, 21, 61, 29,
|
|
18
|
+
36, 4, 44, 12, 52, 20, 60, 28, 35, 3, 43, 11, 51, 19, 59, 27,
|
|
19
|
+
34, 2, 42, 10, 50, 18, 58, 26, 33, 1, 41, 9, 49, 17, 57, 25,
|
|
20
|
+
];
|
|
21
|
+
const E = [
|
|
22
|
+
32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, 8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17,
|
|
23
|
+
16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25, 24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1,
|
|
24
|
+
];
|
|
25
|
+
const P = [
|
|
26
|
+
16, 7, 20, 21, 29, 12, 28, 17, 1, 15, 23, 26, 5, 18, 31, 10,
|
|
27
|
+
2, 8, 24, 14, 32, 27, 3, 9, 19, 13, 30, 6, 22, 11, 4, 25,
|
|
28
|
+
];
|
|
29
|
+
const PC1 = [
|
|
30
|
+
57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36,
|
|
31
|
+
63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4,
|
|
32
|
+
];
|
|
33
|
+
const PC2 = [
|
|
34
|
+
14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2,
|
|
35
|
+
41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32,
|
|
36
|
+
];
|
|
37
|
+
const SHIFTS = [1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1];
|
|
38
|
+
const SBOX = [
|
|
39
|
+
[14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7, 0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8, 4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0, 15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13],
|
|
40
|
+
[15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10, 3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5, 0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15, 13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9],
|
|
41
|
+
[10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1, 13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7, 1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12],
|
|
42
|
+
[7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15, 13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9, 10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4, 3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14],
|
|
43
|
+
[2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9, 14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6, 4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14, 11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3],
|
|
44
|
+
[12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11, 10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8, 9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6, 4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13],
|
|
45
|
+
[4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1, 13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6, 1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2, 6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12],
|
|
46
|
+
[13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7, 1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2, 7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8, 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11],
|
|
47
|
+
];
|
|
48
|
+
function bytesToBits(buf) {
|
|
49
|
+
const bits = [];
|
|
50
|
+
for (let i = 0; i < buf.length; i++) {
|
|
51
|
+
for (let b = 7; b >= 0; b--)
|
|
52
|
+
bits.push((buf[i] >> b) & 1);
|
|
53
|
+
}
|
|
54
|
+
return bits;
|
|
55
|
+
}
|
|
56
|
+
function bitsToBytes(bits) {
|
|
57
|
+
const out = Buffer.alloc(bits.length / 8);
|
|
58
|
+
for (let i = 0; i < out.length; i++) {
|
|
59
|
+
let byte = 0;
|
|
60
|
+
for (let b = 0; b < 8; b++)
|
|
61
|
+
byte = (byte << 1) | bits[i * 8 + b];
|
|
62
|
+
out[i] = byte;
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
function permute(bits, table) {
|
|
67
|
+
return table.map((pos) => bits[pos - 1]);
|
|
68
|
+
}
|
|
69
|
+
function keySchedule(key8) {
|
|
70
|
+
const keyBits = bytesToBits(key8);
|
|
71
|
+
const pc1 = permute(keyBits, PC1);
|
|
72
|
+
let c = pc1.slice(0, 28);
|
|
73
|
+
let d = pc1.slice(28, 56);
|
|
74
|
+
const subkeys = [];
|
|
75
|
+
for (let round = 0; round < 16; round++) {
|
|
76
|
+
const s = SHIFTS[round];
|
|
77
|
+
c = c.slice(s).concat(c.slice(0, s));
|
|
78
|
+
d = d.slice(s).concat(d.slice(0, s));
|
|
79
|
+
subkeys.push(permute(c.concat(d), PC2));
|
|
80
|
+
}
|
|
81
|
+
return subkeys;
|
|
82
|
+
}
|
|
83
|
+
function feistel(r, subkey) {
|
|
84
|
+
const expanded = permute(r, E);
|
|
85
|
+
const xored = expanded.map((bit, i) => bit ^ subkey[i]);
|
|
86
|
+
const out = [];
|
|
87
|
+
for (let box = 0; box < 8; box++) {
|
|
88
|
+
const chunk = xored.slice(box * 6, box * 6 + 6);
|
|
89
|
+
const row = (chunk[0] << 1) | chunk[5];
|
|
90
|
+
const col = (chunk[1] << 3) | (chunk[2] << 2) | (chunk[3] << 1) | chunk[4];
|
|
91
|
+
const val = SBOX[box][row * 16 + col];
|
|
92
|
+
for (let b = 3; b >= 0; b--)
|
|
93
|
+
out.push((val >> b) & 1);
|
|
94
|
+
}
|
|
95
|
+
return permute(out, P);
|
|
96
|
+
}
|
|
97
|
+
// Encrypt one 8-byte block with DES-ECB under an 8-byte key.
|
|
98
|
+
export function desEncryptBlock(key8, block8) {
|
|
99
|
+
if (key8.length !== 8)
|
|
100
|
+
throw new Error(`des key must be 8 bytes, got ${key8.length}`);
|
|
101
|
+
if (block8.length !== 8)
|
|
102
|
+
throw new Error(`des block must be 8 bytes, got ${block8.length}`);
|
|
103
|
+
const subkeys = keySchedule(key8);
|
|
104
|
+
const bits = permute(bytesToBits(block8), IP);
|
|
105
|
+
let l = bits.slice(0, 32);
|
|
106
|
+
let r = bits.slice(32, 64);
|
|
107
|
+
for (let round = 0; round < 16; round++) {
|
|
108
|
+
const f = feistel(r, subkeys[round]);
|
|
109
|
+
const next = l.map((bit, i) => bit ^ f[i]);
|
|
110
|
+
l = r;
|
|
111
|
+
r = next;
|
|
112
|
+
}
|
|
113
|
+
return bitsToBytes(permute(r.concat(l), FP));
|
|
114
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ComputerClient, RPCResponse } from './computer-rpc.js';
|
|
2
|
+
export declare function mirrorByte(b: number): number;
|
|
3
|
+
export declare function vncAuthResponse(challenge: Buffer, password: string): Buffer;
|
|
4
|
+
export declare function buildPixelFormat(): Buffer;
|
|
5
|
+
export declare function encodeSetPixelFormat(pf: Buffer): Buffer;
|
|
6
|
+
export declare function encodeSetEncodings(encodings: number[]): Buffer;
|
|
7
|
+
export declare function encodeFbUpdateRequest(incremental: boolean, x: number, y: number, w: number, h: number): Buffer;
|
|
8
|
+
export declare function encodePointerEvent(buttonMask: number, x: number, y: number): Buffer;
|
|
9
|
+
export declare function encodeKeyEvent(down: boolean, keysym: number): Buffer;
|
|
10
|
+
export declare function keysymForChar(ch: string): number;
|
|
11
|
+
export declare function keysymForKeyName(name: string): number | null;
|
|
12
|
+
export declare function parseKeyCombo(combo: string): {
|
|
13
|
+
modifiers: number[];
|
|
14
|
+
key: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function encodePng(rgb: Buffer, width: number, height: number): Buffer;
|
|
17
|
+
export interface ServerInit {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
name: string;
|
|
21
|
+
}
|
|
22
|
+
export declare function scrollButtonsFor(dx: number, dy: number): {
|
|
23
|
+
vButton: number;
|
|
24
|
+
hButton: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const MAX_RFB_STRING_LEN: number;
|
|
27
|
+
export declare function parseVncEndpoint(raw: string | undefined): {
|
|
28
|
+
host: string;
|
|
29
|
+
port: number;
|
|
30
|
+
} | null;
|
|
31
|
+
export declare class RfbClient implements ComputerClient {
|
|
32
|
+
private host;
|
|
33
|
+
private port;
|
|
34
|
+
private password;
|
|
35
|
+
private sock;
|
|
36
|
+
private reader;
|
|
37
|
+
private ready;
|
|
38
|
+
private info;
|
|
39
|
+
private closed;
|
|
40
|
+
constructor(host: string, port: number, password: string);
|
|
41
|
+
private write;
|
|
42
|
+
private readLenString;
|
|
43
|
+
private handshake;
|
|
44
|
+
private teardown;
|
|
45
|
+
private withTimeout;
|
|
46
|
+
private captureScreen;
|
|
47
|
+
private sendClick;
|
|
48
|
+
private sendScroll;
|
|
49
|
+
private typeText;
|
|
50
|
+
private pressCombo;
|
|
51
|
+
call(method: string, params?: Record<string, unknown>): Promise<RPCResponse>;
|
|
52
|
+
close(): Promise<void>;
|
|
53
|
+
}
|