@saluzi/codegraph 0.1.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (712) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +885 -0
  3. package/dist/bin/codegraph.d.ts +2 -1
  4. package/dist/bin/codegraph.d.ts.map +1 -0
  5. package/dist/bin/codegraph.js +2248 -0
  6. package/dist/bin/codegraph.js.map +1 -0
  7. package/dist/bin/command-supervision.d.ts +49 -0
  8. package/dist/bin/command-supervision.d.ts.map +1 -0
  9. package/dist/bin/command-supervision.js +95 -0
  10. package/dist/bin/command-supervision.js.map +1 -0
  11. package/dist/bin/fatal-handler.d.ts +20 -0
  12. package/dist/bin/fatal-handler.d.ts.map +1 -0
  13. package/dist/bin/fatal-handler.js +118 -0
  14. package/dist/bin/fatal-handler.js.map +1 -0
  15. package/dist/bin/node-version-check.d.ts.map +1 -0
  16. package/dist/bin/node-version-check.js +79 -0
  17. package/dist/bin/node-version-check.js.map +1 -0
  18. package/dist/bin/uninstall.d.ts.map +1 -0
  19. package/dist/bin/uninstall.js +36 -0
  20. package/dist/bin/uninstall.js.map +1 -0
  21. package/dist/context/formatter.d.ts +6 -9
  22. package/dist/context/formatter.d.ts.map +1 -0
  23. package/dist/context/formatter.js +25 -6
  24. package/dist/context/formatter.js.map +1 -0
  25. package/dist/context/index.d.ts +102 -100
  26. package/dist/context/index.d.ts.map +1 -0
  27. package/dist/context/index.js +252 -6
  28. package/dist/context/index.js.map +1 -0
  29. package/dist/context/markers.d.ts +19 -0
  30. package/dist/context/markers.d.ts.map +1 -0
  31. package/dist/context/markers.js +22 -0
  32. package/dist/context/markers.js.map +1 -0
  33. package/dist/db/index.d.ts +185 -85
  34. package/dist/db/index.d.ts.map +1 -0
  35. package/dist/db/index.js +257 -14
  36. package/dist/db/index.js.map +1 -0
  37. package/dist/db/migrations.d.ts +15 -18
  38. package/dist/db/migrations.d.ts.map +1 -0
  39. package/dist/db/migrations.js +82 -1
  40. package/dist/db/migrations.js.map +1 -0
  41. package/dist/db/queries.d.ts +503 -281
  42. package/dist/db/queries.d.ts.map +1 -0
  43. package/dist/db/queries.js +644 -107
  44. package/dist/db/queries.js.map +1 -0
  45. package/dist/db/schema.sql +69 -26
  46. package/dist/db/sqlite-adapter.d.ts +26 -22
  47. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  48. package/dist/db/sqlite-adapter.js +11 -35
  49. package/dist/db/sqlite-adapter.js.map +1 -0
  50. package/dist/db/wal-valve.d.ts +106 -0
  51. package/dist/db/wal-valve.d.ts.map +1 -0
  52. package/dist/db/wal-valve.js +208 -0
  53. package/dist/db/wal-valve.js.map +1 -0
  54. package/dist/directory.d.ts +140 -19
  55. package/dist/directory.d.ts.map +1 -0
  56. package/dist/directory.js +568 -35
  57. package/dist/directory.js.map +1 -0
  58. package/dist/errors.d.ts +32 -45
  59. package/dist/errors.d.ts.map +1 -0
  60. package/dist/errors.js.map +1 -0
  61. package/dist/extraction/astro-extractor.d.ts +79 -0
  62. package/dist/extraction/astro-extractor.d.ts.map +1 -0
  63. package/dist/extraction/astro-extractor.js +320 -0
  64. package/dist/extraction/astro-extractor.js.map +1 -0
  65. package/dist/extraction/cfml-extractor.d.ts +107 -0
  66. package/dist/extraction/cfml-extractor.d.ts.map +1 -0
  67. package/dist/extraction/cfml-extractor.js +494 -0
  68. package/dist/extraction/cfml-extractor.js.map +1 -0
  69. package/dist/extraction/dfm-extractor.d.ts +17 -17
  70. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  71. package/dist/extraction/dfm-extractor.js.map +1 -0
  72. package/dist/extraction/extraction-version.d.ts +25 -0
  73. package/dist/extraction/extraction-version.d.ts.map +1 -0
  74. package/dist/extraction/extraction-version.js +28 -0
  75. package/dist/extraction/extraction-version.js.map +1 -0
  76. package/dist/extraction/function-ref.d.ts +118 -0
  77. package/dist/extraction/function-ref.d.ts.map +1 -0
  78. package/dist/extraction/function-ref.js +727 -0
  79. package/dist/extraction/function-ref.js.map +1 -0
  80. package/dist/extraction/generated-detection.d.ts +30 -0
  81. package/dist/extraction/generated-detection.d.ts.map +1 -0
  82. package/dist/extraction/generated-detection.js +83 -0
  83. package/dist/extraction/generated-detection.js.map +1 -0
  84. package/dist/extraction/grammars.d.ts +74 -30
  85. package/dist/extraction/grammars.d.ts.map +1 -0
  86. package/dist/extraction/grammars.js +289 -15
  87. package/dist/extraction/grammars.js.map +1 -0
  88. package/dist/extraction/index.d.ts +193 -109
  89. package/dist/extraction/index.d.ts.map +1 -0
  90. package/dist/extraction/index.js +1485 -362
  91. package/dist/extraction/index.js.map +1 -0
  92. package/dist/extraction/languages/arkts.d.ts +3 -0
  93. package/dist/extraction/languages/arkts.d.ts.map +1 -0
  94. package/dist/extraction/languages/arkts.js +127 -0
  95. package/dist/extraction/languages/arkts.js.map +1 -0
  96. package/dist/extraction/languages/c-cpp.d.ts +110 -4
  97. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  98. package/dist/extraction/languages/c-cpp.js +713 -2
  99. package/dist/extraction/languages/c-cpp.js.map +1 -0
  100. package/dist/extraction/languages/cfquery.d.ts +12 -0
  101. package/dist/extraction/languages/cfquery.d.ts.map +1 -0
  102. package/dist/extraction/languages/cfquery.js +28 -0
  103. package/dist/extraction/languages/cfquery.js.map +1 -0
  104. package/dist/extraction/languages/cfscript.d.ts +3 -0
  105. package/dist/extraction/languages/cfscript.d.ts.map +1 -0
  106. package/dist/extraction/languages/cfscript.js +73 -0
  107. package/dist/extraction/languages/cfscript.js.map +1 -0
  108. package/dist/extraction/languages/cobol.d.ts +33 -0
  109. package/dist/extraction/languages/cobol.d.ts.map +1 -0
  110. package/dist/extraction/languages/cobol.js +499 -0
  111. package/dist/extraction/languages/cobol.js.map +1 -0
  112. package/dist/extraction/languages/csharp.d.ts +25 -3
  113. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  114. package/dist/extraction/languages/csharp.js +106 -3
  115. package/dist/extraction/languages/csharp.js.map +1 -0
  116. package/dist/extraction/languages/dart.d.ts +3 -3
  117. package/dist/extraction/languages/dart.d.ts.map +1 -0
  118. package/dist/extraction/languages/dart.js +183 -1
  119. package/dist/extraction/languages/dart.js.map +1 -0
  120. package/dist/extraction/languages/erlang.d.ts +3 -0
  121. package/dist/extraction/languages/erlang.d.ts.map +1 -0
  122. package/dist/extraction/languages/erlang.js +350 -0
  123. package/dist/extraction/languages/erlang.js.map +1 -0
  124. package/dist/extraction/languages/go.d.ts +3 -3
  125. package/dist/extraction/languages/go.d.ts.map +1 -0
  126. package/dist/extraction/languages/go.js +55 -2
  127. package/dist/extraction/languages/go.js.map +1 -0
  128. package/dist/extraction/languages/index.d.ts +4 -4
  129. package/dist/extraction/languages/index.d.ts.map +1 -0
  130. package/dist/extraction/languages/index.js +22 -0
  131. package/dist/extraction/languages/index.js.map +1 -0
  132. package/dist/extraction/languages/java.d.ts +3 -3
  133. package/dist/extraction/languages/java.d.ts.map +1 -0
  134. package/dist/extraction/languages/java.js +252 -1
  135. package/dist/extraction/languages/java.js.map +1 -0
  136. package/dist/extraction/languages/javascript.d.ts +3 -3
  137. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  138. package/dist/extraction/languages/javascript.js +16 -0
  139. package/dist/extraction/languages/javascript.js.map +1 -0
  140. package/dist/extraction/languages/kotlin.d.ts +3 -3
  141. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  142. package/dist/extraction/languages/kotlin.js +126 -0
  143. package/dist/extraction/languages/kotlin.js.map +1 -0
  144. package/dist/extraction/languages/lua.d.ts +3 -3
  145. package/dist/extraction/languages/lua.d.ts.map +1 -0
  146. package/dist/extraction/languages/lua.js.map +1 -0
  147. package/dist/extraction/languages/luau.d.ts +3 -3
  148. package/dist/extraction/languages/luau.d.ts.map +1 -0
  149. package/dist/extraction/languages/luau.js.map +1 -0
  150. package/dist/extraction/languages/nix.d.ts +3 -0
  151. package/dist/extraction/languages/nix.d.ts.map +1 -0
  152. package/dist/extraction/languages/nix.js +294 -0
  153. package/dist/extraction/languages/nix.js.map +1 -0
  154. package/dist/extraction/languages/objc.d.ts +3 -0
  155. package/dist/extraction/languages/objc.d.ts.map +1 -0
  156. package/dist/extraction/languages/objc.js +175 -0
  157. package/dist/extraction/languages/objc.js.map +1 -0
  158. package/dist/extraction/languages/pascal.d.ts +3 -3
  159. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  160. package/dist/extraction/languages/pascal.js +11 -0
  161. package/dist/extraction/languages/pascal.js.map +1 -0
  162. package/dist/extraction/languages/php.d.ts +3 -3
  163. package/dist/extraction/languages/php.d.ts.map +1 -0
  164. package/dist/extraction/languages/php.js +90 -1
  165. package/dist/extraction/languages/php.js.map +1 -0
  166. package/dist/extraction/languages/python.d.ts +3 -3
  167. package/dist/extraction/languages/python.d.ts.map +1 -0
  168. package/dist/extraction/languages/python.js.map +1 -0
  169. package/dist/extraction/languages/r.d.ts +3 -0
  170. package/dist/extraction/languages/r.d.ts.map +1 -0
  171. package/dist/extraction/languages/r.js +314 -0
  172. package/dist/extraction/languages/r.js.map +1 -0
  173. package/dist/extraction/languages/ruby.d.ts +3 -3
  174. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  175. package/dist/extraction/languages/ruby.js +35 -0
  176. package/dist/extraction/languages/ruby.js.map +1 -0
  177. package/dist/extraction/languages/rust.d.ts +3 -3
  178. package/dist/extraction/languages/rust.d.ts.map +1 -0
  179. package/dist/extraction/languages/rust.js +35 -2
  180. package/dist/extraction/languages/rust.js.map +1 -0
  181. package/dist/extraction/languages/scala.d.ts +3 -3
  182. package/dist/extraction/languages/scala.d.ts.map +1 -0
  183. package/dist/extraction/languages/scala.js +80 -10
  184. package/dist/extraction/languages/scala.js.map +1 -0
  185. package/dist/extraction/languages/solidity.d.ts +3 -0
  186. package/dist/extraction/languages/solidity.d.ts.map +1 -0
  187. package/dist/extraction/languages/solidity.js +293 -0
  188. package/dist/extraction/languages/solidity.js.map +1 -0
  189. package/dist/extraction/languages/swift.d.ts +3 -3
  190. package/dist/extraction/languages/swift.d.ts.map +1 -0
  191. package/dist/extraction/languages/swift.js +61 -0
  192. package/dist/extraction/languages/swift.js.map +1 -0
  193. package/dist/extraction/languages/terraform.d.ts +3 -0
  194. package/dist/extraction/languages/terraform.d.ts.map +1 -0
  195. package/dist/extraction/languages/terraform.js +641 -0
  196. package/dist/extraction/languages/terraform.js.map +1 -0
  197. package/dist/extraction/languages/typescript.d.ts +16 -3
  198. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  199. package/dist/extraction/languages/typescript.js +38 -0
  200. package/dist/extraction/languages/typescript.js.map +1 -0
  201. package/dist/extraction/languages/vbnet.d.ts +11 -0
  202. package/dist/extraction/languages/vbnet.d.ts.map +1 -0
  203. package/dist/extraction/languages/vbnet.js +141 -0
  204. package/dist/extraction/languages/vbnet.js.map +1 -0
  205. package/dist/extraction/liquid-extractor.d.ts +48 -41
  206. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  207. package/dist/extraction/liquid-extractor.js +53 -9
  208. package/dist/extraction/liquid-extractor.js.map +1 -0
  209. package/dist/extraction/mybatis-extractor.d.ts +68 -0
  210. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  211. package/dist/extraction/mybatis-extractor.js +300 -0
  212. package/dist/extraction/mybatis-extractor.js.map +1 -0
  213. package/dist/extraction/parse-pool.d.ts +152 -0
  214. package/dist/extraction/parse-pool.d.ts.map +1 -0
  215. package/dist/extraction/parse-pool.js +387 -0
  216. package/dist/extraction/parse-pool.js.map +1 -0
  217. package/dist/extraction/parse-worker.d.ts +2 -2
  218. package/dist/extraction/parse-worker.d.ts.map +1 -0
  219. package/dist/extraction/parse-worker.js +13 -3
  220. package/dist/extraction/parse-worker.js.map +1 -0
  221. package/dist/extraction/razor-extractor.d.ts +42 -0
  222. package/dist/extraction/razor-extractor.d.ts.map +1 -0
  223. package/dist/extraction/razor-extractor.js +285 -0
  224. package/dist/extraction/razor-extractor.js.map +1 -0
  225. package/dist/extraction/svelte-extractor.d.ts +42 -42
  226. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  227. package/dist/extraction/svelte-extractor.js +6 -3
  228. package/dist/extraction/svelte-extractor.js.map +1 -0
  229. package/dist/extraction/tree-sitter-helpers.d.ts +7 -18
  230. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  231. package/dist/extraction/tree-sitter-helpers.js +60 -10
  232. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  233. package/dist/extraction/tree-sitter-types.d.ts +224 -157
  234. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  235. package/dist/extraction/tree-sitter-types.js.map +1 -0
  236. package/dist/extraction/tree-sitter.d.ts +689 -221
  237. package/dist/extraction/tree-sitter.d.ts.map +1 -0
  238. package/dist/extraction/tree-sitter.js +4193 -117
  239. package/dist/extraction/tree-sitter.js.map +1 -0
  240. package/dist/extraction/vue-extractor.d.ts +40 -25
  241. package/dist/extraction/vue-extractor.d.ts.map +1 -0
  242. package/dist/extraction/vue-extractor.js +94 -3
  243. package/dist/extraction/vue-extractor.js.map +1 -0
  244. package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  245. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  246. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  247. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  248. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  249. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  250. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  251. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  252. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  253. package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  254. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  255. package/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
  256. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  257. package/dist/extraction/wasm-runtime-flags.d.ts +6 -14
  258. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  259. package/dist/extraction/wasm-runtime-flags.js +1 -0
  260. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  261. package/dist/graph/index.d.ts +3 -3
  262. package/dist/graph/index.d.ts.map +1 -0
  263. package/dist/graph/index.js.map +1 -0
  264. package/dist/graph/queries.d.ts +96 -99
  265. package/dist/graph/queries.d.ts.map +1 -0
  266. package/dist/graph/queries.js +13 -40
  267. package/dist/graph/queries.js.map +1 -0
  268. package/dist/graph/traversal.d.ts +117 -127
  269. package/dist/graph/traversal.d.ts.map +1 -0
  270. package/dist/graph/traversal.js +92 -21
  271. package/dist/graph/traversal.js.map +1 -0
  272. package/dist/index.d.ts +615 -481
  273. package/dist/index.d.ts.map +1 -0
  274. package/dist/index.js +709 -18
  275. package/dist/index.js.map +1 -0
  276. package/dist/installer/config-writer.d.ts +13 -14
  277. package/dist/installer/config-writer.d.ts.map +1 -0
  278. package/dist/installer/config-writer.js +91 -0
  279. package/dist/installer/config-writer.js.map +1 -0
  280. package/dist/installer/index.d.ts +84 -82
  281. package/dist/installer/index.d.ts.map +1 -0
  282. package/dist/installer/index.js +619 -0
  283. package/dist/installer/index.js.map +1 -0
  284. package/dist/installer/instructions-template.d.ts +35 -24
  285. package/dist/installer/instructions-template.d.ts.map +1 -0
  286. package/dist/installer/instructions-template.js +53 -0
  287. package/dist/installer/instructions-template.js.map +1 -0
  288. package/dist/installer/targets/antigravity.d.ts +57 -0
  289. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  290. package/dist/installer/targets/antigravity.js +308 -0
  291. package/dist/installer/targets/antigravity.js.map +1 -0
  292. package/dist/installer/targets/claude.d.ts +34 -27
  293. package/dist/installer/targets/claude.d.ts.map +1 -0
  294. package/dist/installer/targets/claude.js +454 -0
  295. package/dist/installer/targets/claude.js.map +1 -0
  296. package/dist/installer/targets/codex.d.ts +3 -3
  297. package/dist/installer/targets/codex.d.ts.map +1 -0
  298. package/dist/installer/targets/codex.js +185 -0
  299. package/dist/installer/targets/codex.js.map +1 -0
  300. package/dist/installer/targets/cursor.d.ts +3 -3
  301. package/dist/installer/targets/cursor.d.ts.map +1 -0
  302. package/dist/installer/targets/cursor.js +254 -0
  303. package/dist/installer/targets/cursor.js.map +1 -0
  304. package/dist/installer/targets/gemini.d.ts +26 -0
  305. package/dist/installer/targets/gemini.d.ts.map +1 -0
  306. package/dist/installer/targets/gemini.js +165 -0
  307. package/dist/installer/targets/gemini.js.map +1 -0
  308. package/dist/installer/targets/hermes.d.ts +3 -3
  309. package/dist/installer/targets/hermes.d.ts.map +1 -0
  310. package/dist/installer/targets/hermes.js +359 -0
  311. package/dist/installer/targets/hermes.js.map +1 -0
  312. package/dist/installer/targets/kiro.d.ts +27 -0
  313. package/dist/installer/targets/kiro.d.ts.map +1 -0
  314. package/dist/installer/targets/kiro.js +178 -0
  315. package/dist/installer/targets/kiro.js.map +1 -0
  316. package/dist/installer/targets/opencode.d.ts +12 -4
  317. package/dist/installer/targets/opencode.d.ts.map +1 -0
  318. package/dist/installer/targets/opencode.js +288 -0
  319. package/dist/installer/targets/opencode.js.map +1 -0
  320. package/dist/installer/targets/registry.d.ts +9 -12
  321. package/dist/installer/targets/registry.d.ts.map +1 -0
  322. package/dist/installer/targets/registry.js +91 -0
  323. package/dist/installer/targets/registry.js.map +1 -0
  324. package/dist/installer/targets/shared.d.ts +38 -29
  325. package/dist/installer/targets/shared.d.ts.map +1 -0
  326. package/dist/installer/targets/shared.js +264 -0
  327. package/dist/installer/targets/shared.js.map +1 -0
  328. package/dist/installer/targets/toml.d.ts +11 -23
  329. package/dist/installer/targets/toml.d.ts.map +1 -0
  330. package/dist/installer/targets/toml.js +147 -0
  331. package/dist/installer/targets/toml.js.map +1 -0
  332. package/dist/installer/targets/types.d.ts +62 -76
  333. package/dist/installer/targets/types.d.ts.map +1 -0
  334. package/dist/installer/targets/types.js +16 -0
  335. package/dist/installer/targets/types.js.map +1 -0
  336. package/dist/mcp/daemon-manager.d.ts +42 -0
  337. package/dist/mcp/daemon-manager.d.ts.map +1 -0
  338. package/dist/mcp/daemon-manager.js +129 -0
  339. package/dist/mcp/daemon-manager.js.map +1 -0
  340. package/dist/mcp/daemon-paths.d.ts +73 -0
  341. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  342. package/dist/mcp/daemon-paths.js +165 -0
  343. package/dist/mcp/daemon-paths.js.map +1 -0
  344. package/dist/mcp/daemon-registry.d.ts +47 -0
  345. package/dist/mcp/daemon-registry.d.ts.map +1 -0
  346. package/dist/mcp/daemon-registry.js +233 -0
  347. package/dist/mcp/daemon-registry.js.map +1 -0
  348. package/dist/mcp/daemon.d.ts +290 -0
  349. package/dist/mcp/daemon.d.ts.map +1 -0
  350. package/dist/mcp/daemon.js +862 -0
  351. package/dist/mcp/daemon.js.map +1 -0
  352. package/dist/mcp/dynamic-boundaries.d.ts +41 -0
  353. package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  354. package/dist/mcp/dynamic-boundaries.js +360 -0
  355. package/dist/mcp/dynamic-boundaries.js.map +1 -0
  356. package/dist/mcp/early-ppid.d.ts +26 -0
  357. package/dist/mcp/early-ppid.d.ts.map +1 -0
  358. package/dist/mcp/early-ppid.js +29 -0
  359. package/dist/mcp/early-ppid.js.map +1 -0
  360. package/dist/mcp/engine.d.ts +122 -0
  361. package/dist/mcp/engine.d.ts.map +1 -0
  362. package/dist/mcp/engine.js +350 -0
  363. package/dist/mcp/engine.js.map +1 -0
  364. package/dist/mcp/index.d.ts +89 -74
  365. package/dist/mcp/index.d.ts.map +1 -0
  366. package/dist/mcp/index.js +506 -0
  367. package/dist/mcp/index.js.map +1 -0
  368. package/dist/mcp/liveness-watchdog.d.ts +35 -0
  369. package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  370. package/dist/mcp/liveness-watchdog.js +267 -0
  371. package/dist/mcp/liveness-watchdog.js.map +1 -0
  372. package/dist/mcp/ppid-watchdog.d.ts +62 -0
  373. package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  374. package/dist/mcp/ppid-watchdog.js +64 -0
  375. package/dist/mcp/ppid-watchdog.js.map +1 -0
  376. package/dist/mcp/proxy.d.ts +87 -0
  377. package/dist/mcp/proxy.d.ts.map +1 -0
  378. package/dist/mcp/proxy.js +667 -0
  379. package/dist/mcp/proxy.js.map +1 -0
  380. package/dist/mcp/query-pool.d.ts +108 -0
  381. package/dist/mcp/query-pool.d.ts.map +1 -0
  382. package/dist/mcp/query-pool.js +315 -0
  383. package/dist/mcp/query-pool.js.map +1 -0
  384. package/dist/mcp/query-worker.d.ts +24 -0
  385. package/dist/mcp/query-worker.d.ts.map +1 -0
  386. package/dist/mcp/query-worker.js +87 -0
  387. package/dist/mcp/query-worker.js.map +1 -0
  388. package/dist/mcp/server-instructions.d.ts +22 -8
  389. package/dist/mcp/server-instructions.d.ts.map +1 -0
  390. package/dist/mcp/server-instructions.js +106 -0
  391. package/dist/mcp/server-instructions.js.map +1 -0
  392. package/dist/mcp/session.d.ts +93 -0
  393. package/dist/mcp/session.d.ts.map +1 -0
  394. package/dist/mcp/session.js +357 -0
  395. package/dist/mcp/session.js.map +1 -0
  396. package/dist/mcp/startup-handshake.d.ts +44 -0
  397. package/dist/mcp/startup-handshake.d.ts.map +1 -0
  398. package/dist/mcp/startup-handshake.js +73 -0
  399. package/dist/mcp/startup-handshake.js.map +1 -0
  400. package/dist/mcp/stdin-teardown.d.ts +27 -0
  401. package/dist/mcp/stdin-teardown.d.ts.map +1 -0
  402. package/dist/mcp/stdin-teardown.js +49 -0
  403. package/dist/mcp/stdin-teardown.js.map +1 -0
  404. package/dist/mcp/tools.d.ts +557 -213
  405. package/dist/mcp/tools.d.ts.map +1 -0
  406. package/dist/mcp/tools.js +4477 -0
  407. package/dist/mcp/tools.js.map +1 -0
  408. package/dist/mcp/transport.d.ts +158 -87
  409. package/dist/mcp/transport.d.ts.map +1 -0
  410. package/dist/mcp/transport.js +377 -0
  411. package/dist/mcp/transport.js.map +1 -0
  412. package/dist/mcp/version.d.ts +19 -0
  413. package/dist/mcp/version.d.ts.map +1 -0
  414. package/dist/mcp/version.js +71 -0
  415. package/dist/mcp/version.js.map +1 -0
  416. package/dist/project-config.d.ts +94 -0
  417. package/dist/project-config.d.ts.map +1 -0
  418. package/dist/project-config.js +374 -0
  419. package/dist/project-config.js.map +1 -0
  420. package/dist/resolution/c-fnptr-synthesizer.d.ts +6 -0
  421. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  422. package/dist/resolution/c-fnptr-synthesizer.js +1062 -0
  423. package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  424. package/dist/resolution/callback-synthesizer.d.ts +15 -0
  425. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  426. package/dist/resolution/callback-synthesizer.js +3938 -0
  427. package/dist/resolution/callback-synthesizer.js.map +1 -0
  428. package/dist/resolution/cooperative-yield.d.ts +32 -0
  429. package/dist/resolution/cooperative-yield.d.ts.map +1 -0
  430. package/dist/resolution/cooperative-yield.js +42 -0
  431. package/dist/resolution/cooperative-yield.js.map +1 -0
  432. package/dist/resolution/frameworks/astro.d.ts +9 -0
  433. package/dist/resolution/frameworks/astro.d.ts.map +1 -0
  434. package/dist/resolution/frameworks/astro.js +169 -0
  435. package/dist/resolution/frameworks/astro.js.map +1 -0
  436. package/dist/resolution/frameworks/cargo-workspace.d.ts +3 -5
  437. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  438. package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  439. package/dist/resolution/frameworks/cics.d.ts +20 -0
  440. package/dist/resolution/frameworks/cics.d.ts.map +1 -0
  441. package/dist/resolution/frameworks/cics.js +90 -0
  442. package/dist/resolution/frameworks/cics.js.map +1 -0
  443. package/dist/resolution/frameworks/csharp.d.ts +3 -3
  444. package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  445. package/dist/resolution/frameworks/csharp.js +36 -8
  446. package/dist/resolution/frameworks/csharp.js.map +1 -0
  447. package/dist/resolution/frameworks/drupal.d.ts +3 -3
  448. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  449. package/dist/resolution/frameworks/drupal.js +44 -12
  450. package/dist/resolution/frameworks/drupal.js.map +1 -0
  451. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  452. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  453. package/dist/resolution/frameworks/expo-modules.js +148 -0
  454. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  455. package/dist/resolution/frameworks/express.d.ts +3 -3
  456. package/dist/resolution/frameworks/express.d.ts.map +1 -0
  457. package/dist/resolution/frameworks/express.js +102 -19
  458. package/dist/resolution/frameworks/express.js.map +1 -0
  459. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  460. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  461. package/dist/resolution/frameworks/fabric.js +354 -0
  462. package/dist/resolution/frameworks/fabric.js.map +1 -0
  463. package/dist/resolution/frameworks/go.d.ts +3 -3
  464. package/dist/resolution/frameworks/go.d.ts.map +1 -0
  465. package/dist/resolution/frameworks/go.js +6 -3
  466. package/dist/resolution/frameworks/go.js.map +1 -0
  467. package/dist/resolution/frameworks/goframe.d.ts +41 -0
  468. package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  469. package/dist/resolution/frameworks/goframe.js +112 -0
  470. package/dist/resolution/frameworks/goframe.js.map +1 -0
  471. package/dist/resolution/frameworks/index.d.ts +29 -31
  472. package/dist/resolution/frameworks/index.d.ts.map +1 -0
  473. package/dist/resolution/frameworks/index.js +39 -1
  474. package/dist/resolution/frameworks/index.js.map +1 -0
  475. package/dist/resolution/frameworks/java.d.ts +3 -3
  476. package/dist/resolution/frameworks/java.d.ts.map +1 -0
  477. package/dist/resolution/frameworks/java.js +352 -12
  478. package/dist/resolution/frameworks/java.js.map +1 -0
  479. package/dist/resolution/frameworks/laravel.d.ts +4 -4
  480. package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  481. package/dist/resolution/frameworks/laravel.js +17 -8
  482. package/dist/resolution/frameworks/laravel.js.map +1 -0
  483. package/dist/resolution/frameworks/nestjs.d.ts +3 -3
  484. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  485. package/dist/resolution/frameworks/nestjs.js +324 -0
  486. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  487. package/dist/resolution/frameworks/play.d.ts +19 -0
  488. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  489. package/dist/resolution/frameworks/play.js +111 -0
  490. package/dist/resolution/frameworks/play.js.map +1 -0
  491. package/dist/resolution/frameworks/python.d.ts +5 -5
  492. package/dist/resolution/frameworks/python.d.ts.map +1 -0
  493. package/dist/resolution/frameworks/python.js +138 -16
  494. package/dist/resolution/frameworks/python.js.map +1 -0
  495. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  496. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  497. package/dist/resolution/frameworks/react-native.js +410 -0
  498. package/dist/resolution/frameworks/react-native.js.map +1 -0
  499. package/dist/resolution/frameworks/react.d.ts +3 -3
  500. package/dist/resolution/frameworks/react.d.ts.map +1 -0
  501. package/dist/resolution/frameworks/react.js +122 -60
  502. package/dist/resolution/frameworks/react.js.map +1 -0
  503. package/dist/resolution/frameworks/ruby.d.ts +3 -3
  504. package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  505. package/dist/resolution/frameworks/ruby.js +106 -2
  506. package/dist/resolution/frameworks/ruby.js.map +1 -0
  507. package/dist/resolution/frameworks/rust.d.ts +3 -3
  508. package/dist/resolution/frameworks/rust.d.ts.map +1 -0
  509. package/dist/resolution/frameworks/rust.js +102 -5
  510. package/dist/resolution/frameworks/rust.js.map +1 -0
  511. package/dist/resolution/frameworks/svelte.d.ts +3 -3
  512. package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  513. package/dist/resolution/frameworks/svelte.js +5 -1
  514. package/dist/resolution/frameworks/svelte.js.map +1 -0
  515. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  516. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  517. package/dist/resolution/frameworks/swift-objc.js +252 -0
  518. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  519. package/dist/resolution/frameworks/swift.d.ts +5 -5
  520. package/dist/resolution/frameworks/swift.d.ts.map +1 -0
  521. package/dist/resolution/frameworks/swift.js +30 -6
  522. package/dist/resolution/frameworks/swift.js.map +1 -0
  523. package/dist/resolution/frameworks/terraform.d.ts +38 -0
  524. package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
  525. package/dist/resolution/frameworks/terraform.js +277 -0
  526. package/dist/resolution/frameworks/terraform.js.map +1 -0
  527. package/dist/resolution/frameworks/vue.d.ts +3 -3
  528. package/dist/resolution/frameworks/vue.d.ts.map +1 -0
  529. package/dist/resolution/frameworks/vue.js +24 -27
  530. package/dist/resolution/frameworks/vue.js.map +1 -0
  531. package/dist/resolution/go-module.d.ts +26 -0
  532. package/dist/resolution/go-module.d.ts.map +1 -0
  533. package/dist/resolution/go-module.js +78 -0
  534. package/dist/resolution/go-module.js.map +1 -0
  535. package/dist/resolution/goframe-synthesizer.d.ts +29 -0
  536. package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  537. package/dist/resolution/goframe-synthesizer.js +163 -0
  538. package/dist/resolution/goframe-synthesizer.js.map +1 -0
  539. package/dist/resolution/import-resolver.d.ts +53 -29
  540. package/dist/resolution/import-resolver.d.ts.map +1 -0
  541. package/dist/resolution/import-resolver.js +1319 -8
  542. package/dist/resolution/import-resolver.js.map +1 -0
  543. package/dist/resolution/index.d.ts +243 -103
  544. package/dist/resolution/index.d.ts.map +1 -0
  545. package/dist/resolution/index.js +1055 -53
  546. package/dist/resolution/index.js.map +1 -0
  547. package/dist/resolution/lru-cache.d.ts +9 -9
  548. package/dist/resolution/lru-cache.d.ts.map +1 -0
  549. package/dist/resolution/lru-cache.js.map +1 -0
  550. package/dist/resolution/name-matcher.d.ts +91 -29
  551. package/dist/resolution/name-matcher.d.ts.map +1 -0
  552. package/dist/resolution/name-matcher.js +1478 -32
  553. package/dist/resolution/name-matcher.js.map +1 -0
  554. package/dist/resolution/path-aliases.d.ts +23 -27
  555. package/dist/resolution/path-aliases.d.ts.map +1 -0
  556. package/dist/resolution/path-aliases.js.map +1 -0
  557. package/dist/resolution/strip-comments.d.ts +3 -16
  558. package/dist/resolution/strip-comments.d.ts.map +1 -0
  559. package/dist/resolution/strip-comments.js +51 -0
  560. package/dist/resolution/strip-comments.js.map +1 -0
  561. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  562. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  563. package/dist/resolution/swift-objc-bridge.js +256 -0
  564. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  565. package/dist/resolution/types.d.ts +217 -136
  566. package/dist/resolution/types.d.ts.map +1 -0
  567. package/dist/resolution/types.js.map +1 -0
  568. package/dist/resolution/workspace-packages.d.ts +58 -0
  569. package/dist/resolution/workspace-packages.d.ts.map +1 -0
  570. package/dist/resolution/workspace-packages.js +346 -0
  571. package/dist/resolution/workspace-packages.js.map +1 -0
  572. package/dist/search/identifier-segments.d.ts +60 -0
  573. package/dist/search/identifier-segments.d.ts.map +1 -0
  574. package/dist/search/identifier-segments.js +176 -0
  575. package/dist/search/identifier-segments.js.map +1 -0
  576. package/dist/search/query-parser.d.ts +14 -18
  577. package/dist/search/query-parser.d.ts.map +1 -0
  578. package/dist/search/query-parser.js.map +1 -0
  579. package/dist/search/query-utils.d.ts +45 -17
  580. package/dist/search/query-utils.d.ts.map +1 -0
  581. package/dist/search/query-utils.js +113 -47
  582. package/dist/search/query-utils.js.map +1 -0
  583. package/dist/sync/git-hooks.d.ts +13 -22
  584. package/dist/sync/git-hooks.d.ts.map +1 -0
  585. package/dist/sync/git-hooks.js +4 -0
  586. package/dist/sync/git-hooks.js.map +1 -0
  587. package/dist/sync/index.d.ts +6 -12
  588. package/dist/sync/index.d.ts.map +1 -0
  589. package/dist/sync/index.js +8 -1
  590. package/dist/sync/index.js.map +1 -0
  591. package/dist/sync/watch-policy.d.ts +8 -11
  592. package/dist/sync/watch-policy.d.ts.map +1 -0
  593. package/dist/sync/watch-policy.js.map +1 -0
  594. package/dist/sync/watcher.d.ts +335 -63
  595. package/dist/sync/watcher.d.ts.map +1 -0
  596. package/dist/sync/watcher.js +709 -53
  597. package/dist/sync/watcher.js.map +1 -0
  598. package/dist/sync/worktree.d.ts +63 -0
  599. package/dist/sync/worktree.d.ts.map +1 -0
  600. package/dist/sync/worktree.js +182 -0
  601. package/dist/sync/worktree.js.map +1 -0
  602. package/dist/telemetry/index.d.ts +143 -0
  603. package/dist/telemetry/index.d.ts.map +1 -0
  604. package/dist/telemetry/index.js +541 -0
  605. package/dist/telemetry/index.js.map +1 -0
  606. package/dist/types.d.ts +308 -326
  607. package/dist/types.d.ts.map +1 -0
  608. package/dist/types.js +16 -0
  609. package/dist/types.js.map +1 -0
  610. package/dist/ui/glyphs.d.ts +20 -20
  611. package/dist/ui/glyphs.d.ts.map +1 -0
  612. package/dist/ui/glyphs.js +78 -0
  613. package/dist/ui/glyphs.js.map +1 -0
  614. package/dist/ui/shimmer-progress.d.ts +7 -7
  615. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  616. package/dist/ui/shimmer-progress.js +90 -0
  617. package/dist/ui/shimmer-progress.js.map +1 -0
  618. package/dist/ui/shimmer-worker.d.ts +2 -2
  619. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  620. package/dist/ui/shimmer-worker.js +118 -0
  621. package/dist/ui/shimmer-worker.js.map +1 -0
  622. package/dist/ui/types.d.ts +14 -17
  623. package/dist/ui/types.d.ts.map +1 -0
  624. package/dist/ui/types.js +3 -0
  625. package/dist/ui/types.js.map +1 -0
  626. package/dist/upgrade/index.d.ts +164 -0
  627. package/dist/upgrade/index.d.ts.map +1 -0
  628. package/dist/upgrade/index.js +646 -0
  629. package/dist/upgrade/index.js.map +1 -0
  630. package/dist/upgrade/remove-binary.d.ts +87 -0
  631. package/dist/upgrade/remove-binary.d.ts.map +1 -0
  632. package/dist/upgrade/remove-binary.js +289 -0
  633. package/dist/upgrade/remove-binary.js.map +1 -0
  634. package/dist/upgrade/update-check.d.ts +92 -0
  635. package/dist/upgrade/update-check.d.ts.map +1 -0
  636. package/dist/upgrade/update-check.js +258 -0
  637. package/dist/upgrade/update-check.js.map +1 -0
  638. package/dist/utils.d.ts +116 -123
  639. package/dist/utils.d.ts.map +1 -0
  640. package/dist/utils.js +83 -49
  641. package/dist/utils.js.map +1 -0
  642. package/package.json +42 -10
  643. package/scripts/add-lang/bench.sh +60 -0
  644. package/scripts/add-lang/check-grammar.mjs +75 -0
  645. package/scripts/add-lang/dump-ast.mjs +103 -0
  646. package/scripts/add-lang/verify-extraction.mjs +70 -0
  647. package/scripts/agent-eval/ab-adoption.sh +91 -0
  648. package/scripts/agent-eval/ab-hook.sh +86 -0
  649. package/scripts/agent-eval/ab-impl.sh +78 -0
  650. package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
  651. package/scripts/agent-eval/ab-sufficiency.sh +78 -0
  652. package/scripts/agent-eval/arms-F.sh +21 -0
  653. package/scripts/agent-eval/arms-matrix.sh +37 -0
  654. package/scripts/agent-eval/audit.sh +68 -0
  655. package/scripts/agent-eval/bench-readme.sh +28 -0
  656. package/scripts/agent-eval/bench-why-repo.sh +22 -0
  657. package/scripts/agent-eval/block-read-hook.sh +19 -0
  658. package/scripts/agent-eval/hook-settings.json +15 -0
  659. package/scripts/agent-eval/itrun.sh +120 -0
  660. package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
  661. package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
  662. package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
  663. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
  664. package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
  665. package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
  666. package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
  667. package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
  668. package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
  669. package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
  670. package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
  671. package/scripts/agent-eval/offload-eval-setup.sh +24 -0
  672. package/scripts/agent-eval/offload-eval-styles.sh +72 -0
  673. package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
  674. package/scripts/agent-eval/offload-eval.md +76 -0
  675. package/scripts/agent-eval/parse-arms.mjs +116 -0
  676. package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
  677. package/scripts/agent-eval/parse-run.mjs +45 -0
  678. package/scripts/agent-eval/parse-session.mjs +93 -0
  679. package/scripts/agent-eval/probe-context.mjs +21 -0
  680. package/scripts/agent-eval/probe-explore.mjs +40 -0
  681. package/scripts/agent-eval/probe-node.mjs +20 -0
  682. package/scripts/agent-eval/probe-sweep.mjs +119 -0
  683. package/scripts/agent-eval/probe-trace.mjs +20 -0
  684. package/scripts/agent-eval/redirect-read-hook.sh +38 -0
  685. package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -0
  686. package/scripts/agent-eval/repro-daemon-clients.mjs +125 -0
  687. package/scripts/agent-eval/run-agent.sh +34 -0
  688. package/scripts/agent-eval/run-all.sh +75 -0
  689. package/scripts/agent-eval/run-arms.sh +56 -0
  690. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  691. package/scripts/build-bundle.sh +123 -0
  692. package/scripts/extract-release-notes.mjs +130 -0
  693. package/scripts/local-install.sh +41 -0
  694. package/scripts/npm-sdk.js +75 -0
  695. package/scripts/npm-shim.js +275 -0
  696. package/scripts/pack-npm.sh +119 -0
  697. package/scripts/prepare-release.mjs +270 -0
  698. package/dist/extraction/wasm/tree-sitter-c.wasm +0 -0
  699. package/dist/extraction/wasm/tree-sitter-cpp.wasm +0 -0
  700. package/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
  701. package/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
  702. package/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
  703. package/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
  704. package/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  705. package/dist/extraction/wasm/tree-sitter-php.wasm +0 -0
  706. package/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
  707. package/dist/extraction/wasm/tree-sitter-ruby.wasm +0 -0
  708. package/dist/extraction/wasm/tree-sitter-rust.wasm +0 -0
  709. package/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
  710. package/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
  711. package/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
  712. package/dist/installer/claude-md-template.d.ts +0 -19
