@chrrxs/robloxstudio-mcp 2.11.3 → 2.11.4

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 CHANGED
@@ -1261,7 +1261,28 @@ m.Parent = workspace
1261
1261
  local bridgeOk, inner = bf:Invoke(m)
1262
1262
  m:Destroy()
1263
1263
  if not bridgeOk then
1264
- return HttpService:JSONEncode({ bridge = "ok", ok = false, error = tostring(inner) })
1264
+ local errMsg = tostring(inner)
1265
+ -- pcall(require, payload) collapses parse/compile failures into the
1266
+ -- canned engine string below. The real parser diagnostic was emitted
1267
+ -- to LogService just before. Walk GetLogHistory backward for the most
1268
+ -- recent ERR entry tagged at our payload path and substitute.
1269
+ if errMsg == "Requested module experienced an error while loading" then
1270
+ -- The parser diagnostic is emitted to LogService on the next
1271
+ -- engine frame, not synchronously with pcall(require). task.wait(0)
1272
+ -- yields too early; 50ms is enough to let the frame complete and
1273
+ -- the message land in GetLogHistory.
1274
+ task.wait(0.05)
1275
+ local LogService = game:GetService("LogService")
1276
+ local hist = LogService:GetLogHistory()
1277
+ for i = #hist, 1, -1 do
1278
+ local e = hist[i]
1279
+ if e.messageType == Enum.MessageType.MessageError and string.sub(e.message, 1, 27) == "Workspace.__MCPEvalPayload:" then
1280
+ errMsg = e.message
1281
+ break
1282
+ end
1283
+ end
1284
+ end
1285
+ return HttpService:JSONEncode({ bridge = "ok", ok = false, error = errMsg })
1265
1286
  end
1266
1287
  -- inner is the {ok, value, output} table from our IIFE. Defensive: if it's
1267
1288
  -- somehow not a table (caller bypassed the wrapper), fall back to old shape.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrrxs/robloxstudio-mcp",
3
- "version": "2.11.3",
3
+ "version": "2.11.4",
4
4
  "description": "MCP Server for Roblox Studio Integration (fork of boshyxd/robloxstudio-mcp with per-peer execute_luau + stop_playtest fixes)",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -2827,7 +2827,9 @@ return {
2827
2827
  <string name="Name">MetadataHandlers</string>
2828
2828
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
2829
2829
  local TS = require(script.Parent.Parent.Parent.include.RuntimeLib)
2830
- local CollectionService = TS.import(script, script.Parent.Parent.Parent, "node_modules", "@rbxts", "services").CollectionService
2830
+ local _services = TS.import(script, script.Parent.Parent.Parent, "node_modules", "@rbxts", "services")
2831
+ local CollectionService = _services.CollectionService
2832
+ local LogService = _services.LogService
2831
2833
  local Utils = TS.import(script, script.Parent.Parent, "Utils")
2832
2834
  local Recording = TS.import(script, script.Parent.Parent, "Recording")
2833
2835
  local ChangeHistoryService = game:GetService("ChangeHistoryService")
@@ -3314,7 +3316,26 @@ end)())`
3314
3316
  end)
3315
3317
  m:Destroy()
3316
3318
  if not okReq then
3317
- error(tostring(reqResult))
3319
+ local errMsg = tostring(reqResult)
3320
+ -- pcall(require, m) collapses parse/compile failures into the
3321
+ -- canned engine string below. Walk LogService backward for the
3322
+ -- real diagnostic, which was emitted to MessageOut just before.
3323
+ if errMsg == "Requested module experienced an error while loading" then
3324
+ -- The parser diagnostic is emitted to LogService on the next
3325
+ -- engine frame, not synchronously with pcall(require). task.wait(0)
3326
+ -- yields too early; 50ms is enough to let the frame complete and
3327
+ -- the message land in GetLogHistory.
3328
+ task.wait(0.05)
3329
+ local hist = LogService:GetLogHistory()
3330
+ for i = #hist - 1, 0, -1 do
3331
+ local e = hist[i + 1]
3332
+ if e.messageType == Enum.MessageType.MessageError and string.sub(e.message, 1, 31) == "Workspace.__MCPExecLuauPayload:" then
3333
+ errMsg = e.message
3334
+ break
3335
+ end
3336
+ end
3337
+ end
3338
+ error(errMsg)
3318
3339
  end
3319
3340
  return reqResult
3320
3341
  end
@@ -6215,7 +6236,7 @@ return {
6215
6236
  <Properties>
6216
6237
  <string name="Name">State</string>
6217
6238
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
6218
- local CURRENT_VERSION = "2.11.3"
6239
+ local CURRENT_VERSION = "2.11.4"
6219
6240
  local MAX_CONNECTIONS = 5
6220
6241
  local BASE_PORT = 58741
6221
6242
  local activeTabIndex = 0
@@ -2827,7 +2827,9 @@ return {
2827
2827
  <string name="Name">MetadataHandlers</string>
2828
2828
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
2829
2829
  local TS = require(script.Parent.Parent.Parent.include.RuntimeLib)
2830
- local CollectionService = TS.import(script, script.Parent.Parent.Parent, "node_modules", "@rbxts", "services").CollectionService
2830
+ local _services = TS.import(script, script.Parent.Parent.Parent, "node_modules", "@rbxts", "services")
2831
+ local CollectionService = _services.CollectionService
2832
+ local LogService = _services.LogService
2831
2833
  local Utils = TS.import(script, script.Parent.Parent, "Utils")
2832
2834
  local Recording = TS.import(script, script.Parent.Parent, "Recording")
2833
2835
  local ChangeHistoryService = game:GetService("ChangeHistoryService")
@@ -3314,7 +3316,26 @@ end)())`
3314
3316
  end)
