@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.2

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 (761) hide show
  1. package/bin/codegraph +5 -0
  2. package/lib/dist/.test-build-engine.json +1 -0
  3. package/lib/dist/.test-build-viewer.json +1 -0
  4. package/lib/dist/bin/codegraph.d.ts +1 -0
  5. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  6. package/lib/dist/bin/codegraph.js +605 -291
  7. package/lib/dist/bin/codegraph.js.map +1 -1
  8. package/lib/dist/bin/command-supervision.d.ts +7 -0
  9. package/lib/dist/bin/command-supervision.d.ts.map +1 -1
  10. package/lib/dist/bin/command-supervision.js +39 -27
  11. package/lib/dist/bin/command-supervision.js.map +1 -1
  12. package/lib/dist/bin/viewer-gate.d.ts +17 -0
  13. package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
  14. package/lib/dist/bin/viewer-gate.js +31 -0
  15. package/lib/dist/bin/viewer-gate.js.map +1 -0
  16. package/lib/dist/context/index.d.ts.map +1 -1
  17. package/lib/dist/context/index.js +43 -2
  18. package/lib/dist/context/index.js.map +1 -1
  19. package/lib/dist/db/index.d.ts +21 -2
  20. package/lib/dist/db/index.d.ts.map +1 -1
  21. package/lib/dist/db/index.js +86 -31
  22. package/lib/dist/db/index.js.map +1 -1
  23. package/lib/dist/db/migrations.d.ts +1 -1
  24. package/lib/dist/db/migrations.d.ts.map +1 -1
  25. package/lib/dist/db/migrations.js +40 -1
  26. package/lib/dist/db/migrations.js.map +1 -1
  27. package/lib/dist/db/queries.d.ts +454 -10
  28. package/lib/dist/db/queries.d.ts.map +1 -1
  29. package/lib/dist/db/queries.js +1080 -41
  30. package/lib/dist/db/queries.js.map +1 -1
  31. package/lib/dist/db/schema.sql +11 -1
  32. package/lib/dist/db/sqlite-adapter.d.ts +2 -0
  33. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  34. package/lib/dist/db/sqlite-adapter.js +56 -7
  35. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  36. package/lib/dist/db/synthesis-stage.d.ts +12 -0
  37. package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
  38. package/lib/dist/db/synthesis-stage.js +89 -0
  39. package/lib/dist/db/synthesis-stage.js.map +1 -0
  40. package/lib/dist/db/wal-valve.d.ts +32 -12
  41. package/lib/dist/db/wal-valve.d.ts.map +1 -1
  42. package/lib/dist/db/wal-valve.js +65 -22
  43. package/lib/dist/db/wal-valve.js.map +1 -1
  44. package/lib/dist/db/wsl-shared-index.d.ts +53 -0
  45. package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
  46. package/lib/dist/db/wsl-shared-index.js +121 -0
  47. package/lib/dist/db/wsl-shared-index.js.map +1 -0
  48. package/lib/dist/directory.d.ts +131 -2
  49. package/lib/dist/directory.d.ts.map +1 -1
  50. package/lib/dist/directory.js +299 -23
  51. package/lib/dist/directory.js.map +1 -1
  52. package/lib/dist/errors.d.ts +14 -0
  53. package/lib/dist/errors.d.ts.map +1 -1
  54. package/lib/dist/errors.js +16 -1
  55. package/lib/dist/errors.js.map +1 -1
  56. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
  57. package/lib/dist/extraction/astro-extractor.js +7 -35
  58. package/lib/dist/extraction/astro-extractor.js.map +1 -1
  59. package/lib/dist/extraction/cfml-extractor.d.ts +77 -10
  60. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  61. package/lib/dist/extraction/cfml-extractor.js +302 -71
  62. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  63. package/lib/dist/extraction/commonjs-requires.d.ts +23 -0
  64. package/lib/dist/extraction/commonjs-requires.d.ts.map +1 -0
  65. package/lib/dist/extraction/commonjs-requires.js +68 -0
  66. package/lib/dist/extraction/commonjs-requires.js.map +1 -0
  67. package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
  68. package/lib/dist/extraction/dfm-extractor.js +14 -10
  69. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  70. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  71. package/lib/dist/extraction/extraction-version.js +1 -1
  72. package/lib/dist/extraction/function-ref.d.ts +6 -4
  73. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  74. package/lib/dist/extraction/function-ref.js +35 -14
  75. package/lib/dist/extraction/function-ref.js.map +1 -1
  76. package/lib/dist/extraction/generated-detection.d.ts +9 -0
  77. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  78. package/lib/dist/extraction/generated-detection.js +42 -2
  79. package/lib/dist/extraction/generated-detection.js.map +1 -1
  80. package/lib/dist/extraction/grammars.d.ts +40 -0
  81. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  82. package/lib/dist/extraction/grammars.js +171 -1
  83. package/lib/dist/extraction/grammars.js.map +1 -1
  84. package/lib/dist/extraction/index.d.ts +132 -19
  85. package/lib/dist/extraction/index.d.ts.map +1 -1
  86. package/lib/dist/extraction/index.js +825 -195
  87. package/lib/dist/extraction/index.js.map +1 -1
  88. package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
  89. package/lib/dist/extraction/kernel/index.js +6 -0
  90. package/lib/dist/extraction/kernel/index.js.map +1 -1
  91. package/lib/dist/extraction/languages/c-cpp.d.ts +73 -0
  92. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  93. package/lib/dist/extraction/languages/c-cpp.js +412 -16
  94. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  95. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  96. package/lib/dist/extraction/languages/csharp.js +14 -5
  97. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  98. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  99. package/lib/dist/extraction/languages/dart.js +16 -3
  100. package/lib/dist/extraction/languages/dart.js.map +1 -1
  101. package/lib/dist/extraction/languages/javascript.js +1 -1
  102. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  103. package/lib/dist/extraction/languages/kotlin.d.ts +4 -0
  104. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  105. package/lib/dist/extraction/languages/kotlin.js +237 -36
  106. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  107. package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
  108. package/lib/dist/extraction/languages/lua.js +4 -1
  109. package/lib/dist/extraction/languages/lua.js.map +1 -1
  110. package/lib/dist/extraction/languages/python.d.ts.map +1 -1
  111. package/lib/dist/extraction/languages/python.js +71 -0
  112. package/lib/dist/extraction/languages/python.js.map +1 -1
  113. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  114. package/lib/dist/extraction/languages/rust.js +3 -0
  115. package/lib/dist/extraction/languages/rust.js.map +1 -1
  116. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  117. package/lib/dist/extraction/languages/scala.js +18 -3
  118. package/lib/dist/extraction/languages/scala.js.map +1 -1
  119. package/lib/dist/extraction/languages/swift.d.ts +15 -0
  120. package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
  121. package/lib/dist/extraction/languages/swift.js +50 -0
  122. package/lib/dist/extraction/languages/swift.js.map +1 -1
  123. package/lib/dist/extraction/languages/typescript.d.ts +7 -0
  124. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  125. package/lib/dist/extraction/languages/typescript.js +30 -2
  126. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  127. package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
  128. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  129. package/lib/dist/extraction/liquid-extractor.js +98 -22
  130. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  131. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  132. package/lib/dist/extraction/mybatis-extractor.js +6 -4
  133. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  134. package/lib/dist/extraction/parse-budget.d.ts +16 -0
  135. package/lib/dist/extraction/parse-budget.d.ts.map +1 -0
  136. package/lib/dist/extraction/parse-budget.js +24 -0
  137. package/lib/dist/extraction/parse-budget.js.map +1 -0
  138. package/lib/dist/extraction/parse-pool.d.ts +12 -0
  139. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  140. package/lib/dist/extraction/parse-pool.js +51 -3
  141. package/lib/dist/extraction/parse-pool.js.map +1 -1
  142. package/lib/dist/extraction/parse-worker.js +3 -1
  143. package/lib/dist/extraction/parse-worker.js.map +1 -1
  144. package/lib/dist/extraction/sfc-script.d.ts +43 -0
  145. package/lib/dist/extraction/sfc-script.d.ts.map +1 -0
  146. package/lib/dist/extraction/sfc-script.js +135 -0
  147. package/lib/dist/extraction/sfc-script.js.map +1 -0
  148. package/lib/dist/extraction/store-worker.js +5 -0
  149. package/lib/dist/extraction/store-worker.js.map +1 -1
  150. package/lib/dist/extraction/store-writer.d.ts +10 -2
  151. package/lib/dist/extraction/store-writer.d.ts.map +1 -1
  152. package/lib/dist/extraction/store-writer.js +12 -4
  153. package/lib/dist/extraction/store-writer.js.map +1 -1
  154. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  155. package/lib/dist/extraction/svelte-extractor.js +7 -37
  156. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  157. package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
  158. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
  159. package/lib/dist/extraction/syntax-tokens.js +382 -0
  160. package/lib/dist/extraction/syntax-tokens.js.map +1 -0
  161. package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  162. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  163. package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
  164. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  165. package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
  166. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  167. package/lib/dist/extraction/tree-sitter.d.ts +104 -17
  168. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  169. package/lib/dist/extraction/tree-sitter.js +943 -88
  170. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  171. package/lib/dist/extraction/vue-extractor.d.ts +7 -0
  172. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  173. package/lib/dist/extraction/vue-extractor.js +73 -35
  174. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  175. package/lib/dist/extraction/vue-options-api.d.ts +28 -0
  176. package/lib/dist/extraction/vue-options-api.d.ts.map +1 -0
  177. package/lib/dist/extraction/vue-options-api.js +196 -0
  178. package/lib/dist/extraction/vue-options-api.js.map +1 -0
  179. package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  180. package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  181. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  182. package/lib/dist/file-limits.d.ts +40 -0
  183. package/lib/dist/file-limits.d.ts.map +1 -0
  184. package/lib/dist/file-limits.js +147 -0
  185. package/lib/dist/file-limits.js.map +1 -0
  186. package/lib/dist/graph/branch-guards.d.ts +265 -0
  187. package/lib/dist/graph/branch-guards.d.ts.map +1 -0
  188. package/lib/dist/graph/branch-guards.js +2326 -0
  189. package/lib/dist/graph/branch-guards.js.map +1 -0
  190. package/lib/dist/graph/dead-code.d.ts +251 -0
  191. package/lib/dist/graph/dead-code.d.ts.map +1 -0
  192. package/lib/dist/graph/dead-code.js +776 -0
  193. package/lib/dist/graph/dead-code.js.map +1 -0
  194. package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
  195. package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  196. package/lib/dist/graph/dynamic-boundary-report.js +283 -0
  197. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
  198. package/lib/dist/graph/index.d.ts +4 -0
  199. package/lib/dist/graph/index.d.ts.map +1 -1
  200. package/lib/dist/graph/index.js +16 -1
  201. package/lib/dist/graph/index.js.map +1 -1
  202. package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
  203. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
  204. package/lib/dist/graph/named-symbol-flow.js +559 -0
  205. package/lib/dist/graph/named-symbol-flow.js.map +1 -0
  206. package/lib/dist/graph/symbol-lookup.d.ts +83 -0
  207. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
  208. package/lib/dist/graph/symbol-lookup.js +181 -0
  209. package/lib/dist/graph/symbol-lookup.js.map +1 -0
  210. package/lib/dist/graph/traversal.d.ts +9 -0
  211. package/lib/dist/graph/traversal.d.ts.map +1 -1
  212. package/lib/dist/graph/traversal.js +61 -35
  213. package/lib/dist/graph/traversal.js.map +1 -1
  214. package/lib/dist/graph/type-hierarchy.d.ts +155 -0
  215. package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
  216. package/lib/dist/graph/type-hierarchy.js +382 -0
  217. package/lib/dist/graph/type-hierarchy.js.map +1 -0
  218. package/lib/dist/index.d.ts +256 -11
  219. package/lib/dist/index.d.ts.map +1 -1
  220. package/lib/dist/index.js +402 -34
  221. package/lib/dist/index.js.map +1 -1
  222. package/lib/dist/installer/index.d.ts.map +1 -1
  223. package/lib/dist/installer/index.js +3 -2
  224. package/lib/dist/installer/index.js.map +1 -1
  225. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
  226. package/lib/dist/installer/targets/antigravity.js +14 -2
  227. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  228. package/lib/dist/installer/targets/claude.d.ts +3 -0
  229. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  230. package/lib/dist/installer/targets/claude.js +35 -7
  231. package/lib/dist/installer/targets/claude.js.map +1 -1
  232. package/lib/dist/installer/targets/codex.d.ts +2 -1
  233. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  234. package/lib/dist/installer/targets/codex.js +14 -4
  235. package/lib/dist/installer/targets/codex.js.map +1 -1
  236. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  237. package/lib/dist/installer/targets/copilot-cli.js +7 -1
  238. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  239. package/lib/dist/installer/targets/opencode.d.ts +16 -5
  240. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  241. package/lib/dist/installer/targets/opencode.js +73 -22
  242. package/lib/dist/installer/targets/opencode.js.map +1 -1
  243. package/lib/dist/installer/targets/shared.d.ts +14 -3
  244. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  245. package/lib/dist/installer/targets/shared.js +39 -11
  246. package/lib/dist/installer/targets/shared.js.map +1 -1
  247. package/lib/dist/installer/targets/types.d.ts +7 -0
  248. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  249. package/lib/dist/mcp/answer-freshness.d.ts +10 -0
  250. package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
  251. package/lib/dist/mcp/answer-freshness.js +68 -0
  252. package/lib/dist/mcp/answer-freshness.js.map +1 -0
  253. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  254. package/lib/dist/mcp/daemon-manager.js +16 -0
  255. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  256. package/lib/dist/mcp/daemon-paths.d.ts +2 -0
  257. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  258. package/lib/dist/mcp/daemon-paths.js +20 -5
  259. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  260. package/lib/dist/mcp/daemon-registry.d.ts +11 -4
  261. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  262. package/lib/dist/mcp/daemon-registry.js +132 -36
  263. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  264. package/lib/dist/mcp/daemon.d.ts +17 -7
  265. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  266. package/lib/dist/mcp/daemon.js +116 -24
  267. package/lib/dist/mcp/daemon.js.map +1 -1
  268. package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
  269. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  270. package/lib/dist/mcp/dynamic-boundaries.js +46 -42
  271. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  272. package/lib/dist/mcp/engine.d.ts +30 -9
  273. package/lib/dist/mcp/engine.d.ts.map +1 -1
  274. package/lib/dist/mcp/engine.js +158 -66
  275. package/lib/dist/mcp/engine.js.map +1 -1
  276. package/lib/dist/mcp/explore-dedup.d.ts +5 -2
  277. package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
  278. package/lib/dist/mcp/explore-dedup.js +8 -5
  279. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  280. package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
  281. package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  282. package/lib/dist/mcp/index-freshness-worker.js +36 -0
  283. package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
  284. package/lib/dist/mcp/index-freshness.d.ts +13 -0
  285. package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
  286. package/lib/dist/mcp/index-freshness.js +117 -0
  287. package/lib/dist/mcp/index-freshness.js.map +1 -0
  288. package/lib/dist/mcp/index.d.ts +3 -1
  289. package/lib/dist/mcp/index.d.ts.map +1 -1
  290. package/lib/dist/mcp/index.js +95 -11
  291. package/lib/dist/mcp/index.js.map +1 -1
  292. package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
  293. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  294. package/lib/dist/mcp/liveness-watchdog.js +11 -2
  295. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  296. package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
  297. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
  298. package/lib/dist/mcp/project-lifecycle.js +182 -0
  299. package/lib/dist/mcp/project-lifecycle.js.map +1 -0
  300. package/lib/dist/mcp/proxy.d.ts +9 -2
  301. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  302. package/lib/dist/mcp/proxy.js +201 -32
  303. package/lib/dist/mcp/proxy.js.map +1 -1
  304. package/lib/dist/mcp/query-pool.d.ts +18 -3
  305. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  306. package/lib/dist/mcp/query-pool.js +67 -11
  307. package/lib/dist/mcp/query-pool.js.map +1 -1
  308. package/lib/dist/mcp/query-worker.js +2 -2
  309. package/lib/dist/mcp/query-worker.js.map +1 -1
  310. package/lib/dist/mcp/server-instructions.d.ts +1 -1
  311. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  312. package/lib/dist/mcp/server-instructions.js +6 -3
  313. package/lib/dist/mcp/server-instructions.js.map +1 -1
  314. package/lib/dist/mcp/startup-handshake.d.ts +3 -1
  315. package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
  316. package/lib/dist/mcp/startup-handshake.js +10 -2
  317. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  318. package/lib/dist/mcp/tools.d.ts +306 -36
  319. package/lib/dist/mcp/tools.d.ts.map +1 -1
  320. package/lib/dist/mcp/tools.js +2395 -966
  321. package/lib/dist/mcp/tools.js.map +1 -1
  322. package/lib/dist/mcp/writer-lock.d.ts +61 -0
  323. package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
  324. package/lib/dist/mcp/writer-lock.js +260 -0
  325. package/lib/dist/mcp/writer-lock.js.map +1 -0
  326. package/lib/dist/resolution/alias-binding.d.ts +56 -0
  327. package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
  328. package/lib/dist/resolution/alias-binding.js +143 -0
  329. package/lib/dist/resolution/alias-binding.js.map +1 -0
  330. package/lib/dist/resolution/angular-template-synthesizer.d.ts +49 -0
  331. package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -0
  332. package/lib/dist/resolution/angular-template-synthesizer.js +359 -0
  333. package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -0
  334. package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
  335. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  336. package/lib/dist/resolution/callback-synthesizer.js +460 -144
  337. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  338. package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
  339. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
  340. package/lib/dist/resolution/cpp-constructor.js +123 -0
  341. package/lib/dist/resolution/cpp-constructor.js.map +1 -0
  342. package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  343. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  344. package/lib/dist/resolution/cpp-macro-visibility.js +392 -0
  345. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
  346. package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  347. package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  348. package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
  349. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
  350. package/lib/dist/resolution/frameworks/angular-router.d.ts +142 -0
  351. package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -0
  352. package/lib/dist/resolution/frameworks/angular-router.js +1126 -0
  353. package/lib/dist/resolution/frameworks/angular-router.js.map +1 -0
  354. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
  355. package/lib/dist/resolution/frameworks/astro.js +32 -6
  356. package/lib/dist/resolution/frameworks/astro.js.map +1 -1
  357. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  358. package/lib/dist/resolution/frameworks/csharp.js +186 -24
  359. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  360. package/lib/dist/resolution/frameworks/expo-modules.d.ts +10 -0
  361. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  362. package/lib/dist/resolution/frameworks/expo-modules.js +95 -1
  363. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  364. package/lib/dist/resolution/frameworks/expo-router.d.ts +195 -0
  365. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  366. package/lib/dist/resolution/frameworks/expo-router.js +847 -0
  367. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
  368. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  369. package/lib/dist/resolution/frameworks/express.js +339 -45
  370. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  371. package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -1
  372. package/lib/dist/resolution/frameworks/fabric.js +13 -11
  373. package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
  374. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
  375. package/lib/dist/resolution/frameworks/go.js +11 -28
  376. package/lib/dist/resolution/frameworks/go.js.map +1 -1
  377. package/lib/dist/resolution/frameworks/index.d.ts +8 -2
  378. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  379. package/lib/dist/resolution/frameworks/index.js +39 -1
  380. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  381. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  382. package/lib/dist/resolution/frameworks/java.js +88 -68
  383. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  384. package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  385. package/lib/dist/resolution/frameworks/laravel.js +369 -26
  386. package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
  387. package/lib/dist/resolution/frameworks/name-heuristic.d.ts +35 -0
  388. package/lib/dist/resolution/frameworks/name-heuristic.d.ts.map +1 -0
  389. package/lib/dist/resolution/frameworks/name-heuristic.js +45 -0
  390. package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -0
  391. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  392. package/lib/dist/resolution/frameworks/nestjs.js +288 -55
  393. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  394. package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
  395. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  396. package/lib/dist/resolution/frameworks/nextjs.js +329 -0
  397. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
  398. package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
  399. package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  400. package/lib/dist/resolution/frameworks/object-literal.js +139 -0
  401. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
  402. package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
  403. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  404. package/lib/dist/resolution/frameworks/package-deps.js +78 -0
  405. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
  406. package/lib/dist/resolution/frameworks/page-component.d.ts +20 -0
  407. package/lib/dist/resolution/frameworks/page-component.d.ts.map +1 -0
  408. package/lib/dist/resolution/frameworks/page-component.js +45 -0
  409. package/lib/dist/resolution/frameworks/page-component.js.map +1 -0
  410. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
  411. package/lib/dist/resolution/frameworks/play.js +3 -1
  412. package/lib/dist/resolution/frameworks/play.js.map +1 -1
  413. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  414. package/lib/dist/resolution/frameworks/python.js +279 -26
  415. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  416. package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
  417. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  418. package/lib/dist/resolution/frameworks/react-native.js +153 -14
  419. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  420. package/lib/dist/resolution/frameworks/react-router.d.ts +47 -0
  421. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  422. package/lib/dist/resolution/frameworks/react-router.js +201 -0
  423. package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
  424. package/lib/dist/resolution/frameworks/react.d.ts +13 -2
  425. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  426. package/lib/dist/resolution/frameworks/react.js +542 -144
  427. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  428. package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -1
  429. package/lib/dist/resolution/frameworks/ruby.js +177 -17
  430. package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
  431. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
  432. package/lib/dist/resolution/frameworks/rust.js +24 -22
  433. package/lib/dist/resolution/frameworks/rust.js.map +1 -1
  434. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  435. package/lib/dist/resolution/frameworks/svelte.js +14 -6
  436. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  437. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  438. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  439. package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
  440. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  441. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
  442. package/lib/dist/resolution/frameworks/swift.js +253 -124
  443. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  444. package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  445. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  446. package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
  447. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  448. package/lib/dist/resolution/frameworks/vue-router.d.ts +98 -0
  449. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  450. package/lib/dist/resolution/frameworks/vue-router.js +500 -0
  451. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
  452. package/lib/dist/resolution/frameworks/vue.d.ts +9 -2
  453. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
  454. package/lib/dist/resolution/frameworks/vue.js +45 -11
  455. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  456. package/lib/dist/resolution/import-resolver.d.ts +66 -0
  457. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  458. package/lib/dist/resolution/import-resolver.js +643 -61
  459. package/lib/dist/resolution/import-resolver.js.map +1 -1
  460. package/lib/dist/resolution/index.d.ts +124 -25
  461. package/lib/dist/resolution/index.d.ts.map +1 -1
  462. package/lib/dist/resolution/index.js +769 -152
  463. package/lib/dist/resolution/index.js.map +1 -1
  464. package/lib/dist/resolution/js-builtins.d.ts +13 -0
  465. package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
  466. package/lib/dist/resolution/js-builtins.js +48 -0
  467. package/lib/dist/resolution/js-builtins.js.map +1 -0
  468. package/lib/dist/resolution/name-matcher.d.ts +101 -22
  469. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  470. package/lib/dist/resolution/name-matcher.js +8267 -287
  471. package/lib/dist/resolution/name-matcher.js.map +1 -1
  472. package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
  473. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  474. package/lib/dist/resolution/next-router-synthesizer.js +113 -0
  475. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
  476. package/lib/dist/resolution/react-router-synthesizer.d.ts +35 -0
  477. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  478. package/lib/dist/resolution/react-router-synthesizer.js +197 -0
  479. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
  480. package/lib/dist/resolution/resolver-pool.d.ts +22 -1
  481. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  482. package/lib/dist/resolution/resolver-pool.js +35 -5
  483. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  484. package/lib/dist/resolution/resolver-worker.js +3 -0
  485. package/lib/dist/resolution/resolver-worker.js.map +1 -1
  486. package/lib/dist/resolution/strip-comments.d.ts +6 -0
  487. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  488. package/lib/dist/resolution/strip-comments.js +58 -0
  489. package/lib/dist/resolution/strip-comments.js.map +1 -1
  490. package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  491. package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  492. package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
  493. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  494. package/lib/dist/resolution/swift-type-visibility.d.ts +68 -0
  495. package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  496. package/lib/dist/resolution/swift-type-visibility.js +454 -0
  497. package/lib/dist/resolution/swift-type-visibility.js.map +1 -0
  498. package/lib/dist/resolution/synth-utils.d.ts +26 -0
  499. package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
  500. package/lib/dist/resolution/synth-utils.js +75 -0
  501. package/lib/dist/resolution/synth-utils.js.map +1 -0
  502. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  503. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  504. package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
  505. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  506. package/lib/dist/resolution/tier-synthesizer.d.ts +54 -0
  507. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  508. package/lib/dist/resolution/tier-synthesizer.js +1294 -0
  509. package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
  510. package/lib/dist/resolution/type-parameters.d.ts +11 -0
  511. package/lib/dist/resolution/type-parameters.d.ts.map +1 -0
  512. package/lib/dist/resolution/type-parameters.js +287 -0
  513. package/lib/dist/resolution/type-parameters.js.map +1 -0
  514. package/lib/dist/resolution/types.d.ts +105 -2
  515. package/lib/dist/resolution/types.d.ts.map +1 -1
  516. package/lib/dist/resolution/types.js +64 -0
  517. package/lib/dist/resolution/types.js.map +1 -1
  518. package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  519. package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  520. package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
  521. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
  522. package/lib/dist/search/query-paths.d.ts +50 -1
  523. package/lib/dist/search/query-paths.d.ts.map +1 -1
  524. package/lib/dist/search/query-paths.js +227 -12
  525. package/lib/dist/search/query-paths.js.map +1 -1
  526. package/lib/dist/search/query-utils.d.ts +15 -0
  527. package/lib/dist/search/query-utils.d.ts.map +1 -1
  528. package/lib/dist/search/query-utils.js +35 -7
  529. package/lib/dist/search/query-utils.js.map +1 -1
  530. package/lib/dist/sync/watch-policy.d.ts +14 -0
  531. package/lib/dist/sync/watch-policy.d.ts.map +1 -1
  532. package/lib/dist/sync/watch-policy.js +19 -0
  533. package/lib/dist/sync/watch-policy.js.map +1 -1
  534. package/lib/dist/sync/watcher.d.ts +52 -35
  535. package/lib/dist/sync/watcher.d.ts.map +1 -1
  536. package/lib/dist/sync/watcher.js +236 -100
  537. package/lib/dist/sync/watcher.js.map +1 -1
  538. package/lib/dist/sync/worktree.d.ts +22 -0
  539. package/lib/dist/sync/worktree.d.ts.map +1 -1
  540. package/lib/dist/sync/worktree.js +54 -0
  541. package/lib/dist/sync/worktree.js.map +1 -1
  542. package/lib/dist/telemetry/index.d.ts +4 -2
  543. package/lib/dist/telemetry/index.d.ts.map +1 -1
  544. package/lib/dist/telemetry/index.js +159 -66
  545. package/lib/dist/telemetry/index.js.map +1 -1
  546. package/lib/dist/types.d.ts +1 -1
  547. package/lib/dist/types.d.ts.map +1 -1
  548. package/lib/dist/types.js +1 -0
  549. package/lib/dist/types.js.map +1 -1
  550. package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
  551. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
  552. package/lib/dist/ui-server/api/deadcode.js +136 -0
  553. package/lib/dist/ui-server/api/deadcode.js.map +1 -0
  554. package/lib/dist/ui-server/api/effects.d.ts +94 -0
  555. package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
  556. package/lib/dist/ui-server/api/effects.js +527 -0
  557. package/lib/dist/ui-server/api/effects.js.map +1 -0
  558. package/lib/dist/ui-server/api/entrypoints.d.ts +92 -0
  559. package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  560. package/lib/dist/ui-server/api/entrypoints.js +364 -0
  561. package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
  562. package/lib/dist/ui-server/api/events.d.ts +183 -0
  563. package/lib/dist/ui-server/api/events.d.ts.map +1 -0
  564. package/lib/dist/ui-server/api/events.js +430 -0
  565. package/lib/dist/ui-server/api/events.js.map +1 -0
  566. package/lib/dist/ui-server/api/file.d.ts +66 -0
  567. package/lib/dist/ui-server/api/file.d.ts.map +1 -0
  568. package/lib/dist/ui-server/api/file.js +235 -0
  569. package/lib/dist/ui-server/api/file.js.map +1 -0
  570. package/lib/dist/ui-server/api/filecode.d.ts +126 -0
  571. package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
  572. package/lib/dist/ui-server/api/filecode.js +205 -0
  573. package/lib/dist/ui-server/api/filecode.js.map +1 -0
  574. package/lib/dist/ui-server/api/flow.d.ts +226 -0
  575. package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
  576. package/lib/dist/ui-server/api/flow.js +612 -0
  577. package/lib/dist/ui-server/api/flow.js.map +1 -0
  578. package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
  579. package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  580. package/lib/dist/ui-server/api/hierarchy.js +92 -0
  581. package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
  582. package/lib/dist/ui-server/api/index.d.ts +90 -0
  583. package/lib/dist/ui-server/api/index.d.ts.map +1 -0
  584. package/lib/dist/ui-server/api/index.js +332 -0
  585. package/lib/dist/ui-server/api/index.js.map +1 -0
  586. package/lib/dist/ui-server/api/map.d.ts +273 -0
  587. package/lib/dist/ui-server/api/map.d.ts.map +1 -0
  588. package/lib/dist/ui-server/api/map.js +781 -0
  589. package/lib/dist/ui-server/api/map.js.map +1 -0
  590. package/lib/dist/ui-server/api/node.d.ts +81 -0
  591. package/lib/dist/ui-server/api/node.d.ts.map +1 -0
  592. package/lib/dist/ui-server/api/node.js +394 -0
  593. package/lib/dist/ui-server/api/node.js.map +1 -0
  594. package/lib/dist/ui-server/api/nodes.d.ts +25 -0
  595. package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
  596. package/lib/dist/ui-server/api/nodes.js +45 -0
  597. package/lib/dist/ui-server/api/nodes.js.map +1 -0
  598. package/lib/dist/ui-server/api/program.d.ts +139 -0
  599. package/lib/dist/ui-server/api/program.d.ts.map +1 -0
  600. package/lib/dist/ui-server/api/program.js +315 -0
  601. package/lib/dist/ui-server/api/program.js.map +1 -0
  602. package/lib/dist/ui-server/api/respond.d.ts +76 -0
  603. package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
  604. package/lib/dist/ui-server/api/respond.js +186 -0
  605. package/lib/dist/ui-server/api/respond.js.map +1 -0
  606. package/lib/dist/ui-server/api/route-roots.d.ts +45 -0
  607. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
  608. package/lib/dist/ui-server/api/route-roots.js +117 -0
  609. package/lib/dist/ui-server/api/route-roots.js.map +1 -0
  610. package/lib/dist/ui-server/api/routes.d.ts +61 -0
  611. package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
  612. package/lib/dist/ui-server/api/routes.js +164 -0
  613. package/lib/dist/ui-server/api/routes.js.map +1 -0
  614. package/lib/dist/ui-server/api/screens.d.ts +117 -0
  615. package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
  616. package/lib/dist/ui-server/api/screens.js +626 -0
  617. package/lib/dist/ui-server/api/screens.js.map +1 -0
  618. package/lib/dist/ui-server/api/search.d.ts +29 -0
  619. package/lib/dist/ui-server/api/search.d.ts.map +1 -0
  620. package/lib/dist/ui-server/api/search.js +232 -0
  621. package/lib/dist/ui-server/api/search.js.map +1 -0
  622. package/lib/dist/ui-server/api/session.d.ts +52 -0
  623. package/lib/dist/ui-server/api/session.d.ts.map +1 -0
  624. package/lib/dist/ui-server/api/session.js +196 -0
  625. package/lib/dist/ui-server/api/session.js.map +1 -0
  626. package/lib/dist/ui-server/api/source.d.ts +200 -0
  627. package/lib/dist/ui-server/api/source.d.ts.map +1 -0
  628. package/lib/dist/ui-server/api/source.js +422 -0
  629. package/lib/dist/ui-server/api/source.js.map +1 -0
  630. package/lib/dist/ui-server/api/stats.d.ts +27 -0
  631. package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
  632. package/lib/dist/ui-server/api/stats.js +164 -0
  633. package/lib/dist/ui-server/api/stats.js.map +1 -0
  634. package/lib/dist/ui-server/api/steps.d.ts +274 -0
  635. package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
  636. package/lib/dist/ui-server/api/steps.js +1554 -0
  637. package/lib/dist/ui-server/api/steps.js.map +1 -0
  638. package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
  639. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
  640. package/lib/dist/ui-server/api/trail-store.js +323 -0
  641. package/lib/dist/ui-server/api/trail-store.js.map +1 -0
  642. package/lib/dist/ui-server/api/trails.d.ts +163 -0
  643. package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
  644. package/lib/dist/ui-server/api/trails.js +370 -0
  645. package/lib/dist/ui-server/api/trails.js.map +1 -0
  646. package/lib/dist/ui-server/api/when.d.ts +133 -0
  647. package/lib/dist/ui-server/api/when.d.ts.map +1 -0
  648. package/lib/dist/ui-server/api/when.js +275 -0
  649. package/lib/dist/ui-server/api/when.js.map +1 -0
  650. package/lib/dist/ui-server/api/wire.d.ts +179 -0
  651. package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
  652. package/lib/dist/ui-server/api/wire.js +231 -0
  653. package/lib/dist/ui-server/api/wire.js.map +1 -0
  654. package/lib/dist/ui-server/assets.d.ts +40 -0
  655. package/lib/dist/ui-server/assets.d.ts.map +1 -0
  656. package/lib/dist/ui-server/assets.js +110 -0
  657. package/lib/dist/ui-server/assets.js.map +1 -0
  658. package/lib/dist/ui-server/constants.d.ts +32 -0
  659. package/lib/dist/ui-server/constants.d.ts.map +1 -0
  660. package/lib/dist/ui-server/constants.js +35 -0
  661. package/lib/dist/ui-server/constants.js.map +1 -0
  662. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts +28 -0
  663. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts.map +1 -0
  664. package/lib/dist/ui-server/highlight/bounded-tokenize.js +139 -0
  665. package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -0
  666. package/lib/dist/ui-server/highlight/index.d.ts +113 -0
  667. package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
  668. package/lib/dist/ui-server/highlight/index.js +312 -0
  669. package/lib/dist/ui-server/highlight/index.js.map +1 -0
  670. package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
  671. package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
  672. package/lib/dist/ui-server/highlight/languages.js +50 -0
  673. package/lib/dist/ui-server/highlight/languages.js.map +1 -0
  674. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts +7 -0
  675. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts.map +1 -0
  676. package/lib/dist/ui-server/highlight/tokenize-worker.js +20 -0
  677. package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -0
  678. package/lib/dist/ui-server/index.d.ts +92 -0
  679. package/lib/dist/ui-server/index.d.ts.map +1 -0
  680. package/lib/dist/ui-server/index.js +399 -0
  681. package/lib/dist/ui-server/index.js.map +1 -0
  682. package/lib/dist/ui-server/open-browser.d.ts +31 -0
  683. package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
  684. package/lib/dist/ui-server/open-browser.js +79 -0
  685. package/lib/dist/ui-server/open-browser.js.map +1 -0
  686. package/lib/dist/ui-server/security.d.ts +127 -0
  687. package/lib/dist/ui-server/security.d.ts.map +1 -0
  688. package/lib/dist/ui-server/security.js +332 -0
  689. package/lib/dist/ui-server/security.js.map +1 -0
  690. package/lib/dist/ui-server/static.d.ts +45 -0
  691. package/lib/dist/ui-server/static.d.ts.map +1 -0
  692. package/lib/dist/ui-server/static.js +165 -0
  693. package/lib/dist/ui-server/static.js.map +1 -0
  694. package/lib/dist/upgrade/index.d.ts +43 -5
  695. package/lib/dist/upgrade/index.d.ts.map +1 -1
  696. package/lib/dist/upgrade/index.js +157 -35
  697. package/lib/dist/upgrade/index.js.map +1 -1
  698. package/lib/dist/utils.d.ts +14 -2
  699. package/lib/dist/utils.d.ts.map +1 -1
  700. package/lib/dist/utils.js +25 -10
  701. package/lib/dist/utils.js.map +1 -1
  702. package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  703. package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  704. package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  705. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
  706. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
  707. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  708. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  709. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  710. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  711. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  712. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  713. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
  714. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
  715. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  716. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  717. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  718. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  719. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  720. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  721. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
  722. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
  723. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  724. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  725. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  726. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  727. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  728. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  729. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
  730. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
  731. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  732. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  733. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  734. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  735. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  736. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  737. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
  738. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
  739. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  740. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  741. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  742. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  743. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  744. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  745. package/lib/dist/viewer/assets/index-BSGpxBr9.js +99 -0
  746. package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
  747. package/lib/dist/viewer/index.html +16 -0
  748. package/lib/dist/worker-teardown.d.ts +48 -0
  749. package/lib/dist/worker-teardown.d.ts.map +1 -0
  750. package/lib/dist/worker-teardown.js +100 -0
  751. package/lib/dist/worker-teardown.js.map +1 -0
  752. package/lib/kernel/codegraph-kernel.node +2 -2
  753. package/lib/node_modules/.package-lock.json +4 -4
  754. package/lib/node_modules/picomatch/README.md +56 -51
  755. package/lib/node_modules/picomatch/lib/constants.js +4 -0
  756. package/lib/node_modules/picomatch/lib/parse.js +341 -1
  757. package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
  758. package/lib/node_modules/picomatch/lib/scan.js +30 -18
  759. package/lib/node_modules/picomatch/package.json +4 -4
  760. package/lib/package.json +9 -2
  761. package/package.json +1 -1
