everything-claude-code/scripts/lib/cursor-agent-names.js
2026-04-30 02:19:57 -04:00

27 lines
567 B
JavaScript

'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,
};