flockbay 0.10.15
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 +56 -0
- package/bin/flockbay-mcp.mjs +56 -0
- package/bin/flockbay.mjs +78 -0
- package/dist/codex/flockbayMcpStdioBridge.cjs +383 -0
- package/dist/codex/flockbayMcpStdioBridge.d.cts +2 -0
- package/dist/codex/flockbayMcpStdioBridge.d.mts +2 -0
- package/dist/codex/flockbayMcpStdioBridge.mjs +381 -0
- package/dist/flockbayScreenshotGate-DJX3Is5d.mjs +136 -0
- package/dist/flockbayScreenshotGate-DkxU24cR.cjs +138 -0
- package/dist/index--o4BPz5o.cjs +10311 -0
- package/dist/index-CUp3juDS.mjs +10268 -0
- package/dist/index.cjs +43 -0
- package/dist/index.d.cts +1 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +40 -0
- package/dist/lib.cjs +33 -0
- package/dist/lib.d.cts +957 -0
- package/dist/lib.d.mts +957 -0
- package/dist/lib.mjs +23 -0
- package/dist/runCodex-D3eT-TvB.cjs +3449 -0
- package/dist/runCodex-o6PCbHQ7.mjs +3446 -0
- package/dist/runGemini-Bt0oEj_g.mjs +3183 -0
- package/dist/runGemini-CBxZp6I7.cjs +3185 -0
- package/dist/types-C-jnUdn_.cjs +4498 -0
- package/dist/types-DGd6ea2Z.mjs +4450 -0
- package/kits/kit.open_world/kit.json +59 -0
- package/package.json +130 -0
- package/scripts/claude_local_launcher.cjs +73 -0
- package/scripts/claude_remote_launcher.cjs +16 -0
- package/scripts/claude_version_utils.cjs +391 -0
- package/scripts/ripgrep_launcher.cjs +33 -0
- package/scripts/session_hook_forwarder.cjs +49 -0
- package/scripts/test-codex-abort-history.mjs +77 -0
- package/scripts/unpack-tools.cjs +222 -0
- package/tools/licenses/difftastic-LICENSE +21 -0
- package/tools/licenses/ripgrep-LICENSE +3 -0
- package/tools/unreal-mcp/UPSTREAM_VERSION.md +8 -0
- package/tools/unreal-mcp/upstream/Docs/README.md +8 -0
- package/tools/unreal-mcp/upstream/Docs/Tools/README.md +7 -0
- package/tools/unreal-mcp/upstream/Docs/Tools/actor_tools.md +184 -0
- package/tools/unreal-mcp/upstream/Docs/Tools/blueprint_tools.md +268 -0
- package/tools/unreal-mcp/upstream/Docs/Tools/editor_tools.md +104 -0
- package/tools/unreal-mcp/upstream/Docs/Tools/node_tools.md +274 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Config/FilterPlugin.ini +8 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPBlueprintCommands.cpp +1160 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPBlueprintNodeCommands.cpp +924 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPCommonUtils.cpp +709 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPEditorCommands.cpp +896 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPProjectCommands.cpp +72 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPUMGCommands.cpp +544 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/MCPServerRunnable.cpp +321 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/UnrealMCPBridge.cpp +419 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/UnrealMCPModule.cpp +21 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPBlueprintCommands.h +34 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPBlueprintNodeCommands.h +27 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPCommonUtils.h +59 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPEditorCommands.h +40 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPProjectCommands.h +20 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPUMGCommands.h +82 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/MCPServerRunnable.h +34 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/UnrealMCPBridge.h +64 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/UnrealMCPModule.h +22 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/UnrealMCP.Build.cs +78 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/UnrealMCP.uplugin +36 -0
- package/tools/unreal-mcp/upstream/Python/README.md +40 -0
- package/tools/unreal-mcp/upstream/Python/pyproject.toml +22 -0
- package/tools/unreal-mcp/upstream/Python/scripts/actors/test_cube.py +203 -0
- package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_blueprints_with_different_components.py +497 -0
- package/tools/unreal-mcp/upstream/Python/scripts/blueprints/test_create_and_spawn_cube_blueprint.py +194 -0
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_component_reference.py +267 -0
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_create_bird_blueprint_with_input_and_camera.py +618 -0
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_input_mapping.py +366 -0
- package/tools/unreal-mcp/upstream/Python/scripts/node/test_physics_variables.py +390 -0
- package/tools/unreal-mcp/upstream/Python/tools/blueprint_tools.py +420 -0
- package/tools/unreal-mcp/upstream/Python/tools/editor_tools.py +369 -0
- package/tools/unreal-mcp/upstream/Python/tools/node_tools.py +430 -0
- package/tools/unreal-mcp/upstream/Python/tools/project_tools.py +64 -0
- package/tools/unreal-mcp/upstream/Python/tools/umg_tools.py +333 -0
- package/tools/unreal-mcp/upstream/Python/unreal_mcp_server.py +398 -0
- package/tools/unreal-mcp/upstream/Python/uv.lock +521 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ripgrep runner - executed as a subprocess to run the native module
|
|
5
|
+
* This file is intentionally written in CommonJS to avoid ESM complexities
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const path = require('path');
|
|
9
|
+
|
|
10
|
+
// Load the native module from unpacked directory
|
|
11
|
+
const modulePath = path.join(__dirname, '..', 'tools', 'unpacked', 'ripgrep.node');
|
|
12
|
+
const ripgrepNative = require(modulePath);
|
|
13
|
+
|
|
14
|
+
// Get arguments from command line (skip node and script name)
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
|
|
17
|
+
// Parse the JSON-encoded arguments
|
|
18
|
+
let parsedArgs;
|
|
19
|
+
try {
|
|
20
|
+
parsedArgs = JSON.parse(args[0]);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
console.error('Failed to parse arguments:', error.message);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// Run ripgrep
|
|
27
|
+
try {
|
|
28
|
+
const exitCode = ripgrepNative.ripgrepMain(parsedArgs);
|
|
29
|
+
process.exit(exitCode);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('Ripgrep error:', error.message);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Session Hook Forwarder
|
|
4
|
+
*
|
|
5
|
+
* This script is executed by Claude's SessionStart hook.
|
|
6
|
+
* It reads JSON data from stdin and forwards it to Flockbay's hook server.
|
|
7
|
+
*
|
|
8
|
+
* Usage: echo '{"session_id":"..."}' | node session_hook_forwarder.cjs <port>
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const http = require('http');
|
|
12
|
+
|
|
13
|
+
const port = parseInt(process.argv[2], 10);
|
|
14
|
+
|
|
15
|
+
if (!port || isNaN(port)) {
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const chunks = [];
|
|
20
|
+
|
|
21
|
+
process.stdin.on('data', (chunk) => {
|
|
22
|
+
chunks.push(chunk);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
process.stdin.on('end', () => {
|
|
26
|
+
const body = Buffer.concat(chunks);
|
|
27
|
+
|
|
28
|
+
const req = http.request({
|
|
29
|
+
host: '127.0.0.1',
|
|
30
|
+
port: port,
|
|
31
|
+
method: 'POST',
|
|
32
|
+
path: '/hook/session-start',
|
|
33
|
+
headers: {
|
|
34
|
+
'Content-Type': 'application/json',
|
|
35
|
+
'Content-Length': body.length
|
|
36
|
+
}
|
|
37
|
+
}, (res) => {
|
|
38
|
+
res.resume(); // Drain response
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
req.on('error', (error) => {
|
|
42
|
+
// Don't throw (this runs inside Claude hooks), but don't mask failures either.
|
|
43
|
+
console.error('[session_hook_forwarder] Failed to forward session-start hook:', error?.message || error);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
req.end(body);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
process.stdin.resume();
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { setTimeout as delay } from 'node:timers/promises';
|
|
4
|
+
|
|
5
|
+
// Minimal, optional integration check (uses local `codex` CLI via MCP).
|
|
6
|
+
// Goal: verify that an abort does NOT force a new Codex session / lose context.
|
|
7
|
+
//
|
|
8
|
+
// Usage:
|
|
9
|
+
// node flockbay-cli/scripts/test-codex-abort-history.mjs
|
|
10
|
+
// ABORT_DELAY_MS=50 node flockbay-cli/scripts/test-codex-abort-history.mjs
|
|
11
|
+
//
|
|
12
|
+
// Exits:
|
|
13
|
+
// 0 on pass
|
|
14
|
+
// 1 on fail
|
|
15
|
+
|
|
16
|
+
const ABORT_DELAY_MS = Number(process.env.ABORT_DELAY_MS || 50);
|
|
17
|
+
|
|
18
|
+
function extractText(res) {
|
|
19
|
+
const items = Array.isArray(res?.content) ? res.content : [];
|
|
20
|
+
return items
|
|
21
|
+
.map((x) => (x && x.type === 'text' ? x.text : ''))
|
|
22
|
+
.filter(Boolean)
|
|
23
|
+
.join('\n');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function main() {
|
|
27
|
+
const { CodexMcpClient } = await import('../dist/codex/codexMcpClient.cjs');
|
|
28
|
+
|
|
29
|
+
const client = new CodexMcpClient();
|
|
30
|
+
await client.connect();
|
|
31
|
+
|
|
32
|
+
const seed = `Remember these three items for this chat, and respond with ONLY the word: ack\n- green apple\n- red horse\n- purple giraffe\n\nRun id: ${randomUUID()}`;
|
|
33
|
+
await client.startSession({
|
|
34
|
+
prompt: seed,
|
|
35
|
+
sandbox: 'workspace-write',
|
|
36
|
+
'approval-policy': 'untrusted',
|
|
37
|
+
config: {},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
// Fire a request and abort it quickly (tries to exercise the abort path).
|
|
41
|
+
const abortController = new AbortController();
|
|
42
|
+
const inflight = client.continueSession(
|
|
43
|
+
`Write 2000 words about the three items (this is intentionally long).`,
|
|
44
|
+
{ signal: abortController.signal },
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
await delay(ABORT_DELAY_MS);
|
|
48
|
+
abortController.abort();
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
await inflight;
|
|
52
|
+
} catch {
|
|
53
|
+
// Expected: abort cancels the in-flight request.
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const recall = await client.startSession({
|
|
57
|
+
prompt: `List the three items you were asked to remember. Reply in 3 bullet points only.`,
|
|
58
|
+
config: {},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const text = extractText(recall).toLowerCase();
|
|
62
|
+
const ok = text.includes('green') && text.includes('red') && text.includes('purple');
|
|
63
|
+
if (!ok) {
|
|
64
|
+
console.error('FAIL: missing expected recall terms');
|
|
65
|
+
console.error(text);
|
|
66
|
+
process.exit(1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
console.log('PASS');
|
|
70
|
+
process.exit(0);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
main().catch((err) => {
|
|
74
|
+
console.error('FAIL:', err?.stack || err?.message || String(err));
|
|
75
|
+
process.exit(1);
|
|
76
|
+
});
|
|
77
|
+
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Unpacks platform-specific binaries from compressed archives
|
|
5
|
+
* This script extracts the necessary tools for the current platform
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const zlib = require('zlib');
|
|
11
|
+
const tar = require('tar');
|
|
12
|
+
const os = require('os');
|
|
13
|
+
const https = require('https');
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get the platform-specific directory name
|
|
17
|
+
*/
|
|
18
|
+
function getPlatformDir() {
|
|
19
|
+
const platform = os.platform();
|
|
20
|
+
const arch = os.arch();
|
|
21
|
+
|
|
22
|
+
if (platform === 'darwin') {
|
|
23
|
+
if (arch === 'arm64') return 'arm64-darwin';
|
|
24
|
+
if (arch === 'x64') return 'x64-darwin';
|
|
25
|
+
} else if (platform === 'linux') {
|
|
26
|
+
if (arch === 'arm64') return 'arm64-linux';
|
|
27
|
+
if (arch === 'x64') return 'x64-linux';
|
|
28
|
+
} else if (platform === 'win32') {
|
|
29
|
+
if (arch === 'x64') return 'x64-win32';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error(`Unsupported platform: ${arch}-${platform}`);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the root tools directory
|
|
37
|
+
*/
|
|
38
|
+
function getToolsDir() {
|
|
39
|
+
// Handle both direct execution and require() calls
|
|
40
|
+
const scriptDir = __dirname;
|
|
41
|
+
return path.resolve(scriptDir, '..', 'tools');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getToolsBaseUrl() {
|
|
45
|
+
// Allow override for development/testing or alternative mirrors.
|
|
46
|
+
// Default points at our public Cloudflare Worker path that serves R2 objects.
|
|
47
|
+
return (process.env.FLOCKBAY_TOOLS_BASE_URL || 'https://api.flockbay.com/bootstrap/tools').replace(/\/+$/, '');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function downloadFile(url, destPath, redirectCount = 0) {
|
|
51
|
+
return new Promise((resolve, reject) => {
|
|
52
|
+
if (redirectCount > 5) {
|
|
53
|
+
reject(new Error(`Too many redirects while downloading: ${url}`));
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const req = https.get(url, (res) => {
|
|
58
|
+
const statusCode = res.statusCode || 0;
|
|
59
|
+
|
|
60
|
+
if (statusCode >= 300 && statusCode < 400 && res.headers.location) {
|
|
61
|
+
const nextUrl = new URL(res.headers.location, url).toString();
|
|
62
|
+
res.resume();
|
|
63
|
+
downloadFile(nextUrl, destPath, redirectCount + 1).then(resolve).catch(reject);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (statusCode !== 200) {
|
|
68
|
+
res.resume();
|
|
69
|
+
reject(new Error(`Download failed (${statusCode}) for ${url}`));
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const tmpPath = `${destPath}.tmp`;
|
|
74
|
+
const out = fs.createWriteStream(tmpPath);
|
|
75
|
+
res.pipe(out);
|
|
76
|
+
out.on('finish', () => {
|
|
77
|
+
out.close(() => {
|
|
78
|
+
fs.renameSync(tmpPath, destPath);
|
|
79
|
+
resolve();
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
out.on('error', (err) => {
|
|
83
|
+
try { fs.unlinkSync(tmpPath); } catch {}
|
|
84
|
+
reject(err);
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
req.on('error', reject);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Check if tools are already unpacked for current platform
|
|
94
|
+
*/
|
|
95
|
+
function areToolsUnpacked(toolsDir) {
|
|
96
|
+
const unpackedPath = path.join(toolsDir, 'unpacked');
|
|
97
|
+
|
|
98
|
+
if (!fs.existsSync(unpackedPath)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Check for expected binaries
|
|
103
|
+
const isWin = os.platform() === 'win32';
|
|
104
|
+
const difftBinary = isWin ? 'difft.exe' : 'difft';
|
|
105
|
+
const rgBinary = isWin ? 'rg.exe' : 'rg';
|
|
106
|
+
|
|
107
|
+
const expectedFiles = [
|
|
108
|
+
path.join(unpackedPath, difftBinary),
|
|
109
|
+
path.join(unpackedPath, rgBinary),
|
|
110
|
+
path.join(unpackedPath, 'ripgrep.node')
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
return expectedFiles.every(file => fs.existsSync(file));
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Unpack a tar.gz archive to a destination directory
|
|
118
|
+
*/
|
|
119
|
+
async function unpackArchive(archivePath, destDir) {
|
|
120
|
+
return new Promise((resolve, reject) => {
|
|
121
|
+
// Ensure destination directory exists
|
|
122
|
+
if (!fs.existsSync(destDir)) {
|
|
123
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
// Create read stream and extract
|
|
127
|
+
fs.createReadStream(archivePath)
|
|
128
|
+
.pipe(zlib.createGunzip())
|
|
129
|
+
.pipe(tar.extract({
|
|
130
|
+
cwd: destDir,
|
|
131
|
+
preserveMode: true,
|
|
132
|
+
preserveOwner: false
|
|
133
|
+
}))
|
|
134
|
+
.on('finish', () => {
|
|
135
|
+
// Set executable permissions for Unix systems
|
|
136
|
+
if (os.platform() !== 'win32') {
|
|
137
|
+
const files = fs.readdirSync(destDir);
|
|
138
|
+
files.forEach(file => {
|
|
139
|
+
const filePath = path.join(destDir, file);
|
|
140
|
+
const stats = fs.statSync(filePath);
|
|
141
|
+
if (stats.isFile() && !file.endsWith('.node')) {
|
|
142
|
+
// Make binary files executable
|
|
143
|
+
fs.chmodSync(filePath, 0o755);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
resolve();
|
|
148
|
+
})
|
|
149
|
+
.on('error', reject);
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Main unpacking function
|
|
155
|
+
*/
|
|
156
|
+
async function unpackTools() {
|
|
157
|
+
try {
|
|
158
|
+
const platformDir = getPlatformDir();
|
|
159
|
+
const toolsDir = getToolsDir();
|
|
160
|
+
const archivesDir = path.join(toolsDir, 'archives');
|
|
161
|
+
const unpackedPath = path.join(toolsDir, 'unpacked');
|
|
162
|
+
const baseUrl = getToolsBaseUrl();
|
|
163
|
+
|
|
164
|
+
// Check if already unpacked
|
|
165
|
+
if (areToolsUnpacked(toolsDir)) {
|
|
166
|
+
console.log(`Tools already unpacked for ${platformDir}`);
|
|
167
|
+
return { success: true, alreadyUnpacked: true };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
console.log(`Unpacking tools for ${platformDir}...`);
|
|
171
|
+
|
|
172
|
+
// Create unpacked directory
|
|
173
|
+
if (!fs.existsSync(unpackedPath)) {
|
|
174
|
+
fs.mkdirSync(unpackedPath, { recursive: true });
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// Ensure archives directory exists (archives are downloaded on-demand in npm installs)
|
|
178
|
+
if (!fs.existsSync(archivesDir)) {
|
|
179
|
+
fs.mkdirSync(archivesDir, { recursive: true });
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Unpack difftastic
|
|
183
|
+
const difftasticArchive = path.join(archivesDir, `difftastic-${platformDir}.tar.gz`);
|
|
184
|
+
if (!fs.existsSync(difftasticArchive)) {
|
|
185
|
+
const url = `${baseUrl}/difftastic-${platformDir}.tar.gz`;
|
|
186
|
+
console.log(`Downloading difftastic archive: ${url}`);
|
|
187
|
+
await downloadFile(url, difftasticArchive);
|
|
188
|
+
}
|
|
189
|
+
await unpackArchive(difftasticArchive, unpackedPath);
|
|
190
|
+
|
|
191
|
+
// Unpack ripgrep
|
|
192
|
+
const ripgrepArchive = path.join(archivesDir, `ripgrep-${platformDir}.tar.gz`);
|
|
193
|
+
if (!fs.existsSync(ripgrepArchive)) {
|
|
194
|
+
const url = `${baseUrl}/ripgrep-${platformDir}.tar.gz`;
|
|
195
|
+
console.log(`Downloading ripgrep archive: ${url}`);
|
|
196
|
+
await downloadFile(url, ripgrepArchive);
|
|
197
|
+
}
|
|
198
|
+
await unpackArchive(ripgrepArchive, unpackedPath);
|
|
199
|
+
|
|
200
|
+
console.log(`Tools unpacked successfully to ${unpackedPath}`);
|
|
201
|
+
return { success: true, alreadyUnpacked: false };
|
|
202
|
+
|
|
203
|
+
} catch (error) {
|
|
204
|
+
console.error('Failed to unpack tools:', error.message);
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// Export for use as module
|
|
210
|
+
module.exports = { unpackTools, getPlatformDir, getToolsDir };
|
|
211
|
+
|
|
212
|
+
// Run if executed directly
|
|
213
|
+
if (require.main === module) {
|
|
214
|
+
unpackTools()
|
|
215
|
+
.then(result => {
|
|
216
|
+
process.exit(0);
|
|
217
|
+
})
|
|
218
|
+
.catch(error => {
|
|
219
|
+
console.error('Error:', error);
|
|
220
|
+
process.exit(1);
|
|
221
|
+
});
|
|
222
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-2025 Wilfred Hughes
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Unreal Engine MCP Documentation
|
|
2
|
+
|
|
3
|
+
Welcome to the documentation for the Unreal Engine Model Context Protocol (MCP) integration. This documentation will help you understand, set up, and use the MCP system with Unreal Engine.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- [Tools](Tools/README.md) - All the tools that are available.
|
|
8
|
+
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# Unreal MCP Editor Tools
|
|
2
|
+
|
|
3
|
+
This document provides detailed information about the actor tools available in the Unreal MCP integration.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Actor tools allow you to manipulate actors in the Unreal Engine scene.
|
|
8
|
+
|
|
9
|
+
## Actor Tools
|
|
10
|
+
|
|
11
|
+
### get_actors_in_level
|
|
12
|
+
|
|
13
|
+
Get a list of all actors in the current level.
|
|
14
|
+
|
|
15
|
+
**Parameters:**
|
|
16
|
+
- None
|
|
17
|
+
|
|
18
|
+
**Returns:**
|
|
19
|
+
- List of all actors with their properties
|
|
20
|
+
|
|
21
|
+
**Example:**
|
|
22
|
+
```json
|
|
23
|
+
{
|
|
24
|
+
"command": "get_actors_in_level",
|
|
25
|
+
"params": {}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### find_actors_by_name
|
|
30
|
+
|
|
31
|
+
Find actors in the current level by name pattern.
|
|
32
|
+
|
|
33
|
+
**Parameters:**
|
|
34
|
+
- `pattern` (string) - The name or partial name pattern to search for
|
|
35
|
+
|
|
36
|
+
**Returns:**
|
|
37
|
+
- List of matching actor names
|
|
38
|
+
|
|
39
|
+
**Example:**
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"command": "find_actors_by_name",
|
|
43
|
+
"params": {
|
|
44
|
+
"pattern": "Cube"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### create_actor
|
|
50
|
+
|
|
51
|
+
Create a new actor in the current level.
|
|
52
|
+
|
|
53
|
+
**Parameters:**
|
|
54
|
+
- `name` (string) - The name for the new actor (must be unique)
|
|
55
|
+
- `type` (string) - The type of actor to create (must be uppercase)
|
|
56
|
+
- `location` (array, optional) - [X, Y, Z] coordinates for the actor's position, defaults to [0, 0, 0]
|
|
57
|
+
- `rotation` (array, optional) - [Pitch, Yaw, Roll] values for the actor's rotation, defaults to [0, 0, 0]
|
|
58
|
+
- `scale` (array, optional) - [X, Y, Z] values for the actor's scale, defaults to [1, 1, 1]
|
|
59
|
+
|
|
60
|
+
**Returns:**
|
|
61
|
+
- Information about the created actor
|
|
62
|
+
|
|
63
|
+
**Example:**
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"command": "create_actor",
|
|
67
|
+
"params": {
|
|
68
|
+
"name": "MyCube",
|
|
69
|
+
"type": "CUBE",
|
|
70
|
+
"location": [0, 0, 100],
|
|
71
|
+
"rotation": [0, 45, 0],
|
|
72
|
+
"scale": [2, 2, 2]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### delete_actor
|
|
78
|
+
|
|
79
|
+
Delete an actor by name.
|
|
80
|
+
|
|
81
|
+
**Parameters:**
|
|
82
|
+
- `name` (string) - The name of the actor to delete
|
|
83
|
+
|
|
84
|
+
**Returns:**
|
|
85
|
+
- Result of the delete operation
|
|
86
|
+
|
|
87
|
+
**Example:**
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"command": "delete_actor",
|
|
91
|
+
"params": {
|
|
92
|
+
"name": "MyCube"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### set_actor_transform
|
|
98
|
+
|
|
99
|
+
Set the transform (location, rotation, scale) of an actor.
|
|
100
|
+
|
|
101
|
+
**Parameters:**
|
|
102
|
+
- `name` (string) - The name of the actor to modify
|
|
103
|
+
- `location` (array, optional) - [X, Y, Z] coordinates for the actor's position
|
|
104
|
+
- `rotation` (array, optional) - [Pitch, Yaw, Roll] values for the actor's rotation
|
|
105
|
+
- `scale` (array, optional) - [X, Y, Z] values for the actor's scale
|
|
106
|
+
|
|
107
|
+
**Returns:**
|
|
108
|
+
- Result of the transform operation
|
|
109
|
+
|
|
110
|
+
**Example:**
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"command": "set_actor_transform",
|
|
114
|
+
"params": {
|
|
115
|
+
"name": "MyCube",
|
|
116
|
+
"location": [100, 200, 300],
|
|
117
|
+
"rotation": [0, 90, 0]
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### get_actor_properties
|
|
123
|
+
|
|
124
|
+
Get all properties of an actor.
|
|
125
|
+
|
|
126
|
+
**Parameters:**
|
|
127
|
+
- `name` (string) - The name of the actor
|
|
128
|
+
|
|
129
|
+
**Returns:**
|
|
130
|
+
- Object containing all actor properties
|
|
131
|
+
|
|
132
|
+
**Example:**
|
|
133
|
+
```json
|
|
134
|
+
{
|
|
135
|
+
"command": "get_actor_properties",
|
|
136
|
+
"params": {
|
|
137
|
+
"name": "MyCube"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Error Handling
|
|
143
|
+
|
|
144
|
+
All command responses include a "success" field indicating whether the operation succeeded, and an optional "message" field with details in case of failure.
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
{
|
|
148
|
+
"success": false,
|
|
149
|
+
"message": "Actor 'MyCube' not found in the current level"
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Implementation Notes
|
|
154
|
+
|
|
155
|
+
- All numeric parameters for transforms (location, rotation, scale) must be provided as lists of 3 float values
|
|
156
|
+
- Actor types should be provided in uppercase
|
|
157
|
+
- The server maintains logging of all operations with detailed information and error messages
|
|
158
|
+
- All commands are executed through a connection to the Unreal Engine editor
|
|
159
|
+
|
|
160
|
+
## Type Reference
|
|
161
|
+
|
|
162
|
+
### Actor Types
|
|
163
|
+
|
|
164
|
+
Supported actor types for the `create_actor` command:
|
|
165
|
+
|
|
166
|
+
- `CUBE` - Static mesh cube
|
|
167
|
+
- `SPHERE` - Static mesh sphere
|
|
168
|
+
- `CYLINDER` - Static mesh cylinder
|
|
169
|
+
- `PLANE` - Static mesh plane
|
|
170
|
+
- `POINT_LIGHT` - Point light source
|
|
171
|
+
- `SPOT_LIGHT` - Spot light source
|
|
172
|
+
- `DIRECTIONAL_LIGHT` - Directional light source
|
|
173
|
+
- `CAMERA` - Camera actor
|
|
174
|
+
- `EMPTY` - Empty actor (container)
|
|
175
|
+
|
|
176
|
+
## Future Extensions
|
|
177
|
+
|
|
178
|
+
The following tool categories are planned for future releases:
|
|
179
|
+
|
|
180
|
+
- **Level Tools**: Managing Unreal Engine levels
|
|
181
|
+
- **Material Tools**: Creating and editing materials
|
|
182
|
+
- **Blueprint Tools**: Manipulating Blueprints
|
|
183
|
+
- **Asset Tools**: Managing project assets
|
|
184
|
+
- **Editor Tools**: Controlling the Unreal Editor
|