fix: namespace cursor agent installs

This commit is contained in:
Affaan Mustafa
2026-04-30 02:12:24 -04:00
committed by Affaan Mustafa
parent 5881554a1c
commit e1d6d853f7
9 changed files with 121 additions and 7 deletions

View File

@@ -1,7 +1,9 @@
const fs = require('fs');
const path = require('path');
const { toCursorAgentFileName } = require('../cursor-agent-names');
const {
createFlatFileOperations,
createFlatRuleOperations,
createInstallTargetAdapter,
createManagedOperation,
@@ -149,6 +151,16 @@ module.exports = createInstallTargetAdapter({
}));
}
if (sourceRelativePath === 'agents') {
return takeUniqueOperations(createFlatFileOperations({
moduleId: module.id,
repoRoot,
sourceRelativePath,
destinationDir: path.join(targetRoot, 'agents'),
destinationNameTransform: toCursorAgentFileName,
}));
}
if (sourceRelativePath === '.cursor') {
const cursorRoot = path.join(repoRoot, '.cursor');
if (!fs.existsSync(cursorRoot) || !fs.statSync(cursorRoot).isDirectory()) {