@colbymchenry/codegraph-win32-arm64 1.5.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 (693) 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 +744 -320
  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/formatter.d.ts +7 -1
  13. package/lib/dist/context/formatter.d.ts.map +1 -1
  14. package/lib/dist/context/formatter.js +12 -6
  15. package/lib/dist/context/formatter.js.map +1 -1
  16. package/lib/dist/context/index.d.ts +12 -0
  17. package/lib/dist/context/index.d.ts.map +1 -1
  18. package/lib/dist/context/index.js +103 -16
  19. package/lib/dist/context/index.js.map +1 -1
  20. package/lib/dist/db/index.d.ts +58 -2
  21. package/lib/dist/db/index.d.ts.map +1 -1
  22. package/lib/dist/db/index.js +187 -32
  23. package/lib/dist/db/index.js.map +1 -1
  24. package/lib/dist/db/migrations.d.ts +1 -1
  25. package/lib/dist/db/migrations.d.ts.map +1 -1
  26. package/lib/dist/db/migrations.js +64 -1
  27. package/lib/dist/db/migrations.js.map +1 -1
  28. package/lib/dist/db/queries.d.ts +583 -6
  29. package/lib/dist/db/queries.d.ts.map +1 -1
  30. package/lib/dist/db/queries.js +1417 -57
  31. package/lib/dist/db/queries.js.map +1 -1
  32. package/lib/dist/db/schema.sql +27 -4
  33. package/lib/dist/db/sqlite-adapter.d.ts +2 -0
  34. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  35. package/lib/dist/db/sqlite-adapter.js +56 -7
  36. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  37. package/lib/dist/db/synthesis-stage.d.ts +12 -0
  38. package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
  39. package/lib/dist/db/synthesis-stage.js +89 -0
  40. package/lib/dist/db/synthesis-stage.js.map +1 -0
  41. package/lib/dist/db/wal-valve.d.ts +32 -12
  42. package/lib/dist/db/wal-valve.d.ts.map +1 -1
  43. package/lib/dist/db/wal-valve.js +65 -22
  44. package/lib/dist/db/wal-valve.js.map +1 -1
  45. package/lib/dist/db/wsl-shared-index.d.ts +53 -0
  46. package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
  47. package/lib/dist/db/wsl-shared-index.js +121 -0
  48. package/lib/dist/db/wsl-shared-index.js.map +1 -0
  49. package/lib/dist/directory.d.ts +130 -2
  50. package/lib/dist/directory.d.ts.map +1 -1
  51. package/lib/dist/directory.js +306 -23
  52. package/lib/dist/directory.js.map +1 -1
  53. package/lib/dist/errors.d.ts +14 -0
  54. package/lib/dist/errors.d.ts.map +1 -1
  55. package/lib/dist/errors.js +16 -1
  56. package/lib/dist/errors.js.map +1 -1
  57. package/lib/dist/extraction/cfml-extractor.d.ts +1 -0
  58. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  59. package/lib/dist/extraction/cfml-extractor.js +15 -3
  60. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  61. package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
  62. package/lib/dist/extraction/dfm-extractor.js +14 -10
  63. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  64. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  65. package/lib/dist/extraction/extraction-version.js +1 -1
  66. package/lib/dist/extraction/function-ref.d.ts +6 -4
  67. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  68. package/lib/dist/extraction/function-ref.js +41 -14
  69. package/lib/dist/extraction/function-ref.js.map +1 -1
  70. package/lib/dist/extraction/generated-detection.d.ts +48 -12
  71. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  72. package/lib/dist/extraction/generated-detection.js +176 -11
  73. package/lib/dist/extraction/generated-detection.js.map +1 -1
  74. package/lib/dist/extraction/grammars.d.ts +38 -0
  75. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  76. package/lib/dist/extraction/grammars.js +115 -3
  77. package/lib/dist/extraction/grammars.js.map +1 -1
  78. package/lib/dist/extraction/index.d.ts +218 -14
  79. package/lib/dist/extraction/index.d.ts.map +1 -1
  80. package/lib/dist/extraction/index.js +874 -176
  81. package/lib/dist/extraction/index.js.map +1 -1
  82. package/lib/dist/extraction/languages/c-cpp.d.ts +58 -0
  83. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  84. package/lib/dist/extraction/languages/c-cpp.js +310 -19
  85. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  86. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  87. package/lib/dist/extraction/languages/dart.js +8 -3
  88. package/lib/dist/extraction/languages/dart.js.map +1 -1
  89. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
  90. package/lib/dist/extraction/languages/erlang.js +58 -22
  91. package/lib/dist/extraction/languages/erlang.js.map +1 -1
  92. package/lib/dist/extraction/languages/javascript.js +1 -1
  93. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  94. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  95. package/lib/dist/extraction/languages/kotlin.js +169 -36
  96. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  97. package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
  98. package/lib/dist/extraction/languages/lua.js +4 -1
  99. package/lib/dist/extraction/languages/lua.js.map +1 -1
  100. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  101. package/lib/dist/extraction/languages/objc.js +4 -0
  102. package/lib/dist/extraction/languages/objc.js.map +1 -1
  103. package/lib/dist/extraction/languages/python.d.ts.map +1 -1
  104. package/lib/dist/extraction/languages/python.js +71 -0
  105. package/lib/dist/extraction/languages/python.js.map +1 -1
  106. package/lib/dist/extraction/languages/rust.d.ts +20 -0
  107. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  108. package/lib/dist/extraction/languages/rust.js +50 -20
  109. package/lib/dist/extraction/languages/rust.js.map +1 -1
  110. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  111. package/lib/dist/extraction/languages/scala.js +18 -3
  112. package/lib/dist/extraction/languages/scala.js.map +1 -1
  113. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  114. package/lib/dist/extraction/languages/typescript.js +9 -2
  115. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  116. package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
  117. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  118. package/lib/dist/extraction/liquid-extractor.js +98 -22
  119. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  120. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  121. package/lib/dist/extraction/mybatis-extractor.js +6 -4
  122. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  123. package/lib/dist/extraction/parse-pool.d.ts +7 -0
  124. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  125. package/lib/dist/extraction/parse-pool.js +20 -1
  126. package/lib/dist/extraction/parse-pool.js.map +1 -1
  127. package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
  128. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
  129. package/lib/dist/extraction/syntax-tokens.js +381 -0
  130. package/lib/dist/extraction/syntax-tokens.js.map +1 -0
  131. package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  132. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  133. package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
  134. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  135. package/lib/dist/extraction/tree-sitter-types.d.ts +31 -3
  136. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  137. package/lib/dist/extraction/tree-sitter.d.ts +101 -18
  138. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  139. package/lib/dist/extraction/tree-sitter.js +926 -132
  140. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  141. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  142. package/lib/dist/file-limits.d.ts +40 -0
  143. package/lib/dist/file-limits.d.ts.map +1 -0
  144. package/lib/dist/file-limits.js +147 -0
  145. package/lib/dist/file-limits.js.map +1 -0
  146. package/lib/dist/graph/branch-guards.d.ts +248 -0
  147. package/lib/dist/graph/branch-guards.d.ts.map +1 -0
  148. package/lib/dist/graph/branch-guards.js +2231 -0
  149. package/lib/dist/graph/branch-guards.js.map +1 -0
  150. package/lib/dist/graph/dead-code.d.ts +251 -0
  151. package/lib/dist/graph/dead-code.d.ts.map +1 -0
  152. package/lib/dist/graph/dead-code.js +776 -0
  153. package/lib/dist/graph/dead-code.js.map +1 -0
  154. package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
  155. package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  156. package/lib/dist/graph/dynamic-boundary-report.js +283 -0
  157. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
  158. package/lib/dist/graph/index.d.ts +4 -0
  159. package/lib/dist/graph/index.d.ts.map +1 -1
  160. package/lib/dist/graph/index.js +16 -1
  161. package/lib/dist/graph/index.js.map +1 -1
  162. package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
  163. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
  164. package/lib/dist/graph/named-symbol-flow.js +552 -0
  165. package/lib/dist/graph/named-symbol-flow.js.map +1 -0
  166. package/lib/dist/graph/queries.d.ts.map +1 -1
  167. package/lib/dist/graph/queries.js +2 -0
  168. package/lib/dist/graph/queries.js.map +1 -1
  169. package/lib/dist/graph/symbol-lookup.d.ts +83 -0
  170. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
  171. package/lib/dist/graph/symbol-lookup.js +181 -0
  172. package/lib/dist/graph/symbol-lookup.js.map +1 -0
  173. package/lib/dist/graph/traversal.d.ts +9 -0
  174. package/lib/dist/graph/traversal.d.ts.map +1 -1
  175. package/lib/dist/graph/traversal.js +62 -36
  176. package/lib/dist/graph/traversal.js.map +1 -1
  177. package/lib/dist/graph/type-hierarchy.d.ts +155 -0
  178. package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
  179. package/lib/dist/graph/type-hierarchy.js +382 -0
  180. package/lib/dist/graph/type-hierarchy.js.map +1 -0
  181. package/lib/dist/index.d.ts +273 -11
  182. package/lib/dist/index.d.ts.map +1 -1
  183. package/lib/dist/index.js +511 -34
  184. package/lib/dist/index.js.map +1 -1
  185. package/lib/dist/installer/index.d.ts +4 -3
  186. package/lib/dist/installer/index.d.ts.map +1 -1
  187. package/lib/dist/installer/index.js +11 -8
  188. package/lib/dist/installer/index.js.map +1 -1
  189. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
  190. package/lib/dist/installer/targets/antigravity.js +14 -2
  191. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  192. package/lib/dist/installer/targets/claude.d.ts +3 -0
  193. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  194. package/lib/dist/installer/targets/claude.js +72 -12
  195. package/lib/dist/installer/targets/claude.js.map +1 -1
  196. package/lib/dist/installer/targets/codex.d.ts +23 -8
  197. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  198. package/lib/dist/installer/targets/codex.js +74 -47
  199. package/lib/dist/installer/targets/codex.js.map +1 -1
  200. package/lib/dist/installer/targets/copilot-cli.d.ts +32 -0
  201. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -0
  202. package/lib/dist/installer/targets/copilot-cli.js +215 -0
  203. package/lib/dist/installer/targets/copilot-cli.js.map +1 -0
  204. package/lib/dist/installer/targets/copilot-jetbrains.d.ts +42 -0
  205. package/lib/dist/installer/targets/copilot-jetbrains.d.ts.map +1 -0
  206. package/lib/dist/installer/targets/copilot-jetbrains.js +238 -0
  207. package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -0
  208. package/lib/dist/installer/targets/copilot-vscode.d.ts +47 -0
  209. package/lib/dist/installer/targets/copilot-vscode.d.ts.map +1 -0
  210. package/lib/dist/installer/targets/copilot-vscode.js +219 -0
  211. package/lib/dist/installer/targets/copilot-vscode.js.map +1 -0
  212. package/lib/dist/installer/targets/opencode.d.ts +16 -5
  213. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  214. package/lib/dist/installer/targets/opencode.js +73 -22
  215. package/lib/dist/installer/targets/opencode.js.map +1 -1
  216. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  217. package/lib/dist/installer/targets/registry.js +6 -0
  218. package/lib/dist/installer/targets/registry.js.map +1 -1
  219. package/lib/dist/installer/targets/shared.d.ts +14 -3
  220. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  221. package/lib/dist/installer/targets/shared.js +39 -11
  222. package/lib/dist/installer/targets/shared.js.map +1 -1
  223. package/lib/dist/installer/targets/toml.d.ts +6 -5
  224. package/lib/dist/installer/targets/toml.d.ts.map +1 -1
  225. package/lib/dist/installer/targets/toml.js +99 -20
  226. package/lib/dist/installer/targets/toml.js.map +1 -1
  227. package/lib/dist/installer/targets/types.d.ts +12 -5
  228. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  229. package/lib/dist/mcp/answer-freshness.d.ts +10 -0
  230. package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
  231. package/lib/dist/mcp/answer-freshness.js +68 -0
  232. package/lib/dist/mcp/answer-freshness.js.map +1 -0
  233. package/lib/dist/mcp/daemon-manager.d.ts +1 -1
  234. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  235. package/lib/dist/mcp/daemon-manager.js +17 -1
  236. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  237. package/lib/dist/mcp/daemon-paths.d.ts +8 -0
  238. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  239. package/lib/dist/mcp/daemon-paths.js +65 -2
  240. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  241. package/lib/dist/mcp/daemon-registry.d.ts +17 -4
  242. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  243. package/lib/dist/mcp/daemon-registry.js +133 -23
  244. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  245. package/lib/dist/mcp/daemon.d.ts +26 -13
  246. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  247. package/lib/dist/mcp/daemon.js +126 -32
  248. package/lib/dist/mcp/daemon.js.map +1 -1
  249. package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
  250. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  251. package/lib/dist/mcp/dynamic-boundaries.js +46 -42
  252. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  253. package/lib/dist/mcp/engine.d.ts +31 -9
  254. package/lib/dist/mcp/engine.d.ts.map +1 -1
  255. package/lib/dist/mcp/engine.js +190 -64
  256. package/lib/dist/mcp/engine.js.map +1 -1
  257. package/lib/dist/mcp/explore-dedup.d.ts +140 -0
  258. package/lib/dist/mcp/explore-dedup.d.ts.map +1 -0
  259. package/lib/dist/mcp/explore-dedup.js +239 -0
  260. package/lib/dist/mcp/explore-dedup.js.map +1 -0
  261. package/lib/dist/mcp/explore-diagnostics.d.ts +289 -0
  262. package/lib/dist/mcp/explore-diagnostics.d.ts.map +1 -0
  263. package/lib/dist/mcp/explore-diagnostics.js +558 -0
  264. package/lib/dist/mcp/explore-diagnostics.js.map +1 -0
  265. package/lib/dist/mcp/explore-session-state.d.ts +217 -0
  266. package/lib/dist/mcp/explore-session-state.d.ts.map +1 -0
  267. package/lib/dist/mcp/explore-session-state.js +322 -0
  268. package/lib/dist/mcp/explore-session-state.js.map +1 -0
  269. package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
  270. package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  271. package/lib/dist/mcp/index-freshness-worker.js +30 -0
  272. package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
  273. package/lib/dist/mcp/index-freshness.d.ts +7 -0
  274. package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
  275. package/lib/dist/mcp/index-freshness.js +94 -0
  276. package/lib/dist/mcp/index-freshness.js.map +1 -0
  277. package/lib/dist/mcp/index.d.ts +27 -1
  278. package/lib/dist/mcp/index.d.ts.map +1 -1
  279. package/lib/dist/mcp/index.js +159 -14
  280. package/lib/dist/mcp/index.js.map +1 -1
  281. package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
  282. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  283. package/lib/dist/mcp/liveness-watchdog.js +14 -3
  284. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  285. package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
  286. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
  287. package/lib/dist/mcp/project-lifecycle.js +181 -0
  288. package/lib/dist/mcp/project-lifecycle.js.map +1 -0
  289. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  290. package/lib/dist/mcp/proxy.js +15 -1
  291. package/lib/dist/mcp/proxy.js.map +1 -1
  292. package/lib/dist/mcp/query-pool.d.ts +2 -2
  293. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  294. package/lib/dist/mcp/query-pool.js +9 -7
  295. package/lib/dist/mcp/query-pool.js.map +1 -1
  296. package/lib/dist/mcp/query-worker.js +2 -2
  297. package/lib/dist/mcp/query-worker.js.map +1 -1
  298. package/lib/dist/mcp/server-instructions.d.ts +2 -2
  299. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  300. package/lib/dist/mcp/server-instructions.js +13 -5
  301. package/lib/dist/mcp/server-instructions.js.map +1 -1
  302. package/lib/dist/mcp/session.d.ts +16 -0
  303. package/lib/dist/mcp/session.d.ts.map +1 -1
  304. package/lib/dist/mcp/session.js +36 -13
  305. package/lib/dist/mcp/session.js.map +1 -1
  306. package/lib/dist/mcp/startup-handshake.d.ts +3 -1
  307. package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
  308. package/lib/dist/mcp/startup-handshake.js +10 -2
  309. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  310. package/lib/dist/mcp/tools.d.ts +544 -38
  311. package/lib/dist/mcp/tools.d.ts.map +1 -1
  312. package/lib/dist/mcp/tools.js +4246 -770
  313. package/lib/dist/mcp/tools.js.map +1 -1
  314. package/lib/dist/mcp/writer-lock.d.ts +61 -0
  315. package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
  316. package/lib/dist/mcp/writer-lock.js +260 -0
  317. package/lib/dist/mcp/writer-lock.js.map +1 -0
  318. package/lib/dist/project-config.d.ts +23 -0
  319. package/lib/dist/project-config.d.ts.map +1 -1
  320. package/lib/dist/project-config.js +39 -2
  321. package/lib/dist/project-config.js.map +1 -1
  322. package/lib/dist/resolution/alias-binding.d.ts +56 -0
  323. package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
  324. package/lib/dist/resolution/alias-binding.js +127 -0
  325. package/lib/dist/resolution/alias-binding.js.map +1 -0
  326. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  327. package/lib/dist/resolution/c-fnptr-synthesizer.js +21 -19
  328. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  329. package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
  330. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  331. package/lib/dist/resolution/callback-synthesizer.js +330 -154
  332. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  333. package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
  334. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
  335. package/lib/dist/resolution/cpp-constructor.js +123 -0
  336. package/lib/dist/resolution/cpp-constructor.js.map +1 -0
  337. package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  338. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  339. package/lib/dist/resolution/cpp-macro-visibility.js +342 -0
  340. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
  341. package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  342. package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  343. package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
  344. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
  345. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  346. package/lib/dist/resolution/frameworks/csharp.js +96 -2
  347. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  348. package/lib/dist/resolution/frameworks/expo-router.d.ts +189 -0
  349. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  350. package/lib/dist/resolution/frameworks/expo-router.js +785 -0
  351. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
  352. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  353. package/lib/dist/resolution/frameworks/express.js +251 -16
  354. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  355. package/lib/dist/resolution/frameworks/index.d.ts +5 -0
  356. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  357. package/lib/dist/resolution/frameworks/index.js +29 -1
  358. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  359. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  360. package/lib/dist/resolution/frameworks/java.js +79 -47
  361. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  362. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  363. package/lib/dist/resolution/frameworks/nestjs.js +6 -14
  364. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  365. package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
  366. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  367. package/lib/dist/resolution/frameworks/nextjs.js +328 -0
  368. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
  369. package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
  370. package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  371. package/lib/dist/resolution/frameworks/object-literal.js +139 -0
  372. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
  373. package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
  374. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  375. package/lib/dist/resolution/frameworks/package-deps.js +78 -0
  376. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
  377. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  378. package/lib/dist/resolution/frameworks/python.js +166 -0
  379. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  380. package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
  381. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  382. package/lib/dist/resolution/frameworks/react-native.js +153 -14
  383. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  384. package/lib/dist/resolution/frameworks/react-router.d.ts +46 -0
  385. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  386. package/lib/dist/resolution/frameworks/react-router.js +187 -0
  387. package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
  388. package/lib/dist/resolution/frameworks/react.d.ts +2 -1
  389. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  390. package/lib/dist/resolution/frameworks/react.js +188 -139
  391. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  392. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  393. package/lib/dist/resolution/frameworks/svelte.js +6 -1
  394. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  395. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  396. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  397. package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
  398. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  399. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
  400. package/lib/dist/resolution/frameworks/swift.js +11 -1
  401. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  402. package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  403. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  404. package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
  405. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  406. package/lib/dist/resolution/frameworks/vue-router.d.ts +82 -0
  407. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  408. package/lib/dist/resolution/frameworks/vue-router.js +377 -0
  409. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
  410. package/lib/dist/resolution/import-resolver.d.ts +38 -0
  411. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  412. package/lib/dist/resolution/import-resolver.js +394 -28
  413. package/lib/dist/resolution/import-resolver.js.map +1 -1
  414. package/lib/dist/resolution/index.d.ts +89 -25
  415. package/lib/dist/resolution/index.d.ts.map +1 -1
  416. package/lib/dist/resolution/index.js +567 -149
  417. package/lib/dist/resolution/index.js.map +1 -1
  418. package/lib/dist/resolution/js-builtins.d.ts +13 -0
  419. package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
  420. package/lib/dist/resolution/js-builtins.js +46 -0
  421. package/lib/dist/resolution/js-builtins.js.map +1 -0
  422. package/lib/dist/resolution/name-matcher.d.ts +99 -22
  423. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  424. package/lib/dist/resolution/name-matcher.js +2192 -87
  425. package/lib/dist/resolution/name-matcher.js.map +1 -1
  426. package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
  427. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  428. package/lib/dist/resolution/next-router-synthesizer.js +113 -0
  429. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
  430. package/lib/dist/resolution/path-aliases.d.ts +6 -4
  431. package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
  432. package/lib/dist/resolution/path-aliases.js +125 -17
  433. package/lib/dist/resolution/path-aliases.js.map +1 -1
  434. package/lib/dist/resolution/react-router-synthesizer.d.ts +33 -0
  435. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  436. package/lib/dist/resolution/react-router-synthesizer.js +126 -0
  437. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
  438. package/lib/dist/resolution/resolver-pool.d.ts +2 -0
  439. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  440. package/lib/dist/resolution/resolver-pool.js +4 -0
  441. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  442. package/lib/dist/resolution/strip-comments.d.ts +6 -0
  443. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  444. package/lib/dist/resolution/strip-comments.js +58 -0
  445. package/lib/dist/resolution/strip-comments.js.map +1 -1
  446. package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  447. package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  448. package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
  449. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  450. package/lib/dist/resolution/synth-utils.d.ts +26 -0
  451. package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
  452. package/lib/dist/resolution/synth-utils.js +75 -0
  453. package/lib/dist/resolution/synth-utils.js.map +1 -0
  454. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  455. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  456. package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
  457. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  458. package/lib/dist/resolution/tier-synthesizer.d.ts +49 -0
  459. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  460. package/lib/dist/resolution/tier-synthesizer.js +931 -0
  461. package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
  462. package/lib/dist/resolution/types.d.ts +78 -2
  463. package/lib/dist/resolution/types.d.ts.map +1 -1
  464. package/lib/dist/resolution/types.js +64 -0
  465. package/lib/dist/resolution/types.js.map +1 -1
  466. package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  467. package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  468. package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
  469. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
  470. package/lib/dist/search/identifier-segments.d.ts +10 -0
  471. package/lib/dist/search/identifier-segments.d.ts.map +1 -1
  472. package/lib/dist/search/identifier-segments.js +29 -0
  473. package/lib/dist/search/identifier-segments.js.map +1 -1
  474. package/lib/dist/search/query-paths.d.ts +106 -0
  475. package/lib/dist/search/query-paths.d.ts.map +1 -0
  476. package/lib/dist/search/query-paths.js +513 -0
  477. package/lib/dist/search/query-paths.js.map +1 -0
  478. package/lib/dist/search/query-utils.d.ts +16 -1
  479. package/lib/dist/search/query-utils.d.ts.map +1 -1
  480. package/lib/dist/search/query-utils.js +48 -10
  481. package/lib/dist/search/query-utils.js.map +1 -1
  482. package/lib/dist/sync/watch-policy.d.ts +14 -0
  483. package/lib/dist/sync/watch-policy.d.ts.map +1 -1
  484. package/lib/dist/sync/watch-policy.js +19 -0
  485. package/lib/dist/sync/watch-policy.js.map +1 -1
  486. package/lib/dist/sync/watcher.d.ts +74 -35
  487. package/lib/dist/sync/watcher.d.ts.map +1 -1
  488. package/lib/dist/sync/watcher.js +281 -99
  489. package/lib/dist/sync/watcher.js.map +1 -1
  490. package/lib/dist/telemetry/index.d.ts +4 -2
  491. package/lib/dist/telemetry/index.d.ts.map +1 -1
  492. package/lib/dist/telemetry/index.js +92 -41
  493. package/lib/dist/telemetry/index.js.map +1 -1
  494. package/lib/dist/types.d.ts +21 -2
  495. package/lib/dist/types.d.ts.map +1 -1
  496. package/lib/dist/types.js +2 -0
  497. package/lib/dist/types.js.map +1 -1
  498. package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
  499. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
  500. package/lib/dist/ui-server/api/deadcode.js +136 -0
  501. package/lib/dist/ui-server/api/deadcode.js.map +1 -0
  502. package/lib/dist/ui-server/api/effects.d.ts +87 -0
  503. package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
  504. package/lib/dist/ui-server/api/effects.js +499 -0
  505. package/lib/dist/ui-server/api/effects.js.map +1 -0
  506. package/lib/dist/ui-server/api/entrypoints.d.ts +86 -0
  507. package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  508. package/lib/dist/ui-server/api/entrypoints.js +279 -0
  509. package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
  510. package/lib/dist/ui-server/api/events.d.ts +183 -0
  511. package/lib/dist/ui-server/api/events.d.ts.map +1 -0
  512. package/lib/dist/ui-server/api/events.js +430 -0
  513. package/lib/dist/ui-server/api/events.js.map +1 -0
  514. package/lib/dist/ui-server/api/file.d.ts +66 -0
  515. package/lib/dist/ui-server/api/file.d.ts.map +1 -0
  516. package/lib/dist/ui-server/api/file.js +235 -0
  517. package/lib/dist/ui-server/api/file.js.map +1 -0
  518. package/lib/dist/ui-server/api/filecode.d.ts +126 -0
  519. package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
  520. package/lib/dist/ui-server/api/filecode.js +205 -0
  521. package/lib/dist/ui-server/api/filecode.js.map +1 -0
  522. package/lib/dist/ui-server/api/flow.d.ts +226 -0
  523. package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
  524. package/lib/dist/ui-server/api/flow.js +612 -0
  525. package/lib/dist/ui-server/api/flow.js.map +1 -0
  526. package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
  527. package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  528. package/lib/dist/ui-server/api/hierarchy.js +92 -0
  529. package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
  530. package/lib/dist/ui-server/api/index.d.ts +90 -0
  531. package/lib/dist/ui-server/api/index.d.ts.map +1 -0
  532. package/lib/dist/ui-server/api/index.js +332 -0
  533. package/lib/dist/ui-server/api/index.js.map +1 -0
  534. package/lib/dist/ui-server/api/map.d.ts +238 -0
  535. package/lib/dist/ui-server/api/map.d.ts.map +1 -0
  536. package/lib/dist/ui-server/api/map.js +681 -0
  537. package/lib/dist/ui-server/api/map.js.map +1 -0
  538. package/lib/dist/ui-server/api/node.d.ts +81 -0
  539. package/lib/dist/ui-server/api/node.d.ts.map +1 -0
  540. package/lib/dist/ui-server/api/node.js +388 -0
  541. package/lib/dist/ui-server/api/node.js.map +1 -0
  542. package/lib/dist/ui-server/api/nodes.d.ts +25 -0
  543. package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
  544. package/lib/dist/ui-server/api/nodes.js +45 -0
  545. package/lib/dist/ui-server/api/nodes.js.map +1 -0
  546. package/lib/dist/ui-server/api/program.d.ts +139 -0
  547. package/lib/dist/ui-server/api/program.d.ts.map +1 -0
  548. package/lib/dist/ui-server/api/program.js +315 -0
  549. package/lib/dist/ui-server/api/program.js.map +1 -0
  550. package/lib/dist/ui-server/api/respond.d.ts +76 -0
  551. package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
  552. package/lib/dist/ui-server/api/respond.js +186 -0
  553. package/lib/dist/ui-server/api/respond.js.map +1 -0
  554. package/lib/dist/ui-server/api/route-roots.d.ts +39 -0
  555. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
  556. package/lib/dist/ui-server/api/route-roots.js +96 -0
  557. package/lib/dist/ui-server/api/route-roots.js.map +1 -0
  558. package/lib/dist/ui-server/api/routes.d.ts +59 -0
  559. package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
  560. package/lib/dist/ui-server/api/routes.js +108 -0
  561. package/lib/dist/ui-server/api/routes.js.map +1 -0
  562. package/lib/dist/ui-server/api/screens.d.ts +117 -0
  563. package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
  564. package/lib/dist/ui-server/api/screens.js +611 -0
  565. package/lib/dist/ui-server/api/screens.js.map +1 -0
  566. package/lib/dist/ui-server/api/search.d.ts +29 -0
  567. package/lib/dist/ui-server/api/search.d.ts.map +1 -0
  568. package/lib/dist/ui-server/api/search.js +232 -0
  569. package/lib/dist/ui-server/api/search.js.map +1 -0
  570. package/lib/dist/ui-server/api/session.d.ts +52 -0
  571. package/lib/dist/ui-server/api/session.d.ts.map +1 -0
  572. package/lib/dist/ui-server/api/session.js +196 -0
  573. package/lib/dist/ui-server/api/session.js.map +1 -0
  574. package/lib/dist/ui-server/api/source.d.ts +200 -0
  575. package/lib/dist/ui-server/api/source.d.ts.map +1 -0
  576. package/lib/dist/ui-server/api/source.js +422 -0
  577. package/lib/dist/ui-server/api/source.js.map +1 -0
  578. package/lib/dist/ui-server/api/stats.d.ts +27 -0
  579. package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
  580. package/lib/dist/ui-server/api/stats.js +164 -0
  581. package/lib/dist/ui-server/api/stats.js.map +1 -0
  582. package/lib/dist/ui-server/api/steps.d.ts +274 -0
  583. package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
  584. package/lib/dist/ui-server/api/steps.js +1446 -0
  585. package/lib/dist/ui-server/api/steps.js.map +1 -0
  586. package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
  587. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
  588. package/lib/dist/ui-server/api/trail-store.js +323 -0
  589. package/lib/dist/ui-server/api/trail-store.js.map +1 -0
  590. package/lib/dist/ui-server/api/trails.d.ts +163 -0
  591. package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
  592. package/lib/dist/ui-server/api/trails.js +369 -0
  593. package/lib/dist/ui-server/api/trails.js.map +1 -0
  594. package/lib/dist/ui-server/api/when.d.ts +125 -0
  595. package/lib/dist/ui-server/api/when.d.ts.map +1 -0
  596. package/lib/dist/ui-server/api/when.js +251 -0
  597. package/lib/dist/ui-server/api/when.js.map +1 -0
  598. package/lib/dist/ui-server/api/wire.d.ts +179 -0
  599. package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
  600. package/lib/dist/ui-server/api/wire.js +231 -0
  601. package/lib/dist/ui-server/api/wire.js.map +1 -0
  602. package/lib/dist/ui-server/assets.d.ts +40 -0
  603. package/lib/dist/ui-server/assets.d.ts.map +1 -0
  604. package/lib/dist/ui-server/assets.js +110 -0
  605. package/lib/dist/ui-server/assets.js.map +1 -0
  606. package/lib/dist/ui-server/constants.d.ts +32 -0
  607. package/lib/dist/ui-server/constants.d.ts.map +1 -0
  608. package/lib/dist/ui-server/constants.js +35 -0
  609. package/lib/dist/ui-server/constants.js.map +1 -0
  610. package/lib/dist/ui-server/highlight/index.d.ts +113 -0
  611. package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
  612. package/lib/dist/ui-server/highlight/index.js +307 -0
  613. package/lib/dist/ui-server/highlight/index.js.map +1 -0
  614. package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
  615. package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
  616. package/lib/dist/ui-server/highlight/languages.js +50 -0
  617. package/lib/dist/ui-server/highlight/languages.js.map +1 -0
  618. package/lib/dist/ui-server/index.d.ts +92 -0
  619. package/lib/dist/ui-server/index.d.ts.map +1 -0
  620. package/lib/dist/ui-server/index.js +399 -0
  621. package/lib/dist/ui-server/index.js.map +1 -0
  622. package/lib/dist/ui-server/open-browser.d.ts +31 -0
  623. package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
  624. package/lib/dist/ui-server/open-browser.js +79 -0
  625. package/lib/dist/ui-server/open-browser.js.map +1 -0
  626. package/lib/dist/ui-server/security.d.ts +127 -0
  627. package/lib/dist/ui-server/security.d.ts.map +1 -0
  628. package/lib/dist/ui-server/security.js +332 -0
  629. package/lib/dist/ui-server/security.js.map +1 -0
  630. package/lib/dist/ui-server/static.d.ts +45 -0
  631. package/lib/dist/ui-server/static.d.ts.map +1 -0
  632. package/lib/dist/ui-server/static.js +165 -0
  633. package/lib/dist/ui-server/static.js.map +1 -0
  634. package/lib/dist/utils.d.ts +14 -2
  635. package/lib/dist/utils.d.ts.map +1 -1
  636. package/lib/dist/utils.js +25 -10
  637. package/lib/dist/utils.js.map +1 -1
  638. package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  639. package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  640. package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  641. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
  642. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
  643. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  644. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  645. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  646. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  647. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  648. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  649. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
  650. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
  651. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  652. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  653. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  654. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  655. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  656. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  657. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
  658. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
  659. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  660. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  661. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  662. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  663. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  664. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  665. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
  666. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
  667. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  668. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  669. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  670. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  671. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  672. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  673. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
  674. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
  675. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  676. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  677. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  678. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  679. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  680. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  681. package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
  682. package/lib/dist/viewer/assets/index-D4S7YUPf.js +97 -0
  683. package/lib/dist/viewer/index.html +16 -0
  684. package/lib/kernel/codegraph-kernel.node +2 -2
  685. package/lib/node_modules/.package-lock.json +4 -4
  686. package/lib/node_modules/picomatch/README.md +56 -51
  687. package/lib/node_modules/picomatch/lib/constants.js +4 -0
  688. package/lib/node_modules/picomatch/lib/parse.js +341 -1
  689. package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
  690. package/lib/node_modules/picomatch/lib/scan.js +30 -18
  691. package/lib/node_modules/picomatch/package.json +4 -4
  692. package/lib/package.json +9 -2
  693. package/package.json +1 -1
