@lzehrung/codegraph 2.1.0

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 (1525) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +448 -0
  3. package/THIRD_PARTY_NOTICES +77 -0
  4. package/codegraph-skill/codegraph/SKILL.md +262 -0
  5. package/dist/agent/artifact.d.ts +65 -0
  6. package/dist/agent/artifact.d.ts.map +1 -0
  7. package/dist/agent/artifact.js +616 -0
  8. package/dist/agent/artifact.js.map +1 -0
  9. package/dist/agent/bounds.d.ts +12 -0
  10. package/dist/agent/bounds.d.ts.map +1 -0
  11. package/dist/agent/bounds.js +25 -0
  12. package/dist/agent/bounds.js.map +1 -0
  13. package/dist/agent/callHierarchy.d.ts +28 -0
  14. package/dist/agent/callHierarchy.d.ts.map +1 -0
  15. package/dist/agent/callHierarchy.js +82 -0
  16. package/dist/agent/callHierarchy.js.map +1 -0
  17. package/dist/agent/explain.d.ts +136 -0
  18. package/dist/agent/explain.d.ts.map +1 -0
  19. package/dist/agent/explain.js +743 -0
  20. package/dist/agent/explain.js.map +1 -0
  21. package/dist/agent/explore.d.ts +67 -0
  22. package/dist/agent/explore.d.ts.map +1 -0
  23. package/dist/agent/explore.js +474 -0
  24. package/dist/agent/explore.js.map +1 -0
  25. package/dist/agent/fileView.d.ts +55 -0
  26. package/dist/agent/fileView.d.ts.map +1 -0
  27. package/dist/agent/fileView.js +528 -0
  28. package/dist/agent/fileView.js.map +1 -0
  29. package/dist/agent/followUps.d.ts +9 -0
  30. package/dist/agent/followUps.d.ts.map +1 -0
  31. package/dist/agent/followUps.js +164 -0
  32. package/dist/agent/followUps.js.map +1 -0
  33. package/dist/agent/handles.d.ts +29 -0
  34. package/dist/agent/handles.d.ts.map +1 -0
  35. package/dist/agent/handles.js +103 -0
  36. package/dist/agent/handles.js.map +1 -0
  37. package/dist/agent/normalize.d.ts +19 -0
  38. package/dist/agent/normalize.d.ts.map +1 -0
  39. package/dist/agent/normalize.js +45 -0
  40. package/dist/agent/normalize.js.map +1 -0
  41. package/dist/agent/orient.d.ts +55 -0
  42. package/dist/agent/orient.d.ts.map +1 -0
  43. package/dist/agent/orient.js +307 -0
  44. package/dist/agent/orient.js.map +1 -0
  45. package/dist/agent/packet.d.ts +28 -0
  46. package/dist/agent/packet.d.ts.map +1 -0
  47. package/dist/agent/packet.js +138 -0
  48. package/dist/agent/packet.js.map +1 -0
  49. package/dist/agent/query-index/candidates.d.ts +4 -0
  50. package/dist/agent/query-index/candidates.d.ts.map +1 -0
  51. package/dist/agent/query-index/candidates.js +89 -0
  52. package/dist/agent/query-index/candidates.js.map +1 -0
  53. package/dist/agent/query-index/content.d.ts +36 -0
  54. package/dist/agent/query-index/content.d.ts.map +1 -0
  55. package/dist/agent/query-index/content.js +124 -0
  56. package/dist/agent/query-index/content.js.map +1 -0
  57. package/dist/agent/query-index/paths.d.ts +12 -0
  58. package/dist/agent/query-index/paths.d.ts.map +1 -0
  59. package/dist/agent/query-index/paths.js +41 -0
  60. package/dist/agent/query-index/paths.js.map +1 -0
  61. package/dist/agent/query-index/queryIndexWorker.d.ts +8 -0
  62. package/dist/agent/query-index/queryIndexWorker.d.ts.map +1 -0
  63. package/dist/agent/query-index/queryIndexWorker.js +11 -0
  64. package/dist/agent/query-index/queryIndexWorker.js.map +1 -0
  65. package/dist/agent/query-index/schema.d.ts +26 -0
  66. package/dist/agent/query-index/schema.d.ts.map +1 -0
  67. package/dist/agent/query-index/schema.js +171 -0
  68. package/dist/agent/query-index/schema.js.map +1 -0
  69. package/dist/agent/query-index/sessionStore.d.ts +5 -0
  70. package/dist/agent/query-index/sessionStore.d.ts.map +1 -0
  71. package/dist/agent/query-index/sessionStore.js +53 -0
  72. package/dist/agent/query-index/sessionStore.js.map +1 -0
  73. package/dist/agent/query-index/sourceIdentity.d.ts +3 -0
  74. package/dist/agent/query-index/sourceIdentity.d.ts.map +1 -0
  75. package/dist/agent/query-index/sourceIdentity.js +12 -0
  76. package/dist/agent/query-index/sourceIdentity.js.map +1 -0
  77. package/dist/agent/query-index/store.d.ts +48 -0
  78. package/dist/agent/query-index/store.d.ts.map +1 -0
  79. package/dist/agent/query-index/store.js +372 -0
  80. package/dist/agent/query-index/store.js.map +1 -0
  81. package/dist/agent/query-index/update.d.ts +9 -0
  82. package/dist/agent/query-index/update.d.ts.map +1 -0
  83. package/dist/agent/query-index/update.js +309 -0
  84. package/dist/agent/query-index/update.js.map +1 -0
  85. package/dist/agent/query-index/workerPool.d.ts +5 -0
  86. package/dist/agent/query-index/workerPool.d.ts.map +1 -0
  87. package/dist/agent/query-index/workerPool.js +82 -0
  88. package/dist/agent/query-index/workerPool.js.map +1 -0
  89. package/dist/agent/refactorPlan.d.ts +40 -0
  90. package/dist/agent/refactorPlan.d.ts.map +1 -0
  91. package/dist/agent/refactorPlan.js +234 -0
  92. package/dist/agent/refactorPlan.js.map +1 -0
  93. package/dist/agent/renamePreview.d.ts +60 -0
  94. package/dist/agent/renamePreview.d.ts.map +1 -0
  95. package/dist/agent/renamePreview.js +1008 -0
  96. package/dist/agent/renamePreview.js.map +1 -0
  97. package/dist/agent/search.d.ts +77 -0
  98. package/dist/agent/search.d.ts.map +1 -0
  99. package/dist/agent/search.js +1002 -0
  100. package/dist/agent/search.js.map +1 -0
  101. package/dist/agent/semantic.d.ts +35 -0
  102. package/dist/agent/semantic.d.ts.map +1 -0
  103. package/dist/agent/semantic.js +2 -0
  104. package/dist/agent/semantic.js.map +1 -0
  105. package/dist/agent/semanticSymbols.d.ts +16 -0
  106. package/dist/agent/semanticSymbols.d.ts.map +1 -0
  107. package/dist/agent/semanticSymbols.js +96 -0
  108. package/dist/agent/semanticSymbols.js.map +1 -0
  109. package/dist/agent/session.d.ts +71 -0
  110. package/dist/agent/session.d.ts.map +1 -0
  111. package/dist/agent/session.js +432 -0
  112. package/dist/agent/session.js.map +1 -0
  113. package/dist/agent/sessionLifecycle.d.ts +5 -0
  114. package/dist/agent/sessionLifecycle.d.ts.map +1 -0
  115. package/dist/agent/sessionLifecycle.js +18 -0
  116. package/dist/agent/sessionLifecycle.js.map +1 -0
  117. package/dist/agent/shell.d.ts +2 -0
  118. package/dist/agent/shell.d.ts.map +1 -0
  119. package/dist/agent/shell.js +6 -0
  120. package/dist/agent/shell.js.map +1 -0
  121. package/dist/agent/symbolLookup.d.ts +12 -0
  122. package/dist/agent/symbolLookup.d.ts.map +1 -0
  123. package/dist/agent/symbolLookup.js +26 -0
  124. package/dist/agent/symbolLookup.js.map +1 -0
  125. package/dist/agent/typeHierarchy.d.ts +39 -0
  126. package/dist/agent/typeHierarchy.d.ts.map +1 -0
  127. package/dist/agent/typeHierarchy.js +125 -0
  128. package/dist/agent/typeHierarchy.js.map +1 -0
  129. package/dist/agent/workspaceSymbols.d.ts +18 -0
  130. package/dist/agent/workspaceSymbols.d.ts.map +1 -0
  131. package/dist/agent/workspaceSymbols.js +75 -0
  132. package/dist/agent/workspaceSymbols.js.map +1 -0
  133. package/dist/agent-tools.d.ts +280 -0
  134. package/dist/agent-tools.d.ts.map +1 -0
  135. package/dist/agent-tools.js +669 -0
  136. package/dist/agent-tools.js.map +1 -0
  137. package/dist/agent.d.ts +35 -0
  138. package/dist/agent.d.ts.map +1 -0
  139. package/dist/agent.js +19 -0
  140. package/dist/agent.js.map +1 -0
  141. package/dist/analysisSummary.d.ts +19 -0
  142. package/dist/analysisSummary.d.ts.map +1 -0
  143. package/dist/analysisSummary.js +80 -0
  144. package/dist/analysisSummary.js.map +1 -0
  145. package/dist/bin/cli.js +105144 -0
  146. package/dist/bin/queryIndexWorker.js +3914 -0
  147. package/dist/bootstrap/treeSitterLanguages.d.ts +5 -0
  148. package/dist/bootstrap/treeSitterLanguages.d.ts.map +1 -0
  149. package/dist/bootstrap/treeSitterLanguages.js +41 -0
  150. package/dist/bootstrap/treeSitterLanguages.js.map +1 -0
  151. package/dist/chunking/chunkBlocks.d.ts +9 -0
  152. package/dist/chunking/chunkBlocks.d.ts.map +1 -0
  153. package/dist/chunking/chunkBlocks.js +60 -0
  154. package/dist/chunking/chunkBlocks.js.map +1 -0
  155. package/dist/chunking/chunkFile.d.ts +34 -0
  156. package/dist/chunking/chunkFile.d.ts.map +1 -0
  157. package/dist/chunking/chunkFile.js +153 -0
  158. package/dist/chunking/chunkFile.js.map +1 -0
  159. package/dist/chunking/chunkId.d.ts +7 -0
  160. package/dist/chunking/chunkId.d.ts.map +1 -0
  161. package/dist/chunking/chunkId.js +30 -0
  162. package/dist/chunking/chunkId.js.map +1 -0
  163. package/dist/chunking/chunkMatches.d.ts +4 -0
  164. package/dist/chunking/chunkMatches.d.ts.map +1 -0
  165. package/dist/chunking/chunkMatches.js +65 -0
  166. package/dist/chunking/chunkMatches.js.map +1 -0
  167. package/dist/chunking/chunkMerge.d.ts +4 -0
  168. package/dist/chunking/chunkMerge.d.ts.map +1 -0
  169. package/dist/chunking/chunkMerge.js +144 -0
  170. package/dist/chunking/chunkMerge.js.map +1 -0
  171. package/dist/chunking/chunkSFC.d.ts +18 -0
  172. package/dist/chunking/chunkSFC.d.ts.map +1 -0
  173. package/dist/chunking/chunkSFC.js +165 -0
  174. package/dist/chunking/chunkSFC.js.map +1 -0
  175. package/dist/chunking/chunkSplit.d.ts +6 -0
  176. package/dist/chunking/chunkSplit.d.ts.map +1 -0
  177. package/dist/chunking/chunkSplit.js +170 -0
  178. package/dist/chunking/chunkSplit.js.map +1 -0
  179. package/dist/chunking/chunkTextFile.d.ts +28 -0
  180. package/dist/chunking/chunkTextFile.d.ts.map +1 -0
  181. package/dist/chunking/chunkTextFile.js +107 -0
  182. package/dist/chunking/chunkTextFile.js.map +1 -0
  183. package/dist/chunking/languageConfig.d.ts +35 -0
  184. package/dist/chunking/languageConfig.d.ts.map +1 -0
  185. package/dist/chunking/languageConfig.js +24 -0
  186. package/dist/chunking/languageConfig.js.map +1 -0
  187. package/dist/chunking/tokenizer.d.ts +2 -0
  188. package/dist/chunking/tokenizer.d.ts.map +1 -0
  189. package/dist/chunking/tokenizer.js +6 -0
  190. package/dist/chunking/tokenizer.js.map +1 -0
  191. package/dist/chunking/types.d.ts +54 -0
  192. package/dist/chunking/types.d.ts.map +1 -0
  193. package/dist/chunking/types.js +2 -0
  194. package/dist/chunking/types.js.map +1 -0
  195. package/dist/cli/affected.d.ts +32 -0
  196. package/dist/cli/affected.d.ts.map +1 -0
  197. package/dist/cli/affected.js +235 -0
  198. package/dist/cli/affected.js.map +1 -0
  199. package/dist/cli/artifact.d.ts +4 -0
  200. package/dist/cli/artifact.d.ts.map +1 -0
  201. package/dist/cli/artifact.js +35 -0
  202. package/dist/cli/artifact.js.map +1 -0
  203. package/dist/cli/bootstrap.d.ts +3 -0
  204. package/dist/cli/bootstrap.d.ts.map +1 -0
  205. package/dist/cli/bootstrap.js +8 -0
  206. package/dist/cli/bootstrap.js.map +1 -0
  207. package/dist/cli/callHierarchy.d.ts +6 -0
  208. package/dist/cli/callHierarchy.d.ts.map +1 -0
  209. package/dist/cli/callHierarchy.js +65 -0
  210. package/dist/cli/callHierarchy.js.map +1 -0
  211. package/dist/cli/chunk.d.ts +4 -0
  212. package/dist/cli/chunk.d.ts.map +1 -0
  213. package/dist/cli/chunk.js +109 -0
  214. package/dist/cli/chunk.js.map +1 -0
  215. package/dist/cli/commandCatalog.d.ts +14 -0
  216. package/dist/cli/commandCatalog.d.ts.map +1 -0
  217. package/dist/cli/commandCatalog.js +109 -0
  218. package/dist/cli/commandCatalog.js.map +1 -0
  219. package/dist/cli/commandTable.d.ts +16 -0
  220. package/dist/cli/commandTable.d.ts.map +1 -0
  221. package/dist/cli/commandTable.js +716 -0
  222. package/dist/cli/commandTable.js.map +1 -0
  223. package/dist/cli/compileCache.d.ts +17 -0
  224. package/dist/cli/compileCache.d.ts.map +1 -0
  225. package/dist/cli/compileCache.js +63 -0
  226. package/dist/cli/compileCache.js.map +1 -0
  227. package/dist/cli/context.d.ts +87 -0
  228. package/dist/cli/context.d.ts.map +1 -0
  229. package/dist/cli/context.js +322 -0
  230. package/dist/cli/context.js.map +1 -0
  231. package/dist/cli/discoveryGlobs.d.ts +11 -0
  232. package/dist/cli/discoveryGlobs.d.ts.map +1 -0
  233. package/dist/cli/discoveryGlobs.js +74 -0
  234. package/dist/cli/discoveryGlobs.js.map +1 -0
  235. package/dist/cli/doctor.d.ts +33 -0
  236. package/dist/cli/doctor.d.ts.map +1 -0
  237. package/dist/cli/doctor.js +143 -0
  238. package/dist/cli/doctor.js.map +1 -0
  239. package/dist/cli/drift.d.ts +18 -0
  240. package/dist/cli/drift.d.ts.map +1 -0
  241. package/dist/cli/drift.js +101 -0
  242. package/dist/cli/drift.js.map +1 -0
  243. package/dist/cli/duplicateSimilarity.d.ts +10 -0
  244. package/dist/cli/duplicateSimilarity.d.ts.map +1 -0
  245. package/dist/cli/duplicateSimilarity.js +20 -0
  246. package/dist/cli/duplicateSimilarity.js.map +1 -0
  247. package/dist/cli/duplicates.d.ts +15 -0
  248. package/dist/cli/duplicates.d.ts.map +1 -0
  249. package/dist/cli/duplicates.js +400 -0
  250. package/dist/cli/duplicates.js.map +1 -0
  251. package/dist/cli/explain.d.ts +4 -0
  252. package/dist/cli/explain.d.ts.map +1 -0
  253. package/dist/cli/explain.js +47 -0
  254. package/dist/cli/explain.js.map +1 -0
  255. package/dist/cli/explore.d.ts +4 -0
  256. package/dist/cli/explore.d.ts.map +1 -0
  257. package/dist/cli/explore.js +28 -0
  258. package/dist/cli/explore.js.map +1 -0
  259. package/dist/cli/file.d.ts +4 -0
  260. package/dist/cli/file.d.ts.map +1 -0
  261. package/dist/cli/file.js +53 -0
  262. package/dist/cli/file.js.map +1 -0
  263. package/dist/cli/graph.d.ts +90 -0
  264. package/dist/cli/graph.d.ts.map +1 -0
  265. package/dist/cli/graph.js +379 -0
  266. package/dist/cli/graph.js.map +1 -0
  267. package/dist/cli/graphDelta.d.ts +24 -0
  268. package/dist/cli/graphDelta.d.ts.map +1 -0
  269. package/dist/cli/graphDelta.js +75 -0
  270. package/dist/cli/graphDelta.js.map +1 -0
  271. package/dist/cli/graphQueries.d.ts +23 -0
  272. package/dist/cli/graphQueries.d.ts.map +1 -0
  273. package/dist/cli/graphQueries.js +257 -0
  274. package/dist/cli/graphQueries.js.map +1 -0
  275. package/dist/cli/grep.d.ts +10 -0
  276. package/dist/cli/grep.d.ts.map +1 -0
  277. package/dist/cli/grep.js +61 -0
  278. package/dist/cli/grep.js.map +1 -0
  279. package/dist/cli/help.d.ts +52 -0
  280. package/dist/cli/help.d.ts.map +1 -0
  281. package/dist/cli/help.js +749 -0
  282. package/dist/cli/help.js.map +1 -0
  283. package/dist/cli/impact.d.ts +24 -0
  284. package/dist/cli/impact.d.ts.map +1 -0
  285. package/dist/cli/impact.js +481 -0
  286. package/dist/cli/impact.js.map +1 -0
  287. package/dist/cli/index.d.ts +43 -0
  288. package/dist/cli/index.d.ts.map +1 -0
  289. package/dist/cli/index.js +112 -0
  290. package/dist/cli/index.js.map +1 -0
  291. package/dist/cli/indexPolicy.d.ts +36 -0
  292. package/dist/cli/indexPolicy.d.ts.map +1 -0
  293. package/dist/cli/indexPolicy.js +168 -0
  294. package/dist/cli/indexPolicy.js.map +1 -0
  295. package/dist/cli/inspect.d.ts +30 -0
  296. package/dist/cli/inspect.d.ts.map +1 -0
  297. package/dist/cli/inspect.js +323 -0
  298. package/dist/cli/inspect.js.map +1 -0
  299. package/dist/cli/install.d.ts +14 -0
  300. package/dist/cli/install.d.ts.map +1 -0
  301. package/dist/cli/install.js +273 -0
  302. package/dist/cli/install.js.map +1 -0
  303. package/dist/cli/invocationContext.d.ts +77 -0
  304. package/dist/cli/invocationContext.d.ts.map +1 -0
  305. package/dist/cli/invocationContext.js +357 -0
  306. package/dist/cli/invocationContext.js.map +1 -0
  307. package/dist/cli/lifecycle.d.ts +11 -0
  308. package/dist/cli/lifecycle.d.ts.map +1 -0
  309. package/dist/cli/lifecycle.js +81 -0
  310. package/dist/cli/lifecycle.js.map +1 -0
  311. package/dist/cli/links.d.ts +11 -0
  312. package/dist/cli/links.d.ts.map +1 -0
  313. package/dist/cli/links.js +53 -0
  314. package/dist/cli/links.js.map +1 -0
  315. package/dist/cli/location.d.ts +5 -0
  316. package/dist/cli/location.d.ts.map +1 -0
  317. package/dist/cli/location.js +11 -0
  318. package/dist/cli/location.js.map +1 -0
  319. package/dist/cli/mcp.d.ts +7 -0
  320. package/dist/cli/mcp.d.ts.map +1 -0
  321. package/dist/cli/mcp.js +60 -0
  322. package/dist/cli/mcp.js.map +1 -0
  323. package/dist/cli/navigation.d.ts +23 -0
  324. package/dist/cli/navigation.d.ts.map +1 -0
  325. package/dist/cli/navigation.js +367 -0
  326. package/dist/cli/navigation.js.map +1 -0
  327. package/dist/cli/options.d.ts +21 -0
  328. package/dist/cli/options.d.ts.map +1 -0
  329. package/dist/cli/options.js +694 -0
  330. package/dist/cli/options.js.map +1 -0
  331. package/dist/cli/orient.d.ts +6 -0
  332. package/dist/cli/orient.d.ts.map +1 -0
  333. package/dist/cli/orient.js +72 -0
  334. package/dist/cli/orient.js.map +1 -0
  335. package/dist/cli/packet.d.ts +4 -0
  336. package/dist/cli/packet.d.ts.map +1 -0
  337. package/dist/cli/packet.js +53 -0
  338. package/dist/cli/packet.js.map +1 -0
  339. package/dist/cli/pretty.d.ts +9 -0
  340. package/dist/cli/pretty.d.ts.map +1 -0
  341. package/dist/cli/pretty.js +91 -0
  342. package/dist/cli/pretty.js.map +1 -0
  343. package/dist/cli/progress.d.ts +20 -0
  344. package/dist/cli/progress.d.ts.map +1 -0
  345. package/dist/cli/progress.js +156 -0
  346. package/dist/cli/progress.js.map +1 -0
  347. package/dist/cli/projectFile.d.ts +13 -0
  348. package/dist/cli/projectFile.d.ts.map +1 -0
  349. package/dist/cli/projectFile.js +23 -0
  350. package/dist/cli/projectFile.js.map +1 -0
  351. package/dist/cli/refactorPlan.d.ts +6 -0
  352. package/dist/cli/refactorPlan.d.ts.map +1 -0
  353. package/dist/cli/refactorPlan.js +84 -0
  354. package/dist/cli/refactorPlan.js.map +1 -0
  355. package/dist/cli/renamePreview.d.ts +4 -0
  356. package/dist/cli/renamePreview.d.ts.map +1 -0
  357. package/dist/cli/renamePreview.js +86 -0
  358. package/dist/cli/renamePreview.js.map +1 -0
  359. package/dist/cli/review.d.ts +36 -0
  360. package/dist/cli/review.d.ts.map +1 -0
  361. package/dist/cli/review.js +302 -0
  362. package/dist/cli/review.js.map +1 -0
  363. package/dist/cli/rootPolicy.d.ts +53 -0
  364. package/dist/cli/rootPolicy.d.ts.map +1 -0
  365. package/dist/cli/rootPolicy.js +190 -0
  366. package/dist/cli/rootPolicy.js.map +1 -0
  367. package/dist/cli/search.d.ts +8 -0
  368. package/dist/cli/search.d.ts.map +1 -0
  369. package/dist/cli/search.js +49 -0
  370. package/dist/cli/search.js.map +1 -0
  371. package/dist/cli/skill.d.ts +13 -0
  372. package/dist/cli/skill.d.ts.map +1 -0
  373. package/dist/cli/skill.js +227 -0
  374. package/dist/cli/skill.js.map +1 -0
  375. package/dist/cli/sql.d.ts +6 -0
  376. package/dist/cli/sql.d.ts.map +1 -0
  377. package/dist/cli/sql.js +37 -0
  378. package/dist/cli/sql.js.map +1 -0
  379. package/dist/cli/symbols.d.ts +4 -0
  380. package/dist/cli/symbols.d.ts.map +1 -0
  381. package/dist/cli/symbols.js +59 -0
  382. package/dist/cli/symbols.js.map +1 -0
  383. package/dist/cli/typeHierarchy.d.ts +6 -0
  384. package/dist/cli/typeHierarchy.d.ts.map +1 -0
  385. package/dist/cli/typeHierarchy.js +81 -0
  386. package/dist/cli/typeHierarchy.js.map +1 -0
  387. package/dist/cli/viewer.d.ts +27 -0
  388. package/dist/cli/viewer.d.ts.map +1 -0
  389. package/dist/cli/viewer.js +313 -0
  390. package/dist/cli/viewer.js.map +1 -0
  391. package/dist/cli.d.ts +7 -0
  392. package/dist/cli.d.ts.map +1 -0
  393. package/dist/cli.js +185 -0
  394. package/dist/cli.js.map +1 -0
  395. package/dist/cliBootstrap.d.ts +3 -0
  396. package/dist/cliBootstrap.d.ts.map +1 -0
  397. package/dist/cliBootstrap.js +10 -0
  398. package/dist/cliBootstrap.js.map +1 -0
  399. package/dist/config.d.ts +18 -0
  400. package/dist/config.d.ts.map +1 -0
  401. package/dist/config.js +141 -0
  402. package/dist/config.js.map +1 -0
  403. package/dist/documentLinks/asciidoc.d.ts +3 -0
  404. package/dist/documentLinks/asciidoc.d.ts.map +1 -0
  405. package/dist/documentLinks/asciidoc.js +115 -0
  406. package/dist/documentLinks/asciidoc.js.map +1 -0
  407. package/dist/documentLinks/check.d.ts +31 -0
  408. package/dist/documentLinks/check.d.ts.map +1 -0
  409. package/dist/documentLinks/check.js +272 -0
  410. package/dist/documentLinks/check.js.map +1 -0
  411. package/dist/documentLinks/html.d.ts +5 -0
  412. package/dist/documentLinks/html.d.ts.map +1 -0
  413. package/dist/documentLinks/html.js +324 -0
  414. package/dist/documentLinks/html.js.map +1 -0
  415. package/dist/documentLinks/markdown.d.ts +15 -0
  416. package/dist/documentLinks/markdown.d.ts.map +1 -0
  417. package/dist/documentLinks/markdown.js +538 -0
  418. package/dist/documentLinks/markdown.js.map +1 -0
  419. package/dist/documentLinks/rst.d.ts +3 -0
  420. package/dist/documentLinks/rst.d.ts.map +1 -0
  421. package/dist/documentLinks/rst.js +179 -0
  422. package/dist/documentLinks/rst.js.map +1 -0
  423. package/dist/documentLinks/sfc.d.ts +4 -0
  424. package/dist/documentLinks/sfc.d.ts.map +1 -0
  425. package/dist/documentLinks/sfc.js +30 -0
  426. package/dist/documentLinks/sfc.js.map +1 -0
  427. package/dist/documentLinks/shared.d.ts +11 -0
  428. package/dist/documentLinks/shared.d.ts.map +1 -0
  429. package/dist/documentLinks/shared.js +147 -0
  430. package/dist/documentLinks/shared.js.map +1 -0
  431. package/dist/documentLinks.d.ts +12 -0
  432. package/dist/documentLinks.d.ts.map +1 -0
  433. package/dist/documentLinks.js +50 -0
  434. package/dist/documentLinks.js.map +1 -0
  435. package/dist/drift/artifact.d.ts +3 -0
  436. package/dist/drift/artifact.d.ts.map +1 -0
  437. package/dist/drift/artifact.js +170 -0
  438. package/dist/drift/artifact.js.map +1 -0
  439. package/dist/drift/compare.d.ts +5 -0
  440. package/dist/drift/compare.d.ts.map +1 -0
  441. package/dist/drift/compare.js +355 -0
  442. package/dist/drift/compare.js.map +1 -0
  443. package/dist/drift/git.d.ts +3 -0
  444. package/dist/drift/git.d.ts.map +1 -0
  445. package/dist/drift/git.js +128 -0
  446. package/dist/drift/git.js.map +1 -0
  447. package/dist/drift/index.d.ts +8 -0
  448. package/dist/drift/index.d.ts.map +1 -0
  449. package/dist/drift/index.js +7 -0
  450. package/dist/drift/index.js.map +1 -0
  451. package/dist/drift/languages.d.ts +2 -0
  452. package/dist/drift/languages.d.ts.map +1 -0
  453. package/dist/drift/languages.js +18 -0
  454. package/dist/drift/languages.js.map +1 -0
  455. package/dist/drift/report.d.ts +6 -0
  456. package/dist/drift/report.d.ts.map +1 -0
  457. package/dist/drift/report.js +75 -0
  458. package/dist/drift/report.js.map +1 -0
  459. package/dist/drift/snapshot.d.ts +3 -0
  460. package/dist/drift/snapshot.d.ts.map +1 -0
  461. package/dist/drift/snapshot.js +164 -0
  462. package/dist/drift/snapshot.js.map +1 -0
  463. package/dist/drift/types.d.ts +142 -0
  464. package/dist/drift/types.d.ts.map +1 -0
  465. package/dist/drift/types.js +2 -0
  466. package/dist/drift/types.js.map +1 -0
  467. package/dist/duplicate-keywords.d.ts +3 -0
  468. package/dist/duplicate-keywords.d.ts.map +1 -0
  469. package/dist/duplicate-keywords.js +155 -0
  470. package/dist/duplicate-keywords.js.map +1 -0
  471. package/dist/duplicate-token-normalization.d.ts +6 -0
  472. package/dist/duplicate-token-normalization.d.ts.map +1 -0
  473. package/dist/duplicate-token-normalization.js +53 -0
  474. package/dist/duplicate-token-normalization.js.map +1 -0
  475. package/dist/duplicates/scoring.d.ts +121 -0
  476. package/dist/duplicates/scoring.d.ts.map +1 -0
  477. package/dist/duplicates/scoring.js +1245 -0
  478. package/dist/duplicates/scoring.js.map +1 -0
  479. package/dist/duplicates/types.d.ts +216 -0
  480. package/dist/duplicates/types.d.ts.map +1 -0
  481. package/dist/duplicates/types.js +2 -0
  482. package/dist/duplicates/types.js.map +1 -0
  483. package/dist/duplicates/unitCache.d.ts +40 -0
  484. package/dist/duplicates/unitCache.d.ts.map +1 -0
  485. package/dist/duplicates/unitCache.js +352 -0
  486. package/dist/duplicates/unitCache.js.map +1 -0
  487. package/dist/duplicates/units.d.ts +60 -0
  488. package/dist/duplicates/units.d.ts.map +1 -0
  489. package/dist/duplicates/units.js +447 -0
  490. package/dist/duplicates/units.js.map +1 -0
  491. package/dist/duplicates.d.ts +14 -0
  492. package/dist/duplicates.d.ts.map +1 -0
  493. package/dist/duplicates.js +400 -0
  494. package/dist/duplicates.js.map +1 -0
  495. package/dist/duplicatesLeads.d.ts +39 -0
  496. package/dist/duplicatesLeads.d.ts.map +1 -0
  497. package/dist/duplicatesLeads.js +112 -0
  498. package/dist/duplicatesLeads.js.map +1 -0
  499. package/dist/frameworks/angularjs.d.ts +18 -0
  500. package/dist/frameworks/angularjs.d.ts.map +1 -0
  501. package/dist/frameworks/angularjs.js +427 -0
  502. package/dist/frameworks/angularjs.js.map +1 -0
  503. package/dist/graph-builder.d.ts +35 -0
  504. package/dist/graph-builder.d.ts.map +1 -0
  505. package/dist/graph-builder.js +132 -0
  506. package/dist/graph-builder.js.map +1 -0
  507. package/dist/graph-edge-collector.d.ts +57 -0
  508. package/dist/graph-edge-collector.d.ts.map +1 -0
  509. package/dist/graph-edge-collector.js +199 -0
  510. package/dist/graph-edge-collector.js.map +1 -0
  511. package/dist/graphs/adjacency.d.ts +10 -0
  512. package/dist/graphs/adjacency.d.ts.map +1 -0
  513. package/dist/graphs/adjacency.js +38 -0
  514. package/dist/graphs/adjacency.js.map +1 -0
  515. package/dist/graphs/angularjs.d.ts +5 -0
  516. package/dist/graphs/angularjs.d.ts.map +1 -0
  517. package/dist/graphs/angularjs.js +88 -0
  518. package/dist/graphs/angularjs.js.map +1 -0
  519. package/dist/graphs/cycles.d.ts +24 -0
  520. package/dist/graphs/cycles.d.ts.map +1 -0
  521. package/dist/graphs/cycles.js +159 -0
  522. package/dist/graphs/cycles.js.map +1 -0
  523. package/dist/graphs/edgeResolution.d.ts +25 -0
  524. package/dist/graphs/edgeResolution.d.ts.map +1 -0
  525. package/dist/graphs/edgeResolution.js +97 -0
  526. package/dist/graphs/edgeResolution.js.map +1 -0
  527. package/dist/graphs/external/cache.d.ts +6 -0
  528. package/dist/graphs/external/cache.d.ts.map +1 -0
  529. package/dist/graphs/external/cache.js +21 -0
  530. package/dist/graphs/external/cache.js.map +1 -0
  531. package/dist/graphs/external/context.d.ts +9 -0
  532. package/dist/graphs/external/context.d.ts.map +1 -0
  533. package/dist/graphs/external/context.js +93 -0
  534. package/dist/graphs/external/context.js.map +1 -0
  535. package/dist/graphs/external/manifests.d.ts +8 -0
  536. package/dist/graphs/external/manifests.d.ts.map +1 -0
  537. package/dist/graphs/external/manifests.js +429 -0
  538. package/dist/graphs/external/manifests.js.map +1 -0
  539. package/dist/graphs/external/stdlib.d.ts +3 -0
  540. package/dist/graphs/external/stdlib.d.ts.map +1 -0
  541. package/dist/graphs/external/stdlib.js +166 -0
  542. package/dist/graphs/external/stdlib.js.map +1 -0
  543. package/dist/graphs/external-classifier.d.ts +16 -0
  544. package/dist/graphs/external-classifier.d.ts.map +1 -0
  545. package/dist/graphs/external-classifier.js +46 -0
  546. package/dist/graphs/external-classifier.js.map +1 -0
  547. package/dist/graphs/grep.d.ts +66 -0
  548. package/dist/graphs/grep.d.ts.map +1 -0
  549. package/dist/graphs/grep.js +131 -0
  550. package/dist/graphs/grep.js.map +1 -0
  551. package/dist/graphs/hotspots.d.ts +13 -0
  552. package/dist/graphs/hotspots.d.ts.map +1 -0
  553. package/dist/graphs/hotspots.js +88 -0
  554. package/dist/graphs/hotspots.js.map +1 -0
  555. package/dist/graphs/limits.d.ts +2 -0
  556. package/dist/graphs/limits.d.ts.map +1 -0
  557. package/dist/graphs/limits.js +7 -0
  558. package/dist/graphs/limits.js.map +1 -0
  559. package/dist/graphs/queries.d.ts +4 -0
  560. package/dist/graphs/queries.d.ts.map +1 -0
  561. package/dist/graphs/queries.js +4 -0
  562. package/dist/graphs/queries.js.map +1 -0
  563. package/dist/graphs/render.d.ts +6 -0
  564. package/dist/graphs/render.d.ts.map +1 -0
  565. package/dist/graphs/render.js +85 -0
  566. package/dist/graphs/render.js.map +1 -0
  567. package/dist/graphs/specifiers.d.ts +24 -0
  568. package/dist/graphs/specifiers.d.ts.map +1 -0
  569. package/dist/graphs/specifiers.js +434 -0
  570. package/dist/graphs/specifiers.js.map +1 -0
  571. package/dist/graphs/symbol-graph-detailed/ast.d.ts +25 -0
  572. package/dist/graphs/symbol-graph-detailed/ast.d.ts.map +1 -0
  573. package/dist/graphs/symbol-graph-detailed/ast.js +167 -0
  574. package/dist/graphs/symbol-graph-detailed/ast.js.map +1 -0
  575. package/dist/graphs/symbol-graph-detailed/edgePasses.d.ts +30 -0
  576. package/dist/graphs/symbol-graph-detailed/edgePasses.d.ts.map +1 -0
  577. package/dist/graphs/symbol-graph-detailed/edgePasses.js +484 -0
  578. package/dist/graphs/symbol-graph-detailed/edgePasses.js.map +1 -0
  579. package/dist/graphs/symbol-graph-detailed/importAliases.d.ts +10 -0
  580. package/dist/graphs/symbol-graph-detailed/importAliases.d.ts.map +1 -0
  581. package/dist/graphs/symbol-graph-detailed/importAliases.js +44 -0
  582. package/dist/graphs/symbol-graph-detailed/importAliases.js.map +1 -0
  583. package/dist/graphs/symbol-graph-detailed/memberChains.d.ts +17 -0
  584. package/dist/graphs/symbol-graph-detailed/memberChains.d.ts.map +1 -0
  585. package/dist/graphs/symbol-graph-detailed/memberChains.js +30 -0
  586. package/dist/graphs/symbol-graph-detailed/memberChains.js.map +1 -0
  587. package/dist/graphs/symbol-graph-detailed.d.ts +14 -0
  588. package/dist/graphs/symbol-graph-detailed.d.ts.map +1 -0
  589. package/dist/graphs/symbol-graph-detailed.js +180 -0
  590. package/dist/graphs/symbol-graph-detailed.js.map +1 -0
  591. package/dist/graphs/symbol-graph.d.ts +56 -0
  592. package/dist/graphs/symbol-graph.d.ts.map +1 -0
  593. package/dist/graphs/symbol-graph.js +180 -0
  594. package/dist/graphs/symbol-graph.js.map +1 -0
  595. package/dist/graphs/symbol-render.d.ts +22 -0
  596. package/dist/graphs/symbol-render.d.ts.map +1 -0
  597. package/dist/graphs/symbol-render.js +184 -0
  598. package/dist/graphs/symbol-render.js.map +1 -0
  599. package/dist/graphs/traversal.d.ts +20 -0
  600. package/dist/graphs/traversal.d.ts.map +1 -0
  601. package/dist/graphs/traversal.js +75 -0
  602. package/dist/graphs/traversal.js.map +1 -0
  603. package/dist/graphs/types.d.ts +18 -0
  604. package/dist/graphs/types.d.ts.map +1 -0
  605. package/dist/graphs/types.js +2 -0
  606. package/dist/graphs/types.js.map +1 -0
  607. package/dist/graphs/unresolved.d.ts +13 -0
  608. package/dist/graphs/unresolved.d.ts.map +1 -0
  609. package/dist/graphs/unresolved.js +47 -0
  610. package/dist/graphs/unresolved.js.map +1 -0
  611. package/dist/graphs.d.ts +17 -0
  612. package/dist/graphs.d.ts.map +1 -0
  613. package/dist/graphs.js +11 -0
  614. package/dist/graphs.js.map +1 -0
  615. package/dist/impact/analyzer.d.ts +8 -0
  616. package/dist/impact/analyzer.d.ts.map +1 -0
  617. package/dist/impact/analyzer.js +156 -0
  618. package/dist/impact/analyzer.js.map +1 -0
  619. package/dist/impact/budgets.d.ts +36 -0
  620. package/dist/impact/budgets.d.ts.map +1 -0
  621. package/dist/impact/budgets.js +178 -0
  622. package/dist/impact/budgets.js.map +1 -0
  623. package/dist/impact/call-compatibility/providers/index.d.ts +14 -0
  624. package/dist/impact/call-compatibility/providers/index.d.ts.map +1 -0
  625. package/dist/impact/call-compatibility/providers/index.js +58 -0
  626. package/dist/impact/call-compatibility/providers/index.js.map +1 -0
  627. package/dist/impact/call-compatibility/providers/types.d.ts +26 -0
  628. package/dist/impact/call-compatibility/providers/types.d.ts.map +1 -0
  629. package/dist/impact/call-compatibility/providers/types.js +2 -0
  630. package/dist/impact/call-compatibility/providers/types.js.map +1 -0
  631. package/dist/impact/call-compatibility/types.d.ts +24 -0
  632. package/dist/impact/call-compatibility/types.d.ts.map +1 -0
  633. package/dist/impact/call-compatibility/types.js +2 -0
  634. package/dist/impact/call-compatibility/types.js.map +1 -0
  635. package/dist/impact/callCompatibility.d.ts +17 -0
  636. package/dist/impact/callCompatibility.d.ts.map +1 -0
  637. package/dist/impact/callCompatibility.js +1546 -0
  638. package/dist/impact/callCompatibility.js.map +1 -0
  639. package/dist/impact/collect.d.ts +27 -0
  640. package/dist/impact/collect.d.ts.map +1 -0
  641. package/dist/impact/collect.js +97 -0
  642. package/dist/impact/collect.js.map +1 -0
  643. package/dist/impact/context.d.ts +42 -0
  644. package/dist/impact/context.d.ts.map +1 -0
  645. package/dist/impact/context.js +286 -0
  646. package/dist/impact/context.js.map +1 -0
  647. package/dist/impact/direct.d.ts +26 -0
  648. package/dist/impact/direct.d.ts.map +1 -0
  649. package/dist/impact/direct.js +187 -0
  650. package/dist/impact/direct.js.map +1 -0
  651. package/dist/impact/hunks.d.ts +14 -0
  652. package/dist/impact/hunks.d.ts.map +1 -0
  653. package/dist/impact/hunks.js +87 -0
  654. package/dist/impact/hunks.js.map +1 -0
  655. package/dist/impact/index.d.ts +22 -0
  656. package/dist/impact/index.d.ts.map +1 -0
  657. package/dist/impact/index.js +27 -0
  658. package/dist/impact/index.js.map +1 -0
  659. package/dist/impact/map.d.ts +12 -0
  660. package/dist/impact/map.d.ts.map +1 -0
  661. package/dist/impact/map.js +753 -0
  662. package/dist/impact/map.js.map +1 -0
  663. package/dist/impact/memberResolutionCoverage.d.ts +14 -0
  664. package/dist/impact/memberResolutionCoverage.d.ts.map +1 -0
  665. package/dist/impact/memberResolutionCoverage.js +38 -0
  666. package/dist/impact/memberResolutionCoverage.js.map +1 -0
  667. package/dist/impact/parse.d.ts +5 -0
  668. package/dist/impact/parse.d.ts.map +1 -0
  669. package/dist/impact/parse.js +239 -0
  670. package/dist/impact/parse.js.map +1 -0
  671. package/dist/impact/path.d.ts +14 -0
  672. package/dist/impact/path.d.ts.map +1 -0
  673. package/dist/impact/path.js +103 -0
  674. package/dist/impact/path.js.map +1 -0
  675. package/dist/impact/providers/base.d.ts +10 -0
  676. package/dist/impact/providers/base.d.ts.map +1 -0
  677. package/dist/impact/providers/base.js +239 -0
  678. package/dist/impact/providers/base.js.map +1 -0
  679. package/dist/impact/referenceCache.d.ts +12 -0
  680. package/dist/impact/referenceCache.d.ts.map +1 -0
  681. package/dist/impact/referenceCache.js +101 -0
  682. package/dist/impact/referenceCache.js.map +1 -0
  683. package/dist/impact/report-suggestions.d.ts +4 -0
  684. package/dist/impact/report-suggestions.d.ts.map +1 -0
  685. package/dist/impact/report-suggestions.js +886 -0
  686. package/dist/impact/report-suggestions.js.map +1 -0
  687. package/dist/impact/report.d.ts +8 -0
  688. package/dist/impact/report.d.ts.map +1 -0
  689. package/dist/impact/report.js +405 -0
  690. package/dist/impact/report.js.map +1 -0
  691. package/dist/impact/reportCompact.d.ts +8 -0
  692. package/dist/impact/reportCompact.d.ts.map +1 -0
  693. package/dist/impact/reportCompact.js +145 -0
  694. package/dist/impact/reportCompact.js.map +1 -0
  695. package/dist/impact/reportFull.d.ts +10 -0
  696. package/dist/impact/reportFull.d.ts.map +1 -0
  697. package/dist/impact/reportFull.js +66 -0
  698. package/dist/impact/reportFull.js.map +1 -0
  699. package/dist/impact/reportParts.d.ts +42 -0
  700. package/dist/impact/reportParts.d.ts.map +1 -0
  701. package/dist/impact/reportParts.js +2 -0
  702. package/dist/impact/reportParts.js.map +1 -0
  703. package/dist/impact/reportShared.d.ts +76 -0
  704. package/dist/impact/reportShared.d.ts.map +1 -0
  705. package/dist/impact/reportShared.js +130 -0
  706. package/dist/impact/reportShared.js.map +1 -0
  707. package/dist/impact/severity.d.ts +29 -0
  708. package/dist/impact/severity.d.ts.map +1 -0
  709. package/dist/impact/severity.js +178 -0
  710. package/dist/impact/severity.js.map +1 -0
  711. package/dist/impact/signature-node-utils.d.ts +5 -0
  712. package/dist/impact/signature-node-utils.d.ts.map +1 -0
  713. package/dist/impact/signature-node-utils.js +29 -0
  714. package/dist/impact/signature-node-utils.js.map +1 -0
  715. package/dist/impact/streaming.d.ts +60 -0
  716. package/dist/impact/streaming.d.ts.map +1 -0
  717. package/dist/impact/streaming.js +285 -0
  718. package/dist/impact/streaming.js.map +1 -0
  719. package/dist/impact/suggestions.d.ts +4 -0
  720. package/dist/impact/suggestions.d.ts.map +1 -0
  721. package/dist/impact/suggestions.js +317 -0
  722. package/dist/impact/suggestions.js.map +1 -0
  723. package/dist/impact/testPatterns.d.ts +6 -0
  724. package/dist/impact/testPatterns.d.ts.map +1 -0
  725. package/dist/impact/testPatterns.js +65 -0
  726. package/dist/impact/testPatterns.js.map +1 -0
  727. package/dist/impact/transitive.d.ts +12 -0
  728. package/dist/impact/transitive.d.ts.map +1 -0
  729. package/dist/impact/transitive.js +188 -0
  730. package/dist/impact/transitive.js.map +1 -0
  731. package/dist/impact/types.d.ts +556 -0
  732. package/dist/impact/types.d.ts.map +1 -0
  733. package/dist/impact/types.js +17 -0
  734. package/dist/impact/types.js.map +1 -0
  735. package/dist/index.d.ts +60 -0
  736. package/dist/index.d.ts.map +1 -0
  737. package/dist/index.js +55 -0
  738. package/dist/index.js.map +1 -0
  739. package/dist/indexer/build-cache/manifest.d.ts +48 -0
  740. package/dist/indexer/build-cache/manifest.d.ts.map +1 -0
  741. package/dist/indexer/build-cache/manifest.js +228 -0
  742. package/dist/indexer/build-cache/manifest.js.map +1 -0
  743. package/dist/indexer/build-cache/module-cache.d.ts +20 -0
  744. package/dist/indexer/build-cache/module-cache.d.ts.map +1 -0
  745. package/dist/indexer/build-cache/module-cache.js +339 -0
  746. package/dist/indexer/build-cache/module-cache.js.map +1 -0
  747. package/dist/indexer/build-cache/options.d.ts +50 -0
  748. package/dist/indexer/build-cache/options.d.ts.map +1 -0
  749. package/dist/indexer/build-cache/options.js +276 -0
  750. package/dist/indexer/build-cache/options.js.map +1 -0
  751. package/dist/indexer/build-cache/project-snapshot.d.ts +30 -0
  752. package/dist/indexer/build-cache/project-snapshot.d.ts.map +1 -0
  753. package/dist/indexer/build-cache/project-snapshot.js +928 -0
  754. package/dist/indexer/build-cache/project-snapshot.js.map +1 -0
  755. package/dist/indexer/build-cache/reports.d.ts +13 -0
  756. package/dist/indexer/build-cache/reports.d.ts.map +1 -0
  757. package/dist/indexer/build-cache/reports.js +134 -0
  758. package/dist/indexer/build-cache/reports.js.map +1 -0
  759. package/dist/indexer/build-cache.d.ts +6 -0
  760. package/dist/indexer/build-cache.d.ts.map +1 -0
  761. package/dist/indexer/build-cache.js +6 -0
  762. package/dist/indexer/build-cache.js.map +1 -0
  763. package/dist/indexer/build-index.d.ts +28 -0
  764. package/dist/indexer/build-index.d.ts.map +1 -0
  765. package/dist/indexer/build-index.js +1579 -0
  766. package/dist/indexer/build-index.js.map +1 -0
  767. package/dist/indexer/build-manifest.d.ts +16 -0
  768. package/dist/indexer/build-manifest.d.ts.map +1 -0
  769. package/dist/indexer/build-manifest.js +43 -0
  770. package/dist/indexer/build-manifest.js.map +1 -0
  771. package/dist/indexer/build-workers.d.ts +27 -0
  772. package/dist/indexer/build-workers.d.ts.map +1 -0
  773. package/dist/indexer/build-workers.js +209 -0
  774. package/dist/indexer/build-workers.js.map +1 -0
  775. package/dist/indexer/call-hierarchy.d.ts +33 -0
  776. package/dist/indexer/call-hierarchy.d.ts.map +1 -0
  777. package/dist/indexer/call-hierarchy.js +192 -0
  778. package/dist/indexer/call-hierarchy.js.map +1 -0
  779. package/dist/indexer/declarations.d.ts +15 -0
  780. package/dist/indexer/declarations.d.ts.map +1 -0
  781. package/dist/indexer/declarations.js +95 -0
  782. package/dist/indexer/declarations.js.map +1 -0
  783. package/dist/indexer/finalize.d.ts +20 -0
  784. package/dist/indexer/finalize.d.ts.map +1 -0
  785. package/dist/indexer/finalize.js +34 -0
  786. package/dist/indexer/finalize.js.map +1 -0
  787. package/dist/indexer/import-types.d.ts +48 -0
  788. package/dist/indexer/import-types.d.ts.map +1 -0
  789. package/dist/indexer/import-types.js +2 -0
  790. package/dist/indexer/import-types.js.map +1 -0
  791. package/dist/indexer/imports/context.d.ts +7 -0
  792. package/dist/indexer/imports/context.d.ts.map +1 -0
  793. package/dist/indexer/imports/context.js +2 -0
  794. package/dist/indexer/imports/context.js.map +1 -0
  795. package/dist/indexer/imports/graphOnly.d.ts +13 -0
  796. package/dist/indexer/imports/graphOnly.d.ts.map +1 -0
  797. package/dist/indexer/imports/graphOnly.js +40 -0
  798. package/dist/indexer/imports/graphOnly.js.map +1 -0
  799. package/dist/indexer/imports/jsTextImports.d.ts +9 -0
  800. package/dist/indexer/imports/jsTextImports.d.ts.map +1 -0
  801. package/dist/indexer/imports/jsTextImports.js +173 -0
  802. package/dist/indexer/imports/jsTextImports.js.map +1 -0
  803. package/dist/indexer/imports/languageSpecific.d.ts +26 -0
  804. package/dist/indexer/imports/languageSpecific.d.ts.map +1 -0
  805. package/dist/indexer/imports/languageSpecific.js +444 -0
  806. package/dist/indexer/imports/languageSpecific.js.map +1 -0
  807. package/dist/indexer/imports/nativeCaptures.d.ts +16 -0
  808. package/dist/indexer/imports/nativeCaptures.d.ts.map +1 -0
  809. package/dist/indexer/imports/nativeCaptures.js +139 -0
  810. package/dist/indexer/imports/nativeCaptures.js.map +1 -0
  811. package/dist/indexer/imports/python.d.ts +8 -0
  812. package/dist/indexer/imports/python.d.ts.map +1 -0
  813. package/dist/indexer/imports/python.js +116 -0
  814. package/dist/indexer/imports/python.js.map +1 -0
  815. package/dist/indexer/imports.d.ts +21 -0
  816. package/dist/indexer/imports.d.ts.map +1 -0
  817. package/dist/indexer/imports.js +188 -0
  818. package/dist/indexer/imports.js.map +1 -0
  819. package/dist/indexer/incremental-plan.d.ts +71 -0
  820. package/dist/indexer/incremental-plan.d.ts.map +1 -0
  821. package/dist/indexer/incremental-plan.js +212 -0
  822. package/dist/indexer/incremental-plan.js.map +1 -0
  823. package/dist/indexer/load-current-index.d.ts +51 -0
  824. package/dist/indexer/load-current-index.d.ts.map +1 -0
  825. package/dist/indexer/load-current-index.js +53 -0
  826. package/dist/indexer/load-current-index.js.map +1 -0
  827. package/dist/indexer/locals-and-exports.d.ts +12 -0
  828. package/dist/indexer/locals-and-exports.d.ts.map +1 -0
  829. package/dist/indexer/locals-and-exports.js +872 -0
  830. package/dist/indexer/locals-and-exports.js.map +1 -0
  831. package/dist/indexer/navigation-goto.d.ts +13 -0
  832. package/dist/indexer/navigation-goto.d.ts.map +1 -0
  833. package/dist/indexer/navigation-goto.js +548 -0
  834. package/dist/indexer/navigation-goto.js.map +1 -0
  835. package/dist/indexer/navigation-local.d.ts +13 -0
  836. package/dist/indexer/navigation-local.d.ts.map +1 -0
  837. package/dist/indexer/navigation-local.js +173 -0
  838. package/dist/indexer/navigation-local.js.map +1 -0
  839. package/dist/indexer/navigation-php.d.ts +7 -0
  840. package/dist/indexer/navigation-php.d.ts.map +1 -0
  841. package/dist/indexer/navigation-php.js +90 -0
  842. package/dist/indexer/navigation-php.js.map +1 -0
  843. package/dist/indexer/navigation-provenance.d.ts +14 -0
  844. package/dist/indexer/navigation-provenance.d.ts.map +1 -0
  845. package/dist/indexer/navigation-provenance.js +26 -0
  846. package/dist/indexer/navigation-provenance.js.map +1 -0
  847. package/dist/indexer/navigation-references.d.ts +30 -0
  848. package/dist/indexer/navigation-references.d.ts.map +1 -0
  849. package/dist/indexer/navigation-references.js +299 -0
  850. package/dist/indexer/navigation-references.js.map +1 -0
  851. package/dist/indexer/navigation-resolve.d.ts +12 -0
  852. package/dist/indexer/navigation-resolve.d.ts.map +1 -0
  853. package/dist/indexer/navigation-resolve.js +389 -0
  854. package/dist/indexer/navigation-resolve.js.map +1 -0
  855. package/dist/indexer/navigation.d.ts +19 -0
  856. package/dist/indexer/navigation.d.ts.map +1 -0
  857. package/dist/indexer/navigation.js +468 -0
  858. package/dist/indexer/navigation.js.map +1 -0
  859. package/dist/indexer/parse-context.d.ts +47 -0
  860. package/dist/indexer/parse-context.d.ts.map +1 -0
  861. package/dist/indexer/parse-context.js +127 -0
  862. package/dist/indexer/parse-context.js.map +1 -0
  863. package/dist/indexer/parsed-cache.d.ts +6 -0
  864. package/dist/indexer/parsed-cache.d.ts.map +1 -0
  865. package/dist/indexer/parsed-cache.js +32 -0
  866. package/dist/indexer/parsed-cache.js.map +1 -0
  867. package/dist/indexer/reference-candidate-types.d.ts +5 -0
  868. package/dist/indexer/reference-candidate-types.d.ts.map +1 -0
  869. package/dist/indexer/reference-candidate-types.js +2 -0
  870. package/dist/indexer/reference-candidate-types.js.map +1 -0
  871. package/dist/indexer/reference-candidates.d.ts +6 -0
  872. package/dist/indexer/reference-candidates.d.ts.map +1 -0
  873. package/dist/indexer/reference-candidates.js +28 -0
  874. package/dist/indexer/reference-candidates.js.map +1 -0
  875. package/dist/indexer/reference-context.d.ts +13 -0
  876. package/dist/indexer/reference-context.d.ts.map +1 -0
  877. package/dist/indexer/reference-context.js +103 -0
  878. package/dist/indexer/reference-context.js.map +1 -0
  879. package/dist/indexer/scope-types.d.ts +25 -0
  880. package/dist/indexer/scope-types.d.ts.map +1 -0
  881. package/dist/indexer/scope-types.js +2 -0
  882. package/dist/indexer/scope-types.js.map +1 -0
  883. package/dist/indexer/scope.d.ts +11 -0
  884. package/dist/indexer/scope.d.ts.map +1 -0
  885. package/dist/indexer/scope.js +424 -0
  886. package/dist/indexer/scope.js.map +1 -0
  887. package/dist/indexer/shared.d.ts +4 -0
  888. package/dist/indexer/shared.d.ts.map +1 -0
  889. package/dist/indexer/shared.js +9 -0
  890. package/dist/indexer/shared.js.map +1 -0
  891. package/dist/indexer/symbols.d.ts +60 -0
  892. package/dist/indexer/symbols.d.ts.map +1 -0
  893. package/dist/indexer/symbols.js +272 -0
  894. package/dist/indexer/symbols.js.map +1 -0
  895. package/dist/indexer/type-hierarchy.d.ts +52 -0
  896. package/dist/indexer/type-hierarchy.d.ts.map +1 -0
  897. package/dist/indexer/type-hierarchy.js +296 -0
  898. package/dist/indexer/type-hierarchy.js.map +1 -0
  899. package/dist/indexer/types.d.ts +376 -0
  900. package/dist/indexer/types.d.ts.map +1 -0
  901. package/dist/indexer/types.js +15 -0
  902. package/dist/indexer/types.js.map +1 -0
  903. package/dist/indexer/workspace-symbols.d.ts +35 -0
  904. package/dist/indexer/workspace-symbols.d.ts.map +1 -0
  905. package/dist/indexer/workspace-symbols.js +226 -0
  906. package/dist/indexer/workspace-symbols.js.map +1 -0
  907. package/dist/indexer.d.ts +44 -0
  908. package/dist/indexer.d.ts.map +1 -0
  909. package/dist/indexer.js +35 -0
  910. package/dist/indexer.js.map +1 -0
  911. package/dist/installer/registry.d.ts +68 -0
  912. package/dist/installer/registry.d.ts.map +1 -0
  913. package/dist/installer/registry.js +1208 -0
  914. package/dist/installer/registry.js.map +1 -0
  915. package/dist/languages/all.d.ts +28 -0
  916. package/dist/languages/all.d.ts.map +1 -0
  917. package/dist/languages/all.js +28 -0
  918. package/dist/languages/all.js.map +1 -0
  919. package/dist/languages/definitions/adoc.d.ts +2 -0
  920. package/dist/languages/definitions/adoc.d.ts.map +1 -0
  921. package/dist/languages/definitions/adoc.js +5 -0
  922. package/dist/languages/definitions/adoc.js.map +1 -0
  923. package/dist/languages/definitions/astro.d.ts +2 -0
  924. package/dist/languages/definitions/astro.d.ts.map +1 -0
  925. package/dist/languages/definitions/astro.js +5 -0
  926. package/dist/languages/definitions/astro.js.map +1 -0
  927. package/dist/languages/definitions/c.d.ts +2 -0
  928. package/dist/languages/definitions/c.d.ts.map +1 -0
  929. package/dist/languages/definitions/c.js +78 -0
  930. package/dist/languages/definitions/c.js.map +1 -0
  931. package/dist/languages/definitions/cFamily.d.ts +35 -0
  932. package/dist/languages/definitions/cFamily.d.ts.map +1 -0
  933. package/dist/languages/definitions/cFamily.js +179 -0
  934. package/dist/languages/definitions/cFamily.js.map +1 -0
  935. package/dist/languages/definitions/cpp.d.ts +2 -0
  936. package/dist/languages/definitions/cpp.d.ts.map +1 -0
  937. package/dist/languages/definitions/cpp.js +88 -0
  938. package/dist/languages/definitions/cpp.js.map +1 -0
  939. package/dist/languages/definitions/csharp.d.ts +3 -0
  940. package/dist/languages/definitions/csharp.d.ts.map +1 -0
  941. package/dist/languages/definitions/csharp.js +126 -0
  942. package/dist/languages/definitions/csharp.js.map +1 -0
  943. package/dist/languages/definitions/css.d.ts +3 -0
  944. package/dist/languages/definitions/css.d.ts.map +1 -0
  945. package/dist/languages/definitions/css.js +13 -0
  946. package/dist/languages/definitions/css.js.map +1 -0
  947. package/dist/languages/definitions/cssLike.d.ts +5 -0
  948. package/dist/languages/definitions/cssLike.d.ts.map +1 -0
  949. package/dist/languages/definitions/cssLike.js +32 -0
  950. package/dist/languages/definitions/cssLike.js.map +1 -0
  951. package/dist/languages/definitions/go.d.ts +3 -0
  952. package/dist/languages/definitions/go.d.ts.map +1 -0
  953. package/dist/languages/definitions/go.js +113 -0
  954. package/dist/languages/definitions/go.js.map +1 -0
  955. package/dist/languages/definitions/hbs.d.ts +2 -0
  956. package/dist/languages/definitions/hbs.d.ts.map +1 -0
  957. package/dist/languages/definitions/hbs.js +5 -0
  958. package/dist/languages/definitions/hbs.js.map +1 -0
  959. package/dist/languages/definitions/html.d.ts +3 -0
  960. package/dist/languages/definitions/html.d.ts.map +1 -0
  961. package/dist/languages/definitions/html.js +45 -0
  962. package/dist/languages/definitions/html.js.map +1 -0
  963. package/dist/languages/definitions/htmlStub.d.ts +18 -0
  964. package/dist/languages/definitions/htmlStub.d.ts.map +1 -0
  965. package/dist/languages/definitions/htmlStub.js +38 -0
  966. package/dist/languages/definitions/htmlStub.js.map +1 -0
  967. package/dist/languages/definitions/java.d.ts +3 -0
  968. package/dist/languages/definitions/java.d.ts.map +1 -0
  969. package/dist/languages/definitions/java.js +124 -0
  970. package/dist/languages/definitions/java.js.map +1 -0
  971. package/dist/languages/definitions/javascript.d.ts +3 -0
  972. package/dist/languages/definitions/javascript.d.ts.map +1 -0
  973. package/dist/languages/definitions/javascript.js +172 -0
  974. package/dist/languages/definitions/javascript.js.map +1 -0
  975. package/dist/languages/definitions/jsFamily.d.ts +5 -0
  976. package/dist/languages/definitions/jsFamily.d.ts.map +1 -0
  977. package/dist/languages/definitions/jsFamily.js +75 -0
  978. package/dist/languages/definitions/jsFamily.js.map +1 -0
  979. package/dist/languages/definitions/kotlin.d.ts +3 -0
  980. package/dist/languages/definitions/kotlin.d.ts.map +1 -0
  981. package/dist/languages/definitions/kotlin.js +152 -0
  982. package/dist/languages/definitions/kotlin.js.map +1 -0
  983. package/dist/languages/definitions/less.d.ts +3 -0
  984. package/dist/languages/definitions/less.d.ts.map +1 -0
  985. package/dist/languages/definitions/less.js +13 -0
  986. package/dist/languages/definitions/less.js.map +1 -0
  987. package/dist/languages/definitions/loadLanguage.d.ts +2 -0
  988. package/dist/languages/definitions/loadLanguage.d.ts.map +1 -0
  989. package/dist/languages/definitions/loadLanguage.js +2 -0
  990. package/dist/languages/definitions/loadLanguage.js.map +1 -0
  991. package/dist/languages/definitions/markdown.d.ts +2 -0
  992. package/dist/languages/definitions/markdown.d.ts.map +1 -0
  993. package/dist/languages/definitions/markdown.js +5 -0
  994. package/dist/languages/definitions/markdown.js.map +1 -0
  995. package/dist/languages/definitions/mdx.d.ts +2 -0
  996. package/dist/languages/definitions/mdx.d.ts.map +1 -0
  997. package/dist/languages/definitions/mdx.js +5 -0
  998. package/dist/languages/definitions/mdx.js.map +1 -0
  999. package/dist/languages/definitions/php.d.ts +3 -0
  1000. package/dist/languages/definitions/php.d.ts.map +1 -0
  1001. package/dist/languages/definitions/php.js +157 -0
  1002. package/dist/languages/definitions/php.js.map +1 -0
  1003. package/dist/languages/definitions/python.d.ts +3 -0
  1004. package/dist/languages/definitions/python.d.ts.map +1 -0
  1005. package/dist/languages/definitions/python.js +137 -0
  1006. package/dist/languages/definitions/python.js.map +1 -0
  1007. package/dist/languages/definitions/rst.d.ts +2 -0
  1008. package/dist/languages/definitions/rst.d.ts.map +1 -0
  1009. package/dist/languages/definitions/rst.js +5 -0
  1010. package/dist/languages/definitions/rst.js.map +1 -0
  1011. package/dist/languages/definitions/ruby.d.ts +3 -0
  1012. package/dist/languages/definitions/ruby.d.ts.map +1 -0
  1013. package/dist/languages/definitions/ruby.js +92 -0
  1014. package/dist/languages/definitions/ruby.js.map +1 -0
  1015. package/dist/languages/definitions/rust.d.ts +3 -0
  1016. package/dist/languages/definitions/rust.d.ts.map +1 -0
  1017. package/dist/languages/definitions/rust.js +146 -0
  1018. package/dist/languages/definitions/rust.js.map +1 -0
  1019. package/dist/languages/definitions/scss.d.ts +3 -0
  1020. package/dist/languages/definitions/scss.d.ts.map +1 -0
  1021. package/dist/languages/definitions/scss.js +58 -0
  1022. package/dist/languages/definitions/scss.js.map +1 -0
  1023. package/dist/languages/definitions/sql.d.ts +3 -0
  1024. package/dist/languages/definitions/sql.d.ts.map +1 -0
  1025. package/dist/languages/definitions/sql.js +36 -0
  1026. package/dist/languages/definitions/sql.js.map +1 -0
  1027. package/dist/languages/definitions/svelte.d.ts +3 -0
  1028. package/dist/languages/definitions/svelte.d.ts.map +1 -0
  1029. package/dist/languages/definitions/svelte.js +31 -0
  1030. package/dist/languages/definitions/svelte.js.map +1 -0
  1031. package/dist/languages/definitions/swift.d.ts +3 -0
  1032. package/dist/languages/definitions/swift.d.ts.map +1 -0
  1033. package/dist/languages/definitions/swift.js +188 -0
  1034. package/dist/languages/definitions/swift.js.map +1 -0
  1035. package/dist/languages/definitions/typescript.d.ts +4 -0
  1036. package/dist/languages/definitions/typescript.d.ts.map +1 -0
  1037. package/dist/languages/definitions/typescript.js +212 -0
  1038. package/dist/languages/definitions/typescript.js.map +1 -0
  1039. package/dist/languages/definitions/vue.d.ts +3 -0
  1040. package/dist/languages/definitions/vue.d.ts.map +1 -0
  1041. package/dist/languages/definitions/vue.js +31 -0
  1042. package/dist/languages/definitions/vue.js.map +1 -0
  1043. package/dist/languages/definitions/zig.d.ts +3 -0
  1044. package/dist/languages/definitions/zig.d.ts.map +1 -0
  1045. package/dist/languages/definitions/zig.js +75 -0
  1046. package/dist/languages/definitions/zig.js.map +1 -0
  1047. package/dist/languages/filePrep.d.ts +33 -0
  1048. package/dist/languages/filePrep.d.ts.map +1 -0
  1049. package/dist/languages/filePrep.js +77 -0
  1050. package/dist/languages/filePrep.js.map +1 -0
  1051. package/dist/languages/importStatementParsers.d.ts +55 -0
  1052. package/dist/languages/importStatementParsers.d.ts.map +1 -0
  1053. package/dist/languages/importStatementParsers.js +369 -0
  1054. package/dist/languages/importStatementParsers.js.map +1 -0
  1055. package/dist/languages/js-family.d.ts +2 -0
  1056. package/dist/languages/js-family.d.ts.map +1 -0
  1057. package/dist/languages/js-family.js +9 -0
  1058. package/dist/languages/js-family.js.map +1 -0
  1059. package/dist/languages/queryGenerator.d.ts +6 -0
  1060. package/dist/languages/queryGenerator.d.ts.map +1 -0
  1061. package/dist/languages/queryGenerator.js +46 -0
  1062. package/dist/languages/queryGenerator.js.map +1 -0
  1063. package/dist/languages/registry.d.ts +5 -0
  1064. package/dist/languages/registry.d.ts.map +1 -0
  1065. package/dist/languages/registry.js +11 -0
  1066. package/dist/languages/registry.js.map +1 -0
  1067. package/dist/languages/sfc.d.ts +30 -0
  1068. package/dist/languages/sfc.d.ts.map +1 -0
  1069. package/dist/languages/sfc.js +402 -0
  1070. package/dist/languages/sfc.js.map +1 -0
  1071. package/dist/languages/types.d.ts +110 -0
  1072. package/dist/languages/types.d.ts.map +1 -0
  1073. package/dist/languages/types.js +2 -0
  1074. package/dist/languages/types.js.map +1 -0
  1075. package/dist/languages.d.ts +63 -0
  1076. package/dist/languages.d.ts.map +1 -0
  1077. package/dist/languages.js +118 -0
  1078. package/dist/languages.js.map +1 -0
  1079. package/dist/lifecycle/errors.d.ts +4 -0
  1080. package/dist/lifecycle/errors.d.ts.map +1 -0
  1081. package/dist/lifecycle/errors.js +4 -0
  1082. package/dist/lifecycle/errors.js.map +1 -0
  1083. package/dist/lifecycle/gitignore.d.ts +10 -0
  1084. package/dist/lifecycle/gitignore.d.ts.map +1 -0
  1085. package/dist/lifecycle/gitignore.js +83 -0
  1086. package/dist/lifecycle/gitignore.js.map +1 -0
  1087. package/dist/lifecycle/manifest.d.ts +73 -0
  1088. package/dist/lifecycle/manifest.d.ts.map +1 -0
  1089. package/dist/lifecycle/manifest.js +352 -0
  1090. package/dist/lifecycle/manifest.js.map +1 -0
  1091. package/dist/logging.d.ts +5 -0
  1092. package/dist/logging.d.ts.map +1 -0
  1093. package/dist/logging.js +35 -0
  1094. package/dist/logging.js.map +1 -0
  1095. package/dist/mcp/http.d.ts +29 -0
  1096. package/dist/mcp/http.d.ts.map +1 -0
  1097. package/dist/mcp/http.js +179 -0
  1098. package/dist/mcp/http.js.map +1 -0
  1099. package/dist/mcp/security.d.ts +3 -0
  1100. package/dist/mcp/security.d.ts.map +1 -0
  1101. package/dist/mcp/security.js +23 -0
  1102. package/dist/mcp/security.js.map +1 -0
  1103. package/dist/mcp/server.d.ts +267 -0
  1104. package/dist/mcp/server.d.ts.map +1 -0
  1105. package/dist/mcp/server.js +1345 -0
  1106. package/dist/mcp/server.js.map +1 -0
  1107. package/dist/mcp/sqliteGuard.d.ts +3 -0
  1108. package/dist/mcp/sqliteGuard.d.ts.map +1 -0
  1109. package/dist/mcp/sqliteGuard.js +35 -0
  1110. package/dist/mcp/sqliteGuard.js.map +1 -0
  1111. package/dist/mcp/stdioLifecycle.d.ts +23 -0
  1112. package/dist/mcp/stdioLifecycle.d.ts.map +1 -0
  1113. package/dist/mcp/stdioLifecycle.js +83 -0
  1114. package/dist/mcp/stdioLifecycle.js.map +1 -0
  1115. package/dist/mcp/tools.d.ts +15 -0
  1116. package/dist/mcp/tools.d.ts.map +1 -0
  1117. package/dist/mcp/tools.js +299 -0
  1118. package/dist/mcp/tools.js.map +1 -0
  1119. package/dist/mcp.d.ts +9 -0
  1120. package/dist/mcp.d.ts.map +1 -0
  1121. package/dist/mcp.js +8 -0
  1122. package/dist/mcp.js.map +1 -0
  1123. package/dist/native/bindingLoader.d.ts +24 -0
  1124. package/dist/native/bindingLoader.d.ts.map +1 -0
  1125. package/dist/native/bindingLoader.js +206 -0
  1126. package/dist/native/bindingLoader.js.map +1 -0
  1127. package/dist/native/contracts.d.ts +122 -0
  1128. package/dist/native/contracts.d.ts.map +1 -0
  1129. package/dist/native/contracts.js +2 -0
  1130. package/dist/native/contracts.js.map +1 -0
  1131. package/dist/native/execution.d.ts +16 -0
  1132. package/dist/native/execution.d.ts.map +1 -0
  1133. package/dist/native/execution.js +184 -0
  1134. package/dist/native/execution.js.map +1 -0
  1135. package/dist/native/jsBridge.d.ts +7 -0
  1136. package/dist/native/jsBridge.d.ts.map +1 -0
  1137. package/dist/native/jsBridge.js +25 -0
  1138. package/dist/native/jsBridge.js.map +1 -0
  1139. package/dist/native/nativeBackendReport.d.ts +22 -0
  1140. package/dist/native/nativeBackendReport.d.ts.map +1 -0
  1141. package/dist/native/nativeBackendReport.js +102 -0
  1142. package/dist/native/nativeBackendReport.js.map +1 -0
  1143. package/dist/native/projectedTree.d.ts +37 -0
  1144. package/dist/native/projectedTree.d.ts.map +1 -0
  1145. package/dist/native/projectedTree.js +172 -0
  1146. package/dist/native/projectedTree.js.map +1 -0
  1147. package/dist/native/queries.d.ts +22 -0
  1148. package/dist/native/queries.d.ts.map +1 -0
  1149. package/dist/native/queries.js +67 -0
  1150. package/dist/native/queries.js.map +1 -0
  1151. package/dist/native/queryResults.d.ts +6 -0
  1152. package/dist/native/queryResults.d.ts.map +1 -0
  1153. package/dist/native/queryResults.js +26 -0
  1154. package/dist/native/queryResults.js.map +1 -0
  1155. package/dist/native/runtime.d.ts +17 -0
  1156. package/dist/native/runtime.d.ts.map +1 -0
  1157. package/dist/native/runtime.js +152 -0
  1158. package/dist/native/runtime.js.map +1 -0
  1159. package/dist/native/runtimeCache.d.ts +36 -0
  1160. package/dist/native/runtimeCache.d.ts.map +1 -0
  1161. package/dist/native/runtimeCache.js +237 -0
  1162. package/dist/native/runtimeCache.js.map +1 -0
  1163. package/dist/native/treeSitterNative.d.ts +6 -0
  1164. package/dist/native/treeSitterNative.d.ts.map +1 -0
  1165. package/dist/native/treeSitterNative.js +5 -0
  1166. package/dist/native/treeSitterNative.js.map +1 -0
  1167. package/dist/parserBackend.d.ts +57 -0
  1168. package/dist/parserBackend.d.ts.map +1 -0
  1169. package/dist/parserBackend.js +33 -0
  1170. package/dist/parserBackend.js.map +1 -0
  1171. package/dist/presentation/bounds.d.ts +34 -0
  1172. package/dist/presentation/bounds.d.ts.map +1 -0
  1173. package/dist/presentation/bounds.js +43 -0
  1174. package/dist/presentation/bounds.js.map +1 -0
  1175. package/dist/presets.d.ts +32 -0
  1176. package/dist/presets.d.ts.map +1 -0
  1177. package/dist/presets.js +127 -0
  1178. package/dist/presets.js.map +1 -0
  1179. package/dist/query/parser.d.ts +33 -0
  1180. package/dist/query/parser.d.ts.map +1 -0
  1181. package/dist/query/parser.js +104 -0
  1182. package/dist/query/parser.js.map +1 -0
  1183. package/dist/query/symbols.d.ts +15 -0
  1184. package/dist/query/symbols.d.ts.map +1 -0
  1185. package/dist/query/symbols.js +78 -0
  1186. package/dist/query/symbols.js.map +1 -0
  1187. package/dist/query.d.ts +3 -0
  1188. package/dist/query.d.ts.map +1 -0
  1189. package/dist/query.js +3 -0
  1190. package/dist/query.js.map +1 -0
  1191. package/dist/review/candidates.d.ts +13 -0
  1192. package/dist/review/candidates.d.ts.map +1 -0
  1193. package/dist/review/candidates.js +65 -0
  1194. package/dist/review/candidates.js.map +1 -0
  1195. package/dist/review/changes.d.ts +11 -0
  1196. package/dist/review/changes.d.ts.map +1 -0
  1197. package/dist/review/changes.js +94 -0
  1198. package/dist/review/changes.js.map +1 -0
  1199. package/dist/review/deleted.d.ts +23 -0
  1200. package/dist/review/deleted.d.ts.map +1 -0
  1201. package/dist/review/deleted.js +398 -0
  1202. package/dist/review/deleted.js.map +1 -0
  1203. package/dist/review/report.d.ts +37 -0
  1204. package/dist/review/report.d.ts.map +1 -0
  1205. package/dist/review/report.js +76 -0
  1206. package/dist/review/report.js.map +1 -0
  1207. package/dist/review/risk.d.ts +19 -0
  1208. package/dist/review/risk.d.ts.map +1 -0
  1209. package/dist/review/risk.js +105 -0
  1210. package/dist/review/risk.js.map +1 -0
  1211. package/dist/review/summaries.d.ts +24 -0
  1212. package/dist/review/summaries.d.ts.map +1 -0
  1213. package/dist/review/summaries.js +581 -0
  1214. package/dist/review/summaries.js.map +1 -0
  1215. package/dist/review/types.d.ts +146 -0
  1216. package/dist/review/types.d.ts.map +1 -0
  1217. package/dist/review/types.js +43 -0
  1218. package/dist/review/types.js.map +1 -0
  1219. package/dist/review.d.ts +19 -0
  1220. package/dist/review.d.ts.map +1 -0
  1221. package/dist/review.js +442 -0
  1222. package/dist/review.js.map +1 -0
  1223. package/dist/runtimeIdentity.d.ts +27 -0
  1224. package/dist/runtimeIdentity.d.ts.map +1 -0
  1225. package/dist/runtimeIdentity.js +75 -0
  1226. package/dist/runtimeIdentity.js.map +1 -0
  1227. package/dist/session.d.ts +246 -0
  1228. package/dist/session.d.ts.map +1 -0
  1229. package/dist/session.js +858 -0
  1230. package/dist/session.js.map +1 -0
  1231. package/dist/sql/classifySqlFile.d.ts +3 -0
  1232. package/dist/sql/classifySqlFile.d.ts.map +1 -0
  1233. package/dist/sql/classifySqlFile.js +42 -0
  1234. package/dist/sql/classifySqlFile.js.map +1 -0
  1235. package/dist/sql/extractFacts.d.ts +4 -0
  1236. package/dist/sql/extractFacts.d.ts.map +1 -0
  1237. package/dist/sql/extractFacts.js +511 -0
  1238. package/dist/sql/extractFacts.js.map +1 -0
  1239. package/dist/sql/graph.d.ts +33 -0
  1240. package/dist/sql/graph.d.ts.map +1 -0
  1241. package/dist/sql/graph.js +167 -0
  1242. package/dist/sql/graph.js.map +1 -0
  1243. package/dist/sql/index.d.ts +8 -0
  1244. package/dist/sql/index.d.ts.map +1 -0
  1245. package/dist/sql/index.js +5 -0
  1246. package/dist/sql/index.js.map +1 -0
  1247. package/dist/sql/lex.d.ts +12 -0
  1248. package/dist/sql/lex.d.ts.map +1 -0
  1249. package/dist/sql/lex.js +180 -0
  1250. package/dist/sql/lex.js.map +1 -0
  1251. package/dist/sql/lookup.d.ts +3 -0
  1252. package/dist/sql/lookup.d.ts.map +1 -0
  1253. package/dist/sql/lookup.js +11 -0
  1254. package/dist/sql/lookup.js.map +1 -0
  1255. package/dist/sql/navigation.d.ts +4 -0
  1256. package/dist/sql/navigation.d.ts.map +1 -0
  1257. package/dist/sql/navigation.js +399 -0
  1258. package/dist/sql/navigation.js.map +1 -0
  1259. package/dist/sql/review.d.ts +15 -0
  1260. package/dist/sql/review.d.ts.map +1 -0
  1261. package/dist/sql/review.js +197 -0
  1262. package/dist/sql/review.js.map +1 -0
  1263. package/dist/sql/sourceGraph.d.ts +19 -0
  1264. package/dist/sql/sourceGraph.d.ts.map +1 -0
  1265. package/dist/sql/sourceGraph.js +195 -0
  1266. package/dist/sql/sourceGraph.js.map +1 -0
  1267. package/dist/sql/types.d.ts +21 -0
  1268. package/dist/sql/types.d.ts.map +1 -0
  1269. package/dist/sql/types.js +2 -0
  1270. package/dist/sql/types.js.map +1 -0
  1271. package/dist/sqlite/canned-query.d.ts +3 -0
  1272. package/dist/sqlite/canned-query.d.ts.map +1 -0
  1273. package/dist/sqlite/canned-query.js +192 -0
  1274. package/dist/sqlite/canned-query.js.map +1 -0
  1275. package/dist/sqlite/common.d.ts +6 -0
  1276. package/dist/sqlite/common.d.ts.map +1 -0
  1277. package/dist/sqlite/common.js +42 -0
  1278. package/dist/sqlite/common.js.map +1 -0
  1279. package/dist/sqlite/database.d.ts +5 -0
  1280. package/dist/sqlite/database.d.ts.map +1 -0
  1281. package/dist/sqlite/database.js +40 -0
  1282. package/dist/sqlite/database.js.map +1 -0
  1283. package/dist/sqlite/query.d.ts +9 -0
  1284. package/dist/sqlite/query.d.ts.map +1 -0
  1285. package/dist/sqlite/query.js +32 -0
  1286. package/dist/sqlite/query.js.map +1 -0
  1287. package/dist/sqlite/rowBounds.d.ts +24 -0
  1288. package/dist/sqlite/rowBounds.d.ts.map +1 -0
  1289. package/dist/sqlite/rowBounds.js +95 -0
  1290. package/dist/sqlite/rowBounds.js.map +1 -0
  1291. package/dist/sqlite/schema.d.ts +5 -0
  1292. package/dist/sqlite/schema.d.ts.map +1 -0
  1293. package/dist/sqlite/schema.js +243 -0
  1294. package/dist/sqlite/schema.js.map +1 -0
  1295. package/dist/sqlite/types.d.ts +77 -0
  1296. package/dist/sqlite/types.d.ts.map +1 -0
  1297. package/dist/sqlite/types.js +2 -0
  1298. package/dist/sqlite/types.js.map +1 -0
  1299. package/dist/sqlite/write.d.ts +5 -0
  1300. package/dist/sqlite/write.d.ts.map +1 -0
  1301. package/dist/sqlite/write.js +306 -0
  1302. package/dist/sqlite/write.js.map +1 -0
  1303. package/dist/sqlite-driver.d.ts +41 -0
  1304. package/dist/sqlite-driver.d.ts.map +1 -0
  1305. package/dist/sqlite-driver.js +144 -0
  1306. package/dist/sqlite-driver.js.map +1 -0
  1307. package/dist/sqlite.d.ts +4 -0
  1308. package/dist/sqlite.d.ts.map +1 -0
  1309. package/dist/sqlite.js +3 -0
  1310. package/dist/sqlite.js.map +1 -0
  1311. package/dist/triples.d.ts +27 -0
  1312. package/dist/triples.d.ts.map +1 -0
  1313. package/dist/triples.js +46 -0
  1314. package/dist/triples.js.map +1 -0
  1315. package/dist/types.d.ts +39 -0
  1316. package/dist/types.d.ts.map +1 -0
  1317. package/dist/types.js +2 -0
  1318. package/dist/types.js.map +1 -0
  1319. package/dist/util/ast.d.ts +20 -0
  1320. package/dist/util/ast.d.ts.map +1 -0
  1321. package/dist/util/ast.js +62 -0
  1322. package/dist/util/ast.js.map +1 -0
  1323. package/dist/util/bloomFilter.d.ts +99 -0
  1324. package/dist/util/bloomFilter.d.ts.map +1 -0
  1325. package/dist/util/bloomFilter.js +205 -0
  1326. package/dist/util/bloomFilter.js.map +1 -0
  1327. package/dist/util/collections.d.ts +3 -0
  1328. package/dist/util/collections.d.ts.map +1 -0
  1329. package/dist/util/collections.js +21 -0
  1330. package/dist/util/collections.js.map +1 -0
  1331. package/dist/util/comments.d.ts +10 -0
  1332. package/dist/util/comments.d.ts.map +1 -0
  1333. package/dist/util/comments.js +398 -0
  1334. package/dist/util/comments.js.map +1 -0
  1335. package/dist/util/concurrency.d.ts +26 -0
  1336. package/dist/util/concurrency.d.ts.map +1 -0
  1337. package/dist/util/concurrency.js +121 -0
  1338. package/dist/util/concurrency.js.map +1 -0
  1339. package/dist/util/confinedFile.d.ts +8 -0
  1340. package/dist/util/confinedFile.d.ts.map +1 -0
  1341. package/dist/util/confinedFile.js +53 -0
  1342. package/dist/util/confinedFile.js.map +1 -0
  1343. package/dist/util/discoveryPath.d.ts +3 -0
  1344. package/dist/util/discoveryPath.d.ts.map +1 -0
  1345. package/dist/util/discoveryPath.js +19 -0
  1346. package/dist/util/discoveryPath.js.map +1 -0
  1347. package/dist/util/errors.d.ts +3 -0
  1348. package/dist/util/errors.d.ts.map +1 -0
  1349. package/dist/util/errors.js +7 -0
  1350. package/dist/util/errors.js.map +1 -0
  1351. package/dist/util/git.d.ts +79 -0
  1352. package/dist/util/git.d.ts.map +1 -0
  1353. package/dist/util/git.js +403 -0
  1354. package/dist/util/git.js.map +1 -0
  1355. package/dist/util/graphEdges.d.ts +5 -0
  1356. package/dist/util/graphEdges.d.ts.map +1 -0
  1357. package/dist/util/graphEdges.js +42 -0
  1358. package/dist/util/graphEdges.js.map +1 -0
  1359. package/dist/util/graphOnlyExtensions.d.ts +5 -0
  1360. package/dist/util/graphOnlyExtensions.d.ts.map +1 -0
  1361. package/dist/util/graphOnlyExtensions.js +12 -0
  1362. package/dist/util/graphOnlyExtensions.js.map +1 -0
  1363. package/dist/util/guards.d.ts +2 -0
  1364. package/dist/util/guards.d.ts.map +1 -0
  1365. package/dist/util/guards.js +4 -0
  1366. package/dist/util/guards.js.map +1 -0
  1367. package/dist/util/includeRoots.d.ts +6 -0
  1368. package/dist/util/includeRoots.d.ts.map +1 -0
  1369. package/dist/util/includeRoots.js +53 -0
  1370. package/dist/util/includeRoots.js.map +1 -0
  1371. package/dist/util/lazySymbols.d.ts +166 -0
  1372. package/dist/util/lazySymbols.d.ts.map +1 -0
  1373. package/dist/util/lazySymbols.js +365 -0
  1374. package/dist/util/lazySymbols.js.map +1 -0
  1375. package/dist/util/lines.d.ts +2 -0
  1376. package/dist/util/lines.d.ts.map +1 -0
  1377. package/dist/util/lines.js +9 -0
  1378. package/dist/util/lines.js.map +1 -0
  1379. package/dist/util/lruMap.d.ts +3 -0
  1380. package/dist/util/lruMap.d.ts.map +1 -0
  1381. package/dist/util/lruMap.js +22 -0
  1382. package/dist/util/lruMap.js.map +1 -0
  1383. package/dist/util/memberAccess.d.ts +26 -0
  1384. package/dist/util/memberAccess.d.ts.map +1 -0
  1385. package/dist/util/memberAccess.js +175 -0
  1386. package/dist/util/memberAccess.js.map +1 -0
  1387. package/dist/util/packageExports.d.ts +25 -0
  1388. package/dist/util/packageExports.d.ts.map +1 -0
  1389. package/dist/util/packageExports.js +79 -0
  1390. package/dist/util/packageExports.js.map +1 -0
  1391. package/dist/util/packageInfo.d.ts +12 -0
  1392. package/dist/util/packageInfo.d.ts.map +1 -0
  1393. package/dist/util/packageInfo.js +57 -0
  1394. package/dist/util/packageInfo.js.map +1 -0
  1395. package/dist/util/partialResults.d.ts +81 -0
  1396. package/dist/util/partialResults.d.ts.map +1 -0
  1397. package/dist/util/partialResults.js +290 -0
  1398. package/dist/util/partialResults.js.map +1 -0
  1399. package/dist/util/paths.d.ts +51 -0
  1400. package/dist/util/paths.d.ts.map +1 -0
  1401. package/dist/util/paths.js +245 -0
  1402. package/dist/util/paths.js.map +1 -0
  1403. package/dist/util/projectFiles/definitions.d.ts +21 -0
  1404. package/dist/util/projectFiles/definitions.d.ts.map +1 -0
  1405. package/dist/util/projectFiles/definitions.js +112 -0
  1406. package/dist/util/projectFiles/definitions.js.map +1 -0
  1407. package/dist/util/projectFiles/parsers.d.ts +13 -0
  1408. package/dist/util/projectFiles/parsers.d.ts.map +1 -0
  1409. package/dist/util/projectFiles/parsers.js +122 -0
  1410. package/dist/util/projectFiles/parsers.js.map +1 -0
  1411. package/dist/util/projectFiles.d.ts +43 -0
  1412. package/dist/util/projectFiles.d.ts.map +1 -0
  1413. package/dist/util/projectFiles.js +572 -0
  1414. package/dist/util/projectFiles.js.map +1 -0
  1415. package/dist/util/resolution/files.d.ts +3 -0
  1416. package/dist/util/resolution/files.d.ts.map +1 -0
  1417. package/dist/util/resolution/files.js +29 -0
  1418. package/dist/util/resolution/files.js.map +1 -0
  1419. package/dist/util/resolution/findFirstExisting.d.ts +2 -0
  1420. package/dist/util/resolution/findFirstExisting.d.ts.map +1 -0
  1421. package/dist/util/resolution/findFirstExisting.js +13 -0
  1422. package/dist/util/resolution/findFirstExisting.js.map +1 -0
  1423. package/dist/util/resolution/go.d.ts +2 -0
  1424. package/dist/util/resolution/go.d.ts.map +1 -0
  1425. package/dist/util/resolution/go.js +171 -0
  1426. package/dist/util/resolution/go.js.map +1 -0
  1427. package/dist/util/resolution/jvm.d.ts +5 -0
  1428. package/dist/util/resolution/jvm.d.ts.map +1 -0
  1429. package/dist/util/resolution/jvm.js +124 -0
  1430. package/dist/util/resolution/jvm.js.map +1 -0
  1431. package/dist/util/resolution/node.d.ts +3 -0
  1432. package/dist/util/resolution/node.d.ts.map +1 -0
  1433. package/dist/util/resolution/node.js +60 -0
  1434. package/dist/util/resolution/node.js.map +1 -0
  1435. package/dist/util/resolution/php.d.ts +4 -0
  1436. package/dist/util/resolution/php.d.ts.map +1 -0
  1437. package/dist/util/resolution/php.js +498 -0
  1438. package/dist/util/resolution/php.js.map +1 -0
  1439. package/dist/util/resolution/phpComposer.d.ts +17 -0
  1440. package/dist/util/resolution/phpComposer.d.ts.map +1 -0
  1441. package/dist/util/resolution/phpComposer.js +269 -0
  1442. package/dist/util/resolution/phpComposer.js.map +1 -0
  1443. package/dist/util/resolution/projectSymbols.d.ts +14 -0
  1444. package/dist/util/resolution/projectSymbols.d.ts.map +1 -0
  1445. package/dist/util/resolution/projectSymbols.js +70 -0
  1446. package/dist/util/resolution/projectSymbols.js.map +1 -0
  1447. package/dist/util/resolution/python.d.ts +7 -0
  1448. package/dist/util/resolution/python.d.ts.map +1 -0
  1449. package/dist/util/resolution/python.js +129 -0
  1450. package/dist/util/resolution/python.js.map +1 -0
  1451. package/dist/util/resolution/rust.d.ts +2 -0
  1452. package/dist/util/resolution/rust.d.ts.map +1 -0
  1453. package/dist/util/resolution/rust.js +87 -0
  1454. package/dist/util/resolution/rust.js.map +1 -0
  1455. package/dist/util/resolution/tsconfig.d.ts +8 -0
  1456. package/dist/util/resolution/tsconfig.d.ts.map +1 -0
  1457. package/dist/util/resolution/tsconfig.js +131 -0
  1458. package/dist/util/resolution/tsconfig.js.map +1 -0
  1459. package/dist/util/resolution.d.ts +37 -0
  1460. package/dist/util/resolution.d.ts.map +1 -0
  1461. package/dist/util/resolution.js +276 -0
  1462. package/dist/util/resolution.js.map +1 -0
  1463. package/dist/util/resolutionCandidates.d.ts +5 -0
  1464. package/dist/util/resolutionCandidates.d.ts.map +1 -0
  1465. package/dist/util/resolutionCandidates.js +70 -0
  1466. package/dist/util/resolutionCandidates.js.map +1 -0
  1467. package/dist/util/rustTestModules.d.ts +3 -0
  1468. package/dist/util/rustTestModules.d.ts.map +1 -0
  1469. package/dist/util/rustTestModules.js +69 -0
  1470. package/dist/util/rustTestModules.js.map +1 -0
  1471. package/dist/util/semaphore.d.ts +2 -0
  1472. package/dist/util/semaphore.d.ts.map +1 -0
  1473. package/dist/util/semaphore.js +2 -0
  1474. package/dist/util/semaphore.js.map +1 -0
  1475. package/dist/util/sourceLocation.d.ts +8 -0
  1476. package/dist/util/sourceLocation.d.ts.map +1 -0
  1477. package/dist/util/sourceLocation.js +19 -0
  1478. package/dist/util/sourceLocation.js.map +1 -0
  1479. package/dist/util/specifiers.d.ts +17 -0
  1480. package/dist/util/specifiers.d.ts.map +1 -0
  1481. package/dist/util/specifiers.js +263 -0
  1482. package/dist/util/specifiers.js.map +1 -0
  1483. package/dist/util/sqliteSchema.d.ts +28 -0
  1484. package/dist/util/sqliteSchema.d.ts.map +1 -0
  1485. package/dist/util/sqliteSchema.js +66 -0
  1486. package/dist/util/sqliteSchema.js.map +1 -0
  1487. package/dist/util/symbolHash.d.ts +59 -0
  1488. package/dist/util/symbolHash.d.ts.map +1 -0
  1489. package/dist/util/symbolHash.js +84 -0
  1490. package/dist/util/symbolHash.js.map +1 -0
  1491. package/dist/util/workerThreads.d.ts +12 -0
  1492. package/dist/util/workerThreads.d.ts.map +1 -0
  1493. package/dist/util/workerThreads.js +16 -0
  1494. package/dist/util/workerThreads.js.map +1 -0
  1495. package/dist/util/workspace.d.ts +32 -0
  1496. package/dist/util/workspace.d.ts.map +1 -0
  1497. package/dist/util/workspace.js +288 -0
  1498. package/dist/util/workspace.js.map +1 -0
  1499. package/dist/util.d.ts +14 -0
  1500. package/dist/util.d.ts.map +1 -0
  1501. package/dist/util.js +10 -0
  1502. package/dist/util.js.map +1 -0
  1503. package/dist/worker/nativeExtractWorker.d.ts +61 -0
  1504. package/dist/worker/nativeExtractWorker.d.ts.map +1 -0
  1505. package/dist/worker/nativeExtractWorker.js +196 -0
  1506. package/dist/worker/nativeExtractWorker.js.map +1 -0
  1507. package/dist/worker/nativeWorkerPool.d.ts +10 -0
  1508. package/dist/worker/nativeWorkerPool.d.ts.map +1 -0
  1509. package/dist/worker/nativeWorkerPool.js +35 -0
  1510. package/dist/worker/nativeWorkerPool.js.map +1 -0
  1511. package/docs/graph-visualization/app.js +900 -0
  1512. package/docs/graph-visualization/file-tree-filters.js +50 -0
  1513. package/docs/graph-visualization/file-tree-model.js +186 -0
  1514. package/docs/graph-visualization/graph-builder.js +303 -0
  1515. package/docs/graph-visualization/index.html +65 -0
  1516. package/docs/graph-visualization/styles.css +513 -0
  1517. package/docs/graph-visualization/vendor/LICENSE.graphology-layout-forceatlas2.txt +21 -0
  1518. package/docs/graph-visualization/vendor/LICENSE.graphology.txt +21 -0
  1519. package/docs/graph-visualization/vendor/LICENSE.sigma.txt +12 -0
  1520. package/docs/graph-visualization/vendor/graphology-layout-forceatlas2.js +789 -0
  1521. package/docs/graph-visualization/vendor/graphology.js +4204 -0
  1522. package/docs/graph-visualization/vendor/sigma.js +5643 -0
  1523. package/docs/graph-visualization/viewer-selected-node.webp +0 -0
  1524. package/docs/mcp.md +373 -0
  1525. package/package.json +104 -0
