@etavioxy/wocingflow-mcp-server 0.0.5-fix.9 → 0.0.6

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.
@@ -166,9 +166,38 @@ function spawnBridge(env, endpoint) {
166
166
  console.error(`[wocingflow-mcp] bridge spawn error: ${error.message}`);
167
167
  });
168
168
 
169
- process.stdin.pipe(child.stdin);
169
+ let bridgeReady = false;
170
+ const pendingInputChunks = [];
171
+ const forwardOrBuffer = (chunk) => {
172
+ if (bridgeReady) {
173
+ child.stdin.write(chunk);
174
+ return;
175
+ }
176
+ pendingInputChunks.push(Buffer.from(chunk));
177
+ };
178
+ const flushPending = () => {
179
+ if (!bridgeReady) return;
180
+ while (pendingInputChunks.length > 0) {
181
+ const next = pendingInputChunks.shift();
182
+ child.stdin.write(next);
183
+ }
184
+ };
185
+
186
+ process.stdin.on("data", forwardOrBuffer);
187
+ process.stdin.on("end", () => {
188
+ child.stdin.end();
189
+ });
190
+
191
+ child.stderr.on("data", (chunk) => {
192
+ const text = String(chunk);
193
+ process.stderr.write(text);
194
+ if (!bridgeReady && (text.includes("Local STDIO server running") || text.includes("Proxy established successfully"))) {
195
+ bridgeReady = true;
196
+ flushPending();
197
+ }
198
+ });
199
+
170
200
  child.stdout.pipe(process.stdout);
171
- child.stderr.pipe(process.stderr);
172
201
  return child;
173
202
  }
174
203
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etavioxy/wocingflow-mcp-server",
3
- "version": "0.0.5-fix.9",
3
+ "version": "0.0.6",
4
4
  "description": "MCP stdio launcher for WocingFlow service mcp_server",
5
5
  "type": "commonjs",
6
6
  "bin": {
Binary file