@@ -45,21 +45,45 @@ exports.ReferenceResolver = void 0;
45
45
  exports.createResolver = createResolver;
46
46
  const fs = __importStar(require("fs"));
47
47
  const path = __importStar(require("path"));
48
+ const synthesis_stage_1 = require("../db/synthesis-stage");
49
+ const types_1 = require("./types");
48
50
  const name_matcher_1 = require("./name-matcher");
51
+ const cpp_macro_visibility_1 = require("./cpp-macro-visibility");
52
+ const cpp_constructor_1 = require("./cpp-constructor");
53
+ const swift_type_visibility_1 = require("./swift-type-visibility");
54
+ const type_parameters_1 = require("./type-parameters");
49
55
  const import_resolver_1 = require("./import-resolver");
50
56
  const resolver_pool_1 = require("./resolver-pool");
57
+ const alias_binding_1 = require("./alias-binding");
51
58
  const frameworks_1 = require("./frameworks");
52
59
  const callback_synthesizer_1 = require("./callback-synthesizer");
53
60
  const cooperative_yield_1 = require("./cooperative-yield");
61
+ const file_limits_1 = require("../file-limits");
54
62
  const path_aliases_1 = require("./path-aliases");
55
63
  const go_module_1 = require("./go-module");
56
64
  const workspace_packages_1 = require("./workspace-packages");
