@veewo/gitnexus 1.3.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.
Files changed (231) hide show
  1. package/README.md +234 -0
  2. package/dist/benchmark/agent-context/evaluators.d.ts +9 -0
  3. package/dist/benchmark/agent-context/evaluators.js +196 -0
  4. package/dist/benchmark/agent-context/evaluators.test.d.ts +1 -0
  5. package/dist/benchmark/agent-context/evaluators.test.js +39 -0
  6. package/dist/benchmark/agent-context/io.d.ts +2 -0
  7. package/dist/benchmark/agent-context/io.js +23 -0
  8. package/dist/benchmark/agent-context/io.test.d.ts +1 -0
  9. package/dist/benchmark/agent-context/io.test.js +19 -0
  10. package/dist/benchmark/agent-context/report.d.ts +2 -0
  11. package/dist/benchmark/agent-context/report.js +59 -0
  12. package/dist/benchmark/agent-context/report.test.d.ts +1 -0
  13. package/dist/benchmark/agent-context/report.test.js +85 -0
  14. package/dist/benchmark/agent-context/runner.d.ts +46 -0
  15. package/dist/benchmark/agent-context/runner.js +111 -0
  16. package/dist/benchmark/agent-context/runner.test.d.ts +1 -0
  17. package/dist/benchmark/agent-context/runner.test.js +79 -0
  18. package/dist/benchmark/agent-context/tool-runner.d.ts +7 -0
  19. package/dist/benchmark/agent-context/tool-runner.js +18 -0
  20. package/dist/benchmark/agent-context/tool-runner.test.d.ts +1 -0
  21. package/dist/benchmark/agent-context/tool-runner.test.js +11 -0
  22. package/dist/benchmark/agent-context/types.d.ts +40 -0
  23. package/dist/benchmark/agent-context/types.js +1 -0
  24. package/dist/benchmark/analyze-runner.d.ts +16 -0
  25. package/dist/benchmark/analyze-runner.js +51 -0
  26. package/dist/benchmark/analyze-runner.test.d.ts +1 -0
  27. package/dist/benchmark/analyze-runner.test.js +37 -0
  28. package/dist/benchmark/evaluators.d.ts +6 -0
  29. package/dist/benchmark/evaluators.js +10 -0
  30. package/dist/benchmark/evaluators.test.d.ts +1 -0
  31. package/dist/benchmark/evaluators.test.js +12 -0
  32. package/dist/benchmark/io.d.ts +7 -0
  33. package/dist/benchmark/io.js +25 -0
  34. package/dist/benchmark/io.test.d.ts +1 -0
  35. package/dist/benchmark/io.test.js +35 -0
  36. package/dist/benchmark/neonspark-candidates.d.ts +19 -0
  37. package/dist/benchmark/neonspark-candidates.js +94 -0
  38. package/dist/benchmark/neonspark-candidates.test.d.ts +1 -0
  39. package/dist/benchmark/neonspark-candidates.test.js +43 -0
  40. package/dist/benchmark/neonspark-materialize.d.ts +19 -0
  41. package/dist/benchmark/neonspark-materialize.js +111 -0
  42. package/dist/benchmark/neonspark-materialize.test.d.ts +1 -0
  43. package/dist/benchmark/neonspark-materialize.test.js +124 -0
  44. package/dist/benchmark/neonspark-sync.d.ts +3 -0
  45. package/dist/benchmark/neonspark-sync.js +53 -0
  46. package/dist/benchmark/neonspark-sync.test.d.ts +1 -0
  47. package/dist/benchmark/neonspark-sync.test.js +20 -0
  48. package/dist/benchmark/report.d.ts +1 -0
  49. package/dist/benchmark/report.js +7 -0
  50. package/dist/benchmark/runner.d.ts +48 -0
  51. package/dist/benchmark/runner.js +302 -0
  52. package/dist/benchmark/runner.test.d.ts +1 -0
  53. package/dist/benchmark/runner.test.js +50 -0
  54. package/dist/benchmark/scoring.d.ts +16 -0
  55. package/dist/benchmark/scoring.js +27 -0
  56. package/dist/benchmark/scoring.test.d.ts +1 -0
  57. package/dist/benchmark/scoring.test.js +24 -0
  58. package/dist/benchmark/tool-runner.d.ts +6 -0
  59. package/dist/benchmark/tool-runner.js +17 -0
  60. package/dist/benchmark/types.d.ts +36 -0
  61. package/dist/benchmark/types.js +1 -0
  62. package/dist/cli/ai-context.d.ts +22 -0
  63. package/dist/cli/ai-context.js +184 -0
  64. package/dist/cli/ai-context.test.d.ts +1 -0
  65. package/dist/cli/ai-context.test.js +30 -0
  66. package/dist/cli/analyze-multi-scope-regression.test.d.ts +1 -0
  67. package/dist/cli/analyze-multi-scope-regression.test.js +22 -0
  68. package/dist/cli/analyze-options.d.ts +7 -0
  69. package/dist/cli/analyze-options.js +56 -0
  70. package/dist/cli/analyze-options.test.d.ts +1 -0
  71. package/dist/cli/analyze-options.test.js +36 -0
  72. package/dist/cli/analyze.d.ts +14 -0
  73. package/dist/cli/analyze.js +384 -0
  74. package/dist/cli/augment.d.ts +13 -0
  75. package/dist/cli/augment.js +33 -0
  76. package/dist/cli/benchmark-agent-context.d.ts +29 -0
  77. package/dist/cli/benchmark-agent-context.js +61 -0
  78. package/dist/cli/benchmark-agent-context.test.d.ts +1 -0
  79. package/dist/cli/benchmark-agent-context.test.js +80 -0
  80. package/dist/cli/benchmark-unity.d.ts +15 -0
  81. package/dist/cli/benchmark-unity.js +31 -0
  82. package/dist/cli/benchmark-unity.test.d.ts +1 -0
  83. package/dist/cli/benchmark-unity.test.js +18 -0
  84. package/dist/cli/claude-hooks.d.ts +22 -0
  85. package/dist/cli/claude-hooks.js +97 -0
  86. package/dist/cli/clean.d.ts +10 -0
  87. package/dist/cli/clean.js +60 -0
  88. package/dist/cli/eval-server.d.ts +30 -0
  89. package/dist/cli/eval-server.js +372 -0
  90. package/dist/cli/index.d.ts +2 -0
  91. package/dist/cli/index.js +182 -0
  92. package/dist/cli/list.d.ts +6 -0
  93. package/dist/cli/list.js +33 -0
  94. package/dist/cli/mcp.d.ts +8 -0
  95. package/dist/cli/mcp.js +34 -0
  96. package/dist/cli/repo-manager-alias.test.d.ts +1 -0
  97. package/dist/cli/repo-manager-alias.test.js +40 -0
  98. package/dist/cli/scope-filter.test.d.ts +1 -0
  99. package/dist/cli/scope-filter.test.js +49 -0
  100. package/dist/cli/serve.d.ts +4 -0
  101. package/dist/cli/serve.js +6 -0
  102. package/dist/cli/setup.d.ts +8 -0
  103. package/dist/cli/setup.js +311 -0
  104. package/dist/cli/setup.test.d.ts +1 -0
  105. package/dist/cli/setup.test.js +31 -0
  106. package/dist/cli/status.d.ts +6 -0
  107. package/dist/cli/status.js +27 -0
  108. package/dist/cli/tool.d.ts +40 -0
  109. package/dist/cli/tool.js +94 -0
  110. package/dist/cli/version.test.d.ts +1 -0
  111. package/dist/cli/version.test.js +19 -0
  112. package/dist/cli/wiki.d.ts +15 -0
  113. package/dist/cli/wiki.js +361 -0
  114. package/dist/config/ignore-service.d.ts +1 -0
  115. package/dist/config/ignore-service.js +210 -0
  116. package/dist/config/supported-languages.d.ts +12 -0
  117. package/dist/config/supported-languages.js +15 -0
  118. package/dist/core/augmentation/engine.d.ts +26 -0
  119. package/dist/core/augmentation/engine.js +213 -0
  120. package/dist/core/embeddings/embedder.d.ts +60 -0
  121. package/dist/core/embeddings/embedder.js +251 -0
  122. package/dist/core/embeddings/embedding-pipeline.d.ts +51 -0
  123. package/dist/core/embeddings/embedding-pipeline.js +329 -0
  124. package/dist/core/embeddings/index.d.ts +9 -0
  125. package/dist/core/embeddings/index.js +9 -0
  126. package/dist/core/embeddings/text-generator.d.ts +24 -0
  127. package/dist/core/embeddings/text-generator.js +182 -0
  128. package/dist/core/embeddings/types.d.ts +87 -0
  129. package/dist/core/embeddings/types.js +32 -0
  130. package/dist/core/graph/graph.d.ts +2 -0
  131. package/dist/core/graph/graph.js +66 -0
  132. package/dist/core/graph/types.d.ts +61 -0
  133. package/dist/core/graph/types.js +1 -0
  134. package/dist/core/ingestion/ast-cache.d.ts +11 -0
  135. package/dist/core/ingestion/ast-cache.js +34 -0
  136. package/dist/core/ingestion/call-processor.d.ts +15 -0
  137. package/dist/core/ingestion/call-processor.js +327 -0
  138. package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
  139. package/dist/core/ingestion/cluster-enricher.js +170 -0
  140. package/dist/core/ingestion/community-processor.d.ts +39 -0
  141. package/dist/core/ingestion/community-processor.js +312 -0
  142. package/dist/core/ingestion/entry-point-scoring.d.ts +39 -0
  143. package/dist/core/ingestion/entry-point-scoring.js +260 -0
  144. package/dist/core/ingestion/filesystem-walker.d.ts +28 -0
  145. package/dist/core/ingestion/filesystem-walker.js +80 -0
  146. package/dist/core/ingestion/framework-detection.d.ts +39 -0
  147. package/dist/core/ingestion/framework-detection.js +235 -0
  148. package/dist/core/ingestion/heritage-processor.d.ts +20 -0
  149. package/dist/core/ingestion/heritage-processor.js +197 -0
  150. package/dist/core/ingestion/import-processor.d.ts +38 -0
  151. package/dist/core/ingestion/import-processor.js +778 -0
  152. package/dist/core/ingestion/parsing-processor.d.ts +15 -0
  153. package/dist/core/ingestion/parsing-processor.js +291 -0
  154. package/dist/core/ingestion/pipeline.d.ts +5 -0
  155. package/dist/core/ingestion/pipeline.js +323 -0
  156. package/dist/core/ingestion/process-processor.d.ts +51 -0
  157. package/dist/core/ingestion/process-processor.js +309 -0
  158. package/dist/core/ingestion/scope-filter.d.ts +25 -0
  159. package/dist/core/ingestion/scope-filter.js +100 -0
  160. package/dist/core/ingestion/structure-processor.d.ts +2 -0
  161. package/dist/core/ingestion/structure-processor.js +36 -0
  162. package/dist/core/ingestion/symbol-table.d.ts +33 -0
  163. package/dist/core/ingestion/symbol-table.js +38 -0
  164. package/dist/core/ingestion/tree-sitter-queries.d.ts +12 -0
  165. package/dist/core/ingestion/tree-sitter-queries.js +398 -0
  166. package/dist/core/ingestion/utils.d.ts +10 -0
  167. package/dist/core/ingestion/utils.js +50 -0
  168. package/dist/core/ingestion/workers/parse-worker.d.ts +59 -0
  169. package/dist/core/ingestion/workers/parse-worker.js +672 -0
  170. package/dist/core/ingestion/workers/worker-pool.d.ts +16 -0
  171. package/dist/core/ingestion/workers/worker-pool.js +120 -0
  172. package/dist/core/kuzu/csv-generator.d.ts +29 -0
  173. package/dist/core/kuzu/csv-generator.js +336 -0
  174. package/dist/core/kuzu/kuzu-adapter.d.ts +101 -0
  175. package/dist/core/kuzu/kuzu-adapter.js +753 -0
  176. package/dist/core/kuzu/schema.d.ts +53 -0
  177. package/dist/core/kuzu/schema.js +407 -0
  178. package/dist/core/search/bm25-index.d.ts +23 -0
  179. package/dist/core/search/bm25-index.js +95 -0
  180. package/dist/core/search/hybrid-search.d.ts +49 -0
  181. package/dist/core/search/hybrid-search.js +118 -0
  182. package/dist/core/tree-sitter/parser-loader.d.ts +4 -0
  183. package/dist/core/tree-sitter/parser-loader.js +44 -0
  184. package/dist/core/wiki/generator.d.ts +110 -0
  185. package/dist/core/wiki/generator.js +786 -0
  186. package/dist/core/wiki/graph-queries.d.ts +80 -0
  187. package/dist/core/wiki/graph-queries.js +238 -0
  188. package/dist/core/wiki/html-viewer.d.ts +10 -0
  189. package/dist/core/wiki/html-viewer.js +297 -0
  190. package/dist/core/wiki/llm-client.d.ts +40 -0
  191. package/dist/core/wiki/llm-client.js +162 -0
  192. package/dist/core/wiki/prompts.d.ts +53 -0
  193. package/dist/core/wiki/prompts.js +174 -0
  194. package/dist/lib/utils.d.ts +1 -0
  195. package/dist/lib/utils.js +3 -0
  196. package/dist/mcp/core/embedder.d.ts +27 -0
  197. package/dist/mcp/core/embedder.js +108 -0
  198. package/dist/mcp/core/kuzu-adapter.d.ts +34 -0
  199. package/dist/mcp/core/kuzu-adapter.js +231 -0
  200. package/dist/mcp/local/local-backend.d.ts +160 -0
  201. package/dist/mcp/local/local-backend.js +1646 -0
  202. package/dist/mcp/resources.d.ts +31 -0
  203. package/dist/mcp/resources.js +407 -0
  204. package/dist/mcp/server.d.ts +23 -0
  205. package/dist/mcp/server.js +251 -0
  206. package/dist/mcp/staleness.d.ts +15 -0
  207. package/dist/mcp/staleness.js +29 -0
  208. package/dist/mcp/tools.d.ts +24 -0
  209. package/dist/mcp/tools.js +195 -0
  210. package/dist/server/api.d.ts +10 -0
  211. package/dist/server/api.js +344 -0
  212. package/dist/server/mcp-http.d.ts +13 -0
  213. package/dist/server/mcp-http.js +100 -0
  214. package/dist/storage/git.d.ts +6 -0
  215. package/dist/storage/git.js +32 -0
  216. package/dist/storage/repo-manager.d.ts +125 -0
  217. package/dist/storage/repo-manager.js +257 -0
  218. package/dist/types/pipeline.d.ts +34 -0
  219. package/dist/types/pipeline.js +18 -0
  220. package/hooks/claude/gitnexus-hook.cjs +135 -0
  221. package/hooks/claude/pre-tool-use.sh +78 -0
  222. package/hooks/claude/session-start.sh +42 -0
  223. package/package.json +92 -0
  224. package/skills/gitnexus-cli.md +82 -0
  225. package/skills/gitnexus-debugging.md +89 -0
  226. package/skills/gitnexus-exploring.md +78 -0
  227. package/skills/gitnexus-guide.md +64 -0
  228. package/skills/gitnexus-impact-analysis.md +97 -0
  229. package/skills/gitnexus-refactoring.md +121 -0
  230. package/vendor/leiden/index.cjs +355 -0
  231. package/vendor/leiden/utils.cjs +392 -0
