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

@@ -0,0 +1,26 @@
'use strict';
const path = require('path');
function toCursorAgentFileName(fileName) {
if (!fileName || fileName.startsWith('ecc-')) {
return fileName;
}
return `ecc-${fileName}`;
}
function toCursorAgentRelativePath(relativePath) {
const segments = String(relativePath || '').split(/[\\/]+/).filter(Boolean);
if (segments.length === 0) {
return relativePath;
}
const fileName = segments.pop();
return path.join(...segments, toCursorAgentFileName(fileName));
}
module.exports = {
toCursorAgentFileName,
toCursorAgentRelativePath,
};