@chrrxs/robloxstudio-mcp-inspector 2.16.0 → 2.16.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.
- package/dist/index.js +56 -15
- package/package.json +1 -1
- package/studio-plugin/MCPInspectorPlugin.rbxmx +446 -107
- package/studio-plugin/MCPPlugin.rbxmx +446 -107
- package/studio-plugin/src/modules/ClientBroker.ts +32 -6
- package/studio-plugin/src/modules/Communication.ts +40 -22
- package/studio-plugin/src/modules/HttpDiagnostics.ts +50 -0
- package/studio-plugin/src/modules/ServerUrlSettings.ts +48 -0
- package/studio-plugin/src/modules/StopPlayMonitor.ts +152 -35
- package/studio-plugin/src/modules/handlers/TestHandlers.ts +18 -13
- package/studio-plugin/src/server/index.server.ts +15 -4
package/dist/index.js
CHANGED
|
@@ -386,30 +386,60 @@ function createHttpServer(tools, bridge, allowedTools, serverConfig) {
|
|
|
386
386
|
});
|
|
387
387
|
app.post("/ready", (req, res) => {
|
|
388
388
|
const { pluginSessionId, instanceId, role, placeId, placeName, dataModelName, isRunning, pluginVersion, pluginVariant } = req.body;
|
|
389
|
+
const requestContext = {
|
|
390
|
+
instanceId: typeof instanceId === "string" ? instanceId : void 0,
|
|
391
|
+
role: typeof role === "string" ? role : void 0,
|
|
392
|
+
placeId: typeof placeId === "number" ? placeId : void 0,
|
|
393
|
+
placeName: typeof placeName === "string" ? placeName : void 0,
|
|
394
|
+
dataModelName: typeof dataModelName === "string" ? dataModelName : void 0,
|
|
395
|
+
isRunning: typeof isRunning === "boolean" ? isRunning : void 0,
|
|
396
|
+
pluginVersion: typeof pluginVersion === "string" ? pluginVersion : void 0,
|
|
397
|
+
pluginVariant: typeof pluginVariant === "string" ? pluginVariant : void 0
|
|
398
|
+
};
|
|
389
399
|
if (!pluginSessionId || !instanceId || !role) {
|
|
400
|
+
const missingFields = [
|
|
401
|
+
!pluginSessionId ? "pluginSessionId" : void 0,
|
|
402
|
+
!instanceId ? "instanceId" : void 0,
|
|
403
|
+
!role ? "role" : void 0
|
|
404
|
+
].filter((field) => !!field);
|
|
390
405
|
res.status(400).json({
|
|
391
406
|
success: false,
|
|
392
|
-
error: "
|
|
407
|
+
error: "missing_ready_fields",
|
|
408
|
+
message: `/ready missing required field(s): ${missingFields.join(", ")}`,
|
|
409
|
+
missingFields,
|
|
410
|
+
request: requestContext
|
|
411
|
+
});
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
let result;
|
|
415
|
+
try {
|
|
416
|
+
result = bridge.registerInstance({
|
|
417
|
+
pluginSessionId,
|
|
418
|
+
instanceId,
|
|
419
|
+
role,
|
|
420
|
+
placeId: typeof placeId === "number" ? placeId : 0,
|
|
421
|
+
placeName: typeof placeName === "string" ? placeName : "",
|
|
422
|
+
dataModelName: typeof dataModelName === "string" ? dataModelName : "",
|
|
423
|
+
isRunning: !!isRunning,
|
|
424
|
+
pluginVersion: typeof pluginVersion === "string" ? pluginVersion : "",
|
|
425
|
+
pluginVariant: typeof pluginVariant === "string" ? pluginVariant : "unknown",
|
|
426
|
+
serverVersion: serverConfig?.version ?? ""
|
|
427
|
+
});
|
|
428
|
+
} catch (err) {
|
|
429
|
+
res.status(500).json({
|
|
430
|
+
success: false,
|
|
431
|
+
error: "ready_registration_exception",
|
|
432
|
+
message: err instanceof Error ? err.message : String(err),
|
|
433
|
+
request: requestContext
|
|
393
434
|
});
|
|
394
435
|
return;
|
|
395
436
|
}
|
|
396
|
-
const result = bridge.registerInstance({
|
|
397
|
-
pluginSessionId,
|
|
398
|
-
instanceId,
|
|
399
|
-
role,
|
|
400
|
-
placeId: typeof placeId === "number" ? placeId : 0,
|
|
401
|
-
placeName: typeof placeName === "string" ? placeName : "",
|
|
402
|
-
dataModelName: typeof dataModelName === "string" ? dataModelName : "",
|
|
403
|
-
isRunning: !!isRunning,
|
|
404
|
-
pluginVersion: typeof pluginVersion === "string" ? pluginVersion : "",
|
|
405
|
-
pluginVariant: typeof pluginVariant === "string" ? pluginVariant : "unknown",
|
|
406
|
-
serverVersion: serverConfig?.version ?? ""
|
|
407
|
-
});
|
|
408
437
|
if (!result.ok) {
|
|
409
438
|
res.status(409).json({
|
|
410
439
|
success: false,
|
|
411
440
|
error: result.error.code,
|
|
412
441
|
message: result.error.message,
|
|
442
|
+
request: requestContext,
|
|
413
443
|
existing: result.error.existing
|
|
414
444
|
});
|
|
415
445
|
return;
|
|
@@ -4324,9 +4354,20 @@ ${code}`
|
|
|
4324
4354
|
};
|
|
4325
4355
|
}
|
|
4326
4356
|
async stopPlaytest(instance_id) {
|
|
4327
|
-
const
|
|
4357
|
+
const { instanceId } = this._resolveSingleTarget("edit", instance_id);
|
|
4358
|
+
const response = await this.client.request("/api/stop-playtest", {}, instanceId, "edit");
|
|
4359
|
+
let wait;
|
|
4360
|
+
if (response?.success === true) {
|
|
4361
|
+
wait = await this._waitForRuntimeRoles(instanceId, { noRuntime: true }, 15);
|
|
4362
|
+
}
|
|
4363
|
+
const body = wait ? {
|
|
4364
|
+
...response,
|
|
4365
|
+
runtimeStopped: wait.ok,
|
|
4366
|
+
timedOut: wait.timedOut,
|
|
4367
|
+
roles: wait.roles
|
|
4368
|
+
} : response;
|
|
4328
4369
|
return {
|
|
4329
|
-
content: [{ type: "text", text: JSON.stringify(
|
|
4370
|
+
content: [{ type: "text", text: JSON.stringify(body) }]
|
|
4330
4371
|
};
|
|
4331
4372
|
}
|
|
4332
4373
|
async getPlaytestOutput(target, instance_id) {
|
package/package.json
CHANGED