@floomhq/floom-mcp-sync 1.0.8 → 1.0.9
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/dist/auto-sync.js +1 -1
- package/dist/server.js +17 -11
- package/package.json +1 -1
package/dist/auto-sync.js
CHANGED
|
@@ -564,7 +564,7 @@ function maybeAuthWarning(log, message) {
|
|
|
564
564
|
log(message);
|
|
565
565
|
lastAuthWarningAt = now;
|
|
566
566
|
}
|
|
567
|
-
//
|
|
567
|
+
// Future option: swap polling for SSE. Add `/api/v1/sync-stream` route that
|
|
568
568
|
// holds a per-user EventSource open and pushes `{type:"skills-updated"}` from a
|
|
569
569
|
// Supabase post-write trigger or webhook. MCP listens, calls autoSync() on
|
|
570
570
|
// event. Drops sync latency from <=60s to <=2s. Trade-off: needs reconnect
|
package/dist/server.js
CHANGED
|
@@ -273,21 +273,27 @@ async function main() {
|
|
|
273
273
|
process.once("SIGINT", () => shutdown("SIGINT"));
|
|
274
274
|
process.once("SIGTERM", () => shutdown("SIGTERM"));
|
|
275
275
|
const rl = createInterface({ input: stdin, crlfDelay: Infinity });
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
try {
|
|
280
|
-
const message = JSON.parse(line);
|
|
281
|
-
if (!message || typeof message !== "object" || Array.isArray(message)) {
|
|
282
|
-
stdout.write(errorResponse(null, -32600, "Invalid request."));
|
|
276
|
+
try {
|
|
277
|
+
for await (const line of rl) {
|
|
278
|
+
if (!line.trim())
|
|
283
279
|
continue;
|
|
280
|
+
try {
|
|
281
|
+
const message = JSON.parse(line);
|
|
282
|
+
if (!message || typeof message !== "object" || Array.isArray(message)) {
|
|
283
|
+
stdout.write(errorResponse(null, -32600, "Invalid request."));
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
await handleRequest(message);
|
|
287
|
+
}
|
|
288
|
+
catch {
|
|
289
|
+
stdout.write(errorResponse(null, -32700, "Parse error."));
|
|
284
290
|
}
|
|
285
|
-
await handleRequest(message);
|
|
286
|
-
}
|
|
287
|
-
catch {
|
|
288
|
-
stdout.write(errorResponse(null, -32700, "Parse error."));
|
|
289
291
|
}
|
|
290
292
|
}
|
|
293
|
+
finally {
|
|
294
|
+
clearInterval(pollHandle);
|
|
295
|
+
process.stderr.write("[floom] stdin closed, stopping sync poller\n");
|
|
296
|
+
}
|
|
291
297
|
}
|
|
292
298
|
main().catch((err) => {
|
|
293
299
|
process.stderr.write(`[floom] fatal: ${err instanceof Error ? err.message : String(err)}\n`);
|