romdev-mcp 0.1.2 → 0.1.4
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/src/mcp/server.js +3 -2
- package/src/observer/server.js +8 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "romdev-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "MCP server giving coding agents full control of homebrew ROM development across retro platforms (NES, SNES, GB, Genesis, Atari, C64, ...) via WASM libretro cores.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/mcp/server.js",
|
package/src/mcp/server.js
CHANGED
|
@@ -357,9 +357,10 @@ async function main() {
|
|
|
357
357
|
const bannerHost = isDefaultLoopback ? "localhost" : host;
|
|
358
358
|
const httpServer = app.listen(port, bindHosts[0], () => {
|
|
359
359
|
log.info(`romdev listening on http://${bannerHost}:${port}/mcp`);
|
|
360
|
+
log.info("");
|
|
360
361
|
log.info(`optional observer: http://${bannerHost}:${port}/livestream`);
|
|
361
|
-
log.info(
|
|
362
|
-
log.info("
|
|
362
|
+
log.info("");
|
|
363
|
+
log.info("connect your coding agent: https://github.com/monteslu/romdev#connect");
|
|
363
364
|
});
|
|
364
365
|
const extraServers = [];
|
|
365
366
|
for (const h of bindHosts.slice(1)) {
|
package/src/observer/server.js
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
import path from "node:path";
|
|
20
|
+
import { readFileSync } from "node:fs";
|
|
20
21
|
import { Server as SocketIOServer } from "socket.io";
|
|
21
22
|
import { observer } from "./bus.js";
|
|
22
23
|
import { log } from "../mcp/log.js";
|
|
@@ -33,13 +34,13 @@ const __dirname = path.dirname(__filename);
|
|
|
33
34
|
*/
|
|
34
35
|
export function attachObserver(app, ...httpServers) {
|
|
35
36
|
const servers = httpServers.filter(Boolean);
|
|
36
|
-
// Serve the static SPA.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
// Serve the static SPA. Read+send the HTML directly rather than res.sendFile
|
|
38
|
+
// — sendFile's internal `send` throws NotFoundError on the absolute package
|
|
39
|
+
// path under npm/npx installs (404 even though the file is right there).
|
|
40
|
+
const html = readFileSync(path.join(__dirname, "livestream.html"), "utf8");
|
|
41
|
+
const serveHtml = (req, res) => res.type("html").send(html);
|
|
42
|
+
app.get("/livestream", serveHtml);
|
|
43
|
+
app.get("/livestream/", serveHtml);
|
|
43
44
|
|
|
44
45
|
// Socket.io on the primary server, then ATTACHED to every other listener too
|
|
45
46
|
// (io.attach is additive). No auth — loopback only.
|