@dvquys/qrec 0.2.4 → 0.3.0

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.
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ // MCP stdio shim: finds bun, spawns qrec-mcp.cjs with streaming pipe stdio
3
+ const { spawn } = require("child_process");
4
+ const path = require("path");
5
+ const { findBun } = require("./bun-finder.js");
6
+
7
+ const bun = findBun();
8
+ if (!bun) {
9
+ process.stderr.write("[qrec-mcp] ERROR: bun not found. Install from https://bun.sh\n");
10
+ process.exit(1);
11
+ }
12
+
13
+ const qrecCjs = path.join(__dirname, "qrec-mcp.cjs");
14
+ const child = spawn(bun, ["run", qrecCjs], {
15
+ stdio: ["pipe", "pipe", "inherit"], // stream stdin/stdout; inherit stderr for logs
16
+ env: process.env,
17
+ });
18
+
19
+ process.stdin.pipe(child.stdin);
20
+ child.stdout.pipe(process.stdout);
21
+
22
+ child.on("exit", code => process.exit(code ?? 1));
23
+ process.on("SIGTERM", () => child.kill("SIGTERM"));
24
+ process.on("SIGINT", () => child.kill("SIGINT"));