@softerist/heuristic-mcp 3.2.3 → 3.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +387 -376
- package/config.jsonc +800 -800
- package/features/ann-config.js +102 -110
- package/features/clear-cache.js +81 -84
- package/features/find-similar-code.js +265 -286
- package/features/hybrid-search.js +487 -536
- package/features/index-codebase.js +3139 -3270
- package/features/lifecycle.js +1011 -1063
- package/features/package-version.js +277 -291
- package/features/register.js +351 -370
- package/features/resources.js +115 -130
- package/features/set-workspace.js +214 -240
- package/index.js +693 -758
- package/lib/cache-ops.js +22 -22
- package/lib/cache-utils.js +465 -519
- package/lib/cache.js +1749 -1849
- package/lib/call-graph.js +396 -396
- package/lib/cli.js +232 -226
- package/lib/config.js +1483 -1495
- package/lib/constants.js +511 -493
- package/lib/embed-query-process.js +206 -212
- package/lib/embedding-process.js +434 -451
- package/lib/embedding-worker.js +862 -934
- package/lib/ignore-patterns.js +276 -316
- package/lib/json-worker.js +14 -14
- package/lib/json-writer.js +302 -310
- package/lib/logging.js +116 -127
- package/lib/memory-logger.js +13 -13
- package/lib/onnx-backend.js +188 -193
- package/lib/path-utils.js +18 -23
- package/lib/project-detector.js +82 -84
- package/lib/server-lifecycle.js +133 -145
- package/lib/settings-editor.js +738 -739
- package/lib/slice-normalize.js +25 -31
- package/lib/tokenizer.js +168 -203
- package/lib/utils.js +364 -409
- package/lib/vector-store-binary.js +973 -991
- package/lib/vector-store-sqlite.js +377 -414
- package/lib/workspace-env.js +32 -34
- package/mcp_config.json +9 -9
- package/package.json +86 -86
- package/scripts/clear-cache.js +20 -20
- package/scripts/download-model.js +43 -43
- package/scripts/mcp-launcher.js +49 -49
- package/scripts/postinstall.js +12 -12
- package/search-configs.js +36 -36
package/lib/cache-ops.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import fs from 'fs/promises';
|
|
2
|
-
import { loadConfig } from './config.js';
|
|
3
|
-
import { clearStaleCaches } from './cache-utils.js';
|
|
4
|
-
|
|
5
|
-
export async function clearCache(workspaceDir) {
|
|
6
|
-
const effectiveWorkspace = workspaceDir || process.cwd();
|
|
7
|
-
const activeConfig = await loadConfig(effectiveWorkspace);
|
|
8
|
-
|
|
9
|
-
if (!activeConfig.enableCache) {
|
|
10
|
-
console.info('[Cache] Cache disabled (enableCache=false); nothing to clear.');
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
try {
|
|
15
|
-
await fs.rm(activeConfig.cacheDirectory, { recursive: true, force: true });
|
|
16
|
-
console.info(`[Cache] Cleared cache directory: ${activeConfig.cacheDirectory}`);
|
|
17
|
-
await clearStaleCaches();
|
|
18
|
-
} catch (err) {
|
|
19
|
-
console.error(`[Cache] Failed to clear cache: ${err.message}`);
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import { loadConfig } from './config.js';
|
|
3
|
+
import { clearStaleCaches } from './cache-utils.js';
|
|
4
|
+
|
|
5
|
+
export async function clearCache(workspaceDir) {
|
|
6
|
+
const effectiveWorkspace = workspaceDir || process.cwd();
|
|
7
|
+
const activeConfig = await loadConfig(effectiveWorkspace);
|
|
8
|
+
|
|
9
|
+
if (!activeConfig.enableCache) {
|
|
10
|
+
console.info('[Cache] Cache disabled (enableCache=false); nothing to clear.');
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
try {
|
|
15
|
+
await fs.rm(activeConfig.cacheDirectory, { recursive: true, force: true });
|
|
16
|
+
console.info(`[Cache] Cleared cache directory: ${activeConfig.cacheDirectory}`);
|
|
17
|
+
await clearStaleCaches();
|
|
18
|
+
} catch (err) {
|
|
19
|
+
console.error(`[Cache] Failed to clear cache: ${err.message}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
}
|