@colbymchenry/codegraph-win32-arm64 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1036) hide show
  1. package/bin/codegraph +1 -1
  2. package/bin/codegraph.cmd +1 -1
  3. package/lib/dist/.test-build-engine.json +1 -1
  4. package/lib/dist/.test-build-viewer.json +1 -1
  5. package/lib/dist/bin/codegraph.d.ts +3 -0
  6. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  7. package/lib/dist/bin/codegraph.js +425 -688
  8. package/lib/dist/bin/codegraph.js.map +1 -1
  9. package/lib/dist/bin/command-supervision.js +1 -57
  10. package/lib/dist/bin/command-supervision.js.map +1 -1
  11. package/lib/dist/bin/fatal-handler.js +0 -46
  12. package/lib/dist/bin/fatal-handler.js.map +1 -1
  13. package/lib/dist/bin/node-version-check.js +0 -33
  14. package/lib/dist/bin/node-version-check.js.map +1 -1
  15. package/lib/dist/bin/uninstall.js +0 -19
  16. package/lib/dist/bin/uninstall.js.map +1 -1
  17. package/lib/dist/bin/viewer-gate.js +0 -14
  18. package/lib/dist/bin/viewer-gate.js.map +1 -1
  19. package/lib/dist/compile-cache.d.ts +2 -0
  20. package/lib/dist/compile-cache.d.ts.map +1 -0
  21. package/lib/dist/compile-cache.js +45 -0
  22. package/lib/dist/compile-cache.js.map +1 -0
  23. package/lib/dist/context/formatter.js +3 -66
  24. package/lib/dist/context/formatter.js.map +1 -1
  25. package/lib/dist/context/index.d.ts +44 -1
  26. package/lib/dist/context/index.d.ts.map +1 -1
  27. package/lib/dist/context/index.js +123 -430
  28. package/lib/dist/context/index.js.map +1 -1
  29. package/lib/dist/context/markers.js +0 -17
  30. package/lib/dist/context/markers.js.map +1 -1
  31. package/lib/dist/db/index.d.ts +44 -1
  32. package/lib/dist/db/index.d.ts.map +1 -1
  33. package/lib/dist/db/index.js +123 -395
  34. package/lib/dist/db/index.js.map +1 -1
  35. package/lib/dist/db/migrations.d.ts +11 -1
  36. package/lib/dist/db/migrations.d.ts.map +1 -1
  37. package/lib/dist/db/migrations.js +71 -79
  38. package/lib/dist/db/migrations.js.map +1 -1
  39. package/lib/dist/db/name-substring-index.d.ts +63 -0
  40. package/lib/dist/db/name-substring-index.d.ts.map +1 -0
  41. package/lib/dist/db/name-substring-index.js +151 -0
  42. package/lib/dist/db/name-substring-index.js.map +1 -0
  43. package/lib/dist/db/node-sqlite.d.ts +19 -0
  44. package/lib/dist/db/node-sqlite.d.ts.map +1 -0
  45. package/lib/dist/db/node-sqlite.js +23 -0
  46. package/lib/dist/db/node-sqlite.js.map +1 -0
  47. package/lib/dist/db/open-error.d.ts +36 -0
  48. package/lib/dist/db/open-error.d.ts.map +1 -0
  49. package/lib/dist/db/open-error.js +63 -0
  50. package/lib/dist/db/open-error.js.map +1 -0
  51. package/lib/dist/db/parameter-flow-queries.d.ts +120 -0
  52. package/lib/dist/db/parameter-flow-queries.d.ts.map +1 -0
  53. package/lib/dist/db/parameter-flow-queries.js +168 -0
  54. package/lib/dist/db/parameter-flow-queries.js.map +1 -0
  55. package/lib/dist/db/queries.d.ts +610 -33
  56. package/lib/dist/db/queries.d.ts.map +1 -1
  57. package/lib/dist/db/queries.js +1345 -1419
  58. package/lib/dist/db/queries.js.map +1 -1
  59. package/lib/dist/db/reference-tail.d.ts +83 -0
  60. package/lib/dist/db/reference-tail.d.ts.map +1 -0
  61. package/lib/dist/db/reference-tail.js +68 -0
  62. package/lib/dist/db/reference-tail.js.map +1 -0
  63. package/lib/dist/db/schema.sql +18 -2
  64. package/lib/dist/db/sqlite-adapter.d.ts +18 -1
  65. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  66. package/lib/dist/db/sqlite-adapter.js +12 -62
  67. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  68. package/lib/dist/db/synthesis-stage.d.ts.map +1 -1
  69. package/lib/dist/db/synthesis-stage.js +2 -6
  70. package/lib/dist/db/synthesis-stage.js.map +1 -1
  71. package/lib/dist/db/wal-valve.js +1 -153
  72. package/lib/dist/db/wal-valve.js.map +1 -1
  73. package/lib/dist/db/wsl-shared-index.js +0 -37
  74. package/lib/dist/db/wsl-shared-index.js.map +1 -1
  75. package/lib/dist/directory.d.ts +51 -0
  76. package/lib/dist/directory.d.ts.map +1 -1
  77. package/lib/dist/directory.js +76 -530
  78. package/lib/dist/directory.js.map +1 -1
  79. package/lib/dist/engine.d.ts +15 -0
  80. package/lib/dist/engine.d.ts.map +1 -0
  81. package/lib/dist/engine.js +34 -0
  82. package/lib/dist/engine.js.map +1 -0
  83. package/lib/dist/errors.d.ts +10 -0
  84. package/lib/dist/errors.d.ts.map +1 -1
  85. package/lib/dist/errors.js +8 -101
  86. package/lib/dist/errors.js.map +1 -1
  87. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
  88. package/lib/dist/extraction/astro-extractor.js +11 -101
  89. package/lib/dist/extraction/astro-extractor.js.map +1 -1
  90. package/lib/dist/extraction/cfml-extractor.d.ts +27 -1
  91. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  92. package/lib/dist/extraction/cfml-extractor.js +66 -204
  93. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  94. package/lib/dist/extraction/commonjs-requires.js +0 -31
  95. package/lib/dist/extraction/commonjs-requires.js.map +1 -1
  96. package/lib/dist/extraction/dfm-extractor.js +0 -21
  97. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  98. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  99. package/lib/dist/extraction/extraction-version.js +1 -24
  100. package/lib/dist/extraction/extraction-version.js.map +1 -1
  101. package/lib/dist/extraction/function-ref.d.ts +40 -0
  102. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  103. package/lib/dist/extraction/function-ref.js +145 -206
  104. package/lib/dist/extraction/function-ref.js.map +1 -1
  105. package/lib/dist/extraction/generated-detection.js +0 -165
  106. package/lib/dist/extraction/generated-detection.js.map +1 -1
  107. package/lib/dist/extraction/grammars.d.ts +45 -4
  108. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  109. package/lib/dist/extraction/grammars.js +53 -430
  110. package/lib/dist/extraction/grammars.js.map +1 -1
  111. package/lib/dist/extraction/index.d.ts +197 -7
  112. package/lib/dist/extraction/index.d.ts.map +1 -1
  113. package/lib/dist/extraction/index.js +554 -1382
  114. package/lib/dist/extraction/index.js.map +1 -1
  115. package/lib/dist/extraction/kernel/decode.js +0 -16
  116. package/lib/dist/extraction/kernel/decode.js.map +1 -1
  117. package/lib/dist/extraction/kernel/index.d.ts +3 -1
  118. package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
  119. package/lib/dist/extraction/kernel/index.js +25 -133
  120. package/lib/dist/extraction/kernel/index.js.map +1 -1
  121. package/lib/dist/extraction/kernel/layout.js +42 -76
  122. package/lib/dist/extraction/kernel/layout.js.map +1 -1
  123. package/lib/dist/extraction/kernel/loader.js +0 -37
  124. package/lib/dist/extraction/kernel/loader.js.map +1 -1
  125. package/lib/dist/extraction/languages/arkts.js +0 -59
  126. package/lib/dist/extraction/languages/arkts.js.map +1 -1
  127. package/lib/dist/extraction/languages/c-cpp.d.ts +125 -28
  128. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  129. package/lib/dist/extraction/languages/c-cpp.js +789 -856
  130. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  131. package/lib/dist/extraction/languages/cfquery.js +0 -9
  132. package/lib/dist/extraction/languages/cfquery.js.map +1 -1
  133. package/lib/dist/extraction/languages/cfscript.d.ts +20 -0
  134. package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -1
  135. package/lib/dist/extraction/languages/cfscript.js +80 -9
  136. package/lib/dist/extraction/languages/cfscript.js.map +1 -1
  137. package/lib/dist/extraction/languages/cobol.js +0 -114
  138. package/lib/dist/extraction/languages/cobol.js.map +1 -1
  139. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts +66 -0
  140. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts.map +1 -0
  141. package/lib/dist/extraction/languages/cpp-brace-scopes.js +343 -0
  142. package/lib/dist/extraction/languages/cpp-brace-scopes.js.map +1 -0
  143. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts +41 -0
  144. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts.map +1 -0
  145. package/lib/dist/extraction/languages/cpp-macro-methods.js +487 -0
  146. package/lib/dist/extraction/languages/cpp-macro-methods.js.map +1 -0
  147. package/lib/dist/extraction/languages/csharp.js +3 -55
  148. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  149. package/lib/dist/extraction/languages/dart.d.ts +84 -0
  150. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  151. package/lib/dist/extraction/languages/dart.js +329 -161
  152. package/lib/dist/extraction/languages/dart.js.map +1 -1
  153. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
  154. package/lib/dist/extraction/languages/erlang.js +15 -102
  155. package/lib/dist/extraction/languages/erlang.js.map +1 -1
  156. package/lib/dist/extraction/languages/go.d.ts +48 -0
  157. package/lib/dist/extraction/languages/go.d.ts.map +1 -1
  158. package/lib/dist/extraction/languages/go.js +102 -31
  159. package/lib/dist/extraction/languages/go.js.map +1 -1
  160. package/lib/dist/extraction/languages/index.js +0 -6
  161. package/lib/dist/extraction/languages/index.js.map +1 -1
  162. package/lib/dist/extraction/languages/java.d.ts.map +1 -1
  163. package/lib/dist/extraction/languages/java.js +67 -78
  164. package/lib/dist/extraction/languages/java.js.map +1 -1
  165. package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
  166. package/lib/dist/extraction/languages/javascript.js +2 -12
  167. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  168. package/lib/dist/extraction/languages/kotlin.d.ts +11 -0
  169. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  170. package/lib/dist/extraction/languages/kotlin.js +35 -184
  171. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  172. package/lib/dist/extraction/languages/lua.js +2 -39
  173. package/lib/dist/extraction/languages/lua.js.map +1 -1
  174. package/lib/dist/extraction/languages/luau.js +0 -14
  175. package/lib/dist/extraction/languages/luau.js.map +1 -1
  176. package/lib/dist/extraction/languages/nix.js +0 -16
  177. package/lib/dist/extraction/languages/nix.js.map +1 -1
  178. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  179. package/lib/dist/extraction/languages/objc.js +5 -16
  180. package/lib/dist/extraction/languages/objc.js.map +1 -1
  181. package/lib/dist/extraction/languages/pascal-preparse.d.ts +66 -0
  182. package/lib/dist/extraction/languages/pascal-preparse.d.ts.map +1 -0
  183. package/lib/dist/extraction/languages/pascal-preparse.js +958 -0
  184. package/lib/dist/extraction/languages/pascal-preparse.js.map +1 -0
  185. package/lib/dist/extraction/languages/pascal-system.d.ts +11 -0
  186. package/lib/dist/extraction/languages/pascal-system.d.ts.map +1 -0
  187. package/lib/dist/extraction/languages/pascal-system.js +23 -0
  188. package/lib/dist/extraction/languages/pascal-system.js.map +1 -0
  189. package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
  190. package/lib/dist/extraction/languages/pascal.js +3 -4
  191. package/lib/dist/extraction/languages/pascal.js.map +1 -1
  192. package/lib/dist/extraction/languages/php.js +5 -42
  193. package/lib/dist/extraction/languages/php.js.map +1 -1
  194. package/lib/dist/extraction/languages/python.js +2 -20
  195. package/lib/dist/extraction/languages/python.js.map +1 -1
  196. package/lib/dist/extraction/languages/r.js +8 -78
  197. package/lib/dist/extraction/languages/r.js.map +1 -1
  198. package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
  199. package/lib/dist/extraction/languages/ruby.js +17 -25
  200. package/lib/dist/extraction/languages/ruby.js.map +1 -1
  201. package/lib/dist/extraction/languages/rust.d.ts +10 -0
  202. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  203. package/lib/dist/extraction/languages/rust.js +15 -47
  204. package/lib/dist/extraction/languages/rust.js.map +1 -1
  205. package/lib/dist/extraction/languages/scala.js +5 -41
  206. package/lib/dist/extraction/languages/scala.js.map +1 -1
  207. package/lib/dist/extraction/languages/solidity.js +1 -82
  208. package/lib/dist/extraction/languages/solidity.js.map +1 -1
  209. package/lib/dist/extraction/languages/swift.js +3 -47
  210. package/lib/dist/extraction/languages/swift.js.map +1 -1
  211. package/lib/dist/extraction/languages/terraform.js +6 -152
  212. package/lib/dist/extraction/languages/terraform.js.map +1 -1
  213. package/lib/dist/extraction/languages/typescript.d.ts +64 -0
  214. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  215. package/lib/dist/extraction/languages/typescript.js +73 -49
  216. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  217. package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -1
  218. package/lib/dist/extraction/languages/vbnet.js +9 -42
  219. package/lib/dist/extraction/languages/vbnet.js.map +1 -1
  220. package/lib/dist/extraction/lazy-frameworks.d.ts +15 -0
  221. package/lib/dist/extraction/lazy-frameworks.d.ts.map +1 -0
  222. package/lib/dist/extraction/lazy-frameworks.js +8 -0
  223. package/lib/dist/extraction/lazy-frameworks.js.map +1 -0
  224. package/lib/dist/extraction/liquid-extractor.d.ts +29 -3
  225. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  226. package/lib/dist/extraction/liquid-extractor.js +89 -148
  227. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  228. package/lib/dist/extraction/mybatis-extractor.js +0 -78
  229. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  230. package/lib/dist/extraction/parse-budget.js +0 -13
  231. package/lib/dist/extraction/parse-budget.js.map +1 -1
  232. package/lib/dist/extraction/parse-pool.d.ts +29 -5
  233. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  234. package/lib/dist/extraction/parse-pool.js +42 -174
  235. package/lib/dist/extraction/parse-pool.js.map +1 -1
  236. package/lib/dist/extraction/parse-worker.d.ts +1 -1
  237. package/lib/dist/extraction/parse-worker.d.ts.map +1 -1
  238. package/lib/dist/extraction/parse-worker.js +5 -58
  239. package/lib/dist/extraction/parse-worker.js.map +1 -1
  240. package/lib/dist/extraction/razor-extractor.d.ts +9 -0
  241. package/lib/dist/extraction/razor-extractor.d.ts.map +1 -1
  242. package/lib/dist/extraction/razor-extractor.js +45 -69
  243. package/lib/dist/extraction/razor-extractor.js.map +1 -1
  244. package/lib/dist/extraction/razor-script.d.ts +23 -0
  245. package/lib/dist/extraction/razor-script.d.ts.map +1 -0
  246. package/lib/dist/extraction/razor-script.js +244 -0
  247. package/lib/dist/extraction/razor-script.js.map +1 -0
  248. package/lib/dist/extraction/sfc-script.d.ts +42 -0
  249. package/lib/dist/extraction/sfc-script.d.ts.map +1 -1
  250. package/lib/dist/extraction/sfc-script.js +32 -31
  251. package/lib/dist/extraction/sfc-script.js.map +1 -1
  252. package/lib/dist/extraction/store-worker.d.ts +1 -1
  253. package/lib/dist/extraction/store-worker.d.ts.map +1 -1
  254. package/lib/dist/extraction/store-worker.js +1 -38
  255. package/lib/dist/extraction/store-worker.js.map +1 -1
  256. package/lib/dist/extraction/store-writer.js +2 -34
  257. package/lib/dist/extraction/store-writer.js.map +1 -1
  258. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  259. package/lib/dist/extraction/svelte-extractor.js +11 -87
  260. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  261. package/lib/dist/extraction/syntax-tokens.d.ts +6 -5
  262. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -1
  263. package/lib/dist/extraction/syntax-tokens.js +4 -152
  264. package/lib/dist/extraction/syntax-tokens.js.map +1 -1
  265. package/lib/dist/extraction/tree-sitter-helpers.d.ts +37 -1
  266. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  267. package/lib/dist/extraction/tree-sitter-helpers.js +76 -68
  268. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  269. package/lib/dist/extraction/tree-sitter-types.d.ts +102 -22
  270. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  271. package/lib/dist/extraction/tree-sitter-types.js +0 -7
  272. package/lib/dist/extraction/tree-sitter-types.js.map +1 -1
  273. package/lib/dist/extraction/tree-sitter.d.ts +447 -9
  274. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  275. package/lib/dist/extraction/tree-sitter.js +1908 -2544
  276. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  277. package/lib/dist/extraction/vue-extractor.d.ts +13 -0
  278. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  279. package/lib/dist/extraction/vue-extractor.js +52 -92
  280. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  281. package/lib/dist/extraction/vue-options-api.js +0 -32
  282. package/lib/dist/extraction/vue-options-api.js.map +1 -1
  283. package/lib/dist/extraction/vue-template-calls.d.ts +37 -0
  284. package/lib/dist/extraction/vue-template-calls.d.ts.map +1 -0
  285. package/lib/dist/extraction/vue-template-calls.js +497 -0
  286. package/lib/dist/extraction/vue-template-calls.js.map +1 -0
  287. package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  288. package/lib/dist/extraction/wasm-runtime-flags.d.ts +6 -0
  289. package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  290. package/lib/dist/extraction/wasm-runtime-flags.js +1 -88
  291. package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
  292. package/lib/dist/file-limits.d.ts +8 -0
  293. package/lib/dist/file-limits.d.ts.map +1 -1
  294. package/lib/dist/file-limits.js +13 -28
  295. package/lib/dist/file-limits.js.map +1 -1
  296. package/lib/dist/graph/branch-guards.d.ts.map +1 -1
  297. package/lib/dist/graph/branch-guards.js +4 -251
  298. package/lib/dist/graph/branch-guards.js.map +1 -1
  299. package/lib/dist/graph/call-sites.d.ts +12 -0
  300. package/lib/dist/graph/call-sites.d.ts.map +1 -0
  301. package/lib/dist/graph/call-sites.js +17 -0
  302. package/lib/dist/graph/call-sites.js.map +1 -0
  303. package/lib/dist/graph/cobol-copybooks.d.ts +75 -0
  304. package/lib/dist/graph/cobol-copybooks.d.ts.map +1 -0
  305. package/lib/dist/graph/cobol-copybooks.js +45 -0
  306. package/lib/dist/graph/cobol-copybooks.js.map +1 -0
  307. package/lib/dist/graph/dead-code.d.ts +26 -4
  308. package/lib/dist/graph/dead-code.d.ts.map +1 -1
  309. package/lib/dist/graph/dead-code.js +157 -311
  310. package/lib/dist/graph/dead-code.js.map +1 -1
  311. package/lib/dist/graph/dynamic-boundary-report.js +1 -88
  312. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -1
  313. package/lib/dist/graph/file-cycles.d.ts +20 -0
  314. package/lib/dist/graph/file-cycles.d.ts.map +1 -0
  315. package/lib/dist/graph/file-cycles.js +79 -0
  316. package/lib/dist/graph/file-cycles.js.map +1 -0
  317. package/lib/dist/graph/go-package.d.ts +27 -0
  318. package/lib/dist/graph/go-package.d.ts.map +1 -0
  319. package/lib/dist/graph/go-package.js +49 -0
  320. package/lib/dist/graph/go-package.js.map +1 -0
  321. package/lib/dist/graph/index.d.ts +2 -0
  322. package/lib/dist/graph/index.d.ts.map +1 -1
  323. package/lib/dist/graph/index.js +4 -6
  324. package/lib/dist/graph/index.js.map +1 -1
  325. package/lib/dist/graph/named-symbol-flow.d.ts +5 -1
  326. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -1
  327. package/lib/dist/graph/named-symbol-flow.js +82 -223
  328. package/lib/dist/graph/named-symbol-flow.js.map +1 -1
  329. package/lib/dist/graph/owning-package.d.ts +59 -0
  330. package/lib/dist/graph/owning-package.d.ts.map +1 -0
  331. package/lib/dist/graph/owning-package.js +120 -0
  332. package/lib/dist/graph/owning-package.js.map +1 -0
  333. package/lib/dist/graph/queries.d.ts +2 -2
  334. package/lib/dist/graph/queries.d.ts.map +1 -1
  335. package/lib/dist/graph/queries.js +2 -135
  336. package/lib/dist/graph/queries.js.map +1 -1
  337. package/lib/dist/graph/symbol-lookup.d.ts +15 -3
  338. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -1
  339. package/lib/dist/graph/symbol-lookup.js +47 -89
  340. package/lib/dist/graph/symbol-lookup.js.map +1 -1
  341. package/lib/dist/graph/synthesized-hop.d.ts +37 -0
  342. package/lib/dist/graph/synthesized-hop.d.ts.map +1 -0
  343. package/lib/dist/graph/synthesized-hop.js +62 -0
  344. package/lib/dist/graph/synthesized-hop.js.map +1 -0
  345. package/lib/dist/graph/test-code.d.ts +21 -0
  346. package/lib/dist/graph/test-code.d.ts.map +1 -0
  347. package/lib/dist/graph/test-code.js +50 -0
  348. package/lib/dist/graph/test-code.js.map +1 -0
  349. package/lib/dist/graph/traversal.d.ts +31 -2
  350. package/lib/dist/graph/traversal.d.ts.map +1 -1
  351. package/lib/dist/graph/traversal.js +98 -226
  352. package/lib/dist/graph/traversal.js.map +1 -1
  353. package/lib/dist/graph/type-hierarchy.js +0 -138
  354. package/lib/dist/graph/type-hierarchy.js.map +1 -1
  355. package/lib/dist/index.d.ts +190 -25
  356. package/lib/dist/index.d.ts.map +1 -1
  357. package/lib/dist/index.js +694 -1109
  358. package/lib/dist/index.js.map +1 -1
  359. package/lib/dist/installer/beta-signup.js +0 -39
  360. package/lib/dist/installer/beta-signup.js.map +1 -1
  361. package/lib/dist/installer/config-writer.js +0 -24
  362. package/lib/dist/installer/config-writer.js.map +1 -1
  363. package/lib/dist/installer/index.d.ts +9 -5
  364. package/lib/dist/installer/index.d.ts.map +1 -1
  365. package/lib/dist/installer/index.js +25 -159
  366. package/lib/dist/installer/index.js.map +1 -1
  367. package/lib/dist/installer/instructions-template.d.ts +1 -1
  368. package/lib/dist/installer/instructions-template.js +0 -37
  369. package/lib/dist/installer/instructions-template.js.map +1 -1
  370. package/lib/dist/installer/targets/antigravity.js +0 -113
  371. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  372. package/lib/dist/installer/targets/bob.d.ts +20 -0
  373. package/lib/dist/installer/targets/bob.d.ts.map +1 -0
  374. package/lib/dist/installer/targets/bob.js +83 -0
  375. package/lib/dist/installer/targets/bob.js.map +1 -0
  376. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  377. package/lib/dist/installer/targets/claude.js +1 -185
  378. package/lib/dist/installer/targets/claude.js.map +1 -1
  379. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  380. package/lib/dist/installer/targets/codex.js +17 -109
  381. package/lib/dist/installer/targets/codex.js.map +1 -1
  382. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  383. package/lib/dist/installer/targets/copilot-cli.js +2 -54
  384. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  385. package/lib/dist/installer/targets/copilot-jetbrains.js +0 -57
  386. package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -1
  387. package/lib/dist/installer/targets/copilot-vscode.js +0 -58
  388. package/lib/dist/installer/targets/copilot-vscode.js.map +1 -1
  389. package/lib/dist/installer/targets/cursor.js +7 -88
  390. package/lib/dist/installer/targets/cursor.js.map +1 -1
  391. package/lib/dist/installer/targets/droid.d.ts +18 -0
  392. package/lib/dist/installer/targets/droid.d.ts.map +1 -0
  393. package/lib/dist/installer/targets/droid.js +92 -0
  394. package/lib/dist/installer/targets/droid.js.map +1 -0
  395. package/lib/dist/installer/targets/dsh.d.ts +35 -0
  396. package/lib/dist/installer/targets/dsh.d.ts.map +1 -0
  397. package/lib/dist/installer/targets/dsh.js +267 -0
  398. package/lib/dist/installer/targets/dsh.js.map +1 -0
  399. package/lib/dist/installer/targets/gemini.js +0 -37
  400. package/lib/dist/installer/targets/gemini.js.map +1 -1
  401. package/lib/dist/installer/targets/grok.d.ts +25 -0
  402. package/lib/dist/installer/targets/grok.d.ts.map +1 -0
  403. package/lib/dist/installer/targets/grok.js +96 -0
  404. package/lib/dist/installer/targets/grok.js.map +1 -0
  405. package/lib/dist/installer/targets/hermes.d.ts +19 -7
  406. package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
  407. package/lib/dist/installer/targets/hermes.js +218 -214
  408. package/lib/dist/installer/targets/hermes.js.map +1 -1
  409. package/lib/dist/installer/targets/json-config.d.ts +45 -0
  410. package/lib/dist/installer/targets/json-config.d.ts.map +1 -0
  411. package/lib/dist/installer/targets/json-config.js +128 -0
  412. package/lib/dist/installer/targets/json-config.js.map +1 -0
  413. package/lib/dist/installer/targets/kimi.d.ts +21 -0
  414. package/lib/dist/installer/targets/kimi.d.ts.map +1 -0
  415. package/lib/dist/installer/targets/kimi.js +97 -0
  416. package/lib/dist/installer/targets/kimi.js.map +1 -0
  417. package/lib/dist/installer/targets/kiro.js +1 -41
  418. package/lib/dist/installer/targets/kiro.js.map +1 -1
  419. package/lib/dist/installer/targets/opencode.js +0 -102
  420. package/lib/dist/installer/targets/opencode.js.map +1 -1
  421. package/lib/dist/installer/targets/pi.d.ts +24 -0
  422. package/lib/dist/installer/targets/pi.d.ts.map +1 -0
  423. package/lib/dist/installer/targets/pi.js +100 -0
  424. package/lib/dist/installer/targets/pi.js.map +1 -0
  425. package/lib/dist/installer/targets/qoder.d.ts +23 -0
  426. package/lib/dist/installer/targets/qoder.d.ts.map +1 -0
  427. package/lib/dist/installer/targets/qoder.js +83 -0
  428. package/lib/dist/installer/targets/qoder.js.map +1 -0
  429. package/lib/dist/installer/targets/qwen.d.ts +21 -0
  430. package/lib/dist/installer/targets/qwen.d.ts.map +1 -0
  431. package/lib/dist/installer/targets/qwen.js +115 -0
  432. package/lib/dist/installer/targets/qwen.js.map +1 -0
  433. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  434. package/lib/dist/installer/targets/registry.js +18 -25
  435. package/lib/dist/installer/targets/registry.js.map +1 -1
  436. package/lib/dist/installer/targets/shared.d.ts +81 -11
  437. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  438. package/lib/dist/installer/targets/shared.js +183 -129
  439. package/lib/dist/installer/targets/shared.js.map +1 -1
  440. package/lib/dist/installer/targets/toml.d.ts +82 -6
  441. package/lib/dist/installer/targets/toml.d.ts.map +1 -1
  442. package/lib/dist/installer/targets/toml.js +318 -112
  443. package/lib/dist/installer/targets/toml.js.map +1 -1
  444. package/lib/dist/installer/targets/types.d.ts +1 -1
  445. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  446. package/lib/dist/installer/targets/types.js +0 -13
  447. package/lib/dist/installer/targets/types.js.map +1 -1
  448. package/lib/dist/installer/targets/windsurf.d.ts +22 -0
  449. package/lib/dist/installer/targets/windsurf.d.ts.map +1 -0
  450. package/lib/dist/installer/targets/windsurf.js +90 -0
  451. package/lib/dist/installer/targets/windsurf.js.map +1 -0
  452. package/lib/dist/lazy-engine.d.ts +22 -0
  453. package/lib/dist/lazy-engine.d.ts.map +1 -0
  454. package/lib/dist/lazy-engine.js +16 -0
  455. package/lib/dist/lazy-engine.js.map +1 -0
  456. package/lib/dist/mcp/answer-freshness.js +0 -6
  457. package/lib/dist/mcp/answer-freshness.js.map +1 -1
  458. package/lib/dist/mcp/daemon-manager.js +2 -23
  459. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  460. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  461. package/lib/dist/mcp/daemon-paths.js +2 -85
  462. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  463. package/lib/dist/mcp/daemon-registry.d.ts +40 -0
  464. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  465. package/lib/dist/mcp/daemon-registry.js +174 -137
  466. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  467. package/lib/dist/mcp/daemon.d.ts +23 -0
  468. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  469. package/lib/dist/mcp/daemon.js +89 -373
  470. package/lib/dist/mcp/daemon.js.map +1 -1
  471. package/lib/dist/mcp/dynamic-boundaries.js +4 -78
  472. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  473. package/lib/dist/mcp/early-ppid.js +0 -24
  474. package/lib/dist/mcp/early-ppid.js.map +1 -1
  475. package/lib/dist/mcp/engine.d.ts +8 -0
  476. package/lib/dist/mcp/engine.d.ts.map +1 -1
  477. package/lib/dist/mcp/engine.js +33 -152
  478. package/lib/dist/mcp/engine.js.map +1 -1
  479. package/lib/dist/mcp/explore-dedup.js +0 -108
  480. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  481. package/lib/dist/mcp/explore-diagnostics.js +0 -116
  482. package/lib/dist/mcp/explore-diagnostics.js.map +1 -1
  483. package/lib/dist/mcp/explore-session-state.js +0 -129
  484. package/lib/dist/mcp/explore-session-state.js.map +1 -1
  485. package/lib/dist/mcp/index-freshness-worker.js +1 -6
  486. package/lib/dist/mcp/index-freshness-worker.js.map +1 -1
  487. package/lib/dist/mcp/index-freshness.js +0 -15
  488. package/lib/dist/mcp/index-freshness.js.map +1 -1
  489. package/lib/dist/mcp/index-version-warning.d.ts +21 -0
  490. package/lib/dist/mcp/index-version-warning.d.ts.map +1 -0
  491. package/lib/dist/mcp/index-version-warning.js +38 -0
  492. package/lib/dist/mcp/index-version-warning.js.map +1 -0
  493. package/lib/dist/mcp/index.d.ts +19 -1
  494. package/lib/dist/mcp/index.d.ts.map +1 -1
  495. package/lib/dist/mcp/index.js +118 -293
  496. package/lib/dist/mcp/index.js.map +1 -1
  497. package/lib/dist/mcp/liveness-watchdog.d.ts +13 -3
  498. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  499. package/lib/dist/mcp/liveness-watchdog.js +106 -121
  500. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  501. package/lib/dist/mcp/ppid-watchdog.js +0 -24
  502. package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
  503. package/lib/dist/mcp/process-identity.d.ts +42 -0
  504. package/lib/dist/mcp/process-identity.d.ts.map +1 -0
  505. package/lib/dist/mcp/process-identity.js +130 -0
  506. package/lib/dist/mcp/process-identity.js.map +1 -0
  507. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -1
  508. package/lib/dist/mcp/project-lifecycle.js +50 -17
  509. package/lib/dist/mcp/project-lifecycle.js.map +1 -1
  510. package/lib/dist/mcp/proxy.d.ts +17 -6
  511. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  512. package/lib/dist/mcp/proxy.js +74 -248
  513. package/lib/dist/mcp/proxy.js.map +1 -1
  514. package/lib/dist/mcp/query-pool.d.ts +43 -3
  515. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  516. package/lib/dist/mcp/query-pool.js +109 -123
  517. package/lib/dist/mcp/query-pool.js.map +1 -1
  518. package/lib/dist/mcp/query-worker.js +24 -36
  519. package/lib/dist/mcp/query-worker.js.map +1 -1
  520. package/lib/dist/mcp/server-instructions.js +0 -31
  521. package/lib/dist/mcp/server-instructions.js.map +1 -1
  522. package/lib/dist/mcp/session.d.ts +27 -0
  523. package/lib/dist/mcp/session.d.ts.map +1 -1
  524. package/lib/dist/mcp/session.js +29 -130
  525. package/lib/dist/mcp/session.js.map +1 -1
  526. package/lib/dist/mcp/startup-handshake.js +1 -48
  527. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  528. package/lib/dist/mcp/stdin-teardown.js +0 -28
  529. package/lib/dist/mcp/stdin-teardown.js.map +1 -1
  530. package/lib/dist/mcp/stdout-teardown.d.ts +26 -0
  531. package/lib/dist/mcp/stdout-teardown.d.ts.map +1 -0
  532. package/lib/dist/mcp/stdout-teardown.js +20 -0
  533. package/lib/dist/mcp/stdout-teardown.js.map +1 -0
  534. package/lib/dist/mcp/tools.d.ts +127 -18
  535. package/lib/dist/mcp/tools.d.ts.map +1 -1
  536. package/lib/dist/mcp/tools.js +661 -3590
  537. package/lib/dist/mcp/tools.js.map +1 -1
  538. package/lib/dist/mcp/transport.d.ts.map +1 -1
  539. package/lib/dist/mcp/transport.js +4 -96
  540. package/lib/dist/mcp/transport.js.map +1 -1
  541. package/lib/dist/mcp/version.d.ts +13 -1
  542. package/lib/dist/mcp/version.d.ts.map +1 -1
  543. package/lib/dist/mcp/version.js +19 -21
  544. package/lib/dist/mcp/version.js.map +1 -1
  545. package/lib/dist/mcp/writer-lock.d.ts +11 -0
  546. package/lib/dist/mcp/writer-lock.d.ts.map +1 -1
  547. package/lib/dist/mcp/writer-lock.js +49 -46
  548. package/lib/dist/mcp/writer-lock.js.map +1 -1
  549. package/lib/dist/project-config.js +1 -138
  550. package/lib/dist/project-config.js.map +1 -1
  551. package/lib/dist/resolution/alias-binding.d.ts +7 -0
  552. package/lib/dist/resolution/alias-binding.d.ts.map +1 -1
  553. package/lib/dist/resolution/alias-binding.js +7 -56
  554. package/lib/dist/resolution/alias-binding.js.map +1 -1
  555. package/lib/dist/resolution/ambient-modules.d.ts +185 -0
  556. package/lib/dist/resolution/ambient-modules.d.ts.map +1 -0
  557. package/lib/dist/resolution/ambient-modules.js +732 -0
  558. package/lib/dist/resolution/ambient-modules.js.map +1 -0
  559. package/lib/dist/resolution/angular-template-synthesizer.d.ts +48 -1
  560. package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -1
  561. package/lib/dist/resolution/angular-template-synthesizer.js +401 -65
  562. package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -1
  563. package/lib/dist/resolution/c-feature-variants.d.ts +40 -0
  564. package/lib/dist/resolution/c-feature-variants.d.ts.map +1 -0
  565. package/lib/dist/resolution/c-feature-variants.js +249 -0
  566. package/lib/dist/resolution/c-feature-variants.js.map +1 -0
  567. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  568. package/lib/dist/resolution/c-fnptr-synthesizer.js +23 -391
  569. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  570. package/lib/dist/resolution/c-macro-renames.d.ts +25 -0
  571. package/lib/dist/resolution/c-macro-renames.d.ts.map +1 -0
  572. package/lib/dist/resolution/c-macro-renames.js +95 -0
  573. package/lib/dist/resolution/c-macro-renames.js.map +1 -0
  574. package/lib/dist/resolution/callback-synthesizer.d.ts +15 -1
  575. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  576. package/lib/dist/resolution/callback-synthesizer.js +1355 -1270
  577. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  578. package/lib/dist/resolution/const-alias-synthesizer.d.ts +48 -0
  579. package/lib/dist/resolution/const-alias-synthesizer.d.ts.map +1 -0
  580. package/lib/dist/resolution/const-alias-synthesizer.js +234 -0
  581. package/lib/dist/resolution/const-alias-synthesizer.js.map +1 -0
  582. package/lib/dist/resolution/cooperative-yield.js +0 -27
  583. package/lib/dist/resolution/cooperative-yield.js.map +1 -1
  584. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -1
  585. package/lib/dist/resolution/cpp-constructor.js +15 -17
  586. package/lib/dist/resolution/cpp-constructor.js.map +1 -1
  587. package/lib/dist/resolution/cpp-includers.d.ts +46 -0
  588. package/lib/dist/resolution/cpp-includers.d.ts.map +1 -0
  589. package/lib/dist/resolution/cpp-includers.js +153 -0
  590. package/lib/dist/resolution/cpp-includers.js.map +1 -0
  591. package/lib/dist/resolution/cpp-macro-visibility.d.ts +16 -0
  592. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -1
  593. package/lib/dist/resolution/cpp-macro-visibility.js +17 -68
  594. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -1
  595. package/lib/dist/resolution/cpp-namespaces.d.ts +54 -0
  596. package/lib/dist/resolution/cpp-namespaces.d.ts.map +1 -0
  597. package/lib/dist/resolution/cpp-namespaces.js +151 -0
  598. package/lib/dist/resolution/cpp-namespaces.js.map +1 -0
  599. package/lib/dist/resolution/cpp-raw-strings.d.ts +33 -0
  600. package/lib/dist/resolution/cpp-raw-strings.d.ts.map +1 -0
  601. package/lib/dist/resolution/cpp-raw-strings.js +167 -0
  602. package/lib/dist/resolution/cpp-raw-strings.js.map +1 -0
  603. package/lib/dist/resolution/cpp-supertypes.d.ts +118 -0
  604. package/lib/dist/resolution/cpp-supertypes.d.ts.map +1 -0
  605. package/lib/dist/resolution/cpp-supertypes.js +322 -0
  606. package/lib/dist/resolution/cpp-supertypes.js.map +1 -0
  607. package/lib/dist/resolution/cpp-template-instantiations.d.ts +83 -0
  608. package/lib/dist/resolution/cpp-template-instantiations.d.ts.map +1 -0
  609. package/lib/dist/resolution/cpp-template-instantiations.js +983 -0
  610. package/lib/dist/resolution/cpp-template-instantiations.js.map +1 -0
  611. package/lib/dist/resolution/cpp-type-aliases.d.ts +194 -0
  612. package/lib/dist/resolution/cpp-type-aliases.d.ts.map +1 -0
  613. package/lib/dist/resolution/cpp-type-aliases.js +648 -0
  614. package/lib/dist/resolution/cpp-type-aliases.js.map +1 -0
  615. package/lib/dist/resolution/dart-libraries.d.ts +75 -0
  616. package/lib/dist/resolution/dart-libraries.d.ts.map +1 -0
  617. package/lib/dist/resolution/dart-libraries.js +721 -0
  618. package/lib/dist/resolution/dart-libraries.js.map +1 -0
  619. package/lib/dist/resolution/dart-local-scope.d.ts +41 -0
  620. package/lib/dist/resolution/dart-local-scope.d.ts.map +1 -0
  621. package/lib/dist/resolution/dart-local-scope.js +565 -0
  622. package/lib/dist/resolution/dart-local-scope.js.map +1 -0
  623. package/lib/dist/resolution/expo-router-synthesizer.js +0 -52
  624. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -1
  625. package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -1
  626. package/lib/dist/resolution/frameworks/angular-router.js +41 -208
  627. package/lib/dist/resolution/frameworks/angular-router.js.map +1 -1
  628. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
  629. package/lib/dist/resolution/frameworks/astro.js +4 -60
  630. package/lib/dist/resolution/frameworks/astro.js.map +1 -1
  631. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -1
  632. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -1
  633. package/lib/dist/resolution/frameworks/cargo-workspace.js +65 -15
  634. package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -1
  635. package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -1
  636. package/lib/dist/resolution/frameworks/cics.js +7 -33
  637. package/lib/dist/resolution/frameworks/cics.js.map +1 -1
  638. package/lib/dist/resolution/frameworks/codeigniter.d.ts +23 -0
  639. package/lib/dist/resolution/frameworks/codeigniter.d.ts.map +1 -0
  640. package/lib/dist/resolution/frameworks/codeigniter.js +271 -0
  641. package/lib/dist/resolution/frameworks/codeigniter.js.map +1 -0
  642. package/lib/dist/resolution/frameworks/component-folder.d.ts +17 -0
  643. package/lib/dist/resolution/frameworks/component-folder.d.ts.map +1 -0
  644. package/lib/dist/resolution/frameworks/component-folder.js +11 -0
  645. package/lib/dist/resolution/frameworks/component-folder.js.map +1 -0
  646. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  647. package/lib/dist/resolution/frameworks/csharp.js +5 -68
  648. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  649. package/lib/dist/resolution/frameworks/drupal.d.ts +17 -8
  650. package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -1
  651. package/lib/dist/resolution/frameworks/drupal.js +377 -142
  652. package/lib/dist/resolution/frameworks/drupal.js.map +1 -1
  653. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  654. package/lib/dist/resolution/frameworks/expo-modules.js +8 -88
  655. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  656. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -1
  657. package/lib/dist/resolution/frameworks/expo-router.js +9 -190
  658. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -1
  659. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  660. package/lib/dist/resolution/frameworks/express.js +182 -199
  661. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  662. package/lib/dist/resolution/frameworks/fabric.js +1 -104
  663. package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
  664. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
  665. package/lib/dist/resolution/frameworks/go.js +14 -43
  666. package/lib/dist/resolution/frameworks/go.js.map +1 -1
  667. package/lib/dist/resolution/frameworks/goframe.js +1 -55
  668. package/lib/dist/resolution/frameworks/goframe.js.map +1 -1
  669. package/lib/dist/resolution/frameworks/index.d.ts +13 -0
  670. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  671. package/lib/dist/resolution/frameworks/index.js +12 -50
  672. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  673. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  674. package/lib/dist/resolution/frameworks/java.js +203 -129
  675. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  676. package/lib/dist/resolution/frameworks/laravel.js +2 -125
  677. package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
  678. package/lib/dist/resolution/frameworks/name-heuristic.js +0 -12
  679. package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -1
  680. package/lib/dist/resolution/frameworks/nestjs.js +2 -199
  681. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  682. package/lib/dist/resolution/frameworks/next-proxy.d.ts +67 -0
  683. package/lib/dist/resolution/frameworks/next-proxy.d.ts.map +1 -0
  684. package/lib/dist/resolution/frameworks/next-proxy.js +239 -0
  685. package/lib/dist/resolution/frameworks/next-proxy.js.map +1 -0
  686. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -1
  687. package/lib/dist/resolution/frameworks/nextjs.js +10 -66
  688. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -1
  689. package/lib/dist/resolution/frameworks/object-literal.js +0 -21
  690. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -1
  691. package/lib/dist/resolution/frameworks/package-deps.d.ts +11 -7
  692. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -1
  693. package/lib/dist/resolution/frameworks/package-deps.js +35 -26
  694. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -1
  695. package/lib/dist/resolution/frameworks/page-component.js +0 -14
  696. package/lib/dist/resolution/frameworks/page-component.js.map +1 -1
  697. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
  698. package/lib/dist/resolution/frameworks/play.js +26 -34
  699. package/lib/dist/resolution/frameworks/play.js.map +1 -1
  700. package/lib/dist/resolution/frameworks/python.js +5 -102
  701. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  702. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  703. package/lib/dist/resolution/frameworks/react-native.js +1 -166
  704. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  705. package/lib/dist/resolution/frameworks/react-router.d.ts +13 -4
  706. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -1
  707. package/lib/dist/resolution/frameworks/react-router.js +10 -82
  708. package/lib/dist/resolution/frameworks/react-router.js.map +1 -1
  709. package/lib/dist/resolution/frameworks/react.d.ts +57 -0
  710. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  711. package/lib/dist/resolution/frameworks/react.js +1449 -191
  712. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  713. package/lib/dist/resolution/frameworks/ruby.js +1 -61
  714. package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
  715. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
  716. package/lib/dist/resolution/frameworks/rust.js +35 -56
  717. package/lib/dist/resolution/frameworks/rust.js.map +1 -1
  718. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  719. package/lib/dist/resolution/frameworks/svelte.js +7 -75
  720. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  721. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -1
  722. package/lib/dist/resolution/frameworks/sveltekit-router.js +8 -46
  723. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -1
  724. package/lib/dist/resolution/frameworks/swift-objc.js +0 -97
  725. package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -1
  726. package/lib/dist/resolution/frameworks/swift.js +0 -97
  727. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  728. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -1
  729. package/lib/dist/resolution/frameworks/tanstack-router.js +9 -130
  730. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -1
  731. package/lib/dist/resolution/frameworks/terraform.js +1 -85
  732. package/lib/dist/resolution/frameworks/terraform.js.map +1 -1
  733. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -1
  734. package/lib/dist/resolution/frameworks/vue-router.js +11 -134
  735. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -1
  736. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
  737. package/lib/dist/resolution/frameworks/vue.js +42 -114
  738. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  739. package/lib/dist/resolution/go-func-field-synthesizer.d.ts +58 -0
  740. package/lib/dist/resolution/go-func-field-synthesizer.d.ts.map +1 -0
  741. package/lib/dist/resolution/go-func-field-synthesizer.js +696 -0
  742. package/lib/dist/resolution/go-func-field-synthesizer.js.map +1 -0
  743. package/lib/dist/resolution/go-module.d.ts +23 -7
  744. package/lib/dist/resolution/go-module.d.ts.map +1 -1
  745. package/lib/dist/resolution/go-module.js +21 -24
  746. package/lib/dist/resolution/go-module.js.map +1 -1
  747. package/lib/dist/resolution/go-stdlib-methods.d.ts +9 -0
  748. package/lib/dist/resolution/go-stdlib-methods.d.ts.map +1 -0
  749. package/lib/dist/resolution/go-stdlib-methods.js +224 -0
  750. package/lib/dist/resolution/go-stdlib-methods.js.map +1 -0
  751. package/lib/dist/resolution/goframe-synthesizer.js +2 -53
  752. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
  753. package/lib/dist/resolution/import-resolver.d.ts +276 -29
  754. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  755. package/lib/dist/resolution/import-resolver.js +1670 -1380
  756. package/lib/dist/resolution/import-resolver.js.map +1 -1
  757. package/lib/dist/resolution/index.d.ts +415 -6
  758. package/lib/dist/resolution/index.d.ts.map +1 -1
  759. package/lib/dist/resolution/index.js +1323 -1037
  760. package/lib/dist/resolution/index.js.map +1 -1
  761. package/lib/dist/resolution/js-builtins.d.ts +14 -0
  762. package/lib/dist/resolution/js-builtins.d.ts.map +1 -1
  763. package/lib/dist/resolution/js-builtins.js +14 -14
  764. package/lib/dist/resolution/js-builtins.js.map +1 -1
  765. package/lib/dist/resolution/js-class-expressions.d.ts +48 -0
  766. package/lib/dist/resolution/js-class-expressions.d.ts.map +1 -0
  767. package/lib/dist/resolution/js-class-expressions.js +25 -0
  768. package/lib/dist/resolution/js-class-expressions.js.map +1 -0
  769. package/lib/dist/resolution/js-super-calls.d.ts +18 -0
  770. package/lib/dist/resolution/js-super-calls.d.ts.map +1 -0
  771. package/lib/dist/resolution/js-super-calls.js +94 -0
  772. package/lib/dist/resolution/js-super-calls.js.map +1 -0
  773. package/lib/dist/resolution/jsx-code.d.ts +28 -0
  774. package/lib/dist/resolution/jsx-code.d.ts.map +1 -0
  775. package/lib/dist/resolution/jsx-code.js +459 -0
  776. package/lib/dist/resolution/jsx-code.js.map +1 -0
  777. package/lib/dist/resolution/lru-cache.d.ts +5 -13
  778. package/lib/dist/resolution/lru-cache.d.ts.map +1 -1
  779. package/lib/dist/resolution/lru-cache.js +43 -32
  780. package/lib/dist/resolution/lru-cache.js.map +1 -1
  781. package/lib/dist/resolution/memory-budget.js +0 -52
  782. package/lib/dist/resolution/memory-budget.js.map +1 -1
  783. package/lib/dist/resolution/module-importers.d.ts +185 -0
  784. package/lib/dist/resolution/module-importers.d.ts.map +1 -0
  785. package/lib/dist/resolution/module-importers.js +588 -0
  786. package/lib/dist/resolution/module-importers.js.map +1 -0
  787. package/lib/dist/resolution/name-matcher.d.ts +858 -7
  788. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  789. package/lib/dist/resolution/name-matcher.js +21030 -5110
  790. package/lib/dist/resolution/name-matcher.js.map +1 -1
  791. package/lib/dist/resolution/next-router-synthesizer.d.ts +19 -0
  792. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -1
  793. package/lib/dist/resolution/next-router-synthesizer.js +46 -28
  794. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -1
  795. package/lib/dist/resolution/override-parameters.d.ts +40 -0
  796. package/lib/dist/resolution/override-parameters.d.ts.map +1 -0
  797. package/lib/dist/resolution/override-parameters.js +339 -0
  798. package/lib/dist/resolution/override-parameters.js.map +1 -0
  799. package/lib/dist/resolution/parameter-flow.d.ts +218 -0
  800. package/lib/dist/resolution/parameter-flow.d.ts.map +1 -0
  801. package/lib/dist/resolution/parameter-flow.js +474 -0
  802. package/lib/dist/resolution/parameter-flow.js.map +1 -0
  803. package/lib/dist/resolution/pascal-scope.d.ts +91 -0
  804. package/lib/dist/resolution/pascal-scope.d.ts.map +1 -0
  805. package/lib/dist/resolution/pascal-scope.js +961 -0
  806. package/lib/dist/resolution/pascal-scope.js.map +1 -0
  807. package/lib/dist/resolution/path-aliases.d.ts +32 -4
  808. package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
  809. package/lib/dist/resolution/path-aliases.js +43 -110
  810. package/lib/dist/resolution/path-aliases.js.map +1 -1
  811. package/lib/dist/resolution/project-scans.d.ts +38 -0
  812. package/lib/dist/resolution/project-scans.d.ts.map +1 -0
  813. package/lib/dist/resolution/project-scans.js +30 -0
  814. package/lib/dist/resolution/project-scans.js.map +1 -0
  815. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -1
  816. package/lib/dist/resolution/react-router-synthesizer.js +3 -55
  817. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -1
  818. package/lib/dist/resolution/resolver-pool.d.ts +23 -2
  819. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  820. package/lib/dist/resolution/resolver-pool.js +43 -111
  821. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  822. package/lib/dist/resolution/resolver-worker.d.ts +1 -1
  823. package/lib/dist/resolution/resolver-worker.d.ts.map +1 -1
  824. package/lib/dist/resolution/resolver-worker.js +8 -37
  825. package/lib/dist/resolution/resolver-worker.js.map +1 -1
  826. package/lib/dist/resolution/resurrect-ref.d.ts +25 -0
  827. package/lib/dist/resolution/resurrect-ref.d.ts.map +1 -0
  828. package/lib/dist/resolution/resurrect-ref.js +19 -0
  829. package/lib/dist/resolution/resurrect-ref.js.map +1 -0
  830. package/lib/dist/resolution/ruby-constant-paths.d.ts +56 -0
  831. package/lib/dist/resolution/ruby-constant-paths.d.ts.map +1 -0
  832. package/lib/dist/resolution/ruby-constant-paths.js +255 -0
  833. package/lib/dist/resolution/ruby-constant-paths.js.map +1 -0
  834. package/lib/dist/resolution/ruby-parameter-flow.d.ts +10 -0
  835. package/lib/dist/resolution/ruby-parameter-flow.d.ts.map +1 -0
  836. package/lib/dist/resolution/ruby-parameter-flow.js +801 -0
  837. package/lib/dist/resolution/ruby-parameter-flow.js.map +1 -0
  838. package/lib/dist/resolution/rust-scopes.d.ts +120 -0
  839. package/lib/dist/resolution/rust-scopes.d.ts.map +1 -0
  840. package/lib/dist/resolution/rust-scopes.js +730 -0
  841. package/lib/dist/resolution/rust-scopes.js.map +1 -0
  842. package/lib/dist/resolution/shopify-themes.d.ts +10 -0
  843. package/lib/dist/resolution/shopify-themes.d.ts.map +1 -0
  844. package/lib/dist/resolution/shopify-themes.js +19 -0
  845. package/lib/dist/resolution/shopify-themes.js.map +1 -0
  846. package/lib/dist/resolution/strip-comments.d.ts +20 -1
  847. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  848. package/lib/dist/resolution/strip-comments.js +164 -119
  849. package/lib/dist/resolution/strip-comments.js.map +1 -1
  850. package/lib/dist/resolution/sveltekit-synthesizer.js +0 -64
  851. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -1
  852. package/lib/dist/resolution/swift-objc-bridge.js +0 -160
  853. package/lib/dist/resolution/swift-objc-bridge.js.map +1 -1
  854. package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -1
  855. package/lib/dist/resolution/swift-type-visibility.js +2 -101
  856. package/lib/dist/resolution/swift-type-visibility.js.map +1 -1
  857. package/lib/dist/resolution/synth-utils.js +1 -22
  858. package/lib/dist/resolution/synth-utils.js.map +1 -1
  859. package/lib/dist/resolution/tanstack-router-synthesizer.js +0 -32
  860. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -1
  861. package/lib/dist/resolution/tauri-synthesizer.d.ts +37 -0
  862. package/lib/dist/resolution/tauri-synthesizer.d.ts.map +1 -0
  863. package/lib/dist/resolution/tauri-synthesizer.js +1038 -0
  864. package/lib/dist/resolution/tauri-synthesizer.js.map +1 -0
  865. package/lib/dist/resolution/tier-synthesizer.js +4 -170
  866. package/lib/dist/resolution/tier-synthesizer.js.map +1 -1
  867. package/lib/dist/resolution/type-parameters.d.ts +23 -0
  868. package/lib/dist/resolution/type-parameters.d.ts.map +1 -1
  869. package/lib/dist/resolution/type-parameters.js +52 -54
  870. package/lib/dist/resolution/type-parameters.js.map +1 -1
  871. package/lib/dist/resolution/types.d.ts +183 -11
  872. package/lib/dist/resolution/types.d.ts.map +1 -1
  873. package/lib/dist/resolution/types.js +0 -47
  874. package/lib/dist/resolution/types.js.map +1 -1
  875. package/lib/dist/resolution/vbnet-receivers.d.ts +92 -0
  876. package/lib/dist/resolution/vbnet-receivers.d.ts.map +1 -0
  877. package/lib/dist/resolution/vbnet-receivers.js +1482 -0
  878. package/lib/dist/resolution/vbnet-receivers.js.map +1 -0
  879. package/lib/dist/resolution/vue-router-synthesizer.js +0 -31
  880. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -1
  881. package/lib/dist/resolution/workspace-packages.d.ts +206 -15
  882. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
  883. package/lib/dist/resolution/workspace-packages.js +570 -152
  884. package/lib/dist/resolution/workspace-packages.js.map +1 -1
  885. package/lib/dist/search/identifier-segments.js +2 -93
  886. package/lib/dist/search/identifier-segments.js.map +1 -1
  887. package/lib/dist/search/query-parser.js +0 -54
  888. package/lib/dist/search/query-parser.js.map +1 -1
  889. package/lib/dist/search/query-paths.js +0 -167
  890. package/lib/dist/search/query-paths.js.map +1 -1
  891. package/lib/dist/search/query-utils.d.ts +44 -0
  892. package/lib/dist/search/query-utils.d.ts.map +1 -1
  893. package/lib/dist/search/query-utils.js +120 -198
  894. package/lib/dist/search/query-utils.js.map +1 -1
  895. package/lib/dist/sync/git-hooks.d.ts +14 -5
  896. package/lib/dist/sync/git-hooks.d.ts.map +1 -1
  897. package/lib/dist/sync/git-hooks.js +118 -65
  898. package/lib/dist/sync/git-hooks.js.map +1 -1
  899. package/lib/dist/sync/index.js +0 -14
  900. package/lib/dist/sync/index.js.map +1 -1
  901. package/lib/dist/sync/watch-policy.js +0 -45
  902. package/lib/dist/sync/watch-policy.js.map +1 -1
  903. package/lib/dist/sync/watcher.d.ts +29 -11
  904. package/lib/dist/sync/watcher.d.ts.map +1 -1
  905. package/lib/dist/sync/watcher.js +83 -487
  906. package/lib/dist/sync/watcher.js.map +1 -1
  907. package/lib/dist/sync/worktree.d.ts +7 -2
  908. package/lib/dist/sync/worktree.d.ts.map +1 -1
  909. package/lib/dist/sync/worktree.js +24 -97
  910. package/lib/dist/sync/worktree.js.map +1 -1
  911. package/lib/dist/telemetry/index.d.ts.map +1 -1
  912. package/lib/dist/telemetry/index.js +15 -135
  913. package/lib/dist/telemetry/index.js.map +1 -1
  914. package/lib/dist/types.d.ts +46 -0
  915. package/lib/dist/types.d.ts.map +1 -1
  916. package/lib/dist/types.js +15 -44
  917. package/lib/dist/types.js.map +1 -1
  918. package/lib/dist/ui/color.js +0 -19
  919. package/lib/dist/ui/color.js.map +1 -1
  920. package/lib/dist/ui/glyphs.js +2 -45
  921. package/lib/dist/ui/glyphs.js.map +1 -1
  922. package/lib/dist/ui/shimmer-progress.js +0 -21
  923. package/lib/dist/ui/shimmer-progress.js.map +1 -1
  924. package/lib/dist/ui/shimmer-worker.js +0 -22
  925. package/lib/dist/ui/shimmer-worker.js.map +1 -1
  926. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -1
  927. package/lib/dist/ui-server/api/deadcode.js +2 -31
  928. package/lib/dist/ui-server/api/deadcode.js.map +1 -1
  929. package/lib/dist/ui-server/api/effects.js +0 -111
  930. package/lib/dist/ui-server/api/effects.js.map +1 -1
  931. package/lib/dist/ui-server/api/entrypoints.js +0 -142
  932. package/lib/dist/ui-server/api/entrypoints.js.map +1 -1
  933. package/lib/dist/ui-server/api/events.js +0 -145
  934. package/lib/dist/ui-server/api/events.js.map +1 -1
  935. package/lib/dist/ui-server/api/file.js +0 -80
  936. package/lib/dist/ui-server/api/file.js.map +1 -1
  937. package/lib/dist/ui-server/api/filecode.js +0 -95
  938. package/lib/dist/ui-server/api/filecode.js.map +1 -1
  939. package/lib/dist/ui-server/api/flow.js +0 -149
  940. package/lib/dist/ui-server/api/flow.js.map +1 -1
  941. package/lib/dist/ui-server/api/hierarchy.js +0 -28
  942. package/lib/dist/ui-server/api/hierarchy.js.map +1 -1
  943. package/lib/dist/ui-server/api/index.js +0 -88
  944. package/lib/dist/ui-server/api/index.js.map +1 -1
  945. package/lib/dist/ui-server/api/map.d.ts.map +1 -1
  946. package/lib/dist/ui-server/api/map.js +4 -317
  947. package/lib/dist/ui-server/api/map.js.map +1 -1
  948. package/lib/dist/ui-server/api/node.js +0 -111
  949. package/lib/dist/ui-server/api/node.js.map +1 -1
  950. package/lib/dist/ui-server/api/nodes.js +0 -16
  951. package/lib/dist/ui-server/api/nodes.js.map +1 -1
  952. package/lib/dist/ui-server/api/program.js +0 -90
  953. package/lib/dist/ui-server/api/program.js.map +1 -1
  954. package/lib/dist/ui-server/api/respond.js +0 -60
  955. package/lib/dist/ui-server/api/respond.js.map +1 -1
  956. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -1
  957. package/lib/dist/ui-server/api/route-roots.js +2 -44
  958. package/lib/dist/ui-server/api/route-roots.js.map +1 -1
  959. package/lib/dist/ui-server/api/routes.d.ts.map +1 -1
  960. package/lib/dist/ui-server/api/routes.js +4 -60
  961. package/lib/dist/ui-server/api/routes.js.map +1 -1
  962. package/lib/dist/ui-server/api/screens.d.ts.map +1 -1
  963. package/lib/dist/ui-server/api/screens.js +4 -174
  964. package/lib/dist/ui-server/api/screens.js.map +1 -1
  965. package/lib/dist/ui-server/api/search.js +0 -62
  966. package/lib/dist/ui-server/api/search.js.map +1 -1
  967. package/lib/dist/ui-server/api/session.js +0 -58
  968. package/lib/dist/ui-server/api/session.js.map +1 -1
  969. package/lib/dist/ui-server/api/source.d.ts.map +1 -1
  970. package/lib/dist/ui-server/api/source.js +0 -161
  971. package/lib/dist/ui-server/api/source.js.map +1 -1
  972. package/lib/dist/ui-server/api/stats.js +0 -58
  973. package/lib/dist/ui-server/api/stats.js.map +1 -1
  974. package/lib/dist/ui-server/api/steps.d.ts.map +1 -1
  975. package/lib/dist/ui-server/api/steps.js +5 -381
  976. package/lib/dist/ui-server/api/steps.js.map +1 -1
  977. package/lib/dist/ui-server/api/trail-store.d.ts +3 -3
  978. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -1
  979. package/lib/dist/ui-server/api/trail-store.js +24 -106
  980. package/lib/dist/ui-server/api/trail-store.js.map +1 -1
  981. package/lib/dist/ui-server/api/trails.d.ts.map +1 -1
  982. package/lib/dist/ui-server/api/trails.js +19 -94
  983. package/lib/dist/ui-server/api/trails.js.map +1 -1
  984. package/lib/dist/ui-server/api/when.js +0 -36
  985. package/lib/dist/ui-server/api/when.js.map +1 -1
  986. package/lib/dist/ui-server/api/wire.js +0 -58
  987. package/lib/dist/ui-server/api/wire.js.map +1 -1
  988. package/lib/dist/ui-server/assets.js +0 -35
  989. package/lib/dist/ui-server/assets.js.map +1 -1
  990. package/lib/dist/ui-server/constants.js +0 -26
  991. package/lib/dist/ui-server/constants.js.map +1 -1
  992. package/lib/dist/ui-server/highlight/bounded-tokenize.js +0 -25
  993. package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -1
  994. package/lib/dist/ui-server/highlight/index.js +1 -132
  995. package/lib/dist/ui-server/highlight/index.js.map +1 -1
  996. package/lib/dist/ui-server/highlight/languages.d.ts +3 -3
  997. package/lib/dist/ui-server/highlight/languages.js +0 -31
  998. package/lib/dist/ui-server/highlight/languages.js.map +1 -1
  999. package/lib/dist/ui-server/highlight/tokenize-worker.js +0 -5
  1000. package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -1
  1001. package/lib/dist/ui-server/index.d.ts +25 -0
  1002. package/lib/dist/ui-server/index.d.ts.map +1 -1
  1003. package/lib/dist/ui-server/index.js +35 -103
  1004. package/lib/dist/ui-server/index.js.map +1 -1
  1005. package/lib/dist/ui-server/open-browser.js +0 -34
  1006. package/lib/dist/ui-server/open-browser.js.map +1 -1
  1007. package/lib/dist/ui-server/security.d.ts +5 -0
  1008. package/lib/dist/ui-server/security.d.ts.map +1 -1
  1009. package/lib/dist/ui-server/security.js +11 -147
  1010. package/lib/dist/ui-server/security.js.map +1 -1
  1011. package/lib/dist/ui-server/static.js +0 -41
  1012. package/lib/dist/ui-server/static.js.map +1 -1
  1013. package/lib/dist/upgrade/index.d.ts +18 -5
  1014. package/lib/dist/upgrade/index.d.ts.map +1 -1
  1015. package/lib/dist/upgrade/index.js +73 -229
  1016. package/lib/dist/upgrade/index.js.map +1 -1
  1017. package/lib/dist/upgrade/remove-binary.js +2 -67
  1018. package/lib/dist/upgrade/remove-binary.js.map +1 -1
  1019. package/lib/dist/upgrade/update-check.js +1 -81
  1020. package/lib/dist/upgrade/update-check.js.map +1 -1
  1021. package/lib/dist/utils.d.ts +69 -1
  1022. package/lib/dist/utils.d.ts.map +1 -1
  1023. package/lib/dist/utils.js +224 -266
  1024. package/lib/dist/utils.js.map +1 -1
  1025. package/lib/dist/worker-teardown.js +0 -47
  1026. package/lib/dist/worker-teardown.js.map +1 -1
  1027. package/lib/kernel/codegraph-kernel.node +2 -2
  1028. package/lib/node_modules/.package-lock.json +4 -4
  1029. package/lib/node_modules/ignore/README.md +138 -8
  1030. package/lib/node_modules/ignore/index.d.ts +56 -20
  1031. package/lib/node_modules/ignore/index.js +1033 -221
  1032. package/lib/node_modules/ignore/legacy.js +871 -178
  1033. package/lib/node_modules/ignore/package.json +10 -4
  1034. package/lib/package.json +14 -8
  1035. package/node.exe +2 -2
  1036. package/package.json +1 -1
