@el4cteo/rbx-studio-mcp 0.1.0 → 0.1.2

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.
@@ -1,59 +1,59 @@
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.1.0"
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 healthy long-poll session runs before standing aside so streaming
33
- -- can be tried again. Long enough that a Studio which genuinely cannot stream
34
- -- is not reconnecting constantly, short enough that a session downgraded by one
35
- -- unlucky attempt does not spend the rest of its life slower than it should be.
36
- Config.RESTREAM_INTERVAL = 60
37
-
38
- local port: number? = nil
39
-
40
- function Config.setPort(value: number)
41
- port = value
42
- end
43
-
44
- function Config.getPort(): number
45
- return port or Config.DEFAULT_PORT
46
- end
47
-
48
- function Config.baseUrl(): string
49
- return string.format("http://127.0.0.1:%d", Config.getPort())
50
- end
51
-
52
- function Config.headers(): { [string]: string }
53
- return {
54
- [Config.CLIENT_HEADER] = tostring(Config.PROTOCOL_VERSION),
55
- ["Content-Type"] = "application/json",
56
- }
57
- end
58
-
59
- 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.1.2"
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 healthy long-poll session runs before standing aside so streaming
33
+ -- can be tried again. Long enough that a Studio which genuinely cannot stream
34
+ -- is not reconnecting constantly, short enough that a session downgraded by one
35
+ -- unlucky attempt does not spend the rest of its life slower than it should be.
36
+ Config.RESTREAM_INTERVAL = 60
37
+
38
+ local port: number? = nil
39
+
40
+ function Config.setPort(value: number)
41
+ port = value
42
+ end
43
+
44
+ function Config.getPort(): number
45
+ return port or Config.DEFAULT_PORT
46
+ end
47
+
48
+ function Config.baseUrl(): string
49
+ return string.format("http://127.0.0.1:%d", Config.getPort())
50
+ end
51
+
52
+ function Config.headers(): { [string]: string }
53
+ return {
54
+ [Config.CLIENT_HEADER] = tostring(Config.PROTOCOL_VERSION),
55
+ ["Content-Type"] = "application/json",
56
+ }
57
+ end
58
+
59
+ return Config