flockbay 0.10.48 → 0.10.51

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.
Files changed (74) hide show
  1. package/README.md +60 -60
  2. package/bin/flockbay-mcp.mjs +62 -62
  3. package/bin/flockbay.mjs +95 -95
  4. package/dist/{index-BLsRYyPq.mjs → index-DZjyS6UX.mjs} +49 -19
  5. package/dist/{index-jd6DaTy_.cjs → index-wU3LFfZh.cjs} +50 -20
  6. package/dist/index.cjs +2 -2
  7. package/dist/index.mjs +2 -2
  8. package/dist/lib.cjs +1 -1
  9. package/dist/lib.mjs +1 -1
  10. package/dist/{migratePlugin-BPUAeqI_.mjs → migratePlugin-CnpWYW1E.mjs} +28 -1
  11. package/dist/{migratePlugin-CyWWA8GW.cjs → migratePlugin-CyXgJ-se.cjs} +28 -1
  12. package/dist/{runCodex-BkdEucuI.mjs → runCodex-Dhkynhhh.mjs} +7 -2
  13. package/dist/{runCodex-D8On-xj7.cjs → runCodex-jDfLDJJW.cjs} +7 -2
  14. package/dist/{runGemini-BPLO-OFS.cjs → runGemini-DN189-WI.cjs} +2 -2
  15. package/dist/{runGemini-p_aKQRTi.mjs → runGemini-Dq5_59Us.mjs} +2 -2
  16. package/dist/{types-DbQtXaZC.cjs → types-CN-EDgzo.cjs} +186 -14
  17. package/dist/{types-KJ7kAYwk.mjs → types-DRXvc8Nt.mjs} +184 -14
  18. package/package.json +131 -131
  19. package/scripts/claude_local_launcher.cjs +72 -72
  20. package/scripts/claude_remote_launcher.cjs +15 -15
  21. package/scripts/claude_version_utils.cjs +445 -445
  22. package/scripts/ripgrep_launcher.cjs +32 -32
  23. package/scripts/run-with-root-env.mjs +37 -32
  24. package/scripts/session_hook_forwarder.cjs +49 -49
  25. package/scripts/test-codex-abort-history.mjs +77 -77
  26. package/scripts/unpack-tools.cjs +244 -244
  27. package/tools/licenses/difftastic-LICENSE +21 -21
  28. package/tools/licenses/ripgrep-LICENSE +3 -3
  29. package/tools/unreal-mcp/UPSTREAM_VERSION.md +8 -8
  30. package/tools/unreal-mcp/upstream/Docs/README.md +8 -8
  31. package/tools/unreal-mcp/upstream/Docs/Tools/README.md +6 -6
  32. package/tools/unreal-mcp/upstream/Docs/Tools/actor_tools.md +183 -183
  33. package/tools/unreal-mcp/upstream/Docs/Tools/blueprint_tools.md +268 -268
  34. package/tools/unreal-mcp/upstream/Docs/Tools/editor_tools.md +104 -104
  35. package/tools/unreal-mcp/upstream/Docs/Tools/node_tools.md +274 -274
  36. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Config/FilterPlugin.ini +8 -8
  37. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/FlockbayMCP.uplugin +36 -36
  38. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/FlockbayMCP.Build.cs +82 -82
  39. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintCommands.cpp +1364 -1364
  40. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintNodeCommands.cpp +1310 -1310
  41. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPCommandSchema.cpp +756 -756
  42. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPCommonUtils.cpp +1177 -1177
  43. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPEditorCommands.cpp +2618 -2618
  44. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPProjectCommands.cpp +71 -71
  45. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPUMGCommands.cpp +543 -543
  46. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/MCPServerRunnable.cpp +372 -372
  47. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/UnrealMCPBridge.cpp +457 -457
  48. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/UnrealMCPModule.cpp +21 -21
  49. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPBlueprintCommands.h +35 -35
  50. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPBlueprintNodeCommands.h +30 -30
  51. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPCommandSchema.h +41 -41
  52. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPCommonUtils.h +59 -59
  53. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPEditorCommands.h +61 -61
  54. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPProjectCommands.h +20 -20
  55. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPUMGCommands.h +82 -82
  56. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/MCPServerRunnable.h +33 -33
  57. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/UnrealMCPBridge.h +64 -64
  58. package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/UnrealMCPModule.h +22 -22
  59. package/tools/unreal-mcp/upstream/Python/README.md +39 -39
  60. package/tools/unreal-mcp/upstream/Python/pyproject.toml +22 -22
  61. package/tools/unreal-mcp/upstream/Python/scripts/actors/test_cube.py +202 -202
  62. package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_blueprints_with_different_components.py +496 -496
  63. package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_cube_blueprint.py +193 -193
  64. package/tools/unreal-mcp/upstream/Python/scripts/node/test_component_reference.py +266 -266
  65. package/tools/unreal-mcp/upstream/Python/scripts/node/test_create_bird_blueprint_with_input_and_camera.py +617 -617
  66. package/tools/unreal-mcp/upstream/Python/scripts/node/test_input_mapping.py +365 -365
  67. package/tools/unreal-mcp/upstream/Python/scripts/node/test_physics_variables.py +389 -389
  68. package/tools/unreal-mcp/upstream/Python/tools/blueprint_tools.py +419 -419
  69. package/tools/unreal-mcp/upstream/Python/tools/editor_tools.py +369 -369
  70. package/tools/unreal-mcp/upstream/Python/tools/node_tools.py +429 -429
  71. package/tools/unreal-mcp/upstream/Python/tools/project_tools.py +63 -63
  72. package/tools/unreal-mcp/upstream/Python/tools/umg_tools.py +332 -332
  73. package/tools/unreal-mcp/upstream/Python/unreal_mcp_server.py +398 -398
  74. package/tools/unreal-mcp/upstream/Python/uv.lock +521 -521