@@ -1,29 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- /**
4
- * CodeGraph CLI
5
- *
6
- * Command-line interface for CodeGraph code intelligence.
7
- *
8
- * Usage:
9
- * codegraph Run interactive installer (when no args)
10
- * codegraph install Run interactive installer
11
- * codegraph uninstall Remove CodeGraph from your agents
12
- * codegraph init [path] Initialize CodeGraph in a project
13
- * codegraph uninit [path] Remove CodeGraph from a project
14
- * codegraph index [path] Index all files in the project
15
- * codegraph sync [path] Sync changes since last index
16
- * codegraph status [path] Show index status
17
- * codegraph query <search> Search for symbols
18
- * codegraph files [options] Show project file structure
19
- * codegraph context <task> Build context for a task
20
- * codegraph callers <symbol> Find what calls a function/method
21
- * codegraph callees <symbol> Find what a function/method calls
22
- * codegraph impact <symbol> Analyze what code is affected by changing a symbol
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)
25
- * codegraph upgrade [version] Update CodeGraph to the latest release
26
- */
27
3
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
28
4
  if (k2 === undefined) k2 = k;
29
5
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -58,13 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
58
34
  };
59
35
  })();
60
36
  Object.defineProperty(exports, "__esModule", { value: true });
61
- // FIRST import, before anything else loads: capture process.ppid while our
62
- // launcher is (almost certainly) still alive. A launcher killed mid-startup
63
- // otherwise blinds the PPID watchdog forever (#1185) — see early-ppid.ts.
64
37
  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
