@livedesk/client 0.1.28 → 0.1.30

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
@@ -37,6 +37,10 @@ By default, the launcher uses the packaged C# RemoteFast engine when supported.
37
37
  It falls back to the Node engine for AI assist or when a compatible RemoteFast
38
38
  runtime is unavailable. Windows, macOS, and Linux all try RemoteFast first so
39
39
  the Hub can request the Mode 3 hardware video path when it is available.
40
+ The launcher also includes a prebuilt ffmpeg executable through
41
+ `@ffmpeg-installer/ffmpeg` and passes it to RemoteFast automatically. Set
42
+ `LIVEDESK_FFMPEG` to override that path. If you need LGPL-only distribution,
43
+ point `LIVEDESK_FFMPEG` at a verified LGPL ffmpeg build before shipping.
40
44
 
41
45
  Useful flags:
42
46
 
@@ -56,7 +60,7 @@ Frame pipeline roadmap:
56
60
 
57
61
  - Mode 1: `mode1-jpeg` - current test path using screen capture, resize, and JPEG binary frames.
58
62
  - Mode 2: `mode2-lz4` - Windows Fast path using raw BGRA frames compressed as an LZ4 block.
59
- - Mode 3: `mode3-h264-hw` - OS-specific ffmpeg hardware H.264 path. Windows tries Media Foundation/NVENC/QSV/AMF, macOS tries VideoToolbox, and Linux tries NVENC/VAAPI/QSV. Set `LIVEDESK_FFMPEG` to a custom ffmpeg binary if needed.
63
+ - Mode 3: `mode3-h264-hw` - OS-specific ffmpeg hardware H.264 path. Windows tries Media Foundation/NVENC/QSV/AMF, macOS tries VideoToolbox, and Linux tries NVENC/VAAPI/QSV. The launcher uses the bundled ffmpeg first, unless `LIVEDESK_FFMPEG` points to a custom binary. On macOS, set `LIVEDESK_FFMPEG_AVFOUNDATION_INPUT` if your screen input is not `1:none`.
60
64
 
61
65
  Legacy mode names such as `remote-fast` and `remote-quality` are treated as
62
66
  Mode 1 aliases.
@@ -5,10 +5,12 @@ import { dirname, join, resolve } from 'node:path';
5
5
  import { fileURLToPath } from 'node:url';
6
6
  import { spawn, spawnSync } from 'node:child_process';
7
7
  import { createServer } from 'node:http';
8
+ import { createRequire } from 'node:module';
8
9
  import net from 'node:net';
9
10
  import os from 'node:os';
10
11
 
11
12
  const __dirname = dirname(fileURLToPath(import.meta.url));
13
+ const require = createRequire(import.meta.url);
12
14
  const packageRoot = resolve(__dirname, '..');
13
15
  const nodeAgentPath = join(__dirname, 'livedesk-client-node.js');
14
16
  const FAST_PREFLIGHT_TIMEOUT_MS = 5000;
@@ -779,6 +781,27 @@ function hasFastDll(runtime) {
779
781
  return !!runtime?.dll && existsSync(runtime.dll);
780
782
  }
781
783
 
784
+ function resolveBundledFfmpegPath() {
785
+ try {
786
+ const ffmpeg = require('@ffmpeg-installer/ffmpeg');
787
+ const ffmpegPath = String(ffmpeg?.path || '').trim();
788
+ return ffmpegPath && existsSync(ffmpegPath) ? ffmpegPath : '';
789
+ } catch {
790
+ return '';
791
+ }
792
+ }
793
+
794
+ function buildFastEnvironment() {
795
+ const env = { ...process.env };
796
+ if (!env.LIVEDESK_FFMPEG) {
797
+ const bundledFfmpegPath = resolveBundledFfmpegPath();
798
+ if (bundledFfmpegPath) {
799
+ env.LIVEDESK_FFMPEG = bundledFfmpegPath;
800
+ }
801
+ }
802
+ return env;
803
+ }
804
+
782
805
  function describePreflightFailure(result) {
783
806
  if (result?.error) {
784
807
  return result.error.message || String(result.error);
@@ -868,8 +891,9 @@ function resolveFastLaunch(runtime) {
868
891
  };
869
892
  }
870
893
 
871
- function spawnAgent(command, args) {
894
+ function spawnAgent(command, args, env = process.env) {
872
895
  const child = spawn(command, args, {
896
+ env,
873
897
  stdio: 'inherit',
874
898
  windowsHide: true
875
899
  });
@@ -922,7 +946,7 @@ async function main() {
922
946
  const fastArgs = buildFastArgs(prepared.forwarded, prepared.fakeThumbnail);
923
947
  const fastLaunch = resolveFastLaunch(fastRuntime);
924
948
  if (fastLaunch.ok) {
925
- result = await spawnAgent(fastLaunch.command, [...fastLaunch.argsPrefix, ...fastArgs]);
949
+ result = await spawnAgent(fastLaunch.command, [...fastLaunch.argsPrefix, ...fastArgs], buildFastEnvironment());
926
950
  } else if (prepared.engine === 'fast') {
927
951
  console.error(`C# RemoteFast is unavailable: ${fastLaunch.reason}. Use --engine node to run the legacy Node agent.`);
928
952
  process.exit(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livedesk/client",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "LiveDesk local remote client",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,6 +30,7 @@
30
30
  "node": ">=20"
31
31
  },
32
32
  "dependencies": {
33
+ "@ffmpeg-installer/ffmpeg": "^1.1.0",
33
34
  "@supabase/supabase-js": "^2.110.0",
34
35
  "node-screenshots": "^0.2.8",
35
36
  "openai": "^6.42.0"