@aroman22/codegraph-vba-darwin-arm64 1.3.3

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 (800) hide show
  1. package/bin/codegraph +14 -0
  2. package/lib/dist/bin/codegraph.d.ts +26 -0
  3. package/lib/dist/bin/codegraph.d.ts.map +1 -0
  4. package/lib/dist/bin/codegraph.js +2018 -0
  5. package/lib/dist/bin/codegraph.js.map +1 -0
  6. package/lib/dist/bin/command-supervision.d.ts +12 -0
  7. package/lib/dist/bin/command-supervision.d.ts.map +1 -0
  8. package/lib/dist/bin/command-supervision.js +76 -0
  9. package/lib/dist/bin/command-supervision.js.map +1 -0
  10. package/lib/dist/bin/fatal-handler.d.ts +20 -0
  11. package/lib/dist/bin/fatal-handler.d.ts.map +1 -0
  12. package/lib/dist/bin/fatal-handler.js +118 -0
  13. package/lib/dist/bin/fatal-handler.js.map +1 -0
  14. package/lib/dist/bin/node-version-check.d.ts +37 -0
  15. package/lib/dist/bin/node-version-check.d.ts.map +1 -0
  16. package/lib/dist/bin/node-version-check.js +79 -0
  17. package/lib/dist/bin/node-version-check.js.map +1 -0
  18. package/lib/dist/bin/uninstall.d.ts +14 -0
  19. package/lib/dist/bin/uninstall.d.ts.map +1 -0
  20. package/lib/dist/bin/uninstall.js +36 -0
  21. package/lib/dist/bin/uninstall.js.map +1 -0
  22. package/lib/dist/context/formatter.d.ts +30 -0
  23. package/lib/dist/context/formatter.d.ts.map +1 -0
  24. package/lib/dist/context/formatter.js +263 -0
  25. package/lib/dist/context/formatter.js.map +1 -0
  26. package/lib/dist/context/index.d.ts +119 -0
  27. package/lib/dist/context/index.d.ts.map +1 -0
  28. package/lib/dist/context/index.js +1296 -0
  29. package/lib/dist/context/index.js.map +1 -0
  30. package/lib/dist/context/markers.d.ts +19 -0
  31. package/lib/dist/context/markers.d.ts.map +1 -0
  32. package/lib/dist/context/markers.js +22 -0
  33. package/lib/dist/context/markers.js.map +1 -0
  34. package/lib/dist/db/index.d.ts +122 -0
  35. package/lib/dist/db/index.d.ts.map +1 -0
  36. package/lib/dist/db/index.js +296 -0
  37. package/lib/dist/db/index.js.map +1 -0
  38. package/lib/dist/db/migrations.d.ts +44 -0
  39. package/lib/dist/db/migrations.d.ts.map +1 -0
  40. package/lib/dist/db/migrations.js +140 -0
  41. package/lib/dist/db/migrations.js.map +1 -0
  42. package/lib/dist/db/queries.d.ts +402 -0
  43. package/lib/dist/db/queries.d.ts.map +1 -0
  44. package/lib/dist/db/queries.js +1626 -0
  45. package/lib/dist/db/queries.js.map +1 -0
  46. package/lib/dist/db/schema.sql +152 -0
  47. package/lib/dist/db/sqlite-adapter.d.ts +53 -0
  48. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
  49. package/lib/dist/db/sqlite-adapter.js +117 -0
  50. package/lib/dist/db/sqlite-adapter.js.map +1 -0
  51. package/lib/dist/directory.d.ts +179 -0
  52. package/lib/dist/directory.d.ts.map +1 -0
  53. package/lib/dist/directory.js +625 -0
  54. package/lib/dist/directory.js.map +1 -0
  55. package/lib/dist/errors.d.ts +136 -0
  56. package/lib/dist/errors.d.ts.map +1 -0
  57. package/lib/dist/errors.js +219 -0
  58. package/lib/dist/errors.js.map +1 -0
  59. package/lib/dist/extraction/astro-extractor.d.ts +79 -0
  60. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -0
  61. package/lib/dist/extraction/astro-extractor.js +320 -0
  62. package/lib/dist/extraction/astro-extractor.js.map +1 -0
  63. package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
  64. package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
  65. package/lib/dist/extraction/dfm-extractor.js +151 -0
  66. package/lib/dist/extraction/dfm-extractor.js.map +1 -0
  67. package/lib/dist/extraction/extraction-version.d.ts +25 -0
  68. package/lib/dist/extraction/extraction-version.d.ts.map +1 -0
  69. package/lib/dist/extraction/extraction-version.js +28 -0
  70. package/lib/dist/extraction/extraction-version.js.map +1 -0
  71. package/lib/dist/extraction/function-ref.d.ts +118 -0
  72. package/lib/dist/extraction/function-ref.d.ts.map +1 -0
  73. package/lib/dist/extraction/function-ref.js +727 -0
  74. package/lib/dist/extraction/function-ref.js.map +1 -0
  75. package/lib/dist/extraction/generated-detection.d.ts +30 -0
  76. package/lib/dist/extraction/generated-detection.d.ts.map +1 -0
  77. package/lib/dist/extraction/generated-detection.js +83 -0
  78. package/lib/dist/extraction/generated-detection.js.map +1 -0
  79. package/lib/dist/extraction/grammars.d.ts +128 -0
  80. package/lib/dist/extraction/grammars.d.ts.map +1 -0
  81. package/lib/dist/extraction/grammars.js +537 -0
  82. package/lib/dist/extraction/grammars.js.map +1 -0
  83. package/lib/dist/extraction/index.d.ts +187 -0
  84. package/lib/dist/extraction/index.d.ts.map +1 -0
  85. package/lib/dist/extraction/index.js +1951 -0
  86. package/lib/dist/extraction/index.js.map +1 -0
  87. package/lib/dist/extraction/languages/c-cpp.d.ts +12 -0
  88. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  89. package/lib/dist/extraction/languages/c-cpp.js +275 -0
  90. package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
  91. package/lib/dist/extraction/languages/csharp.d.ts +25 -0
  92. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
  93. package/lib/dist/extraction/languages/csharp.js +175 -0
  94. package/lib/dist/extraction/languages/csharp.js.map +1 -0
  95. package/lib/dist/extraction/languages/dart.d.ts +3 -0
  96. package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
  97. package/lib/dist/extraction/languages/dart.js +374 -0
  98. package/lib/dist/extraction/languages/dart.js.map +1 -0
  99. package/lib/dist/extraction/languages/go.d.ts +3 -0
  100. package/lib/dist/extraction/languages/go.d.ts.map +1 -0
  101. package/lib/dist/extraction/languages/go.js +111 -0
  102. package/lib/dist/extraction/languages/go.js.map +1 -0
  103. package/lib/dist/extraction/languages/index.d.ts +10 -0
  104. package/lib/dist/extraction/languages/index.d.ts.map +1 -0
  105. package/lib/dist/extraction/languages/index.js +53 -0
  106. package/lib/dist/extraction/languages/index.js.map +1 -0
  107. package/lib/dist/extraction/languages/java.d.ts +3 -0
  108. package/lib/dist/extraction/languages/java.d.ts.map +1 -0
  109. package/lib/dist/extraction/languages/java.js +315 -0
  110. package/lib/dist/extraction/languages/java.js.map +1 -0
  111. package/lib/dist/extraction/languages/javascript.d.ts +3 -0
  112. package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
  113. package/lib/dist/extraction/languages/javascript.js +106 -0
  114. package/lib/dist/extraction/languages/javascript.js.map +1 -0
  115. package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
  116. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
  117. package/lib/dist/extraction/languages/kotlin.js +379 -0
  118. package/lib/dist/extraction/languages/kotlin.js.map +1 -0
  119. package/lib/dist/extraction/languages/lua.d.ts +3 -0
  120. package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
  121. package/lib/dist/extraction/languages/lua.js +150 -0
  122. package/lib/dist/extraction/languages/lua.js.map +1 -0
  123. package/lib/dist/extraction/languages/luau.d.ts +3 -0
  124. package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
  125. package/lib/dist/extraction/languages/luau.js +37 -0
  126. package/lib/dist/extraction/languages/luau.js.map +1 -0
  127. package/lib/dist/extraction/languages/objc.d.ts +3 -0
  128. package/lib/dist/extraction/languages/objc.d.ts.map +1 -0
  129. package/lib/dist/extraction/languages/objc.js +175 -0
  130. package/lib/dist/extraction/languages/objc.js.map +1 -0
  131. package/lib/dist/extraction/languages/pascal.d.ts +3 -0
  132. package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
  133. package/lib/dist/extraction/languages/pascal.js +77 -0
  134. package/lib/dist/extraction/languages/pascal.js.map +1 -0
  135. package/lib/dist/extraction/languages/php.d.ts +3 -0
  136. package/lib/dist/extraction/languages/php.d.ts.map +1 -0
  137. package/lib/dist/extraction/languages/php.js +196 -0
  138. package/lib/dist/extraction/languages/php.js.map +1 -0
  139. package/lib/dist/extraction/languages/python.d.ts +3 -0
  140. package/lib/dist/extraction/languages/python.d.ts.map +1 -0
  141. package/lib/dist/extraction/languages/python.js +56 -0
  142. package/lib/dist/extraction/languages/python.js.map +1 -0
  143. package/lib/dist/extraction/languages/r.d.ts +3 -0
  144. package/lib/dist/extraction/languages/r.d.ts.map +1 -0
  145. package/lib/dist/extraction/languages/r.js +314 -0
  146. package/lib/dist/extraction/languages/r.js.map +1 -0
  147. package/lib/dist/extraction/languages/ruby.d.ts +3 -0
  148. package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
  149. package/lib/dist/extraction/languages/ruby.js +149 -0
  150. package/lib/dist/extraction/languages/ruby.js.map +1 -0
  151. package/lib/dist/extraction/languages/rust.d.ts +3 -0
  152. package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
  153. package/lib/dist/extraction/languages/rust.js +142 -0
  154. package/lib/dist/extraction/languages/rust.js.map +1 -0
  155. package/lib/dist/extraction/languages/scala.d.ts +3 -0
  156. package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
  157. package/lib/dist/extraction/languages/scala.js +209 -0
  158. package/lib/dist/extraction/languages/scala.js.map +1 -0
  159. package/lib/dist/extraction/languages/swift.d.ts +3 -0
  160. package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
  161. package/lib/dist/extraction/languages/swift.js +152 -0
  162. package/lib/dist/extraction/languages/swift.js.map +1 -0
  163. package/lib/dist/extraction/languages/typescript.d.ts +16 -0
  164. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
  165. package/lib/dist/extraction/languages/typescript.js +167 -0
  166. package/lib/dist/extraction/languages/typescript.js.map +1 -0
  167. package/lib/dist/extraction/liquid-extractor.d.ts +59 -0
  168. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
  169. package/lib/dist/extraction/liquid-extractor.js +357 -0
  170. package/lib/dist/extraction/liquid-extractor.js.map +1 -0
  171. package/lib/dist/extraction/mybatis-extractor.d.ts +48 -0
  172. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  173. package/lib/dist/extraction/mybatis-extractor.js +198 -0
  174. package/lib/dist/extraction/mybatis-extractor.js.map +1 -0
  175. package/lib/dist/extraction/parse-pool.d.ts +126 -0
  176. package/lib/dist/extraction/parse-pool.d.ts.map +1 -0
  177. package/lib/dist/extraction/parse-pool.js +319 -0
  178. package/lib/dist/extraction/parse-pool.js.map +1 -0
  179. package/lib/dist/extraction/parse-worker.d.ts +8 -0
  180. package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
  181. package/lib/dist/extraction/parse-worker.js +97 -0
  182. package/lib/dist/extraction/parse-worker.js.map +1 -0
  183. package/lib/dist/extraction/razor-extractor.d.ts +42 -0
  184. package/lib/dist/extraction/razor-extractor.d.ts.map +1 -0
  185. package/lib/dist/extraction/razor-extractor.js +285 -0
  186. package/lib/dist/extraction/razor-extractor.js.map +1 -0
  187. package/lib/dist/extraction/sql-query-extractor.d.ts +25 -0
  188. package/lib/dist/extraction/sql-query-extractor.d.ts.map +1 -0
  189. package/lib/dist/extraction/sql-query-extractor.js +177 -0
  190. package/lib/dist/extraction/sql-query-extractor.js.map +1 -0
  191. package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
  192. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
  193. package/lib/dist/extraction/svelte-extractor.js +275 -0
  194. package/lib/dist/extraction/svelte-extractor.js.map +1 -0
  195. package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  196. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  197. package/lib/dist/extraction/tree-sitter-helpers.js +152 -0
  198. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
  199. package/lib/dist/extraction/tree-sitter-types.d.ts +239 -0
  200. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  201. package/lib/dist/extraction/tree-sitter-types.js +10 -0
  202. package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
  203. package/lib/dist/extraction/tree-sitter.d.ts +647 -0
  204. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
  205. package/lib/dist/extraction/tree-sitter.js +5647 -0
  206. package/lib/dist/extraction/tree-sitter.js.map +1 -0
  207. package/lib/dist/extraction/vba-extractor.d.ts +394 -0
  208. package/lib/dist/extraction/vba-extractor.d.ts.map +1 -0
  209. package/lib/dist/extraction/vba-extractor.js +1716 -0
  210. package/lib/dist/extraction/vba-extractor.js.map +1 -0
  211. package/lib/dist/extraction/vba-form-extractor.d.ts +89 -0
  212. package/lib/dist/extraction/vba-form-extractor.d.ts.map +1 -0
  213. package/lib/dist/extraction/vba-form-extractor.js +367 -0
  214. package/lib/dist/extraction/vba-form-extractor.js.map +1 -0
  215. package/lib/dist/extraction/vba-preprocess.d.ts +81 -0
  216. package/lib/dist/extraction/vba-preprocess.d.ts.map +1 -0
  217. package/lib/dist/extraction/vba-preprocess.js +287 -0
  218. package/lib/dist/extraction/vba-preprocess.js.map +1 -0
  219. package/lib/dist/extraction/vue-extractor.d.ts +51 -0
  220. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
  221. package/lib/dist/extraction/vue-extractor.js +254 -0
  222. package/lib/dist/extraction/vue-extractor.js.map +1 -0
  223. package/lib/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  224. package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  225. package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  226. package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  227. package/lib/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  228. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  229. package/lib/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  230. package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  231. package/lib/dist/extraction/wasm-runtime-flags.js +106 -0
  232. package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -0
  233. package/lib/dist/graph/index.d.ts +8 -0
  234. package/lib/dist/graph/index.d.ts.map +1 -0
  235. package/lib/dist/graph/index.js +13 -0
  236. package/lib/dist/graph/index.js.map +1 -0
  237. package/lib/dist/graph/queries.d.ts +106 -0
  238. package/lib/dist/graph/queries.d.ts.map +1 -0
  239. package/lib/dist/graph/queries.js +339 -0
  240. package/lib/dist/graph/queries.js.map +1 -0
  241. package/lib/dist/graph/traversal.d.ts +127 -0
  242. package/lib/dist/graph/traversal.d.ts.map +1 -0
  243. package/lib/dist/graph/traversal.js +540 -0
  244. package/lib/dist/graph/traversal.js.map +1 -0
  245. package/lib/dist/index.d.ts +563 -0
  246. package/lib/dist/index.d.ts.map +1 -0
  247. package/lib/dist/index.js +1041 -0
  248. package/lib/dist/index.js.map +1 -0
  249. package/lib/dist/installer/config-writer.d.ts +28 -0
  250. package/lib/dist/installer/config-writer.d.ts.map +1 -0
  251. package/lib/dist/installer/config-writer.js +91 -0
  252. package/lib/dist/installer/config-writer.js.map +1 -0
  253. package/lib/dist/installer/index.d.ts +100 -0
  254. package/lib/dist/installer/index.d.ts.map +1 -0
  255. package/lib/dist/installer/index.js +524 -0
  256. package/lib/dist/installer/index.js.map +1 -0
  257. package/lib/dist/installer/instructions-template.d.ts +41 -0
  258. package/lib/dist/installer/instructions-template.d.ts.map +1 -0
  259. package/lib/dist/installer/instructions-template.js +53 -0
  260. package/lib/dist/installer/instructions-template.js.map +1 -0
  261. package/lib/dist/installer/targets/antigravity.d.ts +57 -0
  262. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -0
  263. package/lib/dist/installer/targets/antigravity.js +308 -0
  264. package/lib/dist/installer/targets/antigravity.js.map +1 -0
  265. package/lib/dist/installer/targets/claude.d.ts +62 -0
  266. package/lib/dist/installer/targets/claude.d.ts.map +1 -0
  267. package/lib/dist/installer/targets/claude.js +454 -0
  268. package/lib/dist/installer/targets/claude.js.map +1 -0
  269. package/lib/dist/installer/targets/codex.d.ts +18 -0
  270. package/lib/dist/installer/targets/codex.d.ts.map +1 -0
  271. package/lib/dist/installer/targets/codex.js +185 -0
  272. package/lib/dist/installer/targets/codex.js.map +1 -0
  273. package/lib/dist/installer/targets/cursor.d.ts +35 -0
  274. package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
  275. package/lib/dist/installer/targets/cursor.js +254 -0
  276. package/lib/dist/installer/targets/cursor.js.map +1 -0
  277. package/lib/dist/installer/targets/gemini.d.ts +26 -0
  278. package/lib/dist/installer/targets/gemini.d.ts.map +1 -0
  279. package/lib/dist/installer/targets/gemini.js +165 -0
  280. package/lib/dist/installer/targets/gemini.js.map +1 -0
  281. package/lib/dist/installer/targets/hermes.d.ts +18 -0
  282. package/lib/dist/installer/targets/hermes.d.ts.map +1 -0
  283. package/lib/dist/installer/targets/hermes.js +359 -0
  284. package/lib/dist/installer/targets/hermes.js.map +1 -0
  285. package/lib/dist/installer/targets/kiro.d.ts +27 -0
  286. package/lib/dist/installer/targets/kiro.d.ts.map +1 -0
  287. package/lib/dist/installer/targets/kiro.js +178 -0
  288. package/lib/dist/installer/targets/kiro.js.map +1 -0
  289. package/lib/dist/installer/targets/opencode.d.ts +38 -0
  290. package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
  291. package/lib/dist/installer/targets/opencode.js +307 -0
  292. package/lib/dist/installer/targets/opencode.js.map +1 -0
  293. package/lib/dist/installer/targets/registry.d.ts +35 -0
  294. package/lib/dist/installer/targets/registry.d.ts.map +1 -0
  295. package/lib/dist/installer/targets/registry.js +91 -0
  296. package/lib/dist/installer/targets/registry.js.map +1 -0
  297. package/lib/dist/installer/targets/shared.d.ts +101 -0
  298. package/lib/dist/installer/targets/shared.d.ts.map +1 -0
  299. package/lib/dist/installer/targets/shared.js +264 -0
  300. package/lib/dist/installer/targets/shared.js.map +1 -0
  301. package/lib/dist/installer/targets/toml.d.ts +52 -0
  302. package/lib/dist/installer/targets/toml.d.ts.map +1 -0
  303. package/lib/dist/installer/targets/toml.js +147 -0
  304. package/lib/dist/installer/targets/toml.js.map +1 -0
  305. package/lib/dist/installer/targets/types.d.ts +108 -0
  306. package/lib/dist/installer/targets/types.d.ts.map +1 -0
  307. package/lib/dist/installer/targets/types.js +16 -0
  308. package/lib/dist/installer/targets/types.js.map +1 -0
  309. package/lib/dist/mcp/daemon-manager.d.ts +42 -0
  310. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -0
  311. package/lib/dist/mcp/daemon-manager.js +129 -0
  312. package/lib/dist/mcp/daemon-manager.js.map +1 -0
  313. package/lib/dist/mcp/daemon-paths.d.ts +73 -0
  314. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -0
  315. package/lib/dist/mcp/daemon-paths.js +165 -0
  316. package/lib/dist/mcp/daemon-paths.js.map +1 -0
  317. package/lib/dist/mcp/daemon-registry.d.ts +47 -0
  318. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -0
  319. package/lib/dist/mcp/daemon-registry.js +233 -0
  320. package/lib/dist/mcp/daemon-registry.js.map +1 -0
  321. package/lib/dist/mcp/daemon.d.ts +258 -0
  322. package/lib/dist/mcp/daemon.d.ts.map +1 -0
  323. package/lib/dist/mcp/daemon.js +770 -0
  324. package/lib/dist/mcp/daemon.js.map +1 -0
  325. package/lib/dist/mcp/dynamic-boundaries.d.ts +41 -0
  326. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  327. package/lib/dist/mcp/dynamic-boundaries.js +359 -0
  328. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -0
  329. package/lib/dist/mcp/engine.d.ts +122 -0
  330. package/lib/dist/mcp/engine.d.ts.map +1 -0
  331. package/lib/dist/mcp/engine.js +350 -0
  332. package/lib/dist/mcp/engine.js.map +1 -0
  333. package/lib/dist/mcp/index.d.ts +113 -0
  334. package/lib/dist/mcp/index.d.ts.map +1 -0
  335. package/lib/dist/mcp/index.js +481 -0
  336. package/lib/dist/mcp/index.js.map +1 -0
  337. package/lib/dist/mcp/liveness-watchdog.d.ts +18 -0
  338. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  339. package/lib/dist/mcp/liveness-watchdog.js +207 -0
  340. package/lib/dist/mcp/liveness-watchdog.js.map +1 -0
  341. package/lib/dist/mcp/ppid-watchdog.d.ts +62 -0
  342. package/lib/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  343. package/lib/dist/mcp/ppid-watchdog.js +64 -0
  344. package/lib/dist/mcp/ppid-watchdog.js.map +1 -0
  345. package/lib/dist/mcp/proxy.d.ts +87 -0
  346. package/lib/dist/mcp/proxy.d.ts.map +1 -0
  347. package/lib/dist/mcp/proxy.js +641 -0
  348. package/lib/dist/mcp/proxy.js.map +1 -0
  349. package/lib/dist/mcp/query-pool.d.ts +94 -0
  350. package/lib/dist/mcp/query-pool.d.ts.map +1 -0
  351. package/lib/dist/mcp/query-pool.js +297 -0
  352. package/lib/dist/mcp/query-pool.js.map +1 -0
  353. package/lib/dist/mcp/query-worker.d.ts +24 -0
  354. package/lib/dist/mcp/query-worker.d.ts.map +1 -0
  355. package/lib/dist/mcp/query-worker.js +87 -0
  356. package/lib/dist/mcp/query-worker.js.map +1 -0
  357. package/lib/dist/mcp/server-instructions.d.ts +34 -0
  358. package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
  359. package/lib/dist/mcp/server-instructions.js +126 -0
  360. package/lib/dist/mcp/server-instructions.js.map +1 -0
  361. package/lib/dist/mcp/session.d.ts +79 -0
  362. package/lib/dist/mcp/session.d.ts.map +1 -0
  363. package/lib/dist/mcp/session.js +330 -0
  364. package/lib/dist/mcp/session.js.map +1 -0
  365. package/lib/dist/mcp/stdin-teardown.d.ts +27 -0
  366. package/lib/dist/mcp/stdin-teardown.d.ts.map +1 -0
  367. package/lib/dist/mcp/stdin-teardown.js +49 -0
  368. package/lib/dist/mcp/stdin-teardown.js.map +1 -0
  369. package/lib/dist/mcp/tools.d.ts +591 -0
  370. package/lib/dist/mcp/tools.d.ts.map +1 -0
  371. package/lib/dist/mcp/tools.js +4211 -0
  372. package/lib/dist/mcp/tools.js.map +1 -0
  373. package/lib/dist/mcp/transport.d.ts +188 -0
  374. package/lib/dist/mcp/transport.d.ts.map +1 -0
  375. package/lib/dist/mcp/transport.js +359 -0
  376. package/lib/dist/mcp/transport.js.map +1 -0
  377. package/lib/dist/mcp/version.d.ts +19 -0
  378. package/lib/dist/mcp/version.d.ts.map +1 -0
  379. package/lib/dist/mcp/version.js +71 -0
  380. package/lib/dist/mcp/version.js.map +1 -0
  381. package/lib/dist/project-config.d.ts +56 -0
  382. package/lib/dist/project-config.d.ts.map +1 -0
  383. package/lib/dist/project-config.js +297 -0
  384. package/lib/dist/project-config.js.map +1 -0
  385. package/lib/dist/reasoning/config.d.ts +45 -0
  386. package/lib/dist/reasoning/config.d.ts.map +1 -0
  387. package/lib/dist/reasoning/config.js +171 -0
  388. package/lib/dist/reasoning/config.js.map +1 -0
  389. package/lib/dist/reasoning/credentials.d.ts +5 -0
  390. package/lib/dist/reasoning/credentials.d.ts.map +1 -0
  391. package/lib/dist/reasoning/credentials.js +83 -0
  392. package/lib/dist/reasoning/credentials.js.map +1 -0
  393. package/lib/dist/reasoning/login.d.ts +21 -0
  394. package/lib/dist/reasoning/login.d.ts.map +1 -0
  395. package/lib/dist/reasoning/login.js +85 -0
  396. package/lib/dist/reasoning/login.js.map +1 -0
  397. package/lib/dist/reasoning/reasoner.d.ts +43 -0
  398. package/lib/dist/reasoning/reasoner.d.ts.map +1 -0
  399. package/lib/dist/reasoning/reasoner.js +308 -0
  400. package/lib/dist/reasoning/reasoner.js.map +1 -0
  401. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts +5 -0
  402. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  403. package/lib/dist/resolution/c-fnptr-synthesizer.js +1038 -0
  404. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  405. package/lib/dist/resolution/callback-synthesizer.d.ts +15 -0
  406. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  407. package/lib/dist/resolution/callback-synthesizer.js +2926 -0
  408. package/lib/dist/resolution/callback-synthesizer.js.map +1 -0
  409. package/lib/dist/resolution/frameworks/astro.d.ts +9 -0
  410. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -0
  411. package/lib/dist/resolution/frameworks/astro.js +169 -0
  412. package/lib/dist/resolution/frameworks/astro.js.map +1 -0
  413. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  414. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  415. package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
  416. package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  417. package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
  418. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  419. package/lib/dist/resolution/frameworks/csharp.js +241 -0
  420. package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
  421. package/lib/dist/resolution/frameworks/drupal.d.ts +51 -0
  422. package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  423. package/lib/dist/resolution/frameworks/drupal.js +367 -0
  424. package/lib/dist/resolution/frameworks/drupal.js.map +1 -0
  425. package/lib/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  426. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  427. package/lib/dist/resolution/frameworks/expo-modules.js +148 -0
  428. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -0
  429. package/lib/dist/resolution/frameworks/express.d.ts +8 -0
  430. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
  431. package/lib/dist/resolution/frameworks/express.js +308 -0
  432. package/lib/dist/resolution/frameworks/express.js.map +1 -0
  433. package/lib/dist/resolution/frameworks/fabric.d.ts +3 -0
  434. package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  435. package/lib/dist/resolution/frameworks/fabric.js +354 -0
  436. package/lib/dist/resolution/frameworks/fabric.js.map +1 -0
  437. package/lib/dist/resolution/frameworks/go.d.ts +8 -0
  438. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
  439. package/lib/dist/resolution/frameworks/go.js +161 -0
  440. package/lib/dist/resolution/frameworks/go.js.map +1 -0
  441. package/lib/dist/resolution/frameworks/goframe.d.ts +41 -0
  442. package/lib/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  443. package/lib/dist/resolution/frameworks/goframe.js +112 -0
  444. package/lib/dist/resolution/frameworks/goframe.js.map +1 -0
  445. package/lib/dist/resolution/frameworks/index.d.ts +50 -0
  446. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
  447. package/lib/dist/resolution/frameworks/index.js +169 -0
  448. package/lib/dist/resolution/frameworks/index.js.map +1 -0
  449. package/lib/dist/resolution/frameworks/java.d.ts +8 -0
  450. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
  451. package/lib/dist/resolution/frameworks/java.js +509 -0
  452. package/lib/dist/resolution/frameworks/java.js.map +1 -0
  453. package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
  454. package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  455. package/lib/dist/resolution/frameworks/laravel.js +257 -0
  456. package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
  457. package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
  458. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  459. package/lib/dist/resolution/frameworks/nestjs.js +698 -0
  460. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
  461. package/lib/dist/resolution/frameworks/play.d.ts +19 -0
  462. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -0
  463. package/lib/dist/resolution/frameworks/play.js +111 -0
  464. package/lib/dist/resolution/frameworks/play.js.map +1 -0
  465. package/lib/dist/resolution/frameworks/python.d.ts +10 -0
  466. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
  467. package/lib/dist/resolution/frameworks/python.js +400 -0
  468. package/lib/dist/resolution/frameworks/python.js.map +1 -0
  469. package/lib/dist/resolution/frameworks/react-native.d.ts +3 -0
  470. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  471. package/lib/dist/resolution/frameworks/react-native.js +410 -0
  472. package/lib/dist/resolution/frameworks/react-native.js.map +1 -0
  473. package/lib/dist/resolution/frameworks/react.d.ts +8 -0
  474. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
  475. package/lib/dist/resolution/frameworks/react.js +334 -0
  476. package/lib/dist/resolution/frameworks/react.js.map +1 -0
  477. package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
  478. package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  479. package/lib/dist/resolution/frameworks/ruby.js +302 -0
  480. package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
  481. package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
  482. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
  483. package/lib/dist/resolution/frameworks/rust.js +304 -0
  484. package/lib/dist/resolution/frameworks/rust.js.map +1 -0
  485. package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
  486. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  487. package/lib/dist/resolution/frameworks/svelte.js +253 -0
  488. package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
  489. package/lib/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  490. package/lib/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  491. package/lib/dist/resolution/frameworks/swift-objc.js +252 -0
  492. package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -0
  493. package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
  494. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
  495. package/lib/dist/resolution/frameworks/swift.js +400 -0
  496. package/lib/dist/resolution/frameworks/swift.js.map +1 -0
  497. package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
  498. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
  499. package/lib/dist/resolution/frameworks/vue.js +303 -0
  500. package/lib/dist/resolution/frameworks/vue.js.map +1 -0
  501. package/lib/dist/resolution/go-module.d.ts +26 -0
  502. package/lib/dist/resolution/go-module.d.ts.map +1 -0
  503. package/lib/dist/resolution/go-module.js +78 -0
  504. package/lib/dist/resolution/go-module.js.map +1 -0
  505. package/lib/dist/resolution/goframe-synthesizer.d.ts +28 -0
  506. package/lib/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  507. package/lib/dist/resolution/goframe-synthesizer.js +158 -0
  508. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -0
  509. package/lib/dist/resolution/import-resolver.d.ts +78 -0
  510. package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
  511. package/lib/dist/resolution/import-resolver.js +1849 -0
  512. package/lib/dist/resolution/import-resolver.js.map +1 -0
  513. package/lib/dist/resolution/index.d.ts +196 -0
  514. package/lib/dist/resolution/index.d.ts.map +1 -0
  515. package/lib/dist/resolution/index.js +1328 -0
  516. package/lib/dist/resolution/index.js.map +1 -0
  517. package/lib/dist/resolution/lru-cache.d.ts +24 -0
  518. package/lib/dist/resolution/lru-cache.d.ts.map +1 -0
  519. package/lib/dist/resolution/lru-cache.js +62 -0
  520. package/lib/dist/resolution/lru-cache.js.map +1 -0
  521. package/lib/dist/resolution/name-matcher.d.ts +93 -0
  522. package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
  523. package/lib/dist/resolution/name-matcher.js +1256 -0
  524. package/lib/dist/resolution/name-matcher.js.map +1 -0
  525. package/lib/dist/resolution/path-aliases.d.ts +68 -0
  526. package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
  527. package/lib/dist/resolution/path-aliases.js +238 -0
  528. package/lib/dist/resolution/path-aliases.js.map +1 -0
  529. package/lib/dist/resolution/strip-comments.d.ts +27 -0
  530. package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
  531. package/lib/dist/resolution/strip-comments.js +443 -0
  532. package/lib/dist/resolution/strip-comments.js.map +1 -0
  533. package/lib/dist/resolution/swift-objc-bridge.d.ts +134 -0
  534. package/lib/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  535. package/lib/dist/resolution/swift-objc-bridge.js +256 -0
  536. package/lib/dist/resolution/swift-objc-bridge.js.map +1 -0
  537. package/lib/dist/resolution/types.d.ts +233 -0
  538. package/lib/dist/resolution/types.d.ts.map +1 -0
  539. package/lib/dist/resolution/types.js +8 -0
  540. package/lib/dist/resolution/types.js.map +1 -0
  541. package/lib/dist/resolution/workspace-packages.d.ts +48 -0
  542. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -0
  543. package/lib/dist/resolution/workspace-packages.js +208 -0
  544. package/lib/dist/resolution/workspace-packages.js.map +1 -0
  545. package/lib/dist/search/query-parser.d.ts +57 -0
  546. package/lib/dist/search/query-parser.d.ts.map +1 -0
  547. package/lib/dist/search/query-parser.js +177 -0
  548. package/lib/dist/search/query-parser.js.map +1 -0
  549. package/lib/dist/search/query-utils.d.ts +87 -0
  550. package/lib/dist/search/query-utils.d.ts.map +1 -0
  551. package/lib/dist/search/query-utils.js +449 -0
  552. package/lib/dist/search/query-utils.js.map +1 -0
  553. package/lib/dist/sync/git-hooks.d.ts +45 -0
  554. package/lib/dist/sync/git-hooks.d.ts.map +1 -0
  555. package/lib/dist/sync/git-hooks.js +225 -0
  556. package/lib/dist/sync/git-hooks.js.map +1 -0
  557. package/lib/dist/sync/index.d.ts +19 -0
  558. package/lib/dist/sync/index.d.ts.map +1 -0
  559. package/lib/dist/sync/index.js +35 -0
  560. package/lib/dist/sync/index.js.map +1 -0
  561. package/lib/dist/sync/watch-policy.d.ts +48 -0
  562. package/lib/dist/sync/watch-policy.d.ts.map +1 -0
  563. package/lib/dist/sync/watch-policy.js +124 -0
  564. package/lib/dist/sync/watch-policy.js.map +1 -0
  565. package/lib/dist/sync/watcher.d.ts +358 -0
  566. package/lib/dist/sync/watcher.d.ts.map +1 -0
  567. package/lib/dist/sync/watcher.js +829 -0
  568. package/lib/dist/sync/watcher.js.map +1 -0
  569. package/lib/dist/sync/worktree.d.ts +54 -0
  570. package/lib/dist/sync/worktree.d.ts.map +1 -0
  571. package/lib/dist/sync/worktree.js +145 -0
  572. package/lib/dist/sync/worktree.js.map +1 -0
  573. package/lib/dist/telemetry/index.d.ts +143 -0
  574. package/lib/dist/telemetry/index.d.ts.map +1 -0
  575. package/lib/dist/telemetry/index.js +541 -0
  576. package/lib/dist/telemetry/index.js.map +1 -0
  577. package/lib/dist/types.d.ts +409 -0
  578. package/lib/dist/types.d.ts.map +1 -0
  579. package/lib/dist/types.js +101 -0
  580. package/lib/dist/types.js.map +1 -0
  581. package/lib/dist/ui/glyphs.d.ts +42 -0
  582. package/lib/dist/ui/glyphs.d.ts.map +1 -0
  583. package/lib/dist/ui/glyphs.js +78 -0
  584. package/lib/dist/ui/glyphs.js.map +1 -0
  585. package/lib/dist/ui/shimmer-progress.d.ts +11 -0
  586. package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
  587. package/lib/dist/ui/shimmer-progress.js +90 -0
  588. package/lib/dist/ui/shimmer-progress.js.map +1 -0
  589. package/lib/dist/ui/shimmer-worker.d.ts +2 -0
  590. package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
  591. package/lib/dist/ui/shimmer-worker.js +118 -0
  592. package/lib/dist/ui/shimmer-worker.js.map +1 -0
  593. package/lib/dist/ui/types.d.ts +17 -0
  594. package/lib/dist/ui/types.d.ts.map +1 -0
  595. package/lib/dist/ui/types.js +3 -0
  596. package/lib/dist/ui/types.js.map +1 -0
  597. package/lib/dist/upgrade/index.d.ts +132 -0
  598. package/lib/dist/upgrade/index.d.ts.map +1 -0
  599. package/lib/dist/upgrade/index.js +576 -0
  600. package/lib/dist/upgrade/index.js.map +1 -0
  601. package/lib/dist/utils.d.ts +224 -0
  602. package/lib/dist/utils.d.ts.map +1 -0
  603. package/lib/dist/utils.js +583 -0
  604. package/lib/dist/utils.js.map +1 -0
  605. package/lib/node_modules/.modules.yaml +45 -0
  606. package/lib/node_modules/.pnpm/lock.yaml +126 -0
  607. package/lib/node_modules/.pnpm-workspace-state-v1.json +25 -0
  608. package/lib/node_modules/@clack/core/CHANGELOG.md +397 -0
  609. package/lib/node_modules/@clack/core/LICENSE +9 -0
  610. package/lib/node_modules/@clack/core/README.md +22 -0
  611. package/lib/node_modules/@clack/core/dist/index.d.mts +469 -0
  612. package/lib/node_modules/@clack/core/dist/index.mjs +981 -0
  613. package/lib/node_modules/@clack/core/package.json +64 -0
  614. package/lib/node_modules/@clack/prompts/CHANGELOG.md +672 -0
  615. package/lib/node_modules/@clack/prompts/LICENSE +9 -0
  616. package/lib/node_modules/@clack/prompts/README.md +396 -0
  617. package/lib/node_modules/@clack/prompts/dist/index.d.mts +928 -0
  618. package/lib/node_modules/@clack/prompts/dist/index.mjs +1398 -0
  619. package/lib/node_modules/@clack/prompts/package.json +68 -0
  620. package/lib/node_modules/commander/LICENSE +22 -0
  621. package/lib/node_modules/commander/Readme.md +1176 -0
  622. package/lib/node_modules/commander/esm.mjs +16 -0
  623. package/lib/node_modules/commander/index.js +24 -0
  624. package/lib/node_modules/commander/lib/argument.js +150 -0
  625. package/lib/node_modules/commander/lib/command.js +2777 -0
  626. package/lib/node_modules/commander/lib/error.js +39 -0
  627. package/lib/node_modules/commander/lib/help.js +747 -0
  628. package/lib/node_modules/commander/lib/option.js +380 -0
  629. package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
  630. package/lib/node_modules/commander/package-support.json +19 -0
  631. package/lib/node_modules/commander/package.json +82 -0
  632. package/lib/node_modules/commander/typings/esm.d.mts +3 -0
  633. package/lib/node_modules/commander/typings/index.d.ts +1113 -0
  634. package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  635. package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  636. package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  637. package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  638. package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  639. package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  640. package/lib/node_modules/fast-string-truncated-width/license +21 -0
  641. package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
  642. package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
  643. package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
  644. package/lib/node_modules/fast-string-width/dist/index.js +14 -0
  645. package/lib/node_modules/fast-string-width/license +21 -0
  646. package/lib/node_modules/fast-string-width/package.json +34 -0
  647. package/lib/node_modules/fast-string-width/readme.md +42 -0
  648. package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
  649. package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
  650. package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  651. package/lib/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  652. package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
  653. package/lib/node_modules/ignore/LICENSE-MIT +21 -0
  654. package/lib/node_modules/ignore/README.md +452 -0
  655. package/lib/node_modules/ignore/index.d.ts +81 -0
  656. package/lib/node_modules/ignore/index.js +784 -0
  657. package/lib/node_modules/ignore/legacy.js +681 -0
  658. package/lib/node_modules/ignore/package.json +87 -0
  659. package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  660. package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
  661. package/lib/node_modules/jsonc-parser/README.md +364 -0
  662. package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
  663. package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  664. package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  665. package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  666. package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  667. package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  668. package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  669. package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  670. package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  671. package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  672. package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  673. package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  674. package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  675. package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  676. package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  677. package/lib/node_modules/jsonc-parser/package.json +37 -0
  678. package/lib/node_modules/picomatch/LICENSE +21 -0
  679. package/lib/node_modules/picomatch/README.md +749 -0
  680. package/lib/node_modules/picomatch/index.js +17 -0
  681. package/lib/node_modules/picomatch/lib/constants.js +184 -0
  682. package/lib/node_modules/picomatch/lib/parse.js +1386 -0
  683. package/lib/node_modules/picomatch/lib/picomatch.js +349 -0
  684. package/lib/node_modules/picomatch/lib/scan.js +391 -0
  685. package/lib/node_modules/picomatch/lib/utils.js +72 -0
  686. package/lib/node_modules/picomatch/package.json +82 -0
  687. package/lib/node_modules/picomatch/posix.js +3 -0
  688. package/lib/node_modules/sisteransi/license +21 -0
  689. package/lib/node_modules/sisteransi/package.json +34 -0
  690. package/lib/node_modules/sisteransi/readme.md +113 -0
  691. package/lib/node_modules/sisteransi/src/index.js +58 -0
  692. package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  693. package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
  694. package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
  695. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
  696. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
  697. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
  698. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
  699. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
  700. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
  701. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
  702. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
  703. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
  704. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
  705. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
  706. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
  707. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
  708. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
  709. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
  710. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
  711. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
  712. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
  713. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
  714. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
  715. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
  716. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
  717. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
  718. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
  719. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
  720. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
  721. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
  722. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
  723. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
  724. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
  725. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
  726. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
  727. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
  728. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
  729. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
  730. package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
  731. package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
  732. package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
  733. package/lib/node_modules/web-tree-sitter/README.md +269 -0
  734. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
  735. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
  736. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
  737. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
  738. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
  739. package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
  740. package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
  741. package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
  742. package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
  743. package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
  744. package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
  745. package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
  746. package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
  747. package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
  748. package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
  749. package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
  750. package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
  751. package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
  752. package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
  753. package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
  754. package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
  755. package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
  756. package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
  757. package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
  758. package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
  759. package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
  760. package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
  761. package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
  762. package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
  763. package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
  764. package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
  765. package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
  766. package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
  767. package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
  768. package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
  769. package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
  770. package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
  771. package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
  772. package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
  773. package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
  774. package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
  775. package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
  776. package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
  777. package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
  778. package/lib/node_modules/web-tree-sitter/package.json +98 -0
  779. package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
  780. package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
  781. package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
  782. package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
  783. package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
  784. package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
  785. package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
  786. package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
  787. package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
  788. package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
  789. package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
  790. package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
  791. package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
  792. package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
  793. package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
  794. package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
  795. package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
  796. package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
  797. package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
  798. package/lib/package.json +57 -0
  799. package/node +0 -0
  800. package/package.json +17 -0
