@datafrog-io/n2n-nexus 0.3.7 → 0.3.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.
@@ -62,7 +62,19 @@ export async function startGuest(targetPort, context) {
62
62
  }
63
63
  catch { /* suppress */ }
64
64
  };
65
- const stdioHandler = (chunk) => forwardToHost(chunk);
65
+ let stdinBuffer = "";
66
+ const stdioHandler = (chunk) => {
67
+ stdinBuffer += chunk.toString();
68
+ // Process all complete lines (JSON-RPC messages)
69
+ let newlineIndex;
70
+ while ((newlineIndex = stdinBuffer.indexOf("\n")) !== -1) {
71
+ const line = stdinBuffer.substring(0, newlineIndex);
72
+ stdinBuffer = stdinBuffer.substring(newlineIndex + 1);
73
+ if (line.trim()) {
74
+ forwardToHost(Buffer.from(line));
75
+ }
76
+ }
77
+ };
66
78
  process.stdin.on("data", stdioHandler);
67
79
  http.get(`http://${connectHost}:${targetPort}/mcp?id=${encodeURIComponent(guestId)}`, (res) => {
68
80
  res.on("data", (chunk) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datafrog-io/n2n-nexus",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Modular MCP Server for multi-AI assistant coordination",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
@@ -58,4 +58,4 @@
58
58
  "typescript-eslint": "^8.51.0",
59
59
  "vitest": "^4.0.16"
60
60
  }
61
- }
61
+ }