rbxstudio-mcp 1.14.0 → 1.14.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/package.json +1 -1
- package/studio-plugin/plugin.luau +45 -11
package/package.json
CHANGED
|
@@ -4097,26 +4097,51 @@ end
|
|
|
4097
4097
|
-- PLAYTEST CONTROL HANDLERS
|
|
4098
4098
|
-- ============================================
|
|
4099
4099
|
|
|
4100
|
+
-- Track active play test task
|
|
4101
|
+
local activePlayTestTask = nil
|
|
4102
|
+
|
|
4100
4103
|
handlers.playSolo = function(requestData)
|
|
4101
4104
|
local success, result = pcall(function()
|
|
4102
4105
|
local wasRunning = RunService:IsRunning()
|
|
4103
4106
|
|
|
4104
|
-
-- If already running, stop first
|
|
4107
|
+
-- If already running, stop first
|
|
4105
4108
|
if wasRunning then
|
|
4106
4109
|
RunService:Stop()
|
|
4107
|
-
|
|
4108
|
-
task.wait(0.1)
|
|
4110
|
+
task.wait(0.2)
|
|
4109
4111
|
end
|
|
4110
4112
|
|
|
4111
|
-
--
|
|
4112
|
-
|
|
4113
|
+
-- Try the new StudioTestService first (available since Dec 2025)
|
|
4114
|
+
local studioTestSuccess, studioTestService = pcall(function()
|
|
4115
|
+
return game:GetService("StudioTestService")
|
|
4116
|
+
end)
|
|
4113
4117
|
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4118
|
+
if studioTestSuccess and studioTestService then
|
|
4119
|
+
-- Use the new StudioTestService API for proper Play Solo mode
|
|
4120
|
+
-- Run in background task so we don't block the HTTP response
|
|
4121
|
+
activePlayTestTask = task.spawn(function()
|
|
4122
|
+
local testResult = studioTestService:ExecutePlayModeAsync(nil)
|
|
4123
|
+
activePlayTestTask = nil
|
|
4124
|
+
end)
|
|
4125
|
+
|
|
4126
|
+
return {
|
|
4127
|
+
success = true,
|
|
4128
|
+
wasRunning = wasRunning,
|
|
4129
|
+
method = "StudioTestService:ExecutePlayModeAsync",
|
|
4130
|
+
message = wasRunning and "Restarted Play Solo (was already running)" or "Started Play Solo mode",
|
|
4131
|
+
note = "Use get_output to read script output. Use stop_play when done."
|
|
4132
|
+
}
|
|
4133
|
+
else
|
|
4134
|
+
-- Fallback to RunService for older Studio versions
|
|
4135
|
+
RunService:Run()
|
|
4136
|
+
|
|
4137
|
+
return {
|
|
4138
|
+
success = true,
|
|
4139
|
+
wasRunning = wasRunning,
|
|
4140
|
+
method = "RunService:Run (fallback)",
|
|
4141
|
+
message = wasRunning and "Restarted play test (was already running)" or "Started Run mode (fallback - StudioTestService not available)",
|
|
4142
|
+
note = "Use get_output to read script output. Use stop_play when done."
|
|
4143
|
+
}
|
|
4144
|
+
end
|
|
4120
4145
|
end)
|
|
4121
4146
|
|
|
4122
4147
|
if success then
|
|
@@ -4141,7 +4166,16 @@ handlers.stopPlay = function(requestData)
|
|
|
4141
4166
|
}
|
|
4142
4167
|
end
|
|
4143
4168
|
|
|
4169
|
+
-- Try StudioTestService:EndTest first if available
|
|
4170
|
+
local endedViaStudioTest = false
|
|
4171
|
+
pcall(function()
|
|
4172
|
+
local studioTestService = game:GetService("StudioTestService")
|
|
4173
|
+
-- EndTest must be called from test context, but Stop() should work
|
|
4174
|
+
end)
|
|
4175
|
+
|
|
4176
|
+
-- Use RunService:Stop() - this works for both Run and Play modes
|
|
4144
4177
|
RunService:Stop()
|
|
4178
|
+
activePlayTestTask = nil
|
|
4145
4179
|
|
|
4146
4180
|
return {
|
|
4147
4181
|
success = true,
|