@livedesk/client 0.1.2 → 0.1.3
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 +12 -10
- package/bin/livedesk-client.js +32 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
Run a direct LiveDesk remote client from a controlled computer.
|
|
4
4
|
|
|
5
5
|
```powershell
|
|
6
|
-
npx @livedesk/client
|
|
6
|
+
npx @livedesk/client
|
|
7
|
+
npx @livedesk/client 3
|
|
7
8
|
```
|
|
8
9
|
|
|
9
10
|
The default flow opens Google sign-in, finds the active LiveDesk manager
|
|
10
|
-
published by the same account, and
|
|
11
|
-
machine
|
|
11
|
+
published by the same account, and connects locally. Omit the number for
|
|
12
|
+
first-available placement, or pass `1` to `99` to pin this machine to a screen
|
|
13
|
+
wall slot.
|
|
12
14
|
|
|
13
15
|
On the manager computer, open the LiveDesk dashboard and sign in first. The
|
|
14
16
|
dashboard keeps its local hub address and private pair token refreshed in the
|
|
@@ -22,7 +24,7 @@ $env:REMOTE_HUB_HOST="0.0.0.0"
|
|
|
22
24
|
$env:REMOTE_HUB_PORT="5197"
|
|
23
25
|
npm run dev:hub
|
|
24
26
|
|
|
25
|
-
npx @livedesk/client
|
|
27
|
+
npx @livedesk/client --no-login --manager 192.168.0.10:5197 --pair <strong-token> --slot 2
|
|
26
28
|
```
|
|
27
29
|
|
|
28
30
|
The client registers the device, sends status heartbeats, can return
|
|
@@ -36,10 +38,10 @@ is unavailable.
|
|
|
36
38
|
Useful flags:
|
|
37
39
|
|
|
38
40
|
```powershell
|
|
39
|
-
npx @livedesk/client
|
|
40
|
-
npx @livedesk/client
|
|
41
|
-
npx @livedesk/client
|
|
42
|
-
npx @livedesk/client
|
|
43
|
-
npx @livedesk/client
|
|
44
|
-
npx @livedesk/client
|
|
41
|
+
npx @livedesk/client 3
|
|
42
|
+
npx @livedesk/client --no-thumbnail
|
|
43
|
+
npx @livedesk/client --no-live
|
|
44
|
+
npx @livedesk/client --engine node
|
|
45
|
+
npx @livedesk/client --engine fast --trace-frames
|
|
46
|
+
npx @livedesk/client --logout
|
|
45
47
|
```
|
package/bin/livedesk-client.js
CHANGED
|
@@ -7,7 +7,6 @@ import { spawn, spawnSync } from 'node:child_process';
|
|
|
7
7
|
import { createServer } from 'node:http';
|
|
8
8
|
import net from 'node:net';
|
|
9
9
|
import os from 'node:os';
|
|
10
|
-
import { createInterface } from 'node:readline/promises';
|
|
11
10
|
|
|
12
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
12
|
const packageRoot = resolve(__dirname, '..');
|
|
@@ -25,11 +24,12 @@ function printHelp() {
|
|
|
25
24
|
LiveDesk Client
|
|
26
25
|
|
|
27
26
|
Usage:
|
|
28
|
-
npx @livedesk/client
|
|
27
|
+
npx @livedesk/client
|
|
28
|
+
npx @livedesk/client 3
|
|
29
29
|
|
|
30
30
|
Default flow:
|
|
31
|
-
Opens Google sign-in, finds the signed-in manager,
|
|
32
|
-
|
|
31
|
+
Opens Google sign-in, finds the signed-in manager, and connects locally.
|
|
32
|
+
Omit the number for first-available placement, or pass 1-99 to pin a slot.
|
|
33
33
|
|
|
34
34
|
Options:
|
|
35
35
|
--slot <number> Screen wall slot number for this computer.
|
|
@@ -51,7 +51,7 @@ Options:
|
|
|
51
51
|
--help Show this help.
|
|
52
52
|
|
|
53
53
|
Manual fallback:
|
|
54
|
-
npx @livedesk/client
|
|
54
|
+
npx @livedesk/client --no-login --manager 192.168.0.10:5197 --pair <token> --slot 2
|
|
55
55
|
|
|
56
56
|
Auto uses C# RemoteFast when supported and falls back to Node for AI assist or
|
|
57
57
|
when a packaged RemoteFast runtime is unavailable.
|
|
@@ -76,6 +76,7 @@ function parseLauncherArgs(argv) {
|
|
|
76
76
|
let loginRequested = false;
|
|
77
77
|
let loginDisabled = false;
|
|
78
78
|
let logout = false;
|
|
79
|
+
let version = false;
|
|
79
80
|
let manager = process.env.LIVEDESK_CLIENT_MANAGER || process.env.MINDEXEC_REMOTE_MANAGER || '';
|
|
80
81
|
let pair = process.env.LIVEDESK_CLIENT_PAIR_TOKEN || process.env.MINDEXEC_REMOTE_PAIR_TOKEN || '';
|
|
81
82
|
let slot = process.env.LIVEDESK_CLIENT_SLOT || process.env.MINDEXEC_REMOTE_SLOT || '';
|
|
@@ -83,14 +84,23 @@ function parseLauncherArgs(argv) {
|
|
|
83
84
|
let nodeOnlyFeature = false;
|
|
84
85
|
let fakeThumbnail = false;
|
|
85
86
|
|
|
86
|
-
const args = [...argv];
|
|
87
|
-
if (args[0] && !args[0].startsWith('-')) {
|
|
88
|
-
command = args[0];
|
|
89
|
-
}
|
|
90
|
-
|
|
91
87
|
for (let index = 0; index < argv.length; index += 1) {
|
|
92
88
|
const arg = argv[index];
|
|
93
|
-
if (
|
|
89
|
+
if (arg && !arg.startsWith('-')) {
|
|
90
|
+
const lowerArg = arg.toLowerCase();
|
|
91
|
+
const shortcutSlot = normalizeSlotNumber(arg);
|
|
92
|
+
if (lowerArg === 'connect') {
|
|
93
|
+
command = 'connect';
|
|
94
|
+
forwarded.push(arg);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (shortcutSlot && !slot) {
|
|
98
|
+
slot = shortcutSlot;
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
if (index === 0) {
|
|
102
|
+
command = arg;
|
|
103
|
+
}
|
|
94
104
|
forwarded.push(arg);
|
|
95
105
|
continue;
|
|
96
106
|
}
|
|
@@ -132,8 +142,11 @@ function parseLauncherArgs(argv) {
|
|
|
132
142
|
continue;
|
|
133
143
|
}
|
|
134
144
|
if (arg === '--slot') {
|
|
135
|
-
|
|
136
|
-
|
|
145
|
+
const nextSlot = normalizeSlotNumber(argv[index + 1] || slot);
|
|
146
|
+
if (nextSlot) {
|
|
147
|
+
slot = nextSlot;
|
|
148
|
+
forwarded.push(arg, nextSlot);
|
|
149
|
+
}
|
|
137
150
|
index += 1;
|
|
138
151
|
continue;
|
|
139
152
|
}
|
|
@@ -141,6 +154,9 @@ function parseLauncherArgs(argv) {
|
|
|
141
154
|
if (arg === '--help' || arg === '-h') {
|
|
142
155
|
help = true;
|
|
143
156
|
}
|
|
157
|
+
if (arg === '--version') {
|
|
158
|
+
version = true;
|
|
159
|
+
}
|
|
144
160
|
if (arg === '--ai' || arg === '--fake-ai' || arg === '--ai-model' || arg === '--no-ai') {
|
|
145
161
|
nodeOnlyFeature = true;
|
|
146
162
|
}
|
|
@@ -158,6 +174,7 @@ function parseLauncherArgs(argv) {
|
|
|
158
174
|
loginRequested,
|
|
159
175
|
loginDisabled,
|
|
160
176
|
logout,
|
|
177
|
+
version,
|
|
161
178
|
manager,
|
|
162
179
|
pair,
|
|
163
180
|
slot,
|
|
@@ -397,26 +414,13 @@ async function resolveManagerFromSupabase(supabase) {
|
|
|
397
414
|
};
|
|
398
415
|
}
|
|
399
416
|
|
|
400
|
-
async function promptForSlotNumber(currentSlot) {
|
|
401
|
-
const normalized = normalizeSlotNumber(currentSlot);
|
|
402
|
-
if (normalized || !process.stdin.isTTY || !process.stdout.isTTY) {
|
|
403
|
-
return normalized;
|
|
404
|
-
}
|
|
405
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
406
|
-
try {
|
|
407
|
-
const answer = await rl.question('Computer number for screen wall (1-99, Enter to skip): ');
|
|
408
|
-
return normalizeSlotNumber(answer);
|
|
409
|
-
} finally {
|
|
410
|
-
rl.close();
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
|
|
414
417
|
async function prepareLoginConnection(parsed) {
|
|
415
418
|
if (parsed.logout) {
|
|
416
419
|
rmSync(CLIENT_AUTH_PATH, { force: true });
|
|
417
420
|
}
|
|
418
421
|
const shouldLogin = !parsed.loginDisabled
|
|
419
422
|
&& parsed.command === 'connect'
|
|
423
|
+
&& !parsed.version
|
|
420
424
|
&& (parsed.loginRequested || !parsed.pair);
|
|
421
425
|
let forwarded = [...parsed.forwarded];
|
|
422
426
|
let manager = parsed.manager;
|
|
@@ -433,7 +437,7 @@ async function prepareLoginConnection(parsed) {
|
|
|
433
437
|
console.log(`Found LiveDesk manager at ${manager}.`);
|
|
434
438
|
}
|
|
435
439
|
|
|
436
|
-
const slot =
|
|
440
|
+
const slot = normalizeSlotNumber(parsed.slot);
|
|
437
441
|
if (manager) {
|
|
438
442
|
forwarded = upsertForwardedOption(forwarded, '--manager', manager);
|
|
439
443
|
}
|