@toolbaux/guardian 0.1.15 → 0.1.16
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/cli.js +2 -0
- package/dist/commands/mcp-serve.js +9 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -343,9 +343,11 @@ program
|
|
|
343
343
|
.command("mcp-serve")
|
|
344
344
|
.description("Start Guardian MCP server for Claude Code / Cursor integration")
|
|
345
345
|
.option("--specs <dir>", "Specs directory", ".specs")
|
|
346
|
+
.option("--quiet", "Suppress stderr output (for clients that merge streams)", false)
|
|
346
347
|
.action(async (options) => {
|
|
347
348
|
await runMcpServe({
|
|
348
349
|
specs: options.specs,
|
|
350
|
+
quiet: options.quiet,
|
|
349
351
|
});
|
|
350
352
|
});
|
|
351
353
|
program.parseAsync().catch((error) => {
|
|
@@ -456,12 +456,15 @@ async function handleRequest(req) {
|
|
|
456
456
|
// ── Entry point ──
|
|
457
457
|
export async function runMcpServe(options) {
|
|
458
458
|
const specsDir = path.resolve(options.specs);
|
|
459
|
+
const quiet = options.quiet ?? false;
|
|
459
460
|
intelPath = path.join(specsDir, "machine", "codebase-intelligence.json");
|
|
460
461
|
// Pre-load intelligence
|
|
461
462
|
await loadIntel();
|
|
462
463
|
// Log to stderr (stdout is for MCP protocol)
|
|
463
|
-
|
|
464
|
-
|
|
464
|
+
if (!quiet) {
|
|
465
|
+
process.stderr.write(`Guardian MCP server started. Intelligence: ${intelPath}\n`);
|
|
466
|
+
process.stderr.write(`Tools: ${TOOLS.map((t) => t.name).join(", ")}\n`);
|
|
467
|
+
}
|
|
465
468
|
// Read JSON-RPC messages from stdin, line by line
|
|
466
469
|
const rl = readline.createInterface({ input: process.stdin });
|
|
467
470
|
rl.on("line", async (line) => {
|
|
@@ -484,10 +487,12 @@ export async function runMcpServe(options) {
|
|
|
484
487
|
session_end: new Date().toISOString(),
|
|
485
488
|
});
|
|
486
489
|
await fs.appendFile(metricsPath, entry + "\n", "utf8");
|
|
487
|
-
|
|
490
|
+
if (!quiet)
|
|
491
|
+
process.stderr.write(`Guardian metrics saved to ${metricsPath}\n`);
|
|
488
492
|
}
|
|
489
493
|
catch { }
|
|
490
|
-
|
|
494
|
+
if (!quiet)
|
|
495
|
+
process.stderr.write("Guardian MCP server stopped.\n");
|
|
491
496
|
process.exit(0);
|
|
492
497
|
});
|
|
493
498
|
}
|
package/package.json
CHANGED