@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
@@ -1,12 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SYNTH_PROGRESS_STEPS = exports.SYNTH_PASSES = void 0;
4
+ exports.hasSynthesisPattern = hasSynthesisPattern;
4
5
  exports.synthesizeCallbackEdges = synthesizeCallbackEdges;
5
6
  const generated_detection_1 = require("../extraction/generated-detection");
6
7
  const strip_comments_1 = require("./strip-comments");
7
8
  const c_fnptr_synthesizer_1 = require("./c-fnptr-synthesizer");
8
9
  const goframe_synthesizer_1 = require("./goframe-synthesizer");
10
+ const expo_router_synthesizer_1 = require("./expo-router-synthesizer");
11
+ const next_router_synthesizer_1 = require("./next-router-synthesizer");
12
+ const react_router_synthesizer_1 = require("./react-router-synthesizer");
13
+ const tanstack_router_synthesizer_1 = require("./tanstack-router-synthesizer");
14
+ const vue_router_synthesizer_1 = require("./vue-router-synthesizer");
15
+ const angular_template_synthesizer_1 = require("./angular-template-synthesizer");
16
+ const sveltekit_synthesizer_1 = require("./sveltekit-synthesizer");
9
17
  const cooperative_yield_1 = require("./cooperative-yield");
18
+ const tier_synthesizer_1 = require("./tier-synthesizer");
19
+ const synth_utils_1 = require("./synth-utils");
20
+ const import_resolver_1 = require("./import-resolver");
21
+ const name_matcher_1 = require("./name-matcher");
10
22
  const REGISTRAR_NAME = /^(on[A-Z]\w*|subscribe|addListener|addEventListener|register|watch|listen|addCallback)$/;
11
23
  const DISPATCHER_NAME = /(emit|trigger|notify|dispatch|fire|publish|flush)/i;
12
24
  const MAX_CALLBACKS_PER_CHANNEL = 40;