@@ -0,0 +1,1579 @@
1
+ import crypto from "node:crypto";
2
+ import fs from "node:fs";
3
+ import fsp from "node:fs/promises";
4
+ import path from "node:path";
5
+ import { performance } from "node:perf_hooks";
6
+ import { languageExtensionPatterns, supportForFile } from "../languages.js";
7
+ import { loadWorkspaceConfig, resolveWorkspacePackage } from "../util/workspace.js";
8
+ import { DEFAULT_PROJECT_PATTERNS, discoverProjectFiles, listProjectFiles, } from "../util/projectFiles.js";
9
+ import { getGitHead, isGitRepo, getGitBlobHashes, listChangedFiles } from "../util/git.js";
10
+ import { clearImportResolutionCaches, resolveSpecifier } from "../util/resolution.js";
11
+ import { assertFilePathWithinRoot, fileIdentityKey, initializeFileIdentityCaseSensitivity, normalizePath, } from "../util/paths.js";
12
+ import { mapLimit } from "../util/concurrency.js";
13
+ import { resolveWorkerThreadCount } from "../util/workerThreads.js";
14
+ import { logWithLevel } from "../logging.js";
15
+ import { collectGraph } from "../graph-builder.js";
16
+ import { collectEdgesForFile } from "../graph-edge-collector.js";
17
+ import { buildGraphAdjacency } from "../graphs/adjacency.js";
18
+ import { isGraphOnlyLanguage } from "../documentLinks.js";
19
+ import { attemptParsePreparedFileContext } from "./parse-context.js";
20
+ import { ProjectedSyntaxTree } from "../native/projectedTree.js";
21
+ import { collectImportsForFile } from "./imports.js";
22
+ import { collectLocalsAndExportsFromSource } from "./locals-and-exports.js";
23
+ import { compareEdges, edgeKey, toRelativeEdge } from "./shared.js";
24
+ import { buildBloomFilterFromSource } from "../util/bloomFilter.js";
25
+ import { initNativeBackendReport } from "../native/nativeBackendReport.js";
26
+ import { closeDuplicateUnitCacheDatabase } from "../duplicates.js";
27
+ import { isNativeRequiredUnavailableError } from "../native/treeSitterNative.js";
28
+ import { isNodeSqliteUnavailableError } from "../sqlite-driver.js";
29
+ import { buildBloomFilterForFile, cacheSignatureForFile, closeDiskCacheDatabase, collectWorkspaceManifestDependencyEdges, computeConfigHash, createFallbackImportExtractionHandler, diffBuildOptions, fileSignature, graphOptionsEqual, initFileReport, initManifestReport, loadManifest, normalizeGraphOptions, normalizeIndexedFileInputs, normalizeLanguageExtensions, projectSnapshotFilesSignature, recordConfigHashResult, recordFileFailure, sanitizeManifestEntriesForRoot, sanitizeManifestTransientFilesForRoot, tryLoadFromCache, tryLoadPersistedBloomFilters, tryLoadProjectIndexSnapshot, verifyManifestEntries, writeProjectIndexSnapshot, writeToCache, } from "./build-cache.js";
30
+ import { cacheRoot } from "./build-cache/module-cache.js";
31
+ import { SymbolKind, } from "./types.js";
32
+ import { isNonNativeParserUnavailableError, isParserSyntaxTree } from "../parserBackend.js";
33
+ import { isUnsupportedParserInputError } from "../languages/filePrep.js";
34
+ import { buildSqlFactCache, buildSqlModuleIndex, sqlCorpusSignature } from "../sql/sourceGraph.js";
35
+ import { finalizeProjectIndex } from "./finalize.js";
36
+ import { toManifestFileEntry, writeIndexManifestSnapshot } from "./build-manifest.js";
37
+ import { prepareFileContextForBuild, setupWorkerPool, teardownWorkerPool, } from "./build-workers.js";
38
+ import { buildIncrementalGitDiffOptions, canUseIncrementalDiscoveryFastPath, collectDeletedTrackedFileDependents, collectTrackedFileDependents, isMissingGitRevisionError, listUntrackedProjectFiles, partitionTrackedManifestFiles, probePathExistence, } from "./incremental-plan.js";
39
+ import { parsedCacheMaxEntries, setParsedCacheEntry } from "./parsed-cache.js";
40
+ function initParserBackendDegradationReport(report) {
41
+ if (!report)
42
+ return undefined;
43
+ initNativeBackendReport(report);
44
+ report.backend ??= {
45
+ native: {
46
+ available: false,
47
+ enabled: false,
48
+ supportedLanguageIds: [],
49
+ filesUsed: 0,
50
+ filesFellBack: 0,
51
+ fallbackReasons: {
52
+ unavailable: 0,
53
+ unsupportedLanguage: 0,
54
+ queryFailure: 0,
55
+ },
56
+ byLanguage: {},
57
+ errors: [],
58
+ },
59
+ };
60
+ report.backend.parser ??= {
61
+ total: 0,
62
+ byLanguage: {},
63
+ files: [],
64
+ };
65
+ return report.backend.parser;
66
+ }
67
+ function recordParserBackendDegradation(report, entry) {
68
+ const parserReport = initParserBackendDegradationReport(report);
69
+ if (!parserReport)
70
+ return;
71
+ parserReport.total += 1;
72
+ parserReport.byLanguage[entry.languageId] = (parserReport.byLanguage[entry.languageId] ?? 0) + 1;
73
+ if (parserReport.files.length >= 20)
74
+ return;
75
+ parserReport.files.push(entry);
76
+ }
77
+ function createEmptyModuleIndex(file) {
78
+ return { file, exports: [], imports: [], locals: [] };
79
+ }
80
+ async function resolveCrossModuleSymbolExports(file, mod, support, projectRoot, graphOptions, workspaceConfig, logLevel) {
81
+ if (!support.supportsCrossModuleSymbols)
82
+ return;
83
+ if (support.id !== "ts" && support.id !== "js")
84
+ return;
85
+ const { matchPath } = await import("../util/resolution.js").then((mod) => mod.loadNearestTsconfigFor(file, projectRoot, logLevel));
86
+ for (const entry of mod.exports) {
87
+ if (entry.type !== "reexport" && entry.type !== "exportStar" && entry.type !== "namespaceReexport") {
88
+ continue;
89
+ }
90
+ if (entry.fromModule.startsWith(".")) {
91
+ const resolved = await resolveSpecifier(file, entry.fromModule, projectRoot, matchPath, workspaceConfig, {
92
+ resolveNodeModules: !!graphOptions.resolveNodeModules,
93
+ ...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
94
+ });
95
+ if (typeof resolved === "string")
96
+ entry.fromModule = resolved;
97
+ continue;
98
+ }
99
+ const pkgResolved = await resolveWorkspacePackage(entry.fromModule, workspaceConfig);
100
+ if (pkgResolved)
101
+ entry.fromModule = pkgResolved;
102
+ }
103
+ }
104
+ async function buildIndexedModuleForFile(args) {
105
+ const prepared = await prepareFileContextForBuild(args.file, args.support, args.opts, args.workerSetup, args.report);
106
+ const { source, sup, nativeQueries, embeddedBlocks } = prepared;
107
+ let resolvedLang = prepared.lang;
108
+ let tree;
109
+ const graphOnlyLanguage = isGraphOnlyLanguage(sup.id);
110
+ if (prepared.syntaxTree) {
111
+ tree = new ProjectedSyntaxTree(source, prepared.syntaxTree);
112
+ }
113
+ else if (!nativeQueries && !graphOnlyLanguage && sup.id !== "sql") {
114
+ const parseAttempt = attemptParsePreparedFileContext(prepared);
115
+ const parsed = parseAttempt.parsed;
116
+ if (parsed) {
117
+ tree = parsed.tree;
118
+ resolvedLang = parsed.lang;
119
+ setParsedCacheEntry(args.parsedMap, args.file, parsed, args.parsedCacheMaxEntries);
120
+ }
121
+ else {
122
+ recordParserBackendDegradation(args.report, {
123
+ file: args.file,
124
+ languageId: prepared.sup.id,
125
+ ...(parseAttempt.nativeFallbackReason ? { nativeFallbackReason: parseAttempt.nativeFallbackReason } : {}),
126
+ ...(parseAttempt.nativeError ? { nativeError: parseAttempt.nativeError } : {}),
127
+ ...(parseAttempt.jsError ? { jsError: parseAttempt.jsError } : {}),
128
+ });
129
+ }
130
+ }
131
+ else if (nativeQueries && !graphOnlyLanguage && sup.id !== "sql") {
132
+ // Worker returned queries without a tree (older path/fallback): reconstruct once.
133
+ const parseAttempt = attemptParsePreparedFileContext(prepared);
134
+ const parsed = parseAttempt.parsed;
135
+ if (parsed) {
136
+ tree = parsed.tree;
137
+ resolvedLang = parsed.lang ?? resolvedLang;
138
+ }
139
+ }
140
+ const lacksParserContext = !nativeQueries && !tree;
141
+ if (args.bloomFilterCache) {
142
+ const filter = buildBloomFilterFromSource(source, sup.id);
143
+ args.bloomFilterCache.set(args.file, filter);
144
+ }
145
+ const imports = sup.id === "sql"
146
+ ? []
147
+ : await collectImportsForFile(args.file, args.projectRoot, {
148
+ source,
149
+ ...(tree && isParserSyntaxTree(tree) ? { tree } : {}),
150
+ sup,
151
+ ...(resolvedLang ? { lang: resolvedLang } : {}),
152
+ ...(nativeQueries !== undefined ? { nativeQueries } : {}),
153
+ graphOptions: args.graphOptions,
154
+ ...(args.opts?.native ? { native: args.opts.native } : {}),
155
+ ...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
156
+ ...(args.opts?.languageExtensions ? { languageExtensions: args.opts.languageExtensions } : {}),
157
+ ...(args.onFallbackImportExtraction ? { onFallbackImportExtraction: args.onFallbackImportExtraction } : {}),
158
+ });
159
+ for (const block of embeddedBlocks ?? []) {
160
+ imports.push(...(await collectImportsForFile(args.file, args.projectRoot, {
161
+ source: block.source,
162
+ sup: block.sup,
163
+ graphOptions: args.graphOptions,
164
+ ...(args.opts?.native ? { native: args.opts.native } : {}),
165
+ ...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
166
+ ...(args.opts?.languageExtensions ? { languageExtensions: args.opts.languageExtensions } : {}),
167
+ ...(args.onFallbackImportExtraction ? { onFallbackImportExtraction: args.onFallbackImportExtraction } : {}),
168
+ })));
169
+ }
170
+ collectJsonDependencies(imports, args.jsonDependencies);
171
+ let mod;
172
+ if (sup.id === "sql") {
173
+ mod = buildSqlModuleIndex(args.file, source);
174
+ }
175
+ else if (lacksParserContext) {
176
+ mod = { ...createEmptyModuleIndex(args.file), imports };
177
+ }
178
+ else {
179
+ mod = collectLocalsAndExportsFromSource(args.file, source, sup, resolvedLang, imports, {
180
+ ...(tree ? { tree } : {}),
181
+ ...(nativeQueries !== undefined ? { nativeQueries } : {}),
182
+ ...(args.opts?.native ? { nativeMode: args.opts.native } : {}),
183
+ ...(args.opts?.logLevel ? { logLevel: args.opts.logLevel } : {}),
184
+ });
185
+ }
186
+ mod.imports = imports;
187
+ await resolveCrossModuleSymbolExports(args.file, mod, sup, args.projectRoot, args.graphOptions, args.workspaceConfig, args.opts?.logLevel);
188
+ const sigInfo = args.fileSignatures.get(args.file);
189
+ const cacheable = !prepared.nativeFallbackReason && !lacksParserContext;
190
+ if (sigInfo && cacheable) {
191
+ const cacheSig = args.cacheEnabled
192
+ ? await moduleCacheSignatureForFile(args.file, sigInfo, args.opts)
193
+ : sigInfo.cacheSig;
194
+ writeToCache(args.projectRoot, args.file, cacheSig, mod, args.opts);
195
+ }
196
+ return {
197
+ module: mod,
198
+ graphContext: {
199
+ source,
200
+ sup,
201
+ ...(resolvedLang ? { lang: resolvedLang } : {}),
202
+ ...(nativeQueries !== undefined ? { nativeQueries } : {}),
203
+ ...(tree ? { tree } : {}),
204
+ ...(embeddedBlocks ? { embeddedBlocks } : {}),
205
+ },
206
+ };
207
+ }
208
+ function isJsonFile(filePath) {
209
+ return filePath.toLowerCase().endsWith(".json");
210
+ }
211
+ function collectJsonDependencies(imports, bucket) {
212
+ for (const imp of imports) {
213
+ const resolved = typeof imp.resolved === "string" ? normalizePath(imp.resolved) : null;
214
+ if (resolved && isJsonFile(resolved))
215
+ bucket.set(fileIdentityKey(resolved), resolved);
216
+ }
217
+ }
218
+ function ensureJsonModule(modules, filePath) {
219
+ const resolved = path.resolve(filePath);
220
+ const normalized = normalizePath(resolved);
221
+ const key = fileIdentityKey(normalized);
222
+ if (modules.has(key))
223
+ return;
224
+ if (!fs.existsSync(resolved))
225
+ return;
226
+ const pos = { line: 1, column: 1, index: 0 };
227
+ const symbol = {
228
+ file: normalized,
229
+ localName: "default",
230
+ kind: SymbolKind.Default,
231
+ range: { start: pos, end: pos },
232
+ };
233
+ modules.set(key, {
234
+ file: normalized,
235
+ exports: [{ type: "local", exportedAs: "default", target: symbol }],
236
+ imports: [],
237
+ locals: [symbol],
238
+ });
239
+ }
240
+ function graphEdgeKey(edge) {
241
+ const from = fileIdentityKey(edge.from);
242
+ const target = edge.to.type === "file" ? `file:${fileIdentityKey(edge.to.path)}` : `external:${edge.to.name}`;
243
+ return `${from}::${target}::${edge.raw ?? ""}::${edge.typeOnly ? 1 : 0}`;
244
+ }
245
+ async function moduleCacheSignatureForFile(file, sigInfo, opts) {
246
+ const baseSignature = await cacheSignatureForFile(file, sigInfo, opts);
247
+ const normalizedExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
248
+ if (!normalizedExtensions)
249
+ return baseSignature;
250
+ // Combine via a hash rather than raw concatenation: the disk cache stores this string in a
251
+ // SQLite TEXT column, and node:sqlite's DatabaseSync silently truncates TEXT bind parameters
252
+ // at embedded NUL bytes, so a raw separator character risks the stored and freshly-computed
253
+ // signatures never matching (permanent cache miss) if either baseSignature or the serialized
254
+ // extensions ever contained one.
255
+ const hash = crypto.createHash("sha1");
256
+ hash.update(baseSignature);
257
+ hash.update(JSON.stringify(Object.entries(normalizedExtensions)));
258
+ return hash.digest("hex");
259
+ }
260
+ function projectPatternsForLanguageExtensions(opts) {
261
+ const customPatterns = languageExtensionPatterns(opts?.languageExtensions);
262
+ if (!customPatterns.length)
263
+ return undefined;
264
+ return [...DEFAULT_PROJECT_PATTERNS, ...customPatterns];
265
+ }
266
+ function expandStarImports(modules, opts) {
267
+ const expandedImportKey = (binding) => {
268
+ const typeOnly = binding.typeOnly ?? false;
269
+ if (binding.kind === "named") {
270
+ return JSON.stringify(["named", binding.from, binding.resolved, typeOnly, binding.local, binding.imported]);
271
+ }
272
+ if (binding.kind === "namespace") {
273
+ return JSON.stringify(["namespace", binding.from, binding.resolved, typeOnly, binding.localNS]);
274
+ }
275
+ return null;
276
+ };
277
+ for (const mod of modules.values()) {
278
+ const expandedImportKeys = new Set();
279
+ for (const existing of mod.imports) {
280
+ const key = expandedImportKey(existing);
281
+ if (key)
282
+ expandedImportKeys.add(key);
283
+ }
284
+ for (const imp of [...mod.imports]) {
285
+ if (imp.kind !== "star" || typeof imp.resolved !== "string")
286
+ continue;
287
+ const target = modules.get(fileIdentityKey(imp.resolved));
288
+ if (!target)
289
+ continue;
290
+ const targetSupport = supportForFile(imp.resolved, opts?.languageExtensions);
291
+ const exportedSymbols = target.exports.filter((entry) => entry.type === "local").length
292
+ ? target.exports
293
+ .filter((entry) => entry.type === "local")
294
+ .map((entry) => entry.target)
295
+ : target.locals.filter((local) => !local.localName.startsWith("_"));
296
+ const seen = new Set();
297
+ for (const symbol of exportedSymbols) {
298
+ if (!symbol.localName || seen.has(symbol.localName))
299
+ continue;
300
+ seen.add(symbol.localName);
301
+ const treatAsNamespace = targetSupport?.id === "ruby" && symbol.kind === SymbolKind.Class;
302
+ const expandedImport = treatAsNamespace
303
+ ? {
304
+ kind: "namespace",
305
+ localNS: symbol.localName,
306
+ from: imp.from,
307
+ resolved: imp.resolved,
308
+ ...(imp.typeOnly !== undefined ? { typeOnly: imp.typeOnly } : {}),
309
+ }
310
+ : {
311
+ kind: "named",
312
+ local: symbol.localName,
313
+ imported: symbol.localName,
314
+ from: imp.from,
315
+ resolved: imp.resolved,
316
+ ...(imp.typeOnly !== undefined ? { typeOnly: imp.typeOnly } : {}),
317
+ };
318
+ const expandedImportKeyValue = expandedImportKey(expandedImport);
319
+ if (!expandedImportKeyValue || expandedImportKeys.has(expandedImportKeyValue))
320
+ continue;
321
+ expandedImportKeys.add(expandedImportKeyValue);
322
+ mod.imports.push(expandedImport);
323
+ }
324
+ }
325
+ }
326
+ }
327
+ function toProjectIndexManifestEntry(entry) {
328
+ return {
329
+ sig: entry.sig,
330
+ ...(entry.gitSig ? { gitSig: entry.gitSig } : {}),
331
+ };
332
+ }
333
+ function projectIndexManifestEntries(entries) {
334
+ return new Map(Array.from(entries, ([file, entry]) => [file, toProjectIndexManifestEntry(entry)]));
335
+ }
336
+ function createIndexBuildRunState(projectRoot, opts, graphOptions = normalizeGraphOptions(opts?.graph)) {
337
+ const report = opts?.report;
338
+ if (report)
339
+ initNativeBackendReport(report);
340
+ const cacheMode = opts?.cache ?? "off";
341
+ return {
342
+ normalizedProjectRoot: normalizePath(projectRoot),
343
+ report,
344
+ timings: report?.timings,
345
+ totalStart: performance.now(),
346
+ cacheMode,
347
+ cacheEnabled: cacheMode !== "off",
348
+ graphOptions,
349
+ onFallbackImportExtraction: createFallbackImportExtractionHandler(report, opts),
350
+ };
351
+ }
352
+ function emitIndexLifecycleProgress(opts, phase, mode, total, elapsedMs) {
353
+ let message = "Index ready";
354
+ if (phase === "start") {
355
+ const action = mode === "build" ? "Building" : "Updating";
356
+ message = `${action} project index`;
357
+ }
358
+ opts?.onProgress?.({
359
+ type: "progress",
360
+ phase,
361
+ mode,
362
+ message,
363
+ current: phase === "complete" ? total : 0,
364
+ total,
365
+ ...(elapsedMs !== undefined ? { elapsedMs } : {}),
366
+ });
367
+ }
368
+ function buildConcurrency(opts) {
369
+ return resolveWorkerThreadCount({ requested: Number(opts?.threads || 0), defaultCount: 8, max: 64 });
370
+ }
371
+ async function prepareFileSignatures(args) {
372
+ const entries = await mapLimit(args.files, args.concurrency, async (file) => {
373
+ const gitSig = args.gitSigMap.get(file);
374
+ const sigInfo = await fileSignature(file, args.opts?.cacheStrict, gitSig, {
375
+ forceContentHash: args.cacheEnabled && !gitSig,
376
+ });
377
+ return [file, sigInfo];
378
+ });
379
+ return new Map(entries);
380
+ }
381
+ async function buildProjectIndexFromExport(projectRoot, opts, helperOpts) {
382
+ return buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpts);
383
+ }
384
+ async function buildIndexFromFileListShared(projectRoot, rawFiles, opts, helperOpts) {
385
+ clearImportResolutionCaches();
386
+ await initializeFileIdentityCaseSensitivity(projectRoot);
387
+ const { normalizedProjectRoot, report, timings, totalStart, cacheMode, cacheEnabled, graphOptions, onFallbackImportExtraction, } = createIndexBuildRunState(projectRoot, opts);
388
+ const manifestMode = helperOpts?.manifestMode ?? "off";
389
+ const useManifest = manifestMode !== "off";
390
+ const shouldWriteManifest = manifestMode === "read-write";
391
+ const projectFiles = helperOpts?.projectFiles;
392
+ initManifestReport(report, useManifest, false);
393
+ const normalizedFiles = Array.from(new Set(normalizeIndexedFileInputs(projectRoot, rawFiles ?? [], "Index file")));
394
+ if (!normalizedFiles.length && helperOpts?.warnNoFilesMessage) {
395
+ logWithLevel(opts?.logLevel, "warn", helperOpts.warnNoFilesMessage);
396
+ }
397
+ const fileReport = initFileReport(report);
398
+ if (fileReport)
399
+ fileReport.total = normalizedFiles.length;
400
+ const manifestStart = performance.now();
401
+ const manifest = useManifest && !helperOpts?.ignoreExistingManifest ? await loadManifest(projectRoot, opts) : null;
402
+ const manifestFiles = sanitizeManifestEntriesForRoot(projectRoot, manifest?.files);
403
+ const manifestOptionDiffs = manifest ? diffBuildOptions(manifest.buildOptions, opts) : [];
404
+ const languageExtensionsChanged = manifestOptionDiffs.includes("languageExtensions");
405
+ const implementationChanged = manifestOptionDiffs.includes("implementation");
406
+ if (timings && useManifest) {
407
+ timings.manifestMs = Math.round(performance.now() - manifestStart);
408
+ }
409
+ const edgeProbeConcurrency = buildConcurrency(opts);
410
+ const staleCachedEdgeFiles = new Set();
411
+ if (manifest) {
412
+ const edgeTargetPaths = [];
413
+ for (const entry of Object.values(manifestFiles)) {
414
+ for (const edge of entry.edges) {
415
+ if (edge.to.type === "file")
416
+ edgeTargetPaths.push(edge.to.path);
417
+ }
418
+ }
419
+ const edgeTargetExistence = await probePathExistence(edgeTargetPaths, edgeProbeConcurrency);
420
+ for (const [file, entry] of Object.entries(manifestFiles)) {
421
+ if (entry.edges.some((edge) => edge.to.type === "file" && !edgeTargetExistence.get(edge.to.path))) {
422
+ staleCachedEdgeFiles.add(file);
423
+ }
424
+ }
425
+ }
426
+ const cachedGraphEntries = manifest &&
427
+ !languageExtensionsChanged &&
428
+ !implementationChanged &&
429
+ graphOptionsEqual(manifest.graphOptions, graphOptions)
430
+ ? new Map(Object.entries(manifestFiles).filter(([file]) => !staleCachedEdgeFiles.has(file)))
431
+ : undefined;
432
+ if (report?.manifest) {
433
+ report.manifest.reused = !!cachedGraphEntries;
434
+ }
435
+ const manifestEntries = shouldWriteManifest ? new Map() : undefined;
436
+ const manifestEntriesForIndex = useManifest
437
+ ? projectIndexManifestEntries(cachedGraphEntries ?? [])
438
+ : new Map();
439
+ const modules = new Map();
440
+ const gitAvailable = await isGitRepo(projectRoot);
441
+ const useGitSignatures = gitAvailable && (cacheMode !== "off" || opts?.cacheStrict);
442
+ const gitSigMap = useGitSignatures
443
+ ? await getGitBlobHashes(projectRoot, normalizedFiles, {
444
+ gitAvailable,
445
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
446
+ })
447
+ : new Map();
448
+ const conc = edgeProbeConcurrency;
449
+ const languageExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
450
+ const sqlFiles = normalizedFiles
451
+ .filter((file) => {
452
+ if (!languageExtensions)
453
+ return path.extname(file).toLowerCase() === ".sql";
454
+ return supportForFile(file, languageExtensions)?.id === "sql";
455
+ })
456
+ .sort((left, right) => left.localeCompare(right));
457
+ const fileSignatures = await prepareFileSignatures({
458
+ files: sqlFiles,
459
+ opts,
460
+ gitSigMap,
461
+ cacheEnabled,
462
+ concurrency: conc,
463
+ });
464
+ const sqlCorpusSig = sqlCorpusSignature(sqlFiles, fileSignatures);
465
+ let sqlFactCachePromise;
466
+ const getSqlFactCache = () => {
467
+ sqlFactCachePromise ??= buildSqlFactCache(normalizedFiles, opts?.languageExtensions);
468
+ return sqlFactCachePromise;
469
+ };
470
+ const shouldProvideSqlFactCache = (file, sigInfo, cachedEdgesEntry) => {
471
+ if (supportForFile(file, opts?.languageExtensions)?.id !== "sql")
472
+ return false;
473
+ if (!cachedEdgesEntry || !sqlCorpusSig || cachedEdgesEntry.sqlCorpusSig !== sqlCorpusSig)
474
+ return true;
475
+ const matchesGitSig = !!sigInfo.gitSig && !!cachedEdgesEntry.gitSig && cachedEdgesEntry.gitSig === sigInfo.gitSig;
476
+ return !(matchesGitSig || cachedEdgesEntry.sig === sigInfo.sig);
477
+ };
478
+ const jsonDependencies = new Map();
479
+ const workerSetup = await setupWorkerPool(opts, normalizedFiles.length);
480
+ try {
481
+ const useBloomFilters = opts?.useBloomFilters ?? true;
482
+ const bloomFilterCache = useBloomFilters
483
+ ? new (await import("../util/bloomFilter.js")).BloomFilterCache()
484
+ : undefined;
485
+ const persistedBloomFilters = bloomFilterCache ? await tryLoadPersistedBloomFilters(projectRoot, opts) : null;
486
+ const parsedMap = new Map();
487
+ const workspaceConfig = await loadWorkspaceConfig(projectRoot);
488
+ const parseStart = performance.now();
489
+ const graph = { nodes: new Set(normalizedFiles), edges: [] };
490
+ const onFileEdges = manifestEntries
491
+ ? (file, entry) => {
492
+ const manifestEntry = toManifestFileEntry(entry);
493
+ if (!manifestEntry)
494
+ return;
495
+ manifestEntries.set(file, manifestEntry);
496
+ }
497
+ : undefined;
498
+ let processedFiles = 0;
499
+ const totalFiles = normalizedFiles.length;
500
+ let buildStartedAt;
501
+ const ensureBuildProgressStarted = () => {
502
+ if (buildStartedAt !== undefined)
503
+ return;
504
+ buildStartedAt = performance.now();
505
+ emitIndexLifecycleProgress(opts, "start", "build", totalFiles);
506
+ };
507
+ const fileResults = await mapLimit(normalizedFiles, conc, async (file) => {
508
+ try {
509
+ let sigInfo = fileSignatures.get(file);
510
+ if (!sigInfo) {
511
+ const gitSig = gitSigMap.get(file);
512
+ sigInfo = await fileSignature(file, opts?.cacheStrict, gitSig, {
513
+ forceContentHash: cacheEnabled && !gitSig,
514
+ });
515
+ fileSignatures.set(file, sigInfo);
516
+ }
517
+ manifestEntriesForIndex.set(file, toProjectIndexManifestEntry(sigInfo));
518
+ if (manifestEntries) {
519
+ const initialManifestEntry = toManifestFileEntry({ ...sigInfo, edges: [] });
520
+ if (initialManifestEntry)
521
+ manifestEntries.set(file, initialManifestEntry);
522
+ }
523
+ const cacheSig = cacheEnabled ? await moduleCacheSignatureForFile(file, sigInfo, opts) : sigInfo.cacheSig;
524
+ let mod = cacheEnabled ? tryLoadFromCache(projectRoot, file, cacheSig, opts, report) : null;
525
+ if (mod && fileReport) {
526
+ fileReport.cached = (fileReport.cached ?? 0) + 1;
527
+ }
528
+ const cachedEdgesEntry = cachedGraphEntries?.get(file);
529
+ const edgesCached = !!cachedEdgesEntry &&
530
+ ((cachedEdgesEntry.gitSig && cachedEdgesEntry.gitSig === sigInfo.gitSig) ||
531
+ cachedEdgesEntry.sig === sigInfo.sig);
532
+ const sqlFactCache = shouldProvideSqlFactCache(file, sigInfo, cachedEdgesEntry)
533
+ ? await getSqlFactCache()
534
+ : undefined;
535
+ let edges = [];
536
+ if (mod && edgesCached) {
537
+ edges = await collectEdgesForFile(file, projectRoot, workspaceConfig, {
538
+ fast: !!graphOptions.fast,
539
+ ...(graphOptions.fastRegexDisabledLanguages
540
+ ? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
541
+ : {}),
542
+ resolveNodeModules: !!graphOptions.resolveNodeModules,
543
+ dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
544
+ ...(opts?.native ? { native: opts.native } : {}),
545
+ ...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
546
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
547
+ ...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
548
+ fileSignature: sigInfo,
549
+ ...(sqlCorpusSig ? { sqlCorpusSig } : {}),
550
+ ...(cachedEdgesEntry ? { cachedFileEdges: cachedEdgesEntry } : {}),
551
+ ...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
552
+ ...(onFileEdges ? { onFileEdges } : {}),
553
+ ...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
554
+ allFiles: normalizedFiles,
555
+ ...(sqlFactCache ? { sqlFactCache } : {}),
556
+ });
557
+ if (bloomFilterCache) {
558
+ const persistedFilter = persistedBloomFilters?.get(file);
559
+ if (persistedFilter) {
560
+ bloomFilterCache.set(file, persistedFilter);
561
+ }
562
+ else {
563
+ const filter = await buildBloomFilterForFile(file, opts);
564
+ if (filter)
565
+ bloomFilterCache.set(file, filter);
566
+ }
567
+ }
568
+ return [file, mod, edges];
569
+ }
570
+ if (fileReport)
571
+ fileReport.parsed = (fileReport.parsed ?? 0) + 1;
572
+ const support = supportForFile(file, opts?.languageExtensions);
573
+ if (!support)
574
+ return [file, createEmptyModuleIndex(file), []];
575
+ ensureBuildProgressStarted();
576
+ let graphContext;
577
+ if (!mod) {
578
+ const built = await buildIndexedModuleForFile({
579
+ file,
580
+ support,
581
+ projectRoot,
582
+ opts,
583
+ report,
584
+ graphOptions,
585
+ workspaceConfig,
586
+ workerSetup,
587
+ parsedMap,
588
+ parsedCacheMaxEntries: parsedCacheMaxEntries(opts),
589
+ jsonDependencies,
590
+ bloomFilterCache,
591
+ onFallbackImportExtraction,
592
+ fileSignatures,
593
+ cacheEnabled,
594
+ });
595
+ mod = built.module;
596
+ graphContext = built.graphContext;
597
+ }
598
+ else {
599
+ collectJsonDependencies(mod.imports, jsonDependencies);
600
+ }
601
+ edges = await collectEdgesForFile(file, projectRoot, workspaceConfig, {
602
+ ...(graphContext ? { parsed: graphContext } : {}),
603
+ fast: !!graphOptions.fast,
604
+ ...(graphOptions.fastRegexDisabledLanguages
605
+ ? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
606
+ : {}),
607
+ resolveNodeModules: !!graphOptions.resolveNodeModules,
608
+ dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
609
+ ...(opts?.native ? { native: opts.native } : {}),
610
+ ...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
611
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
612
+ ...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
613
+ fileSignature: sigInfo,
614
+ ...(sqlCorpusSig ? { sqlCorpusSig } : {}),
615
+ ...(cachedEdgesEntry ? { cachedFileEdges: cachedEdgesEntry } : {}),
616
+ ...(manifest?.projectRoot ? { cachedFileEdgesProjectRoot: manifest.projectRoot } : {}),
617
+ ...(onFileEdges ? { onFileEdges } : {}),
618
+ ...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
619
+ allFiles: normalizedFiles,
620
+ ...(sqlFactCache ? { sqlFactCache } : {}),
621
+ });
622
+ return [file, mod ?? createEmptyModuleIndex(file), edges];
623
+ }
624
+ catch (error) {
625
+ if (isNativeRequiredUnavailableError(error) || isNodeSqliteUnavailableError(error))
626
+ throw error;
627
+ if (isUnsupportedParserInputError(error) || isNonNativeParserUnavailableError(error)) {
628
+ return [file, createEmptyModuleIndex(file), []];
629
+ }
630
+ recordFileFailure(report, file, error);
631
+ logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
632
+ return [file, createEmptyModuleIndex(file), []];
633
+ }
634
+ finally {
635
+ processedFiles += 1;
636
+ if (opts?.onProgress && buildStartedAt !== undefined) {
637
+ opts.onProgress({
638
+ type: "progress",
639
+ phase: "update",
640
+ mode: "build",
641
+ message: `Indexed ${file}`,
642
+ current: processedFiles,
643
+ total: totalFiles,
644
+ });
645
+ }
646
+ }
647
+ });
648
+ if (timings)
649
+ timings.parseMs = Math.round(performance.now() - parseStart);
650
+ const graphStart = performance.now();
651
+ const seenGraphEdges = new Set();
652
+ const appendUniqueGraphEdges = (edges) => {
653
+ if (!edges.length)
654
+ return;
655
+ for (const edge of edges) {
656
+ const key = graphEdgeKey(edge);
657
+ if (seenGraphEdges.has(key))
658
+ continue;
659
+ seenGraphEdges.add(key);
660
+ graph.edges.push(edge);
661
+ if (edge.to.type === "file")
662
+ graph.nodes.add(edge.to.path);
663
+ }
664
+ };
665
+ for (const [file, mod, edges] of fileResults) {
666
+ modules.set(fileIdentityKey(file), mod);
667
+ appendUniqueGraphEdges(edges);
668
+ }
669
+ const workspaceManifestEdges = await collectWorkspaceManifestDependencyEdges(projectRoot, opts?.discovery, new Set(normalizedFiles), opts?.logLevel);
670
+ appendUniqueGraphEdges(workspaceManifestEdges);
671
+ if (timings)
672
+ timings.graphMs = Math.round(performance.now() - graphStart);
673
+ for (const jsonPath of jsonDependencies.values()) {
674
+ ensureJsonModule(modules, jsonPath);
675
+ }
676
+ expandStarImports(modules, opts);
677
+ if (manifestEntries) {
678
+ await writeIndexManifestSnapshot({
679
+ projectRoot,
680
+ opts,
681
+ graphOptions,
682
+ files: manifestEntries,
683
+ timings,
684
+ manifestReport: report?.manifest,
685
+ ...(helperOpts?.transientFiles !== undefined ? { transientFiles: helperOpts.transientFiles } : {}),
686
+ ...(helperOpts?.symlinkDirectories !== undefined ? { symlinkDirectories: helperOpts.symlinkDirectories } : {}),
687
+ });
688
+ }
689
+ const index = await finalizeProjectIndex({
690
+ projectRoot,
691
+ normalizedProjectRoot,
692
+ opts,
693
+ timings,
694
+ totalStart,
695
+ graph,
696
+ modules,
697
+ parsedMap,
698
+ bloomFilterCache,
699
+ ...(projectFiles !== undefined ? { projectFiles } : {}),
700
+ buildReport: report,
701
+ manifestEntries: manifestEntriesForIndex,
702
+ });
703
+ if (manifestEntries) {
704
+ await writeProjectIndexSnapshot(projectRoot, opts, index, projectSnapshotFilesSignature(manifestEntries));
705
+ }
706
+ if (buildStartedAt !== undefined) {
707
+ emitIndexLifecycleProgress(opts, "complete", "build", index.byFile.size, performance.now() - buildStartedAt);
708
+ }
709
+ return index;
710
+ }
711
+ finally {
712
+ await teardownWorkerPool(workerSetup, report);
713
+ }
714
+ }
715
+ async function buildProjectIndexWithManifestOptions(projectRoot, opts, helperOpts) {
716
+ await initializeFileIdentityCaseSensitivity(projectRoot);
717
+ try {
718
+ const useDiskCache = (opts?.cache ?? "off") === "disk";
719
+ // With disk caching enabled, reuse the previous full scan's symlinked-directory
720
+ // list so the file-discovery and project-file walks below can skip their own
721
+ // full-tree symlink probe. Off and memory modes never read or write this disk
722
+ // manifest, keeping read-only builds from mutating the project root. A missing or
723
+ // unusable manifest falls back to probing once.
724
+ // A symlink hint never expires on its own: `knownSymlinkDirectories` disables probing entirely, so
725
+ // a directory symlinked in after the hint was recorded (e.g. `npm link`) would
726
+ // otherwise never be discovered. `--cache-strict`/`--cache-verify` are explicit asks
727
+ // for maximum correctness over speed, so both force a fresh probe here too.
728
+ const wantsMaxSymlinkCorrectness = !!opts?.cacheStrict || !!opts?.cacheVerify;
729
+ const symlinkHintManifest = helperOpts?.ignoreExistingManifest || wantsMaxSymlinkCorrectness || !useDiskCache
730
+ ? null
731
+ : await loadManifest(projectRoot, opts);
732
+ const knownSymlinkDirectories = symlinkHintManifest?.symlinkDirectories;
733
+ let discoveredSymlinkDirectories = knownSymlinkDirectories;
734
+ const onSymlinkDirectoriesDiscovered = (directories) => {
735
+ discoveredSymlinkDirectories = Array.from(directories);
736
+ };
737
+ // When the hint is unknown, listProjectFiles() and discoverProjectFiles() must run
738
+ // sequentially rather than in Promise.all: both would otherwise start their own
739
+ // full-tree symlink probe concurrently, since the callback only reports back after
740
+ // listProjectFiles() resolves, too late to inform a probe discoverProjectFiles()
741
+ // already started on its own. Sequencing costs a little parallelism on that one
742
+ // cold-start case, but avoids paying for two full-tree walks instead of one. Once a
743
+ // hint is known (the common warm case), both calls skip probing entirely, so running
744
+ // them sequentially here costs no meaningful time either way.
745
+ const discoveredFiles = await listProjectFiles(projectRoot, projectPatternsForLanguageExtensions(opts), {
746
+ ...opts?.discovery,
747
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
748
+ ...(knownSymlinkDirectories !== undefined ? { knownSymlinkDirectories } : {}),
749
+ onSymlinkDirectoriesDiscovered,
750
+ });
751
+ const additionalFileCandidates = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional index file");
752
+ const additionalFileExistence = await probePathExistence(additionalFileCandidates, buildConcurrency(opts));
753
+ const additionalFiles = additionalFileCandidates.filter((file) => additionalFileExistence.get(file));
754
+ const discoveredFileSet = new Set(discoveredFiles);
755
+ const files = Array.from(new Set([...discoveredFiles, ...additionalFiles]));
756
+ const transientFiles = additionalFiles.filter((file) => !discoveredFileSet.has(file));
757
+ const projectFiles = await discoverProjectFiles(projectRoot, {
758
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
759
+ ...(discoveredSymlinkDirectories !== undefined ? { knownSymlinkDirectories: discoveredSymlinkDirectories } : {}),
760
+ });
761
+ return await buildIndexFromFileListShared(projectRoot, files, opts, {
762
+ manifestMode: useDiskCache ? "read-write" : "off",
763
+ warnNoFilesMessage: `Warning: No files found in project root: ${projectRoot}. Check codegraph.config.json globs and CLI --include-glob/--ignore-glob filters. Diagnostic: codegraph doctor`,
764
+ ...(helperOpts?.ignoreExistingManifest ? { ignoreExistingManifest: true } : {}),
765
+ projectFiles,
766
+ transientFiles,
767
+ ...(discoveredSymlinkDirectories !== undefined ? { symlinkDirectories: discoveredSymlinkDirectories } : {}),
768
+ });
769
+ }
770
+ finally {
771
+ if ((opts?.cache ?? "off") === "disk") {
772
+ closeDiskCacheDatabase(projectRoot, opts);
773
+ closeDuplicateUnitCacheDatabase(projectRoot, opts);
774
+ }
775
+ }
776
+ }
777
+ /**
778
+ * Build a complete project index for a repo root.
779
+ *
780
+ * The returned index contains the file dependency graph, per-file module indexes,
781
+ * symbol definitions, imports, exports, and project-file metadata. Build it once
782
+ * and pass it to navigation, review, impact, or agent-tool APIs when composing
783
+ * deterministic packets from the same repo snapshot.
784
+ */
785
+ export async function buildProjectIndex(projectRoot, opts) {
786
+ return buildProjectIndexWithManifestOptions(projectRoot, opts);
787
+ }
788
+ /**
789
+ * Build a project index from an explicit file list.
790
+ *
791
+ * Use this when a caller already has a scoped manifest, sparse checkout, or
792
+ * deterministic pack boundary and does not want Codegraph to discover every file
793
+ * under the project root.
794
+ */
795
+ export async function buildProjectIndexFromFiles(projectRoot, inputFiles, opts) {
796
+ try {
797
+ const useDiskCache = (opts?.cache ?? "off") === "disk";
798
+ return await buildIndexFromFileListShared(projectRoot, inputFiles, opts, {
799
+ manifestMode: useDiskCache ? "read-only" : "off",
800
+ warnNoFilesMessage: `Warning: No files provided for indexing in ${projectRoot}. Check the explicit file list and include/ignore filters. Diagnostic: codegraph doctor`,
801
+ });
802
+ }
803
+ finally {
804
+ if ((opts?.cache ?? "off") === "disk") {
805
+ closeDiskCacheDatabase(projectRoot, opts);
806
+ closeDuplicateUnitCacheDatabase(projectRoot, opts);
807
+ }
808
+ }
809
+ }
810
+ /**
811
+ * Build exactly the file list a caller declared as the current project scope.
812
+ *
813
+ * Identical to {@link buildProjectIndexFromFiles} except that an empty list is a valid
814
+ * query result (a scope whose filters matched nothing), not the missing-file-list operator
815
+ * error that variant warns about. The manifest stays read-only either way, so a scoped
816
+ * build never rewrites project-wide state.
817
+ */
818
+ async function buildDeclaredScopeIndex(projectRoot, scopeFiles, opts) {
819
+ try {
820
+ const useDiskCache = (opts?.cache ?? "off") === "disk";
821
+ return await buildIndexFromFileListShared(projectRoot, [...scopeFiles], opts, {
822
+ manifestMode: useDiskCache ? "read-only" : "off",
823
+ });
824
+ }
825
+ finally {
826
+ if ((opts?.cache ?? "off") === "disk") {
827
+ closeDiskCacheDatabase(projectRoot, opts);
828
+ closeDuplicateUnitCacheDatabase(projectRoot, opts);
829
+ }
830
+ }
831
+ }
832
+ /**
833
+ * Build or refresh a project index using the on-disk manifest when available.
834
+ *
835
+ * Incremental options can target explicit files, `changedSince`, or a
836
+ * `gitBase`/`gitHead` range. `gitHead` accepts `WORKTREE`, `STAGED`, and `INDEX`
837
+ * sentinels for review-agent workflows that analyze uncommitted changes.
838
+ */
839
+ export async function buildProjectIndexIncremental(projectRoot, opts) {
840
+ await initializeFileIdentityCaseSensitivity(projectRoot);
841
+ clearImportResolutionCaches();
842
+ const graphOptions = normalizeGraphOptions(opts?.graph);
843
+ const strictIncremental = opts?.incrementalStrict ?? false;
844
+ if (strictIncremental && graphOptions.fast)
845
+ graphOptions.fast = false;
846
+ const { normalizedProjectRoot, report, timings, totalStart, cacheMode, cacheEnabled, onFallbackImportExtraction } = createIndexBuildRunState(projectRoot, opts, graphOptions);
847
+ let checkProgressActive = false;
848
+ const startCheckProgress = () => {
849
+ if (checkProgressActive)
850
+ return;
851
+ checkProgressActive = true;
852
+ opts?.onProgress?.({
853
+ type: "progress",
854
+ phase: "start",
855
+ mode: "check",
856
+ message: "Checking project index",
857
+ current: 0,
858
+ total: 0,
859
+ });
860
+ };
861
+ const completeCheckProgress = (total) => {
862
+ if (!checkProgressActive)
863
+ return;
864
+ checkProgressActive = false;
865
+ opts?.onProgress?.({
866
+ type: "progress",
867
+ phase: "complete",
868
+ mode: "check",
869
+ message: "Checked project index",
870
+ current: total,
871
+ total,
872
+ elapsedMs: performance.now() - totalStart,
873
+ });
874
+ };
875
+ try {
876
+ const declaredScope = opts?.filesAreProjectScope ? opts.files : undefined;
877
+ // A declared project scope is the whole truth for this build, including when it is
878
+ // empty: full discovery would silently widen a scoped query. Scoped builds go through
879
+ // the shared finalization path with a read-only manifest, so they never rewrite
880
+ // project-wide state.
881
+ if (declaredScope && !declaredScope.length) {
882
+ return await buildDeclaredScopeIndex(projectRoot, declaredScope, opts);
883
+ }
884
+ if (cacheMode !== "disk") {
885
+ if (declaredScope) {
886
+ return await buildDeclaredScopeIndex(projectRoot, declaredScope, opts);
887
+ }
888
+ return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
889
+ }
890
+ startCheckProgress();
891
+ const manifestStart = performance.now();
892
+ const manifest = await loadManifest(projectRoot, opts);
893
+ if (timings)
894
+ timings.manifestMs = Math.round(performance.now() - manifestStart);
895
+ const manifestUsed = !!manifest;
896
+ const manifestReport = initManifestReport(report, manifestUsed, false);
897
+ if (manifestReport && !manifestUsed)
898
+ manifestReport.reason = "missing";
899
+ const optionDiffs = diffBuildOptions(manifest?.buildOptions, opts);
900
+ const warningOptionDiffs = optionDiffs.filter((diff) => diff !== "cache");
901
+ if (manifest && warningOptionDiffs.length) {
902
+ logWithLevel(opts?.logLevel, "warn", `Warning: Manifest options differ from current build options: ${warningOptionDiffs.join(", ")}`);
903
+ }
904
+ if (manifestReport && optionDiffs.length) {
905
+ manifestReport.optionsMismatch = optionDiffs;
906
+ }
907
+ const currentConfigHashResult = await computeConfigHash(projectRoot, opts?.logLevel);
908
+ const currentConfigHash = recordConfigHashResult(manifestReport, currentConfigHashResult, opts?.logLevel);
909
+ const configChanged = !!currentConfigHashResult.error || !manifest?.configHash || currentConfigHash !== manifest.configHash;
910
+ const requiresFullRebuild = optionDiffs.some((diff) => diff === "discovery" || diff === "native" || diff === "implementation" || diff === "languageExtensions");
911
+ if (!manifest || !graphOptionsEqual(manifest.graphOptions, graphOptions) || configChanged || requiresFullRebuild) {
912
+ if (manifest && configChanged) {
913
+ logWithLevel(opts?.logLevel, "warn", "Configuration changed, rebuilding index...");
914
+ }
915
+ if (manifestReport && manifest) {
916
+ let reason = "graphOptionsMismatch";
917
+ if (requiresFullRebuild) {
918
+ reason = "buildOptionsMismatch";
919
+ }
920
+ else if (configChanged) {
921
+ reason = "configChanged";
922
+ }
923
+ manifestReport.reason = reason;
924
+ manifestReport.reused = false;
925
+ }
926
+ return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
927
+ }
928
+ const gitAvailable = await isGitRepo(projectRoot);
929
+ const hasExplicitGitRange = !!opts?.gitBase || !!opts?.gitHead;
930
+ // Diff against the working tree, not just the last-indexed commit: a file that was
931
+ // `git add`ed but never committed is neither a tracked manifest entry nor reported
932
+ // by `git ls-files --others` (it stops being "untracked" once staged), so comparing
933
+ // only committed history would miss it whenever HEAD has not moved. Diffing against
934
+ // WORKTREE captures staged and unstaged tracked-file changes together, and still
935
+ // covers ordinary new-commit history when the working tree is clean at the new HEAD.
936
+ const shouldDiffAgainstWorkingTree = !hasExplicitGitRange && gitAvailable && !!manifest.lastCommit;
937
+ const canReuseReconciliation = opts?.reconciledManifestUpdatedAt === manifest.updatedAt;
938
+ let manifestDiffFiles = [];
939
+ if (shouldDiffAgainstWorkingTree) {
940
+ try {
941
+ manifestDiffFiles =
942
+ (canReuseReconciliation ? opts?.reconciledWorkingTreeDiffFiles : undefined) ??
943
+ (await listChangedFiles(projectRoot, {
944
+ base: manifest.lastCommit,
945
+ head: "WORKTREE",
946
+ }));
947
+ }
948
+ catch (error) {
949
+ if (!isMissingGitRevisionError(error))
950
+ throw error;
951
+ if (manifestReport) {
952
+ manifestReport.reason = "staleGitCommit";
953
+ manifestReport.reused = false;
954
+ }
955
+ logWithLevel(opts?.logLevel, "warn", "Warning: Manifest commit is no longer available; rebuilding full index.");
956
+ const rebuiltIndex = await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
957
+ if (manifestReport) {
958
+ manifestReport.reason = "staleGitCommit";
959
+ manifestReport.reused = false;
960
+ }
961
+ return rebuiltIndex;
962
+ }
963
+ }
964
+ if (manifestReport)
965
+ manifestReport.reused = true;
966
+ if (opts?.cacheVerify) {
967
+ const { mismatches, missing } = await verifyManifestEntries(projectRoot, manifest, opts, gitAvailable);
968
+ if (manifestReport) {
969
+ manifestReport.mismatches = mismatches;
970
+ manifestReport.missing = missing;
971
+ }
972
+ if (mismatches > 0 || missing > 0) {
973
+ logWithLevel(opts?.logLevel, "warn", `Warning: Manifest verification failed (mismatches: ${mismatches}, missing: ${missing}). Rebuilding full index.`);
974
+ return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
975
+ }
976
+ }
977
+ const trackedEntries = sanitizeManifestEntriesForRoot(projectRoot, manifest.files);
978
+ const manifestFileKeys = Object.keys(manifest.files);
979
+ const trackedEntryKeys = Object.keys(trackedEntries);
980
+ let manifestRequiresSanitization = manifestFileKeys.length !== trackedEntryKeys.length ||
981
+ manifestFileKeys.some((file) => !Object.hasOwn(trackedEntries, file));
982
+ const explicitFiles = normalizeIndexedFileInputs(projectRoot, opts?.files ?? [], "Incremental file");
983
+ const additionalFiles = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional index file");
984
+ const previousTransientFiles = sanitizeManifestTransientFilesForRoot(projectRoot, manifest.transientFiles).filter((file) => Object.hasOwn(trackedEntries, file));
985
+ const previousTransientFileSet = new Set(previousTransientFiles);
986
+ const needsGitScan = !!opts?.gitBase || !!opts?.changedSince;
987
+ const gitFiles = needsGitScan ? await listChangedFiles(projectRoot, buildIncrementalGitDiffOptions(opts)) : [];
988
+ // New files that were never committed, staged, or passed explicitly have no tracked
989
+ // manifest entry and no working-tree-diff record, so they would otherwise stay
990
+ // invisible to an incremental build until the next full rebuild. Detecting them via
991
+ // `git ls-files --others` is far cheaper than a full recursive directory scan and
992
+ // keeps this path correct without requiring callers to pre-scan the project
993
+ // themselves. A failure here cannot be treated as "no untracked files": that would
994
+ // silently produce an incomplete index, so it falls back to a full rebuild instead,
995
+ // the same way a stale manifest commit does above.
996
+ let untrackedFiles = [];
997
+ // Without that cheap Git signal -- no repository at all, or `--cache-strict` asking for
998
+ // maximum certainty over speed -- the manifest file list cannot prove that no new file
999
+ // appeared, so rediscover the project instead of trusting it. Per-file signature checks
1000
+ // below still keep unchanged files cached, so this costs one directory walk, not a
1001
+ // full reparse. Callers that already resolved the complete scope (`filesAreProjectScope`)
1002
+ // need no rescan.
1003
+ let rediscoveredFiles = [];
1004
+ if (canUseIncrementalDiscoveryFastPath(gitAvailable, opts?.cacheStrict)) {
1005
+ try {
1006
+ untrackedFiles =
1007
+ (canReuseReconciliation ? opts?.reconciledUntrackedFiles : undefined) ??
1008
+ (await listUntrackedProjectFiles(projectRoot, opts?.discovery, gitAvailable));
1009
+ }
1010
+ catch (error) {
1011
+ if (manifestReport) {
1012
+ manifestReport.reason = "gitUntrackedScanFailed";
1013
+ manifestReport.reused = false;
1014
+ }
1015
+ logWithLevel(opts?.logLevel, "warn", "Warning: Failed to list untracked project files via Git; rebuilding full index.", error);
1016
+ return await buildProjectIndexFromExport(projectRoot, opts, { ignoreExistingManifest: true });
1017
+ }
1018
+ }
1019
+ else if (!opts?.filesAreProjectScope) {
1020
+ rediscoveredFiles = await listProjectFiles(projectRoot, projectPatternsForLanguageExtensions(opts), {
1021
+ ...opts?.discovery,
1022
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
1023
+ ...(!opts?.cacheStrict && manifest.symlinkDirectories !== undefined
1024
+ ? { knownSymlinkDirectories: manifest.symlinkDirectories }
1025
+ : {}),
1026
+ });
1027
+ }
1028
+ const candidateFiles = [
1029
+ ...explicitFiles,
1030
+ ...additionalFiles,
1031
+ ...manifestDiffFiles,
1032
+ ...gitFiles,
1033
+ ...untrackedFiles,
1034
+ ...rediscoveredFiles,
1035
+ ];
1036
+ const candidateExistence = await probePathExistence(candidateFiles, buildConcurrency(opts));
1037
+ const existsInCandidateSnapshot = (file) => candidateExistence.get(file) ?? false;
1038
+ const additionalFileSet = new Set(additionalFiles.filter(existsInCandidateSnapshot));
1039
+ const transientFiles = [...additionalFileSet].filter((file) => previousTransientFileSet.has(file) || !Object.hasOwn(trackedEntries, file));
1040
+ const retiredTransientFiles = previousTransientFiles.filter((file) => !additionalFileSet.has(file));
1041
+ const { trackedFiles, deletedTrackedFiles } = await partitionTrackedManifestFiles(trackedEntries);
1042
+ for (const file of retiredTransientFiles) {
1043
+ trackedFiles.delete(file);
1044
+ deletedTrackedFiles.add(file);
1045
+ delete trackedEntries[file];
1046
+ }
1047
+ if (retiredTransientFiles.length)
1048
+ manifestRequiresSanitization = true;
1049
+ const fileReport = initFileReport(report);
1050
+ if (fileReport)
1051
+ fileReport.total = trackedFiles.size;
1052
+ const allFiles = new Set([
1053
+ ...trackedFiles,
1054
+ ...explicitFiles.filter(existsInCandidateSnapshot),
1055
+ ...additionalFiles.filter(existsInCandidateSnapshot),
1056
+ ...manifestDiffFiles.filter(existsInCandidateSnapshot),
1057
+ ...gitFiles.filter(existsInCandidateSnapshot),
1058
+ ...untrackedFiles.filter(existsInCandidateSnapshot),
1059
+ ...rediscoveredFiles.filter(existsInCandidateSnapshot),
1060
+ ]);
1061
+ if (fileReport)
1062
+ fileReport.total = allFiles.size;
1063
+ const dependentFilesOfDeletedTracked = collectDeletedTrackedFileDependents(trackedEntries, deletedTrackedFiles);
1064
+ if (allFiles.size === 0) {
1065
+ completeCheckProgress(0);
1066
+ await writeIndexManifestSnapshot({
1067
+ projectRoot,
1068
+ opts,
1069
+ graphOptions,
1070
+ files: {},
1071
+ timings,
1072
+ manifestReport,
1073
+ allowEmpty: true,
1074
+ transientFiles,
1075
+ ...(manifest.symlinkDirectories !== undefined ? { symlinkDirectories: manifest.symlinkDirectories } : {}),
1076
+ });
1077
+ return {
1078
+ graph: { nodes: new Set(), edges: [] },
1079
+ graphAdjacency: buildGraphAdjacency({ nodes: new Set(), edges: [] }),
1080
+ modules: new Map(),
1081
+ byFile: new Map(),
1082
+ projectRoot: normalizedProjectRoot,
1083
+ ...(opts?.native ? { nativeMode: opts.native } : {}),
1084
+ exportCache: new Map(),
1085
+ scopeCache: new Map(),
1086
+ parsed: new Map(),
1087
+ };
1088
+ }
1089
+ const changedFiles = new Set();
1090
+ const markAsChanged = (file) => {
1091
+ if (allFiles.has(file))
1092
+ changedFiles.add(file);
1093
+ };
1094
+ // Git working-tree diffs are change *candidates*, not proof the indexed bytes are
1095
+ // stale. `lastCommit...WORKTREE` stays dirty across warm runs after we index the
1096
+ // dirty tree, so force-marking these files caused perpetual "Updated N files"
1097
+ // reparses even when signatures already matched the on-disk content. Keep them in
1098
+ // `allFiles` above so signature validation can decide; only skip the early snapshot
1099
+ // fast-path while candidates exist.
1100
+ const gitChangeCandidates = new Set();
1101
+ for (const file of manifestDiffFiles) {
1102
+ if (existsInCandidateSnapshot(file))
1103
+ gitChangeCandidates.add(file);
1104
+ }
1105
+ for (const file of gitFiles) {
1106
+ if (existsInCandidateSnapshot(file))
1107
+ gitChangeCandidates.add(file);
1108
+ }
1109
+ const explicitFileSet = new Set(explicitFiles);
1110
+ const explicitFilesCoverAllFiles = explicitFileSet.size === allFiles.size && [...allFiles].every((file) => explicitFileSet.has(file));
1111
+ const explicitFilesAreChangeInputs = !opts?.filesAreProjectScope;
1112
+ if (explicitFileSet.size && explicitFilesAreChangeInputs && (!explicitFilesCoverAllFiles || report)) {
1113
+ explicitFileSet.forEach(markAsChanged);
1114
+ }
1115
+ dependentFilesOfDeletedTracked.forEach(markAsChanged);
1116
+ if (fileReport)
1117
+ fileReport.changed = changedFiles.size;
1118
+ const reuseUnchangedSnapshot = async () => {
1119
+ if (changedFiles.size || deletedTrackedFiles.size || manifestRequiresSanitization)
1120
+ return null;
1121
+ const manifestEntryMap = new Map(Object.entries(trackedEntries));
1122
+ const snapshotLoad = await tryLoadProjectIndexSnapshot(projectRoot, opts, manifestEntryMap);
1123
+ if (!snapshotLoad)
1124
+ return null;
1125
+ const snapshot = snapshotLoad.index;
1126
+ snapshot.projectFiles ??= await discoverProjectFiles(projectRoot, {
1127
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
1128
+ });
1129
+ if (opts?.cache) {
1130
+ snapshot.cacheMode = opts.cache;
1131
+ snapshot.cacheRootDir = cacheRoot(projectRoot, opts);
1132
+ }
1133
+ if (fileReport)
1134
+ fileReport.cached = allFiles.size;
1135
+ if (timings)
1136
+ timings.graphMs = 0;
1137
+ if (report) {
1138
+ if (snapshotLoad.analysisReport?.backend)
1139
+ report.backend = snapshotLoad.analysisReport.backend;
1140
+ if (snapshotLoad.analysisReport?.graph)
1141
+ report.graph = snapshotLoad.analysisReport.graph;
1142
+ if (!report.backend)
1143
+ initNativeBackendReport(report);
1144
+ snapshot.buildReport = report;
1145
+ }
1146
+ return snapshot;
1147
+ };
1148
+ // A file can only hide from the incremental scan by being genuinely unseen: absent from
1149
+ // both the manifest and any git diff signal. An untracked file that already has a
1150
+ // manifest entry (a build artifact or scratch file indexed once and never committed, for
1151
+ // example) is not automatically "unknown" -- but unlike a tracked file, git has no diff
1152
+ // history for it, so its manifest signature cannot be trusted without independent proof
1153
+ // it is still current. `entry.sig` always starts with `${mtimeMs}:${size}` (see
1154
+ // `fileStatSignature` in build-cache/module-cache.ts), so a single cheap `stat()` per
1155
+ // already-known untracked file proves freshness without reading its content. Unseen files
1156
+ // (no manifest entry) and files whose stat no longer matches both still block the fast
1157
+ // path, exactly as before; only "already indexed and provably unchanged" now qualifies.
1158
+ const hasStaleOrUnseenUntrackedFile = untrackedFiles.length
1159
+ ? (await Promise.all(untrackedFiles.map(async (file) => {
1160
+ const entry = trackedEntries[file];
1161
+ if (!entry?.sig)
1162
+ return true;
1163
+ try {
1164
+ const stat = await fsp.stat(file);
1165
+ // Non-strict signatures are `${mtimeMs}:${size}`; strict ones append
1166
+ // `:${contentHash}`. Match either form so the fast path works when
1167
+ // `cacheStrict: false` (where this gate itself only runs).
1168
+ const prefix = `${stat.mtimeMs}:${stat.size}`;
1169
+ return !(entry.sig === prefix || entry.sig.startsWith(`${prefix}:`));
1170
+ }
1171
+ catch {
1172
+ return true;
1173
+ }
1174
+ }))).some(Boolean)
1175
+ : false;
1176
+ const canSkipFileValidation = gitAvailable &&
1177
+ !opts?.cacheStrict &&
1178
+ !hasStaleOrUnseenUntrackedFile &&
1179
+ !additionalFiles.length &&
1180
+ !gitChangeCandidates.size;
1181
+ if (canSkipFileValidation) {
1182
+ const snapshot = await reuseUnchangedSnapshot();
1183
+ if (snapshot) {
1184
+ if (timings)
1185
+ timings.totalMs = Math.round(performance.now() - totalStart);
1186
+ completeCheckProgress(allFiles.size);
1187
+ return snapshot;
1188
+ }
1189
+ }
1190
+ const workspaceConfig = await loadWorkspaceConfig(projectRoot);
1191
+ const conc = buildConcurrency(opts);
1192
+ const workerSetup = await setupWorkerPool(opts, allFiles.size);
1193
+ try {
1194
+ const useGitSignatures = gitAvailable;
1195
+ const gitSigMap = useGitSignatures
1196
+ ? await getGitBlobHashes(projectRoot, Array.from(allFiles), {
1197
+ gitAvailable,
1198
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
1199
+ })
1200
+ : new Map();
1201
+ const fileSignatures = await prepareFileSignatures({
1202
+ files: Array.from(allFiles),
1203
+ opts,
1204
+ gitSigMap,
1205
+ cacheEnabled,
1206
+ concurrency: conc,
1207
+ });
1208
+ const modules = new Map();
1209
+ const parsedMap = new Map();
1210
+ const jsonDependencies = new Map();
1211
+ const useBloomFilters = opts?.useBloomFilters ?? true;
1212
+ const bloomFilterCache = useBloomFilters
1213
+ ? new (await import("../util/bloomFilter.js")).BloomFilterCache()
1214
+ : undefined;
1215
+ for (const file of allFiles) {
1216
+ const sigInfo = fileSignatures.get(file);
1217
+ if (!sigInfo)
1218
+ continue;
1219
+ const entry = trackedEntries[file];
1220
+ const hasMatchingGitSig = !!entry?.gitSig && !!sigInfo.gitSig && entry.gitSig === sigInfo.gitSig;
1221
+ const hasMatchingSig = entry?.sig === sigInfo.sig;
1222
+ if (!entry || !(hasMatchingGitSig || hasMatchingSig)) {
1223
+ changedFiles.add(file);
1224
+ }
1225
+ }
1226
+ const invalidateCachedDependents = () => {
1227
+ const dependentFilesOfChanged = collectTrackedFileDependents(trackedEntries, changedFiles);
1228
+ for (const file of dependentFilesOfChanged) {
1229
+ const key = fileIdentityKey(file);
1230
+ if (modules.has(key)) {
1231
+ modules.delete(key);
1232
+ if (fileReport) {
1233
+ fileReport.cached = Math.max(0, (fileReport.cached ?? 0) - 1);
1234
+ }
1235
+ }
1236
+ markAsChanged(file);
1237
+ }
1238
+ };
1239
+ invalidateCachedDependents();
1240
+ if (fileReport)
1241
+ fileReport.changed = changedFiles.size;
1242
+ const unchangedSnapshot = await reuseUnchangedSnapshot();
1243
+ if (unchangedSnapshot) {
1244
+ unchangedSnapshot.manifestEntries = new Map(Array.from(fileSignatures, ([file, signature]) => [file, toProjectIndexManifestEntry(signature)]));
1245
+ unchangedSnapshot.manifestSignaturesFresh = true;
1246
+ if (timings)
1247
+ timings.totalMs = Math.round(performance.now() - totalStart);
1248
+ completeCheckProgress(allFiles.size);
1249
+ return unchangedSnapshot;
1250
+ }
1251
+ const persistedBloomFilters = bloomFilterCache ? await tryLoadPersistedBloomFilters(projectRoot, opts) : null;
1252
+ for (const file of allFiles) {
1253
+ if (changedFiles.has(file))
1254
+ continue;
1255
+ const sigInfo = fileSignatures.get(file);
1256
+ const cacheSig = cacheEnabled ? await moduleCacheSignatureForFile(file, sigInfo, opts) : sigInfo.cacheSig;
1257
+ const cached = cacheEnabled ? tryLoadFromCache(projectRoot, file, cacheSig, opts, report) : null;
1258
+ if (cached) {
1259
+ if (fileReport)
1260
+ fileReport.cached = (fileReport.cached ?? 0) + 1;
1261
+ modules.set(fileIdentityKey(file), cached);
1262
+ collectJsonDependencies(cached.imports, jsonDependencies);
1263
+ if (bloomFilterCache) {
1264
+ const persistedFilter = persistedBloomFilters?.get(file);
1265
+ if (persistedFilter) {
1266
+ bloomFilterCache.set(file, persistedFilter);
1267
+ }
1268
+ else {
1269
+ const filter = await buildBloomFilterForFile(file, opts);
1270
+ if (filter)
1271
+ bloomFilterCache.set(file, filter);
1272
+ }
1273
+ }
1274
+ }
1275
+ else {
1276
+ changedFiles.add(file);
1277
+ }
1278
+ }
1279
+ invalidateCachedDependents();
1280
+ const changedList = Array.from(changedFiles);
1281
+ let updateStartedAt;
1282
+ if (changedList.length || deletedTrackedFiles.size) {
1283
+ updateStartedAt = performance.now();
1284
+ emitIndexLifecycleProgress(opts, "start", "update", changedList.length);
1285
+ }
1286
+ if (fileReport)
1287
+ fileReport.changed = changedList.length;
1288
+ if (changedList.length) {
1289
+ const parseStart = performance.now();
1290
+ let processedFiles = 0;
1291
+ const totalFiles = changedList.length;
1292
+ const fileResults = await mapLimit(changedList, conc, async (file) => {
1293
+ try {
1294
+ if (fileReport)
1295
+ fileReport.parsed = (fileReport.parsed ?? 0) + 1;
1296
+ const support = supportForFile(file, opts?.languageExtensions);
1297
+ if (!support)
1298
+ return [file, createEmptyModuleIndex(file)];
1299
+ const built = await buildIndexedModuleForFile({
1300
+ file,
1301
+ support,
1302
+ projectRoot,
1303
+ opts,
1304
+ report,
1305
+ graphOptions,
1306
+ workspaceConfig,
1307
+ workerSetup,
1308
+ parsedMap,
1309
+ parsedCacheMaxEntries: parsedCacheMaxEntries(opts),
1310
+ jsonDependencies,
1311
+ bloomFilterCache,
1312
+ onFallbackImportExtraction,
1313
+ fileSignatures,
1314
+ cacheEnabled,
1315
+ });
1316
+ return [file, built.module];
1317
+ }
1318
+ catch (error) {
1319
+ if (isNativeRequiredUnavailableError(error) || isNodeSqliteUnavailableError(error))
1320
+ throw error;
1321
+ if (isUnsupportedParserInputError(error) || isNonNativeParserUnavailableError(error)) {
1322
+ return [file, createEmptyModuleIndex(file)];
1323
+ }
1324
+ recordFileFailure(report, file, error);
1325
+ logWithLevel(opts?.logLevel, "warn", `Warning: Failed to process file ${file}:`, error);
1326
+ return [file, createEmptyModuleIndex(file)];
1327
+ }
1328
+ finally {
1329
+ if (opts?.onProgress) {
1330
+ opts.onProgress({
1331
+ type: "progress",
1332
+ phase: "update",
1333
+ mode: "update",
1334
+ message: `Indexed ${file}`,
1335
+ current: ++processedFiles,
1336
+ total: totalFiles,
1337
+ });
1338
+ }
1339
+ }
1340
+ });
1341
+ for (const [file, mod] of fileResults) {
1342
+ modules.set(fileIdentityKey(file), mod);
1343
+ }
1344
+ if (timings)
1345
+ timings.parseMs = Math.round(performance.now() - parseStart);
1346
+ }
1347
+ for (const jsonPath of jsonDependencies.values()) {
1348
+ ensureJsonModule(modules, jsonPath);
1349
+ }
1350
+ expandStarImports(modules, opts);
1351
+ const retainedTrackedEntries = Object.entries(trackedEntries).filter(([file]) => !deletedTrackedFiles.has(file));
1352
+ const cachedGraphEntries = new Map(retainedTrackedEntries);
1353
+ const manifestEntries = new Map(cachedGraphEntries);
1354
+ const baseGraph = cachedGraphEntries.size > 0 ? { nodes: new Set(), edges: [] } : undefined;
1355
+ if (baseGraph) {
1356
+ const baseGraphEdgeTargets = [];
1357
+ for (const entry of cachedGraphEntries.values()) {
1358
+ for (const edge of entry.edges) {
1359
+ if (edge.to.type === "file")
1360
+ baseGraphEdgeTargets.push(edge.to.path);
1361
+ }
1362
+ }
1363
+ const baseGraphEdgeExistence = await probePathExistence(baseGraphEdgeTargets, conc);
1364
+ for (const [file, entry] of cachedGraphEntries) {
1365
+ baseGraph.nodes.add(file);
1366
+ for (const edge of entry.edges) {
1367
+ baseGraph.edges.push(edge);
1368
+ if (edge.to.type === "file" && baseGraphEdgeExistence.get(edge.to.path)) {
1369
+ baseGraph.nodes.add(edge.to.path);
1370
+ }
1371
+ }
1372
+ }
1373
+ }
1374
+ const filesList = Array.from(changedFiles);
1375
+ const graphStart = performance.now();
1376
+ const graph = !filesList.length && baseGraph
1377
+ ? { nodes: new Set(baseGraph.nodes), edges: [...baseGraph.edges] }
1378
+ : await collectGraph(projectRoot, filesList, {
1379
+ parsed: parsedMap,
1380
+ fast: !!graphOptions.fast,
1381
+ ...(graphOptions.fastRegexDisabledLanguages
1382
+ ? { fastRegexDisabledLanguages: graphOptions.fastRegexDisabledLanguages }
1383
+ : {}),
1384
+ resolveNodeModules: !!graphOptions.resolveNodeModules,
1385
+ dynamicImportHeuristics: !!graphOptions.dynamicImportHeuristics,
1386
+ ...(opts?.native ? { native: opts.native } : {}),
1387
+ ...(opts?.languageExtensions ? { languageExtensions: opts.languageExtensions } : {}),
1388
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
1389
+ ...(graphOptions.resolutionHints ? { resolutionHints: graphOptions.resolutionHints } : {}),
1390
+ allFiles: Array.from(allFiles),
1391
+ fileSignatures,
1392
+ cachedFileEdges: cachedGraphEntries,
1393
+ ...(onFallbackImportExtraction ? { onFallbackImportExtraction } : {}),
1394
+ ...(baseGraph ? { baseGraph } : {}),
1395
+ replaceFiles: new Set(changedFiles),
1396
+ onFileEdges: (file, entry) => {
1397
+ const manifestEntry = toManifestFileEntry(entry);
1398
+ if (!manifestEntry)
1399
+ return;
1400
+ manifestEntries.set(file, manifestEntry);
1401
+ },
1402
+ });
1403
+ if (timings)
1404
+ timings.graphMs = Math.round(performance.now() - graphStart);
1405
+ await writeIndexManifestSnapshot({
1406
+ projectRoot,
1407
+ opts,
1408
+ graphOptions,
1409
+ files: manifestEntries,
1410
+ timings,
1411
+ manifestReport,
1412
+ transientFiles,
1413
+ ...(manifest.symlinkDirectories !== undefined ? { symlinkDirectories: manifest.symlinkDirectories } : {}),
1414
+ });
1415
+ const index = await finalizeProjectIndex({
1416
+ projectRoot,
1417
+ normalizedProjectRoot,
1418
+ opts,
1419
+ timings,
1420
+ totalStart,
1421
+ graph,
1422
+ modules,
1423
+ parsedMap,
1424
+ bloomFilterCache,
1425
+ manifestEntries: projectIndexManifestEntries(manifestEntries),
1426
+ buildReport: report,
1427
+ });
1428
+ await writeProjectIndexSnapshot(projectRoot, opts, index, projectSnapshotFilesSignature(manifestEntries));
1429
+ if (updateStartedAt !== undefined) {
1430
+ emitIndexLifecycleProgress(opts, "complete", "update", index.byFile.size, performance.now() - updateStartedAt);
1431
+ }
1432
+ else {
1433
+ completeCheckProgress(allFiles.size);
1434
+ }
1435
+ return index;
1436
+ }
1437
+ finally {
1438
+ await teardownWorkerPool(workerSetup, report);
1439
+ }
1440
+ }
1441
+ finally {
1442
+ if (cacheMode === "disk") {
1443
+ closeDiskCacheDatabase(projectRoot, opts);
1444
+ closeDuplicateUnitCacheDatabase(projectRoot, opts);
1445
+ }
1446
+ }
1447
+ }
1448
+ export async function buildGraphDelta(projectRoot, opts) {
1449
+ const manifest = await loadManifest(projectRoot, opts);
1450
+ const trackedEntries = sanitizeManifestEntriesForRoot(projectRoot, manifest?.files);
1451
+ const graphOptions = normalizeGraphOptions(opts?.graph);
1452
+ const previousLanguageExtensions = normalizeLanguageExtensions(manifest?.buildOptions?.languageExtensions);
1453
+ const currentLanguageExtensions = normalizeLanguageExtensions(opts?.languageExtensions);
1454
+ const languageExtensionsChanged = manifest
1455
+ ? diffBuildOptions(manifest.buildOptions, opts).includes("languageExtensions")
1456
+ : false;
1457
+ const languageSupportChangedForFile = (file) => supportForFile(file, previousLanguageExtensions)?.id !== supportForFile(file, currentLanguageExtensions)?.id;
1458
+ const strictIncremental = opts?.incrementalStrict ?? false;
1459
+ if (strictIncremental && graphOptions.fast)
1460
+ graphOptions.fast = false;
1461
+ const explicitFiles = normalizeIndexedFileInputs(projectRoot, opts?.files ?? [], "Graph delta file");
1462
+ const additionalFiles = normalizeIndexedFileInputs(projectRoot, opts?.additionalFiles ?? [], "Additional graph delta file");
1463
+ const needsGitScan = !!opts?.gitBase || !!opts?.changedSince;
1464
+ const gitFiles = needsGitScan ? await listChangedFiles(projectRoot, buildIncrementalGitDiffOptions(opts)) : [];
1465
+ const { trackedFiles } = await partitionTrackedManifestFiles(trackedEntries);
1466
+ const gitAvailable = await isGitRepo(projectRoot);
1467
+ const currentHead = gitAvailable ? await getGitHead(projectRoot) : null;
1468
+ const hasExplicitGitRange = !!opts?.gitBase || !!opts?.gitHead;
1469
+ const manifestCommitMismatch = !hasExplicitGitRange && !!manifest?.lastCommit && !!currentHead && manifest.lastCommit !== currentHead;
1470
+ let manifestDiffFiles = [];
1471
+ if (manifestCommitMismatch) {
1472
+ try {
1473
+ manifestDiffFiles = await listChangedFiles(projectRoot, {
1474
+ base: manifest?.lastCommit,
1475
+ head: currentHead,
1476
+ });
1477
+ }
1478
+ catch (error) {
1479
+ if (!isMissingGitRevisionError(error))
1480
+ throw error;
1481
+ manifestDiffFiles = Object.keys(trackedEntries);
1482
+ logWithLevel(opts?.logLevel, "warn", "Warning: Manifest commit is no longer available; using tracked manifest files for graph delta.");
1483
+ }
1484
+ }
1485
+ const candidateExistence = await probePathExistence([...explicitFiles, ...additionalFiles, ...manifestDiffFiles, ...gitFiles], buildConcurrency(opts));
1486
+ const existsInCandidateSnapshot = (file) => candidateExistence.get(file) ?? false;
1487
+ const existingExplicitFiles = explicitFiles.filter(existsInCandidateSnapshot);
1488
+ const existingAdditionalFiles = additionalFiles.filter(existsInCandidateSnapshot);
1489
+ const allFiles = new Set([
1490
+ ...trackedFiles,
1491
+ ...existingExplicitFiles,
1492
+ ...existingAdditionalFiles,
1493
+ ...manifestDiffFiles.filter(existsInCandidateSnapshot),
1494
+ ...gitFiles.filter(existsInCandidateSnapshot),
1495
+ ]);
1496
+ const changedFiles = new Set();
1497
+ const changedFileKeys = new Set();
1498
+ const addChangedFile = (file) => {
1499
+ const key = fileIdentityKey(file);
1500
+ if (changedFileKeys.has(key))
1501
+ return;
1502
+ changedFileKeys.add(key);
1503
+ changedFiles.add(file);
1504
+ };
1505
+ existingExplicitFiles.forEach(addChangedFile);
1506
+ manifestDiffFiles.forEach(addChangedFile);
1507
+ gitFiles.forEach(addChangedFile);
1508
+ if (languageExtensionsChanged) {
1509
+ for (const file of trackedFiles) {
1510
+ if (languageSupportChangedForFile(file))
1511
+ addChangedFile(file);
1512
+ }
1513
+ }
1514
+ if (!languageExtensionsChanged && allFiles.size === 0 && changedFiles.size === 0) {
1515
+ return { changedFiles: [], added: [], removed: [] };
1516
+ }
1517
+ if (manifest && graphOptionsEqual(manifest.graphOptions, graphOptions)) {
1518
+ const gitSigMap = gitAvailable
1519
+ ? await getGitBlobHashes(projectRoot, Array.from(allFiles), {
1520
+ gitAvailable,
1521
+ ...(opts?.logLevel ? { logLevel: opts.logLevel } : {}),
1522
+ })
1523
+ : new Map();
1524
+ for (const file of allFiles) {
1525
+ const sigInfo = await fileSignature(file, opts?.cacheStrict, gitSigMap.get(file));
1526
+ const entry = trackedEntries[file];
1527
+ const hasMatchingGitSig = !!entry?.gitSig && !!sigInfo.gitSig && entry.gitSig === sigInfo.gitSig;
1528
+ const hasMatchingSig = entry?.sig === sigInfo.sig;
1529
+ if (!entry || !(hasMatchingGitSig || hasMatchingSig)) {
1530
+ addChangedFile(file);
1531
+ }
1532
+ }
1533
+ }
1534
+ const beforeEdges = new Map();
1535
+ if (manifest) {
1536
+ for (const file of changedFiles) {
1537
+ const entry = trackedEntries[file];
1538
+ if (!entry?.edges)
1539
+ continue;
1540
+ for (const edge of entry.edges) {
1541
+ beforeEdges.set(edgeKey(edge), edge);
1542
+ }
1543
+ }
1544
+ }
1545
+ const index = await buildProjectIndexIncremental(projectRoot, opts);
1546
+ if (languageExtensionsChanged) {
1547
+ for (const file of index.modules.keys()) {
1548
+ if (!languageSupportChangedForFile(file))
1549
+ continue;
1550
+ const displayFile = index.byFile.get(fileIdentityKey(file))?.file ?? file;
1551
+ addChangedFile(displayFile);
1552
+ }
1553
+ }
1554
+ const changedList = Array.from(changedFiles);
1555
+ const afterEdges = new Map();
1556
+ for (const edge of index.graph.edges) {
1557
+ if (changedFileKeys.has(fileIdentityKey(edge.from)))
1558
+ afterEdges.set(edgeKey(edge), edge);
1559
+ }
1560
+ const added = [];
1561
+ const removed = [];
1562
+ for (const [key, edge] of afterEdges) {
1563
+ if (!beforeEdges.has(key))
1564
+ added.push(edge);
1565
+ }
1566
+ for (const [key, edge] of beforeEdges) {
1567
+ if (!afterEdges.has(key))
1568
+ removed.push(edge);
1569
+ }
1570
+ const changedFilesRelative = changedList.map((file) => normalizePath(path.relative(projectRoot, file)));
1571
+ const addedRelative = added.map((edge) => toRelativeEdge(projectRoot, edge));
1572
+ const removedRelative = removed.map((edge) => toRelativeEdge(projectRoot, edge));
1573
+ return {
1574
+ changedFiles: changedFilesRelative.sort(),
1575
+ added: addedRelative.sort(compareEdges),
1576
+ removed: removedRelative.sort(compareEdges),
1577
+ };
1578
+ }
1579
+ //# sourceMappingURL=build-index.js.map