@reinteractive/rails-insight 1.0.7 → 1.0.8
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 +2 -2
- package/src/server.js +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reinteractive/rails-insight",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Rails-aware codebase indexer — MCP server for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -59,4 +59,4 @@
|
|
|
59
59
|
"engines": {
|
|
60
60
|
"node": ">=18.0.0"
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
package/src/server.js
CHANGED
|
@@ -57,6 +57,17 @@ export async function startLocal(projectRoot, options = {}) {
|
|
|
57
57
|
const transport = new StdioServerTransport()
|
|
58
58
|
await server.connect(transport)
|
|
59
59
|
|
|
60
|
+
// Keep the event loop alive so Node.js doesn't exit when startLocal returns.
|
|
61
|
+
// StdioServerTransport adds a 'data' listener to stdin but does not call
|
|
62
|
+
// resume(), so without this the process exits immediately on idle stdin.
|
|
63
|
+
process.stdin.resume()
|
|
64
|
+
|
|
65
|
+
// Yield to the event loop before running the synchronous buildIndex pipeline.
|
|
66
|
+
// This lets the MCP SDK process the VS Code initialize handshake that arrived
|
|
67
|
+
// on stdin while we were awaiting connect(), preventing a timeout on the
|
|
68
|
+
// client side before any tools have been registered.
|
|
69
|
+
await new Promise((resolve) => setImmediate(resolve))
|
|
70
|
+
|
|
60
71
|
if (verbose) {
|
|
61
72
|
process.stderr.write(`[railsinsight] Indexing ${projectRoot}...\n`)
|
|
62
73
|
}
|