@princeofscale/bloxforge 2.20.2
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/assets/Baseplate.rbxl +0 -0
- package/dist/index.js +19391 -0
- package/package.json +62 -0
- package/studio-plugin/INSTALLATION.md +161 -0
- package/studio-plugin/MCPInspectorPlugin.rbxmx +171699 -0
- package/studio-plugin/MCPPlugin.rbxmx +171699 -0
- package/studio-plugin/default.project.json +19 -0
- package/studio-plugin/dev.project.json +23 -0
- package/studio-plugin/include/LibMP.lua +156378 -0
- package/studio-plugin/inspector-icon.png +0 -0
- package/studio-plugin/package-lock.json +692 -0
- package/studio-plugin/package.json +19 -0
- package/studio-plugin/plugin.json +10 -0
- package/studio-plugin/src/modules/ClientBroker.ts +447 -0
- package/studio-plugin/src/modules/Communication.ts +697 -0
- package/studio-plugin/src/modules/EvalBridges.ts +255 -0
- package/studio-plugin/src/modules/HttpDiagnostics.ts +50 -0
- package/studio-plugin/src/modules/JobRegistry.ts +77 -0
- package/studio-plugin/src/modules/LuauExec.ts +465 -0
- package/studio-plugin/src/modules/Recording.ts +28 -0
- package/studio-plugin/src/modules/RenderMonitor.ts +60 -0
- package/studio-plugin/src/modules/RuntimeLogBuffer.ts +152 -0
- package/studio-plugin/src/modules/ServerUrlSettings.ts +114 -0
- package/studio-plugin/src/modules/State.ts +101 -0
- package/studio-plugin/src/modules/StopPlayMonitor.ts +276 -0
- package/studio-plugin/src/modules/UI.ts +790 -0
- package/studio-plugin/src/modules/Utils.ts +318 -0
- package/studio-plugin/src/modules/handlers/AssetHandlers.ts +241 -0
- package/studio-plugin/src/modules/handlers/BreakpointHandlers.ts +460 -0
- package/studio-plugin/src/modules/handlers/BuildHandlers.ts +481 -0
- package/studio-plugin/src/modules/handlers/CaptureHandlers.ts +203 -0
- package/studio-plugin/src/modules/handlers/EvalRuntimeHandlers.ts +149 -0
- package/studio-plugin/src/modules/handlers/InputHandlers.ts +160 -0
- package/studio-plugin/src/modules/handlers/InstanceHandlers.ts +380 -0
- package/studio-plugin/src/modules/handlers/JobHandlers.ts +111 -0
- package/studio-plugin/src/modules/handlers/LogHandlers.ts +14 -0
- package/studio-plugin/src/modules/handlers/MemoryHandlers.ts +44 -0
- package/studio-plugin/src/modules/handlers/MetadataHandlers.ts +354 -0
- package/studio-plugin/src/modules/handlers/MicroProfilerHandlers.ts +1263 -0
- package/studio-plugin/src/modules/handlers/PropertyHandlers.ts +191 -0
- package/studio-plugin/src/modules/handlers/QueryHandlers.ts +809 -0
- package/studio-plugin/src/modules/handlers/SceneAnalysisHandlers.ts +216 -0
- package/studio-plugin/src/modules/handlers/ScriptHandlers.ts +530 -0
- package/studio-plugin/src/modules/handlers/ScriptProfilerHandlers.ts +386 -0
- package/studio-plugin/src/modules/handlers/SerializationHandlers.ts +172 -0
- package/studio-plugin/src/modules/handlers/TestHandlers.ts +535 -0
- package/studio-plugin/src/server/index.server.ts +134 -0
- package/studio-plugin/src/types/index.d.ts +83 -0
- package/studio-plugin/tsconfig.json +21 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import Utils from "../Utils";
|
|
2
|
+
import Recording from "../Recording";
|
|
3
|
+
|
|
4
|
+
const { getInstanceByPath, convertPropertyValue } = Utils;
|
|
5
|
+
const { beginRecording, finishRecording } = Recording;
|
|
6
|
+
|
|
7
|
+
function setProperty(requestData: Record<string, unknown>) {
|
|
8
|
+
const instancePath = requestData.instancePath as string;
|
|
9
|
+
const propertyName = requestData.propertyName as string;
|
|
10
|
+
const propertyValue = requestData.propertyValue;
|
|
11
|
+
|
|
12
|
+
if (!instancePath || !propertyName) {
|
|
13
|
+
return { error: "Instance path and property name are required" };
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const instance = getInstanceByPath(instancePath);
|
|
17
|
+
if (!instance) return { error: `Instance not found: ${instancePath}` };
|
|
18
|
+
const recordingId = beginRecording(`Set ${propertyName} property`);
|
|
19
|
+
|
|
20
|
+
const inst = instance as unknown as Record<string, unknown>;
|
|
21
|
+
|
|
22
|
+
const [success, result] = pcall(() => {
|
|
23
|
+
if (propertyName === "Parent" || propertyName === "PrimaryPart") {
|
|
24
|
+
if (typeIs(propertyValue, "string")) {
|
|
25
|
+
const refInstance = getInstanceByPath(propertyValue);
|
|
26
|
+
if (refInstance) {
|
|
27
|
+
inst[propertyName] = refInstance;
|
|
28
|
+
} else {
|
|
29
|
+
return { error: `${propertyName} instance not found: ${propertyValue}` };
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
} else if (propertyName === "Name") {
|
|
33
|
+
instance.Name = tostring(propertyValue);
|
|
34
|
+
} else if (propertyName === "Source" && instance.IsA("LuaSourceContainer")) {
|
|
35
|
+
(instance as unknown as { Source: string }).Source = tostring(propertyValue);
|
|
36
|
+
} else {
|
|
37
|
+
const convertedValue = convertPropertyValue(instance, propertyName, propertyValue);
|
|
38
|
+
if (convertedValue !== undefined) {
|
|
39
|
+
inst[propertyName] = convertedValue;
|
|
40
|
+
} else {
|
|
41
|
+
inst[propertyName] = propertyValue;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return true;
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (success) {
|
|
49
|
+
finishRecording(recordingId, true);
|
|
50
|
+
return {
|
|
51
|
+
success: true,
|
|
52
|
+
instancePath,
|
|
53
|
+
propertyName,
|
|
54
|
+
propertyValue,
|
|
55
|
+
message: "Property set successfully",
|
|
56
|
+
};
|
|
57
|
+
} else {
|
|
58
|
+
finishRecording(recordingId, false);
|
|
59
|
+
return { error: `Failed to set property: ${result}`, instancePath, propertyName };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function massSetProperty(requestData: Record<string, unknown>) {
|
|
64
|
+
const paths = requestData.paths as string[];
|
|
65
|
+
const propertyName = requestData.propertyName as string;
|
|
66
|
+
const propertyValue = requestData.propertyValue;
|
|
67
|
+
|
|
68
|
+
if (!paths || !typeIs(paths, "table") || (paths as defined[]).size() === 0 || !propertyName) {
|
|
69
|
+
return { error: "Paths array and property name are required" };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const results: Record<string, unknown>[] = [];
|
|
73
|
+
let successCount = 0;
|
|
74
|
+
let failureCount = 0;
|
|
75
|
+
const recordingId = beginRecording(`Mass set ${propertyName} property`);
|
|
76
|
+
|
|
77
|
+
for (const path of paths) {
|
|
78
|
+
const instance = getInstanceByPath(path);
|
|
79
|
+
if (instance) {
|
|
80
|
+
const [success, err] = pcall(() => {
|
|
81
|
+
const converted = convertPropertyValue(instance, propertyName, propertyValue);
|
|
82
|
+
(instance as unknown as Record<string, unknown>)[propertyName] =
|
|
83
|
+
converted !== undefined ? converted : propertyValue;
|
|
84
|
+
});
|
|
85
|
+
if (success) {
|
|
86
|
+
successCount++;
|
|
87
|
+
results.push({ path, success: true, propertyName, propertyValue });
|
|
88
|
+
} else {
|
|
89
|
+
failureCount++;
|
|
90
|
+
results.push({ path, success: false, error: tostring(err) });
|
|
91
|
+
}
|
|
92
|
+
} else {
|
|
93
|
+
failureCount++;
|
|
94
|
+
results.push({ path, success: false, error: "Instance not found" });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
finishRecording(recordingId, successCount > 0);
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
results,
|
|
102
|
+
summary: { total: paths.size(), succeeded: successCount, failed: failureCount },
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function massGetProperty(requestData: Record<string, unknown>) {
|
|
107
|
+
const paths = requestData.paths as string[];
|
|
108
|
+
const propertyName = requestData.propertyName as string;
|
|
109
|
+
|
|
110
|
+
if (!paths || !typeIs(paths, "table") || (paths as defined[]).size() === 0 || !propertyName) {
|
|
111
|
+
return { error: "Paths array and property name are required" };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const results: Record<string, unknown>[] = [];
|
|
115
|
+
|
|
116
|
+
for (const path of paths) {
|
|
117
|
+
const instance = getInstanceByPath(path);
|
|
118
|
+
if (instance) {
|
|
119
|
+
const [success, value] = pcall(() => (instance as unknown as Record<string, unknown>)[propertyName]);
|
|
120
|
+
if (success) {
|
|
121
|
+
results.push({ path, success: true, propertyName, propertyValue: value });
|
|
122
|
+
} else {
|
|
123
|
+
results.push({ path, success: false, error: tostring(value) });
|
|
124
|
+
}
|
|
125
|
+
} else {
|
|
126
|
+
results.push({ path, success: false, error: "Instance not found" });
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return { results, propertyName };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function setProperties(requestData: Record<string, unknown>) {
|
|
134
|
+
const instancePath = requestData.instancePath as string;
|
|
135
|
+
const properties = requestData.properties as Record<string, unknown>;
|
|
136
|
+
|
|
137
|
+
if (!instancePath || !properties || !typeIs(properties, "table")) {
|
|
138
|
+
return { error: "Instance path and properties object are required" };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const instance = getInstanceByPath(instancePath);
|
|
142
|
+
if (!instance) return { error: `Instance not found: ${instancePath}` };
|
|
143
|
+
|
|
144
|
+
const recordingId = beginRecording("Set multiple properties");
|
|
145
|
+
const inst = instance as unknown as Record<string, unknown>;
|
|
146
|
+
const results: Record<string, unknown>[] = [];
|
|
147
|
+
let successCount = 0;
|
|
148
|
+
let failureCount = 0;
|
|
149
|
+
|
|
150
|
+
for (const [propName, propValue] of pairs(properties)) {
|
|
151
|
+
const [success, err] = pcall(() => {
|
|
152
|
+
if (propName === "Parent" || propName === "PrimaryPart") {
|
|
153
|
+
if (typeIs(propValue, "string")) {
|
|
154
|
+
const refInstance = getInstanceByPath(propValue as string);
|
|
155
|
+
if (!refInstance) error(`${propName} reference not found: ${propValue}`);
|
|
156
|
+
inst[propName as string] = refInstance;
|
|
157
|
+
}
|
|
158
|
+
} else if (propName === "Name") {
|
|
159
|
+
instance.Name = tostring(propValue);
|
|
160
|
+
} else if (propName === "Source" && instance.IsA("LuaSourceContainer")) {
|
|
161
|
+
(instance as unknown as { Source: string }).Source = tostring(propValue);
|
|
162
|
+
} else {
|
|
163
|
+
const converted = convertPropertyValue(instance, propName as string, propValue);
|
|
164
|
+
inst[propName as string] = converted !== undefined ? converted : propValue;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
if (success) {
|
|
169
|
+
successCount++;
|
|
170
|
+
results.push({ property: propName, success: true });
|
|
171
|
+
} else {
|
|
172
|
+
failureCount++;
|
|
173
|
+
results.push({ property: propName, success: false, error: tostring(err) });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
finishRecording(recordingId, successCount > 0);
|
|
178
|
+
|
|
179
|
+
return {
|
|
180
|
+
instancePath,
|
|
181
|
+
summary: { total: successCount + failureCount, succeeded: successCount, failed: failureCount },
|
|
182
|
+
results,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export = {
|
|
187
|
+
setProperty,
|
|
188
|
+
massSetProperty,
|
|
189
|
+
massGetProperty,
|
|
190
|
+
setProperties,
|
|
191
|
+
};
|