package/dist/index.d.ts CHANGED
@@ -4,96 +4,49 @@
4
4
  * A local-first code intelligence system that builds a semantic
5
5
  * knowledge graph from any codebase.
6
6
  */
7
- import {
8
- Node,
9
- Edge,
10
- FileRecord,
11
- ExtractionResult,
12
- Subgraph,
13
- TraversalOptions,
14
- SearchOptions,
15
- SearchResult,
16
- Context,
17
- GraphStats,
18
- TaskInput,
19
- TaskContext,
20
- BuildContextOptions,
21
- FindRelevantContextOptions,
22
- } from './types'
23
- import { IndexProgress, IndexResult, SyncResult } from './extraction'
24
- import { ResolutionResult } from './resolution'
25
- import { WatchOptions } from './sync'
26
- export * from './types'
27
- export { getDatabasePath } from './db'
28
- export {
29
- getCodeGraphDir,
30
- isInitialized,
31
- findNearestCodeGraphRoot,
32
- CODEGRAPH_DIR,
33
- } from './directory'
34
- export { IndexProgress, IndexResult, SyncResult } from './extraction'
35
- export {
36
- detectLanguage,
37
- isLanguageSupported,
38
- isGrammarLoaded,
39
- getSupportedLanguages,
40
- initGrammars,
41
- loadGrammarsForLanguages,
42
- loadAllGrammars,
43
- } from './extraction'
44
- export { ResolutionResult } from './resolution'
45
- export {
46
- CodeGraphError,
47
- FileError,
48
- ParseError,
49
- DatabaseError,
50
- SearchError,
51
- VectorError,
52
- ConfigError,
53
- Logger,
54
- setLogger,
55
- getLogger,
56
- silentLogger,
57
- defaultLogger,
58
- } from './errors'
59
- export {
60
- Mutex,
61
- FileLock,
62
- processInBatches,
63
- debounce,
64
- throttle,
65
- MemoryMonitor,
66
- } from './utils'
67
- export { FileWatcher, WatchOptions } from './sync'
68
- export { MCPServer } from './mcp'
7
+ import { Node, Edge, FileRecord, ExtractionResult, Subgraph, TraversalOptions, SearchOptions, SearchResult, SegmentMatch, Context, GraphStats, TaskInput, TaskContext, BuildContextOptions, FindRelevantContextOptions } from './types';
8
+ import { IndexProgress, IndexResult, SyncResult } from './extraction';
9
+ import { ResolutionResult } from './resolution';
10
+ import { WatchOptions, PendingFile } from './sync';
11
+ export * from './types';
12
+ export { getDatabasePath, DatabaseConnection } from './db';
13
+ export { QueryBuilder } from './db/queries';
14
+ export { getCodeGraphDir, isInitialized, findNearestCodeGraphRoot, CODEGRAPH_DIR, } from './directory';
15
+ export { IndexProgress, IndexResult, SyncResult } from './extraction';
16
+ export { detectLanguage, isLanguageSupported, isGrammarLoaded, getSupportedLanguages, initGrammars, loadGrammarsForLanguages, loadAllGrammars } from './extraction';
17
+ export { ResolutionResult } from './resolution';
18
+ export { CodeGraphError, FileError, ParseError, DatabaseError, SearchError, VectorError, ConfigError, Logger, setLogger, getLogger, silentLogger, defaultLogger, } from './errors';
19
+ export { Mutex, FileLock, processInBatches, debounce, throttle, MemoryMonitor } from './utils';
20
+ export { FileWatcher, WatchOptions, PendingFile, LockUnavailableError } from './sync';
21
+ export { MCPServer } from './mcp';
69
22
  /**
70
23
  * Options for initializing a new CodeGraph project
71
24
  */
