@chrrxs/robloxstudio-mcp 2.23.1 → 3.0.1

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.
Files changed (50) hide show
  1. package/dist/index.js +1688 -4547
  2. package/package.json +7 -5
  3. package/studio-plugin/MCPPlugin.rbxmx +489 -1965
  4. package/studio-plugin/.Carbon.rbxm.lock +0 -0
  5. package/studio-plugin/Carbon.rbxm +0 -0
  6. package/studio-plugin/INSTALLATION.md +0 -170
  7. package/studio-plugin/MCPInspectorPlugin.rbxmx +0 -171527
  8. package/studio-plugin/default.project.json +0 -19
  9. package/studio-plugin/dev.project.json +0 -23
  10. package/studio-plugin/include/LibMP.lua +0 -156378
  11. package/studio-plugin/inspector-icon.png +0 -0
  12. package/studio-plugin/package-lock.json +0 -706
  13. package/studio-plugin/package.json +0 -19
  14. package/studio-plugin/plugin.json +0 -10
  15. package/studio-plugin/src/modules/AssetSanitizationPolicy.ts +0 -127
  16. package/studio-plugin/src/modules/ClientBroker.ts +0 -450
  17. package/studio-plugin/src/modules/Communication.ts +0 -632
  18. package/studio-plugin/src/modules/EvalBridges.ts +0 -255
  19. package/studio-plugin/src/modules/HttpDiagnostics.ts +0 -50
  20. package/studio-plugin/src/modules/LuauExec.ts +0 -403
  21. package/studio-plugin/src/modules/Recording.ts +0 -28
  22. package/studio-plugin/src/modules/RenderMonitor.ts +0 -60
  23. package/studio-plugin/src/modules/RuntimeLogBuffer.ts +0 -210
  24. package/studio-plugin/src/modules/ServerUrlSettings.ts +0 -117
  25. package/studio-plugin/src/modules/State.ts +0 -39
  26. package/studio-plugin/src/modules/StopPlayMonitor.ts +0 -267
  27. package/studio-plugin/src/modules/UI.ts +0 -597
  28. package/studio-plugin/src/modules/Utils.ts +0 -469
  29. package/studio-plugin/src/modules/handlers/AssetHandlers.ts +0 -391
  30. package/studio-plugin/src/modules/handlers/BreakpointHandlers.ts +0 -460
  31. package/studio-plugin/src/modules/handlers/BuildHandlers.ts +0 -481
  32. package/studio-plugin/src/modules/handlers/CaptureHandlers.ts +0 -170
  33. package/studio-plugin/src/modules/handlers/EvalRuntimeHandlers.ts +0 -149
  34. package/studio-plugin/src/modules/handlers/GenerateModelHandlers.ts +0 -168
  35. package/studio-plugin/src/modules/handlers/InputHandlers.ts +0 -163
  36. package/studio-plugin/src/modules/handlers/InstanceHandlers.ts +0 -380
  37. package/studio-plugin/src/modules/handlers/LogHandlers.ts +0 -14
  38. package/studio-plugin/src/modules/handlers/MemoryHandlers.ts +0 -44
  39. package/studio-plugin/src/modules/handlers/MetadataHandlers.ts +0 -354
  40. package/studio-plugin/src/modules/handlers/MicroProfilerHandlers.ts +0 -1263
  41. package/studio-plugin/src/modules/handlers/PropertyHandlers.ts +0 -191
  42. package/studio-plugin/src/modules/handlers/QueryHandlers.ts +0 -874
  43. package/studio-plugin/src/modules/handlers/SceneAnalysisHandlers.ts +0 -216
  44. package/studio-plugin/src/modules/handlers/ScriptHandlers.ts +0 -530
  45. package/studio-plugin/src/modules/handlers/ScriptProfilerHandlers.ts +0 -386
  46. package/studio-plugin/src/modules/handlers/SerializationHandlers.ts +0 -172
  47. package/studio-plugin/src/modules/handlers/TestHandlers.ts +0 -350
  48. package/studio-plugin/src/server/index.server.ts +0 -135
  49. package/studio-plugin/src/types/index.d.ts +0 -57
  50. package/studio-plugin/tsconfig.json +0 -20
@@ -1,191 +0,0 @@
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
- };