@chrrxs/robloxstudio-mcp 2.16.3 → 2.16.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
@@ -3225,6 +3225,16 @@ var init_tools = __esm({
3225
3225
  const instanceIds = new Set(this.bridge.getEquivalentInstanceIds(instanceId));
3226
3226
  return this.bridge.getInstances().filter((i) => instanceIds.has(i.instanceId) && (i.role === "server" || /^client-\d+$/.test(i.role))).map((i) => ({ instanceId: i.instanceId, role: i.role }));
3227
3227
  }
3228
+ _compactSimulationResetResult(result) {
3229
+ const compact = {};
3230
+ if ("network" in result)
3231
+ compact.network = true;
3232
+ if ("deviceSimulator" in result)
3233
+ compact.deviceSimulator = true;
3234
+ if (result.errors !== void 0)
3235
+ compact.errors = result.errors;
3236
+ return compact;
3237
+ }
3228
3238
  _resolveDeviceSimulatorSingleTarget(target, instance_id, toolName) {
3229
3239
  const selectedTarget = target ?? "edit";
3230
3240
  if (selectedTarget === "server" || selectedTarget === "all" || selectedTarget === "all-clients" || selectedTarget === "edit-proxy") {
@@ -4137,10 +4147,12 @@ ${code}`
4137
4147
  }
4138
4148
  return { role, result };
4139
4149
  }));
4150
+ const rawRoles = {};
4140
4151
  const roles = {};
4141
4152
  const failures = [];
4142
4153
  for (const entry of roleEntries) {
4143
- roles[entry.role] = entry.result;
4154
+ rawRoles[entry.role] = entry.result;
4155
+ roles[entry.role] = this._compactSimulationResetResult(entry.result);
4144
4156
  const errors = entry.result.errors;
4145
4157
  if (errors) {
4146
4158
  for (const [kind, message] of Object.entries(errors)) {
@@ -4149,15 +4161,15 @@ ${code}`
4149
4161
  }
4150
4162
  }
4151
4163
  const body = {
4164
+ success: true,
4152
4165
  target: resolved.selectedTarget,
4153
4166
  network: resetNetwork,
4154
4167
  deviceSimulator: resetDeviceSimulator,
4155
4168
  roles,
4156
- warnings: resolved.warnings,
4157
- persistenceNotes: SIMULATION_PERSISTENCE_NOTES
4169
+ warnings: resolved.warnings
4158
4170
  };
4159
4171
  if (failures.length > 0) {
4160
- throw new Error(`reset_simulation_state failed for ${failures.join("; ")}. Partial result: ${JSON.stringify(body)}`);
4172
+ throw new Error(`reset_simulation_state failed for ${failures.join("; ")}. Partial result: ${JSON.stringify({ ...body, roles: rawRoles })}`);
4161
4173
  }
4162
4174
  return {
4163
4175
  content: [{
@@ -4468,6 +4480,24 @@ ${code}`
4468
4480
  }
4469
4481
  });
4470
4482
  }
4483
+ const existingRuntime = this._runtimeTargetsForEquivalentInstances(resolved.targetInstanceId);
4484
+ if (existingRuntime.length > 0) {
4485
+ const roles = this._rolesForEquivalentInstances(resolved.targetInstanceId);
4486
+ return {
4487
+ content: [{
4488
+ type: "text",
4489
+ text: JSON.stringify({
4490
+ success: false,
4491
+ error: "Playtest already running.",
4492
+ message: "A playtest is already running for this Studio place. Stop the current playtest before starting another.",
4493
+ runtimeReady: true,
4494
+ timedOut: false,
4495
+ roles,
4496
+ runtimeRoles: existingRuntime.map((target) => target.role)
4497
+ })
4498
+ }]
4499
+ };
4500
+ }
4471
4501
  const response = await this.client.request("/api/start-playtest", data, resolved.targetInstanceId, resolved.targetRole);
4472
4502
  let wait;
4473
4503
  if (response?.success === true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrrxs/robloxstudio-mcp",
3
- "version": "2.16.3",
3
+ "version": "2.16.4",
4
4
  "description": "MCP server for testing, debugging, and controlling Roblox Studio from AI coding tools",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1411,9 +1411,9 @@ local function computeBridgeStamp()
1411
1411
  for i = 1, #combined do
1412
1412
  h = (h * 33 + (string.byte(combined, i))) % 2147483647
1413
1413
  end
1414
- -- "2.16.3" is replaced with the package version at package time
1414
+ -- "2.16.4" is replaced with the package version at package time
1415
1415
  -- (scripts/build-plugin.mjs injectVersion), so a release bump also restamps.
1416
- return `{tostring(h)}-2.16.3`
1416
+ return `{tostring(h)}-2.16.4`
1417
1417
  end
1418
1418
  local BRIDGE_STAMP = computeBridgeStamp()
1419
1419
  local function setSource(scriptInst, source)
@@ -8041,7 +8041,7 @@ return {
8041
8041
  <Properties>
8042
8042
  <string name="Name">State</string>
8043
8043
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
8044
- local CURRENT_VERSION = "2.16.3"
8044
+ local CURRENT_VERSION = "2.16.4"
8045
8045
  local PLUGIN_VARIANT = "inspector"
8046
8046
  local MAX_CONNECTIONS = 5
8047
8047
  local BASE_PORT = 58741
@@ -1411,9 +1411,9 @@ local function computeBridgeStamp()
1411
1411
  for i = 1, #combined do
1412
1412
  h = (h * 33 + (string.byte(combined, i))) % 2147483647
1413
1413
  end
1414
- -- "2.16.3" is replaced with the package version at package time
1414
+ -- "2.16.4" is replaced with the package version at package time
1415
1415
  -- (scripts/build-plugin.mjs injectVersion), so a release bump also restamps.
1416
- return `{tostring(h)}-2.16.3`
1416
+ return `{tostring(h)}-2.16.4`
1417
1417
  end
1418
1418
  local BRIDGE_STAMP = computeBridgeStamp()
1419
1419
  local function setSource(scriptInst, source)
@@ -8041,7 +8041,7 @@ return {
8041
8041
  <Properties>
8042
8042
  <string name="Name">State</string>
8043
8043
  <string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
8044
- local CURRENT_VERSION = "2.16.3"
8044
+ local CURRENT_VERSION = "2.16.4"
8045
8045
  local PLUGIN_VARIANT = "main"
8046
8046
  local MAX_CONNECTIONS = 5
8047
8047
  local BASE_PORT = 58741