@global-packages/mcp-kit 1.0.1 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +117 -71
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +27 -27
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +50 -35
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/doctor.d.ts +5 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +128 -104
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/env-check.d.ts.map +1 -1
- package/dist/commands/env-check.js +63 -40
- package/dist/commands/env-check.js.map +1 -1
- package/dist/commands/export.d.ts +6 -4
- package/dist/commands/export.d.ts.map +1 -1
- package/dist/commands/export.js +52 -41
- package/dist/commands/export.js.map +1 -1
- package/dist/commands/import.d.ts.map +1 -1
- package/dist/commands/import.js +109 -74
- package/dist/commands/import.js.map +1 -1
- package/dist/commands/info.d.ts.map +1 -1
- package/dist/commands/info.js +60 -56
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.d.ts +5 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +189 -87
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/install.d.ts.map +1 -1
- package/dist/commands/install.js +56 -48
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/list.d.ts +5 -2
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +103 -45
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/open.d.ts.map +1 -1
- package/dist/commands/open.js +31 -23
- package/dist/commands/open.js.map +1 -1
- package/dist/commands/remove.d.ts.map +1 -1
- package/dist/commands/remove.js +60 -43
- package/dist/commands/remove.js.map +1 -1
- package/dist/commands/reset.d.ts.map +1 -1
- package/dist/commands/reset.js +52 -48
- package/dist/commands/reset.js.map +1 -1
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +52 -20
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +94 -76
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/toggle.d.ts.map +1 -1
- package/dist/commands/toggle.js +22 -24
- package/dist/commands/toggle.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +86 -62
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +43 -37
- package/dist/commands/validate.js.map +1 -1
- package/dist/constants.d.ts +3 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +377 -78
- package/dist/constants.js.map +1 -1
- package/dist/core/credentials.d.ts +15 -2
- package/dist/core/credentials.d.ts.map +1 -1
- package/dist/core/credentials.js +205 -116
- package/dist/core/credentials.js.map +1 -1
- package/dist/core/detector.d.ts +28 -2
- package/dist/core/detector.d.ts.map +1 -1
- package/dist/core/detector.js +101 -60
- package/dist/core/detector.js.map +1 -1
- package/dist/core/registry.d.ts +25 -1
- package/dist/core/registry.d.ts.map +1 -1
- package/dist/core/registry.js +45 -33
- package/dist/core/registry.js.map +1 -1
- package/dist/core/validator.d.ts +18 -2
- package/dist/core/validator.d.ts.map +1 -1
- package/dist/core/validator.js +53 -30
- package/dist/core/validator.js.map +1 -1
- package/dist/core/writer.d.ts +19 -1
- package/dist/core/writer.d.ts.map +1 -1
- package/dist/core/writer.js +41 -35
- package/dist/core/writer.js.map +1 -1
- package/dist/index.js +233 -122
- package/dist/index.js.map +1 -1
- package/dist/postinstall.js +25 -30
- package/dist/postinstall.js.map +1 -1
- package/dist/prompts/dev-prompts.d.ts +10 -2
- package/dist/prompts/dev-prompts.d.ts.map +1 -1
- package/dist/prompts/dev-prompts.js +87 -31
- package/dist/prompts/dev-prompts.js.map +1 -1
- package/dist/prompts/non-dev-prompts.d.ts +16 -2
- package/dist/prompts/non-dev-prompts.d.ts.map +1 -1
- package/dist/prompts/non-dev-prompts.js +90 -35
- package/dist/prompts/non-dev-prompts.js.map +1 -1
- package/dist/prompts/shared-prompts.d.ts +10 -1
- package/dist/prompts/shared-prompts.d.ts.map +1 -1
- package/dist/prompts/shared-prompts.js +66 -43
- package/dist/prompts/shared-prompts.js.map +1 -1
- package/dist/types.d.ts +22 -6
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +4 -2
- package/dist/types.js.map +1 -1
- package/dist/utils/fs.d.ts +36 -4
- package/dist/utils/fs.d.ts.map +1 -1
- package/dist/utils/fs.js +92 -28
- package/dist/utils/fs.js.map +1 -1
- package/dist/utils/logger.d.ts.map +1 -1
- package/dist/utils/logger.js +18 -24
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/network.d.ts +12 -1
- package/dist/utils/network.d.ts.map +1 -1
- package/dist/utils/network.js +37 -9
- package/dist/utils/network.js.map +1 -1
- package/dist/utils/spinner.js +10 -19
- package/dist/utils/spinner.js.map +1 -1
- package/package.json +62 -27
- package/src/postinstall.ts +121 -0
|
@@ -1,40 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { checkAndReportEnvVar, printEnvProfileInstructions, } from '../core/credentials.js';
|
|
4
|
+
/**
|
|
5
|
+
* Collect all env var answers for the given set of MCPs in developer mode.
|
|
6
|
+
*
|
|
7
|
+
* Returns:
|
|
8
|
+
* Map<mcpId, Record<envKey, value>>
|
|
9
|
+
*
|
|
10
|
+
* MCPs with no env vars are still included with an empty record.
|
|
11
|
+
*/
|
|
12
|
+
export async function collectDevAnswers(mcps, storage) {
|
|
13
|
+
const results = new Map();
|
|
11
14
|
for (const mcp of mcps) {
|
|
12
|
-
console.log(
|
|
13
|
-
console.log(
|
|
15
|
+
console.log('');
|
|
16
|
+
console.log(chalk.bold.cyan(`🔧 Setting up: ${mcp.name}`));
|
|
17
|
+
console.log(chalk.gray(mcp.description));
|
|
18
|
+
console.log(chalk.gray(`Docs: ${mcp.docsUrl}`));
|
|
19
|
+
//
|
|
20
|
+
// No env vars
|
|
21
|
+
//
|
|
14
22
|
if (mcp.envVars.length === 0) {
|
|
15
|
-
console.log(
|
|
16
|
-
|
|
23
|
+
console.log(chalk.green('✓ No configuration needed'));
|
|
24
|
+
results.set(mcp.id, {});
|
|
17
25
|
continue;
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
//
|
|
28
|
+
// env-profile mode
|
|
29
|
+
//
|
|
30
|
+
if (storage === 'env-profile') {
|
|
31
|
+
const record = {};
|
|
32
|
+
let allSet = true;
|
|
33
|
+
for (const envVar of mcp.envVars) {
|
|
34
|
+
const alreadySet = checkAndReportEnvVar(envVar.key, envVar.secret);
|
|
35
|
+
if (!alreadySet) {
|
|
36
|
+
allSet = false;
|
|
37
|
+
if (envVar.required) {
|
|
38
|
+
printEnvProfileInstructions(envVar.key);
|
|
39
|
+
}
|
|
32
40
|
}
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
// store runtime env value or empty string
|
|
42
|
+
record[envVar.key] =
|
|
43
|
+
process.env[envVar.key] ?? '';
|
|
44
|
+
}
|
|
45
|
+
if (!allSet) {
|
|
46
|
+
console.log(chalk.yellow('\n⚠ Set missing environment variables and re-run mcp-kit init\n'));
|
|
47
|
+
}
|
|
48
|
+
results.set(mcp.id, record);
|
|
49
|
+
continue;
|
|
35
50
|
}
|
|
36
|
-
|
|
51
|
+
//
|
|
52
|
+
// interactive mode
|
|
53
|
+
//
|
|
54
|
+
const questions = mcp.envVars.map((envVar) => {
|
|
55
|
+
if (envVar.hint) {
|
|
56
|
+
console.log(chalk.gray(` ${envVar.hint}`));
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
type: envVar.secret
|
|
60
|
+
? 'password'
|
|
61
|
+
: 'input',
|
|
62
|
+
name: envVar.key,
|
|
63
|
+
message: `${envVar.label}${envVar.required
|
|
64
|
+
? ' *'
|
|
65
|
+
: ' (optional)'}`,
|
|
66
|
+
default: envVar.defaultValue ?? '',
|
|
67
|
+
validate: (input) => {
|
|
68
|
+
if (!envVar.required &&
|
|
69
|
+
input.trim().length === 0) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (envVar.required &&
|
|
73
|
+
input.trim().length === 0) {
|
|
74
|
+
return 'This field is required';
|
|
75
|
+
}
|
|
76
|
+
if (envVar.validationRegex) {
|
|
77
|
+
try {
|
|
78
|
+
const regex = new RegExp(envVar.validationRegex);
|
|
79
|
+
if (!regex.test(input)) {
|
|
80
|
+
return 'Value does not match expected format';
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// ignore invalid regex
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
const answers = await inquirer.prompt(questions);
|
|
92
|
+
results.set(mcp.id, answers);
|
|
37
93
|
}
|
|
38
|
-
return
|
|
94
|
+
return results;
|
|
39
95
|
}
|
|
40
96
|
//# sourceMappingURL=dev-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-prompts.js","sourceRoot":"","sources":["../../src/prompts/dev-prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dev-prompts.js","sourceRoot":"","sources":["../../src/prompts/dev-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA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AAC,MAAM,KAAK,CAAC,EACzB,CAAC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC;oBAED,IACE,MAAM,CAAC,QAAQ;wBACf,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACzB,CAAC;wBACD,OAAO,wBAAwB,CAAC;oBAClC,CAAC;oBAED,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;wBAC3B,IAAI,CAAC;4BACH,MAAM,KAAK,GAAG,IAAI,MAAM,CACtB,MAAM,CAAC,eAAe,CACvB,CAAC;4BAEF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gCACvB,OAAO,sCAAsC,CAAC;4BAChD,CAAC;wBACH,CAAC;wBAAC,MAAM,CAAC;4BACP,uBAAuB;wBACzB,CAAC;oBACH,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,MAAM,OAAO,GACX,MAAM,QAAQ,CAAC,MAAM,CAEnB,SAAS,CAAC,CAAC;QAEf,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import type { McpDefinition, CredentialStorage } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Collect all env var answers for the given set of MCPs in non-developer mode.
|
|
4
|
+
*
|
|
5
|
+
* Uses simpler, friendlier labels and reminds non-technical users
|
|
6
|
+
* to ask their IT/DevOps team for values they don't know.
|
|
7
|
+
*
|
|
8
|
+
* Returns:
|
|
9
|
+
* Map<mcpId, Record<envKey, value>>
|
|
10
|
+
*/
|
|
11
|
+
export declare function collectNonDevAnswers(mcps: McpDefinition[], storage: CredentialStorage): Promise<Map<string, Record<string, string>>>;
|
|
12
|
+
declare module '../types.js' {
|
|
13
|
+
interface McpEnvVar {
|
|
14
|
+
devOnly?: boolean;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
3
17
|
//# sourceMappingURL=non-dev-prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-dev-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/non-dev-prompts.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"non-dev-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/non-dev-prompts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,MAAM,aAAa,CAAC;AAWrB;;;;;;;;GAQG;AAEH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,aAAa,EAAE,EACrB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CACR,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CACpC,CAuJA;AAMD,OAAO,QAAQ,aAAa,CAAC;IAC3B,UAAU,SAAS;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB;CACF"}
|
|
@@ -1,43 +1,98 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import { checkAndReportEnvVar, printEnvProfileInstructions, } from '../core/credentials.js';
|
|
4
|
+
//
|
|
5
|
+
// Non-developer interactive prompts
|
|
6
|
+
//
|
|
7
|
+
/**
|
|
8
|
+
* Collect all env var answers for the given set of MCPs in non-developer mode.
|
|
9
|
+
*
|
|
10
|
+
* Uses simpler, friendlier labels and reminds non-technical users
|
|
11
|
+
* to ask their IT/DevOps team for values they don't know.
|
|
12
|
+
*
|
|
13
|
+
* Returns:
|
|
14
|
+
* Map<mcpId, Record<envKey, value>>
|
|
15
|
+
*/
|
|
16
|
+
export async function collectNonDevAnswers(mcps, storage) {
|
|
17
|
+
console.log('');
|
|
18
|
+
console.log(chalk.yellow('ℹ Ask your IT/DevOps team for these values if you are unsure.\n' +
|
|
19
|
+
'They will know what to provide for each field.\n'));
|
|
20
|
+
const results = new Map();
|
|
21
|
+
for (const mcp of mcps) {
|
|
22
|
+
//
|
|
23
|
+
// Skip dev-only MCPs in non-dev mode
|
|
24
|
+
//
|
|
25
|
+
if (mcp.devOnly)
|
|
26
|
+
continue;
|
|
27
|
+
console.log('');
|
|
28
|
+
console.log(chalk.bold.cyan(`🔧 Setting up: ${mcp.name}`));
|
|
29
|
+
console.log(chalk.gray(mcp.description));
|
|
30
|
+
//
|
|
31
|
+
// No configuration needed
|
|
32
|
+
//
|
|
17
33
|
if (mcp.envVars.length === 0) {
|
|
18
|
-
console.log(
|
|
19
|
-
|
|
34
|
+
console.log(chalk.green('✓ No configuration needed'));
|
|
35
|
+
results.set(mcp.id, {});
|
|
20
36
|
continue;
|
|
21
37
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
38
|
+
//
|
|
39
|
+
// env-profile mode
|
|
40
|
+
//
|
|
41
|
+
if (storage === 'env-profile') {
|
|
42
|
+
const record = {};
|
|
43
|
+
let allSet = true;
|
|
44
|
+
for (const envVar of mcp.envVars.filter((ev) => !ev.devOnly)) {
|
|
45
|
+
const alreadySet = checkAndReportEnvVar(envVar.key, envVar.secret);
|
|
46
|
+
if (!alreadySet) {
|
|
47
|
+
allSet = false;
|
|
48
|
+
if (envVar.required) {
|
|
49
|
+
printEnvProfileInstructions(envVar.key);
|
|
50
|
+
}
|
|
35
51
|
}
|
|
36
|
-
|
|
37
|
-
|
|
52
|
+
record[envVar.key] =
|
|
53
|
+
process.env[envVar.key] ?? '';
|
|
54
|
+
}
|
|
55
|
+
if (!allSet) {
|
|
56
|
+
console.log(chalk.yellow('\n⚠ Ask your IT/DevOps team to set the missing variables above, then re-run.\n'));
|
|
57
|
+
}
|
|
58
|
+
results.set(mcp.id, record);
|
|
59
|
+
continue;
|
|
38
60
|
}
|
|
39
|
-
|
|
61
|
+
//
|
|
62
|
+
// Interactive mode
|
|
63
|
+
//
|
|
64
|
+
const questions = mcp.envVars
|
|
65
|
+
.filter((ev) => !ev.devOnly)
|
|
66
|
+
.map((envVar) => {
|
|
67
|
+
if (envVar.hint) {
|
|
68
|
+
console.log(chalk.gray(` ${envVar.hint}`));
|
|
69
|
+
}
|
|
70
|
+
const label = `${envVar.label} (ask your IT admin if unsure)`;
|
|
71
|
+
return {
|
|
72
|
+
type: envVar.secret
|
|
73
|
+
? 'password'
|
|
74
|
+
: 'input',
|
|
75
|
+
name: envVar.key,
|
|
76
|
+
message: `${label}${envVar.required
|
|
77
|
+
? ' *'
|
|
78
|
+
: ' (optional)'}`,
|
|
79
|
+
default: envVar.defaultValue ?? '',
|
|
80
|
+
validate: (input) => {
|
|
81
|
+
if (!envVar.required &&
|
|
82
|
+
input.trim().length === 0) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
if (envVar.required &&
|
|
86
|
+
input.trim().length === 0) {
|
|
87
|
+
return 'This field is required';
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
const answers = await inquirer.prompt(questions);
|
|
94
|
+
results.set(mcp.id, answers);
|
|
40
95
|
}
|
|
41
|
-
return
|
|
96
|
+
return results;
|
|
42
97
|
}
|
|
43
98
|
//# sourceMappingURL=non-dev-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"non-dev-prompts.js","sourceRoot":"","sources":["../../src/prompts/non-dev-prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"non-dev-prompts.js","sourceRoot":"","sources":["../../src/prompts/non-dev-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,OAAO,EACL,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,wBAAwB,CAAC;AAEhC,EAAE;AACF,oCAAoC;AACpC,EAAE;AAEF;;;;;;;;GAQG;AAEH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,IAAqB,EACrB,OAA0B;IAI1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,iEAAiE;QAC/D,kDAAkD,CACrD,CACF,CAAC;IAEF,MAAM,OAAO,GAAG,IAAI,GAAG,EAGpB,CAAC;IAEJ,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,EAAE;QACF,qCAAqC;QACrC,EAAE;QACF,IAAI,GAAG,CAAC,OAAO;YAAE,SAAS;QAE1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,IAAI,CAAC,IAAI,CACb,kBAAkB,GAAG,CAAC,IAAI,EAAE,CAC7B,CACF,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC;QAEzC,EAAE;QACF,0BAA0B;QAC1B,EAAE;QACF,IAAI,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CACT,2BAA2B,CAC5B,CACF,CAAC;YAEF,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,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,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAC/B,CAAC;YACJ,CAAC;YAED,MAAM,KAAK,GAAG,GAAG,MAAM,CAAC,KAAK,gCAAgC,CAAC;YAE9D,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,MAAM;oBACjB,CAAC,CAAC,UAAU;oBACZ,CAAC,CAAC,OAAO;gBAEX,IAAI,EAAE,MAAM,CAAC,GAAG;gBAEhB,OAAO,EAAE,GAAG,KAAK,GACf,MAAM,CAAC,QAAQ;oBACb,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,aACN,EAAE;gBAEF,OAAO,EACL,MAAM,CAAC,YAAY,IAAI,EAAE;gBAE3B,QAAQ,EAAE,CACR,KAAa,EACK,EAAE;oBACpB,IACE,CAAC,MAAM,CAAC,QAAQ;wBAChB,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACzB,CAAC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC;oBAED,IACE,MAAM,CAAC,QAAQ;wBACf,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EACzB,CAAC;wBACD,OAAO,wBAAwB,CAAC;oBAClC,CAAC;oBAED,OAAO,IAAI,CAAC;gBACd,CAAC;aACF,CAAC;QACJ,CAAC,CAAC,CAAC;QAEL,MAAM,OAAO,GACX,MAAM,QAAQ,CAAC,MAAM,CAEnB,SAAS,CAAC,CAAC;QAEf,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import { CredentialStorage, McpDefinition } from
|
|
1
|
+
import type { CredentialStorage, McpDefinition } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Ask the user how they want credentials stored.
|
|
4
|
+
*/
|
|
2
5
|
export declare function askCredentialStorage(): Promise<CredentialStorage>;
|
|
6
|
+
/**
|
|
7
|
+
* Ask the user to select which MCPs to configure.
|
|
8
|
+
*/
|
|
3
9
|
export declare function askMcpSelection(mcps: McpDefinition[], alreadyInstalled: string[]): Promise<string[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Ask a yes/no confirmation question.
|
|
12
|
+
*/
|
|
4
13
|
export declare function askConfirm(message: string): Promise<boolean>;
|
|
5
14
|
//# sourceMappingURL=shared-prompts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/shared-prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/shared-prompts.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACd,MAAM,aAAa,CAAC;AAMrB;;GAEG;AAEH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAmCvE;AAED;;GAEG;AAEH,wBAAsB,eAAe,CACnC,IAAI,EAAE,aAAa,EAAE,EACrB,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC,CA8CnB;AAED;;GAEG;AAEH,wBAAsB,UAAU,CAC9B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
|
@@ -1,59 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
async function askCredentialStorage() {
|
|
11
|
-
const answer = await inquirer_1.default.prompt([
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
//
|
|
3
|
+
// Shared interactive prompts
|
|
4
|
+
//
|
|
5
|
+
/**
|
|
6
|
+
* Ask the user how they want credentials stored.
|
|
7
|
+
*/
|
|
8
|
+
export async function askCredentialStorage() {
|
|
9
|
+
const { storage } = await inquirer.prompt([
|
|
12
10
|
{
|
|
13
|
-
type:
|
|
14
|
-
name:
|
|
15
|
-
message:
|
|
11
|
+
type: 'list',
|
|
12
|
+
name: 'storage',
|
|
13
|
+
message: 'How should credentials be stored?',
|
|
16
14
|
choices: [
|
|
17
15
|
{
|
|
18
|
-
name:
|
|
19
|
-
value:
|
|
16
|
+
name: 'Environment variable (~/.zshrc / ~/.bash_profile / Windows System Env) - recommended',
|
|
17
|
+
value: 'env-profile',
|
|
20
18
|
},
|
|
21
19
|
{
|
|
22
|
-
name:
|
|
23
|
-
value:
|
|
20
|
+
name: 'System keychain (Mac Keychain / Windows Credential Store)',
|
|
21
|
+
value: 'keychain',
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
|
-
name:
|
|
27
|
-
value:
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
name: 'dotenv file in project root (auto-added to .gitignore)',
|
|
25
|
+
value: 'dotenv',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Inline in mcp.json (not recommended for shared repos)',
|
|
29
|
+
value: 'inline',
|
|
30
|
+
},
|
|
31
|
+
],
|
|
32
|
+
},
|
|
31
33
|
]);
|
|
32
|
-
return
|
|
34
|
+
return storage;
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Ask the user to select which MCPs to configure.
|
|
38
|
+
*/
|
|
39
|
+
export async function askMcpSelection(mcps, alreadyInstalled) {
|
|
40
|
+
const ALL_VALUE = '__ALL__';
|
|
41
|
+
const allIds = mcps.map((m) => m.id);
|
|
42
|
+
const allPreChecked = allIds.every((id) => alreadyInstalled.includes(id));
|
|
43
|
+
const { selected } = await inquirer.prompt([
|
|
36
44
|
{
|
|
37
|
-
type:
|
|
38
|
-
name:
|
|
39
|
-
message:
|
|
40
|
-
choices:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
type: 'checkbox',
|
|
46
|
+
name: 'selected',
|
|
47
|
+
message: 'Select MCPs to configure (space to select, a to toggle all, enter to confirm):',
|
|
48
|
+
choices: [
|
|
49
|
+
{
|
|
50
|
+
name: 'Select ALL →',
|
|
51
|
+
value: ALL_VALUE,
|
|
52
|
+
checked: allPreChecked,
|
|
53
|
+
},
|
|
54
|
+
new inquirer.Separator(),
|
|
55
|
+
...mcps.map((mcp) => ({
|
|
56
|
+
name: `${mcp.name} - ${mcp.description}`,
|
|
57
|
+
value: mcp.id,
|
|
58
|
+
checked: alreadyInstalled.includes(mcp.id),
|
|
59
|
+
})),
|
|
60
|
+
],
|
|
61
|
+
},
|
|
46
62
|
]);
|
|
47
|
-
|
|
63
|
+
if (selected.includes(ALL_VALUE)) {
|
|
64
|
+
return allIds;
|
|
65
|
+
}
|
|
66
|
+
return selected.filter((v) => v !== ALL_VALUE);
|
|
48
67
|
}
|
|
49
|
-
|
|
50
|
-
|
|
68
|
+
/**
|
|
69
|
+
* Ask a yes/no confirmation question.
|
|
70
|
+
*/
|
|
71
|
+
export async function askConfirm(message) {
|
|
72
|
+
const { confirmed } = await inquirer.prompt([
|
|
51
73
|
{
|
|
52
|
-
type:
|
|
53
|
-
name:
|
|
54
|
-
message
|
|
55
|
-
|
|
74
|
+
type: 'confirm',
|
|
75
|
+
name: 'confirmed',
|
|
76
|
+
message,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
56
79
|
]);
|
|
57
|
-
return
|
|
80
|
+
return confirmed;
|
|
58
81
|
}
|
|
59
82
|
//# sourceMappingURL=shared-prompts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-prompts.js","sourceRoot":"","sources":["../../src/prompts/shared-prompts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared-prompts.js","sourceRoot":"","sources":["../../src/prompts/shared-prompts.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,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B,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBACpB,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC,WAAW,EAAE;oBACxC,KAAK,EAAE,GAAG,CAAC,EAAE;oBACb,OAAO,EAAE,gBAAgB,CAAC,QAAQ,CAChC,GAAG,CAAC,EAAE,CACP;iBACF,CAAC,CAAC;aACJ;SACF;KACF,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;QACjC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,QAAQ,CAAC,MAAM,CACpB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CACvB,CAAC;AACJ,CAAC;AAED;;GAEG;AAEH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,OAAe;IAEf,MAAM,EAAE,SAAS,EAAE,GACjB,MAAM,QAAQ,CAAC,MAAM,CAElB;QACD;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,WAAW;YACjB,OAAO;YACP,OAAO,EAAE,KAAK;SACf;KACF,CAAC,CAAC;IAEL,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type SupportedOS =
|
|
2
|
-
export type ProfileMode =
|
|
3
|
-
export type CredentialStorage =
|
|
4
|
-
export type McpCategory =
|
|
1
|
+
export type SupportedOS = 'windows' | 'mac' | 'linux';
|
|
2
|
+
export type ProfileMode = 'dev' | 'non-dev';
|
|
3
|
+
export type CredentialStorage = 'env-profile' | 'keychain' | 'dotenv' | 'inline';
|
|
4
|
+
export type McpCategory = 'database' | 'devops' | 'testing' | 'documentation' | 'cloud' | 'filesystem' | 'incident' | 'versioncontrol' | 'productivity' | 'codeanalysis' | 'design';
|
|
5
5
|
export interface McpEnvVar {
|
|
6
6
|
key: string;
|
|
7
7
|
label: string;
|
|
@@ -28,18 +28,26 @@ export interface McpDefinition {
|
|
|
28
28
|
version?: string;
|
|
29
29
|
}
|
|
30
30
|
export interface McpServerEntry {
|
|
31
|
+
type?: string;
|
|
31
32
|
command: string;
|
|
32
33
|
args: string[];
|
|
33
34
|
env?: Record<string, string>;
|
|
34
35
|
disabled?: boolean;
|
|
35
36
|
}
|
|
37
|
+
export interface McpInputPrompt {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
password?: boolean;
|
|
42
|
+
}
|
|
36
43
|
export interface McpJsonConfig {
|
|
44
|
+
inputs?: McpInputPrompt[];
|
|
37
45
|
servers: Record<string, McpServerEntry>;
|
|
38
46
|
}
|
|
39
47
|
export interface VsCodePaths {
|
|
40
48
|
mcpJsonPath: string;
|
|
41
49
|
vscodeFolderPath: string;
|
|
42
|
-
source:
|
|
50
|
+
source: 'project' | 'global' | 'created';
|
|
43
51
|
}
|
|
44
52
|
export interface DoctorResult {
|
|
45
53
|
mcpId: string;
|
|
@@ -50,7 +58,7 @@ export interface DoctorResult {
|
|
|
50
58
|
packageInstallable: boolean;
|
|
51
59
|
issues: string[];
|
|
52
60
|
suggestions: string[];
|
|
53
|
-
status:
|
|
61
|
+
status: 'healthy' | 'warning' | 'error';
|
|
54
62
|
}
|
|
55
63
|
export interface McpStatus {
|
|
56
64
|
id: string;
|
|
@@ -76,4 +84,12 @@ export interface McpKitMeta {
|
|
|
76
84
|
installedMcps: string[];
|
|
77
85
|
mcpKitVersion: string;
|
|
78
86
|
}
|
|
87
|
+
export interface McpKitExport {
|
|
88
|
+
exportedAt: string;
|
|
89
|
+
mcpKitVersion: string;
|
|
90
|
+
profileMode: string;
|
|
91
|
+
servers: Record<string, McpServerEntry>;
|
|
92
|
+
mcpIds: string[];
|
|
93
|
+
instructions: string;
|
|
94
|
+
}
|
|
79
95
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,WAAW,GACnB,SAAS,GACT,KAAK,GACL,OAAO,CAAC;AAMZ,MAAM,MAAM,WAAW,GACnB,KAAK,GACL,SAAS,CAAC;AAMd,MAAM,MAAM,iBAAiB,GACzB,aAAa,GACb,UAAU,GACV,QAAQ,GACR,QAAQ,CAAC;AAMb,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,QAAQ,GACR,SAAS,GACT,eAAe,GACf,OAAO,GACP,YAAY,GACZ,UAAU,GACV,gBAAgB,GAChB,cAAc,GACd,cAAc,GACd,QAAQ,CAAC;AAMb,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAC;IAGd,MAAM,EAAE,OAAO,CAAC;IAGhB,QAAQ,EAAE,OAAO,CAAC;IAElB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,IAAI,CAAC,EAAE,MAAM,CAAC;IAId,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAMD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IAGX,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,WAAW,CAAC;IAEtB,UAAU,EAAE,MAAM,CAAC;IAGnB,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,MAAM,EAAE,CAAC;IAKf,OAAO,EAAE,SAAS,EAAE,CAAC;IAGrB,OAAO,EAAE,OAAO,CAAC;IAGjB,UAAU,EAAE,OAAO,CAAC;IAGpB,eAAe,EAAE,OAAO,CAAC;IAEzB,cAAc,CAAC,EAAE,MAAM,CAAC;IAGxB,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,CA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MAAM,CAAC;IAEtB,QAAQ,EAAE,OAAO,CAAC;IAElB,iBAAiB,EAAE,iBAAiB,CAAC;IAErC,UAAU,EAAE,OAAO,CAAC;CACrB;AAMD,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,MAAM,CAAC;IAEZ,KAAK,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,iBAAiB,CAAC;CAC5B;AAMD,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,MAAM,CAAC;IAEpB,WAAW,EAAE,WAAW,CAAC;IAEzB,UAAU,EAAE,MAAM,CAAC;IAEnB,iBAAiB,EAAE,iBAAiB,CAAC;IAErC,aAAa,EAAE,MAAM,EAAE,CAAC;IAGxB,aAAa,EAAE,MAAM,CAAC;CACvB;AAMD,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IAEnB,aAAa,EAAE,MAAM,CAAC;IAEtB,WAAW,EAAE,MAAM,CAAC;IAEpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAExC,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB,YAAY,EAAE,MAAM,CAAC;CACtB"}
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,EAAE;AACF,wBAAwB;AACxB,EAAE"}
|
package/dist/utils/fs.d.ts
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
1
|
+
/**
|
|
2
|
+
* Read and parse a JSON file. Returns null if the file doesn't exist or is invalid.
|
|
3
|
+
*/
|
|
4
|
+
export declare function safeReadJSON<T>(filePath: string): Promise<T | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Write an object to a JSON file, creating directories as needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare function safeWriteJSON(filePath: string, data: any): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Check if a file exists.
|
|
11
|
+
*/
|
|
12
|
+
export declare function fileExists(filePath: string): Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Check whether path is writable.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isWritable(filePath: string): Promise<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Ensure a directory exists, creating it if necessary.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ensureDir(dirPath: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Read a text file, returning null if it doesn't exist.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readText(filePath: string): Promise<string | null>;
|
|
25
|
+
/**
|
|
26
|
+
* Write text to a file, creating directories as needed.
|
|
27
|
+
*/
|
|
28
|
+
export declare function writeText(filePath: string, content: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Append text to a file, creating it if it doesn't exist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function appendText(filePath: string, content: string): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Delete a file if it exists.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deleteFile(filePath: string): Promise<void>;
|
|
5
37
|
//# sourceMappingURL=fs.d.ts.map
|