@@ -0,0 +1,1256 @@
1
+ "use strict";
2
+ /**
3
+ * Name Matcher
4
+ *
5
+ * Handles symbol name matching for reference resolution.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.matchByFilePath = matchByFilePath;
9
+ exports.sameLanguageFamily = sameLanguageFamily;
10
+ exports.isKnownLanguageFamily = isKnownLanguageFamily;
11
+ exports.crossesKnownFamily = crossesKnownFamily;
12
+ exports.matchFunctionRef = matchFunctionRef;
13
+ exports.matchByExactName = matchByExactName;
14
+ exports.matchByQualifiedName = matchByQualifiedName;
15
+ exports.matchCppCallChain = matchCppCallChain;
16
+ exports.matchScopedCallChain = matchScopedCallChain;
17
+ exports.matchDottedCallChain = matchDottedCallChain;
18
+ exports.matchMethodCall = matchMethodCall;
19
+ exports.matchFuzzy = matchFuzzy;
20
+ exports.matchReference = matchReference;
21
+ /**
22
+ * Ceiling on how many same-named definitions a FUZZY name-match strategy will
23
+ * score. A name defined more times than this is "ubiquitous" — a method/symbol
24
+ * re-declared across a vendored theme or SDK (e.g. `init`/`update`/`render` on
25
+ * every widget of a committed Metronic theme — #999). No directory-proximity or
26
+ * receiver-word-overlap score can reliably pick THE one true target among
27
+ * thousands, so the fuzzy strategies (matchByExactName's findBestMatch, and
28
+ * matchMethodCall Strategy 3) decline above the ceiling instead of emitting a
29
+ * low-confidence, almost-certainly-wrong edge. This also caps their per-ref cost
30
+ * at O(ceiling): without it, K same-named refs each scored K candidates — the
31
+ * O(K²) blow-up that pinned a core for 15-28 min at "Resolving refs … 94%" on a
32
+ * repo vendoring a large JS/TS theme (#999). The PRECISE strategies are
33
+ * unaffected: qualified-name, import-based, and class-name (Strategy 1/2)
34
+ * resolution all still run and resolve a ubiquitous name when the context names
35
+ * its exact target. Real repos top out near ~40 same-named methods, so a normal
36
+ * codebase never reaches this; only bulk-vendored code does. Tune via
37
+ * `CODEGRAPH_AMBIGUOUS_NAME_CEILING`.
38
+ */
39
+ const DEFAULT_AMBIGUOUS_NAME_CEILING = 500;
40
+ function resolveAmbiguousNameCeiling() {
41
+ const raw = process.env.CODEGRAPH_AMBIGUOUS_NAME_CEILING;
42
+ if (!raw)
43
+ return DEFAULT_AMBIGUOUS_NAME_CEILING;
44
+ const parsed = Number.parseInt(raw, 10);
45
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_AMBIGUOUS_NAME_CEILING;
46
+ }
47
+ const AMBIGUOUS_NAME_CEILING = resolveAmbiguousNameCeiling();
48
+ /**
49
+ * Try to resolve a path-like reference (e.g., "snippets/drawer-menu.liquid")
50
+ * by matching the filename against file nodes.
51
+ */
52
+ function matchByFilePath(ref, context) {
53
+ // Path-like (`a/b.liquid`) OR a bare filename ending in a short extension
54
+ // (`Foo.h` — an Objective-C `#import "Foo.h"`, resolved to the header by
55
+ // basename). A bare ref WITHOUT an extension is a symbol name, not a file, so
56
+ // leave it to the symbol-matching strategies.
57
+ if (!ref.referenceName.includes('/') && !/\.[A-Za-z][A-Za-z0-9]{0,3}$/.test(ref.referenceName)) {
58
+ return null;
59
+ }
60
+ // Extract the filename from the path
61
+ const fileName = ref.referenceName.split('/').pop();
62
+ if (!fileName)
63
+ return null;
64
+ // Search for file nodes with this name
65
+ const candidates = context.getNodesByName(fileName);
66
+ const fileNodes = candidates.filter(n => n.kind === 'file');
67
+ if (fileNodes.length === 0)
68
+ return null;
69
+ // Prefer exact path match on qualified_name
70
+ const exactMatch = fileNodes.find(n => n.qualifiedName === ref.referenceName || n.filePath === ref.referenceName);
71
+ if (exactMatch) {
72
+ return {
73
+ original: ref,
74
+ targetNodeId: exactMatch.id,
75
+ confidence: 0.95,
76
+ resolvedBy: 'file-path',
77
+ };
78
+ }
79
+ // Fall back to suffix match (e.g., ref="snippets/foo.liquid" matches
80
+ // "src/snippets/foo.liquid"). When several files share the basename — a
81
+ // `#include "RNCAsyncStorage.h"` with a same-named header on another platform
82
+ // (windows/code/ vs apple/) — prefer the one in the includer's own directory,
83
+ // then by directory proximity / same language family. A C/C++ include (and any
84
+ // bare-filename import) resolves relative to the including file, not to an
85
+ // arbitrary same-named header elsewhere in the tree.
86
+ const suffixMatches = fileNodes.filter(n => n.qualifiedName.endsWith(ref.referenceName) || n.filePath.endsWith(ref.referenceName));
87
+ if (suffixMatches.length > 0) {
88
+ return {
89
+ original: ref,
90
+ targetNodeId: pickClosestFileNode(suffixMatches, ref).id,
91
+ confidence: 0.85,
92
+ resolvedBy: 'file-path',
93
+ };
94
+ }
95
+ // If only one file node with this name, use it with lower confidence
96
+ if (fileNodes.length === 1) {
97
+ return {
98
+ original: ref,
99
+ targetNodeId: fileNodes[0].id,
100
+ confidence: 0.7,
101
+ resolvedBy: 'file-path',
102
+ };
103
+ }
104
+ return null;
105
+ }
106
+ /**
107
+ * Among several file nodes that all match a bare include/import by basename,
108
+ * pick the one closest to the referencing file: same directory first, then by
109
+ * directory-tree proximity, with the same language family as a tiebreak. A
110
+ * C/C++ `#include "X.h"` (and any bare-filename import) resolves relative to the
111
+ * including file — not to an arbitrary same-named header on another platform.
112
+ */
113
+ function pickClosestFileNode(candidates, ref) {
114
+ const dirOf = (p) => {
115
+ const i = p.lastIndexOf('/');
116
+ return i >= 0 ? p.slice(0, i) : '';
117
+ };
118
+ const refDir = dirOf(ref.filePath);
119
+ const sameDir = candidates.filter((c) => dirOf(c.filePath) === refDir);
120
+ const pool = sameDir.length > 0 ? sameDir : candidates;
121
+ let best = pool[0];
122
+ let bestScore = -Infinity;
123
+ for (const c of pool) {
124
+ const score = computePathProximity(ref.filePath, c.filePath) +
125
+ (sameLanguageFamily(c.language, ref.language) ? 5 : 0);
126
+ if (score > bestScore) {
127
+ bestScore = score;
128
+ best = c;
129
+ }
130
+ }
131
+ return best;
132
+ }
133
+ /**
134
+ * Language families that share a type system / runtime, so a same-language-only
135
+ * reference may still resolve across them (a Kotlin `Foo.BAR` can name a Java
136
+ * `Foo`). Anything not listed forms its own singleton family.
137
+ */
138
+ const LANGUAGE_FAMILY = {
139
+ java: 'jvm', kotlin: 'jvm', scala: 'jvm',
140
+ swift: 'apple', objc: 'apple',
141
+ typescript: 'web', tsx: 'web', javascript: 'web', jsx: 'web',
142
+ c: 'c', cpp: 'c',
143
+ // Razor/Blazor markup names C# types — same family so `@model Foo` /
144
+ // `<MyComponent/>` resolve to their `.cs` class through the cross-family gate.
145
+ csharp: 'dotnet', razor: 'dotnet',
146
+ };
147
+ function sameLanguageFamily(a, b) {
148
+ if (a === b)
149
+ return true;
150
+ const fa = LANGUAGE_FAMILY[a];
151
+ return fa !== undefined && fa === LANGUAGE_FAMILY[b];
152
+ }
153
+ /**
154
+ * True when `lang` belongs to a known multi-language family (jvm/apple/web/c).
155
+ * Languages not listed (php, python, go, ruby, rust, dart, …) and config
156
+ * formats (yaml/xml/blade) form their own singleton families and return
157
+ * `false` — used to leave config↔code framework bridges (whose config side is
158
+ * never a known programming-language family) out of the cross-family gate.
159
+ */
160
+ function isKnownLanguageFamily(lang) {
161
+ return LANGUAGE_FAMILY[lang] !== undefined;
162
+ }
163
+ /**
164
+ * True when `a` and `b` are two DIFFERENT *known* language families — the
165
+ * signature of a coincidental cross-language name collision (a TS `import
166
+ * React` matching a Swift `import React`, a C++ `#include "X.h"` matching a
167
+ * same-named ObjC header on another platform). The both-*known* test is
168
+ * deliberately weaker than {@link sameLanguageFamily}'s negation: a
169
+ * single-file-component language that carries its own tag (`vue`/`svelte`)
170
+ * importing a `.ts` module, or any singleton-family language (php/go/ruby/…),
171
+ * returns `false` here and is left alone.
172
+ */
173
+ function crossesKnownFamily(a, b) {
174
+ return isKnownLanguageFamily(a) && isKnownLanguageFamily(b) && !sameLanguageFamily(a, b);
175
+ }
176
+ /**
177
+ * Drop cross-language candidates from a name lookup. Two regimes:
178
+ * - `references` (type-usage): a type named in language X resolves to a
179
+ * SAME-family type, never a coincidentally same-named symbol in another
180
+ * language (the Android `BatteryManager` system class vs a JS one). Strict
181
+ * same-family filter — cross-language communication is `calls`, not refs.
182
+ * - `imports` (import binding): an `import`/`#include` never crosses two
183
+ * KNOWN families (TS `import React` ↮ Swift `import React`). Weaker
184
+ * both-known filter so `.vue`/`.svelte` (own tag) importing `.ts` survives.
185
+ */
186
+ function applyLanguageGate(candidates, ref) {
187
+ if (ref.referenceKind === 'references' || ref.referenceKind === 'function_ref') {
188
+ return candidates.filter((c) => sameLanguageFamily(c.language, ref.language));
189
+ }
190
+ if (ref.referenceKind === 'imports') {
191
+ return candidates.filter((c) => !crossesKnownFamily(c.language, ref.language));
192
+ }
193
+ return candidates;
194
+ }
195
+ /**
196
+ * Resolve a function-as-value reference (#756) — a function name used as a
197
+ * callback/function-pointer value (`register(handler)`, `o->cb = handler`,
198
+ * `{ .cb = handler }`, `signal(SIGINT, handler)`). The ONLY strategy allowed
199
+ * for `function_ref` refs: exact name, function/method targets only, same
200
+ * language family, same-file first, and cross-file only when the match is
201
+ * UNIQUE. No fuzzy fallback, no qualified-name walking — a wrong callback
202
+ * edge is worse than none.
203
+ */
204
+ function matchFunctionRef(ref, context) {
205
+ // `this.<member>` refs are resolved ONLY by the class-scoped resolver in
206
+ // resolveOne (resolveThisMemberFnRef) — never by name matching here.
207
+ if (ref.referenceName.startsWith('this.'))
208
+ return null;
209
+ // In JS/TS/Python a bare identifier can never be a method value (methods
210
+ // are only reachable through a receiver — `this.m` / `self.m` /
211
+ // `Cls.m`), so bare fn-refs match FUNCTIONS only. This also sidesteps the
212
+ // pre-existing TS quirk of class fields extracting as method-kind nodes,
213
+ // which otherwise soaked up local names passed as arguments (excalidraw
214
+ // A/B finding; same pattern in vendored docopt.py). Python's `self.m`
215
+ // form keeps method targets via its own capture shape. C++ likewise: a
216
+ // bare identifier can only be a FREE function (member values need
217
+ // `&Cls::method`). PHP string callables name global FUNCTIONS (methods
218
+ // need the `[$obj, 'm']` array form, which carries its own shape). Other
219
+ // languages keep method targets: C# method groups, Swift/Dart
220
+ // implicit-self, Java/Kotlin method references.
221
+ const bareFnOnly = ref.language === 'typescript' || ref.language === 'tsx' ||
222
+ ref.language === 'javascript' || ref.language === 'jsx' ||
223
+ ref.language === 'cpp' || ref.language === 'python' ||
224
+ ref.language === 'php';
225
+ // Qualified member-pointer (`&Widget::on_click` → "Widget::on_click"):
226
+ // resolve the member ON THAT SCOPE — exempt from bareFnOnly (the `&Cls::m`
227
+ // shape is an explicit member reference). Unique-or-drop like everything else.
228
+ if (ref.referenceName.includes('::')) {
229
+ const memberName = ref.referenceName.slice(ref.referenceName.lastIndexOf('::') + 2);
230
+ const scoped = context
231
+ .getNodesByName(memberName)
232
+ .filter((n) => (n.kind === 'function' || n.kind === 'method') &&
233
+ sameLanguageFamily(n.language, ref.language) &&
234
+ n.id !== ref.fromNodeId &&
235
+ (n.qualifiedName === ref.referenceName ||
236
+ n.qualifiedName.endsWith(`::${ref.referenceName}`)));
237
+ if (scoped.length === 0)
238
+ return null;
239
+ const sameFileScoped = scoped.filter((n) => n.filePath === ref.filePath);
240
+ const pool = sameFileScoped.length > 0 ? sameFileScoped : scoped;
241
+ if (sameFileScoped.length === 0 && scoped.length > 1)
242
+ return null;
243
+ const target = pool.reduce((a, b) => (a.startLine <= b.startLine ? a : b));
244
+ return {
245
+ original: ref,
246
+ targetNodeId: target.id,
247
+ confidence: 0.9,
248
+ resolvedBy: 'function-ref',
249
+ };
250
+ }
251
+ let candidates = context
252
+ .getNodesByName(ref.referenceName)
253
+ .filter((n) => (n.kind === 'function' || (!bareFnOnly && n.kind === 'method')) &&
254
+ sameLanguageFamily(n.language, ref.language) &&
255
+ n.id !== ref.fromNodeId // a function registering itself is not a dependency edge
256
+ );
257
+ if (candidates.length === 0)
258
+ return null;
259
+ // Swift implicit-self: a bare identifier can name a METHOD only of the
260
+ // ENCLOSING type (`Button(action: handleTap)` written inside that type) —
261
+ // a same-named method on any OTHER class is a parameter collision
262
+ // (Alamofire: a `request` parameter resolving to EventMonitor::request).
263
+ // Scope method candidates to the from-symbol's type; top-level code has no
264
+ // implicit self, so method targets are excluded there entirely. Free
265
+ // functions are unaffected.
266
+ if (ref.language === 'swift' && candidates.some((n) => n.kind === 'method')) {
267
+ const fromNode = context.getNodeById?.(ref.fromNodeId);
268
+ const sep = fromNode ? fromNode.qualifiedName.lastIndexOf('::') : -1;
269
+ const classPrefix = fromNode && sep > 0 ? fromNode.qualifiedName.slice(0, sep) : null;
270
+ candidates = candidates.filter((n) => {
271
+ if (n.kind !== 'method')
272
+ return true;
273
+ if (!classPrefix)
274
+ return false;
275
+ const mSep = n.qualifiedName.lastIndexOf('::');
276
+ if (mSep <= 0)
277
+ return false;
278
+ const methodPrefix = n.qualifiedName.slice(0, mSep);
279
+ // Accept exact-scope matches plus suffix relationships either way, so
280
+ // extension-declared members (`Holder::m`) still match a nested
281
+ // from-scope (`Module::Holder::wire`) and vice versa.
282
+ return (methodPrefix === classPrefix ||
283
+ methodPrefix.endsWith(`::${classPrefix}`) ||
284
+ classPrefix.endsWith(`::${methodPrefix}`));
285
+ });
286
+ if (candidates.length === 0)
287
+ return null;
288
+ }
289
+ // Same-file definition wins — the extraction gate guarantees most survivors
290
+ // have one, and it's the dominant C pattern (static callback registered in
291
+ // a same-file ops struct).
292
+ const sameFile = candidates.filter((n) => n.filePath === ref.filePath);
293
+ if (sameFile.length > 0) {
294
+ // Swift: several same-named METHODS in one file is an API overload family
295
+ // (`Session.request(...)` × N), and a bare identifier hitting it is almost
296
+ // always a same-named parameter, not a method value (Alamofire A/B
297
+ // finding) — refuse rather than guess. A single method (SwiftUI's
298
+ // `action: handleTap`) still resolves.
299
+ if (ref.language === 'swift' &&
300
+ sameFile.length > 1 &&
301
+ sameFile.every((n) => n.kind === 'method')) {
302
+ return null;
303
+ }
304
+ // Same-name overloads in one file are the same conceptual symbol; pick
305
+ // the first by position for determinism.
306
+ const target = sameFile.reduce((a, b) => (a.startLine <= b.startLine ? a : b));
307
+ return {
308
+ original: ref,
309
+ targetNodeId: target.id,
310
+ confidence: sameFile.length === 1 ? 0.95 : 0.9,
311
+ resolvedBy: 'function-ref',
312
+ };
313
+ }
314
+ // Cross-file (imported names the import resolver didn't already claim):
315
+ // only an unambiguous match resolves.
316
+ if (candidates.length === 1) {
317
+ return {
318
+ original: ref,
319
+ targetNodeId: candidates[0].id,
320
+ confidence: 0.8,
321
+ resolvedBy: 'function-ref',
322
+ };
323
+ }
324
+ return null;
325
+ }
326
+ /**
327
+ * Try to resolve a reference by exact name match
328
+ */
329
+ function matchByExactName(ref, context) {
330
+ // `import`-kind nodes are import STATEMENTS, not definitions, so a reference
331
+ // resolving to a sibling file's `import` is a meaningless edge — the real
332
+ // import→definition resolution is the import resolver's job (resolveViaImport),
333
+ // never name-matching here. Excluding them also removes a quadratic blow-up:
334
+ // a ubiquitous package (`react`, `@superset-ui/core`, Python `logging`/`typing`)
335
+ // is re-declared as an `import` node in every file that imports it, so K
336
+ // unresolved import refs each scored K same-named import candidates through
337
+ // findBestMatch — O(K²) per package, the dominant cost of "Resolving refs" on
338
+ // large import-heavy (front-end + back-end) repos (#915).
339
+ const candidates = applyLanguageGate(context.getNodesByName(ref.referenceName), ref)
340
+ .filter((n) => n.kind !== 'import');
341
+ if (candidates.length === 0) {
342
+ return null;
343
+ }
344
+ // If only one match, use it — but penalize cross-language matches
345
+ if (candidates.length === 1) {
346
+ const isCrossLanguage = candidates[0].language !== ref.language;
347
+ return {
348
+ original: ref,
349
+ targetNodeId: candidates[0].id,
350
+ confidence: isCrossLanguage ? 0.5 : 0.9,
351
+ resolvedBy: 'exact-match',
352
+ };
353
+ }
354
+ // Ubiquitous-name ceiling (#999): above it, picking one target among K
355
+ // same-named defs by directory proximity is unreliable AND O(K) per ref — the
356
+ // quadratic behind the "Resolving refs" wedge on theme/SDK-vendoring repos.
357
+ // Decline; the precise strategies (qualified-name, import, class-name) already
358
+ // ran. Falls through to fuzzy, which itself only resolves a UNIQUE candidate.
359
+ if (candidates.length > AMBIGUOUS_NAME_CEILING) {
360
+ return null;
361
+ }
362
+ // Multiple matches - try to narrow down
363
+ const bestMatch = findBestMatch(ref, candidates, context);
364
+ if (bestMatch) {
365
+ // Lower confidence when the match is from a distant/unrelated module
366
+ const proximity = computePathProximity(ref.filePath, bestMatch.filePath);
367
+ const confidence = proximity >= 30 ? 0.7 : 0.4;
368
+ return {
369
+ original: ref,
370
+ targetNodeId: bestMatch.id,
371
+ confidence,
372
+ resolvedBy: 'exact-match',
373
+ };
374
+ }
375
+ return null;
376
+ }
377
+ /**
378
+ * Try to resolve by qualified name
379
+ */
380
+ function matchByQualifiedName(ref, context) {
381
+ // Check if the reference name looks qualified (contains :: or .)
382
+ if (!ref.referenceName.includes('::') && !ref.referenceName.includes('.')) {
383
+ return null;
384
+ }
385
+ const candidates = context.getNodesByQualifiedName(ref.referenceName);
386
+ if (candidates.length === 1) {
387
+ return {
388
+ original: ref,
389
+ targetNodeId: candidates[0].id,
390
+ confidence: 0.95,
391
+ resolvedBy: 'qualified-name',
392
+ };
393
+ }
394
+ // Try partial qualified name match
395
+ const parts = ref.referenceName.split(/[:.]/);
396
+ const lastName = parts[parts.length - 1];
397
+ if (lastName) {
398
+ const partialCandidates = context.getNodesByName(lastName);
399
+ for (const candidate of partialCandidates) {
400
+ if (candidate.qualifiedName.endsWith(ref.referenceName)) {
401
+ return {
402
+ original: ref,
403
+ targetNodeId: candidate.id,
404
+ confidence: 0.85,
405
+ resolvedBy: 'qualified-name',
406
+ };
407
+ }
408
+ }
409
+ }
410
+ return null;
411
+ }
412
+ function resolveMethodOnType(typeName, methodName, ref, context, confidence, resolvedBy,
413
+ /**
414
+ * Optional FQN that identifies WHICH class declaration `typeName`
415
+ * refers to in the caller's file. When multiple candidates share
416
+ * the same qualifiedName (`FooConverter::convert` in both
417
+ * `dao/converter/` and `service/converter/`), the FQN's
418
+ * file-path-suffix picks the right one — the disambiguation
419
+ * signal Java imports carry but the call site doesn't (#314).
420
+ */
421
+ preferredFqn,
422
+ /** Recursion guard for the supertype/conformance walk. */
423
+ depth = 0) {
424
+ // Look up methods by name and match by qualifiedName ending in
425
+ // `<typeName>::<methodName>`. This works whether the method is defined
426
+ // in-class (`class Foo { int bar() { ... } }`) or out-of-line in a separate
427
+ // file (`int Foo::bar() { ... }` in foo.cpp while class Foo is in foo.hpp).
428
+ // The previous same-file approach missed the latter — the typical C++ layout.
429
+ const methodCandidates = context.getNodesByName(methodName);
430
+ const want = `${typeName}::${methodName}`;
431
+ const matches = [];
432
+ for (const m of methodCandidates) {
433
+ if (m.kind !== 'method')
434
+ continue;
435
+ if (m.language !== ref.language)
436
+ continue;
437
+ const qn = m.qualifiedName;
438
+ if (qn === want || qn.endsWith(`::${want}`)) {
439
+ matches.push(m);
440
+ }
441
+ }
442
+ if (matches.length === 0) {
443
+ // Conformance fallback: the method may be defined on a supertype `typeName`
444
+ // extends, or on a protocol / trait it conforms to (e.g. a Swift protocol-
445
+ // extension method, a C# default-interface or extension method, a Kotlin
446
+ // extension on a supertype). Walk supertypes transitively (depth-capped) via
447
+ // the resolved implements/extends edges — empty in the first resolution pass,
448
+ // populated in the conformance pass. Still VALIDATED (the method must exist on
449
+ // a supertype), so a wrong inference produces no edge.
450
+ if (depth < 4 && context.getSupertypes) {
451
+ for (const supertype of context.getSupertypes(typeName, ref.language)) {
452
+ const via = resolveMethodOnType(supertype, methodName, ref, context, confidence, resolvedBy, preferredFqn, depth + 1);
453
+ if (via)
454
+ return via;
455
+ }
456
+ }
457
+ return null;
458
+ }
459
+ if (matches.length > 1 && preferredFqn) {
460
+ const ext = ref.language === 'kotlin' ? '.kt' : '.java';
461
+ const fqnPath = preferredFqn.replace(/\./g, '/') + ext;
462
+ const chosen = matches.find((m) => {
463
+ const fp = m.filePath.replace(/\\/g, '/');
464
+ return fp.endsWith(fqnPath) || fp.endsWith('/' + fqnPath);
465
+ });
466
+ if (chosen) {
467
+ return {
468
+ original: ref,
469
+ targetNodeId: chosen.id,
470
+ confidence,
471
+ resolvedBy,
472
+ };
473
+ }
474
+ }
475
+ return {
476
+ original: ref,
477
+ targetNodeId: matches[0].id,
478
+ confidence,
479
+ resolvedBy,
480
+ };
481
+ }
482
+ // C++ keywords/control-flow tokens that can appear right before a receiver
483
+ // (e.g. `return ptr->m()`) and must NOT be treated as a type.
484
+ const CPP_NON_TYPE_TOKENS = new Set([
485
+ 'return', 'if', 'else', 'for', 'while', 'do', 'switch', 'case', 'default',
486
+ 'break', 'continue', 'goto', 'throw', 'new', 'delete', 'co_await', 'co_yield',
487
+ 'co_return', 'static_cast', 'const_cast', 'dynamic_cast', 'reinterpret_cast',
488
+ 'sizeof', 'alignof', 'typeid', 'and', 'or', 'not', 'xor',
489
+ ]);
490
+ function normalizeCppTypeName(typeName) {
491
+ const normalized = typeName
492
+ .replace(/\b(const|volatile|mutable|typename|class|struct)\b/g, ' ')
493
+ .replace(/[&*]+/g, ' ')
494
+ .replace(/<[^>]*>/g, ' ')
495
+ .replace(/\s+/g, ' ')
496
+ .trim();
497
+ if (!normalized)
498
+ return null;
499
+ const parts = normalized.split(/::/).filter(Boolean);
500
+ const last = parts[parts.length - 1];
501
+ if (!last)
502
+ return null;
503
+ if (CPP_NON_TYPE_TOKENS.has(last))
504
+ return null;
505
+ return last;
506
+ }
507
+ // Declarator regex: matches `Type receiver`, `Type* receiver`, `Type *receiver`,
508
+ // `Type*receiver`, `Type<X> receiver`, etc., REQUIRING a declarator terminator
509
+ // (`;`, `=`, `,`, `)`, `[`, `{`, `(`, or end-of-line) after the receiver. The
510
+ // terminator rules out uses like `return receiver->m()` where the preceding
511
+ // token is a keyword, not a type.
512
+ function buildDeclaratorRegex(escapedReceiver) {
513
+ return new RegExp(`([A-Za-z_][\\w:]*(?:\\s*<[^;=(){}]+>)?(?:\\s*[*&]+)?)\\s*\\b${escapedReceiver}\\b\\s*(?=[;=,)\\[{(]|$)`);
514
+ }
515
+ function inferCppReceiverType(receiverName, ref, context, depth = 0) {
516
+ const source = context.readFile(ref.filePath);
517
+ if (!source)
518
+ return null;
519
+ const lines = source.split(/\r?\n/);
520
+ const callLineIndex = Math.max(0, Math.min(lines.length - 1, ref.line - 1));
521
+ const escapedReceiver = receiverName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
522
+ const receiverPattern = new RegExp(`\\b${escapedReceiver}\\b`);
523
+ const declaratorRegex = buildDeclaratorRegex(escapedReceiver);
524
+ for (let i = callLineIndex; i >= 0; i--) {
525
+ const line = lines[i];
526
+ if (!line || !receiverPattern.test(line))
527
+ continue;
528
+ const declaratorMatch = line.match(declaratorRegex);
529
+ if (declaratorMatch) {
530
+ const normalized = normalizeCppTypeName(declaratorMatch[1] ?? '');
531
+ if (normalized === 'auto') {
532
+ // `auto x = Foo::instance();` — the declared type is deduced; recover it
533
+ // from the initializer (call return type / construction) (#645).
534
+ const initType = inferCppAutoInitializerType(line, receiverName, ref, context, depth);
535
+ if (initType)
536
+ return initType;
537
+ // No usable initializer on this line — keep scanning earlier ones.
538
+ }
539
+ else if (normalized) {
540
+ return normalized;
541
+ }
542
+ }
543
+ }
544
+ const headerCandidates = [
545
+ ref.filePath.replace(/\.(?:c|cc|cpp|cxx)$/i, '.h'),
546
+ ref.filePath.replace(/\.(?:c|cc|cpp|cxx)$/i, '.hpp'),
547
+ ref.filePath.replace(/\.(?:c|cc|cpp|cxx)$/i, '.hxx'),
548
+ ].filter((candidate, index, arr) => arr.indexOf(candidate) === index && candidate !== ref.filePath);
549
+ for (const headerPath of headerCandidates) {
550
+ if (!context.fileExists(headerPath))
551
+ continue;
552
+ const headerSource = context.readFile(headerPath);
553
+ if (!headerSource)
554
+ continue;
555
+ for (const line of headerSource.split(/\r?\n/)) {
556
+ if (!receiverPattern.test(line))
557
+ continue;
558
+ const declaratorMatch = line.match(declaratorRegex);
559
+ if (!declaratorMatch)
560
+ continue;
561
+ const normalized = normalizeCppTypeName(declaratorMatch[1] ?? '');
562
+ if (normalized && normalized !== 'auto')
563
+ return normalized;
564
+ }
565
+ }
566
+ return null;
567
+ }
568
+ /**
569
+ * Last `::`-separated segment of a (possibly namespace-qualified) C++ name.
570
+ */
571
+ function cppLastSegment(name) {
572
+ const parts = name.split('::').filter(Boolean);
573
+ return parts[parts.length - 1] ?? name;
574
+ }
575
+ /**
576
+ * Return type captured at extraction for `Class::method` (or a free function),
577
+ * read off the indexed node's `returnType` — used by the C++ (#645) and PHP
578
+ * (#608) chained-call resolvers. Language-filtered. Null when not indexed or no
579
+ * return type was recorded (a `void`/primitive return).
580
+ */
581
+ function lookupCalleeReturnType(callee, ref, context) {
582
+ let method = callee;
583
+ let cls = null;
584
+ if (callee.includes('::')) {
585
+ const parts = callee.split('::').filter(Boolean);
586
+ method = parts[parts.length - 1] ?? callee;
587
+ cls = parts.slice(0, -1).join('::');
588
+ }
589
+ const candidates = context.getNodesByName(method).filter((n) => (n.kind === 'method' || n.kind === 'function') &&
590
+ n.language === ref.language &&
591
+ !!n.returnType);
592
+ if (cls) {
593
+ const want = `${cls}::${method}`;
594
+ // The call site may name the class with MORE namespace qualification than
595
+ // the stored node (`details::registry::instance` at the call vs
596
+ // `registry::instance` on the node — the receiver type only carries the
597
+ // immediate class), or LESS. Accept an exact match or either being a
598
+ // namespace-suffix of the other; the shared `::<class>::<method>` tail keeps
599
+ // it specific.
600
+ const m = candidates.find((n) => n.qualifiedName === want ||
601
+ n.qualifiedName.endsWith(`::${want}`) ||
602
+ want.endsWith(`::${n.qualifiedName}`));
603
+ return m?.returnType ?? null;
604
+ }
605
+ return candidates.find((n) => n.kind === 'function')?.returnType ?? null;
606
+ }
607
+ /** Does the graph contain a class/struct named `name`'s last segment? */
608
+ function cppClassExists(name, ref, context) {
609
+ const last = cppLastSegment(name);
610
+ return context
611
+ .getNodesByName(last)
612
+ .some((n) => (n.kind === 'class' || n.kind === 'struct') && n.language === ref.language);
613
+ }
614
+ /**
615
+ * Infer the class produced by a C++ call/construction expression, using return
616
+ * types captured at extraction (#645). Handles, in order:
617
+ * - `make_unique<T>()` / `make_shared<T>()` → T
618
+ * - single-level member call `recv.method()` → recv's type, then method's return
619
+ * - `Class::method()` / free `func()` → the callee's recorded return type
620
+ * - direct construction `Type()` / `ns::Type()` → Type
621
+ * Returns null when undeterminable. Callers MUST still validate the outer method
622
+ * exists on the result before creating an edge, so a wrong guess stays silent.
623
+ */
624
+ function resolveCppCallResultType(inner, ref, context, depth = 0) {
625
+ if (depth > 3)
626
+ return null; // guard against pathological mutual recursion
627
+ const expr = inner.trim();
628
+ const make = expr.match(/(?:^|::)(?:make_unique|make_shared)\s*<\s*([A-Za-z_]\w*)/);
629
+ if (make)
630
+ return make[1] ?? null;
631
+ // Single-level member call `recv.method` (the `manager.view().render()` shape).
632
+ const dotIdx = expr.lastIndexOf('.');
633
+ if (dotIdx > 0) {
634
+ const recv = expr.slice(0, dotIdx);
635
+ const method = expr.slice(dotIdx + 1);
636
+ if (recv.includes('.') || recv.includes('(') || recv.includes('::'))
637
+ return null; // single level only
638
+ const recvType = inferCppReceiverType(recv, ref, context, depth + 1);
639
+ if (!recvType)
640
+ return null;
641
+ return lookupCalleeReturnType(`${recvType}::${method}`, ref, context);
642
+ }
643
+ const ret = lookupCalleeReturnType(expr, ref, context);
644
+ if (ret)
645
+ return ret;
646
+ // Direct construction — the callee itself names a class/struct.
647
+ if (cppClassExists(expr, ref, context))
648
+ return cppLastSegment(expr);
649
+ return null;
650
+ }
651
+ /**
652
+ * Recover the type of an `auto`-declared local from its initializer on the
653
+ * declaration line — `auto x = Foo::instance();`, `auto w = make_unique<W>();`,
654
+ * `auto p = new W();`, `auto w = Widget();` (#645).
655
+ */
656
+ function inferCppAutoInitializerType(line, receiverName, ref, context, depth) {
657
+ const escaped = receiverName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
658
+ const m = line.match(new RegExp(`\\b${escaped}\\b\\s*=\\s*([^;]+)`));
659
+ if (!m || !m[1])
660
+ return null;
661
+ const init = m[1].trim();
662
+ const neu = init.match(/^new\s+([A-Za-z_][\w:]*)/);
663
+ if (neu && neu[1])
664
+ return cppLastSegment(neu[1]);
665
+ // A call or construction: `Foo(...)`, `A::b(...)`, `make_unique<T>(...)`.
666
+ const call = init.match(/^([A-Za-z_][\w:]*(?:\s*<[^>;]*>)?)\s*\(/);
667
+ if (call && call[1])
668
+ return resolveCppCallResultType(call[1].replace(/\s+/g, ''), ref, context, depth + 1);
669
+ return null;
670
+ }
671
+ /**
672
+ * Resolve a C++ chained call whose receiver is itself a call — encoded by the
673
+ * extractor as `<innerCallee>().<method>` (#645). The receiver's type is what
674
+ * the inner call returns; the outer method is then resolved and VALIDATED on it
675
+ * (resolveMethodOnType requires `cls::method` to exist), so a wrong inference
676
+ * produces no edge rather than a wrong one.
677
+ */
678
+ function matchCppCallChain(ref, context) {
679
+ const m = ref.referenceName.match(/^(.+)\(\)\.(\w+)$/);
680
+ if (!m || !m[1] || !m[2])
681
+ return null;
682
+ const cls = resolveCppCallResultType(m[1], ref, context);
683
+ if (!cls)
684
+ return null;
685
+ return resolveMethodOnType(cls, m[2], ref, context, 0.85, 'instance-method');
686
+ }
687
+ /**
688
+ * Resolve a `::`-scoped factory chain whose receiver is a scoped/static call —
689
+ * PHP `Cls::for($x)->method()` (#608, the per-credential Laravel client idiom) or
690
+ * Rust `Foo::new().bar()` (an associated-function call) — both encoded by the
691
+ * extractor as `Cls::factory().method`. The receiver's type is what `Cls::factory`
692
+ * returns: a `self` marker (PHP `: self`/`: static`, Rust `-> Self`) resolves to
693
+ * the factory's own type, a concrete return type to that type. The outer method is
694
+ * then resolved and VALIDATED on it (resolveMethodOnType requires the method to
695
+ * exist on the type or a supertype it conforms to), so a wrong inference yields no
696
+ * edge rather than a wrong one. Shared by the `::`-receiver languages (PHP, Rust).
697
+ */
698
+ function matchScopedCallChain(ref, context) {
699
+ const m = ref.referenceName.match(/^(.+)\(\)\.(\w+)$/);
700
+ if (!m || !m[1] || !m[2])
701
+ return null;
702
+ const inner = m[1];
703
+ const method = m[2];
704
+ if (!inner.includes('::'))
705
+ return null; // only static-factory (`Cls::method`) chains
706
+ const factoryClass = inner.slice(0, inner.lastIndexOf('::'));
707
+ const ret = lookupCalleeReturnType(inner, ref, context);
708
+ if (!ret)
709
+ return null;
710
+ // `self` (the extractor's marker for self/static/$this) → the factory's class.
711
+ const resolvedClass = ret === 'self' ? factoryClass : ret;
712
+ return resolveMethodOnType(resolvedClass, method, ref, context, 0.85, 'instance-method');
713
+ }
714
+ /**
715
+ * Languages where an unprefixed capitalized call `Foo(args)` constructs the
716
+ * class (so a `Foo(args).method()` receiver's type is `Foo`). Java/C# need `new`,
717
+ * so a bare `Foo()` there is a method call, not construction — excluded. Scala's
718
+ * `Foo(args)` is a case-class / companion `apply`, which conventionally returns
719
+ * `Foo` — and resolveMethodOnType validates, so a non-conventional `apply` that
720
+ * returns another type simply yields no edge rather than a wrong one. Pascal/Delphi:
721
+ * a `TFoo(x)` is a TYPECAST whose result is a `TFoo`, so `TFoo(x).method()` resolves
722
+ * the method on `TFoo` — same shape, same validation.
723
+ */
724
+ const CONSTRUCTS_VIA_BARE_CALL = new Set(['kotlin', 'swift', 'scala', 'dart', 'pascal']);
725
+ /**
726
+ * Resolve a dotted chained call whose receiver is a static factory / fluent call —
727
+ * `Foo.getInstance().bar()`, encoded by the extractor as `Foo.getInstance().bar`
728
+ * (#645/#608 mechanism). The receiver's type is what `Foo.getInstance` returns
729
+ * (its declared return type); the outer method is then resolved and VALIDATED on
730
+ * it (resolveMethodOnType requires `Type::method` to exist), so a wrong inference
731
+ * yields no edge rather than a wrong one (e.g. a same-named `bar()` on an
732
+ * unrelated class is never matched). Shared by the dot-notation languages
733
+ * (Java, Kotlin, C#, Swift) — same receiver shape, same `Class::method` qualified names.
734
+ */
735
+ function matchDottedCallChain(ref, context) {
736
+ const m = ref.referenceName.match(/^(.+)\(\)\.(\w+)$/);
737
+ if (!m || !m[1] || !m[2])
738
+ return null;
739
+ const inner = m[1]; // `Foo.getInstance`
740
+ const method = m[2]; // `bar`
741
+ const lastDot = inner.lastIndexOf('.');
742
+ if (lastDot <= 0) {
743
+ // Go: bare package-level factory FUNCTION `New().method()` — the receiver's
744
+ // type is what `New` returns; resolve the method on that.
745
+ if (ref.language === 'go') {
746
+ const ret = lookupCalleeReturnType(inner, ref, context);
747
+ if (ret) {
748
+ return resolveMethodOnType(ret, method, ref, context, 0.85, 'instance-method', importedFqnOf(ret, ref, context));
749
+ }
750
+ // `inner` isn't a function with a captured return type — typically a
751
+ // package-level VARIABLE holding a function value (e.g. gin's `engine()`),
752
+ // whose type we can't recover. Fall back to bare-name resolution of the
753
+ // method so we don't DROP an edge the un-re-encoded bare path would have
754
+ // found. (When `inner` IS a real factory function but the method doesn't
755
+ // exist on its return type, `ret` is truthy and we returned no edge above —
756
+ // the absent-method safety guarantee is preserved.)
757
+ //
758
+ // CRITICAL: resolve the TARGET via a synthetic bare-name ref, but return the
759
+ // match tied to the ORIGINAL `ref` (referenceName `inner().method`). The
760
+ // batched resolver (resolveAndPersistBatched) reads unresolved rows from
761
+ // offset 0 every pass and relies on deleteSpecificResolvedReferences —
762
+ // keyed on referenceName — to clear each resolved row so the batch empties.
763
+ // If we propagated the synthetic ref's bare `method` as `.original`, the
764
+ // delete would never match the stored `inner().method` row, the batch would
765
+ // never drain, and the loop would re-resolve + re-insert forever (a runaway
766
+ // that grew gin's graph to 5M edges / 1.4 GB before this fix).
767
+ const bareRef = { ...ref, referenceName: method };
768
+ const bareMatch = matchByExactName(bareRef, context) ?? matchFuzzy(bareRef, context);
769
+ return bareMatch ? { ...bareMatch, original: ref } : null;
770
+ }
771
+ // Constructor receiver `Foo(args).method()` (encoded `Foo().method`): a bare,
772
+ // capitalized inner is a class construction, so the receiver's type is the
773
+ // class itself — resolve the method on it. Only in languages where an
774
+ // unprefixed capitalized call constructs the class (Kotlin, Swift); in Java/C#
775
+ // a bare `Foo()` is a method call (constructors need `new`), so we must not
776
+ // assume construction. A lowercase bare inner is a top-level `factory().method()`
777
+ // whose type we can't recover — bail.
778
+ if (!CONSTRUCTS_VIA_BARE_CALL.has(ref.language) || !/^[A-Z]/.test(inner))
779
+ return null;
780
+ return resolveMethodOnType(inner, method, ref, context, 0.85, 'instance-method', importedFqnOf(inner, ref, context));
781
+ }
782
+ // Factory/fluent receiver `Receiver.factory(args).method()`: the receiver's
783
+ // type is what `Receiver.factory` returns (its declared return type).
784
+ const factoryClass = inner.slice(0, lastDot).split('.').pop(); // simple class name
785
+ const factoryMethod = inner.slice(lastDot + 1);
786
+ if (!factoryClass || !factoryMethod)
787
+ return null;
788
+ const ret = lookupCalleeReturnType(`${factoryClass}::${factoryMethod}`, ref, context);
789
+ if (!ret) {
790
+ // Objective-C: a class-message factory — `[X alloc]`, `[X new]`,
791
+ // `[X sharedFoo]` — returns an instance of the RECEIVER class `X` by
792
+ // convention (`instancetype`). So when the factory's own return type isn't
793
+ // recoverable (its selector returns `instancetype`, or `alloc`/`new` aren't
794
+ // user-defined nodes at all), the receiver's type is the class `X` itself.
795
+ // This resolves the ubiquitous `[[X alloc] init]` and singleton chains.
796
+ // resolveMethodOnType validates against X (and its supertypes), so a class
797
+ // whose method actually lives elsewhere yields NO edge, not a wrong one — and
798
+ // crucially this does NOT fire when a concrete return type WAS captured but
799
+ // simply lacks the method (that already returned null above: absent-method
800
+ // safety, so a same-named decoy is still never matched).
801
+ if (ref.language === 'objc' && /^[A-Z]/.test(factoryClass)) {
802
+ return resolveMethodOnType(factoryClass, method, ref, context, 0.8, 'instance-method', importedFqnOf(factoryClass, ref, context));
803
+ }
804
+ // Pascal/Delphi: the extractor only re-encodes a `TFoo`/`IFoo`-prefixed chain
805
+ // (the type-naming convention), so `factoryClass` is always a real class here.
806
+ // A factory whose return type wasn't captured is a CONSTRUCTOR
807
+ // (`TFileMem.Create().SetCachePerformance` — `constructor Create` has no `:
808
+ // TBar` annotation but returns its own class) or an unannotated function. In
809
+ // both cases the receiver's type is the class itself, so resolve the method on
810
+ // `factoryClass`. resolveMethodOnType validates against it (and its
811
+ // supertypes), so a wrong inference yields no edge — and this never fires when
812
+ // a return type WAS captured but lacks the method (absent-method safety above).
813
+ if (ref.language === 'pascal' && /^[TI]/.test(factoryClass)) {
814
+ return resolveMethodOnType(factoryClass, method, ref, context, 0.8, 'instance-method', importedFqnOf(factoryClass, ref, context));
815
+ }
816
+ return null;
817
+ }
818
+ return resolveMethodOnType(ret, method, ref, context, 0.85, 'instance-method', importedFqnOf(ret, ref, context));
819
+ }
820
+ /**
821
+ * When several classes share a simple type name, the caller file's import of
822
+ * that type is the only signal that names WHICH one (#314). Returns the imported
823
+ * FQN for `typeName` in the ref's file, or undefined.
824
+ */
825
+ function importedFqnOf(typeName, ref, context) {
826
+ const imports = context.getImportMappings(ref.filePath, ref.language);
827
+ return imports.find((i) => i.localName === typeName)?.source;
828
+ }
829
+ /**
830
+ * Java/Kotlin: infer a receiver's declared type by walking field declarations
831
+ * in the class enclosing the call site. The field's `signature` is already in
832
+ * the form "<TypeName> <fieldName>" (set by tree-sitter.ts extractField), so we
833
+ * pull the type from there. Handles Spring `@Resource UserBO userbo;` /
834
+ * `@Autowired private UserService userService;` where the receiver field name
835
+ * doesn't match the class name by Java naming convention.
836
+ *
837
+ * Returns the bare type name (generics stripped, dotted package stripped) or
838
+ * null when no matching field is in the enclosing class.
839
+ */
840
+ function inferJavaFieldReceiverType(receiverName, ref, context) {
841
+ const inFile = context.getNodesInFile(ref.filePath);
842
+ if (inFile.length === 0)
843
+ return null;
844
+ // Find the class enclosing the call line (tightest match by latest start).
845
+ let enclosing = null;
846
+ for (const n of inFile) {
847
+ if (n.kind !== 'class' && n.kind !== 'interface')
848
+ continue;
849
+ if (n.language !== ref.language)
850
+ continue;
851
+ const end = n.endLine ?? n.startLine;
852
+ if (n.startLine <= ref.line && end >= ref.line) {
853
+ if (!enclosing || n.startLine >= enclosing.startLine)
854
+ enclosing = n;
855
+ }
856
+ }
857
+ if (!enclosing)
858
+ return null;
859
+ const enclosingEnd = enclosing.endLine ?? enclosing.startLine;
860
+ const field = inFile.find((n) => n.kind === 'field' &&
861
+ n.name === receiverName &&
862
+ n.language === ref.language &&
863
+ n.startLine >= enclosing.startLine &&
864
+ (n.endLine ?? n.startLine) <= enclosingEnd);
865
+ if (!field || !field.signature)
866
+ return null;
867
+ // Signature shape: "<TypeName> <fieldName>" (extractField). Pull the type,
868
+ // strip generics + dotted package, drop array/varargs markers.
869
+ const beforeName = field.signature.slice(0, field.signature.lastIndexOf(field.name));
870
+ const typeRaw = beforeName.trim();
871
+ if (!typeRaw)
872
+ return null;
873
+ const typeNoGenerics = typeRaw.replace(/<[^>]*>/g, '').trim();
874
+ const typeNoArray = typeNoGenerics.replace(/\[\s*\]/g, '').replace(/\.\.\.$/, '').trim();
875
+ const parts = typeNoArray.split(/[.\s]+/).filter(Boolean);
876
+ const lastPart = parts[parts.length - 1];
877
+ if (!lastPart)
878
+ return null;
879
+ if (!/^[A-Z]/.test(lastPart))
880
+ return null; // primitives / lowercase → skip
881
+ return lastPart;
882
+ }
883
+ /**
884
+ * Try to resolve by method name on a class/object
885
+ */
886
+ function matchMethodCall(ref, context) {
887
+ // Parse method call patterns like "obj.method" or "Class::method". The method
888
+ // part allows trailing `:` keywords so Objective-C selectors resolve
889
+ // (`SDImageCache.storeImage:`, `obj.setX:y:`); colons never appear in other
890
+ // languages' method refs, so this is a no-op for them.
891
+ // The receiver allows dots (`builder.Services.AddCoreServices`) so a CHAINED
892
+ // call resolves by its last segment — Strategy 3 below name-matches the method
893
+ // (with its existing single-candidate / receiver-overlap guards). Without this
894
+ // a multi-dot extension-method call (C# DI `builder.Services.AddCoreServices()`,
895
+ // `Guard.Against.X()`) matched no pattern and never resolved.
896
+ const dotMatch = ref.referenceName.match(/^([\w.]+)\.(\w+:?(?:\w+:)*)$/);
897
+ const colonMatch = ref.referenceName.match(/^(\w+)::(\w+)$/);
898
+ const match = dotMatch || colonMatch;
899
+ if (!match) {
900
+ return null;
901
+ }
902
+ const [, objectOrClass, methodName] = match;
903
+ if (ref.language === 'cpp' && dotMatch) {
904
+ const inferredType = inferCppReceiverType(objectOrClass, ref, context);
905
+ if (inferredType) {
906
+ const typedMatch = resolveMethodOnType(inferredType, methodName, ref, context, 0.9, 'instance-method');
907
+ if (typedMatch) {
908
+ return typedMatch;
909
+ }
910
+ }
911
+ }
912
+ // Java/Kotlin: receiver may be a field whose name doesn't match the type by
913
+ // Java naming convention (`userbo` → class `UserBO`, abbreviated). Look up
914
+ // the field in the enclosing class to get its declared type, then resolve
915
+ // the method on that type. Covers Spring `@Resource`/`@Autowired` field
916
+ // injection where the field type is the concrete bean class.
917
+ if ((ref.language === 'java' || ref.language === 'kotlin') && dotMatch) {
918
+ const inferredType = inferJavaFieldReceiverType(objectOrClass, ref, context);
919
+ if (inferredType) {
920
+ // When two classes share the same simple name, the caller file's
921
+ // import is the only signal that names WHICH one — pass the
922
+ // imported FQN so resolveMethodOnType can disambiguate (#314).
923
+ const imports = context.getImportMappings(ref.filePath, ref.language);
924
+ const importedFqn = imports.find((i) => i.localName === inferredType)?.source;
925
+ const typedMatch = resolveMethodOnType(inferredType, methodName, ref, context, 0.9, 'instance-method', importedFqn);
926
+ if (typedMatch) {
927
+ return typedMatch;
928
+ }
929
+ }
930
+ }
931
+ // Strategy 1: Direct class name match (existing logic)
932
+ const classCandidates = context.getNodesByName(objectOrClass);
933
+ for (const classNode of classCandidates) {
934
+ if (classNode.kind === 'class' || classNode.kind === 'struct' || classNode.kind === 'interface') {
935
+ // Skip cross-language class matches
936
+ if (classNode.language !== ref.language)
937
+ continue;
938
+ const nodesInFile = context.getNodesInFile(classNode.filePath);
939
+ const methodNode = nodesInFile.find((n) => n.kind === 'method' &&
940
+ n.name === methodName &&
941
+ n.qualifiedName.includes(classNode.name));
942
+ if (methodNode) {
943
+ return {
944
+ original: ref,
945
+ targetNodeId: methodNode.id,
946
+ confidence: 0.85,
947
+ resolvedBy: 'qualified-name',
948
+ };
949
+ }
950
+ }
951
+ }
952
+ // Strategy 2: Instance variable receiver - try capitalized form to find class
953
+ // e.g., "permissionEngine" → look for classes containing "PermissionEngine"
954
+ const capitalizedReceiver = objectOrClass.charAt(0).toUpperCase() + objectOrClass.slice(1);
955
+ if (capitalizedReceiver !== objectOrClass) {
956
+ const fuzzyClassCandidates = context.getNodesByName(capitalizedReceiver);
957
+ for (const classNode of fuzzyClassCandidates) {
958
+ if (classNode.kind === 'class' || classNode.kind === 'struct' || classNode.kind === 'interface') {
959
+ // Skip cross-language class matches
960
+ if (classNode.language !== ref.language)
961
+ continue;
962
+ const nodesInFile = context.getNodesInFile(classNode.filePath);
963
+ const methodNode = nodesInFile.find((n) => n.kind === 'method' &&
964
+ n.name === methodName &&
965
+ n.qualifiedName.includes(classNode.name));
966
+ if (methodNode) {
967
+ return {
968
+ original: ref,
969
+ targetNodeId: methodNode.id,
970
+ confidence: 0.8,
971
+ resolvedBy: 'instance-method',
972
+ };
973
+ }
974
+ }
975
+ }
976
+ }
977
+ // Strategy 3: Find methods by name across the codebase, match by receiver
978
+ // name similarity with the containing class. Handles abbreviated variable
979
+ // names like permissionEngine → PermissionRuleEngine.
980
+ if (methodName) {
981
+ const methodCandidates = context.getNodesByName(methodName);
982
+ // Ubiquitous-method ceiling (#999): a method name re-declared across a
983
+ // vendored theme/SDK (Metronic's `init`/`update`/… on every widget) yields
984
+ // K candidates that receiver-word overlap can't reliably disambiguate —
985
+ // and filtering + scoring all K per call is the O(K²) cost that wedged
986
+ // "Resolving refs" for 15-28 min. Bail before the O(K) work; Strategy 1/2
987
+ // (class-name match) already had their precise shot above.
988
+ if (methodCandidates.length > AMBIGUOUS_NAME_CEILING) {
989
+ return null;
990
+ }
991
+ const methods = methodCandidates.filter((n) => n.kind === 'method' && n.name === methodName);
992
+ // Filter to same-language candidates first
993
+ const sameLanguageMethods = methods.filter(m => m.language === ref.language);
994
+ const targetMethods = sameLanguageMethods.length > 0 ? sameLanguageMethods : methods;
995
+ // If only one same-language method with this name exists, use it
996
+ if (targetMethods.length === 1 && targetMethods[0].language === ref.language) {
997
+ return {
998
+ original: ref,
999
+ targetNodeId: targetMethods[0].id,
1000
+ confidence: 0.7,
1001
+ resolvedBy: 'instance-method',
1002
+ };
1003
+ }
1004
+ // Multiple methods: score by receiver name word overlap with class name
1005
+ if (targetMethods.length > 1) {
1006
+ const receiverWords = splitCamelCase(objectOrClass);
1007
+ let bestMatch;
1008
+ let bestScore = 0;
1009
+ for (const method of targetMethods) {
1010
+ const classWords = splitCamelCase(method.qualifiedName);
1011
+ let score = receiverWords.filter(w => classWords.some(cw => cw.toLowerCase() === w.toLowerCase())).length;
1012
+ // Bonus for same language
1013
+ if (method.language === ref.language)
1014
+ score += 1;
1015
+ if (score > bestScore) {
1016
+ bestScore = score;
1017
+ bestMatch = method;
1018
+ }
1019
+ }
1020
+ if (bestMatch && bestScore >= 2) {
1021
+ return {
1022
+ original: ref,
1023
+ targetNodeId: bestMatch.id,
1024
+ confidence: 0.65,
1025
+ resolvedBy: 'instance-method',
1026
+ };
1027
+ }
1028
+ }
1029
+ }
1030
+ return null;
1031
+ }
1032
+ /**
1033
+ * Split a camelCase or PascalCase string into words.
1034
+ */
1035
+ function splitCamelCase(str) {
1036
+ return str.replace(/([a-z])([A-Z])/g, '$1 $2')
1037
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
1038
+ .split(/[\s._:\/\\]+/)
1039
+ .filter(w => w.length > 1);
1040
+ }
1041
+ /**
1042
+ * Compute directory proximity from a pre-split list of directory segments
1043
+ * (`filePath1` minus its filename) and a second file path.
1044
+ * Returns a score based on the number of shared leading directory segments.
1045
+ * Higher score = closer in directory tree.
1046
+ *
1047
+ * Split into a pre-split variant because findBestMatch scores every candidate
1048
+ * against the SAME `ref.filePath`; re-splitting it per candidate was a hot spot
1049
+ * on large repos (#915), so the caller splits it once and passes the segments.
1050
+ */
1051
+ function pathProximityFromDirs(dir1, filePath2) {
1052
+ const dir2 = filePath2.split('/');
1053
+ dir2.pop(); // drop filename — matches the original slice(0, -1) on both paths
1054
+ let shared = 0;
1055
+ const limit = Math.min(dir1.length, dir2.length);
1056
+ for (let i = 0; i < limit; i++) {
1057
+ if (dir1[i] === dir2[i]) {
1058
+ shared++;
1059
+ }
1060
+ else {
1061
+ break;
1062
+ }
1063
+ }
1064
+ // Each shared directory segment contributes 15 points, capped at 80
1065
+ return Math.min(shared * 15, 80);
1066
+ }
1067
+ /**
1068
+ * Compute directory proximity between two file paths.
1069
+ * Returns a score based on the number of shared directory segments.
1070
+ */
1071
+ function computePathProximity(filePath1, filePath2) {
1072
+ const dir1 = filePath1.split('/');
1073
+ dir1.pop();
1074
+ return pathProximityFromDirs(dir1, filePath2);
1075
+ }
1076
+ /**
1077
+ * Find the best matching node when there are multiple candidates
1078
+ */
1079
+ function findBestMatch(ref, candidates, _context) {
1080
+ // Prioritization rules:
1081
+ // 1. Same file > different file
1082
+ // 2. Directory proximity (same module/package > different module)
1083
+ // 3. Same language > different language
1084
+ // 4. Functions/methods > classes/types (for call references)
1085
+ // 5. Exported > non-exported
1086
+ let bestScore = -1;
1087
+ let bestNode = null;
1088
+ // Split the ref's path once (it's the same across every candidate) instead of
1089
+ // re-splitting it inside computePathProximity per candidate (#915 hot spot).
1090
+ const refDirs = ref.filePath.split('/');
1091
+ refDirs.pop();
1092
+ // A same-language candidate ALWAYS outscores a cross-language one: same-language
1093
+ // scores at least +50 (language bonus), while a cross-language candidate maxes
1094
+ // out at +35 (−80 language, +80 proximity, +25 kind, +10 exported; it can never
1095
+ // be in the same file). So when any same-language candidate exists, skip the
1096
+ // cross-language ones — provably the same winner, without paying the per-candidate
1097
+ // scoring. Cuts the candidate set to same-language size on mixed front-end +
1098
+ // back-end repos (#915). When ALL candidates are cross-language (a legitimate
1099
+ // cross-language `calls` bridge), none are skipped and behavior is unchanged.
1100
+ const hasSameLanguage = candidates.some((c) => c.language === ref.language);
1101
+ for (const candidate of candidates) {
1102
+ if (hasSameLanguage && candidate.language !== ref.language)
1103
+ continue;
1104
+ let score = 0;
1105
+ // Same file bonus
1106
+ if (candidate.filePath === ref.filePath) {
1107
+ score += 100;
1108
+ }
1109
+ // Directory proximity bonus — strongly prefer same module/package
1110
+ score += pathProximityFromDirs(refDirs, candidate.filePath);
1111
+ // Language matching: strongly prefer same language, penalize cross-language
1112
+ if (candidate.language === ref.language) {
1113
+ score += 50;
1114
+ }
1115
+ else {
1116
+ score -= 80;
1117
+ }
1118
+ // For call references, prefer functions/methods
1119
+ if (ref.referenceKind === 'calls') {
1120
+ if (candidate.kind === 'function' || candidate.kind === 'method') {
1121
+ score += 25;
1122
+ }
1123
+ }
1124
+ // For instantiation references (`new Foo()`), prefer class-like
1125
+ // targets — without this, a function named `Foo` in another module
1126
+ // could outscore the actual class.
1127
+ if (ref.referenceKind === 'instantiates') {
1128
+ if (candidate.kind === 'class' ||
1129
+ candidate.kind === 'struct' ||
1130
+ candidate.kind === 'interface') {
1131
+ score += 25;
1132
+ }
1133
+ }
1134
+ // For decorator references (`@Foo`), prefer functions. Class
1135
+ // decorators (Python `@SomeClass`, Java annotation interfaces)
1136
+ // also resolve here, hence the smaller class bonus.
1137
+ if (ref.referenceKind === 'decorates') {
1138
+ if (candidate.kind === 'function' || candidate.kind === 'method') {
1139
+ score += 25;
1140
+ }
1141
+ else if (candidate.kind === 'class' || candidate.kind === 'interface') {
1142
+ score += 15;
1143
+ }
1144
+ }
1145
+ // Exported bonus
1146
+ if (candidate.isExported) {
1147
+ score += 10;
1148
+ }
1149
+ // Closer line number (within same file)
1150
+ if (candidate.filePath === ref.filePath && candidate.startLine) {
1151
+ const distance = Math.abs(candidate.startLine - ref.line);
1152
+ score += Math.max(0, 20 - distance / 10);
1153
+ }
1154
+ if (score > bestScore) {
1155
+ bestScore = score;
1156
+ bestNode = candidate;
1157
+ }
1158
+ }
1159
+ return bestNode;
1160
+ }
1161
+ /**
1162
+ * Fuzzy match - last resort with lower confidence
1163
+ */
1164
+ function matchFuzzy(ref, context) {
1165
+ const lowerName = ref.referenceName.toLowerCase();
1166
+ // Use pre-built lowercase index for O(1) lookup instead of scanning all nodes
1167
+ const candidates = context.getNodesByLowerName(lowerName);
1168
+ // Filter to callable kinds only (function, method, class)
1169
+ const callableKinds = new Set(['function', 'method', 'class']);
1170
+ const callableCandidates = applyLanguageGate(candidates.filter((n) => callableKinds.has(n.kind)), ref);
1171
+ // Prefer same-language matches
1172
+ const sameLanguageCandidates = callableCandidates.filter(n => n.language === ref.language);
1173
+ const finalCandidates = sameLanguageCandidates.length > 0 ? sameLanguageCandidates : callableCandidates;
1174
+ if (finalCandidates.length === 1) {
1175
+ const isCrossLanguage = finalCandidates[0].language !== ref.language;
1176
+ return {
1177
+ original: ref,
1178
+ targetNodeId: finalCandidates[0].id,
1179
+ confidence: isCrossLanguage ? 0.3 : 0.5,
1180
+ resolvedBy: 'fuzzy',
1181
+ };
1182
+ }
1183
+ return null;
1184
+ }
1185
+ /**
1186
+ * Match all strategies in order of confidence
1187
+ */
1188
+ function matchReference(ref, context) {
1189
+ // Function-as-value refs (#756) resolve ONLY through the dedicated matcher —
1190
+ // never the fuzzy/qualified fallthrough below (a wrong callback edge is
1191
+ // worse than none).
1192
+ if (ref.referenceKind === 'function_ref') {
1193
+ return matchFunctionRef(ref, context);
1194
+ }
1195
+ // Try strategies in order of confidence
1196
+ let result;
1197
+ // 0. File path match (e.g., "snippets/drawer-menu.liquid" → file node)
1198
+ result = matchByFilePath(ref, context);
1199
+ if (result)
1200
+ return result;
1201
+ // 1. Qualified name match (highest confidence)
1202
+ result = matchByQualifiedName(ref, context);
1203
+ if (result)
1204
+ return result;
1205
+ // 1b. C++ chained call whose receiver is another call — `Foo::instance().bar()`
1206
+ // encoded as `Foo::instance().bar` by the extractor (#645). Resolve the
1207
+ // receiver's type from what the inner call returns, then the method on it.
1208
+ if (ref.language === 'cpp' || ref.language === 'c') {
1209
+ result = matchCppCallChain(ref, context);
1210
+ if (result)
1211
+ return result;
1212
+ }
1213
+ // 1c. `::`-scoped factory chain — PHP `Cls::for($x)->method()` (#608) or Rust
1214
+ // `Foo::new().bar()`, both encoded as `Cls::factory().method`. The receiver's
1215
+ // type is the factory's `self` (PHP `: self`/`: static`, Rust `-> Self`) or
1216
+ // concrete return type.
1217
+ if (ref.language === 'php' || ref.language === 'rust') {
1218
+ result = matchScopedCallChain(ref, context);
1219
+ if (result)
1220
+ return result;
1221
+ }
1222
+ // 1d. Dotted chained static-factory / fluent call (Java / Kotlin / C# / Swift /
1223
+ // Go / Scala / Dart / Objective-C) — `Foo.getInstance().bar()` encoded as
1224
+ // `Foo.getInstance().bar`, Go's bare-factory `New().Method()` as `New().Method`,
1225
+ // Scala's companion factory, Dart's static factory / factory-constructor, or
1226
+ // ObjC's chained message send `[[Foo create] doIt]` encoded as `Foo.create().doIt`
1227
+ // (#645/#608 mechanism). Resolve the method's class from the inner call's
1228
+ // declared return type, then validate it.
1229
+ if (ref.language === 'java' ||
1230
+ ref.language === 'kotlin' ||
1231
+ ref.language === 'csharp' ||
1232
+ ref.language === 'swift' ||
1233
+ ref.language === 'go' ||
1234
+ ref.language === 'scala' ||
1235
+ ref.language === 'dart' ||
1236
+ ref.language === 'objc' ||
1237
+ ref.language === 'pascal') {
1238
+ result = matchDottedCallChain(ref, context);
1239
+ if (result)
1240
+ return result;
1241
+ }
1242
+ // 2. Method call pattern
1243
+ result = matchMethodCall(ref, context);
1244
+ if (result)
1245
+ return result;
1246
+ // 3. Exact name match
1247
+ result = matchByExactName(ref, context);
1248
+ if (result)
1249
+ return result;
1250
+ // 4. Fuzzy match (lowest confidence)
1251
+ result = matchFuzzy(ref, context);
1252
+ if (result)
1253
+ return result;
1254
+ return null;
1255
+ }
1256
+ //# sourceMappingURL=name-matcher.js.map