@softerist/heuristic-mcp 3.0.15 → 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 +104 -104
  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 +96 -96
  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 +517 -517
  20. package/lib/constants.js +39 -39
  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 -754
  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 -28
  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/.prettierrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "semi": true,
3
- "singleQuote": true,
4
- "tabWidth": 2,
5
- "trailingComma": "es5",
6
- "printWidth": 100
7
- }
package/debug-pids.js DELETED
@@ -1,30 +0,0 @@
1
- import { exec } from 'child_process';
2
- import util from 'util';
3
-
4
- const execPromise = util.promisify(exec);
5
-
6
- async function check() {
7
- console.info('Checking processes...');
8
- try {
9
- const { stdout } = await execPromise(
10
- `powershell -NoProfile -Command "Get-CimInstance Win32_Process | Where-Object { $_.Name -eq 'node.exe' } | Select-Object ProcessId, CommandLine, ParentProcessId | ConvertTo-Json"`
11
- );
12
- const processes = JSON.parse(stdout);
13
- const list = Array.isArray(processes) ? processes : [processes];
14
-
15
- for (const p of list) {
16
- if (
17
- p.CommandLine &&
18
- (p.CommandLine.includes('heuristic-mcp') || p.CommandLine.includes('index.js'))
19
- ) {
20
- console.info(`PID: ${p.ProcessId}, Parent: ${p.ParentProcessId}`);
21
- console.info(`CMD: ${p.CommandLine}`);
22
- console.info('---');
23
- }
24
- }
25
- } catch (err) {
26
- console.error('Error:', err.message);
27
- }
28
- }
29
-
30
- check();
package/eslint.config.js DELETED
@@ -1,36 +0,0 @@
1
- import js from '@eslint/js';
2
- import globals from 'globals';
3
-
4
- export default [
5
- {
6
- ignores: ['node_modules/**', 'coverage/**', '.vitest-coverage/**'],
7
- },
8
- js.configs.recommended,
9
- {
10
- files: ['**/*.js'],
11
- languageOptions: {
12
- ecmaVersion: 2022,
13
- sourceType: 'module',
14
- globals: {
15
- ...globals.node,
16
- ...globals.es2021,
17
- },
18
- },
19
- rules: {
20
- 'no-unused-vars': ['warn', { argsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_' }],
21
- 'no-console': ['warn', { allow: ['warn', 'error', 'info'] }],
22
- },
23
- },
24
- {
25
- files: ['scripts/**/*.js', 'test/**/*.js'],
26
- rules: {
27
- 'no-console': 'off',
28
- },
29
- },
30
- {
31
- files: ['test/**/*.js'],
32
- rules: {
33
- 'no-unused-vars': 'off',
34
- },
35
- },
36
- ];
package/specs/plan.md DELETED
@@ -1,23 +0,0 @@
1
- # Invoking heuristic-mcp Tools Plan
2
-
3
- ## Why (Architectural intent)
4
- The goal is to demonstrate the capabilities of the `heuristic-mcp` server by invoking its core tools in a logical sequence.
5
-
6
- ## How (Proposed changes)
7
- I will use the `antigravity` toolset to call the MCP tools directly.
8
- Sequence:
9
- 1. `b_index_codebase`
10
- 2. `e_check_package_version`
11
- 3. `f_set_workspace`
12
- 4. `d_ann_config`
13
- 5. `a_semantic_search`
14
- 6. `d_find_similar_code`
15
- 7. `c_clear_cache`
16
-
17
- ## Risks (What might break?)
18
- - Reindexing might take time depending on the codebase size.
19
- - Clearing cache will require a subsequent reindex for search tools to work.
20
-
21
- ## Verification (How will we prove it works?)
22
- - Capture and display the JSON output of each MCP call.
23
- - Run `npm test` on key features to ensure system stability.
package/vitest.config.js DELETED
@@ -1,39 +0,0 @@
1
- import { defineConfig } from 'vitest/config';
2
-
3
- export default defineConfig({
4
- test: {
5
- // Test files pattern
6
- include: ['test/**/*.test.js'],
7
-
8
- // Global test timeout (embedding models can be slow)
9
- testTimeout: 180000,
10
-
11
- // Hook timeout for setup/teardown
12
- hookTimeout: 180000,
13
-
14
- // Run test files sequentially to avoid resource conflicts
15
- // Each file loads the embedding model which uses significant memory
16
- fileParallelism: false,
17
-
18
- // Run tests within a file sequentially
19
- sequence: {
20
- concurrent: false,
21
- },
22
-
23
- // Verbose output
24
- reporters: ['verbose'],
25
-
26
- // Isolate tests to prevent memory leaks between test files
27
- isolate: true,
28
-
29
- coverage: {
30
- provider: 'v8',
31
- all: true,
32
- include: ['features/**/*.js', 'lib/**/*.js', 'index.js'],
33
- exclude: ['**/test/**'],
34
- reporter: ['text', 'html', 'json'],
35
- reportsDirectory: '.vitest-coverage',
36
- clean: true,
37
- },
38
- },
39
- });