38
  const viewer_gate_1 = require("./viewer-gate");
69
39
  {
70
40
  const viewerCommand = (0, viewer_gate_1.requestedViewerCommand)(process.argv.slice(2));
@@ -73,15 +43,7 @@ const viewer_gate_1 = require("./viewer-gate");
73
43
  process.exit(1);
74
44
  }
75
45
  }
76
- // Persist V8 compile artifacts across runs (Node ≥22.8). Every invocation —
77
- // and every worker thread, which re-requires the whole extraction module
78
- // graph — skips recompiling unchanged sources. Worth hundreds of ms of
79
- // worker-boot latency per bulk index; harmless no-op when unavailable.
80
- try {
81
- // eslint-disable-next-line @typescript-eslint/no-require-imports
82
- require('node:module').enableCompileCache?.();
83
- }
84
- catch { /* cache is best-effort */ }
46
+ require("../compile-cache");
85
47
  const commander_1 = require("commander");
86
48
  const path = __importStar(require("path"));
87
49
  const fs = __importStar(require("fs"));
@@ -97,16 +59,15 @@ const wasm_runtime_flags_1 = require("../extraction/wasm-runtime-flags");
97
59
  const command_supervision_1 = require("./command-supervision");
98
60
  const extraction_version_1 = require("../extraction/extraction-version");
