refactor: streamline claude-mem integration and remove unused code
- Updated CODEMAP to reflect changes in fallback methods for package root discovery. - Removed the `detectClaudePath` function and replaced its usage with direct references to `PACKAGE_NAME`. - Eliminated the `claudePath` property from Settings interface and user settings configuration. - Cleaned up path discovery logic by removing the npm list command method. - Removed the `findExecutable` method from the Platform utility as it was no longer needed.
This commit is contained in:
@@ -182,7 +182,7 @@ export class PathDiscovery {
|
||||
// Method 2: Walk up from current module location
|
||||
const currentFile = fileURLToPath(import.meta.url);
|
||||
let currentDir = dirname(currentFile);
|
||||
|
||||
|
||||
for (let i = 0; i < 10; i++) {
|
||||
const packageJsonPath = join(currentDir, 'package.json');
|
||||
if (existsSync(packageJsonPath)) {
|
||||
@@ -198,21 +198,6 @@ export class PathDiscovery {
|
||||
currentDir = parentDir;
|
||||
}
|
||||
|
||||
// Method 3: Try npm list command
|
||||
try {
|
||||
const npmOutput = execSync('npm list -g claude-mem --json 2>/dev/null || npm list claude-mem --json 2>/dev/null', {
|
||||
encoding: 'utf8'
|
||||
});
|
||||
const npmData = JSON.parse(npmOutput);
|
||||
|
||||
if (npmData.dependencies?.['claude-mem']?.resolved) {
|
||||
this._packageRoot = dirname(npmData.dependencies['claude-mem'].resolved);
|
||||
return this._packageRoot;
|
||||
}
|
||||
} catch {
|
||||
// Continue to error
|
||||
}
|
||||
|
||||
throw new Error('Cannot locate claude-mem package root. Ensure claude-mem is properly installed.');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user