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:
Alex Newman
2025-10-16 14:24:32 -04:00
parent 6e9be84a01
commit eddb321489
6 changed files with 90 additions and 131 deletions
+1 -16
View File
@@ -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.');
}