@livedesk/client 0.1.15 → 0.1.17

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 CHANGED
@@ -34,8 +34,9 @@ playback. When file transfer is enabled by the manager, received files are saved
34
34
  to `Desktop/LiveDeskFiles` unless the manager sets another destination folder.
35
35
 
36
36
  By default, the launcher uses the packaged C# RemoteFast engine when supported.
37
- It falls back to the Node engine for AI assist or when a compatible .NET runtime
38
- is unavailable.
37
+ It falls back to the Node engine for AI assist or when a compatible RemoteFast
38
+ runtime is unavailable. Linux currently uses the Node engine with native
39
+ `node-screenshots` capture for thumbnails and live frames.
39
40
 
40
41
  Useful flags:
41
42
 
@@ -6,7 +6,7 @@ import path from 'path';
6
6
  import crypto from 'crypto';
7
7
  import { promises as fs, statfsSync } from 'fs';
8
8
 
9
- const AGENT_VERSION = '0.1.15-livedesk.1';
9
+ const AGENT_VERSION = '0.1.17-livedesk.1';
10
10
  const DEFAULT_MANAGER = '127.0.0.1:5197';
11
11
  const DEFAULT_HEARTBEAT_MS = 5000;
12
12
  const DEFAULT_AI_MODEL = 'gpt-5.4-mini';
@@ -58,8 +58,20 @@ function isFalsy(value) {
58
58
  return /^(0|false|no|off)$/i.test(String(value || '').trim());
59
59
  }
60
60
 
61
+ function isNativeDesktopCaptureEnabledByDefault() {
62
+ const platform = os.platform();
63
+ const arch = os.arch();
64
+ if (platform === 'win32' || platform === 'darwin') {
65
+ return true;
66
+ }
67
+ if (platform === 'linux') {
68
+ return ['x64', 'arm64', 'loong64'].includes(arch);
69
+ }
70
+ return false;
71
+ }
72
+
61
73
  function parseArgs(argv) {
62
- const defaultDesktopCaptureEnabled = os.platform() === 'win32';
74
+ const defaultDesktopCaptureEnabled = isNativeDesktopCaptureEnabledByDefault();
63
75
  const result = {
64
76
  command: 'connect',
65
77
  manager: process.env.LIVEDESK_CLIENT_MANAGER || process.env.MINDEXEC_REMOTE_MANAGER || DEFAULT_MANAGER,
@@ -247,6 +259,49 @@ function getRootDiskStatus() {
247
259
  }
248
260
  }
249
261
 
262
+ function optionalNumber(value) {
263
+ const number = Number(value);
264
+ return Number.isFinite(number) ? number : undefined;
265
+ }
266
+
267
+ function optionalRatio(value) {
268
+ const number = optionalNumber(value);
269
+ if (number === undefined) {
270
+ return undefined;
271
+ }
272
+ return Math.max(0, Math.min(1, number > 1 ? number / 100 : number));
273
+ }
274
+
275
+ function getAcceleratorStatus() {
276
+ return {
277
+ gpu: {
278
+ name: process.env.LIVEDESK_GPU_NAME || process.env.MINDEXEC_GPU_NAME || '',
279
+ usageRatio: optionalRatio(process.env.LIVEDESK_GPU_USAGE_RATIO || process.env.MINDEXEC_GPU_USAGE_RATIO),
280
+ temperatureC: optionalNumber(process.env.LIVEDESK_GPU_TEMPERATURE_C || process.env.MINDEXEC_GPU_TEMPERATURE_C)
281
+ },
282
+ npu: {
283
+ name: process.env.LIVEDESK_NPU_NAME || process.env.MINDEXEC_NPU_NAME || '',
284
+ usageRatio: optionalRatio(process.env.LIVEDESK_NPU_USAGE_RATIO || process.env.MINDEXEC_NPU_USAGE_RATIO),
285
+ tops: optionalNumber(process.env.LIVEDESK_NPU_TOPS || process.env.MINDEXEC_NPU_TOPS)
286
+ }
287
+ };
288
+ }
289
+
290
+ function getNetworkStatus() {
291
+ const interfaces = os.networkInterfaces();
292
+ const activeName = Object.entries(interfaces).find(([, addresses]) =>
293
+ Array.isArray(addresses) && addresses.some(address => !address.internal && address.family === 'IPv4')
294
+ )?.[0] || '';
295
+ return {
296
+ interface: activeName,
297
+ link: activeName || '',
298
+ rxMbps: optionalNumber(process.env.LIVEDESK_NETWORK_RX_MBPS || process.env.MINDEXEC_NETWORK_RX_MBPS),
299
+ txMbps: optionalNumber(process.env.LIVEDESK_NETWORK_TX_MBPS || process.env.MINDEXEC_NETWORK_TX_MBPS),
300
+ latencyMs: optionalNumber(process.env.LIVEDESK_NETWORK_LATENCY_MS || process.env.MINDEXEC_NETWORK_LATENCY_MS),
301
+ usageRatio: optionalRatio(process.env.LIVEDESK_NETWORK_USAGE_RATIO || process.env.MINDEXEC_NETWORK_USAGE_RATIO)
302
+ };
303
+ }
304
+
250
305
  function getStatus(options = {}) {
251
306
  const totalMem = os.totalmem();
252
307
  const freeMem = os.freemem();
@@ -257,6 +312,7 @@ function getStatus(options = {}) {
257
312
  ? Number(Math.min(1, loadavg[0] / cpuCores).toFixed(4))
258
313
  : 0;
259
314
  const usedMemRatio = totalMem > 0 ? Number(((totalMem - freeMem) / totalMem).toFixed(4)) : 0;
315
+ const acceleratorStatus = getAcceleratorStatus();
260
316
  const status = {
261
317
  uptimeSec: Math.round(os.uptime()),
262
318
  loadavg,
@@ -279,6 +335,9 @@ function getStatus(options = {}) {
279
335
  usedRatio: usedMemRatio
280
336
  },
281
337
  disk: getRootDiskStatus(),
338
+ gpu: acceleratorStatus.gpu,
339
+ npu: acceleratorStatus.npu,
340
+ network: getNetworkStatus(),
282
341
  workload: {
283
342
  role: options.aiEnabled ? 'Agent worker' : options.taskEnabled ? 'Task worker' : 'Local machine',
284
343
  status: 'idle',
@@ -806,6 +806,13 @@ function shouldUseFast(parsed) {
806
806
  return !parsed.nodeOnlyFeature;
807
807
  }
808
808
 
809
+ function shouldTryFast(parsed, runtime) {
810
+ if (parsed.engine === 'fast') {
811
+ return true;
812
+ }
813
+ return shouldUseFast(parsed) && !!runtime;
814
+ }
815
+
809
816
  async function main() {
810
817
  const parsed = parseLauncherArgs(process.argv.slice(2));
811
818
  if (parsed.help) {
@@ -815,7 +822,7 @@ async function main() {
815
822
 
816
823
  const prepared = await prepareLoginConnection(parsed);
817
824
  const fastRuntime = getFastRuntime();
818
- const useFast = shouldUseFast(prepared);
825
+ const useFast = shouldTryFast(prepared, fastRuntime);
819
826
  if (useFast) {
820
827
  const fastArgs = buildFastArgs(prepared.forwarded, prepared.fakeThumbnail);
821
828
  const fastLaunch = resolveFastLaunch(fastRuntime);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {