flockbay 0.10.49 → 0.10.52
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 +60 -60
- package/bin/flockbay-mcp.mjs +62 -62
- package/bin/flockbay.mjs +95 -95
- package/dist/{index-r3VTdgFI.cjs → index-IntvnrmZ.cjs} +71 -14
- package/dist/{index-D8AeVbvv.mjs → index-wkeSi0iC.mjs} +70 -13
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/dist/lib.cjs +1 -1
- package/dist/lib.mjs +1 -1
- package/dist/{migratePlugin-CEvGPul8.mjs → migratePlugin-C71hAoc5.mjs} +12 -2
- package/dist/{migratePlugin-wFK-k3Wk.cjs → migratePlugin-D1XjjWFq.cjs} +12 -2
- package/dist/{runCodex-DuyuYqoB.cjs → runCodex-B7i_ICoQ.cjs} +34 -23
- package/dist/{runCodex-ZfUyhHF6.mjs → runCodex-BSx-hCu6.mjs} +34 -23
- package/dist/{runGemini-DBU1mMdp.mjs → runGemini-Dwyh7_WI.mjs} +2 -2
- package/dist/{runGemini-D7j5Y5TF.cjs → runGemini-gBKR3rdL.cjs} +2 -2
- package/dist/{types-DNr0xwSy.cjs → types-5z8UADAi.cjs} +224 -15
- package/dist/{types-BRJuZQj_.mjs → types-Bgzap7qR.mjs} +224 -16
- package/package.json +131 -131
- package/scripts/claude_local_launcher.cjs +72 -72
- package/scripts/claude_remote_launcher.cjs +15 -15
- package/scripts/claude_version_utils.cjs +445 -445
- package/scripts/ripgrep_launcher.cjs +32 -32
- package/scripts/run-with-root-env.mjs +37 -32
- package/scripts/session_hook_forwarder.cjs +49 -49
- package/scripts/test-codex-abort-history.mjs +77 -77
- package/scripts/unpack-tools.cjs +244 -244
- package/tools/licenses/difftastic-LICENSE +21 -21
- package/tools/licenses/ripgrep-LICENSE +3 -3
- package/tools/unreal-mcp/UPSTREAM_VERSION.md +8 -8
- package/tools/unreal-mcp/upstream/Docs/README.md +8 -8
- package/tools/unreal-mcp/upstream/Docs/Tools/README.md +6 -6
- package/tools/unreal-mcp/upstream/Docs/Tools/actor_tools.md +183 -183
- package/tools/unreal-mcp/upstream/Docs/Tools/blueprint_tools.md +268 -268
- package/tools/unreal-mcp/upstream/Docs/Tools/editor_tools.md +104 -104
- package/tools/unreal-mcp/upstream/Docs/Tools/node_tools.md +274 -274
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Config/FilterPlugin.ini +8 -8
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/FlockbayMCP.uplugin +36 -36
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/FlockbayMCP.Build.cs +82 -82
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintCommands.cpp +1364 -1364
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintNodeCommands.cpp +1310 -1310
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPCommandSchema.cpp +756 -756
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPCommonUtils.cpp +1177 -1177
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPEditorCommands.cpp +2618 -2618
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPProjectCommands.cpp +71 -71
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPUMGCommands.cpp +543 -543
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/MCPServerRunnable.cpp +372 -372
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/UnrealMCPBridge.cpp +457 -457
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/UnrealMCPModule.cpp +21 -21
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPBlueprintCommands.h +35 -35
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPBlueprintNodeCommands.h +30 -30
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPCommandSchema.h +41 -41
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPCommonUtils.h +59 -59
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPEditorCommands.h +61 -61
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPProjectCommands.h +20 -20
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/Commands/UnrealMCPUMGCommands.h +82 -82
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/MCPServerRunnable.h +33 -33
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/UnrealMCPBridge.h +64 -64
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Public/UnrealMCPModule.h +22 -22
- package/tools/unreal-mcp/upstream/Python/README.md +39 -39
- package/tools/unreal-mcp/upstream/Python/pyproject.toml +22 -22
- package/tools/unreal-mcp/upstream/Python/scripts/actors/test_cube.py +202 -202
- package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_blueprints_with_different_components.py +496 -496
- package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_cube_blueprint.py +193 -193
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_component_reference.py +266 -266
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_create_bird_blueprint_with_input_and_camera.py +617 -617
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_input_mapping.py +365 -365
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_physics_variables.py +389 -389
- package/tools/unreal-mcp/upstream/Python/tools/blueprint_tools.py +419 -419
- package/tools/unreal-mcp/upstream/Python/tools/editor_tools.py +369 -369
- package/tools/unreal-mcp/upstream/Python/tools/node_tools.py +429 -429
- package/tools/unreal-mcp/upstream/Python/tools/project_tools.py +63 -63
- package/tools/unreal-mcp/upstream/Python/tools/umg_tools.py +332 -332
- package/tools/unreal-mcp/upstream/Python/unreal_mcp_server.py +398 -398
- 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.
|
package/bin/flockbay-mcp.mjs
CHANGED
|
@@ -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
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
4
|
var os = require('node:os');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
|
-
var types = require('./types-
|
|
6
|
+
var types = require('./types-5z8UADAi.cjs');
|
|
7
7
|
var node_child_process = require('node:child_process');
|
|
8
8
|
var path = require('node:path');
|
|
9
9
|
var node_readline = require('node:readline');
|
|
@@ -982,7 +982,11 @@ async function claudeLocalLauncher(session) {
|
|
|
982
982
|
} catch (e) {
|
|
983
983
|
types.logger.debug("[local]: launch error", e);
|
|
984
984
|
if (!exitReason) {
|
|
985
|
-
|
|
985
|
+
const details = e instanceof Error ? e.message : String(e);
|
|
986
|
+
session.client.sendSessionEvent({
|
|
987
|
+
type: "message",
|
|
988
|
+
message: `Process exited unexpectedly${details ? `: ${details}` : ""}`
|
|
989
|
+
});
|
|
986
990
|
continue;
|
|
987
991
|
} else {
|
|
988
992
|
break;
|
|
@@ -1319,7 +1323,7 @@ function buildDaemonSafeEnv(baseEnv, binPath) {
|
|
|
1319
1323
|
env[pathKey] = [...prepend, ...existingParts].join(pathSep);
|
|
1320
1324
|
return env;
|
|
1321
1325
|
}
|
|
1322
|
-
const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-
|
|
1326
|
+
const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-IntvnrmZ.cjs', document.baseURI).href)));
|
|
1323
1327
|
const __dirname$1 = path.join(__filename$1, "..");
|
|
1324
1328
|
function getGlobalClaudeVersion(claudeExecutable) {
|
|
1325
1329
|
try {
|
|
@@ -1522,6 +1526,40 @@ async function streamToStdin(stream, stdin, abort) {
|
|
|
1522
1526
|
stdin.end();
|
|
1523
1527
|
}
|
|
1524
1528
|
|
|
1529
|
+
function trimProcessDiagnostic(text) {
|
|
1530
|
+
const lines = String(text || "").split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
1531
|
+
if (lines.length === 0) return "";
|
|
1532
|
+
return lines.slice(-8).join("\n");
|
|
1533
|
+
}
|
|
1534
|
+
function buildClaudeProcessExitMessage(args) {
|
|
1535
|
+
const stderrText = String(args.stderrText || "");
|
|
1536
|
+
const stderr = trimProcessDiagnostic(stderrText);
|
|
1537
|
+
const combined = [stderrText, args.spawnError?.message || ""].filter(Boolean).join("\n");
|
|
1538
|
+
if (/claude code is not installed/i.test(combined)) {
|
|
1539
|
+
return [
|
|
1540
|
+
"Claude Code is not installed on this machine.",
|
|
1541
|
+
"Install it, then restart Flockbay:",
|
|
1542
|
+
process$1.platform === "win32" ? " npm install -g @anthropic-ai/claude-code" : " npm install -g @anthropic-ai/claude-code"
|
|
1543
|
+
].join("\n");
|
|
1544
|
+
}
|
|
1545
|
+
if (/not recognized as an internal or external command|command not found|spawn .*enoent|enoent/i.test(combined)) {
|
|
1546
|
+
return [
|
|
1547
|
+
"Claude Code could not be found on PATH.",
|
|
1548
|
+
"Install it, then restart Flockbay:",
|
|
1549
|
+
" npm install -g @anthropic-ai/claude-code"
|
|
1550
|
+
].join("\n");
|
|
1551
|
+
}
|
|
1552
|
+
if (/git bash|bash\.exe|claude_code_git_bash_path/i.test(combined)) {
|
|
1553
|
+
return [
|
|
1554
|
+
"Claude Code could not start because Git Bash is missing or not configured.",
|
|
1555
|
+
"Install Git for Windows, then set CLAUDE_CODE_GIT_BASH_PATH to your bash.exe path and restart Flockbay."
|
|
1556
|
+
].join("\n");
|
|
1557
|
+
}
|
|
1558
|
+
if (stderr) {
|
|
1559
|
+
return `Claude Code process exited with code ${args.code}. Details: ${stderr}`;
|
|
1560
|
+
}
|
|
1561
|
+
return `Claude Code process exited with code ${args.code}`;
|
|
1562
|
+
}
|
|
1525
1563
|
class Query {
|
|
1526
1564
|
constructor(childStdin, childStdout, processExitPromise, canCallTool) {
|
|
1527
1565
|
this.childStdin = childStdin;
|
|
@@ -1791,11 +1829,17 @@ function query(config) {
|
|
|
1791
1829
|
streamToStdin(prompt, child.stdin, config.options?.abort);
|
|
1792
1830
|
childStdin = child.stdin;
|
|
1793
1831
|
}
|
|
1794
|
-
|
|
1795
|
-
|
|
1832
|
+
let stderrTail = "";
|
|
1833
|
+
const appendStderr = (chunk) => {
|
|
1834
|
+
stderrTail += chunk.toString();
|
|
1835
|
+
if (stderrTail.length > 32e3) stderrTail = stderrTail.slice(-16e3);
|
|
1836
|
+
};
|
|
1837
|
+
child.stderr.on("data", (data) => {
|
|
1838
|
+
appendStderr(data);
|
|
1839
|
+
if (process$1.env.DEBUG) {
|
|
1796
1840
|
console.error("Claude Code stderr:", data.toString());
|
|
1797
|
-
}
|
|
1798
|
-
}
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1799
1843
|
const cleanup = () => {
|
|
1800
1844
|
if (!child.killed) {
|
|
1801
1845
|
child.kill("SIGTERM");
|
|
@@ -1809,7 +1853,7 @@ function query(config) {
|
|
|
1809
1853
|
query2.setError(new AbortError("Claude Code process aborted by user"));
|
|
1810
1854
|
}
|
|
1811
1855
|
if (code !== 0) {
|
|
1812
|
-
query2.setError(new Error(
|
|
1856
|
+
query2.setError(new Error(buildClaudeProcessExitMessage({ code, stderrText: stderrTail })));
|
|
1813
1857
|
} else {
|
|
1814
1858
|
resolve();
|
|
1815
1859
|
}
|
|
@@ -1820,7 +1864,7 @@ function query(config) {
|
|
|
1820
1864
|
if (config.options?.abort?.aborted) {
|
|
1821
1865
|
query2.setError(new AbortError("Claude Code process aborted by user"));
|
|
1822
1866
|
} else {
|
|
1823
|
-
query2.setError(new Error(
|
|
1867
|
+
query2.setError(new Error(buildClaudeProcessExitMessage({ code: null, stderrText: stderrTail, spawnError: error })));
|
|
1824
1868
|
}
|
|
1825
1869
|
});
|
|
1826
1870
|
processExitPromise.finally(() => {
|
|
@@ -2052,11 +2096,24 @@ function normalizeFilePathToken(token) {
|
|
|
2052
2096
|
function resolveCandidatePath(candidate, cwd) {
|
|
2053
2097
|
const raw = normalizeFilePathToken(candidate);
|
|
2054
2098
|
if (!raw) return raw;
|
|
2099
|
+
const isWindowsPath = (value) => {
|
|
2100
|
+
const v = String(value || "").trim();
|
|
2101
|
+
if (!v) return false;
|
|
2102
|
+
if (/^[a-zA-Z]:[\\/]/.test(v)) return true;
|
|
2103
|
+
if (v.startsWith("\\\\")) return true;
|
|
2104
|
+
return false;
|
|
2105
|
+
};
|
|
2106
|
+
const isPosixPath = (value) => String(value || "").trim().startsWith("/");
|
|
2107
|
+
const resolveApi = (() => {
|
|
2108
|
+
if (isWindowsPath(raw) || isWindowsPath(cwd)) return path.win32;
|
|
2109
|
+
if (isPosixPath(raw) || isPosixPath(cwd)) return path.posix;
|
|
2110
|
+
return path;
|
|
2111
|
+
})();
|
|
2055
2112
|
if (raw.startsWith("~/")) {
|
|
2056
2113
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
2057
|
-
if (home) return
|
|
2114
|
+
if (home) return resolveApi.join(home, raw.slice(2));
|
|
2058
2115
|
}
|
|
2059
|
-
return
|
|
2116
|
+
return resolveApi.isAbsolute(raw) ? raw : resolveApi.resolve(cwd, raw);
|
|
2060
2117
|
}
|
|
2061
2118
|
function isImageBlock(block) {
|
|
2062
2119
|
if (!block || typeof block !== "object") return false;
|
|
@@ -15212,7 +15269,7 @@ async function authAndSetupMachineIfNeeded() {
|
|
|
15212
15269
|
process.exit(1);
|
|
15213
15270
|
}
|
|
15214
15271
|
try {
|
|
15215
|
-
const { migrateUnrealMcpToFlockbayMcp } = await Promise.resolve().then(function () { return require('./migratePlugin-
|
|
15272
|
+
const { migrateUnrealMcpToFlockbayMcp } = await Promise.resolve().then(function () { return require('./migratePlugin-D1XjjWFq.cjs'); });
|
|
15216
15273
|
const result = migrateUnrealMcpToFlockbayMcp({
|
|
15217
15274
|
engineRoot,
|
|
15218
15275
|
projectUprojectPath: project || void 0,
|
|
@@ -15368,7 +15425,7 @@ ${engineRoot}`;
|
|
|
15368
15425
|
} else if (subcommand === "codex") {
|
|
15369
15426
|
try {
|
|
15370
15427
|
await chdirToNearestUprojectRootIfPresent();
|
|
15371
|
-
const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-
|
|
15428
|
+
const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-B7i_ICoQ.cjs'); });
|
|
15372
15429
|
let startedBy = void 0;
|
|
15373
15430
|
let sessionId = void 0;
|
|
15374
15431
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15470,7 +15527,7 @@ ${engineRoot}`;
|
|
|
15470
15527
|
}
|
|
15471
15528
|
try {
|
|
15472
15529
|
await chdirToNearestUprojectRootIfPresent();
|
|
15473
|
-
const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-
|
|
15530
|
+
const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-gBKR3rdL.cjs'); });
|
|
15474
15531
|
let startedBy = void 0;
|
|
15475
15532
|
let sessionId = void 0;
|
|
15476
15533
|
for (let i = 1; i < args.length; i++) {
|