@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.1

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 (622) hide show
  1. package/bin/codegraph +5 -0
  2. package/lib/dist/.test-build-engine.json +1 -0
  3. package/lib/dist/.test-build-viewer.json +1 -0
  4. package/lib/dist/bin/codegraph.d.ts +1 -0
  5. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  6. package/lib/dist/bin/codegraph.js +599 -291
  7. package/lib/dist/bin/codegraph.js.map +1 -1
  8. package/lib/dist/bin/viewer-gate.d.ts +17 -0
  9. package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
  10. package/lib/dist/bin/viewer-gate.js +31 -0
  11. package/lib/dist/bin/viewer-gate.js.map +1 -0
  12. package/lib/dist/context/index.d.ts.map +1 -1
  13. package/lib/dist/context/index.js +43 -2
  14. package/lib/dist/context/index.js.map +1 -1
  15. package/lib/dist/db/index.d.ts +21 -2
  16. package/lib/dist/db/index.d.ts.map +1 -1
  17. package/lib/dist/db/index.js +86 -31
  18. package/lib/dist/db/index.js.map +1 -1
  19. package/lib/dist/db/migrations.d.ts +1 -1
  20. package/lib/dist/db/migrations.d.ts.map +1 -1
  21. package/lib/dist/db/migrations.js +40 -1
  22. package/lib/dist/db/migrations.js.map +1 -1
  23. package/lib/dist/db/queries.d.ts +423 -3
  24. package/lib/dist/db/queries.d.ts.map +1 -1
  25. package/lib/dist/db/queries.js +1026 -33
  26. package/lib/dist/db/queries.js.map +1 -1
  27. package/lib/dist/db/schema.sql +11 -1
  28. package/lib/dist/db/sqlite-adapter.d.ts +2 -0
  29. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  30. package/lib/dist/db/sqlite-adapter.js +56 -7
  31. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  32. package/lib/dist/db/synthesis-stage.d.ts +12 -0
  33. package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
  34. package/lib/dist/db/synthesis-stage.js +89 -0
  35. package/lib/dist/db/synthesis-stage.js.map +1 -0
  36. package/lib/dist/db/wal-valve.d.ts +32 -12
  37. package/lib/dist/db/wal-valve.d.ts.map +1 -1
  38. package/lib/dist/db/wal-valve.js +65 -22
  39. package/lib/dist/db/wal-valve.js.map +1 -1
  40. package/lib/dist/db/wsl-shared-index.d.ts +53 -0
  41. package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
  42. package/lib/dist/db/wsl-shared-index.js +121 -0
  43. package/lib/dist/db/wsl-shared-index.js.map +1 -0
  44. package/lib/dist/directory.d.ts +101 -2
  45. package/lib/dist/directory.d.ts.map +1 -1
  46. package/lib/dist/directory.js +254 -23
  47. package/lib/dist/directory.js.map +1 -1
  48. package/lib/dist/errors.d.ts +14 -0
  49. package/lib/dist/errors.d.ts.map +1 -1
  50. package/lib/dist/errors.js +16 -1
  51. package/lib/dist/errors.js.map +1 -1
  52. package/lib/dist/extraction/cfml-extractor.d.ts +1 -0
  53. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  54. package/lib/dist/extraction/cfml-extractor.js +15 -3
  55. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  56. package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
  57. package/lib/dist/extraction/dfm-extractor.js +14 -10
  58. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  59. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  60. package/lib/dist/extraction/extraction-version.js +1 -1
  61. package/lib/dist/extraction/function-ref.d.ts +6 -4
  62. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  63. package/lib/dist/extraction/function-ref.js +35 -14
  64. package/lib/dist/extraction/function-ref.js.map +1 -1
  65. package/lib/dist/extraction/grammars.d.ts +38 -0
  66. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  67. package/lib/dist/extraction/grammars.js +77 -1
  68. package/lib/dist/extraction/grammars.js.map +1 -1
  69. package/lib/dist/extraction/index.d.ts +113 -15
  70. package/lib/dist/extraction/index.d.ts.map +1 -1
  71. package/lib/dist/extraction/index.js +599 -132
  72. package/lib/dist/extraction/index.js.map +1 -1
  73. package/lib/dist/extraction/languages/c-cpp.d.ts +58 -0
  74. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  75. package/lib/dist/extraction/languages/c-cpp.js +291 -15
  76. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  77. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  78. package/lib/dist/extraction/languages/dart.js +8 -3
  79. package/lib/dist/extraction/languages/dart.js.map +1 -1
  80. package/lib/dist/extraction/languages/javascript.js +1 -1
  81. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  82. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  83. package/lib/dist/extraction/languages/kotlin.js +169 -36
  84. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  85. package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
  86. package/lib/dist/extraction/languages/lua.js +4 -1
  87. package/lib/dist/extraction/languages/lua.js.map +1 -1
  88. package/lib/dist/extraction/languages/python.d.ts.map +1 -1
  89. package/lib/dist/extraction/languages/python.js +71 -0
  90. package/lib/dist/extraction/languages/python.js.map +1 -1
  91. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  92. package/lib/dist/extraction/languages/rust.js +3 -0
  93. package/lib/dist/extraction/languages/rust.js.map +1 -1
  94. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  95. package/lib/dist/extraction/languages/scala.js +18 -3
  96. package/lib/dist/extraction/languages/scala.js.map +1 -1
  97. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  98. package/lib/dist/extraction/languages/typescript.js +9 -2
  99. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  100. package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
  101. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  102. package/lib/dist/extraction/liquid-extractor.js +98 -22
  103. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  104. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  105. package/lib/dist/extraction/mybatis-extractor.js +6 -4
  106. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  107. package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
  108. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
  109. package/lib/dist/extraction/syntax-tokens.js +381 -0
  110. package/lib/dist/extraction/syntax-tokens.js.map +1 -0
  111. package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  112. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  113. package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
  114. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  115. package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
  116. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  117. package/lib/dist/extraction/tree-sitter.d.ts +96 -17
  118. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  119. package/lib/dist/extraction/tree-sitter.js +820 -82
  120. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  121. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  122. package/lib/dist/file-limits.d.ts +40 -0
  123. package/lib/dist/file-limits.d.ts.map +1 -0
  124. package/lib/dist/file-limits.js +147 -0
  125. package/lib/dist/file-limits.js.map +1 -0
  126. package/lib/dist/graph/branch-guards.d.ts +248 -0
  127. package/lib/dist/graph/branch-guards.d.ts.map +1 -0
  128. package/lib/dist/graph/branch-guards.js +2231 -0
  129. package/lib/dist/graph/branch-guards.js.map +1 -0
  130. package/lib/dist/graph/dead-code.d.ts +251 -0
  131. package/lib/dist/graph/dead-code.d.ts.map +1 -0
  132. package/lib/dist/graph/dead-code.js +776 -0
  133. package/lib/dist/graph/dead-code.js.map +1 -0
  134. package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
  135. package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  136. package/lib/dist/graph/dynamic-boundary-report.js +283 -0
  137. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
  138. package/lib/dist/graph/index.d.ts +4 -0
  139. package/lib/dist/graph/index.d.ts.map +1 -1
  140. package/lib/dist/graph/index.js +16 -1
  141. package/lib/dist/graph/index.js.map +1 -1
  142. package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
  143. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
  144. package/lib/dist/graph/named-symbol-flow.js +552 -0
  145. package/lib/dist/graph/named-symbol-flow.js.map +1 -0
  146. package/lib/dist/graph/symbol-lookup.d.ts +83 -0
  147. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
  148. package/lib/dist/graph/symbol-lookup.js +181 -0
  149. package/lib/dist/graph/symbol-lookup.js.map +1 -0
  150. package/lib/dist/graph/traversal.d.ts +9 -0
  151. package/lib/dist/graph/traversal.d.ts.map +1 -1
  152. package/lib/dist/graph/traversal.js +61 -35
  153. package/lib/dist/graph/traversal.js.map +1 -1
  154. package/lib/dist/graph/type-hierarchy.d.ts +155 -0
  155. package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
  156. package/lib/dist/graph/type-hierarchy.js +382 -0
  157. package/lib/dist/graph/type-hierarchy.js.map +1 -0
  158. package/lib/dist/index.d.ts +251 -11
  159. package/lib/dist/index.d.ts.map +1 -1
  160. package/lib/dist/index.js +395 -34
  161. package/lib/dist/index.js.map +1 -1
  162. package/lib/dist/installer/index.d.ts.map +1 -1
  163. package/lib/dist/installer/index.js +3 -2
  164. package/lib/dist/installer/index.js.map +1 -1
  165. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
  166. package/lib/dist/installer/targets/antigravity.js +14 -2
  167. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  168. package/lib/dist/installer/targets/claude.d.ts +3 -0
  169. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  170. package/lib/dist/installer/targets/claude.js +35 -7
  171. package/lib/dist/installer/targets/claude.js.map +1 -1
  172. package/lib/dist/installer/targets/codex.d.ts +2 -1
  173. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  174. package/lib/dist/installer/targets/codex.js +14 -4
  175. package/lib/dist/installer/targets/codex.js.map +1 -1
  176. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  177. package/lib/dist/installer/targets/copilot-cli.js +7 -1
  178. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  179. package/lib/dist/installer/targets/opencode.d.ts +16 -5
  180. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  181. package/lib/dist/installer/targets/opencode.js +73 -22
  182. package/lib/dist/installer/targets/opencode.js.map +1 -1
  183. package/lib/dist/installer/targets/shared.d.ts +14 -3
  184. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  185. package/lib/dist/installer/targets/shared.js +39 -11
  186. package/lib/dist/installer/targets/shared.js.map +1 -1
  187. package/lib/dist/installer/targets/types.d.ts +7 -0
  188. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  189. package/lib/dist/mcp/answer-freshness.d.ts +10 -0
  190. package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
  191. package/lib/dist/mcp/answer-freshness.js +68 -0
  192. package/lib/dist/mcp/answer-freshness.js.map +1 -0
  193. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  194. package/lib/dist/mcp/daemon-manager.js +16 -0
  195. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  196. package/lib/dist/mcp/daemon-paths.d.ts +2 -0
  197. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  198. package/lib/dist/mcp/daemon-paths.js +12 -3
  199. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  200. package/lib/dist/mcp/daemon-registry.d.ts +7 -4
  201. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  202. package/lib/dist/mcp/daemon-registry.js +91 -29
  203. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  204. package/lib/dist/mcp/daemon.d.ts +17 -7
  205. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  206. package/lib/dist/mcp/daemon.js +116 -24
  207. package/lib/dist/mcp/daemon.js.map +1 -1
  208. package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
  209. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  210. package/lib/dist/mcp/dynamic-boundaries.js +46 -42
  211. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  212. package/lib/dist/mcp/engine.d.ts +28 -9
  213. package/lib/dist/mcp/engine.d.ts.map +1 -1
  214. package/lib/dist/mcp/engine.js +146 -62
  215. package/lib/dist/mcp/engine.js.map +1 -1
  216. package/lib/dist/mcp/explore-dedup.d.ts +5 -2
  217. package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
  218. package/lib/dist/mcp/explore-dedup.js +8 -5
  219. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  220. package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
  221. package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  222. package/lib/dist/mcp/index-freshness-worker.js +30 -0
  223. package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
  224. package/lib/dist/mcp/index-freshness.d.ts +7 -0
  225. package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
  226. package/lib/dist/mcp/index-freshness.js +94 -0
  227. package/lib/dist/mcp/index-freshness.js.map +1 -0
  228. package/lib/dist/mcp/index.d.ts +3 -1
  229. package/lib/dist/mcp/index.d.ts.map +1 -1
  230. package/lib/dist/mcp/index.js +95 -11
  231. package/lib/dist/mcp/index.js.map +1 -1
  232. package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
  233. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  234. package/lib/dist/mcp/liveness-watchdog.js +11 -2
  235. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  236. package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
  237. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
  238. package/lib/dist/mcp/project-lifecycle.js +181 -0
  239. package/lib/dist/mcp/project-lifecycle.js.map +1 -0
  240. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  241. package/lib/dist/mcp/proxy.js +9 -0
  242. package/lib/dist/mcp/proxy.js.map +1 -1
  243. package/lib/dist/mcp/query-pool.d.ts +2 -2
  244. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  245. package/lib/dist/mcp/query-pool.js +9 -7
  246. package/lib/dist/mcp/query-pool.js.map +1 -1
  247. package/lib/dist/mcp/query-worker.js +2 -2
  248. package/lib/dist/mcp/query-worker.js.map +1 -1
  249. package/lib/dist/mcp/server-instructions.d.ts +1 -1
  250. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  251. package/lib/dist/mcp/server-instructions.js +6 -3
  252. package/lib/dist/mcp/server-instructions.js.map +1 -1
  253. package/lib/dist/mcp/startup-handshake.d.ts +3 -1
  254. package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
  255. package/lib/dist/mcp/startup-handshake.js +10 -2
  256. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  257. package/lib/dist/mcp/tools.d.ts +276 -36
  258. package/lib/dist/mcp/tools.d.ts.map +1 -1
  259. package/lib/dist/mcp/tools.js +2295 -980
  260. package/lib/dist/mcp/tools.js.map +1 -1
  261. package/lib/dist/mcp/writer-lock.d.ts +61 -0
  262. package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
  263. package/lib/dist/mcp/writer-lock.js +260 -0
  264. package/lib/dist/mcp/writer-lock.js.map +1 -0
  265. package/lib/dist/resolution/alias-binding.d.ts +56 -0
  266. package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
  267. package/lib/dist/resolution/alias-binding.js +127 -0
  268. package/lib/dist/resolution/alias-binding.js.map +1 -0
  269. package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
  270. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  271. package/lib/dist/resolution/callback-synthesizer.js +291 -143
  272. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  273. package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
  274. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
  275. package/lib/dist/resolution/cpp-constructor.js +123 -0
  276. package/lib/dist/resolution/cpp-constructor.js.map +1 -0
  277. package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  278. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  279. package/lib/dist/resolution/cpp-macro-visibility.js +342 -0
  280. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
  281. package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  282. package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  283. package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
  284. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
  285. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  286. package/lib/dist/resolution/frameworks/csharp.js +96 -2
  287. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  288. package/lib/dist/resolution/frameworks/expo-router.d.ts +189 -0
  289. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  290. package/lib/dist/resolution/frameworks/expo-router.js +785 -0
  291. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
  292. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  293. package/lib/dist/resolution/frameworks/express.js +251 -16
  294. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  295. package/lib/dist/resolution/frameworks/index.d.ts +5 -0
  296. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  297. package/lib/dist/resolution/frameworks/index.js +29 -1
  298. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  299. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  300. package/lib/dist/resolution/frameworks/java.js +79 -47
  301. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  302. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  303. package/lib/dist/resolution/frameworks/nestjs.js +6 -14
  304. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  305. package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
  306. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  307. package/lib/dist/resolution/frameworks/nextjs.js +328 -0
  308. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
  309. package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
  310. package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  311. package/lib/dist/resolution/frameworks/object-literal.js +139 -0
  312. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
  313. package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
  314. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  315. package/lib/dist/resolution/frameworks/package-deps.js +78 -0
  316. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
  317. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  318. package/lib/dist/resolution/frameworks/python.js +166 -0
  319. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  320. package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
  321. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  322. package/lib/dist/resolution/frameworks/react-native.js +153 -14
  323. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  324. package/lib/dist/resolution/frameworks/react-router.d.ts +46 -0
  325. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  326. package/lib/dist/resolution/frameworks/react-router.js +187 -0
  327. package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
  328. package/lib/dist/resolution/frameworks/react.d.ts +2 -1
  329. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  330. package/lib/dist/resolution/frameworks/react.js +188 -139
  331. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  332. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  333. package/lib/dist/resolution/frameworks/svelte.js +6 -1
  334. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  335. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  336. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  337. package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
  338. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  339. package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  340. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  341. package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
  342. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  343. package/lib/dist/resolution/frameworks/vue-router.d.ts +82 -0
  344. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  345. package/lib/dist/resolution/frameworks/vue-router.js +377 -0
  346. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
  347. package/lib/dist/resolution/import-resolver.d.ts +38 -0
  348. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  349. package/lib/dist/resolution/import-resolver.js +376 -26
  350. package/lib/dist/resolution/import-resolver.js.map +1 -1
  351. package/lib/dist/resolution/index.d.ts +89 -25
  352. package/lib/dist/resolution/index.d.ts.map +1 -1
  353. package/lib/dist/resolution/index.js +552 -145
  354. package/lib/dist/resolution/index.js.map +1 -1
  355. package/lib/dist/resolution/js-builtins.d.ts +13 -0
  356. package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
  357. package/lib/dist/resolution/js-builtins.js +46 -0
  358. package/lib/dist/resolution/js-builtins.js.map +1 -0
  359. package/lib/dist/resolution/name-matcher.d.ts +69 -22
  360. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  361. package/lib/dist/resolution/name-matcher.js +1902 -87
  362. package/lib/dist/resolution/name-matcher.js.map +1 -1
  363. package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
  364. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  365. package/lib/dist/resolution/next-router-synthesizer.js +113 -0
  366. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
  367. package/lib/dist/resolution/react-router-synthesizer.d.ts +33 -0
  368. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  369. package/lib/dist/resolution/react-router-synthesizer.js +126 -0
  370. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
  371. package/lib/dist/resolution/resolver-pool.d.ts +2 -0
  372. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  373. package/lib/dist/resolution/resolver-pool.js +4 -0
  374. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  375. package/lib/dist/resolution/strip-comments.d.ts +6 -0
  376. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  377. package/lib/dist/resolution/strip-comments.js +58 -0
  378. package/lib/dist/resolution/strip-comments.js.map +1 -1
  379. package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  380. package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  381. package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
  382. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  383. package/lib/dist/resolution/synth-utils.d.ts +26 -0
  384. package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
  385. package/lib/dist/resolution/synth-utils.js +75 -0
  386. package/lib/dist/resolution/synth-utils.js.map +1 -0
  387. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  388. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  389. package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
  390. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  391. package/lib/dist/resolution/tier-synthesizer.d.ts +49 -0
  392. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  393. package/lib/dist/resolution/tier-synthesizer.js +931 -0
  394. package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
  395. package/lib/dist/resolution/types.d.ts +78 -2
  396. package/lib/dist/resolution/types.d.ts.map +1 -1
  397. package/lib/dist/resolution/types.js +64 -0
  398. package/lib/dist/resolution/types.js.map +1 -1
  399. package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  400. package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  401. package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
  402. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
  403. package/lib/dist/search/query-paths.d.ts +50 -1
  404. package/lib/dist/search/query-paths.d.ts.map +1 -1
  405. package/lib/dist/search/query-paths.js +227 -12
  406. package/lib/dist/search/query-paths.js.map +1 -1
  407. package/lib/dist/search/query-utils.d.ts +15 -0
  408. package/lib/dist/search/query-utils.d.ts.map +1 -1
  409. package/lib/dist/search/query-utils.js +35 -7
  410. package/lib/dist/search/query-utils.js.map +1 -1
  411. package/lib/dist/sync/watch-policy.d.ts +14 -0
  412. package/lib/dist/sync/watch-policy.d.ts.map +1 -1
  413. package/lib/dist/sync/watch-policy.js +19 -0
  414. package/lib/dist/sync/watch-policy.js.map +1 -1
  415. package/lib/dist/sync/watcher.d.ts +52 -35
  416. package/lib/dist/sync/watcher.d.ts.map +1 -1
  417. package/lib/dist/sync/watcher.js +236 -100
  418. package/lib/dist/sync/watcher.js.map +1 -1
  419. package/lib/dist/telemetry/index.d.ts +4 -2
  420. package/lib/dist/telemetry/index.d.ts.map +1 -1
  421. package/lib/dist/telemetry/index.js +92 -41
  422. package/lib/dist/telemetry/index.js.map +1 -1
  423. package/lib/dist/types.d.ts +1 -1
  424. package/lib/dist/types.d.ts.map +1 -1
  425. package/lib/dist/types.js +1 -0
  426. package/lib/dist/types.js.map +1 -1
  427. package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
  428. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
  429. package/lib/dist/ui-server/api/deadcode.js +136 -0
  430. package/lib/dist/ui-server/api/deadcode.js.map +1 -0
  431. package/lib/dist/ui-server/api/effects.d.ts +87 -0
  432. package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
  433. package/lib/dist/ui-server/api/effects.js +499 -0
  434. package/lib/dist/ui-server/api/effects.js.map +1 -0
  435. package/lib/dist/ui-server/api/entrypoints.d.ts +86 -0
  436. package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  437. package/lib/dist/ui-server/api/entrypoints.js +279 -0
  438. package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
  439. package/lib/dist/ui-server/api/events.d.ts +183 -0
  440. package/lib/dist/ui-server/api/events.d.ts.map +1 -0
  441. package/lib/dist/ui-server/api/events.js +430 -0
  442. package/lib/dist/ui-server/api/events.js.map +1 -0
  443. package/lib/dist/ui-server/api/file.d.ts +66 -0
  444. package/lib/dist/ui-server/api/file.d.ts.map +1 -0
  445. package/lib/dist/ui-server/api/file.js +235 -0
  446. package/lib/dist/ui-server/api/file.js.map +1 -0
  447. package/lib/dist/ui-server/api/filecode.d.ts +126 -0
  448. package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
  449. package/lib/dist/ui-server/api/filecode.js +205 -0
  450. package/lib/dist/ui-server/api/filecode.js.map +1 -0
  451. package/lib/dist/ui-server/api/flow.d.ts +226 -0
  452. package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
  453. package/lib/dist/ui-server/api/flow.js +612 -0
  454. package/lib/dist/ui-server/api/flow.js.map +1 -0
  455. package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
  456. package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  457. package/lib/dist/ui-server/api/hierarchy.js +92 -0
  458. package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
  459. package/lib/dist/ui-server/api/index.d.ts +90 -0
  460. package/lib/dist/ui-server/api/index.d.ts.map +1 -0
  461. package/lib/dist/ui-server/api/index.js +332 -0
  462. package/lib/dist/ui-server/api/index.js.map +1 -0
  463. package/lib/dist/ui-server/api/map.d.ts +238 -0
  464. package/lib/dist/ui-server/api/map.d.ts.map +1 -0
  465. package/lib/dist/ui-server/api/map.js +681 -0
  466. package/lib/dist/ui-server/api/map.js.map +1 -0
  467. package/lib/dist/ui-server/api/node.d.ts +81 -0
  468. package/lib/dist/ui-server/api/node.d.ts.map +1 -0
  469. package/lib/dist/ui-server/api/node.js +388 -0
  470. package/lib/dist/ui-server/api/node.js.map +1 -0
  471. package/lib/dist/ui-server/api/nodes.d.ts +25 -0
  472. package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
  473. package/lib/dist/ui-server/api/nodes.js +45 -0
  474. package/lib/dist/ui-server/api/nodes.js.map +1 -0
  475. package/lib/dist/ui-server/api/program.d.ts +139 -0
  476. package/lib/dist/ui-server/api/program.d.ts.map +1 -0
  477. package/lib/dist/ui-server/api/program.js +315 -0
  478. package/lib/dist/ui-server/api/program.js.map +1 -0
  479. package/lib/dist/ui-server/api/respond.d.ts +76 -0
  480. package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
  481. package/lib/dist/ui-server/api/respond.js +186 -0
  482. package/lib/dist/ui-server/api/respond.js.map +1 -0
  483. package/lib/dist/ui-server/api/route-roots.d.ts +39 -0
  484. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
  485. package/lib/dist/ui-server/api/route-roots.js +96 -0
  486. package/lib/dist/ui-server/api/route-roots.js.map +1 -0
  487. package/lib/dist/ui-server/api/routes.d.ts +59 -0
  488. package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
  489. package/lib/dist/ui-server/api/routes.js +108 -0
  490. package/lib/dist/ui-server/api/routes.js.map +1 -0
  491. package/lib/dist/ui-server/api/screens.d.ts +117 -0
  492. package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
  493. package/lib/dist/ui-server/api/screens.js +611 -0
  494. package/lib/dist/ui-server/api/screens.js.map +1 -0
  495. package/lib/dist/ui-server/api/search.d.ts +29 -0
  496. package/lib/dist/ui-server/api/search.d.ts.map +1 -0
  497. package/lib/dist/ui-server/api/search.js +232 -0
  498. package/lib/dist/ui-server/api/search.js.map +1 -0
  499. package/lib/dist/ui-server/api/session.d.ts +52 -0
  500. package/lib/dist/ui-server/api/session.d.ts.map +1 -0
  501. package/lib/dist/ui-server/api/session.js +196 -0
  502. package/lib/dist/ui-server/api/session.js.map +1 -0
  503. package/lib/dist/ui-server/api/source.d.ts +200 -0
  504. package/lib/dist/ui-server/api/source.d.ts.map +1 -0
  505. package/lib/dist/ui-server/api/source.js +422 -0
  506. package/lib/dist/ui-server/api/source.js.map +1 -0
  507. package/lib/dist/ui-server/api/stats.d.ts +27 -0
  508. package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
  509. package/lib/dist/ui-server/api/stats.js +164 -0
  510. package/lib/dist/ui-server/api/stats.js.map +1 -0
  511. package/lib/dist/ui-server/api/steps.d.ts +274 -0
  512. package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
  513. package/lib/dist/ui-server/api/steps.js +1446 -0
  514. package/lib/dist/ui-server/api/steps.js.map +1 -0
  515. package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
  516. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
  517. package/lib/dist/ui-server/api/trail-store.js +323 -0
  518. package/lib/dist/ui-server/api/trail-store.js.map +1 -0
  519. package/lib/dist/ui-server/api/trails.d.ts +163 -0
  520. package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
  521. package/lib/dist/ui-server/api/trails.js +369 -0
  522. package/lib/dist/ui-server/api/trails.js.map +1 -0
  523. package/lib/dist/ui-server/api/when.d.ts +125 -0
  524. package/lib/dist/ui-server/api/when.d.ts.map +1 -0
  525. package/lib/dist/ui-server/api/when.js +251 -0
  526. package/lib/dist/ui-server/api/when.js.map +1 -0
  527. package/lib/dist/ui-server/api/wire.d.ts +179 -0
  528. package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
  529. package/lib/dist/ui-server/api/wire.js +231 -0
  530. package/lib/dist/ui-server/api/wire.js.map +1 -0
  531. package/lib/dist/ui-server/assets.d.ts +40 -0
  532. package/lib/dist/ui-server/assets.d.ts.map +1 -0
  533. package/lib/dist/ui-server/assets.js +110 -0
  534. package/lib/dist/ui-server/assets.js.map +1 -0
  535. package/lib/dist/ui-server/constants.d.ts +32 -0
  536. package/lib/dist/ui-server/constants.d.ts.map +1 -0
  537. package/lib/dist/ui-server/constants.js +35 -0
  538. package/lib/dist/ui-server/constants.js.map +1 -0
  539. package/lib/dist/ui-server/highlight/index.d.ts +113 -0
  540. package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
  541. package/lib/dist/ui-server/highlight/index.js +307 -0
  542. package/lib/dist/ui-server/highlight/index.js.map +1 -0
  543. package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
  544. package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
  545. package/lib/dist/ui-server/highlight/languages.js +50 -0
  546. package/lib/dist/ui-server/highlight/languages.js.map +1 -0
  547. package/lib/dist/ui-server/index.d.ts +92 -0
  548. package/lib/dist/ui-server/index.d.ts.map +1 -0
  549. package/lib/dist/ui-server/index.js +399 -0
  550. package/lib/dist/ui-server/index.js.map +1 -0
  551. package/lib/dist/ui-server/open-browser.d.ts +31 -0
  552. package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
  553. package/lib/dist/ui-server/open-browser.js +79 -0
  554. package/lib/dist/ui-server/open-browser.js.map +1 -0
  555. package/lib/dist/ui-server/security.d.ts +127 -0
  556. package/lib/dist/ui-server/security.d.ts.map +1 -0
  557. package/lib/dist/ui-server/security.js +332 -0
  558. package/lib/dist/ui-server/security.js.map +1 -0
  559. package/lib/dist/ui-server/static.d.ts +45 -0
  560. package/lib/dist/ui-server/static.d.ts.map +1 -0
  561. package/lib/dist/ui-server/static.js +165 -0
  562. package/lib/dist/ui-server/static.js.map +1 -0
  563. package/lib/dist/utils.d.ts +14 -2
  564. package/lib/dist/utils.d.ts.map +1 -1
  565. package/lib/dist/utils.js +25 -10
  566. package/lib/dist/utils.js.map +1 -1
  567. package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  568. package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  569. package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  570. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
  571. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
  572. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  573. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  574. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  575. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  576. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  577. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  578. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
  579. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
  580. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  581. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  582. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  583. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  584. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  585. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  586. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
  587. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
  588. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  589. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  590. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  591. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  592. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  593. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  594. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
  595. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
  596. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  597. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  598. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  599. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  600. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  601. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  602. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
  603. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
  604. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  605. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  606. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  607. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  608. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  609. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  610. package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
  611. package/lib/dist/viewer/assets/index-D4S7YUPf.js +97 -0
  612. package/lib/dist/viewer/index.html +16 -0
  613. package/lib/kernel/codegraph-kernel.node +2 -2
  614. package/lib/node_modules/.package-lock.json +4 -4
  615. package/lib/node_modules/picomatch/README.md +56 -51
  616. package/lib/node_modules/picomatch/lib/constants.js +4 -0
  617. package/lib/node_modules/picomatch/lib/parse.js +341 -1
  618. package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
  619. package/lib/node_modules/picomatch/lib/scan.js +30 -18
  620. package/lib/node_modules/picomatch/package.json +4 -4
  621. package/lib/package.json +9 -2
  622. package/package.json +1 -1
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Project writer lock (#1740).
3
+ *
4
+ * At most one long-lived MCP *writer* (shared daemon OR direct-mode /
5
+ * in-process engine that owns the FileWatcher) may serve a given project.
6
+ * The shared daemon already multiplexes N stdio proxies onto one writer; this
7
+ * lock closes the same-OS gap where two direct-mode `serve --mcp` processes
8
+ * (via `CODEGRAPH_NO_DAEMON=1` or proxy→in-process fallback) each start a
9
+ * watcher, contend on `codegraph.lock`, and degrade auto-sync.
10
+ *
11
+ * Deliberately separate from `daemon.pid`: proxies probe the daemon socket
12
+ * and may clear a live pid that has no socket. A direct-mode holder must not
13
+ * look like a daemon. `writer.pid` is only about "who owns live auto-sync".
14
+ */
15
+ /** Absolute path to the writer pid lockfile for `projectRoot`. */
16
+ export declare function getWriterPidPath(projectRoot: string, lockName?: 'writer.pid' | 'rebuild.pid'): string;
17
+ /** Structured contents of the writer pidfile. */
18
+ export interface WriterLockInfo {
19
+ pid: number;
20
+ /** `direct` | `daemon` | `fallback` — for actionable error text only. */
21
+ mode: string;
22
+ startedAt: number;
23
+ /** False until the MCP owner has finished its initial catch-up. */
24
+ ready?: boolean;
25
+ }
26
+ export type WriterAcquireResult = {
27
+ kind: 'acquired';
28
+ pidPath: string;
29
+ info: WriterLockInfo;
30
+ } | {
31
+ kind: 'taken';
32
+ existing: WriterLockInfo | null;
33
+ pidPath: string;
34
+ };
35
+ export declare function decodeWriterLockInfo(raw: string): WriterLockInfo | null;
36
+ /**
37
+ * Atomically create `writer.pid` (link-into-place, O_EXCL fallback). If held
38
+ * by a dead PID, clear and retry once. Does not steal from a live holder.
39
+ */
40
+ export declare function tryAcquireWriterLock(projectRoot: string, mode: string, lockName?: 'writer.pid' | 'rebuild.pid'): WriterAcquireResult;
41
+ /** Publish catch-up readiness without exposing a partially-written pidfile. */
42
+ export declare function markWriterReady(projectRoot: string): void;
43
+ /** Release if we still own the lock (pid match). */
44
+ export declare function releaseWriterLock(projectRoot: string, lockName?: 'writer.pid' | 'rebuild.pid'): void;
45
+ /** Read current lock without acquiring. */
46
+ export declare function readWriterLock(projectRoot: string, lockName?: 'writer.pid' | 'rebuild.pid'): WriterLockInfo | null;
47
+ /**
48
+ * Actionable message when another live process owns the writer lock (#1740).
49
+ */
50
+ export declare function writerLockHeldMessage(existing: WriterLockInfo | null, pidPath: string): string;
51
+ /** Rebuild intent is separate from writer ownership: acquire BEFORE stopping
52
+ * the daemon, so its disconnected proxies cannot reopen SQLite in the gap. */
53
+ /**
54
+ * An index rebuild (`codegraph index`) owns the database. Expected and brief,
55
+ * so the MCP layer answers it as guidance, never as a tool error (#1325).
56
+ */
57
+ export declare class RebuildInProgressError extends Error {
58
+ constructor();
59
+ }
60
+ export declare function assertNoRebuild(root: string): void;
61
+ //# sourceMappingURL=writer-lock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer-lock.d.ts","sourceRoot":"","sources":["../../src/mcp/writer-lock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkBH,kEAAkE;AAClE,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAY,GAAG,aAA4B,GAAG,MAAM,CAInH;AAED,iDAAiD;AACjD,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,yEAAyE;IACzE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAC3B;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,cAAc,CAAA;CAAE,GAC3D;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAMxE,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAavE;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,YAAY,GAAG,aAA4B,GACpD,mBAAmB,CAwErB;AAED,+EAA+E;AAC/E,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAWzD;AAED,oDAAoD;AACpD,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAY,GAAG,aAA4B,GAAG,IAAI,CASlH;AAED,2CAA2C;AAC3C,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,GAAE,YAAY,GAAG,aAA4B,GAAG,cAAc,GAAG,IAAI,CAOhI;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,cAAc,GAAG,IAAI,EAC/B,OAAO,EAAE,MAAM,GACd,MAAM,CAWR;AAED;8EAC8E;AAC9E;;;GAGG;AACH,qBAAa,sBAAuB,SAAQ,KAAK;;CAKhD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAKlD"}
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ /**
3
+ * Project writer lock (#1740).
4
+ *
5
+ * At most one long-lived MCP *writer* (shared daemon OR direct-mode /
6
+ * in-process engine that owns the FileWatcher) may serve a given project.
7
+ * The shared daemon already multiplexes N stdio proxies onto one writer; this
8
+ * lock closes the same-OS gap where two direct-mode `serve --mcp` processes
9
+ * (via `CODEGRAPH_NO_DAEMON=1` or proxy→in-process fallback) each start a
10
+ * watcher, contend on `codegraph.lock`, and degrade auto-sync.
11
+ *
12
+ * Deliberately separate from `daemon.pid`: proxies probe the daemon socket
13
+ * and may clear a live pid that has no socket. A direct-mode holder must not
14
+ * look like a daemon. `writer.pid` is only about "who owns live auto-sync".
15
+ */
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.RebuildInProgressError = void 0;
51
+ exports.getWriterPidPath = getWriterPidPath;
52
+ exports.decodeWriterLockInfo = decodeWriterLockInfo;
53
+ exports.tryAcquireWriterLock = tryAcquireWriterLock;
54
+ exports.markWriterReady = markWriterReady;
55
+ exports.releaseWriterLock = releaseWriterLock;
56
+ exports.readWriterLock = readWriterLock;
57
+ exports.writerLockHeldMessage = writerLockHeldMessage;
58
+ exports.assertNoRebuild = assertNoRebuild;
59
+ const fs = __importStar(require("fs"));
60
+ const path = __importStar(require("path"));
61
+ const directory_1 = require("../directory");
62
+ /** Signal-0 liveness (EPERM ⇒ alive). Local copy to avoid a daemon↔writer cycle. */
63
+ function isProcessAlive(pid) {
64
+ try {
65
+ process.kill(pid, 0);
66
+ return true;
67
+ }
68
+ catch (err) {
69
+ const e = err;
70
+ if (e.code === 'EPERM')
71
+ return true;
72
+ return false;
73
+ }
74
+ }
75
+ /** Absolute path to the writer pid lockfile for `projectRoot`. */
76
+ function getWriterPidPath(projectRoot, lockName = 'writer.pid') {
77
+ let root = projectRoot;
78
+ try {
79
+ root = fs.realpathSync(projectRoot);
80
+ }
81
+ catch { /* keep lexical */ }
82
+ return path.join((0, directory_1.getCodeGraphDir)(root), lockName);
83
+ }
84
+ function encode(info) {
85
+ return JSON.stringify(info) + '\n';
86
+ }
87
+ function decodeWriterLockInfo(raw) {
88
+ try {
89
+ const parsed = JSON.parse(raw.trim());
90
+ if (typeof parsed.pid !== 'number' || typeof parsed.mode !== 'string')
91
+ return null;
92
+ return {
93
+ pid: parsed.pid,
94
+ mode: parsed.mode,
95
+ startedAt: typeof parsed.startedAt === 'number' ? parsed.startedAt : 0,
96
+ ...(typeof parsed.ready === 'boolean' ? { ready: parsed.ready } : {}),
97
+ };
98
+ }
99
+ catch {
100
+ return null;
101
+ }
102
+ }
103
+ /**
104
+ * Atomically create `writer.pid` (link-into-place, O_EXCL fallback). If held
105
+ * by a dead PID, clear and retry once. Does not steal from a live holder.
106
+ */
107
+ function tryAcquireWriterLock(projectRoot, mode, lockName = 'writer.pid') {
108
+ const pidPath = getWriterPidPath(projectRoot, lockName);
109
+ fs.mkdirSync(path.dirname(pidPath), { recursive: true });
110
+ const info = {
111
+ pid: process.pid,
112
+ mode,
113
+ startedAt: Date.now(),
114
+ ready: false,
115
+ };
116
+ const attempt = () => {
117
+ const tmp = `${pidPath}.${process.pid}.tmp`;
118
+ let acquired = false;
119
+ try {
120
+ fs.writeFileSync(tmp, encode(info), { mode: 0o600 });
121
+ try {
122
+ fs.linkSync(tmp, pidPath);
123
+ acquired = true;
124
+ }
125
+ catch (err) {
126
+ if (err.code === 'EEXIST') {
127
+ // taken
128
+ }
129
+ else {
130
+ // No hard links — O_EXCL create.
131
+ try {
132
+ const fd = fs.openSync(pidPath, 'wx', 0o600);
133
+ try {
134
+ fs.writeSync(fd, encode(info));
135
+ acquired = true;
136
+ }
137
+ finally {
138
+ fs.closeSync(fd);
139
+ }
140
+ }
141
+ catch (e2) {
142
+ if (e2.code !== 'EEXIST')
143
+ throw e2;
144
+ }
145
+ }
146
+ }
147
+ }
148
+ finally {
149
+ try {
150
+ fs.unlinkSync(tmp);
151
+ }
152
+ catch { /* ignore */ }
153
+ }
154
+ if (acquired)
155
+ return { kind: 'acquired', pidPath, info };
156
+ let existing = null;
157
+ try {
158
+ existing = decodeWriterLockInfo(fs.readFileSync(pidPath, 'utf8'));
159
+ }
160
+ catch { /* unreadable */ }
161
+ return { kind: 'taken', existing, pidPath };
162
+ };
163
+ let result = attempt();
164
+ if (result.kind === 'taken' && result.existing && result.existing.pid === process.pid) {
165
+ // Same process already holds it (daemon acquired before engine watch).
166
+ return { kind: 'acquired', pidPath: result.pidPath, info: result.existing };
167
+ }
168
+ if (result.kind === 'taken') {
169
+ const existing = result.existing;
170
+ if (!existing || existing.pid <= 0 || !isProcessAlive(existing.pid)) {
171
+ // Stale — clear (pid-verified) and retry once.
172
+ try {
173
+ const raw = fs.readFileSync(pidPath, 'utf8');
174
+ const cur = decodeWriterLockInfo(raw);
175
+ if (!cur || cur.pid === existing?.pid) {
176
+ if (!cur || cur.pid <= 0 || !isProcessAlive(cur.pid)) {
177
+ fs.unlinkSync(pidPath);
178
+ }
179
+ }
180
+ }
181
+ catch { /* ENOENT ok */ }
182
+ result = attempt();
183
+ }
184
+ }
185
+ return result;
186
+ }
187
+ /** Publish catch-up readiness without exposing a partially-written pidfile. */
188
+ function markWriterReady(projectRoot) {
189
+ const pidPath = getWriterPidPath(projectRoot);
190
+ const info = readWriterLock(projectRoot);
191
+ if (!info || info.pid !== process.pid)
192
+ return;
193
+ const tmp = `${pidPath}.${process.pid}.ready.tmp`;
194
+ try {
195
+ fs.writeFileSync(tmp, encode({ ...info, ready: true }), { mode: 0o600 });
196
+ fs.renameSync(tmp, pidPath);
197
+ }
198
+ finally {
199
+ try {
200
+ fs.unlinkSync(tmp);
201
+ }
202
+ catch { /* best-effort */ }
203
+ }
204
+ }
205
+ /** Release if we still own the lock (pid match). */
206
+ function releaseWriterLock(projectRoot, lockName = 'writer.pid') {
207
+ const pidPath = getWriterPidPath(projectRoot, lockName);
208
+ try {
209
+ if (!fs.existsSync(pidPath))
210
+ return;
211
+ const info = decodeWriterLockInfo(fs.readFileSync(pidPath, 'utf8'));
212
+ if (info && info.pid === process.pid) {
213
+ fs.unlinkSync(pidPath);
214
+ }
215
+ }
216
+ catch { /* best-effort */ }
217
+ }
218
+ /** Read current lock without acquiring. */
219
+ function readWriterLock(projectRoot, lockName = 'writer.pid') {
220
+ const pidPath = getWriterPidPath(projectRoot, lockName);
221
+ try {
222
+ return decodeWriterLockInfo(fs.readFileSync(pidPath, 'utf8'));
223
+ }
224
+ catch {
225
+ return null;
226
+ }
227
+ }
228
+ /**
229
+ * Actionable message when another live process owns the writer lock (#1740).
230
+ */
231
+ function writerLockHeldMessage(existing, pidPath) {
232
+ const who = existing && existing.pid > 0
233
+ ? `PID ${existing.pid} (${existing.mode || 'unknown'} mode)`
234
+ : 'another process';
235
+ return ('CodeGraph writer lock held by ' + who + '. ' +
236
+ 'Only one live MCP writer may serve a project (auto-sync / index). ' +
237
+ 'Stop the other server (codegraph daemon stop if a shared daemon, or end the other MCP session), ' +
238
+ 'or unset CODEGRAPH_NO_DAEMON so additional clients proxy to the shared daemon. ' +
239
+ 'If this is stale, delete ' + pidPath);
240
+ }
241
+ /** Rebuild intent is separate from writer ownership: acquire BEFORE stopping
242
+ * the daemon, so its disconnected proxies cannot reopen SQLite in the gap. */
243
+ /**
244
+ * An index rebuild (`codegraph index`) owns the database. Expected and brief,
245
+ * so the MCP layer answers it as guidance, never as a tool error (#1325).
246
+ */
247
+ class RebuildInProgressError extends Error {
248
+ constructor() {
249
+ super('CodeGraph index rebuild is in progress; retry when it finishes.');
250
+ this.name = 'RebuildInProgressError';
251
+ }
252
+ }
253
+ exports.RebuildInProgressError = RebuildInProgressError;
254
+ function assertNoRebuild(root) {
255
+ const lock = readWriterLock(root, 'rebuild.pid');
256
+ if (lock && lock.pid !== process.pid && isProcessAlive(lock.pid)) {
257
+ throw new RebuildInProgressError();
258
+ }
259
+ }
260
+ //# sourceMappingURL=writer-lock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer-lock.js","sourceRo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// p1 — cross-file through an import
5
+ * const local = realImpl; // p6 — same file
6
+ * export const api = { run: impl }; // p5 — property holding a function ref
7
+ * export { realImpl as alias }; // p2 — a local export clause
8
+ *
9
+ * Extraction records the binding itself as a `constant`/`variable` node and
10
+ * stores its initializer in `signature` (`"= realImpl"`), so a call through the
11
+ * alias resolves to the BINDING, not the function. `callers realImpl` then
12
+ * omits every caller that went through the alias and reports a confident zero,
13
+ * while `callers alias` finds them — the edge exists, it just terminates one
14
+ * hop short. A local `export { X as Y }` clause is worse: the exported name
15
+ * matches no declaration at all, so resolution fails outright.
16
+ *
17
+ * A call through an alias IS a call to the aliased function, so these hops are
18
+ * only ever applied to `calls` refs. A `references` edge to the binding is
19
+ * correct as-is — reading the alias as a value is a genuine use of the alias.
20
+ */
21
+ import type { Node } from '../types';
22
+ import type { ResolutionContext } from './types';
23
+ /**
24
+ * The symbol name an alias binding forwards to, or null when the initializer is
25
+ * anything else (a call, a literal, an expression — all genuine definitions).
26
+ *
27
+ * `memberName` targets a property of an object-literal initializer
28
+ * (`= { run: impl }` for `api.run()`), including ES shorthand (`= { impl }`).
29
+ */
30
+ export declare function aliasTargetName(signature: string | undefined | null, memberName: string | null): string | null;
31
+ /**
32
+ * The callable an alias binding forwards to.
33
+ *
34
+ * Prefers a declaration in the alias's own file: an alias almost always names a
35
+ * local symbol or one it imported, and a same-file hit needs no disambiguation.
36
+ * Cross-file is accepted only when the name is unique in the project, so an
37
+ * ambiguous name yields no hop rather than an invented edge — a wrong edge is
38
+ * worse than a missing one.
39
+ */
40
+ export declare function resolveAliasBinding(aliasNode: Node, memberName: string | null, context: ResolutionContext): Node | null;
41
+ /**
42
+ * Local export clauses: `export { realImpl as alias }` / `export { realImpl }`
43
+ * with no `from` source.
44
+ *
45
+ * `extractReExports` only models the `export … from './other'` form, so a local
46
+ * clause leaves the exported name bound to nothing the export index knows —
47
+ * importing `alias` matches no declaration and resolution falls through to the
48
+ * name-matcher, which cannot cross the rename (a false 0 callers).
49
+ *
50
+ * Type-only specifiers are skipped: they carry no runtime call.
51
+ */
52
+ export declare function extractLocalExportAliases(content: string): Array<{
53
+ exportedName: string;
54
+ localName: string;
55
+ }>;
56
+ //# sourceMappingURL=alias-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias-binding.d.ts","sourceRoot":"","sources":["../../src/resolution/alias-binding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAgBjD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,EACpC,UAAU,EAAE,MAAM,GAAG,IAAI,GACxB,MAAM,GAAG,IAAI,CAgBf;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,IAAI,EACf,UAAU,EAAE,MAAM,GAAG,IAAI,EACzB,OAAO,EAAE,iBAAiB,GACzB,IAAI,GAAG,IAAI,CAsBb;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAoB7G"}
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ /**
3
+ * Alias bindings: a name bound to nothing but another symbol.
4
+ *
5
+ * export const alias = realImpl; // p1 — cross-file through an import
6
+ * const local = realImpl; // p6 — same file
7
+ * export const api = { run: impl }; // p5 — property holding a function ref
8
+ * export { realImpl as alias }; // p2 — a local export clause
9
+ *
10
+ * Extraction records the binding itself as a `constant`/`variable` node and
11
+ * stores its initializer in `signature` (`"= realImpl"`), so a call through the
12
+ * alias resolves to the BINDING, not the function. `callers realImpl` then
13
+ * omits every caller that went through the alias and reports a confident zero,
14
+ * while `callers alias` finds them — the edge exists, it just terminates one
15
+ * hop short. A local `export { X as Y }` clause is worse: the exported name
16
+ * matches no declaration at all, so resolution fails outright.
17
+ *
18
+ * A call through an alias IS a call to the aliased function, so these hops are
19
+ * only ever applied to `calls` refs. A `references` edge to the binding is
20
+ * correct as-is — reading the alias as a value is a genuine use of the alias.
21
+ */
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ exports.aliasTargetName = aliasTargetName;
24
+ exports.resolveAliasBinding = resolveAliasBinding;
25
+ exports.extractLocalExportAliases = extractLocalExportAliases;
26
+ const name_matcher_1 = require("./name-matcher");
27
+ /** Kinds that can be a pure alias for another symbol. */
28
+ const ALIAS_BINDING_KINDS = new Set(['constant', 'variable', 'property']);
29
+ /** Kinds an alias may usefully forward a CALL to. */
30
+ const CALLABLE_KINDS = new Set(['function', 'method', 'class', 'component']);
31
+ /** `= identifier`, optionally with a cast or trailing semicolon, and nothing else. */
32
+ const BARE_ALIAS_RE = /^=\s*([A-Za-z_$][\w$]*)\s*(?:as\s+[\w.<>[\]]+\s*)?;?$/;
33
+ function escapeRegExp(s) {
34
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
35
+ }
36
+ /**
37
+ * The symbol name an alias binding forwards to, or null when the initializer is
38
+ * anything else (a call, a literal, an expression — all genuine definitions).
39
+ *
40
+ * `memberName` targets a property of an object-literal initializer
41
+ * (`= { run: impl }` for `api.run()`), including ES shorthand (`= { impl }`).
42
+ */
43
+ function aliasTargetName(signature, memberName) {
44
+ if (!signature)
45
+ return null;
46
+ const initializer = signature.trim();
47
+ if (memberName) {
48
+ const key = escapeRegExp(memberName);
49
+ const explicit = new RegExp(`[{,]\\s*${key}\\s*:\\s*([A-Za-z_$][\\w$]*)\\s*[,}]`).exec(initializer);
50
+ if (explicit)
51
+ return explicit[1];
52
+ // `{ impl }` — shorthand binds the property to the same-named symbol.
53
+ const shorthand = new RegExp(`[{,]\\s*(${key})\\s*[,}]`).exec(initializer);
54
+ if (shorthand)
55
+ return shorthand[1];
56
+ return null;
57
+ }
58
+ const bare = BARE_ALIAS_RE.exec(initializer);
59
+ return bare ? bare[1] : null;
60
+ }
61
+ /**
62
+ * The callable an alias binding forwards to.
63
+ *
64
+ * Prefers a declaration in the alias's own file: an alias almost always names a
65
+ * local symbol or one it imported, and a same-file hit needs no disambiguation.
66
+ * Cross-file is accepted only when the name is unique in the project, so an
67
+ * ambiguous name yields no hop rather than an invented edge — a wrong edge is
68
+ * worse than a missing one.
69
+ */
70
+ function resolveAliasBinding(aliasNode, memberName, context) {
71
+ if (!ALIAS_BINDING_KINDS.has(aliasNode.kind))
72
+ return null;
73
+ if (memberName && ['typescript', 'tsx', 'javascript', 'jsx', 'arkts'].includes(aliasNode.language)) {
74
+ const resolved = (0, name_matcher_1.resolveObjectLiteralBinding)(aliasNode, memberName, {
75
+ fromNodeId: aliasNode.id, referenceName: memberName, referenceKind: 'calls',
76
+ filePath: aliasNode.filePath, language: aliasNode.language,
77
+ line: aliasNode.startLine, column: aliasNode.startColumn,
78
+ }, context);
79
+ return resolved ? context.getNodeById?.(resolved.targetNodeId) ?? null : null;
80
+ }
81
+ const targetName = aliasTargetName(aliasNode.signature, memberName);
82
+ if (!targetName || targetName === aliasNode.name)
83
+ return null;
84
+ const candidates = context.getNodesByName(targetName).filter((n) => CALLABLE_KINDS.has(n.kind));
85
+ if (candidates.length === 0)
86
+ return null;
87
+ const sameFile = candidates.filter((n) => n.filePath === aliasNode.filePath);
88
+ if (sameFile.length === 1)
89
+ return sameFile[0];
90
+ if (sameFile.length > 1)
91
+ return null;
92
+ return candidates.length === 1 ? candidates[0] : null;
93
+ }
94
+ /**
95
+ * Local export clauses: `export { realImpl as alias }` / `export { realImpl }`
96
+ * with no `from` source.
97
+ *
98
+ * `extractReExports` only models the `export … from './other'` form, so a local
99
+ * clause leaves the exported name bound to nothing the export index knows —
100
+ * importing `alias` matches no declaration and resolution falls through to the
101
+ * name-matcher, which cannot cross the rename (a false 0 callers).
102
+ *
103
+ * Type-only specifiers are skipped: they carry no runtime call.
104
+ */
105
+ function extractLocalExportAliases(content) {
106
+ const out = [];
107
+ // `export { … }` NOT followed by `from` — the `from` form is a re-export.
108
+ const clauseRe = /export\s*\{([^}]*)\}\s*(?!\s*from)[;\n]/g;
109
+ let clause;
110
+ while ((clause = clauseRe.exec(content)) !== null) {
111
+ for (const raw of clause[1].split(',')) {
112
+ const specifier = raw.trim();
113
+ if (!specifier || /^type\s/.test(specifier))
114
+ continue;
115
+ const renamed = /^([A-Za-z_$][\w$]*)\s+as\s+([A-Za-z_$][\w$]*)$/.exec(specifier);
116
+ if (renamed) {
117
+ out.push({ localName: renamed[1], exportedName: renamed[2] });
118
+ continue;
119
+ }
120
+ if (/^[A-Za-z_$][\w$]*$/.test(specifier)) {
121
+ out.push({ localName: specifier, exportedName: specifier });
122
+ }
123
+ }
124
+ }
125
+ return out;
126
+ }
127
+ //# sourceMappingURL=alias-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alias-binding.js","sourceRoot":"","sources":["../../src/resolution/alias-binding.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;AA0BH,0CAmBC;AAWD,kDA0BC;AAaD,8DAoBC;AA/GD,iDAA6D;AAE7D,yDAAyD;AACzD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAElF,qDAAqD;AACrD,MAAM,cAAc,GAAG,IAAI,GAAG,CAAS,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC;AAErF,sFAAsF;AACtF,MAAM,aAAa,GAAG,uDAAuD,CAAC;AAE9E,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,eAAe,CAC7B,SAAoC,EAC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0EAA0E;IAC1E,MAAM,QAAQ,GAAG,0CAA0C,CAAC;IAC5D,IAAI,MAA8B,CAAC;IACnC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAClD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,CAAC,CAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACxC,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC;gBAAE,SAAS;YACtD,MAAM,OAAO,GAAG,gDAAgD,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACjF,IAAI,OAAO,EAAE,CAAC;gBACZ,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAE,EAAE,CAAC,CAAC;gBAChE,SAAS;YACX,CAAC;YACD,IAAI,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;gBACzC,GAAG,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YAC9D,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -25,6 +25,25 @@ import type { Edge } from '../types';
25
25
  import type { QueryBuilder } from '../db/queries';