99
61
  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
62
  const constants_1 = require("../ui-server/constants");
104
63
  const symbol_lookup_1 = require("../graph/symbol-lookup");
64
+ const call_sites_1 = require("../graph/call-sites");
65
+ const go_package_1 = require("../graph/go-package");
66
+ const owning_package_1 = require("../graph/owning-package");
67
+ const type_hierarchy_1 = require("../graph/type-hierarchy");
68
+ const test_code_1 = require("../graph/test-code");
105
69
  const query_utils_1 = require("../search/query-utils");
106
- // Decided once, before `--color`/`--no-color` are stripped from argv below
107
- // (#1281). Piped/redirected stdout, NO_COLOR, or --no-color -> plain output.
108
70
  const COLORS_ENABLED = (0, color_1.ansiColorsEnabled)();
109
- // Lazy-load heavy modules (CodeGraph, runInstaller) to keep CLI startup fast.
110
71
  async function loadCodeGraph() {
111
72
  try {
112
73
  return await Promise.resolve().then(() => __importStar(require('../index')));
@@ -121,17 +82,7 @@ async function loadCodeGraph() {
121
82
  process.exit(1);
122
83
  }
123
84
  }
124
- // Dynamic import helper — tsc compiles import() to require() in CJS mode,
125
- // which fails for ESM-only packages. This bypasses the transformation.
126
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
127
85
  const importESM = new Function('specifier', 'return import(specifier)');
128
- // Block CodeGraph on Node.js 25.x — V8's turboshaft WASM JIT has a Zone
129
- // allocator bug that reliably crashes when compiling tree-sitter
130
- // grammars (see #54, #81, #140). The previous behaviour was a soft
131
- // console.warn that scrolls off-screen before the OOM crash 30 seconds
132
- // later, leading to a steady stream of "what is this OOM" reports.
133
- // Hard-exit before any WASM work; allow override via env var for users
134
- // who patched V8 themselves or want to test a future fix.
135
86
  const nodeVersion = process.versions.node;
136
87
  const nodeMajor = parseInt(nodeVersion.split('.')[0] ?? '0', 10);
137
88
  if (nodeMajor >= 25) {
@@ -139,31 +90,15 @@ if (nodeMajor >= 25) {
139
90
  if (!process.env.CODEGRAPH_ALLOW_UNSAFE_NODE) {
140
91
  process.exit(1);
141
92
  }
142
- // Override active — banner shown for visibility, continuing.
143
93
  }
144
- // Enforce the supported Node floor. `engines` in package.json only *warns* on
145
- // install (unless engine-strict), so hard-block here to actually keep users off
146
- // unsupported versions. Mirrors the 25+ block above. See package.json `engines`.
147
94
  if (nodeMajor < node_version_check_1.MIN_NODE_MAJOR) {
148
95
  process.stderr.write((0, node_version_check_1.buildNodeTooOldBanner)(nodeVersion) + '\n');
149
96
  if (!process.env.CODEGRAPH_ALLOW_UNSAFE_NODE) {
150
97
  process.exit(1);
151
98
  }
152
- // Override active — banner shown for visibility, continuing.
153
99
  }
154
- // Re-exec with V8's `--liftoff-only` if it isn't already set, so tree-sitter's
155
- // large WASM grammars never hit the turboshaft Zone OOM (`Fatal process out of
156
- // memory: Zone`) on Node >= 22. No-op under the bundled launcher, which already
157
- // passes the flag. Must run before any grammar (in the parse worker, which
158
- // inherits this process's flags) is compiled. See ../extraction/wasm-runtime-flags.
159
100
  (0, wasm_runtime_flags_1.relaunchWithWasmRuntimeFlagsIfNeeded)(__filename);
160
- // Last-resort fatal handlers: log a bounded line and exit non-zero. A fault
161
- // that reaches here escaped every boundary, so the process is in an undefined
162
- // state — keeping it alive is what let the detached MCP daemon orphan and pin a
163
- // CPU core with no recovery (#799, #850). Installed before the command branch
164
- // so it also covers a synchronous throw during startup. See ./fatal-handler.
165
101
  (0, fatal_handler_1.installFatalHandlers)();
166
- // Check if running with no arguments - run installer
167
102
  if (process.argv.length === 2) {
168
103
  Promise.resolve().then(() => __importStar(require('../installer'))).then(({ runInstaller }) => runInstaller()).catch((err) => {
169
104
  console.error('Installation failed:', err instanceof Error ? err.message : String(err));
@@ -171,30 +106,16 @@ if (process.argv.length === 2) {
171
106
  });
172
107
  }
173
108
  else {
174
- // Normal CLI flow
175
109
  main();
176
110
  }
177
111
  function main() {
178
112
  const program = new commander_1.Command();
179
- // Version from package.json
180
113
  const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'));
181
- // Make the version trivial to reach. commander's `.version()` (below) wires up
182
- // `--version` and `-V`; intercept the spellings it can't — lowercase `-v` and
183
- // single-dash `-version` — before any parsing. (commander's version short flag
184
- // is the capital `-V`, and its parser rejects a multi-character single-dash
185
- // flag.) The bare `codegraph version` subcommand is registered further down so
186
- // the affordance also shows up in `codegraph --help`.
187
114
  const firstArg = process.argv[2];
188
115
  if (firstArg === '-v' || firstArg === '-version') {
189
116
  console.log(packageJson.version);
190
117
  return;
191
118
  }
192
- // =============================================================================
193
- // ANSI Color Helpers (avoid chalk ESM issues)
194
- // =============================================================================
195
- // `--color` / `--no-color` are global and position-independent — they were
196
- // already read by ansiColorsEnabled() at module load, so strip them before
197
- // commander parses (a subcommand would otherwise reject the unknown flag).
198
119
  process.argv = process.argv.filter((a) => a !== '--color' && a !== '--no-color');
199
120
  const colors = COLORS_ENABLED
200
121
  ? {
@@ -236,51 +157,28 @@ function main() {
236
157
  .name('codegraph')
237
158
  .description('Code intelligence and knowledge graph for any codebase')
238
159
  .version(packageJson.version)
239
- // Parsed manually before commander runs (any argv position works); declared
240
- // here so they show up in --help. NO_COLOR / FORCE_COLOR env vars are also
241
- // honored, and piped output defaults to no color (#1281).
242
160
  .option('--color', 'force ANSI colors even when stdout is not a TTY')
243
161
  .option('--no-color', 'disable ANSI colors (NO_COLOR env is also honored)');
244
- // Anonymous usage telemetry (see TELEMETRY.md): record the invoked subcommand
245
- // NAME only — never arguments or paths. Counts buffer locally; network sends
246
- // piggyback on commands that run long anyway (quick commands only append to
247
- // the local buffer at exit, costing nothing).
248
- // install/uninstall are absent on purpose: the installer flushes at its own
249
- // end, AFTER its consent prompt — a flush here would fire the first-run
250
- // notice before the user ever sees the toggle.
251
162
  const TELEMETRY_FLUSH_COMMANDS = new Set(['init', 'uninit', 'index', 'sync', 'upgrade']);
252
163
  program.hook('preAction', (_thisCommand, actionCommand) => {
253
164
  try {
254
- // The detached daemon re-invokes `serve --mcp` internally — not a user action.
255
165
  if (process.env.CODEGRAPH_DAEMON_INTERNAL)
256
166
  return;
257
167
  const name = actionCommand.name();
258
168
  if (name === 'telemetry')
259
- return; // managing telemetry is not usage
169
+ return;
260
170
  (0, telemetry_1.getTelemetry)().recordUsage('cli_command', name, true);
261
171
  if (TELEMETRY_FLUSH_COMMANDS.has(name))
262
172
  (0, telemetry_1.getTelemetry)().maybeFlush();
263
173
  }
264
174
  catch {
265
- /* telemetry must never break the CLI */
266
175
  }
267
176
  });
268
- // =============================================================================
269
- // Helper Functions
270
- // =============================================================================
271
- /**
272
- * Resolve project path from argument or current directory
273
- * Walks up parent directories to find nearest initialized CodeGraph project
274
- * (must have .codegraph/codegraph.db, not just .codegraph/lessons.db)
275
- */
276
177
  function resolveProjectPath(pathArg) {
277
178
  const absolutePath = path.resolve(pathArg || process.cwd());
278
- // If exact path is initialized (has codegraph.db), use it
279
179
  if ((0, directory_1.isInitialized)(absolutePath)) {
280
180
  return absolutePath;
281
181
  }
282
- // Walk up to find nearest parent with CodeGraph initialized
283
- // Note: findNearestCodeGraphRoot finds any .codegraph folder, but we need one with codegraph.db
284
182
  let current = absolutePath;
285
183
  const root = path.parse(current).root;
286
184
  while (current !== root) {
@@ -292,18 +190,11 @@ function main() {
292
190
  return current;
293
191
  }
294
192
  }
295
- // Not found - return original path (will fail later with helpful error)
296
193
  return absolutePath;
297
194
  }
298
- /**
299
- * Format a number with commas
300
- */
301
195
  function formatNumber(n) {
302
196
  return n.toLocaleString();
303
197
  }
304
- /**
305
- * Format duration in milliseconds to human readable
306
- */
307
198
  function formatDuration(ms) {
308
199
  if (ms < 1000) {
309
200
  return `${ms}ms`;
@@ -316,12 +207,6 @@ function main() {
316
207
  const remainingSeconds = seconds % 60;
317
208
  return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
318
209
  }
319
- // Shimmer progress renderer (runs in a worker thread for smooth animation)
320
- // Imported at top of file from '../ui/shimmer-progress'
321
- /**
322
- * Create a plain-text progress callback for --verbose mode.
323
- * No animations, no ANSI tricks — just timestamped lines to stdout.
324
- */
325
210
  function createVerboseProgress() {
326
211
  let lastPhase = '';
327
212
  let lastPct = -1;
@@ -335,56 +220,49 @@ function main() {
335
220
  }
336
221
  if (progress.total > 0) {
337
222
  const pct = Math.floor((progress.current / progress.total) * 100);
338
- // Log every 5% to keep output manageable
339
223
  if (pct >= lastPct + 5 || progress.current === progress.total) {
340
224
  lastPct = pct;
341
225
  console.log(`[${elapsed}s] ${progress.current}/${progress.total} (${pct}%)${progress.currentFile ? ` ${(0, glyphs_1.getGlyphs)().dash} ${progress.currentFile}` : ''}`);
342
226
  }
343
227
  }
344
228
  else if (progress.current > 0) {
345
- // Scanning phase (no total yet) — log periodically
346
229
  if (progress.current % 1000 === 0 || progress.current === 1) {
347
230
  console.log(`[${elapsed}s] ${formatNumber(progress.current)} files found`);
348
231
  }
349
232
  }
350
233
  };
351
234
  }
352
- /**
353
- * Print success message
354
- */
355
235
  function success(message) {
356
236
  console.log(chalk.green((0, glyphs_1.getGlyphs)().ok) + ' ' + message);
357
237
  }
358
- /**
359
- * Print error message
360
- */
361
238
  function error(message) {
362
239
  console.error(chalk.red((0, glyphs_1.getGlyphs)().err) + ' ' + message);
363
240
  }
364
- /**
365
- * Print info message
366
- */
367
241
  function info(message) {
368
242
  console.log(chalk.blue((0, glyphs_1.getGlyphs)().info) + ' ' + message);
369
243
  }
370
- /**
371
- * Print warning message
372
- */
373
244
  function warn(message) {
374
245
  console.log(chalk.yellow((0, glyphs_1.getGlyphs)().warn) + ' ' + message);
375
246
  }
376
- /** "not found" (+ optional did-you-mean) when no exact symbol matches. */
247
+ async function openIndexToRead(projectPath) {
248
+ const { default: CodeGraph } = await loadCodeGraph();
249
+ const cg = await CodeGraph.open(projectPath, { readOnly: true });
250
+ const { isRebuildInProgress } = await Promise.resolve().then(() => __importStar(require('../mcp/writer-lock')));
251
+ if (isRebuildInProgress(projectPath)) {
252
+ console.error(`${chalk.yellow((0, glyphs_1.getGlyphs)().warn)} An index rebuild ("codegraph index") is running in another process — this answer comes from the part of the index it has rebuilt so far.`);
253
+ }
254
+ return cg;
255
+ }
377
256
  function formatSymbolNotFound(symbol, fuzzyNames) {
378
257
  const suggestions = [...new Set(fuzzyNames.filter((n) => n !== symbol))].slice(0, 3);
379
258
  if (suggestions.length === 0)
380
259
  return `Symbol "${symbol}" not found`;
381
260
  return `Symbol "${symbol}" not found — did you mean: ${suggestions.join(', ')}?`;
382
261
  }
383
- /** Compact node shape retained by the CLI's existing JSON lists. */
384
262
  function cliNode(node) {
385
263
  return { name: node.name, kind: node.kind, filePath: node.filePath, startLine: node.startLine };
386
264
  }
387
- /** Attribute a group's edges to every overload of this definition. */
265
+ const CLI_CALL_SITES_SHOWN = 10;
388
266
  function cliDefinition(group) {
389
267
  const head = group[0];
390
268
  return {
@@ -392,23 +270,9 @@ function main() {
392
270
  roots: group.map((node) => node.id),
393
271
  };
394
272
  }
395
- /**
396
- * Print indexing results using clack log methods
397
- */
398
273
  function printIndexResult(clack, result, projectPath) {
399
274
  const hasErrors = result.filesErrored > 0;
400
275
  const parseWarnings = result.errors.filter((e) => e.code === 'parse_error' && e.severity === 'warning');
401
- // Surface non-file-level failures (e.g. lock-acquisition failure
402
- // when another indexer is running) before the file-count branches.
403
- // Without this the CLI falls through to "No files found to index",
404
- // which is actively misleading — the index DID run, it just couldn't
405
- // get the lock.
406
- //
407
- // If success is false but no severity:'error' entry exists in
408
- // `result.errors` (degenerate case — shouldn't happen in practice
409
- // but worth guarding because the result shape is plumbed through
410
- // multiple call sites), fall back to a generic message rather than
411
- // continuing to the misleading "No files found" branch or throwing.
412
276
  if (!result.success && !hasErrors && result.filesIndexed === 0) {
413
277
  const generic = result.errors.find((e) => e.severity === 'error');
414
278
  clack.log.error(generic?.message ?? `Indexing failed ${(0, glyphs_1.getGlyphs)().dash} no further details available`);
@@ -422,22 +286,12 @@ function main() {
422
286
  clack.log.success(`Indexed ${formatNumber(result.filesIndexed)} files`);
423
287
  }
424
288
  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
289
  for (const warning of parseWarnings) {
427
290
  clack.log.warn(warning.message);
428
291
  }
429
- // A PARTIAL index (files silently dropped mid-pipeline) must not pass
430
- // as a clean run — it's the difference between "indexed the repo" and
431
- // "indexed most of the repo, quietly". Only the completeness
432
- // reconciliation warning; per-file extractor warnings stay in the
433
- // error-code summary below.
434
292
  for (const w of result.errors.filter((e) => e.code === 'index_partial')) {
435
293
  clack.log.warn(w.message);
436
294
  }
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
295
  const salvaged = result.errors.filter((e) => e.code === 'salvaged_stripped');
442
296
  if (salvaged.length > 0) {
443
297
  const sample = salvaged.slice(0, 3).map((e) => e.filePath).filter(Boolean).join(', ');
@@ -449,11 +303,6 @@ function main() {
449
303
  clack.log.error(`Indexing failed ${(0, glyphs_1.getGlyphs)().dash} all ${formatNumber(result.filesErrored)} files had errors`);
450
304
  }
451
305
  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
306
  const top = (result.topUnsupportedExtensions ?? [])
458
307
  .map(e => `${e.ext} (${formatNumber(e.count)})`)
459
308
  .join(', ');
@@ -493,8 +342,6 @@ function main() {
493
342
  }
494
343
  }
495
344
  else if (projectPath) {
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
345
  if (result.errors.some((e) => e.code === 'salvaged_stripped')) {
499
346
  writeErrorLog(projectPath, result.errors);
500
347
  clack.log.info('See .codegraph/errors.log for details');
@@ -507,26 +354,16 @@ function main() {
507
354
  }
508
355
  }
509
356
  }
510
- /**
511
- * When an `init`/`index` produced an EMPTY graph and the reason is that the
512
- * project's own `.gitignore` excludes nested git repositories — the "super-repo
513
- * gitignores its child repos" layout (#1156), where `init` at the parent
514
- * correctly indexes ~nothing while `init` inside each child works — name those
515
- * repos and offer to index them. An interactive terminal gets a yes/no prompt
516
- * that writes `includeIgnored` to codegraph.json and re-indexes; a
517
- * non-interactive run just prints the one-line opt-in snippet. The caller gates
518
- * this on `nodesCreated === 0`, so a project that DID index real content is
519
- * never nagged about the gitignored reference clones it deliberately keeps out
520
- * (#970, #1065). Best-effort throughout: detection never breaks the command.
521
- */
522
357
  async function offerIndexIgnoredRepos(clack, projectPath, reindex, opts) {
523
358
  let repos;
359
+ let patterns;
524
360
  try {
525
- const { findUnindexedIgnoredRepos } = await Promise.resolve().then(() => __importStar(require('../extraction')));
361
+ const { findUnindexedIgnoredRepos, includeIgnoredPatternFor } = await Promise.resolve().then(() => __importStar(require('../extraction')));
526
362
  repos = findUnindexedIgnoredRepos(projectPath);
363
+ patterns = repos.map(includeIgnoredPatternFor);
527
364
  }
528
365
  catch {
529
- return; // detection is advisory — never let it break the command
366
+ return;
530
367
  }
531
368
  if (repos.length === 0)
532
369
  return;
@@ -535,7 +372,7 @@ function main() {
535
372
  const SHOWN = 6;
536
373
  const names = repos.slice(0, SHOWN).map((r) => r.replace(/\/$/, ''));
537
374
  const extra = repos.length > SHOWN ? ` (+${formatNumber(repos.length - SHOWN)} more)` : '';
538
- const snippet = `{ "includeIgnored": [${repos.map((p) => JSON.stringify(p)).join(', ')}] }`;
375
+ const snippet = `{ "includeIgnored": [${patterns.map((p) => JSON.stringify(p)).join(', ')}] }`;
539
376
  clack.log.warn(`Your .gitignore excludes ${isOne ? 'a nested git repository' : `${formatNumber(repos.length)} nested git repositories`} here, ` +
540
377
  `so ${isOne ? 'it was' : 'they were'} not indexed: ${names.join(', ')}${extra}.`);
541
378
  const manualHint = () => {
@@ -557,7 +394,7 @@ function main() {
557
394
  let added;
558
395
  try {
559
396
  const { addIncludeIgnoredPatterns } = await Promise.resolve().then(() => __importStar(require('../project-config')));
560
- added = addIncludeIgnoredPatterns(projectPath, repos);
397
+ added = addIncludeIgnoredPatterns(projectPath, patterns);
561
398
  }
562
399
  catch (err) {
563
400
  clack.log.error(`Could not update ${PROJECT_CONFIG_FILENAME}: ${err instanceof Error ? err.message : String(err)}`);
@@ -569,15 +406,11 @@ function main() {
569
406
  printIndexResult(clack, result, projectPath);
570
407
  return result;
571
408
  }
572
- /**
573
- * Write detailed error log to .codegraph/errors.log
574
- */
575
409
  function writeErrorLog(projectPath, errors) {
576
410
  const cgDir = (0, directory_1.getCodeGraphDir)(projectPath);
577
411
  if (!fs.existsSync(cgDir))
578
412
  return;
579
413
  const logPath = path.join(cgDir, 'errors.log');
580
- // Group errors by file path
581
414
  const errorsByFile = new Map();
582
415
  const noFileErrors = [];
583
416
  for (const err of errors) {
@@ -610,33 +443,31 @@ function main() {
610
443
  }
611
444
  fs.writeFileSync(logPath, lines.join('\n') + '\n');
612
445
  }
613
- /**
614
- * Telemetry for a completed full index (see TELEMETRY.md). The bounded flush
615
- * keeps init/index responsive (these commands just ran for seconds anyway)
616
- * while delivering the event promptly.
617
- */
618
446
  async function recordIndexTelemetry(cg, result) {
619
447
  (0, telemetry_1.recordIndexEvent)(cg, result);
620
448
  await (0, telemetry_1.getTelemetry)().flushNow();
621
449
  }
622
- // =============================================================================
623
- // Commands
624
- // =============================================================================
625
- /**
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.
632
- */
450
+ function applyLocalOnlyGitignore(clack, projectPath) {
451
+ const file = `${path.basename((0, directory_1.getCodeGraphDir)(projectPath))}/.gitignore`;
452
+ switch ((0, directory_1.makeGitignoreLocalOnly)(projectPath)) {
453
+ case 'written':
454
+ clack.log.success(`${file} now ignores itself, so nothing of CodeGraph's shows in git.`);
455
+ break;
456
+ case 'unchanged':
457
+ clack.log.info(`${file} already ignores itself.`);
458
+ break;
459
+ case 'customized':
460
+ clack.log.warn(`Left ${file} as it is because it has your own rules. A lone * in it would keep the whole folder out of git.`);
461
+ break;
462
+ case 'tracked':
463
+ clack.log.warn(`Left ${file} as it is because it is committed to this repository, so changing it would show up in git.`);
464
+ break;
465
+ }
466
+ }
633
467
  async function runInit(projectPath, options) {
634
468
  const clack = await importESM('@clack/prompts');
635
469
  clack.intro('Initializing CodeGraph');
636
470
  try {
637
- // Refuse to index your home directory / a filesystem root — it pulls in
638
- // caches, other projects, and your whole tree (a multi-GB index + watcher
639
- // churn, and on pre-1.0 macOS a machine-crashing fd blowup, #845).
640
471
  const unsafe = (0, directory_1.unsafeIndexRootReason)(projectPath);
641
472
  if (unsafe && !options.force) {
642
473
  clack.log.error(`Refusing to initialize in ${projectPath} — it looks like ${unsafe}.`);
@@ -648,11 +479,13 @@ function main() {
648
479
  if ((0, directory_1.isInitialized)(projectPath)) {
649
480
  clack.log.warn(`Already initialized in ${projectPath}`);
650
481
  clack.log.info('Use "codegraph index" to re-index or "codegraph sync" to update');
482
+ if (options.localOnly)
483
+ applyLocalOnlyGitignore(clack, projectPath);
651
484
  try {
652
485
  const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
653
486
  await offerWatchFallback(clack, projectPath, { yes: options.yes });
654
487
  }
655
- catch { /* non-fatal */ }
488
+ catch { }
656
489
  clack.outro('');
657
490
  return;
658
491
  }
@@ -670,21 +503,13 @@ function main() {
670
503
  const { default: CodeGraph, getDatabasePath } = await loadCodeGraph();
671
504
  const cg = await CodeGraph.init(projectPath, { index: false });
672
505
  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.
506
+ if (options.localOnly)
507
+ applyLocalOnlyGitignore(clack, projectPath);
675
508
  const dataDir = path.basename((0, directory_1.getCodeGraphDir)(projectPath));
676
509
  if (dataDir !== (0, directory_1.codeGraphDirName)()) {
677
510
  clack.log.info(`The index is in ${dataDir}/: this project is on a Windows drive, so WSL keeps its own index ` +
678
511
  `rather than share ${directory_1.DEFAULT_CODEGRAPH_DIR}/ with CodeGraph on Windows. Set CODEGRAPH_DIR to choose the name yourself.`);
679
512
  }
680
- // Indexing runs by default now. The legacy -i/--index flag is still
681
- // accepted (so existing muscle memory and scripts don't break) but is a
682
- // no-op — initializing always builds the initial index.
683
- // Supervise the index: self-terminate if orphaned or wedged (#999).
684
- // The DB + WAL paths let the liveness watchdog tell a slow store on
685
- // degraded storage from a true wedge (#1231).
686
- // A closure so we can re-run the exact same supervised, progress-rendered
687
- // index if the user opts gitignored child repos in below (#1156).
688
513
  const dbPath = getDatabasePath(projectPath);
689
514
  const runIndex = async () => {
690
515
  const supervision = (0, command_supervision_1.installCommandSupervision)('init', { progressPaths: [dbPath, `${dbPath}-wal`] });
@@ -705,11 +530,6 @@ function main() {
705
530
  const result = await runIndex();
706
531
  printIndexResult(clack, result, projectPath);
707
532
  await recordIndexTelemetry(cg, result);
708
- // An empty graph at a git super-repo usually means `.gitignore` excludes
709
- // the child repos that hold the code — surface them and offer to opt in
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).
713
533
  if (result.nodesCreated === 0) {
714
534
  await offerIndexIgnoredRepos(clack, projectPath, runIndex, { interactive: !options.yes });
715
535
  }
@@ -717,7 +537,7 @@ function main() {
717
537
  const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
718
538
  await offerWatchFallback(clack, projectPath, { yes: options.yes });
719
539
  }
720
- catch { /* non-fatal */ }
540
+ catch { }
721
541
  clack.outro('Done');
722
542
  cg.destroy();
723
543
  }
@@ -726,9 +546,6 @@ function main() {
726
546
  process.exit(1);
727
547
  }
728
548
  }
729
- /**
730
- * codegraph init [path]
731
- */
732
549
  program
733
550
  .command('init [path]')
734
551
  .description('Initialize CodeGraph in a project directory and build the initial index')
@@ -736,12 +553,10 @@ function main() {
736
553
  .option('-f, --force', 'Initialize even if the path looks like your home directory or a filesystem root')
737
554
  .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
738
555
  .option('-y, --yes', 'Non-interactive: skip every prompt and take the defaults (for scripts / CI / container bootstraps)')
556
+ .option('--local-only', 'Keep .codegraph/ out of git entirely: its .gitignore ignores itself too. Also converts an initialized project')
739
557
  .action(async (pathArg, options) => {
740
558
  await runInit(path.resolve(pathArg || process.cwd()), options);
741
559
  });
742
- /**
743
- * codegraph uninit [path]
744
- */
745
560
  program
746
561
  .command('uninit [path]')
747
562
  .description('Remove CodeGraph from a project (deletes .codegraph/ directory)')
@@ -754,7 +569,6 @@ function main() {
754
569
  return;
755
570
  }
756
571
  if (!options.force) {
757
- // Confirm with user
758
572
  const readline = await Promise.resolve().then(() => __importStar(require('readline')));
759
573
  const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
760
574
  const answer = await new Promise((resolve) => {
@@ -769,7 +583,6 @@ function main() {
769
583
  const { default: CodeGraph } = await loadCodeGraph();
770
584
  const cg = CodeGraph.openSync(projectPath);
771
585
  cg.uninitialize();
772
- // Clean up any git sync hooks we installed (no-op if none / not a repo).
773
586
  try {
774
587
  const { removeGitSyncHook } = await Promise.resolve().then(() => __importStar(require('../sync/git-hooks')));
775
588
  const removed = removeGitSyncHook(projectPath);
@@ -777,24 +590,19 @@ function main() {
777
590
  info(`Removed git ${removed.installed.join(', ')} sync hook${removed.installed.length > 1 ? 's' : ''}`);
778
591
  }
779
592
  }
780
- catch { /* non-fatal */ }
593
+ catch { }
781
594
  success(`Removed CodeGraph from ${projectPath}`);
782
- // Churn signal — and flush now, since after an uninit there may be no
783
- // "next run" to deliver it.
784
595
  try {
785
596
  (0, telemetry_1.getTelemetry)().recordLifecycle('uninstall', {});
786
597
  await (0, telemetry_1.getTelemetry)().flushNow();
787
598
  }
788
- catch { /* non-fatal */ }
599
+ catch { }
789
600
  }
790
601
  catch (err) {
791
602
  error(`Failed to uninitialize: ${err instanceof Error ? err.message : String(err)}`);
792
603
  process.exit(1);
793
604
  }
794
605
  });
795
- /**
796
- * codegraph index [path]
797
- */
798
606
  program
799
607
  .command('index [path]')
800
608
  .description('Rebuild the full index from scratch (same result as a fresh init)')
@@ -802,16 +610,8 @@ function main() {
802
610
  .option('-q, --quiet', 'Suppress progress output')
803
611
  .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
804
612
  .action(async (pathArg, options) => {
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
613
  const projectPath = pathArg ? path.resolve(pathArg) : resolveProjectPath();
812
614
  try {
813
- // Don't (re)index your home directory / a filesystem root (#845). --force
814
- // doubles as the override.
815
615
  const unsafe = (0, directory_1.unsafeIndexRootReason)(projectPath);
816
616
  if (unsafe && !options.force) {
817
617
  error(`Refusing to index ${projectPath} — it looks like ${unsafe}. Pass --force to override.`);
@@ -833,39 +633,22 @@ function main() {
833
633
  if (rebuild.kind === 'taken')
834
634
  throw new Error('Another index rebuild is already in progress.');
835
635
  try {
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 });
636
+ const { stopDaemonAt, daemonStopFailureMessage } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
637
+ const realRoot = fs.realpathSync(projectPath);
638
+ const daemonStop = await stopDaemonAt(realRoot, { preserveUnverified: true });
840
639
  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`.');
640
+ throw new Error(await daemonStopFailureMessage(realRoot, daemonStop));
842
641
  }
843
- // Keep the writer slot through recreation AND indexing. A reconnecting
844
- // proxy/daemon must not open the replacement database halfway through.
845
642
  const writer = tryAcquireWriterLock(projectPath, 'rebuild');
846
643
  if (writer.kind === 'taken')
847
644
  throw new Error(writerLockHeldMessage(writer.existing, writer.pidPath));
848
645
  try {
849
646
  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
647
  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
648
  const dbPath = getDatabasePath(projectPath);
865
649
  const supervision = (0, command_supervision_1.installCommandSupervision)('index', { progressPaths: [dbPath, `${dbPath}-wal`] });
866
650
  try {
867
651
  if (options.quiet) {
868
- // Quiet mode: no UI, just run against the freshly-recreated graph.
869
652
  const result = await cg.indexAll();
870
653
  if (!result.success)
871
654
  process.exit(1);
@@ -873,8 +656,6 @@ function main() {
873
656
  }
874
657
  const clack = await importESM('@clack/prompts');
875
658
  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
659
  const renderIndex = async () => {
879
660
  if (options.verbose) {
880
661
  return await cg.indexAll({ onProgress: createVerboseProgress(), verbose: true });
@@ -888,8 +669,6 @@ function main() {
888
669
  const result = await renderIndex();
889
670
  printIndexResult(clack, result, projectPath);
890
671
  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
672
  let finalResult = result;
894
673
  if (result.nodesCreated === 0) {
895
674
  finalResult = (await offerIndexIgnoredRepos(clack, projectPath, renderIndex, { interactive: true })) ?? result;
@@ -917,9 +696,6 @@ function main() {
917
696
  process.exit(1);
918
697
  }
919
698
  });
920
- /**
921
- * codegraph sync [path]
922
- */
923
699
  program
924
700
  .command('sync [path]')
925
701
  .description('Sync changes since last index')
@@ -948,8 +724,9 @@ function main() {
948
724
  onProgress: progress.onProgress,
949
725
  }).finally(() => progress.stop());
950
726
  const totalChanges = result.filesAdded + result.filesModified + result.filesRemoved;
727
+ const staleIndex = cg.isIndexStale();
951
728
  if (totalChanges === 0 && !result.pendingRefsProcessed) {
952
- clack.log.info('Already up to date');
729
+ clack.log.info(staleIndex ? 'No files changed' : 'Already up to date');
953
730
  }
954
731
  else if (totalChanges > 0) {
955
732
  clack.log.success(`Synced ${formatNumber(totalChanges)} changed files`);
@@ -967,6 +744,9 @@ function main() {
967
744
  ? ` (${formatNumber(result.pendingRefsUnresolved)} unresolved)` : '';
968
745
  clack.log.info(`Resolved ${formatNumber(result.pendingRefsResolved ?? 0)} pending references${unresolved}`);
969
746
  }
747
+ if (staleIndex) {
748
+ clack.log.warn('This index was built by an older CodeGraph engine, and sync only re-reads changed files. Run "codegraph index" for a full rebuild.');
749
+ }
970
750
  clack.outro('Done');
971
751
  }
972
752
  finally {
@@ -980,22 +760,37 @@ function main() {
980
760
  process.exit(1);
981
761
  }
982
762
  });
983
- /**
984
- * codegraph status [path]
985
- */
763
+ function samplePaths(paths) {
764
+ return paths.slice(0, 3).join(', ') + (paths.length > 3 ? ` (+${formatNumber(paths.length - 3)} more)` : '');
765
+ }
766
+ function describeFilesMissingSymbols(health) {
767
+ const dash = (0, glyphs_1.getGlyphs)().dash;
768
+ const lines = [];
769
+ const reindex = health.needsReindex.length;
770
+ if (reindex > 0) {
771
+ lines.push(`${formatNumber(reindex)} ${reindex === 1 ? 'file is missing its' : 'files are missing their'} symbols ${dash} ` +
772
+ `run "codegraph sync" to re-index ${reindex === 1 ? 'it' : 'them'}: ${samplePaths(health.needsReindex)}`);
773
+ }
774
+ const unparsed = health.parseErrors.length;
775
+ if (unparsed > 0) {
776
+ lines.push(`${formatNumber(unparsed)} ${unparsed === 1 ? 'file could not be parsed, so its symbols are' : 'files could not be parsed, so their symbols are'} ` +
777
+ `missing: ${samplePaths(health.parseErrors)} ${dash} "codegraph files --json" shows the errors`);
778
+ }
779
+ return lines;
780
+ }
986
781
  program
987
782
  .command('status [path]')
988
783
  .description('Show index status and statistics')
989
784
  .option('-j, --json', 'Output as JSON')
785
+ .option('--strict', 'Exit 1 unless the index is finished, up to date, and every language that should yield symbols did')
990
786
  .action(async (pathArg, options) => {
991
787
  const projectPath = resolveProjectPath(pathArg);
992
- // The directory the user actually ran from, before walking up to the index
993
- // root. Used to detect when the resolved index lives in a different git
994
- // working tree (e.g. a nested worktree borrowing the main checkout's index).
995
788
  const startPath = path.resolve(pathArg || process.cwd());
996
789
  const worktreeMismatch = (0, worktree_1.detectWorktreeIndexMismatch)(startPath, projectPath);
997
790
  try {
998
791
  if (!(0, directory_1.isInitialized)(projectPath)) {
792
+ if (options.strict)
793
+ process.exitCode = 1;
999
794
  if (options.json) {
1000
795
  console.log(JSON.stringify({
1001
796
  initialized: false,
@@ -1013,18 +808,28 @@ function main() {
1013
808
  return;
1014
809
  }
1015
810
  const { default: CodeGraph } = await loadCodeGraph();
1016
- const cg = await CodeGraph.open(projectPath);
811
+ const cg = await CodeGraph.open(projectPath, { readOnly: true });
812
+ const { isRebuildInProgress } = await Promise.resolve().then(() => __importStar(require('../mcp/writer-lock')));
813
+ const rebuildInProgress = isRebuildInProgress(projectPath);
1017
814
  const stats = cg.getStats();
1018
815
  const changes = cg.getChangedFiles();
1019
816
  const backend = cg.getBackend();
1020
817
  const journalMode = cg.getJournalMode();
1021
818
  const buildInfo = cg.getIndexBuildInfo();
1022
819
  const reindexRecommended = cg.isIndexStale();
820
+ const frameworkChanges = cg.getFrameworkChangesSinceIndex();
1023
821
  const indexState = cg.getIndexState();
1024
- // Zero on a healthy index; non-zero at rest means a resolution pass was
1025
- // interrupted, so some files' call edges are missing (#1187).
1026
822
  const pendingRefs = cg.getPendingReferenceCount();
1027
- // JSON output mode
823
+ const health = cg.getIndexHealth();
824
+ const coverage = cg.getLanguageCoverage();
825
+ const totalChanges = changes.added.length + changes.modified.length + changes.removed.length;
826
+ if (options.strict && (rebuildInProgress ||
827
+ indexState === 'indexing' || indexState === 'partial' || indexState === 'failed' ||
828
+ totalChanges > 0 ||
829
+ health.needsReindex.length > 0 ||
830
+ coverage.unparsedLanguages.length > 0)) {
831
+ process.exitCode = 1;
832
+ }
1028
833
  if (options.json) {
1029
834
  const lastIndexedMs = cg.getLastIndexedAt();
1030
835
  console.log(JSON.stringify({
@@ -1042,6 +847,9 @@ function main() {
1042
847
  journalMode,
1043
848
  nodesByKind: stats.nodesByKind,
1044
849
  languages: Object.entries(stats.filesByLanguage).filter(([, count]) => count > 0).map(([lang]) => lang),
850
+ filesByLanguage: stats.filesByLanguage,
851
+ parsedFilesByLanguage: coverage.parsedFilesByLanguage,
852
+ unparsedLanguages: coverage.unparsedLanguages,
1045
853
  pendingChanges: {
1046
854
  added: changes.added.length,
1047
855
  modified: changes.modified.length,
@@ -1050,31 +858,31 @@ function main() {
1050
858
  worktreeMismatch: worktreeMismatch
1051
859
  ? { worktreeRoot: worktreeMismatch.worktreeRoot, indexRoot: worktreeMismatch.indexRoot }
1052
860
  : null,
861
+ rebuildInProgress,
1053
862
  index: {
1054
863
  builtWithVersion: buildInfo.version,
1055
864
  builtWithExtractionVersion: buildInfo.extractionVersion,
1056
865
  currentExtractionVersion: extraction_version_1.EXTRACTION_VERSION,
1057
- reindexRecommended,
1058
- // 'complete' | 'partial' (files silently dropped) | 'indexing'
1059
- // (a run was killed mid-index — the index is truncated) |
1060
- // 'failed' | null (predates the marker).
866
+ reindexRecommended: reindexRecommended || frameworkChanges !== null,
867
+ frameworksChangedSinceIndex: frameworkChanges,
1061
868
  state: indexState,
1062
- // References awaiting resolution. Non-zero at rest means an
1063
- // interrupted resolution pass left edges missing; the next
1064
- // sync sweeps them (#1187).
1065
869
  pendingRefs,
870
+ filesNeedingReindex: health.needsReindex.length,
871
+ filesWithParseErrors: health.parseErrors.length,
1066
872
  },
1067
873
  }));
1068
874
  cg.destroy();
1069
875
  return;
1070
876
  }
1071
877
  console.log(chalk.bold('\nCodeGraph Status\n'));
1072
- // Project info
1073
878
  console.log(chalk.cyan('Project:'), projectPath);
1074
879
  if (worktreeMismatch) {
1075
880
  warn((0, worktree_1.worktreeMismatchWarning)(worktreeMismatch));
1076
881
  }
1077
- if (indexState === 'indexing') {
882
+ if (rebuildInProgress) {
883
+ warn('An index rebuild ("codegraph index") is running in another process — the statistics below are a snapshot of it.');
884
+ }
885
+ else if (indexState === 'indexing') {
1078
886
  warn('The last index run never finished (killed mid-index?) — the index is truncated. Re-run "codegraph index".');
1079
887
  }
1080
888
  else if (indexState === 'partial') {
@@ -1083,43 +891,31 @@ function main() {
1083
891
  else if (indexState === 'failed') {
1084
892
  warn('The last index run failed — results may be incomplete. Re-run "codegraph index".');
1085
893
  }
1086
- if (pendingRefs > 0) {
894
+ if (pendingRefs > 0 && !rebuildInProgress) {
1087
895
  warn(`${formatNumber(pendingRefs)} references from an interrupted run are awaiting resolution — some callers/impact edges are missing. Run "codegraph sync" to resolve them.`);
1088
896
  }
1089
897
  console.log();
1090
- // Index stats
1091
898
  console.log(chalk.bold('Index Statistics:'));
1092
899
  console.log(` Files: ${formatNumber(stats.fileCount)}`);
1093
900
  console.log(` Nodes: ${formatNumber(stats.nodeCount)}`);
1094
901
  console.log(` Edges: ${formatNumber(stats.edgeCount)}`);
1095
902
  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
903
  if (stats.walSizeBytes > 0) {
1101
904
  const { WAL_HEAL_THRESHOLD_BYTES } = await Promise.resolve().then(() => __importStar(require('../db/index')));
1102
905
  const oversized = stats.walSizeBytes > Math.max(WAL_HEAL_THRESHOLD_BYTES, stats.dbSizeBytes);
1103
906
  const walLabel = `${(stats.walSizeBytes / 1024 / 1024).toFixed(2)} MB`;
1104
907
  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.');
908
+ if (oversized && !rebuildInProgress) {
909
+ warn('The write-ahead log is larger than the database — killed sessions left it behind. The next "codegraph sync" reclaims it; if it persists after that, another live CodeGraph process is holding it.');
1107
910
  }
1108
911
  }
1109
- // Surface the active SQLite backend (node:sqlite — Node's built-in real
1110
- // SQLite, full WAL + FTS5, no native build).
1111
912
  const backendLabel = chalk.green(`node:sqlite ${(0, glyphs_1.getGlyphs)().dash} built-in (full WAL)`);
1112
913
  console.log(` Backend: ${backendLabel}`);
1113
- // Effective journal mode: 'wal' means concurrent reads never block on a
1114
- // writer; anything else means they can ("database is locked"). node:sqlite
1115
- // supports WAL everywhere, so a non-wal mode means the filesystem can't
1116
- // (network mounts, WSL2 /mnt). See issue #238.
1117
914
  const journalLabel = journalMode === 'wal'
1118
915
  ? chalk.green('wal')
1119
916
  : chalk.yellow(`${journalMode || 'unknown'} ${(0, glyphs_1.getGlyphs)().dash} WAL inactive; reads can block on writes`);
1120
917
  console.log(` Journal: ${journalLabel}`);
1121
918
  console.log();
1122
- // Node breakdown
1123
919
  console.log(chalk.bold('Nodes by Kind:'));
1124
920
  const nodesByKind = Object.entries(stats.nodesByKind)
1125
921
  .filter(([, count]) => count > 0)
@@ -1128,17 +924,28 @@ function main() {
1128
924
  console.log(` ${kind.padEnd(15)} ${formatNumber(count)}`);
1129
925
  }
1130
926
  console.log();
1131
- // Language breakdown
1132
927
  console.log(chalk.bold('Files by Language:'));
1133
928
  const filesByLang = Object.entries(stats.filesByLanguage)
1134
929
  .filter(([, count]) => count > 0)
1135
930
  .sort((a, b) => b[1] - a[1]);
1136
931
  for (const [lang, count] of filesByLang) {
1137
- console.log(` ${lang.padEnd(15)} ${formatNumber(count)}`);
932
+ const parsed = coverage.parsedFilesByLanguage[lang];
933
+ const withSymbols = parsed === undefined || parsed === count ? '' : ` (${formatNumber(parsed)} with symbols)`;
934
+ console.log(` ${lang.padEnd(15)} ${formatNumber(count)}${chalk.dim(withSymbols)}`);
1138
935
  }
1139
936
  console.log();
1140
- // Pending changes
1141
- const totalChanges = changes.added.length + changes.modified.length + changes.removed.length;
937
+ if (rebuildInProgress) {
938
+ cg.destroy();
939
+ return;
940
+ }
941
+ if (coverage.unparsedLanguages.length > 0) {
942
+ const files = cg.getFiles();
943
+ for (const language of coverage.unparsedLanguages) {
944
+ const paths = files.filter((file) => file.language === language).map((file) => file.path);
945
+ warn(`No symbols came from any ${language} file ${(0, glyphs_1.getGlyphs)().dash} fine if they hold no code, otherwise its parser isn't working: ${samplePaths(paths)}`);
946
+ }
947
+ console.log();
948
+ }
1142
949
  if (totalChanges > 0) {
1143
950
  console.log(chalk.bold('Pending Changes:'));
1144
951
  if (changes.added.length > 0) {
@@ -1152,16 +959,26 @@ function main() {
1152
959
  }
1153
960
  info('Run "codegraph sync" to update the index');
1154
961
  }
1155
- else {
962
+ const missingSymbols = describeFilesMissingSymbols(health);
963
+ for (const line of missingSymbols)
964
+ warn(line);
965
+ if (totalChanges === 0 && missingSymbols.length === 0) {
1156
966
  success('Index is up to date');
1157
967
  }
1158
968
  console.log();
1159
- // Re-index hint: the index was built by an older engine than the one now
1160
- // running, so a rebuild would add data a migration can't backfill.
1161
969
  if (reindexRecommended) {
1162
970
  const builtWith = buildInfo.version ? `v${buildInfo.version.replace(/^v/, '')}` : 'an earlier version';
1163
971
  warn(`Index was built by ${builtWith}; re-index to pick up this engine's improvements.`);
1164
- info('Run "codegraph index" (full rebuild) or "codegraph sync"');
972
+ info('Run "codegraph index" for a full rebuild');
973
+ console.log();
974
+ }
975
+ if (frameworkChanges) {
976
+ const changed = [
977
+ ...(frameworkChanges.added.length > 0 ? [`added ${frameworkChanges.added.join(', ')}`] : []),
978
+ ...(frameworkChanges.removed.length > 0 ? [`removed ${frameworkChanges.removed.join(', ')}`] : []),
979
+ ].join('; ');
980
+ warn(`Frameworks changed since the last full index (${changed}); files indexed before then were read without the change.`);
981
+ info('Run "codegraph index" to re-index every file with them');
1165
982
  console.log();
1166
983
  }
1167
984
  cg.destroy();
@@ -1171,9 +988,6 @@ function main() {
1171
988
  process.exit(1);
1172
989
  }
1173
990
  });
1174
- /**
1175
- * codegraph query <search>
1176
- */
1177
991
  program
1178
992
  .command('query <search>')
1179
993
  .description('Search for symbols in the codebase')
@@ -1188,18 +1002,12 @@ function main() {
1188
1002
  error(`CodeGraph not initialized in ${projectPath}`);
1189
1003
  process.exit(1);
1190
1004
  }
1191
- const { default: CodeGraph } = await loadCodeGraph();
1192
- const cg = await CodeGraph.open(projectPath);
1005
+ const cg = await openIndexToRead(projectPath);
1193
1006
  const limit = parseInt(options.limit || '10', 10);
1194
1007
  const rawResults = cg.searchNodes(search, {
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
1008
  limit: limit + 1,
1198
1009
  kinds: options.kind ? [options.kind] : undefined,
1199
1010
  });
1200
- // Mirror the MCP search down-rank so the CLI also surfaces the
1201
- // hand-written implementation before protobuf/gRPC scaffolding
1202
- // when both share a name. See extraction/generated-detection.ts.
1203
1011
  const isGen = cg.generatedFilePredicate(rawResults.map((r) => r.node.filePath));
1204
1012
  const rankedResults = [...rawResults].sort((a, b) => {
1205
1013
  const aGen = isGen(a.node.filePath) ? 1 : 0;
@@ -1220,11 +1028,6 @@ function main() {
1220
1028
  }
1221
1029
  else {
1222
1030
  console.log(chalk.bold(`\nSearch Results for "${search}":\n`));
1223
- // Results arrive already ranked by relevance, so the order conveys
1224
- // it. We don't print the raw score: it's an unbounded BM25/FTS value
1225
- // (relative-ranking only), and the old `(score * 100)%` rendered it
1226
- // as nonsensical percentages like "12042%" (#1045). The MCP search
1227
- // tool likewise shows no score. Raw `score` stays in --json output.
1228
1031
  for (const result of results) {
1229
1032
  const node = result.node;
1230
1033
  const location = `${node.filePath}:${node.startLine}`;
@@ -1247,15 +1050,6 @@ function main() {
1247
1050
  process.exit(1);
1248
1051
  }
1249
1052
  });
1250
- /**
1251
- * codegraph explore <query...>
1252
- *
1253
- * The CLI face of the MCP codegraph_explore tool — same handler, same
1254
- * output (source of the relevant symbols grouped by file + the call path
1255
- * among them). Exists so agents WITHOUT the MCP tools — Task-tool
1256
- * subagents (which don't inherit MCP tools, #704) and non-MCP harnesses —
1257
- * can reach the graph through a plain shell command.
1258
- */
1259
1053
  program
1260
1054
  .command('explore <query...>')
1261
1055
  .description('Explore an area: relevant symbols\' source + call paths in one shot (same output as the codegraph_explore MCP tool)')
@@ -1268,8 +1062,7 @@ function main() {
1268
1062
  error(`CodeGraph isn't available here — no .codegraph/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable CodeGraph with 'codegraph init'.)`);
1269
1063
  process.exit(1);
1270
1064
  }
1271
- const { default: CodeGraph } = await loadCodeGraph();
1272
- const cg = await CodeGraph.open(projectPath);
1065
+ const cg = await openIndexToRead(projectPath);
1273
1066
  const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
1274
1067
  const handler = new ToolHandler(cg);
1275
1068
  const args = { query: queryParts.join(' ') };
@@ -1286,15 +1079,6 @@ function main() {
1286
1079
  process.exit(1);
1287
1080
  }
1288
1081
  });
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
1082
  program
1299
1083
  .command('context <task...>')
1300
1084
  .description('Build context for a task: relevant symbols, relationships, and code blocks')
@@ -1322,16 +1106,12 @@ function main() {
1322
1106
  error(`CodeGraph not initialized in ${projectPath}`);
1323
1107
  process.exit(1);
1324
1108
  }
1325
- const { default: CodeGraph } = await loadCodeGraph();
1326
- const cg = await CodeGraph.open(projectPath);
1109
+ const cg = await openIndexToRead(projectPath);
1327
1110
  const result = await cg.buildContext(taskParts.join(' '), {
1328
1111
  format,
1329
1112
  includeCode: options.code !== false,
1330
1113
  ...(maxNodes !== undefined ? { maxNodes } : {}),
1331
1114
  });
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
1115
  console.log(typeof result === 'string' ? result : JSON.stringify(result, null, 2));
1336
1116
  cg.destroy();
1337
1117
  }
@@ -1340,31 +1120,15 @@ function main() {
1340
1120
  process.exit(1);
1341
1121
  }
1342
1122
  });
1343
- /**
1344
- * codegraph prompt-hook (hidden)
1345
- *
1346
- * A Claude Code `UserPromptSubmit` hook entry point. Reads `{prompt, cwd}` JSON
1347
- * on stdin; for a structural/flow/impact prompt it runs `codegraph_explore` on
1348
- * the indexed project and prints the result to stdout, which Claude injects into
1349
- * the agent's context — so the agent's reflex grep/read has nothing left to find
1350
- * and reliably uses CodeGraph (the adoption problem). Installed by the installer
1351
- * into Claude's settings.json (opt-in, default-yes).
1352
- *
1353
- * LOAD-BEARING: this must NEVER break the user's prompt. Every failure path —
1354
- * kill-switch, non-structural prompt, no index, engine error — exits 0 with no
1355
- * output. The only effect is additive context when it can confidently provide it.
1356
- */
1357
1123
  program
1358
1124
  .command('prompt-hook', { hidden: true })
1359
1125
  .description('Claude UserPromptSubmit hook: inject CodeGraph context for structural prompts (reads {prompt,cwd} JSON on stdin)')
1360
1126
  .action(async () => {
1361
1127
  try {
1362
- // Kill-switch: lets a user disable the nudge without uninstalling /
1363
- // editing settings.json (CI, low-power machines, personal preference).
1364
1128
  if (process.env.CODEGRAPH_NO_PROMPT_HOOK === '1' || process.env.CODEGRAPH_PROMPT_HOOK === '0')
1365
1129
  return;
1366
1130
  if (process.stdin.isTTY)
1367
- return; // invoked by hand, no piped payload
1131
+ return;
1368
1132
  const raw = await new Promise((resolve) => {
1369
1133
  let data = '';
1370
1134
  process.stdin.setEncoding('utf8');
@@ -1379,34 +1143,15 @@ function main() {
1379
1143
  catch {
1380
1144
  return;
1381
1145
  }
1382
- const prompt = String(input.prompt || '');
1383
- // System-injected task notifications and subagent hand-backs are not
1384
- // user prompts: exit before any project lookup or explore work (#1832,
1385
- // #2184).
1386
- if ((0, directory_1.isTaskNotification)(prompt) || (0, directory_1.isAgentMessage)(prompt))
1146
+ const prompt = (0, directory_1.stripSystemReminders)(String(input.prompt || ''));
1147
+ if (!prompt || (0, directory_1.isTaskNotification)(prompt) || (0, directory_1.isAgentMessage)(prompt) || (0, directory_1.isCrossSessionMessage)(prompt))
1387
1148
  return;
1388
- // Gate telemetry: how often each tier fires vs. no-ops — counter names
1389
- // only, NEVER prompt content (see TELEMETRY.md). This is the data that
1390
- // turns "is the gate any good" from vibes into a measured recall rate.
1391
1149
  const gate = (outcome) => {
1392
1150
  try {
1393
1151
  (0, telemetry_1.getTelemetry)().recordUsage('cli_command', `prompt-hook-gate-${outcome}`, true);
1394
1152
  }
1395
- catch { /* never break the hook */ }
1153
+ catch { }
1396
1154
  };
1397
- // Gate, tiered by confidence (#994, #1126):
1398
- // HIGH — a structural keyword (any covered language), or a code-shaped
1399
- // token verified in the index → full explore injection.
1400
- // MEDIUM — no keyword/token, but prose words match indexed symbol-name
1401
- // SEGMENTS ("state machine" → OrderStateMachine, in any
1402
- // language): inject a short list of the matching symbols and
1403
- // let the AGENT write the explore query — the graph-derived
1404
- // tier, no vocabulary involved.
1405
- // silent — nothing verified. Every other prompt ("fix this typo")
1406
- // stays a zero-cost no-op.
1407
- // Keywords fire on their own; a token or prose word is only a CANDIDATE
1408
- // verified against the graph below, so a tech brand ("JavaScript") that
1409
- // merely looks like code doesn't inject spurious context.
1410
1155
  const keyworded = (0, directory_1.hasStructuralKeyword)(prompt);
1411
1156
  const codeTokens = keyworded ? [] : (0, directory_1.extractCodeTokens)(prompt);
1412
1157
  const proseWords = keyworded ? [] : (0, identifier_segments_1.extractProseCandidates)(prompt);
@@ -1414,33 +1159,23 @@ function main() {
1414
1159
  gate('noop-shape');
1415
1160
  return;
1416
1161
  }
1417
- // Decide what to inject, shaped by WHERE the index(es) are: the nearest
1418
- // indexed ancestor of cwd, or — when cwd is an un-indexed workspace root
1419
- // whose indexed project(s) live in sub-dirs (the monorepo case, #964) —
1420
- // the sub-project the prompt points at, plus a `projectPath` nudge for any
1421
- // others. Without the down-scan the hook injected nothing at a monorepo
1422
- // root (it only walked up), so the validated adoption lever never fired
1423
- // exactly where the agent most needs it.
1424
1162
  const plan = (0, directory_1.planFrontload)(String(input.cwd || process.cwd()), prompt);
1425
1163
  if (!plan.exploreRoot && plan.nudgeProjects.length === 0) {
1426
1164
  gate('noop-no-index');
1427
1165
  return;
1428
- } // nothing reachable — the agent's normal tools apply
1429
- // A "pass projectPath" line for indexed sub-projects we did NOT front-load.
1430
- // Follow-up codegraph_explore calls against a sub-project (cwd isn't its
1431
- // index root) need an explicit projectPath, so spell it out.
1166
+ }
1432
1167
  const nudge = (projects, lead) => `${lead}\n${projects.map((p) => ` - projectPath: "${p}"`).join('\n')}\n`;
1433
1168
  if (plan.exploreRoot) {
1434
- const { default: CodeGraph } = await loadCodeGraph();
1435
- const cg = await CodeGraph.open(plan.exploreRoot);
1169
+ const { isRebuildInProgress } = await Promise.resolve().then(() => __importStar(require('../mcp/writer-lock')));
1170
+ if (isRebuildInProgress(plan.exploreRoot)) {
1171
+ gate('noop-rebuild');
1172
+ return;
1173
+ }
1174
+ const cg = await openIndexToRead(plan.exploreRoot);
1436
1175
  try {
1437
1176
  const others = plan.nudgeProjects.length
1438
1177
  ? `\n${nudge(plan.nudgeProjects, 'Other indexed projects in this workspace — pass projectPath to query them:')}`
1439
1178
  : '';
1440
- // Tier decision against THIS index (issue #994 follow-up: candidates
1441
- // must be real here — a brand name or prose about another domain
1442
- // must not inject). Keyword-bearing prompts skip verification — the
1443
- // keyword is signal enough.
1444
1179
  const tokenVerified = !keyworded && codeTokens.some((t) => cg.getNodesByName(t).length > 0);
1445
1180
  if (keyworded || tokenVerified) {
1446
1181
  const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
@@ -1448,13 +1183,7 @@ function main() {
1448
1183
  const result = await handler.execute('codegraph_explore', { query: prompt });
1449
1184
  const text = result.content[0]?.text ?? '';
1450
1185
  if (!result.isError && text.trim()) {
1451
- // Cap the injection so a large-repo explore can't flood the prompt.
1452
- // Claude Code shows hook stdout inline only up to 10,000 characters;
1453
- // above that it persists the output to a file and the model sees a
1454
- // 2 KB preview (#1694). PROMPT_HOOK_INJECTION_MAX (9,000) leaves
1455
- // room for the wrapper and the projectPath nudge lines below.
1456
1186
  const body = (0, directory_1.capPromptHookInjection)(text);
1457
- // For a front-loaded SUB-project, a follow-up explore needs its path.
1458
1187
  const more = plan.viaSubScan
1459
1188
  ? `call codegraph_explore with projectPath: "${plan.exploreRoot}" for more`
1460
1189
  : 'call codegraph_explore for more';
@@ -1462,26 +1191,10 @@ function main() {
1462
1191
  gate(keyworded ? 'high-keyword' : 'high-token');
1463
1192
  }
1464
1193
  else {
1465
- // A high-* outcome must mean context was actually delivered —
1466
- // the funnel's noop-vs-high split is how gate recall is
1467
- // measured (#1143). An explore error or empty result is a
1468
- // delivery failure, not a gate success.
1469
1194
  gate(keyworded ? 'noop-explore-keyword' : 'noop-explore-token');
1470
1195
  }
1471
1196
  return;
1472
1197
  }
1473
- // MEDIUM: prose words → symbol-name segments, co-occurrence/rarity
1474
- // scored, each hit re-verified to exist (see getSegmentMatches). The
1475
- // payload names the symbols but does NOT run explore — the agent owns
1476
- // the query where the hook's confidence is only "these are related".
1477
- //
1478
- // A database indexed before the vocab table existed starts with it
1479
- // EMPTY, and only sync() backfills it — which this hook never runs
1480
- // (#1142). Heal it here: on a populated vocab this is one SELECT;
1481
- // the actual backfill is a one-time batched pass whose cost the MCP
1482
- // server's own catch-up sync usually pays first (it runs at every
1483
- // session start). A distinct noop outcome keeps a dormant vocab
1484
- // from polluting the noop-unverified recall signal.
1485
1198
  const vocabReady = await cg.healSegmentVocabIfEmpty().catch(() => false);
1486
1199
  if (!vocabReady) {
1487
1200
  gate('noop-vocab-empty');
@@ -1509,8 +1222,6 @@ function main() {
1509
1222
  }
1510
1223
  }
1511
1224
  else {
1512
- // Several indexed sub-projects, none a clear match — don't guess; tell
1513
- // the agent they exist and how to query one.
1514
1225
  process.stdout.write(`<codegraph_context note="CodeGraph is available for this workspace's indexed sub-projects — query one by passing projectPath to codegraph_explore.">\n` +
1515
1226
  nudge(plan.nudgeProjects, "This workspace's CodeGraph indexes live in sub-projects. To use CodeGraph, call codegraph_explore with the projectPath of the relevant one:") +
1516
1227
  `</codegraph_context>\n`);
@@ -1518,19 +1229,8 @@ function main() {
1518
1229
  }
1519
1230
  }
1520
1231
  catch {
1521
- // Degradable by contract: never surface an error to the prompt pipeline.
1522
1232
  }
1523
1233
  });
1524
- /**
1525
- * codegraph node [name]
1526
- *
1527
- * The CLI face of the MCP codegraph_node tool: one symbol's source +
1528
- * caller/callee trail, or a whole file with line numbers + dependents
1529
- * (Read-parity). Same subagent/non-MCP rationale as `explore`.
1530
- *
1531
- * `name` is OPTIONAL because `--file` (file-read mode) carries no symbol —
1532
- * a required `<name>` made `codegraph node -f <file>` unreachable (#1044).
1533
- */
1534
1234
  program
1535
1235
  .command('node [name]')
1536
1236
  .description('One symbol\'s source + caller/callee trail, or read a file with line numbers + dependents (same output as the codegraph_node MCP tool)')
@@ -1540,9 +1240,6 @@ function main() {
1540
1240
  .option('--limit <number>', 'File mode: maximum lines')
1541
1241
  .option('--symbols-only', 'File mode: just the symbol map + dependents')
1542
1242
  .action(async (name, options) => {
1543
- // Need a symbol (positional) OR a file (--file / a path-like positional).
1544
- // With [name] optional, a bare `codegraph node` reaches here with neither
1545
- // and must be told what to pass, rather than crashing downstream.
1546
1243
  if (!name && !options.file) {
1547
1244
  error("Pass a symbol name (e.g. 'codegraph node parseToken') or a file (e.g. 'codegraph node -f src/auth.ts', or 'codegraph node src/auth.ts').");
1548
1245
  process.exit(1);
@@ -1553,24 +1250,14 @@ function main() {
1553
1250
  error(`CodeGraph isn't available here — no .codegraph/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable CodeGraph with 'codegraph init'.)`);
1554
1251
  process.exit(1);
1555
1252
  }
1556
- const { default: CodeGraph } = await loadCodeGraph();
1557
- const cg = await CodeGraph.open(projectPath);
1253
+ const cg = await openIndexToRead(projectPath);
1558
1254
  const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
1559
1255
  const handler = new ToolHandler(cg);
1560
- // A name with a path separator is a file read; otherwise a symbol
1561
- // (use --file for basename-only file reads or to pin an overload).
1562
- // Both separators: Windows users type src\auth\session.ts. Symbols
1563
- // never contain either ('/' isn't an identifier char anywhere we
1564
- // index; C++ scope is '::', JS members '.').
1565
1256
  const args = {};
1566
1257
  if (options.file) {
1567
1258
  args.file = options.file;
1568
1259
  if (name && name !== options.file) {
1569
1260
  args.symbol = name;
1570
- // Symbol mode pinned to a file is still symbol mode — the CLI
1571
- // always wants the body, exactly like the bare-symbol branch
1572
- // below. Omitting this printed location + trail with no source
1573
- // (#1284).
1574
1261
  args.includeCode = true;
1575
1262
  }
1576
1263
  }
@@ -1598,16 +1285,15 @@ function main() {
1598
1285
  process.exit(1);
1599
1286
  }
1600
1287
  });
1601
- /**
1602
- * codegraph files [path]
1603
- */
1604
1288
  program
1605
1289
  .command('files')
1606
1290
  .description('Show project file structure from the index')
1607
1291
  .option('-p, --path <path>', 'Project path')
1608
1292
  .option('--filter <dir>', 'Filter to files under this directory')
1609
1293
  .option('--pattern <glob>', 'Filter files matching this glob pattern')
1610
- .option('--format <format>', 'Output format (tree, flat, grouped)', 'tree')
1294
+ .option('--tests', 'Show only test files')
1295
+ .option('--no-tests', 'Exclude test files')
1296
+ .option('--format <format>', 'Output format (tree, flat, grouped, package)', 'tree')
1611
1297
  .option('--max-depth <number>', 'Maximum directory depth for tree format')
1612
1298
  .option('--no-metadata', 'Hide file metadata (language, symbol count)')
1613
1299
  .option('-j, --json', 'Output as JSON')
@@ -1618,36 +1304,42 @@ function main() {
1618
1304
  error(`CodeGraph not initialized in ${projectPath}`);
1619
1305
  process.exit(1);
1620
1306
  }
1621
- const { default: CodeGraph } = await loadCodeGraph();
1622
- const cg = await CodeGraph.open(projectPath);
1307
+ const cg = await openIndexToRead(projectPath);
1623
1308
  let files = cg.getFiles();
1624
1309
  if (files.length === 0) {
1625
1310
  info('No files indexed. Run "codegraph index" first.');
1626
1311
  cg.destroy();
1627
1312
  return;
1628
1313
  }
1629
- // Filter by path prefix
1630
1314
  if (options.filter) {
1631
1315
  const filter = options.filter;
1632
1316
  files = files.filter(f => f.path.startsWith(filter) || f.path.startsWith('./' + filter));
1633
1317
  }
1634
- // Filter by glob pattern
1635
1318
  if (options.pattern) {
1636
1319
  const regex = globToRegex(options.pattern);
1637
1320
  files = files.filter(f => regex.test(f.path));
1638
1321
  }
1322
+ if (options.tests !== undefined) {
1323
+ files = files.filter(f => (0, query_utils_1.isTestPath)(f.path) === options.tests);
1324
+ }
1639
1325
  if (files.length === 0) {
1640
1326
  info('No files found matching the criteria.');
1641
1327
  cg.destroy();
1642
1328
  return;
1643
1329
  }
1644
- // JSON output
1645
1330
  if (options.json) {
1646
1331
  const output = files.map(f => ({
1647
1332
  path: f.path,
1333
+ isTest: (0, query_utils_1.isTestPath)(f.path),
1648
1334
  language: f.language,
1649
1335
  nodeCount: f.nodeCount,
1650
1336
  size: f.size,
1337
+ errors: (f.errors ?? []).map((e) => ({
1338
+ severity: e.severity,
1339
+ code: e.code,
1340
+ message: e.message,
1341
+ line: e.line,
1342
+ })),
1651
1343
  }));
1652
1344
  console.log(JSON.stringify(output, null, 2));
1653
1345
  cg.destroy();
@@ -1656,7 +1348,6 @@ function main() {
1656
1348
  const includeMetadata = options.metadata !== false;
1657
1349
  const format = options.format || 'tree';
1658
1350
  const maxDepth = options.maxDepth ? parseInt(options.maxDepth, 10) : undefined;
1659
- // Format output
1660
1351
  switch (format) {
1661
1352
  case 'flat':
1662
1353
  console.log(chalk.bold(`\nFiles (${files.length}):\n`));
@@ -1691,6 +1382,23 @@ function main() {
1691
1382
  console.log();
1692
1383
  }
1693
1384
  break;
1385
+ case 'package': {
1386
+ const groups = (0, owning_package_1.groupFilesByPackage)(projectPath, files);
1387
+ console.log(chalk.bold(`\n${(0, owning_package_1.packageListingTitle)(groups)}:\n`));
1388
+ for (const group of groups) {
1389
+ console.log(chalk.cyan(`${(0, owning_package_1.packageGroupTitle)(group)}:`));
1390
+ for (const file of group.files) {
1391
+ if (includeMetadata) {
1392
+ console.log(` ${file.path} ${chalk.dim(`(${file.language}, ${file.nodeCount} symbols)`)}`);
1393
+ }
1394
+ else {
1395
+ console.log(` ${file.path}`);
1396
+ }
1397
+ }
1398
+ console.log();
1399
+ }
1400
+ break;
1401
+ }
1694
1402
  case 'tree':
1695
1403
  default:
1696
1404
  console.log(chalk.bold(`\nProject Structure (${files.length} files):\n`));
@@ -1705,27 +1413,15 @@ function main() {
1705
1413
  process.exit(1);
1706
1414
  }
1707
1415
  });
1708
- /**
1709
- * Normalize a user-supplied file path to the project-relative, forward-slash
1710
- * form CodeGraph stores in the index. Accepts an absolute path, a `./`-prefixed
1711
- * path, or Windows back-slashes; an empty string when the input is blank. Used
1712
- * by `codegraph affected` so `./src/x.ts`, `/abs/repo/src/x.ts`, and
1713
- * `src/x.ts` all match the same indexed file. (#825)
1714
- */
1715
1416
  function normalizeIndexPath(filePath, projectPath) {
1716
1417
  let f = filePath.trim();
1717
1418
  if (!f)
1718
1419
  return '';
1719
1420
  if (path.isAbsolute(f))
1720
1421
  f = path.relative(projectPath, f);
1721
- // Collapse `.`/`..` segments, then force forward slashes and drop a leading
1722
- // `./` (path.normalize already strips it on POSIX; explicit for Windows).
1723
1422
  f = path.normalize(f).replace(/\\/g, '/').replace(/^\.\//, '');
1724
1423
  return f;
1725
1424
  }
1726
- /**
1727
- * Convert glob pattern to regex
1728
- */
1729
1425
  function globToRegex(pattern) {
1730
1426
  const escaped = pattern
1731
1427
  .replace(/[.+^${}()|[\]\\]/g, '\\$&')
@@ -1735,9 +1431,6 @@ function main() {
1735
1431
  .replace(/\{\{GLOBSTAR\}\}/g, '.*');
1736
1432
  return new RegExp(escaped);
1737
1433
  }
1738
- /**
1739
- * Print files as a tree
1740
- */
1741
1434
  function printFileTree(files, includeMetadata, maxDepth, chalk) {
1742
1435
  const root = { name: '', children: new Map() };
1743
1436
  for (const file of files) {
@@ -1785,11 +1478,6 @@ function main() {
1785
1478
  };
1786
1479
  renderNode(root, '', true, 0);
1787
1480
  }
1788
- /**
1789
- * codegraph daemon — interactive manager for the background daemons. Arrow keys
1790
- * to pick one (the current project's daemon floats to the top, auto-selected),
1791
- * enter to stop it. Falls back to a plain list when output isn't a TTY.
1792
- */
1793
1481
  program
1794
1482
  .command('daemon')
1795
1483
  .aliases(['daemons'])
@@ -1802,15 +1490,12 @@ function main() {
1802
1490
  info('No CodeGraph daemons running.');
1803
1491
  return;
1804
1492
  }
1805
- // No TTY (piped / CI / non-interactive) — can't do arrow-key selection, so
1806
- // just print what's running instead of crashing on a prompt with no input.
1807
1493
  if (!process.stdout.isTTY || !process.stdin.isTTY) {
1808
1494
  for (const d of daemons) {
1809
1495
  console.log(`pid ${d.pid} v${d.version} up ${formatDuration(Date.now() - d.startedAt)} ${d.root}`);
1810
1496
  }
1811
1497
  return;
1812
1498
  }
1813
- // The current project's daemon floats to the top and is pre-selected.
1814
1499
  let cwdRoot = null;
1815
1500
  const found = (0, directory_1.findNearestCodeGraphRoot)(process.cwd());
1816
1501
  if (found) {
@@ -1835,19 +1520,9 @@ function main() {
1835
1520
  done: (m) => clack.outro(m),
1836
1521
  });
1837
1522
  });
1838
- /**
1839
- * Print the "no index here" guidance.
1840
- *
1841
- * The viewer READS an index; it never builds one — indexing stays the user's
1842
- * decision, exactly as it is for the MCP tools. So a missing index is normal
1843
- * input, not a failure to apologize for: say what is missing, say the one
1844
- * command that fixes it, and never print a stack trace.
1845
- */
1846
1523
  function printNoIndexGuidance(projectPath) {
1847
1524
  error(`No CodeGraph index found for ${projectPath}`);
1848
1525
  console.error('');
1849
- // getGlyphs() (not a literal em dash): a legacy Windows console decodes raw
1850
- // UTF-8 with its OEM codepage and renders one as mojibake (#168).
1851
1526
  console.error(` The viewer reads an index that already exists ${(0, glyphs_1.getGlyphs)().dash} it never creates one.`);
1852
1527
  console.error(' To index this project:');
1853
1528
  console.error('');
@@ -1858,20 +1533,6 @@ function main() {
1858
1533
  console.error(` ${chalk.cyan('codegraph ui /path/to/indexed/project')}`);
1859
1534
  console.error('');
1860
1535
  }
1861
- /**
1862
- * codegraph ui [path] (alias: web)
1863
- *
1864
- * The browser reader: serves the built viewer (`dist/viewer/`) over loopback
1865
- * and opens it. It opens the index for reading and never writes to it, never
1866
- * indexes, and never changes a line of the project's code. The single thing it
1867
- * writes is a trail the reader saved, as JSON under `.codegraph/ui/trails/`;
1868
- * `--read-only` turns even that off.
1869
- *
1870
- * Deliberately absent from TELEMETRY_FLUSH_COMMANDS above: the command's own
1871
- * banner tells the user nothing leaves their machine, so it must not be the
1872
- * thing that triggers a telemetry send. The usage count still buffers locally
1873
- * like every other quick command.
1874
- */
1875
1536
  program
1876
1537
  .command('ui [path]', { hidden: !(0, viewer_gate_1.viewerEnabled)() })
1877
1538
  .alias('web')
@@ -1922,9 +1583,6 @@ Set ${constants_1.BROWSER_ENV}=<command> to choose which browser opens, or
1922
1583
  ${constants_1.BROWSER_ENV}=none to never open one.
1923
1584
  `)
1924
1585
  .action(async (pathArg, options) => {
1925
- // An explicit --port stays explicit: a scripted `--port 8080` that quietly
1926
- // lands on 8081 is worse than one that says the port is busy. The default
1927
- // port is the only one we're free to walk away from.
1928
1586
  let requestedPort;
1929
1587
  if (options.port !== undefined) {
1930
1588
  requestedPort = Number(options.port);
@@ -1934,9 +1592,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
1934
1592
  }
1935
1593
  }
1936
1594
  const projectPath = resolveProjectPath(pathArg);
1937
- // Sensitive-directory refusal before anything opens: the same guard the MCP
1938
- // entry points use, so `codegraph ui /etc` is turned away here rather than
1939
- // becoming a browsable view of the system.
1940
1595
  const { validateProjectPath } = await Promise.resolve().then(() => __importStar(require('../utils')));
1941
1596
  const rootError = validateProjectPath(projectPath);
1942
1597
  if (rootError) {
@@ -1948,9 +1603,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
1948
1603
  process.exit(1);
1949
1604
  }
1950
1605
  const { startUiServer, openBrowser, createGraphApi, ViewerMissingError } = await Promise.resolve().then(() => __importStar(require('../ui-server')));
1951
- // The JSON API the viewer reads its screens from. It opens the index lazily
1952
- // on the first request, so a slow first paint is the only cost of mounting
1953
- // it here rather than after the browser connects.
1954
1606
  const readOnly = options.readOnly === true;
1955
1607
  const api = createGraphApi({
1956
1608
  projectRoot: projectPath,
@@ -1970,8 +1622,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
1970
1622
  }
1971
1623
  catch (err) {
1972
1624
  api.close();
1973
- // Both failure modes here (viewer assets missing, no port available) carry
1974
- // their own remediation — print it plainly, never a stack trace.
1975
1625
  error(err instanceof ViewerMissingError || err instanceof Error ? err.message : String(err));
1976
1626
  process.exit(1);
1977
1627
  }
@@ -1990,50 +1640,31 @@ ${constants_1.BROWSER_ENV}=none to never open one.
1990
1640
  ? chalk.dim(' Opening your browser... press Ctrl+C to stop.')
1991
1641
  : chalk.dim(' Open that URL in a browser. Press Ctrl+C to stop.'));
1992
1642
  console.log('');
1993
- // The http server keeps the event loop alive on its own; these just make
1994
- // Ctrl-C hang up live sockets instead of waiting on browser keep-alives.
1995
1643
  const shutdown = () => {
1996
- // Release the SQLite handle before the socket: the process should never
1997
- // exit with a live connection to the user's index.
1998
1644
  api.close();
1999
1645
  void handle.close().then(() => process.exit(0));
2000
1646
  };
2001
1647
  process.once('SIGINT', shutdown);
2002
1648
  process.once('SIGTERM', shutdown);
2003
- // Killing the command the user started (its pid, not Ctrl+C's process
2004
- // group) leaves this re-exec'd server with no parent to forward the
2005
- // signal: shut down the same way instead of serving the port forever.
2006
1649
  (0, command_supervision_1.watchParent)(shutdown);
2007
1650
  });
2008
- /**
2009
- * codegraph serve
2010
- */
2011
1651
  program
2012
- // Hidden from `--help`: this is the stdio entry point an AI agent launches
2013
- // for itself (the installer wires `args: ['serve','--mcp']` into every
2014
- // agent's MCP config), not a command a human runs. It still works when
2015
- // invoked — hiding only removes it from the listing. See the interactive-TTY
2016
- // guard below, which explains this to anyone who runs it by hand.
2017
1652
  .command('serve', { hidden: true })
2018
1653
  .description('Start CodeGraph as an MCP server for AI assistants')
2019
1654
  .option('-p, --path <path>', 'Project path (optional for MCP mode, uses rootUri from client)')
2020
1655
  .option('--mcp', 'Run as MCP server (stdio transport)')
2021
1656
  .option('--no-watch', 'Disable the file watcher (no auto-sync; useful on slow filesystems like WSL2 /mnt drives)')
1657
+ .option('--no-telemetry', 'Send no usage telemetry from this server (same as CODEGRAPH_TELEMETRY=0)')
2022
1658
  .action(async (options) => {
2023
1659
  const projectPath = options.path ? resolveProjectPath(options.path) : undefined;
2024
- // Commander sets watch=false when --no-watch is passed. Route it through
2025
- // the same env-var chokepoint the watcher and MCP server already honor.
2026
1660
  if (options.watch === false) {
2027
1661
  process.env.CODEGRAPH_NO_WATCH = '1';
2028
1662
  }
1663
+ if (options.telemetry === false) {
1664
+ process.env.CODEGRAPH_TELEMETRY = '0';
1665
+ }
2029
1666
  try {
2030
1667
  if (options.mcp) {
2031
- // `serve --mcp` is the stdio MCP server an AI agent launches for itself,
2032
- // not a command to run by hand. A human in a terminal would otherwise
2033
- // see it hang waiting for JSON-RPC on stdin, which reads as broken. If
2034
- // stdin is an interactive TTY, explain instead of hanging. The agent's
2035
- // pipe and the detached daemon both have a non-TTY stdin, so this only
2036
- // ever fires for a person who typed it.
2037
1668
  if (process.stdin.isTTY && !process.env.CODEGRAPH_DAEMON_INTERNAL) {
2038
1669
  console.error(chalk.bold('\nCodeGraph MCP server\n'));
2039
1670
  console.error("This is the MCP server your AI agent (Claude Code, Cursor, Codex, opencode, …)");
@@ -2044,15 +1675,11 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2044
1675
  console.error(chalk.dim('\n(Running it directly only does something when an MCP client drives it over stdin.)'));
2045
1676
  return;
2046
1677
  }
2047
- // Start MCP server - it handles initialization lazily based on rootUri from client
2048
1678
  const { MCPServer } = await Promise.resolve().then(() => __importStar(require('../mcp/index')));
2049
1679
  const server = new MCPServer(projectPath);
2050
1680
  await server.start();
2051
- // Server will run until terminated
2052
1681
  }
2053
1682
  else {
2054
- // Default: show info about MCP mode.
2055
- // Use stderr so stdout stays clean for any piped/stdio usage.
2056
1683
  console.error(chalk.bold('\nCodeGraph MCP Server\n'));
2057
1684
  console.error(chalk.blue((0, glyphs_1.getGlyphs)().info) + ' Use --mcp flag to start the MCP server');
2058
1685
  console.error('\nTo use with Claude Code, add to your MCP configuration:');
@@ -2082,9 +1709,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2082
1709
  process.exit(1);
2083
1710
  }
2084
1711
  });
2085
- /**
2086
- * codegraph unlock [path]
2087
- */
2088
1712
  program
2089
1713
  .command('unlock [path]')
2090
1714
  .description('Remove a stale lock file that is blocking indexing')
@@ -2113,11 +1737,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2113
1737
  process.exit(1);
2114
1738
  }
2115
1739
  });
2116
- /**
2117
- * CLI parity with MCP callers/callees: resolve once, then collect and limit
2118
- * within each definition. The legacy JSON list remains an explicitly labeled
2119
- * union, with its original total/limit/truncated contract (#1674).
2120
- */
2121
1740
  for (const direction of ['callers', 'callees']) {
2122
1741
  const title = direction === 'callers' ? 'Callers' : 'Callees';
2123
1742
  program
@@ -2136,11 +1755,10 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2136
1755
  error(`CodeGraph not initialized in ${projectPath}`);
2137
1756
  process.exit(1);
2138
1757
  }
2139
- const { default: CodeGraph } = await loadCodeGraph();
2140
- const cg = await CodeGraph.open(projectPath);
1758
+ const cg = await openIndexToRead(projectPath);
2141
1759
  try {
2142
1760
  const limit = parseInt(options.limit || '20', 10);
2143
- const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol);
1761
+ const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol, (0, go_package_1.goPackageReaderFor)(cg));
2144
1762
  if (targets.length === 0) {
2145
1763
  info(formatSymbolNotFound(symbol, cg.searchNodes(symbol, { limit: 5 }).map((m) => m.node.name)));
2146
1764
  return;
@@ -2153,25 +1771,40 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2153
1771
  const collected = groups.map((group) => {
2154
1772
  const nodes = new Map();
2155
1773
  const edges = new Map();
1774
+ const recursive = new Set();
2156
1775
  for (const target of group) {
2157
- const connections = direction === 'callers' ? cg.getCallers(target.id) : cg.getCallees(target.id);
2158
- for (const { node, edge } of connections) {
2159
- nodes.set(node.id, node);
2160
- edges.set(`${edge.source}->${edge.target}:${edge.kind}`, edge);
1776
+ for (const row of cg.getCallSites(target.id, direction)) {
1777
+ nodes.set(row.node.id, row.node);
1778
+ if (row.recursive)
1779
+ recursive.add(row.node.id);
1780
+ for (const edge of row.edges) {
1781
+ edges.set(`${edge.source}|${edge.target}|${edge.kind}|${edge.line ?? -1}|${edge.column ?? -1}`, edge);
1782
+ }
2161
1783
  }
2162
1784
  }
2163
- return { group, nodes: [...nodes.values()], edges: [...edges.values()] };
1785
+ return { group, nodes: [...nodes.values()], edges: [...edges.values()], recursive };
1786
+ });
1787
+ const ownEdges = (node, edges) => edges.filter((edge) => (direction === 'callers' ? edge.source : edge.target) === node.id);
1788
+ const relationships = (node, edges) => [...new Set(ownEdges(node, edges).map((edge) => edge.kind))];
1789
+ const location = (node, edges) => {
1790
+ const lines = direction === 'callers' ? (0, call_sites_1.callSiteLines)(ownEdges(node, edges)) : [];
1791
+ if (lines.length > 0)
1792
+ return `:${(0, call_sites_1.formatCallSiteLines)(lines, CLI_CALL_SITES_SHOWN)}`;
1793
+ return node.startLine ? `:${node.startLine}` : '';
1794
+ };
1795
+ const row = (node, edges, recursive) => ({
1796
+ ...cliNode(node),
1797
+ relationships: relationships(node, edges),
1798
+ lines: (0, call_sites_1.callSiteLines)(ownEdges(node, edges)),
1799
+ recursive,
2164
1800
  });
2165
- const relationships = (node, edges) => [...new Set(edges
2166
- .filter((edge) => (direction === 'callers' ? edge.source : edge.target) === node.id)
2167
- .map((edge) => edge.kind))];
2168
1801
  if (options.json) {
2169
- const definitions = collected.map(({ group, nodes, edges }) => {
1802
+ const definitions = collected.map(({ group, nodes, edges, recursive }) => {
2170
1803
  const limited = nodes.slice(0, limit);
2171
1804
  const shown = new Set(limited.map((node) => node.id));
2172
1805
  return {
2173
1806
  ...cliDefinition(group),
2174
- [direction]: limited.map((node) => ({ id: node.id, ...cliNode(node), relationships: relationships(node, edges) })),
1807
+ [direction]: limited.map((node) => ({ id: node.id, ...row(node, edges, recursive.has(node.id)) })),
2175
1808
  edges: edges.filter((edge) => shown.has(direction === 'callers' ? edge.source : edge.target)),
2176
1809
  total: nodes.length,
2177
1810
  limit,
@@ -2184,6 +1817,7 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2184
1817
  union.set(node.id, node);
2185
1818
  }
2186
1819
  const total = union.size;
1820
+ const allEdges = collected.flatMap((entry) => entry.edges);
2187
1821
  console.log(JSON.stringify({
2188
1822
  symbol,
2189
1823
  targets: groups.flat().map((node) => cliDefinition([node]).definition),
@@ -2193,8 +1827,7 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2193
1827
  filteredOut,
2194
1828
  note,
2195
1829
  definitions,
2196
- [direction]: [...union.values()].slice(0, limit).map((node) => ({ ...cliNode(node),
2197
- relationships: relationships(node, collected.flatMap((entry) => entry.edges)) })),
1830
+ [direction]: [...union.values()].slice(0, limit).map((node) => row(node, allEdges, collected.some((entry) => entry.recursive.has(node.id)))),
2198
1831
  total,
2199
1832
  limit,
2200
1833
  truncated: total > limit,
@@ -2206,7 +1839,7 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2206
1839
  if (ambiguous) {
2207
1840
  console.log(chalk.bold(`\n${title} of "${symbol}" — ${groups.length} distinct definitions (narrow with --file):`));
2208
1841
  }
2209
- for (const { group, nodes, edges } of collected) {
1842
+ for (const { group, nodes, edges, recursive } of collected) {
2210
1843
  const limited = nodes.slice(0, limit);
2211
1844
  const total = nodes.length;
2212
1845
  const truncated = total > limit;
@@ -2225,11 +1858,11 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2225
1858
  info(`No ${direction} found for "${symbol}"`);
2226
1859
  }
2227
1860
  for (const node of limited) {
2228
- const loc = node.startLine ? `:${node.startLine}` : '';
2229
1861
  const kinds = relationships(node, edges).filter((kind) => kind !== 'calls');
2230
1862
  const relation = kinds.length ? ` [${kinds.join(', ')}]` : '';
2231
- console.log(chalk.cyan(node.kind.padEnd(12)) + chalk.white(node.name) + chalk.dim(relation));
2232
- console.log(chalk.dim(` ${node.filePath}${loc}`));
1863
+ const itself = recursive.has(node.id) ? ' (calls itself)' : '';
1864
+ console.log(chalk.cyan(node.kind.padEnd(12)) + chalk.white(node.name) + chalk.dim(itself + relation));
1865
+ console.log(chalk.dim(` ${node.filePath}${location(node, edges)}`));
2233
1866
  console.log();
2234
1867
  }
2235
1868
  if (truncated)
@@ -2247,9 +1880,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2247
1880
  }
2248
1881
  });
2249
1882
  }
2250
- /**
2251
- * codegraph impact <symbol> — one blast radius per distinct definition.
2252
- */
2253
1883
  program
2254
1884
  .command('impact <symbol>')
2255
1885
  .description('Analyze what code is affected by changing a symbol')
@@ -2264,11 +1894,10 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2264
1894
  error(`CodeGraph not initialized in ${projectPath}`);
2265
1895
  process.exit(1);
2266
1896
  }
2267
- const { default: CodeGraph } = await loadCodeGraph();
2268
- const cg = await CodeGraph.open(projectPath);
1897
+ const cg = await openIndexToRead(projectPath);
2269
1898
  try {
2270
1899
  const depth = Math.min(Math.max(parseInt(options.depth || '2', 10), 1), 10);
2271
- const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol);
1900
+ const { nodes: targets } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol, (0, go_package_1.goPackageReaderFor)(cg));
2272
1901
  if (targets.length === 0) {
2273
1902
  info(formatSymbolNotFound(symbol, cg.searchNodes(symbol, { limit: 5 }).map((m) => m.node.name)));
2274
1903
  return;
@@ -2281,19 +1910,22 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2281
1910
  const collected = groups.map((group) => {
2282
1911
  const nodes = new Map();
2283
1912
  const edges = new Map();
1913
+ let truncated = false;
2284
1914
  for (const target of group) {
2285
1915
  const impact = cg.getImpactRadius(target.id, depth);
1916
+ truncated ||= impact.truncated === true;
2286
1917
  for (const [id, node] of impact.nodes)
2287
1918
  nodes.set(id, node);
2288
1919
  for (const edge of impact.edges)
2289
1920
  edges.set(`${edge.source}->${edge.target}:${edge.kind}`, edge);
2290
1921
  }
2291
- return { group, nodes, edges };
1922
+ return { group, nodes, edges, truncated };
2292
1923
  });
1924
+ const truncated = collected.some((c) => c.truncated);
2293
1925
  if (options.json) {
2294
1926
  const unionNodes = new Map();
2295
1927
  const unionEdges = new Map();
2296
- const definitions = collected.map(({ group, nodes, edges }) => {
1928
+ const definitions = collected.map(({ group, nodes, edges, truncated }) => {
2297
1929
  for (const [id, node] of nodes)
2298
1930
  unionNodes.set(id, node);
2299
1931
  for (const [key, edge] of edges)
@@ -2302,6 +1934,7 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2302
1934
  ...cliDefinition(group),
2303
1935
  nodeCount: nodes.size,
2304
1936
  edgeCount: edges.size,
1937
+ ...(truncated ? { truncated } : {}),
2305
1938
  affected: [...nodes.values()].map((node) => ({ id: node.id, ...cliNode(node) })),
2306
1939
  edges: [...edges.values()],
2307
1940
  };
@@ -2318,6 +1951,7 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2318
1951
  definitions,
2319
1952
  nodeCount: unionNodes.size,
2320
1953
  edgeCount: unionEdges.size,
1954
+ ...(truncated ? { truncated } : {}),
2321
1955
  affected: [...unionNodes.values()].map(cliNode),
2322
1956
  }, null, 2));
2323
1957
  }
@@ -2350,6 +1984,8 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2350
1984
  console.log();
2351
1985
  }
2352
1986
  }
1987
+ if (truncated)
1988
+ warn('Result truncated at the safety limit. Narrow it with --file or a smaller --depth.');
2353
1989
  }
2354
1990
  }
2355
1991
  finally {
@@ -2361,23 +1997,137 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2361
1997
  process.exit(1);
2362
1998
  }
2363
1999
  });
2364
- /**
2365
- * codegraph affected [files...]
2366
- *
2367
- * Find test files affected by the given source files.
2368
- * Traces dependency edges transitively to find test files that depend on changed code.
2369
- *
2370
- * Usage:
2371
- * git diff --name-only | codegraph affected --stdin
2372
- * codegraph affected src/lib/components/Editor.svelte src/routes/+page.svelte
2373
- */
2000
+ async function affectedFilterMatcher(pattern) {
2001
+ const { default: picomatch } = await Promise.resolve().then(() => __importStar(require('picomatch')));
2002
+ const options = { dot: true, windows: false };
2003
+ let glob = pattern.trim();
2004
+ if (glob.endsWith('/'))
2005
+ glob += '**';
2006
+ if (!glob.includes('/')) {
2007
+ const matchName = picomatch(glob, options);
2008
+ return (filePath) => matchName(path.posix.basename(filePath));
2009
+ }
2010
+ const anchored = /^\.?\//.test(glob);
2011
+ glob = glob.replace(/^\.?\/+/, '');
2012
+ if (!anchored && !glob.startsWith('**/'))
2013
+ glob = `**/${glob}`;
2014
+ return picomatch(glob, options);
2015
+ }
2016
+ program
2017
+ .command('implementations <symbol>')
2018
+ .description('List the types that implement or extend a trait, interface or class')
2019
+ .option('-p, --path <path>', 'Project path')
2020
+ .option('-f, --file <path>', 'Narrow definitions by file path or suffix (no match: show all with a note)')
2021
+ .option('-d, --depth <number>', `Levels of subtypes to list, 1-${type_hierarchy_1.MAX_DESCENDANT_DEPTH} (1: direct implementors only)`, '1')
2022
+ .option('-j, --json', 'Output as JSON')
2023
+ .action(async (symbol, options) => {
2024
+ const projectPath = resolveProjectPath(options.path);
2025
+ try {
2026
+ if (!(0, directory_1.isInitialized)(projectPath)) {
2027
+ error(`CodeGraph not initialized in ${projectPath}`);
2028
+ process.exit(1);
2029
+ }
2030
+ const cg = await openIndexToRead(projectPath);
2031
+ try {
2032
+ const depth = Math.min(Math.max(parseInt(options.depth || '1', 10) || 1, 1), type_hierarchy_1.MAX_DESCENDANT_DEPTH);
2033
+ const { nodes: found } = (0, symbol_lookup_1.lookupSymbolNodes)(cg, symbol, (0, go_package_1.goPackageReaderFor)(cg));
2034
+ if (found.length === 0) {
2035
+ info(formatSymbolNotFound(symbol, cg.searchNodes(symbol, { limit: 5 }).map((m) => m.node.name)));
2036
+ return;
2037
+ }
2038
+ const targets = found.filter(type_hierarchy_1.canHaveHierarchy);
2039
+ if (targets.length === 0) {
2040
+ info(`"${symbol}" is ${(0, symbol_lookup_1.describeSymbolNode)(found[0])} — not a type something can implement or extend.`);
2041
+ return;
2042
+ }
2043
+ const { groups, filteredOut } = (0, symbol_lookup_1.groupDefinitions)(targets, options.file);
2044
+ const ambiguous = groups.length > 1;
2045
+ const note = filteredOut
2046
+ ? `no definition of "${symbol}" matches file "${options.file}" — showing all definitions instead.`
2047
+ : undefined;
2048
+ const sources = new Map();
2049
+ const sourceOf = (filePath) => {
2050
+ if (!sources.has(filePath)) {
2051
+ try {
2052
+ sources.set(filePath, fs.readFileSync(path.join(projectPath, filePath), 'utf-8'));
2053
+ }
2054
+ catch {
2055
+ sources.set(filePath, undefined);
2056
+ }
2057
+ }
2058
+ return sources.get(filePath);
2059
+ };
2060
+ const collected = groups.map((group) => {
2061
+ const focus = group[0];
2062
+ const hierarchy = (0, type_hierarchy_1.buildTypeHierarchy)(cg, focus, { overrides: false });
2063
+ const entries = (hierarchy?.descendants ?? []).filter((e) => e.depth <= depth);
2064
+ const nameOf = new Map([[focus.id, focus.name]]);
2065
+ for (const e of entries)
2066
+ nameOf.set(e.node.id, e.node.name);
2067
+ const implementations = entries.map((e) => ({
2068
+ ...cliNode(e.node),
2069
+ qualifiedName: e.node.qualifiedName,
2070
+ language: e.node.language,
2071
+ relation: e.relation,
2072
+ depth: e.depth,
2073
+ via: e.depth > 1 ? nameOf.get(e.parentId) : undefined,
2074
+ test: (0, test_code_1.isTestCode)(e.node, e.node.language === 'rust' ? sourceOf(e.node.filePath) : undefined),
2075
+ synthesized: e.synthesized,
2076
+ }));
2077
+ return { group, implementations, directSubtypes: hierarchy?.directSubtypes ?? 0, bounded: hierarchy?.bounded ?? false };
2078
+ });
2079
+ if (options.json) {
2080
+ console.log(JSON.stringify({
2081
+ symbol,
2082
+ depth,
2083
+ targets: groups.flat().map((node) => cliDefinition([node]).definition),
2084
+ ambiguous,
2085
+ file: options.file,
2086
+ filteredOut,
2087
+ note,
2088
+ definitions: collected.map(({ group, implementations, directSubtypes, bounded }) => ({
2089
+ ...cliDefinition(group),
2090
+ directSubtypes,
2091
+ bounded,
2092
+ implementations,
2093
+ })),
2094
+ }, null, 2));
2095
+ }
2096
+ else {
2097
+ if (note)
2098
+ warn(note);
2099
+ for (const { group, implementations, directSubtypes, bounded } of collected) {
2100
+ const deeper = depth > 1 ? `, ${implementations.length} within ${depth} levels` : '';
2101
+ console.log(chalk.bold(`\nImplementations of ${(0, symbol_lookup_1.describeSymbolNode)(group[0])} — ${directSubtypes} direct${deeper}:\n`));
2102
+ if (implementations.length === 0)
2103
+ console.log(chalk.dim(' (none in the index)'));
2104
+ for (const r of implementations) {
2105
+ const tags = [r.test ? '[test]' : '', r.synthesized ? '[synthesized]' : ''].filter(Boolean).join(' ');
2106
+ const via = r.via ? ` ${r.via}` : '';
2107
+ console.log(` ${' '.repeat(r.depth - 1)}${chalk.dim(r.kind.padEnd(10))}${r.name} ${chalk.dim(r.relation + via)} ${chalk.cyan(`${r.filePath}:${r.startLine}`)}${tags ? ` ${chalk.dim(tags)}` : ''}`);
2108
+ }
2109
+ if (bounded)
2110
+ console.log(chalk.dim(`\n …the walk stops at ${type_hierarchy_1.MAX_DESCENDANTS} subtypes or ${type_hierarchy_1.MAX_DESCENDANT_DEPTH} levels; more exist.`));
2111
+ console.log();
2112
+ }
2113
+ }
2114
+ }
2115
+ finally {
2116
+ cg.destroy();
2117
+ }
2118
+ }
2119
+ catch (err) {
2120
+ error(`implementations failed: ${err instanceof Error ? err.message : String(err)}`);
2121
+ process.exit(1);
2122
+ }
2123
+ });
2374
2124
  program
2375
2125
  .command('affected [files...]')
2376
2126
  .description('Find test files affected by changed source files')
2377
2127
  .option('-p, --path <path>', 'Project path')
2378
2128
  .option('--stdin', 'Read file list from stdin (one per line)')
2379
2129
  .option('-d, --depth <number>', 'Max dependency traversal depth', '5')
2380
- .option('-f, --filter <glob>', 'Custom glob filter for test files (e.g. "e2e/*.spec.ts")')
2130
+ .option('-f, --filter <glob>', 'Glob for the files that count as tests, matched against the whole name: "*_test.go" matches the file name at any depth, "e2e/*.spec.ts" that folder at any depth, "/tests/**/*.py" from the project root only')
2381
2131
  .option('-j, --json', 'Output as JSON')
2382
2132
  .option('-q, --quiet', 'Only output file paths, no decoration')
2383
2133
  .action(async (fileArgs, options) => {
@@ -2387,17 +2137,12 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2387
2137
  error(`CodeGraph not initialized in ${projectPath}`);
2388
2138
  process.exit(1);
2389
2139
  }
2390
- // Collect changed files from args or stdin
2391
2140
  let changedFiles = [...(fileArgs || [])];
2392
2141
  if (options.stdin) {
2393
2142
  const stdinData = fs.readFileSync(0, 'utf-8');
2394
2143
  const stdinFiles = stdinData.split('\n').map(f => f.trim()).filter(Boolean);
2395
2144
  changedFiles.push(...stdinFiles);
2396
2145
  }
2397
- // Normalize inputs to the project-relative, forward-slash form the index
2398
- // stores. Without this, `affected ./src/x.ts`, an absolute path (what a
2399
- // wrapping script often passes), or a Windows back-slash path silently
2400
- // matches nothing and reports 0 affected tests. (#825)
2401
2146
  changedFiles = changedFiles
2402
2147
  .map((f) => normalizeIndexPath(f, projectPath))
2403
2148
  .filter(Boolean);
@@ -2406,40 +2151,30 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2406
2151
  info('No files provided. Use file arguments or --stdin.');
2407
2152
  process.exit(0);
2408
2153
  }
2409
- const { default: CodeGraph } = await loadCodeGraph();
2410
- const cg = await CodeGraph.open(projectPath);
2411
- const maxDepth = parseInt(options.depth || '5', 10);
2412
- // Custom filter pattern
2413
2154
  let customFilter = null;
2414
2155
  if (options.filter) {
2415
- // Convert glob to regex: ** → .+, * → [^/]*, . → \.
2416
- const regex = options.filter
2417
- .replace(/[+[\]{}()^$|\\]/g, '\\$&')
2418
- .replace(/\./g, '\\.')
2419
- .replace(/\*\*/g, '.+')
2420
- .replace(/\*/g, '[^/]*');
2421
- customFilter = new RegExp(regex);
2422
- }
2423
- // One notion of "a test" for the whole tool (#1507): the CLI used to keep
2424
- // its own six regexes here, which knew `.test.` and `/tests/` but not Go's
2425
- // `_test.go`, Python's `test_x.py` or the JVM's `FooTest.kt` — so
2426
- // `affected` reported "no tests" for whole ecosystems while `search` and
2427
- // the MCP tools counted those very files as tests.
2156
+ try {
2157
+ customFilter = await affectedFilterMatcher(options.filter);
2158
+ }
2159
+ catch (err) {
2160
+ error(`Invalid --filter pattern "${options.filter}": ${err instanceof Error ? err.message : String(err)}`);
2161
+ process.exit(1);
2162
+ }
2163
+ }
2164
+ const cg = await openIndexToRead(projectPath);
2165
+ const maxDepth = parseInt(options.depth || '5', 10);
2428
2166
  function isTestFile(filePath) {
2429
2167
  if (customFilter)
2430
- return customFilter.test(filePath);
2168
+ return customFilter(filePath);
2431
2169
  return (0, query_utils_1.isTestPath)(filePath);
2432
2170
  }
2433
- // BFS to find all transitive dependents of changed files, filtered to test files
2434
2171
  const affectedTests = new Set();
2435
2172
  const allDependents = new Set();
2436
2173
  for (const file of changedFiles) {
2437
- // If the changed file is itself a test file, include it
2438
2174
  if (isTestFile(file)) {
2439
2175
  affectedTests.add(file);
2440
2176
  continue;
2441
2177
  }
2442
- // BFS through dependents
2443
2178
  const queue = [{ file, depth: 0 }];
2444
2179
  const visited = new Set();
2445
2180
  visited.add(file);
@@ -2463,7 +2198,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2463
2198
  }
2464
2199
  }
2465
2200
  const sortedTests = Array.from(affectedTests).sort();
2466
- // Output
2467
2201
  if (options.json) {
2468
2202
  console.log(JSON.stringify({
2469
2203
  changedFiles,
@@ -2494,17 +2228,60 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2494
2228
  process.exit(1);
2495
2229
  }
2496
2230
  });
2497
- /**
2498
- * codegraph install
2499
- */
2231
+ const CLI_CYCLE_FILES_SHOWN = 12;
2232
+ program
2233
+ .command('cycles [path]')
2234
+ .description('List circular imports between files (exits 1 when there are any)')
2235
+ .option('-j, --json', 'Output as JSON')
2236
+ .action(async (pathArg, options) => {
2237
+ const projectPath = resolveProjectPath(pathArg);
2238
+ try {
2239
+ if (!(0, directory_1.isInitialized)(projectPath)) {
2240
+ error(`CodeGraph not initialized in ${projectPath}`);
2241
+ process.exit(1);
2242
+ }
2243
+ const cg = await openIndexToRead(projectPath);
2244
+ try {
2245
+ const cycles = cg.findCircularDependencies();
2246
+ if (options.json) {
2247
+ console.log(JSON.stringify({ count: cycles.length, cycles }, null, 2));
2248
+ }
2249
+ else if (cycles.length === 0) {
2250
+ success('No circular imports found');
2251
+ }
2252
+ else {
2253
+ const files = cycles.reduce((sum, group) => sum + group.length, 0);
2254
+ console.log(chalk.bold(`\nCircular imports: ${cycles.length} group${cycles.length === 1 ? '' : 's'}, ${files} files\n`));
2255
+ cycles.forEach((group, i) => {
2256
+ console.log(chalk.cyan(`${i + 1}. ${group.length} files`));
2257
+ for (const file of group.slice(0, CLI_CYCLE_FILES_SHOWN))
2258
+ console.log(` ${file}`);
2259
+ if (group.length > CLI_CYCLE_FILES_SHOWN) {
2260
+ console.log(chalk.dim(` ... and ${group.length - CLI_CYCLE_FILES_SHOWN} more (--json lists them all)`));
2261
+ }
2262
+ console.log();
2263
+ });
2264
+ }
2265
+ if (cycles.length > 0)
2266
+ process.exitCode = 1;
2267
+ }
2268
+ finally {
2269
+ cg.destroy();
2270
+ }
2271
+ }
2272
+ catch (err) {
2273
+ error(`cycles failed: ${err instanceof Error ? err.message : String(err)}`);
2274
+ process.exit(1);
2275
+ }
2276
+ });
2500
2277
  program
2501
2278
  .command('install')
2502
- .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)')
2279
+ .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, IBM Bob, Factory Droid, Windsurf, Qwen Code, DeepSeek Harness, Grok Build, Kimi Code, Qoder CLI, Pi)')
2503
2280
  .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "auto"|"all"|"none". Default: prompt')
2504
2281
  .option('-l, --location <where>', 'Install location: "global" or "local". Default: prompt')
2505
2282
  .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=auto, auto-allow on')
2506
2283
  .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)')
2507
- .option('--no-permissions', 'Skip writing the auto-allow permissions list (Claude Code only)')
2284
+ .option('--no-permissions', 'Skip writing the auto-allow permissions list (Claude Code and Qwen Code only)')
2508
2285
  .option('--print-config <id>', 'Print MCP config snippet for the named agent and exit (no file writes)')
2509
2286
  .option('--refresh', 'Rewrite what previous installs configured, for already-configured agents only (never adds new ones). Run automatically by `codegraph upgrade`')
2510
2287
  .action(async (opts) => {
@@ -2520,12 +2297,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2520
2297
  process.stdout.write(target.printConfig(loc));
2521
2298
  return;
2522
2299
  }
2523
- // --refresh: non-interactive sweep that re-writes what previous
2524
- // installs configured (instructions section, MCP entry, legacy-hook
2525
- // cleanups) for already-configured agents, so those surfaces match
2526
- // THIS binary's templates. Skips everything else — never a first
2527
- // install, never touches permissions or the prompt hook. Sweeps both
2528
- // locations unless --location narrows it.
2529
2300
  if (opts.refresh) {
2530
2301
  const { refreshTargets } = await Promise.resolve().then(() => __importStar(require('../installer')));
2531
2302
  const { ALL_TARGETS } = await Promise.resolve().then(() => __importStar(require('../installer/targets/registry')));
@@ -2537,17 +2308,24 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2537
2308
  ? [opts.location]
2538
2309
  : ['global', 'local'];
2539
2310
  let changed = 0;
2311
+ let failed = 0;
2540
2312
  for (const loc of locs) {
2541
2313
  for (const report of refreshTargets(ALL_TARGETS, loc)) {
2314
+ if (report.status === 'failed') {
2315
+ failed += 1;
2316
+ error(`${report.displayName}: could not refresh — ${report.error}`);
2317
+ }
2542
2318
  for (const p of report.changedPaths) {
2543
2319
  changed += 1;
2544
2320
  console.log(` ${report.displayName}: refreshed ${p}`);
2545
2321
  }
2546
2322
  }
2547
2323
  }
2548
- if (changed === 0) {
2324
+ if (changed === 0 && failed === 0) {
2549
2325
  console.log('All configured agent surfaces are already current.');
2550
2326
  }
2327
+ if (failed > 0)
2328
+ process.exitCode = 1;
2551
2329
  return;
2552
2330
  }
2553
2331
  const { runInstallerWithOptions } = await Promise.resolve().then(() => __importStar(require('../installer')));
@@ -2556,12 +2334,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2556
2334
  process.exit(1);
2557
2335
  }
2558
2336
  try {
2559
- // Commander's `--no-permissions` makes `opts.permissions === false`;
2560
- // omitting the flag leaves it `true` (the positive-form default).
2561
- // We MUST treat the default-true as "user did not override — let
2562
- // the orchestrator prompt" and only forward an explicit `false`
2563
- // (or `true` when --yes implies it). Otherwise the auto-allow
2564
- // prompt is silently skipped on every interactive run.
2565
2337
  const explicitNoPermissions = opts.permissions === false;
2566
2338
  const autoAllow = explicitNoPermissions
2567
2339
  ? false
@@ -2579,29 +2351,13 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2579
2351
  error(err instanceof Error ? err.message : String(err));
2580
2352
  process.exit(1);
2581
2353
  }
2582
- // --init: the one-shot "wire agents AND build this project's index"
2583
- // bootstrap (#1578). The installer itself never indexes implicitly (a
2584
- // surprise index of $HOME is the thing we refuse) — an explicit flag is
2585
- // the user choosing. Runs after a successful install, including the
2586
- // `--target none` / nothing-detected case (the installer returns normally
2587
- // there), and shares every guard with `codegraph init`: an unsafe root
2588
- // is refused (exit 1, no implied --force), an already-initialized
2589
- // project just says so. `--yes` flows through so no offer prompts.
2590
2354
  if (opts.init) {
2591
2355
  await runInit(process.cwd(), { yes: opts.yes });
2592
2356
  }
2593
2357
  });
2594
- /**
2595
- * codegraph uninstall
2596
- *
2597
- * Inverse of `install`. Removes the codegraph MCP server entry,
2598
- * instructions block, and permissions from every agent (or a
2599
- * `--target` subset). Prompts global-vs-local when not given. Does NOT
2600
- * delete the `.codegraph/` index — that's `codegraph uninit`.
2601
- */
2602
2358
  program
2603
2359
  .command('uninstall')
2604
- .description('Remove codegraph from your agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, Kiro, GitHub Copilot)')
2360
+ .description('Remove codegraph from your agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, Kiro, GitHub Copilot, IBM Bob, Factory Droid, Windsurf, Qwen Code, DeepSeek Harness, Grok Build, Kimi Code, Qoder CLI, Pi)')
2605
2361
  .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "all". Default: all')
2606
2362
  .option('-l, --location <where>', 'Uninstall location: "global" or "local". Default: prompt')
2607
2363
  .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=all')
@@ -2626,9 +2382,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2626
2382
  process.exit(1);
2627
2383
  }
2628
2384
  });
2629
- /**
2630
- * codegraph telemetry [on|off|status]
2631
- */
2632
2385
  program
2633
2386
  .command('telemetry [action]')
2634
2387
  .description('Show or change anonymous usage telemetry (status, on, off)')
@@ -2665,13 +2418,6 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2665
2418
  console.log(`Config: ${s.configPath}`);
2666
2419
  console.log(chalk.dim(`\nExactly what is collected (and never collected): ${telemetry_1.TELEMETRY_DOCS}\n`));
2667
2420
  });
2668
- /**
2669
- * codegraph upgrade [version]
2670
- *
2671
- * Self-update, however CodeGraph was installed (bundle via install.sh/.ps1,
2672
- * npm-global, npx, or a source checkout). See ../upgrade for the detection and
2673
- * per-method upgrade logic.
2674
- */
2675
2421
  program
2676
2422
  .command('upgrade [version]')
2677
2423
  .description('Update CodeGraph to the latest release (or a specific version)')
@@ -2704,21 +2450,12 @@ ${constants_1.BROWSER_ENV}=none to never open one.
2704
2450
  });
2705
2451
  process.exit(code);
2706
2452
  });
2707
- /**
2708
- * codegraph version
2709
- *
2710
- * The bare-noun form of `--version`. commander already provides `--version`
2711
- * and `-V`, and the `-v` / `-version` spellings are intercepted before parse
2712
- * (see top of main). This subcommand makes `codegraph version` work and lists
2713
- * the version affordance in `codegraph --help`.
2714
- */
2715
2453
  program
2716
2454
  .command('version')
2717
2455
  .description('Print the installed CodeGraph version (also: -v, --version)')
2718
2456
  .action(() => {
2719
2457
  console.log(packageJson.version);
2720
2458
  });
2721
- // Parse and run
2722
2459
  program.parse();
2723
- } // end main()
2460
+ }
2724
2461
  //# sourceMappingURL=codegraph.js.map