flockbay 0.10.15 → 0.10.16
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/codex/flockbayMcpStdioBridge.cjs +339 -0
- package/dist/codex/flockbayMcpStdioBridge.mjs +339 -0
- package/dist/{index--o4BPz5o.cjs → index-Cau-_Qvn.cjs} +2683 -609
- package/dist/{index-CUp3juDS.mjs → index-DtmFQzXY.mjs} +2684 -611
- package/dist/index.cjs +3 -5
- package/dist/index.mjs +3 -5
- package/dist/lib.cjs +7 -9
- package/dist/lib.d.cts +219 -531
- package/dist/lib.d.mts +219 -531
- package/dist/lib.mjs +7 -9
- package/dist/{runCodex-o6PCbHQ7.mjs → runCodex-Di9eHddq.mjs} +263 -42
- package/dist/{runCodex-D3eT-TvB.cjs → runCodex-DzP3VUa-.cjs} +264 -43
- package/dist/{runGemini-Bt0oEj_g.mjs → runGemini-BS6sBU_V.mjs} +63 -28
- package/dist/{runGemini-CBxZp6I7.cjs → runGemini-CpmehDQ2.cjs} +64 -29
- package/dist/{types-DGd6ea2Z.mjs → types-CwzNqYEx.mjs} +465 -1142
- package/dist/{types-C-jnUdn_.cjs → types-SUAKq-K0.cjs} +466 -1146
- package/package.json +1 -1
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPBlueprintCommands.cpp +195 -6
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPBlueprintNodeCommands.cpp +376 -5
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPCommandSchema.cpp +731 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPCommonUtils.cpp +476 -8
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/Commands/UnrealMCPEditorCommands.cpp +1518 -94
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/MCPServerRunnable.cpp +7 -4
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Private/UnrealMCPBridge.cpp +150 -112
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPBlueprintCommands.h +2 -1
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPBlueprintNodeCommands.h +4 -1
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPCommandSchema.h +42 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/Public/Commands/UnrealMCPEditorCommands.h +21 -0
- package/tools/unreal-mcp/upstream/MCPGameProject/Plugins/UnrealMCP/Source/UnrealMCP/UnrealMCP.Build.cs +4 -1
- package/dist/flockbayScreenshotGate-DJX3Is5d.mjs +0 -136
- package/dist/flockbayScreenshotGate-DkxU24cR.cjs +0 -138
package/package.json
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
#include "UObject/FieldPath.h"
|
|
19
19
|
#include "EditorAssetLibrary.h"
|
|
20
20
|
#include "AssetRegistry/AssetRegistryModule.h"
|
|
21
|
+
#include "MessageLogModule.h"
|
|
22
|
+
#include "IMessageLogListing.h"
|
|
21
23
|
#include "GameFramework/Actor.h"
|
|
22
24
|
#include "GameFramework/Pawn.h"
|
|
23
25
|
|
|
@@ -47,6 +49,10 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleCommand(const FString
|
|
|
47
49
|
{
|
|
48
50
|
return HandleCompileBlueprint(Params);
|
|
49
51
|
}
|
|
52
|
+
else if (CommandType == TEXT("compile_blueprints_all"))
|
|
53
|
+
{
|
|
54
|
+
return HandleCompileBlueprintsAll(Params);
|
|
55
|
+
}
|
|
50
56
|
else if (CommandType == TEXT("spawn_blueprint_actor"))
|
|
51
57
|
{
|
|
52
58
|
return HandleSpawnBlueprintActor(Params);
|
|
@@ -67,17 +73,66 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleCommand(const FString
|
|
|
67
73
|
return FUnrealMCPCommonUtils::CreateErrorResponse(FString::Printf(TEXT("Unknown blueprint command: %s"), *CommandType));
|
|
68
74
|
}
|
|
69
75
|
|
|
76
|
+
static bool IsSafeToCompileBlueprints(FString& OutError)
|
|
77
|
+
{
|
|
78
|
+
if (!GEditor)
|
|
79
|
+
{
|
|
80
|
+
OutError = TEXT("Editor is not available (GEditor is null).");
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
if (GEditor->PlayWorld)
|
|
84
|
+
{
|
|
85
|
+
OutError = TEXT("Cannot compile Blueprints while Play-In-Editor is running. Stop PIE and retry.");
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
static FString MessageSeverityToString(EMessageSeverity::Type Severity)
|
|
92
|
+
{
|
|
93
|
+
switch (Severity)
|
|
94
|
+
{
|
|
95
|
+
case EMessageSeverity::CriticalError:
|
|
96
|
+
case EMessageSeverity::Error:
|
|
97
|
+
return TEXT("error");
|
|
98
|
+
case EMessageSeverity::Warning:
|
|
99
|
+
case EMessageSeverity::PerformanceWarning:
|
|
100
|
+
return TEXT("warning");
|
|
101
|
+
case EMessageSeverity::Info:
|
|
102
|
+
return TEXT("info");
|
|
103
|
+
default:
|
|
104
|
+
return TEXT("info");
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
70
108
|
TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleCreateBlueprint(const TSharedPtr<FJsonObject>& Params)
|
|
71
109
|
{
|
|
72
110
|
// Get required parameters
|
|
73
111
|
FString BlueprintName;
|
|
74
|
-
if (!Params->TryGetStringField(TEXT("name"), BlueprintName))
|
|
112
|
+
if (!Params->TryGetStringField(TEXT("name"), BlueprintName) && !Params->TryGetStringField(TEXT("blueprint_name"), BlueprintName))
|
|
75
113
|
{
|
|
76
114
|
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Missing 'name' parameter"));
|
|
77
115
|
}
|
|
78
116
|
|
|
79
117
|
// Check if blueprint already exists
|
|
80
118
|
FString PackagePath = TEXT("/Game/Blueprints/");
|
|
119
|
+
Params->TryGetStringField(TEXT("path"), PackagePath);
|
|
120
|
+
Params->TryGetStringField(TEXT("blueprint_path"), PackagePath);
|
|
121
|
+
Params->TryGetStringField(TEXT("packagePath"), PackagePath);
|
|
122
|
+
Params->TryGetStringField(TEXT("package_path"), PackagePath);
|
|
123
|
+
|
|
124
|
+
PackagePath = PackagePath.TrimStartAndEnd();
|
|
125
|
+
if (PackagePath.IsEmpty()) PackagePath = TEXT("/Game/Blueprints/");
|
|
126
|
+
if (!PackagePath.StartsWith(TEXT("/Game/")))
|
|
127
|
+
{
|
|
128
|
+
// Keep it safe + predictable: only allow /Game paths.
|
|
129
|
+
PackagePath = TEXT("/Game/Blueprints/");
|
|
130
|
+
}
|
|
131
|
+
if (!PackagePath.EndsWith(TEXT("/")))
|
|
132
|
+
{
|
|
133
|
+
PackagePath += TEXT("/");
|
|
134
|
+
}
|
|
135
|
+
|
|
81
136
|
FString AssetName = BlueprintName;
|
|
82
137
|
if (UEditorAssetLibrary::DoesAssetExist(PackagePath + AssetName))
|
|
83
138
|
{
|
|
@@ -172,15 +227,15 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleAddComponentToBluepri
|
|
|
172
227
|
}
|
|
173
228
|
|
|
174
229
|
FString ComponentType;
|
|
175
|
-
if (!Params->TryGetStringField(TEXT("component_type"), ComponentType))
|
|
230
|
+
if (!Params->TryGetStringField(TEXT("component_type"), ComponentType) && !Params->TryGetStringField(TEXT("type"), ComponentType))
|
|
176
231
|
{
|
|
177
|
-
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Missing '
|
|
232
|
+
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Missing 'component_type' parameter"));
|
|
178
233
|
}
|
|
179
234
|
|
|
180
235
|
FString ComponentName;
|
|
181
|
-
if (!Params->TryGetStringField(TEXT("component_name"), ComponentName))
|
|
236
|
+
if (!Params->TryGetStringField(TEXT("component_name"), ComponentName) && !Params->TryGetStringField(TEXT("name"), ComponentName))
|
|
182
237
|
{
|
|
183
|
-
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Missing '
|
|
238
|
+
return FUnrealMCPCommonUtils::CreateErrorResponse(TEXT("Missing 'component_name' parameter"));
|
|
184
239
|
}
|
|
185
240
|
|
|
186
241
|
// Find the blueprint
|
|
@@ -850,6 +905,140 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleCompileBlueprint(cons
|
|
|
850
905
|
return ResultObj;
|
|
851
906
|
}
|
|
852
907
|
|
|
908
|
+
TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleCompileBlueprintsAll(const TSharedPtr<FJsonObject>& Params)
|
|
909
|
+
{
|
|
910
|
+
{
|
|
911
|
+
FString Err;
|
|
912
|
+
if (!IsSafeToCompileBlueprints(Err))
|
|
913
|
+
{
|
|
914
|
+
return FUnrealMCPCommonUtils::CreateErrorResponse(Err);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
int32 Limit = 500;
|
|
919
|
+
if (Params->HasField(TEXT("limit")))
|
|
920
|
+
{
|
|
921
|
+
Limit = (int32)Params->GetNumberField(TEXT("limit"));
|
|
922
|
+
}
|
|
923
|
+
Limit = FMath::Clamp(Limit, 1, 10000);
|
|
924
|
+
|
|
925
|
+
bool bIncludeWarnings = true;
|
|
926
|
+
if (Params->HasField(TEXT("includeWarnings")))
|
|
927
|
+
{
|
|
928
|
+
bIncludeWarnings = Params->GetBoolField(TEXT("includeWarnings"));
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
TArray<FString> RootPaths;
|
|
932
|
+
if (Params->HasField(TEXT("paths")))
|
|
933
|
+
{
|
|
934
|
+
const TArray<TSharedPtr<FJsonValue>> PathsJson = Params->GetArrayField(TEXT("paths"));
|
|
935
|
+
for (const TSharedPtr<FJsonValue>& PathVal : PathsJson)
|
|
936
|
+
{
|
|
937
|
+
if (!PathVal.IsValid() || PathVal->Type != EJson::String) continue;
|
|
938
|
+
const FString P = PathVal->AsString().TrimStartAndEnd();
|
|
939
|
+
if (!P.IsEmpty())
|
|
940
|
+
{
|
|
941
|
+
RootPaths.Add(P);
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
if (RootPaths.Num() == 0)
|
|
946
|
+
{
|
|
947
|
+
RootPaths.Add(TEXT("/Game"));
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
FAssetRegistryModule& AssetRegistryModule = FModuleManager::LoadModuleChecked<FAssetRegistryModule>(TEXT("AssetRegistry"));
|
|
951
|
+
IAssetRegistry& AssetRegistry = AssetRegistryModule.Get();
|
|
952
|
+
|
|
953
|
+
FARFilter Filter;
|
|
954
|
+
Filter.bRecursivePaths = true;
|
|
955
|
+
#if ENGINE_MAJOR_VERSION >= 5
|
|
956
|
+
Filter.ClassPaths.Add(UBlueprint::StaticClass()->GetClassPathName());
|
|
957
|
+
#else
|
|
958
|
+
Filter.ClassNames.Add(UBlueprint::StaticClass()->GetFName());
|
|
959
|
+
#endif
|
|
960
|
+
for (const FString& RootPath : RootPaths)
|
|
961
|
+
{
|
|
962
|
+
const FString Normalized = RootPath.StartsWith(TEXT("/")) ? RootPath : FString(TEXT("/")) + RootPath;
|
|
963
|
+
Filter.PackagePaths.Add(FName(*Normalized));
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
TArray<FAssetData> Assets;
|
|
967
|
+
AssetRegistry.GetAssets(Filter, Assets);
|
|
968
|
+
|
|
969
|
+
int32 TotalBlueprints = 0;
|
|
970
|
+
int32 Compiled = 0;
|
|
971
|
+
int32 Failed = 0;
|
|
972
|
+
int32 ErrorMessages = 0;
|
|
973
|
+
int32 WarningMessages = 0;
|
|
974
|
+
|
|
975
|
+
FMessageLogModule& MessageLogModule = FModuleManager::LoadModuleChecked<FMessageLogModule>(TEXT("MessageLog"));
|
|
976
|
+
const TSharedRef<IMessageLogListing> Listing = MessageLogModule.GetLogListing(TEXT("BlueprintLog"));
|
|
977
|
+
|
|
978
|
+
TArray<TSharedPtr<FJsonValue>> Results;
|
|
979
|
+
|
|
980
|
+
for (const FAssetData& Asset : Assets)
|
|
981
|
+
{
|
|
982
|
+
if (TotalBlueprints >= Limit) break;
|
|
983
|
+
|
|
984
|
+
UBlueprint* Blueprint = Cast<UBlueprint>(Asset.GetAsset());
|
|
985
|
+
if (!Blueprint) continue;
|
|
986
|
+
|
|
987
|
+
TotalBlueprints++;
|
|
988
|
+
|
|
989
|
+
Listing->ClearMessages();
|
|
990
|
+
FKismetEditorUtilities::CompileBlueprint(Blueprint);
|
|
991
|
+
|
|
992
|
+
const TArray<TSharedRef<FTokenizedMessage>>& Messages = Listing->GetFilteredMessages();
|
|
993
|
+
int32 BlueprintErrors = 0;
|
|
994
|
+
int32 BlueprintWarnings = 0;
|
|
995
|
+
TArray<TSharedPtr<FJsonValue>> MessageArray;
|
|
996
|
+
|
|
997
|
+
for (const TSharedRef<FTokenizedMessage>& Message : Messages)
|
|
998
|
+
{
|
|
999
|
+
const EMessageSeverity::Type Severity = Message->GetSeverity();
|
|
1000
|
+
const bool bIsWarning =
|
|
1001
|
+
Severity == EMessageSeverity::Warning || Severity == EMessageSeverity::PerformanceWarning;
|
|
1002
|
+
const bool bIsError = Severity == EMessageSeverity::Error || Severity == EMessageSeverity::CriticalError;
|
|
1003
|
+
|
|
1004
|
+
if (bIsError) BlueprintErrors++;
|
|
1005
|
+
if (bIsWarning) BlueprintWarnings++;
|
|
1006
|
+
|
|
1007
|
+
if (!bIncludeWarnings && bIsWarning) continue;
|
|
1008
|
+
|
|
1009
|
+
TSharedPtr<FJsonObject> Msg = MakeShared<FJsonObject>();
|
|
1010
|
+
Msg->SetStringField(TEXT("severity"), MessageSeverityToString(Severity));
|
|
1011
|
+
Msg->SetStringField(TEXT("message"), Message->ToText().ToString());
|
|
1012
|
+
MessageArray.Add(MakeShared<FJsonValueObject>(Msg));
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
ErrorMessages += BlueprintErrors;
|
|
1016
|
+
WarningMessages += BlueprintWarnings;
|
|
1017
|
+
|
|
1018
|
+
const bool bHadErrors = Blueprint->Status == BS_Error;
|
|
1019
|
+
if (bHadErrors) Failed++; else Compiled++;
|
|
1020
|
+
|
|
1021
|
+
TSharedPtr<FJsonObject> Entry = MakeShared<FJsonObject>();
|
|
1022
|
+
Entry->SetStringField(TEXT("name"), Blueprint->GetName());
|
|
1023
|
+
Entry->SetStringField(TEXT("objectPath"), Asset.GetObjectPathString());
|
|
1024
|
+
Entry->SetBoolField(TEXT("ok"), !bHadErrors);
|
|
1025
|
+
Entry->SetNumberField(TEXT("errors"), BlueprintErrors);
|
|
1026
|
+
Entry->SetNumberField(TEXT("warnings"), BlueprintWarnings);
|
|
1027
|
+
Entry->SetArrayField(TEXT("messages"), MessageArray);
|
|
1028
|
+
Results.Add(MakeShared<FJsonValueObject>(Entry));
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
TSharedPtr<FJsonObject> ResultObj = MakeShared<FJsonObject>();
|
|
1032
|
+
ResultObj->SetNumberField(TEXT("found"), Assets.Num());
|
|
1033
|
+
ResultObj->SetNumberField(TEXT("compiled"), Compiled);
|
|
1034
|
+
ResultObj->SetNumberField(TEXT("failed"), Failed);
|
|
1035
|
+
ResultObj->SetNumberField(TEXT("errors"), ErrorMessages);
|
|
1036
|
+
ResultObj->SetNumberField(TEXT("warnings"), WarningMessages);
|
|
1037
|
+
ResultObj->SetArrayField(TEXT("results"), Results);
|
|
1038
|
+
ResultObj->SetBoolField(TEXT("truncated"), TotalBlueprints < Assets.Num() && TotalBlueprints >= Limit);
|
|
1039
|
+
return ResultObj;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
853
1042
|
TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleSpawnBlueprintActor(const TSharedPtr<FJsonObject>& Params)
|
|
854
1043
|
{
|
|
855
1044
|
// Get required parameters
|
|
@@ -1157,4 +1346,4 @@ TSharedPtr<FJsonObject> FUnrealMCPBlueprintCommands::HandleSetPawnProperties(con
|
|
|
1157
1346
|
ResponseObj->SetBoolField(TEXT("success"), bAnyPropertiesSet);
|
|
1158
1347
|
ResponseObj->SetObjectField(TEXT("results"), ResultsObj);
|
|
1159
1348
|
return ResponseObj;
|
|
1160
|
-
}
|
|
1349
|
+
}
|