57
65
  const errors_1 = require("../errors");
66
+ const utils_1 = require("../utils");
58
67
  const lru_cache_1 = require("./lru-cache");
68
+ const js_builtins_1 = require("./js-builtins");
69
+ const module_1 = require("module");
70
+ const jsonc_parser_1 = require("jsonc-parser");
71
+ const NODE_BUILTINS = new Set(module_1.builtinModules);
59
72
  /** Node kinds that can declare supertypes (extends/implements). */
60
73
  const SUPERTYPE_BEARING_KINDS = new Set([
61
74
  'class', 'struct', 'interface', 'trait', 'protocol', 'enum',
62
75
  ]);
76
+ /**
77
+ * The only edges resolving a reference reads (getSupertypes' walk). The batch
78
+ * loop commits a batch that made any of these before the next batch fans out;
79
+ * its other edges land while that batch resolves. A resolution strategy that
80
+ * reads another edge kind must be added here.
81
+ */
82
+ const RESOLUTION_READ_EDGE_KINDS = ['implements', 'extends'];
83
+ // SUPERTYPE_TARGET_KINDS (the kinds an extends/implements edge may TARGET)
84
+ // lives in ./types — the name-matcher needs the same set to restrict its
85
+ // candidate pool before ranking. It is deliberately wider than
86
+ // SUPERTYPE_BEARING_KINDS above, which is about the DECLARING side.
63
87
  /**
64
88
  * Languages whose chained static-factory/fluent calls defer to the conformance
65
89
  * second pass. Dotted-receiver languages resolve via matchDottedCallChain; the
@@ -92,13 +116,6 @@ function resolveCacheLimit() {
92
116
  // Re-export types
93
117
  __exportStar(require("./types"), exports);
94
118
  // Pre-built Sets for O(1) built-in lookups (allocated once, shared across all instances)
95
- const JS_BUILT_INS = new Set([
96
- 'console', 'window', 'document', 'global', 'process',
97
- 'Promise', 'Array', 'Object', 'String', 'Number', 'Boolean',
98
- 'Date', 'Math', 'JSON', 'RegExp', 'Error', 'Map', 'Set',
99
- 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval',
100
- 'fetch', 'require', 'module', 'exports', '__dirname', '__filename',
101
- ]);
102
119
  const REACT_HOOKS = new Set([
103
120
  'useState', 'useEffect', 'useContext', 'useReducer', 'useCallback',
104
121
  'useMemo', 'useRef', 'useLayoutEffect', 'useImperativeHandle', 'useDebugValue',
@@ -219,8 +236,9 @@ class ReferenceResolver {
219
236
  context;
220
237
  frameworks = [];
221
238
  // Chained static-factory/fluent call refs the first pass couldn't resolve,
222
- // collected in-memory (the batched resolver deletes unresolved refs from the
223
- // DB, so they can't be re-read). Drained by resolveChainedCallsViaConformance
239
+ // collected in-memory and left pending in the DB until the post-pass
240
+ // finishes, so a restart can recover the queue (#1577). Drained by
241
+ // resolveChainedCallsViaConformance
224
242
  // once implements/extends edges exist, to resolve methods on a supertype the
225
243
  // receiver conforms to (#750).
226
244
  deferredChainRefs = [];
@@ -229,6 +247,7 @@ class ReferenceResolver {
229
247
  // same reason as deferredChainRefs and drained by
230
248
  // resolveDeferredThisMemberRefs once implements/extends edges exist (#808).
231
249
  deferredThisMemberRefs = [];
250
+ deferredRowIds = new Set();
232
251
  // Per-`.razor`/`.cshtml`-file `@using` namespace set (own directives + folder
233
252
  // `_Imports.razor`, cascading to the project root). Used to disambiguate a
234
253
  // markup type ref to the right C# namespace.
@@ -244,6 +263,12 @@ class ReferenceResolver {
244
263
  lowerNameCache; // lower(name) → nodes cache
245
264
  qualifiedNameCache; // qualified_name → nodes cache
246
265
  fileLinesCache; // file → split lines cache
266
+ // id → node for the resolver's own point reads. Every resolved reference
267
+ // re-reads its target a few times (kind gate, language gate, alias
268
+ // following, edge creation) and targets recur ~5× on large repos; the query
269
+ // layer's cache is too small for that working set. Same stable window as the
270
+ // name caches above; absent ids are not cached.
271
+ nodeByIdCache;
247
272
  methodMatchCache; // lang\0Type::method → matching method nodes
248
273
  // Per-(language, methodName) owner index for getMethodMatches: buckets a
249
274
  // method name's candidates by their qualifiedName's last two segments so a
@@ -280,6 +305,8 @@ class ReferenceResolver {
280
305
  // resolution pass (same lifetime assumption as nameCache); clearCaches() resets
281
306
  // it between passes. Callers must treat the returned array as read-only.
282
307
  nodesByKindCache = new Map();
308
+ // Filesystem existence probes behind context.fileExists (paths not in knownFiles).
309
+ fileExistsMemo = new Map();
283
310
  knownNames = null; // all known symbol names for fast pre-filtering
284
311
  knownFiles = null;
285
312
  cachesWarmed = false;
@@ -287,6 +314,8 @@ class ReferenceResolver {
287
314
  // `null` = computed and absent. Treated as immutable for the
288
315
  // resolver's lifetime; callers re-create the resolver if config changes.
289
316
  projectAliases = undefined;
317
+ // Per directory: the aliases of the nearest non-root tsconfig declaring `paths`.
318
+ dirAliases = new Map();
290
319
  // go.mod module path. Same lazy/immutable convention as projectAliases.
291
320
  goModule = undefined;
292
321
  // Monorepo workspace member packages. Same lazy/immutable convention.
@@ -308,6 +337,7 @@ class ReferenceResolver {
308
337
  // Split-lines arrays are heavier than content strings; refs arrive
309
338
  // file-ordered, so a small cache still hits nearly always.
310
339
  this.fileLinesCache = new lru_cache_1.LRUCache(contentLimit);
340
+ this.nodeByIdCache = new lru_cache_1.LRUCache(Math.max(limit * 4, 20_000));
311
341
  this.methodMatchCache = new lru_cache_1.LRUCache(limit);
312
342
  this.context = this.createContext();
313
343
  }
@@ -386,6 +416,16 @@ class ReferenceResolver {
386
416
  this.knownNames = names;
387
417
  this.cachesWarmed = true;
388
418
  }
419
+ /** `queries.getNodeById` through the resolver's own id → node cache. */
420
+ nodeById(id) {
421
+ const cached = this.nodeByIdCache.get(id);
422
+ if (cached !== undefined)
423
+ return cached;
424
+ const node = this.queries.getNodeById(id);
425
+ if (node)
426
+ this.nodeByIdCache.set(id, node);
427
+ return node;
428
+ }
389
429
  /**
390
430
  * Clear internal caches
391
431
  */
