gitnexus 1.4.0 → 1.4.5

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 (102) hide show
  1. package/README.md +19 -18
  2. package/dist/cli/analyze.js +37 -28
  3. package/dist/cli/augment.js +1 -1
  4. package/dist/cli/eval-server.d.ts +1 -1
  5. package/dist/cli/eval-server.js +1 -1
  6. package/dist/cli/index.js +1 -0
  7. package/dist/cli/mcp.js +1 -1
  8. package/dist/cli/setup.js +25 -13
  9. package/dist/cli/status.js +13 -4
  10. package/dist/cli/tool.d.ts +1 -1
  11. package/dist/cli/tool.js +2 -2
  12. package/dist/cli/wiki.js +2 -2
  13. package/dist/config/ignore-service.d.ts +25 -0
  14. package/dist/config/ignore-service.js +76 -0
  15. package/dist/config/supported-languages.d.ts +1 -0
  16. package/dist/config/supported-languages.js +1 -1
  17. package/dist/core/augmentation/engine.js +94 -67
  18. package/dist/core/embeddings/embedder.d.ts +1 -1
  19. package/dist/core/embeddings/embedder.js +1 -1
  20. package/dist/core/embeddings/embedding-pipeline.d.ts +3 -3
  21. package/dist/core/embeddings/embedding-pipeline.js +52 -25
  22. package/dist/core/embeddings/types.d.ts +1 -1
  23. package/dist/core/ingestion/call-processor.d.ts +6 -7
  24. package/dist/core/ingestion/call-processor.js +490 -127
  25. package/dist/core/ingestion/call-routing.d.ts +53 -0
  26. package/dist/core/ingestion/call-routing.js +108 -0
  27. package/dist/core/ingestion/entry-point-scoring.js +13 -2
  28. package/dist/core/ingestion/export-detection.js +1 -0
  29. package/dist/core/ingestion/filesystem-walker.js +4 -3
  30. package/dist/core/ingestion/framework-detection.js +9 -0
  31. package/dist/core/ingestion/heritage-processor.d.ts +3 -4
  32. package/dist/core/ingestion/heritage-processor.js +40 -50
  33. package/dist/core/ingestion/import-processor.d.ts +3 -5
  34. package/dist/core/ingestion/import-processor.js +41 -10
  35. package/dist/core/ingestion/parsing-processor.d.ts +2 -1
  36. package/dist/core/ingestion/parsing-processor.js +41 -4
  37. package/dist/core/ingestion/pipeline.d.ts +5 -1
  38. package/dist/core/ingestion/pipeline.js +174 -121
  39. package/dist/core/ingestion/resolution-context.d.ts +53 -0
  40. package/dist/core/ingestion/resolution-context.js +132 -0
  41. package/dist/core/ingestion/resolvers/index.d.ts +2 -0
  42. package/dist/core/ingestion/resolvers/index.js +2 -0
  43. package/dist/core/ingestion/resolvers/python.d.ts +19 -0
  44. package/dist/core/ingestion/resolvers/python.js +52 -0
  45. package/dist/core/ingestion/resolvers/ruby.d.ts +12 -0
  46. package/dist/core/ingestion/resolvers/ruby.js +15 -0
  47. package/dist/core/ingestion/resolvers/standard.js +0 -22
  48. package/dist/core/ingestion/resolvers/utils.js +2 -0
  49. package/dist/core/ingestion/symbol-table.d.ts +3 -0
  50. package/dist/core/ingestion/symbol-table.js +1 -0
  51. package/dist/core/ingestion/tree-sitter-queries.d.ts +3 -2
  52. package/dist/core/ingestion/tree-sitter-queries.js +53 -1
  53. package/dist/core/ingestion/type-env.d.ts +32 -10
  54. package/dist/core/ingestion/type-env.js +520 -47
  55. package/dist/core/ingestion/type-extractors/c-cpp.js +326 -1
  56. package/dist/core/ingestion/type-extractors/csharp.js +282 -2
  57. package/dist/core/ingestion/type-extractors/go.js +333 -2
  58. package/dist/core/ingestion/type-extractors/index.d.ts +3 -2
  59. package/dist/core/ingestion/type-extractors/index.js +3 -1
  60. package/dist/core/ingestion/type-extractors/jvm.js +537 -4
  61. package/dist/core/ingestion/type-extractors/php.js +387 -7
  62. package/dist/core/ingestion/type-extractors/python.js +356 -5
  63. package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
  64. package/dist/core/ingestion/type-extractors/ruby.js +389 -0
  65. package/dist/core/ingestion/type-extractors/rust.js +399 -2
  66. package/dist/core/ingestion/type-extractors/shared.d.ts +116 -1
  67. package/dist/core/ingestion/type-extractors/shared.js +488 -14
  68. package/dist/core/ingestion/type-extractors/swift.js +95 -1
  69. package/dist/core/ingestion/type-extractors/types.d.ts +81 -0
  70. package/dist/core/ingestion/type-extractors/typescript.js +436 -2
  71. package/dist/core/ingestion/utils.d.ts +33 -2
  72. package/dist/core/ingestion/utils.js +399 -27
  73. package/dist/core/ingestion/workers/parse-worker.d.ts +18 -1
  74. package/dist/core/ingestion/workers/parse-worker.js +169 -19
  75. package/dist/core/{kuzu → lbug}/csv-generator.d.ts +1 -1
  76. package/dist/core/{kuzu → lbug}/csv-generator.js +1 -1
  77. package/dist/core/{kuzu/kuzu-adapter.d.ts → lbug/lbug-adapter.d.ts} +19 -19
  78. package/dist/core/{kuzu/kuzu-adapter.js → lbug/lbug-adapter.js} +70 -65
  79. package/dist/core/{kuzu → lbug}/schema.d.ts +1 -1
  80. package/dist/core/{kuzu → lbug}/schema.js +1 -1
  81. package/dist/core/search/bm25-index.d.ts +4 -4
  82. package/dist/core/search/bm25-index.js +10 -10
  83. package/dist/core/search/hybrid-search.d.ts +2 -2
  84. package/dist/core/search/hybrid-search.js +6 -6
  85. package/dist/core/tree-sitter/parser-loader.js +9 -2
  86. package/dist/core/wiki/generator.d.ts +2 -2
  87. package/dist/core/wiki/generator.js +4 -4
  88. package/dist/core/wiki/graph-queries.d.ts +4 -4
  89. package/dist/core/wiki/graph-queries.js +7 -7
  90. package/dist/mcp/core/{kuzu-adapter.d.ts → lbug-adapter.d.ts} +7 -7
  91. package/dist/mcp/core/{kuzu-adapter.js → lbug-adapter.js} +72 -43
  92. package/dist/mcp/local/local-backend.d.ts +6 -6
  93. package/dist/mcp/local/local-backend.js +25 -18
  94. package/dist/server/api.js +12 -12
  95. package/dist/server/mcp-http.d.ts +1 -1
  96. package/dist/server/mcp-http.js +1 -1
  97. package/dist/storage/repo-manager.d.ts +20 -2
  98. package/dist/storage/repo-manager.js +55 -1
  99. package/dist/types/pipeline.d.ts +1 -1
  100. package/package.json +5 -3
  101. package/dist/core/ingestion/symbol-resolver.d.ts +0 -32
  102. package/dist/core/ingestion/symbol-resolver.js +0 -83
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.4.0",
3
+ "version": "1.4.5",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -58,7 +58,8 @@
58
58
  "graphology": "^0.25.4",