72
25
  export interface InitOptions {
73
- /** Whether to run initial indexing after init */
74
- index?: boolean
75
- /** Progress callback for indexing */
76
- onProgress?: (progress: IndexProgress) => void
26
+ /** Whether to run initial indexing after init */
27
+ index?: boolean;
28
+ /** Progress callback for indexing */
29
+ onProgress?: (progress: IndexProgress) => void;
77
30
  }
78
31
  /**
79
32
  * Options for opening an existing CodeGraph project
80
33
  */
81
34
  export interface OpenOptions {
82
- /** Whether to run sync if files have changed */
83
- sync?: boolean
84
- /** Whether to run in read-only mode */
85
- readOnly?: boolean
35
+ /** Whether to run sync if files have changed */
36
+ sync?: boolean;
37
+ /** Whether to run in read-only mode */
38
+ readOnly?: boolean;
86
39
  }
87
40
  /**
88
41
  * Options for indexing
89
42
  */
90
43
  export interface IndexOptions {
91
- /** Progress callback */
92
- onProgress?: (progress: IndexProgress) => void
93
- /** Abort signal for cancellation */
94
- signal?: AbortSignal
95
- /** Enable verbose logging (worker lifecycle, memory, timeouts) */
96
- verbose?: boolean
44
+ /** Progress callback */
45
+ onProgress?: (progress: IndexProgress) => void;
46
+ /** Abort signal for cancellation */
47
+ signal?: AbortSignal;
48
+ /** Enable verbose logging (worker lifecycle, memory, timeouts) */
49
+ verbose?: boolean;
97
50
  }
