@el4cteo/rbx-studio-mcp 0.5.6 → 0.5.9
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/README.md +141 -139
- package/config/dsh.cordis.yml +45 -0
- package/package.json +74 -68
- package/plugin/src/Commands.luau +562 -524
- package/plugin/src/Config.luau +65 -65
- package/plugin/src/Console.luau +1843 -1831
- package/plugin/src/Prompt.luau +961 -436
- package/plugin/src/init.server.luau +832 -829
package/plugin/src/Config.luau
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
--!strict
|
|
2
|
-
--[[
|
|
3
|
-
Connection settings for the Studio MCP plugin.
|
|
4
|
-
|
|
5
|
-
The port must match the one the Node server was started with (`--port`, or
|
|
6
|
-
the ROBLOX_STUDIO_MCP_PORT environment variable). It is stored as a plugin
|
|
7
|
-
setting so a user running on a non-default port only has to set it once.
|
|
8
|
-
]]
|
|
9
|
-
|
|
10
|
-
local Config = {}
|
|
11
|
-
|
|
12
|
-
Config.PLUGIN_VERSION = "0.5.
|
|
13
|
-
|
|
14
|
-
-- Fingerprint of plugin/src, stamped in by scripts/build-plugin.mjs. The server
|
|
15
|
-
-- computes the same hash from its own copy of the sources and compares, so a
|
|
16
|
-
-- plugin left running from an older build is reported rather than silently
|
|
17
|
-
-- answering with stale handlers. Stays "dev" when the tree is loaded unbuilt.
|
|
18
|
-
Config.BUILD_ID = "dev"
|
|
19
|
-
Config.PROTOCOL_VERSION = 1
|
|
20
|
-
Config.DEFAULT_PORT = 44755
|
|
21
|
-
|
|
22
|
-
-- Header the bridge requires on every request. A web page cannot set it
|
|
23
|
-
-- cross-origin without a preflight the bridge never answers, which is what
|
|
24
|
-
-- keeps a malicious site from driving Studio through the loopback port.
|
|
25
|
-
Config.CLIENT_HEADER = "x-roblox-studio-mcp"
|
|
26
|
-
|
|
27
|
-
-- How long to wait before retrying after the stream drops. Studio closes SSE
|
|
28
|
-
-- connections at the 30 minute mark, so reconnects are routine, not exceptional.
|
|
29
|
-
Config.RECONNECT_DELAY = 1
|
|
30
|
-
Config.MAX_RECONNECT_DELAY = 30
|
|
31
|
-
|
|
32
|
-
-- How long a connection has to last before it counts as having worked, rather
|
|
33
|
-
-- than as one more failure to back off from. Comfortably longer than a failed
|
|
34
|
-
-- handshake against a dead port, which resolves in milliseconds, and far shorter
|
|
35
|
-
-- than any connection that carried a single command.
|
|
36
|
-
Config.HEALTHY_CONNECTION = 10
|
|
37
|
-
|
|
38
|
-
-- How long a healthy long-poll session runs before standing aside so streaming
|
|
39
|
-
-- can be tried again. Long enough that a Studio which genuinely cannot stream
|
|
40
|
-
-- is not reconnecting constantly, short enough that a session downgraded by one
|
|
41
|
-
-- unlucky attempt does not spend the rest of its life slower than it should be.
|
|
42
|
-
Config.RESTREAM_INTERVAL = 60
|
|
43
|
-
|
|
44
|
-
local port: number? = nil
|
|
45
|
-
|
|
46
|
-
function Config.setPort(value: number)
|
|
47
|
-
port = value
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
function Config.getPort(): number
|
|
51
|
-
return port or Config.DEFAULT_PORT
|
|
52
|
-
end
|
|
53
|
-
|
|
54
|
-
function Config.baseUrl(): string
|
|
55
|
-
return string.format("http://127.0.0.1:%d", Config.getPort())
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
function Config.headers(): { [string]: string }
|
|
59
|
-
return {
|
|
60
|
-
[Config.CLIENT_HEADER] = tostring(Config.PROTOCOL_VERSION),
|
|
61
|
-
["Content-Type"] = "application/json",
|
|
62
|
-
}
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
return Config
|
|
1
|
+
--!strict
|
|
2
|
+
--[[
|
|
3
|
+
Connection settings for the Studio MCP plugin.
|
|
4
|
+
|
|
5
|
+
The port must match the one the Node server was started with (`--port`, or
|
|
6
|
+
the ROBLOX_STUDIO_MCP_PORT environment variable). It is stored as a plugin
|
|
7
|
+
setting so a user running on a non-default port only has to set it once.
|
|
8
|
+
]]
|
|
9
|
+
|
|
10
|
+
local Config = {}
|
|
11
|
+
|
|
12
|
+
Config.PLUGIN_VERSION = "0.5.9"
|
|
13
|
+
|
|
14
|
+
-- Fingerprint of plugin/src, stamped in by scripts/build-plugin.mjs. The server
|
|
15
|
+
-- computes the same hash from its own copy of the sources and compares, so a
|
|
16
|
+
-- plugin left running from an older build is reported rather than silently
|
|
17
|
+
-- answering with stale handlers. Stays "dev" when the tree is loaded unbuilt.
|
|
18
|
+
Config.BUILD_ID = "dev"
|
|
19
|
+
Config.PROTOCOL_VERSION = 1
|
|
20
|
+
Config.DEFAULT_PORT = 44755
|
|
21
|
+
|
|
22
|
+
-- Header the bridge requires on every request. A web page cannot set it
|
|
23
|
+
-- cross-origin without a preflight the bridge never answers, which is what
|
|
24
|
+
-- keeps a malicious site from driving Studio through the loopback port.
|
|
25
|
+
Config.CLIENT_HEADER = "x-roblox-studio-mcp"
|
|
26
|
+
|
|
27
|
+
-- How long to wait before retrying after the stream drops. Studio closes SSE
|
|
28
|
+
-- connections at the 30 minute mark, so reconnects are routine, not exceptional.
|
|
29
|
+
Config.RECONNECT_DELAY = 1
|
|
30
|
+
Config.MAX_RECONNECT_DELAY = 30
|
|
31
|
+
|
|
32
|
+
-- How long a connection has to last before it counts as having worked, rather
|
|
33
|
+
-- than as one more failure to back off from. Comfortably longer than a failed
|
|
34
|
+
-- handshake against a dead port, which resolves in milliseconds, and far shorter
|
|
35
|
+
-- than any connection that carried a single command.
|
|
36
|
+
Config.HEALTHY_CONNECTION = 10
|
|
37
|
+
|
|
38
|
+
-- How long a healthy long-poll session runs before standing aside so streaming
|
|
39
|
+
-- can be tried again. Long enough that a Studio which genuinely cannot stream
|
|
40
|
+
-- is not reconnecting constantly, short enough that a session downgraded by one
|
|
41
|
+
-- unlucky attempt does not spend the rest of its life slower than it should be.
|
|
42
|
+
Config.RESTREAM_INTERVAL = 60
|
|
43
|
+
|
|
44
|
+
local port: number? = nil
|
|
45
|
+
|
|
46
|
+
function Config.setPort(value: number)
|
|
47
|
+
port = value
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
function Config.getPort(): number
|
|
51
|
+
return port or Config.DEFAULT_PORT
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
function Config.baseUrl(): string
|
|
55
|
+
return string.format("http://127.0.0.1:%d", Config.getPort())
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
function Config.headers(): { [string]: string }
|
|
59
|
+
return {
|
|
60
|
+
[Config.CLIENT_HEADER] = tostring(Config.PROTOCOL_VERSION),
|
|
61
|
+
["Content-Type"] = "application/json",
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
return Config
|