flockbay 0.10.45 → 0.10.46
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/dist/{index-CpdfIEVW.cjs → index-BsespsLC.cjs} +5 -5
- package/dist/{index-BRx_RPRT.mjs → index-CNHBXWGe.mjs} +4 -4
- 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--pdww8Jg.cjs → migratePlugin-B2SM0IhP.cjs} +1 -1
- package/dist/{migratePlugin-JesDYgpP.mjs → migratePlugin-CcRAl4zO.mjs} +1 -1
- package/dist/{runCodex-t2FSXDl4.cjs → runCodex-Rx9uhhBt.cjs} +2 -2
- package/dist/{runCodex-DeNgXSEc.mjs → runCodex-b9J0CZko.mjs} +2 -2
- package/dist/{runGemini-D__vNNGK.cjs → runGemini-BEFeFruX.cjs} +2 -2
- package/dist/{runGemini-X5dTcwGa.mjs → runGemini-C3cdyIH7.mjs} +2 -2
- package/dist/{types-AsI7cuLg.cjs → types-CziwW90U.cjs} +3 -3
- package/dist/{types-Cq5rjOkx.mjs → types-H7oBEqpR.mjs} +2 -2
- package/package.json +1 -1
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintCommands.cpp +19 -4
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPBlueprintNodeCommands.cpp +24 -9
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/Commands/UnrealMCPEditorCommands.cpp +17 -2
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/FlockbayMCP/Source/FlockbayMCP/Private/MCPServerRunnable.cpp +3 -3
|
@@ -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-CziwW90U.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');
|
|
@@ -1316,7 +1316,7 @@ function buildDaemonSafeEnv(baseEnv, binPath) {
|
|
|
1316
1316
|
env[pathKey] = [...prepend, ...existingParts].join(pathSep);
|
|
1317
1317
|
return env;
|
|
1318
1318
|
}
|
|
1319
|
-
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-
|
|
1319
|
+
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-BsespsLC.cjs', document.baseURI).href)));
|
|
1320
1320
|
const __dirname$1 = path.join(__filename$1, "..");
|
|
1321
1321
|
function getGlobalClaudeVersion(claudeExecutable) {
|
|
1322
1322
|
try {
|
|
@@ -15139,7 +15139,7 @@ async function authAndSetupMachineIfNeeded() {
|
|
|
15139
15139
|
process.exit(1);
|
|
15140
15140
|
}
|
|
15141
15141
|
try {
|
|
15142
|
-
const { migrateUnrealMcpToFlockbayMcp } = await Promise.resolve().then(function () { return require('./migratePlugin
|
|
15142
|
+
const { migrateUnrealMcpToFlockbayMcp } = await Promise.resolve().then(function () { return require('./migratePlugin-B2SM0IhP.cjs'); });
|
|
15143
15143
|
const result = migrateUnrealMcpToFlockbayMcp({
|
|
15144
15144
|
engineRoot,
|
|
15145
15145
|
projectUprojectPath: project || void 0,
|
|
@@ -15278,7 +15278,7 @@ ${engineRoot}`, {
|
|
|
15278
15278
|
} else if (subcommand === "codex") {
|
|
15279
15279
|
try {
|
|
15280
15280
|
await chdirToNearestUprojectRootIfPresent();
|
|
15281
|
-
const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-
|
|
15281
|
+
const { runCodex } = await Promise.resolve().then(function () { return require('./runCodex-Rx9uhhBt.cjs'); });
|
|
15282
15282
|
let startedBy = void 0;
|
|
15283
15283
|
let sessionId = void 0;
|
|
15284
15284
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15380,7 +15380,7 @@ ${engineRoot}`, {
|
|
|
15380
15380
|
}
|
|
15381
15381
|
try {
|
|
15382
15382
|
await chdirToNearestUprojectRootIfPresent();
|
|
15383
|
-
const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-
|
|
15383
|
+
const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BEFeFruX.cjs'); });
|
|
15384
15384
|
let startedBy = void 0;
|
|
15385
15385
|
let sessionId = void 0;
|
|
15386
15386
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -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-
|
|
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-H7oBEqpR.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';
|
|
@@ -15117,7 +15117,7 @@ async function authAndSetupMachineIfNeeded() {
|
|
|
15117
15117
|
process.exit(1);
|
|
15118
15118
|
}
|
|
15119
15119
|
try {
|
|
15120
|
-
const { migrateUnrealMcpToFlockbayMcp } = await import('./migratePlugin-
|
|
15120
|
+
const { migrateUnrealMcpToFlockbayMcp } = await import('./migratePlugin-CcRAl4zO.mjs');
|
|
15121
15121
|
const result = migrateUnrealMcpToFlockbayMcp({
|
|
15122
15122
|
engineRoot,
|
|
15123
15123
|
projectUprojectPath: project || void 0,
|
|
@@ -15256,7 +15256,7 @@ ${engineRoot}`, {
|
|
|
15256
15256
|
} else if (subcommand === "codex") {
|
|
15257
15257
|
try {
|
|
15258
15258
|
await chdirToNearestUprojectRootIfPresent();
|
|
15259
|
-
const { runCodex } = await import('./runCodex-
|
|
15259
|
+
const { runCodex } = await import('./runCodex-b9J0CZko.mjs');
|
|
15260
15260
|
let startedBy = void 0;
|
|
15261
15261
|
let sessionId = void 0;
|
|
15262
15262
|
for (let i = 1; i < args.length; i++) {
|
|
@@ -15358,7 +15358,7 @@ ${engineRoot}`, {
|
|
|
15358
15358
|
}
|
|
15359
15359
|
try {
|
|
15360
15360
|
await chdirToNearestUprojectRootIfPresent();
|
|
15361
|
-
const { runGemini } = await import('./runGemini-
|
|
15361
|
+
const { runGemini } = await import('./runGemini-C3cdyIH7.mjs');
|
|
15362
15362
|
let startedBy = void 0;
|
|
15363
15363
|
let sessionId = void 0;
|
|
15364
15364
|
for (let i = 1; i < args.length; i++) {
|
package/dist/index.cjs
CHANGED
package/dist/index.mjs
CHANGED
package/dist/lib.cjs
CHANGED
package/dist/lib.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-
|
|
1
|
+
export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema, c as configuration, l as logger } from './types-H7oBEqpR.mjs';
|
|
2
2
|
import 'axios';
|
|
3
3
|
import 'node:fs';
|
|
4
4
|
import 'node:os';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import fs__default from 'node:fs';
|
|
2
2
|
import path__default from 'node:path';
|
|
3
|
-
import { i as installUnrealMcpPluginToEngine } from './types-
|
|
3
|
+
import { i as installUnrealMcpPluginToEngine } from './types-H7oBEqpR.mjs';
|
|
4
4
|
import 'axios';
|
|
5
5
|
import 'node:os';
|
|
6
6
|
import 'node:events';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var ink = require('ink');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var types = require('./types-
|
|
5
|
+
var types = require('./types-CziwW90U.cjs');
|
|
6
6
|
var index_js = require('@modelcontextprotocol/sdk/client/index.js');
|
|
7
7
|
var z = require('zod');
|
|
8
8
|
var types_js = require('@modelcontextprotocol/sdk/types.js');
|
|
@@ -16,7 +16,7 @@ var process$1 = require('node:process');
|
|
|
16
16
|
var node_stream = require('node:stream');
|
|
17
17
|
var stdio_js$1 = require('@modelcontextprotocol/sdk/client/stdio.js');
|
|
18
18
|
var stdio_js = require('@modelcontextprotocol/sdk/shared/stdio.js');
|
|
19
|
-
var index = require('./index-
|
|
19
|
+
var index = require('./index-BsespsLC.cjs');
|
|
20
20
|
require('axios');
|
|
21
21
|
require('node:events');
|
|
22
22
|
require('socket.io-client');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useStdout, useInput, Box, Text, render } from 'ink';
|
|
2
2
|
import React, { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
|
-
import { l as logger, A as ApiClient, p as packageJson, c as configuration, r as readSettings, b as projectPath } from './types-
|
|
3
|
+
import { l as logger, A as ApiClient, p as packageJson, c as configuration, r as readSettings, b as projectPath } from './types-H7oBEqpR.mjs';
|
|
4
4
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
import { ElicitRequestSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -14,7 +14,7 @@ import process$1 from 'node:process';
|
|
|
14
14
|
import { PassThrough } from 'node:stream';
|
|
15
15
|
import { getDefaultEnvironment } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
16
16
|
import { ReadBuffer, serializeMessage } from '@modelcontextprotocol/sdk/shared/stdio.js';
|
|
17
|
-
import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, e as enforceCliVersionPolicy, i as initialMachineMetadata, E as ElicitationHub, n as notifyDaemonSessionStarted, M as MessageQueue2, P as PLATFORM_SYSTEM_PROMPT, a as setLatestUserImages, w as withUserImagesMarker, r as registerKillSessionHandler, b as MessageBuffer, d as startFlockbayServer, g as buildProjectCapsule, t as trimIdent, j as autoFinalizeCoordinationWorkItem, k as detectScreenshotsForGate, l as applyCoordinationSideEffectsFromMcpToolResult, m as stopCaffeinate } from './index-
|
|
17
|
+
import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, e as enforceCliVersionPolicy, i as initialMachineMetadata, E as ElicitationHub, n as notifyDaemonSessionStarted, M as MessageQueue2, P as PLATFORM_SYSTEM_PROMPT, a as setLatestUserImages, w as withUserImagesMarker, r as registerKillSessionHandler, b as MessageBuffer, d as startFlockbayServer, g as buildProjectCapsule, t as trimIdent, j as autoFinalizeCoordinationWorkItem, k as detectScreenshotsForGate, l as applyCoordinationSideEffectsFromMcpToolResult, m as stopCaffeinate } from './index-CNHBXWGe.mjs';
|
|
18
18
|
import 'axios';
|
|
19
19
|
import 'node:events';
|
|
20
20
|
import 'socket.io-client';
|
|
@@ -6,8 +6,8 @@ var node_crypto = require('node:crypto');
|
|
|
6
6
|
var os = require('node:os');
|
|
7
7
|
var path = require('node:path');
|
|
8
8
|
var fs$2 = require('node:fs/promises');
|
|
9
|
-
var types = require('./types-
|
|
10
|
-
var index = require('./index-
|
|
9
|
+
var types = require('./types-CziwW90U.cjs');
|
|
10
|
+
var index = require('./index-BsespsLC.cjs');
|
|
11
11
|
var node_child_process = require('node:child_process');
|
|
12
12
|
var sdk = require('@agentclientprotocol/sdk');
|
|
13
13
|
var fs = require('fs');
|
|
@@ -4,8 +4,8 @@ import { randomUUID, createHash } from 'node:crypto';
|
|
|
4
4
|
import os__default from 'node:os';
|
|
5
5
|
import path__default, { resolve, join as join$1, basename } from 'node:path';
|
|
6
6
|
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
|
7
|
-
import { l as logger, p as packageJson, A as ApiClient, c as configuration, r as readSettings, b as projectPath } from './types-
|
|
8
|
-
import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, e as enforceCliVersionPolicy, i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, g as buildProjectCapsule, a as setLatestUserImages, b as MessageBuffer, w as withUserImagesMarker, r as registerKillSessionHandler, d as startFlockbayServer, o as extractUserImagesMarker, p as getLatestUserImages, P as PLATFORM_SYSTEM_PROMPT, j as autoFinalizeCoordinationWorkItem, E as ElicitationHub, k as detectScreenshotsForGate, m as stopCaffeinate } from './index-
|
|
7
|
+
import { l as logger, p as packageJson, A as ApiClient, c as configuration, r as readSettings, b as projectPath } from './types-H7oBEqpR.mjs';
|
|
8
|
+
import { s as shouldCountToolCall, c as consumeToolQuota, f as formatQuotaDeniedReason, h as hashObject, e as enforceCliVersionPolicy, i as initialMachineMetadata, n as notifyDaemonSessionStarted, M as MessageQueue2, g as buildProjectCapsule, a as setLatestUserImages, b as MessageBuffer, w as withUserImagesMarker, r as registerKillSessionHandler, d as startFlockbayServer, o as extractUserImagesMarker, p as getLatestUserImages, P as PLATFORM_SYSTEM_PROMPT, j as autoFinalizeCoordinationWorkItem, E as ElicitationHub, k as detectScreenshotsForGate, m as stopCaffeinate } from './index-CNHBXWGe.mjs';
|
|
9
9
|
import { spawn, spawnSync } from 'node:child_process';
|
|
10
10
|
import { ndJsonStream, ClientSideConnection } from '@agentclientprotocol/sdk';
|
|
11
11
|
import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
@@ -44,7 +44,7 @@ function _interopNamespaceDefault(e) {
|
|
|
44
44
|
var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
|
|
45
45
|
|
|
46
46
|
var name = "flockbay";
|
|
47
|
-
var version = "0.10.
|
|
47
|
+
var version = "0.10.46";
|
|
48
48
|
var description = "Flockbay CLI (local agent + daemon)";
|
|
49
49
|
var author = "Eduardo Orellana";
|
|
50
50
|
var license = "UNLICENSED";
|
|
@@ -832,7 +832,7 @@ class RpcHandlerManager {
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
-
const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-
|
|
835
|
+
const __dirname$1 = path$1.dirname(url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('types-CziwW90U.cjs', document.baseURI).href))));
|
|
836
836
|
function projectPath() {
|
|
837
837
|
const path = path$1.resolve(__dirname$1, "..");
|
|
838
838
|
return path;
|
|
@@ -3836,7 +3836,7 @@ exitCode: ${exitCode}
|
|
|
3836
3836
|
buildLogPath,
|
|
3837
3837
|
errorMessage: `Failed to build the Flockbay MCP plugin.
|
|
3838
3838
|
Log: ${buildLogPath}
|
|
3839
|
-
|
|
3839
|
+
Open the log to see the exact failure (missing compiler toolchain vs plugin compile errors).`
|
|
3840
3840
|
};
|
|
3841
3841
|
}
|
|
3842
3842
|
const resolved = resolvePackagedPluginDir(packageDir);
|
|
@@ -23,7 +23,7 @@ import { createServer } from 'http';
|
|
|
23
23
|
import open$2 from 'open';
|
|
24
24
|
|
|
25
25
|
var name = "flockbay";
|
|
26
|
-
var version = "0.10.
|
|
26
|
+
var version = "0.10.46";
|
|
27
27
|
var description = "Flockbay CLI (local agent + daemon)";
|
|
28
28
|
var author = "Eduardo Orellana";
|
|
29
29
|
var license = "UNLICENSED";
|
|
@@ -3815,7 +3815,7 @@ exitCode: ${exitCode}
|
|
|
3815
3815
|
buildLogPath,
|
|
3816
3816
|
errorMessage: `Failed to build the Flockbay MCP plugin.
|
|
3817
3817
|
Log: ${buildLogPath}
|
|
3818
|
-
|
|
3818
|
+
Open the log to see the exact failure (missing compiler toolchain vs plugin compile errors).`
|
|
3819
3819
|
};
|
|
3820
3820
|
}
|
|
3821
3821
|
const resolved = resolvePackagedPluginDir(packageDir);
|
package/package.json
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
#include "Engine/SCS_Node.h"
|
|
17
17
|
#include "UObject/Field.h"
|
|
18
18
|
#include "UObject/FieldPath.h"
|
|
19
|
+
#include "UObject/UObjectGlobals.h"
|
|
19
20
|
#include "EditorAssetLibrary.h"
|
|
20
21
|
#include "AssetRegistry/AssetRegistryModule.h"
|
|
21
22
|
#include "MessageLogModule.h"
|
|
@@ -23,6 +24,20 @@
|
|
|
23
24
|
#include "GameFramework/Actor.h"
|
|
24
25
|
#include "GameFramework/Pawn.h"
|
|
25
26
|
|
|
27
|
+
static UClass* FindMcpClassByName(const TCHAR* ClassName)
|
|
28
|
+
{
|
|
29
|
+
#if defined(ANY_PACKAGE)
|
|
30
|
+
return FindObject<UClass>(ANY_PACKAGE, ClassName);
|
|
31
|
+
#else
|
|
32
|
+
return FindFirstObject<UClass>(ClassName);
|
|
33
|
+
#endif
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static UClass* FindMcpClassByName(const FString& ClassName)
|
|
37
|
+
{
|
|
38
|
+
return FindMcpClassByName(*ClassName);
|
|
39
|
+
}
|
|
40
|
+
|
|
26
41
|
FUnrealMCPBlueprintCommands::FUnrealMCPBlueprintCommands()
|
|
27
42
|
{
|
|
28
43
|
}
|
|
@@ -249,26 +264,26 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleAddComponentToBluepri
|
|
|
249
264
|
UClass* ComponentClass = nullptr;
|
|
250
265
|
|
|
251
266
|
// Try to find the class with exact name first
|
|
252
|
-
ComponentClass =
|
|
267
|
+
ComponentClass = FindMcpClassByName(ComponentType);
|
|
253
268
|
|
|
254
269
|
// If not found, try with "Component" suffix
|
|
255
270
|
if (!ComponentClass && !ComponentType.EndsWith(TEXT("Component")))
|
|
256
271
|
{
|
|
257
272
|
FString ComponentTypeWithSuffix = ComponentType + TEXT("Component");
|
|
258
|
-
ComponentClass =
|
|
273
|
+
ComponentClass = FindMcpClassByName(ComponentTypeWithSuffix);
|
|
259
274
|
}
|
|
260
275
|
|
|
261
276
|
// If still not found, try with "U" prefix
|
|
262
277
|
if (!ComponentClass && !ComponentType.StartsWith(TEXT("U")))
|
|
263
278
|
{
|
|
264
279
|
FString ComponentTypeWithPrefix = TEXT("U") + ComponentType;
|
|
265
|
-
ComponentClass =
|
|
280
|
+
ComponentClass = FindMcpClassByName(ComponentTypeWithPrefix);
|
|
266
281
|
|
|
267
282
|
// Try with both prefix and suffix
|
|
268
283
|
if (!ComponentClass && !ComponentType.EndsWith(TEXT("Component")))
|
|
269
284
|
{
|
|
270
285
|
FString ComponentTypeWithBoth = TEXT("U") + ComponentType + TEXT("Component");
|
|
271
|
-
ComponentClass =
|
|
286
|
+
ComponentClass = FindMcpClassByName(ComponentTypeWithBoth);
|
|
272
287
|
}
|
|
273
288
|
}
|
|
274
289
|
|
|
@@ -17,11 +17,26 @@
|
|
|
17
17
|
#include "Kismet/GameplayStatics.h"
|
|
18
18
|
#include "EdGraphSchema_K2.h"
|
|
19
19
|
#include "UObject/UObjectIterator.h"
|
|
20
|
+
#include "UObject/UObjectGlobals.h"
|
|
20
21
|
#include "Kismet/BlueprintFunctionLibrary.h"
|
|
21
22
|
|
|
22
23
|
// Declare the log category
|
|
23
24
|
DEFINE_LOG_CATEGORY_STATIC(LogUnrealMCP, Log, All);
|
|
24
25
|
|
|
26
|
+
static UClass* FindMcpClassByName(const TCHAR* ClassName)
|
|
27
|
+
{
|
|
28
|
+
#if defined(ANY_PACKAGE)
|
|
29
|
+
return FindObject<UClass>(ANY_PACKAGE, ClassName);
|
|
30
|
+
#else
|
|
31
|
+
return FindFirstObject<UClass>(ClassName);
|
|
32
|
+
#endif
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
static UClass* FindMcpClassByName(const FString& ClassName)
|
|
36
|
+
{
|
|
37
|
+
return FindMcpClassByName(*ClassName);
|
|
38
|
+
}
|
|
39
|
+
|
|
25
40
|
FUnrealMCPBlueprintNodeCommands::FUnrealMCPBlueprintNodeCommands()
|
|
26
41
|
{
|
|
27
42
|
}
|
|
@@ -413,7 +428,7 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintNodeCommands::HandleAddBlueprintFunct
|
|
|
413
428
|
UClass* TargetClass = nullptr;
|
|
414
429
|
|
|
415
430
|
// First try without a prefix
|
|
416
|
-
TargetClass =
|
|
431
|
+
TargetClass = FindMcpClassByName(Target);
|
|
417
432
|
UE_LOG(LogTemp, Display, TEXT("Tried to find class '%s': %s"),
|
|
418
433
|
*Target, TargetClass ? TEXT("Found") : TEXT("Not found"));
|
|
419
434
|
|
|
@@ -421,7 +436,7 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintNodeCommands::HandleAddBlueprintFunct
|
|
|
421
436
|
if (!TargetClass && !Target.StartsWith(TEXT("U")))
|
|
422
437
|
{
|
|
423
438
|
FString TargetWithPrefix = FString(TEXT("U")) + Target;
|
|
424
|
-
TargetClass =
|
|
439
|
+
TargetClass = FindMcpClassByName(TargetWithPrefix);
|
|
425
440
|
UE_LOG(LogTemp, Display, TEXT("Tried to find class '%s': %s"),
|
|
426
441
|
*TargetWithPrefix, TargetClass ? TEXT("Found") : TEXT("Not found"));
|
|
427
442
|
}
|
|
@@ -436,7 +451,7 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintNodeCommands::HandleAddBlueprintFunct
|
|
|
436
451
|
|
|
437
452
|
for (const FString& ClassName : PossibleClassNames)
|
|
438
453
|
{
|
|
439
|
-
TargetClass =
|
|
454
|
+
TargetClass = FindMcpClassByName(ClassName);
|
|
440
455
|
if (TargetClass)
|
|
441
456
|
{
|
|
442
457
|
UE_LOG(LogTemp, Display, TEXT("Found class using alternative name '%s'"), *ClassName);
|
|
@@ -449,7 +464,7 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintNodeCommands::HandleAddBlueprintFunct
|
|
|
449
464
|
if (!TargetClass && Target == TEXT("UGameplayStatics"))
|
|
450
465
|
{
|
|
451
466
|
// For UGameplayStatics, use a direct reference to known class
|
|
452
|
-
TargetClass =
|
|
467
|
+
TargetClass = FindMcpClassByName(TEXT("UGameplayStatics"));
|
|
453
468
|
if (!TargetClass)
|
|
454
469
|
{
|
|
455
470
|
// Try loading it from its known package
|
|
@@ -594,7 +609,7 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintNodeCommands::HandleAddBlueprintFunct
|
|
|
594
609
|
const FString& ClassName = StringVal;
|
|
595
610
|
|
|
596
611
|
// TODO: This likely won't work in UE5.5+, so don't rely on it.
|
|
597
|
-
UClass* Class =
|
|
612
|
+
UClass* Class = FindMcpClassByName(ClassName);
|
|
598
613
|
|
|
599
614
|
if (!Class)
|
|
600
615
|
{
|
|
@@ -796,18 +811,18 @@ static UClass* ResolveClassBestEffort(const FString& Target)
|
|
|
796
811
|
return LoadObject<UClass>(nullptr, *T);
|
|
797
812
|
}
|
|
798
813
|
|
|
799
|
-
UClass* Found =
|
|
814
|
+
UClass* Found = FindMcpClassByName(T);
|
|
800
815
|
if (!Found && !T.StartsWith(TEXT("U")))
|
|
801
816
|
{
|
|
802
|
-
Found =
|
|
817
|
+
Found = FindMcpClassByName(FString(TEXT("U")) + T);
|
|
803
818
|
}
|
|
804
819
|
if (!Found && !T.EndsWith(TEXT("Library")))
|
|
805
820
|
{
|
|
806
|
-
Found =
|
|
821
|
+
Found = FindMcpClassByName(FString(TEXT("U")) + T + TEXT("Library"));
|
|
807
822
|
}
|
|
808
823
|
if (!Found && !T.EndsWith(TEXT("Component")))
|
|
809
824
|
{
|
|
810
|
-
Found =
|
|
825
|
+
Found = FindMcpClassByName(FString(TEXT("U")) + T + TEXT("Component"));
|
|
811
826
|
}
|
|
812
827
|
return Found;
|
|
813
828
|
}
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
#include "AssetRegistry/AssetRegistryModule.h"
|
|
45
45
|
#include "UObject/SoftObjectPath.h"
|
|
46
46
|
#include "UObject/Package.h"
|
|
47
|
+
#include "UObject/UObjectGlobals.h"
|
|
47
48
|
#include "FileHelpers.h"
|
|
48
49
|
#include "MessageLogModule.h"
|
|
49
50
|
#include "IMessageLogListing.h"
|
|
@@ -56,6 +57,20 @@
|
|
|
56
57
|
#include "Components/SceneCaptureComponent2D.h"
|
|
57
58
|
#include "Engine/TextureRenderTarget2D.h"
|
|
58
59
|
|
|
60
|
+
static UClass* FindMcpClassByName(const TCHAR* ClassName)
|
|
61
|
+
{
|
|
62
|
+
#if defined(ANY_PACKAGE)
|
|
63
|
+
return FindObject<UClass>(ANY_PACKAGE, ClassName);
|
|
64
|
+
#else
|
|
65
|
+
return FindFirstObject<UClass>(ClassName);
|
|
66
|
+
#endif
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static UClass* FindMcpClassByName(const FString& ClassName)
|
|
70
|
+
{
|
|
71
|
+
return FindMcpClassByName(*ClassName);
|
|
72
|
+
}
|
|
73
|
+
|
|
59
74
|
static bool SavePngToFile(const FString& FilePath, int32 Width, int32 Height, TArray<FColor>& Bitmap)
|
|
60
75
|
{
|
|
61
76
|
IImageWrapperModule& ImageWrapperModule = FModuleManager::LoadModuleChecked<IImageWrapperModule>(FName("ImageWrapper"));
|
|
@@ -560,10 +575,10 @@ static bool TryResolveAssetClassFilter(const TSharedPtr<FJsonObject>& Params, FA
|
|
|
560
575
|
}
|
|
561
576
|
else
|
|
562
577
|
{
|
|
563
|
-
Class =
|
|
578
|
+
Class = FindMcpClassByName(ClassName);
|
|
564
579
|
if (!Class && !ClassName.StartsWith(TEXT("U")))
|
|
565
580
|
{
|
|
566
|
-
Class =
|
|
581
|
+
Class = FindMcpClassByName(TEXT("U") + ClassName);
|
|
567
582
|
}
|
|
568
583
|
}
|
|
569
584
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
#include "HAL/PlatformTime.h"
|
|
13
13
|
|
|
14
14
|
// Buffer size for receiving data
|
|
15
|
-
const int32
|
|
15
|
+
const int32 RecvBufferSizeBytes = 8192;
|
|
16
16
|
|
|
17
17
|
static bool SendAll(FSocket* Socket, const uint8* Data, int32 TotalBytes, int32& OutTotalBytesSent)
|
|
18
18
|
{
|
|
@@ -102,7 +102,7 @@ uint32 FMCPServerRunnable::Run()
|
|
|
102
102
|
ClientSocket->SetSendBufferSize(SocketBufferSize, SocketBufferSize);
|
|
103
103
|
ClientSocket->SetReceiveBufferSize(SocketBufferSize, SocketBufferSize);
|
|
104
104
|
|
|
105
|
-
uint8 Buffer[
|
|
105
|
+
uint8 Buffer[RecvBufferSizeBytes + 1];
|
|
106
106
|
while (bRunning)
|
|
107
107
|
{
|
|
108
108
|
int32 BytesRead = 0;
|
|
@@ -116,7 +116,7 @@ uint32 FMCPServerRunnable::Run()
|
|
|
116
116
|
|
|
117
117
|
// Convert received data to string
|
|
118
118
|
// Null-terminate safely (Recv can fill the entire buffer).
|
|
119
|
-
const int32 SafeIndex = FMath::Clamp(BytesRead, 0,
|
|
119
|
+
const int32 SafeIndex = FMath::Clamp(BytesRead, 0, RecvBufferSizeBytes);
|
|
120
120
|
Buffer[SafeIndex] = '\0';
|
|
121
121
|
FString ReceivedText = UTF8_TO_TCHAR(Buffer);
|
|
122
122
|
UE_LOG(LogTemp, Display, TEXT("MCPServerRunnable: Received: %s"), *ReceivedText);
|