@chrrxs/robloxstudio-mcp 2.22.4 → 2.23.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 +5107 -3632
- package/package.json +1 -1
- package/studio-plugin/.Carbon.rbxm.lock +0 -0
- package/studio-plugin/Carbon.rbxm +0 -0
- package/studio-plugin/INSTALLATION.md +4 -0
- package/studio-plugin/MCPInspectorPlugin.rbxmx +345 -79
- package/studio-plugin/MCPPlugin.rbxmx +345 -79
- package/studio-plugin/src/modules/AssetSanitizationPolicy.ts +127 -0
- package/studio-plugin/src/modules/handlers/AssetHandlers.ts +179 -29
|
@@ -145,6 +145,117 @@ end)
|
|
|
145
145
|
<string name="Name">modules</string>
|
|
146
146
|
</Properties>
|
|
147
147
|
<Item class="ModuleScript" referent="2">
|
|
148
|
+
<Properties>
|
|
149
|
+
<string name="Name">AssetSanitizationPolicy</string>
|
|
150
|
+
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
151
|
+
local function countInstances(instances)
|
|
152
|
+
local count = 0
|
|
153
|
+
for _, _instance in instances do
|
|
154
|
+
count += 1
|
|
155
|
+
end
|
|
156
|
+
return count
|
|
157
|
+
end
|
|
158
|
+
local function scanForbiddenImportedInstances(root)
|
|
159
|
+
local scripts = {}
|
|
160
|
+
local packageLinks = {}
|
|
161
|
+
local function inspect(instance)
|
|
162
|
+
-- IsA("LuaSourceContainer") covers Script, LocalScript, ModuleScript,
|
|
163
|
+
-- and any future script-bearing subclass. Names, source, creator,
|
|
164
|
+
-- reputation, and hierarchy depth are deliberately irrelevant.
|
|
165
|
+
if instance:IsA("LuaSourceContainer") then
|
|
166
|
+
local _instance = instance
|
|
167
|
+
table.insert(scripts, _instance)
|
|
168
|
+
end
|
|
169
|
+
if instance:IsA("PackageLink") then
|
|
170
|
+
local _instance = instance
|
|
171
|
+
table.insert(packageLinks, _instance)
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
inspect(root)
|
|
175
|
+
-- GetDescendants performs an engine-level, unlimited-depth traversal.
|
|
176
|
+
-- Never replace this security scan with a depth-limited tree walk.
|
|
177
|
+
for _, descendant in root:GetDescendants() do
|
|
178
|
+
inspect(descendant)
|
|
179
|
+
end
|
|
180
|
+
return {
|
|
181
|
+
scripts = scripts,
|
|
182
|
+
packageLinks = packageLinks,
|
|
183
|
+
}
|
|
184
|
+
end
|
|
185
|
+
local function sanitizeLoadedAsset(root, operations)
|
|
186
|
+
if not operations.forceUnparent(root) then
|
|
187
|
+
operations.destroy(root)
|
|
188
|
+
return {
|
|
189
|
+
success = false,
|
|
190
|
+
removedScriptCount = 0,
|
|
191
|
+
removedPackageLinkCount = 0,
|
|
192
|
+
remainingScriptCount = 0,
|
|
193
|
+
remainingPackageLinkCount = 0,
|
|
194
|
+
error = "Loaded asset could not be kept unparented for sanitization.",
|
|
195
|
+
}
|
|
196
|
+
end
|
|
197
|
+
local firstScan = scanForbiddenImportedInstances(root)
|
|
198
|
+
local firstScriptCount = countInstances(firstScan.scripts)
|
|
199
|
+
local firstPackageLinkCount = countInstances(firstScan.packageLinks)
|
|
200
|
+
-- A forbidden root cannot be removed while preserving an import wrapper.
|
|
201
|
+
-- Destroy the whole load and fail closed.
|
|
202
|
+
if root:IsA("LuaSourceContainer") or root:IsA("PackageLink") then
|
|
203
|
+
local rootWasScript = root:IsA("LuaSourceContainer")
|
|
204
|
+
local rootWasPackageLink = root:IsA("PackageLink")
|
|
205
|
+
operations.destroy(root)
|
|
206
|
+
return {
|
|
207
|
+
success = false,
|
|
208
|
+
removedScriptCount = firstScriptCount,
|
|
209
|
+
removedPackageLinkCount = firstPackageLinkCount,
|
|
210
|
+
remainingScriptCount = if rootWasScript then 1 else 0,
|
|
211
|
+
remainingPackageLinkCount = if rootWasPackageLink then 1 else 0,
|
|
212
|
+
error = "Loaded asset root is a forbidden executable or package-link instance.",
|
|
213
|
+
}
|
|
214
|
+
end
|
|
215
|
+
local removedScriptCount = 0
|
|
216
|
+
for _, scriptInstance in firstScan.scripts do
|
|
217
|
+
if operations.destroy(scriptInstance) then
|
|
218
|
+
removedScriptCount += 1
|
|
219
|
+
end
|
|
220
|
+
end
|
|
221
|
+
local removedPackageLinkCount = 0
|
|
222
|
+
for _, packageLink in firstScan.packageLinks do
|
|
223
|
+
if operations.destroy(packageLink) then
|
|
224
|
+
removedPackageLinkCount += 1
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
-- Mandatory second unlimited-depth scan. If any forbidden instance
|
|
228
|
+
-- survived, destroy the entire imported root and insert nothing.
|
|
229
|
+
local verificationScan = scanForbiddenImportedInstances(root)
|
|
230
|
+
local remainingScriptCount = countInstances(verificationScan.scripts)
|
|
231
|
+
local remainingPackageLinkCount = countInstances(verificationScan.packageLinks)
|
|
232
|
+
if remainingScriptCount > 0 or remainingPackageLinkCount > 0 then
|
|
233
|
+
operations.destroy(root)
|
|
234
|
+
return {
|
|
235
|
+
success = false,
|
|
236
|
+
removedScriptCount = removedScriptCount,
|
|
237
|
+
removedPackageLinkCount = removedPackageLinkCount,
|
|
238
|
+
remainingScriptCount = remainingScriptCount,
|
|
239
|
+
remainingPackageLinkCount = remainingPackageLinkCount,
|
|
240
|
+
error = "Asset sanitization verification failed; the entire imported asset was destroyed.",
|
|
241
|
+
}
|
|
242
|
+
end
|
|
243
|
+
return {
|
|
244
|
+
success = true,
|
|
245
|
+
removedScriptCount = removedScriptCount,
|
|
246
|
+
removedPackageLinkCount = removedPackageLinkCount,
|
|
247
|
+
remainingScriptCount = 0,
|
|
248
|
+
remainingPackageLinkCount = 0,
|
|
249
|
+
}
|
|
250
|
+
end
|
|
251
|
+
return {
|
|
252
|
+
scanForbiddenImportedInstances = scanForbiddenImportedInstances,
|
|
253
|
+
sanitizeLoadedAsset = sanitizeLoadedAsset,
|
|
254
|
+
}
|
|
255
|
+
]]></string>
|
|
256
|
+
</Properties>
|
|
257
|
+
</Item>
|
|
258
|
+
<Item class="ModuleScript" referent="3">
|
|
148
259
|
<Properties>
|
|
149
260
|
<string name="Name">ClientBroker</string>
|
|
150
261
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -652,7 +763,7 @@ return {
|
|
|
652
763
|
]]></string>
|
|
653
764
|
</Properties>
|
|
654
765
|
</Item>
|
|
655
|
-
<Item class="ModuleScript" referent="
|
|
766
|
+
<Item class="ModuleScript" referent="4">
|
|
656
767
|
<Properties>
|
|
657
768
|
<string name="Name">Communication</string>
|
|
658
769
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -1319,7 +1430,7 @@ return {
|
|
|
1319
1430
|
]]></string>
|
|
1320
1431
|
</Properties>
|
|
1321
1432
|
</Item>
|
|
1322
|
-
<Item class="ModuleScript" referent="
|
|
1433
|
+
<Item class="ModuleScript" referent="5">
|
|
1323
1434
|
<Properties>
|
|
1324
1435
|
<string name="Name">EvalBridges</string>
|
|
1325
1436
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -1439,9 +1550,9 @@ local function computeBridgeStamp()
|
|
|
1439
1550
|
for i = 1, #combined do
|
|
1440
1551
|
h = (h * 33 + (string.byte(combined, i))) % 2147483647
|
|
1441
1552
|
end
|
|
1442
|
-
-- "2.
|
|
1553
|
+
-- "2.23.0" is replaced with the package version at package time
|
|
1443
1554
|
-- (scripts/build-plugin.mjs injectVersion), so a release bump also restamps.
|
|
1444
|
-
return `{tostring(h)}-2.
|
|
1555
|
+
return `{tostring(h)}-2.23.0`
|
|
1445
1556
|
end
|
|
1446
1557
|
local BRIDGE_STAMP = computeBridgeStamp()
|
|
1447
1558
|
local function setSource(scriptInst, source)
|
|
@@ -1594,17 +1705,20 @@ return {
|
|
|
1594
1705
|
]]></string>
|
|
1595
1706
|
</Properties>
|
|
1596
1707
|
</Item>
|
|
1597
|
-
<Item class="Folder" referent="
|
|
1708
|
+
<Item class="Folder" referent="6">
|
|
1598
1709
|
<Properties>
|
|
1599
1710
|
<string name="Name">handlers</string>
|
|
1600
1711
|
</Properties>
|
|
1601
|
-
<Item class="ModuleScript" referent="
|
|
1712
|
+
<Item class="ModuleScript" referent="7">
|
|
1602
1713
|
<Properties>
|
|
1603
1714
|
<string name="Name">AssetHandlers</string>
|
|
1604
1715
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
1605
1716
|
local TS = require(script.Parent.Parent.Parent.include.RuntimeLib)
|
|
1606
1717
|
local Utils = TS.import(script, script.Parent.Parent, "Utils")
|
|
1607
1718
|
local Recording = TS.import(script, script.Parent.Parent, "Recording")
|
|
1719
|
+
local _AssetSanitizationPolicy = TS.import(script, script.Parent.Parent, "AssetSanitizationPolicy")
|
|
1720
|
+
local sanitizeLoadedAsset = _AssetSanitizationPolicy.sanitizeLoadedAsset
|
|
1721
|
+
local scanForbiddenImportedInstances = _AssetSanitizationPolicy.scanForbiddenImportedInstances
|
|
1608
1722
|
local AssetService = game:GetService("AssetService")
|
|
1609
1723
|
local ChangeHistoryService = game:GetService("ChangeHistoryService")
|
|
1610
1724
|
local Selection = game:GetService("Selection")
|
|
@@ -1614,6 +1728,34 @@ local getInstanceByPath = _binding.getInstanceByPath
|
|
|
1614
1728
|
local _binding_1 = Recording
|
|
1615
1729
|
local beginRecording = _binding_1.beginRecording
|
|
1616
1730
|
local finishRecording = _binding_1.finishRecording
|
|
1731
|
+
local THIRD_PARTY_ASSET_SETTING_HINT = '\nTo load public Creator Store assets that you do not own, enable "Allow Loading Third Party Assets" in Game Settings > Security.'
|
|
1732
|
+
local function destroyImportedRoot(root)
|
|
1733
|
+
pcall(function()
|
|
1734
|
+
root:Destroy()
|
|
1735
|
+
end)
|
|
1736
|
+
end
|
|
1737
|
+
local function formatAssetLoadFailure(assetId, loadError)
|
|
1738
|
+
local settingReadable, allowInsertFreeAssets = pcall(function()
|
|
1739
|
+
return AssetService.AllowInsertFreeAssets
|
|
1740
|
+
end)
|
|
1741
|
+
local settingHint = if settingReadable and allowInsertFreeAssets == true then "" else THIRD_PARTY_ASSET_SETTING_HINT
|
|
1742
|
+
return `Failed to load asset {assetId}: {tostring(loadError)}{settingHint}`
|
|
1743
|
+
end
|
|
1744
|
+
local sanitizationOperations = {
|
|
1745
|
+
forceUnparent = function(root)
|
|
1746
|
+
local instance = root
|
|
1747
|
+
local unparentedOk = pcall(function()
|
|
1748
|
+
instance.Parent = nil
|
|
1749
|
+
end)
|
|
1750
|
+
return unparentedOk and instance.Parent == nil
|
|
1751
|
+
end,
|
|
1752
|
+
destroy = function(instance)
|
|
1753
|
+
local destroyed = pcall(function()
|
|
1754
|
+
instance:Destroy()
|
|
1755
|
+
end)
|
|
1756
|
+
return destroyed
|
|
1757
|
+
end,
|
|
1758
|
+
}
|
|
1617
1759
|
local function insertAsset(requestData)
|
|
1618
1760
|
local assetId = requestData.assetId
|
|
1619
1761
|
local _condition = (requestData.parentPath)
|
|
@@ -1635,15 +1777,27 @@ local function insertAsset(requestData)
|
|
|
1635
1777
|
end
|
|
1636
1778
|
local recordingId = beginRecording(`Insert asset {assetId}`)
|
|
1637
1779
|
local wrapperModel
|
|
1780
|
+
local insertedInstances = {}
|
|
1638
1781
|
local insertSuccess, insertResult = pcall(function()
|
|
1639
|
-
local
|
|
1782
|
+
local loadSuccess, loadResult = pcall(function()
|
|
1783
|
+
return AssetService:LoadAssetAsync(assetId)
|
|
1784
|
+
end)
|
|
1785
|
+
if not loadSuccess or not loadResult then
|
|
1786
|
+
error(formatAssetLoadFailure(assetId, loadResult), 0)
|
|
1787
|
+
end
|
|
1788
|
+
local loadedWrapper = loadResult
|
|
1640
1789
|
wrapperModel = loadedWrapper
|
|
1641
|
-
local
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1790
|
+
local sanitization = sanitizeLoadedAsset(loadedWrapper, sanitizationOperations)
|
|
1791
|
+
if not sanitization.success then
|
|
1792
|
+
local _condition_1 = sanitization.error
|
|
1793
|
+
if _condition_1 == nil then
|
|
1794
|
+
_condition_1 = "Asset sanitization failed."
|
|
1795
|
+
end
|
|
1796
|
+
error(_condition_1, 0)
|
|
1646
1797
|
end
|
|
1798
|
+
local children = loadedWrapper:GetChildren()
|
|
1799
|
+
-- Position while every sanitized child is still contained by the
|
|
1800
|
+
-- unparented wrapper. Nothing reaches the DataModel before verification.
|
|
1647
1801
|
if position then
|
|
1648
1802
|
local _condition_1 = position.x
|
|
1649
1803
|
if _condition_1 == nil then
|
|
@@ -1658,7 +1812,7 @@ local function insertAsset(requestData)
|
|
|
1658
1812
|
_condition_3 = 0
|
|
1659
1813
|
end
|
|
1660
1814
|
local pos = Vector3.new(_condition_1, _condition_2, _condition_3)
|
|
1661
|
-
for _, inst in
|
|
1815
|
+
for _, inst in children do
|
|
1662
1816
|
if inst:IsA("BasePart") then
|
|
1663
1817
|
inst.Position = pos
|
|
1664
1818
|
elseif inst:IsA("Model") then
|
|
@@ -1673,6 +1827,12 @@ local function insertAsset(requestData)
|
|
|
1673
1827
|
end
|
|
1674
1828
|
end
|
|
1675
1829
|
end
|
|
1830
|
+
-- This is the first point at which imported content is parented into
|
|
1831
|
+
-- Studio. Both unlimited-depth scans have already passed.
|
|
1832
|
+
for _, child in children do
|
|
1833
|
+
child.Parent = parentInstance
|
|
1834
|
+
table.insert(insertedInstances, child)
|
|
1835
|
+
end
|
|
1676
1836
|
pcall(function()
|
|
1677
1837
|
Selection:Set(insertedInstances)
|
|
1678
1838
|
end)
|
|
@@ -1696,8 +1856,21 @@ local function insertAsset(requestData)
|
|
|
1696
1856
|
parentPath = parentPath,
|
|
1697
1857
|
insertedCount = #insertedInstances,
|
|
1698
1858
|
instances = resultInstances,
|
|
1859
|
+
sanitization = {
|
|
1860
|
+
removedScriptCount = sanitization.removedScriptCount,
|
|
1861
|
+
removedPackageLinkCount = sanitization.removedPackageLinkCount,
|
|
1862
|
+
verifiedClean = true,
|
|
1863
|
+
},
|
|
1699
1864
|
}
|
|
1700
1865
|
end)
|
|
1866
|
+
if not insertSuccess then
|
|
1867
|
+
-- Roll back any partially-parented children if a later operation failed.
|
|
1868
|
+
for _, inserted in insertedInstances do
|
|
1869
|
+
pcall(function()
|
|
1870
|
+
inserted:Destroy()
|
|
1871
|
+
end)
|
|
1872
|
+
end
|
|
1873
|
+
end
|
|
1701
1874
|
if wrapperModel then
|
|
1702
1875
|
pcall(function()
|
|
1703
1876
|
wrapperModel:Destroy()
|
|
@@ -1715,12 +1888,12 @@ local function previewAsset(requestData)
|
|
|
1715
1888
|
local assetId = requestData.assetId
|
|
1716
1889
|
local _condition = (requestData.includeProperties)
|
|
1717
1890
|
if _condition == nil then
|
|
1718
|
-
_condition =
|
|
1891
|
+
_condition = false
|
|
1719
1892
|
end
|
|
1720
1893
|
local includeProperties = _condition
|
|
1721
1894
|
local _condition_1 = (requestData.maxDepth)
|
|
1722
1895
|
if _condition_1 == nil then
|
|
1723
|
-
_condition_1 =
|
|
1896
|
+
_condition_1 = 4
|
|
1724
1897
|
end
|
|
1725
1898
|
local maxDepth = _condition_1
|
|
1726
1899
|
if not (assetId ~= 0 and assetId == assetId and assetId) then
|
|
@@ -1733,17 +1906,34 @@ local function previewAsset(requestData)
|
|
|
1733
1906
|
end)
|
|
1734
1907
|
if not loadSuccess or not wrapperModel then
|
|
1735
1908
|
return {
|
|
1736
|
-
error =
|
|
1909
|
+
error = formatAssetLoadFailure(assetId, wrapperModel),
|
|
1737
1910
|
}
|
|
1738
1911
|
end
|
|
1739
|
-
--
|
|
1912
|
+
-- Previewed assets never enter the DataModel.
|
|
1913
|
+
local unparentedOk = pcall(function()
|
|
1914
|
+
wrapperModel.Parent = nil
|
|
1915
|
+
end)
|
|
1916
|
+
if not unparentedOk or wrapperModel.Parent ~= nil then
|
|
1917
|
+
destroyImportedRoot(wrapperModel)
|
|
1918
|
+
return {
|
|
1919
|
+
error = `Failed to keep asset {assetId} unparented for preview`,
|
|
1920
|
+
}
|
|
1921
|
+
end
|
|
1922
|
+
-- Security and visual-capability tracking always scan the full descendant
|
|
1923
|
+
-- hierarchy. maxDepth only affects the display tree below.
|
|
1740
1924
|
local totalInstances = 0
|
|
1741
1925
|
local classCounts = {}
|
|
1742
|
-
local hasScripts = false
|
|
1743
1926
|
local hasAnimations = false
|
|
1744
1927
|
local hasSounds = false
|
|
1745
1928
|
local hasParticles = false
|
|
1746
|
-
local
|
|
1929
|
+
local hasVfx = false
|
|
1930
|
+
local hasDecalsOrTextures = false
|
|
1931
|
+
local hasMeshes = false
|
|
1932
|
+
local hasLights = false
|
|
1933
|
+
local hasAttachments = false
|
|
1934
|
+
local soundReferences = {}
|
|
1935
|
+
local uniqueSoundContentIds = {}
|
|
1936
|
+
local function recordSummary(instance)
|
|
1747
1937
|
totalInstances += 1
|
|
1748
1938
|
local className = instance.ClassName
|
|
1749
1939
|
local _condition_2 = classCounts[className]
|
|
@@ -1751,18 +1941,79 @@ local function previewAsset(requestData)
|
|
|
1751
1941
|
_condition_2 = 0
|
|
1752
1942
|
end
|
|
1753
1943
|
classCounts[className] = _condition_2 + 1
|
|
1754
|
-
if instance:IsA("LuaSourceContainer") then
|
|
1755
|
-
hasScripts = true
|
|
1756
|
-
end
|
|
1757
1944
|
if className == "Animation" or className == "AnimationController" or className == "Animator" then
|
|
1758
1945
|
hasAnimations = true
|
|
1759
1946
|
end
|
|
1760
1947
|
if instance:IsA("Sound") then
|
|
1761
1948
|
hasSounds = true
|
|
1949
|
+
local sound = instance
|
|
1950
|
+
local soundId = sound.SoundId
|
|
1951
|
+
if soundId ~= "" then
|
|
1952
|
+
uniqueSoundContentIds[soundId] = true
|
|
1953
|
+
end
|
|
1954
|
+
local _arg0 = {
|
|
1955
|
+
path = sound:GetFullName(),
|
|
1956
|
+
name = sound.Name,
|
|
1957
|
+
className = className,
|
|
1958
|
+
soundId = soundId,
|
|
1959
|
+
volume = sound.Volume,
|
|
1960
|
+
playbackSpeed = sound.PlaybackSpeed,
|
|
1961
|
+
looped = sound.Looped,
|
|
1962
|
+
isLoaded = sound.IsLoaded,
|
|
1963
|
+
timeLength = sound.TimeLength,
|
|
1964
|
+
rollOffMode = tostring(sound.RollOffMode),
|
|
1965
|
+
rollOffMinDistance = sound.RollOffMinDistance,
|
|
1966
|
+
rollOffMaxDistance = sound.RollOffMaxDistance,
|
|
1967
|
+
}
|
|
1968
|
+
table.insert(soundReferences, _arg0)
|
|
1969
|
+
elseif instance:IsA("AudioPlayer") then
|
|
1970
|
+
hasSounds = true
|
|
1971
|
+
local audioPlayer = instance
|
|
1972
|
+
local soundId = tostring(audioPlayer.Asset)
|
|
1973
|
+
if soundId ~= "" then
|
|
1974
|
+
uniqueSoundContentIds[soundId] = true
|
|
1975
|
+
end
|
|
1976
|
+
local _arg0 = {
|
|
1977
|
+
path = audioPlayer:GetFullName(),
|
|
1978
|
+
name = audioPlayer.Name,
|
|
1979
|
+
className = className,
|
|
1980
|
+
soundId = soundId,
|
|
1981
|
+
volume = audioPlayer.Volume,
|
|
1982
|
+
playbackSpeed = audioPlayer.PlaybackSpeed,
|
|
1983
|
+
looped = audioPlayer.Looping,
|
|
1984
|
+
autoPlay = audioPlayer.AutoPlay,
|
|
1985
|
+
isLoaded = audioPlayer.IsReady,
|
|
1986
|
+
timeLength = audioPlayer.TimeLength,
|
|
1987
|
+
}
|
|
1988
|
+
table.insert(soundReferences, _arg0)
|
|
1762
1989
|
end
|
|
1763
|
-
if
|
|
1990
|
+
if instance:IsA("ParticleEmitter") or className == "Fire" or className == "Smoke" or className == "Sparkles" then
|
|
1764
1991
|
hasParticles = true
|
|
1992
|
+
hasVfx = true
|
|
1765
1993
|
end
|
|
1994
|
+
if instance:IsA("Beam") or instance:IsA("Trail") then
|
|
1995
|
+
hasVfx = true
|
|
1996
|
+
end
|
|
1997
|
+
if instance:IsA("Decal") or instance:IsA("Texture") then
|
|
1998
|
+
hasDecalsOrTextures = true
|
|
1999
|
+
end
|
|
2000
|
+
if instance:IsA("MeshPart") or instance:IsA("SpecialMesh") then
|
|
2001
|
+
hasMeshes = true
|
|
2002
|
+
end
|
|
2003
|
+
if instance:IsA("Light") then
|
|
2004
|
+
hasLights = true
|
|
2005
|
+
end
|
|
2006
|
+
if instance:IsA("Attachment") then
|
|
2007
|
+
hasAttachments = true
|
|
2008
|
+
end
|
|
2009
|
+
end
|
|
2010
|
+
recordSummary(wrapperModel)
|
|
2011
|
+
for _, descendant in wrapperModel:GetDescendants() do
|
|
2012
|
+
recordSummary(descendant)
|
|
2013
|
+
end
|
|
2014
|
+
local forbiddenScan = scanForbiddenImportedInstances(wrapperModel)
|
|
2015
|
+
local function buildHierarchy(instance, depth)
|
|
2016
|
+
local className = instance.ClassName
|
|
1766
2017
|
local node = {
|
|
1767
2018
|
name = instance.Name,
|
|
1768
2019
|
className = className,
|
|
@@ -1796,17 +2047,6 @@ local function previewAsset(requestData)
|
|
|
1796
2047
|
props.primaryPart = model.PrimaryPart.Name
|
|
1797
2048
|
end
|
|
1798
2049
|
end
|
|
1799
|
-
if instance:IsA("LuaSourceContainer") then
|
|
1800
|
-
local ok, src = pcall(function()
|
|
1801
|
-
return instance.Source
|
|
1802
|
-
end)
|
|
1803
|
-
local _value = ok and src
|
|
1804
|
-
if _value ~= "" and _value then
|
|
1805
|
-
local preview = string.sub(src, 1, 200)
|
|
1806
|
-
props.sourcePreview = preview
|
|
1807
|
-
props.sourceLength = #src
|
|
1808
|
-
end
|
|
1809
|
-
end
|
|
1810
2050
|
if className == "Decal" or className == "Texture" then
|
|
1811
2051
|
local ok, texId = pcall(function()
|
|
1812
2052
|
return instance.Texture
|
|
@@ -1817,6 +2057,8 @@ local function previewAsset(requestData)
|
|
|
1817
2057
|
end
|
|
1818
2058
|
if instance:IsA("Sound") then
|
|
1819
2059
|
props.soundId = instance.SoundId
|
|
2060
|
+
elseif instance:IsA("AudioPlayer") then
|
|
2061
|
+
props.soundId = tostring(instance.Asset)
|
|
1820
2062
|
end
|
|
1821
2063
|
-- Only include props if there are any
|
|
1822
2064
|
local hasProps = false
|
|
@@ -1853,19 +2095,43 @@ local function previewAsset(requestData)
|
|
|
1853
2095
|
local _arg0 = buildHierarchy(child, 0)
|
|
1854
2096
|
table.insert(hierarchyRoots, _arg0)
|
|
1855
2097
|
end
|
|
1856
|
-
|
|
2098
|
+
local _object = {
|
|
1857
2099
|
success = true,
|
|
1858
2100
|
assetId = assetId,
|
|
1859
2101
|
hierarchy = hierarchyRoots,
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
2102
|
+
sounds = soundReferences,
|
|
2103
|
+
}
|
|
2104
|
+
local _left = "summary"
|
|
2105
|
+
local _object_1 = {
|
|
2106
|
+
totalInstances = totalInstances,
|
|
2107
|
+
classCounts = classCounts,
|
|
2108
|
+
hasScripts = #forbiddenScan.scripts > 0,
|
|
2109
|
+
scriptCount = #forbiddenScan.scripts,
|
|
2110
|
+
hasPackageLinks = #forbiddenScan.packageLinks > 0,
|
|
2111
|
+
packageLinkCount = #forbiddenScan.packageLinks,
|
|
2112
|
+
hasAnimations = hasAnimations,
|
|
2113
|
+
hasSounds = hasSounds,
|
|
2114
|
+
soundCount = #soundReferences,
|
|
1868
2115
|
}
|
|
2116
|
+
local _left_1 = "uniqueSoundContentIdCount"
|
|
2117
|
+
-- ▼ ReadonlySet.size ▼
|
|
2118
|
+
local _size = 0
|
|
2119
|
+
for _ in uniqueSoundContentIds do
|
|
2120
|
+
_size += 1
|
|
2121
|
+
end
|
|
2122
|
+
-- ▲ ReadonlySet.size ▲
|
|
2123
|
+
_object_1[_left_1] = _size
|
|
2124
|
+
_object_1.hasParticles = hasParticles
|
|
2125
|
+
_object_1.hasVfx = hasVfx
|
|
2126
|
+
_object_1.hasDecalsOrTextures = hasDecalsOrTextures
|
|
2127
|
+
_object_1.hasMeshes = hasMeshes
|
|
2128
|
+
_object_1.hasLights = hasLights
|
|
2129
|
+
_object_1.hasAttachments = hasAttachments
|
|
2130
|
+
_object_1.securityScanDepth = "unlimited"
|
|
2131
|
+
_object_1.scriptSourceExposed = false
|
|
2132
|
+
_object_1.insertPolicy = "All LuaSourceContainer and PackageLink instances are stripped and verified before insertion."
|
|
2133
|
+
_object[_left] = _object_1
|
|
2134
|
+
return _object
|
|
1869
2135
|
end)
|
|
1870
2136
|
pcall(function()
|
|
1871
2137
|
wrapperModel:Destroy()
|
|
@@ -1884,7 +2150,7 @@ return {
|
|
|
1884
2150
|
]]></string>
|
|
1885
2151
|
</Properties>
|
|
1886
2152
|
</Item>
|
|
1887
|
-
<Item class="ModuleScript" referent="
|
|
2153
|
+
<Item class="ModuleScript" referent="8">
|
|
1888
2154
|
<Properties>
|
|
1889
2155
|
<string name="Name">BreakpointHandlers</string>
|
|
1890
2156
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -2402,7 +2668,7 @@ return {
|
|
|
2402
2668
|
]]></string>
|
|
2403
2669
|
</Properties>
|
|
2404
2670
|
</Item>
|
|
2405
|
-
<Item class="ModuleScript" referent="
|
|
2671
|
+
<Item class="ModuleScript" referent="9">
|
|
2406
2672
|
<Properties>
|
|
2407
2673
|
<string name="Name">BuildHandlers</string>
|
|
2408
2674
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -2967,7 +3233,7 @@ return {
|
|
|
2967
3233
|
]]></string>
|
|
2968
3234
|
</Properties>
|
|
2969
3235
|
</Item>
|
|
2970
|
-
<Item class="ModuleScript" referent="
|
|
3236
|
+
<Item class="ModuleScript" referent="10">
|
|
2971
3237
|
<Properties>
|
|
2972
3238
|
<string name="Name">CaptureHandlers</string>
|
|
2973
3239
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -3182,7 +3448,7 @@ return {
|
|
|
3182
3448
|
]]></string>
|
|
3183
3449
|
</Properties>
|
|
3184
3450
|
</Item>
|
|
3185
|
-
<Item class="ModuleScript" referent="
|
|
3451
|
+
<Item class="ModuleScript" referent="11">
|
|
3186
3452
|
<Properties>
|
|
3187
3453
|
<string name="Name">EvalRuntimeHandlers</string>
|
|
3188
3454
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -3336,7 +3602,7 @@ return {
|
|
|
3336
3602
|
]]></string>
|
|
3337
3603
|
</Properties>
|
|
3338
3604
|
</Item>
|
|
3339
|
-
<Item class="ModuleScript" referent="
|
|
3605
|
+
<Item class="ModuleScript" referent="12">
|
|
3340
3606
|
<Properties>
|
|
3341
3607
|
<string name="Name">GenerateModelHandlers</string>
|
|
3342
3608
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -3541,7 +3807,7 @@ return {
|
|
|
3541
3807
|
]]></string>
|
|
3542
3808
|
</Properties>
|
|
3543
3809
|
</Item>
|
|
3544
|
-
<Item class="ModuleScript" referent="
|
|
3810
|
+
<Item class="ModuleScript" referent="13">
|
|
3545
3811
|
<Properties>
|
|
3546
3812
|
<string name="Name">InputHandlers</string>
|
|
3547
3813
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -3741,7 +4007,7 @@ return {
|
|
|
3741
4007
|
]]></string>
|
|
3742
4008
|
</Properties>
|
|
3743
4009
|
</Item>
|
|
3744
|
-
<Item class="ModuleScript" referent="
|
|
4010
|
+
<Item class="ModuleScript" referent="14">
|
|
3745
4011
|
<Properties>
|
|
3746
4012
|
<string name="Name">InstanceHandlers</string>
|
|
3747
4013
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -4248,7 +4514,7 @@ return {
|
|
|
4248
4514
|
]]></string>
|
|
4249
4515
|
</Properties>
|
|
4250
4516
|
</Item>
|
|
4251
|
-
<Item class="ModuleScript" referent="
|
|
4517
|
+
<Item class="ModuleScript" referent="15">
|
|
4252
4518
|
<Properties>
|
|
4253
4519
|
<string name="Name">LogHandlers</string>
|
|
4254
4520
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -4274,7 +4540,7 @@ return {
|
|
|
4274
4540
|
]]></string>
|
|
4275
4541
|
</Properties>
|
|
4276
4542
|
</Item>
|
|
4277
|
-
<Item class="ModuleScript" referent="
|
|
4543
|
+
<Item class="ModuleScript" referent="16">
|
|
4278
4544
|
<Properties>
|
|
4279
4545
|
<string name="Name">MemoryHandlers</string>
|
|
4280
4546
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -4342,7 +4608,7 @@ return {
|
|
|
4342
4608
|
]]></string>
|
|
4343
4609
|
</Properties>
|
|
4344
4610
|
</Item>
|
|
4345
|
-
<Item class="ModuleScript" referent="
|
|
4611
|
+
<Item class="ModuleScript" referent="17">
|
|
4346
4612
|
<Properties>
|
|
4347
4613
|
<string name="Name">MetadataHandlers</string>
|
|
4348
4614
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -4881,7 +5147,7 @@ return {
|
|
|
4881
5147
|
]]></string>
|
|
4882
5148
|
</Properties>
|
|
4883
5149
|
</Item>
|
|
4884
|
-
<Item class="ModuleScript" referent="
|
|
5150
|
+
<Item class="ModuleScript" referent="18">
|
|
4885
5151
|
<Properties>
|
|
4886
5152
|
<string name="Name">MicroProfilerHandlers</string>
|
|
4887
5153
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -6525,7 +6791,7 @@ return {
|
|
|
6525
6791
|
]]></string>
|
|
6526
6792
|
</Properties>
|
|
6527
6793
|
</Item>
|
|
6528
|
-
<Item class="ModuleScript" referent="
|
|
6794
|
+
<Item class="ModuleScript" referent="19">
|
|
6529
6795
|
<Properties>
|
|
6530
6796
|
<string name="Name">PropertyHandlers</string>
|
|
6531
6797
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -6777,7 +7043,7 @@ return {
|
|
|
6777
7043
|
]]></string>
|
|
6778
7044
|
</Properties>
|
|
6779
7045
|
</Item>
|
|
6780
|
-
<Item class="ModuleScript" referent="
|
|
7046
|
+
<Item class="ModuleScript" referent="20">
|
|
6781
7047
|
<Properties>
|
|
6782
7048
|
<string name="Name">QueryHandlers</string>
|
|
6783
7049
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -7834,7 +8100,7 @@ return {
|
|
|
7834
8100
|
]]></string>
|
|
7835
8101
|
</Properties>
|
|
7836
8102
|
</Item>
|
|
7837
|
-
<Item class="ModuleScript" referent="
|
|
8103
|
+
<Item class="ModuleScript" referent="21">
|
|
7838
8104
|
<Properties>
|
|
7839
8105
|
<string name="Name">SceneAnalysisHandlers</string>
|
|
7840
8106
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -8083,7 +8349,7 @@ return {
|
|
|
8083
8349
|
]]></string>
|
|
8084
8350
|
</Properties>
|
|
8085
8351
|
</Item>
|
|
8086
|
-
<Item class="ModuleScript" referent="
|
|
8352
|
+
<Item class="ModuleScript" referent="22">
|
|
8087
8353
|
<Properties>
|
|
8088
8354
|
<string name="Name">ScriptHandlers</string>
|
|
8089
8355
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -8776,7 +9042,7 @@ return {
|
|
|
8776
9042
|
]]></string>
|
|
8777
9043
|
</Properties>
|
|
8778
9044
|
</Item>
|
|
8779
|
-
<Item class="ModuleScript" referent="
|
|
9045
|
+
<Item class="ModuleScript" referent="23">
|
|
8780
9046
|
<Properties>
|
|
8781
9047
|
<string name="Name">ScriptProfilerHandlers</string>
|
|
8782
9048
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -9239,7 +9505,7 @@ return {
|
|
|
9239
9505
|
]]></string>
|
|
9240
9506
|
</Properties>
|
|
9241
9507
|
</Item>
|
|
9242
|
-
<Item class="ModuleScript" referent="
|
|
9508
|
+
<Item class="ModuleScript" referent="24">
|
|
9243
9509
|
<Properties>
|
|
9244
9510
|
<string name="Name">SerializationHandlers</string>
|
|
9245
9511
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -9425,7 +9691,7 @@ return {
|
|
|
9425
9691
|
]]></string>
|
|
9426
9692
|
</Properties>
|
|
9427
9693
|
</Item>
|
|
9428
|
-
<Item class="ModuleScript" referent="
|
|
9694
|
+
<Item class="ModuleScript" referent="25">
|
|
9429
9695
|
<Properties>
|
|
9430
9696
|
<string name="Name">TestHandlers</string>
|
|
9431
9697
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -9792,7 +10058,7 @@ return {
|
|
|
9792
10058
|
</Properties>
|
|
9793
10059
|
</Item>
|
|
9794
10060
|
</Item>
|
|
9795
|
-
<Item class="ModuleScript" referent="
|
|
10061
|
+
<Item class="ModuleScript" referent="26">
|
|
9796
10062
|
<Properties>
|
|
9797
10063
|
<string name="Name">HttpDiagnostics</string>
|
|
9798
10064
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -9873,7 +10139,7 @@ return {
|
|
|
9873
10139
|
]]></string>
|
|
9874
10140
|
</Properties>
|
|
9875
10141
|
</Item>
|
|
9876
|
-
<Item class="ModuleScript" referent="
|
|
10142
|
+
<Item class="ModuleScript" referent="27">
|
|
9877
10143
|
<Properties>
|
|
9878
10144
|
<string name="Name">LuauExec</string>
|
|
9879
10145
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -10307,7 +10573,7 @@ return {
|
|
|
10307
10573
|
]]></string>
|
|
10308
10574
|
</Properties>
|
|
10309
10575
|
</Item>
|
|
10310
|
-
<Item class="ModuleScript" referent="
|
|
10576
|
+
<Item class="ModuleScript" referent="28">
|
|
10311
10577
|
<Properties>
|
|
10312
10578
|
<string name="Name">Recording</string>
|
|
10313
10579
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -10337,7 +10603,7 @@ return {
|
|
|
10337
10603
|
]]></string>
|
|
10338
10604
|
</Properties>
|
|
10339
10605
|
</Item>
|
|
10340
|
-
<Item class="ModuleScript" referent="
|
|
10606
|
+
<Item class="ModuleScript" referent="29">
|
|
10341
10607
|
<Properties>
|
|
10342
10608
|
<string name="Name">RenderMonitor</string>
|
|
10343
10609
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -10405,7 +10671,7 @@ return {
|
|
|
10405
10671
|
]]></string>
|
|
10406
10672
|
</Properties>
|
|
10407
10673
|
</Item>
|
|
10408
|
-
<Item class="ModuleScript" referent="
|
|
10674
|
+
<Item class="ModuleScript" referent="30">
|
|
10409
10675
|
<Properties>
|
|
10410
10676
|
<string name="Name">RuntimeLogBuffer</string>
|
|
10411
10677
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -10660,7 +10926,7 @@ return {
|
|
|
10660
10926
|
]]></string>
|
|
10661
10927
|
</Properties>
|
|
10662
10928
|
</Item>
|
|
10663
|
-
<Item class="ModuleScript" referent="
|
|
10929
|
+
<Item class="ModuleScript" referent="31">
|
|
10664
10930
|
<Properties>
|
|
10665
10931
|
<string name="Name">ServerUrlSettings</string>
|
|
10666
10932
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -10810,11 +11076,11 @@ return {
|
|
|
10810
11076
|
]]></string>
|
|
10811
11077
|
</Properties>
|
|
10812
11078
|
</Item>
|
|
10813
|
-
<Item class="ModuleScript" referent="
|
|
11079
|
+
<Item class="ModuleScript" referent="32">
|
|
10814
11080
|
<Properties>
|
|
10815
11081
|
<string name="Name">State</string>
|
|
10816
11082
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
10817
|
-
local CURRENT_VERSION = "2.
|
|
11083
|
+
local CURRENT_VERSION = "2.23.0"
|
|
10818
11084
|
local PLUGIN_VARIANT = "inspector"
|
|
10819
11085
|
local BASE_PORT = 58741
|
|
10820
11086
|
local function createConnection(port)
|
|
@@ -10850,7 +11116,7 @@ return {
|
|
|
10850
11116
|
]]></string>
|
|
10851
11117
|
</Properties>
|
|
10852
11118
|
</Item>
|
|
10853
|
-
<Item class="ModuleScript" referent="
|
|
11119
|
+
<Item class="ModuleScript" referent="33">
|
|
10854
11120
|
<Properties>
|
|
10855
11121
|
<string name="Name">StopPlayMonitor</string>
|
|
10856
11122
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -11148,7 +11414,7 @@ return {
|
|
|
11148
11414
|
]]></string>
|
|
11149
11415
|
</Properties>
|
|
11150
11416
|
</Item>
|
|
11151
|
-
<Item class="ModuleScript" referent="
|
|
11417
|
+
<Item class="ModuleScript" referent="34">
|
|
11152
11418
|
<Properties>
|
|
11153
11419
|
<string name="Name">UI</string>
|
|
11154
11420
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -11700,7 +11966,7 @@ return {
|
|
|
11700
11966
|
]]></string>
|
|
11701
11967
|
</Properties>
|
|
11702
11968
|
</Item>
|
|
11703
|
-
<Item class="ModuleScript" referent="
|
|
11969
|
+
<Item class="ModuleScript" referent="35">
|
|
11704
11970
|
<Properties>
|
|
11705
11971
|
<string name="Name">Utils</string>
|
|
11706
11972
|
<string name="Source"><![CDATA[-- Compiled with roblox-ts v3.0.0
|
|
@@ -12493,11 +12759,11 @@ return {
|
|
|
12493
12759
|
</Properties>
|
|
12494
12760
|
</Item>
|
|
12495
12761
|
</Item>
|
|
12496
|
-
<Item class="Folder" referent="
|
|
12762
|
+
<Item class="Folder" referent="40">
|
|
12497
12763
|
<Properties>
|
|
12498
12764
|
<string name="Name">include</string>
|
|
12499
12765
|
</Properties>
|
|
12500
|
-
<Item class="ModuleScript" referent="
|
|
12766
|
+
<Item class="ModuleScript" referent="36">
|
|
12501
12767
|
<Properties>
|
|
12502
12768
|
<string name="Name">LibMP</string>
|
|
12503
12769
|
<string name="Source"><![CDATA[-- =============================================================================
|
|
@@ -168881,7 +169147,7 @@ return LibMP
|
|
|
168881
169147
|
]]></string>
|
|
168882
169148
|
</Properties>
|
|
168883
169149
|
</Item>
|
|
168884
|
-
<Item class="ModuleScript" referent="
|
|
169150
|
+
<Item class="ModuleScript" referent="37">
|
|
168885
169151
|
<Properties>
|
|
168886
169152
|
<string name="Name">Promise</string>
|
|
168887
169153
|
<string name="Source"><![CDATA[--[[
|
|
@@ -170955,7 +171221,7 @@ return Promise
|
|
|
170955
171221
|
]]></string>
|
|
170956
171222
|
</Properties>
|
|
170957
171223
|
</Item>
|
|
170958
|
-
<Item class="ModuleScript" referent="
|
|
171224
|
+
<Item class="ModuleScript" referent="38">
|
|
170959
171225
|
<Properties>
|
|
170960
171226
|
<string name="Name">RuntimeLib</string>
|
|
170961
171227
|
<string name="Source"><![CDATA[local Promise = require(script.Parent.Promise)
|
|
@@ -171222,15 +171488,15 @@ return TS
|
|
|
171222
171488
|
</Properties>
|
|
171223
171489
|
</Item>
|
|
171224
171490
|
</Item>
|
|
171225
|
-
<Item class="Folder" referent="
|
|
171491
|
+
<Item class="Folder" referent="41">
|
|
171226
171492
|
<Properties>
|
|
171227
171493
|
<string name="Name">node_modules</string>
|
|
171228
171494
|
</Properties>
|
|
171229
|
-
<Item class="Folder" referent="
|
|
171495
|
+
<Item class="Folder" referent="42">
|
|
171230
171496
|
<Properties>
|
|
171231
171497
|
<string name="Name">@rbxts</string>
|
|
171232
171498
|
</Properties>
|
|
171233
|
-
<Item class="ModuleScript" referent="
|
|
171499
|
+
<Item class="ModuleScript" referent="39">
|
|
171234
171500
|
<Properties>
|
|
171235
171501
|
<string name="Name">services</string>
|
|
171236
171502
|
<string name="Source"><![CDATA[return setmetatable({}, {
|