26
26
  import type { ResolutionContext } from './types';
27
27
  import { type MaybeYield } from './cooperative-yield';
28
+ /**
29
+ * Synthesize dispatcher→callback edges (field observers + EventEmitters +
30
+ * React re-render + JSX children + Vue templates + SvelteKit load + RN event
31
+ * channel + Fabric native-impl + MyBatis Java↔XML + Gin middleware chain +
32
+ * Redux-thunk dispatch chain + object-literal registry dispatch + RTK Query
33
+ * generated-hook → endpoint + Pinia useStore().action() + Vuex string dispatch +
34
+ * Celery task .delay()/.apply_async() → task body + Spring publishEvent → @EventListener +
35
+ * MediatR Send/Publish → IRequestHandler/INotificationHandler +
36
+ * Sidekiq Worker.perform_async → #perform + Laravel event(new X) → listener handle).
37
+ * Returns the count added. Never throws into indexing — callers wrap in try/catch.
38
+ */
39
+ /**
40
+ * Number of progress steps synthesizeCallbackEdges reports: one per `__mark()`
41
+ * call (every synthesis pass, plus the dedupe-merge and edge-insert steps).
42
+ * Cosmetic only — drift just makes the progress bar end early or jump — and a
43
+ * test pins it to the actual step count (registry passes + the fixed
44
+ * pre/post marks) so adding a pass without bumping this fails loudly instead
45
+ * of silently skewing the bar.
46
+ */
28
47
  /** `has(...)` shape passed to pass gates — true when the project contains any of the languages. */