59
59
  "graphology-indices": "^0.17.0",
60
60
  "graphology-utils": "^2.3.0",
61
- "kuzu": "^0.11.3",
61
+ "@ladybugdb/core": "^0.15.1",
62
+ "ignore": "^7.0.5",
62
63
  "lru-cache": "^11.0.0",
63
64
  "mnemonist": "^0.39.0",
64
65
  "pandemonium": "^2.4.0",
@@ -69,14 +70,15 @@
69
70
  "tree-sitter-go": "^0.21.0",
70
71
  "tree-sitter-java": "^0.21.0",
71
72
  "tree-sitter-javascript": "^0.21.0",
72
- "tree-sitter-kotlin": "^0.3.8",
73
73
  "tree-sitter-php": "^0.23.12",
74
74
  "tree-sitter-python": "^0.21.0",
75
+ "tree-sitter-ruby": "^0.23.1",
75
76
  "tree-sitter-rust": "^0.21.0",
76
77
  "tree-sitter-typescript": "^0.21.0",
77
78
  "uuid": "^13.0.0"
78
79
  },
79
80
  "optionalDependencies": {
81
+ "tree-sitter-kotlin": "^0.3.8",
80
82
  "tree-sitter-swift": "^0.6.0"
81
83
  },
82
84
  "devDependencies": {
@@ -1,32 +0,0 @@
1
- /**
2
- * Symbol Resolver
3
- *
4
- * Import-filtered candidate narrowing for bare identifier resolution.
5
- * NOT FQN resolution — does not parse qualifiers (ns::Bar, com.foo.Bar).
6
- *
7
- * Shared between heritage-processor.ts and call-processor.ts.
8
- */
9
- import type { SymbolTable, SymbolDefinition } from './symbol-table.js';
10
- import type { ImportMap, PackageMap, NamedImportMap } from './import-processor.js';
11
- /** Resolution tier for internal tracking, logging, and test assertions. */
12
- export type ResolutionTier = 'same-file' | 'import-scoped' | 'unique-global';
13
- /** Internal resolution result preserving tier metadata. */
14
- export interface InternalResolution {
15
- definition: SymbolDefinition;
16
- tier: ResolutionTier;
17
- candidateCount: number;
18
- }
19
- /**
20
- * Resolve a bare identifier to its best-matching definition using import context.
21
- *
22
- * Resolution tiers (highest confidence first):
23
- * 1. Same file (lookupExactFull — authoritative)
24
- * 2. Import-scoped (lookupFuzzy filtered by importMap — acceptable)
25
- * 3. Unique global (lookupFuzzy with exactly 1 match — acceptable fallback)
26
- *
27
- * If multiple global candidates remain after filtering, returns null.
28
- * A wrong edge is worse than no edge.
29
- */
30
- export declare const resolveSymbol: (name: string, currentFilePath: string, symbolTable: SymbolTable, importMap: ImportMap, packageMap?: PackageMap, namedImportMap?: NamedImportMap) => SymbolDefinition | null;
31
- /** Internal resolver preserving tier metadata for logging and test assertions. */
32
- export declare const resolveSymbolInternal: (name: string, currentFilePath: string, symbolTable: SymbolTable, importMap: ImportMap, packageMap?: PackageMap, namedImportMap?: NamedImportMap) => InternalResolution | null;
@@ -1,83 +0,0 @@
1
- /**
2
- * Symbol Resolver
3
- *
4
- * Import-filtered candidate narrowing for bare identifier resolution.
5
- * NOT FQN resolution — does not parse qualifiers (ns::Bar, com.foo.Bar).
6
- *
7
- * Shared between heritage-processor.ts and call-processor.ts.
8
- */
9
- import { isFileInPackageDir } from './import-processor.js';
10
- import { walkBindingChain } from './named-binding-extraction.js';
11
- /**
12
- * Resolve a bare identifier to its best-matching definition using import context.
13
- *
14
- * Resolution tiers (highest confidence first):
15
- * 1. Same file (lookupExactFull — authoritative)
16
- * 2. Import-scoped (lookupFuzzy filtered by importMap — acceptable)
17
- * 3. Unique global (lookupFuzzy with exactly 1 match — acceptable fallback)
18
- *
19
- * If multiple global candidates remain after filtering, returns null.
20
- * A wrong edge is worse than no edge.
21
- */
22
- export const resolveSymbol = (name, currentFilePath, symbolTable, importMap, packageMap, namedImportMap) => {
23
- return resolveSymbolInternal(name, currentFilePath, symbolTable, importMap, packageMap, namedImportMap)?.definition ?? null;
24
- };
25
- /** Internal resolver preserving tier metadata for logging and test assertions. */
26
- export const resolveSymbolInternal = (name, currentFilePath, symbolTable, importMap, packageMap, namedImportMap) => {
27
- // Tier 1: Same file — authoritative match
28
- const localDef = symbolTable.lookupExactFull(currentFilePath, name);
29
- if (localDef)
30
- return { definition: localDef, tier: 'same-file', candidateCount: 1 };
31
- // Get all global definitions for subsequent tiers
32
- const allDefs = symbolTable.lookupFuzzy(name);
33
- // Tier 2a-named: Check named bindings BEFORE the empty-allDefs early return,
34
- // because aliased imports (import { User as U }) mean lookupFuzzy('U') returns
35
- // empty but we can resolve via the exported name.
36
- if (namedImportMap) {
37
- const result = resolveNamedBindingChain(name, currentFilePath, symbolTable, namedImportMap, allDefs);
38
- if (result)
39
- return result;
40
- }
41
- if (allDefs.length === 0)
42
- return null;
43
- // Tier 2a: Import-scoped — check if any definition is in a file imported by currentFile
44
- const importedFiles = importMap.get(currentFilePath);
45
- if (importedFiles) {
46
- for (const def of allDefs) {
47
- if (importedFiles.has(def.filePath)) {
48
- return { definition: def, tier: 'import-scoped', candidateCount: allDefs.length };
49
- }
50
- }
51
- }
52
- // Tier 2b: Package-scoped — check if any definition is in a package/namespace dir imported by currentFile
53
- // Used for Go packages and C# namespace imports to avoid ImportMap expansion bloat
54
- const importedPackages = packageMap?.get(currentFilePath);
55
- if (importedPackages) {
56
- for (const def of allDefs) {
57
- for (const dirSuffix of importedPackages) {
58
- if (isFileInPackageDir(def.filePath, dirSuffix)) {
59
- return { definition: def, tier: 'import-scoped', candidateCount: allDefs.length };
60
- }
61
- }
62
- }
63
- }
64
- // Tier 3: Unique global — ONLY if exactly one candidate exists
65
- // Ambiguous global matches are refused. A wrong edge is worse than no edge.
66
- if (allDefs.length === 1) {
67
- return { definition: allDefs[0], tier: 'unique-global', candidateCount: 1 };
68
- }
69
- // Ambiguous: multiple global candidates, no import or same-file match → refuse
70
- return null;
71
- };
72
- /**
73
- * Follow re-export chains through NamedImportMap.
74
- * Delegates chain-walking to the shared walkBindingChain utility, then
75
- * applies symbol-resolver semantics: exactly one match required.
76
- */
77
- const resolveNamedBindingChain = (name, currentFilePath, symbolTable, namedImportMap, allDefs) => {
78
- const defs = walkBindingChain(name, currentFilePath, symbolTable, namedImportMap, allDefs);
79
- if (defs?.length === 1) {
80
- return { definition: defs[0], tier: 'import-scoped', candidateCount: defs.length };
81
- }
82
- return null;
83
- };