@@ -398,12 +438,16 @@ class ReferenceResolver {
398
438
  this.lowerNameCache.clear();
399
439
  this.qualifiedNameCache.clear();
400
440
  this.fileLinesCache.clear();
441
+ this.nodeByIdCache.clear();
401
442
  this.methodMatchCache.clear();
402
443
  this.methodOwnerIndexCache.clear();
403
444
  this.supertypeMemo.clear();
404
445
  this.supertypeGen++;
405
446
  this.nodesByKindCache.clear();
447
+ this.fileExistsMemo.clear();
448
+ this.manifestScopes.clear();
406
449
  this.knownNames = null;
450
+ this.knownLowerNames = null;
407
451
  this.knownFiles = null;
408
452
  this.cachesWarmed = false;
409
453
  // The import-resolver's and name-matcher's per-context memos assume the
@@ -411,6 +455,9 @@ class ReferenceResolver {
411
455
  if (this.context) {
412
456
  (0, import_resolver_1.clearImportResolverMemos)(this.context);
413
457
  (0, name_matcher_1.clearNameMatcherMemos)(this.context);
458
+ (0, cpp_macro_visibility_1.clearCppMacroVisibility)(this.context);
459
+ (0, swift_type_visibility_1.clearSwiftTypeVisibility)(this.context);
460
+ (0, type_parameters_1.clearTypeParameterMemos)(this.context);
414
461
  }
415
462
  }
416
463
  /** `readFile` through the LRU content cache (null = read failed, also cached). */
@@ -420,6 +467,14 @@ class ReferenceResolver {
420
467
  }
421
468
  const fullPath = path.join(this.projectRoot, filePath);
422
469
  try {
470
+ // Import resolvers may follow package metadata to an archive (`file:*.har`,
471
+ // for example). Reject anything extraction would not accept before UTF-8
472
+ // decoding can multiply a large binary blob into gigabytes of V8 heap.
473
+ const stats = fs.statSync(fullPath);
474
+ if (!stats.isFile() || stats.size > file_limits_1.MAX_SOURCE_FILE_SIZE_BYTES) {
475
+ this.fileCache.set(filePath, null);
476
+ return null;
477
+ }
423
478
  const content = fs.readFileSync(fullPath, 'utf-8');
424
479
  this.fileCache.set(filePath, content);
425
480
  return content;
@@ -430,17 +485,52 @@ class ReferenceResolver {
430
485
  return null;
431
486
  }
432
487
  }
488
+ /**
489
+ * `readFileCached(filePath)?.includes(needle)` for an ASCII needle, searched
490
+ * in the raw bytes: an ASCII byte sequence survives UTF-8 decoding
491
+ * unchanged, and decoding is most of reading a file nobody keeps.
492
+ */
493
+ fileContains(filePath, needle) {
494
+ if (this.fileCache.has(filePath))
495
+ return this.fileCache.get(filePath)?.includes(needle) ?? false;
496
+ const fullPath = path.join(this.projectRoot, filePath);
497
+ try {
498
+ const stats = fs.statSync(fullPath);
499
+ if (!stats.isFile() || stats.size > file_limits_1.MAX_SOURCE_FILE_SIZE_BYTES)
500
+ return false;
501
+ return fs.readFileSync(fullPath).includes(needle);
502
+ }
503
+ catch {
504
+ return false;
505
+ }
506
+ }
433
507
  /**
434
508
  * Create the resolution context
435
509
  */
436
510
  createContext() {
437
511
  return {
512
+ resolveImport: (ref) => (0, import_resolver_1.resolveViaImport)(ref, this.context),
513
+ isOutOfRepoImport: (source, fromFile, language) => (0, import_resolver_1.isExternalImport)(source, language, this.context) &&
514
+ (0, import_resolver_1.resolveImportPath)(source, fromFile, language, this.context) === null &&
515
+ this.isDeclaredOutsidePackage(source, fromFile),
438
516
  getNodesInFile: (filePath) => {
439
517
  if (!this.nodeCache.has(filePath)) {
440
518
  this.nodeCache.set(filePath, this.queries.getNodesByFile(filePath));
441
519
  }
442
520
  return this.nodeCache.get(filePath);
443
521
  },
522
+ fileHasExportedNode: (filePath) => {
523
+ const cached = this.nodeCache.get(filePath);
524
+ return cached !== undefined ? cached.some((n) => n.isExported) : this.queries.fileHasExportedNode(filePath);
525
+ },
526
+ getExportedNodesInFile: (filePath) => {
527
+ const cached = this.nodeCache.get(filePath);
528
+ return cached !== undefined ? cached.filter((n) => n.isExported) : this.queries.getExportedNodesByFile(filePath);
529
+ },
530
+ getNodesInFileNamed: (filePath, name) => {
531
+ const cached = this.nodeCache.get(filePath);
532
+ return cached !== undefined ? cached.filter((n) => n.name === name) : this.queries.getNodesByFileAndName(filePath, name);
533
+ },
444
534
  getNodesByName: (name) => {
445
535
  const cached = this.nameCache.get(name);
446
536
  if (cached !== undefined)
@@ -471,7 +561,7 @@ class ReferenceResolver {
471
561
  for (const m of candidates) {
472
562
  if (m.kind !== 'method')
473
563
  continue;
474
- if (m.language !== language)
564
+ if (!(0, name_matcher_1.sameLanguageFamily)(m.language, language))
475
565
  continue;
476
566
  const qn = m.qualifiedName;
477
567
  if (qn === want || qn.endsWith(`::${want}`))
@@ -498,7 +588,7 @@ class ReferenceResolver {
498
588
  for (const m of candidates) {
499
589
  if (m.kind !== 'method')
500
590
  continue;
501
- if (m.language !== language)
591
+ if (!(0, name_matcher_1.sameLanguageFamily)(m.language, language))
502
592
  continue;
503
593
  const qn = m.qualifiedName;
504
594
  const i2 = qn.lastIndexOf('::');
@@ -548,17 +638,40 @@ class ReferenceResolver {
548
638
  return true;
549
639
  }
550
640
  }
551
- // Fall back to filesystem for files not yet indexed
552
- const fullPath = path.join(this.projectRoot, filePath);
553
- try {
554
- return fs.existsSync(fullPath);
555
- }
556
- catch (error) {
557
- (0, errors_1.logDebug)('Error checking file existence', { filePath, error: String(error) });
558
- return false;
641
+ // Fall back to filesystem for files not yet indexed. `path.join` does
642
+ // not clamp, and relative-import resolution hands us paths carrying
643
+ // `../` segments, so the probe has to be contained (#1631): a path
644
+ // outside the root can never be an indexed project file, and the
645
+ // `knownFiles` check above already answered for everything that is.
646
+ // Lexical containment only: this is a per-candidate hot path, and the
647
+ // symlink half of `validatePathWithinRoot` costs two `realpathSync`
648
+ // calls per probe (~70x slower here). It would also be wrong to apply
649
+ // — indexing deliberately follows in-root symlinks whose targets live
650
+ // outside the root (#935), so only the `../` escape is refused.
651
+ // Memoized: import resolution probes the same candidate paths (every
652
+ // extension of a specifier) from every file that imports it, and the
653
+ // tree does not change within a resolution pass (same window as the
654
+ // file-content cache; dropped by clearCaches).
655
+ const probed = this.fileExistsMemo.get(filePath);
656
+ if (probed !== undefined)
657
+ return probed;
658
+ const fullPath = (0, utils_1.lexicalPathWithinRoot)(this.projectRoot, filePath);
659
+ let exists = false;
660
+ if (fullPath !== null) {
661
+ try {
662
+ exists = fs.existsSync(fullPath);
663
+ }
664
+ catch (error) {
665
+ (0, errors_1.logDebug)('Error checking file existence', { filePath, error: String(error) });
666
+ }
559
667
  }
668
+ if (this.fileExistsMemo.size >= 200_000)
669
+ this.fileExistsMemo.clear();
670
+ this.fileExistsMemo.set(filePath, exists);
671
+ return exists;
560
672
  },
561
673
  readFile: (filePath) => this.readFileCached(filePath),
674
+ fileContains: (filePath, needle) => this.fileContains(filePath, needle),
562
675
  getFileLines: (filePath) => {
563
676
  const cached = this.fileLinesCache.get(filePath);
564
677
  if (cached !== undefined)
@@ -599,7 +712,7 @@ class ReferenceResolver {
599
712
  return result;
600
713
  },
601
714
  getNodeById: (id) => {
602
- return this.queries.getNodeById(id);
715
+ return this.nodeById(id);
603
716
  },
604
717
  getSupertypes: (typeName, language) => {
605
718
  // Union the `implements`/`extends` targets of every same-named type node.
@@ -616,7 +729,9 @@ class ReferenceResolver {
616
729
  return hit.supers;
617
730
  const typeNodes = this.context
618
731
  .getNodesByName(typeName)
619
- .filter((n) => SUPERTYPE_BEARING_KINDS.has(n.kind) && n.language === language);
732
+ // Scala singletons can inherit members even though they cannot be parents.
733
+ .filter((n) => n.language === language && (SUPERTYPE_BEARING_KINDS.has(n.kind) ||
734
+ (n.language === 'scala' && n.kind === 'module')));
620
735
  let supers;
621
736
  if (typeNodes.length === 0) {
622
737
  supers = [];
@@ -624,11 +739,20 @@ class ReferenceResolver {
624
739
  else {
625
740
  const supertypes = new Set();
626
741
  for (const tn of typeNodes) {
627
- for (const edge of this.queries.getOutgoingEdges(tn.id, ['implements', 'extends'])) {
628
- const target = this.queries.getNodeById(edge.target);
742
+ for (const edge of this.queries.getOutgoingEdges(tn.id, RESOLUTION_READ_EDGE_KINDS)) {
743
+ const target = this.nodeById(edge.target);
629
744
  if (target?.name && target.name !== typeName)
630
745
  supertypes.add(target.name);
631
746
  }
747
+ // A Swift conformance to a type the project only extends (SwiftUI's
748
+ // `View`) resolves to nothing — the extension is not the type — yet
749
+ // the members its extensions add are still the conformer's.
750
+ if (language === 'swift') {
751
+ for (const name of (0, swift_type_visibility_1.swiftExtendedConformances)(tn, this.context)) {
752
+ if (name !== typeName)
753
+ supertypes.add(name);
754
+ }
755
+ }
632
756
  }
633
757
  supers = [...supertypes];
634
758
  }
@@ -655,6 +779,31 @@ class ReferenceResolver {
655
779
  }
656
780
  return this.projectAliases;
657
781
  },
782
+ getNearestAliases: (fromFile) => {
783
+ let dir = path.posix.dirname(fromFile.replace(/\\/g, '/'));
784
+ const walked = [];
785
+ let found = null;
786
+ while (dir && dir !== '.' && dir !== '/') {
787
+ const hit = this.dirAliases.get(dir);
788
+ if (hit !== undefined) {
789
+ found = hit;
790
+ break;
791
+ }
792
+ walked.push(dir);
793
+ const abs = path.join(this.projectRoot, dir);
794
+ if (['tsconfig.json', 'jsconfig.json'].some((name) => fs.existsSync(path.join(abs, name)))) {
795
+ const aliases = (0, path_aliases_1.loadProjectAliases)(abs);
796
+ if (aliases) {
797
+ found = aliases;
798
+ break;
799
+ }
800
+ }
801
+ dir = path.posix.dirname(dir);
802
+ }
803
+ for (const d of walked)
804
+ this.dirAliases.set(d, found);
805
+ return found;
806
+ },
658
807
  getGoModule: () => {
659
808
  if (this.goModule === undefined) {
660
809
  this.goModule = (0, go_module_1.loadGoModule)(this.projectRoot);
@@ -699,6 +848,7 @@ class ReferenceResolver {
699
848
  resolveAll(unresolvedRefs, onProgress) {
700
849
  // Pre-load all nodes into memory for fast lookups
701
850
  this.warmCaches();
851
+ this.advanceSupertypeGeneration();
702
852
  const resolved = [];
703
853
  const unresolved = [];
704
854
  const byMethod = {};
@@ -749,6 +899,22 @@ class ReferenceResolver {
749
899
  },
750
900
  };
751
901
  }
902
+ /** Lowercased `knownNames`, built the first time a case-insensitive language asks. */
903
+ knownLowerNames = null;
904
+ /** `hasAnyPossibleMatch` for a language whose names ignore case: the name, or any `.`/`::`/`->` part of it. */
905
+ hasAnyPossibleMatchIgnoringCase(name) {
906
+ if (!this.knownNames)
907
+ return true;
908
+ if (!this.knownLowerNames || this.knownLowerNames.size === 0) {
909
+ this.knownLowerNames = new Set();
910
+ for (const known of this.knownNames)
911
+ this.knownLowerNames.add(known.toLowerCase());
912
+ }
913
+ const lower = name.toLowerCase();
914
+ if (this.knownLowerNames.has(lower))
915
+ return true;
916
+ return lower.split(/::|->|\./).some((part) => part.length > 0 && this.knownLowerNames.has(part));
917
+ }
752
918
  /**
753
919
  * Check if a reference name has any possible match in the codebase.
754
920
  * Uses the pre-built knownNames set to skip expensive resolution
@@ -844,9 +1010,49 @@ class ReferenceResolver {
844
1010
  return false;
845
1011
  }
846
1012
  /**
847
- * Resolve a single reference
1013
+ * Resolve a single reference.
1014
+ *
1015
+ * Thin decorator over `resolveOneInner` so every strategy — framework,
1016
+ * import, name-match, chain, CFML component path — passes through the
1017
+ * inheritance target-kind gate at ONE seam. Filtering inside the
1018
+ * name-matcher would have covered `matchByExactName` only.
1019
+ * Calls that land on an alias binding then forward once to the callable
1020
+ * the alias names (see ./alias-binding), regardless of the strategy.
848
1021
  */
849
1022
  resolveOne(ref) {
1023
+ // A C/C++ "call" whose name is a function-like macro visible in this
1024
+ // translation unit is a macro expansion, not a call — it must never bind
1025
+ // to a same-named function in another file (#1838).
1026
+ if ((0, cpp_macro_visibility_1.isVisibleCppMacro)(ref, this.context))
1027
+ return null;
1028
+ // A Swift type reference never lands on an `extension X {}` node, nor on a
1029
+ // nested type it cannot name bare (see ./swift-type-visibility).
1030
+ // A name a declaration around the reference declares as a type parameter
1031
+ // (`def f[A]`, `class Foo<T>`) is that parameter (see ./type-parameters).
1032
+ const candidate = (0, type_parameters_1.gateTypeParameter)((0, swift_type_visibility_1.gateSwiftTypeTarget)(this.gateTargetKind(this.resolveOneInner(ref), ref), ref, this.context), ref, this.context);
1033
+ const scoped = this.gateRustScope(candidate, ref);
1034
+ const resolved = this.gateSuperSelfCall(scoped?.resolvedBy === 'framework' ? this.gateFrameworkLanguage(scoped, ref) : this.gateLanguage(scoped, ref), ref);
1035
+ if (!resolved || ref.referenceKind !== 'calls')
1036
+ return resolved;
1037
+ const target = this.nodeById(resolved.targetNodeId);
1038
+ if (!target)
1039
+ return resolved;
1040
+ const dot = ref.referenceName.lastIndexOf('.');
1041
+ const memberName = dot >= 0 ? ref.referenceName.slice(dot + 1) : null;
1042
+ const forwarded = (0, alias_binding_1.resolveAliasBinding)(target, memberName, this.context);
1043
+ if (!forwarded || forwarded.id === resolved.targetNodeId)
1044
+ return resolved;
1045
+ return this.gateLanguage({
1046
+ ...resolved,
1047
+ targetNodeId: forwarded.id,
1048
+ confidence: Math.min(resolved.confidence, 0.85),
1049
+ }, ref);
1050
+ }
1051
+ resolveOneInner(ref) {
1052
+ // A local C++ object construction (`T obj(args)`, ref `ns::T::T/1`)
1053
+ // resolves ONLY to a constructor of the lexically nearest `T` (#1839).
1054
+ if ((0, cpp_constructor_1.isCppConstructorRef)(ref))
1055
+ return (0, cpp_constructor_1.matchCppConstructor)(ref, this.context);
850
1056
  // Skip built-in/external references
851
1057
  if (this.isBuiltInOrExternal(ref)) {
852
1058
  return null;
@@ -865,6 +1071,13 @@ class ReferenceResolver {
865
1071
  (ref.referenceName.includes('.') || ref.referenceName.includes('/'))) {
866
1072
  return this.resolveCfmlComponentPath(ref);
867
1073
  }
1074
+ // A PHP class written with a namespace in it — `new Alias\X()` through a
1075
+ // `use Ns as Alias;` namespace alias, `extends Sub\Base`, `\Ns\X::make()`
1076
+ // (#2256). The pre-filter below would drop most of these before any import
1077
+ // strategy ran, and PHP gives each one exactly one meaning; resolve it first.
1078
+ const phpQualified = (0, import_resolver_1.resolvePhpQualifiedClassRef)(ref, this.context);
1079
+ if (phpQualified !== undefined)
1080
+ return this.gateLanguage(phpQualified, ref);
868
1081
  // Fast pre-filter: skip if no symbol with this name exists anywhere
869
1082
  // AND the name doesn't match a local import. The import escape is
870
1083
  // necessary because re-export rename chains (`import { login }
@@ -874,8 +1087,9 @@ class ReferenceResolver {
874
1087
  // ArkTS chained-attribute refs carry a leading dot (`.titleStyle`) that
875
1088
  // routes them to the decorator-gated matcher; the symbol itself is
876
1089
  // indexed under the bare name, so the existence check strips the dot.
877
- // Nix static path imports (`import ./x.nix`) name a FILE, not a symbol —
878
- // they bypass the symbol-existence check and resolve via resolveViaImport.
1090
+ // Nix static path imports (`import ./x.nix`) and JS/TS module paths
1091
+ // (`require('./x')`) name a FILE, not a symbol — they bypass the
1092
+ // symbol-existence check and resolve via resolveViaImport.
879
1093
  let existenceName = ref.language === 'arkts' && ref.referenceName.startsWith('.')
880
1094
  ? ref.referenceName.slice(1)
881
1095
  : ref.referenceName;
@@ -885,13 +1099,17 @@ class ReferenceResolver {
885
1099
  existenceName = existenceName.replace(/\/\d{1,3}$/, '');
886
1100
  const tPre = this.profileStages ? process.hrtime.bigint() : 0n;
887
1101
  const preFilterPass = (0, import_resolver_1.isNixPathImportRef)(ref) ||
1102
+ (0, import_resolver_1.isJsPathImportRef)(ref) ||
888
1103
  this.hasAnyPossibleMatch(existenceName) ||
1104
+ // PHP, Pascal, CFML, COBOL and VB.NET names ignore case: `formatprice()`
1105
+ // calls `FormatPrice`, which the exact-name set never lists.
1106
+ (name_matcher_1.CASE_INSENSITIVE_LANGUAGES.has(ref.language) && this.hasAnyPossibleMatchIgnoringCase(existenceName)) ||
889
1107
  this.matchesAnyImport(ref) ||
890
1108
  this.frameworks.some((f) => f.claimsReference?.(ref.referenceName));
891
1109
  if (this.profileStages)
892
1110
  this.stageAdd('preFilter', ref, preFilterPass, tPre);
893
1111
  if (!preFilterPass) {
894
- return null;
1112
+ return this.gateLanguage((0, name_matcher_1.matchJsStoreBindingCall)(ref, this.context), ref);
895
1113
  }
896
1114
  // Function-as-value refs (#756) get a dedicated, strictly-gated path:
897
1115
  // import-based resolution first (an imported callback resolves through its
@@ -904,9 +1122,12 @@ class ReferenceResolver {
904
1122
  if (ref.referenceName.startsWith('this.')) {
905
1123
  return this.gateLanguage(this.resolveThisMemberFnRef(ref), ref);
906
1124
  }
1125
+ if ((ref.language === 'python' || ref.language === 'go') && ref.referenceName.includes('.')) {
1126
+ return this.gateLanguage((0, name_matcher_1.matchFunctionRef)(ref, this.context), ref);
1127
+ }
907
1128
  const viaImport = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
908
1129
  if (viaImport) {
909
- const target = this.queries.getNodeById(viaImport.targetNodeId);
1130
+ const target = this.nodeById(viaImport.targetNodeId);
910
1131
  if (target &&
911
1132
  (target.kind === 'function' ||
912
1133
  target.kind === 'method' ||
@@ -938,16 +1159,24 @@ class ReferenceResolver {
938
1159
  if (razorResult)
939
1160
  return razorResult;
940
1161
  }
1162
+ // An explicit PHP class import owns its static calls, including an
1163
+ // unavailable method. Do not let same-name fallbacks change the receiver
1164
+ // to an unrelated Service/Repository type (#1545).
1165
+ const phpStaticImport = (0, import_resolver_1.resolvePhpImportedStaticCall)(ref, this.context);
1166
+ if (phpStaticImport !== undefined)
1167
+ return this.gateLanguage(phpStaticImport, ref);
941
1168
  const candidates = [];
942
1169
  // Strategy 1: Try framework-specific resolution. Cross-language bridges
943
1170
  // are deliberately preserved (Drupal `routing.yml` → PHP controller, RN
944
- // JS → native `calls`) — `gateFrameworkLanguage` only drops a type/import
945
- // edge between two KNOWN families (see its doc), never a `calls` bridge or
946
- // a config↔code edge.
1171
+ // JS → native `calls`); other code references obey the shared family gate.
947
1172
  const tFw = this.profileStages ? process.hrtime.bigint() : 0n;
948
1173
  let fwEarly = null;
949
1174
  for (const framework of this.frameworks) {
950
- const result = this.gateFrameworkLanguage(framework.resolve(ref, this.context), ref);
1175
+ const resolved = this.gateFrameworkLanguage(framework.resolve(ref, this.context), ref);
1176
+ // Name the resolver on the edge (`metadata.framework`): a Swift→ObjC or
1177
+ // React Native bridge hop says how it got into the graph, as a
1178
+ // synthesized edge's `synthesizedBy` does.
1179
+ const result = resolved ? { ...resolved, metadata: { ...resolved.metadata, framework: framework.name } } : null;
951
1180
  if (result) {
952
1181
  if (result.confidence >= 0.9) {
953
1182
  fwEarly = result; // High confidence, return immediately (below)
@@ -960,9 +1189,38 @@ class ReferenceResolver {
960
1189
  this.stageAdd('frameworks', ref, fwEarly !== null, tFw);
961
1190
  if (fwEarly)
962
1191
  return fwEarly;
1192
+ // A retained untyped chain supplies effect/call-site evidence only. In
1193
+ // particular, importing its root does not make the root its call target.
1194
+ // A path through module namespaces is not untyped: `z.coerce.number()`
1195
+ // after `import * as z`, where the barrel has `export * as coerce`.
1196
+ if ((0, name_matcher_1.isUnresolvedJsMemberCall)(ref)) {
1197
+ const root = ref.referenceName.slice(0, ref.referenceName.indexOf('.'));
1198
+ const namespace = this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.isNamespace && m.localName === root);
1199
+ if (!namespace)
1200
+ return null;
1201
+ const viaNamespace = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1202
+ const target = viaNamespace ? this.nodeById(viaNamespace.targetNodeId) : null;
1203
+ return target && (target.kind === 'function' || target.kind === 'method' || target.kind === 'class' || target.kind === 'constant' || target.kind === 'variable')
1204
+ ? viaNamespace : null;
1205
+ }
963
1206
  // Strategy 2: Try import-based resolution
1207
+ // A TS/JS/Python call-receiver chain (`useStore.getState().reset`, #1683)
1208
+ // names the ROOT's import, not the method's: letting resolveViaImport see
1209
+ // it binds the call to the imported store constant and the method is
1210
+ // never looked up. The name-matcher owns the chain shape for these
1211
+ // languages — the Java/Kotlin/C++ chains keep their existing path.
1212
+ if (ref.referenceKind === 'calls' &&
1213
+ CHAIN_SHAPE.test(ref.referenceName) &&
1214
+ (ref.language === 'typescript' || ref.language === 'javascript' || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'python')) {
1215
+ return this.gateLanguage((0, name_matcher_1.matchReference)(ref, this.context), ref);
1216
+ }
964
1217
  const tImp = this.profileStages ? process.hrtime.bigint() : 0n;
965
- const importResult = this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
1218
+ // `self.get_ip()` is a method call on the instance even when the file
1219
+ // also imports a function named `get_ip`: the import never names it.
1220
+ const selfCall = ref.language === 'python' && ref.referenceKind === 'calls' &&
1221
+ this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.localName === ref.referenceName) &&
1222
+ (0, name_matcher_1.isPythonSelfCall)(ref, this.context);
1223
+ const importResult = selfCall ? null : this.gateLanguage((0, import_resolver_1.resolveViaImport)(ref, this.context), ref);
966
1224
  if (this.profileStages)
967
1225
  this.stageAdd('viaImport', ref, !!importResult, tImp);
968
1226
  if (importResult) {
@@ -997,8 +1255,15 @@ class ReferenceResolver {
997
1255
  // matcher would link each `mkOption` call to whichever file's inherit
998
1256
  // binding it happened to pick. Same-file matches only.
999
1257
  if (nameResult) {
1000
- const target = this.queries.getNodeById(nameResult.targetNodeId);
1001
- if (ref.language === 'nix') {
1258
+ const target = this.nodeById(nameResult.targetNodeId);
1259
+ // A definition its language makes file-local — a C `static`, a Kotlin
1260
+ // `private fun`, a Go unexported name in another package, a Rust
1261
+ // non-`pub` item outside its module subtree — cannot be what a name in
1262
+ // another file means, whichever strategy chose it (#1730).
1263
+ if (target && !(0, name_matcher_1.isVisibleAcrossFiles)(target, ref, this.context)) {
1264
+ nameResult = null;
1265
+ }
1266
+ else if (ref.language === 'nix') {
1002
1267
  if (!target || target.filePath !== ref.filePath) {
1003
1268
  nameResult = null;
1004
1269
  }
@@ -1021,7 +1286,7 @@ class ReferenceResolver {
1021
1286
  if (ref.referenceKind === 'calls' &&
1022
1287
  CHAIN_LANGUAGES.has(ref.language) &&
1023
1288
  CHAIN_SHAPE.test(ref.referenceName)) {
1024
- this.deferredChainRefs.push(ref);
1289
+ this.deferReference(ref, this.deferredChainRefs);
1025
1290
  }
1026
1291
  else if (
1027
1292
  // PHP `$this->prop->method()` (encoded `this->prop.method`): its method
@@ -1030,7 +1295,7 @@ class ReferenceResolver {
1030
1295
  ref.referenceKind === 'calls' &&
1031
1296
  ref.language === 'php' &&
1032
1297
  PHP_PROP_SHAPE.test(ref.referenceName)) {
1033
- this.deferredChainRefs.push(ref);
1298
+ this.deferReference(ref, this.deferredChainRefs);
1034
1299
  }
1035
1300
  return null;
1036
1301
  }
@@ -1041,18 +1306,19 @@ class ReferenceResolver {
1041
1306
  * Create edges from resolved references
1042
1307
  */
1043
1308
  createEdges(resolved) {
1044
- return resolved.map((ref) => {
1309
+ return resolved.flatMap((ref) => {
1045
1310
  // `function_ref` (#756) is internal-only: it persists as a `references`
1046
1311
  // edge (the registration site depends on the callback), distinguishable
1047
1312
  // by metadata.resolvedBy === 'function-ref'. callers/impact already
1048
1313
  // traverse `references`, so registration sites surface with no
1049
1314
  // graph-layer changes.
1050
- let kind = ref.original.referenceKind === 'function_ref' ? 'references' : ref.original.referenceKind;
1315
+ let kind = ref.edgeKind ??
1316
+ (ref.original.referenceKind === 'function_ref' ? 'references' : ref.original.referenceKind);
1051
1317
  // Promote "extends" to "implements" when a class/struct targets an interface
1052
1318
  if (kind === 'extends') {
1053
- const targetNode = this.queries.getNodeById(ref.targetNodeId);
1319
+ const targetNode = this.nodeById(ref.targetNodeId);
1054
1320
  if (targetNode && (targetNode.kind === 'interface' || targetNode.kind === 'protocol')) {
1055
- const sourceNode = this.queries.getNodeById(ref.original.fromNodeId);
1321
+ const sourceNode = this.nodeById(ref.original.fromNodeId);
1056
1322
  if (sourceNode && sourceNode.kind !== 'interface' && sourceNode.kind !== 'protocol') {
1057
1323
  kind = 'implements';
1058
1324
  }
@@ -1064,19 +1330,27 @@ class ReferenceResolver {
1064
1330
  // apart from a function call without symbol info, but resolution
1065
1331
  // can: if `Foo` resolves to a class, the call IS an instantiation.
1066
1332
  if (kind === 'calls') {
1067
- const targetNode = this.queries.getNodeById(ref.targetNodeId);
1333
+ const targetNode = this.nodeById(ref.targetNodeId);
1068
1334
  if (targetNode &&
1069
1335
  (targetNode.kind === 'class' || targetNode.kind === 'struct' || targetNode.kind === 'union')) {
1070
1336
  kind = 'instantiates';
1071
1337
  }
1072
1338
  }
1073
- return {
1339
+ // One reference can name several targets — a navigation whose
1340
+ // destination is a conditional reaches every arm. Each becomes its own
1341
+ // edge, sharing this resolution's kind and confidence.
1342
+ const targets = [
1343
+ { targetNodeId: ref.targetNodeId, metadata: ref.metadata },
1344
+ ...(ref.alsoTargets ?? []),
1345
+ ];
1346
+ return targets.map((t) => ({
1074
1347
  source: ref.original.fromNodeId,
1075
- target: ref.targetNodeId,
1348
+ target: t.targetNodeId,
1076
1349
  kind,
1077
1350
  line: ref.original.line,
1078
1351
  column: ref.original.column,
1079
1352
  metadata: {
1353
+ ...(t.metadata ?? {}),
1080
1354
  confidence: ref.confidence,
1081
1355
  resolvedBy: ref.resolvedBy,
1082
1356
  // The ORIGINAL reference text (and kind, when edge-kind promotion
@@ -1097,7 +1371,7 @@ class ReferenceResolver {
1097
1371
  // exactly the edges this feature added.
1098
1372
  ...(ref.original.referenceKind === 'function_ref' ? { fnRef: true } : {}),
1099
1373
  },
1100
- };
1374
+ }));
1101
1375
  });
1102
1376
  }
1103
1377
  /**
@@ -1146,10 +1420,25 @@ class ReferenceResolver {
1146
1420
  }
1147
1421
  return { byRowId, legacyKeys };
1148
1422
  }
1423
+ /** A deferred attempt is unfinished work, not a final failure (#1577). */
1424
+ nonDeferredFailures(unresolved) {
1425
+ return unresolved.filter((ref) => ref.rowId == null || !this.deferredRowIds.has(ref.rowId));
1426
+ }
1427
+ deferReference(ref, queue) {
1428
+ queue.push(ref);
1429
+ if (ref.rowId != null)
1430
+ this.deferredRowIds.add(ref.rowId);
1431
+ }
1149
1432
  /**
1150
1433
  * Resolve and persist edges to database
1151
1434
  */
1152
1435
  resolveAndPersist(unresolvedRefs, onProgress) {
1436
+ const prerequisites = unresolvedRefs.filter(ReferenceResolver.isPrerequisite);
1437
+ if (prerequisites.length > 0 && prerequisites.length < unresolvedRefs.length) {
1438
+ const first = this.resolveAndPersist(prerequisites, (current) => onProgress?.(current, unresolvedRefs.length));
1439
+ const rest = this.resolveAndPersist(unresolvedRefs.filter((ref) => !ReferenceResolver.isPrerequisite(ref)), (current) => onProgress?.(prerequisites.length + current, unresolvedRefs.length));
1440
+ return ReferenceResolver.mergeResults(first, rest);
1441
+ }
1153
1442
  const result = this.resolveAll(unresolvedRefs, onProgress);
1154
1443
  // Create edges from resolved references
1155
1444
  const edges = this.createEdges(result.resolved);
@@ -1173,7 +1462,7 @@ class ReferenceResolver {
1173
1462
  // is still 'pending', so any pending row at rest belongs to an
1174
1463
  // interrupted run and the sweep can key off the pending count.
1175
1464
  if (result.unresolved.length > 0) {
1176
- const { byRowId, legacyKeys } = ReferenceResolver.partitionFailedCleanup(result.unresolved);
1465
+ const { byRowId, legacyKeys } = ReferenceResolver.partitionFailedCleanup(this.nonDeferredFailures(result.unresolved));
1177
1466
  this.queries.markReferencesFailedByRowIds(byRowId);
1178
1467
  this.queries.markReferencesFailed(legacyKeys);
1179
1468
  }
@@ -1189,8 +1478,18 @@ class ReferenceResolver {
1189
1478
  * a large edit lands many popular symbol names at once.
1190
1479
  */
1191
1480
  async resolveAndPersistListYielding(refs) {
1481
+ const prerequisites = refs.filter(ReferenceResolver.isPrerequisite);
1482
+ if (prerequisites.length > 0 && prerequisites.length < refs.length) {
1483
+ const first = await this.resolveAndPersistListYielding(prerequisites);
1484
+ const rest = await this.resolveAndPersistListYielding(refs.filter((ref) => !ReferenceResolver.isPrerequisite(ref)));
1485
+ return ReferenceResolver.mergeResults(first, rest);
1486
+ }
1192
1487
  const maybeYield = (0, cooperative_yield_1.createYielder)();
1193
1488
  const result = await this.resolveBatchYielding(refs, maybeYield);
1489
+ await this.persistResolutionResult(result, maybeYield);
1490
+ return result;
1491
+ }
1492
+ async persistResolutionResult(result, maybeYield) {
1194
1493
  const PERSIST_CHUNK = 1000;
1195
1494
  const edges = this.createEdges(result.resolved);
1196
1495
  for (let i = 0; i < edges.length; i += PERSIST_CHUNK) {
@@ -1206,7 +1505,7 @@ class ReferenceResolver {
1206
1505
  this.queries.deleteSpecificResolvedReferences(resolvedCleanup.legacyKeys.slice(i, i + PERSIST_CHUNK));
1207
1506
  await maybeYield();
1208
1507
  }
1209
- const failedCleanup = ReferenceResolver.partitionFailedCleanup(result.unresolved);
1508
+ const failedCleanup = ReferenceResolver.partitionFailedCleanup(this.nonDeferredFailures(result.unresolved));
1210
1509
  for (let i = 0; i < failedCleanup.byRowId.length; i += PERSIST_CHUNK) {
1211
1510
  this.queries.markReferencesFailedByRowIds(failedCleanup.byRowId.slice(i, i + PERSIST_CHUNK));
1212
1511
  await maybeYield();
@@ -1215,7 +1514,43 @@ class ReferenceResolver {
1215
1514
  this.queries.markReferencesFailed(failedCleanup.legacyKeys.slice(i, i + PERSIST_CHUNK));
1216
1515
  await maybeYield();
1217
1516
  }
1218
- return result;
1517
+ return edges.length;
1518
+ }
1519
+ /** Finalize the durable queue only AFTER its edges have been inserted. */
1520
+ async persistDeferredReferences(deferred, resolved) {
1521
+ for (const ref of deferred)
1522
+ if (ref.rowId != null)
1523
+ this.deferredRowIds.delete(ref.rowId);
1524
+ const matched = new Set(resolved.map((ref) => ref.original));
1525
+ const unresolved = deferred.filter((ref) => !matched.has(ref));
1526
+ const count = await this.persistResolutionResult({
1527
+ resolved,
1528
+ unresolved,
1529
+ stats: { total: deferred.length, resolved: resolved.length, unresolved: unresolved.length, byMethod: {} },
1530
+ }, (0, cooperative_yield_1.createYielder)());
1531
+ if (count > 0)
1532
+ this.clearCaches();
1533
+ return count;
1534
+ }
1535
+ /** Same two phases as the bounded DB reader: persist wiring before calls. */
1536
+ static isPrerequisite(ref) {
1537
+ return ref.referenceKind === 'imports' || ref.referenceKind === 'extends' || ref.referenceKind === 'implements';
1538
+ }
1539
+ static mergeResults(first, rest) {
1540
+ const byMethod = { ...first.stats.byMethod };
1541
+ for (const [method, count] of Object.entries(rest.stats.byMethod)) {
1542
+ byMethod[method] = (byMethod[method] ?? 0) + count;
1543
+ }
1544
+ return {
1545
+ resolved: first.resolved.concat(rest.resolved),
1546
+ unresolved: first.unresolved.concat(rest.unresolved),
1547
+ stats: {
1548
+ total: first.stats.total + rest.stats.total,
1549
+ resolved: first.stats.resolved + rest.stats.resolved,
1550
+ unresolved: first.stats.unresolved + rest.stats.unresolved,
1551
+ byMethod,
1552
+ },
1553
+ };
1219
1554
  }
1220
1555
  /**
1221
1556
  * Second resolution pass for chained static-factory / fluent calls whose
@@ -1259,14 +1594,7 @@ class ReferenceResolver {
1259
1594
  resolved.push(match);
1260
1595
  await maybeYield();
1261
1596
  }
1262
- if (resolved.length === 0)
1263
- return 0;
1264
- const edges = this.createEdges(resolved);
1265
- if (edges.length > 0) {
1266
- this.queries.insertEdges(edges);
1267
- this.clearCaches();
1268
- }
1269
- return edges.length;
1597
+ return this.persistDeferredReferences(deferred, resolved);
1270
1598
  }
1271
1599
  /**
1272
1600
  * Resolve one batch with a yield checkpoint between EVERY ref so the #850
@@ -1418,6 +1746,7 @@ class ReferenceResolver {
1418
1746
  unresolved.push(ref);
1419
1747
  }
1420
1748
  }
1749
+ this.deferredRowIds.clear(); // the admission side now owns both queues
1421
1750
  return {
1422
1751
  resolved,
1423
1752
  unresolved,
@@ -1440,8 +1769,10 @@ class ReferenceResolver {
1440
1769
  * would have.
1441
1770
  */
1442
1771
  appendDeferredFromWorkers(deferredChain, deferredThisMember) {
1443
- this.deferredChainRefs.push(...deferredChain);
1444
- this.deferredThisMemberRefs.push(...deferredThisMember);
1772
+ for (const ref of deferredChain)
1773
+ this.deferReference(ref, this.deferredChainRefs);
1774
+ for (const ref of deferredThisMember)
1775
+ this.deferReference(ref, this.deferredThisMemberRefs);
1445
1776
  }
1446
1777
  /**
1447
1778
  * Resolve and persist in batches to keep memory bounded.
@@ -1460,7 +1791,7 @@ class ReferenceResolver {
1460
1791
  // the valve's timer-driven passive passes stay perpetually partial against
1461
1792
  // the pool's continuous reads, which is how a kernel-scale resolution grew
1462
1793
  // a 22GB WAL on a 4.6GB DB (migration plan §7a.1).
1463
- parallel) {
1794
+ parallel, synthesize = true) {
1464
1795
  // Resolution runs on the indexer's MAIN thread, and the #850 liveness
1465
1796
  // watchdog SIGKILLs a process whose event loop stalls past its window (60s
1466
1797
  // by default). A single dense batch's resolveAll — or the synthesis pass
@@ -1615,8 +1946,26 @@ class ReferenceResolver {
1615
1946
  }
1616
1947
  try {
1617
1948
  try {
1949
+ // Orphans retain interruption/re-extraction order, not clean-index order.
1950
+ // A caller can precede its imports or supertypes by many batches (#1577).
1951
+ // Drain those prerequisites first, then start a fresh keyset cursor over
1952
+ // the remaining kinds. The disjoint filters let us prefetch across the
1953
+ // phase boundary before cleanup without re-reading the current batch.
1954
+ let prerequisites = true;
1955
+ let afterRowId = 0;
1956
+ const readNextBatch = () => {
1957
+ let next = this.queries.getUnresolvedReferencesBatchAfter(afterRowId, batchSize, prerequisites);
1958
+ if (next.length === 0 && prerequisites) {
1959
+ prerequisites = false;
1960
+ afterRowId = 0;
1961
+ next = this.queries.getUnresolvedReferencesBatchAfter(afterRowId, batchSize, prerequisites);
1962
+ }
1963
+ if (next.length > 0)
1964
+ afterRowId = next[next.length - 1].rowId;
1965
+ return next;
1966
+ };
1618
1967
  tLp = Date.now();
1619
- let batch = this.queries.getUnresolvedReferencesBatchAfter(0, batchSize);
1968
+ let batch = readNextBatch();
1620
1969
  lp('read', tLp);
1621
1970
  let inFlight = batch.length > 0 ? beginBatch(batch) : null;
1622
1971
  while (batch.length > 0 && inFlight) {
@@ -1626,7 +1975,7 @@ class ReferenceResolver {
1626
1975
  // enumeration yields the following batch (keyset — OFFSET re-walked the
1627
1976
  // accumulated failed prefix every read, 54.6s at kernel scale, §7a.2).
1628
1977
  tLp = Date.now();
1629
- const nextBatch = this.queries.getUnresolvedReferencesBatchAfter(batch[batch.length - 1].rowId, batchSize);
1978
+ const nextBatch = readNextBatch();
1630
1979
  lp('read', tLp);
1631
1980
  const tBatch = Date.now();
1632
1981
  const result = await settleBatch(inFlight, batch);
@@ -1647,7 +1996,7 @@ class ReferenceResolver {
1647
1996
  adaptiveSeqRefs += batch.length;
1648
1997
  const remaining = total - processed - batch.length;
1649
1998
  const projectedMs = (adaptiveSeqMs / Math.max(1, adaptiveSeqRefs)) * Math.max(0, remaining);
1650
- if (projectedMs >= ADAPTIVE_ENGAGE_SETTLE_MS) {
1999
+ if ((0, resolver_pool_1.shouldEngageAdaptively)(projectedMs, remaining, ADAPTIVE_ENGAGE_SETTLE_MS)) {
1651
2000
  if (process.env.CODEGRAPH_SYNTH_TIMINGS) {
1652
2001
  console.error(`[pool-timing] adaptive engage: projected ${Math.round(projectedMs)}ms sequential settle over ${remaining} remaining refs`);
1653
2002
  }
@@ -1699,27 +2048,36 @@ class ReferenceResolver {
1699
2048
  // the remainder idempotently on the next run/sweep (#1187).
1700
2049
  const PERSIST_CHUNK = 1000;
1701
2050
  const tPersist = Date.now();
1702
- // Persist edges BEFORE fanning out the next batch: later batches read
1703
- // this batch's edges — resolveMethodOnType walks supertype chains over
1704
- // `extends`/`implements` edges that earlier batches resolved, so a
1705
- // receiver typed as a subclass only reaches a method declared on its
1706
- // base class if those edges are visible. (Validated on dubbo: fanning
1707
- // out first downgraded exactly those supertype-method resolutions from
1708
- // the 0.9 typed-receiver path to the 0.65 word-overlap fallback.)
2051
+ // A batch that made `extends`/`implements` edges persists them BEFORE
2052
+ // fanning out the next batch: later batches read them —
2053
+ // resolveMethodOnType walks supertype chains over edges that earlier
2054
+ // batches resolved, so a receiver typed as a subclass only reaches a
2055
+ // method declared on its base class if those edges are visible.
2056
+ // (Validated on dubbo: fanning out first downgraded exactly those
2057
+ // supertype-method resolutions from the 0.9 typed-receiver path to the
2058
+ // 0.65 word-overlap fallback.) They are the only edges resolution reads
2059
+ // (RESOLUTION_READ_EDGE_KINDS), so a batch that made none — every batch
2060
+ // after the prerequisite phase readNextBatch drains first — fans the
2061
+ // next batch out now and inserts while it resolves: the same writes in
2062
+ // the same order, and nothing the workers read differs.
1709
2063
  tLp = Date.now();
1710
2064
  const edges = this.createEdges(result.resolved);
1711
2065
  lp('createEdges', tLp);
2066
+ const readEdge = edges.some((e) => RESOLUTION_READ_EDGE_KINDS.includes(e.kind));
2067
+ let nextInFlight = !readEdge && nextBatch.length > 0 ? beginBatch(nextBatch) : null;
1712
2068
  tLp = Date.now();
1713
2069
  for (let i = 0; i < edges.length; i += PERSIST_CHUNK) {
1714
2070
  this.queries.insertEdges(edges.slice(i, i + PERSIST_CHUNK));
1715
2071
  await maybeYield();
1716
2072
  }
1717
2073
  lp('insertEdges', tLp);
1718
- // NOW fan the next batch out — workers see exactly the edge state the
1719
- // sequential baseline would (every batch ≤ this one committed), while
1720
- // the main thread spends the REST of the persist (ref deletes + failed
1721
- // parking below) overlapped with their resolution — the double-buffer.
1722
- const nextInFlight = nextBatch.length > 0 ? beginBatch(nextBatch) : null;
2074
+ // NOW fan the next batch out (if not already) — workers see exactly the
2075
+ // edge state the sequential baseline would (every batch ≤ this one
2076
+ // committed), while the main thread spends the REST of the persist (ref
2077
+ // deletes + failed parking below) overlapped with their resolution —
2078
+ // the double-buffer.
2079
+ if (!nextInFlight && nextBatch.length > 0)
2080
+ nextInFlight = beginBatch(nextBatch);
1723
2081
  // Clean up resolved refs so they don't appear in the next batch —
1724
2082
  // by row id, so a same-key sibling ref in a LATER batch (same caller
1725
2083
  // calling the same callee at another line) is left pending for its own
@@ -1741,7 +2099,9 @@ class ReferenceResolver {
1741
2099
  // only see pending rows) but stay retryable when a later sync adds a
1742
2100
  // symbol that could satisfy them (#1240).
1743
2101
  tLp = Date.now();
1744
- const failedCleanup = ReferenceResolver.partitionFailedCleanup(result.unresolved);
2102
+ const failures = this.nonDeferredFailures(result.unresolved);
2103
+ const deferredCount = result.unresolved.length - failures.length;
2104
+ const failedCleanup = ReferenceResolver.partitionFailedCleanup(failures);
1745
2105
  for (let i = 0; i < failedCleanup.byRowId.length; i += PERSIST_CHUNK) {
1746
2106
  removedThisBatch += this.queries.markReferencesFailedByRowIds(failedCleanup.byRowId.slice(i, i + PERSIST_CHUNK));
1747
2107
  await maybeYield();
@@ -1771,17 +2131,11 @@ class ReferenceResolver {
1771
2131
  // first 5000 refs are all external/stdlib calls, resolution stopped at
1772
2132
  // batch one and left the rest of the table as permanent orphans (#1187).
1773
2133
  // The count-based guard below catches the true no-progress case.
1774
- // Non-progress guard (defense-in-depth). Each iteration enumerates from
1775
- // the head of the pending set, so the PENDING population MUST shrink
1776
- // every iteration — resolved refs are deleted and unresolvable ones are
1777
- // marked failed above, and both leave the pending set the batch reader
1778
- // sees. If it didn't shrink, a resolver returned a match whose
1779
- // `original.referenceName` differs from the stored row, so the keyed
1780
- // delete/update no-ops, and we'd re-read + re-resolve + re-insert the
1781
- // same rows forever (the runaway that grew a 99-file repo to 5M edges /
1782
- // 1.4 GB before the Go-fallback fix). Stop rather than grow the graph
1783
- // without bound. (An in-flight prefetched batch is abandoned unsettled —
1784
- // fan-out has no side effects until settleBatch appends its results.)
2134
+ // Non-progress guard (defense-in-depth). Ordinary attempts must leave
2135
+ // the pending set; a mismatched original reference can make legacy-key
2136
+ // cleanup a no-op. Keep the guard against that broken persistence even
2137
+ // though keyset pagination now advances independently of row cleanup.
2138
+ // An abandoned prefetched batch has no side effects until settleBatch.
1785
2139
  // Non-progress signal, now O(1): `changes` summed across this batch's
1786
2140
  // deletes + failed-parks is the DIRECT evidence the guard's old count
1787
2141
  // diff inferred — a resolver returning a mismatched name makes the keyed
@@ -1791,7 +2145,9 @@ class ReferenceResolver {
1791
2145
  // runs only on the suspicious path (claimed-work batch removed nothing —
1792
2146
  // e.g. every row was a sibling a legacy-key sweep already consumed),
1793
2147
  // where it arbitrates stop-vs-continue exactly as before.
1794
- if (removedThisBatch <= 0 && batch.length > 0) {
2148
+ // Deferred refs legitimately remain pending for the post-pass. The
2149
+ // keyset cursor advances past them; they must not trigger this guard.
2150
+ if (removedThisBatch + deferredCount <= 0 && batch.length > 0) {
1795
2151
  tLp = Date.now();
1796
2152
  const remaining = this.queries.getUnresolvedReferencesCount();
1797
2153
  lp('countGuard', tLp);
@@ -1828,6 +2184,21 @@ class ReferenceResolver {
1828
2184
  await bp;
1829
2185
  }
1830
2186
  }
2187
+ // Indexes the bulk-edge window's end deferred: built once, while the pool
2188
+ // is busy with synthesis when it is, and in any case before this returns.
2189
+ let deferredBuilt = !bulkEdgesActive || !parallel?.bulkEdgeLoad?.deferred;
2190
+ const buildDeferredIndexes = () => {
2191
+ if (deferredBuilt)
2192
+ return;
2193
+ deferredBuilt = true;
2194
+ const tDeferred = Date.now();
2195
+ try {
2196
+ parallel.bulkEdgeLoad.deferred();
2197
+ }
2198
+ catch { /* healed by schema.sql on the next open, like a crash in the window */ }
2199
+ if (process.env.CODEGRAPH_SYNTH_TIMINGS)
2200
+ console.error(`[phase-timing] deferred-edge-index: ${Date.now() - tDeferred}ms`);
2201
+ };
1831
2202
  // Dynamic-edge synthesis: now that all base `calls` edges are persisted,
1832
2203
  // synthesize observer/callback dispatch edges (dispatcher → registered
1833
2204
  // callbacks) that static parsing leaves out. Best-effort — never fail the
@@ -1837,11 +2208,13 @@ class ReferenceResolver {
1837
2208
  // loop. See docs/design/callback-edge-synthesis.md.
1838
2209
  const tSynth = Date.now();
1839
2210
  try {
1840
- aggregateStats.byMethod['callback-synthesis'] = await (0, callback_synthesizer_1.synthesizeCallbackEdges)(this.queries, this.context, onSynthesisProgress, pool, parallel?.backpressure);
2211
+ if (synthesize)
2212
+ aggregateStats.byMethod['callback-synthesis'] = await (0, callback_synthesizer_1.synthesizeCallbackEdges)(this.queries, this.context, onSynthesisProgress, pool, parallel?.backpressure, buildDeferredIndexes);
1841
2213
  }
1842
2214
  catch {
1843
2215
  // synthesis is additive and optional; ignore failures
1844
2216
  }
2217
+ buildDeferredIndexes();
1845
2218
  if (process.env.CODEGRAPH_SYNTH_TIMINGS)
1846
2219
  console.error(`[phase-timing] callback-synthesis: ${Date.now() - tSynth}ms`);
1847
2220
  }
@@ -1860,21 +2233,75 @@ class ReferenceResolver {
1860
2233
  stats: aggregateStats,
1861
2234
  };
1862
2235
  }
2236
+ /** Replace synthesis only after every base-resolution pass has finished. */
2237
+ async refreshSynthesis(dbPath, onProgress, backpressure) {
2238
+ this.clearCaches();
2239
+ const stage = new synthesis_stage_1.SynthesisStage(dbPath);
2240
+ try {
2241
+ const fresh = new ReferenceResolver(this.projectRoot, stage.queries);
2242
+ const count = await (0, callback_synthesizer_1.synthesizeCallbackEdges)(stage.queries, fresh.context, onProgress, null, backpressure);
2243
+ await stage.publish(backpressure);
2244
+ return count;
2245
+ }
2246
+ finally {
2247
+ stage.close();
2248
+ this.clearCaches();
2249
+ }
2250
+ }
1863
2251
  /**
1864
2252
  * Get detected frameworks
1865
2253
  */
1866
2254
  getDetectedFrameworks() {
1867
2255
  return this.frameworks.map((f) => f.name);
1868
2256
  }
2257
+ /**
2258
+ * True when `receiver` is a local name bound by an import that resolves to a
2259
+ * file IN THIS PROJECT — the only case where letting a python
2260
+ * built-in-method name through the filter is safe (#1681).
2261
+ *
2262
+ * Asking only whether SOME import bound the local name is not enough: every
2263
+ * import produces a mapping, stdlib and PyPI included, so that would also be
2264
+ * true for `os`, `requests`, `np`. Opening the filter for them lets
2265
+ * resolveViaImport find no project file, fall through to bare-name matching,
2266
+ * and bind `os.remove(p)` to whatever project method happens to be named
2267
+ * `remove` — reintroducing, through its own escape hatch, the fabricated-edge
2268
+ * class this filter exists to prevent.
2269
+ *
2270
+ * Resolving the specifier is the same question resolveViaImport will ask
2271
+ * next, so a receiver that passes here is one the qualified path can actually
2272
+ * serve; anything else stays a silent miss rather than a wrong edge.
2273
+ */
2274
+ isPythonProjectModule(ref, receiver) {
2275
+ for (const imp of this.context.getImportMappings(ref.filePath, ref.language)) {
2276
+ if (imp.localName !== receiver)
2277
+ continue;
2278
+ // `import pkg.mod` / `import pkg.mod as m` binds the module `source`
2279
+ // names. `from pkg import mod` binds `pkg.mod`, and `from . import mod`
2280
+ // binds `.mod` — join without doubling the dot that makes `.` mean the
2281
+ // current package.
2282
+ const specifier = imp.isNamespace
2283
+ ? imp.source
2284
+ : imp.source.endsWith('.')
2285
+ ? `${imp.source}${imp.exportedName}`
2286
+ : `${imp.source}.${imp.exportedName}`;
2287
+ if ((0, import_resolver_1.resolveImportPath)(specifier, ref.filePath, ref.language, this.context)) {
2288
+ return true;
2289
+ }
2290
+ }
2291
+ return false;
2292
+ }
1869
2293
  /**
1870
2294
  * Check if reference is to a built-in or external symbol
1871
2295
  */
1872
2296
  isBuiltInOrExternal(ref) {
1873
2297
  const name = ref.referenceName;
1874
2298
  const isJsTs = ref.language === 'typescript' || ref.language === 'javascript'
1875
- || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'arkts';
1876
- // JavaScript/TypeScript built-ins
1877
- if (isJsTs && JS_BUILT_INS.has(name)) {
2299
+ || ref.language === 'tsx' || ref.language === 'jsx' || ref.language === 'arkts'
2300
+ || ref.language === 'vue' || ref.language === 'svelte' || ref.language === 'astro';
2301
+ // JavaScript/TypeScript built-ins — unless the file imports its own
2302
+ // binding of that name (`import Map from './Map.svelte'`).
2303
+ if (isJsTs && js_builtins_1.JS_BUILT_INS.has(name) &&
2304
+ !this.context.getImportMappings(ref.filePath, ref.language).some((m) => m.localName === name)) {
1878
2305
  return true;
1879
2306
  }
1880
2307
  // ArkTS resource-reference intrinsics — `$r('app.string.x')` /
@@ -1908,10 +2335,27 @@ class ReferenceResolver {
1908
2335
  }
1909
2336
  // Filter built-in methods on non-class receivers
1910
2337
  // (e.g., items.append where items is a local list variable)
1911
- // But allow if the capitalized receiver matches a known codebase class
2338
+ // But allow if the capitalized receiver matches a known codebase class,
2339
+ // OR the receiver is itself an imported project module — a module can
2340
+ // export a top-level function sharing a common collection-method name
2341
+ // (`ledger.append`, `from . import ledger`), and that call is a real
2342
+ // project dependency, not `list.append` (#1681). Without this, the
2343
+ // qualified ref never reaches resolveViaImport / resolvePythonModuleMember.
1912
2344
  if (PYTHON_BUILT_IN_METHODS.has(method)) {
2345
+ // A module-scope collection binding is stronger evidence than a
2346
+ // coincidentally matching class name (#1652). Only use this file's
2347
+ // binding: an unrelated module may reuse the receiver for a collection.
2348
+ const isCollection = this.context.getNodesByName(receiver).some((node) => node.language === 'python' && node.filePath === ref.filePath &&
2349
+ (node.kind === 'variable' || node.kind === 'constant') &&
2350
+ node.qualifiedName === receiver &&
2351
+ /^=\s*(?:[\[{]|(?:dict|list|set|tuple|frozenset)\s*\(|\(\s*\)|\([^()]*,)/.test(node.signature ?? ''));
2352
+ if (isCollection)
2353
+ return true;
1913
2354
  const capitalized = receiver.charAt(0).toUpperCase() + receiver.slice(1);
1914
- if (!this.knownNames?.has(capitalized)) {
2355
+ const isKnownClass = this.context.getNodesByName(capitalized).some((node) => node.language === 'python' &&
2356
+ (node.kind === 'class' || node.kind === 'struct' || node.kind === 'interface'));
2357
+ const isProjectModule = !isKnownClass && this.isPythonProjectModule(ref, receiver);
2358
+ if (!isKnownClass && !isProjectModule) {
1915
2359
  return true;
1916
2360
  }
1917
2361
  }
@@ -1919,9 +2363,8 @@ class ReferenceResolver {
1919
2363
  // A bare name colliding with a builtin method (index, get, update, count…)
1920
2364
  // is only a builtin when NOTHING in the codebase declares it. A declared
1921
2365
  // symbol with that exact name — e.g. a Flask/FastAPI view `def index()` or
1922
- // `def get()` — is a real reference target. Mirrors the knownNames guard on
1923
- // the dotted branch above; without it, every handler named after a builtin
1924
- // method silently loses its route→handler edge.
2366
+ // `def get()` — is a real reference target. Without this guard, every
2367
+ // handler named after a builtin method silently loses its route→handler edge.
1925
2368
  if (PYTHON_BUILT_IN_METHODS.has(name) && !this.knownNames?.has(name)) {
1926
2369
  return true;
1927
2370
  }
@@ -1972,28 +2415,16 @@ class ReferenceResolver {
1972
2415
  * Get file path from node ID
1973
2416
  */
1974
2417
  getFilePathFromNodeId(nodeId) {
1975
- const node = this.queries.getNodeById(nodeId);
2418
+ const node = this.nodeById(nodeId);
1976
2419
  return node?.filePath || '';
1977
2420
  }
1978
2421
  /**
1979
2422
  * Get language from node ID
1980
2423
  */
1981
2424
  getLanguageFromNodeId(nodeId) {
1982
- const node = this.queries.getNodeById(nodeId);
2425
+ const node = this.nodeById(nodeId);
1983
2426
  return node?.language || 'unknown';
1984
2427
  }
1985
- /**
1986
- * Drop an import/name-strategy resolution that crosses a language family.
1987
- * Two regimes (mirrors `applyLanguageGate`'s candidate filter):
1988
- * - `references` (type usage): STRICT — a `Type.member` static read names a
1989
- * same-family type, never a coincidentally same-named symbol in another
1990
- * language. Drops any non-same-family target.
1991
- * - `imports` (import binding / `#include`): both-known — a C++ `#include
1992
- * "X.h"` must not resolve to a same-named ObjC header on another platform
1993
- * (basename collision), but a singleton-family / SFC language (`vue` →
1994
- * `.ts`) importing across is left alone.
1995
- * Applies to the import (strategy 2) + name-match (strategy 3) results.
1996
- */
1997
2428
  /**
1998
2429
  * Collect the `@using` namespaces in scope for a `.razor`/`.cshtml` file: its
1999
2430
  * own `@using` directives plus every `_Imports.razor` from the file's folder up
@@ -2151,7 +2582,7 @@ class ReferenceResolver {
2151
2582
  const member = ref.referenceName.slice('this.'.length);
2152
2583
  if (!member)
2153
2584
  return null;
2154
- const fromNode = this.queries.getNodeById(ref.fromNodeId);
2585
+ const fromNode = this.nodeById(ref.fromNodeId);
2155
2586
  if (!fromNode)
2156
2587
  return null;
2157
2588
  // A hook declared at class-body level (Ruby `before_action :authenticate`)
@@ -2176,7 +2607,7 @@ class ReferenceResolver {
2176
2607
  // Not on the class itself — possibly INHERITED. implements/extends
2177
2608
  // edges don't exist yet in this pass, so retry in the supertype pass
2178
2609
  // (resolveDeferredThisMemberRefs) instead of giving up.
2179
- this.deferredThisMemberRefs.push(ref);
2610
+ this.deferReference(ref, this.deferredThisMemberRefs);
2180
2611
  return null;
2181
2612
  }
2182
2613
  const target = candidates.reduce((a, b) => (a.startLine <= b.startLine ? a : b));
@@ -2207,10 +2638,41 @@ class ReferenceResolver {
2207
2638
  // periodically so the #850 liveness watchdog heartbeat can fire (#1091).
2208
2639
  const maybeYield = (0, cooperative_yield_1.createYielder)();
2209
2640
  const resolved = [];
2641
+ // Refs share supertypes (every `this.dispose` walks the same chain), and
2642
+ // nothing is written until the loop ends: read each type's supertype
2643
+ // edges, and each supertype's callable members by name, once.
2644
+ const supertypeEdges = new Map();
2645
+ const callableMembers = new Map();
2646
+ const supertypesOf = (id) => {
2647
+ let edges = supertypeEdges.get(id);
2648
+ if (!edges) {
2649
+ edges = this.queries.getOutgoingEdges(id, ['implements', 'extends']);
2650
+ supertypeEdges.set(id, edges);
2651
+ }
2652
+ return edges;
2653
+ };
2654
+ const callableMembersOf = (id) => {
2655
+ let byName = callableMembers.get(id);
2656
+ if (!byName) {
2657
+ byName = new Map();
2658
+ for (const c of this.queries.getOutgoingEdges(id, ['contains'])) {
2659
+ const m = this.nodeById(c.target);
2660
+ if (!m || (m.kind !== 'function' && m.kind !== 'method'))
2661
+ continue;
2662
+ const list = byName.get(m.name);
2663
+ if (list)
2664
+ list.push(m);
2665
+ else
2666
+ byName.set(m.name, [m]);
2667
+ }
2668
+ callableMembers.set(id, byName);
2669
+ }
2670
+ return byName;
2671
+ };
2210
2672
  for (const ref of deferred) {
2211
2673
  await maybeYield();
2212
2674
  const member = ref.referenceName.slice('this.'.length);
2213
- const fromNode = this.queries.getNodeById(ref.fromNodeId);
2675
+ const fromNode = this.nodeById(ref.fromNodeId);
2214
2676
  if (!fromNode || !member)
2215
2677
  continue;
2216
2678
  // Class-body-level hooks (Ruby) attribute to the CLASS node itself.
@@ -2250,24 +2712,18 @@ class ReferenceResolver {
2250
2712
  for (let depth = 0; depth < 5 && frontierNodes.length > 0 && !target; depth++) {
2251
2713
  const next = [];
2252
2714
  for (const typeNode of frontierNodes) {
2253
- for (const edge of this.queries.getOutgoingEdges(typeNode.id, ['implements', 'extends'])) {
2254
- const superNode = this.queries.getNodeById(edge.target);
2715
+ for (const edge of supertypesOf(typeNode.id)) {
2716
+ const superNode = this.nodeById(edge.target);
2255
2717
  if (!superNode || seenNodes.has(superNode.id))
2256
2718
  continue;
2257
2719
  seenNodes.add(superNode.id);
2258
2720
  if (!SUPERTYPE_BEARING_KINDS.has(superNode.kind))
2259
2721
  continue;
2260
2722
  // Member lookup anchored on the supertype's contains edges.
2261
- for (const c of this.queries.getOutgoingEdges(superNode.id, ['contains'])) {
2262
- const m = this.queries.getNodeById(c.target);
2263
- if (m &&
2264
- m.name === member &&
2265
- (m.kind === 'function' || m.kind === 'method') &&
2266
- (0, name_matcher_1.sameLanguageFamily)(m.language, ref.language)) {
2267
- target = m;
2268
- break;
2269
- }
2270
- }
2723
+ target =
2724
+ callableMembersOf(superNode.id)
2725
+ .get(member)
2726
+ ?.find((m) => (0, name_matcher_1.sameLanguageFamily)(m.language, ref.language)) ?? null;
2271
2727
  if (target)
2272
2728
  break;
2273
2729
  next.push(superNode);
@@ -2286,47 +2742,208 @@ class ReferenceResolver {
2286
2742
  });
2287
2743
  }
2288
2744
  }
2289
- if (resolved.length === 0)
2290
- return 0;
2291
- const edges = this.createEdges(resolved);
2292
- if (edges.length > 0) {
2293
- this.queries.insertEdges(edges);
2294
- this.clearCaches();
2295
- }
2296
- return edges.length;
2745
+ return this.persistDeferredReferences(deferred, resolved);
2297
2746
  }
2298
- gateLanguage(result, ref) {
2747
+ /**
2748
+ * Drop a resolution whose target cannot be what the reference names.
2749
+ * Applied at the `resolveOne` seam so it covers every strategy uniformly —
2750
+ * framework, import, name-match, chain, CFML component path.
2751
+ *
2752
+ * For `imports`: the target must be importable. A member that only exists
2753
+ * inside a type never is.
2754
+ *
2755
+ * For `extends`/`implements`, it cannot be describing a real supertype when:
2756
+ *
2757
+ * 1. The target's kind can never be a supertype (an enum member, a method,
2758
+ * a variable). `matchByExactName` additionally narrows its candidate
2759
+ * pool by the same set, so a legitimate supertype outranks a same-named
2760
+ * non-type rather than merely losing its edge.
2761
+ * 2. The name is imported from outside the repo, so NO local node is the
2762
+ * referent. Without this, filtering by kind alone just relocates the
2763
+ * false edge onto the next same-named local type.
2764
+ *
2765
+ * One exception to (1): a TypeScript VALUE that shares its name with a type
2766
+ * in the same file. `export const IFoo = createDecorator<IFoo>('foo')` beside
2767
+ * `export interface IFoo` is how VS Code declares every service, and an
2768
+ * import of `IFoo` resolves to the file with both — a strategy that takes the
2769
+ * first export of that name gets the value. The strategy found the right
2770
+ * file and name; the type declared there is the supertype, so the edge moves
2771
+ * to it rather than being dropped (dropping it lost ~900 `implements` edges
2772
+ * on vscode).
2773
+ *
2774
+ * Otherwise this only ever REMOVES an edge, never adds one. A dropped ref
2775
+ * stays in `unresolved_refs` as `failed`, which is the honest record for a
2776
+ * supertype that lives outside the repo — silent beats wrong.
2777
+ */
2778
+ gateTargetKind(result, ref) {
2299
2779
  if (!result)
2300
2780
  return result;
2301
- const tgt = this.getLanguageFromNodeId(result.targetNodeId);
2302
- if (!tgt || !ref.language)
2781
+ // A `#define` is a value, never a callee (#1838): a macro defined only in
2782
+ // an unrelated file is not what `NAME(x)` here expands to either.
2783
+ if (ref.referenceKind === 'calls') {
2784
+ const target = this.nodeById(result.targetNodeId);
2785
+ if (target?.kind === 'constant' && types_1.CPP_DEFINE_SIGNATURE.test(target.signature ?? ''))
2786
+ return null;
2787
+ }
2788
+ // An `imports` reference names something importable — never a member that
2789
+ // only exists inside a type.
2790
+ if (ref.referenceKind === 'imports') {
2791
+ const target = this.nodeById(result.targetNodeId);
2792
+ return target && !(0, types_1.isImportableKind)(target.kind) ? null : result;
2793
+ }
2794
+ if (!(0, types_1.isInheritanceRef)(ref))
2303
2795
  return result;
2304
- if ((ref.referenceKind === 'references' || ref.referenceKind === 'function_ref') && !(0, name_matcher_1.sameLanguageFamily)(tgt, ref.language))
2305
- return null;
2306
- if (ref.referenceKind === 'imports' && (0, name_matcher_1.crossesKnownFamily)(tgt, ref.language))
2796
+ const target = this.nodeById(result.targetNodeId);
2797
+ if (target && !(0, types_1.isSupertypeTarget)(target)) {
2798
+ const type = this.sameNamedTypeOfValue(target);
2799
+ if (!type)
2800
+ return null;
2801
+ result = { ...result, targetNodeId: type.id };
2802
+ }
2803
+ if ((0, import_resolver_1.isBoundToOutOfRepoImport)(ref, this.context))
2307
2804
  return null;
2308
2805
  return result;
2309
2806
  }
2310
2807
  /**
2311
- * Drop a FRAMEWORK-strategy resolution that crosses two *known* language
2312
- * families for a type-usage (`references`) or import-binding (`imports`)
2313
- * edge. The framework strategy is intentionally ungated for cross-language
2314
- * bridges, but those legitimate bridges are either `calls` edges (RN/Expo
2315
- * JS → native) or config↔code edges whose config side (`yaml`/`blade`/…) is
2316
- * not a known programming-language family. A `references`/`imports` edge
2317
- * between two *known* families is always a coincidental name collision — the
2318
- * React/Svelte/Vue PascalCase component resolvers name-match `getNodesByName`
2319
- * without a language check, so a TS `<TestRunner>` ref happily matched a
2320
- * Kotlin `class TestRunner`. Gating only the both-known-cross-family case
2321
- * lets config bridges and `calls` bridges through untouched.
2808
+ * `super.didMoveToWindow()` inside an override of `didMoveToWindow` calls
2809
+ * the PARENT's implementation, never the method making the call. Extraction
2810
+ * keeps a `super` call under the bare method name, so every strategy found
2811
+ * the enclosing method itself: one expo-camera view had eleven of its
2812
+ * overrides "calling" themselves. The parent's method is usually a
2813
+ * framework's (UIKit, Android, React); a self-edge is never it. Real
2814
+ * recursion keeps its edge — only a call written through `super` / `base`
2815
+ * (C#) / `[super …]` (Objective-C) / `parent::` (PHP) / `super().` (Python)
2816
+ * is declined.
2817
+ */
2818
+ gateSuperSelfCall(result, ref) {
2819
+ if (!result || ref.referenceKind !== 'calls' || result.targetNodeId !== ref.fromNodeId)
2820
+ return result;
2821
+ const name = ref.referenceName.slice(Math.max(ref.referenceName.lastIndexOf('.'), ref.referenceName.lastIndexOf(':')) + 1);
2822
+ if (!/^[A-Za-z_$][\w$]*$/.test(name))
2823
+ return result;
2824
+ const line = (this.context.getFileLines?.(ref.filePath) ?? this.context.readFile(ref.filePath)?.split(/\r?\n/))?.[ref.line - 1];
2825
+ if (!line)
2826
+ return result;
2827
+ const escaped = name.replace(/\$/g, '\\$');
2828
+ const viaSuper = new RegExp(String.raw `(?:\b(?:super|base)\s*(?:\(\s*(?:[\w.]+\s*,\s*\w+)?\s*\))?\s*\??\.\s*|\[\s*super\s+|\bparent\s*::\s*)` + escaped + String.raw `\b`);
2829
+ return viaSuper.test(line) ? null : result;
2830
+ }
2831
+ /**
2832
+ * A bare Rust name reaches only what is in scope — every strategy's result,
2833
+ * a framework resolver's `Ok(x)` → `struct Ok` construction included (see
2834
+ * isRustNameInScope).
2835
+ */
2836
+ gateRustScope(result, ref) {
2837
+ if (!result || ref.language !== 'rust' || !/^[A-Za-z_]\w*$/.test(ref.referenceName))
2838
+ return result;
2839
+ const target = this.nodeById(result.targetNodeId);
2840
+ return target && !(0, name_matcher_1.isRustNameInScope)(target, ref, this.context) ? null : result;
2841
+ }
2842
+ /** The repository's own package name, from its root package.json; null without one. */
2843
+ /** Per directory: the package names its package.json and every enclosing one own and depend on. */
2844
+ manifestScopes = new Map();
2845
+ /**
2846
+ * Is `source` a package from outside the repository? Only when the importing
2847
+ * file's package.json (or an enclosing one) declares it, or it is a Node
2848
+ * built-in or a runtime's virtual module. A specifier nothing declares is
2849
+ * an alias this resolver does not know — SvelteKit's `$lib/…`, Nuxt's
2850
+ * `~/…`, a nested app's own `@/…` — and stays the project's.
2851
+ */
2852
+ isDeclaredOutsidePackage(source, fromFile) {
2853
+ // Deno's standard library is `@std/…` from JSR.
2854
+ if (/^(?:node|bun|jsr|npm|https?):/.test(source) || source.startsWith('@std/') || NODE_BUILTINS.has(source))
2855
+ return true;
2856
+ const name = source.startsWith('@') ? source.split('/').slice(0, 2).join('/') : source.split('/')[0];
2857
+ const normalized = fromFile.replace(/\\/g, '/');
2858
+ const scope = this.manifestScope(normalized.includes('/') ? normalized.slice(0, normalized.lastIndexOf('/')) : '');
2859
+ if (scope.own.has(name))
2860
+ return false;
2861
+ if (scope.deps.has(name))
2862
+ return true;
2863
+ // SvelteKit's `$app/…` and Astro's `astro:…` belong to the framework —
2864
+ // unless this repository is that framework.
2865
+ const provider = source.startsWith('astro:') ? 'astro' : /^\$(?:app|env|service-worker)(?:\/|$)/.test(source) ? '@sveltejs/kit' : null;
2866
+ return provider !== null && !scope.own.has(provider) && !this.context.getWorkspacePackages?.()?.byName.has(provider);
2867
+ }
2868
+ manifestScope(dir) {
2869
+ const memo = this.manifestScopes.get(dir);
2870
+ if (memo)
2871
+ return memo;
2872
+ const parent = dir === '' ? null : this.manifestScope(dir.includes('/') ? dir.slice(0, dir.lastIndexOf('/')) : '');
2873
+ let scope = parent ?? { own: new Set(), deps: new Set() };
2874
+ try {
2875
+ const json = JSON.parse(this.context.readFile(dir ? `${dir}/package.json` : 'package.json') ?? 'null');
2876
+ if (json && typeof json === 'object') {
2877
+ scope = { own: new Set(scope.own), deps: new Set(scope.deps) };
2878
+ if (typeof json.name === 'string' && json.name.length > 0)
2879
+ scope.own.add(json.name);
2880
+ for (const field of ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies']) {
2881
+ const deps = json[field];
2882
+ if (!deps || typeof deps !== 'object')
2883
+ continue;
2884
+ for (const [dep, version] of Object.entries(deps)) {
2885
+ // `workspace:*`, `file:../shared`, `link:…`: a package in this repository.
2886
+ if (typeof version === 'string' && /^(?:workspace|file|link|portal):/.test(version))
2887
+ scope.own.add(dep);
2888
+ else
2889
+ scope.deps.add(dep);
2890
+ }
2891
+ }
2892
+ }
2893
+ }
2894
+ catch { /* no or unreadable package.json */ }
2895
+ // A Deno import map names packages the same way — an entry that maps to a
2896
+ // registry or a URL, not one that maps to a path in the repository.
2897
+ for (const file of ['deno.json', 'deno.jsonc']) {
2898
+ const raw = this.context.readFile(dir ? `${dir}/${file}` : file);
2899
+ if (!raw)
2900
+ continue;
2901
+ const json = (0, jsonc_parser_1.parse)(raw);
2902
+ const imports = json && typeof json === 'object' ? json.imports : undefined;
2903
+ if (!imports || typeof imports !== 'object')
2904
+ continue;
2905
+ for (const [key, target] of Object.entries(imports)) {
2906
+ if (typeof target !== 'string' || !/^(?:jsr|npm|https?):/.test(target))
2907
+ continue;
2908
+ if (scope === parent)
2909
+ scope = { own: new Set(scope.own), deps: new Set(scope.deps) };
2910
+ scope.deps.add(key.replace(/\/$/, ''));
2911
+ }
2912
+ }
2913
+ this.manifestScopes.set(dir, scope);
2914
+ return scope;
2915
+ }
2916
+ /** The one supertype-kind node a TypeScript value shares its name and file with. */
2917
+ sameNamedTypeOfValue(value) {
2918
+ if (value.kind !== 'constant' && value.kind !== 'variable')
2919
+ return null;
2920
+ if (value.language !== 'typescript' && value.language !== 'tsx')
2921
+ return null;
2922
+ const types = this.context
2923
+ .getNodesInFile(value.filePath)
2924
+ .filter((n) => n.name === value.name && (0, types_1.isSupertypeTarget)(n));
2925
+ return types.length === 1 ? types[0] : null;
2926
+ }
2927
+ gateLanguage(result, ref) {
2928
+ if (!result)
2929
+ return result;
2930
+ return (0, name_matcher_1.gateLanguageMatch)(result, ref, this.context);
2931
+ }
2932
+ /**
2933
+ * Framework calls carry bridge evidence (RN/Expo JS → native). Other
2934
+ * framework results obey the same code-family boundary as name matches;
2935
+ * markup/config transitions remain open.
2322
2936
  */
2323
2937
  gateFrameworkLanguage(result, ref) {
2324
2938
  if (!result)
2325
2939
  return result;
2326
- if (ref.referenceKind !== 'references' && ref.referenceKind !== 'imports')
2940
+ if (ref.referenceKind === 'calls')
2327
2941
  return result;
2328
2942
  const tgt = this.getLanguageFromNodeId(result.targetNodeId);
2329
- if (tgt && ref.language && (0, name_matcher_1.crossesKnownFamily)(tgt, ref.language))
2943
+ // Package imports cannot target prose found by a framework's name lookup.
2944
+ if (ref.referenceKind === 'imports' && tgt === 'markdown' && ref.language !== 'markdown')
2945
+ return null;
2946
+ if (tgt && ref.language && (0, name_matcher_1.crossesCodeBoundary)(tgt, ref.language))
2330
2947
  return null;
2331
2948
  return result;
2332
2949
  }