@qazuor/claude-code-config 0.3.1 → 0.4.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/dist/bin.cjs +44 -8
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +44 -8
- package/dist/bin.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -9678,6 +9678,10 @@ async function promptMcpConfig(options) {
|
|
|
9678
9678
|
skippedConfigs: []
|
|
9679
9679
|
};
|
|
9680
9680
|
}
|
|
9681
|
+
const projectPath = options?.projectPath || process.cwd();
|
|
9682
|
+
const installedServers = await getInstalledMcpServers(projectPath);
|
|
9683
|
+
const userInstalledSet = new Set(installedServers.user);
|
|
9684
|
+
const projectInstalledSet = new Set(installedServers.project);
|
|
9681
9685
|
const level = await select({
|
|
9682
9686
|
message: "Where should MCP servers be configured?",
|
|
9683
9687
|
choices: [
|
|
@@ -9698,13 +9702,44 @@ async function promptMcpConfig(options) {
|
|
|
9698
9702
|
const selectedServerIds = [];
|
|
9699
9703
|
logger.newline();
|
|
9700
9704
|
logger.info("Select MCP servers to install:");
|
|
9705
|
+
const totalInstalled = userInstalledSet.size + projectInstalledSet.size;
|
|
9706
|
+
if (totalInstalled > 0) {
|
|
9707
|
+
const parts = [];
|
|
9708
|
+
if (userInstalledSet.size > 0) {
|
|
9709
|
+
parts.push(`${userInstalledSet.size} at user level`);
|
|
9710
|
+
}
|
|
9711
|
+
if (projectInstalledSet.size > 0) {
|
|
9712
|
+
parts.push(`${projectInstalledSet.size} at project level`);
|
|
9713
|
+
}
|
|
9714
|
+
logger.info(colors.muted(` (${parts.join(", ")} already installed)`));
|
|
9715
|
+
}
|
|
9701
9716
|
logger.newline();
|
|
9702
9717
|
for (const [category, servers] of Object.entries(serversByCategory)) {
|
|
9703
|
-
const choices = servers.map((s) =>
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9718
|
+
const choices = servers.map((s) => {
|
|
9719
|
+
const isInstalledAtUserLevel = userInstalledSet.has(s.id);
|
|
9720
|
+
const isInstalledAtProjectLevel = projectInstalledSet.has(s.id);
|
|
9721
|
+
if (isInstalledAtUserLevel) {
|
|
9722
|
+
return {
|
|
9723
|
+
name: `${s.name} - ${s.description} ${colors.muted("(already installed at user level)")}`,
|
|
9724
|
+
value: s.id,
|
|
9725
|
+
checked: false,
|
|
9726
|
+
disabled: "already installed at user level"
|
|
9727
|
+
};
|
|
9728
|
+
}
|
|
9729
|
+
if (isInstalledAtProjectLevel) {
|
|
9730
|
+
return {
|
|
9731
|
+
name: `${s.name} - ${s.description} ${colors.muted("(already installed at project level)")}`,
|
|
9732
|
+
value: s.id,
|
|
9733
|
+
checked: false,
|
|
9734
|
+
disabled: "already installed at project level"
|
|
9735
|
+
};
|
|
9736
|
+
}
|
|
9737
|
+
return {
|
|
9738
|
+
name: `${s.name} - ${s.description}`,
|
|
9739
|
+
value: s.id,
|
|
9740
|
+
checked: options?.defaults?.servers?.some((i) => i.serverId === s.id) ?? false
|
|
9741
|
+
};
|
|
9742
|
+
});
|
|
9708
9743
|
const categoryLabel = formatCategory(category);
|
|
9709
9744
|
const selected = await checkbox({
|
|
9710
9745
|
message: `${categoryLabel}:`,
|
|
@@ -11202,7 +11237,7 @@ function createMcpConfigStep() {
|
|
|
11202
11237
|
required: false
|
|
11203
11238
|
},
|
|
11204
11239
|
computeDefaults: (ctx) => ctx.mcpConfig,
|
|
11205
|
-
execute: async (
|
|
11240
|
+
execute: async (ctx, defaults) => {
|
|
11206
11241
|
const goBack = await promptBackOption(5, "Configure MCP servers or go back?");
|
|
11207
11242
|
if (goBack) {
|
|
11208
11243
|
return createResult(
|
|
@@ -11210,7 +11245,7 @@ function createMcpConfigStep() {
|
|
|
11210
11245
|
"back"
|
|
11211
11246
|
);
|
|
11212
11247
|
}
|
|
11213
|
-
const result = await promptMcpConfig();
|
|
11248
|
+
const result = await promptMcpConfig({ projectPath: ctx.projectPath });
|
|
11214
11249
|
return createResult(result, "next");
|
|
11215
11250
|
}
|
|
11216
11251
|
};
|
|
@@ -12919,7 +12954,8 @@ async function handleConfigUpdates(projectPath, config, _options) {
|
|
|
12919
12954
|
}
|
|
12920
12955
|
if (reconfigureOptions.includes("mcp")) {
|
|
12921
12956
|
const mcpResult = await promptMcpConfig({
|
|
12922
|
-
defaults: config.mcp
|
|
12957
|
+
defaults: config.mcp,
|
|
12958
|
+
projectPath
|
|
12923
12959
|
});
|
|
12924
12960
|
config.mcp = mcpResult.config;
|
|
12925
12961
|
await installMcpServers(projectPath, mcpResult.config);
|