@@ -21,6 +21,7 @@
21
21
  * codegraph callees <symbol> Find what a function/method calls
22
22
  * codegraph impact <symbol> Analyze what code is affected by changing a symbol
23
23
  * codegraph affected [files] Find test files affected by changes
24
+ * codegraph ui [path] Open the browser viewer (alias: web; not released yet — needs CODEGRAPH_UI=1)
24
25
  * codegraph upgrade [version] Update CodeGraph to the latest release
25
26
  */
26
27
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -61,6 +62,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
61
62
  // launcher is (almost certainly) still alive. A launcher killed mid-startup
62
63
  // otherwise blinds the PPID watchdog forever (#1185) — see early-ppid.ts.
63
64
  require("../mcp/early-ppid");
65
+ // The browser viewer is not part of a release yet (see viewer-gate). Refuse
66
+ // `ui` / `web` — also as `help ui` or `ui --help` — before any startup work,
67
+ // unless CODEGRAPH_UI=1 opts in.
68
+ const viewer_gate_1 = require("./viewer-gate");
69
+ {
70
+ const viewerCommand = (0, viewer_gate_1.requestedViewerCommand)(process.argv.slice(2));
71
+ if (viewerCommand && !(0, viewer_gate_1.viewerEnabled)()) {
72
+ process.stderr.write(`error: 'codegraph ${viewerCommand}' is not in this release yet. The browser viewer is coming in an upcoming release.\n`);
73
+ process.exit(1);
74
+ }
75
+ }
64
76
  // Persist V8 compile artifacts across runs (Node ≥22.8). Every invocation —
