robloxstudio-mcp 2.4.0 → 2.5.0
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.js +173 -10
- package/dist/install-plugin-cli.js +87 -0
- package/package.json +3 -2
- package/studio-plugin/MCPPlugin.rbxmx +1522 -183
- package/studio-plugin/src/modules/Communication.ts +3 -0
- package/studio-plugin/src/modules/Utils.ts +1 -1
- package/studio-plugin/src/modules/handlers/AssetHandlers.ts +79 -68
- package/studio-plugin/src/modules/handlers/BuildHandlers.ts +36 -31
- package/studio-plugin/src/modules/handlers/CaptureHandlers.ts +118 -0
- package/studio-plugin/src/modules/handlers/InstanceHandlers.ts +125 -72
- package/studio-plugin/src/modules/handlers/QueryHandlers.ts +25 -8
- package/studio-plugin/src/modules/handlers/ScriptHandlers.ts +1 -0
|
@@ -9,6 +9,7 @@ interface TreeNode {
|
|
|
9
9
|
children: TreeNode[];
|
|
10
10
|
hasSource?: boolean;
|
|
11
11
|
scriptType?: string;
|
|
12
|
+
enabled?: boolean;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
function getFileTree(requestData: Record<string, unknown>) {
|
|
@@ -34,6 +35,9 @@ function getFileTree(requestData: Record<string, unknown>) {
|
|
|
34
35
|
if (instance.IsA("LuaSourceContainer")) {
|
|
35
36
|
node.hasSource = true;
|
|
36
37
|
node.scriptType = instance.ClassName;
|
|
38
|
+
if (instance.IsA("BaseScript")) {
|
|
39
|
+
node.enabled = instance.Enabled;
|
|
40
|
+
}
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
for (const child of instance.GetChildren()) {
|
|
@@ -55,7 +59,7 @@ function searchFiles(requestData: Record<string, unknown>) {
|
|
|
55
59
|
|
|
56
60
|
if (!query) return { error: "Query is required" };
|
|
57
61
|
|
|
58
|
-
const results: { name: string; className: string; path: string; hasSource: boolean }[] = [];
|
|
62
|
+
const results: { name: string; className: string; path: string; hasSource: boolean; enabled?: boolean }[] = [];
|
|
59
63
|
|
|
60
64
|
function searchRecursive(instance: Instance) {
|
|
61
65
|
let match = false;
|
|
@@ -69,12 +73,16 @@ function searchFiles(requestData: Record<string, unknown>) {
|
|
|
69
73
|
}
|
|
70
74
|
|
|
71
75
|
if (match) {
|
|
72
|
-
|
|
76
|
+
const entry: { name: string; className: string; path: string; hasSource: boolean; enabled?: boolean } = {
|
|
73
77
|
name: instance.Name,
|
|
74
78
|
className: instance.ClassName,
|
|
75
79
|
path: getInstancePath(instance),
|
|
76
80
|
hasSource: instance.IsA("LuaSourceContainer"),
|
|
77
|
-
}
|
|
81
|
+
};
|
|
82
|
+
if (instance.IsA("BaseScript")) {
|
|
83
|
+
entry.enabled = instance.Enabled;
|
|
84
|
+
}
|
|
85
|
+
results.push(entry);
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
for (const child of instance.GetChildren()) {
|
|
@@ -300,15 +308,19 @@ function getInstanceChildren(requestData: Record<string, unknown>) {
|
|
|
300
308
|
const instance = getInstanceByPath(instancePath);
|
|
301
309
|
if (!instance) return { error: `Instance not found: ${instancePath}` };
|
|
302
310
|
|
|
303
|
-
const children: { name: string; className: string; path: string; hasChildren: boolean; hasSource: boolean }[] = [];
|
|
311
|
+
const children: { name: string; className: string; path: string; hasChildren: boolean; hasSource: boolean; enabled?: boolean }[] = [];
|
|
304
312
|
for (const child of instance.GetChildren()) {
|
|
305
|
-
|
|
313
|
+
const entry: { name: string; className: string; path: string; hasChildren: boolean; hasSource: boolean; enabled?: boolean } = {
|
|
306
314
|
name: child.Name,
|
|
307
315
|
className: child.ClassName,
|
|
308
316
|
path: getInstancePath(child),
|
|
309
317
|
hasChildren: child.GetChildren().size() > 0,
|
|
310
318
|
hasSource: child.IsA("LuaSourceContainer"),
|
|
311
|
-
}
|
|
319
|
+
};
|
|
320
|
+
if (child.IsA("BaseScript")) {
|
|
321
|
+
entry.enabled = child.Enabled;
|
|
322
|
+
}
|
|
323
|
+
children.push(entry);
|
|
312
324
|
}
|
|
313
325
|
|
|
314
326
|
return { instancePath, children, count: children.size() };
|
|
@@ -568,6 +580,7 @@ function grepScripts(requestData: Record<string, unknown>) {
|
|
|
568
580
|
instancePath: string;
|
|
569
581
|
name: string;
|
|
570
582
|
className: string;
|
|
583
|
+
enabled?: boolean;
|
|
571
584
|
matches: LineMatch[];
|
|
572
585
|
}
|
|
573
586
|
|
|
@@ -644,12 +657,16 @@ function grepScripts(requestData: Record<string, unknown>) {
|
|
|
644
657
|
}
|
|
645
658
|
|
|
646
659
|
if (scriptMatchCount > 0) {
|
|
647
|
-
|
|
660
|
+
const scriptResult: ScriptResult = {
|
|
648
661
|
instancePath: getInstancePath(instance),
|
|
649
662
|
name: instance.Name,
|
|
650
663
|
className: instance.ClassName,
|
|
651
664
|
matches: scriptMatches,
|
|
652
|
-
}
|
|
665
|
+
};
|
|
666
|
+
if (instance.IsA("BaseScript")) {
|
|
667
|
+
scriptResult.enabled = instance.Enabled;
|
|
668
|
+
}
|
|
669
|
+
results.push(scriptResult);
|
|
653
670
|
}
|
|
654
671
|
}
|
|
655
672
|
|
|
@@ -11,6 +11,7 @@ function normalizeEscapes(s: string): string {
|
|
|
11
11
|
result = result.gsub("\\n", "\n")[0];
|
|
12
12
|
result = result.gsub("\\t", "\t")[0];
|
|
13
13
|
result = result.gsub("\\r", "\r")[0];
|
|
14
|
+
result = result.gsub('\\"', '"')[0];
|
|
14
15
|
result = result.gsub("\\\\", "\\")[0];
|
|
15
16
|
return result;
|
|
16
17
|
}
|