3315
3317
  m:Destroy()
3316
3318
  if not okReq then
3317
- error(tostring(reqResult))
3319
+ local errMsg = tostring(reqResult)
3320
+ -- pcall(require, m) collapses parse/compile failures into the
3321
+ -- canned engine string below. Walk LogService backward for the
3322
+ -- real diagnostic, which was emitted to MessageOut just before.
3323
+ if errMsg == "Requested module experienced an error while loading" then
3324
+ -- The parser diagnostic is emitted to LogService on the next
3325
+ -- engine frame, not synchronously with pcall(require). task.wait(0)
3326
+ -- yields too early; 50ms is enough to let the frame complete and
3327
+ -- the message land in GetLogHistory.
3328
+ task.wait(0.05)
3329
+ local hist = LogService:GetLogHistory()
3330
+ for i = #hist - 1, 0, -1 do
3331
+ local e = hist[i + 1]
3332
+ if e.messageType == Enum.MessageType.MessageError and string.sub(e.message, 1, 31) == "Workspace.__MCPExecLuauPayload:" then
3333
+ errMsg = e.message
3334
+ break
3335
+ end
3336
+ end
3337
+ end
3338
+ error(errMsg)
3318
3339
  end
3319
3340
  return reqResult
3320
3341
  end
@@ -6215,7 +6236,7 @@ return {
6215
6236
  <Properties>
6216
6237
  <string name="Name">State</string>
6217
6238
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
6218
- local CURRENT_VERSION = "2.11.3"
6239
+ local CURRENT_VERSION = "2.11.4"
6219
6240
  local MAX_CONNECTIONS = 5
6220
6241
  local BASE_PORT = 58741
6221
6242
  local activeTabIndex = 0
@@ -1,4 +1,4 @@
1
- import { CollectionService } from "@rbxts/services";
1
+ import { CollectionService, LogService } from "@rbxts/services";
2
2
  import Utils from "../Utils";
3
3
  import Recording from "../Recording";
4
4
 
@@ -326,7 +326,31 @@ end)())`;
326
326
  m.Parent = game.GetService("Workspace");
327
327
  const [okReq, reqResult] = pcall(() => require(m));
328
328
  m.Destroy();
329
- if (!okReq) error(tostring(reqResult));
329
+ if (!okReq) {
330
+ let errMsg = tostring(reqResult);
331
+ // pcall(require, m) collapses parse/compile failures into the
332
+ // canned engine string below. Walk LogService backward for the
333
+ // real diagnostic, which was emitted to MessageOut just before.
334
+ if (errMsg === "Requested module experienced an error while loading") {
335
+ // The parser diagnostic is emitted to LogService on the next
336
+ // engine frame, not synchronously with pcall(require). task.wait(0)
337
+ // yields too early; 50ms is enough to let the frame complete and
338
+ // the message land in GetLogHistory.
339
+ task.wait(0.05);
340
+ const hist = LogService.GetLogHistory();
341
+ for (let i = hist.size() - 1; i >= 0; i--) {
342
+ const e = hist[i];
343
+ if (
344
+ e.messageType === Enum.MessageType.MessageError &&
345
+ string.sub(e.message, 1, 31) === "Workspace.__MCPExecLuauPayload:"
346
+ ) {
347
+ errMsg = e.message;
348
+ break;
349
+ }
350
+ }
351
+ }
352
+ error(errMsg);
353
+ }
330
354
  return reqResult as unknown as WrapperResult;
331
355
  };
332
356