sentinelayer-cli 0.36.5 → 0.37.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.
- package/package.json +1 -1
- package/src/commands/mcp.js +57 -30
package/package.json
CHANGED
package/src/commands/mcp.js
CHANGED
|
@@ -481,37 +481,64 @@ Docs: https://github.com/mrrCarter/create-sentinelayer/blob/main/docs/mcp.md`,
|
|
|
481
481
|
console.log(pc.gray("Next: validate with registry cross-check before runtime wiring."));
|
|
482
482
|
});
|
|
483
483
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
484
|
+
const registerSessionRegistryInit = ({
|
|
485
|
+
commandName,
|
|
486
|
+
description,
|
|
487
|
+
outputSuffix,
|
|
488
|
+
payloadCommand,
|
|
489
|
+
successLabel,
|
|
490
|
+
nextMessage,
|
|
491
|
+
}) => {
|
|
492
|
+
registry
|
|
493
|
+
.command(commandName)
|
|
494
|
+
.description(description)
|
|
495
|
+
.option("--path <path>", "Destination file path override")
|
|
496
|
+
.option("--output-dir <path>", "Optional artifact output root override")
|
|
497
|
+
.option("--force", "Overwrite destination file if it already exists")
|
|
498
|
+
.option("--json", "Emit machine-readable output")
|
|
499
|
+
.action(async (options, command) => {
|
|
500
|
+
const defaultPath = await resolveDefaultMcpOutputPath({
|
|
501
|
+
cwd: process.cwd(),
|
|
502
|
+
outputDir: options.outputDir,
|
|
503
|
+
env: process.env,
|
|
504
|
+
});
|
|
505
|
+
const outputPath = normalizeOutputPath(options.path, defaultPath.replace(".schema", outputSuffix));
|
|
506
|
+
const template = buildSentinelayerSessionRegistryTemplate();
|
|
507
|
+
validateMcpToolRegistry(template);
|
|
508
|
+
const writtenPath = await writeJsonFile(outputPath, template, { force: Boolean(options.force) });
|
|
509
|
+
const payload = {
|
|
510
|
+
command: payloadCommand,
|
|
511
|
+
outputPath: writtenPath,
|
|
512
|
+
toolCount: template.tools.length,
|
|
513
|
+
tools: template.tools.map((tool) => tool.name),
|
|
514
|
+
};
|
|
507
515
|
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
516
|
+
if (shouldEmitJson(options, command)) {
|
|
517
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
console.log(pc.green(`Wrote ${successLabel}: ${writtenPath}`));
|
|
521
|
+
console.log(pc.gray(nextMessage));
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
registerSessionRegistryInit({
|
|
526
|
+
commandName: "init-session",
|
|
527
|
+
description: "Write the built-in SentinelLayer session MCP tool registry",
|
|
528
|
+
outputSuffix: ".session-tools",
|
|
529
|
+
payloadCommand: "mcp registry init-session",
|
|
530
|
+
successLabel: "SentinelLayer session MCP registry template",
|
|
531
|
+
nextMessage: "Next: run 'sl mcp server init --id sentinelayer-session --registry-file <path>'.",
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
registerSessionRegistryInit({
|
|
535
|
+
commandName: "init-senti-session",
|
|
536
|
+
description: "Write the built-in Senti session MCP tool registry",
|
|
537
|
+
outputSuffix: ".senti-session-tools",
|
|
538
|
+
payloadCommand: "mcp registry init-senti-session",
|
|
539
|
+
successLabel: "Senti session MCP registry template",
|
|
540
|
+
nextMessage: "Next: run 'sl mcp registry init-hosted-session-connector --registry-file <path>' for hosted MCP.",
|
|
541
|
+
});
|
|
515
542
|
|
|
516
543
|
registry
|
|
517
544
|
.command("init-hosted-session-connector")
|