65
77
  // and every worker thread, which re-requires the whole extraction module
66
78
  // graph — skips recompiling unchanged sources. Worth hundreds of ms of
@@ -85,6 +97,12 @@ const wasm_runtime_flags_1 = require("../extraction/wasm-runtime-flags");
85
97
  const command_supervision_1 = require("./command-supervision");
86
98
  const extraction_version_1 = require("../extraction/extraction-version");
87
99
  const telemetry_1 = require("../telemetry");
100
+ // Value import, but dependency-free by design so `--help` text can name the
101
+ // default port without dragging node:http into every other subcommand; the
102
+ // server itself is loaded lazily inside the `ui` action. See ui-server/constants.
103
+ const constants_1 = require("../ui-server/constants");
104
+ const symbol_lookup_1 = require("../graph/symbol-lookup");
105
+ const query_utils_1 = require("../search/query-utils");
88
106
  // Decided once, before `--color`/`--no-color` are stripped from argv below
89
107
  // (#1281). Piped/redirected stdout, NO_COLOR, or --no-color -> plain output.
90
108
  const COLORS_ENABLED = (0, color_1.ansiColorsEnabled)();
@@ -355,11 +373,31 @@ function main() {
355
373
  function warn(message) {
356
374
  console.log(chalk.yellow((0, glyphs_1.getGlyphs)().warn) + ' ' + message);
357
375
  }
376
+ /** "not found" (+ optional did-you-mean) when no exact symbol matches. */
377
+ function formatSymbolNotFound(symbol, fuzzyNames) {
378
+ const suggestions = [...new Set(fuzzyNames.filter((n) => n !== symbol))].slice(0, 3);
379
+ if (suggestions.length === 0)
380
+ return `Symbol "${symbol}" not found`;
381
+ return `Symbol "${symbol}" not found — did you mean: ${suggestions.join(', ')}?`;
382
+ }
383
+ /** Compact node shape retained by the CLI's existing JSON lists. */
384
+ function cliNode(node) {
385
+ return { name: node.name, kind: node.kind, filePath: node.filePath, startLine: node.startLine };
386
+ }
387
+ /** Attribute a group's edges to every overload of this definition. */
388
+ function cliDefinition(group) {
389
+ const head = group[0];
390
+ return {
391
+ definition: { ...cliNode(head), id: head.id, qualifiedName: head.qualifiedName, language: head.language },
392
+ roots: group.map((node) => node.id),
393
+ };
394
+ }
358
395
  /**
359
396
  * Print indexing results using clack log methods
360
397
  */
361
398
  function printIndexResult(clack, result, projectPath) {
362
399
  const hasErrors = result.filesErrored > 0;
400
+ const parseWarnings = result.errors.filter((e) => e.code === 'parse_error' && e.severity === 'warning');
363
401
  // Surface non-file-level failures (e.g. lock-acquisition failure
364
402
  // when another indexer is running) before the file-count branches.
365
403
  // Without this the CLI falls through to "No files found to index",
@@ -384,6 +422,10 @@ function main() {
384
422
  clack.log.success(`Indexed ${formatNumber(result.filesIndexed)} files`);
385
423
  }
386
424
  clack.log.info(`${formatNumber(result.nodesCreated)} nodes, ${formatNumber(result.edgesCreated)} edges in ${formatDuration(result.durationMs)}`);
425
+ // Warning-only parse failures keep indexing successful, but must be visible.
426
+ for (const warning of parseWarnings) {
427
+ clack.log.warn(warning.message);
428
+ }
387
429
  // A PARTIAL index (files silently dropped mid-pipeline) must not pass
388
430
  // as a clean run — it's the difference between "indexed the repo" and
389
431
  // "indexed most of the repo, quietly". Only the completeness
@@ -392,10 +434,33 @@ function main() {
392
434
  for (const w of result.errors.filter((e) => e.code === 'index_partial')) {
393
435
  clack.log.warn(w.message);
394
436
  }
437
+ // Files salvaged from comment-stripped source after repeated parser
438
+ // failures are indexed but possibly incomplete — say so here, or the run
439
+ // reads as fully clean and the index quietly disagrees with a later
440
+ // re-parse of the same bytes (#1565).
441
+ const salvaged = result.errors.filter((e) => e.code === 'salvaged_stripped');
442
+ if (salvaged.length > 0) {
443
+ const sample = salvaged.slice(0, 3).map((e) => e.filePath).filter(Boolean).join(', ');
444
+ const more = salvaged.length > 3 ? ', ...' : '';
445
+ clack.log.warn(`${formatNumber(salvaged.length)} file(s) indexed from comment-stripped source after repeated parse failures ${(0, glyphs_1.getGlyphs)().dash} symbols may be incomplete (${sample}${more})`);
446
+ }
395
447
  }
396
448
  else if (hasErrors) {
397
449
  clack.log.error(`Indexing failed ${(0, glyphs_1.getGlyphs)().dash} all ${formatNumber(result.filesErrored)} files had errors`);
398
450
  }
451
+ else if (result.filesSkippedUnsupported) {
452
+ // A project CodeGraph has no grammar for used to be indistinguishable from
453
+ // an empty one: same message, same `complete` state, same exit 0. Say which
454
+ // files were there and that the graph is empty on purpose, so nobody — and
455
+ // no agent trusting the graph — reads silence as "this code doesn't exist"
456
+ // (#1502).
457
+ const top = (result.topUnsupportedExtensions ?? [])
458
+ .map(e => `${e.ext} (${formatNumber(e.count)})`)
459
+ .join(', ');
460
+ clack.log.warn(`No supported source files found ${(0, glyphs_1.getGlyphs)().dash} ${formatNumber(result.filesSkippedUnsupported)} file(s) present, none in a language CodeGraph indexes`
461
+ + (top ? `: ${top}` : ''));
462
+ clack.log.info('CodeGraph is inactive for this workspace — searches will return nothing. Use your own file tools here.');
463
+ }
399
464
  else {
400
465
  clack.log.warn('No files found to index');
401
466
  }
@@ -428,9 +493,17 @@ function main() {
428
493
  }
429
494
  }
430
495
  else if (projectPath) {
431
- const logPath = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'errors.log');
432
- if (fs.existsSync(logPath)) {
433
- fs.unlinkSync(logPath);
496
+ // No hard errors. Salvaged-file warnings still belong in the log — it
497
+ // carries the per-file detail behind the one-line summary above.
498
+ if (result.errors.some((e) => e.code === 'salvaged_stripped')) {
499
+ writeErrorLog(projectPath, result.errors);
500
+ clack.log.info('See .codegraph/errors.log for details');
501
+ }
502
+ else {
503
+ const logPath = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'errors.log');
504
+ if (fs.existsSync(logPath)) {
505
+ fs.unlinkSync(logPath);
506
+ }
434
507
  }
435
508
  }
