@softerist/heuristic-mcp 3.0.14 → 3.0.16

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.
Files changed (49) hide show
  1. package/README.md +90 -82
  2. package/config.jsonc +173 -173
  3. package/features/ann-config.js +131 -0
  4. package/features/clear-cache.js +84 -0
  5. package/features/find-similar-code.js +291 -0
  6. package/features/hybrid-search.js +544 -0
  7. package/features/index-codebase.js +3268 -0
  8. package/features/lifecycle.js +1189 -0
  9. package/features/package-version.js +302 -0
  10. package/features/register.js +408 -0
  11. package/features/resources.js +156 -0
  12. package/features/set-workspace.js +265 -0
  13. package/index.js +136 -69
  14. package/lib/cache-ops.js +22 -22
  15. package/lib/cache-utils.js +565 -565
  16. package/lib/cache.js +1870 -1870
  17. package/lib/call-graph.js +396 -396
  18. package/lib/cli.js +1 -1
  19. package/lib/config.js +487 -427
  20. package/lib/constants.js +31 -0
  21. package/lib/embed-query-process.js +7 -7
  22. package/lib/embedding-process.js +7 -7
  23. package/lib/embedding-worker.js +299 -299
  24. package/lib/ignore-patterns.js +316 -316
  25. package/lib/json-worker.js +14 -14
  26. package/lib/json-writer.js +337 -337
  27. package/lib/logging.js +164 -164
  28. package/lib/memory-logger.js +13 -13
  29. package/lib/onnx-backend.js +193 -193
  30. package/lib/project-detector.js +84 -84
  31. package/lib/server-lifecycle.js +165 -165
  32. package/lib/settings-editor.js +754 -638
  33. package/lib/tokenizer.js +256 -256
  34. package/lib/utils.js +428 -428
  35. package/lib/vector-store-binary.js +627 -627
  36. package/lib/vector-store-sqlite.js +95 -95
  37. package/lib/workspace-env.js +28 -0
  38. package/mcp_config.json +9 -9
  39. package/package.json +86 -75
  40. package/scripts/clear-cache.js +20 -0
  41. package/scripts/download-model.js +43 -0
  42. package/scripts/mcp-launcher.js +49 -0
  43. package/scripts/postinstall.js +12 -0
  44. package/search-configs.js +36 -36
  45. package/.prettierrc +0 -7
  46. package/debug-pids.js +0 -30
  47. package/eslint.config.js +0 -36
  48. package/specs/plan.md +0 -23
  49. package/vitest.config.js +0 -39
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
+ }