@@ -0,0 +1,197 @@
1
+ /**
2
+ * Heritage Processor
3
+ *
4
+ * Extracts class inheritance relationships:
5
+ * - EXTENDS: Class extends another Class (TS, JS, Python)
6
+ * - IMPLEMENTS: Class implements an Interface (TS only)
7
+ */
8
+ import Parser from 'tree-sitter';
9
+ import { loadParser, loadLanguage } from '../tree-sitter/parser-loader.js';
10
+ import { LANGUAGE_QUERIES } from './tree-sitter-queries.js';
11
+ import { generateId } from '../../lib/utils.js';
12
+ import { getLanguageFromFilename, yieldToEventLoop } from './utils.js';
13
+ export const processHeritage = async (graph, files, astCache, symbolTable, onProgress) => {
14
+ const parser = await loadParser();
15
+ for (let i = 0; i < files.length; i++) {
16
+ const file = files[i];
17
+ onProgress?.(i + 1, files.length);
18
+ if (i % 20 === 0)
19
+ await yieldToEventLoop();
20
+ // 1. Check language support
21
+ const language = getLanguageFromFilename(file.path);
22
+ if (!language)
23
+ continue;
24
+ const queryStr = LANGUAGE_QUERIES[language];
25
+ if (!queryStr)
26
+ continue;
27
+ // 2. Load the language
28
+ await loadLanguage(language, file.path);
29
+ // 3. Get AST
30
+ let tree = astCache.get(file.path);
31
+ let wasReparsed = false;
32
+ if (!tree) {
33
+ // Use larger bufferSize for files > 32KB
34
+ try {
35
+ tree = parser.parse(file.content, undefined, { bufferSize: 1024 * 256 });
36
+ }
37
+ catch (parseError) {
38
+ // Skip files that can't be parsed
39
+ continue;
40
+ }
41
+ wasReparsed = true;
42
+ // Cache re-parsed tree for potential future use
43
+ astCache.set(file.path, tree);
44
+ }
45
+ let query;
46
+ let matches;
47
+ try {
48
+ const language = parser.getLanguage();
49
+ query = new Parser.Query(language, queryStr);
50
+ matches = query.matches(tree.rootNode);
51
+ }
52
+ catch (queryError) {
53
+ console.warn(`Heritage query error for ${file.path}:`, queryError);
54
+ continue;
55
+ }
56
+ // 4. Process heritage matches
57
+ matches.forEach(match => {
58
+ const captureMap = {};
59
+ match.captures.forEach(c => {
60
+ captureMap[c.name] = c.node;
61
+ });
62
+ // EXTENDS: Class extends another Class
63
+ if (captureMap['heritage.class'] && captureMap['heritage.extends']) {
64
+ const className = captureMap['heritage.class'].text;
65
+ const parentClassName = captureMap['heritage.extends'].text;
66
+ // Resolve both class IDs
67
+ const childId = symbolTable.lookupExact(file.path, className) ||
68
+ symbolTable.lookupFuzzy(className)[0]?.nodeId ||
69
+ generateId('Class', `${file.path}:${className}`);
70
+ const parentId = symbolTable.lookupFuzzy(parentClassName)[0]?.nodeId ||
71
+ generateId('Class', `${parentClassName}`);
72
+ if (childId && parentId && childId !== parentId) {
73
+ const relId = generateId('EXTENDS', `${childId}->${parentId}`);
74
+ graph.addRelationship({
75
+ id: relId,
76
+ sourceId: childId,
77
+ targetId: parentId,
78
+ type: 'EXTENDS',
79
+ confidence: 1.0,
80
+ reason: '',
81
+ });
82
+ }
83
+ }
84
+ // IMPLEMENTS: Class implements Interface (TypeScript only)
85
+ if (captureMap['heritage.class'] && captureMap['heritage.implements']) {
86
+ const className = captureMap['heritage.class'].text;
87
+ const interfaceName = captureMap['heritage.implements'].text;
88
+ // Resolve class and interface IDs
89
+ const classId = symbolTable.lookupExact(file.path, className) ||
90
+ symbolTable.lookupFuzzy(className)[0]?.nodeId ||
91
+ generateId('Class', `${file.path}:${className}`);
92
+ const interfaceId = symbolTable.lookupFuzzy(interfaceName)[0]?.nodeId ||
93
+ generateId('Interface', `${interfaceName}`);
94
+ if (classId && interfaceId) {
95
+ const relId = generateId('IMPLEMENTS', `${classId}->${interfaceId}`);
96
+ graph.addRelationship({
97
+ id: relId,
98
+ sourceId: classId,
99
+ targetId: interfaceId,
100
+ type: 'IMPLEMENTS',
101
+ confidence: 1.0,
102
+ reason: '',
103
+ });
104
+ }
105
+ }
106
+ // IMPLEMENTS (Rust): impl Trait for Struct
107
+ if (captureMap['heritage.trait'] && captureMap['heritage.class']) {
108
+ const structName = captureMap['heritage.class'].text;
109
+ const traitName = captureMap['heritage.trait'].text;
110
+ // Resolve struct and trait IDs
111
+ const structId = symbolTable.lookupExact(file.path, structName) ||
112
+ symbolTable.lookupFuzzy(structName)[0]?.nodeId ||
113
+ generateId('Struct', `${file.path}:${structName}`);
114
+ const traitId = symbolTable.lookupFuzzy(traitName)[0]?.nodeId ||
115
+ generateId('Trait', `${traitName}`);
116
+ if (structId && traitId) {
117
+ const relId = generateId('IMPLEMENTS', `${structId}->${traitId}`);
118
+ graph.addRelationship({
119
+ id: relId,
120
+ sourceId: structId,
121
+ targetId: traitId,
122
+ type: 'IMPLEMENTS',
123
+ confidence: 1.0,
124
+ reason: 'trait-impl',
125
+ });
126
+ }
127
+ }
128
+ });
129
+ // Tree is now owned by the LRU cache — no manual delete needed
130
+ }
131
+ };
132
+ /**
133
+ * Fast path: resolve pre-extracted heritage from workers.
134
+ * No AST parsing — workers already extracted className + parentName + kind.
135
+ */
136
+ export const processHeritageFromExtracted = async (graph, extractedHeritage, symbolTable, onProgress) => {
137
+ const total = extractedHeritage.length;
138
+ for (let i = 0; i < extractedHeritage.length; i++) {
139
+ if (i % 500 === 0) {
140
+ onProgress?.(i, total);
141
+ await yieldToEventLoop();
142
+ }
143
+ const h = extractedHeritage[i];
144
+ if (h.kind === 'extends') {
145
+ const childId = symbolTable.lookupExact(h.filePath, h.className) ||
146
+ symbolTable.lookupFuzzy(h.className)[0]?.nodeId ||
147
+ generateId('Class', `${h.filePath}:${h.className}`);
148
+ const parentId = symbolTable.lookupFuzzy(h.parentName)[0]?.nodeId ||
149
+ generateId('Class', `${h.parentName}`);
150
+ if (childId && parentId && childId !== parentId) {
151
+ graph.addRelationship({
152
+ id: generateId('EXTENDS', `${childId}->${parentId}`),
153
+ sourceId: childId,
154
+ targetId: parentId,
155
+ type: 'EXTENDS',
156
+ confidence: 1.0,
157
+ reason: '',
158
+ });
159
+ }
160
+ }
161
+ else if (h.kind === 'implements') {
162
+ const classId = symbolTable.lookupExact(h.filePath, h.className) ||
163
+ symbolTable.lookupFuzzy(h.className)[0]?.nodeId ||
164
+ generateId('Class', `${h.filePath}:${h.className}`);
165
+ const interfaceId = symbolTable.lookupFuzzy(h.parentName)[0]?.nodeId ||
166
+ generateId('Interface', `${h.parentName}`);
167
+ if (classId && interfaceId) {
168
+ graph.addRelationship({
169
+ id: generateId('IMPLEMENTS', `${classId}->${interfaceId}`),
170
+ sourceId: classId,
171
+ targetId: interfaceId,
172
+ type: 'IMPLEMENTS',
173
+ confidence: 1.0,
174
+ reason: '',
175
+ });
176
+ }
177
+ }
178
+ else if (h.kind === 'trait-impl') {
179
+ const structId = symbolTable.lookupExact(h.filePath, h.className) ||
180
+ symbolTable.lookupFuzzy(h.className)[0]?.nodeId ||
181
+ generateId('Struct', `${h.filePath}:${h.className}`);
182
+ const traitId = symbolTable.lookupFuzzy(h.parentName)[0]?.nodeId ||
183
+ generateId('Trait', `${h.parentName}`);
184
+ if (structId && traitId) {
185
+ graph.addRelationship({
186
+ id: generateId('IMPLEMENTS', `${structId}->${traitId}`),
187
+ sourceId: structId,
188
+ targetId: traitId,
189
+ type: 'IMPLEMENTS',
190
+ confidence: 1.0,
191
+ reason: 'trait-impl',
192
+ });
193
+ }
194
+ }
195
+ }
196
+ onProgress?.(total, total);
197
+ };
@@ -0,0 +1,38 @@
1
+ import { KnowledgeGraph } from '../graph/types.js';
2
+ import { ASTCache } from './ast-cache.js';
3
+ import type { ExtractedImport } from './workers/parse-worker.js';
4
+ export type ImportMap = Map<string, Set<string>>;
5
+ export declare const createImportMap: () => ImportMap;
6
+ /** Pre-built lookup structures for import resolution. Build once, reuse across chunks. */
7
+ export interface ImportResolutionContext {
8
+ allFilePaths: Set<string>;
9
+ allFileList: string[];
10
+ normalizedFileList: string[];
11
+ suffixIndex: SuffixIndex;
12
+ resolveCache: Map<string, string | null>;
13
+ }
14
+ export declare function buildImportResolutionContext(allPaths: string[]): ImportResolutionContext;
15
+ /**
16
+ * Build a suffix index for O(1) endsWith lookups.
17
+ * Maps every possible path suffix to its original file path.
18
+ * e.g. for "src/com/example/Foo.java":
19
+ * "Foo.java" -> "src/com/example/Foo.java"
20
+ * "example/Foo.java" -> "src/com/example/Foo.java"
21
+ * "com/example/Foo.java" -> "src/com/example/Foo.java"
22
+ * etc.
23
+ */
24
+ export interface SuffixIndex {
25
+ /** Exact suffix lookup (case-sensitive) */
26
+ get(suffix: string): string | undefined;
27
+ /** Case-insensitive suffix lookup */
28
+ getInsensitive(suffix: string): string | undefined;
29
+ /** Get all files in a directory suffix */
30
+ getFilesInDir(dirSuffix: string, extension: string): string[];
31
+ }
32
+ export declare const processImports: (graph: KnowledgeGraph, files: {
33
+ path: string;
34
+ content: string;
35
+ }[], astCache: ASTCache, importMap: ImportMap, onProgress?: (current: number, total: number) => void, repoRoot?: string, allPaths?: string[]) => Promise<void>;
36
+ export declare const processImportsFromExtracted: (graph: KnowledgeGraph, files: {
37
+ path: string;
38
+ }[], extractedImports: ExtractedImport[], importMap: ImportMap, onProgress?: (current: number, total: number) => void, repoRoot?: string, prebuiltCtx?: ImportResolutionContext) => Promise<void>;