98
51
  /**
99
52
  * Main CodeGraph class
@@ -101,409 +54,590 @@ export interface IndexOptions {
101
54
  * Provides the primary interface for interacting with the code knowledge graph.
102
55
  */
103
56
  export declare class CodeGraph {
104
- private db
105
- private queries
106
- private projectRoot
107
- private orchestrator
108
- private resolver
109
- private graphManager
110
- private traverser
111
- private contextBuilder
112
- private indexMutex
113
- private fileLock
114
- private watcher
115
- private constructor()
116
- /**
117
- * Initialize a new CodeGraph project
118
- *
119
- * Creates the .CodeGraph directory, database, and configuration.
120
- *
121
- * @param projectRoot - Path to the project root directory
122
- * @param options - Initialization options
123
- * @returns A new CodeGraph instance
124
- */
125
- static init(projectRoot: string, options?: InitOptions): Promise<CodeGraph>
126
- /**
127
- * Initialize synchronously (without indexing)
128
- */
129
- static initSync(projectRoot: string): CodeGraph
130
- /**
131
- * Open an existing CodeGraph project
132
- *
133
- * @param projectRoot - Path to the project root directory
134
- * @param options - Open options
135
- * @returns A CodeGraph instance
136
- */
137
- static open(projectRoot: string, options?: OpenOptions): Promise<CodeGraph>
138
- /**
139
- * Open synchronously (without sync)
140
- */
141
- static openSync(projectRoot: string): CodeGraph
142
- /**
143
- * Check if a directory has been initialized as a CodeGraph project
144
- */
145
- static isInitialized(projectRoot: string): boolean
146
- /**
147
- * Close the CodeGraph instance and release resources
148
- */
149
- close(): void
150
- /**
151
- * Get the project root directory
152
- */
153
- getProjectRoot(): string
154
- /**
155
- * Index all files in the project
156
- *
157
- * Uses a mutex to prevent concurrent indexing operations.
158
- */
159
- indexAll(options?: IndexOptions): Promise<IndexResult>
160
- /**
161
- * Index specific files
162
- *
163
- * Uses a mutex to prevent concurrent indexing operations.
164
- */
165
- indexFiles(filePaths: string[]): Promise<IndexResult>
166
- /**
167
- * Sync with current file state (incremental update)
168
- *
169
- * Uses a mutex to prevent concurrent indexing operations.
170
- */
171
- sync(options?: IndexOptions): Promise<SyncResult>
172
- /**
173
- * Check if an indexing operation is currently in progress
174
- */
175
- isIndexing(): boolean
176
- /**
177
- * Start watching for file changes and auto-syncing.
178
- *
179
- * Uses native OS file events (FSEvents on macOS, inotify on Linux 19+,
180
- * ReadDirectoryChangesW on Windows) with debouncing to avoid thrashing.
181
- *
182
- * @param options - Watch options (debounce delay, callbacks)
183
- * @returns true if watching started successfully
184
- */
185
- watch(options?: WatchOptions): boolean
186
- /**
187
- * Stop watching for file changes.
188
- */
189
- unwatch(): void
190
- /**
191
- * Check if the file watcher is active.
192
- */
193
- isWatching(): boolean
194
- /**
195
- * Get files that have changed since last index
196
- */
197
- getChangedFiles(): {
198
- added: string[]
199
- modified: string[]
200
- removed: string[]
201
- }
202
- /**
203
- * Extract nodes and edges from source code (without storing)
204
- */
205
- extractFromSource(filePath: string, source: string): ExtractionResult
206
- /**
207
- * Resolve unresolved references and create edges
208
- *
209
- * This method takes unresolved references from extraction and attempts
210
- * to resolve them using multiple strategies:
211
- * - Framework-specific patterns (React, Express, Laravel)
212
- * - Import-based resolution
213
- * - Name-based symbol matching
214
- */
215
- resolveReferences(
216
- onProgress?: (current: number, total: number) => void,
217
- ): ResolutionResult
218
- /**
219
- * Resolve references in batches to keep memory bounded on large codebases.
220
- * Processes chunks of unresolved refs, persisting results after each batch.
221
- */
222
- resolveReferencesBatched(
223
- onProgress?: (current: number, total: number) => void,
224
- ): Promise<ResolutionResult>
225
- /**
226
- * Get detected frameworks in the project
227
- */
228
- getDetectedFrameworks(): string[]
229
- /**
230
- * Re-initialize the resolver (useful after adding new files)
231
- */
232
- reinitializeResolver(): void
233
- /**
234
- * Get statistics about the knowledge graph
235
- */
236
- getStats(): GraphStats
237
- /**
238
- * Active SQLite backend for this project's connection (`node-sqlite` Node's
239
- * built-in real-SQLite module). Surfaced via `codegraph status` and the
240
- * `codegraph_status` MCP tool alongside the effective journal mode.
241
- */
242
- getBackend(): import('./db').SqliteBackend
243
- /**
244
- * The journal mode actually in effect ('wal', 'delete', …). 'wal' means
245
- * readers never block on a concurrent writer; anything else means they can,
246
- * which is the precondition for the "database is locked" failures in issue
247
- * #238. Surfaced via `codegraph status` and the `codegraph_status` MCP tool.
248
- */
249
- getJournalMode(): string
250
- /**
251
- * Get a node by ID
252
- */
253
- getNode(id: string): Node | null
254
- /**
255
- * Get all nodes in a file
256
- */
257
- getNodesInFile(filePath: string): Node[]
258
- /**
259
- * Get all nodes of a specific kind
260
- */
261
- getNodesByKind(kind: Node['kind']): Node[]
262
- /**
263
- * Search nodes by text
264
- */
265
- searchNodes(query: string, options?: SearchOptions): SearchResult[]
266
- /**
267
- * Get outgoing edges from a node
268
- */
269
- getOutgoingEdges(nodeId: string): Edge[]
270
- /**
271
- * Get incoming edges to a node
272
- */
273
- getIncomingEdges(nodeId: string): Edge[]
274
- /**
275
- * Get a file record by path
276
- */
277
- getFile(filePath: string): FileRecord | null
278
- /**
279
- * Get all tracked files
280
- */
281
- getFiles(): FileRecord[]
282
- /**
283
- * Get the context for a node (ancestors, children, references)
284
- *
285
- * Returns comprehensive context about a node including its containment
286
- * hierarchy, children, incoming/outgoing references, type information,
287
- * and relevant imports.
288
- *
289
- * @param nodeId - ID of the focal node
290
- * @returns Context object with all related information
291
- */
292
- getContext(nodeId: string): Context
293
- /**
294
- * Traverse the graph from a starting node
295
- *
296
- * Uses breadth-first search by default. Supports filtering by edge types,
297
- * node types, and traversal direction.
298
- *
299
- * @param startId - Starting node ID
300
- * @param options - Traversal options
301
- * @returns Subgraph containing traversed nodes and edges
302
- */
303
- traverse(startId: string, options?: TraversalOptions): Subgraph
304
- /**
305
- * Get the call graph for a function
306
- *
307
- * Returns both callers (functions that call this function) and
308
- * callees (functions called by this function) up to the specified depth.
309
- *
310
- * @param nodeId - ID of the function/method node
311
- * @param depth - Maximum depth in each direction (default: 2)
312
- * @returns Subgraph containing the call graph
313
- */
314
- getCallGraph(nodeId: string, depth?: number): Subgraph
315
- /**
316
- * Get the type hierarchy for a class/interface
317
- *
318
- * Returns both ancestors (types this extends/implements) and
319
- * descendants (types that extend/implement this).
320
- *
321
- * @param nodeId - ID of the class/interface node
322
- * @returns Subgraph containing the type hierarchy
323
- */
324
- getTypeHierarchy(nodeId: string): Subgraph
325
- /**
326
- * Find all usages of a symbol
327
- *
328
- * Returns all nodes that reference the specified symbol through
329
- * any edge type (calls, references, type_of, etc.).
330
- *
331
- * @param nodeId - ID of the symbol node
332
- * @returns Array of nodes and edges that reference this symbol
333
- */
334
- findUsages(nodeId: string): Array<{
335
- node: Node
336
- edge: Edge
337
- }>
338
- /**
339
- * Get callers of a function/method
340
- *
341
- * @param nodeId - ID of the function/method node
342
- * @param maxDepth - Maximum depth to traverse (default: 1)
343
- * @returns Array of nodes that call this function
344
- */
345
- getCallers(
346
- nodeId: string,
347
- maxDepth?: number,
348
- ): Array<{
349
- node: Node
350
- edge: Edge
351
- }>
352
- /**
353
- * Get callees of a function/method
354
- *
355
- * @param nodeId - ID of the function/method node
356
- * @param maxDepth - Maximum depth to traverse (default: 1)
357
- * @returns Array of nodes called by this function
358
- */
359
- getCallees(
360
- nodeId: string,
361
- maxDepth?: number,
362
- ): Array<{
363
- node: Node
364
- edge: Edge
365
- }>
366
- /**
367
- * Calculate the impact radius of a node
368
- *
369
- * Returns all nodes that could be affected by changes to this node.
370
- *
371
- * @param nodeId - ID of the node
372
- * @param maxDepth - Maximum depth to traverse (default: 3)
373
- * @returns Subgraph containing potentially impacted nodes
374
- */
375
- getImpactRadius(nodeId: string, maxDepth?: number): Subgraph
376
- /**
377
- * Find the shortest path between two nodes
378
- *
379
- * @param fromId - Starting node ID
380
- * @param toId - Target node ID
381
- * @param edgeKinds - Edge types to consider (all if empty)
382
- * @returns Array of nodes and edges forming the path, or null if no path exists
383
- */
384
- findPath(
385
- fromId: string,
386
- toId: string,
387
- edgeKinds?: Edge['kind'][],
388
- ): Array<{
389
- node: Node
390
- edge: Edge | null
391
- }> | null
392
- /**
393
- * Get ancestors of a node in the containment hierarchy
394
- *
395
- * @param nodeId - ID of the node
396
- * @returns Array of ancestor nodes from immediate parent to root
397
- */
398
- getAncestors(nodeId: string): Node[]
399
- /**
400
- * Get immediate children of a node
401
- *
402
- * @param nodeId - ID of the node
403
- * @returns Array of child nodes
404
- */
405
- getChildren(nodeId: string): Node[]
406
- /**
407
- * Get dependencies of a file
408
- *
409
- * @param filePath - Path to the file
410
- * @returns Array of file paths this file depends on
411
- */
412
- getFileDependencies(filePath: string): string[]
413
- /**
414
- * Get dependents of a file
415
- *
416
- * @param filePath - Path to the file
417
- * @returns Array of file paths that depend on this file
418
- */
419
- getFileDependents(filePath: string): string[]
420
- /**
421
- * Find circular dependencies in the codebase
422
- *
423
- * @returns Array of cycles, each cycle is an array of file paths
424
- */
425
- findCircularDependencies(): string[][]
426
- /**
427
- * Find dead code (unreferenced symbols)
428
- *
429
- * @param kinds - Node kinds to check (default: functions, methods, classes)
430
- * @returns Array of unreferenced nodes
431
- */
432
- findDeadCode(kinds?: Node['kind'][]): Node[]
433
- /**
434
- * Get complexity metrics for a node
435
- *
436
- * @param nodeId - ID of the node
437
- * @returns Object containing various complexity metrics
438
- */
439
- getNodeMetrics(nodeId: string): {
440
- incomingEdgeCount: number
441
- outgoingEdgeCount: number
442
- callCount: number
443
- callerCount: number
444
- childCount: number
445
- depth: number
446
- }
447
- /**
448
- * Get the source code for a node
449
- *
450
- * Reads the file and extracts the code between startLine and endLine.
451
- *
452
- * @param nodeId - ID of the node
453
- * @returns Code string or null if not found
454
- */
455
- getCode(nodeId: string): Promise<string | null>
456
- /**
457
- * Find relevant subgraph for a query
458
- *
459
- * Combines semantic search with graph traversal to find the most
460
- * relevant nodes and their relationships for a given query.
461
- *
462
- * @param query - Natural language query describing the task
463
- * @param options - Search and traversal options
464
- * @returns Subgraph of relevant nodes and edges
465
- */
466
- findRelevantContext(
467
- query: string,
468
- options?: FindRelevantContextOptions,
469
- ): Promise<Subgraph>
470
- /**
471
- * Build context for a task
472
- *
473
- * Creates comprehensive context by:
474
- * 1. Running FTS search to find entry points
475
- * 2. Expanding the graph around entry points
476
- * 3. Extracting code blocks for key nodes
477
- * 4. Formatting output for Claude
478
- *
479
- * @param input - Task description (string or {title, description})
480
- * @param options - Build options (maxNodes, includeCode, format, etc.)
481
- * @returns TaskContext object or formatted string (markdown/JSON)
482
- */
483
- buildContext(
484
- input: TaskInput,
485
- options?: BuildContextOptions,
486
- ): Promise<TaskContext | string>
487
- /**
488
- * Optimize the database (vacuum and analyze)
489
- */
490
- optimize(): void
491
- /**
492
- * Clear all data from the graph
493
- */
494
- clear(): void
495
- /**
496
- * Alias for close() for backwards compatibility.
497
- * @deprecated Use close() instead
498
- */
499
- destroy(): void
500
- /**
501
- * Completely remove CodeGraph from the project.
502
- * This closes the database and deletes the .CodeGraph directory.
503
- *
504
- * WARNING: This permanently deletes all CodeGraph data for the project.
505
- */
506
- uninitialize(): void
57
+ private db;
58
+ private queries;
59
+ private projectRoot;
60
+ private orchestrator;
61
+ private resolver;
62
+ private graphManager;
63
+ private traverser;
64
+ private contextBuilder;
65
+ private indexMutex;
66
+ private fileLock;
67
+ private watcher;
68
+ private constructor();
69
+ /**
70
+ * (Re)build the query/extraction/graph layers over the current `this.queries`
71
+ * (which wraps `this.db`). Factored out of the constructor so `reopenIfReplaced`
72
+ * can rebuild them against a fresh connection without duplicating the wiring.
73
+ * The path-based `fileLock` is independent of the DB handle, so it stays put.
74
+ */
75
+ private wireLayers;
76
+ /**
77
+ * Heal a stale database handle in place. If `.codegraph/` was removed and
78
+ * recreated at the SAME path while this instance held the DB open — a git
79
+ * worktree removed and re-added, or `rm -rf .codegraph` + `codegraph init` —
80
+ * our open fd points at the now-unlinked inode and can never see the new
81
+ * index, so every query returns the pre-removal snapshot until the process
82
+ * restarts (#925). When that's detected, open the live file at the same path,
83
+ * rebuild the query layers, and swap them IN PLACE, so every holder of this
84
+ * instance (the MCP daemon's default project, cached projectPath connections)
85
+ * heals without a restart. Returns true iff it reopened.
86
+ *
87
+ * POSIX-only in practice: `isReplacedOnDisk` never fires on Windows (an open
88
+ * file can't be unlinked there, and st_ino is unreliable).
89
+ */
90
+ reopenIfReplaced(): boolean;
91
+ /**
92
+ * Initialize a new CodeGraph project
93
+ *
94
+ * Creates the .CodeGraph directory, database, and configuration.
95
+ *
96
+ * @param projectRoot - Path to the project root directory
97
+ * @param options - Initialization options
98
+ * @returns A new CodeGraph instance
99
+ */
100
+ static init(projectRoot: string, options?: InitOptions): Promise<CodeGraph>;
101
+ /**
102
+ * Initialize synchronously (without indexing)
103
+ */
104
+ static initSync(projectRoot: string): CodeGraph;
105
+ /**
106
+ * Open an existing CodeGraph project
107
+ *
108
+ * @param projectRoot - Path to the project root directory
109
+ * @param options - Open options
110
+ * @returns A CodeGraph instance
111
+ */
112
+ static open(projectRoot: string, options?: OpenOptions): Promise<CodeGraph>;
113
+ /**
114
+ * Rebuild the project's database from scratch and return a fresh, empty
115
+ * instance — the "same result as a fresh init" semantics that `codegraph
116
+ * index` documents.
117
+ *
118
+ * Unlike `open()` followed by `clear()`, this DISCARDS the existing
119
+ * `.codegraph/codegraph.db` (and its `-wal`/`-shm` sidecars) before
120
+ * re-initializing, instead of opening the old database and DELETE-ing every
121
+ * row. On a large or pre-fix poisoned index — e.g. an old graph that scanned
122
+ * an ignored gitlink corpus (#1065) into ~1.6M nodes with a multi-GB WAL —
123
+ * the per-row `nodes_fts` delete-trigger churn blocks the main thread long
124
+ * enough to trip the #850 liveness watchdog before indexing even starts, so a
125
+ * full re-index could never recover the bad state (#1067). Discarding the
126
+ * files is O(1) regardless of size, reclaims the disk, and sidesteps opening
127
+ * (and running migrations against) the poisoned database entirely.
128
+ */
129
+ static recreate(projectRoot: string): Promise<CodeGraph>;
130
+ /**
131
+ * Open synchronously (without sync)
132
+ */
133
+ static openSync(projectRoot: string): CodeGraph;
134
+ /**
135
+ * Check if a directory has been initialized as a CodeGraph project
136
+ */
137
+ static isInitialized(projectRoot: string): boolean;
138
+ /**
139
+ * Close the CodeGraph instance and release resources
140
+ */
141
+ close(): void;
142
+ /**
143
+ * Get the project root directory
144
+ */
145
+ getProjectRoot(): string;
146
+ /**
147
+ * Index all files in the project
148
+ *
149
+ * Uses a mutex to prevent concurrent indexing operations.
150
+ */
151
+ indexAll(options?: IndexOptions): Promise<IndexResult>;
152
+ /**
153
+ * Index specific files
154
+ *
155
+ * Uses a mutex to prevent concurrent indexing operations.
156
+ */
157
+ indexFiles(filePaths: string[]): Promise<IndexResult>;
158
+ /**
159
+ * Sync with current file state (incremental update)
160
+ *
161
+ * Uses a mutex to prevent concurrent indexing operations.
162
+ */
163
+ sync(options?: IndexOptions): Promise<SyncResult>;
164
+ /**
165
+ * Check if an indexing operation is currently in progress
166
+ */
167
+ isIndexing(): boolean;
168
+ /**
169
+ * Start watching for file changes and auto-syncing.
170
+ *
171
+ * Uses native OS file events (FSEvents on macOS, inotify on Linux 19+,
172
+ * ReadDirectoryChangesW on Windows) with debouncing to avoid thrashing.
173
+ *
174
+ * @param options - Watch options (debounce delay, callbacks)
175
+ * @returns true if watching started successfully
176
+ */
177
+ watch(options?: WatchOptions): boolean;
178
+ /**
179
+ * Stop watching for file changes.
180
+ */
181
+ unwatch(): void;
182
+ /**
183
+ * Check if the file watcher is active.
184
+ */
185
+ isWatching(): boolean;
186
+ /**
187
+ * True once live watching has permanently degraded (OS watch-resource
188
+ * exhaustion, or a write lock held past the retry budget) and auto-sync is
189
+ * disabled until the next {@link watch} call. Distinct from `!isWatching()`:
190
+ * a stopped/never-started watcher is inactive but NOT degraded. MCP tools use
191
+ * this to surface a whole-index "results may be stale" notice, since
192
+ * `getPendingFiles()` goes empty once watching stops (#876).
193
+ */
194
+ isWatcherDegraded(): boolean;
195
+ /** The reason live watching degraded, or null if it is healthy (#876). */
196
+ getWatcherDegradedReason(): string | null;
197
+ /**
198
+ * Files seen by the file watcher since the last successful sync
199
+ * the per-file "stale" signal MCP tools attach to responses so an agent
200
+ * can fall back to {@link Read} for just the affected file without
201
+ * waiting for a debounced sync to complete (issue #403).
202
+ *
203
+ * Returns an empty list when the watcher isn't active, or no events have
204
+ * arrived. Each entry includes `firstSeenMs` and `lastSeenMs` (wall-clock
205
+ * `Date.now()` values) so callers can render "edited Nms ago", plus an
206
+ * `indexing` flag indicating whether the in-flight sync (if any) will
207
+ * absorb that file.
208
+ */
209
+ getPendingFiles(): PendingFile[];
210
+ /**
211
+ * Resolves once the file watcher has installed its watch set. Useful for
212
+ * tests that need a deterministic boundary before asserting on
213
+ * `getPendingFiles()`. Resolves immediately when no watcher is active.
214
+ */
215
+ waitUntilWatcherReady(timeoutMs?: number): Promise<void>;
216
+ /**
217
+ * Get files that have changed since last index
218
+ */
219
+ getChangedFiles(): {
220
+ added: string[];
221
+ modified: string[];
222
+ removed: string[];
223
+ };
224
+ /**
225
+ * Most recent index timestamp (ms since epoch) across all tracked files, or
226
+ * null when nothing is indexed yet. Lets library consumers check index
227
+ * freshness without shelling out to `codegraph status --json`. (#329)
228
+ */
229
+ getLastIndexedAt(): number | null;
230
+ /**
231
+ * Completeness of the last full index run. `'complete'` is the only good
232
+ * state. `'indexing'` after the fact means a run was killed mid-index (OOM,
233
+ * SIGKILL, liveness watchdog) and the on-disk index is truncated;
234
+ * `'partial'` means the run finished but silently dropped files
235
+ * (discovered > indexed+skipped+errored); `'failed'` means it reported
236
+ * failure. `null` = index predates this marker. Surfaced by
237
+ * `codegraph status`.
238
+ */
239
+ getIndexState(): 'indexing' | 'complete' | 'partial' | 'failed' | null;
240
+ /**
241
+ * Which engine built the current index: the package version + extraction
242
+ * version stamped at the last full `indexAll`. Either field is null for an
243
+ * index built before stamping existed (treated as stale). See
244
+ * `extraction-version.ts` and `isIndexStale()`.
245
+ */
246
+ getIndexBuildInfo(): {
247
+ version: string | null;
248
+ extractionVersion: number | null;
249
+ };
250
+ /**
251
+ * True when the on-disk index was built by an engine whose extraction is
252
+ * older than the one now running — i.e. a re-index would add data a migration
253
+ * can't backfill. False when there's no index yet (nothing to refresh) or the
254
+ * stamp is current. This is the signal behind `codegraph status`'s re-index
255
+ * hint and `codegraph upgrade`'s reminder.
256
+ */
257
+ isIndexStale(): boolean;
258
+ /**
259
+ * Extract nodes and edges from source code (without storing)
260
+ */
261
+ extractFromSource(filePath: string, source: string): ExtractionResult;
262
+ /**
263
+ * Resolve unresolved references and create edges
264
+ *
265
+ * This method takes unresolved references from extraction and attempts
266
+ * to resolve them using multiple strategies:
267
+ * - Framework-specific patterns (React, Express, Laravel)
268
+ * - Import-based resolution
269
+ * - Name-based symbol matching
270
+ */
271
+ resolveReferences(onProgress?: (current: number, total: number) => void): ResolutionResult;
272
+ /**
273
+ * Resolve references in batches to keep memory bounded on large codebases.
274
+ * Processes chunks of unresolved refs, persisting results after each batch.
275
+ */
276
+ resolveReferencesBatched(onProgress?: (current: number, total: number) => void): Promise<ResolutionResult>;
277
+ /**
278
+ * References extracted but never attempted by a resolution pass. Zero on a
279
+ * healthy index a completed pass consumes every pending row (resolving it
280
+ * or parking it as failed, #1240). Non-zero at rest means a pass was
281
+ * interrupted mid-run (killed indexer, crash #1187), so some files' call
282
+ * edges are missing; the next `sync` sweeps them.
283
+ */
284
+ getPendingReferenceCount(): number;
285
+ /**
286
+ * Get detected frameworks in the project
287
+ */
288
+ getDetectedFrameworks(): string[];
289
+ /**
290
+ * Re-initialize the resolver (useful after adding new files)
291
+ */
292
+ reinitializeResolver(): void;
293
+ /**
294
+ * Get statistics about the knowledge graph
295
+ */
296
+ getStats(): GraphStats;
297
+ /**
298
+ * Active SQLite backend for this project's connection (`node-sqlite` — Node's
299
+ * built-in real-SQLite module). Surfaced via `codegraph status` and the
300
+ * `codegraph_status` MCP tool alongside the effective journal mode.
301
+ */
302
+ getBackend(): import('./db').SqliteBackend;
303
+ /**
304
+ * The journal mode actually in effect ('wal', 'delete', …). 'wal' means
305
+ * readers never block on a concurrent writer; anything else means they can,
306
+ * which is the precondition for the "database is locked" failures in issue
307
+ * #238. Surfaced via `codegraph status` and the `codegraph_status` MCP tool.
308
+ */
309
+ getJournalMode(): string;
310
+ /**
311
+ * Get a node by ID
312
+ */
313
+ getNode(id: string): Node | null;
314
+ /**
315
+ * Get all nodes in a file
316
+ */
317
+ getNodesInFile(filePath: string): Node[];
318
+ /**
319
+ * Get all nodes of a specific kind
320
+ */
321
+ getNodesByKind(kind: Node['kind']): Node[];
322
+ /**
323
+ * Get ALL nodes with an exact name (direct index lookup, not FTS-ranked/capped).
324
+ * Used to enumerate every overload of a heavily-overloaded name so the specific
325
+ * definition the caller wants is never dropped below a search cut.
326
+ */
327
+ getNodesByName(name: string): Node[];
328
+ /** Nodes whose name starts with `prefix` (index range scan, capped). */
329
+ getNodesByNamePrefix(prefix: string, limit?: number): Node[];
330
+ /**
331
+ * Search nodes by text
332
+ */
333
+ searchNodes(query: string, options?: SearchOptions): SearchResult[];
334
+ /**
335
+ * Graph-derived prompt matching for the front-load hook's MEDIUM tier:
336
+ * which indexed symbols do these prose words name? "state machine des
337
+ * commandes" → `OrderStateMachine`, in any human language whose technical
338
+ * nouns are Latin script — no keyword list involved.
339
+ *
340
+ * Precision comes from the repo's own naming statistics, not vocabulary:
341
+ * - CO-OCCURRENCE: ≥2 words that are segments of the SAME name ("state" +
342
+ * "machine" → OrderStateMachine) is strong evidence and always qualifies.
343
+ * - RARITY: a single matched word qualifies only when its segment is
344
+ * discriminative here (≤ {@link SEGMENT_RARITY_CEILING} distinct names) —
345
+ * "checkout" in a shop backend yes, "state" in a react app no.
346
+ * Every candidate is re-verified against `nodes` before being returned
347
+ * (vocab rows are proposals; deletions leave orphans by design), so a
348
+ * returned symbol is guaranteed to exist right now.
349
+ */
350
+ getSegmentMatches(words: string[], limit?: number): SegmentMatch[];
351
+ /** A single word ("state") can match hundreds of names in a big repo — that
352
+ * is noise, not signal. Ceiling for the single-word tier; co-occurrence is
353
+ * exempt because two words on one name is already discriminative. */
354
+ private static readonly SEGMENT_RARITY_CEILING;
355
+ /** Which of the prompt's original words match `name`'s segments (via
356
+ * variants). Segments are recomputed in JS — a name-keyed vocab lookup
357
+ * would scan the (segment, name) primary key. */
358
+ private wordsMatchingName;
359
+ /**
360
+ * One-shot upgrade heal for callers that open the graph WITHOUT syncing —
361
+ * concretely the prompt hook, whose MEDIUM tier reads the segment
362
+ * vocabulary: a database migrated from before the vocab table existed
363
+ * starts with it empty, and the only other backfill lives inside `sync()`,
364
+ * which such callers never run (#1142). Returns true when the vocab is
365
+ * usable (already populated — the overwhelmingly common one-SELECT case —
366
+ * or healed here); false when it isn't (empty graph, or another process
367
+ * holds the index lock — that process's own sync heals it).
368
+ */
369
+ healSegmentVocabIfEmpty(): Promise<boolean>;
370
+ /**
371
+ * Rebuild the segment vocabulary from the current graph, batched and
372
+ * yielding — the upgrade-heal path for indexes built before the vocab table
373
+ * existed. Runs inside the index mutex/lock (sync and
374
+ * healSegmentVocabIfEmpty hold them).
375
+ */
376
+ private rebuildNameSegmentVocab;
377
+ /**
378
+ * Normalized project-name tokens (go.mod / package.json / repo dir) used to
379
+ * down-weight the non-discriminative project name in search ranking (#720).
380
+ * Exposed so explore can exclude it from the PascalCase type-disambiguation
381
+ * bias, which would otherwise pull overloaded tokens toward whichever stack
382
+ * embeds the project name.
383
+ */
384
+ getProjectNameTokens(): Set<string>;
385
+ /**
386
+ * Find the project's "primary route file" — the file with the densest
387
+ * concentration of framework-emitted `route` nodes (≥3 routes, ≥30%
388
+ * of all non-test routes). Used to inline the routing config in
389
+ * `codegraph_explore` responses on small realworld template repos
390
+ * (rails-realworld, laravel-realworld, drupal-admintoolbar, …) where
391
+ * Glob+Read of `routes.rb`/`urls.py`/etc. otherwise beats codegraph.
392
+ */
393
+ getTopRouteFile(): {
394
+ filePath: string;
395
+ routeCount: number;
396
+ totalRoutes: number;
397
+ } | null;
398
+ /**
399
+ * Build a URL → handler routing manifest from the index. Each entry
400
+ * pairs a route node (URL + method) with its handler function/method
401
+ * via the `references` edge that framework resolvers emit. Returns
402
+ * null when fewer than 3 valid (non-test) routes exist.
403
+ */
404
+ getRoutingManifest(limit?: number): {
405
+ entries: Array<{
406
+ url: string;
407
+ handler: string;
408
+ handlerFile: string;
409
+ handlerLine: number;
410
+ handlerKind: string;
411
+ }>;
412
+ topHandlerFile: string | null;
413
+ topHandlerFileCount: number;
414
+ totalRoutes: number;
415
+ } | null;
416
+ /**
417
+ * Get outgoing edges from a node
418
+ */
419
+ getOutgoingEdges(nodeId: string): Edge[];
420
+ /**
421
+ * Get incoming edges to a node
422
+ */
423
+ getIncomingEdges(nodeId: string): Edge[];
424
+ /**
425
+ * Get a file record by path
426
+ */
427
+ getFile(filePath: string): FileRecord | null;
428
+ /**
429
+ * Get all tracked files
430
+ */
431
+ getFiles(): FileRecord[];
432
+ /**
433
+ * Get the context for a node (ancestors, children, references)
434
+ *
435
+ * Returns comprehensive context about a node including its containment
436
+ * hierarchy, children, incoming/outgoing references, type information,
437
+ * and relevant imports.
438
+ *
439
+ * @param nodeId - ID of the focal node
440
+ * @returns Context object with all related information
441
+ */
442
+ getContext(nodeId: string): Context;
443
+ /**
444
+ * Traverse the graph from a starting node
445
+ *
446
+ * Uses breadth-first search by default. Supports filtering by edge types,
447
+ * node types, and traversal direction.
448
+ *
449
+ * @param startId - Starting node ID
450
+ * @param options - Traversal options
451
+ * @returns Subgraph containing traversed nodes and edges
452
+ */
453
+ traverse(startId: string, options?: TraversalOptions): Subgraph;
454
+ /**
455
+ * Get the call graph for a function
456
+ *
457
+ * Returns both callers (functions that call this function) and
458
+ * callees (functions called by this function) up to the specified depth.
459
+ *
460
+ * @param nodeId - ID of the function/method node
461
+ * @param depth - Maximum depth in each direction (default: 2)
462
+ * @returns Subgraph containing the call graph
463
+ */
464
+ getCallGraph(nodeId: string, depth?: number): Subgraph;
465
+ /**
466
+ * Get the type hierarchy for a class/interface
467
+ *
468
+ * Returns both ancestors (types this extends/implements) and
469
+ * descendants (types that extend/implement this).
470
+ *
471
+ * @param nodeId - ID of the class/interface node
472
+ * @returns Subgraph containing the type hierarchy
473
+ */
474
+ getTypeHierarchy(nodeId: string): Subgraph;
475
+ /**
476
+ * Find all usages of a symbol
477
+ *
478
+ * Returns all nodes that reference the specified symbol through
479
+ * any edge type (calls, references, type_of, etc.).
480
+ *
481
+ * @param nodeId - ID of the symbol node
482
+ * @returns Array of nodes and edges that reference this symbol
483
+ */
484
+ findUsages(nodeId: string): Array<{
485
+ node: Node;
486
+ edge: Edge;
487
+ }>;
488
+ /**
489
+ * Get callers of a function/method
490
+ *
491
+ * @param nodeId - ID of the function/method node
492
+ * @param maxDepth - Maximum depth to traverse (default: 1)
493
+ * @returns Array of nodes that call this function
494
+ */
495
+ getCallers(nodeId: string, maxDepth?: number): Array<{
496
+ node: Node;
497
+ edge: Edge;
498
+ }>;
499
+ /**
500
+ * Get callees of a function/method
501
+ *
502
+ * @param nodeId - ID of the function/method node
503
+ * @param maxDepth - Maximum depth to traverse (default: 1)
504
+ * @returns Array of nodes called by this function
505
+ */
506
+ getCallees(nodeId: string, maxDepth?: number): Array<{
507
+ node: Node;
508
+ edge: Edge;
509
+ }>;
510
+ /**
511
+ * Calculate the impact radius of a node
512
+ *
513
+ * Returns all nodes that could be affected by changes to this node.
514
+ *
515
+ * @param nodeId - ID of the node
516
+ * @param maxDepth - Maximum depth to traverse (default: 3)
517
+ * @returns Subgraph containing potentially impacted nodes
518
+ */
519
+ getImpactRadius(nodeId: string, maxDepth?: number): Subgraph;
520
+ /**
521
+ * Find the shortest path between two nodes
522
+ *
523
+ * @param fromId - Starting node ID
524
+ * @param toId - Target node ID
525
+ * @param edgeKinds - Edge types to consider (all if empty)
526
+ * @returns Array of nodes and edges forming the path, or null if no path exists
527
+ */
528
+ findPath(fromId: string, toId: string, edgeKinds?: Edge['kind'][]): Array<{
529
+ node: Node;
530
+ edge: Edge | null;
531
+ }> | null;
532
+ /**
533
+ * Get ancestors of a node in the containment hierarchy
534
+ *
535
+ * @param nodeId - ID of the node
536
+ * @returns Array of ancestor nodes from immediate parent to root
537
+ */
538
+ getAncestors(nodeId: string): Node[];
539
+ /**
540
+ * Get immediate children of a node
541
+ *
542
+ * @param nodeId - ID of the node
543
+ * @returns Array of child nodes
544
+ */
545
+ getChildren(nodeId: string): Node[];
546
+ /**
547
+ * Get dependencies of a file
548
+ *
549
+ * @param filePath - Path to the file
550
+ * @returns Array of file paths this file depends on
551
+ */
552
+ getFileDependencies(filePath: string): string[];
553
+ /**
554
+ * Get dependents of a file
555
+ *
556
+ * @param filePath - Path to the file
557
+ * @returns Array of file paths that depend on this file
558
+ */
559
+ getFileDependents(filePath: string): string[];
560
+ /**
561
+ * Find circular dependencies in the codebase
562
+ *
563
+ * @returns Array of cycles, each cycle is an array of file paths
564
+ */
565
+ findCircularDependencies(): string[][];
566
+ /**
567
+ * Find dead code (unreferenced symbols)
568
+ *
569
+ * @param kinds - Node kinds to check (default: functions, methods, classes)
570
+ * @returns Array of unreferenced nodes
571
+ */
572
+ findDeadCode(kinds?: Node['kind'][]): Node[];
573
+ /**
574
+ * Get complexity metrics for a node
575
+ *
576
+ * @param nodeId - ID of the node
577
+ * @returns Object containing various complexity metrics
578
+ */
579
+ getNodeMetrics(nodeId: string): {
580
+ incomingEdgeCount: number;
581
+ outgoingEdgeCount: number;
582
+ callCount: number;
583
+ callerCount: number;
584
+ childCount: number;
585
+ depth: number;
586
+ };
587
+ /**
588
+ * Get the source code for a node
589
+ *
590
+ * Reads the file and extracts the code between startLine and endLine.
591
+ *
592
+ * @param nodeId - ID of the node
593
+ * @returns Code string or null if not found
594
+ */
595
+ getCode(nodeId: string): Promise<string | null>;
596
+ /**
597
+ * Find relevant subgraph for a query
598
+ *
599
+ * Combines semantic search with graph traversal to find the most
600
+ * relevant nodes and their relationships for a given query.
601
+ *
602
+ * @param query - Natural language query describing the task
603
+ * @param options - Search and traversal options
604
+ * @returns Subgraph of relevant nodes and edges
605
+ */
606
+ findRelevantContext(query: string, options?: FindRelevantContextOptions): Promise<Subgraph>;
607
+ /**
608
+ * Build context for a task
609
+ *
610
+ * Creates comprehensive context by:
611
+ * 1. Running FTS search to find entry points
612
+ * 2. Expanding the graph around entry points
613
+ * 3. Extracting code blocks for key nodes
614
+ * 4. Formatting output for Claude
615
+ *
616
+ * @param input - Task description (string or {title, description})
617
+ * @param options - Build options (maxNodes, includeCode, format, etc.)
618
+ * @returns TaskContext object or formatted string (markdown/JSON)
619
+ */
620
+ buildContext(input: TaskInput, options?: BuildContextOptions): Promise<TaskContext | string>;
621
+ /**
622
+ * Optimize the database (vacuum and analyze)
623
+ */
624
+ optimize(): void;
625
+ /**
626
+ * Clear all data from the graph
627
+ */
628
+ clear(): void;
629
+ /**
630
+ * Alias for close() for backwards compatibility.
631
+ * @deprecated Use close() instead
632
+ */
633
+ destroy(): void;
634
+ /**
635
+ * Completely remove CodeGraph from the project.
636
+ * This closes the database and deletes the .CodeGraph directory.
637
+ *
638
+ * WARNING: This permanently deletes all CodeGraph data for the project.
639
+ */
640
+ uninitialize(): void;
507
641
  }
508
- export default CodeGraph
509
- //# sourceMappingURL=index.d.ts.map
642
+ export default CodeGraph;
643
+ //# sourceMappingURL=index.d.ts.map