aicm 0.16.0 → 0.16.1
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/install.js +42 -0
- package/package.json +1 -1
package/dist/commands/install.js
CHANGED
|
@@ -180,6 +180,37 @@ function dedupeCommandsForInstall(commands) {
|
|
|
180
180
|
}
|
|
181
181
|
return Array.from(unique.values());
|
|
182
182
|
}
|
|
183
|
+
function mergeWorkspaceCommands(packages) {
|
|
184
|
+
var _a;
|
|
185
|
+
const commands = [];
|
|
186
|
+
const seenPresetCommands = new Set();
|
|
187
|
+
for (const pkg of packages) {
|
|
188
|
+
const hasCursorTarget = pkg.config.config.targets.includes("cursor");
|
|
189
|
+
if (!hasCursorTarget) {
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
for (const command of (_a = pkg.config.commands) !== null && _a !== void 0 ? _a : []) {
|
|
193
|
+
if (command.presetName) {
|
|
194
|
+
const presetKey = `${command.presetName}::${command.name}`;
|
|
195
|
+
if (seenPresetCommands.has(presetKey)) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
seenPresetCommands.add(presetKey);
|
|
199
|
+
}
|
|
200
|
+
commands.push(command);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
return commands;
|
|
204
|
+
}
|
|
205
|
+
function collectWorkspaceCommandTargets(packages) {
|
|
206
|
+
const targets = new Set();
|
|
207
|
+
for (const pkg of packages) {
|
|
208
|
+
if (pkg.config.config.targets.includes("cursor")) {
|
|
209
|
+
targets.add("cursor");
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return Array.from(targets);
|
|
213
|
+
}
|
|
183
214
|
/**
|
|
184
215
|
* Write MCP servers configuration to IDE targets
|
|
185
216
|
*/
|
|
@@ -455,6 +486,17 @@ async function installWorkspaces(cwd, installOnCI, verbose = false, dryRun = fal
|
|
|
455
486
|
verbose,
|
|
456
487
|
dryRun,
|
|
457
488
|
});
|
|
489
|
+
const workspaceCommands = mergeWorkspaceCommands(packages);
|
|
490
|
+
const workspaceCommandTargets = collectWorkspaceCommandTargets(packages);
|
|
491
|
+
if (workspaceCommands.length > 0) {
|
|
492
|
+
warnPresetCommandCollisions(workspaceCommands);
|
|
493
|
+
}
|
|
494
|
+
if (!dryRun &&
|
|
495
|
+
workspaceCommands.length > 0 &&
|
|
496
|
+
workspaceCommandTargets.length > 0) {
|
|
497
|
+
const dedupedWorkspaceCommands = dedupeCommandsForInstall(workspaceCommands);
|
|
498
|
+
writeCommandsToTargets(dedupedWorkspaceCommands, workspaceCommandTargets);
|
|
499
|
+
}
|
|
458
500
|
const { merged: rootMcp, conflicts } = mergeWorkspaceMcpServers(packages);
|
|
459
501
|
const hasCursorTarget = packages.some((p) => p.config.config.targets.includes("cursor"));
|
|
460
502
|
if (!dryRun && hasCursorTarget && Object.keys(rootMcp).length > 0) {
|