package/README.md CHANGED
@@ -1,60 +1,60 @@
1
- # Flockbay CLI
2
-
3
- Code on the go controlling Claude/Codex sessions from your mobile device.
4
-
5
- Code anywhere.
6
-
7
- Flockbay CLI is the command-line tool for running and controlling Flockbay sessions (including daemon and Codex mode).
8
-
9
- ## Installation
10
-
11
- ```bash
12
- npm install -g flockbay
13
- ```
14
-
15
- ## Usage
16
-
17
- ```bash
18
- flockbay
19
- ```
20
-
21
- This will:
22
- 1. Start a Claude Code session
23
- 2. Display a QR code to connect from your mobile device
24
- 3. Allow real-time session sharing between Claude Code and your mobile app
25
-
26
- ## Commands
27
-
28
- - `flockbay auth` – Manage authentication
29
- - `flockbay codex` – Start Codex mode
30
- - `flockbay connect` – Store AI vendor API keys in Flockbay
31
- - `flockbay notify` – Send a push notification to your devices
32
- - `flockbay daemon` – Manage background service
33
- - `flockbay doctor` – System diagnostics & troubleshooting
34
-
35
- ## Options
36
-
37
- - `-h, --help` - Show help
38
- - `-v, --version` - Show version
39
- - `-m, --model <model>` - Claude model to use (default: sonnet)
40
- - `-p, --permission-mode <mode>` - Permission mode: auto, default, or plan
41
- - `--claude-env KEY=VALUE` - Set environment variable for Claude Code (e.g., for [claude-code-router](https://github.com/musistudio/claude-code-router))
42
- - `--claude-arg ARG` - Pass additional argument to Claude CLI
43
-
44
- Run `flockbay --help` for the complete list of options.
45
-
46
- ## Requirements
47
-
48
- - Node.js >= 20.0.0
49
- - Required by `eventsource-parser@3.0.5`, which is required by
50
- `@modelcontextprotocol/sdk`, which we used to implement permission forwarding
51
- to mobile app
52
- - Claude CLI installed & logged in (`claude` command available in PATH)
53
-
54
- ## Windows UX note
55
-
56
- - Codex MCP child processes are started with hidden console windows to prevent blank `cmd.exe` popups during session startup.
57
-
58
- ## License
59
-
60
- Proprietary. Copyright (c) 2024-2026 Flockbay. All rights reserved.
1
+ # Flockbay CLI
2
+
3
+ Code on the go controlling Claude/Codex sessions from your mobile device.
4
+
5
+ Code anywhere.
6
+
7
+ Flockbay CLI is the command-line tool for running and controlling Flockbay sessions (including daemon and Codex mode).
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install -g flockbay
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ flockbay
19
+ ```
20
+
21
+ This will:
22
+ 1. Start a Claude Code session
23
+ 2. Display a QR code to connect from your mobile device
24
+ 3. Allow real-time session sharing between Claude Code and your mobile app
25
+
26
+ ## Commands
27
+
28
+ - `flockbay auth` – Manage authentication
29
+ - `flockbay codex` – Start Codex mode
30
+ - `flockbay connect` – Store AI vendor API keys in Flockbay
31
+ - `flockbay notify` – Send a push notification to your devices
32
+ - `flockbay daemon` – Manage background service
33
+ - `flockbay doctor` – System diagnostics & troubleshooting
34
+
35
+ ## Options
36
+
37
+ - `-h, --help` - Show help
38
+ - `-v, --version` - Show version
39
+ - `-m, --model <model>` - Claude model to use (default: sonnet)
40
+ - `-p, --permission-mode <mode>` - Permission mode: auto, default, or plan
41
+ - `--claude-env KEY=VALUE` - Set environment variable for Claude Code (e.g., for [claude-code-router](https://github.com/musistudio/claude-code-router))
42
+ - `--claude-arg ARG` - Pass additional argument to Claude CLI
43
+
44
+ Run `flockbay --help` for the complete list of options.
45
+
46
+ ## Requirements
47
+
48
+ - Node.js >= 20.0.0
49
+ - Required by `eventsource-parser@3.0.5`, which is required by
50
+ `@modelcontextprotocol/sdk`, which we used to implement permission forwarding
51
+ to mobile app
52
+ - Claude CLI installed & logged in (`claude` command available in PATH)
53
+
54
+ ## Windows UX note
55
+
56
+ - Codex MCP child processes are started with hidden console windows to prevent blank `cmd.exe` popups during session startup.
57
+
58
+ ## License
59
+
60
+ Proprietary. Copyright (c) 2024-2026 Flockbay. All rights reserved.
@@ -1,62 +1,62 @@
1
- #!/usr/bin/env node
2
-
3
- import { execFileSync } from 'node:child_process';
4
- import { existsSync } from 'node:fs';
5
- import { dirname, join } from 'node:path';
6
- import { fileURLToPath, pathToFileURL } from 'node:url';
7
-
8
- // Ensure Node flags to reduce noisy warnings on stdout (which could interfere with MCP).
9
- const hasNoWarnings = process.execArgv.includes('--no-warnings');
10
- const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
11
-
12
- const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
13
- const distEntrypoint = join(projectRoot, 'dist', 'codex', 'flockbayMcpStdioBridge.mjs');
14
- const devEntrypoint = join(projectRoot, 'src', 'codex', 'flockbayMcpStdioBridge.ts');
15
- const entrypoint = existsSync(distEntrypoint) ? distEntrypoint : devEntrypoint;
16
- const useTsx = entrypoint.endsWith('.ts');
17
- const invokedCwd = process.cwd();
18
-
19
- function resolveTsxImportArgs() {
20
- if (!useTsx) return [];
21
- const candidates = [
22
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.mjs'),
23
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.js'),
24
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.mjs'),
25
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.js'),
26
- ];
27
- const resolved = candidates.find(existsSync);
28
- return resolved ? ['--import', toNodeSpecifier(resolved)] : ['--import', 'tsx'];
29
- }
30
-
31
- function toNodeSpecifier(p) {
32
- if (process.platform !== 'win32') return p;
33
- if (!/^[a-zA-Z]:[\\/]/.test(p)) return p;
34
- return pathToFileURL(p).href;
35
- }
36
-
37
- if (!hasNoWarnings || !hasNoDeprecation || useTsx) {
38
- try {
39
- execFileSync(
40
- process.execPath,
41
- [
42
- '--no-warnings',
43
- '--no-deprecation',
44
- ...resolveTsxImportArgs(),
45
- entrypoint,
46
- ...process.argv.slice(2),
47
- ],
48
- {
49
- stdio: 'inherit',
50
- ...(useTsx ? { cwd: projectRoot } : {}),
51
- env: {
52
- ...process.env,
53
- ...(useTsx ? { FLOCKBAY_INVOKED_CWD: invokedCwd } : {}),
54
- },
55
- },
56
- );
57
- } catch (error) {
58
- process.exit(error?.status || 1);
59
- }
60
- } else {
61
- await import('../dist/codex/flockbayMcpStdioBridge.mjs');
62
- }
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from 'node:child_process';
4
+ import { existsSync } from 'node:fs';
5
+ import { dirname, join } from 'node:path';
6
+ import { fileURLToPath, pathToFileURL } from 'node:url';
7
+
8
+ // Ensure Node flags to reduce noisy warnings on stdout (which could interfere with MCP).
9
+ const hasNoWarnings = process.execArgv.includes('--no-warnings');
10
+ const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
11
+
12
+ const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
13
+ const distEntrypoint = join(projectRoot, 'dist', 'codex', 'flockbayMcpStdioBridge.mjs');
14
+ const devEntrypoint = join(projectRoot, 'src', 'codex', 'flockbayMcpStdioBridge.ts');
15
+ const entrypoint = existsSync(distEntrypoint) ? distEntrypoint : devEntrypoint;
16
+ const useTsx = entrypoint.endsWith('.ts');
17
+ const invokedCwd = process.cwd();
18
+
19
+ function resolveTsxImportArgs() {
20
+ if (!useTsx) return [];
21
+ const candidates = [
22
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.mjs'),
23
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.js'),
24
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.mjs'),
25
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.js'),
26
+ ];
27
+ const resolved = candidates.find(existsSync);
28
+ return resolved ? ['--import', toNodeSpecifier(resolved)] : ['--import', 'tsx'];
29
+ }
30
+
31
+ function toNodeSpecifier(p) {
32
+ if (process.platform !== 'win32') return p;
33
+ if (!/^[a-zA-Z]:[\\/]/.test(p)) return p;
34
+ return pathToFileURL(p).href;
35
+ }
36
+
37
+ if (!hasNoWarnings || !hasNoDeprecation || useTsx) {
38
+ try {
39
+ execFileSync(
40
+ process.execPath,
41
+ [
42
+ '--no-warnings',
43
+ '--no-deprecation',
44
+ ...resolveTsxImportArgs(),
45
+ entrypoint,
46
+ ...process.argv.slice(2),
47
+ ],
48
+ {
49
+ stdio: 'inherit',
50
+ ...(useTsx ? { cwd: projectRoot } : {}),
51
+ env: {
52
+ ...process.env,
53
+ ...(useTsx ? { FLOCKBAY_INVOKED_CWD: invokedCwd } : {}),
54
+ },
55
+ },
56
+ );
57
+ } catch (error) {
58
+ process.exit(error?.status || 1);
59
+ }
60
+ } else {
61
+ await import('../dist/codex/flockbayMcpStdioBridge.mjs');
62
+ }
package/bin/flockbay.mjs CHANGED
@@ -1,95 +1,95 @@
1
- #!/usr/bin/env node
2
-
3
- import { execFileSync } from 'node:child_process';
4
- import { existsSync, statSync } from 'node:fs';
5
- import { dirname, join } from 'node:path';
6
- import { fileURLToPath, pathToFileURL } from 'node:url';
7
-
8
- // Ensure Node flags to reduce noisy warnings on stdout.
9
- const hasNoWarnings = process.execArgv.includes('--no-warnings');
10
- const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
11
-
12
- const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
13
- const distEntrypoint = join(projectRoot, 'dist', 'index.mjs');
14
- const devEntrypoint = join(projectRoot, 'src', 'index.ts');
15
- const entrypoint = (() => {
16
- const forceSrc = process.env.FLOCKBAY_USE_SRC === '1';
17
- const forceDist = process.env.FLOCKBAY_USE_DIST === '1';
18
-
19
- const hasDist = existsSync(distEntrypoint);
20
- const hasDev = existsSync(devEntrypoint);
21
-
22
- if (forceSrc && hasDev) return devEntrypoint;
23
- if (forceDist && hasDist) return distEntrypoint;
24
-
25
- if (hasDist && hasDev) {
26
- try {
27
- const devTime = statSync(devEntrypoint).mtimeMs;
28
- const distTime = statSync(distEntrypoint).mtimeMs;
29
- if (devTime > distTime) return devEntrypoint;
30
- } catch {
31
- // ignore
32
- }
33
- return distEntrypoint;
34
- }
35
-
36
- return hasDist ? distEntrypoint : devEntrypoint;
37
- })();
38
- const useTsx = entrypoint.endsWith('.ts');
39
- const invokedCwd = process.cwd();
40
-
41
- function rewriteTopLevelAliases(args) {
42
- const cmd = args[0];
43
- if (cmd === 'install') return ['daemon', 'install', ...args.slice(1)];
44
- if (cmd === 'uninstall') return ['daemon', 'uninstall', ...args.slice(1)];
45
- return args;
46
- }
47
-
48
- function resolveTsxImportArgs() {
49
- if (!useTsx) return [];
50
- const candidates = [
51
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.mjs'),
52
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.js'),
53
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.mjs'),
54
- join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.js'),
55
- ];
56
- const resolved = candidates.find(existsSync);
57
- return resolved ? ['--import', toNodeSpecifier(resolved)] : ['--import', 'tsx'];
58
- }
59
-
60
- function toNodeSpecifier(p) {
61
- if (process.platform !== 'win32') return p;
62
- if (!/^[a-zA-Z]:[\\/]/.test(p)) return p;
63
- return pathToFileURL(p).href;
64
- }
65
-
66
- const rewrittenArgs = rewriteTopLevelAliases(process.argv.slice(2));
67
-
68
- if (!hasNoWarnings || !hasNoDeprecation || useTsx) {
69
- try {
70
- execFileSync(
71
- process.execPath,
72
- [
73
- '--no-warnings',
74
- '--no-deprecation',
75
- ...resolveTsxImportArgs(),
76
- entrypoint,
77
- ...rewrittenArgs,
78
- ],
79
- {
80
- stdio: 'inherit',
81
- ...(useTsx ? { cwd: projectRoot } : {}),
82
- env: {
83
- ...process.env,
84
- ...(useTsx ? { FLOCKBAY_INVOKED_CWD: invokedCwd } : {}),
85
- },
86
- },
87
- );
88
- } catch (error) {
89
- process.exit(error?.status || 1);
90
- }
91
- } else {
92
- // When running via direct import, mutate argv so the entrypoint sees the same aliases.
93
- process.argv.splice(2, process.argv.length - 2, ...rewrittenArgs);
94
- await import('../dist/index.mjs');
95
- }
1
+ #!/usr/bin/env node
2
+
3
+ import { execFileSync } from 'node:child_process';
4
+ import { existsSync, statSync } from 'node:fs';
5
+ import { dirname, join } from 'node:path';
6
+ import { fileURLToPath, pathToFileURL } from 'node:url';
7
+
8
+ // Ensure Node flags to reduce noisy warnings on stdout.
9
+ const hasNoWarnings = process.execArgv.includes('--no-warnings');
10
+ const hasNoDeprecation = process.execArgv.includes('--no-deprecation');
11
+
12
+ const projectRoot = dirname(dirname(fileURLToPath(import.meta.url)));
13
+ const distEntrypoint = join(projectRoot, 'dist', 'index.mjs');
14
+ const devEntrypoint = join(projectRoot, 'src', 'index.ts');
15
+ const entrypoint = (() => {
16
+ const forceSrc = process.env.FLOCKBAY_USE_SRC === '1';
17
+ const forceDist = process.env.FLOCKBAY_USE_DIST === '1';
18
+
19
+ const hasDist = existsSync(distEntrypoint);
20
+ const hasDev = existsSync(devEntrypoint);
21
+
22
+ if (forceSrc && hasDev) return devEntrypoint;
23
+ if (forceDist && hasDist) return distEntrypoint;
24
+
25
+ if (hasDist && hasDev) {
26
+ try {
27
+ const devTime = statSync(devEntrypoint).mtimeMs;
28
+ const distTime = statSync(distEntrypoint).mtimeMs;
29
+ if (devTime > distTime) return devEntrypoint;
30
+ } catch {
31
+ // ignore
32
+ }
33
+ return distEntrypoint;
34
+ }
35
+
36
+ return hasDist ? distEntrypoint : devEntrypoint;
37
+ })();
38
+ const useTsx = entrypoint.endsWith('.ts');
39
+ const invokedCwd = process.cwd();
40
+
41
+ function rewriteTopLevelAliases(args) {
42
+ const cmd = args[0];
43
+ if (cmd === 'install') return ['daemon', 'install', ...args.slice(1)];
44
+ if (cmd === 'uninstall') return ['daemon', 'uninstall', ...args.slice(1)];
45
+ return args;
46
+ }
47
+
48
+ function resolveTsxImportArgs() {
49
+ if (!useTsx) return [];
50
+ const candidates = [
51
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.mjs'),
52
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'esm', 'index.js'),
53
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.mjs'),
54
+ join(projectRoot, 'node_modules', 'tsx', 'dist', 'index.js'),
55
+ ];
56
+ const resolved = candidates.find(existsSync);
57
+ return resolved ? ['--import', toNodeSpecifier(resolved)] : ['--import', 'tsx'];
58
+ }
59
+
60
+ function toNodeSpecifier(p) {
61
+ if (process.platform !== 'win32') return p;
62
+ if (!/^[a-zA-Z]:[\\/]/.test(p)) return p;
63
+ return pathToFileURL(p).href;
64
+ }
65
+
66
+ const rewrittenArgs = rewriteTopLevelAliases(process.argv.slice(2));
67
+
68
+ if (!hasNoWarnings || !hasNoDeprecation || useTsx) {
69
+ try {
70
+ execFileSync(
71
+ process.execPath,
72
+ [
73
+ '--no-warnings',
74
+ '--no-deprecation',
75
+ ...resolveTsxImportArgs(),
76
+ entrypoint,
77
+ ...rewrittenArgs,
78
+ ],
79
+ {
80
+ stdio: 'inherit',
81
+ ...(useTsx ? { cwd: projectRoot } : {}),
82
+ env: {
83
+ ...process.env,
84
+ ...(useTsx ? { FLOCKBAY_INVOKED_CWD: invokedCwd } : {}),
85
+ },
86
+ },
87
+ );
88
+ } catch (error) {
89
+ process.exit(error?.status || 1);
90
+ }
91
+ } else {
92
+ // When running via direct import, mutate argv so the entrypoint sees the same aliases.
93
+ process.argv.splice(2, process.argv.length - 2, ...rewrittenArgs);
94
+ await import('../dist/index.mjs');
95
+ }
@@ -2,7 +2,7 @@ import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(im
2
2
  import * as os from 'node:os';
3
3
  import os__default, { homedir } from 'node:os';
4
4
  import { randomUUID, createCipheriv, randomBytes, createHash as createHash$1 } from 'node:crypto';
5
- import { l as logger, b as projectPath, d as backoff, e as delay, R as RawJSONLinesSchema, c as configuration, f as readDaemonState, g as clearDaemonState, p as packageJson, r as readSettings, h as readCredentials, u as updateSettings, o as openBrowser, w as writeCredentials, j as unrealMcpPythonDir, k as acquireDaemonLock, m as writeDaemonState, n as ApiMachineClient, q as releaseDaemonLock, s as sendUnrealMcpTcpCommand, A as ApiClient, v as validatePath, t as run, x as run$1, y as buildShellInvocation, z as clearCredentials, B as clearMachineId, C as authenticateCodex, D as syncCodexCliAuth, E as authenticateClaude, F as authenticateGemini, i as installUnrealMcpPluginToEngine, G as buildAndInstallUnrealMcpPlugin, H as installUnrealMcpPluginToProject, I as getLatestDaemonLog, J as normalizeServerUrlForNode } from './types-KJ7kAYwk.mjs';
5
+ import { l as logger, e as projectPath, f as backoff, g as delay, R as RawJSONLinesSchema, c as configuration, h as readDaemonState, j as clearDaemonState, p as packageJson, r as readSettings, k as readCredentials, u as updateSettings, o as openBrowser, w as writeCredentials, m as unrealMcpPythonDir, n as acquireDaemonLock, s as writeDaemonState, t as ApiMachineClient, v as releaseDaemonLock, x as sendUnrealMcpTcpCommand, A as ApiClient, y as validatePath, z as run, B as run$1, C as buildShellInvocation, D as clearCredentials, E as clearMachineId, F as authenticateCodex, G as syncCodexCliAuth, H as authenticateClaude, I as authenticateGemini, d as installUnrealMcpPluginToEngine, J as buildAndInstallUnrealMcpPlugin, i as installUnrealMcpPluginToProject, b as isInstalledEngineRoot, K as getLatestDaemonLog, L as normalizeServerUrlForNode } from './types-DRXvc8Nt.mjs';
6
6
  import { spawn, execFileSync, execSync } from 'node:child_process';
7
7
  import * as path from 'node:path';
8
8
  import path__default, { resolve, join, dirname } from 'node:path';
@@ -2030,11 +2030,24 @@ function normalizeFilePathToken(token) {
2030
2030
  function resolveCandidatePath(candidate, cwd) {
2031
2031
  const raw = normalizeFilePathToken(candidate);
2032
2032
  if (!raw) return raw;
2033
+ const isWindowsPath = (value) => {
2034
+ const v = String(value || "").trim();
2035
+ if (!v) return false;
2036
+ if (/^[a-zA-Z]:[\\/]/.test(v)) return true;
2037
+ if (v.startsWith("\\\\")) return true;
2038
+ return false;
2039
+ };
2040
+ const isPosixPath = (value) => String(value || "").trim().startsWith("/");
2041
+ const resolveApi = (() => {
2042
+ if (isWindowsPath(raw) || isWindowsPath(cwd)) return path__default.win32;
2043
+ if (isPosixPath(raw) || isPosixPath(cwd)) return path__default.posix;
2044
+ return path__default;
2045
+ })();
2033
2046
  if (raw.startsWith("~/")) {
2034
2047
  const home = process.env.HOME || process.env.USERPROFILE || "";
2035
- if (home) return path__default.join(home, raw.slice(2));
2048
+ if (home) return resolveApi.join(home, raw.slice(2));
2036
2049
  }
2037
- return path__default.isAbsolute(raw) ? raw : path__default.resolve(cwd, raw);
2050
+ return resolveApi.isAbsolute(raw) ? raw : resolveApi.resolve(cwd, raw);
2038
2051
  }
2039
2052
  function isImageBlock(block) {
2040
2053
  if (!block || typeof block !== "object") return false;
@@ -15190,7 +15203,7 @@ async function authAndSetupMachineIfNeeded() {
15190
15203
  process.exit(1);
15191
15204
  }
15192
15205
  try {
15193
- const { migrateUnrealMcpToFlockbayMcp } = await import('./migratePlugin-BPUAeqI_.mjs');
15206
+ const { migrateUnrealMcpToFlockbayMcp } = await import('./migratePlugin-CnpWYW1E.mjs');
15194
15207
  const result = migrateUnrealMcpToFlockbayMcp({
15195
15208
  engineRoot,
15196
15209
  projectUprojectPath: project || void 0,
@@ -15300,19 +15313,36 @@ async function authAndSetupMachineIfNeeded() {
15300
15313
  if (!parsed.skipUnreal) {
15301
15314
  const engineRoot = readArgValue(startArgs, "--engine-root") || (process.env.UE_ENGINE_ROOT || "").trim() || (process.env.ENGINE_ROOT || "").trim() || null;
15302
15315
  if (engineRoot) {
15303
- const shouldInstall = await promptYesNo(`Install Flockbay MCP plugin into this Unreal Engine folder?
15304
- ${engineRoot}`, {
15305
- defaultYes: true
15306
- });
15307
- if (shouldInstall) {
15308
- const result = installUnrealMcpPluginToEngine(engineRoot);
15309
- if (result.ok) {
15310
- console.log(`Flockbay MCP plugin installed: ${result.destDir}`);
15311
- process.env.FLOCKBAY_UNREAL_MCP_ENABLED = "1";
15312
- process.env.ENGINE_ROOT = engineRoot;
15313
- } else {
15314
- console.error(chalk.yellow("Flockbay MCP plugin install skipped:"));
15315
- console.error(chalk.gray(result.errorMessage));
15316
+ const installedEngine = isInstalledEngineRoot(engineRoot);
15317
+ const detection = await detectUnrealProject(process.cwd());
15318
+ const uproject = detection.ok ? detection.uprojectFile : null;
15319
+ const promptTarget = installedEngine ? uproject ? `Install Flockbay MCP plugin into this Unreal project?
15320
+ ${uproject}` : null : `Install Flockbay MCP plugin into this Unreal Engine folder?
15321
+ ${engineRoot}`;
15322
+ if (installedEngine && !uproject) {
15323
+ console.error(chalk.yellow("Unreal MCP plugin install skipped:"));
15324
+ console.error(
15325
+ chalk.gray(
15326
+ [
15327
+ "This engine appears to be an Installed Build (Epic Launcher).",
15328
+ "Engine-scope install can break builds. Run `flockbay start` from a project folder, or pass --project <path> to install as a project plugin."
15329
+ ].join("\n")
15330
+ )
15331
+ );
15332
+ } else {
15333
+ const shouldInstall = await promptYesNo(promptTarget, {
15334
+ defaultYes: true
15335
+ });
15336
+ if (shouldInstall) {
15337
+ const result = installedEngine && uproject ? installUnrealMcpPluginToProject(uproject) : installUnrealMcpPluginToEngine(engineRoot);
15338
+ if (result.ok) {
15339
+ console.log(`Flockbay MCP plugin installed: ${result.destDir}`);
15340
+ process.env.FLOCKBAY_UNREAL_MCP_ENABLED = "1";
15341
+ process.env.ENGINE_ROOT = engineRoot;
15342
+ } else {
15343
+ console.error(chalk.yellow("Flockbay MCP plugin install skipped:"));
15344
+ console.error(chalk.gray(result.errorMessage));
15345
+ }
15316
15346
  }
15317
15347
  }
15318
15348
  }
@@ -15329,7 +15359,7 @@ ${engineRoot}`, {
15329
15359
  } else if (subcommand === "codex") {
15330
15360
  try {
15331
15361
  await chdirToNearestUprojectRootIfPresent();
15332
- const { runCodex } = await import('./runCodex-BkdEucuI.mjs');
15362
+ const { runCodex } = await import('./runCodex-Dhkynhhh.mjs');
15333
15363
  let startedBy = void 0;
15334
15364
  let sessionId = void 0;
15335
15365
  for (let i = 1; i < args.length; i++) {
@@ -15431,7 +15461,7 @@ ${engineRoot}`, {
15431
15461
  }
15432
15462
  try {
15433
15463
  await chdirToNearestUprojectRootIfPresent();
15434
- const { runGemini } = await import('./runGemini-p_aKQRTi.mjs');
15464
+ const { runGemini } = await import('./runGemini-Dq5_59Us.mjs');
15435
15465
  let startedBy = void 0;
15436
15466
  let sessionId = void 0;
15437
15467
  for (let i = 1; i < args.length; i++) {