436
509
  }
@@ -550,16 +623,14 @@ function main() {
550
623
  // Commands
551
624
  // =============================================================================
552
625
  /**
553
- * codegraph init [path]
626
+ * The `init` flow — shared by `codegraph init` and `codegraph install --init`
627
+ * (#1578): refuse an unsafe root, create `.codegraph/`, build the initial
628
+ * index under supervision, then the post-index offers. `yes` makes every
629
+ * offer non-interactive (defaults only), so a container / CI bootstrap never
630
+ * blocks on a prompt. An unsafe root sets `process.exitCode = 1` and returns
631
+ * (no `--force` is implied by any caller); an index failure exits 1.
554
632
  */
555
- program
556
- .command('init [path]')
557
- .description('Initialize CodeGraph in a project directory and build the initial index')
558
- .option('-i, --index', 'Deprecated: indexing now runs by default; flag accepted for backward compatibility')
559
- .option('-f, --force', 'Initialize even if the path looks like your home directory or a filesystem root')
560
- .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
561
- .action(async (pathArg, options) => {
562
- const projectPath = path.resolve(pathArg || process.cwd());
633
+ async function runInit(projectPath, options) {
563
634
  const clack = await importESM('@clack/prompts');
564
635
  clack.intro('Initializing CodeGraph');
565
636
  try {
@@ -579,15 +650,33 @@ function main() {
579
650
  clack.log.info('Use "codegraph index" to re-index or "codegraph sync" to update');
580
651
  try {
581
652
  const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
582
- await offerWatchFallback(clack, projectPath);
653
+ await offerWatchFallback(clack, projectPath, { yes: options.yes });
583
654
  }
584
655
  catch { /* non-fatal */ }
585
656
  clack.outro('');
586
657
  return;
587
658
  }
659
+ if ((0, directory_1.hasForeignDbFile)(projectPath)) {
660
+ const dbFile = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'codegraph.db');
661
+ clack.log.error(`${dbFile} is not a SQLite database, so it cannot be rebuilt in place.`);
662
+ clack.log.info('Move or delete that file, then run "codegraph init" again.');
663
+ clack.outro('');
664
+ process.exitCode = 1;
665
+ return;
666
+ }
667
+ if ((0, directory_1.hasSchemalessDb)(projectPath)) {
668
+ clack.log.warn(`Found a codegraph.db without the codegraph schema in ${(0, directory_1.getCodeGraphDir)(projectPath)} (left by an interrupted init?) — rebuilding it.`);
669
+ }
588
670
  const { default: CodeGraph, getDatabasePath } = await loadCodeGraph();
589
671
  const cg = await CodeGraph.init(projectPath, { index: false });
590
672
  clack.log.success(`Initialized in ${projectPath}`);
673
+ // A fresh index on a Windows drive under WSL gets its own directory (#995).
674
+ // It isn't the documented name, so say where it went and why.
675
+ const dataDir = path.basename((0, directory_1.getCodeGraphDir)(projectPath));
676
+ if (dataDir !== (0, directory_1.codeGraphDirName)()) {
677
+ clack.log.info(`The index is in ${dataDir}/: this project is on a Windows drive, so WSL keeps its own index ` +
678
+ `rather than share ${directory_1.DEFAULT_CODEGRAPH_DIR}/ with CodeGraph on Windows. Set CODEGRAPH_DIR to choose the name yourself.`);
679
+ }
591
680
  // Indexing runs by default now. The legacy -i/--index flag is still
592
681
  // accepted (so existing muscle memory and scripts don't break) but is a
593
682
  // no-op — initializing always builds the initial index.
@@ -619,12 +708,14 @@ function main() {
619
708
  // An empty graph at a git super-repo usually means `.gitignore` excludes
620
709
  // the child repos that hold the code — surface them and offer to opt in
621
710
  // rather than leaving the user with a silent 0-node "Done". (#1156)
711
+ // Under --yes the offer prints its one-line opt-in snippet instead of
712
+ // prompting (same as a non-TTY run).
622
713
  if (result.nodesCreated === 0) {
623
- await offerIndexIgnoredRepos(clack, projectPath, runIndex, { interactive: true });
714
+ await offerIndexIgnoredRepos(clack, projectPath, runIndex, { interactive: !options.yes });
624
715
  }
625
716
  try {
626
717
  const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
627
- await offerWatchFallback(clack, projectPath);
718
+ await offerWatchFallback(clack, projectPath, { yes: options.yes });
628
719
  }
629
720
  catch { /* non-fatal */ }
630
721
  clack.outro('Done');
@@ -634,6 +725,19 @@ function main() {
634
725
  clack.log.error(`Failed: ${err instanceof Error ? err.message : String(err)}`);
635
726
  process.exit(1);
636
727
  }
728
+ }
729
+ /**
730
+ * codegraph init [path]
731
+ */
732
+ program
733
+ .command('init [path]')
734
+ .description('Initialize CodeGraph in a project directory and build the initial index')
735
+ .option('-i, --index', 'Deprecated: indexing now runs by default; flag accepted for backward compatibility')
736
+ .option('-f, --force', 'Initialize even if the path looks like your home directory or a filesystem root')
737
+ .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
738
+ .option('-y, --yes', 'Non-interactive: skip every prompt and take the defaults (for scripts / CI / container bootstraps)')
739
+ .action(async (pathArg, options) => {
740
+ await runInit(path.resolve(pathArg || process.cwd()), options);
637
741
  });
638
742
  /**
639
743
  * codegraph uninit [path]
@@ -698,7 +802,13 @@ function main() {
698
802
  .option('-q, --quiet', 'Suppress progress output')
699
803
  .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
700
804
  .action(async (pathArg, options) => {
701
- const projectPath = resolveProjectPath(pathArg);
805
+ // An EXPLICIT path names the project to rebuild — it is never a hint to go
806
+ // looking for one. resolveProjectPath walks up to the nearest initialized
807
+ // ancestor, which is right for `codegraph query` run from a subdirectory,
808
+ // but for a full re-index it silently rebuilt the parent's graph under a
809
+ // normal "Done" when <path> had no index of its own (#1524). Only a bare
810
+ // `codegraph index` (cwd) may resolve upward.
811
+ const projectPath = pathArg ? path.resolve(pathArg) : resolveProjectPath();
702
812
  try {
703
813
  // Don't (re)index your home directory / a filesystem root (#845). --force
704
814
  // doubles as the override.
@@ -709,66 +819,97 @@ function main() {
709
819
  }
710
820
  if (!(0, directory_1.isInitialized)(projectPath)) {
711
821
  error(`CodeGraph not initialized in ${projectPath}`);
712
- info('Run "codegraph init" first');
822
+ const ancestor = pathArg ? resolveProjectPath(pathArg) : projectPath;
823
+ if (ancestor !== projectPath) {
824
+ info(`The nearest initialized project is ${ancestor} — pass that path to rebuild it, or run "codegraph init" in ${projectPath} to index it on its own.`);
825
+ }
826
+ else {
827
+ info('Run "codegraph init" first');
828
+ }
713
829
  process.exit(1);
714
830
  }
715
- const { default: CodeGraph, getDatabasePath } = await loadCodeGraph();
716
- // `index` is a FULL re-index — identical to a fresh `init`. RECREATE the
717
- // database from scratch (discard .codegraph/codegraph.db + its WAL) rather
718
- // than opening the old graph and DELETE-ing every row. The clear-then-index
719
- // approach reported "0 nodes" without the clear (#874); the recreate keeps
720
- // that fixed AND avoids the failure mode where, on a large or pre-fix
721
- // poisoned index, the per-row FTS delete churn wedged the main thread long
722
- // enough to trip the liveness watchdog before scanning even began (#1067).
723
- // recreate() hands back a fresh, empty instance — no clear() needed. For
724
- // fast incremental updates use `sync`.
725
- const cg = await CodeGraph.recreate(projectPath);
726
- // Supervise the indexer: self-terminate if orphaned (parent shim killed)
727
- // or if the main thread wedges — neither was guarded on this path (#999).
728
- // The DB + WAL paths let the liveness watchdog tell a slow store on
729
- // degraded storage from a true wedge (#1231).
730
- const dbPath = getDatabasePath(projectPath);
731
- const supervision = (0, command_supervision_1.installCommandSupervision)('index', { progressPaths: [dbPath, `${dbPath}-wal`] });
831
+ const { tryAcquireWriterLock, releaseWriterLock, writerLockHeldMessage } = await Promise.resolve().then(() => __importStar(require('../mcp/writer-lock')));
832
+ const rebuild = tryAcquireWriterLock(projectPath, 'rebuild', 'rebuild.pid');
833
+ if (rebuild.kind === 'taken')
834
+ throw new Error('Another index rebuild is already in progress.');
732
835
  try {
733
- if (options.quiet) {
734
- // Quiet mode: no UI, just run against the freshly-recreated graph.
735
- const result = await cg.indexAll();
736
- if (!result.success)
737
- process.exit(1);
738
- cg.destroy();
739
- return;
836
+ // A live MCP daemon keeps SQLite handles open. Verify it by its socket
837
+ // before stopping it so a stale pidfile can never signal another process.
838
+ const { stopDaemonAt } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
839
+ const daemonStop = await stopDaemonAt(fs.realpathSync(projectPath), { preserveUnverified: true });
840
+ if (daemonStop.outcome === 'unverified' || daemonStop.outcome === 'still-running') {
841
+ throw new Error('Could not verify that the active CodeGraph daemon has stopped. Run `codegraph daemon stop` to stop it, then retry `codegraph index`.');
740
842
  }
741
- const clack = await importESM('@clack/prompts');
742
- clack.intro('Indexing project');
743
- // A closure so a re-index (after opting gitignored child repos in, #1156)
744
- // renders identically. Supervision already wraps the whole command.
745
- const renderIndex = async () => {
746
- if (options.verbose) {
747
- return await cg.indexAll({ onProgress: createVerboseProgress(), verbose: true });
843
+ // Keep the writer slot through recreation AND indexing. A reconnecting
844
+ // proxy/daemon must not open the replacement database halfway through.
845
+ const writer = tryAcquireWriterLock(projectPath, 'rebuild');
846
+ if (writer.kind === 'taken')
847
+ throw new Error(writerLockHeldMessage(writer.existing, writer.pidPath));
848
+ try {
849
+ const { default: CodeGraph, getDatabasePath } = await loadCodeGraph();
850
+ // `index` is a FULL re-index — identical to a fresh `init`. RECREATE the
851
+ // database from scratch (discard .codegraph/codegraph.db + its WAL) rather
852
+ // than opening the old graph and DELETE-ing every row. The clear-then-index
853
+ // approach reported "0 nodes" without the clear (#874); the recreate keeps
854
+ // that fixed AND avoids the failure mode where, on a large or pre-fix
855
+ // poisoned index, the per-row FTS delete churn wedged the main thread long
856
+ // enough to trip the liveness watchdog before scanning even began (#1067).
857
+ // recreate() hands back a fresh, empty instance — no clear() needed. For
858
+ // fast incremental updates use `sync`.
859
+ const cg = await CodeGraph.recreate(projectPath);
860
+ // Supervise the indexer: self-terminate if orphaned (parent shim killed)
861
+ // or if the main thread wedges — neither was guarded on this path (#999).
862
+ // The DB + WAL paths let the liveness watchdog tell a slow store on
863
+ // degraded storage from a true wedge (#1231).
864
+ const dbPath = getDatabasePath(projectPath);
865
+ const supervision = (0, command_supervision_1.installCommandSupervision)('index', { progressPaths: [dbPath, `${dbPath}-wal`] });
866
+ try {
867
+ if (options.quiet) {
868
+ // Quiet mode: no UI, just run against the freshly-recreated graph.
869
+ const result = await cg.indexAll();
870
+ if (!result.success)
871
+ process.exit(1);
872
+ return;
873
+ }
874
+ const clack = await importESM('@clack/prompts');
875
+ clack.intro('Indexing project');
876
+ // A closure so a re-index (after opting gitignored child repos in, #1156)
877
+ // renders identically. Supervision already wraps the whole command.
878
+ const renderIndex = async () => {
879
+ if (options.verbose) {
880
+ return await cg.indexAll({ onProgress: createVerboseProgress(), verbose: true });
881
+ }
882
+ process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
883
+ const progress = (0, shimmer_progress_1.createShimmerProgress)();
884
+ const r = await cg.indexAll({ onProgress: progress.onProgress });
885
+ await progress.stop();
886
+ return r;
887
+ };
888
+ const result = await renderIndex();
889
+ printIndexResult(clack, result, projectPath);
890
+ await recordIndexTelemetry(cg, result);
891
+ // Empty graph at a git super-repo → likely `.gitignore`d child repos;
892
+ // name them and offer to opt in instead of a silent 0-node result (#1156).
893
+ let finalResult = result;
894
+ if (result.nodesCreated === 0) {
895
+ finalResult = (await offerIndexIgnoredRepos(clack, projectPath, renderIndex, { interactive: true })) ?? result;
896
+ }
897
+ if (!finalResult.success) {
898
+ process.exit(1);
899
+ }
900
+ clack.outro('Done');
901
+ }
902
+ finally {
903
+ supervision.stop();
904
+ cg.destroy();
748
905
  }
749
- process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
750
- const progress = (0, shimmer_progress_1.createShimmerProgress)();
751
- const r = await cg.indexAll({ onProgress: progress.onProgress });
752
- await progress.stop();
753
- return r;
754
- };
755
- const result = await renderIndex();
756
- printIndexResult(clack, result, projectPath);
757
- await recordIndexTelemetry(cg, result);
758
- // Empty graph at a git super-repo → likely `.gitignore`d child repos;
759
- // name them and offer to opt in instead of a silent 0-node result (#1156).
760
- let finalResult = result;
761
- if (result.nodesCreated === 0) {
762
- finalResult = (await offerIndexIgnoredRepos(clack, projectPath, renderIndex, { interactive: true })) ?? result;
763
906
  }
764
- if (!finalResult.success) {
765
- process.exit(1);
907
+ finally {
908
+ releaseWriterLock(projectPath);
766
909
  }
767
- clack.outro('Done');
768
- cg.destroy();
769
910
  }
770
911
  finally {
771
- supervision.stop();
912
+ releaseWriterLock(projectPath, 'rebuild.pid');
772
913
  }
773
914
  }
774
915
  catch (err) {
@@ -794,36 +935,43 @@ function main() {
794
935
  }
795
936
  const { default: CodeGraph } = await loadCodeGraph();
796
937
  const cg = await CodeGraph.open(projectPath);
797
- if (options.quiet) {
798
- await cg.sync();
799
- cg.destroy();
800
- return;
801
- }
802
- const clack = await importESM('@clack/prompts');
803
- clack.intro('Syncing CodeGraph');
804
- process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
805
- const progress = (0, shimmer_progress_1.createShimmerProgress)();
806
- const result = await cg.sync({
807
- onProgress: progress.onProgress,
808
- });
809
- await progress.stop();
810
- const totalChanges = result.filesAdded + result.filesModified + result.filesRemoved;
811
- if (totalChanges === 0) {
812
- clack.log.info('Already up to date');
938
+ try {
939
+ if (options.quiet) {
940
+ await cg.sync();
941
+ return;
942
+ }
943
+ const clack = await importESM('@clack/prompts');
944
+ clack.intro('Syncing CodeGraph');
945
+ process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
946
+ const progress = (0, shimmer_progress_1.createShimmerProgress)();
947
+ const result = await cg.sync({
948
+ onProgress: progress.onProgress,
949
+ }).finally(() => progress.stop());
950
+ const totalChanges = result.filesAdded + result.filesModified + result.filesRemoved;
951
+ if (totalChanges === 0 && !result.pendingRefsProcessed) {
952
+ clack.log.info('Already up to date');
953
+ }
954
+ else if (totalChanges > 0) {
955
+ clack.log.success(`Synced ${formatNumber(totalChanges)} changed files`);
956
+ const details = [];
957
+ if (result.filesAdded > 0)
958
+ details.push(`Added: ${result.filesAdded}`);
959
+ if (result.filesModified > 0)
960
+ details.push(`Modified: ${result.filesModified}`);
961
+ if (result.filesRemoved > 0)
962
+ details.push(`Removed: ${result.filesRemoved}`);
963
+ clack.log.info(`${details.join(', ')} ${(0, glyphs_1.getGlyphs)().dash} ${formatNumber(result.nodesUpdated)} nodes in ${formatDuration(result.durationMs)}`);
964
+ }
965
+ if (result.pendingRefsProcessed) {
966
+ const unresolved = result.pendingRefsUnresolved
967
+ ? ` (${formatNumber(result.pendingRefsUnresolved)} unresolved)` : '';
968
+ clack.log.info(`Resolved ${formatNumber(result.pendingRefsResolved ?? 0)} pending references${unresolved}`);
969
+ }
970
+ clack.outro('Done');
813
971
  }
814
- else {
815
- clack.log.success(`Synced ${formatNumber(totalChanges)} changed files`);
816
- const details = [];
817
- if (result.filesAdded > 0)
818
- details.push(`Added: ${result.filesAdded}`);
819
- if (result.filesModified > 0)
820
- details.push(`Modified: ${result.filesModified}`);
821
- if (result.filesRemoved > 0)
822
- details.push(`Removed: ${result.filesRemoved}`);
823
- clack.log.info(`${details.join(', ')} ${(0, glyphs_1.getGlyphs)().dash} ${formatNumber(result.nodesUpdated)} nodes in ${formatDuration(result.durationMs)}`);
972
+ finally {
973
+ cg.destroy();
824
974
  }
825
- clack.outro('Done');
826
- cg.destroy();
827
975
  }
828
976
  catch (err) {
829
977
  if (!options.quiet) {
@@ -889,6 +1037,7 @@ function main() {
889
1037
  nodeCount: stats.nodeCount,
890
1038
  edgeCount: stats.edgeCount,
891
1039
  dbSizeBytes: stats.dbSizeBytes,
1040
+ walSizeBytes: stats.walSizeBytes,
892
1041
  backend,
893
1042
  journalMode,
894
1043
  nodesByKind: stats.nodesByKind,
@@ -944,6 +1093,19 @@ function main() {
944
1093
  console.log(` Nodes: ${formatNumber(stats.nodeCount)}`);
945
1094
  console.log(` Edges: ${formatNumber(stats.edgeCount)}`);
946
1095
  console.log(` DB Size: ${(stats.dbSizeBytes / 1024 / 1024).toFixed(2)} MB`);
1096
+ // Surface the WAL sidecar (#1431): a WAL that dwarfs the DB at rest is
1097
+ // the killed-session leak — invisible before this line, it only showed
1098
+ // up as a mysteriously full disk. open() above already kicked off the
1099
+ // automatic heal for the oversized case.
1100
+ if (stats.walSizeBytes > 0) {
1101
+ const { WAL_HEAL_THRESHOLD_BYTES } = await Promise.resolve().then(() => __importStar(require('../db/index')));
1102
+ const oversized = stats.walSizeBytes > Math.max(WAL_HEAL_THRESHOLD_BYTES, stats.dbSizeBytes);
1103
+ const walLabel = `${(stats.walSizeBytes / 1024 / 1024).toFixed(2)} MB`;
1104
+ console.log(` WAL Size: ${oversized ? chalk.yellow(walLabel) : walLabel}`);
1105
+ if (oversized) {
1106
+ warn('The write-ahead log is larger than the database — killed sessions left it behind. It is reclaimed automatically on open; if it persists across runs, another live CodeGraph process is holding it.');
1107
+ }
1108
+ }
947
1109
  // Surface the active SQLite backend (node:sqlite — Node's built-in real
948
1110
  // SQLite, full WAL + FTS5, no native build).
949
1111
  const backendLabel = chalk.green(`node:sqlite ${(0, glyphs_1.getGlyphs)().dash} built-in (full WAL)`);
@@ -1030,20 +1192,27 @@ function main() {
1030
1192
  const cg = await CodeGraph.open(projectPath);
1031
1193
  const limit = parseInt(options.limit || '10', 10);
1032
1194
  const rawResults = cg.searchNodes(search, {
1033
- limit,
1195
+ // Fetch one extra row so the CLI can report a cut without changing the
1196
+ // long-standing bare-array contract of `query --json` (#1639).
1197
+ limit: limit + 1,
1034
1198
  kinds: options.kind ? [options.kind] : undefined,
1035
1199
  });
1036
1200
  // Mirror the MCP search down-rank so the CLI also surfaces the
1037
1201
  // hand-written implementation before protobuf/gRPC scaffolding
1038
1202
  // when both share a name. See extraction/generated-detection.ts.
1039
- const { isGeneratedFile } = await Promise.resolve().then(() => __importStar(require('../extraction/generated-detection')));
1040
- const results = [...rawResults].sort((a, b) => {
1041
- const aGen = isGeneratedFile(a.node.filePath) ? 1 : 0;
1042
- const bGen = isGeneratedFile(b.node.filePath) ? 1 : 0;
1203
+ const isGen = cg.generatedFilePredicate(rawResults.map((r) => r.node.filePath));
1204
+ const rankedResults = [...rawResults].sort((a, b) => {
1205
+ const aGen = isGen(a.node.filePath) ? 1 : 0;
1206
+ const bGen = isGen(b.node.filePath) ? 1 : 0;
1043
1207
  return aGen - bGen;
1044
1208
  });
1209
+ const truncated = rankedResults.length > limit;
1210
+ const results = rankedResults.slice(0, limit);
1211
+ const truncationMessage = `Results truncated at ${limit}; pass --limit to widen.`;
1045
1212
  if (options.json) {
1046
1213
  console.log(JSON.stringify(results, null, 2));
1214
+ if (truncated)
1215
+ console.error(truncationMessage);
1047
1216
  }
1048
1217
  else {
1049
1218
  if (results.length === 0) {
@@ -1067,6 +1236,8 @@ function main() {
1067
1236
  }
1068
1237
  console.log();
1069
1238
  }
1239
+ if (truncated)
1240
+ console.log(chalk.dim(truncationMessage));
1070
1241
  }
1071
1242
  }
1072
1243
  cg.destroy();
@@ -1115,6 +1286,60 @@ function main() {
1115
1286
  process.exit(1);
1116
1287
  }
1117
1288
  });
1289
+ /**
1290
+ * codegraph context <task...>
1291
+ *
1292
+ * The CLI face of the public `buildContext` API (ContextBuilder): FTS entry
1293
+ * points + graph expansion + code blocks, formatted as markdown or JSON.
1294
+ * Advertised in the usage header since the first release but never actually
1295
+ * registered (#1611); external integrations (e.g. Memorix) invoke it as
1296
+ * `codegraph context --path <root> --format json --max-nodes 8 --no-code <task>`.
1297
+ */
1298
+ program
1299
+ .command('context <task...>')
1300
+ .description('Build context for a task: relevant symbols, relationships, and code blocks')
1301
+ .option('-p, --path <path>', 'Project path')
1302
+ .option('-f, --format <format>', 'Output format: markdown or json', 'markdown')
1303
+ .option('-n, --max-nodes <number>', 'Maximum number of symbols to include')
1304
+ .option('--no-code', 'Omit code blocks (structure only)')
1305
+ .action(async (taskParts, options) => {
1306
+ const projectPath = resolveProjectPath(options.path);
1307
+ const format = options.format ?? 'markdown';
1308
+ if (format !== 'markdown' && format !== 'json') {
1309
+ error(`Unknown format "${options.format}" — use "markdown" or "json".`);
1310
+ process.exit(1);
1311
+ }
1312
+ let maxNodes;
1313
+ if (options.maxNodes !== undefined) {
1314
+ maxNodes = parseInt(options.maxNodes, 10);
1315
+ if (Number.isNaN(maxNodes) || maxNodes < 1) {
1316
+ error(`--max-nodes expects a positive integer, got "${options.maxNodes}".`);
1317
+ process.exit(1);
1318
+ }
1319
+ }
1320
+ try {
1321
+ if (!(0, directory_1.isInitialized)(projectPath)) {
1322
+ error(`CodeGraph not initialized in ${projectPath}`);
1323
+ process.exit(1);
1324
+ }
1325
+ const { default: CodeGraph } = await loadCodeGraph();
1326
+ const cg = await CodeGraph.open(projectPath);
1327
+ const result = await cg.buildContext(taskParts.join(' '), {
1328
+ format,
1329
+ includeCode: options.code !== false,
1330
+ ...(maxNodes !== undefined ? { maxNodes } : {}),
1331
+ });
1332
+ // Both supported formats return a formatted string; print it verbatim so
1333
+ // `--format json` stays machine-parseable on stdout (error()/warnings go
1334
+ // to stderr only).
1335
+ console.log(typeof result === 'string' ? result : JSON.stringify(result, null, 2));
1336
+ cg.destroy();
1337
+ }
1338
+ catch (err) {
1339
+ error(`Context build failed: ${err instanceof Error ? err.message : String(err)}`);
1340
+ process.exit(1);
1341
+ }
1342
+ });
1118
1343
  /**
1119
1344
  * codegraph prompt-hook (hidden)
1120
1345
  *
@@ -1155,6 +1380,10 @@ function main() {
1155
1380
  return;
1156
1381
  }
1157
1382
  const prompt = String(input.prompt || '');
1383
+ // System-injected task notifications are not user prompts: exit before
1384
+ // any project lookup or explore work (#1832).
1385
+ if ((0, directory_1.isTaskNotification)(prompt))
1386
+ return;
1158
1387
  // Gate telemetry: how often each tier fires vs. no-ops — counter names
1159
1388
  // only, NEVER prompt content (see TELEMETRY.md). This is the data that
1160
1389
  // turns "is the gate any good" from vibes into a measured recall rate.
@@ -1219,8 +1448,11 @@ function main() {
1219
1448
  const text = result.content[0]?.text ?? '';
1220
1449
  if (!result.isError && text.trim()) {
1221
1450
  // Cap the injection so a large-repo explore can't flood the prompt.
1222
- const MAX = 16000;
1223
- const body = text.length > MAX ? `${text.slice(0, MAX)}\n…(truncated; call codegraph_explore for the rest)` : text;
1451
+ // Claude Code shows hook stdout inline only up to 10,000 characters;
1452
+ // above that it persists the output to a file and the model sees a
1453
+ // 2 KB preview (#1694). PROMPT_HOOK_INJECTION_MAX (9,000) leaves
1454
+ // room for the wrapper and the projectPath nudge lines below.
1455
+ const body = (0, directory_1.capPromptHookInjection)(text);
1224
1456
  // For a front-loaded SUB-project, a follow-up explore needs its path.
1225
1457
  const more = plan.viaSubScan
1226
1458
  ? `call codegraph_explore with projectPath: "${plan.exploreRoot}" for more`
@@ -1562,9 +1794,9 @@ function main() {
1562
1794
  .aliases(['daemons'])
1563
1795
  .description('Manage running CodeGraph background daemons — pick one and press enter to stop it')
1564
1796
  .action(async () => {
1565
- const { listDaemons, stopDaemonAt, stopAllDaemons } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
1797
+ const { listVerifiedDaemons, stopDaemonAt, stopAllDaemons } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
1566
1798
  const { runDaemonPicker } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-manager')));
1567
- const daemons = listDaemons();
1799
+ const daemons = await listVerifiedDaemons();
1568
1800
  if (daemons.length === 0) {
1569
1801
  info('No CodeGraph daemons running.');
1570
1802
  return;
@@ -1591,7 +1823,7 @@ function main() {
1591
1823
  const clack = await importESM('@clack/prompts');
1592
1824
  clack.intro('CodeGraph daemons');
1593
1825
  await runDaemonPicker({
1594
- list: listDaemons,
1826
+ list: listVerifiedDaemons,
1595
1827
  stop: stopDaemonAt,
1596
1828
  stopAll: stopAllDaemons,
1597
1829
  cwdRoot,
@@ -1602,6 +1834,172 @@ function main() {
1602
1834
  done: (m) => clack.outro(m),
1603
1835
  });
1604
1836
  });
1837
+ /**
1838
+ * Print the "no index here" guidance.
1839
+ *
1840
+ * The viewer READS an index; it never builds one — indexing stays the user's
1841
+ * decision, exactly as it is for the MCP tools. So a missing index is normal
1842
+ * input, not a failure to apologize for: say what is missing, say the one
1843
+ * command that fixes it, and never print a stack trace.
1844
+ */
1845
+ function printNoIndexGuidance(projectPath) {
1846
+ error(`No CodeGraph index found for ${projectPath}`);
1847
+ console.error('');
1848
+ // getGlyphs() (not a literal em dash): a legacy Windows console decodes raw
1849
+ // UTF-8 with its OEM codepage and renders one as mojibake (#168).
1850
+ console.error(` The viewer reads an index that already exists ${(0, glyphs_1.getGlyphs)().dash} it never creates one.`);
1851
+ console.error(' To index this project:');
1852
+ console.error('');
1853
+ console.error(` ${chalk.cyan('codegraph init')}`);
1854
+ console.error('');
1855
+ console.error(' Already indexed somewhere else? Point the viewer at it:');
1856
+ console.error('');
1857
+ console.error(` ${chalk.cyan('codegraph ui /path/to/indexed/project')}`);
1858
+ console.error('');
1859
+ }
1860
+ /**
1861
+ * codegraph ui [path] (alias: web)
1862
+ *
1863
+ * The browser reader: serves the built viewer (`dist/viewer/`) over loopback
1864
+ * and opens it. It opens the index for reading and never writes to it, never
1865
+ * indexes, and never changes a line of the project's code. The single thing it
1866
+ * writes is a trail the reader saved, as JSON under `.codegraph/ui/trails/`;
1867
+ * `--read-only` turns even that off.
1868
+ *
1869
+ * Deliberately absent from TELEMETRY_FLUSH_COMMANDS above: the command's own
1870
+ * banner tells the user nothing leaves their machine, so it must not be the
1871
+ * thing that triggers a telemetry send. The usage count still buffers locally
1872
+ * like every other quick command.
1873
+ */
1874
+ program
1875
+ .command('ui [path]', { hidden: !(0, viewer_gate_1.viewerEnabled)() })
1876
+ .alias('web')
1877
+ .description('Open the CodeGraph viewer in your browser — read your indexed project as a graph')
1878
+ .option('--port <number>', `Port to listen on (default: ${constants_1.DEFAULT_UI_PORT}, or the next free one)`)
1879
+ .option('--no-open', 'Print the URL instead of opening a browser')
1880
+ .option('--read-only', 'Refuse every write — saved trails can be opened but not saved or deleted')
1881
+ .addHelpText('after', `
1882
+ Examples:
1883
+ $ codegraph ui Read the project you're standing in
1884
+ $ codegraph ui ~/code/my-app Read a specific indexed project
1885
+ $ codegraph ui --port 8080 Use one specific port (fails if it's taken)
1886
+ $ codegraph ui --no-open Just print the URL (headless boxes, SSH)
1887
+ $ codegraph web Same command under its alias
1888
+
1889
+ Pick a symbol and you see who calls it on the left, its source in the middle,
1890
+ and what it calls on the right at the height of the line that calls it. Search
1891
+ with / (or Cmd-K), click a file path for the file's outline and its imports.
1892
+
1893
+ Ask "how does execute reach getFile" (or "execute -> getFile") in the search
1894
+ box for the flow between two symbols: one card per hop, opened at the line that
1895
+ makes the next call, with dynamic-dispatch hops drawn dashed and named. The Map
1896
+ tab draws the whole project by module, with dependencies pointing down.
1897
+
1898
+ Never opened this codebase before? The Entry points tab lists the routes with
1899
+ the symbols that serve them, the files that run something when they load, the
1900
+ tests, and what the most code depends on — and starts a flow from any of them.
1901
+
1902
+ The page keeps up with the project while it is open: save a file and it says so
1903
+ within about a third of a second, and whatever is on screen re-reads the graph
1904
+ when something re-indexes it. It watches for that; it never polls.
1905
+
1906
+ Save a walk you want to keep: name the trail and it is written to
1907
+ .codegraph/ui/trails/ (already gitignored) as plain JSON, listed on the empty
1908
+ screen, and reopened at the symbol you left. Hops are remembered by name rather
1909
+ than by position, so a saved trail survives re-indexing and says which hop moved
1910
+ when one does. Pass --read-only to refuse every write.
1911
+
1912
+ The viewer listens on 127.0.0.1 only, so nothing on your network can reach it.
1913
+ It opens an index that already exists, never indexes, and never changes a line
1914
+ of your code — the one thing it writes is a trail you asked it to save.
1915
+ Requests from any other host are refused, and nothing is sent anywhere: no code,
1916
+ no paths, no analytics.
1917
+
1918
+ Without --port it takes ${constants_1.DEFAULT_UI_PORT}, or the next free port if that one is busy.
1919
+
1920
+ Set ${constants_1.BROWSER_ENV}=<command> to choose which browser opens, or
1921
+ ${constants_1.BROWSER_ENV}=none to never open one.
1922
+ `)
1923
+ .action(async (pathArg, options) => {
1924
+ // An explicit --port stays explicit: a scripted `--port 8080` that quietly
1925
+ // lands on 8081 is worse than one that says the port is busy. The default
1926
+ // port is the only one we're free to walk away from.
1927
+ let requestedPort;
1928
+ if (options.port !== undefined) {
1929
+ requestedPort = Number(options.port);
1930
+ if (!Number.isInteger(requestedPort) || requestedPort < 0 || requestedPort > 65535) {
1931
+ error(`--port must be a whole number between 0 and 65535 (got "${options.port}").`);
1932
+ process.exit(1);
1933
+ }
1934
+ }
1935
+ const projectPath = resolveProjectPath(pathArg);
1936
+ // Sensitive-directory refusal before anything opens: the same guard the MCP
1937
+ // entry points use, so `codegraph ui /etc` is turned away here rather than
1938
+ // becoming a browsable view of the system.
1939
+ const { validateProjectPath } = await Promise.resolve().then(() => __importStar(require('../utils')));
1940
+ const rootError = validateProjectPath(projectPath);
1941
+ if (rootError) {
1942
+ error(rootError);
1943
+ process.exit(1);
1944
+ }
1945
+ if (!(0, directory_1.isInitialized)(projectPath)) {
1946
+ printNoIndexGuidance(projectPath);
1947
+ process.exit(1);
1948
+ }
1949
+ const { startUiServer, openBrowser, createGraphApi, ViewerMissingError } = await Promise.resolve().then(() => __importStar(require('../ui-server')));
1950
+ // The JSON API the viewer reads its screens from. It opens the index lazily
1951
+ // on the first request, so a slow first paint is the only cost of mounting
1952
+ // it here rather than after the browser connects.
1953
+ const readOnly = options.readOnly === true;
1954
+ const api = createGraphApi({
1955
+ projectRoot: projectPath,
1956
+ readOnly,
1957
+ readOnlyReason: readOnly
1958
+ ? 'This viewer was started with --read-only, so trails cannot be saved.'
1959
+ : undefined,
1960
+ });
1961
+ let handle;
1962
+ try {
1963
+ handle = await startUiServer({
1964
+ projectRoot: projectPath,
1965
+ port: requestedPort,
1966
+ portFallback: requestedPort === undefined,
1967
+ api: api.handler,
1968
+ });
1969
+ }
1970
+ catch (err) {
1971
+ api.close();
1972
+ // Both failure modes here (viewer assets missing, no port available) carry
1973
+ // their own remediation — print it plainly, never a stack trace.
1974
+ error(err instanceof ViewerMissingError || err instanceof Error ? err.message : String(err));
1975
+ process.exit(1);
1976
+ }
1977
+ console.log('');
1978
+ console.log(chalk.bold('CodeGraph viewer'));
1979
+ console.log('');
1980
+ console.log(` ${chalk.dim('Reading')} ${projectPath}`);
1981
+ console.log(` ${chalk.dim('URL')} ${chalk.cyan(handle.url)}`);
1982
+ console.log(` ${chalk.dim('Access')} this machine only ${(0, glyphs_1.getGlyphs)().dash} ` +
1983
+ (readOnly
1984
+ ? 'read-only, nothing leaves your computer'
1985
+ : 'nothing leaves your computer; saved trails are the only thing written'));
1986
+ console.log('');
1987
+ const opened = options.open === false ? false : openBrowser(handle.url);
1988
+ console.log(opened
1989
+ ? chalk.dim(' Opening your browser... press Ctrl+C to stop.')
1990
+ : chalk.dim(' Open that URL in a browser. Press Ctrl+C to stop.'));
1991
+ console.log('');
1992
+ // The http server keeps the event loop alive on its own; these just make
1993
+ // Ctrl-C hang up live sockets instead of waiting on browser keep-alives.
1994
+ const shutdown = () => {
1995
+ // Release the SQLite handle before the socket: the process should never
1996
+ // exit with a live connection to the user's index.
1997
+ api.close();
1998
+ void handle.close().then(() => process.exit(0));
1999
+ };
2000
+ process.once('SIGINT', shutdown);
2001
+ process.once('SIGTERM', shutdown);
2002
+ });
1605
2003
  /**
1606
2004
  * codegraph serve
1607
2005
  */
@@ -1693,12 +2091,17 @@ function main() {
1693
2091
  return;
1694
2092
  }
1695
2093
  const lockPath = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'codegraph.lock');
1696
- if (!fs.existsSync(lockPath)) {
1697
- info(`No lock file found ${(0, glyphs_1.getGlyphs)().dash} nothing to do`);
1698
- return;
1699
- }
1700
- fs.unlinkSync(lockPath);
1701
- success('Removed lock file. You can now run indexing again.');
2094
+ let removed = false;
2095
+ if (fs.existsSync(lockPath)) {
2096
+ fs.unlinkSync(lockPath);
2097
+ removed = true;
2098
+ }
2099
+ const { clearStaleDaemonArtifacts } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
2100
+ removed = await clearStaleDaemonArtifacts(projectPath) || removed;
2101
+ if (removed)
2102
+ success('Removed stale lock artifacts. You can now run indexing again.');
2103
+ else
2104
+ info(`No stale lock files found ${(0, glyphs_1.getGlyphs)().dash} nothing to do`);
1702
2105
  }
1703
2106
  catch (err) {
1704
2107
  error(`Failed to remove lock: ${err instanceof Error ? err.message : String(err)}`);
@@ -1706,157 +2109,147 @@ function main() {
1706
2109
  }
1707
2110
  });
1708
2111
  /**
1709
- * codegraph callers <symbol>
1710
- *
1711
- * CLI parity with the MCP graph tools (codegraph_callers/callees/impact) so the
1712
- * traversal queries work in scripts, CI, and git hooks without a running MCP
1713
- * server.
2112
+ * CLI parity with MCP callers/callees: resolve once, then collect and limit
2113
+ * within each definition. The legacy JSON list remains an explicitly labeled
2114
+ * union, with its original total/limit/truncated contract (#1674).
1714
2115
  */
1715
- program
1716
- .command('callers <symbol>')
1717
- .description('Find all functions/methods that call a specific symbol')
1718
- .option('-p, --path <path>', 'Project path')
1719
- .option('-l, --limit <number>', 'Maximum results', '20')
1720
- .option('-j, --json', 'Output as JSON')
1721
- .action(async (symbol, options) => {
1722
- const projectPath = resolveProjectPath(options.path);
1723
- try {
1724
- if (!(0, directory_1.isInitialized)(projectPath)) {
1725
- error(`CodeGraph not initialized in ${projectPath}`);
1726
- process.exit(1);
1727
- }
1728
- const { default: CodeGraph } = await loadCodeGraph();
1729
- const cg = await CodeGraph.open(projectPath);
1730
- const limit = parseInt(options.limit || '20', 10);
1731
- const matches = cg.searchNodes(symbol, { limit: 50 });
1732
- if (matches.length === 0) {
1733
- info(`Symbol "${symbol}" not found`);
1734
- cg.destroy();
1735
- return;
1736
- }
1737
- const seen = new Set();
1738
- const allCallers = [];
1739
- for (const match of matches) {
1740
- const exactMatch = match.node.name === symbol || match.node.name.endsWith(`.${symbol}`) || match.node.name.endsWith(`::${symbol}`);
1741
- if (!exactMatch && matches.length > 1)
1742
- continue;
1743
- for (const c of cg.getCallers(match.node.id)) {
1744
- if (!seen.has(c.node.id)) {
1745
- seen.add(c.node.id);
1746
- allCallers.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
1747
- }
2116
+ for (const direction of ['callers', 'callees']) {
2117
+ const title = direction === 'callers' ? 'Callers' : 'Callees';
2118
+ program
2119
+ .command(`${direction} <symbol>`)
2120
+ .description(direction === 'callers'
2121
+ ? 'Find all functions/methods that call a specific symbol'
2122
+ : 'Find all functions/methods called by a specific symbol')
2123
+ .option('-p, --path <path>', 'Project path')
2124
+ .option('-f, --file <path>', 'Narrow definitions by file path or suffix (no match: show all with a note)')
2125
+ .option('-l, --limit <number>', 'Maximum results per definition (also caps the JSON union)', '20')
2126
+ .option('-j, --json', 'Output as JSON')
2127
+ .action(async (symbol, options) => {
2128
+ const projectPath = resolveProjectPath(options.path);
2129
+ try {
2130
+ if (!(0, directory_1.isInitialized)(projectPath)) {
2131
+ error(`CodeGraph not initialized in ${projectPath}`);
2132
+ process.exit(1);
1748
2133
  }
1749
- }
1750
- // Fallback: if exact filter removed everything, use the top match
1751
- if (allCallers.length === 0 && matches[0]) {
1752
- for (const c of cg.getCallers(matches[0].node.id)) {
1753
- if (!seen.has(c.node.id)) {
1754
- seen.add(c.node.id);
1755
- allCallers.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
2134
+ const { default: CodeGraph } = await loadCodeGraph();
2135
+ const cg = await CodeGraph.open(projectPath);
2136
+ try {
2137
+ const limit = parseInt(options.limit || '20', 10);
2138
+ const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol);
2139
+ if (targets.length === 0) {
2140
+ info(formatSymbolNotFound(symbol, cg.searchNodes(symbol, { limit: 5 }).map((m) => m.node.name)));
2141
+ return;
1756
2142
  }
1757
- }
1758
- }
1759
- const limited = allCallers.slice(0, limit);
1760
- if (options.json) {
1761
- console.log(JSON.stringify({ symbol, callers: limited }, null, 2));
1762
- }
1763
- else if (limited.length === 0) {
1764
- info(`No callers found for "${symbol}"`);
1765
- }
1766
- else {
1767
- console.log(chalk.bold(`\nCallers of "${symbol}" (${limited.length}):\n`));
1768
- for (const node of limited) {
1769
- const loc = node.startLine ? `:${node.startLine}` : '';
1770
- console.log(chalk.cyan(node.kind.padEnd(12)) +
1771
- chalk.white(node.name));
1772
- console.log(chalk.dim(` ${node.filePath}${loc}`));
1773
- console.log();
1774
- }
1775
- }
1776
- cg.destroy();
1777
- }
1778
- catch (err) {
1779
- error(`callers failed: ${err instanceof Error ? err.message : String(err)}`);
1780
- process.exit(1);
1781
- }
1782
- });
1783
- /**
1784
- * codegraph callees <symbol>
1785
- */
1786
- program
1787
- .command('callees <symbol>')
1788
- .description('Find all functions/methods that a specific symbol calls')
1789
- .option('-p, --path <path>', 'Project path')
1790
- .option('-l, --limit <number>', 'Maximum results', '20')
1791
- .option('-j, --json', 'Output as JSON')
1792
- .action(async (symbol, options) => {
1793
- const projectPath = resolveProjectPath(options.path);
1794
- try {
1795
- if (!(0, directory_1.isInitialized)(projectPath)) {
1796
- error(`CodeGraph not initialized in ${projectPath}`);
1797
- process.exit(1);
1798
- }
1799
- const { default: CodeGraph } = await loadCodeGraph();
1800
- const cg = await CodeGraph.open(projectPath);
1801
- const limit = parseInt(options.limit || '20', 10);
1802
- const matches = cg.searchNodes(symbol, { limit: 50 });
1803
- if (matches.length === 0) {
1804
- info(`Symbol "${symbol}" not found`);
1805
- cg.destroy();
1806
- return;
1807
- }
1808
- const seen = new Set();
1809
- const allCallees = [];
1810
- for (const match of matches) {
1811
- const exactMatch = match.node.name === symbol || match.node.name.endsWith(`.${symbol}`) || match.node.name.endsWith(`::${symbol}`);
1812
- if (!exactMatch && matches.length > 1)
1813
- continue;
1814
- for (const c of cg.getCallees(match.node.id)) {
1815
- if (!seen.has(c.node.id)) {
1816
- seen.add(c.node.id);
1817
- allCallees.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
2143
+ const { groups, filteredOut } = (0, symbol_lookup_1.groupDefinitions)(targets, options.file);
2144
+ const ambiguous = groups.length > 1;
2145
+ const note = filteredOut
2146
+ ? `no definition of "${symbol}" matches file "${options.file}" — showing all definitions instead.`
2147
+ : undefined;
2148
+ const collected = groups.map((group) => {
2149
+ const nodes = new Map();
2150
+ const edges = new Map();
2151
+ for (const target of group) {
2152
+ const connections = direction === 'callers' ? cg.getCallers(target.id) : cg.getCallees(target.id);
2153
+ for (const { node, edge } of connections) {
2154
+ nodes.set(node.id, node);
2155
+ edges.set(`${edge.source}->${edge.target}:${edge.kind}`, edge);
2156
+ }
2157
+ }
2158
+ return { group, nodes: [...nodes.values()], edges: [...edges.values()] };
2159
+ });
2160
+ const relationships = (node, edges) => [...new Set(edges
2161
+ .filter((edge) => (direction === 'callers' ? edge.source : edge.target) === node.id)
2162
+ .map((edge) => edge.kind))];
2163
+ if (options.json) {
2164
+ const definitions = collected.map(({ group, nodes, edges }) => {
2165
+ const limited = nodes.slice(0, limit);
2166
+ const shown = new Set(limited.map((node) => node.id));
2167
+ return {
2168
+ ...cliDefinition(group),
2169
+ [direction]: limited.map((node) => ({ id: node.id, ...cliNode(node), relationships: relationships(node, edges) })),
2170
+ edges: edges.filter((edge) => shown.has(direction === 'callers' ? edge.source : edge.target)),
2171
+ total: nodes.length,
2172
+ limit,
2173
+ truncated: nodes.length > limit,
2174
+ };
2175
+ });
2176
+ const union = new Map();
2177
+ for (const { nodes } of collected) {
2178
+ for (const node of nodes)
2179
+ union.set(node.id, node);
2180
+ }
2181
+ const total = union.size;
2182
+ console.log(JSON.stringify({
2183
+ symbol,
2184
+ targets: groups.flat().map((node) => cliDefinition([node]).definition),
2185
+ ambiguous,
2186
+ aggregation: ambiguous ? 'union' : 'definition',
2187
+ file: options.file,
2188
+ filteredOut,
2189
+ note,
2190
+ definitions,
2191
+ [direction]: [...union.values()].slice(0, limit).map((node) => ({ ...cliNode(node),
2192
+ relationships: relationships(node, collected.flatMap((entry) => entry.edges)) })),
2193
+ total,
2194
+ limit,
2195
+ truncated: total > limit,
2196
+ }, null, 2));
1818
2197
  }
1819
- }
1820
- }
1821
- if (allCallees.length === 0 && matches[0]) {
1822
- for (const c of cg.getCallees(matches[0].node.id)) {
1823
- if (!seen.has(c.node.id)) {
1824
- seen.add(c.node.id);
1825
- allCallees.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
2198
+ else {
2199
+ if (note)
2200
+ warn(note);
2201
+ if (ambiguous) {
2202
+ console.log(chalk.bold(`\n${title} of "${symbol}" — ${groups.length} distinct definitions (narrow with --file):`));
2203
+ }
2204
+ for (const { group, nodes, edges } of collected) {
2205
+ const limited = nodes.slice(0, limit);
2206
+ const total = nodes.length;
2207
+ const truncated = total > limit;
2208
+ const count = truncated ? `${limited.length} of ${total}` : String(total);
2209
+ if (ambiguous) {
2210
+ console.log(chalk.bold(`\n${(0, symbol_lookup_1.describeSymbolNode)(group[0])} (${count}):\n`));
2211
+ }
2212
+ else {
2213
+ console.log(chalk.bold(`\n${title} of "${symbol}" (${count}):\n`));
2214
+ console.log(chalk.dim((0, symbol_lookup_1.describeSymbolNode)(group[0])));
2215
+ }
2216
+ if (total === 0) {
2217
+ if (ambiguous)
2218
+ console.log(chalk.dim(` (no ${direction})`));
2219
+ else
2220
+ info(`No ${direction} found for "${symbol}"`);
2221
+ }
2222
+ for (const node of limited) {
2223
+ const loc = node.startLine ? `:${node.startLine}` : '';
2224
+ const kinds = relationships(node, edges).filter((kind) => kind !== 'calls');
2225
+ const relation = kinds.length ? ` [${kinds.join(', ')}]` : '';
2226
+ console.log(chalk.cyan(node.kind.padEnd(12)) + chalk.white(node.name) + chalk.dim(relation));
2227
+ console.log(chalk.dim(` ${node.filePath}${loc}`));
2228
+ console.log();
2229
+ }
2230
+ if (truncated)
2231
+ console.log(chalk.dim(`Showing ${limited.length} of ${total}; pass --limit to widen.`));
2232
+ }
1826
2233
  }
1827
2234
  }
1828
- }
1829
- const limited = allCallees.slice(0, limit);
1830
- if (options.json) {
1831
- console.log(JSON.stringify({ symbol, callees: limited }, null, 2));
1832
- }
1833
- else if (limited.length === 0) {
1834
- info(`No callees found for "${symbol}"`);
1835
- }
1836
- else {
1837
- console.log(chalk.bold(`\nCallees of "${symbol}" (${limited.length}):\n`));
1838
- for (const node of limited) {
1839
- const loc = node.startLine ? `:${node.startLine}` : '';
1840
- console.log(chalk.cyan(node.kind.padEnd(12)) +
1841
- chalk.white(node.name));
1842
- console.log(chalk.dim(` ${node.filePath}${loc}`));
1843
- console.log();
2235
+ finally {
2236
+ cg.destroy();
1844
2237
  }
1845
2238
  }
1846
- cg.destroy();
1847
- }
1848
- catch (err) {
1849
- error(`callees failed: ${err instanceof Error ? err.message : String(err)}`);
1850
- process.exit(1);
1851
- }
1852
- });
2239
+ catch (err) {
2240
+ error(`${direction} failed: ${err instanceof Error ? err.message : String(err)}`);
2241
+ process.exit(1);
2242
+ }
2243
+ });
2244
+ }
1853
2245
  /**
1854
- * codegraph impact <symbol>
2246
+ * codegraph impact <symbol> — one blast radius per distinct definition.
1855
2247
  */
1856
2248
  program
1857
2249
  .command('impact <symbol>')
1858
2250
  .description('Analyze what code is affected by changing a symbol')
1859
2251
  .option('-p, --path <path>', 'Project path')
2252
+ .option('-f, --file <path>', 'Narrow definitions by file path or suffix (no match: show all with a note)')
1860
2253
  .option('-d, --depth <number>', 'Traversal depth', '2')
1861
2254
  .option('-j, --json', 'Output as JSON')
1862
2255
  .action(async (symbol, options) => {
@@ -1868,72 +2261,95 @@ function main() {
1868
2261
  }
1869
2262
  const { default: CodeGraph } = await loadCodeGraph();
1870
2263
  const cg = await CodeGraph.open(projectPath);
1871
- const depth = Math.min(Math.max(parseInt(options.depth || '2', 10), 1), 10);
1872
- const matches = cg.searchNodes(symbol, { limit: 50 });
1873
- if (matches.length === 0) {
1874
- info(`Symbol "${symbol}" not found`);
1875
- cg.destroy();
1876
- return;
1877
- }
1878
- // Merge impact subgraphs across all exact-matching symbols
1879
- const mergedNodes = new Map();
1880
- const seenEdges = new Set();
1881
- let edgeCount = 0;
1882
- for (const match of matches) {
1883
- const exactMatch = match.node.name === symbol || match.node.name.endsWith(`.${symbol}`) || match.node.name.endsWith(`::${symbol}`);
1884
- if (!exactMatch && matches.length > 1)
1885
- continue;
1886
- const impact = cg.getImpactRadius(match.node.id, depth);
1887
- for (const [id, n] of impact.nodes) {
1888
- mergedNodes.set(id, { name: n.name, kind: n.kind, filePath: n.filePath, startLine: n.startLine });
2264
+ try {
2265
+ const depth = Math.min(Math.max(parseInt(options.depth || '2', 10), 1), 10);
2266
+ const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol);
2267
+ if (targets.length === 0) {
2268
+ info(formatSymbolNotFound(symbol, cg.searchNodes(symbol, { limit: 5 }).map((m) => m.node.name)));
2269
+ return;
1889
2270
  }
1890
- for (const e of impact.edges) {
1891
- const key = `${e.source}->${e.target}:${e.kind}`;
1892
- if (!seenEdges.has(key)) {
1893
- seenEdges.add(key);
1894
- edgeCount++;
2271
+ const { groups, filteredOut } = (0, symbol_lookup_1.groupDefinitions)(targets, options.file);
2272
+ const ambiguous = groups.length > 1;
2273
+ const note = filteredOut
2274
+ ? `no definition of "${symbol}" matches file "${options.file}" — showing all definitions instead.`
2275
+ : undefined;
2276
+ const collected = groups.map((group) => {
2277
+ const nodes = new Map();
2278
+ const edges = new Map();
2279
+ for (const target of group) {
2280
+ const impact = cg.getImpactRadius(target.id, depth);
2281
+ for (const [id, node] of impact.nodes)
2282
+ nodes.set(id, node);
2283
+ for (const edge of impact.edges)
2284
+ edges.set(`${edge.source}->${edge.target}:${edge.kind}`, edge);
1895
2285
  }
2286
+ return { group, nodes, edges };
2287
+ });
2288
+ if (options.json) {
2289
+ const unionNodes = new Map();
2290
+ const unionEdges = new Map();
2291
+ const definitions = collected.map(({ group, nodes, edges }) => {
2292
+ for (const [id, node] of nodes)
2293
+ unionNodes.set(id, node);
2294
+ for (const [key, edge] of edges)
2295
+ unionEdges.set(key, edge);
2296
+ return {
2297
+ ...cliDefinition(group),
2298
+ nodeCount: nodes.size,
2299
+ edgeCount: edges.size,
2300
+ affected: [...nodes.values()].map((node) => ({ id: node.id, ...cliNode(node) })),
2301
+ edges: [...edges.values()],
2302
+ };
2303
+ });
2304
+ console.log(JSON.stringify({
2305
+ symbol,
2306
+ depth,
2307
+ targets: groups.flat().map((node) => cliDefinition([node]).definition),
2308
+ ambiguous,
2309
+ aggregation: ambiguous ? 'union' : 'definition',
2310
+ file: options.file,
2311
+ filteredOut,
2312
+ note,
2313
+ definitions,
2314
+ nodeCount: unionNodes.size,
2315
+ edgeCount: unionEdges.size,
2316
+ affected: [...unionNodes.values()].map(cliNode),
2317
+ }, null, 2));
1896
2318
  }
1897
- }
1898
- // Fallback to top match if exact filter removed everything
1899
- if (mergedNodes.size === 0 && matches[0]) {
1900
- const impact = cg.getImpactRadius(matches[0].node.id, depth);
1901
- for (const [id, n] of impact.nodes) {
1902
- mergedNodes.set(id, { name: n.name, kind: n.kind, filePath: n.filePath, startLine: n.startLine });
1903
- }
1904
- edgeCount = impact.edges.length;
1905
- }
1906
- if (options.json) {
1907
- console.log(JSON.stringify({
1908
- symbol,
1909
- depth,
1910
- nodeCount: mergedNodes.size,
1911
- edgeCount,
1912
- affected: Array.from(mergedNodes.values()),
1913
- }, null, 2));
1914
- }
1915
- else if (mergedNodes.size === 0) {
1916
- info(`No affected symbols found for "${symbol}"`);
1917
- }
1918
- else {
1919
- console.log(chalk.bold(`\nImpact of changing "${symbol}" — ${mergedNodes.size} affected symbols:\n`));
1920
- // Group by file
1921
- const byFile = new Map();
1922
- for (const node of mergedNodes.values()) {
1923
- const list = byFile.get(node.filePath) || [];
1924
- list.push({ name: node.name, kind: node.kind, startLine: node.startLine });
1925
- byFile.set(node.filePath, list);
1926
- }
1927
- for (const [file, nodes] of byFile) {
1928
- console.log(chalk.cyan(file));
1929
- for (const node of nodes) {
1930
- const loc = node.startLine ? `:${node.startLine}` : '';
1931
- console.log(` ${chalk.dim(node.kind.padEnd(12))}${node.name}${chalk.dim(loc)}`);
2319
+ else {
2320
+ if (note)
2321
+ warn(note);
2322
+ if (ambiguous) {
2323
+ console.log(chalk.bold(`\nImpact of changing "${symbol}" — ${groups.length} distinct definitions (each with its own blast radius; narrow with --file):`));
2324
+ }
2325
+ for (const { group, nodes } of collected) {
2326
+ if (ambiguous) {
2327
+ console.log(chalk.bold(`\n${(0, symbol_lookup_1.describeSymbolNode)(group[0])} — ${nodes.size} affected symbols:\n`));
2328
+ }
2329
+ else {
2330
+ console.log(chalk.bold(`\nImpact of changing "${symbol}" — ${nodes.size} affected symbols:\n`));
2331
+ console.log(chalk.dim((0, symbol_lookup_1.describeSymbolNode)(group[0])));
2332
+ }
2333
+ const byFile = new Map();
2334
+ for (const node of nodes.values()) {
2335
+ const list = byFile.get(node.filePath) || [];
2336
+ list.push(node);
2337
+ byFile.set(node.filePath, list);
2338
+ }
2339
+ for (const [file, affected] of byFile) {
2340
+ console.log(chalk.cyan(file));
2341
+ for (const node of affected) {
2342
+ const loc = node.startLine ? `:${node.startLine}` : '';
2343
+ console.log(` ${chalk.dim(node.kind.padEnd(12))}${node.name}${chalk.dim(loc)}`);
2344
+ }
2345
+ console.log();
2346
+ }
1932
2347
  }
1933
- console.log();
1934
2348
  }
1935
2349
  }
1936
- cg.destroy();
2350
+ finally {
2351
+ cg.destroy();
2352
+ }
1937
2353
  }
1938
2354
  catch (err) {
1939
2355
  error(`impact failed: ${err instanceof Error ? err.message : String(err)}`);
@@ -1988,15 +2404,6 @@ function main() {
1988
2404
  const { default: CodeGraph } = await loadCodeGraph();
1989
2405
  const cg = await CodeGraph.open(projectPath);
1990
2406
  const maxDepth = parseInt(options.depth || '5', 10);
1991
- // Common test file patterns
1992
- const defaultTestPatterns = [
1993
- /\.spec\./,
1994
- /\.test\./,
1995
- /\/__tests__\//,
1996
- /\/tests?\//,
1997
- /\/e2e\//,
1998
- /\/spec\//,
1999
- ];
2000
2407
  // Custom filter pattern
2001
2408
  let customFilter = null;
2002
2409
  if (options.filter) {
@@ -2008,10 +2415,15 @@ function main() {
2008
2415
  .replace(/\*/g, '[^/]*');
2009
2416
  customFilter = new RegExp(regex);
2010
2417
  }
2418
+ // One notion of "a test" for the whole tool (#1507): the CLI used to keep
2419
+ // its own six regexes here, which knew `.test.` and `/tests/` but not Go's
2420
+ // `_test.go`, Python's `test_x.py` or the JVM's `FooTest.kt` — so
2421
+ // `affected` reported "no tests" for whole ecosystems while `search` and
2422
+ // the MCP tools counted those very files as tests.
2011
2423
  function isTestFile(filePath) {
2012
2424
  if (customFilter)
2013
2425
  return customFilter.test(filePath);
2014
- return defaultTestPatterns.some(p => p.test(filePath));
2426
+ return (0, query_utils_1.isTestPath)(filePath);
2015
2427
  }
2016
2428
  // BFS to find all transitive dependents of changed files, filtered to test files
2017
2429
  const affectedTests = new Set();
@@ -2082,10 +2494,11 @@ function main() {
2082
2494
  */
2083
2495
  program
2084
2496
  .command('install')
2085
- .description('Install codegraph MCP server into one or more agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent)')
2497
+ .description('Install codegraph MCP server into one or more agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, Kiro, GitHub Copilot)')
2086
2498
  .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "auto"|"all"|"none". Default: prompt')
2087
2499
  .option('-l, --location <where>', 'Install location: "global" or "local". Default: prompt')
2088
2500
  .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=auto, auto-allow on')
2501
+ .option('-i, --init', 'After wiring agents, also run `codegraph init` in the current directory — builds this project’s index, so install + index is one command (combine with --yes for an unattended bootstrap)')
2089
2502
  .option('--no-permissions', 'Skip writing the auto-allow permissions list (Claude Code only)')
2090
2503
  .option('--print-config <id>', 'Print MCP config snippet for the named agent and exit (no file writes)')
2091
2504
  .option('--refresh', 'Rewrite what previous installs configured, for already-configured agents only (never adds new ones). Run automatically by `codegraph upgrade`')
@@ -2161,6 +2574,17 @@ function main() {
2161
2574
  error(err instanceof Error ? err.message : String(err));
2162
2575
  process.exit(1);
2163
2576
  }
2577
+ // --init: the one-shot "wire agents AND build this project's index"
2578
+ // bootstrap (#1578). The installer itself never indexes implicitly (a
2579
+ // surprise index of $HOME is the thing we refuse) — an explicit flag is
2580
+ // the user choosing. Runs after a successful install, including the
2581
+ // `--target none` / nothing-detected case (the installer returns normally
2582
+ // there), and shares every guard with `codegraph init`: an unsafe root
2583
+ // is refused (exit 1, no implied --force), an already-initialized
2584
+ // project just says so. `--yes` flows through so no offer prompts.
2585
+ if (opts.init) {
2586
+ await runInit(process.cwd(), { yes: opts.yes });
2587
+ }
2164
2588
  });
2165
2589
  /**
2166
2590
  * codegraph uninstall
@@ -2172,7 +2596,7 @@ function main() {
2172
2596
  */
2173
2597
  program
2174
2598
  .command('uninstall')
2175
- .description('Remove codegraph from your agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent)')
2599
+ .description('Remove codegraph from your agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, Kiro, GitHub Copilot)')
2176
2600
  .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "all". Default: all')
2177
2601
  .option('-l, --location <where>', 'Uninstall location: "global" or "local". Default: prompt')
2178
2602
  .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=all')