29
48
  type HasLang = (...ls: string[]) => boolean;
30
49
  /**
@@ -40,6 +59,8 @@ export interface SynthPassDef {
40
59
  gate: (has: HasLang) => boolean;
41
60
  run: (queries: QueryBuilder, ctx: ResolutionContext, yieldToLoop: MaybeYield, subProgress?: (fraction: number) => void) => Promise<Edge[]>;
42
61
  }
62
+ /** Conservative input gates for SYNTH_PASSES; keep these in sync when adding a pass. */
63
+ export declare function hasSynthesisPattern(filePath: string, content: string): boolean;
43
64
  /**
44
65
  * The independent passes, in MERGE ORDER — the first-seen dedup in
45
66
  * synthesizeCallbackEdges follows this array, so reordering entries changes
@@ -54,6 +75,7 @@ export declare function synthesizeCallbackEdges(queries: QueryBuilder, ctx: Reso
54
75
  edges: Edge[];
55
76
  ms: number;
56
77
  }>;
57
- } | null, backpressure?: () => Promise<void> | null): Promise<number>;
78
+ readonly size?: number;
79
+ } | null, backpressure?: () => Promise<void> | null, whilePoolBusy?: () => void): Promise<number>;
58
80
  export {};
59
81
  //# sourceMappingURL=callback-synthesizer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"callback-synthesizer.d.ts","sourceRoot":"","sources":["../../src/resolution/callback-synthesizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GA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