mcpman 2.0.0 → 2.1.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/LICENSE +21 -21
- package/README.md +45 -540
- package/dist/chunk-6X6Q6UZC.js +0 -0
- package/dist/chunk-CYYW35D2.js +0 -0
- package/dist/chunk-HQO4AO6B.js +0 -0
- package/dist/chunk-K3NQKI34.js +0 -0
- package/dist/chunk-NFQMBLT3.js +0 -0
- package/dist/chunk-RGKHLY5G.js +0 -0
- package/dist/client-detector-TSWWOALP.js +0 -0
- package/dist/index.cjs +1018 -642
- package/dist/index.js +1013 -641
- package/dist/lockfile-MDGG6WI3.js +0 -0
- package/dist/trust-scorer-PEAFSMFK.js +0 -0
- package/dist/vault-service-O2I2K3DX.js +0 -0
- package/package.json +10 -3
package/dist/index.cjs
CHANGED
|
@@ -460,9 +460,9 @@ async function atomicWrite(filePath, content) {
|
|
|
460
460
|
throw err;
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
async function pathExists(
|
|
463
|
+
async function pathExists(p19) {
|
|
464
464
|
try {
|
|
465
|
-
await import_node_fs11.default.promises.access(
|
|
465
|
+
await import_node_fs11.default.promises.access(p19);
|
|
466
466
|
return true;
|
|
467
467
|
} catch {
|
|
468
468
|
return false;
|
|
@@ -966,7 +966,7 @@ function decrypt(entry, password2) {
|
|
|
966
966
|
]);
|
|
967
967
|
return decrypted.toString("utf-8");
|
|
968
968
|
}
|
|
969
|
-
async function getMasterPassword(
|
|
969
|
+
async function getMasterPassword(confirm13 = false) {
|
|
970
970
|
if (_cachedPassword) return _cachedPassword;
|
|
971
971
|
const password2 = await p4.password({
|
|
972
972
|
message: "Enter vault master password:",
|
|
@@ -976,7 +976,7 @@ async function getMasterPassword(confirm12 = false) {
|
|
|
976
976
|
p4.cancel("Vault access cancelled.");
|
|
977
977
|
process.exit(0);
|
|
978
978
|
}
|
|
979
|
-
if (
|
|
979
|
+
if (confirm13) {
|
|
980
980
|
const confirm22 = await p4.password({ message: "Confirm master password:" });
|
|
981
981
|
if (p4.isCancel(confirm22) || confirm22 !== password2) {
|
|
982
982
|
p4.cancel("Passwords do not match.");
|
|
@@ -1048,7 +1048,7 @@ var init_vault_service = __esm({
|
|
|
1048
1048
|
|
|
1049
1049
|
// src/index.ts
|
|
1050
1050
|
init_cjs_shims();
|
|
1051
|
-
var
|
|
1051
|
+
var import_citty48 = require("citty");
|
|
1052
1052
|
|
|
1053
1053
|
// src/commands/agent.ts
|
|
1054
1054
|
init_cjs_shims();
|
|
@@ -2043,11 +2043,11 @@ async function scanAllServers(servers, concurrency = 3) {
|
|
|
2043
2043
|
const results = [];
|
|
2044
2044
|
const executing = /* @__PURE__ */ new Set();
|
|
2045
2045
|
for (const [name, entry] of entries) {
|
|
2046
|
-
const
|
|
2046
|
+
const p19 = scanServer(name, entry).then((r) => {
|
|
2047
2047
|
results.push(r);
|
|
2048
|
-
executing.delete(
|
|
2048
|
+
executing.delete(p19);
|
|
2049
2049
|
});
|
|
2050
|
-
executing.add(
|
|
2050
|
+
executing.add(p19);
|
|
2051
2051
|
if (executing.size >= concurrency) await Promise.race(executing);
|
|
2052
2052
|
}
|
|
2053
2053
|
await Promise.all(executing);
|
|
@@ -2280,8 +2280,8 @@ function setConfigValue(key, value, configPath = getConfigPath()) {
|
|
|
2280
2280
|
// src/core/plugin-loader.ts
|
|
2281
2281
|
function isValidPlugin(obj) {
|
|
2282
2282
|
if (typeof obj !== "object" || obj === null) return false;
|
|
2283
|
-
const
|
|
2284
|
-
return typeof
|
|
2283
|
+
const p19 = obj;
|
|
2284
|
+
return typeof p19.name === "string" && typeof p19.prefix === "string" && typeof p19.resolve === "function";
|
|
2285
2285
|
}
|
|
2286
2286
|
function loadPlugin(pkg, pluginDir = getPluginDir()) {
|
|
2287
2287
|
try {
|
|
@@ -2335,7 +2335,7 @@ function removePluginPackage(name, pluginDir = getPluginDir()) {
|
|
|
2335
2335
|
}
|
|
2336
2336
|
const config = readConfig();
|
|
2337
2337
|
const plugins = config.plugins ?? [];
|
|
2338
|
-
config.plugins = plugins.filter((
|
|
2338
|
+
config.plugins = plugins.filter((p19) => p19 !== name);
|
|
2339
2339
|
writeConfig(config);
|
|
2340
2340
|
}
|
|
2341
2341
|
function listPluginPackages() {
|
|
@@ -2389,7 +2389,7 @@ async function resolveServer(input) {
|
|
|
2389
2389
|
default: {
|
|
2390
2390
|
if (source.type.startsWith("plugin:")) {
|
|
2391
2391
|
const pluginName = source.type.slice(7);
|
|
2392
|
-
const plugin = plugins.find((
|
|
2392
|
+
const plugin = plugins.find((p19) => p19.name === pluginName);
|
|
2393
2393
|
if (plugin) {
|
|
2394
2394
|
const resolved = await plugin.resolve(source.input);
|
|
2395
2395
|
return resolved;
|
|
@@ -2601,11 +2601,11 @@ async function checkAllVersions(lockfile) {
|
|
|
2601
2601
|
const executing = /* @__PURE__ */ new Set();
|
|
2602
2602
|
for (const [name, entry] of entries) {
|
|
2603
2603
|
if (isPinned(name)) continue;
|
|
2604
|
-
const
|
|
2604
|
+
const p19 = checkVersion(name, entry).then((r) => {
|
|
2605
2605
|
results.push(r);
|
|
2606
|
-
executing.delete(
|
|
2606
|
+
executing.delete(p19);
|
|
2607
2607
|
});
|
|
2608
|
-
executing.add(
|
|
2608
|
+
executing.add(p19);
|
|
2609
2609
|
if (executing.size >= 5) {
|
|
2610
2610
|
await Promise.race(executing);
|
|
2611
2611
|
}
|
|
@@ -2714,16 +2714,16 @@ var audit_default = (0, import_citty3.defineCommand)({
|
|
|
2714
2714
|
} else {
|
|
2715
2715
|
Object.assign(targets, servers);
|
|
2716
2716
|
}
|
|
2717
|
-
const
|
|
2717
|
+
const spinner8 = (0, import_nanospinner.createSpinner)(`Scanning ${Object.keys(targets).length} server(s)...`).start();
|
|
2718
2718
|
let reports;
|
|
2719
2719
|
try {
|
|
2720
2720
|
reports = args.server ? [await scanServer(args.server, targets[args.server])] : await scanAllServers(targets);
|
|
2721
2721
|
} catch (err) {
|
|
2722
|
-
|
|
2722
|
+
spinner8.error({ text: "Scan failed" });
|
|
2723
2723
|
console.error(import_picocolors3.default.red(String(err)));
|
|
2724
2724
|
process.exit(1);
|
|
2725
2725
|
}
|
|
2726
|
-
|
|
2726
|
+
spinner8.success({ text: `Scanned ${reports.length} server(s)` });
|
|
2727
2727
|
if (args.json) {
|
|
2728
2728
|
console.log(JSON.stringify(reports, null, 2));
|
|
2729
2729
|
return;
|
|
@@ -2931,9 +2931,9 @@ function measureOneRun(command, args, env, timeoutMs) {
|
|
|
2931
2931
|
`);
|
|
2932
2932
|
});
|
|
2933
2933
|
}
|
|
2934
|
-
function percentile(sorted,
|
|
2934
|
+
function percentile(sorted, p19) {
|
|
2935
2935
|
if (sorted.length === 0) return 0;
|
|
2936
|
-
const idx = Math.ceil(
|
|
2936
|
+
const idx = Math.ceil(p19 / 100 * sorted.length) - 1;
|
|
2937
2937
|
return sorted[Math.max(0, idx)];
|
|
2938
2938
|
}
|
|
2939
2939
|
async function benchServer(command, args, env, runs = 5, timeoutMs = DEFAULT_TIMEOUT_MS) {
|
|
@@ -4575,8 +4575,8 @@ function printServerResult(result, showFix) {
|
|
|
4575
4575
|
const icon = result.status === "healthy" ? import_picocolors10.default.green("\u25CF") : import_picocolors10.default.red("\u25CF");
|
|
4576
4576
|
console.log(` ${icon} ${import_picocolors10.default.bold(result.serverName)}`);
|
|
4577
4577
|
for (const check of result.checks) {
|
|
4578
|
-
const
|
|
4579
|
-
console.log(` ${
|
|
4578
|
+
const checkIcon2 = check.skipped ? CHECK_ICON.skip : check.passed ? CHECK_ICON.pass : CHECK_ICON.fail;
|
|
4579
|
+
console.log(` ${checkIcon2} ${check.name}: ${check.message}`);
|
|
4580
4580
|
if (showFix && !check.passed && !check.skipped && check.fix) {
|
|
4581
4581
|
console.log(` ${import_picocolors10.default.yellow("\u2192")} Fix: ${import_picocolors10.default.cyan(check.fix)}`);
|
|
4582
4582
|
}
|
|
@@ -4587,11 +4587,11 @@ async function runParallel(tasks, concurrency) {
|
|
|
4587
4587
|
const results = [];
|
|
4588
4588
|
const executing = /* @__PURE__ */ new Set();
|
|
4589
4589
|
for (const task of tasks) {
|
|
4590
|
-
const
|
|
4590
|
+
const p19 = task().then((r) => {
|
|
4591
4591
|
results.push(r);
|
|
4592
|
-
executing.delete(
|
|
4592
|
+
executing.delete(p19);
|
|
4593
4593
|
});
|
|
4594
|
-
executing.add(
|
|
4594
|
+
executing.add(p19);
|
|
4595
4595
|
if (executing.size >= concurrency) {
|
|
4596
4596
|
await Promise.race(executing);
|
|
4597
4597
|
}
|
|
@@ -5125,14 +5125,146 @@ var group_default = (0, import_citty13.defineCommand)({
|
|
|
5125
5125
|
}
|
|
5126
5126
|
});
|
|
5127
5127
|
|
|
5128
|
+
// src/commands/health.ts
|
|
5129
|
+
init_cjs_shims();
|
|
5130
|
+
var import_citty14 = require("citty");
|
|
5131
|
+
var import_nanospinner2 = require("nanospinner");
|
|
5132
|
+
var import_picocolors14 = __toESM(require("picocolors"), 1);
|
|
5133
|
+
function statusIcon(status) {
|
|
5134
|
+
switch (status) {
|
|
5135
|
+
case "healthy":
|
|
5136
|
+
return import_picocolors14.default.green("\u25CF healthy");
|
|
5137
|
+
case "unhealthy":
|
|
5138
|
+
return import_picocolors14.default.red("\u25CF down");
|
|
5139
|
+
default:
|
|
5140
|
+
return import_picocolors14.default.yellow("\u25CF unknown");
|
|
5141
|
+
}
|
|
5142
|
+
}
|
|
5143
|
+
function checkIcon(passed, skipped) {
|
|
5144
|
+
if (skipped) return import_picocolors14.default.dim("-");
|
|
5145
|
+
return passed ? import_picocolors14.default.green("\u2713") : import_picocolors14.default.red("\u2717");
|
|
5146
|
+
}
|
|
5147
|
+
function printDashboard(results) {
|
|
5148
|
+
const nameW = Math.max(6, ...results.map((r) => r.serverName.length));
|
|
5149
|
+
const header = ` ${pad("SERVER", nameW)} STATUS`;
|
|
5150
|
+
console.log(import_picocolors14.default.bold("\n mcpman health\n"));
|
|
5151
|
+
console.log(import_picocolors14.default.dim(header));
|
|
5152
|
+
console.log(import_picocolors14.default.dim(` ${"\u2500".repeat(nameW + 20)}`));
|
|
5153
|
+
for (const result of results) {
|
|
5154
|
+
const name = pad(result.serverName, nameW);
|
|
5155
|
+
console.log(` ${name} ${statusIcon(result.status)}`);
|
|
5156
|
+
for (const check of result.checks) {
|
|
5157
|
+
const icon = checkIcon(check.passed, check.skipped ?? false);
|
|
5158
|
+
const msg = check.skipped ? import_picocolors14.default.dim(check.message) : check.message;
|
|
5159
|
+
console.log(` ${icon} ${import_picocolors14.default.dim(check.name)}: ${msg}`);
|
|
5160
|
+
}
|
|
5161
|
+
console.log();
|
|
5162
|
+
}
|
|
5163
|
+
}
|
|
5164
|
+
function printSummaryLine(results) {
|
|
5165
|
+
const healthy = results.filter((r) => r.status === "healthy").length;
|
|
5166
|
+
const unhealthy = results.filter((r) => r.status === "unhealthy").length;
|
|
5167
|
+
const unknown = results.filter((r) => r.status === "unknown").length;
|
|
5168
|
+
const parts = [];
|
|
5169
|
+
if (healthy > 0) parts.push(import_picocolors14.default.green(`${healthy} healthy`));
|
|
5170
|
+
if (unhealthy > 0) parts.push(import_picocolors14.default.red(`${unhealthy} down`));
|
|
5171
|
+
if (unknown > 0) parts.push(import_picocolors14.default.yellow(`${unknown} unknown`));
|
|
5172
|
+
console.log(` ${parts.join(" \xB7 ")}
|
|
5173
|
+
`);
|
|
5174
|
+
}
|
|
5175
|
+
async function runParallel2(tasks, concurrency) {
|
|
5176
|
+
const results = [];
|
|
5177
|
+
const executing = /* @__PURE__ */ new Set();
|
|
5178
|
+
for (const task of tasks) {
|
|
5179
|
+
const p19 = task().then((r) => {
|
|
5180
|
+
results.push(r);
|
|
5181
|
+
executing.delete(p19);
|
|
5182
|
+
});
|
|
5183
|
+
executing.add(p19);
|
|
5184
|
+
if (executing.size >= concurrency) {
|
|
5185
|
+
await Promise.race(executing);
|
|
5186
|
+
}
|
|
5187
|
+
}
|
|
5188
|
+
await Promise.all(executing);
|
|
5189
|
+
return results;
|
|
5190
|
+
}
|
|
5191
|
+
var health_default = (0, import_citty14.defineCommand)({
|
|
5192
|
+
meta: {
|
|
5193
|
+
name: "health",
|
|
5194
|
+
description: "Real-time health monitoring dashboard for installed MCP servers"
|
|
5195
|
+
},
|
|
5196
|
+
args: {
|
|
5197
|
+
server: {
|
|
5198
|
+
type: "string",
|
|
5199
|
+
description: "Check a specific server by name"
|
|
5200
|
+
},
|
|
5201
|
+
json: {
|
|
5202
|
+
type: "boolean",
|
|
5203
|
+
description: "Output results as JSON",
|
|
5204
|
+
default: false
|
|
5205
|
+
},
|
|
5206
|
+
concurrency: {
|
|
5207
|
+
type: "string",
|
|
5208
|
+
description: "Max parallel health checks (default: 5)",
|
|
5209
|
+
default: "5"
|
|
5210
|
+
}
|
|
5211
|
+
},
|
|
5212
|
+
async run({ args }) {
|
|
5213
|
+
const label = args.server ? `Checking ${args.server}...` : "Checking all servers...";
|
|
5214
|
+
const spinner8 = (0, import_nanospinner2.createSpinner)(label).start();
|
|
5215
|
+
let servers = await getInstalledServers();
|
|
5216
|
+
if (args.server) {
|
|
5217
|
+
servers = servers.filter((s) => s.name === args.server);
|
|
5218
|
+
if (servers.length === 0) {
|
|
5219
|
+
spinner8.error({ text: `Server "${args.server}" not found in any client config.` });
|
|
5220
|
+
process.exit(1);
|
|
5221
|
+
}
|
|
5222
|
+
}
|
|
5223
|
+
if (servers.length === 0) {
|
|
5224
|
+
spinner8.warn({ text: "No MCP servers installed." });
|
|
5225
|
+
console.log(import_picocolors14.default.dim("\n Run mcpman install <server> to get started.\n"));
|
|
5226
|
+
return;
|
|
5227
|
+
}
|
|
5228
|
+
const concurrency = Math.max(1, Number.parseInt(args.concurrency ?? "5", 10) || 5);
|
|
5229
|
+
const tasks = servers.map((s) => () => checkServerHealth(s.name, s.config));
|
|
5230
|
+
let results;
|
|
5231
|
+
try {
|
|
5232
|
+
results = await runParallel2(tasks, concurrency);
|
|
5233
|
+
} catch (err) {
|
|
5234
|
+
spinner8.error({ text: "Health check failed" });
|
|
5235
|
+
console.error(import_picocolors14.default.red(String(err)));
|
|
5236
|
+
process.exit(1);
|
|
5237
|
+
}
|
|
5238
|
+
results.sort((a, b) => {
|
|
5239
|
+
const order = { unhealthy: 0, unknown: 1, healthy: 2 };
|
|
5240
|
+
return order[a.status] - order[b.status];
|
|
5241
|
+
});
|
|
5242
|
+
const unhealthyCount = results.filter((r) => r.status === "unhealthy").length;
|
|
5243
|
+
spinner8.success({ text: `Checked ${results.length} server(s)` });
|
|
5244
|
+
if (args.json) {
|
|
5245
|
+
console.log(JSON.stringify(results, null, 2));
|
|
5246
|
+
return;
|
|
5247
|
+
}
|
|
5248
|
+
printDashboard(results);
|
|
5249
|
+
printSummaryLine(results);
|
|
5250
|
+
if (unhealthyCount > 0) {
|
|
5251
|
+
console.log(
|
|
5252
|
+
import_picocolors14.default.dim(` Run ${import_picocolors14.default.cyan("mcpman doctor --fix")} for detailed fix suggestions.
|
|
5253
|
+
`)
|
|
5254
|
+
);
|
|
5255
|
+
process.exit(1);
|
|
5256
|
+
}
|
|
5257
|
+
}
|
|
5258
|
+
});
|
|
5259
|
+
|
|
5128
5260
|
// src/commands/import-command.ts
|
|
5129
5261
|
init_cjs_shims();
|
|
5130
5262
|
var import_node_fs21 = __toESM(require("fs"), 1);
|
|
5131
5263
|
var import_node_path16 = __toESM(require("path"), 1);
|
|
5132
5264
|
var p5 = __toESM(require("@clack/prompts"), 1);
|
|
5133
|
-
var
|
|
5134
|
-
var
|
|
5135
|
-
var import_command_default = (0,
|
|
5265
|
+
var import_citty15 = require("citty");
|
|
5266
|
+
var import_picocolors15 = __toESM(require("picocolors"), 1);
|
|
5267
|
+
var import_command_default = (0, import_citty15.defineCommand)({
|
|
5136
5268
|
meta: {
|
|
5137
5269
|
name: "import",
|
|
5138
5270
|
description: "Import mcpman config, lockfile, vault, and plugins from an export file"
|
|
@@ -5157,19 +5289,19 @@ var import_command_default = (0, import_citty14.defineCommand)({
|
|
|
5157
5289
|
async run({ args }) {
|
|
5158
5290
|
const filePath = import_node_path16.default.resolve(args.file);
|
|
5159
5291
|
if (!import_node_fs21.default.existsSync(filePath)) {
|
|
5160
|
-
console.error(`${
|
|
5292
|
+
console.error(`${import_picocolors15.default.red("\u2717")} File not found: ${filePath}`);
|
|
5161
5293
|
process.exit(1);
|
|
5162
5294
|
}
|
|
5163
5295
|
let raw;
|
|
5164
5296
|
try {
|
|
5165
5297
|
raw = JSON.parse(import_node_fs21.default.readFileSync(filePath, "utf-8"));
|
|
5166
5298
|
} catch {
|
|
5167
|
-
console.error(`${
|
|
5299
|
+
console.error(`${import_picocolors15.default.red("\u2717")} Invalid JSON in ${filePath}`);
|
|
5168
5300
|
process.exit(1);
|
|
5169
5301
|
}
|
|
5170
5302
|
const error2 = validateBundle(raw);
|
|
5171
5303
|
if (error2) {
|
|
5172
|
-
console.error(`${
|
|
5304
|
+
console.error(`${import_picocolors15.default.red("\u2717")} Invalid export bundle: ${error2}`);
|
|
5173
5305
|
process.exit(1);
|
|
5174
5306
|
}
|
|
5175
5307
|
const bundle = raw;
|
|
@@ -5179,16 +5311,16 @@ var import_command_default = (0, import_citty14.defineCommand)({
|
|
|
5179
5311
|
const hasVault = !!bundle.vault;
|
|
5180
5312
|
const isDryRun = !!args["dry-run"];
|
|
5181
5313
|
console.log("");
|
|
5182
|
-
console.log(
|
|
5183
|
-
console.log(
|
|
5184
|
-
console.log(
|
|
5185
|
-
console.log(` Config keys: ${
|
|
5186
|
-
console.log(` Servers: ${
|
|
5187
|
-
console.log(` Vault: ${hasVault ?
|
|
5188
|
-
console.log(` Plugins: ${
|
|
5314
|
+
console.log(import_picocolors15.default.bold("Import summary:"));
|
|
5315
|
+
console.log(import_picocolors15.default.dim(` Source version: mcpman ${bundle.mcpmanVersion}`));
|
|
5316
|
+
console.log(import_picocolors15.default.dim(` Exported at: ${bundle.exportedAt}`));
|
|
5317
|
+
console.log(` Config keys: ${import_picocolors15.default.cyan(String(configKeys))}`);
|
|
5318
|
+
console.log(` Servers: ${import_picocolors15.default.cyan(String(serverCount))}`);
|
|
5319
|
+
console.log(` Vault: ${hasVault ? import_picocolors15.default.green("included") : import_picocolors15.default.dim("not included")}`);
|
|
5320
|
+
console.log(` Plugins: ${import_picocolors15.default.cyan(String(pluginCount))}`);
|
|
5189
5321
|
console.log("");
|
|
5190
5322
|
if (isDryRun) {
|
|
5191
|
-
console.log(
|
|
5323
|
+
console.log(import_picocolors15.default.yellow(" [dry-run] No changes applied."));
|
|
5192
5324
|
return;
|
|
5193
5325
|
}
|
|
5194
5326
|
if (!args.yes) {
|
|
@@ -5202,19 +5334,19 @@ var import_command_default = (0, import_citty14.defineCommand)({
|
|
|
5202
5334
|
}
|
|
5203
5335
|
}
|
|
5204
5336
|
const summary = importBundle(bundle, { dryRun: false });
|
|
5205
|
-
console.log(`${
|
|
5206
|
-
console.log(
|
|
5207
|
-
console.log(
|
|
5208
|
-
console.log(
|
|
5209
|
-
console.log(
|
|
5337
|
+
console.log(`${import_picocolors15.default.green("\u2713")} Import complete`);
|
|
5338
|
+
console.log(import_picocolors15.default.dim(` Config keys restored: ${summary.configKeys}`));
|
|
5339
|
+
console.log(import_picocolors15.default.dim(` Servers restored: ${summary.servers}`));
|
|
5340
|
+
console.log(import_picocolors15.default.dim(` Vault: ${summary.vaultImported ? "restored" : "skipped"}`));
|
|
5341
|
+
console.log(import_picocolors15.default.dim(` Plugins installed: ${summary.pluginsInstalled}`));
|
|
5210
5342
|
}
|
|
5211
5343
|
});
|
|
5212
5344
|
|
|
5213
5345
|
// src/commands/info.ts
|
|
5214
5346
|
init_cjs_shims();
|
|
5215
|
-
var
|
|
5216
|
-
var
|
|
5217
|
-
var
|
|
5347
|
+
var import_citty16 = require("citty");
|
|
5348
|
+
var import_nanospinner3 = require("nanospinner");
|
|
5349
|
+
var import_picocolors16 = __toESM(require("picocolors"), 1);
|
|
5218
5350
|
|
|
5219
5351
|
// src/core/package-info.ts
|
|
5220
5352
|
init_cjs_shims();
|
|
@@ -5272,11 +5404,11 @@ async function getPackageInfo(serverName) {
|
|
|
5272
5404
|
// src/commands/info.ts
|
|
5273
5405
|
function colorRisk2(score, riskLevel) {
|
|
5274
5406
|
const label = score !== null ? `${score}/100 (${riskLevel})` : riskLevel;
|
|
5275
|
-
if (riskLevel === "LOW") return
|
|
5276
|
-
if (riskLevel === "MEDIUM") return
|
|
5277
|
-
if (riskLevel === "HIGH") return
|
|
5278
|
-
if (riskLevel === "CRITICAL") return
|
|
5279
|
-
return
|
|
5407
|
+
if (riskLevel === "LOW") return import_picocolors16.default.green(label);
|
|
5408
|
+
if (riskLevel === "MEDIUM") return import_picocolors16.default.yellow(label);
|
|
5409
|
+
if (riskLevel === "HIGH") return import_picocolors16.default.red(label);
|
|
5410
|
+
if (riskLevel === "CRITICAL") return import_picocolors16.default.bold(import_picocolors16.default.red(label));
|
|
5411
|
+
return import_picocolors16.default.dim(label);
|
|
5280
5412
|
}
|
|
5281
5413
|
function formatDaysAgo(isoDate) {
|
|
5282
5414
|
if (!isoDate) return "unknown";
|
|
@@ -5286,54 +5418,54 @@ function formatDaysAgo(isoDate) {
|
|
|
5286
5418
|
return `${days} days ago`;
|
|
5287
5419
|
}
|
|
5288
5420
|
function printInfo(info2) {
|
|
5289
|
-
const installedBadge = info2.isInstalled ?
|
|
5421
|
+
const installedBadge = info2.isInstalled ? import_picocolors16.default.green(" [installed]") : import_picocolors16.default.dim(" [not installed]");
|
|
5290
5422
|
console.log();
|
|
5291
|
-
console.log(
|
|
5292
|
-
console.log(
|
|
5293
|
-
console.log(` ${
|
|
5294
|
-
console.log(` ${
|
|
5423
|
+
console.log(import_picocolors16.default.bold(` ${info2.name}@${info2.version}`) + installedBadge);
|
|
5424
|
+
console.log(import_picocolors16.default.dim(` ${"\u2500".repeat(60)}`));
|
|
5425
|
+
console.log(` ${import_picocolors16.default.dim("Source:")} ${info2.source}`);
|
|
5426
|
+
console.log(` ${import_picocolors16.default.dim("Runtime:")} ${info2.runtime}`);
|
|
5295
5427
|
if (info2.description) {
|
|
5296
|
-
console.log(` ${
|
|
5428
|
+
console.log(` ${import_picocolors16.default.dim("Description:")} ${info2.description}`);
|
|
5297
5429
|
}
|
|
5298
5430
|
if (info2.deprecated) {
|
|
5299
|
-
console.log(` ${
|
|
5431
|
+
console.log(` ${import_picocolors16.default.red("[DEPRECATED]")} This package is deprecated`);
|
|
5300
5432
|
}
|
|
5301
5433
|
console.log();
|
|
5302
|
-
console.log(` ${
|
|
5303
|
-
console.log(` ${
|
|
5434
|
+
console.log(` ${import_picocolors16.default.bold("Trust & Security")}`);
|
|
5435
|
+
console.log(` ${import_picocolors16.default.dim("Trust score:")} ${colorRisk2(info2.trustScore, info2.riskLevel)}`);
|
|
5304
5436
|
if (info2.source === "npm") {
|
|
5305
5437
|
console.log(
|
|
5306
|
-
` ${
|
|
5438
|
+
` ${import_picocolors16.default.dim("Downloads:")} ${info2.weeklyDownloads.toLocaleString()}/week ${import_picocolors16.default.dim("|")} ${import_picocolors16.default.dim("Age:")} ${info2.packageAge}d ${import_picocolors16.default.dim("|")} ${import_picocolors16.default.dim("Maintainers:")} ${info2.maintainerCount}`
|
|
5307
5439
|
);
|
|
5308
5440
|
if (info2.lastPublish) {
|
|
5309
|
-
console.log(` ${
|
|
5441
|
+
console.log(` ${import_picocolors16.default.dim("Last publish:")} ${formatDaysAgo(info2.lastPublish)}`);
|
|
5310
5442
|
}
|
|
5311
5443
|
} else {
|
|
5312
|
-
console.log(
|
|
5444
|
+
console.log(import_picocolors16.default.dim(" (Trust data available for npm packages only)"));
|
|
5313
5445
|
}
|
|
5314
5446
|
console.log();
|
|
5315
|
-
console.log(` ${
|
|
5447
|
+
console.log(` ${import_picocolors16.default.bold("Environment Variables")}`);
|
|
5316
5448
|
if (info2.envVars.length > 0) {
|
|
5317
5449
|
for (const env of info2.envVars) {
|
|
5318
|
-
console.log(` ${
|
|
5450
|
+
console.log(` ${import_picocolors16.default.cyan("\u2022")} ${env}`);
|
|
5319
5451
|
}
|
|
5320
5452
|
} else {
|
|
5321
|
-
console.log(
|
|
5453
|
+
console.log(import_picocolors16.default.dim(" none required"));
|
|
5322
5454
|
}
|
|
5323
5455
|
console.log();
|
|
5324
|
-
console.log(` ${
|
|
5456
|
+
console.log(` ${import_picocolors16.default.bold("Installed Clients")}`);
|
|
5325
5457
|
if (info2.installedClients.length > 0) {
|
|
5326
5458
|
for (const client of info2.installedClients) {
|
|
5327
|
-
console.log(` ${
|
|
5459
|
+
console.log(` ${import_picocolors16.default.green("\u2713")} ${client}`);
|
|
5328
5460
|
}
|
|
5329
5461
|
} else {
|
|
5330
|
-
console.log(
|
|
5462
|
+
console.log(import_picocolors16.default.dim(" Not installed in any client"));
|
|
5331
5463
|
}
|
|
5332
5464
|
console.log();
|
|
5333
|
-
console.log(
|
|
5465
|
+
console.log(import_picocolors16.default.dim(` ${"\u2500".repeat(60)}`));
|
|
5334
5466
|
console.log();
|
|
5335
5467
|
}
|
|
5336
|
-
var info_default = (0,
|
|
5468
|
+
var info_default = (0, import_citty16.defineCommand)({
|
|
5337
5469
|
meta: {
|
|
5338
5470
|
name: "info",
|
|
5339
5471
|
description: "Show detailed metadata for an MCP server (installed or from registry)"
|
|
@@ -5351,25 +5483,25 @@ var info_default = (0, import_citty15.defineCommand)({
|
|
|
5351
5483
|
}
|
|
5352
5484
|
},
|
|
5353
5485
|
async run({ args }) {
|
|
5354
|
-
const
|
|
5486
|
+
const spinner8 = (0, import_nanospinner3.createSpinner)(`Fetching info for ${args.server}...`).start();
|
|
5355
5487
|
let info2;
|
|
5356
5488
|
try {
|
|
5357
5489
|
info2 = await getPackageInfo(args.server);
|
|
5358
5490
|
} catch (err) {
|
|
5359
|
-
|
|
5360
|
-
console.error(
|
|
5491
|
+
spinner8.error({ text: "Failed to fetch package info" });
|
|
5492
|
+
console.error(import_picocolors16.default.red(String(err)));
|
|
5361
5493
|
process.exit(1);
|
|
5362
5494
|
}
|
|
5363
5495
|
if (!info2) {
|
|
5364
|
-
|
|
5496
|
+
spinner8.error({ text: `Package not found: ${args.server}` });
|
|
5365
5497
|
console.log(
|
|
5366
|
-
|
|
5498
|
+
import_picocolors16.default.dim(`
|
|
5367
5499
|
"${args.server}" was not found in the npm registry or your lockfile.
|
|
5368
5500
|
`)
|
|
5369
5501
|
);
|
|
5370
5502
|
process.exit(1);
|
|
5371
5503
|
}
|
|
5372
|
-
|
|
5504
|
+
spinner8.success({ text: `Found ${args.server}` });
|
|
5373
5505
|
if (args.json) {
|
|
5374
5506
|
console.log(JSON.stringify(info2, null, 2));
|
|
5375
5507
|
return;
|
|
@@ -5382,9 +5514,9 @@ var info_default = (0, import_citty15.defineCommand)({
|
|
|
5382
5514
|
init_cjs_shims();
|
|
5383
5515
|
var import_node_path17 = __toESM(require("path"), 1);
|
|
5384
5516
|
var p6 = __toESM(require("@clack/prompts"), 1);
|
|
5385
|
-
var
|
|
5517
|
+
var import_citty17 = require("citty");
|
|
5386
5518
|
init_lockfile();
|
|
5387
|
-
var init_default = (0,
|
|
5519
|
+
var init_default = (0, import_citty17.defineCommand)({
|
|
5388
5520
|
meta: {
|
|
5389
5521
|
name: "init",
|
|
5390
5522
|
description: "Initialize mcpman.lock in the current project"
|
|
@@ -5485,7 +5617,7 @@ var init_default = (0, import_citty16.defineCommand)({
|
|
|
5485
5617
|
// src/commands/install.ts
|
|
5486
5618
|
init_cjs_shims();
|
|
5487
5619
|
var p9 = __toESM(require("@clack/prompts"), 1);
|
|
5488
|
-
var
|
|
5620
|
+
var import_citty18 = require("citty");
|
|
5489
5621
|
|
|
5490
5622
|
// src/core/installer.ts
|
|
5491
5623
|
init_cjs_shims();
|
|
@@ -5566,17 +5698,17 @@ async function loadClients2() {
|
|
|
5566
5698
|
}
|
|
5567
5699
|
async function installServer(input, options = {}) {
|
|
5568
5700
|
p8.intro("mcpman install");
|
|
5569
|
-
const
|
|
5570
|
-
|
|
5701
|
+
const spinner8 = p8.spinner();
|
|
5702
|
+
spinner8.start("Resolving server...");
|
|
5571
5703
|
let metadata;
|
|
5572
5704
|
try {
|
|
5573
5705
|
metadata = await resolveServer(input);
|
|
5574
5706
|
} catch (err) {
|
|
5575
|
-
|
|
5707
|
+
spinner8.stop("Resolution failed");
|
|
5576
5708
|
p8.log.error(err instanceof Error ? err.message : String(err));
|
|
5577
5709
|
process.exit(1);
|
|
5578
5710
|
}
|
|
5579
|
-
|
|
5711
|
+
spinner8.stop(`Found: ${metadata.name}@${metadata.version}`);
|
|
5580
5712
|
const clients = await loadClients2();
|
|
5581
5713
|
if (clients.length === 0) {
|
|
5582
5714
|
p8.log.warn("No supported AI clients detected on this machine.");
|
|
@@ -5637,20 +5769,20 @@ async function installServer(input, options = {}) {
|
|
|
5637
5769
|
args: metadata.args,
|
|
5638
5770
|
...Object.keys(collectedEnv).length > 0 ? { env: collectedEnv } : {}
|
|
5639
5771
|
};
|
|
5640
|
-
|
|
5772
|
+
spinner8.start("Writing config...");
|
|
5641
5773
|
const clientTypes = [];
|
|
5642
5774
|
for (const client of selectedClients) {
|
|
5643
5775
|
try {
|
|
5644
5776
|
await client.addServer(metadata.name, entry);
|
|
5645
5777
|
clientTypes.push(client.type);
|
|
5646
5778
|
} catch (err) {
|
|
5647
|
-
|
|
5779
|
+
spinner8.stop("Partial failure");
|
|
5648
5780
|
p8.log.warn(
|
|
5649
5781
|
`Failed to write to ${client.displayName}: ${err instanceof Error ? err.message : String(err)}`
|
|
5650
5782
|
);
|
|
5651
5783
|
}
|
|
5652
5784
|
}
|
|
5653
|
-
|
|
5785
|
+
spinner8.stop("Config written");
|
|
5654
5786
|
const source = detectSource(input);
|
|
5655
5787
|
const integrity = computeIntegrity(metadata.resolved);
|
|
5656
5788
|
addEntry(metadata.name, {
|
|
@@ -5714,21 +5846,21 @@ async function installRemoteServer(options) {
|
|
|
5714
5846
|
transport: options.transport,
|
|
5715
5847
|
headers: options.headers
|
|
5716
5848
|
});
|
|
5717
|
-
const
|
|
5718
|
-
|
|
5849
|
+
const spinner8 = p8.spinner();
|
|
5850
|
+
spinner8.start("Writing config...");
|
|
5719
5851
|
const clientTypes = [];
|
|
5720
5852
|
for (const client of selectedClients) {
|
|
5721
5853
|
try {
|
|
5722
5854
|
await client.addServer(options.name, entry);
|
|
5723
5855
|
clientTypes.push(client.type);
|
|
5724
5856
|
} catch (err) {
|
|
5725
|
-
|
|
5857
|
+
spinner8.stop("Partial failure");
|
|
5726
5858
|
p8.log.warn(
|
|
5727
5859
|
`Failed to write to ${client.displayName}: ${err instanceof Error ? err.message : String(err)}`
|
|
5728
5860
|
);
|
|
5729
5861
|
}
|
|
5730
5862
|
}
|
|
5731
|
-
|
|
5863
|
+
spinner8.stop("Config written");
|
|
5732
5864
|
const integrity = computeIntegrity(options.url);
|
|
5733
5865
|
addEntry(options.name, {
|
|
5734
5866
|
version: "remote",
|
|
@@ -5754,7 +5886,7 @@ init_lockfile();
|
|
|
5754
5886
|
|
|
5755
5887
|
// src/utils/logger.ts
|
|
5756
5888
|
init_cjs_shims();
|
|
5757
|
-
var
|
|
5889
|
+
var import_picocolors17 = __toESM(require("picocolors"), 1);
|
|
5758
5890
|
var noColor = process.env.NO_COLOR !== void 0 || process.argv.includes("--no-color");
|
|
5759
5891
|
var isVerbose = process.argv.includes("--verbose");
|
|
5760
5892
|
var isJson = process.argv.includes("--json");
|
|
@@ -5763,11 +5895,11 @@ function colorize(fn, text3) {
|
|
|
5763
5895
|
}
|
|
5764
5896
|
function info(message) {
|
|
5765
5897
|
if (isJson) return;
|
|
5766
|
-
console.log(`${colorize(
|
|
5898
|
+
console.log(`${colorize(import_picocolors17.default.cyan, "i")} ${message}`);
|
|
5767
5899
|
}
|
|
5768
5900
|
function error(message) {
|
|
5769
5901
|
if (isJson) return;
|
|
5770
|
-
console.error(`${colorize(
|
|
5902
|
+
console.error(`${colorize(import_picocolors17.default.red, "\u2717")} ${message}`);
|
|
5771
5903
|
}
|
|
5772
5904
|
function json(data) {
|
|
5773
5905
|
console.log(JSON.stringify(data, null, 2));
|
|
@@ -5777,7 +5909,7 @@ function json(data) {
|
|
|
5777
5909
|
function parseHeaders(headerFlag) {
|
|
5778
5910
|
return parseEnvFlags(headerFlag);
|
|
5779
5911
|
}
|
|
5780
|
-
var install_default = (0,
|
|
5912
|
+
var install_default = (0, import_citty18.defineCommand)({
|
|
5781
5913
|
meta: {
|
|
5782
5914
|
name: "install",
|
|
5783
5915
|
description: "Install an MCP server into one or more AI clients"
|
|
@@ -5887,8 +6019,8 @@ async function restoreFromLockfile() {
|
|
|
5887
6019
|
// src/commands/link.ts
|
|
5888
6020
|
init_cjs_shims();
|
|
5889
6021
|
var import_node_path19 = __toESM(require("path"), 1);
|
|
5890
|
-
var
|
|
5891
|
-
var
|
|
6022
|
+
var import_citty19 = require("citty");
|
|
6023
|
+
var import_picocolors18 = __toESM(require("picocolors"), 1);
|
|
5892
6024
|
init_client_detector();
|
|
5893
6025
|
|
|
5894
6026
|
// src/core/link-service.ts
|
|
@@ -5971,7 +6103,7 @@ function detectPythonServer(dir, pyprojectPath) {
|
|
|
5971
6103
|
import_node_path18.default.join(dir, "main.py"),
|
|
5972
6104
|
import_node_path18.default.join(dir, name.replace(/-/g, "_"), "main.py"),
|
|
5973
6105
|
import_node_path18.default.join(dir, "__main__.py")
|
|
5974
|
-
].find((
|
|
6106
|
+
].find((p19) => import_node_fs22.default.existsSync(p19));
|
|
5975
6107
|
const entryPoint = entryCandidate ?? import_node_path18.default.join(dir, "main.py");
|
|
5976
6108
|
return {
|
|
5977
6109
|
name,
|
|
@@ -6020,7 +6152,7 @@ async function registerLinkedServer(linkResult, clients, lockfilePath, nameOverr
|
|
|
6020
6152
|
}
|
|
6021
6153
|
|
|
6022
6154
|
// src/commands/link.ts
|
|
6023
|
-
var link_default = (0,
|
|
6155
|
+
var link_default = (0, import_citty19.defineCommand)({
|
|
6024
6156
|
meta: {
|
|
6025
6157
|
name: "link",
|
|
6026
6158
|
description: "Register a local MCP server directory with AI clients"
|
|
@@ -6051,37 +6183,37 @@ var link_default = (0, import_citty18.defineCommand)({
|
|
|
6051
6183
|
try {
|
|
6052
6184
|
linkResult = detectLocalServer(absoluteDir);
|
|
6053
6185
|
} catch (err) {
|
|
6054
|
-
console.error(
|
|
6186
|
+
console.error(import_picocolors18.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
6055
6187
|
process.exit(1);
|
|
6056
6188
|
}
|
|
6057
6189
|
const serverName = nameOverride ?? linkResult.name;
|
|
6058
|
-
console.log(
|
|
6059
|
-
Detected: ${
|
|
6060
|
-
console.log(
|
|
6061
|
-
console.log(
|
|
6190
|
+
console.log(import_picocolors18.default.dim(`
|
|
6191
|
+
Detected: ${import_picocolors18.default.cyan(serverName)} (${linkResult.runtime})`));
|
|
6192
|
+
console.log(import_picocolors18.default.dim(` Path: ${absoluteDir}`));
|
|
6193
|
+
console.log(import_picocolors18.default.dim(` Command: ${linkResult.command} ${linkResult.args.join(" ")}`));
|
|
6062
6194
|
const allClients = await getInstalledClients();
|
|
6063
6195
|
const clients = clientFilter ? allClients.filter((c) => c.type === clientFilter) : allClients;
|
|
6064
6196
|
if (clientFilter && clients.length === 0) {
|
|
6065
|
-
console.error(
|
|
6197
|
+
console.error(import_picocolors18.default.red(` Error: Unknown client '${clientFilter}'.`));
|
|
6066
6198
|
process.exit(1);
|
|
6067
6199
|
}
|
|
6068
6200
|
let registered;
|
|
6069
6201
|
try {
|
|
6070
6202
|
registered = await registerLinkedServer(linkResult, clients, void 0, nameOverride);
|
|
6071
6203
|
} catch (err) {
|
|
6072
|
-
console.error(
|
|
6204
|
+
console.error(import_picocolors18.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
6073
6205
|
process.exit(1);
|
|
6074
6206
|
}
|
|
6075
6207
|
if (registered.length === 0) {
|
|
6076
|
-
console.log(
|
|
6077
|
-
console.log(
|
|
6208
|
+
console.log(import_picocolors18.default.yellow(" Warning: No clients registered. Are any AI clients installed?"));
|
|
6209
|
+
console.log(import_picocolors18.default.dim(` Server saved to lockfile with source "local".`));
|
|
6078
6210
|
} else {
|
|
6079
|
-
console.log(
|
|
6080
|
-
Linked ${
|
|
6211
|
+
console.log(import_picocolors18.default.green(`
|
|
6212
|
+
Linked ${import_picocolors18.default.bold(serverName)} to: ${registered.join(", ")}
|
|
6081
6213
|
`));
|
|
6082
|
-
console.log(
|
|
6214
|
+
console.log(import_picocolors18.default.dim(` Run ${import_picocolors18.default.cyan("mcpman list")} to verify.`));
|
|
6083
6215
|
console.log(
|
|
6084
|
-
|
|
6216
|
+
import_picocolors18.default.dim(` Run ${import_picocolors18.default.cyan(`mcpman watch ${serverName}`)} to start with auto-restart.`)
|
|
6085
6217
|
);
|
|
6086
6218
|
}
|
|
6087
6219
|
console.log();
|
|
@@ -6090,14 +6222,14 @@ var link_default = (0, import_citty18.defineCommand)({
|
|
|
6090
6222
|
|
|
6091
6223
|
// src/commands/list.ts
|
|
6092
6224
|
init_cjs_shims();
|
|
6093
|
-
var
|
|
6094
|
-
var
|
|
6225
|
+
var import_citty20 = require("citty");
|
|
6226
|
+
var import_picocolors19 = __toESM(require("picocolors"), 1);
|
|
6095
6227
|
var STATUS_ICON = {
|
|
6096
|
-
healthy:
|
|
6097
|
-
unhealthy:
|
|
6098
|
-
unknown:
|
|
6228
|
+
healthy: import_picocolors19.default.green("\u25CF"),
|
|
6229
|
+
unhealthy: import_picocolors19.default.red("\u25CF"),
|
|
6230
|
+
unknown: import_picocolors19.default.dim("\u25CB")
|
|
6099
6231
|
};
|
|
6100
|
-
var list_default = (0,
|
|
6232
|
+
var list_default = (0, import_citty20.defineCommand)({
|
|
6101
6233
|
meta: {
|
|
6102
6234
|
name: "list",
|
|
6103
6235
|
description: "List installed MCP servers"
|
|
@@ -6118,8 +6250,8 @@ var list_default = (0, import_citty19.defineCommand)({
|
|
|
6118
6250
|
if (servers.length === 0) {
|
|
6119
6251
|
const filter = args.client ? ` for client "${args.client}"` : "";
|
|
6120
6252
|
console.log(
|
|
6121
|
-
|
|
6122
|
-
`No MCP servers installed${filter}. Run ${
|
|
6253
|
+
import_picocolors19.default.dim(
|
|
6254
|
+
`No MCP servers installed${filter}. Run ${import_picocolors19.default.cyan("mcpman install <server>")} to get started.`
|
|
6123
6255
|
)
|
|
6124
6256
|
);
|
|
6125
6257
|
return;
|
|
@@ -6145,9 +6277,9 @@ var list_default = (0, import_citty19.defineCommand)({
|
|
|
6145
6277
|
const nameWidth = Math.max(4, ...withStatus.map((s) => s.name.length));
|
|
6146
6278
|
const clientsWidth = Math.max(7, ...withStatus.map((s) => formatClients(s.clients).length));
|
|
6147
6279
|
const header = ` ${pad("NAME", nameWidth)} ${pad("CLIENT(S)", clientsWidth)} ${pad("COMMAND", 20)} STATUS`;
|
|
6148
|
-
console.log(
|
|
6280
|
+
console.log(import_picocolors19.default.dim(header));
|
|
6149
6281
|
console.log(
|
|
6150
|
-
|
|
6282
|
+
import_picocolors19.default.dim(` ${"-".repeat(nameWidth)} ${"-".repeat(clientsWidth)} ${"-".repeat(20)} ------`)
|
|
6151
6283
|
);
|
|
6152
6284
|
for (const s of withStatus) {
|
|
6153
6285
|
const icon = STATUS_ICON[s.status];
|
|
@@ -6163,7 +6295,7 @@ var list_default = (0, import_citty19.defineCommand)({
|
|
|
6163
6295
|
}
|
|
6164
6296
|
const clientSet = new Set(withStatus.flatMap((s) => s.clients));
|
|
6165
6297
|
console.log(
|
|
6166
|
-
|
|
6298
|
+
import_picocolors19.default.dim(
|
|
6167
6299
|
`
|
|
6168
6300
|
${withStatus.length} server${withStatus.length !== 1 ? "s" : ""} \xB7 ${clientSet.size} client${clientSet.size !== 1 ? "s" : ""}`
|
|
6169
6301
|
)
|
|
@@ -6177,10 +6309,10 @@ function formatClients(clients) {
|
|
|
6177
6309
|
// src/commands/logs.ts
|
|
6178
6310
|
init_cjs_shims();
|
|
6179
6311
|
var import_node_child_process6 = require("child_process");
|
|
6180
|
-
var
|
|
6181
|
-
var
|
|
6312
|
+
var import_citty21 = require("citty");
|
|
6313
|
+
var import_picocolors20 = __toESM(require("picocolors"), 1);
|
|
6182
6314
|
init_lockfile();
|
|
6183
|
-
var logs_default = (0,
|
|
6315
|
+
var logs_default = (0, import_citty21.defineCommand)({
|
|
6184
6316
|
meta: {
|
|
6185
6317
|
name: "logs",
|
|
6186
6318
|
description: "Stream stdout/stderr from an MCP server"
|
|
@@ -6203,7 +6335,7 @@ var logs_default = (0, import_citty20.defineCommand)({
|
|
|
6203
6335
|
const lockfile = readLockfile();
|
|
6204
6336
|
const entry = lockfile.servers[serverName];
|
|
6205
6337
|
if (!entry) {
|
|
6206
|
-
console.error(
|
|
6338
|
+
console.error(import_picocolors20.default.red(` Error: Server '${serverName}' is not installed.`));
|
|
6207
6339
|
process.exit(1);
|
|
6208
6340
|
}
|
|
6209
6341
|
const lockfileEnv = parseEnvFlags(entry.envVars);
|
|
@@ -6213,24 +6345,24 @@ var logs_default = (0, import_citty20.defineCommand)({
|
|
|
6213
6345
|
...lockfileEnv,
|
|
6214
6346
|
...vaultEnv
|
|
6215
6347
|
};
|
|
6216
|
-
console.log(
|
|
6348
|
+
console.log(import_picocolors20.default.dim(` Streaming logs for ${import_picocolors20.default.cyan(serverName)}... (Ctrl+C to stop)
|
|
6217
6349
|
`));
|
|
6218
6350
|
const child = (0, import_node_child_process6.spawn)(entry.command, entry.args, {
|
|
6219
6351
|
env: finalEnv,
|
|
6220
6352
|
stdio: ["pipe", "pipe", "pipe"]
|
|
6221
6353
|
});
|
|
6222
6354
|
child.stdout?.on("data", (chunk) => {
|
|
6223
|
-
process.stdout.write(
|
|
6355
|
+
process.stdout.write(import_picocolors20.default.dim("[stdout] ") + chunk.toString());
|
|
6224
6356
|
});
|
|
6225
6357
|
child.stderr?.on("data", (chunk) => {
|
|
6226
|
-
process.stderr.write(
|
|
6358
|
+
process.stderr.write(import_picocolors20.default.yellow("[stderr] ") + chunk.toString());
|
|
6227
6359
|
});
|
|
6228
6360
|
child.on("error", (err) => {
|
|
6229
|
-
console.error(
|
|
6361
|
+
console.error(import_picocolors20.default.red(` Failed to start '${serverName}': ${err.message}`));
|
|
6230
6362
|
process.exit(1);
|
|
6231
6363
|
});
|
|
6232
6364
|
child.on("close", (code) => {
|
|
6233
|
-
console.log(
|
|
6365
|
+
console.log(import_picocolors20.default.dim(`
|
|
6234
6366
|
Process exited with code ${code ?? 0}`));
|
|
6235
6367
|
process.exit(code ?? 0);
|
|
6236
6368
|
});
|
|
@@ -6244,10 +6376,157 @@ var logs_default = (0, import_citty20.defineCommand)({
|
|
|
6244
6376
|
}
|
|
6245
6377
|
});
|
|
6246
6378
|
|
|
6379
|
+
// src/commands/migrate.ts
|
|
6380
|
+
init_cjs_shims();
|
|
6381
|
+
var p10 = __toESM(require("@clack/prompts"), 1);
|
|
6382
|
+
var import_citty22 = require("citty");
|
|
6383
|
+
var import_picocolors21 = __toESM(require("picocolors"), 1);
|
|
6384
|
+
init_client_detector();
|
|
6385
|
+
var VALID_CLIENTS2 = [
|
|
6386
|
+
"claude-desktop",
|
|
6387
|
+
"cursor",
|
|
6388
|
+
"vscode",
|
|
6389
|
+
"windsurf",
|
|
6390
|
+
"claude-code",
|
|
6391
|
+
"roo-code",
|
|
6392
|
+
"codex-cli",
|
|
6393
|
+
"opencode",
|
|
6394
|
+
"continue",
|
|
6395
|
+
"zed"
|
|
6396
|
+
];
|
|
6397
|
+
function clientLabel(type) {
|
|
6398
|
+
return CLIENT_DISPLAY[type] ?? type;
|
|
6399
|
+
}
|
|
6400
|
+
function validateClient(value, flag) {
|
|
6401
|
+
if (!VALID_CLIENTS2.includes(value)) {
|
|
6402
|
+
console.error(
|
|
6403
|
+
`${import_picocolors21.default.red("\u2717")} Invalid --${flag} "${value}". Must be one of: ${VALID_CLIENTS2.join(", ")}`
|
|
6404
|
+
);
|
|
6405
|
+
process.exit(1);
|
|
6406
|
+
}
|
|
6407
|
+
return value;
|
|
6408
|
+
}
|
|
6409
|
+
var migrate_default = (0, import_citty22.defineCommand)({
|
|
6410
|
+
meta: {
|
|
6411
|
+
name: "migrate",
|
|
6412
|
+
description: "Migrate MCP server configs from one AI client to another"
|
|
6413
|
+
},
|
|
6414
|
+
args: {
|
|
6415
|
+
from: {
|
|
6416
|
+
type: "string",
|
|
6417
|
+
description: "Source client (claude-desktop, cursor, vscode, windsurf, claude-code, roo-code, codex-cli, opencode, continue, zed)",
|
|
6418
|
+
required: true
|
|
6419
|
+
},
|
|
6420
|
+
to: {
|
|
6421
|
+
type: "string",
|
|
6422
|
+
description: "Target client (same options as --from)",
|
|
6423
|
+
required: true
|
|
6424
|
+
},
|
|
6425
|
+
yes: {
|
|
6426
|
+
type: "boolean",
|
|
6427
|
+
description: "Skip confirmation prompt",
|
|
6428
|
+
default: false
|
|
6429
|
+
},
|
|
6430
|
+
"dry-run": {
|
|
6431
|
+
type: "boolean",
|
|
6432
|
+
description: "Preview changes without writing to target client config",
|
|
6433
|
+
default: false
|
|
6434
|
+
}
|
|
6435
|
+
},
|
|
6436
|
+
async run({ args }) {
|
|
6437
|
+
const fromType = validateClient(args.from, "from");
|
|
6438
|
+
const toType = validateClient(args.to, "to");
|
|
6439
|
+
if (fromType === toType) {
|
|
6440
|
+
console.error(`${import_picocolors21.default.red("\u2717")} --from and --to must be different clients.`);
|
|
6441
|
+
process.exit(1);
|
|
6442
|
+
}
|
|
6443
|
+
const fromLabel = clientLabel(fromType);
|
|
6444
|
+
const toLabel = clientLabel(toType);
|
|
6445
|
+
p10.intro(`${import_picocolors21.default.cyan("mcpman migrate")} ${import_picocolors21.default.dim(`${fromLabel} \u2192 ${toLabel}`)}`);
|
|
6446
|
+
const fromHandler = getClient(fromType);
|
|
6447
|
+
const fromInstalled = await fromHandler.isInstalled();
|
|
6448
|
+
if (!fromInstalled) {
|
|
6449
|
+
p10.log.error(`Source client "${fromLabel}" does not appear to be installed.`);
|
|
6450
|
+
process.exit(1);
|
|
6451
|
+
}
|
|
6452
|
+
let sourceServers;
|
|
6453
|
+
try {
|
|
6454
|
+
const config = await fromHandler.readConfig();
|
|
6455
|
+
sourceServers = config.servers;
|
|
6456
|
+
} catch (err) {
|
|
6457
|
+
p10.log.error(`Failed to read source config: ${String(err)}`);
|
|
6458
|
+
process.exit(1);
|
|
6459
|
+
}
|
|
6460
|
+
const serverNames = Object.keys(sourceServers);
|
|
6461
|
+
if (serverNames.length === 0) {
|
|
6462
|
+
p10.outro(import_picocolors21.default.dim(`No servers found in ${fromLabel} \u2014 nothing to migrate.`));
|
|
6463
|
+
return;
|
|
6464
|
+
}
|
|
6465
|
+
const toHandler = getClient(toType);
|
|
6466
|
+
let existingServers = {};
|
|
6467
|
+
try {
|
|
6468
|
+
const targetConfig = await toHandler.readConfig();
|
|
6469
|
+
existingServers = targetConfig.servers;
|
|
6470
|
+
} catch {
|
|
6471
|
+
}
|
|
6472
|
+
const toAdd = serverNames.filter((n) => !(n in existingServers));
|
|
6473
|
+
const toOverwrite = serverNames.filter((n) => n in existingServers);
|
|
6474
|
+
console.log(import_picocolors21.default.bold(`
|
|
6475
|
+
Servers to migrate from ${fromLabel} to ${toLabel}:
|
|
6476
|
+
`));
|
|
6477
|
+
for (const name of toAdd) {
|
|
6478
|
+
console.log(` ${import_picocolors21.default.green("+")} ${name} ${import_picocolors21.default.dim("(new)")}`);
|
|
6479
|
+
}
|
|
6480
|
+
for (const name of toOverwrite) {
|
|
6481
|
+
console.log(` ${import_picocolors21.default.yellow("~")} ${name} ${import_picocolors21.default.yellow("(already exists \u2014 will overwrite)")}`);
|
|
6482
|
+
}
|
|
6483
|
+
console.log();
|
|
6484
|
+
if (args["dry-run"]) {
|
|
6485
|
+
p10.outro(import_picocolors21.default.dim("Dry run \u2014 no changes applied."));
|
|
6486
|
+
return;
|
|
6487
|
+
}
|
|
6488
|
+
if (!args.yes) {
|
|
6489
|
+
const parts = [];
|
|
6490
|
+
if (toAdd.length > 0) parts.push(`add ${toAdd.length}`);
|
|
6491
|
+
if (toOverwrite.length > 0) parts.push(`overwrite ${toOverwrite.length}`);
|
|
6492
|
+
const message = `${parts.join(" and ")} server(s) in ${toLabel}. Continue?`;
|
|
6493
|
+
const confirmed = await p10.confirm({ message, initialValue: true });
|
|
6494
|
+
if (p10.isCancel(confirmed) || !confirmed) {
|
|
6495
|
+
p10.outro(import_picocolors21.default.dim("Cancelled \u2014 no changes applied."));
|
|
6496
|
+
return;
|
|
6497
|
+
}
|
|
6498
|
+
}
|
|
6499
|
+
const spinner8 = p10.spinner();
|
|
6500
|
+
spinner8.start("Migrating servers...");
|
|
6501
|
+
let successCount = 0;
|
|
6502
|
+
const errors = [];
|
|
6503
|
+
for (const [name, entry] of Object.entries(sourceServers)) {
|
|
6504
|
+
try {
|
|
6505
|
+
await toHandler.addServer(name, entry);
|
|
6506
|
+
successCount++;
|
|
6507
|
+
} catch (err) {
|
|
6508
|
+
errors.push({ name, error: String(err) });
|
|
6509
|
+
}
|
|
6510
|
+
}
|
|
6511
|
+
spinner8.stop("Migration complete");
|
|
6512
|
+
if (errors.length > 0) {
|
|
6513
|
+
for (const e of errors) {
|
|
6514
|
+
p10.log.error(`Failed to migrate "${e.name}": ${e.error}`);
|
|
6515
|
+
}
|
|
6516
|
+
}
|
|
6517
|
+
p10.outro(
|
|
6518
|
+
errors.length === 0 ? import_picocolors21.default.green(`Migrated ${successCount} server(s) to ${toLabel}.`) : import_picocolors21.default.yellow(
|
|
6519
|
+
`Migrated ${successCount}/${serverNames.length} server(s) \u2014 ${errors.length} error(s).`
|
|
6520
|
+
)
|
|
6521
|
+
);
|
|
6522
|
+
if (errors.length > 0) process.exit(1);
|
|
6523
|
+
}
|
|
6524
|
+
});
|
|
6525
|
+
|
|
6247
6526
|
// src/commands/notify.ts
|
|
6248
6527
|
init_cjs_shims();
|
|
6249
|
-
var
|
|
6250
|
-
var
|
|
6528
|
+
var import_citty23 = require("citty");
|
|
6529
|
+
var import_picocolors22 = __toESM(require("picocolors"), 1);
|
|
6251
6530
|
|
|
6252
6531
|
// src/core/notify-service.ts
|
|
6253
6532
|
init_cjs_shims();
|
|
@@ -6323,7 +6602,7 @@ function fireShell(command, event, payload) {
|
|
|
6323
6602
|
|
|
6324
6603
|
// src/commands/notify.ts
|
|
6325
6604
|
var VALID_EVENTS = ["install", "remove", "update", "health-fail"];
|
|
6326
|
-
var addCmd3 = (0,
|
|
6605
|
+
var addCmd3 = (0, import_citty23.defineCommand)({
|
|
6327
6606
|
meta: { name: "add", description: "Add a webhook or shell hook for an event" },
|
|
6328
6607
|
args: {
|
|
6329
6608
|
event: {
|
|
@@ -6343,11 +6622,11 @@ var addCmd3 = (0, import_citty21.defineCommand)({
|
|
|
6343
6622
|
run({ args }) {
|
|
6344
6623
|
const event = args.event;
|
|
6345
6624
|
if (!VALID_EVENTS.includes(event)) {
|
|
6346
|
-
console.error(`${
|
|
6625
|
+
console.error(`${import_picocolors22.default.red("\u2717")} Invalid event "${event}". Valid: ${VALID_EVENTS.join(", ")}`);
|
|
6347
6626
|
process.exit(1);
|
|
6348
6627
|
}
|
|
6349
6628
|
if (!args.webhook && !args.shell) {
|
|
6350
|
-
console.error(`${
|
|
6629
|
+
console.error(`${import_picocolors22.default.red("\u2717")} Provide --webhook <url> or --shell <command>`);
|
|
6351
6630
|
process.exit(1);
|
|
6352
6631
|
}
|
|
6353
6632
|
const type = args.webhook ? "webhook" : "shell";
|
|
@@ -6356,11 +6635,11 @@ var addCmd3 = (0, import_citty21.defineCommand)({
|
|
|
6356
6635
|
const hooks = listHooks();
|
|
6357
6636
|
const idx = hooks.length - 1;
|
|
6358
6637
|
console.log(
|
|
6359
|
-
`${
|
|
6638
|
+
`${import_picocolors22.default.green("\u2713")} Hook [${import_picocolors22.default.cyan(String(idx))}] added: ${import_picocolors22.default.bold(event)} \u2192 ${import_picocolors22.default.dim(type)}:${target}`
|
|
6360
6639
|
);
|
|
6361
6640
|
}
|
|
6362
6641
|
});
|
|
6363
|
-
var removeCmd2 = (0,
|
|
6642
|
+
var removeCmd2 = (0, import_citty23.defineCommand)({
|
|
6364
6643
|
meta: { name: "remove", description: "Remove a hook by index" },
|
|
6365
6644
|
args: {
|
|
6366
6645
|
index: { type: "positional", description: "Hook index (from `notify list`)", required: true }
|
|
@@ -6368,44 +6647,44 @@ var removeCmd2 = (0, import_citty21.defineCommand)({
|
|
|
6368
6647
|
run({ args }) {
|
|
6369
6648
|
const idx = Number(args.index);
|
|
6370
6649
|
if (Number.isNaN(idx) || idx < 0) {
|
|
6371
|
-
console.error(`${
|
|
6650
|
+
console.error(`${import_picocolors22.default.red("\u2717")} Invalid index "${args.index}".`);
|
|
6372
6651
|
process.exit(1);
|
|
6373
6652
|
}
|
|
6374
6653
|
try {
|
|
6375
6654
|
removeHook(idx);
|
|
6376
|
-
console.log(`${
|
|
6655
|
+
console.log(`${import_picocolors22.default.green("\u2713")} Hook [${idx}] removed`);
|
|
6377
6656
|
} catch (err) {
|
|
6378
|
-
console.error(`${
|
|
6657
|
+
console.error(`${import_picocolors22.default.red("\u2717")} ${String(err)}`);
|
|
6379
6658
|
process.exit(1);
|
|
6380
6659
|
}
|
|
6381
6660
|
}
|
|
6382
6661
|
});
|
|
6383
|
-
var listCmd4 = (0,
|
|
6662
|
+
var listCmd4 = (0, import_citty23.defineCommand)({
|
|
6384
6663
|
meta: { name: "list", description: "List all configured hooks" },
|
|
6385
6664
|
args: {},
|
|
6386
6665
|
run() {
|
|
6387
6666
|
const hooks = listHooks();
|
|
6388
6667
|
if (hooks.length === 0) {
|
|
6389
6668
|
console.log(
|
|
6390
|
-
|
|
6669
|
+
import_picocolors22.default.dim(
|
|
6391
6670
|
"\n No hooks configured. Use `mcpman notify add --event <event> --webhook <url>`.\n"
|
|
6392
6671
|
)
|
|
6393
6672
|
);
|
|
6394
6673
|
return;
|
|
6395
6674
|
}
|
|
6396
|
-
console.log(
|
|
6397
|
-
console.log(
|
|
6675
|
+
console.log(import_picocolors22.default.bold("\n mcpman notify hooks\n"));
|
|
6676
|
+
console.log(import_picocolors22.default.dim(` ${"\u2500".repeat(60)}`));
|
|
6398
6677
|
hooks.forEach((h, i) => {
|
|
6399
|
-
const typeLabel = h.type === "webhook" ?
|
|
6678
|
+
const typeLabel = h.type === "webhook" ? import_picocolors22.default.blue("webhook") : import_picocolors22.default.magenta("shell");
|
|
6400
6679
|
console.log(
|
|
6401
|
-
` ${
|
|
6680
|
+
` ${import_picocolors22.default.dim(`[${i}]`)} ${import_picocolors22.default.bold(h.event.padEnd(12))} ${typeLabel} ${import_picocolors22.default.dim(h.target)}`
|
|
6402
6681
|
);
|
|
6403
6682
|
});
|
|
6404
|
-
console.log(
|
|
6683
|
+
console.log(import_picocolors22.default.dim(` ${"\u2500".repeat(60)}
|
|
6405
6684
|
`));
|
|
6406
6685
|
}
|
|
6407
6686
|
});
|
|
6408
|
-
var testCmd = (0,
|
|
6687
|
+
var testCmd = (0, import_citty23.defineCommand)({
|
|
6409
6688
|
meta: { name: "test", description: "Fire a test event to all matching hooks" },
|
|
6410
6689
|
args: {
|
|
6411
6690
|
event: {
|
|
@@ -6417,30 +6696,30 @@ var testCmd = (0, import_citty21.defineCommand)({
|
|
|
6417
6696
|
async run({ args }) {
|
|
6418
6697
|
const event = args.event;
|
|
6419
6698
|
if (!VALID_EVENTS.includes(event)) {
|
|
6420
|
-
console.error(`${
|
|
6699
|
+
console.error(`${import_picocolors22.default.red("\u2717")} Invalid event "${event}". Valid: ${VALID_EVENTS.join(", ")}`);
|
|
6421
6700
|
process.exit(1);
|
|
6422
6701
|
}
|
|
6423
6702
|
const hooks = listHooks().filter((h) => h.event === event);
|
|
6424
6703
|
if (hooks.length === 0) {
|
|
6425
|
-
console.log(
|
|
6704
|
+
console.log(import_picocolors22.default.dim(`
|
|
6426
6705
|
No hooks configured for event "${event}".
|
|
6427
6706
|
`));
|
|
6428
6707
|
return;
|
|
6429
6708
|
}
|
|
6430
|
-
console.log(
|
|
6431
|
-
Firing test event: ${
|
|
6709
|
+
console.log(import_picocolors22.default.cyan(`
|
|
6710
|
+
Firing test event: ${import_picocolors22.default.bold(event)} (${hooks.length} hook(s))...
|
|
6432
6711
|
`));
|
|
6433
6712
|
try {
|
|
6434
6713
|
await fireEvent(event, { test: true, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
6435
|
-
console.log(`${
|
|
6714
|
+
console.log(`${import_picocolors22.default.green("\u2713")} Test event fired
|
|
6436
6715
|
`);
|
|
6437
6716
|
} catch (err) {
|
|
6438
|
-
console.error(`${
|
|
6717
|
+
console.error(`${import_picocolors22.default.red("\u2717")} ${String(err)}`);
|
|
6439
6718
|
process.exit(1);
|
|
6440
6719
|
}
|
|
6441
6720
|
}
|
|
6442
6721
|
});
|
|
6443
|
-
var notify_default = (0,
|
|
6722
|
+
var notify_default = (0, import_citty23.defineCommand)({
|
|
6444
6723
|
meta: {
|
|
6445
6724
|
name: "notify",
|
|
6446
6725
|
description: "Manage event webhooks and shell hooks"
|
|
@@ -6453,12 +6732,106 @@ var notify_default = (0, import_citty21.defineCommand)({
|
|
|
6453
6732
|
}
|
|
6454
6733
|
});
|
|
6455
6734
|
|
|
6735
|
+
// src/commands/outdated.ts
|
|
6736
|
+
init_cjs_shims();
|
|
6737
|
+
var import_citty24 = require("citty");
|
|
6738
|
+
var import_nanospinner4 = require("nanospinner");
|
|
6739
|
+
var import_picocolors23 = __toESM(require("picocolors"), 1);
|
|
6740
|
+
init_lockfile();
|
|
6741
|
+
function statusLabel(info2) {
|
|
6742
|
+
if (!info2.hasUpdate) return import_picocolors23.default.green("up-to-date");
|
|
6743
|
+
switch (info2.updateType) {
|
|
6744
|
+
case "major":
|
|
6745
|
+
return import_picocolors23.default.red("major");
|
|
6746
|
+
case "minor":
|
|
6747
|
+
return import_picocolors23.default.yellow("minor");
|
|
6748
|
+
case "patch":
|
|
6749
|
+
return import_picocolors23.default.cyan("patch");
|
|
6750
|
+
default:
|
|
6751
|
+
return import_picocolors23.default.yellow("outdated");
|
|
6752
|
+
}
|
|
6753
|
+
}
|
|
6754
|
+
function printTable(results) {
|
|
6755
|
+
if (results.length === 0) {
|
|
6756
|
+
console.log(import_picocolors23.default.dim("\n No servers to check.\n"));
|
|
6757
|
+
return;
|
|
6758
|
+
}
|
|
6759
|
+
const nameW = Math.max(7, ...results.map((r) => r.server.length));
|
|
6760
|
+
const curW = Math.max(7, ...results.map((r) => r.currentVersion.length));
|
|
6761
|
+
const latW = Math.max(6, ...results.map((r) => r.latestVersion.length));
|
|
6762
|
+
const header = [pad("PACKAGE", nameW), pad("CURRENT", curW), pad("LATEST", latW), "STATUS"].join(
|
|
6763
|
+
" "
|
|
6764
|
+
);
|
|
6765
|
+
console.log(import_picocolors23.default.bold(`
|
|
6766
|
+
${header}`));
|
|
6767
|
+
console.log(import_picocolors23.default.dim(` ${"\u2500".repeat(nameW + curW + latW + 20)}`));
|
|
6768
|
+
for (const r of results) {
|
|
6769
|
+
const name = pad(r.server, nameW);
|
|
6770
|
+
const cur = pad(r.currentVersion, curW);
|
|
6771
|
+
const lat = pad(r.latestVersion, latW);
|
|
6772
|
+
const status = statusLabel(r);
|
|
6773
|
+
console.log(` ${name} ${cur} ${lat} ${status}`);
|
|
6774
|
+
}
|
|
6775
|
+
console.log();
|
|
6776
|
+
}
|
|
6777
|
+
var outdated_default = (0, import_citty24.defineCommand)({
|
|
6778
|
+
meta: {
|
|
6779
|
+
name: "outdated",
|
|
6780
|
+
description: "Check installed MCP servers for newer versions available on the registry"
|
|
6781
|
+
},
|
|
6782
|
+
args: {
|
|
6783
|
+
json: {
|
|
6784
|
+
type: "boolean",
|
|
6785
|
+
description: "Output results as JSON",
|
|
6786
|
+
default: false
|
|
6787
|
+
},
|
|
6788
|
+
outdated: {
|
|
6789
|
+
type: "boolean",
|
|
6790
|
+
description: "Show only packages that have updates available",
|
|
6791
|
+
default: false
|
|
6792
|
+
}
|
|
6793
|
+
},
|
|
6794
|
+
async run({ args }) {
|
|
6795
|
+
const lockfile = readLockfile();
|
|
6796
|
+
const entries = Object.entries(lockfile.servers);
|
|
6797
|
+
if (entries.length === 0) {
|
|
6798
|
+
console.log(import_picocolors23.default.dim("\n No MCP servers installed. Run mcpman install <server> first.\n"));
|
|
6799
|
+
return;
|
|
6800
|
+
}
|
|
6801
|
+
const spinner8 = (0, import_nanospinner4.createSpinner)(`Checking ${entries.length} server(s) for updates...`).start();
|
|
6802
|
+
let results;
|
|
6803
|
+
try {
|
|
6804
|
+
results = await checkAllVersions(lockfile);
|
|
6805
|
+
} catch (err) {
|
|
6806
|
+
spinner8.error({ text: "Version check failed" });
|
|
6807
|
+
console.error(import_picocolors23.default.red(String(err)));
|
|
6808
|
+
process.exit(1);
|
|
6809
|
+
}
|
|
6810
|
+
const outdatedCount = results.filter((r) => r.hasUpdate).length;
|
|
6811
|
+
spinner8.success({ text: `Checked ${results.length} server(s)` });
|
|
6812
|
+
const display = args.outdated ? results.filter((r) => r.hasUpdate) : results;
|
|
6813
|
+
if (args.json) {
|
|
6814
|
+
console.log(JSON.stringify(display, null, 2));
|
|
6815
|
+
return;
|
|
6816
|
+
}
|
|
6817
|
+
printTable(display);
|
|
6818
|
+
if (outdatedCount === 0) {
|
|
6819
|
+
console.log(import_picocolors23.default.green(" All servers are up to date."));
|
|
6820
|
+
} else {
|
|
6821
|
+
console.log(
|
|
6822
|
+
import_picocolors23.default.yellow(` ${outdatedCount} server(s) have updates available.`) + import_picocolors23.default.dim(" Run mcpman update to apply.")
|
|
6823
|
+
);
|
|
6824
|
+
}
|
|
6825
|
+
console.log();
|
|
6826
|
+
}
|
|
6827
|
+
});
|
|
6828
|
+
|
|
6456
6829
|
// src/commands/pin.ts
|
|
6457
6830
|
init_cjs_shims();
|
|
6458
|
-
var
|
|
6459
|
-
var
|
|
6831
|
+
var import_citty25 = require("citty");
|
|
6832
|
+
var import_picocolors24 = __toESM(require("picocolors"), 1);
|
|
6460
6833
|
init_lockfile();
|
|
6461
|
-
var pin_default = (0,
|
|
6834
|
+
var pin_default = (0, import_citty25.defineCommand)({
|
|
6462
6835
|
meta: {
|
|
6463
6836
|
name: "pin",
|
|
6464
6837
|
description: "Pin a server to a specific version"
|
|
@@ -6489,33 +6862,33 @@ var pin_default = (0, import_citty22.defineCommand)({
|
|
|
6489
6862
|
if (args.list) {
|
|
6490
6863
|
const pins = listPins();
|
|
6491
6864
|
if (pins.length === 0) {
|
|
6492
|
-
console.log(
|
|
6865
|
+
console.log(import_picocolors24.default.dim("No servers are pinned."));
|
|
6493
6866
|
return;
|
|
6494
6867
|
}
|
|
6495
6868
|
console.log(`
|
|
6496
|
-
${
|
|
6869
|
+
${import_picocolors24.default.bold("Pinned servers")}
|
|
6497
6870
|
`);
|
|
6498
6871
|
for (const { server, version: version2 } of pins) {
|
|
6499
|
-
console.log(` ${
|
|
6872
|
+
console.log(` ${import_picocolors24.default.cyan(import_picocolors24.default.bold(server))} ${import_picocolors24.default.dim("@")}${import_picocolors24.default.green(version2)}`);
|
|
6500
6873
|
}
|
|
6501
6874
|
console.log("");
|
|
6502
6875
|
return;
|
|
6503
6876
|
}
|
|
6504
6877
|
if (args.unpin) {
|
|
6505
6878
|
if (!args.server) {
|
|
6506
|
-
console.error(`${
|
|
6879
|
+
console.error(`${import_picocolors24.default.red("\u2717")} Specify a server name to unpin.`);
|
|
6507
6880
|
process.exit(1);
|
|
6508
6881
|
}
|
|
6509
6882
|
if (!isPinned(args.server)) {
|
|
6510
|
-
console.log(
|
|
6883
|
+
console.log(import_picocolors24.default.dim(`"${args.server}" is not pinned.`));
|
|
6511
6884
|
return;
|
|
6512
6885
|
}
|
|
6513
6886
|
unpinServer(args.server);
|
|
6514
|
-
console.log(`${
|
|
6887
|
+
console.log(`${import_picocolors24.default.green("\u2713")} Unpinned ${import_picocolors24.default.cyan(args.server)}`);
|
|
6515
6888
|
return;
|
|
6516
6889
|
}
|
|
6517
6890
|
if (!args.server) {
|
|
6518
|
-
console.error(`${
|
|
6891
|
+
console.error(`${import_picocolors24.default.red("\u2717")} Specify a server name to pin. Use --list to see pins.`);
|
|
6519
6892
|
process.exit(1);
|
|
6520
6893
|
}
|
|
6521
6894
|
let version = args.version;
|
|
@@ -6524,7 +6897,7 @@ var pin_default = (0, import_citty22.defineCommand)({
|
|
|
6524
6897
|
version = lockfile.servers[args.server]?.version;
|
|
6525
6898
|
if (!version) {
|
|
6526
6899
|
console.error(
|
|
6527
|
-
`${
|
|
6900
|
+
`${import_picocolors24.default.red("\u2717")} "${args.server}" not found in lockfile. Specify a version explicitly.`
|
|
6528
6901
|
);
|
|
6529
6902
|
process.exit(1);
|
|
6530
6903
|
}
|
|
@@ -6533,21 +6906,21 @@ var pin_default = (0, import_citty22.defineCommand)({
|
|
|
6533
6906
|
pinServer(args.server, version);
|
|
6534
6907
|
if (prev && prev !== version) {
|
|
6535
6908
|
console.log(
|
|
6536
|
-
`${
|
|
6909
|
+
`${import_picocolors24.default.green("\u2713")} Re-pinned ${import_picocolors24.default.cyan(args.server)} ${import_picocolors24.default.dim(prev)} \u2192 ${import_picocolors24.default.green(version)}`
|
|
6537
6910
|
);
|
|
6538
6911
|
} else {
|
|
6539
|
-
console.log(`${
|
|
6912
|
+
console.log(`${import_picocolors24.default.green("\u2713")} Pinned ${import_picocolors24.default.cyan(args.server)} @ ${import_picocolors24.default.green(version)}`);
|
|
6540
6913
|
}
|
|
6541
|
-
console.log(
|
|
6914
|
+
console.log(import_picocolors24.default.dim(" Update notifications will be suppressed for this server."));
|
|
6542
6915
|
}
|
|
6543
6916
|
});
|
|
6544
6917
|
|
|
6545
6918
|
// src/commands/plugin.ts
|
|
6546
6919
|
init_cjs_shims();
|
|
6547
|
-
var
|
|
6548
|
-
var
|
|
6549
|
-
var
|
|
6550
|
-
var addCommand = (0,
|
|
6920
|
+
var import_citty26 = require("citty");
|
|
6921
|
+
var import_nanospinner5 = require("nanospinner");
|
|
6922
|
+
var import_picocolors25 = __toESM(require("picocolors"), 1);
|
|
6923
|
+
var addCommand = (0, import_citty26.defineCommand)({
|
|
6551
6924
|
meta: { name: "add", description: "Install a plugin package" },
|
|
6552
6925
|
args: {
|
|
6553
6926
|
package: {
|
|
@@ -6558,30 +6931,30 @@ var addCommand = (0, import_citty23.defineCommand)({
|
|
|
6558
6931
|
},
|
|
6559
6932
|
async run({ args }) {
|
|
6560
6933
|
const pkg = args.package;
|
|
6561
|
-
const
|
|
6934
|
+
const spinner8 = (0, import_nanospinner5.createSpinner)(`Installing plugin ${pkg}...`).start();
|
|
6562
6935
|
try {
|
|
6563
6936
|
installPluginPackage(pkg);
|
|
6564
6937
|
const loaded = loadPlugin(pkg);
|
|
6565
|
-
|
|
6938
|
+
spinner8.stop();
|
|
6566
6939
|
if (loaded) {
|
|
6567
6940
|
console.log(
|
|
6568
|
-
`${
|
|
6941
|
+
`${import_picocolors25.default.green("\u2713")} Plugin ${import_picocolors25.default.bold(loaded.name)} installed (prefix: ${import_picocolors25.default.cyan(loaded.prefix)})`
|
|
6569
6942
|
);
|
|
6570
6943
|
} else {
|
|
6571
6944
|
console.log(
|
|
6572
|
-
`${
|
|
6945
|
+
`${import_picocolors25.default.yellow("\u26A0")} Package ${import_picocolors25.default.bold(pkg)} installed but does not export a valid mcpman plugin.`
|
|
6573
6946
|
);
|
|
6574
6947
|
}
|
|
6575
6948
|
} catch (err) {
|
|
6576
|
-
|
|
6949
|
+
spinner8.stop();
|
|
6577
6950
|
console.error(
|
|
6578
|
-
`${
|
|
6951
|
+
`${import_picocolors25.default.red("\u2717")} Failed to install plugin: ${err instanceof Error ? err.message : String(err)}`
|
|
6579
6952
|
);
|
|
6580
6953
|
process.exit(1);
|
|
6581
6954
|
}
|
|
6582
6955
|
}
|
|
6583
6956
|
});
|
|
6584
|
-
var removeCommand = (0,
|
|
6957
|
+
var removeCommand = (0, import_citty26.defineCommand)({
|
|
6585
6958
|
meta: { name: "remove", description: "Uninstall a plugin package" },
|
|
6586
6959
|
args: {
|
|
6587
6960
|
package: {
|
|
@@ -6594,46 +6967,46 @@ var removeCommand = (0, import_citty23.defineCommand)({
|
|
|
6594
6967
|
const pkg = args.package;
|
|
6595
6968
|
const installed = listPluginPackages();
|
|
6596
6969
|
if (!installed.includes(pkg)) {
|
|
6597
|
-
console.log(
|
|
6970
|
+
console.log(import_picocolors25.default.dim(`Plugin "${pkg}" is not installed.`));
|
|
6598
6971
|
return;
|
|
6599
6972
|
}
|
|
6600
6973
|
try {
|
|
6601
6974
|
removePluginPackage(pkg);
|
|
6602
|
-
console.log(`${
|
|
6975
|
+
console.log(`${import_picocolors25.default.green("\u2713")} Plugin ${import_picocolors25.default.bold(pkg)} removed.`);
|
|
6603
6976
|
} catch (err) {
|
|
6604
6977
|
console.error(
|
|
6605
|
-
`${
|
|
6978
|
+
`${import_picocolors25.default.red("\u2717")} Failed to remove plugin: ${err instanceof Error ? err.message : String(err)}`
|
|
6606
6979
|
);
|
|
6607
6980
|
process.exit(1);
|
|
6608
6981
|
}
|
|
6609
6982
|
}
|
|
6610
6983
|
});
|
|
6611
|
-
var listCommand3 = (0,
|
|
6984
|
+
var listCommand3 = (0, import_citty26.defineCommand)({
|
|
6612
6985
|
meta: { name: "list", description: "List installed plugins" },
|
|
6613
6986
|
run() {
|
|
6614
6987
|
const packages = listPluginPackages();
|
|
6615
6988
|
if (packages.length === 0) {
|
|
6616
|
-
console.log(
|
|
6989
|
+
console.log(import_picocolors25.default.dim("No plugins installed. Use `mcpman plugin add <package>`."));
|
|
6617
6990
|
return;
|
|
6618
6991
|
}
|
|
6619
6992
|
console.log("");
|
|
6620
|
-
console.log(
|
|
6993
|
+
console.log(import_picocolors25.default.bold("Installed plugins:"));
|
|
6621
6994
|
console.log("");
|
|
6622
6995
|
for (const pkg of packages) {
|
|
6623
6996
|
const loaded = loadPlugin(pkg);
|
|
6624
6997
|
if (loaded) {
|
|
6625
6998
|
console.log(
|
|
6626
|
-
` ${
|
|
6999
|
+
` ${import_picocolors25.default.green("\u25CF")} ${import_picocolors25.default.bold(loaded.name)} prefix: ${import_picocolors25.default.cyan(loaded.prefix)} pkg: ${import_picocolors25.default.dim(pkg)}`
|
|
6627
7000
|
);
|
|
6628
7001
|
} else {
|
|
6629
|
-
console.log(` ${
|
|
7002
|
+
console.log(` ${import_picocolors25.default.yellow("\u25CF")} ${import_picocolors25.default.dim(pkg)} ${import_picocolors25.default.yellow("(failed to load)")}`);
|
|
6630
7003
|
}
|
|
6631
7004
|
}
|
|
6632
7005
|
console.log("");
|
|
6633
|
-
console.log(
|
|
7006
|
+
console.log(import_picocolors25.default.dim(` ${packages.length} plugin${packages.length !== 1 ? "s" : ""} installed`));
|
|
6634
7007
|
}
|
|
6635
7008
|
});
|
|
6636
|
-
var plugin_default = (0,
|
|
7009
|
+
var plugin_default = (0, import_citty26.defineCommand)({
|
|
6637
7010
|
meta: {
|
|
6638
7011
|
name: "plugin",
|
|
6639
7012
|
description: "Manage mcpman plugins for custom registries"
|
|
@@ -6647,8 +7020,8 @@ var plugin_default = (0, import_citty23.defineCommand)({
|
|
|
6647
7020
|
|
|
6648
7021
|
// src/commands/profiles.ts
|
|
6649
7022
|
init_cjs_shims();
|
|
6650
|
-
var
|
|
6651
|
-
var
|
|
7023
|
+
var import_citty27 = require("citty");
|
|
7024
|
+
var import_picocolors26 = __toESM(require("picocolors"), 1);
|
|
6652
7025
|
init_lockfile();
|
|
6653
7026
|
|
|
6654
7027
|
// src/core/profile-service.ts
|
|
@@ -6711,7 +7084,7 @@ function deleteProfile(name, dir = getProfilesDir()) {
|
|
|
6711
7084
|
}
|
|
6712
7085
|
|
|
6713
7086
|
// src/commands/profiles.ts
|
|
6714
|
-
var profiles_default = (0,
|
|
7087
|
+
var profiles_default = (0, import_citty27.defineCommand)({
|
|
6715
7088
|
meta: {
|
|
6716
7089
|
name: "profiles",
|
|
6717
7090
|
description: "Manage named server configuration profiles"
|
|
@@ -6740,16 +7113,16 @@ var profiles_default = (0, import_citty24.defineCommand)({
|
|
|
6740
7113
|
case "create": {
|
|
6741
7114
|
if (!name) {
|
|
6742
7115
|
console.error(
|
|
6743
|
-
|
|
7116
|
+
import_picocolors26.default.red(" Error: Profile name required. Usage: mcpman profiles create <name>")
|
|
6744
7117
|
);
|
|
6745
7118
|
process.exit(1);
|
|
6746
7119
|
}
|
|
6747
7120
|
try {
|
|
6748
7121
|
const profile = createProfile(name, args.description ?? "");
|
|
6749
7122
|
const count = Object.keys(profile.servers).length;
|
|
6750
|
-
console.log(
|
|
7123
|
+
console.log(import_picocolors26.default.green(` \u2713 Profile '${name}' created with ${count} server(s).`));
|
|
6751
7124
|
} catch (err) {
|
|
6752
|
-
console.error(
|
|
7125
|
+
console.error(import_picocolors26.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
6753
7126
|
process.exit(1);
|
|
6754
7127
|
}
|
|
6755
7128
|
break;
|
|
@@ -6757,38 +7130,38 @@ var profiles_default = (0, import_citty24.defineCommand)({
|
|
|
6757
7130
|
case "switch": {
|
|
6758
7131
|
if (!name) {
|
|
6759
7132
|
console.error(
|
|
6760
|
-
|
|
7133
|
+
import_picocolors26.default.red(" Error: Profile name required. Usage: mcpman profiles switch <name>")
|
|
6761
7134
|
);
|
|
6762
7135
|
process.exit(1);
|
|
6763
7136
|
}
|
|
6764
7137
|
const profile = loadProfile(name);
|
|
6765
7138
|
if (!profile) {
|
|
6766
|
-
console.error(
|
|
7139
|
+
console.error(import_picocolors26.default.red(` Error: Profile '${name}' not found.`));
|
|
6767
7140
|
process.exit(1);
|
|
6768
7141
|
}
|
|
6769
7142
|
const lockData = { lockfileVersion: 1, servers: profile.servers };
|
|
6770
7143
|
writeLockfile(lockData);
|
|
6771
7144
|
const count = Object.keys(profile.servers).length;
|
|
6772
|
-
console.log(
|
|
6773
|
-
console.log(
|
|
7145
|
+
console.log(import_picocolors26.default.green(` \u2713 Switched to profile '${name}' (${count} servers).`));
|
|
7146
|
+
console.log(import_picocolors26.default.dim(" Run mcpman sync to apply to all clients."));
|
|
6774
7147
|
break;
|
|
6775
7148
|
}
|
|
6776
7149
|
case "list": {
|
|
6777
7150
|
const profiles = listProfiles();
|
|
6778
7151
|
if (profiles.length === 0) {
|
|
6779
7152
|
console.log(
|
|
6780
|
-
|
|
7153
|
+
import_picocolors26.default.dim(" No profiles saved. Create one with: mcpman profiles create <name>")
|
|
6781
7154
|
);
|
|
6782
7155
|
return;
|
|
6783
7156
|
}
|
|
6784
|
-
console.log(
|
|
7157
|
+
console.log(import_picocolors26.default.bold(`
|
|
6785
7158
|
Profiles (${profiles.length})
|
|
6786
7159
|
`));
|
|
6787
|
-
for (const
|
|
6788
|
-
const count = Object.keys(
|
|
6789
|
-
const desc =
|
|
7160
|
+
for (const p19 of profiles) {
|
|
7161
|
+
const count = Object.keys(p19.servers).length;
|
|
7162
|
+
const desc = p19.description ? import_picocolors26.default.dim(` \u2014 ${p19.description}`) : "";
|
|
6790
7163
|
console.log(
|
|
6791
|
-
` ${
|
|
7164
|
+
` ${import_picocolors26.default.cyan("\u25CF")} ${import_picocolors26.default.bold(p19.name)} ${import_picocolors26.default.dim(`${count} server(s)`)}${desc}`
|
|
6792
7165
|
);
|
|
6793
7166
|
}
|
|
6794
7167
|
console.log();
|
|
@@ -6797,22 +7170,22 @@ var profiles_default = (0, import_citty24.defineCommand)({
|
|
|
6797
7170
|
case "delete": {
|
|
6798
7171
|
if (!name) {
|
|
6799
7172
|
console.error(
|
|
6800
|
-
|
|
7173
|
+
import_picocolors26.default.red(" Error: Profile name required. Usage: mcpman profiles delete <name>")
|
|
6801
7174
|
);
|
|
6802
7175
|
process.exit(1);
|
|
6803
7176
|
}
|
|
6804
7177
|
const deleted = deleteProfile(name);
|
|
6805
7178
|
if (deleted) {
|
|
6806
|
-
console.log(
|
|
7179
|
+
console.log(import_picocolors26.default.green(` \u2713 Profile '${name}' deleted.`));
|
|
6807
7180
|
} else {
|
|
6808
|
-
console.error(
|
|
7181
|
+
console.error(import_picocolors26.default.red(` Error: Profile '${name}' not found.`));
|
|
6809
7182
|
process.exit(1);
|
|
6810
7183
|
}
|
|
6811
7184
|
break;
|
|
6812
7185
|
}
|
|
6813
7186
|
default:
|
|
6814
7187
|
console.error(
|
|
6815
|
-
|
|
7188
|
+
import_picocolors26.default.red(` Unknown action '${action}'. Use: create, switch, list, or delete.`)
|
|
6816
7189
|
);
|
|
6817
7190
|
process.exit(1);
|
|
6818
7191
|
}
|
|
@@ -6821,8 +7194,8 @@ var profiles_default = (0, import_citty24.defineCommand)({
|
|
|
6821
7194
|
|
|
6822
7195
|
// src/commands/publish.ts
|
|
6823
7196
|
init_cjs_shims();
|
|
6824
|
-
var
|
|
6825
|
-
var
|
|
7197
|
+
var p11 = __toESM(require("@clack/prompts"), 1);
|
|
7198
|
+
var import_citty28 = require("citty");
|
|
6826
7199
|
|
|
6827
7200
|
// src/core/publish-service.ts
|
|
6828
7201
|
init_cjs_shims();
|
|
@@ -6901,7 +7274,7 @@ async function publishPackage(manifest, token) {
|
|
|
6901
7274
|
}
|
|
6902
7275
|
|
|
6903
7276
|
// src/commands/publish.ts
|
|
6904
|
-
var publish_default = (0,
|
|
7277
|
+
var publish_default = (0, import_citty28.defineCommand)({
|
|
6905
7278
|
meta: {
|
|
6906
7279
|
name: "publish",
|
|
6907
7280
|
description: "Publish current package to the mcpman registry"
|
|
@@ -6918,45 +7291,45 @@ var publish_default = (0, import_citty25.defineCommand)({
|
|
|
6918
7291
|
}
|
|
6919
7292
|
},
|
|
6920
7293
|
async run({ args }) {
|
|
6921
|
-
|
|
7294
|
+
p11.intro("mcpman publish");
|
|
6922
7295
|
let manifest;
|
|
6923
7296
|
try {
|
|
6924
7297
|
manifest = readPackageManifest();
|
|
6925
7298
|
} catch (err) {
|
|
6926
|
-
|
|
7299
|
+
p11.log.error(err instanceof Error ? err.message : String(err));
|
|
6927
7300
|
process.exit(1);
|
|
6928
7301
|
}
|
|
6929
7302
|
const { valid, errors } = validateManifest(manifest);
|
|
6930
7303
|
if (!valid) {
|
|
6931
|
-
|
|
7304
|
+
p11.log.error("Manifest validation failed:");
|
|
6932
7305
|
for (const e of errors) {
|
|
6933
|
-
|
|
7306
|
+
p11.log.warn(` - ${e}`);
|
|
6934
7307
|
}
|
|
6935
7308
|
process.exit(1);
|
|
6936
7309
|
}
|
|
6937
|
-
|
|
7310
|
+
p11.log.info(`Package: ${manifest.name}@${manifest.version} (${manifest.type})`);
|
|
6938
7311
|
if (args["dry-run"]) {
|
|
6939
|
-
|
|
7312
|
+
p11.outro("Dry run complete \u2014 manifest is valid.");
|
|
6940
7313
|
return;
|
|
6941
7314
|
}
|
|
6942
|
-
const token = args.token ?? process.env.MCPMAN_TOKEN ?? await
|
|
7315
|
+
const token = args.token ?? process.env.MCPMAN_TOKEN ?? await p11.text({
|
|
6943
7316
|
message: "mcpman registry token:",
|
|
6944
7317
|
validate: (v) => v ? void 0 : "Token is required"
|
|
6945
7318
|
});
|
|
6946
|
-
if (
|
|
6947
|
-
|
|
7319
|
+
if (p11.isCancel(token)) {
|
|
7320
|
+
p11.outro("Cancelled.");
|
|
6948
7321
|
process.exit(0);
|
|
6949
7322
|
}
|
|
6950
|
-
const
|
|
6951
|
-
|
|
7323
|
+
const spinner8 = p11.spinner();
|
|
7324
|
+
spinner8.start("Publishing...");
|
|
6952
7325
|
try {
|
|
6953
7326
|
const result = await publishPackage(manifest, token);
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
7327
|
+
spinner8.stop("Published");
|
|
7328
|
+
p11.log.success(`${result.name}@${result.version} \u2192 ${result.url}`);
|
|
7329
|
+
p11.outro("Done.");
|
|
6957
7330
|
} catch (err) {
|
|
6958
|
-
|
|
6959
|
-
|
|
7331
|
+
spinner8.stop("Publish failed");
|
|
7332
|
+
p11.log.error(err instanceof Error ? err.message : String(err));
|
|
6960
7333
|
process.exit(1);
|
|
6961
7334
|
}
|
|
6962
7335
|
}
|
|
@@ -6964,8 +7337,8 @@ var publish_default = (0, import_citty25.defineCommand)({
|
|
|
6964
7337
|
|
|
6965
7338
|
// src/commands/registry.ts
|
|
6966
7339
|
init_cjs_shims();
|
|
6967
|
-
var
|
|
6968
|
-
var
|
|
7340
|
+
var import_citty29 = require("citty");
|
|
7341
|
+
var import_picocolors27 = __toESM(require("picocolors"), 1);
|
|
6969
7342
|
|
|
6970
7343
|
// src/core/registry-manager.ts
|
|
6971
7344
|
init_cjs_shims();
|
|
@@ -7037,7 +7410,7 @@ function getDefaultRegistry(configPath) {
|
|
|
7037
7410
|
}
|
|
7038
7411
|
|
|
7039
7412
|
// src/commands/registry.ts
|
|
7040
|
-
var registry_default = (0,
|
|
7413
|
+
var registry_default = (0, import_citty29.defineCommand)({
|
|
7041
7414
|
meta: {
|
|
7042
7415
|
name: "registry",
|
|
7043
7416
|
description: "Manage custom registry URLs"
|
|
@@ -7067,67 +7440,67 @@ var registry_default = (0, import_citty26.defineCommand)({
|
|
|
7067
7440
|
case "list": {
|
|
7068
7441
|
const registries = getRegistries();
|
|
7069
7442
|
const defaultName = getDefaultRegistry();
|
|
7070
|
-
console.log(
|
|
7443
|
+
console.log(import_picocolors27.default.bold("\n Registries\n"));
|
|
7071
7444
|
for (const r of registries) {
|
|
7072
7445
|
const isDefault = r.name === defaultName;
|
|
7073
|
-
const defaultTag = isDefault ?
|
|
7074
|
-
const builtinTag = r.builtin ?
|
|
7446
|
+
const defaultTag = isDefault ? import_picocolors27.default.green(" (default)") : "";
|
|
7447
|
+
const builtinTag = r.builtin ? import_picocolors27.default.dim(" [builtin]") : "";
|
|
7075
7448
|
console.log(
|
|
7076
|
-
` ${isDefault ?
|
|
7449
|
+
` ${isDefault ? import_picocolors27.default.green("\u25CF") : import_picocolors27.default.dim("\u25CB")} ${import_picocolors27.default.bold(r.name)}${defaultTag}${builtinTag}`
|
|
7077
7450
|
);
|
|
7078
|
-
console.log(` ${
|
|
7451
|
+
console.log(` ${import_picocolors27.default.dim(r.url)}`);
|
|
7079
7452
|
}
|
|
7080
7453
|
console.log();
|
|
7081
7454
|
break;
|
|
7082
7455
|
}
|
|
7083
7456
|
case "add": {
|
|
7084
7457
|
if (!name) {
|
|
7085
|
-
console.error(
|
|
7458
|
+
console.error(import_picocolors27.default.red(" Error: Usage: mcpman registry add <name> <url>"));
|
|
7086
7459
|
process.exit(1);
|
|
7087
7460
|
}
|
|
7088
7461
|
if (!url) {
|
|
7089
|
-
console.error(
|
|
7462
|
+
console.error(import_picocolors27.default.red(" Error: Usage: mcpman registry add <name> <url>"));
|
|
7090
7463
|
process.exit(1);
|
|
7091
7464
|
}
|
|
7092
7465
|
try {
|
|
7093
7466
|
addRegistry(name, url);
|
|
7094
|
-
console.log(
|
|
7467
|
+
console.log(import_picocolors27.default.green(` Added registry '${name}' \u2192 ${url}`));
|
|
7095
7468
|
} catch (err) {
|
|
7096
|
-
console.error(
|
|
7469
|
+
console.error(import_picocolors27.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
7097
7470
|
process.exit(1);
|
|
7098
7471
|
}
|
|
7099
7472
|
break;
|
|
7100
7473
|
}
|
|
7101
7474
|
case "remove": {
|
|
7102
7475
|
if (!name) {
|
|
7103
|
-
console.error(
|
|
7476
|
+
console.error(import_picocolors27.default.red(" Error: Usage: mcpman registry remove <name>"));
|
|
7104
7477
|
process.exit(1);
|
|
7105
7478
|
}
|
|
7106
7479
|
try {
|
|
7107
7480
|
removeRegistry(name);
|
|
7108
|
-
console.log(
|
|
7481
|
+
console.log(import_picocolors27.default.green(` Removed registry '${name}'.`));
|
|
7109
7482
|
} catch (err) {
|
|
7110
|
-
console.error(
|
|
7483
|
+
console.error(import_picocolors27.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
7111
7484
|
process.exit(1);
|
|
7112
7485
|
}
|
|
7113
7486
|
break;
|
|
7114
7487
|
}
|
|
7115
7488
|
case "set-default": {
|
|
7116
7489
|
if (!name) {
|
|
7117
|
-
console.error(
|
|
7490
|
+
console.error(import_picocolors27.default.red(" Error: Usage: mcpman registry set-default <name>"));
|
|
7118
7491
|
process.exit(1);
|
|
7119
7492
|
}
|
|
7120
7493
|
try {
|
|
7121
7494
|
setDefaultRegistry(name);
|
|
7122
|
-
console.log(
|
|
7495
|
+
console.log(import_picocolors27.default.green(` Default registry set to '${name}'.`));
|
|
7123
7496
|
} catch (err) {
|
|
7124
|
-
console.error(
|
|
7497
|
+
console.error(import_picocolors27.default.red(` Error: ${err instanceof Error ? err.message : String(err)}`));
|
|
7125
7498
|
process.exit(1);
|
|
7126
7499
|
}
|
|
7127
7500
|
break;
|
|
7128
7501
|
}
|
|
7129
7502
|
default:
|
|
7130
|
-
console.error(
|
|
7503
|
+
console.error(import_picocolors27.default.red(` Unknown action '${action}'. Use: list, add, remove, set-default.`));
|
|
7131
7504
|
process.exit(1);
|
|
7132
7505
|
}
|
|
7133
7506
|
}
|
|
@@ -7135,14 +7508,14 @@ var registry_default = (0, import_citty26.defineCommand)({
|
|
|
7135
7508
|
|
|
7136
7509
|
// src/commands/remove.ts
|
|
7137
7510
|
init_cjs_shims();
|
|
7138
|
-
var
|
|
7139
|
-
var
|
|
7140
|
-
var
|
|
7511
|
+
var p12 = __toESM(require("@clack/prompts"), 1);
|
|
7512
|
+
var import_citty30 = require("citty");
|
|
7513
|
+
var import_picocolors28 = __toESM(require("picocolors"), 1);
|
|
7141
7514
|
init_client_detector();
|
|
7142
7515
|
function clientDisplayName(type) {
|
|
7143
7516
|
return CLIENT_DISPLAY[type] ?? type;
|
|
7144
7517
|
}
|
|
7145
|
-
var remove_default = (0,
|
|
7518
|
+
var remove_default = (0, import_citty30.defineCommand)({
|
|
7146
7519
|
meta: {
|
|
7147
7520
|
name: "remove",
|
|
7148
7521
|
description: "Remove an MCP server from one or more AI clients"
|
|
@@ -7169,19 +7542,19 @@ var remove_default = (0, import_citty27.defineCommand)({
|
|
|
7169
7542
|
}
|
|
7170
7543
|
},
|
|
7171
7544
|
async run({ args }) {
|
|
7172
|
-
|
|
7545
|
+
p12.intro(import_picocolors28.default.bold("mcpman remove"));
|
|
7173
7546
|
const serverName = args.server;
|
|
7174
7547
|
const servers = await getInstalledServers();
|
|
7175
7548
|
const match = servers.find((s) => s.name === serverName);
|
|
7176
7549
|
if (!match) {
|
|
7177
|
-
|
|
7550
|
+
p12.log.warn(`Server "${serverName}" is not installed.`);
|
|
7178
7551
|
const similar = servers.filter(
|
|
7179
7552
|
(s) => s.name.includes(serverName) || serverName.includes(s.name)
|
|
7180
7553
|
);
|
|
7181
7554
|
if (similar.length > 0) {
|
|
7182
|
-
|
|
7555
|
+
p12.log.info(`Did you mean: ${similar.map((s) => import_picocolors28.default.cyan(s.name)).join(", ")}?`);
|
|
7183
7556
|
}
|
|
7184
|
-
|
|
7557
|
+
p12.outro("Nothing to remove.");
|
|
7185
7558
|
return;
|
|
7186
7559
|
}
|
|
7187
7560
|
let targetClients;
|
|
@@ -7189,15 +7562,15 @@ var remove_default = (0, import_citty27.defineCommand)({
|
|
|
7189
7562
|
targetClients = match.clients;
|
|
7190
7563
|
} else if (args.client) {
|
|
7191
7564
|
if (!match.clients.includes(args.client)) {
|
|
7192
|
-
|
|
7193
|
-
|
|
7565
|
+
p12.log.warn(`Server "${serverName}" is not installed in client "${args.client}".`);
|
|
7566
|
+
p12.outro("Nothing to remove.");
|
|
7194
7567
|
return;
|
|
7195
7568
|
}
|
|
7196
7569
|
targetClients = [args.client];
|
|
7197
7570
|
} else if (match.clients.length === 1) {
|
|
7198
7571
|
targetClients = match.clients;
|
|
7199
7572
|
} else {
|
|
7200
|
-
const selected = await
|
|
7573
|
+
const selected = await p12.multiselect({
|
|
7201
7574
|
message: `Remove "${serverName}" from which clients?`,
|
|
7202
7575
|
options: match.clients.map((c) => ({
|
|
7203
7576
|
value: c,
|
|
@@ -7205,19 +7578,19 @@ var remove_default = (0, import_citty27.defineCommand)({
|
|
|
7205
7578
|
})),
|
|
7206
7579
|
required: true
|
|
7207
7580
|
});
|
|
7208
|
-
if (
|
|
7209
|
-
|
|
7581
|
+
if (p12.isCancel(selected)) {
|
|
7582
|
+
p12.outro("Cancelled.");
|
|
7210
7583
|
process.exit(0);
|
|
7211
7584
|
}
|
|
7212
7585
|
targetClients = selected;
|
|
7213
7586
|
}
|
|
7214
7587
|
if (!args.yes) {
|
|
7215
7588
|
const clientNames = targetClients.map(clientDisplayName).join(", ");
|
|
7216
|
-
const confirmed = await
|
|
7217
|
-
message: `Remove ${
|
|
7589
|
+
const confirmed = await p12.confirm({
|
|
7590
|
+
message: `Remove ${import_picocolors28.default.cyan(serverName)} from ${import_picocolors28.default.yellow(clientNames)}?`
|
|
7218
7591
|
});
|
|
7219
|
-
if (
|
|
7220
|
-
|
|
7592
|
+
if (p12.isCancel(confirmed) || !confirmed) {
|
|
7593
|
+
p12.outro("Cancelled.");
|
|
7221
7594
|
return;
|
|
7222
7595
|
}
|
|
7223
7596
|
}
|
|
@@ -7231,25 +7604,25 @@ var remove_default = (0, import_citty27.defineCommand)({
|
|
|
7231
7604
|
}
|
|
7232
7605
|
try {
|
|
7233
7606
|
await handler.removeServer(serverName);
|
|
7234
|
-
|
|
7607
|
+
p12.log.success(`Removed from ${clientDisplayName(clientType)}`);
|
|
7235
7608
|
} catch (err) {
|
|
7236
7609
|
const msg = err instanceof Error ? err.message : String(err);
|
|
7237
7610
|
errors.push(`${clientDisplayName(clientType)}: ${msg}`);
|
|
7238
7611
|
}
|
|
7239
7612
|
}
|
|
7240
7613
|
if (errors.length > 0) {
|
|
7241
|
-
for (const e of errors)
|
|
7242
|
-
|
|
7614
|
+
for (const e of errors) p12.log.error(e);
|
|
7615
|
+
p12.outro(import_picocolors28.default.red("Completed with errors."));
|
|
7243
7616
|
process.exit(1);
|
|
7244
7617
|
}
|
|
7245
|
-
|
|
7618
|
+
p12.outro(import_picocolors28.default.green(`Removed "${serverName}" successfully.`));
|
|
7246
7619
|
}
|
|
7247
7620
|
});
|
|
7248
7621
|
|
|
7249
7622
|
// src/commands/replay.ts
|
|
7250
7623
|
init_cjs_shims();
|
|
7251
|
-
var
|
|
7252
|
-
var
|
|
7624
|
+
var import_citty31 = require("citty");
|
|
7625
|
+
var import_picocolors29 = __toESM(require("picocolors"), 1);
|
|
7253
7626
|
|
|
7254
7627
|
// src/core/history-service.ts
|
|
7255
7628
|
init_cjs_shims();
|
|
@@ -7284,7 +7657,7 @@ function replayCommand(index, file) {
|
|
|
7284
7657
|
}
|
|
7285
7658
|
|
|
7286
7659
|
// src/commands/replay.ts
|
|
7287
|
-
var replay_default = (0,
|
|
7660
|
+
var replay_default = (0, import_citty31.defineCommand)({
|
|
7288
7661
|
meta: {
|
|
7289
7662
|
name: "replay",
|
|
7290
7663
|
description: "Replay a previous mcpman command from history"
|
|
@@ -7305,27 +7678,27 @@ var replay_default = (0, import_citty28.defineCommand)({
|
|
|
7305
7678
|
const history = getHistory();
|
|
7306
7679
|
if (args.list || args.index === void 0) {
|
|
7307
7680
|
if (history.length === 0) {
|
|
7308
|
-
console.log(
|
|
7681
|
+
console.log(import_picocolors29.default.dim("\n No command history found.\n"));
|
|
7309
7682
|
return;
|
|
7310
7683
|
}
|
|
7311
7684
|
const reversed2 = [...history].reverse().slice(0, 20);
|
|
7312
|
-
console.log(
|
|
7313
|
-
console.log(
|
|
7685
|
+
console.log(import_picocolors29.default.bold("\n mcpman history\n"));
|
|
7686
|
+
console.log(import_picocolors29.default.dim(` ${"\u2500".repeat(50)}`));
|
|
7314
7687
|
reversed2.forEach((entry2, i) => {
|
|
7315
7688
|
const cmdParts2 = [entry2.command, ...entry2.args].filter(Boolean).join(" ");
|
|
7316
7689
|
const ts = new Date(entry2.timestamp).toLocaleString();
|
|
7317
|
-
console.log(` ${
|
|
7690
|
+
console.log(` ${import_picocolors29.default.cyan(String(i).padStart(2))} ${import_picocolors29.default.bold(cmdParts2)} ${import_picocolors29.default.dim(ts)}`);
|
|
7318
7691
|
});
|
|
7319
|
-
console.log(
|
|
7692
|
+
console.log(import_picocolors29.default.dim(` ${"\u2500".repeat(50)}
|
|
7320
7693
|
`));
|
|
7321
7694
|
if (!args.list) {
|
|
7322
|
-
console.log(
|
|
7695
|
+
console.log(import_picocolors29.default.dim(" Usage: mcpman replay <index> | mcpman replay --list\n"));
|
|
7323
7696
|
}
|
|
7324
7697
|
return;
|
|
7325
7698
|
}
|
|
7326
7699
|
const idx = Number(args.index);
|
|
7327
7700
|
if (Number.isNaN(idx) || idx < 0) {
|
|
7328
|
-
console.error(
|
|
7701
|
+
console.error(import_picocolors29.default.red(`
|
|
7329
7702
|
Invalid index "${args.index}". Must be a non-negative number.
|
|
7330
7703
|
`));
|
|
7331
7704
|
process.exit(1);
|
|
@@ -7333,7 +7706,7 @@ var replay_default = (0, import_citty28.defineCommand)({
|
|
|
7333
7706
|
const reversed = [...history].reverse();
|
|
7334
7707
|
if (idx >= reversed.length) {
|
|
7335
7708
|
console.error(
|
|
7336
|
-
|
|
7709
|
+
import_picocolors29.default.red(`
|
|
7337
7710
|
Index ${idx} out of range. History has ${reversed.length} entries.
|
|
7338
7711
|
`)
|
|
7339
7712
|
);
|
|
@@ -7341,13 +7714,13 @@ var replay_default = (0, import_citty28.defineCommand)({
|
|
|
7341
7714
|
}
|
|
7342
7715
|
const entry = reversed[idx];
|
|
7343
7716
|
const cmdParts = [entry.command, ...entry.args].filter(Boolean).join(" ");
|
|
7344
|
-
console.log(
|
|
7717
|
+
console.log(import_picocolors29.default.cyan(`
|
|
7345
7718
|
Replaying: mcpman ${cmdParts}
|
|
7346
7719
|
`));
|
|
7347
7720
|
try {
|
|
7348
7721
|
replayCommand(idx);
|
|
7349
7722
|
} catch (err) {
|
|
7350
|
-
console.error(
|
|
7723
|
+
console.error(import_picocolors29.default.red(` ${String(err)}`));
|
|
7351
7724
|
process.exit(1);
|
|
7352
7725
|
}
|
|
7353
7726
|
}
|
|
@@ -7355,12 +7728,12 @@ var replay_default = (0, import_citty28.defineCommand)({
|
|
|
7355
7728
|
|
|
7356
7729
|
// src/commands/rollback.ts
|
|
7357
7730
|
init_cjs_shims();
|
|
7358
|
-
var
|
|
7359
|
-
var
|
|
7360
|
-
var
|
|
7731
|
+
var p13 = __toESM(require("@clack/prompts"), 1);
|
|
7732
|
+
var import_citty32 = require("citty");
|
|
7733
|
+
var import_picocolors30 = __toESM(require("picocolors"), 1);
|
|
7361
7734
|
init_lockfile();
|
|
7362
7735
|
init_rollback_service();
|
|
7363
|
-
var rollback_default = (0,
|
|
7736
|
+
var rollback_default = (0, import_citty32.defineCommand)({
|
|
7364
7737
|
meta: {
|
|
7365
7738
|
name: "rollback",
|
|
7366
7739
|
description: "Restore a previous lockfile snapshot"
|
|
@@ -7387,19 +7760,19 @@ var rollback_default = (0, import_citty29.defineCommand)({
|
|
|
7387
7760
|
if (args.list || args.index === void 0) {
|
|
7388
7761
|
if (snapshots.length === 0) {
|
|
7389
7762
|
console.log(
|
|
7390
|
-
|
|
7763
|
+
import_picocolors30.default.dim("No snapshots available. Snapshots are created on each lockfile write.")
|
|
7391
7764
|
);
|
|
7392
7765
|
return;
|
|
7393
7766
|
}
|
|
7394
7767
|
console.log(
|
|
7395
7768
|
`
|
|
7396
|
-
${
|
|
7769
|
+
${import_picocolors30.default.bold("Lockfile snapshots")} ${import_picocolors30.default.dim(`(${snapshots.length} available, 0 = most recent)`)}
|
|
7397
7770
|
`
|
|
7398
7771
|
);
|
|
7399
7772
|
for (const snap2 of snapshots) {
|
|
7400
7773
|
const size = `${Math.ceil(snap2.sizeBytes / 1024)}KB`;
|
|
7401
7774
|
const date2 = snap2.createdAt ? new Date(snap2.createdAt).toLocaleString() : "unknown";
|
|
7402
|
-
console.log(` ${
|
|
7775
|
+
console.log(` ${import_picocolors30.default.cyan(`[${snap2.index}]`)} ${import_picocolors30.default.dim(date2)} ${import_picocolors30.default.dim(size)}`);
|
|
7403
7776
|
}
|
|
7404
7777
|
console.log("");
|
|
7405
7778
|
if (args.index === void 0) return;
|
|
@@ -7407,62 +7780,62 @@ var rollback_default = (0, import_citty29.defineCommand)({
|
|
|
7407
7780
|
const idx = Number.parseInt(String(args.index), 10);
|
|
7408
7781
|
if (Number.isNaN(idx) || idx < 0) {
|
|
7409
7782
|
console.error(
|
|
7410
|
-
`${
|
|
7783
|
+
`${import_picocolors30.default.red("\u2717")} Invalid index "${args.index}". Must be a non-negative integer.`
|
|
7411
7784
|
);
|
|
7412
7785
|
process.exit(1);
|
|
7413
7786
|
}
|
|
7414
7787
|
const snap = snapshots[idx];
|
|
7415
7788
|
if (!snap) {
|
|
7416
7789
|
console.error(
|
|
7417
|
-
`${
|
|
7790
|
+
`${import_picocolors30.default.red("\u2717")} Snapshot [${idx}] does not exist. Use --list to see available snapshots.`
|
|
7418
7791
|
);
|
|
7419
7792
|
process.exit(1);
|
|
7420
7793
|
}
|
|
7421
7794
|
const content = readSnapshot(idx);
|
|
7422
7795
|
if (!content) {
|
|
7423
|
-
console.error(`${
|
|
7796
|
+
console.error(`${import_picocolors30.default.red("\u2717")} Could not read snapshot [${idx}].`);
|
|
7424
7797
|
process.exit(1);
|
|
7425
7798
|
}
|
|
7426
7799
|
const date = snap.createdAt ? new Date(snap.createdAt).toLocaleString() : "unknown";
|
|
7427
7800
|
console.log(`
|
|
7428
|
-
${
|
|
7801
|
+
${import_picocolors30.default.bold("Restoring snapshot")} ${import_picocolors30.default.cyan(`[${idx}]`)} ${import_picocolors30.default.dim(date)}
|
|
7429
7802
|
`);
|
|
7430
7803
|
try {
|
|
7431
7804
|
const parsed = JSON.parse(content);
|
|
7432
7805
|
const count = Object.keys(parsed.servers ?? {}).length;
|
|
7433
|
-
console.log(` ${
|
|
7806
|
+
console.log(` ${import_picocolors30.default.dim(`Preview: ${count} server(s) in snapshot`)}
|
|
7434
7807
|
`);
|
|
7435
7808
|
} catch {
|
|
7436
7809
|
}
|
|
7437
7810
|
const lockfilePath = resolveLockfilePath();
|
|
7438
7811
|
if (!args.yes) {
|
|
7439
|
-
const confirmed = await
|
|
7812
|
+
const confirmed = await p13.confirm({
|
|
7440
7813
|
message: `Restore snapshot [${idx}] to ${lockfilePath}?`,
|
|
7441
7814
|
initialValue: false
|
|
7442
7815
|
});
|
|
7443
|
-
if (
|
|
7444
|
-
|
|
7816
|
+
if (p13.isCancel(confirmed) || !confirmed) {
|
|
7817
|
+
p13.cancel("Cancelled.");
|
|
7445
7818
|
return;
|
|
7446
7819
|
}
|
|
7447
7820
|
}
|
|
7448
7821
|
const restored = restoreSnapshot(idx, lockfilePath);
|
|
7449
7822
|
if (!restored) {
|
|
7450
|
-
console.error(`${
|
|
7823
|
+
console.error(`${import_picocolors30.default.red("\u2717")} Restore failed.`);
|
|
7451
7824
|
process.exit(1);
|
|
7452
7825
|
}
|
|
7453
7826
|
console.log(`
|
|
7454
|
-
${
|
|
7455
|
-
console.log(
|
|
7827
|
+
${import_picocolors30.default.green("\u2713")} Lockfile restored from snapshot [${idx}].`);
|
|
7828
|
+
console.log(import_picocolors30.default.dim(` Written to: ${lockfilePath}`));
|
|
7456
7829
|
}
|
|
7457
7830
|
});
|
|
7458
7831
|
|
|
7459
7832
|
// src/commands/run.ts
|
|
7460
7833
|
init_cjs_shims();
|
|
7461
7834
|
var import_node_child_process9 = require("child_process");
|
|
7462
|
-
var
|
|
7463
|
-
var
|
|
7835
|
+
var import_citty33 = require("citty");
|
|
7836
|
+
var import_picocolors31 = __toESM(require("picocolors"), 1);
|
|
7464
7837
|
init_lockfile();
|
|
7465
|
-
var run_default = (0,
|
|
7838
|
+
var run_default = (0, import_citty33.defineCommand)({
|
|
7466
7839
|
meta: {
|
|
7467
7840
|
name: "run",
|
|
7468
7841
|
description: "Run an installed MCP server with vault secrets injected"
|
|
@@ -7484,8 +7857,8 @@ var run_default = (0, import_citty30.defineCommand)({
|
|
|
7484
7857
|
const lockfile = readLockfile();
|
|
7485
7858
|
const entry = lockfile.servers[serverName];
|
|
7486
7859
|
if (!entry) {
|
|
7487
|
-
console.error(
|
|
7488
|
-
console.error(
|
|
7860
|
+
console.error(import_picocolors31.default.red(` Error: Server '${serverName}' is not installed.`));
|
|
7861
|
+
console.error(import_picocolors31.default.dim(` Run ${import_picocolors31.default.cyan("mcpman install <server>")} to install it first.`));
|
|
7489
7862
|
process.exit(1);
|
|
7490
7863
|
}
|
|
7491
7864
|
const lockfileEnv = parseEnvFlags(entry.envVars);
|
|
@@ -7497,7 +7870,7 @@ var run_default = (0, import_citty30.defineCommand)({
|
|
|
7497
7870
|
...vaultEnv,
|
|
7498
7871
|
...cliEnv
|
|
7499
7872
|
};
|
|
7500
|
-
console.log(
|
|
7873
|
+
console.log(import_picocolors31.default.dim(` Running ${import_picocolors31.default.cyan(serverName)}...`));
|
|
7501
7874
|
const child = (0, import_node_child_process9.spawn)(entry.command, entry.args, {
|
|
7502
7875
|
env: finalEnv,
|
|
7503
7876
|
stdio: "inherit"
|
|
@@ -7515,7 +7888,7 @@ var run_default = (0, import_citty30.defineCommand)({
|
|
|
7515
7888
|
resolve();
|
|
7516
7889
|
});
|
|
7517
7890
|
child.on("error", (err) => {
|
|
7518
|
-
console.error(
|
|
7891
|
+
console.error(import_picocolors31.default.red(` Failed to start '${serverName}': ${err.message}`));
|
|
7519
7892
|
process.exit(1);
|
|
7520
7893
|
resolve();
|
|
7521
7894
|
});
|
|
@@ -7525,9 +7898,9 @@ var run_default = (0, import_citty30.defineCommand)({
|
|
|
7525
7898
|
|
|
7526
7899
|
// src/commands/search.ts
|
|
7527
7900
|
init_cjs_shims();
|
|
7528
|
-
var
|
|
7529
|
-
var
|
|
7530
|
-
var
|
|
7901
|
+
var import_citty34 = require("citty");
|
|
7902
|
+
var import_nanospinner6 = require("nanospinner");
|
|
7903
|
+
var import_picocolors32 = __toESM(require("picocolors"), 1);
|
|
7531
7904
|
|
|
7532
7905
|
// src/core/registry-search.ts
|
|
7533
7906
|
init_cjs_shims();
|
|
@@ -7595,10 +7968,10 @@ async function searchPlugins(query, limit = 20) {
|
|
|
7595
7968
|
function highlightMatch(name, query) {
|
|
7596
7969
|
const idx = name.toLowerCase().indexOf(query.toLowerCase());
|
|
7597
7970
|
if (idx === -1) return name;
|
|
7598
|
-
return name.slice(0, idx) +
|
|
7971
|
+
return name.slice(0, idx) + import_picocolors32.default.yellow(name.slice(idx, idx + query.length)) + name.slice(idx + query.length);
|
|
7599
7972
|
}
|
|
7600
7973
|
function formatDownloads(n) {
|
|
7601
|
-
if (!n) return
|
|
7974
|
+
if (!n) return import_picocolors32.default.dim("\u2014");
|
|
7602
7975
|
if (n >= 1e6) return `${(n / 1e6).toFixed(1)}M`;
|
|
7603
7976
|
if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
|
|
7604
7977
|
return String(n);
|
|
@@ -7609,9 +7982,9 @@ function printNpmResults(results, query) {
|
|
|
7609
7982
|
const dlWidth = 9;
|
|
7610
7983
|
const descMax = 50;
|
|
7611
7984
|
const header = ` ${pad("NAME", nameWidth)} ${pad("VERSION", verWidth)} ${pad("DOWNLOADS", dlWidth)} DESCRIPTION`;
|
|
7612
|
-
console.log(
|
|
7985
|
+
console.log(import_picocolors32.default.dim(header));
|
|
7613
7986
|
console.log(
|
|
7614
|
-
|
|
7987
|
+
import_picocolors32.default.dim(
|
|
7615
7988
|
` ${"-".repeat(nameWidth)} ${"-".repeat(verWidth)} ${"-".repeat(dlWidth)} ${"-".repeat(descMax)}`
|
|
7616
7989
|
)
|
|
7617
7990
|
);
|
|
@@ -7619,8 +7992,8 @@ function printNpmResults(results, query) {
|
|
|
7619
7992
|
const name = highlightMatch(pad(r.name, nameWidth), query);
|
|
7620
7993
|
const ver = pad(r.version, verWidth);
|
|
7621
7994
|
const dl = pad(formatDownloads(r.downloads), dlWidth);
|
|
7622
|
-
const desc = truncate(r.description ||
|
|
7623
|
-
console.log(` ${name} ${
|
|
7995
|
+
const desc = truncate(r.description || import_picocolors32.default.dim("(no description)"), descMax);
|
|
7996
|
+
console.log(` ${name} ${import_picocolors32.default.dim(ver)} ${dl} ${desc}`);
|
|
7624
7997
|
}
|
|
7625
7998
|
}
|
|
7626
7999
|
function printSmitheryResults(results, query) {
|
|
@@ -7628,19 +8001,19 @@ function printSmitheryResults(results, query) {
|
|
|
7628
8001
|
const usesWidth = 8;
|
|
7629
8002
|
const descMax = 50;
|
|
7630
8003
|
const header = ` ${pad("NAME", nameWidth)} ${pad("USES", usesWidth)} DESCRIPTION`;
|
|
7631
|
-
console.log(
|
|
8004
|
+
console.log(import_picocolors32.default.dim(header));
|
|
7632
8005
|
console.log(
|
|
7633
|
-
|
|
8006
|
+
import_picocolors32.default.dim(` ${"-".repeat(nameWidth)} ${"-".repeat(usesWidth)} ${"-".repeat(descMax)}`)
|
|
7634
8007
|
);
|
|
7635
8008
|
for (const r of results) {
|
|
7636
8009
|
const name = highlightMatch(pad(r.name, nameWidth), query);
|
|
7637
8010
|
const uses = pad(formatDownloads(r.useCount), usesWidth);
|
|
7638
|
-
const badge = r.verified ?
|
|
7639
|
-
const desc = truncate(r.description ||
|
|
8011
|
+
const badge = r.verified ? import_picocolors32.default.green(" \u2713") : "";
|
|
8012
|
+
const desc = truncate(r.description || import_picocolors32.default.dim("(no description)"), descMax);
|
|
7640
8013
|
console.log(` ${name}${badge} ${uses} ${desc}`);
|
|
7641
8014
|
}
|
|
7642
8015
|
}
|
|
7643
|
-
var search_default = (0,
|
|
8016
|
+
var search_default = (0, import_citty34.defineCommand)({
|
|
7644
8017
|
meta: {
|
|
7645
8018
|
name: "search",
|
|
7646
8019
|
description: "Search for MCP servers on npm or Smithery registry"
|
|
@@ -7672,50 +8045,50 @@ var search_default = (0, import_citty31.defineCommand)({
|
|
|
7672
8045
|
const registry = args.registry.toLowerCase();
|
|
7673
8046
|
const limit = Math.min(Math.max(1, Number.parseInt(args.limit, 10) || 20), 100);
|
|
7674
8047
|
if (registry !== "npm" && registry !== "smithery") {
|
|
7675
|
-
console.error(
|
|
8048
|
+
console.error(import_picocolors32.default.red(` Unknown registry "${registry}". Use "npm" or "smithery".`));
|
|
7676
8049
|
process.exit(1);
|
|
7677
8050
|
}
|
|
7678
|
-
const
|
|
8051
|
+
const spinner8 = (0, import_nanospinner6.createSpinner)(`Searching ${registry} for "${query}"...`).start();
|
|
7679
8052
|
if (registry === "npm") {
|
|
7680
8053
|
const results2 = await searchNpm(query, limit);
|
|
7681
|
-
|
|
8054
|
+
spinner8.stop();
|
|
7682
8055
|
if (results2.length === 0) {
|
|
7683
|
-
console.log(
|
|
8056
|
+
console.log(import_picocolors32.default.dim(`
|
|
7684
8057
|
No results found for "${query}" on npm.
|
|
7685
8058
|
`));
|
|
7686
8059
|
return;
|
|
7687
8060
|
}
|
|
7688
8061
|
console.log(
|
|
7689
|
-
|
|
8062
|
+
import_picocolors32.default.bold(
|
|
7690
8063
|
`
|
|
7691
8064
|
mcpman search \u2014 npm (${results2.length} result${results2.length !== 1 ? "s" : ""})
|
|
7692
8065
|
`
|
|
7693
8066
|
)
|
|
7694
8067
|
);
|
|
7695
8068
|
printNpmResults(results2, query);
|
|
7696
|
-
console.log(
|
|
8069
|
+
console.log(import_picocolors32.default.dim("\n Install with: mcpman install <name>\n"));
|
|
7697
8070
|
if (args.all) {
|
|
7698
8071
|
await printPluginResults(query, limit);
|
|
7699
8072
|
}
|
|
7700
8073
|
return;
|
|
7701
8074
|
}
|
|
7702
8075
|
const results = await searchSmithery(query, limit);
|
|
7703
|
-
|
|
8076
|
+
spinner8.stop();
|
|
7704
8077
|
if (results.length === 0) {
|
|
7705
|
-
console.log(
|
|
8078
|
+
console.log(import_picocolors32.default.dim(`
|
|
7706
8079
|
No results found for "${query}" on Smithery.
|
|
7707
8080
|
`));
|
|
7708
8081
|
return;
|
|
7709
8082
|
}
|
|
7710
8083
|
console.log(
|
|
7711
|
-
|
|
8084
|
+
import_picocolors32.default.bold(
|
|
7712
8085
|
`
|
|
7713
8086
|
mcpman search \u2014 Smithery (${results.length} result${results.length !== 1 ? "s" : ""})
|
|
7714
8087
|
`
|
|
7715
8088
|
)
|
|
7716
8089
|
);
|
|
7717
8090
|
printSmitheryResults(results, query);
|
|
7718
|
-
console.log(
|
|
8091
|
+
console.log(import_picocolors32.default.dim("\n Install with: mcpman install <name>\n"));
|
|
7719
8092
|
if (args.all) {
|
|
7720
8093
|
await printPluginResults(query, limit);
|
|
7721
8094
|
}
|
|
@@ -7725,7 +8098,7 @@ async function printPluginResults(query, limit) {
|
|
|
7725
8098
|
const pluginResults = await searchPlugins(query, limit);
|
|
7726
8099
|
if (pluginResults.length === 0) return;
|
|
7727
8100
|
console.log(
|
|
7728
|
-
|
|
8101
|
+
import_picocolors32.default.bold(
|
|
7729
8102
|
`
|
|
7730
8103
|
Plugins (${pluginResults.length} result${pluginResults.length !== 1 ? "s" : ""})
|
|
7731
8104
|
`
|
|
@@ -7735,23 +8108,23 @@ async function printPluginResults(query, limit) {
|
|
|
7735
8108
|
const srcWidth = Math.max(6, ...pluginResults.map((r) => r.source.length));
|
|
7736
8109
|
const descMax = 50;
|
|
7737
8110
|
const header = ` ${pad("NAME", nameWidth)} ${pad("SOURCE", srcWidth)} DESCRIPTION`;
|
|
7738
|
-
console.log(
|
|
8111
|
+
console.log(import_picocolors32.default.dim(header));
|
|
7739
8112
|
console.log(
|
|
7740
|
-
|
|
8113
|
+
import_picocolors32.default.dim(` ${"-".repeat(nameWidth)} ${"-".repeat(srcWidth)} ${"-".repeat(descMax)}`)
|
|
7741
8114
|
);
|
|
7742
8115
|
for (const r of pluginResults) {
|
|
7743
8116
|
const name = highlightMatch(pad(r.name, nameWidth), query);
|
|
7744
8117
|
const src = pad(r.source, srcWidth);
|
|
7745
|
-
const desc = truncate(r.description ||
|
|
7746
|
-
console.log(` ${name} ${
|
|
8118
|
+
const desc = truncate(r.description || import_picocolors32.default.dim("(no description)"), descMax);
|
|
8119
|
+
console.log(` ${name} ${import_picocolors32.default.dim(src)} ${desc}`);
|
|
7747
8120
|
}
|
|
7748
8121
|
}
|
|
7749
8122
|
|
|
7750
8123
|
// src/commands/secrets.ts
|
|
7751
8124
|
init_cjs_shims();
|
|
7752
|
-
var
|
|
7753
|
-
var
|
|
7754
|
-
var
|
|
8125
|
+
var p14 = __toESM(require("@clack/prompts"), 1);
|
|
8126
|
+
var import_citty35 = require("citty");
|
|
8127
|
+
var import_picocolors33 = __toESM(require("picocolors"), 1);
|
|
7755
8128
|
init_vault_service();
|
|
7756
8129
|
function maskValue(value) {
|
|
7757
8130
|
if (value.length <= 8) return "***";
|
|
@@ -7762,7 +8135,7 @@ function parseKeyValue(input) {
|
|
|
7762
8135
|
if (idx <= 0) return null;
|
|
7763
8136
|
return { key: input.slice(0, idx), value: input.slice(idx + 1) };
|
|
7764
8137
|
}
|
|
7765
|
-
var setCommand2 = (0,
|
|
8138
|
+
var setCommand2 = (0, import_citty35.defineCommand)({
|
|
7766
8139
|
meta: { name: "set", description: "Store an encrypted secret for a server" },
|
|
7767
8140
|
args: {
|
|
7768
8141
|
server: {
|
|
@@ -7779,28 +8152,28 @@ var setCommand2 = (0, import_citty32.defineCommand)({
|
|
|
7779
8152
|
async run({ args }) {
|
|
7780
8153
|
const parsed = parseKeyValue(args.keyvalue);
|
|
7781
8154
|
if (!parsed) {
|
|
7782
|
-
console.error(`${
|
|
8155
|
+
console.error(`${import_picocolors33.default.red("\u2717")} Invalid format. Expected KEY=VALUE`);
|
|
7783
8156
|
process.exit(1);
|
|
7784
8157
|
}
|
|
7785
|
-
|
|
8158
|
+
p14.intro(import_picocolors33.default.cyan("mcpman secrets set"));
|
|
7786
8159
|
const isNew = listSecrets(args.server).length === 0 || !listSecrets(args.server)[0]?.keys.includes(parsed.key);
|
|
7787
8160
|
const vaultPath = (await Promise.resolve().then(() => (init_vault_service(), vault_service_exports))).getVaultPath();
|
|
7788
8161
|
const vaultExists = (await import("fs")).existsSync(vaultPath);
|
|
7789
8162
|
const password2 = await getMasterPassword(!vaultExists && isNew);
|
|
7790
|
-
const spin =
|
|
8163
|
+
const spin = p14.spinner();
|
|
7791
8164
|
spin.start("Encrypting secret...");
|
|
7792
8165
|
try {
|
|
7793
8166
|
setSecret(args.server, parsed.key, parsed.value, password2);
|
|
7794
|
-
spin.stop(`${
|
|
8167
|
+
spin.stop(`${import_picocolors33.default.green("\u2713")} Stored ${import_picocolors33.default.bold(parsed.key)} for ${import_picocolors33.default.cyan(args.server)}`);
|
|
7795
8168
|
} catch (err) {
|
|
7796
|
-
spin.stop(`${
|
|
7797
|
-
console.error(
|
|
8169
|
+
spin.stop(`${import_picocolors33.default.red("\u2717")} Failed to store secret`);
|
|
8170
|
+
console.error(import_picocolors33.default.dim(String(err)));
|
|
7798
8171
|
process.exit(1);
|
|
7799
8172
|
}
|
|
7800
|
-
|
|
8173
|
+
p14.outro(import_picocolors33.default.dim("Secret encrypted and saved to vault."));
|
|
7801
8174
|
}
|
|
7802
8175
|
});
|
|
7803
|
-
var listCommand4 = (0,
|
|
8176
|
+
var listCommand4 = (0, import_citty35.defineCommand)({
|
|
7804
8177
|
meta: { name: "list", description: "List secret keys stored in the vault" },
|
|
7805
8178
|
args: {
|
|
7806
8179
|
server: {
|
|
@@ -7812,27 +8185,27 @@ var listCommand4 = (0, import_citty32.defineCommand)({
|
|
|
7812
8185
|
async run({ args }) {
|
|
7813
8186
|
const results = listSecrets(args.server || void 0);
|
|
7814
8187
|
if (results.length === 0) {
|
|
7815
|
-
const filter = args.server ? ` for ${
|
|
7816
|
-
console.log(
|
|
8188
|
+
const filter = args.server ? ` for ${import_picocolors33.default.cyan(args.server)}` : "";
|
|
8189
|
+
console.log(import_picocolors33.default.dim(`No secrets stored${filter}.`));
|
|
7817
8190
|
return;
|
|
7818
8191
|
}
|
|
7819
8192
|
console.log("");
|
|
7820
8193
|
for (const { server, keys } of results) {
|
|
7821
|
-
console.log(
|
|
8194
|
+
console.log(import_picocolors33.default.bold(import_picocolors33.default.cyan(server)));
|
|
7822
8195
|
for (const key of keys) {
|
|
7823
|
-
console.log(` ${
|
|
8196
|
+
console.log(` ${import_picocolors33.default.green("\u25CF")} ${import_picocolors33.default.bold(key)} ${import_picocolors33.default.dim(maskValue("\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"))}`);
|
|
7824
8197
|
}
|
|
7825
8198
|
console.log("");
|
|
7826
8199
|
}
|
|
7827
8200
|
const total = results.reduce((n, r) => n + r.keys.length, 0);
|
|
7828
8201
|
console.log(
|
|
7829
|
-
|
|
8202
|
+
import_picocolors33.default.dim(
|
|
7830
8203
|
` ${total} secret${total !== 1 ? "s" : ""} in ${results.length} server${results.length !== 1 ? "s" : ""}`
|
|
7831
8204
|
)
|
|
7832
8205
|
);
|
|
7833
8206
|
}
|
|
7834
8207
|
});
|
|
7835
|
-
var removeCommand2 = (0,
|
|
8208
|
+
var removeCommand2 = (0, import_citty35.defineCommand)({
|
|
7836
8209
|
meta: { name: "remove", description: "Delete a secret from the vault" },
|
|
7837
8210
|
args: {
|
|
7838
8211
|
server: {
|
|
@@ -7847,25 +8220,25 @@ var removeCommand2 = (0, import_citty32.defineCommand)({
|
|
|
7847
8220
|
}
|
|
7848
8221
|
},
|
|
7849
8222
|
async run({ args }) {
|
|
7850
|
-
const confirmed = await
|
|
7851
|
-
message: `Remove ${
|
|
8223
|
+
const confirmed = await p14.confirm({
|
|
8224
|
+
message: `Remove ${import_picocolors33.default.bold(args.key)} from ${import_picocolors33.default.cyan(args.server)}?`,
|
|
7852
8225
|
initialValue: false
|
|
7853
8226
|
});
|
|
7854
|
-
if (
|
|
7855
|
-
|
|
8227
|
+
if (p14.isCancel(confirmed) || !confirmed) {
|
|
8228
|
+
p14.cancel("Cancelled.");
|
|
7856
8229
|
return;
|
|
7857
8230
|
}
|
|
7858
8231
|
try {
|
|
7859
8232
|
removeSecret(args.server, args.key);
|
|
7860
|
-
console.log(`${
|
|
8233
|
+
console.log(`${import_picocolors33.default.green("\u2713")} Removed ${import_picocolors33.default.bold(args.key)} from ${import_picocolors33.default.cyan(args.server)}`);
|
|
7861
8234
|
} catch (err) {
|
|
7862
|
-
console.error(`${
|
|
7863
|
-
console.error(
|
|
8235
|
+
console.error(`${import_picocolors33.default.red("\u2717")} Failed to remove secret`);
|
|
8236
|
+
console.error(import_picocolors33.default.dim(String(err)));
|
|
7864
8237
|
process.exit(1);
|
|
7865
8238
|
}
|
|
7866
8239
|
}
|
|
7867
8240
|
});
|
|
7868
|
-
var secrets_default = (0,
|
|
8241
|
+
var secrets_default = (0, import_citty35.defineCommand)({
|
|
7869
8242
|
meta: {
|
|
7870
8243
|
name: "secrets",
|
|
7871
8244
|
description: "Manage encrypted secrets for MCP servers"
|
|
@@ -7879,7 +8252,7 @@ var secrets_default = (0, import_citty32.defineCommand)({
|
|
|
7879
8252
|
|
|
7880
8253
|
// src/commands/serve.ts
|
|
7881
8254
|
init_cjs_shims();
|
|
7882
|
-
var
|
|
8255
|
+
var import_citty36 = require("citty");
|
|
7883
8256
|
|
|
7884
8257
|
// src/mcp-server/server.ts
|
|
7885
8258
|
init_cjs_shims();
|
|
@@ -8329,7 +8702,7 @@ async function startMcpServer() {
|
|
|
8329
8702
|
}
|
|
8330
8703
|
|
|
8331
8704
|
// src/commands/serve.ts
|
|
8332
|
-
var serve_default = (0,
|
|
8705
|
+
var serve_default = (0, import_citty36.defineCommand)({
|
|
8333
8706
|
meta: {
|
|
8334
8707
|
name: "serve",
|
|
8335
8708
|
description: "Start mcpman as an MCP server (stdio transport) for AI agent use"
|
|
@@ -8357,33 +8730,33 @@ var serve_default = (0, import_citty33.defineCommand)({
|
|
|
8357
8730
|
// src/commands/skill.ts
|
|
8358
8731
|
init_cjs_shims();
|
|
8359
8732
|
var import_node_fs27 = require("fs");
|
|
8360
|
-
var
|
|
8361
|
-
var
|
|
8362
|
-
var
|
|
8733
|
+
var p15 = __toESM(require("@clack/prompts"), 1);
|
|
8734
|
+
var import_citty37 = require("citty");
|
|
8735
|
+
var import_picocolors34 = __toESM(require("picocolors"), 1);
|
|
8363
8736
|
function printSkillTable(skills) {
|
|
8364
8737
|
const nameW = Math.max(4, ...skills.map((s) => s.spec.name.length));
|
|
8365
8738
|
const verW = Math.max(7, ...skills.map((s) => s.spec.version.length));
|
|
8366
8739
|
const descW = 40;
|
|
8367
8740
|
const header = [
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8741
|
+
import_picocolors34.default.bold("NAME".padEnd(nameW)),
|
|
8742
|
+
import_picocolors34.default.bold("VERSION".padEnd(verW)),
|
|
8743
|
+
import_picocolors34.default.bold("RULES".padEnd(5)),
|
|
8744
|
+
import_picocolors34.default.bold("DESCRIPTION".padEnd(descW))
|
|
8372
8745
|
].join(" ");
|
|
8373
8746
|
console.log(header);
|
|
8374
|
-
console.log(
|
|
8747
|
+
console.log(import_picocolors34.default.dim("\u2500".repeat(nameW + verW + 5 + descW + 6)));
|
|
8375
8748
|
for (const sk of skills) {
|
|
8376
8749
|
const desc = sk.spec.description ?? "";
|
|
8377
8750
|
const row = [
|
|
8378
|
-
|
|
8751
|
+
import_picocolors34.default.cyan(sk.spec.name.padEnd(nameW)),
|
|
8379
8752
|
sk.spec.version.padEnd(verW),
|
|
8380
8753
|
String(sk.spec.rules.length).padEnd(5),
|
|
8381
|
-
|
|
8754
|
+
import_picocolors34.default.dim(desc.length > descW ? `${desc.slice(0, descW - 1)}\u2026` : desc.padEnd(descW))
|
|
8382
8755
|
].join(" ");
|
|
8383
8756
|
console.log(row);
|
|
8384
8757
|
}
|
|
8385
8758
|
}
|
|
8386
|
-
var installCommand = (0,
|
|
8759
|
+
var installCommand = (0, import_citty37.defineCommand)({
|
|
8387
8760
|
meta: { name: "install", description: "Install a skill from a JSON spec file or npm package" },
|
|
8388
8761
|
args: {
|
|
8389
8762
|
source: {
|
|
@@ -8393,75 +8766,75 @@ var installCommand = (0, import_citty34.defineCommand)({
|
|
|
8393
8766
|
}
|
|
8394
8767
|
},
|
|
8395
8768
|
async run({ args }) {
|
|
8396
|
-
|
|
8769
|
+
p15.intro(import_picocolors34.default.cyan("mcpman skill install"));
|
|
8397
8770
|
let spec;
|
|
8398
8771
|
if ((0, import_node_fs27.existsSync)(args.source)) {
|
|
8399
|
-
const spin =
|
|
8772
|
+
const spin = p15.spinner();
|
|
8400
8773
|
spin.start(`Reading spec from ${args.source}...`);
|
|
8401
8774
|
try {
|
|
8402
8775
|
const raw = (0, import_node_fs27.readFileSync)(args.source, "utf8");
|
|
8403
8776
|
spec = JSON.parse(raw);
|
|
8404
|
-
spin.stop(`${
|
|
8777
|
+
spin.stop(`${import_picocolors34.default.green("\u2713")} Loaded spec: ${import_picocolors34.default.bold(spec.name)} v${spec.version}`);
|
|
8405
8778
|
} catch (err) {
|
|
8406
|
-
spin.stop(`${
|
|
8407
|
-
console.error(
|
|
8779
|
+
spin.stop(`${import_picocolors34.default.red("\u2717")} Failed to read spec`);
|
|
8780
|
+
console.error(import_picocolors34.default.dim(String(err)));
|
|
8408
8781
|
process.exit(1);
|
|
8409
8782
|
}
|
|
8410
8783
|
} else {
|
|
8411
|
-
const spin =
|
|
8412
|
-
spin.start(`Loading skill package ${
|
|
8784
|
+
const spin = p15.spinner();
|
|
8785
|
+
spin.start(`Loading skill package ${import_picocolors34.default.bold(args.source)}...`);
|
|
8413
8786
|
try {
|
|
8414
8787
|
const { createRequire: createRequire2 } = await import("module");
|
|
8415
8788
|
const req = createRequire2(importMetaUrl);
|
|
8416
8789
|
spec = req(`${args.source}/mcpman-skill.json`);
|
|
8417
|
-
spin.stop(`${
|
|
8790
|
+
spin.stop(`${import_picocolors34.default.green("\u2713")} Loaded spec: ${import_picocolors34.default.bold(spec.name)} v${spec.version}`);
|
|
8418
8791
|
} catch (err) {
|
|
8419
|
-
spin.stop(`${
|
|
8420
|
-
console.error(
|
|
8792
|
+
spin.stop(`${import_picocolors34.default.red("\u2717")} Could not load skill package "${args.source}"`);
|
|
8793
|
+
console.error(import_picocolors34.default.dim(String(err)));
|
|
8421
8794
|
process.exit(1);
|
|
8422
8795
|
}
|
|
8423
8796
|
}
|
|
8424
|
-
const installSpin =
|
|
8797
|
+
const installSpin = p15.spinner();
|
|
8425
8798
|
installSpin.start("Installing skill rules...");
|
|
8426
8799
|
try {
|
|
8427
8800
|
installSkill(spec);
|
|
8428
|
-
installSpin.stop(`${
|
|
8801
|
+
installSpin.stop(`${import_picocolors34.default.green("\u2713")} Skill ${import_picocolors34.default.bold(spec.name)} installed`);
|
|
8429
8802
|
} catch (err) {
|
|
8430
|
-
installSpin.stop(`${
|
|
8431
|
-
console.error(
|
|
8803
|
+
installSpin.stop(`${import_picocolors34.default.red("\u2717")} Failed to install skill`);
|
|
8804
|
+
console.error(import_picocolors34.default.dim(String(err)));
|
|
8432
8805
|
process.exit(1);
|
|
8433
8806
|
}
|
|
8434
8807
|
if (spec.mcp_servers && spec.mcp_servers.length > 0) {
|
|
8435
|
-
|
|
8808
|
+
p15.log.info(`Installing ${spec.mcp_servers.length} bundled MCP server(s)...`);
|
|
8436
8809
|
for (const server of spec.mcp_servers) {
|
|
8437
8810
|
try {
|
|
8438
8811
|
await installServer(server.name, { yes: true });
|
|
8439
|
-
|
|
8812
|
+
p15.log.step(`${import_picocolors34.default.green("\u2713")} Server: ${import_picocolors34.default.cyan(server.name)}`);
|
|
8440
8813
|
} catch (err) {
|
|
8441
|
-
|
|
8814
|
+
p15.log.warn(`${import_picocolors34.default.yellow("\u26A0")} Server ${server.name} failed: ${String(err)}`);
|
|
8442
8815
|
}
|
|
8443
8816
|
}
|
|
8444
8817
|
}
|
|
8445
|
-
|
|
8446
|
-
|
|
8818
|
+
p15.outro(
|
|
8819
|
+
import_picocolors34.default.dim(`Skill "${spec.name}" ready. Run 'mcpman skill sync' to push rules to clients.`)
|
|
8447
8820
|
);
|
|
8448
8821
|
}
|
|
8449
8822
|
});
|
|
8450
|
-
var listCommand5 = (0,
|
|
8823
|
+
var listCommand5 = (0, import_citty37.defineCommand)({
|
|
8451
8824
|
meta: { name: "list", description: "List installed skills" },
|
|
8452
8825
|
run() {
|
|
8453
8826
|
const skills = listSkills();
|
|
8454
8827
|
if (skills.length === 0) {
|
|
8455
|
-
console.log(
|
|
8828
|
+
console.log(import_picocolors34.default.dim("No skills installed. Use `mcpman skill install <path-or-package>`."));
|
|
8456
8829
|
return;
|
|
8457
8830
|
}
|
|
8458
8831
|
console.log("");
|
|
8459
8832
|
printSkillTable(skills);
|
|
8460
8833
|
console.log("");
|
|
8461
|
-
console.log(
|
|
8834
|
+
console.log(import_picocolors34.default.dim(` ${skills.length} skill${skills.length !== 1 ? "s" : ""} installed`));
|
|
8462
8835
|
}
|
|
8463
8836
|
});
|
|
8464
|
-
var removeCommand3 = (0,
|
|
8837
|
+
var removeCommand3 = (0, import_citty37.defineCommand)({
|
|
8465
8838
|
meta: { name: "remove", description: "Remove an installed skill" },
|
|
8466
8839
|
args: {
|
|
8467
8840
|
name: {
|
|
@@ -8471,30 +8844,30 @@ var removeCommand3 = (0, import_citty34.defineCommand)({
|
|
|
8471
8844
|
}
|
|
8472
8845
|
},
|
|
8473
8846
|
async run({ args }) {
|
|
8474
|
-
const confirmed = await
|
|
8475
|
-
message: `Remove skill ${
|
|
8847
|
+
const confirmed = await p15.confirm({
|
|
8848
|
+
message: `Remove skill ${import_picocolors34.default.bold(args.name)}?`,
|
|
8476
8849
|
initialValue: false
|
|
8477
8850
|
});
|
|
8478
|
-
if (
|
|
8479
|
-
|
|
8851
|
+
if (p15.isCancel(confirmed) || !confirmed) {
|
|
8852
|
+
p15.cancel("Cancelled.");
|
|
8480
8853
|
return;
|
|
8481
8854
|
}
|
|
8482
8855
|
try {
|
|
8483
8856
|
const removed = removeSkill(args.name);
|
|
8484
8857
|
if (!removed) {
|
|
8485
|
-
console.log(
|
|
8858
|
+
console.log(import_picocolors34.default.dim(`Skill "${args.name}" not found.`));
|
|
8486
8859
|
return;
|
|
8487
8860
|
}
|
|
8488
|
-
console.log(`${
|
|
8861
|
+
console.log(`${import_picocolors34.default.green("\u2713")} Skill ${import_picocolors34.default.bold(args.name)} removed.`);
|
|
8489
8862
|
} catch (err) {
|
|
8490
8863
|
console.error(
|
|
8491
|
-
`${
|
|
8864
|
+
`${import_picocolors34.default.red("\u2717")} Failed to remove skill: ${err instanceof Error ? err.message : String(err)}`
|
|
8492
8865
|
);
|
|
8493
8866
|
process.exit(1);
|
|
8494
8867
|
}
|
|
8495
8868
|
}
|
|
8496
8869
|
});
|
|
8497
|
-
var syncCommand2 = (0,
|
|
8870
|
+
var syncCommand2 = (0, import_citty37.defineCommand)({
|
|
8498
8871
|
meta: { name: "sync", description: "Sync all skill rules to installed clients" },
|
|
8499
8872
|
args: {
|
|
8500
8873
|
client: {
|
|
@@ -8503,7 +8876,7 @@ var syncCommand2 = (0, import_citty34.defineCommand)({
|
|
|
8503
8876
|
}
|
|
8504
8877
|
},
|
|
8505
8878
|
run({ args }) {
|
|
8506
|
-
|
|
8879
|
+
p15.intro(import_picocolors34.default.cyan("mcpman skill sync"));
|
|
8507
8880
|
const targets = args.client ? [args.client] : getClientTypes();
|
|
8508
8881
|
let totalRules = 0;
|
|
8509
8882
|
let clientsUpdated = 0;
|
|
@@ -8513,19 +8886,19 @@ var syncCommand2 = (0, import_citty34.defineCommand)({
|
|
|
8513
8886
|
if (written.length > 0) {
|
|
8514
8887
|
totalRules += written.length;
|
|
8515
8888
|
clientsUpdated++;
|
|
8516
|
-
|
|
8517
|
-
`${
|
|
8889
|
+
p15.log.step(
|
|
8890
|
+
`${import_picocolors34.default.green("\u2713")} ${import_picocolors34.default.cyan(client)}: ${written.length} file${written.length !== 1 ? "s" : ""} written`
|
|
8518
8891
|
);
|
|
8519
8892
|
}
|
|
8520
8893
|
} catch (err) {
|
|
8521
8894
|
const msg = err instanceof Error ? err.message : String(err);
|
|
8522
8895
|
if (!msg.includes("No format adapter")) {
|
|
8523
|
-
|
|
8896
|
+
p15.log.warn(`${import_picocolors34.default.yellow("\u26A0")} ${client}: ${msg}`);
|
|
8524
8897
|
}
|
|
8525
8898
|
}
|
|
8526
8899
|
}
|
|
8527
|
-
|
|
8528
|
-
|
|
8900
|
+
p15.outro(
|
|
8901
|
+
import_picocolors34.default.dim(
|
|
8529
8902
|
`${totalRules} file${totalRules !== 1 ? "s" : ""} written across ${clientsUpdated} client${clientsUpdated !== 1 ? "s" : ""}.`
|
|
8530
8903
|
)
|
|
8531
8904
|
);
|
|
@@ -8538,7 +8911,7 @@ var RULE_SCAN_LOCATIONS = [
|
|
|
8538
8911
|
{ path: ".roo/rules/rules.md", name: "roo-rules" },
|
|
8539
8912
|
{ path: ".continue/rules/rules.md", name: "continue-rules" }
|
|
8540
8913
|
];
|
|
8541
|
-
var exportCommand2 = (0,
|
|
8914
|
+
var exportCommand2 = (0, import_citty37.defineCommand)({
|
|
8542
8915
|
meta: { name: "export", description: "Export current project rules as a skill spec" },
|
|
8543
8916
|
args: {
|
|
8544
8917
|
name: {
|
|
@@ -8553,7 +8926,7 @@ var exportCommand2 = (0, import_citty34.defineCommand)({
|
|
|
8553
8926
|
}
|
|
8554
8927
|
},
|
|
8555
8928
|
run({ args }) {
|
|
8556
|
-
|
|
8929
|
+
p15.intro(import_picocolors34.default.cyan("mcpman skill export"));
|
|
8557
8930
|
const cwd = process.cwd();
|
|
8558
8931
|
const rules = [];
|
|
8559
8932
|
for (const loc of RULE_SCAN_LOCATIONS) {
|
|
@@ -8562,13 +8935,13 @@ var exportCommand2 = (0, import_citty34.defineCommand)({
|
|
|
8562
8935
|
try {
|
|
8563
8936
|
const content = (0, import_node_fs27.readFileSync)(fullPath, "utf8");
|
|
8564
8937
|
rules.push({ name: loc.name, content });
|
|
8565
|
-
|
|
8938
|
+
p15.log.step(`${import_picocolors34.default.green("\u2713")} Found: ${import_picocolors34.default.dim(loc.path)}`);
|
|
8566
8939
|
} catch {
|
|
8567
8940
|
}
|
|
8568
8941
|
}
|
|
8569
8942
|
if (rules.length === 0) {
|
|
8570
|
-
console.log(
|
|
8571
|
-
|
|
8943
|
+
console.log(import_picocolors34.default.yellow("\u26A0 No rule files found in current directory."));
|
|
8944
|
+
p15.outro(import_picocolors34.default.dim("Nothing to export."));
|
|
8572
8945
|
return;
|
|
8573
8946
|
}
|
|
8574
8947
|
const spec = {
|
|
@@ -8581,19 +8954,19 @@ var exportCommand2 = (0, import_citty34.defineCommand)({
|
|
|
8581
8954
|
try {
|
|
8582
8955
|
(0, import_node_fs27.writeFileSync)(outPath, `${JSON.stringify(spec, null, 2)}
|
|
8583
8956
|
`, "utf8");
|
|
8584
|
-
console.log(`${
|
|
8957
|
+
console.log(`${import_picocolors34.default.green("\u2713")} Written: ${import_picocolors34.default.bold("mcpman-skill.json")}`);
|
|
8585
8958
|
} catch (err) {
|
|
8586
|
-
console.error(`${
|
|
8959
|
+
console.error(`${import_picocolors34.default.red("\u2717")} Failed to write spec: ${String(err)}`);
|
|
8587
8960
|
process.exit(1);
|
|
8588
8961
|
}
|
|
8589
|
-
|
|
8590
|
-
|
|
8962
|
+
p15.outro(
|
|
8963
|
+
import_picocolors34.default.dim(
|
|
8591
8964
|
`Exported "${args.name}" v${args.version} with ${rules.length} rule${rules.length !== 1 ? "s" : ""}.`
|
|
8592
8965
|
)
|
|
8593
8966
|
);
|
|
8594
8967
|
}
|
|
8595
8968
|
});
|
|
8596
|
-
var skill_default = (0,
|
|
8969
|
+
var skill_default = (0, import_citty37.defineCommand)({
|
|
8597
8970
|
meta: {
|
|
8598
8971
|
name: "skill",
|
|
8599
8972
|
description: "Manage reusable skill bundles (rules + MCP servers)"
|
|
@@ -8609,9 +8982,9 @@ var skill_default = (0, import_citty34.defineCommand)({
|
|
|
8609
8982
|
|
|
8610
8983
|
// src/commands/status.ts
|
|
8611
8984
|
init_cjs_shims();
|
|
8612
|
-
var
|
|
8613
|
-
var
|
|
8614
|
-
var
|
|
8985
|
+
var import_citty38 = require("citty");
|
|
8986
|
+
var import_nanospinner7 = require("nanospinner");
|
|
8987
|
+
var import_picocolors35 = __toESM(require("picocolors"), 1);
|
|
8615
8988
|
|
|
8616
8989
|
// src/core/status-checker.ts
|
|
8617
8990
|
init_cjs_shims();
|
|
@@ -8732,21 +9105,21 @@ async function getServerStatuses(serverName) {
|
|
|
8732
9105
|
|
|
8733
9106
|
// src/commands/status.ts
|
|
8734
9107
|
function formatStatus(s) {
|
|
8735
|
-
return s.alive ?
|
|
9108
|
+
return s.alive ? import_picocolors35.default.green("alive") : import_picocolors35.default.red("dead");
|
|
8736
9109
|
}
|
|
8737
9110
|
function formatResponseTime(s) {
|
|
8738
|
-
if (!s.alive || s.responseTimeMs === null) return
|
|
8739
|
-
return
|
|
9111
|
+
if (!s.alive || s.responseTimeMs === null) return import_picocolors35.default.dim("\u2014");
|
|
9112
|
+
return import_picocolors35.default.cyan(`${s.responseTimeMs}ms`);
|
|
8740
9113
|
}
|
|
8741
|
-
function
|
|
9114
|
+
function printTable2(statuses) {
|
|
8742
9115
|
const nameW = Math.max(6, ...statuses.map((s) => s.name.length));
|
|
8743
9116
|
const header = ` ${pad("SERVER", nameW)} ${pad("STATUS", 7)} ${pad("RESPONSE", 10)} ERROR`;
|
|
8744
|
-
console.log(
|
|
9117
|
+
console.log(import_picocolors35.default.dim(header));
|
|
8745
9118
|
console.log(
|
|
8746
|
-
|
|
9119
|
+
import_picocolors35.default.dim(` ${"\u2500".repeat(nameW)} ${"\u2500".repeat(7)} ${"\u2500".repeat(10)} ${"\u2500".repeat(20)}`)
|
|
8747
9120
|
);
|
|
8748
9121
|
for (const s of statuses) {
|
|
8749
|
-
const errStr = s.error ?
|
|
9122
|
+
const errStr = s.error ? import_picocolors35.default.dim(s.error) : "";
|
|
8750
9123
|
console.log(
|
|
8751
9124
|
` ${pad(s.name, nameW)} ${pad(
|
|
8752
9125
|
formatStatus(s),
|
|
@@ -8756,7 +9129,7 @@ function printTable(statuses) {
|
|
|
8756
9129
|
);
|
|
8757
9130
|
}
|
|
8758
9131
|
}
|
|
8759
|
-
var status_default = (0,
|
|
9132
|
+
var status_default = (0, import_citty38.defineCommand)({
|
|
8760
9133
|
meta: {
|
|
8761
9134
|
name: "status",
|
|
8762
9135
|
description: "Show live process status for installed MCP servers"
|
|
@@ -8774,31 +9147,31 @@ var status_default = (0, import_citty35.defineCommand)({
|
|
|
8774
9147
|
},
|
|
8775
9148
|
async run({ args }) {
|
|
8776
9149
|
const label = args.server ? `Probing ${args.server}...` : "Probing all servers...";
|
|
8777
|
-
const
|
|
9150
|
+
const spinner8 = (0, import_nanospinner7.createSpinner)(label).start();
|
|
8778
9151
|
let statuses;
|
|
8779
9152
|
try {
|
|
8780
9153
|
statuses = await getServerStatuses(args.server);
|
|
8781
9154
|
} catch (err) {
|
|
8782
|
-
|
|
8783
|
-
console.error(
|
|
9155
|
+
spinner8.error({ text: "Status check failed" });
|
|
9156
|
+
console.error(import_picocolors35.default.red(String(err)));
|
|
8784
9157
|
process.exit(1);
|
|
8785
9158
|
}
|
|
8786
|
-
|
|
9159
|
+
spinner8.success({ text: `Checked ${statuses.length} server(s)` });
|
|
8787
9160
|
if (statuses.length === 0) {
|
|
8788
|
-
console.log(
|
|
9161
|
+
console.log(import_picocolors35.default.dim("\n No MCP servers installed.\n"));
|
|
8789
9162
|
return;
|
|
8790
9163
|
}
|
|
8791
9164
|
if (args.json) {
|
|
8792
9165
|
console.log(JSON.stringify(statuses, null, 2));
|
|
8793
9166
|
return;
|
|
8794
9167
|
}
|
|
8795
|
-
console.log(
|
|
8796
|
-
|
|
9168
|
+
console.log(import_picocolors35.default.bold("\n mcpman status\n"));
|
|
9169
|
+
printTable2(statuses);
|
|
8797
9170
|
const alive = statuses.filter((s) => s.alive).length;
|
|
8798
9171
|
const dead = statuses.length - alive;
|
|
8799
9172
|
const parts = [];
|
|
8800
|
-
if (alive > 0) parts.push(
|
|
8801
|
-
if (dead > 0) parts.push(
|
|
9173
|
+
if (alive > 0) parts.push(import_picocolors35.default.green(`${alive} alive`));
|
|
9174
|
+
if (dead > 0) parts.push(import_picocolors35.default.red(`${dead} dead`));
|
|
8802
9175
|
console.log(`
|
|
8803
9176
|
${parts.join(" \xB7 ")}
|
|
8804
9177
|
`);
|
|
@@ -8807,9 +9180,9 @@ var status_default = (0, import_citty35.defineCommand)({
|
|
|
8807
9180
|
|
|
8808
9181
|
// src/commands/sync.ts
|
|
8809
9182
|
init_cjs_shims();
|
|
8810
|
-
var
|
|
8811
|
-
var
|
|
8812
|
-
var
|
|
9183
|
+
var p16 = __toESM(require("@clack/prompts"), 1);
|
|
9184
|
+
var import_citty39 = require("citty");
|
|
9185
|
+
var import_picocolors36 = __toESM(require("picocolors"), 1);
|
|
8813
9186
|
|
|
8814
9187
|
// src/core/config-diff.ts
|
|
8815
9188
|
init_cjs_shims();
|
|
@@ -8966,7 +9339,7 @@ async function getClientConfigs() {
|
|
|
8966
9339
|
}
|
|
8967
9340
|
|
|
8968
9341
|
// src/commands/sync.ts
|
|
8969
|
-
var
|
|
9342
|
+
var VALID_CLIENTS3 = [
|
|
8970
9343
|
"claude-desktop",
|
|
8971
9344
|
"cursor",
|
|
8972
9345
|
"vscode",
|
|
@@ -8978,7 +9351,7 @@ var VALID_CLIENTS2 = [
|
|
|
8978
9351
|
"continue",
|
|
8979
9352
|
"zed"
|
|
8980
9353
|
];
|
|
8981
|
-
var sync_default = (0,
|
|
9354
|
+
var sync_default = (0, import_citty39.defineCommand)({
|
|
8982
9355
|
meta: {
|
|
8983
9356
|
name: "sync",
|
|
8984
9357
|
description: "Sync MCP server configs across all detected AI clients"
|
|
@@ -9005,20 +9378,20 @@ var sync_default = (0, import_citty36.defineCommand)({
|
|
|
9005
9378
|
}
|
|
9006
9379
|
},
|
|
9007
9380
|
async run({ args }) {
|
|
9008
|
-
|
|
9381
|
+
p16.intro(`${import_picocolors36.default.cyan("mcpman sync")}`);
|
|
9009
9382
|
const sourceClient = args.source;
|
|
9010
|
-
if (sourceClient && !
|
|
9011
|
-
|
|
9012
|
-
`Invalid --source "${sourceClient}". Must be one of: ${
|
|
9383
|
+
if (sourceClient && !VALID_CLIENTS3.includes(sourceClient)) {
|
|
9384
|
+
p16.log.error(
|
|
9385
|
+
`Invalid --source "${sourceClient}". Must be one of: ${VALID_CLIENTS3.join(", ")}`
|
|
9013
9386
|
);
|
|
9014
9387
|
process.exit(1);
|
|
9015
9388
|
}
|
|
9016
|
-
const
|
|
9017
|
-
|
|
9389
|
+
const spinner8 = p16.spinner();
|
|
9390
|
+
spinner8.start("Detecting clients and reading configs...");
|
|
9018
9391
|
const { configs, handlers } = await getClientConfigs();
|
|
9019
|
-
|
|
9392
|
+
spinner8.stop(`Found ${configs.size} client(s)`);
|
|
9020
9393
|
if (configs.size === 0) {
|
|
9021
|
-
|
|
9394
|
+
p16.log.warn(
|
|
9022
9395
|
"No AI clients detected. Install Claude Desktop, Cursor, VS Code, Windsurf, Claude Code, Roo Code, Codex CLI, OpenCode, Continue, or Zed first."
|
|
9023
9396
|
);
|
|
9024
9397
|
process.exit(0);
|
|
@@ -9027,10 +9400,10 @@ var sync_default = (0, import_citty36.defineCommand)({
|
|
|
9027
9400
|
let actions;
|
|
9028
9401
|
if (sourceClient) {
|
|
9029
9402
|
if (!configs.has(sourceClient)) {
|
|
9030
|
-
|
|
9403
|
+
p16.log.error(`Source client "${sourceClient}" is not detected or its config is unreadable.`);
|
|
9031
9404
|
process.exit(1);
|
|
9032
9405
|
}
|
|
9033
|
-
|
|
9406
|
+
p16.log.info(`Using ${CLIENT_DISPLAY[sourceClient]} as source of truth`);
|
|
9034
9407
|
actions = computeDiffFromClient(sourceClient, configs, diffOptions);
|
|
9035
9408
|
} else {
|
|
9036
9409
|
const lockfile = readLockfile();
|
|
@@ -9041,58 +9414,58 @@ var sync_default = (0, import_citty36.defineCommand)({
|
|
|
9041
9414
|
const extraCount = actions.filter((a) => a.action === "extra").length;
|
|
9042
9415
|
const removeCount = actions.filter((a) => a.action === "remove").length;
|
|
9043
9416
|
if (addCount === 0 && removeCount === 0 && extraCount === 0) {
|
|
9044
|
-
|
|
9417
|
+
p16.outro(import_picocolors36.default.green("All clients are in sync."));
|
|
9045
9418
|
process.exit(0);
|
|
9046
9419
|
}
|
|
9047
9420
|
const parts = [];
|
|
9048
|
-
if (addCount > 0) parts.push(
|
|
9049
|
-
if (removeCount > 0) parts.push(
|
|
9050
|
-
if (extraCount > 0) parts.push(
|
|
9051
|
-
|
|
9421
|
+
if (addCount > 0) parts.push(import_picocolors36.default.green(`${addCount} to add`));
|
|
9422
|
+
if (removeCount > 0) parts.push(import_picocolors36.default.red(`${removeCount} to remove`));
|
|
9423
|
+
if (extraCount > 0) parts.push(import_picocolors36.default.yellow(`${extraCount} extra (informational)`));
|
|
9424
|
+
p16.log.info(parts.join(" \xB7 "));
|
|
9052
9425
|
if (args["dry-run"]) {
|
|
9053
|
-
|
|
9426
|
+
p16.outro(import_picocolors36.default.dim("Dry run \u2014 no changes applied."));
|
|
9054
9427
|
process.exit(0);
|
|
9055
9428
|
}
|
|
9056
9429
|
if (addCount === 0 && removeCount === 0) {
|
|
9057
|
-
|
|
9430
|
+
p16.outro(import_picocolors36.default.dim("No additions needed. Extra servers left untouched."));
|
|
9058
9431
|
process.exit(0);
|
|
9059
9432
|
}
|
|
9060
9433
|
if (!args.yes) {
|
|
9061
9434
|
const actionParts = [];
|
|
9062
9435
|
if (addCount > 0) actionParts.push(`${addCount} addition(s)`);
|
|
9063
9436
|
if (removeCount > 0) actionParts.push(`${removeCount} removal(s)`);
|
|
9064
|
-
const confirmed = await
|
|
9437
|
+
const confirmed = await p16.confirm({
|
|
9065
9438
|
message: `Apply ${actionParts.join(" and ")} to client configs?`,
|
|
9066
9439
|
initialValue: true
|
|
9067
9440
|
});
|
|
9068
|
-
if (
|
|
9069
|
-
|
|
9441
|
+
if (p16.isCancel(confirmed) || !confirmed) {
|
|
9442
|
+
p16.outro(import_picocolors36.default.dim("Cancelled \u2014 no changes applied."));
|
|
9070
9443
|
process.exit(0);
|
|
9071
9444
|
}
|
|
9072
9445
|
}
|
|
9073
|
-
|
|
9446
|
+
spinner8.start("Applying sync changes...");
|
|
9074
9447
|
const result = await applySyncActions(actions, handlers);
|
|
9075
|
-
|
|
9448
|
+
spinner8.stop("Done");
|
|
9076
9449
|
if (result.applied > 0) {
|
|
9077
|
-
|
|
9450
|
+
p16.log.success(`Added ${result.applied} server(s) to client configs.`);
|
|
9078
9451
|
}
|
|
9079
9452
|
if (result.removed > 0) {
|
|
9080
|
-
|
|
9453
|
+
p16.log.success(`Removed ${result.removed} server(s) from client configs.`);
|
|
9081
9454
|
}
|
|
9082
9455
|
if (result.failed > 0) {
|
|
9083
9456
|
for (const e of result.errors) {
|
|
9084
|
-
|
|
9457
|
+
p16.log.error(`Failed to sync "${e.server}" on ${e.client}: ${e.error}`);
|
|
9085
9458
|
}
|
|
9086
9459
|
}
|
|
9087
|
-
|
|
9088
|
-
result.failed === 0 ?
|
|
9460
|
+
p16.outro(
|
|
9461
|
+
result.failed === 0 ? import_picocolors36.default.green("Sync complete.") : import_picocolors36.default.yellow("Sync complete with errors.")
|
|
9089
9462
|
);
|
|
9090
9463
|
process.exit(result.failed > 0 ? 1 : 0);
|
|
9091
9464
|
}
|
|
9092
9465
|
});
|
|
9093
9466
|
function printDiffTable(actions) {
|
|
9094
9467
|
if (actions.length === 0) {
|
|
9095
|
-
|
|
9468
|
+
p16.log.info("No actions to display.");
|
|
9096
9469
|
return;
|
|
9097
9470
|
}
|
|
9098
9471
|
const nameWidth = Math.max(6, ...actions.map((a) => a.server.length));
|
|
@@ -9101,8 +9474,8 @@ function printDiffTable(actions) {
|
|
|
9101
9474
|
...actions.map((a) => CLIENT_DISPLAY[a.client]?.length ?? a.client.length)
|
|
9102
9475
|
);
|
|
9103
9476
|
const header = ` ${pad("SERVER", nameWidth)} ${pad("CLIENT", clientWidth)} STATUS`;
|
|
9104
|
-
console.log(
|
|
9105
|
-
console.log(
|
|
9477
|
+
console.log(import_picocolors36.default.dim(header));
|
|
9478
|
+
console.log(import_picocolors36.default.dim(` ${"-".repeat(nameWidth)} ${"-".repeat(clientWidth)} ------`));
|
|
9106
9479
|
for (const action of actions) {
|
|
9107
9480
|
const clientDisplay = CLIENT_DISPLAY[action.client] ?? action.client;
|
|
9108
9481
|
const [icon, statusText] = formatAction(action.action);
|
|
@@ -9115,21 +9488,21 @@ function printDiffTable(actions) {
|
|
|
9115
9488
|
function formatAction(action) {
|
|
9116
9489
|
switch (action) {
|
|
9117
9490
|
case "add":
|
|
9118
|
-
return [
|
|
9491
|
+
return [import_picocolors36.default.green("+"), import_picocolors36.default.green("missing \u2014 will add")];
|
|
9119
9492
|
case "extra":
|
|
9120
|
-
return [
|
|
9493
|
+
return [import_picocolors36.default.yellow("?"), import_picocolors36.default.yellow("extra (not in lockfile)")];
|
|
9121
9494
|
case "remove":
|
|
9122
|
-
return [
|
|
9495
|
+
return [import_picocolors36.default.red("\u2013"), import_picocolors36.default.red("extra \u2014 will remove")];
|
|
9123
9496
|
case "ok":
|
|
9124
|
-
return [
|
|
9497
|
+
return [import_picocolors36.default.dim("\xB7"), import_picocolors36.default.dim("in sync")];
|
|
9125
9498
|
}
|
|
9126
9499
|
}
|
|
9127
9500
|
|
|
9128
9501
|
// src/commands/team.ts
|
|
9129
9502
|
init_cjs_shims();
|
|
9130
|
-
var
|
|
9131
|
-
var
|
|
9132
|
-
var
|
|
9503
|
+
var p17 = __toESM(require("@clack/prompts"), 1);
|
|
9504
|
+
var import_citty40 = require("citty");
|
|
9505
|
+
var import_picocolors37 = __toESM(require("picocolors"), 1);
|
|
9133
9506
|
|
|
9134
9507
|
// src/core/team-service.ts
|
|
9135
9508
|
init_cjs_shims();
|
|
@@ -9275,10 +9648,10 @@ function appendAudit(entry, dir) {
|
|
|
9275
9648
|
const dirPath = teamDir(dir);
|
|
9276
9649
|
if (!import_node_fs28.default.existsSync(dirPath)) import_node_fs28.default.mkdirSync(dirPath, { recursive: true });
|
|
9277
9650
|
try {
|
|
9278
|
-
const
|
|
9279
|
-
|
|
9651
|
+
const log13 = getAuditLog(dir);
|
|
9652
|
+
log13.push({ ...entry, timestamp: (/* @__PURE__ */ new Date()).toISOString() });
|
|
9280
9653
|
const tmp = `${filePath}.tmp`;
|
|
9281
|
-
import_node_fs28.default.writeFileSync(tmp, `${JSON.stringify(
|
|
9654
|
+
import_node_fs28.default.writeFileSync(tmp, `${JSON.stringify(log13, null, 2)}
|
|
9282
9655
|
`, "utf-8");
|
|
9283
9656
|
import_node_fs28.default.renameSync(tmp, filePath);
|
|
9284
9657
|
} catch {
|
|
@@ -9286,24 +9659,24 @@ function appendAudit(entry, dir) {
|
|
|
9286
9659
|
}
|
|
9287
9660
|
|
|
9288
9661
|
// src/commands/team.ts
|
|
9289
|
-
var initCommand = (0,
|
|
9662
|
+
var initCommand = (0, import_citty40.defineCommand)({
|
|
9290
9663
|
meta: { name: "init", description: "Initialize a team config in current project" },
|
|
9291
9664
|
args: {
|
|
9292
9665
|
name: { type: "positional", description: "Team name", required: true }
|
|
9293
9666
|
},
|
|
9294
9667
|
run({ args }) {
|
|
9295
|
-
|
|
9668
|
+
p17.intro(import_picocolors37.default.cyan("mcpman team init"));
|
|
9296
9669
|
try {
|
|
9297
9670
|
const config = initTeam(args.name);
|
|
9298
|
-
|
|
9299
|
-
|
|
9671
|
+
p17.log.success(`Team ${import_picocolors37.default.bold(config.name)} created in ${import_picocolors37.default.dim(".mcpman/team.json")}`);
|
|
9672
|
+
p17.outro(import_picocolors37.default.dim("Commit .mcpman/team.json to share with your team."));
|
|
9300
9673
|
} catch (err) {
|
|
9301
|
-
|
|
9674
|
+
p17.log.error(err instanceof Error ? err.message : String(err));
|
|
9302
9675
|
process.exit(1);
|
|
9303
9676
|
}
|
|
9304
9677
|
}
|
|
9305
9678
|
});
|
|
9306
|
-
var addCommand2 = (0,
|
|
9679
|
+
var addCommand2 = (0, import_citty40.defineCommand)({
|
|
9307
9680
|
meta: { name: "add", description: "Add a team member" },
|
|
9308
9681
|
args: {
|
|
9309
9682
|
member: { type: "positional", description: "Member username", required: true },
|
|
@@ -9312,19 +9685,19 @@ var addCommand2 = (0, import_citty37.defineCommand)({
|
|
|
9312
9685
|
run({ args }) {
|
|
9313
9686
|
const validRoles = ["admin", "member", "viewer"];
|
|
9314
9687
|
if (!validRoles.includes(args.role)) {
|
|
9315
|
-
|
|
9688
|
+
p17.log.error(`Invalid role "${args.role}". Must be: ${validRoles.join(", ")}`);
|
|
9316
9689
|
process.exit(1);
|
|
9317
9690
|
}
|
|
9318
9691
|
try {
|
|
9319
9692
|
addMember(args.member, args.role);
|
|
9320
|
-
|
|
9693
|
+
p17.log.success(`Added ${import_picocolors37.default.bold(args.member)} as ${import_picocolors37.default.cyan(args.role)}`);
|
|
9321
9694
|
} catch (err) {
|
|
9322
|
-
|
|
9695
|
+
p17.log.error(err instanceof Error ? err.message : String(err));
|
|
9323
9696
|
process.exit(1);
|
|
9324
9697
|
}
|
|
9325
9698
|
}
|
|
9326
9699
|
});
|
|
9327
|
-
var removeCommand4 = (0,
|
|
9700
|
+
var removeCommand4 = (0, import_citty40.defineCommand)({
|
|
9328
9701
|
meta: { name: "remove", description: "Remove a team member" },
|
|
9329
9702
|
args: {
|
|
9330
9703
|
member: { type: "positional", description: "Member username to remove", required: true }
|
|
@@ -9332,33 +9705,33 @@ var removeCommand4 = (0, import_citty37.defineCommand)({
|
|
|
9332
9705
|
run({ args }) {
|
|
9333
9706
|
try {
|
|
9334
9707
|
removeMember(args.member);
|
|
9335
|
-
|
|
9708
|
+
p17.log.success(`Removed ${import_picocolors37.default.bold(args.member)} from team`);
|
|
9336
9709
|
} catch (err) {
|
|
9337
|
-
|
|
9710
|
+
p17.log.error(err instanceof Error ? err.message : String(err));
|
|
9338
9711
|
process.exit(1);
|
|
9339
9712
|
}
|
|
9340
9713
|
}
|
|
9341
9714
|
});
|
|
9342
|
-
var syncCommand3 = (0,
|
|
9715
|
+
var syncCommand3 = (0, import_citty40.defineCommand)({
|
|
9343
9716
|
meta: { name: "sync", description: "Pull team servers into local lockfile" },
|
|
9344
9717
|
run() {
|
|
9345
|
-
|
|
9718
|
+
p17.intro(import_picocolors37.default.cyan("mcpman team sync"));
|
|
9346
9719
|
try {
|
|
9347
9720
|
const result = syncTeamToLocal();
|
|
9348
9721
|
if (result.added.length)
|
|
9349
|
-
|
|
9722
|
+
p17.log.step(`Added: ${result.added.map((s) => import_picocolors37.default.green(s)).join(", ")}`);
|
|
9350
9723
|
if (result.updated.length)
|
|
9351
|
-
|
|
9724
|
+
p17.log.step(`Updated: ${result.updated.map((s) => import_picocolors37.default.cyan(s)).join(", ")}`);
|
|
9352
9725
|
if (!result.added.length && !result.updated.length)
|
|
9353
|
-
|
|
9354
|
-
|
|
9726
|
+
p17.log.info("Local lockfile already up to date.");
|
|
9727
|
+
p17.outro(import_picocolors37.default.dim(`${result.added.length + result.updated.length} server(s) synced.`));
|
|
9355
9728
|
} catch (err) {
|
|
9356
|
-
|
|
9729
|
+
p17.log.error(err instanceof Error ? err.message : String(err));
|
|
9357
9730
|
process.exit(1);
|
|
9358
9731
|
}
|
|
9359
9732
|
}
|
|
9360
9733
|
});
|
|
9361
|
-
var shareCommand = (0,
|
|
9734
|
+
var shareCommand = (0, import_citty40.defineCommand)({
|
|
9362
9735
|
meta: { name: "share", description: "Push local servers to team config" },
|
|
9363
9736
|
args: {
|
|
9364
9737
|
servers: {
|
|
@@ -9368,25 +9741,25 @@ var shareCommand = (0, import_citty37.defineCommand)({
|
|
|
9368
9741
|
}
|
|
9369
9742
|
},
|
|
9370
9743
|
run({ args }) {
|
|
9371
|
-
|
|
9744
|
+
p17.intro(import_picocolors37.default.cyan("mcpman team share"));
|
|
9372
9745
|
const names = args.servers ? args.servers.split(",").map((s) => s.trim()).filter(Boolean) : [];
|
|
9373
9746
|
if (!names.length) {
|
|
9374
|
-
|
|
9747
|
+
p17.log.error(
|
|
9375
9748
|
"Provide server name(s) to share, e.g.: mcpman team share my-server,other-server"
|
|
9376
9749
|
);
|
|
9377
9750
|
process.exit(1);
|
|
9378
9751
|
}
|
|
9379
9752
|
try {
|
|
9380
9753
|
shareLocalToTeam(names);
|
|
9381
|
-
|
|
9382
|
-
|
|
9754
|
+
p17.log.success(`Shared: ${names.map((n) => import_picocolors37.default.cyan(n)).join(", ")}`);
|
|
9755
|
+
p17.outro(import_picocolors37.default.dim("Commit .mcpman/team.json to share with your team."));
|
|
9383
9756
|
} catch (err) {
|
|
9384
|
-
|
|
9757
|
+
p17.log.error(err instanceof Error ? err.message : String(err));
|
|
9385
9758
|
process.exit(1);
|
|
9386
9759
|
}
|
|
9387
9760
|
}
|
|
9388
9761
|
});
|
|
9389
|
-
var auditCommand = (0,
|
|
9762
|
+
var auditCommand = (0, import_citty40.defineCommand)({
|
|
9390
9763
|
meta: { name: "audit", description: "Show team audit log" },
|
|
9391
9764
|
args: {
|
|
9392
9765
|
limit: {
|
|
@@ -9396,57 +9769,57 @@ var auditCommand = (0, import_citty37.defineCommand)({
|
|
|
9396
9769
|
}
|
|
9397
9770
|
},
|
|
9398
9771
|
run({ args }) {
|
|
9399
|
-
const
|
|
9400
|
-
if (!
|
|
9401
|
-
console.log(
|
|
9772
|
+
const log13 = getAuditLog();
|
|
9773
|
+
if (!log13.length) {
|
|
9774
|
+
console.log(import_picocolors37.default.dim("No audit entries found."));
|
|
9402
9775
|
return;
|
|
9403
9776
|
}
|
|
9404
9777
|
const n = Math.max(1, Number.parseInt(args.limit, 10) || 20);
|
|
9405
|
-
const entries =
|
|
9778
|
+
const entries = log13.slice(-n).reverse();
|
|
9406
9779
|
console.log("");
|
|
9407
9780
|
for (const entry of entries) {
|
|
9408
|
-
const ts =
|
|
9781
|
+
const ts = import_picocolors37.default.dim(new Date(entry.timestamp).toLocaleString());
|
|
9409
9782
|
console.log(
|
|
9410
|
-
` ${ts} ${
|
|
9783
|
+
` ${ts} ${import_picocolors37.default.cyan(entry.actor)} ${import_picocolors37.default.bold(entry.action)} ${import_picocolors37.default.yellow(entry.target)}${entry.details ? import_picocolors37.default.dim(` (${entry.details})`) : ""}`
|
|
9411
9784
|
);
|
|
9412
9785
|
}
|
|
9413
9786
|
console.log("");
|
|
9414
|
-
console.log(
|
|
9787
|
+
console.log(import_picocolors37.default.dim(` Showing ${entries.length} of ${log13.length} entries`));
|
|
9415
9788
|
}
|
|
9416
9789
|
});
|
|
9417
|
-
var listCommand6 = (0,
|
|
9790
|
+
var listCommand6 = (0, import_citty40.defineCommand)({
|
|
9418
9791
|
meta: { name: "list", description: "Show team info, members, and servers" },
|
|
9419
9792
|
run() {
|
|
9420
9793
|
const config = readTeamConfig();
|
|
9421
9794
|
if (!config) {
|
|
9422
|
-
console.log(
|
|
9795
|
+
console.log(import_picocolors37.default.yellow("No team config found. Run `mcpman team init <name>` first."));
|
|
9423
9796
|
return;
|
|
9424
9797
|
}
|
|
9425
9798
|
console.log("");
|
|
9426
|
-
console.log(` ${
|
|
9427
|
-
console.log(` ${
|
|
9428
|
-
console.log(` ${
|
|
9799
|
+
console.log(` ${import_picocolors37.default.bold("Team:")} ${import_picocolors37.default.cyan(config.name)}`);
|
|
9800
|
+
console.log(` ${import_picocolors37.default.dim("Created:")} ${new Date(config.createdAt).toLocaleDateString()}`);
|
|
9801
|
+
console.log(` ${import_picocolors37.default.dim("Updated:")} ${new Date(config.updatedAt).toLocaleDateString()}`);
|
|
9429
9802
|
console.log("");
|
|
9430
9803
|
if (config.members.length) {
|
|
9431
|
-
console.log(` ${
|
|
9804
|
+
console.log(` ${import_picocolors37.default.bold("Members")} (${config.members.length})`);
|
|
9432
9805
|
for (const m of config.members) {
|
|
9433
|
-
const roleColor = m.role === "admin" ?
|
|
9434
|
-
console.log(` ${
|
|
9806
|
+
const roleColor = m.role === "admin" ? import_picocolors37.default.red : m.role === "member" ? import_picocolors37.default.green : import_picocolors37.default.dim;
|
|
9807
|
+
console.log(` ${import_picocolors37.default.cyan(m.name.padEnd(20))} ${roleColor(m.role)}`);
|
|
9435
9808
|
}
|
|
9436
9809
|
}
|
|
9437
9810
|
const serverNames = Object.keys(config.servers);
|
|
9438
9811
|
if (serverNames.length) {
|
|
9439
9812
|
console.log("");
|
|
9440
|
-
console.log(` ${
|
|
9813
|
+
console.log(` ${import_picocolors37.default.bold("Servers")} (${serverNames.length})`);
|
|
9441
9814
|
for (const [name, entry] of Object.entries(config.servers)) {
|
|
9442
9815
|
const detail = entry.url ?? entry.command ?? "";
|
|
9443
|
-
console.log(` ${
|
|
9816
|
+
console.log(` ${import_picocolors37.default.cyan(name.padEnd(20))} ${import_picocolors37.default.dim(detail)}`);
|
|
9444
9817
|
}
|
|
9445
9818
|
}
|
|
9446
9819
|
console.log("");
|
|
9447
9820
|
}
|
|
9448
9821
|
});
|
|
9449
|
-
var team_default = (0,
|
|
9822
|
+
var team_default = (0, import_citty40.defineCommand)({
|
|
9450
9823
|
meta: {
|
|
9451
9824
|
name: "team",
|
|
9452
9825
|
description: "Manage shared MCP configurations for teams (.mcpman/team.json)"
|
|
@@ -9464,8 +9837,8 @@ var team_default = (0, import_citty37.defineCommand)({
|
|
|
9464
9837
|
|
|
9465
9838
|
// src/commands/template.ts
|
|
9466
9839
|
init_cjs_shims();
|
|
9467
|
-
var
|
|
9468
|
-
var
|
|
9840
|
+
var import_citty41 = require("citty");
|
|
9841
|
+
var import_picocolors38 = __toESM(require("picocolors"), 1);
|
|
9469
9842
|
|
|
9470
9843
|
// src/core/template-service.ts
|
|
9471
9844
|
init_cjs_shims();
|
|
@@ -9531,7 +9904,7 @@ function applyTemplate(name, dir) {
|
|
|
9531
9904
|
}
|
|
9532
9905
|
|
|
9533
9906
|
// src/commands/template.ts
|
|
9534
|
-
var saveCmd = (0,
|
|
9907
|
+
var saveCmd = (0, import_citty41.defineCommand)({
|
|
9535
9908
|
meta: { name: "save", description: "Save current lockfile servers as a named template" },
|
|
9536
9909
|
args: {
|
|
9537
9910
|
name: { type: "positional", description: "Template name", required: true },
|
|
@@ -9546,15 +9919,15 @@ var saveCmd = (0, import_citty38.defineCommand)({
|
|
|
9546
9919
|
const tmpl = loadTemplate(args.name);
|
|
9547
9920
|
const count = tmpl?.servers.length ?? 0;
|
|
9548
9921
|
console.log(
|
|
9549
|
-
`${
|
|
9922
|
+
`${import_picocolors38.default.green("\u2713")} Template ${import_picocolors38.default.cyan(import_picocolors38.default.bold(args.name))} saved (${count} server${count !== 1 ? "s" : ""})`
|
|
9550
9923
|
);
|
|
9551
9924
|
} catch (err) {
|
|
9552
|
-
console.error(`${
|
|
9925
|
+
console.error(`${import_picocolors38.default.red("\u2717")} ${String(err)}`);
|
|
9553
9926
|
process.exit(1);
|
|
9554
9927
|
}
|
|
9555
9928
|
}
|
|
9556
9929
|
});
|
|
9557
|
-
var applyCmd = (0,
|
|
9930
|
+
var applyCmd = (0, import_citty41.defineCommand)({
|
|
9558
9931
|
meta: { name: "apply", description: "Print install commands for a template" },
|
|
9559
9932
|
args: {
|
|
9560
9933
|
name: { type: "positional", description: "Template name", required: true }
|
|
@@ -9564,49 +9937,49 @@ var applyCmd = (0, import_citty38.defineCommand)({
|
|
|
9564
9937
|
try {
|
|
9565
9938
|
commands = applyTemplate(args.name);
|
|
9566
9939
|
} catch (err) {
|
|
9567
|
-
console.error(`${
|
|
9940
|
+
console.error(`${import_picocolors38.default.red("\u2717")} ${String(err)}`);
|
|
9568
9941
|
process.exit(1);
|
|
9569
9942
|
}
|
|
9570
9943
|
if (commands.length === 0) {
|
|
9571
|
-
console.log(
|
|
9944
|
+
console.log(import_picocolors38.default.dim(`
|
|
9572
9945
|
Template "${args.name}" has no servers.
|
|
9573
9946
|
`));
|
|
9574
9947
|
return;
|
|
9575
9948
|
}
|
|
9576
|
-
console.log(
|
|
9577
|
-
Template: ${
|
|
9949
|
+
console.log(import_picocolors38.default.bold(`
|
|
9950
|
+
Template: ${import_picocolors38.default.cyan(args.name)}
|
|
9578
9951
|
`));
|
|
9579
|
-
console.log(
|
|
9952
|
+
console.log(import_picocolors38.default.dim(" Run the following commands to install all servers:\n"));
|
|
9580
9953
|
for (const cmd of commands) {
|
|
9581
|
-
console.log(` ${
|
|
9954
|
+
console.log(` ${import_picocolors38.default.green("$")} ${cmd}`);
|
|
9582
9955
|
}
|
|
9583
9956
|
console.log();
|
|
9584
9957
|
}
|
|
9585
9958
|
});
|
|
9586
|
-
var listCmd5 = (0,
|
|
9959
|
+
var listCmd5 = (0, import_citty41.defineCommand)({
|
|
9587
9960
|
meta: { name: "list", description: "List all saved templates" },
|
|
9588
9961
|
args: {},
|
|
9589
9962
|
run() {
|
|
9590
9963
|
const names = listTemplates();
|
|
9591
9964
|
if (names.length === 0) {
|
|
9592
|
-
console.log(
|
|
9965
|
+
console.log(import_picocolors38.default.dim("\n No templates saved. Use `mcpman template save <name>`.\n"));
|
|
9593
9966
|
return;
|
|
9594
9967
|
}
|
|
9595
|
-
console.log(
|
|
9596
|
-
console.log(
|
|
9968
|
+
console.log(import_picocolors38.default.bold("\n mcpman templates\n"));
|
|
9969
|
+
console.log(import_picocolors38.default.dim(` ${"\u2500".repeat(50)}`));
|
|
9597
9970
|
for (const name of names) {
|
|
9598
9971
|
const tmpl = loadTemplate(name);
|
|
9599
9972
|
const count = tmpl?.servers.length ?? 0;
|
|
9600
|
-
const desc = tmpl?.description ?
|
|
9973
|
+
const desc = tmpl?.description ? import_picocolors38.default.dim(` \u2014 ${tmpl.description}`) : "";
|
|
9601
9974
|
console.log(
|
|
9602
|
-
` ${
|
|
9975
|
+
` ${import_picocolors38.default.cyan(import_picocolors38.default.bold(name.padEnd(20)))} ${import_picocolors38.default.dim(`${count} server${count !== 1 ? "s" : ""}`)}${desc}`
|
|
9603
9976
|
);
|
|
9604
9977
|
}
|
|
9605
|
-
console.log(
|
|
9978
|
+
console.log(import_picocolors38.default.dim(` ${"\u2500".repeat(50)}
|
|
9606
9979
|
`));
|
|
9607
9980
|
}
|
|
9608
9981
|
});
|
|
9609
|
-
var deleteCmd2 = (0,
|
|
9982
|
+
var deleteCmd2 = (0, import_citty41.defineCommand)({
|
|
9610
9983
|
meta: { name: "delete", description: "Delete a saved template" },
|
|
9611
9984
|
args: {
|
|
9612
9985
|
name: { type: "positional", description: "Template name", required: true }
|
|
@@ -9614,14 +9987,14 @@ var deleteCmd2 = (0, import_citty38.defineCommand)({
|
|
|
9614
9987
|
run({ args }) {
|
|
9615
9988
|
const existing = listTemplates();
|
|
9616
9989
|
if (!existing.includes(args.name)) {
|
|
9617
|
-
console.error(`${
|
|
9990
|
+
console.error(`${import_picocolors38.default.red("\u2717")} Template "${args.name}" does not exist.`);
|
|
9618
9991
|
process.exit(1);
|
|
9619
9992
|
}
|
|
9620
9993
|
deleteTemplate(args.name);
|
|
9621
|
-
console.log(`${
|
|
9994
|
+
console.log(`${import_picocolors38.default.green("\u2713")} Template ${import_picocolors38.default.cyan(args.name)} deleted`);
|
|
9622
9995
|
}
|
|
9623
9996
|
});
|
|
9624
|
-
var template_default = (0,
|
|
9997
|
+
var template_default = (0, import_citty41.defineCommand)({
|
|
9625
9998
|
meta: {
|
|
9626
9999
|
name: "template",
|
|
9627
10000
|
description: "Manage install templates"
|
|
@@ -9636,8 +10009,8 @@ var template_default = (0, import_citty38.defineCommand)({
|
|
|
9636
10009
|
|
|
9637
10010
|
// src/commands/test-command.ts
|
|
9638
10011
|
init_cjs_shims();
|
|
9639
|
-
var
|
|
9640
|
-
var
|
|
10012
|
+
var import_citty42 = require("citty");
|
|
10013
|
+
var import_picocolors39 = __toESM(require("picocolors"), 1);
|
|
9641
10014
|
init_lockfile();
|
|
9642
10015
|
|
|
9643
10016
|
// src/core/mcp-tester.ts
|
|
@@ -9797,7 +10170,7 @@ async function testMcpServer(serverName, command, args, env) {
|
|
|
9797
10170
|
}
|
|
9798
10171
|
|
|
9799
10172
|
// src/commands/test-command.ts
|
|
9800
|
-
var test_command_default = (0,
|
|
10173
|
+
var test_command_default = (0, import_citty42.defineCommand)({
|
|
9801
10174
|
meta: {
|
|
9802
10175
|
name: "test",
|
|
9803
10176
|
description: "Test MCP server connectivity and capabilities"
|
|
@@ -9818,10 +10191,10 @@ var test_command_default = (0, import_citty39.defineCommand)({
|
|
|
9818
10191
|
const lockfile = readLockfile();
|
|
9819
10192
|
const serverNames = args.all ? Object.keys(lockfile.servers) : args.server ? [args.server] : [];
|
|
9820
10193
|
if (serverNames.length === 0) {
|
|
9821
|
-
console.error(
|
|
10194
|
+
console.error(import_picocolors39.default.red(" Error: Specify a server name or use --all."));
|
|
9822
10195
|
process.exit(1);
|
|
9823
10196
|
}
|
|
9824
|
-
console.log(
|
|
10197
|
+
console.log(import_picocolors39.default.bold(`
|
|
9825
10198
|
mcpman test \u2014 ${serverNames.length} server(s)
|
|
9826
10199
|
`));
|
|
9827
10200
|
let passed = 0;
|
|
@@ -9829,7 +10202,7 @@ var test_command_default = (0, import_citty39.defineCommand)({
|
|
|
9829
10202
|
for (const name of serverNames) {
|
|
9830
10203
|
const entry = lockfile.servers[name];
|
|
9831
10204
|
if (!entry) {
|
|
9832
|
-
console.log(` ${
|
|
10205
|
+
console.log(` ${import_picocolors39.default.red("\u2717")} ${import_picocolors39.default.bold(name)} \u2014 not installed`);
|
|
9833
10206
|
failed++;
|
|
9834
10207
|
continue;
|
|
9835
10208
|
}
|
|
@@ -9838,17 +10211,17 @@ var test_command_default = (0, import_citty39.defineCommand)({
|
|
|
9838
10211
|
if (result2.passed) {
|
|
9839
10212
|
passed++;
|
|
9840
10213
|
console.log(
|
|
9841
|
-
` ${
|
|
10214
|
+
` ${import_picocolors39.default.green("\u2713")} ${import_picocolors39.default.bold(name)} ${import_picocolors39.default.dim(`[${entry.transport}]`)} ${import_picocolors39.default.dim(`(${result2.responseTimeMs}ms)`)}`
|
|
9842
10215
|
);
|
|
9843
10216
|
if (result2.tools.length > 0) {
|
|
9844
|
-
console.log(
|
|
10217
|
+
console.log(import_picocolors39.default.dim(` Tools: ${result2.tools.join(", ")}`));
|
|
9845
10218
|
}
|
|
9846
10219
|
} else {
|
|
9847
10220
|
failed++;
|
|
9848
10221
|
console.log(
|
|
9849
|
-
` ${
|
|
10222
|
+
` ${import_picocolors39.default.red("\u2717")} ${import_picocolors39.default.bold(name)} ${import_picocolors39.default.dim(`[${entry.transport}]`)} ${import_picocolors39.default.dim(`(${result2.responseTimeMs}ms)`)}`
|
|
9850
10223
|
);
|
|
9851
|
-
if (result2.error) console.log(` ${
|
|
10224
|
+
if (result2.error) console.log(` ${import_picocolors39.default.red(result2.error)}`);
|
|
9852
10225
|
}
|
|
9853
10226
|
continue;
|
|
9854
10227
|
}
|
|
@@ -9859,27 +10232,27 @@ var test_command_default = (0, import_citty39.defineCommand)({
|
|
|
9859
10232
|
if (result.passed) {
|
|
9860
10233
|
passed++;
|
|
9861
10234
|
console.log(
|
|
9862
|
-
` ${
|
|
10235
|
+
` ${import_picocolors39.default.green("\u2713")} ${import_picocolors39.default.bold(name)} ${import_picocolors39.default.dim(`(${result.responseTimeMs}ms)`)}`
|
|
9863
10236
|
);
|
|
9864
10237
|
if (result.tools.length > 0) {
|
|
9865
|
-
console.log(
|
|
10238
|
+
console.log(import_picocolors39.default.dim(` Tools: ${result.tools.join(", ")}`));
|
|
9866
10239
|
}
|
|
9867
10240
|
} else {
|
|
9868
10241
|
failed++;
|
|
9869
|
-
console.log(` ${
|
|
10242
|
+
console.log(` ${import_picocolors39.default.red("\u2717")} ${import_picocolors39.default.bold(name)} ${import_picocolors39.default.dim(`(${result.responseTimeMs}ms)`)}`);
|
|
9870
10243
|
if (result.error) {
|
|
9871
|
-
console.log(` ${
|
|
10244
|
+
console.log(` ${import_picocolors39.default.red(result.error)}`);
|
|
9872
10245
|
}
|
|
9873
10246
|
console.log(
|
|
9874
|
-
` ${
|
|
10247
|
+
` ${import_picocolors39.default.dim("initialize:")} ${result.initializeOk ? import_picocolors39.default.green("ok") : import_picocolors39.default.red("fail")} ${import_picocolors39.default.dim("tools/list:")} ${result.toolsListOk ? import_picocolors39.default.green("ok") : import_picocolors39.default.red("fail")}`
|
|
9875
10248
|
);
|
|
9876
10249
|
}
|
|
9877
10250
|
}
|
|
9878
|
-
console.log(
|
|
10251
|
+
console.log(import_picocolors39.default.dim(`
|
|
9879
10252
|
${"\u2500".repeat(40)}`));
|
|
9880
10253
|
const parts = [];
|
|
9881
|
-
if (passed > 0) parts.push(
|
|
9882
|
-
if (failed > 0) parts.push(
|
|
10254
|
+
if (passed > 0) parts.push(import_picocolors39.default.green(`${passed} passed`));
|
|
10255
|
+
if (failed > 0) parts.push(import_picocolors39.default.red(`${failed} failed`));
|
|
9883
10256
|
console.log(` ${parts.join(", ")}
|
|
9884
10257
|
`);
|
|
9885
10258
|
if (failed > 0) process.exit(1);
|
|
@@ -9888,9 +10261,9 @@ var test_command_default = (0, import_citty39.defineCommand)({
|
|
|
9888
10261
|
|
|
9889
10262
|
// src/commands/update.ts
|
|
9890
10263
|
init_cjs_shims();
|
|
9891
|
-
var
|
|
9892
|
-
var
|
|
9893
|
-
var
|
|
10264
|
+
var p18 = __toESM(require("@clack/prompts"), 1);
|
|
10265
|
+
var import_citty43 = require("citty");
|
|
10266
|
+
var import_picocolors41 = __toESM(require("picocolors"), 1);
|
|
9894
10267
|
init_lockfile();
|
|
9895
10268
|
|
|
9896
10269
|
// src/core/update-notifier.ts
|
|
@@ -9898,7 +10271,7 @@ init_cjs_shims();
|
|
|
9898
10271
|
var import_node_fs30 = __toESM(require("fs"), 1);
|
|
9899
10272
|
var import_node_os9 = __toESM(require("os"), 1);
|
|
9900
10273
|
var import_node_path24 = __toESM(require("path"), 1);
|
|
9901
|
-
var
|
|
10274
|
+
var import_picocolors40 = __toESM(require("picocolors"), 1);
|
|
9902
10275
|
var CACHE_FILE = import_node_path24.default.join(import_node_os9.default.homedir(), ".mcpman", ".update-check");
|
|
9903
10276
|
var TTL_MS = 24 * 60 * 60 * 1e3;
|
|
9904
10277
|
function writeUpdateCache(data) {
|
|
@@ -9921,7 +10294,7 @@ async function loadClients3() {
|
|
|
9921
10294
|
return [];
|
|
9922
10295
|
}
|
|
9923
10296
|
}
|
|
9924
|
-
function
|
|
10297
|
+
function printTable3(updates) {
|
|
9925
10298
|
const NAME_W = 28;
|
|
9926
10299
|
const VER_W = 10;
|
|
9927
10300
|
const header = [
|
|
@@ -9930,19 +10303,19 @@ function printTable2(updates) {
|
|
|
9930
10303
|
"LATEST".padEnd(VER_W),
|
|
9931
10304
|
"STATUS"
|
|
9932
10305
|
].join(" ");
|
|
9933
|
-
console.log(
|
|
10306
|
+
console.log(import_picocolors41.default.bold(`
|
|
9934
10307
|
${header}`));
|
|
9935
|
-
console.log(
|
|
10308
|
+
console.log(import_picocolors41.default.dim(` ${"\u2500".repeat(NAME_W + VER_W * 2 + 20)}`));
|
|
9936
10309
|
for (const u of updates) {
|
|
9937
10310
|
const nameCol = u.server.slice(0, NAME_W).padEnd(NAME_W);
|
|
9938
10311
|
const curCol = u.currentVersion.padEnd(VER_W);
|
|
9939
10312
|
const latCol = u.latestVersion.padEnd(VER_W);
|
|
9940
|
-
const statusCol = u.hasUpdate ?
|
|
10313
|
+
const statusCol = u.hasUpdate ? import_picocolors41.default.yellow(`Update available${u.updateType ? ` [${u.updateType}]` : ""}`) : import_picocolors41.default.green("Up to date");
|
|
9941
10314
|
console.log(` ${nameCol} ${curCol} ${latCol} ${statusCol}`);
|
|
9942
10315
|
}
|
|
9943
10316
|
console.log();
|
|
9944
10317
|
}
|
|
9945
|
-
var update_default = (0,
|
|
10318
|
+
var update_default = (0, import_citty43.defineCommand)({
|
|
9946
10319
|
meta: {
|
|
9947
10320
|
name: "update",
|
|
9948
10321
|
description: "Check for and apply updates to installed MCP servers"
|
|
@@ -9981,8 +10354,8 @@ var update_default = (0, import_citty40.defineCommand)({
|
|
|
9981
10354
|
}
|
|
9982
10355
|
process.exit(1);
|
|
9983
10356
|
}
|
|
9984
|
-
const
|
|
9985
|
-
|
|
10357
|
+
const spinner8 = p18.spinner();
|
|
10358
|
+
spinner8.start("Checking versions...");
|
|
9986
10359
|
let updates;
|
|
9987
10360
|
try {
|
|
9988
10361
|
const partialLock = {
|
|
@@ -9991,63 +10364,63 @@ var update_default = (0, import_citty40.defineCommand)({
|
|
|
9991
10364
|
};
|
|
9992
10365
|
updates = await checkAllVersions(partialLock);
|
|
9993
10366
|
} catch (err) {
|
|
9994
|
-
|
|
10367
|
+
spinner8.stop("Version check failed");
|
|
9995
10368
|
console.error(err instanceof Error ? err.message : String(err));
|
|
9996
10369
|
process.exit(1);
|
|
9997
10370
|
}
|
|
9998
|
-
|
|
10371
|
+
spinner8.stop(`Checked ${updates.length} server(s)`);
|
|
9999
10372
|
if (args.json) {
|
|
10000
10373
|
console.log(JSON.stringify(updates, null, 2));
|
|
10001
10374
|
return;
|
|
10002
10375
|
}
|
|
10003
|
-
|
|
10376
|
+
printTable3(updates);
|
|
10004
10377
|
const outdated = updates.filter((u) => u.hasUpdate);
|
|
10005
10378
|
if (outdated.length === 0) {
|
|
10006
|
-
console.log(
|
|
10379
|
+
console.log(import_picocolors41.default.green(" All servers are up to date."));
|
|
10007
10380
|
return;
|
|
10008
10381
|
}
|
|
10009
10382
|
if (args.check) {
|
|
10010
10383
|
console.log(
|
|
10011
|
-
|
|
10384
|
+
import_picocolors41.default.yellow(` ${outdated.length} update(s) available. Run mcpman update to apply.`)
|
|
10012
10385
|
);
|
|
10013
10386
|
return;
|
|
10014
10387
|
}
|
|
10015
10388
|
if (!args.yes) {
|
|
10016
|
-
const confirmed = await
|
|
10389
|
+
const confirmed = await p18.confirm({
|
|
10017
10390
|
message: `Apply ${outdated.length} update(s)?`,
|
|
10018
10391
|
initialValue: true
|
|
10019
10392
|
});
|
|
10020
|
-
if (
|
|
10021
|
-
|
|
10393
|
+
if (p18.isCancel(confirmed) || !confirmed) {
|
|
10394
|
+
p18.outro("Cancelled.");
|
|
10022
10395
|
return;
|
|
10023
10396
|
}
|
|
10024
10397
|
}
|
|
10025
10398
|
const clients = await loadClients3();
|
|
10026
10399
|
let successCount = 0;
|
|
10027
10400
|
for (const update of outdated) {
|
|
10028
|
-
const s =
|
|
10401
|
+
const s = p18.spinner();
|
|
10029
10402
|
s.start(`Updating ${update.server}...`);
|
|
10030
10403
|
const result = await applyServerUpdate(update.server, servers[update.server], clients);
|
|
10031
10404
|
if (result.success) {
|
|
10032
|
-
s.stop(`${
|
|
10405
|
+
s.stop(`${import_picocolors41.default.green("\u2713")} ${update.server}: ${result.fromVersion} \u2192 ${result.toVersion}`);
|
|
10033
10406
|
successCount++;
|
|
10034
10407
|
} else {
|
|
10035
|
-
s.stop(`${
|
|
10408
|
+
s.stop(`${import_picocolors41.default.red("\u2717")} ${update.server}: ${result.error}`);
|
|
10036
10409
|
}
|
|
10037
10410
|
}
|
|
10038
10411
|
const freshLockfile = readLockfile(resolveLockfilePath());
|
|
10039
10412
|
const freshUpdates = await checkAllVersions(freshLockfile);
|
|
10040
10413
|
writeUpdateCache({ lastCheck: (/* @__PURE__ */ new Date()).toISOString(), updates: freshUpdates });
|
|
10041
|
-
|
|
10414
|
+
p18.outro(`${successCount} of ${outdated.length} server(s) updated.`);
|
|
10042
10415
|
}
|
|
10043
10416
|
});
|
|
10044
10417
|
|
|
10045
10418
|
// src/commands/upgrade.ts
|
|
10046
10419
|
init_cjs_shims();
|
|
10047
10420
|
var import_node_child_process13 = require("child_process");
|
|
10048
|
-
var
|
|
10049
|
-
var
|
|
10050
|
-
var upgrade_default = (0,
|
|
10421
|
+
var import_citty44 = require("citty");
|
|
10422
|
+
var import_picocolors42 = __toESM(require("picocolors"), 1);
|
|
10423
|
+
var upgrade_default = (0, import_citty44.defineCommand)({
|
|
10051
10424
|
meta: {
|
|
10052
10425
|
name: "upgrade",
|
|
10053
10426
|
description: "Upgrade mcpman to the latest version"
|
|
@@ -10060,30 +10433,30 @@ var upgrade_default = (0, import_citty41.defineCommand)({
|
|
|
10060
10433
|
}
|
|
10061
10434
|
},
|
|
10062
10435
|
async run({ args }) {
|
|
10063
|
-
console.log(
|
|
10436
|
+
console.log(import_picocolors42.default.dim(` Current version: ${APP_VERSION}`));
|
|
10064
10437
|
let latest;
|
|
10065
10438
|
try {
|
|
10066
10439
|
latest = (0, import_node_child_process13.execSync)("npm view mcpman version", { encoding: "utf-8", timeout: 15e3 }).trim();
|
|
10067
10440
|
} catch {
|
|
10068
|
-
console.error(
|
|
10441
|
+
console.error(import_picocolors42.default.red(" Error: Could not check latest version from npm."));
|
|
10069
10442
|
process.exit(1);
|
|
10070
10443
|
}
|
|
10071
10444
|
if (latest === APP_VERSION) {
|
|
10072
|
-
console.log(
|
|
10445
|
+
console.log(import_picocolors42.default.green(" \u2713 Already on the latest version."));
|
|
10073
10446
|
return;
|
|
10074
10447
|
}
|
|
10075
|
-
console.log(
|
|
10448
|
+
console.log(import_picocolors42.default.yellow(` Update available: ${APP_VERSION} \u2192 ${latest}`));
|
|
10076
10449
|
if (args.check) {
|
|
10077
|
-
console.log(
|
|
10450
|
+
console.log(import_picocolors42.default.dim(" Run mcpman upgrade to install."));
|
|
10078
10451
|
return;
|
|
10079
10452
|
}
|
|
10080
|
-
console.log(
|
|
10453
|
+
console.log(import_picocolors42.default.dim(" Installing..."));
|
|
10081
10454
|
try {
|
|
10082
10455
|
(0, import_node_child_process13.execSync)(`npm install -g mcpman@${latest}`, { stdio: "inherit", timeout: 6e4 });
|
|
10083
|
-
console.log(
|
|
10456
|
+
console.log(import_picocolors42.default.green(`
|
|
10084
10457
|
\u2713 Upgraded to mcpman@${latest}`));
|
|
10085
10458
|
} catch {
|
|
10086
|
-
console.error(
|
|
10459
|
+
console.error(import_picocolors42.default.red(" Error: Upgrade failed. Try manually: npm install -g mcpman@latest"));
|
|
10087
10460
|
process.exit(1);
|
|
10088
10461
|
}
|
|
10089
10462
|
}
|
|
@@ -10091,8 +10464,8 @@ var upgrade_default = (0, import_citty41.defineCommand)({
|
|
|
10091
10464
|
|
|
10092
10465
|
// src/commands/validate.ts
|
|
10093
10466
|
init_cjs_shims();
|
|
10094
|
-
var
|
|
10095
|
-
var
|
|
10467
|
+
var import_citty45 = require("citty");
|
|
10468
|
+
var import_picocolors43 = __toESM(require("picocolors"), 1);
|
|
10096
10469
|
|
|
10097
10470
|
// src/core/config-validator.ts
|
|
10098
10471
|
init_cjs_shims();
|
|
@@ -10232,16 +10605,16 @@ function validateAll(lockfilePath) {
|
|
|
10232
10605
|
|
|
10233
10606
|
// src/commands/validate.ts
|
|
10234
10607
|
function printResult(r) {
|
|
10235
|
-
const icon = r.valid ?
|
|
10236
|
-
const status = r.valid ?
|
|
10237
|
-
console.log(` ${icon} ${
|
|
10608
|
+
const icon = r.valid ? import_picocolors43.default.green("\u2713") : import_picocolors43.default.red("\u2717");
|
|
10609
|
+
const status = r.valid ? import_picocolors43.default.green("PASS") : import_picocolors43.default.red("FAIL");
|
|
10610
|
+
console.log(` ${icon} ${import_picocolors43.default.bold(r.file)} ${status}`);
|
|
10238
10611
|
if (!r.valid) {
|
|
10239
10612
|
for (const err of r.errors) {
|
|
10240
|
-
console.log(` ${
|
|
10613
|
+
console.log(` ${import_picocolors43.default.dim("\xB7")} ${import_picocolors43.default.yellow(err)}`);
|
|
10241
10614
|
}
|
|
10242
10615
|
}
|
|
10243
10616
|
}
|
|
10244
|
-
var validate_default = (0,
|
|
10617
|
+
var validate_default = (0, import_citty45.defineCommand)({
|
|
10245
10618
|
meta: {
|
|
10246
10619
|
name: "validate",
|
|
10247
10620
|
description: "Validate lockfile and client configs against expected schema"
|
|
@@ -10270,23 +10643,23 @@ var validate_default = (0, import_citty42.defineCommand)({
|
|
|
10270
10643
|
if (anyFail) process.exit(1);
|
|
10271
10644
|
return;
|
|
10272
10645
|
}
|
|
10273
|
-
console.log(
|
|
10274
|
-
console.log(
|
|
10646
|
+
console.log(import_picocolors43.default.bold("\n mcpman validate\n"));
|
|
10647
|
+
console.log(import_picocolors43.default.dim(` ${"\u2500".repeat(60)}`));
|
|
10275
10648
|
for (const r of results) {
|
|
10276
10649
|
printResult(r);
|
|
10277
10650
|
}
|
|
10278
|
-
console.log(
|
|
10651
|
+
console.log(import_picocolors43.default.dim(`
|
|
10279
10652
|
${"\u2500".repeat(60)}`));
|
|
10280
10653
|
const passed = results.filter((r) => r.valid).length;
|
|
10281
10654
|
const failed = results.filter((r) => !r.valid).length;
|
|
10282
10655
|
if (failed === 0) {
|
|
10283
10656
|
console.log(`
|
|
10284
|
-
${
|
|
10657
|
+
${import_picocolors43.default.green("All files valid")} (${passed} checked)
|
|
10285
10658
|
`);
|
|
10286
10659
|
} else {
|
|
10287
10660
|
console.log(
|
|
10288
10661
|
`
|
|
10289
|
-
${
|
|
10662
|
+
${import_picocolors43.default.red(`${failed} file(s) failed`)} ${import_picocolors43.default.dim("\xB7")} ${import_picocolors43.default.green(`${passed} passed`)}
|
|
10290
10663
|
`
|
|
10291
10664
|
);
|
|
10292
10665
|
process.exit(1);
|
|
@@ -10296,8 +10669,8 @@ var validate_default = (0, import_citty42.defineCommand)({
|
|
|
10296
10669
|
|
|
10297
10670
|
// src/commands/watch.ts
|
|
10298
10671
|
init_cjs_shims();
|
|
10299
|
-
var
|
|
10300
|
-
var
|
|
10672
|
+
var import_citty46 = require("citty");
|
|
10673
|
+
var import_picocolors44 = __toESM(require("picocolors"), 1);
|
|
10301
10674
|
|
|
10302
10675
|
// src/core/file-watcher-service.ts
|
|
10303
10676
|
init_cjs_shims();
|
|
@@ -10314,7 +10687,7 @@ var IGNORE_PATTERNS = [
|
|
|
10314
10687
|
".tox"
|
|
10315
10688
|
];
|
|
10316
10689
|
function shouldIgnore(filename) {
|
|
10317
|
-
return IGNORE_PATTERNS.some((
|
|
10690
|
+
return IGNORE_PATTERNS.some((p19) => filename.includes(p19));
|
|
10318
10691
|
}
|
|
10319
10692
|
function hasWatchedExtension(filename, extensions) {
|
|
10320
10693
|
return extensions.some((ext) => filename.endsWith(`.${ext}`));
|
|
@@ -10440,7 +10813,7 @@ var ServerWatcher = class {
|
|
|
10440
10813
|
init_lockfile();
|
|
10441
10814
|
var DEFAULT_EXTENSIONS = ["ts", "js", "json", "py", "mjs", "cjs"];
|
|
10442
10815
|
var DEFAULT_DEBOUNCE_MS = 300;
|
|
10443
|
-
var watch_default = (0,
|
|
10816
|
+
var watch_default = (0, import_citty46.defineCommand)({
|
|
10444
10817
|
meta: {
|
|
10445
10818
|
name: "watch",
|
|
10446
10819
|
description: "Watch a local MCP server for file changes and auto-restart"
|
|
@@ -10479,8 +10852,8 @@ var watch_default = (0, import_citty43.defineCommand)({
|
|
|
10479
10852
|
const lockfile = readLockfile();
|
|
10480
10853
|
const entry = lockfile.servers[serverName];
|
|
10481
10854
|
if (!entry) {
|
|
10482
|
-
console.error(
|
|
10483
|
-
console.error(
|
|
10855
|
+
console.error(import_picocolors44.default.red(` Error: Server '${serverName}' not found in lockfile.`));
|
|
10856
|
+
console.error(import_picocolors44.default.dim(` Run ${import_picocolors44.default.cyan("mcpman link .")} to register a local server.`));
|
|
10484
10857
|
process.exit(1);
|
|
10485
10858
|
}
|
|
10486
10859
|
let watchDir = args.dir;
|
|
@@ -10488,8 +10861,8 @@ var watch_default = (0, import_citty43.defineCommand)({
|
|
|
10488
10861
|
if (entry.source === "local" && entry.resolved) {
|
|
10489
10862
|
watchDir = entry.resolved;
|
|
10490
10863
|
} else {
|
|
10491
|
-
console.error(
|
|
10492
|
-
console.error(
|
|
10864
|
+
console.error(import_picocolors44.default.red(` Error: Cannot determine watch directory for '${serverName}'.`));
|
|
10865
|
+
console.error(import_picocolors44.default.dim(" Use --dir to specify the directory to watch."));
|
|
10493
10866
|
process.exit(1);
|
|
10494
10867
|
}
|
|
10495
10868
|
}
|
|
@@ -10526,8 +10899,8 @@ var watch_default = (0, import_citty43.defineCommand)({
|
|
|
10526
10899
|
|
|
10527
10900
|
// src/commands/why.ts
|
|
10528
10901
|
init_cjs_shims();
|
|
10529
|
-
var
|
|
10530
|
-
var
|
|
10902
|
+
var import_citty47 = require("citty");
|
|
10903
|
+
var import_picocolors45 = __toESM(require("picocolors"), 1);
|
|
10531
10904
|
|
|
10532
10905
|
// src/core/why-service.ts
|
|
10533
10906
|
init_cjs_shims();
|
|
@@ -10643,8 +11016,8 @@ function formatWhyOutput(result) {
|
|
|
10643
11016
|
if (result.profiles.length > 0) {
|
|
10644
11017
|
lines.push("");
|
|
10645
11018
|
lines.push(" Profiles:");
|
|
10646
|
-
for (const
|
|
10647
|
-
lines.push(` ${
|
|
11019
|
+
for (const p19 of result.profiles) {
|
|
11020
|
+
lines.push(` ${p19}`);
|
|
10648
11021
|
}
|
|
10649
11022
|
}
|
|
10650
11023
|
if (result.envVars.length > 0) {
|
|
@@ -10658,7 +11031,7 @@ function formatWhyOutput(result) {
|
|
|
10658
11031
|
}
|
|
10659
11032
|
|
|
10660
11033
|
// src/commands/why.ts
|
|
10661
|
-
var why_default = (0,
|
|
11034
|
+
var why_default = (0, import_citty47.defineCommand)({
|
|
10662
11035
|
meta: {
|
|
10663
11036
|
name: "why",
|
|
10664
11037
|
description: "Show why a server is installed (provenance, clients, profiles)"
|
|
@@ -10680,15 +11053,15 @@ var why_default = (0, import_citty44.defineCommand)({
|
|
|
10680
11053
|
const asJson = args.json;
|
|
10681
11054
|
const result = await getServerProvenance(serverName);
|
|
10682
11055
|
if (!result) {
|
|
10683
|
-
console.error(
|
|
10684
|
-
console.error(
|
|
11056
|
+
console.error(import_picocolors45.default.red(` Server '${serverName}' not found in lockfile or any client config.`));
|
|
11057
|
+
console.error(import_picocolors45.default.dim(` Run ${import_picocolors45.default.cyan("mcpman list")} to see installed servers.`));
|
|
10685
11058
|
process.exit(1);
|
|
10686
11059
|
}
|
|
10687
11060
|
if (result.orphaned) {
|
|
10688
|
-
console.log(
|
|
11061
|
+
console.log(import_picocolors45.default.yellow(`
|
|
10689
11062
|
Server '${serverName}' is orphaned:`));
|
|
10690
|
-
console.log(
|
|
10691
|
-
console.log(
|
|
11063
|
+
console.log(import_picocolors45.default.dim(" Found in client config(s) but not in lockfile."));
|
|
11064
|
+
console.log(import_picocolors45.default.dim(` Run ${import_picocolors45.default.cyan("mcpman sync --remove")} to clean up.
|
|
10692
11065
|
`));
|
|
10693
11066
|
const registeredClients = result.clients.filter((c) => c.registered).map((c) => c.type);
|
|
10694
11067
|
if (registeredClients.length > 0) {
|
|
@@ -10711,7 +11084,7 @@ process.on("SIGINT", () => {
|
|
|
10711
11084
|
console.log("\nAborted.");
|
|
10712
11085
|
process.exit(130);
|
|
10713
11086
|
});
|
|
10714
|
-
var main = (0,
|
|
11087
|
+
var main = (0, import_citty48.defineCommand)({
|
|
10715
11088
|
meta: {
|
|
10716
11089
|
name: APP_NAME,
|
|
10717
11090
|
version: APP_VERSION,
|
|
@@ -10761,7 +11134,10 @@ var main = (0, import_citty45.defineCommand)({
|
|
|
10761
11134
|
serve: serve_default,
|
|
10762
11135
|
dashboard: dashboard_default,
|
|
10763
11136
|
publish: publish_default,
|
|
10764
|
-
team: team_default
|
|
11137
|
+
team: team_default,
|
|
11138
|
+
outdated: outdated_default,
|
|
11139
|
+
migrate: migrate_default,
|
|
11140
|
+
health: health_default
|
|
10765
11141
|
}
|
|
10766
11142
|
});
|
|
10767
|
-
(0,
|
|
11143
|
+
(0, import_citty48.runMain)(main);
|