mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-30 16:45:48 +08:00
27 lines
567 B
JavaScript
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,
|
|
};
|