@@ -15,6 +27,7 @@ const ON_RE = /\.(?:on|once|addListener)\(\s*['"]([^'"]+)['"]\s*,\s*(?:function\
15
27
  const EMIT_RE = /\.(?:emit|fire|dispatchEvent)\(\s*['"]([^'"]+)['"]/g;
16
28
  const SETSTATE_RE = /this\.setState\s*\(/;
17
29
  const FLUTTER_SETSTATE_RE = /\bsetState\s*\(/; // Flutter: setState((){…}) / this.setState
30
+ const JS_FAMILY = ['typescript', 'javascript', 'tsx', 'jsx'];
18
31
  const JSX_TAG_RE = /<([A-Z][A-Za-z0-9_]*)[\s/>]/g;
19
32
  const MAX_JSX_CHILDREN = 30;
20
33
  // Vue SFC templates: kebab-case child components (<el-button> → ElButton) and
@@ -85,35 +98,6 @@ function sliceLines(content, startLine, endLine) {
85
98
  return null;
86
99
  return content.split('\n').slice(startLine - 1, endLine).join('\n');
87
100
  }
88
- /**
89
- * Per-match line resolver over `src`, 1-based at `baseLine`. The inline
90
- * `src.slice(0, idx).split('\n').length` idiom is O(source-length) PER MATCH,
91
- * which goes quadratic on a match-dense source (a generated function full of
92
- * `.push(` calls re-scanned tens of thousands of times was most of the #1235
93
- * indexing wedge). Builds the newline index once — lazily, since most sources
94
- * never produce a match — then answers each call with a binary search.
95
- */
96
- function makeLineAt(src, baseLine) {
97
- let nl = null;
98
- return (idx) => {
99
- if (!nl) {
100
- nl = [];
101
- for (let i = src.indexOf('\n'); i !== -1; i = src.indexOf('\n', i + 1))
102
- nl.push(i);
103
- }
104
- // Count newlines strictly before idx.
105
- let lo = 0;
106
- let hi = nl.length;
107
- while (lo < hi) {
108
- const mid = (lo + hi) >> 1;
109
- if (nl[mid] < idx)
110
- lo = mid + 1;
111
- else
112
- hi = mid;
113
- }
114
- return baseLine + lo;
115
- };
116
- }
117
101
  function registrarField(src) {
118
102
  const m = src.match(/this\.(\w+)\.(?:add|push|set)\(/);
119
103
  return m ? m[1] : null;
@@ -127,21 +111,6 @@ function dispatcherField(src) {
127
111
  return forEach[1];
128
112
  return null;
129
113
  }
130
- const FN_KINDS = new Set(['method', 'function', 'component']);
131
- /** Innermost function/method node whose line range contains `line`. */
132
- function enclosingFn(nodesInFile, line) {
133
- let best = null;
134
- for (const n of nodesInFile) {
135
- if (!FN_KINDS.has(n.kind))
136
- continue;
137
- const end = n.endLine ?? n.startLine;
138
- if (n.startLine <= line && end >= line) {
139
- if (!best || n.startLine >= best.startLine)
140
- best = n; // prefer the tightest (latest-starting) encloser
141
- }
142
- }
143
- return best;
144
- }
145
114
  /**
146
115
  * Stream method + function nodes lazily. The synthesizers only scan-and-filter
147
116
  * down to a tiny matched subset, so materializing every function/method (which
@@ -185,7 +154,7 @@ async function fieldChannelEdges(queries, ctx, onYield) {
185
154
  const chDispatchers = dispatchers.filter((d) => d.node.filePath === reg.node.filePath && d.field === reg.field);
186
155
  if (chDispatchers.length === 0)
187
156
  continue;
188
- const argRe = new RegExp(`${reg.node.name}\\s*\\(\\s*(?:this\\.)?(\\w+)`);
157
+ const argRe = new RegExp(`${reg.node.name}\\s*\\(\\s*(this\\.\\w+|\\w+)\\s*(?=[,)])`);
189
158
  let added = 0;
190
159
  for (const e of queries.getIncomingEdges(reg.node.id, ['calls'])) {
191
160
  if (added >= MAX_CALLBACKS_PER_CHANNEL)
@@ -199,8 +168,15 @@ async function fieldChannelEdges(queries, ctx, onYield) {
199
168
  const am = line?.match(argRe);
200
169
  if (!am)
201
170
  continue;
202
- const fn = ctx.getNodesByName(am[1]).find((n) => n.kind === 'method' || n.kind === 'function');
203
- if (!fn)
171
+ // Reuse the resolved value at this registration site: it retains the
172
+ // receiver's class/inheritance and import binding, unlike a name lookup.
173
+ const refs = queries.getOutgoingEdges(caller.id, ['references']).filter((r) => r.line === e.line && r.metadata?.fnRef === true && r.metadata.refName === am[1]);
174
+ if (refs.length !== 1)
175
+ continue;
176
+ const fn = queries.getNodeById(refs[0].target);
177
+ if (!fn || (fn.kind !== 'method' && fn.kind !== 'function'))
178
+ continue;
179
+ if (!am[1].startsWith('this.') && fn.filePath !== caller.filePath && refs[0].metadata?.resolvedBy !== 'import')
204
180
  continue;
205
181
  for (const disp of chDispatchers) {
206
182
  if (disp.node.id === fn.id)
@@ -271,7 +247,7 @@ async function closureCollectionEdges(queries, ctx, onYield) {
271
247
  const hasAppend = src.includes('.append(') || src.includes('.add(') || src.includes('.push(') || src.includes('.insert(');
272
248
  if (!hasForEach && !hasAppend)
273
249
  continue;
274
- const lineAt = makeLineAt(src, m.startLine ?? 1);
250
+ const lineAt = (0, synth_utils_1.makeLineAt)(src, m.startLine ?? 1);
275
251
  if (hasForEach) {
276
252
  CC_DISPATCH_RE.lastIndex = 0;
277
253
  let d;
@@ -345,12 +321,12 @@ async function eventEmitterEdges(ctx, onYield) {
345
321
  if (!hasEmit && !hasOn)
346
322
  continue;
347
323
  const nodesInFile = ctx.getNodesInFile(file);
348
- const lineOf = makeLineAt(content, 1);
324
+ const lineOf = (0, synth_utils_1.makeLineAt)(content, 1);
349
325
  if (hasEmit) {
350
326
  EMIT_RE.lastIndex = 0;
351
327
  let m;
352
328
  while ((m = EMIT_RE.exec(content))) {
353
- const disp = enclosingFn(nodesInFile, lineOf(m.index));
329
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, lineOf(m.index));
354
330
  if (!disp)
355
331
  continue;
356
332
  const set = emitsByEvent.get(m[1]) ?? new Set();
@@ -542,11 +518,9 @@ async function arkuiStateBuildEdges(queries, ctx, onYield) {
542
518
  let scanned255 = 0;
543
519
  const edges = [];
544
520
  const seen = new Set();
545
- for (const struct of queries.iterateNodesByKind('struct')) {
521
+ for (const struct of queries.iterateNodesByKindIn('struct', ['arkts'])) {
546
522
  if ((++scanned255 & 63) === 0)
547
523
  await onYield();
548
- if (struct.language !== 'arkts')
549
- continue;
550
524
  const children = queries.getOutgoingEdges(struct.id, ['contains'])
551
525
  .map((e) => queries.getNodeById(e.target))
552
526
  .filter((n) => !!n);
@@ -884,22 +858,17 @@ async function goImplementsEdges(queries, onYield) {
884
858
  // never the whole struct kind — that array is O(nodes) on struct-heavy
885
859
  // repos like the Linux kernel (#1212).
886
860
  const goStructs = [];
887
- for (const s of queries.iterateNodesByKind('struct')) {
861
+ for (const s of queries.iterateNodesByKindIn('struct', ['go'])) {
888
862
  if ((++scanned255 & 63) === 0)
889
863
  await onYield();
890
- if (s.language === 'go')
891
- goStructs.push(s);
864
+ goStructs.push(s);
892
865
  }
893
866
  const structMethods = new Map();
894
867
  for (const s of goStructs)
895
868
  structMethods.set(s.id, methodNameSet(s.id));
896
- for (const iface of queries.iterateNodesByKind('interface')) {
869
+ for (const iface of queries.iterateNodesByKindIn('interface', ['go'])) {
897
870
  if ((++scanned255 & 63) === 0)
898
871
  await onYield();
899
- if ((++scanned255 & 63) === 0)
900
- await onYield();
901
- if (iface.language !== 'go')
902
- continue;
903
872
  const want = methodNameSet(iface.id);
904
873
  if (want.size === 0)
905
874
  continue; // empty interface (`any`) — would match everything
@@ -952,9 +921,10 @@ async function goImplementsEdges(queries, onYield) {
952
921
  *
953
922
  * Go guarantees a method's receiver type is declared in the SAME PACKAGE as the
954
923
  * method, and a Go package is a single directory — so this is a deterministic
955
- * structural link, not a heuristic: find the same-named type in the method's own
956
- * directory and add the missing `contains` edge (no `provenance: 'heuristic'`,
957
- * matching the same-file edges extraction already emits). Skips methods that
924
+ * structural link, not a heuristic: find the same-named type in the method's
925
+ * own directory and add the missing `contains` edge with no provenance, matching
926
+ * same-file extraction. Tag synthesis ownership so an incremental
927
+ * refresh can replace it alongside implicit `implements`. Skips methods that
958
928
  * already have a type parent (the same-file case). (#583, cross-file half)
959
929
  */
960
930
  async function goCrossFileMethodContainsEdges(queries, onYield) {
@@ -966,13 +936,9 @@ async function goCrossFileMethodContainsEdges(queries, onYield) {
966
936
  const i = p.replace(/\\/g, '/').lastIndexOf('/');
967
937
  return i >= 0 ? p.slice(0, i) : '';
968
938
  };
969
- for (const method of queries.iterateNodesByKind('method')) {
939
+ for (const method of queries.iterateNodesByKindIn('method', ['go'])) {
970
940
  if ((++scanned255 & 63) === 0)
971
941
  await onYield();
972
- if ((++scanned255 & 63) === 0)
973
- await onYield();
974
- if (method.language !== 'go')
975
- continue;
976
942
  // The receiver type is encoded in the method's qualifiedName as `Recv::name`
977
943
  // (extraction sets `${receiverType}::${name}` for receiver methods).
978
944
  const qn = method.qualifiedName;
@@ -1007,7 +973,8 @@ async function goCrossFileMethodContainsEdges(queries, onYield) {
1007
973
  if (seen.has(key))
1008
974
  continue;
1009
975
  seen.add(key);
1010
- edges.push({ source: owner.id, target: method.id, kind: 'contains', line: method.startLine });
976
+ edges.push({ source: owner.id, target: method.id, kind: 'contains', line: method.startLine,
977
+ metadata: { synthesizedBy: 'go-method-contains' } });
1011
978
  }
1012
979
  return edges;
1013
980
  }
@@ -1106,6 +1073,27 @@ async function interfaceOverrideEdges(queries, onYield) {
1106
1073
  methodsMemo.set(classId, methods);
1107
1074
  return methods;
1108
1075
  };
1076
+ // A Swift protocol's methods live in its extensions: requirements are not
1077
+ // extracted as methods, and `extension EventMonitor { func request(…) }` is
1078
+ // where the default implementations a conformer overrides are. A class-kind
1079
+ // node sharing a protocol's name is one of its extensions.
1080
+ const protocolMemo = new Map();
1081
+ const baseMethodsOf = (base) => {
1082
+ if (base.language !== 'swift' || base.kind !== 'interface')
1083
+ return methodsOf(base.id);
1084
+ const hit = protocolMemo.get(base.id);
1085
+ if (hit)
1086
+ return hit;
1087
+ const methods = [
1088
+ ...methodsOf(base.id),
1089
+ ...queries
1090
+ .getNodesByName(base.name)
1091
+ .filter((n) => n.language === 'swift' && n.kind === 'class')
1092
+ .flatMap((n) => methodsOf(n.id)),
1093
+ ];
1094
+ protocolMemo.set(base.id, methods);
1095
+ return methods;
1096
+ };
1109
1097
  // Concrete-side kinds vary by language: `class` covers Java / Kotlin /
1110
1098
  // C# / TS / Swift-classes / Scala-classes; `struct` covers Swift value
1111
1099
  // types that conform to protocols. Iterate both.
@@ -1140,7 +1128,7 @@ async function interfaceOverrideEdges(queries, onYield) {
1140
1128
  implByName.set(m.name, [m]);
1141
1129
  }
1142
1130
  let added = 0;
1143
- for (const bm of methodsOf(base.id)) {
1131
+ for (const bm of baseMethodsOf(base)) {
1144
1132
  if (added >= MAX_CALLBACKS_PER_CHANNEL)
1145
1133
  break;
1146
1134
  for (const m of implByName.get(bm.name) ?? []) {
@@ -1206,11 +1194,9 @@ async function goGrpcStubImplEdges(queries, onYield) {
1206
1194
  const methodNamesByStruct = new Map();
1207
1195
  const methodNodesByStruct = new Map();
1208
1196
  const goStructs = [];
1209
- for (const s of queries.iterateNodesByKind('struct')) {
1197
+ for (const s of queries.iterateNodesByKindIn('struct', ['go'])) {
1210
1198
  if ((++scanned255 & 63) === 0)
1211
1199
  await onYield();
1212
- if (s.language !== 'go')
1213
- continue;
1214
1200
  goStructs.push(s);
1215
1201
  const ms = queries
1216
1202
  .getOutgoingEdges(s.id, ['contains'])
@@ -1282,6 +1268,87 @@ async function goGrpcStubImplEdges(queries, onYield) {
1282
1268
  }
1283
1269
  return edges;
1284
1270
  }
1271
+ /** Kinds a JSX tag can name. A tag that resolves only to a type is markup we drop. */
1272
+ const JSX_CHILD_KINDS = new Set(['component', 'function', 'class']);
1273
+ /**
1274
+ * The languages a JSX tag can plausibly name a component in. Preferred over a
1275
+ * same-named symbol in another language, never required — a React Native tag
1276
+ * whose only match is the native class it bridges to (`requireNativeComponent`)
1277
+ * still links there.
1278
+ */
1279
+ const JSX_CHILD_LANGUAGES = [...JS_FAMILY, 'vue', 'svelte'];
1280
+ function languageForJsxFile(file) {
1281
+ if (file.endsWith('.tsx'))
1282
+ return 'tsx';
1283
+ if (/\.[cm]?ts$/.test(file))
1284
+ return 'typescript';
1285
+ if (file.endsWith('.jsx'))
1286
+ return 'jsx';
1287
+ if (file.endsWith('.vue'))
1288
+ return 'vue';
1289
+ if (file.endsWith('.svelte'))
1290
+ return 'svelte';
1291
+ return 'javascript';
1292
+ }
1293
+ /** `localName` → the project file it is imported from, for one file's imports. */
1294
+ function importedFrom(ctx, file, language) {
1295
+ const out = new Map();
1296
+ for (const im of ctx.getImportMappings(file, language)) {
1297
+ // The mappings name the module as written; the file it is comes from the
1298
+ // same resolution the import resolver uses (aliases, extensions, index files).
1299
+ const resolved = im.resolvedPath ?? (0, import_resolver_1.resolveImportPath)(im.source, file, language, ctx);
1300
+ if (resolved)
1301
+ out.set(im.localName, resolved);
1302
+ }
1303
+ return out;
1304
+ }
1305
+ /**
1306
+ * The component a JSX tag names, among every node that shares the name.
1307
+ *
1308
+ * A tag is written in one file, and that file already says which `FrameCard` it
1309
+ * means: the one it declares, or the one it imports. Taking the FIRST node of
1310
+ * that name — which is what this did — is a coin flip once a name repeats, and
1311
+ * it costs twice over. The parent gets an edge to a component it never renders,
1312
+ * and the component it does render is left with no caller at all, so every walk
1313
+ * back from that subtree dead-ends: on an Expo app whose `<FrameCard/>` was one
1314
+ * of two, the folder sheet's `openBackgroundNoiseDetail` stood alone on Screens
1315
+ * with no screen behind it, while the edge pointed at an unrelated card in
1316
+ * another sheet.
1317
+ *
1318
+ * Same file first — a small component declared beside its use is the commonest
1319
+ * shape, and the one an import can never disambiguate. Then the file the name
1320
+ * is imported from. Then the language, which only decides a tie: a `.tsx` tag
1321
+ * naming both a TS component and a same-named Swift class means the TS one.
1322
+ */
1323
+ function jsxChild(ctx, name, file, importsOf) {
1324
+ const candidates = ctx.getNodesByName(name).filter((n) => JSX_CHILD_KINDS.has(n.kind));
1325
+ if (candidates.length === 0) {
1326
+ // A name nothing declares is the file's DEFAULT import of a module's one
1327
+ // component under another name: segmented-control renders
1328
+ // `<RNCSegmentedControlNativeComponent>`, the default export of a module
1329
+ // that is `requireNativeComponent('RNCSegmentedControl')`; element-plus's
1330
+ // tests render `<Autocomplete>` from `autocomplete.vue`. A named import
1331
+ // names an export of its own, which a barrel's one component is not.
1332
+ const isDefault = ctx
1333
+ .getImportMappings(file, languageForJsxFile(file))
1334
+ .some((m) => m.localName === name && m.isDefault);
1335
+ const from = isDefault ? importsOf().get(name) : undefined;
1336
+ const components = from ? ctx.getNodesInFile(from).filter((n) => n.kind === 'component') : [];
1337
+ return components.length === 1 ? components[0] : undefined;
1338
+ }
1339
+ if (candidates.length === 1)
1340
+ return candidates[0];
1341
+ const local = candidates.find((n) => n.filePath === file);
1342
+ if (local)
1343
+ return local;
1344
+ const from = importsOf().get(name);
1345
+ if (from) {
1346
+ const imported = candidates.find((n) => n.filePath === from);
1347
+ if (imported)
1348
+ return imported;
1349
+ }
1350
+ return candidates.find((n) => JSX_CHILD_LANGUAGES.includes(n.language)) ?? candidates[0];
1351
+ }
1285
1352
  /**
1286
1353
  * Phase 5: React JSX child rendering. A component that returns `<Child .../>`
1287
1354
  * mounts Child — React calls it — but JSX instantiation isn't a static call edge,
@@ -1310,6 +1377,9 @@ async function reactJsxChildEdges(ctx, onYield) {
1310
1377
  const parents = ctx.getNodesInFile(file).filter((n) => PARENT_KINDS.has(n.kind) && JS_FAMILY.includes(n.language));
1311
1378
  if (parents.length === 0)
1312
1379
  continue;
1380
+ // Read once per file, and only when a name actually turns out ambiguous.
1381
+ let imports = null;
1382
+ const importsOf = () => (imports ??= importedFrom(ctx, file, parents[0].language));
1313
1383
  for (const parent of parents) {
1314
1384
  const src = sliceLines(content, parent.startLine, parent.endLine);
1315
1385
  if (!src || (!src.includes('</') && !src.includes('/>')))
@@ -1323,8 +1393,8 @@ async function reactJsxChildEdges(ctx, onYield) {
1323
1393
  for (const name of names) {
1324
1394
  if (added >= MAX_JSX_CHILDREN)
1325
1395
  break;
1326
- const child = ctx.getNodesByName(name).find((n) => n.kind === 'component' || n.kind === 'function' || n.kind === 'class');
1327
- if (!child || child.id === parent.id)
1396
+ const child = jsxChild(ctx, name, file, importsOf);
1397
+ if (!child || child.id === parent.id || (0, name_matcher_1.crossesCodeBoundary)(parent.language, child.language))
1328
1398
  continue;
1329
1399
  const key = `${parent.id}>${child.id}`;
1330
1400
  if (seen.has(key))
@@ -1406,7 +1476,8 @@ async function vueTemplateEdges(ctx, onYield) {
1406
1476
  }
1407
1477
  let added = 0;
1408
1478
  const addEdge = (target, meta) => {
1409
- if (added >= MAX_JSX_CHILDREN || !target || target.id === comp.id)
1479
+ if (added >= MAX_JSX_CHILDREN || !target || target.id === comp.id ||
1480
+ (0, name_matcher_1.crossesCodeBoundary)(comp.language, target.language))
1410
1481
  return;
1411
1482
  const k = `${comp.id}>${target.id}>${meta.synthesizedBy}`;
1412
1483
  if (seen.has(k))
@@ -1483,10 +1554,13 @@ async function vueTemplateEdges(ctx, onYield) {
1483
1554
  * DeviceEventEmitter.addListener("locationUpdate", handler);
1484
1555
  *
1485
1556
  * Synthesize: native dispatch site → JS handler, keyed by the literal
1486
- * event name. Only matches NAMED handlers (the existing `ON_RE` named-
1487
- * capture form). Inline arrow handlers like `addListener('x', d => …)`
1488
- * aren't named at extraction time and would need link-through-body
1489
- * support; matches the deliberate scope of the in-language synthesizer.
1557
+ * event name. A NAMED handler (`addListener('x', handleX)`) is the target
1558
+ * when it is a node; an unnamed one — a parameter passed through, or an
1559
+ * inline `(data) => {…}` written in a `useEffect` — is attributed to the
1560
+ * enclosing function, where the event demonstrably lands. (The in-language
1561
+ * synthesizer stays named-only; this channel pairs across a language
1562
+ * boundary on a literal, which is the evidence that makes the wider
1563
+ * attribution safe.)
1490
1564
  *
1491
1565
  * Provenance `'heuristic'`, synthesizedBy `'rn-event-channel'`.
1492
1566
  */
@@ -1512,8 +1586,81 @@ const RN_JVM_EMIT_RE = /\.emit\s*\(\s*"([^"]+)"\s*,/g;
1512
1586
  // statement and stops at a block boundary, so the wrapper DEFINITION (whose `(`
1513
1587
  // is followed by `… ) {`) never matches. Multi-line tolerant. (java/kotlin/swift)
1514
1588
  const RN_NATIVE_SENDEVENT_RE = /\bsendEvent\s*\([^;{}]*?"([^"]+)"/g;
1589
+ // The same calls with the event named by a CONSTANT — NetInfo listens with
1590
+ // `addListener(PrivateTypes.DEVICE_CONNECTIVITY_EVENT, …)`, many libraries emit
1591
+ // with `.emit(EVENT_NAME, …)` or `sendEventWithName:kLocationEvent`.
1592
+ const RN_OBJC_SEND_CONST_RE = /\bsendEventWithName\s*:\s*([A-Za-z_]\w*)\b/g;
1593
+ const RN_SWIFT_SEND_CONST_RE = /\bsendEvent\s*\(\s*withName\s*:\s*([A-Za-z_][\w.]*)/g;
1594
+ const RN_JVM_EMIT_CONST_RE = /\.emit\s*\(\s*([A-Za-z_][\w.]*)\s*,/g;
1595
+ const RN_NATIVE_SENDEVENT_CONST_RE = /\bsendEvent\s*\(\s*[A-Za-z_][\w.]*\s*,\s*([A-Za-z_][\w.]*)\s*,/g;
1596
+ const RN_JS_LISTEN_CONST_RE = /\.(?:on|once|addListener)\(\s*((?:[A-Za-z_$][\w$]*\.)*[A-Za-z_$][\w$]*)\s*,\s*([A-Za-z_$][\w$.]*|(?:async\s*)?(?:\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>|function\s*\())/g;
1597
+ const CONSTANT_KINDS = new Set(['constant', 'variable', 'field', 'property', 'enum_member']);
1598
+ /**
1599
+ * The string an event-name constant holds, read off its declaration line:
1600
+ * `export const DEVICE_CONNECTIVITY_EVENT = 'netInfo.networkStatusDidChange'`,
1601
+ * `static final String EVENT = "x"`, `const val EVENT = "x"`,
1602
+ * `NSString *const kEvent = @"x"`, `#define kEvent @"x"`, `static let event = "x"`,
1603
+ * an enum case `Changed = 'changed'`.
1604
+ *
1605
+ * Scoped as the language scopes the name, never by the name alone — a
1606
+ * parameter `eventName` is not some test's `eventName = "pong"`:
1607
+ * - a bare `NAME` is a declaration in the same file, or (JS) the one an
1608
+ * import of that name points at;
1609
+ * - `Owner.NAME` is a declaration inside `Owner`, or (JS) `NAME` in the file
1610
+ * a namespace import `Owner` points at.
1611
+ * Null unless those declarations agree on one literal.
1612
+ */
1613
+ function constantEventName(expr, file, ctx, memo) {
1614
+ const key = `${file}\0${expr}`;
1615
+ if (memo.has(key))
1616
+ return memo.get(key);
1617
+ const parts = expr.replace(/\.rawValue$/, '').split('.');
1618
+ const name = parts[parts.length - 1];
1619
+ const owner = parts.length > 1 ? parts[parts.length - 2] : null;
1620
+ let value = null;
1621
+ if (/^[A-Za-z_$][\w$]*$/.test(name) && name !== 'this' && (parts.length <= 2 || parts[0] !== 'this')) {
1622
+ const read = (n) => {
1623
+ const line = (ctx.getFileLines?.(n.filePath) ?? ctx.readFile(n.filePath)?.split(/\r?\n/))?.[n.startLine - 1] ?? '';
1624
+ const at = line.indexOf(name);
1625
+ if (at < 0)
1626
+ return null;
1627
+ const rest = line.slice(at + name.length);
1628
+ const m = /^\s*(?::[^=;]*)?[=:]\s*@?(["'`])([^"'`]+)\1/.exec(rest) ?? /^\s+@?(")([^"]+)"/.exec(rest);
1629
+ return m ? m[2] : null;
1630
+ };
1631
+ const declaredIn = (f) => ctx.getNodesInFile(f).filter((n) => n.name === name && CONSTANT_KINDS.has(n.kind));
1632
+ const js = /\.(?:[cm]?[jt]sx?)$/.test(file);
1633
+ const language = /\.tsx$/.test(file) ? 'tsx' : /\.[cm]?ts$/.test(file) ? 'typescript' : file.endsWith('.jsx') ? 'jsx' : 'javascript';
1634
+ const importedFile = (local) => {
1635
+ if (!js)
1636
+ return null;
1637
+ const binding = ctx.getImportMappings(file, language).find((m) => m.localName === local);
1638
+ return binding ? (0, import_resolver_1.resolveImportPath)(binding.source, file, language, ctx) : null;
1639
+ };
1640
+ let decls = [];
1641
+ if (owner === null) {
1642
+ decls = declaredIn(file);
1643
+ if (decls.length === 0) {
1644
+ const from = importedFile(name);
1645
+ if (from)
1646
+ decls = declaredIn(from);
1647
+ }
1648
+ }
1649
+ else {
1650
+ const from = importedFile(owner);
1651
+ decls = from
1652
+ ? declaredIn(from)
1653
+ : ctx.getNodesByName(name).filter((n) => CONSTANT_KINDS.has(n.kind) && new RegExp(`(?:^|[.:])${owner}(?:[.:]|$)`).test(n.qualifiedName.slice(0, n.qualifiedName.lastIndexOf(name))));
1654
+ }
1655
+ const values = new Set(decls.map(read).filter((v) => v !== null));
1656
+ value = values.size === 1 ? [...values][0] : null;
1657
+ }
1658
+ memo.set(key, value);
1659
+ return value;
1660
+ }
1515
1661
  async function rnEventEdges(ctx, onYield) {
1516
1662
  let scannedFiles = 0;
1663
+ const constants = new Map();
1517
1664
  // Native dispatchers (source = the native method whose body sends the
1518
1665
  // event) and JS handlers (target = the function/method registered as
1519
1666
  // the listener) keyed by event name.
@@ -1526,9 +1673,9 @@ async function rnEventEdges(ctx, onYield) {
1526
1673
  if (!content)
1527
1674
  continue;
1528
1675
  const nodesInFile = ctx.getNodesInFile(file);
1529
- const lineOf = makeLineAt(content, 1);
1676
+ const lineOf = (0, synth_utils_1.makeLineAt)(content, 1);
1530
1677
  const addDispatcher = (event, line) => {
1531
- const disp = enclosingFn(nodesInFile, line);
1678
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
1532
1679
  if (!disp)
1533
1680
  return;
1534
1681
  const set = nativeDispatchersByEvent.get(event) ?? new Set();
@@ -1544,6 +1691,12 @@ async function rnEventEdges(ctx, onYield) {
1544
1691
  if (m[1])
1545
1692
  addDispatcher(m[1], lineOf(m.index));
1546
1693
  }
1694
+ RN_OBJC_SEND_CONST_RE.lastIndex = 0;
1695
+ while ((m = RN_OBJC_SEND_CONST_RE.exec(content))) {
1696
+ const event = constantEventName(m[1], file, ctx, constants);
1697
+ if (event)
1698
+ addDispatcher(event, lineOf(m.index));
1699
+ }
1547
1700
  }
1548
1701
  // Swift side: same RCTEventEmitter method, parens/named-args syntax.
1549
1702
  if (file.endsWith('.swift')) {
@@ -1558,6 +1711,12 @@ async function rnEventEdges(ctx, onYield) {
1558
1711
  if (m[1])
1559
1712
  addDispatcher(m[1], lineOf(m.index));
1560
1713
  }
1714
+ RN_SWIFT_SEND_CONST_RE.lastIndex = 0;
1715
+ while ((m = RN_SWIFT_SEND_CONST_RE.exec(content))) {
1716
+ const event = constantEventName(m[1], file, ctx, constants);
1717
+ if (event)
1718
+ addDispatcher(event, lineOf(m.index));
1719
+ }
1561
1720
  }
1562
1721
  // JVM side: `.emit("X", …)` in Java/Kotlin, plus the common
1563
1722
  // `sendEvent(ctx, "X", body)` wrapper. (We pattern-match anywhere in the
@@ -1575,6 +1734,14 @@ async function rnEventEdges(ctx, onYield) {
1575
1734
  if (m[1])
1576
1735
  addDispatcher(m[1], lineOf(m.index));
1577
1736
  }
1737
+ for (const re of [RN_JVM_EMIT_CONST_RE, RN_NATIVE_SENDEVENT_CONST_RE]) {
1738
+ re.lastIndex = 0;
1739
+ while ((m = re.exec(content))) {
1740
+ const event = constantEventName(m[1], file, ctx, constants);
1741
+ if (event)
1742
+ addDispatcher(event, lineOf(m.index));
1743
+ }
1744
+ }
1578
1745
  }
1579
1746
  // JS subscribers (.addListener("X", handler)). Restrict to JS-family
1580
1747
  // files so a native file's `addListener:` (the ObjC method) doesn't
@@ -1594,6 +1761,8 @@ async function rnEventEdges(ctx, onYield) {
1594
1761
  // function (the abstraction layer), giving a reachability-correct
1595
1762
  // hop even when the actual user-side handler lives one call up.
1596
1763
  const ADDLISTENER_ANY = /\.(?:on|once|addListener)\(\s*['"]([^'"]+)['"]\s*,\s*([A-Za-z_][\w.]*)/g;
1764
+ // The inline form: `.addListener('x', (data) => {…})` / `function () {…}`.
1765
+ const ADDLISTENER_INLINE = /\.(?:on|once|addListener)\(\s*['"]([^'"]+)['"]\s*,\s*(?:async\s*)?(?:\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>|function\s*\()/g;
1597
1766
  ADDLISTENER_ANY.lastIndex = 0;
1598
1767
  let m;
1599
1768
  while ((m = ADDLISTENER_ANY.exec(content))) {
@@ -1611,7 +1780,7 @@ async function rnEventEdges(ctx, onYield) {
1611
1780
  // Fall back to the enclosing function — the subscribe-wrapper
1612
1781
  // pattern means the event fires THROUGH this function on its
1613
1782
  // way to user code. Reachability-correct attribution.
1614
- const enclosing = enclosingFn(nodesInFile, lineOf(m.index));
1783
+ const enclosing = (0, synth_utils_1.enclosingFn)(nodesInFile, lineOf(m.index));
1615
1784
  targetId = enclosing?.id ?? null;
1616
1785
  }
1617
1786
  if (!targetId) {
@@ -1641,6 +1810,46 @@ async function rnEventEdges(ctx, onYield) {
1641
1810
  map.set(targetId, `${file}:${lineOf(m.index)}`);
1642
1811
  jsHandlersByEvent.set(event, map);
1643
1812
  }
1813
+ // Inline listeners — the shape a React component registers inside a
1814
+ // `useEffect`: `nativeEmitter.addListener('onCaptureComplete', (data) =>
1815
+ // { … router.push('/review') })`. There is no handler symbol to name,
1816
+ // so the subscription is attributed to the enclosing function exactly
1817
+ // as the unnamed-argument form above is: the native event lands in that
1818
+ // component, and its body is where a reader looks next. This channel
1819
+ // only — the in-language synthesizer keeps its named-handler policy.
1820
+ ADDLISTENER_INLINE.lastIndex = 0;
1821
+ while ((m = ADDLISTENER_INLINE.exec(content))) {
1822
+ const event = m[1];
1823
+ if (!event)
1824
+ continue;
1825
+ const enclosing = (0, synth_utils_1.enclosingFn)(nodesInFile, lineOf(m.index));
1826
+ if (!enclosing)
1827
+ continue;
1828
+ const map = jsHandlersByEvent.get(event) ?? new Map();
1829
+ if (!map.has(enclosing.id))
1830
+ map.set(enclosing.id, `${file}:${lineOf(m.index)}`);
1831
+ jsHandlersByEvent.set(event, map);
1832
+ }
1833
+ // A constant event name: the listener lands where a literal one would —
1834
+ // the named handler when it is a node, else the enclosing function.
1835
+ RN_JS_LISTEN_CONST_RE.lastIndex = 0;
1836
+ while ((m = RN_JS_LISTEN_CONST_RE.exec(content))) {
1837
+ const event = constantEventName(m[1], file, ctx, constants);
1838
+ if (!event)
1839
+ continue;
1840
+ const arg = m[2];
1841
+ const bare = /^[A-Za-z_$][\w$.]*$/.test(arg) ? arg.slice(arg.lastIndexOf('.') + 1) : null;
1842
+ const line = lineOf(m.index);
1843
+ // The handler this file names — never a same-named function elsewhere.
1844
+ const named = bare ? nodesInFile.find((n) => (n.kind === 'function' || n.kind === 'method') && n.name === bare) : undefined;
1845
+ const target = named ?? (0, synth_utils_1.enclosingFn)(nodesInFile, line);
1846
+ if (!target)
1847
+ continue;
1848
+ const map = jsHandlersByEvent.get(event) ?? new Map();
1849
+ if (!map.has(target.id))
1850
+ map.set(target.id, `${file}:${line}`);
1851
+ jsHandlersByEvent.set(event, map);
1852
+ }
1644
1853
  }
1645
1854
  }
1646
1855
  const edges = [];
@@ -1787,11 +1996,9 @@ async function rnCrossPlatformEdges(queries, onYield) {
1787
1996
  // impls in ≥2 native languages can pair, so the per-method JS-caller check
1788
1997
  // below only runs for genuine cross-platform candidates.
1789
1998
  const byName = new Map();
1790
- for (const m of queries.iterateNodesByKind('method')) {
1999
+ for (const m of queries.iterateNodesByKindIn('method', [...NATIVE])) {
1791
2000
  if ((++scanned255 & 63) === 0)
1792
2001
  await onYield();
1793
- if (!NATIVE.has(m.language))
1794
- continue;
1795
2002
  const key = norm(m.name);
1796
2003
  const arr = byName.get(key);
1797
2004
  if (arr)
@@ -1923,21 +2130,18 @@ async function mybatisJavaXmlEdges(queries, onYield) {
1923
2130
  // stream below. Same rowid stream order as matching inline, so the edge
1924
2131
  // output is byte-identical when mappers do exist.
1925
2132
  const xmlMethods = [];
1926
- for (const m of queries.iterateNodesByKind('method')) {
2133
+ for (const m of queries.iterateNodesByKindIn('method', ['xml'])) {
1927
2134
  if ((++scanned255 & 63) === 0)
1928
2135
  await onYield();
1929
- if (m.language === 'xml')
1930
- xmlMethods.push(m);
2136
+ xmlMethods.push(m);
1931
2137
  }
1932
2138
  if (xmlMethods.length === 0)
1933
2139
  return edges;
1934
2140
  // Index Java methods by `<ClassName>::<methodName>` for O(1) lookup.
1935
2141
  const javaIndex = new Map();
1936
- for (const m of queries.iterateNodesByKind('method')) {
2142
+ for (const m of queries.iterateNodesByKindIn('method', ['java', 'kotlin'])) {
1937
2143
  if ((++scanned255 & 63) === 0)
1938
2144
  await onYield();
1939
- if (m.language !== 'java' && m.language !== 'kotlin')
1940
- continue;
1941
2145
  const parts = m.qualifiedName.split('::');
1942
2146
  const last = parts[parts.length - 1];
1943
2147
  const cls = parts[parts.length - 2];
@@ -2069,11 +2273,9 @@ async function ginMiddlewareChainEdges(queries, ctx, onYield) {
2069
2273
  let scannedFiles = 0;
2070
2274
  // 1. Find the chain dispatcher(s): a Go method that invokes a `handlers` slice by index.
2071
2275
  const dispatchers = [];
2072
- for (const n of queries.iterateNodesByKind('method')) {
2276
+ for (const n of queries.iterateNodesByKindIn('method', ['go'])) {
2073
2277
  if ((++scanned255 & 63) === 0)
2074
2278
  await onYield();
2075
- if (n.language !== 'go')
2076
- continue;
2077
2279
  const content = ctx.readFile(n.filePath);
2078
2280
  const src = content && sliceLines(content, n.startLine, n.endLine);
2079
2281
  if (src && GIN_DISPATCH_RE.test(src))
@@ -2207,12 +2409,17 @@ async function svelteKitLoadEdges(ctx, onYield) {
2207
2409
  if (!allFiles.has(loaderFile))
2208
2410
  continue;
2209
2411
  for (const hook of ctx.getNodesInFile(loaderFile)) {
2210
- if (!HOOK_KINDS.has(hook.kind) || !HOOKS.has(hook.name))
2412
+ // `load` and `actions` by name, and every function the loader file
2413
+ // declares — a form action is an arrow inside `actions`, and it is a
2414
+ // node of its own (`default`, `logout`), where the redirect that ends
2415
+ // the submission is actually written.
2416
+ const named = HOOK_KINDS.has(hook.kind) && HOOKS.has(hook.name);
2417
+ if (!named && hook.kind !== 'function' && hook.kind !== 'method')
2211
2418
  continue;
2212
2419
  edges.push({
2213
2420
  source: page.id,
2214
2421
  target: hook.id,
2215
- kind: 'references',
2422
+ kind: 'calls',
2216
2423
  line: page.startLine,
2217
2424
  provenance: 'heuristic',
2218
2425
  metadata: {
@@ -2310,12 +2517,38 @@ async function reduxThunkEdges(queries, ctx, onYield) {
2310
2517
  // the SAME file (the cross-file barrel-namespace variant, e.g. trezor's getMethod, is
2311
2518
  // deferred). Gated on a real object literal with ≥2 entries that RESOLVE to callables (a
2312
2519
  // `{ width: 5 }` literal resolves to nothing → no edges); fan-out capped.
2313
- const REGISTRY_ASSIGN_RE = /(?:(?:const|let|var)\s+([A-Za-z_$][\w$]*)|((?:this\.)?[A-Za-z_$][\w$]*))\s*=\s*\{/g;
2314
- const REGISTRY_DISPATCH_RE = /(?:\bnew\s+)?((?:this\.)?[A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$.]*)\s*\]\s*(?:\(|\.[A-Za-z_$])/g;
2520
+ // Both scans only START a name at an identifier's first character (or at a `this.`): the
2521
+ // engine otherwise retries the greedy name at every later character of every identifier in
2522
+ // the file. A match found from inside an identifier always has one from the identifier's
2523
+ // start (same name tail, same continuation), so the result is unchanged — except where the
2524
+ // scan itself resumes mid-identifier after a dispatch ending in `.method`, which
2525
+ // `nextRegistryDispatch` covers with the unguarded pattern.
2526
+ const REGISTRY_NAME_START = String.raw `(?:(?<![A-Za-z_$])(?<![A-Za-z_$][\w$]+)|(?=this\.))`;
2527
+ const REGISTRY_ASSIGN_RE = new RegExp(String.raw `(?:(?:const|let|var)\s+([A-Za-z_$][\w$]*)|${REGISTRY_NAME_START}((?:this\.)?[A-Za-z_$][\w$]*))\s*=\s*\{`, 'g');
2528
+ const REGISTRY_DISPATCH_SRC = String.raw `(?:\bnew\s+)?((?:this\.)?[A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$.]*)\s*\]\s*(?:\(|\.[A-Za-z_$])`;
2529
+ const REGISTRY_DISPATCH_AT = new RegExp(REGISTRY_DISPATCH_SRC, 'y');
2530
+ // `\bnew` can follow a `$` inside an identifier run, hence the extra `(?<!\w)` start.
2531
+ const REGISTRY_DISPATCH_RE = new RegExp(String.raw `(?:(?<!\w)|${REGISTRY_NAME_START})${REGISTRY_DISPATCH_SRC}`, 'g');
2532
+ const IDENT_RUN_CHAR = /[\w$]/;
2315
2533
  const REGISTRY_MIN_ENTRIES = 2;
2316
2534
  const REGISTRY_FANOUT_CAP = 40;
2317
2535
  const REGISTRY_CLASS_ENTRY = new Set(['execute', 'run', 'handle', 'perform', 'process', 'call', 'apply', 'dispatch']);
2318
2536
  const REGISTRY_JS_EXT = /\.(?:ts|tsx|js|jsx|mjs|cjs)$/;
2537
+ /** The first registry dispatch at or after `from`, exactly as a `g` scan of the unguarded
2538
+ * pattern resuming at `from` would find it. */
2539
+ function nextRegistryDispatch(src, from) {
2540
+ let at = from;
2541
+ if (at > 0 && at < src.length && IDENT_RUN_CHAR.test(src[at - 1]) && IDENT_RUN_CHAR.test(src[at])) {
2542
+ for (; at < src.length && IDENT_RUN_CHAR.test(src[at]); at++) {
2543
+ REGISTRY_DISPATCH_AT.lastIndex = at;
2544
+ const m = REGISTRY_DISPATCH_AT.exec(src);
2545
+ if (m)
2546
+ return m;
2547
+ }
2548
+ }
2549
+ REGISTRY_DISPATCH_RE.lastIndex = at;
2550
+ return REGISTRY_DISPATCH_RE.exec(src);
2551
+ }
2319
2552
  /** From the index of an opening `{`, return the brace-balanced body up to its matching `}`. */
2320
2553
  function braceBody(src, openIdx) {
2321
2554
  let depth = 0;
@@ -2404,13 +2637,12 @@ async function objectRegistryEdges(ctx, onYield) {
2404
2637
  const safe = (0, strip_comments_1.stripCommentsForRegex)(content, /\.(?:jsx?|mjs|cjs)$/.test(file) ? 'javascript' : 'typescript');
2405
2638
  // 1. Dispatch sites: `(new )?<ref>[<ident-key>]` followed by a call or a chained method.
2406
2639
  // A quoted-string key (`['save']`) does NOT match — that's a static access, not dispatch.
2407
- REGISTRY_DISPATCH_RE.lastIndex = 0;
2640
+ const lineOf = (0, synth_utils_1.makeLineAt)(safe, 1);
2408
2641
  const dispatches = [];
2409
- let dm;
2410
- while ((dm = REGISTRY_DISPATCH_RE.exec(safe))) {
2642
+ for (let dm = nextRegistryDispatch(safe, 0); dm; dm = nextRegistryDispatch(safe, dm.index + dm[0].length)) {
2411
2643
  const win = safe.slice(dm.index, dm.index + 160);
2412
2644
  const cm = /\]\s*\([^)]*\)\s*\.\s*([A-Za-z_$][\w$]*)/.exec(win) || /\]\s*\.\s*([A-Za-z_$][\w$]*)/.exec(win);
2413
- dispatches.push({ ref: dm[1], line: safe.slice(0, dm.index).split('\n').length, chained: cm ? cm[1] : null });
2645
+ dispatches.push({ ref: dm[1], line: lineOf(dm.index), chained: cm ? cm[1] : null });
2414
2646
  }
2415
2647
  if (!dispatches.length)
2416
2648
  continue;
@@ -2431,7 +2663,7 @@ async function objectRegistryEdges(ctx, onYield) {
2431
2663
  continue;
2432
2664
  const names = registryEntryNames(body); // depth-0 `key: Identifier` entries only
2433
2665
  if (names.length >= REGISTRY_MIN_ENTRIES) {
2434
- registries.set(lhs, { names, line: safe.slice(0, am.index).split('\n').length });
2666
+ registries.set(lhs, { names, line: lineOf(am.index) });
2435
2667
  }
2436
2668
  }
2437
2669
  if (!registries.size)
@@ -2442,7 +2674,7 @@ async function objectRegistryEdges(ctx, onYield) {
2442
2674
  const reg = registries.get(norm(d.ref));
2443
2675
  if (!reg)
2444
2676
  continue;
2445
- const disp = enclosingFn(nodesInFile, d.line);
2677
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, d.line);
2446
2678
  if (!disp)
2447
2679
  continue;
2448
2680
  let added = 0;
@@ -2601,7 +2833,7 @@ async function piniaStoreEdges(ctx, onYield) {
2601
2833
  continue;
2602
2834
  const method = cm[2];
2603
2835
  const line = safe.slice(0, cm.index).split('\n').length;
2604
- const disp = enclosingFn(nodesInFile, line) ?? fallbackDispatcher;
2836
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line) ?? fallbackDispatcher;
2605
2837
  if (!disp)
2606
2838
  continue;
2607
2839
  const target = ctx
@@ -2699,7 +2931,7 @@ async function vuexDispatchEdges(ctx, onYield) {
2699
2931
  while ((m = VUEX_DISPATCH_RE.exec(safe)) && added < VUEX_FANOUT_CAP) {
2700
2932
  const key = m[1];
2701
2933
  const line = safe.slice(0, m.index).split('\n').length;
2702
- const disp = enclosingFn(nodesInFile, line) ?? fallback;
2934
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line) ?? fallback;
2703
2935
  if (!disp)
2704
2936
  continue;
2705
2937
  const target = resolve(key, file);
@@ -2804,7 +3036,7 @@ async function celeryDispatchEdges(ctx, onYield) {
2804
3036
  while ((m = CELERY_DISPATCH_RE.exec(safe)) && added < CELERY_FANOUT_CAP) {
2805
3037
  const name = m[1];
2806
3038
  const line = safe.slice(0, m.index).split('\n').length;
2807
- const disp = enclosingFn(nodesInFile, line);
3039
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
2808
3040
  if (!disp)
2809
3041
  continue; // module-level dispatch — no source symbol to attribute
2810
3042
  const target = resolve(name, file);
@@ -2946,7 +3178,7 @@ async function springEventEdges(ctx, onYield) {
2946
3178
  if (!targets || !targets.length)
2947
3179
  continue;
2948
3180
  const line = safe.slice(0, m.index).split('\n').length;
2949
- const disp = enclosingFn(nodesInFile, line);
3181
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
2950
3182
  if (!disp)
2951
3183
  continue;
2952
3184
  for (const target of targets) {
@@ -3074,7 +3306,7 @@ async function mediatrDispatchEdges(ctx, onYield) {
3074
3306
  if (!MEDIATR_RECEIVER_RE.test(m[1]))
3075
3307
  continue; // not a mediator (MessagingCenter, HttpClient, …)
3076
3308
  const line = safe.slice(0, m.index).split('\n').length;
3077
- const disp = enclosingFn(nodesInFile, line);
3309
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
3078
3310
  if (!disp)
3079
3311
  continue;
3080
3312
  const type = resolveMediatrArgType(m[2], safeLines, disp.startLine, line);
@@ -3174,7 +3406,7 @@ async function sidekiqDispatchEdges(ctx, onYield) {
3174
3406
  let added = 0;
3175
3407
  while ((m = SIDEKIQ_DISPATCH_RE.exec(safe)) && added < SIDEKIQ_FANOUT_CAP) {
3176
3408
  const line = safe.slice(0, m.index).split('\n').length;
3177
- const disp = enclosingFn(nodesInFile, line);
3409
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
3178
3410
  if (!disp)
3179
3411
  continue;
3180
3412
  const target = resolve(m[1]);
@@ -3366,13 +3598,11 @@ async function nixOptionPathEdges(queries, onYield) {
3366
3598
  const byFile = new Map();
3367
3599
  let scanned = 0;
3368
3600
  for (const kind of ['variable', 'function']) {
3369
- for (const node of queries.iterateNodesByKind(kind)) {
3601
+ for (const node of queries.iterateNodesByKindIn(kind, ['nix'])) {
3370
3602
  if ((++scanned255 & 63) === 0)
3371
3603
  await onYield();
3372
3604
  if ((++scanned & 0x3fff) === 0 && onYield)
3373
3605
  await onYield();
3374
- if (node.language !== 'nix')
3375
- continue;
3376
3606
  const segs = nixLeadingPlainSegments(node.name);
3377
3607
  if (segs.length === 0)
3378
3608
  continue;
@@ -3397,7 +3627,7 @@ async function nixOptionPathEdges(queries, onYield) {
3397
3627
  // own namespace (`attrsOf (submodule { options = ...; })`) — its internals
3398
3628
  // are not globally addressable, so the sentinel blocks registration below it
3399
3629
  // while still excluding the region from write candidates.
3400
- const SUBMODULE = 'submodule';
3630
+ const SUBMODULE = '\u0000submodule';
3401
3631
  const decls = new Map();
3402
3632
  const writes = [];
3403
3633
  const register = (path, rec) => {
@@ -3487,11 +3717,10 @@ async function erlangBehaviourDispatchEdges(queries, ctx, onYield) {
3487
3717
  // Cheap language gate: no Erlang modules → no cost beyond one streamed
3488
3718
  // kind scan (never a materialized array of every namespace — #1212).
3489
3719
  const erlangModules = [];
3490
- for (const n of queries.iterateNodesByKind('namespace')) {
3720
+ for (const n of queries.iterateNodesByKindIn('namespace', ['erlang'])) {
3491
3721
  if ((++scanned255 & 63) === 0)
3492
3722
  await onYield();
3493
- if (n.language === 'erlang')
3494
- erlangModules.push(n);
3723
+ erlangModules.push(n);
3495
3724
  }
3496
3725
  if (erlangModules.length === 0)
3497
3726
  return [];
@@ -3602,7 +3831,7 @@ async function erlangBehaviourDispatchEdges(queries, ctx, onYield) {
3602
3831
  if (targets.length === 0 || targets.length > ERLANG_BEHAVIOUR_FANOUT_CAP)
3603
3832
  continue;
3604
3833
  const line = safe.slice(0, m.index).split('\n').length;
3605
- const disp = enclosingFn(nodesInFile, line);
3834
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
3606
3835
  if (!disp)
3607
3836
  continue;
3608
3837
  for (const target of targets) {
@@ -3757,7 +3986,7 @@ async function laravelEventEdges(ctx, onYield) {
3757
3986
  if (!targets)
3758
3987
  continue;
3759
3988
  const line = safe.slice(0, m.index).split('\n').length;
3760
- const disp = enclosingFn(nodesInFile, line);
3989
+ const disp = (0, synth_utils_1.enclosingFn)(nodesInFile, line);
3761
3990
  if (!disp)
3762
3991
  continue;
3763
3992
  for (const target of targets.values()) {
@@ -3781,27 +4010,43 @@ async function laravelEventEdges(ctx, onYield) {
3781
4010
  }
3782
4011
  return edges;
3783
4012
  }
3784
- /**
3785
- * Synthesize dispatcher→callback edges (field observers + EventEmitters +
3786
- * React re-render + JSX children + Vue templates + SvelteKit load + RN event
3787
- * channel + Fabric native-impl + MyBatis Java↔XML + Gin middleware chain +
3788
- * Redux-thunk dispatch chain + object-literal registry dispatch + RTK Query
3789
- * generated-hook → endpoint + Pinia useStore().action() + Vuex string dispatch +
3790
- * Celery task .delay()/.apply_async() → task body + Spring publishEvent → @EventListener +
3791
- * MediatR Send/Publish → IRequestHandler/INotificationHandler +
3792
- * Sidekiq Worker.perform_async → #perform + Laravel event(new X) → listener handle).
3793
- * Returns the count added. Never throws into indexing — callers wrap in try/catch.
3794
- */
3795
- /**
3796
- * Number of progress steps synthesizeCallbackEdges reports: one per `__mark()`
3797
- * call (every synthesis pass, plus the dedupe-merge and edge-insert steps).
3798
- * Cosmetic only — drift just makes the progress bar end early or jump — and a
3799
- * test pins it to the actual step count (registry passes + the fixed
3800
- * pre/post marks) so adding a pass without bumping this fails loudly instead
3801
- * of silently skewing the bar.
3802
- */
3803
- const JS_FAMILY = ['typescript', 'javascript', 'tsx', 'jsx'];
3804
4013
  const ALWAYS = () => true;
4014
+ /** Conservative input gates for SYNTH_PASSES; keep these in sync when adding a pass. */
4015
+ function hasSynthesisPattern(filePath, content) {
4016
+ // These passes consume declarations/layouts as well as dispatch sites. A
4017
+ // header or markup edit can change a channel whose endpoints live elsewhere.
4018
+ if (/\.(?:vue|svelte|dfm|fmx|nix|xml)$/.test(filePath))
4019
+ return true;
4020
+ if (/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx|cppm|ipp|inl|tcc|def|inc|tbl)$/i.test(filePath) &&
4021
+ /\b(?:struct|union|typedef|virtual|override)\b|#\s*(?:include|define|if)|=|->|\[/.test(content))
4022
+ return true;
4023
+ if (/\b(?:class|interface|protocol|trait|impl|extends|implements|expect|actual)\b/.test(content))
4024
+ return true;
4025
+ if (/\.go$/.test(filePath) && /\b(?:struct|interface)\b|\bfunc\s*\(/.test(content))
4026
+ return true;
4027
+ if ((0, tier_synthesizer_1.hasCrossTierPattern)(content) || (0, tier_synthesizer_1.hasTestRequestPattern)(filePath, content))
4028
+ return true;
4029
+ if (/\b(?:render|build|setState|defineStore|createStore|createApi|Store|href|sendEvent|sendEventWithName)\b|<\/|\/>/.test(content))
4030
+ return true;
4031
+ if (/\.(?:forEach|append|add|push|insert|fire|dispatchEvent|addListener|Use|GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|Any|Handle)\s*\(/.test(content))
4032
+ return true;
4033
+ if (/[\w$]\s*\[\s*[A-Za-z_$]/.test(content) || /\b(?:dispatch|commit)\s*\(/.test(content))
4034
+ return true;
4035
+ const patterns = [THUNK_DECL_RE, CELERY_TASK_DECORATOR_RE, CELERY_DISPATCH_RE,
4036
+ SPRING_LISTENER_ANNO_RE, SPRING_APP_LISTENER_RE, SPRING_PUBLISH_RE,
4037
+ MEDIATR_HANDLER_BASE_RE, MEDIATR_DISPATCH_RE, SIDEKIQ_WORKER_RE, SIDEKIQ_DISPATCH_RE,
4038
+ ERLANG_CALLBACK_DECL_RE, ERLANG_DISPATCH_RE, LARAVEL_DISPATCH_RE, ARKUI_EMITTER_CALL_RE,
4039
+ ARKUI_ROUTER_RE];
4040
+ for (const re of patterns) {
4041
+ re.lastIndex = 0;
4042
+ const matches = re.test(content);
4043
+ re.lastIndex = 0;
4044
+ if (matches)
4045
+ return true;
4046
+ }
4047
+ // Field-backed observers use method-name gates rather than fixed call names.
4048
+ return (content.match(/[A-Za-z_$][\w$]*/g) ?? []).some((name) => REGISTRAR_NAME.test(name) || DISPATCHER_NAME.test(name));
4049
+ }
3805
4050
  /**
3806
4051
  * The independent passes, in MERGE ORDER — the first-seen dedup in
3807
4052
  * synthesizeCallbackEdges follows this array, so reordering entries changes
@@ -3812,6 +4057,15 @@ const ALWAYS = () => true;
3812
4057
  exports.SYNTH_PASSES = [
3813
4058
  { name: 'fieldEdges', gate: ALWAYS, run: (q, c, y) => fieldChannelEdges(q, c, y) },
3814
4059
  { name: 'closureCollEdges', gate: ALWAYS, run: (q, c, y) => closureCollectionEdges(q, c, y) },
4060
+ // Cross-tier channels — a client's `fetch('/api/x')` onto its own route,
4061
+ // a queue job onto its consumer, a bus / socket event onto its handler.
4062
+ // Before the in-process emitter pass: the same (source, target) pair
4063
+ // keeps the more specific edge — the one that says which tier it crosses.
4064
+ { name: 'tierEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => (0, tier_synthesizer_1.crossTierEdges)(c, y) },
4065
+ // A Spring / Laravel test's request (`mockMvc.perform(post("/x"))`,
4066
+ // `$this->postJson('api/x')`) onto the route it reaches, so the handler
4067
+ // counts as tested.
4068
+ { name: 'testRequestEdges', gate: (has) => has('java', 'kotlin', 'php'), run: (_q, c, y) => (0, tier_synthesizer_1.testRequestEdges)(c, y) },
3815
4069
  { name: 'emitterEdges', gate: ALWAYS, run: (_q, c, y) => eventEmitterEdges(c, y) },
3816
4070
  { name: 'renderEdges', gate: ALWAYS, run: (q, c, y) => reactRenderEdges(q, c, y) },
3817
4071
  { name: 'jsxEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => reactJsxChildEdges(c, y) },
@@ -3868,8 +4122,33 @@ exports.SYNTH_PASSES = [
3868
4122
  run: (q, c, y, sub) => (0, c_fnptr_synthesizer_1.cFnPointerDispatchEdges)(q, c, y, sub),
3869
4123
  },
3870
4124
  { name: 'goframeEdges', gate: (has) => has('go'), run: (_q, c, y) => (0, goframe_synthesizer_1.goframeRouteEdges)(c, y) },
4125
+ // `router.push(await helper())` — the helper's return literals are the screens.
4126
+ { name: 'expoRouterReturnEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => (0, expo_router_synthesizer_1.expoRouterReturnEdges)(c, y) },
4127
+ // `<Link href="/x">` / an internal `<a href>` — markup, not a call; the component navigates.
4128
+ { name: 'nextLinkEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => (0, next_router_synthesizer_1.nextLinkEdges)(c, y) },
4129
+ { name: 'reactRouterLinkEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => (0, react_router_synthesizer_1.reactRouterLinkEdges)(c, y) },
4130
+ { name: 'tanstackLinkEdges', gate: (has) => has(...JS_FAMILY), run: (_q, c, y) => (0, tanstack_router_synthesizer_1.tanstackLinkEdges)(c, y) },
4131
+ { name: 'vueRouterLinkEdges', gate: (has) => has('vue', ...JS_FAMILY), run: (_q, c, y) => (0, vue_router_synthesizer_1.vueRouterLinkEdges)(c, y) },
4132
+ // An Angular template: the child components it renders and its `routerLink`s.
4133
+ { name: 'angularTemplateEdges', gate: (has) => has('typescript'), run: (_q, c, y) => (0, angular_template_synthesizer_1.angularTemplateEdges)(c, y) },
4134
+ { name: 'svelteKitPageEdges', gate: (has) => has('svelte'), run: (_q, c, y) => (0, sveltekit_synthesizer_1.svelteKitPageComponentEdges)(c, y) },
4135
+ { name: 'svelteKitLinkEdges', gate: (has) => has('svelte'), run: (_q, c, y) => (0, sveltekit_synthesizer_1.svelteKitLinkEdges)(c, y) },
3871
4136
  { name: 'nixOptionEdges', gate: (has) => has('nix'), run: (q, _c, y) => nixOptionPathEdges(q, y) },
3872
4137
  ];
4138
+ /**
4139
+ * Rough relative cost of the passes that run longest on large repos. Only
4140
+ * the pooled dispatch ORDER reads it — heaviest first, so the longest passes
4141
+ * start before the short ones fill the workers; unlisted passes keep registry
4142
+ * order after these. A wrong hint costs wall time, never edges.
4143
+ */
4144
+ const SYNTH_PASS_COST_HINT = {
4145
+ cFnPtrEdges: 100, registryEdges: 60, tierEdges: 55, jsxEdges: 25, rnEventEdgesList: 24,
4146
+ ifaceEdges: 18, flutterEdges: 16, cppEdges: 15, emitterEdges: 12, fieldEdges: 11,
4147
+ mybatisEdges: 10, vuexEdges: 8, closureCollEdges: 6, piniaEdges: 5, renderEdges: 4,
4148
+ };
4149
+ function synthPassCostHint(name) {
4150
+ return SYNTH_PASS_COST_HINT[name] ?? 0;
4151
+ }
3873
4152
  /** Fixed non-registry steps: goMethodContains, goImplements, dedupe-merge, insertMergedEdges. */
3874
4153
  const FIXED_SYNTH_STEPS = 4;
3875
4154
  exports.SYNTH_PROGRESS_STEPS = exports.SYNTH_PASSES.length + FIXED_SYNTH_STEPS;
@@ -3881,7 +4160,10 @@ pool,
3881
4160
  // WAL-valve writer backstop (WalCheckpointValve.backpressure), called at
3882
4161
  // pool-idle points in the edge-insert loops below — the passes themselves
3883
4162
  // only read; every write in this function happens with the pool idle.
3884
- backpressure) {
4163
+ backpressure,
4164
+ // Main-thread work to run while the pool computes the passes (the main
4165
+ // thread otherwise only waits there) — e.g. building a deferred index.
4166
+ whilePoolBusy) {
3885
4167
  // Each sub-pass below is a whole-graph scan, and there are ~30 of them, all
3886
4168
  // running synchronously on the indexer's main thread. Their AGGREGATE can run
3887
4169
  // for well over a minute on a large repo — long enough for the #850 liveness
@@ -4007,8 +4289,23 @@ backpressure) {
4007
4289
  // synthesized edges; the index still completes.
4008
4290
  const MAIN_RETRY_MAX_NODES = 1_500_000;
4009
4291
  const graphNodes = queries.getNodeAndEdgeCount().nodes;
4292
+ // Files whose text could feed a pass (inputs that produce NO edges included,
4293
+ // e.g. an over-cap channel: deleting one may make the full pass viable). It
4294
+ // depends only on the files, so with a pool the main thread reads them while
4295
+ // the workers run the passes instead of after.
4296
+ const collectInputs = async () => {
4297
+ const found = [];
4298
+ for (const file of ctx.getAllFiles()) {
4299
+ const content = ctx.readFile(file);
4300
+ if (content !== null && hasSynthesisPattern(file, content))
4301
+ found.push(file);
4302
+ await yieldToLoop();
4303
+ }
4304
+ return found;
4305
+ };
4306
+ let inputs = null;
4010
4307
  if (pool && gatedIn.length > 1) {
4011
- await Promise.all(gatedIn.map(async (i) => {
4308
+ const runPooled = async (i) => {
4012
4309
  const pass = exports.SYNTH_PASSES[i];
4013
4310
  try {
4014
4311
  const out = await pool.runSynthPass(pass.name);
@@ -4027,7 +4324,25 @@ backpressure) {
4027
4324
  // mismatch): retry this one pass on the main thread.
4028
4325
  await runPassOnMain(i);
4029
4326
  }
4030
- }));
4327
+ };
4328
+ // One pass per worker at a time, heaviest first. Handing every pass out
4329
+ // at once split them by count, and a worker interleaves what it holds, so
4330
+ // a heavy pass finished only with its worker's whole share: on vscode the
4331
+ // 6s registry pass ended ~16s in. Pulling keeps workers busy until the
4332
+ // queue drains. Edges merge by registry index below, so order is free.
4333
+ const lanes = Math.min(pool.size ?? gatedIn.length, gatedIn.length);
4334
+ const queue = [...gatedIn].sort((a, b) => synthPassCostHint(exports.SYNTH_PASSES[b].name) - synthPassCostHint(exports.SYNTH_PASSES[a].name) || a - b);
4335
+ const lane = async () => {
4336
+ for (let i = queue.shift(); i !== undefined; i = queue.shift())
4337
+ await runPooled(i);
4338
+ };
4339
+ const fanOut = Promise.all(Array.from({ length: lanes }, lane));
4340
+ // Observed now, awaited below: a rejection while the scan runs must not
4341
+ // surface as an unhandled one.
4342
+ fanOut.catch(() => undefined);
4343
+ whilePoolBusy?.();
4344
+ inputs = await collectInputs();
4345
+ await fanOut;
4031
4346
  }
4032
4347
  else {
4033
4348
  for (const i of gatedIn) {
@@ -4052,6 +4367,7 @@ backpressure) {
4052
4367
  await yieldToLoop();
4053
4368
  await foldIfOver();
4054
4369
  }
4370
+ queries.replaceSynthesisInputs(inputs ?? await collectInputs());
4055
4371
  __mark('insertMergedEdges');
4056
4372
  return merged.length + goImpl.length + goMethodContains.length;
4057
4373
  }