@calltelemetry/ct-lab-mcp 0.4.3 → 0.4.4

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.
@@ -75,6 +75,80 @@ export async function runPurgeDaemonCli(argv = process.argv) {
75
75
  process.once("SIGTERM", handleSig);
76
76
  });
77
77
  }
78
+ export function buildBenchmarkCommand() {
79
+ return new Command("benchmark")
80
+ .description("Run high-resolution VM lifecycle performance benchmark (sub-45ms declarative or physical Proxmox)")
81
+ .option("--physical", "Run live physical hardware provisioning, boot, ping, and SSH benchmark against Proxmox Mini")
82
+ .option("--json", "Output results as structured JSON", false);
83
+ }
84
+ export async function runBenchmarkCli(argv = process.argv) {
85
+ const program = buildBenchmarkCommand();
86
+ program.parse([argv[0] || "node", argv[1] || "ct-lab-mcp", ...argv.slice(3)]);
87
+ const options = program.opts();
88
+ if (options.physical) {
89
+ console.log("[ct-lab-mcp] Executing live physical hardware benchmark against Proxmox Mini...");
90
+ const scriptPath = path.resolve(__dirname, "../../scripts/live-physical-vm-benchmark.mjs");
91
+ const { spawn } = await import("node:child_process");
92
+ return new Promise((resolve) => {
93
+ const child = spawn(process.execPath, [scriptPath], { stdio: "inherit" });
94
+ child.on("close", (code) => resolve(code ?? 0));
95
+ });
96
+ }
97
+ else {
98
+ console.log("[ct-lab-mcp] Executing declarative VM lifecycle benchmark...");
99
+ const { ApplianceSlotReconciler } = await import("../src/crd/reconciler.js");
100
+ const { SlotManager } = await import("../src/slot/manager.js");
101
+ const t0 = performance.now();
102
+ const slotManager = new SlotManager();
103
+ const reconciler = new ApplianceSlotReconciler(slotManager);
104
+ const manifest = {
105
+ apiVersion: "lab.calltelemetry.com/v1alpha1",
106
+ kind: "ApplianceSlot",
107
+ metadata: { name: "cli-benchmark-slot", labels: { linearIssue: "BENCHMARK-CLI" } },
108
+ spec: { host: "proxmox-mini", resources: { memoryMb: 8192, cores: 4, thinDisk: true } }
109
+ };
110
+ const tAllocStart = performance.now();
111
+ const applied = await reconciler.reconcile(manifest);
112
+ const tAlloc = performance.now() - tAllocStart;
113
+ const tGetStart = performance.now();
114
+ await reconciler.getManifest("cli-benchmark-slot");
115
+ const tGet = performance.now() - tGetStart;
116
+ const tRenewStart = performance.now();
117
+ await reconciler.renewManifest("cli-benchmark-slot", 60);
118
+ const tRenew = performance.now() - tRenewStart;
119
+ const tDelStart = performance.now();
120
+ await reconciler.deleteManifest("cli-benchmark-slot");
121
+ const tDel = performance.now() - tDelStart;
122
+ const tTotal = performance.now() - t0;
123
+ if (options.json) {
124
+ console.log(JSON.stringify({
125
+ success: true,
126
+ metrics: {
127
+ allocationMs: Number(tAlloc.toFixed(3)),
128
+ getMs: Number(tGet.toFixed(3)),
129
+ renewMs: Number(tRenew.toFixed(3)),
130
+ deletionMs: Number(tDel.toFixed(3)),
131
+ totalMs: Number(tTotal.toFixed(3)),
132
+ defaultTtlMinutes: applied.status?.remainingTtlMinutes || 120
133
+ }
134
+ }, null, 2));
135
+ }
136
+ else {
137
+ console.log("=================================================");
138
+ console.log("🚀 CALL TELEMETRY VM LIFECYCLE BENCHMARK");
139
+ console.log("=================================================");
140
+ console.log(`• Allocation & Credential Linkage: ${tAlloc.toFixed(2)}ms`);
141
+ console.log(`• Status Inspection & Reconcile: ${tGet.toFixed(2)}ms`);
142
+ console.log(`• Lease Heartbeat Renewal (+60m): ${tRenew.toFixed(2)}ms`);
143
+ console.log(`• Teardown & Capacity Restore: ${tDel.toFixed(2)}ms`);
144
+ console.log(`• Default Claim Duration: ${applied.status?.remainingTtlMinutes || 120} minutes (2 Hours)`);
145
+ console.log("-------------------------------------------------");
146
+ console.log(`• TOTAL LIFECYCLE ROUNDTRIP: ${tTotal.toFixed(2)}ms`);
147
+ console.log("=================================================\n");
148
+ }
149
+ return 0;
150
+ }
151
+ }
78
152
  /**
79
153
  * Builds the Commander CLI program definition.
80
154
  */
@@ -104,6 +178,7 @@ export function buildCli(exitOverride = false) {
104
178
  }
105
179
  program.addCommand(buildPreflightCommand());
106
180
  program.addCommand(buildPurgeDaemonCommand());
181
+ program.addCommand(buildBenchmarkCommand());
107
182
  return program;
108
183
  }
109
184
  /**
@@ -331,6 +406,9 @@ if (isMainModule(import.meta.url)) {
331
406
  else if (process.argv[2] === "purge-daemon") {
332
407
  command = runPurgeDaemonCli();
333
408
  }
409
+ else if (process.argv[2] === "benchmark") {
410
+ command = runBenchmarkCli();
411
+ }
334
412
  else {
335
413
  command = runCli();
336
414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@calltelemetry/ct-lab-mcp",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Expanded Model Context Protocol (MCP) server for Call Telemetry lab, fleet, and appliance management across Proxmox VE and VMware ESXi.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",