cgraphx 1.1.0

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 (936) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +243 -0
  3. package/dist/.claude-template/commands/my-commit.md +9 -0
  4. package/dist/.claude-template/commands/my-query.md +4 -0
  5. package/dist/.claude-template/hooks/context-monitor/context-monitor.cjs +216 -0
  6. package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts +4 -0
  7. package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.d.ts.map +1 -0
  8. package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js +24 -0
  9. package/dist/.claude-template/plugins/claude-hud/dist/claude-config-dir.js.map +1 -0
  10. package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts +8 -0
  11. package/dist/.claude-template/plugins/claude-hud/dist/config-reader.d.ts.map +1 -0
  12. package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js +204 -0
  13. package/dist/.claude-template/plugins/claude-hud/dist/config-reader.js.map +1 -0
  14. package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts +46 -0
  15. package/dist/.claude-template/plugins/claude-hud/dist/config.d.ts.map +1 -0
  16. package/dist/.claude-template/plugins/claude-hud/dist/config.js +220 -0
  17. package/dist/.claude-template/plugins/claude-hud/dist/config.js.map +1 -0
  18. package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts +10 -0
  19. package/dist/.claude-template/plugins/claude-hud/dist/constants.d.ts.map +1 -0
  20. package/dist/.claude-template/plugins/claude-hud/dist/constants.js +10 -0
  21. package/dist/.claude-template/plugins/claude-hud/dist/constants.js.map +1 -0
  22. package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts +6 -0
  23. package/dist/.claude-template/plugins/claude-hud/dist/debug.d.ts.map +1 -0
  24. package/dist/.claude-template/plugins/claude-hud/dist/debug.js +15 -0
  25. package/dist/.claude-template/plugins/claude-hud/dist/debug.js.map +1 -0
  26. package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts +23 -0
  27. package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.d.ts.map +1 -0
  28. package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js +103 -0
  29. package/dist/.claude-template/plugins/claude-hud/dist/extra-cmd.js.map +1 -0
  30. package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts +16 -0
  31. package/dist/.claude-template/plugins/claude-hud/dist/git.d.ts.map +1 -0
  32. package/dist/.claude-template/plugins/claude-hud/dist/git.js +86 -0
  33. package/dist/.claude-template/plugins/claude-hud/dist/git.js.map +1 -0
  34. package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts +24 -0
  35. package/dist/.claude-template/plugins/claude-hud/dist/index.d.ts.map +1 -0
  36. package/dist/.claude-template/plugins/claude-hud/dist/index.js +97 -0
  37. package/dist/.claude-template/plugins/claude-hud/dist/index.js.map +1 -0
  38. package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts +3 -0
  39. package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.d.ts.map +1 -0
  40. package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js +44 -0
  41. package/dist/.claude-template/plugins/claude-hud/dist/render/agents-line.js.map +1 -0
  42. package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts +12 -0
  43. package/dist/.claude-template/plugins/claude-hud/dist/render/colors.d.ts.map +1 -0
  44. package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js +58 -0
  45. package/dist/.claude-template/plugins/claude-hud/dist/render/colors.js.map +1 -0
  46. package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts +3 -0
  47. package/dist/.claude-template/plugins/claude-hud/dist/render/index.d.ts.map +1 -0
  48. package/dist/.claude-template/plugins/claude-hud/dist/render/index.js +379 -0
  49. package/dist/.claude-template/plugins/claude-hud/dist/render/index.js.map +1 -0
  50. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts +3 -0
  51. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.d.ts.map +1 -0
  52. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js +30 -0
  53. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/environment.js.map +1 -0
  54. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts +3 -0
  55. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.d.ts.map +1 -0
  56. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js +52 -0
  57. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/identity.js.map +1 -0
  58. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts +5 -0
  59. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.d.ts.map +1 -0
  60. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js +5 -0
  61. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/index.js.map +1 -0
  62. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts +3 -0
  63. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.d.ts.map +1 -0
  64. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js +74 -0
  65. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/project.js.map +1 -0
  66. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts +3 -0
  67. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.d.ts.map +1 -0
  68. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js +92 -0
  69. package/dist/.claude-template/plugins/claude-hud/dist/render/lines/usage.js.map +1 -0
  70. package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts +7 -0
  71. package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.d.ts.map +1 -0
  72. package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js +247 -0
  73. package/dist/.claude-template/plugins/claude-hud/dist/render/session-line.js.map +1 -0
  74. package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts +3 -0
  75. package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.d.ts.map +1 -0
  76. package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js +25 -0
  77. package/dist/.claude-template/plugins/claude-hud/dist/render/todos-line.js.map +1 -0
  78. package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts +3 -0
  79. package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.d.ts.map +1 -0
  80. package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js +43 -0
  81. package/dist/.claude-template/plugins/claude-hud/dist/render/tools-line.js.map +1 -0
  82. package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts +7 -0
  83. package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.d.ts.map +1 -0
  84. package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js +62 -0
  85. package/dist/.claude-template/plugins/claude-hud/dist/speed-tracker.js.map +1 -0
  86. package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts +9 -0
  87. package/dist/.claude-template/plugins/claude-hud/dist/stdin.d.ts.map +1 -0
  88. package/dist/.claude-template/plugins/claude-hud/dist/stdin.js +136 -0
  89. package/dist/.claude-template/plugins/claude-hud/dist/stdin.js.map +1 -0
  90. package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts +3 -0
  91. package/dist/.claude-template/plugins/claude-hud/dist/transcript.d.ts.map +1 -0
  92. package/dist/.claude-template/plugins/claude-hud/dist/transcript.js +189 -0
  93. package/dist/.claude-template/plugins/claude-hud/dist/transcript.js.map +1 -0
  94. package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts +79 -0
  95. package/dist/.claude-template/plugins/claude-hud/dist/types.d.ts.map +1 -0
  96. package/dist/.claude-template/plugins/claude-hud/dist/types.js +5 -0
  97. package/dist/.claude-template/plugins/claude-hud/dist/types.js.map +1 -0
  98. package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts +59 -0
  99. package/dist/.claude-template/plugins/claude-hud/dist/usage-api.d.ts.map +1 -0
  100. package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js +733 -0
  101. package/dist/.claude-template/plugins/claude-hud/dist/usage-api.js.map +1 -0
  102. package/dist/.claude-template/skills/cgraphx/SKILL.md +143 -0
  103. package/dist/.claude-template/skills/cgraphx/agent-prompt.md +56 -0
  104. package/dist/.claude-template/skills/clarify-requirements/SKILL.md +425 -0
  105. package/dist/.claude-template/skills/code-impact-api/SKILL.md +143 -0
  106. package/dist/.claude-template/skills/code-impact-api/agent-prompt.md +51 -0
  107. package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +366 -0
  108. package/dist/.claude-template/skills/code-impact-docgen/template-business-html.md +242 -0
  109. package/dist/.claude-template/skills/code-impact-docgen/template-business-md.md +107 -0
  110. package/dist/.claude-template/skills/code-impact-docgen/template-technical-html.md +205 -0
  111. package/dist/.claude-template/skills/code-impact-docgen/template-technical-md.md +155 -0
  112. package/dist/.claude-template/skills/code-impact-init/SKILL.md +800 -0
  113. package/dist/.claude-template/skills/code-impact-markdown/SKILL.md +345 -0
  114. package/dist/.claude-template/skills/code-impact-markdown/template-guide.md +68 -0
  115. package/dist/.claude-template/skills/code-impact-markdown/template-memory.md +82 -0
  116. package/dist/.claude-template/skills/code-impact-markdown/template-runbook.md +58 -0
  117. package/dist/.claude-template/skills/db-query/SKILL.md +166 -0
  118. package/dist/.claude-template/skills/db-query/agent-prompt.md +55 -0
  119. package/dist/.claude-template/skills/developer-timeline/SKILL.md +302 -0
  120. package/dist/.claude-template/skills/developer-timeline/demo-single-page-report.html +657 -0
  121. package/dist/.claude-template/skills/implementation/SKILL.md +136 -0
  122. package/dist/.claude-template/skills/subagent-implement/SKILL.md +225 -0
  123. package/dist/.claude-template/skills/subagent-implement/implementer-prompt.md +127 -0
  124. package/dist/.claude-template/skills/subagent-implement/quality-reviewer-prompt.md +130 -0
  125. package/dist/.claude-template/skills/subagent-implement/spec-reviewer-prompt.md +112 -0
  126. package/dist/.claude-template/skills/write-plan/SKILL.md +322 -0
  127. package/dist/.claude-template/skills/write-plan/plan-document-reviewer-prompt.md +134 -0
  128. package/dist/.claude-template/skills/write-prd/SKILL.md +242 -0
  129. package/dist/.claude-template/skills/write-spec/SKILL.md +278 -0
  130. package/dist/bin/codegraph.d.ts +26 -0
  131. package/dist/bin/codegraph.d.ts.map +1 -0
  132. package/dist/bin/codegraph.js +2014 -0
  133. package/dist/bin/codegraph.js.map +1 -0
  134. package/dist/bin/fatal-handler.d.ts +20 -0
  135. package/dist/bin/fatal-handler.d.ts.map +1 -0
  136. package/dist/bin/fatal-handler.js +118 -0
  137. package/dist/bin/fatal-handler.js.map +1 -0
  138. package/dist/bin/node-version-check.d.ts +51 -0
  139. package/dist/bin/node-version-check.d.ts.map +1 -0
  140. package/dist/bin/node-version-check.js +114 -0
  141. package/dist/bin/node-version-check.js.map +1 -0
  142. package/dist/bin/uninstall.d.ts +14 -0
  143. package/dist/bin/uninstall.d.ts.map +1 -0
  144. package/dist/bin/uninstall.js +36 -0
  145. package/dist/bin/uninstall.js.map +1 -0
  146. package/dist/context/formatter.d.ts +30 -0
  147. package/dist/context/formatter.d.ts.map +1 -0
  148. package/dist/context/formatter.js +263 -0
  149. package/dist/context/formatter.js.map +1 -0
  150. package/dist/context/index.d.ts +119 -0
  151. package/dist/context/index.d.ts.map +1 -0
  152. package/dist/context/index.js +1296 -0
  153. package/dist/context/index.js.map +1 -0
  154. package/dist/context/markers.d.ts +19 -0
  155. package/dist/context/markers.d.ts.map +1 -0
  156. package/dist/context/markers.js +22 -0
  157. package/dist/context/markers.js.map +1 -0
  158. package/dist/db/index.d.ts +122 -0
  159. package/dist/db/index.d.ts.map +1 -0
  160. package/dist/db/index.js +296 -0
  161. package/dist/db/index.js.map +1 -0
  162. package/dist/db/migrations.d.ts +44 -0
  163. package/dist/db/migrations.d.ts.map +1 -0
  164. package/dist/db/migrations.js +140 -0
  165. package/dist/db/migrations.js.map +1 -0
  166. package/dist/db/queries.d.ts +401 -0
  167. package/dist/db/queries.d.ts.map +1 -0
  168. package/dist/db/queries.js +1591 -0
  169. package/dist/db/queries.js.map +1 -0
  170. package/dist/db/schema.sql +152 -0
  171. package/dist/db/sqlite-adapter.d.ts +53 -0
  172. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  173. package/dist/db/sqlite-adapter.js +117 -0
  174. package/dist/db/sqlite-adapter.js.map +1 -0
  175. package/dist/dbquery/cli.d.ts +17 -0
  176. package/dist/dbquery/cli.d.ts.map +1 -0
  177. package/dist/dbquery/cli.js +229 -0
  178. package/dist/dbquery/cli.js.map +1 -0
  179. package/dist/dbquery/config.d.ts +38 -0
  180. package/dist/dbquery/config.d.ts.map +1 -0
  181. package/dist/dbquery/config.js +244 -0
  182. package/dist/dbquery/config.js.map +1 -0
  183. package/dist/dbquery/constants.d.ts +40 -0
  184. package/dist/dbquery/constants.d.ts.map +1 -0
  185. package/dist/dbquery/constants.js +65 -0
  186. package/dist/dbquery/constants.js.map +1 -0
  187. package/dist/dbquery/drivers/mysql.d.ts +15 -0
  188. package/dist/dbquery/drivers/mysql.d.ts.map +1 -0
  189. package/dist/dbquery/drivers/mysql.js +102 -0
  190. package/dist/dbquery/drivers/mysql.js.map +1 -0
  191. package/dist/dbquery/drivers/postgres.d.ts +16 -0
  192. package/dist/dbquery/drivers/postgres.d.ts.map +1 -0
  193. package/dist/dbquery/drivers/postgres.js +105 -0
  194. package/dist/dbquery/drivers/postgres.js.map +1 -0
  195. package/dist/dbquery/errors.d.ts +40 -0
  196. package/dist/dbquery/errors.d.ts.map +1 -0
  197. package/dist/dbquery/errors.js +85 -0
  198. package/dist/dbquery/errors.js.map +1 -0
  199. package/dist/dbquery/executor.d.ts +30 -0
  200. package/dist/dbquery/executor.d.ts.map +1 -0
  201. package/dist/dbquery/executor.js +243 -0
  202. package/dist/dbquery/executor.js.map +1 -0
  203. package/dist/dbquery/format.d.ts +18 -0
  204. package/dist/dbquery/format.d.ts.map +1 -0
  205. package/dist/dbquery/format.js +174 -0
  206. package/dist/dbquery/format.js.map +1 -0
  207. package/dist/dbquery/index.d.ts +10 -0
  208. package/dist/dbquery/index.d.ts.map +1 -0
  209. package/dist/dbquery/index.js +23 -0
  210. package/dist/dbquery/index.js.map +1 -0
  211. package/dist/dbquery/init.d.ts +33 -0
  212. package/dist/dbquery/init.d.ts.map +1 -0
  213. package/dist/dbquery/init.js +125 -0
  214. package/dist/dbquery/init.js.map +1 -0
  215. package/dist/dbquery/logging.d.ts +22 -0
  216. package/dist/dbquery/logging.d.ts.map +1 -0
  217. package/dist/dbquery/logging.js +140 -0
  218. package/dist/dbquery/logging.js.map +1 -0
  219. package/dist/dbquery/mcp-tools.d.ts +29 -0
  220. package/dist/dbquery/mcp-tools.d.ts.map +1 -0
  221. package/dist/dbquery/mcp-tools.js +206 -0
  222. package/dist/dbquery/mcp-tools.js.map +1 -0
  223. package/dist/dbquery/queries.d.ts +31 -0
  224. package/dist/dbquery/queries.d.ts.map +1 -0
  225. package/dist/dbquery/queries.js +160 -0
  226. package/dist/dbquery/queries.js.map +1 -0
  227. package/dist/dbquery/safety.d.ts +35 -0
  228. package/dist/dbquery/safety.d.ts.map +1 -0
  229. package/dist/dbquery/safety.js +306 -0
  230. package/dist/dbquery/safety.js.map +1 -0
  231. package/dist/dbquery/types.d.ts +152 -0
  232. package/dist/dbquery/types.d.ts.map +1 -0
  233. package/dist/dbquery/types.js +10 -0
  234. package/dist/dbquery/types.js.map +1 -0
  235. package/dist/directory.d.ts +147 -0
  236. package/dist/directory.d.ts.map +1 -0
  237. package/dist/directory.js +523 -0
  238. package/dist/directory.js.map +1 -0
  239. package/dist/errors.d.ts +136 -0
  240. package/dist/errors.d.ts.map +1 -0
  241. package/dist/errors.js +219 -0
  242. package/dist/errors.js.map +1 -0
  243. package/dist/extraction/astro-extractor.d.ts +79 -0
  244. package/dist/extraction/astro-extractor.d.ts.map +1 -0
  245. package/dist/extraction/astro-extractor.js +320 -0
  246. package/dist/extraction/astro-extractor.js.map +1 -0
  247. package/dist/extraction/dfm-extractor.d.ts +31 -0
  248. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  249. package/dist/extraction/dfm-extractor.js +151 -0
  250. package/dist/extraction/dfm-extractor.js.map +1 -0
  251. package/dist/extraction/extraction-version.d.ts +25 -0
  252. package/dist/extraction/extraction-version.d.ts.map +1 -0
  253. package/dist/extraction/extraction-version.js +28 -0
  254. package/dist/extraction/extraction-version.js.map +1 -0
  255. package/dist/extraction/function-ref.d.ts +118 -0
  256. package/dist/extraction/function-ref.d.ts.map +1 -0
  257. package/dist/extraction/function-ref.js +727 -0
  258. package/dist/extraction/function-ref.js.map +1 -0
  259. package/dist/extraction/generated-detection.d.ts +30 -0
  260. package/dist/extraction/generated-detection.d.ts.map +1 -0
  261. package/dist/extraction/generated-detection.js +83 -0
  262. package/dist/extraction/generated-detection.js.map +1 -0
  263. package/dist/extraction/grammars.d.ts +114 -0
  264. package/dist/extraction/grammars.d.ts.map +1 -0
  265. package/dist/extraction/grammars.js +477 -0
  266. package/dist/extraction/grammars.js.map +1 -0
  267. package/dist/extraction/index.d.ts +175 -0
  268. package/dist/extraction/index.d.ts.map +1 -0
  269. package/dist/extraction/index.js +1887 -0
  270. package/dist/extraction/index.js.map +1 -0
  271. package/dist/extraction/languages/c-cpp.d.ts +12 -0
  272. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  273. package/dist/extraction/languages/c-cpp.js +275 -0
  274. package/dist/extraction/languages/c-cpp.js.map +1 -0
  275. package/dist/extraction/languages/csharp.d.ts +25 -0
  276. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  277. package/dist/extraction/languages/csharp.js +175 -0
  278. package/dist/extraction/languages/csharp.js.map +1 -0
  279. package/dist/extraction/languages/dart.d.ts +3 -0
  280. package/dist/extraction/languages/dart.d.ts.map +1 -0
  281. package/dist/extraction/languages/dart.js +374 -0
  282. package/dist/extraction/languages/dart.js.map +1 -0
  283. package/dist/extraction/languages/go.d.ts +3 -0
  284. package/dist/extraction/languages/go.d.ts.map +1 -0
  285. package/dist/extraction/languages/go.js +111 -0
  286. package/dist/extraction/languages/go.js.map +1 -0
  287. package/dist/extraction/languages/index.d.ts +10 -0
  288. package/dist/extraction/languages/index.d.ts.map +1 -0
  289. package/dist/extraction/languages/index.js +53 -0
  290. package/dist/extraction/languages/index.js.map +1 -0
  291. package/dist/extraction/languages/java.d.ts +3 -0
  292. package/dist/extraction/languages/java.d.ts.map +1 -0
  293. package/dist/extraction/languages/java.js +315 -0
  294. package/dist/extraction/languages/java.js.map +1 -0
  295. package/dist/extraction/languages/javascript.d.ts +3 -0
  296. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  297. package/dist/extraction/languages/javascript.js +106 -0
  298. package/dist/extraction/languages/javascript.js.map +1 -0
  299. package/dist/extraction/languages/kotlin.d.ts +3 -0
  300. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  301. package/dist/extraction/languages/kotlin.js +379 -0
  302. package/dist/extraction/languages/kotlin.js.map +1 -0
  303. package/dist/extraction/languages/lua.d.ts +3 -0
  304. package/dist/extraction/languages/lua.d.ts.map +1 -0
  305. package/dist/extraction/languages/lua.js +150 -0
  306. package/dist/extraction/languages/lua.js.map +1 -0
  307. package/dist/extraction/languages/luau.d.ts +3 -0
  308. package/dist/extraction/languages/luau.d.ts.map +1 -0
  309. package/dist/extraction/languages/luau.js +37 -0
  310. package/dist/extraction/languages/luau.js.map +1 -0
  311. package/dist/extraction/languages/objc.d.ts +3 -0
  312. package/dist/extraction/languages/objc.d.ts.map +1 -0
  313. package/dist/extraction/languages/objc.js +175 -0
  314. package/dist/extraction/languages/objc.js.map +1 -0
  315. package/dist/extraction/languages/pascal.d.ts +3 -0
  316. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  317. package/dist/extraction/languages/pascal.js +77 -0
  318. package/dist/extraction/languages/pascal.js.map +1 -0
  319. package/dist/extraction/languages/php.d.ts +3 -0
  320. package/dist/extraction/languages/php.d.ts.map +1 -0
  321. package/dist/extraction/languages/php.js +196 -0
  322. package/dist/extraction/languages/php.js.map +1 -0
  323. package/dist/extraction/languages/python.d.ts +3 -0
  324. package/dist/extraction/languages/python.d.ts.map +1 -0
  325. package/dist/extraction/languages/python.js +56 -0
  326. package/dist/extraction/languages/python.js.map +1 -0
  327. package/dist/extraction/languages/r.d.ts +3 -0
  328. package/dist/extraction/languages/r.d.ts.map +1 -0
  329. package/dist/extraction/languages/r.js +314 -0
  330. package/dist/extraction/languages/r.js.map +1 -0
  331. package/dist/extraction/languages/ruby.d.ts +3 -0
  332. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  333. package/dist/extraction/languages/ruby.js +149 -0
  334. package/dist/extraction/languages/ruby.js.map +1 -0
  335. package/dist/extraction/languages/rust.d.ts +3 -0
  336. package/dist/extraction/languages/rust.d.ts.map +1 -0
  337. package/dist/extraction/languages/rust.js +142 -0
  338. package/dist/extraction/languages/rust.js.map +1 -0
  339. package/dist/extraction/languages/scala.d.ts +3 -0
  340. package/dist/extraction/languages/scala.d.ts.map +1 -0
  341. package/dist/extraction/languages/scala.js +209 -0
  342. package/dist/extraction/languages/scala.js.map +1 -0
  343. package/dist/extraction/languages/swift.d.ts +3 -0
  344. package/dist/extraction/languages/swift.d.ts.map +1 -0
  345. package/dist/extraction/languages/swift.js +152 -0
  346. package/dist/extraction/languages/swift.js.map +1 -0
  347. package/dist/extraction/languages/typescript.d.ts +16 -0
  348. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  349. package/dist/extraction/languages/typescript.js +167 -0
  350. package/dist/extraction/languages/typescript.js.map +1 -0
  351. package/dist/extraction/liquid-extractor.d.ts +59 -0
  352. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  353. package/dist/extraction/liquid-extractor.js +357 -0
  354. package/dist/extraction/liquid-extractor.js.map +1 -0
  355. package/dist/extraction/mybatis-extractor.d.ts +48 -0
  356. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  357. package/dist/extraction/mybatis-extractor.js +198 -0
  358. package/dist/extraction/mybatis-extractor.js.map +1 -0
  359. package/dist/extraction/parse-worker.d.ts +8 -0
  360. package/dist/extraction/parse-worker.d.ts.map +1 -0
  361. package/dist/extraction/parse-worker.js +97 -0
  362. package/dist/extraction/parse-worker.js.map +1 -0
  363. package/dist/extraction/razor-extractor.d.ts +42 -0
  364. package/dist/extraction/razor-extractor.d.ts.map +1 -0
  365. package/dist/extraction/razor-extractor.js +285 -0
  366. package/dist/extraction/razor-extractor.js.map +1 -0
  367. package/dist/extraction/svelte-extractor.d.ts +56 -0
  368. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  369. package/dist/extraction/svelte-extractor.js +275 -0
  370. package/dist/extraction/svelte-extractor.js.map +1 -0
  371. package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  372. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  373. package/dist/extraction/tree-sitter-helpers.js +152 -0
  374. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  375. package/dist/extraction/tree-sitter-types.d.ts +239 -0
  376. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  377. package/dist/extraction/tree-sitter-types.js +10 -0
  378. package/dist/extraction/tree-sitter-types.js.map +1 -0
  379. package/dist/extraction/tree-sitter.d.ts +647 -0
  380. package/dist/extraction/tree-sitter.d.ts.map +1 -0
  381. package/dist/extraction/tree-sitter.js +5592 -0
  382. package/dist/extraction/tree-sitter.js.map +1 -0
  383. package/dist/extraction/vue-extractor.d.ts +51 -0
  384. package/dist/extraction/vue-extractor.d.ts.map +1 -0
  385. package/dist/extraction/vue-extractor.js +254 -0
  386. package/dist/extraction/vue-extractor.js.map +1 -0
  387. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  388. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  389. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  390. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  391. package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  392. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  393. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  394. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  395. package/dist/extraction/wasm-runtime-flags.js +106 -0
  396. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  397. package/dist/graph/index.d.ts +8 -0
  398. package/dist/graph/index.d.ts.map +1 -0
  399. package/dist/graph/index.js +13 -0
  400. package/dist/graph/index.js.map +1 -0
  401. package/dist/graph/queries.d.ts +106 -0
  402. package/dist/graph/queries.d.ts.map +1 -0
  403. package/dist/graph/queries.js +339 -0
  404. package/dist/graph/queries.js.map +1 -0
  405. package/dist/graph/traversal.d.ts +127 -0
  406. package/dist/graph/traversal.d.ts.map +1 -0
  407. package/dist/graph/traversal.js +540 -0
  408. package/dist/graph/traversal.js.map +1 -0
  409. package/dist/index.d.ts +563 -0
  410. package/dist/index.d.ts.map +1 -0
  411. package/dist/index.js +1041 -0
  412. package/dist/index.js.map +1 -0
  413. package/dist/installer/claude-assets.d.ts +45 -0
  414. package/dist/installer/claude-assets.d.ts.map +1 -0
  415. package/dist/installer/claude-assets.js +144 -0
  416. package/dist/installer/claude-assets.js.map +1 -0
  417. package/dist/installer/config-writer.d.ts +28 -0
  418. package/dist/installer/config-writer.d.ts.map +1 -0
  419. package/dist/installer/config-writer.js +91 -0
  420. package/dist/installer/config-writer.js.map +1 -0
  421. package/dist/installer/index.d.ts +101 -0
  422. package/dist/installer/index.d.ts.map +1 -0
  423. package/dist/installer/index.js +692 -0
  424. package/dist/installer/index.js.map +1 -0
  425. package/dist/installer/instructions-template.d.ts +41 -0
  426. package/dist/installer/instructions-template.d.ts.map +1 -0
  427. package/dist/installer/instructions-template.js +53 -0
  428. package/dist/installer/instructions-template.js.map +1 -0
  429. package/dist/installer/targets/antigravity.d.ts +57 -0
  430. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  431. package/dist/installer/targets/antigravity.js +308 -0
  432. package/dist/installer/targets/antigravity.js.map +1 -0
  433. package/dist/installer/targets/claude.d.ts +66 -0
  434. package/dist/installer/targets/claude.d.ts.map +1 -0
  435. package/dist/installer/targets/claude.js +564 -0
  436. package/dist/installer/targets/claude.js.map +1 -0
  437. package/dist/installer/targets/codex.d.ts +18 -0
  438. package/dist/installer/targets/codex.d.ts.map +1 -0
  439. package/dist/installer/targets/codex.js +185 -0
  440. package/dist/installer/targets/codex.js.map +1 -0
  441. package/dist/installer/targets/cursor.d.ts +35 -0
  442. package/dist/installer/targets/cursor.d.ts.map +1 -0
  443. package/dist/installer/targets/cursor.js +254 -0
  444. package/dist/installer/targets/cursor.js.map +1 -0
  445. package/dist/installer/targets/gemini.d.ts +26 -0
  446. package/dist/installer/targets/gemini.d.ts.map +1 -0
  447. package/dist/installer/targets/gemini.js +165 -0
  448. package/dist/installer/targets/gemini.js.map +1 -0
  449. package/dist/installer/targets/hermes.d.ts +18 -0
  450. package/dist/installer/targets/hermes.d.ts.map +1 -0
  451. package/dist/installer/targets/hermes.js +359 -0
  452. package/dist/installer/targets/hermes.js.map +1 -0
  453. package/dist/installer/targets/kiro.d.ts +27 -0
  454. package/dist/installer/targets/kiro.d.ts.map +1 -0
  455. package/dist/installer/targets/kiro.js +178 -0
  456. package/dist/installer/targets/kiro.js.map +1 -0
  457. package/dist/installer/targets/opencode.d.ts +38 -0
  458. package/dist/installer/targets/opencode.d.ts.map +1 -0
  459. package/dist/installer/targets/opencode.js +288 -0
  460. package/dist/installer/targets/opencode.js.map +1 -0
  461. package/dist/installer/targets/registry.d.ts +35 -0
  462. package/dist/installer/targets/registry.d.ts.map +1 -0
  463. package/dist/installer/targets/registry.js +91 -0
  464. package/dist/installer/targets/registry.js.map +1 -0
  465. package/dist/installer/targets/shared.d.ts +101 -0
  466. package/dist/installer/targets/shared.d.ts.map +1 -0
  467. package/dist/installer/targets/shared.js +264 -0
  468. package/dist/installer/targets/shared.js.map +1 -0
  469. package/dist/installer/targets/toml.d.ts +52 -0
  470. package/dist/installer/targets/toml.d.ts.map +1 -0
  471. package/dist/installer/targets/toml.js +147 -0
  472. package/dist/installer/targets/toml.js.map +1 -0
  473. package/dist/installer/targets/types.d.ts +108 -0
  474. package/dist/installer/targets/types.d.ts.map +1 -0
  475. package/dist/installer/targets/types.js +16 -0
  476. package/dist/installer/targets/types.js.map +1 -0
  477. package/dist/markdown/cli.d.ts +16 -0
  478. package/dist/markdown/cli.d.ts.map +1 -0
  479. package/dist/markdown/cli.js +533 -0
  480. package/dist/markdown/cli.js.map +1 -0
  481. package/dist/markdown/constants.d.ts +22 -0
  482. package/dist/markdown/constants.d.ts.map +1 -0
  483. package/dist/markdown/constants.js +71 -0
  484. package/dist/markdown/constants.js.map +1 -0
  485. package/dist/markdown/dedup.d.ts +20 -0
  486. package/dist/markdown/dedup.d.ts.map +1 -0
  487. package/dist/markdown/dedup.js +64 -0
  488. package/dist/markdown/dedup.js.map +1 -0
  489. package/dist/markdown/errors.d.ts +22 -0
  490. package/dist/markdown/errors.d.ts.map +1 -0
  491. package/dist/markdown/errors.js +45 -0
  492. package/dist/markdown/errors.js.map +1 -0
  493. package/dist/markdown/extractor.d.ts +43 -0
  494. package/dist/markdown/extractor.d.ts.map +1 -0
  495. package/dist/markdown/extractor.js +152 -0
  496. package/dist/markdown/extractor.js.map +1 -0
  497. package/dist/markdown/frontmatter-parser.d.ts +47 -0
  498. package/dist/markdown/frontmatter-parser.d.ts.map +1 -0
  499. package/dist/markdown/frontmatter-parser.js +199 -0
  500. package/dist/markdown/frontmatter-parser.js.map +1 -0
  501. package/dist/markdown/indexer.d.ts +34 -0
  502. package/dist/markdown/indexer.d.ts.map +1 -0
  503. package/dist/markdown/indexer.js +256 -0
  504. package/dist/markdown/indexer.js.map +1 -0
  505. package/dist/markdown/mcp-tools.d.ts +33 -0
  506. package/dist/markdown/mcp-tools.d.ts.map +1 -0
  507. package/dist/markdown/mcp-tools.js +300 -0
  508. package/dist/markdown/mcp-tools.js.map +1 -0
  509. package/dist/markdown/query.d.ts +108 -0
  510. package/dist/markdown/query.d.ts.map +1 -0
  511. package/dist/markdown/query.js +570 -0
  512. package/dist/markdown/query.js.map +1 -0
  513. package/dist/markdown/schema-bootstrap.d.ts +40 -0
  514. package/dist/markdown/schema-bootstrap.d.ts.map +1 -0
  515. package/dist/markdown/schema-bootstrap.js +85 -0
  516. package/dist/markdown/schema-bootstrap.js.map +1 -0
  517. package/dist/markdown/schema.sql +124 -0
  518. package/dist/markdown/store.d.ts +77 -0
  519. package/dist/markdown/store.d.ts.map +1 -0
  520. package/dist/markdown/store.js +194 -0
  521. package/dist/markdown/store.js.map +1 -0
  522. package/dist/markdown/summary-extractor.d.ts +22 -0
  523. package/dist/markdown/summary-extractor.d.ts.map +1 -0
  524. package/dist/markdown/summary-extractor.js +66 -0
  525. package/dist/markdown/summary-extractor.js.map +1 -0
  526. package/dist/markdown/types.d.ts +159 -0
  527. package/dist/markdown/types.d.ts.map +1 -0
  528. package/dist/markdown/types.js +9 -0
  529. package/dist/markdown/types.js.map +1 -0
  530. package/dist/markdown/validator.d.ts +44 -0
  531. package/dist/markdown/validator.d.ts.map +1 -0
  532. package/dist/markdown/validator.js +95 -0
  533. package/dist/markdown/validator.js.map +1 -0
  534. package/dist/mcp/daemon-manager.d.ts +42 -0
  535. package/dist/mcp/daemon-manager.d.ts.map +1 -0
  536. package/dist/mcp/daemon-manager.js +129 -0
  537. package/dist/mcp/daemon-manager.js.map +1 -0
  538. package/dist/mcp/daemon-paths.d.ts +46 -0
  539. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  540. package/dist/mcp/daemon-paths.js +125 -0
  541. package/dist/mcp/daemon-paths.js.map +1 -0
  542. package/dist/mcp/daemon-registry.d.ts +47 -0
  543. package/dist/mcp/daemon-registry.d.ts.map +1 -0
  544. package/dist/mcp/daemon-registry.js +229 -0
  545. package/dist/mcp/daemon-registry.js.map +1 -0
  546. package/dist/mcp/daemon.d.ts +220 -0
  547. package/dist/mcp/daemon.d.ts.map +1 -0
  548. package/dist/mcp/daemon.js +637 -0
  549. package/dist/mcp/daemon.js.map +1 -0
  550. package/dist/mcp/dynamic-boundaries.d.ts +41 -0
  551. package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  552. package/dist/mcp/dynamic-boundaries.js +359 -0
  553. package/dist/mcp/dynamic-boundaries.js.map +1 -0
  554. package/dist/mcp/engine.d.ts +105 -0
  555. package/dist/mcp/engine.d.ts.map +1 -0
  556. package/dist/mcp/engine.js +278 -0
  557. package/dist/mcp/engine.js.map +1 -0
  558. package/dist/mcp/index.d.ts +113 -0
  559. package/dist/mcp/index.d.ts.map +1 -0
  560. package/dist/mcp/index.js +499 -0
  561. package/dist/mcp/index.js.map +1 -0
  562. package/dist/mcp/liveness-watchdog.d.ts +18 -0
  563. package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  564. package/dist/mcp/liveness-watchdog.js +207 -0
  565. package/dist/mcp/liveness-watchdog.js.map +1 -0
  566. package/dist/mcp/ppid-watchdog.d.ts +44 -0
  567. package/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  568. package/dist/mcp/ppid-watchdog.js +27 -0
  569. package/dist/mcp/ppid-watchdog.js.map +1 -0
  570. package/dist/mcp/proxy.d.ts +87 -0
  571. package/dist/mcp/proxy.d.ts.map +1 -0
  572. package/dist/mcp/proxy.js +641 -0
  573. package/dist/mcp/proxy.js.map +1 -0
  574. package/dist/mcp/server-instructions.d.ts +34 -0
  575. package/dist/mcp/server-instructions.d.ts.map +1 -0
  576. package/dist/mcp/server-instructions.js +106 -0
  577. package/dist/mcp/server-instructions.js.map +1 -0
  578. package/dist/mcp/session.d.ts +79 -0
  579. package/dist/mcp/session.d.ts.map +1 -0
  580. package/dist/mcp/session.js +330 -0
  581. package/dist/mcp/session.js.map +1 -0
  582. package/dist/mcp/stdin-teardown.d.ts +27 -0
  583. package/dist/mcp/stdin-teardown.d.ts.map +1 -0
  584. package/dist/mcp/stdin-teardown.js +49 -0
  585. package/dist/mcp/stdin-teardown.js.map +1 -0
  586. package/dist/mcp/tools.d.ts +547 -0
  587. package/dist/mcp/tools.d.ts.map +1 -0
  588. package/dist/mcp/tools.js +4122 -0
  589. package/dist/mcp/tools.js.map +1 -0
  590. package/dist/mcp/transport.d.ts +188 -0
  591. package/dist/mcp/transport.d.ts.map +1 -0
  592. package/dist/mcp/transport.js +359 -0
  593. package/dist/mcp/transport.js.map +1 -0
  594. package/dist/mcp/version.d.ts +19 -0
  595. package/dist/mcp/version.d.ts.map +1 -0
  596. package/dist/mcp/version.js +71 -0
  597. package/dist/mcp/version.js.map +1 -0
  598. package/dist/project-config.d.ts +36 -0
  599. package/dist/project-config.d.ts.map +1 -0
  600. package/dist/project-config.js +235 -0
  601. package/dist/project-config.js.map +1 -0
  602. package/dist/reasoning/config.d.ts +45 -0
  603. package/dist/reasoning/config.d.ts.map +1 -0
  604. package/dist/reasoning/config.js +171 -0
  605. package/dist/reasoning/config.js.map +1 -0
  606. package/dist/reasoning/credentials.d.ts +5 -0
  607. package/dist/reasoning/credentials.d.ts.map +1 -0
  608. package/dist/reasoning/credentials.js +83 -0
  609. package/dist/reasoning/credentials.js.map +1 -0
  610. package/dist/reasoning/login.d.ts +21 -0
  611. package/dist/reasoning/login.d.ts.map +1 -0
  612. package/dist/reasoning/login.js +85 -0
  613. package/dist/reasoning/login.js.map +1 -0
  614. package/dist/reasoning/reasoner.d.ts +43 -0
  615. package/dist/reasoning/reasoner.d.ts.map +1 -0
  616. package/dist/reasoning/reasoner.js +308 -0
  617. package/dist/reasoning/reasoner.js.map +1 -0
  618. package/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
  619. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  620. package/dist/resolution/c-fnptr-synthesizer.js +352 -0
  621. package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  622. package/dist/resolution/callback-synthesizer.d.ts +15 -0
  623. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  624. package/dist/resolution/callback-synthesizer.js +2926 -0
  625. package/dist/resolution/callback-synthesizer.js.map +1 -0
  626. package/dist/resolution/frameworks/astro.d.ts +9 -0
  627. package/dist/resolution/frameworks/astro.d.ts.map +1 -0
  628. package/dist/resolution/frameworks/astro.js +169 -0
  629. package/dist/resolution/frameworks/astro.js.map +1 -0
  630. package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  631. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  632. package/dist/resolution/frameworks/cargo-workspace.js +225 -0
  633. package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  634. package/dist/resolution/frameworks/csharp.d.ts +8 -0
  635. package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  636. package/dist/resolution/frameworks/csharp.js +241 -0
  637. package/dist/resolution/frameworks/csharp.js.map +1 -0
  638. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  639. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  640. package/dist/resolution/frameworks/drupal.js +367 -0
  641. package/dist/resolution/frameworks/drupal.js.map +1 -0
  642. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  643. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  644. package/dist/resolution/frameworks/expo-modules.js +148 -0
  645. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  646. package/dist/resolution/frameworks/express.d.ts +8 -0
  647. package/dist/resolution/frameworks/express.d.ts.map +1 -0
  648. package/dist/resolution/frameworks/express.js +308 -0
  649. package/dist/resolution/frameworks/express.js.map +1 -0
  650. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  651. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  652. package/dist/resolution/frameworks/fabric.js +354 -0
  653. package/dist/resolution/frameworks/fabric.js.map +1 -0
  654. package/dist/resolution/frameworks/go.d.ts +8 -0
  655. package/dist/resolution/frameworks/go.d.ts.map +1 -0
  656. package/dist/resolution/frameworks/go.js +161 -0
  657. package/dist/resolution/frameworks/go.js.map +1 -0
  658. package/dist/resolution/frameworks/goframe.d.ts +41 -0
  659. package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  660. package/dist/resolution/frameworks/goframe.js +112 -0
  661. package/dist/resolution/frameworks/goframe.js.map +1 -0
  662. package/dist/resolution/frameworks/index.d.ts +50 -0
  663. package/dist/resolution/frameworks/index.d.ts.map +1 -0
  664. package/dist/resolution/frameworks/index.js +169 -0
  665. package/dist/resolution/frameworks/index.js.map +1 -0
  666. package/dist/resolution/frameworks/java.d.ts +8 -0
  667. package/dist/resolution/frameworks/java.d.ts.map +1 -0
  668. package/dist/resolution/frameworks/java.js +509 -0
  669. package/dist/resolution/frameworks/java.js.map +1 -0
  670. package/dist/resolution/frameworks/laravel.d.ts +13 -0
  671. package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  672. package/dist/resolution/frameworks/laravel.js +257 -0
  673. package/dist/resolution/frameworks/laravel.js.map +1 -0
  674. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  675. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  676. package/dist/resolution/frameworks/nestjs.js +698 -0
  677. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  678. package/dist/resolution/frameworks/play.d.ts +19 -0
  679. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  680. package/dist/resolution/frameworks/play.js +111 -0
  681. package/dist/resolution/frameworks/play.js.map +1 -0
  682. package/dist/resolution/frameworks/python.d.ts +10 -0
  683. package/dist/resolution/frameworks/python.d.ts.map +1 -0
  684. package/dist/resolution/frameworks/python.js +400 -0
  685. package/dist/resolution/frameworks/python.js.map +1 -0
  686. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  687. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  688. package/dist/resolution/frameworks/react-native.js +410 -0
  689. package/dist/resolution/frameworks/react-native.js.map +1 -0
  690. package/dist/resolution/frameworks/react.d.ts +8 -0
  691. package/dist/resolution/frameworks/react.d.ts.map +1 -0
  692. package/dist/resolution/frameworks/react.js +334 -0
  693. package/dist/resolution/frameworks/react.js.map +1 -0
  694. package/dist/resolution/frameworks/ruby.d.ts +8 -0
  695. package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  696. package/dist/resolution/frameworks/ruby.js +302 -0
  697. package/dist/resolution/frameworks/ruby.js.map +1 -0
  698. package/dist/resolution/frameworks/rust.d.ts +8 -0
  699. package/dist/resolution/frameworks/rust.d.ts.map +1 -0
  700. package/dist/resolution/frameworks/rust.js +304 -0
  701. package/dist/resolution/frameworks/rust.js.map +1 -0
  702. package/dist/resolution/frameworks/svelte.d.ts +9 -0
  703. package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  704. package/dist/resolution/frameworks/svelte.js +253 -0
  705. package/dist/resolution/frameworks/svelte.js.map +1 -0
  706. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  707. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  708. package/dist/resolution/frameworks/swift-objc.js +252 -0
  709. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  710. package/dist/resolution/frameworks/swift.d.ts +10 -0
  711. package/dist/resolution/frameworks/swift.d.ts.map +1 -0
  712. package/dist/resolution/frameworks/swift.js +400 -0
  713. package/dist/resolution/frameworks/swift.js.map +1 -0
  714. package/dist/resolution/frameworks/vue.d.ts +9 -0
  715. package/dist/resolution/frameworks/vue.d.ts.map +1 -0
  716. package/dist/resolution/frameworks/vue.js +303 -0
  717. package/dist/resolution/frameworks/vue.js.map +1 -0
  718. package/dist/resolution/go-module.d.ts +26 -0
  719. package/dist/resolution/go-module.d.ts.map +1 -0
  720. package/dist/resolution/go-module.js +78 -0
  721. package/dist/resolution/go-module.js.map +1 -0
  722. package/dist/resolution/goframe-synthesizer.d.ts +28 -0
  723. package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  724. package/dist/resolution/goframe-synthesizer.js +158 -0
  725. package/dist/resolution/goframe-synthesizer.js.map +1 -0
  726. package/dist/resolution/import-resolver.d.ts +78 -0
  727. package/dist/resolution/import-resolver.d.ts.map +1 -0
  728. package/dist/resolution/import-resolver.js +1849 -0
  729. package/dist/resolution/import-resolver.js.map +1 -0
  730. package/dist/resolution/index.d.ts +196 -0
  731. package/dist/resolution/index.d.ts.map +1 -0
  732. package/dist/resolution/index.js +1328 -0
  733. package/dist/resolution/index.js.map +1 -0
  734. package/dist/resolution/lru-cache.d.ts +24 -0
  735. package/dist/resolution/lru-cache.d.ts.map +1 -0
  736. package/dist/resolution/lru-cache.js +62 -0
  737. package/dist/resolution/lru-cache.js.map +1 -0
  738. package/dist/resolution/name-matcher.d.ts +93 -0
  739. package/dist/resolution/name-matcher.d.ts.map +1 -0
  740. package/dist/resolution/name-matcher.js +1212 -0
  741. package/dist/resolution/name-matcher.js.map +1 -0
  742. package/dist/resolution/path-aliases.d.ts +68 -0
  743. package/dist/resolution/path-aliases.d.ts.map +1 -0
  744. package/dist/resolution/path-aliases.js +238 -0
  745. package/dist/resolution/path-aliases.js.map +1 -0
  746. package/dist/resolution/strip-comments.d.ts +27 -0
  747. package/dist/resolution/strip-comments.d.ts.map +1 -0
  748. package/dist/resolution/strip-comments.js +443 -0
  749. package/dist/resolution/strip-comments.js.map +1 -0
  750. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  751. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  752. package/dist/resolution/swift-objc-bridge.js +256 -0
  753. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  754. package/dist/resolution/types.d.ts +233 -0
  755. package/dist/resolution/types.d.ts.map +1 -0
  756. package/dist/resolution/types.js +8 -0
  757. package/dist/resolution/types.js.map +1 -0
  758. package/dist/resolution/workspace-packages.d.ts +48 -0
  759. package/dist/resolution/workspace-packages.d.ts.map +1 -0
  760. package/dist/resolution/workspace-packages.js +208 -0
  761. package/dist/resolution/workspace-packages.js.map +1 -0
  762. package/dist/search/query-parser.d.ts +57 -0
  763. package/dist/search/query-parser.d.ts.map +1 -0
  764. package/dist/search/query-parser.js +177 -0
  765. package/dist/search/query-parser.js.map +1 -0
  766. package/dist/search/query-utils.d.ts +87 -0
  767. package/dist/search/query-utils.d.ts.map +1 -0
  768. package/dist/search/query-utils.js +449 -0
  769. package/dist/search/query-utils.js.map +1 -0
  770. package/dist/sync/git-hooks.d.ts +45 -0
  771. package/dist/sync/git-hooks.d.ts.map +1 -0
  772. package/dist/sync/git-hooks.js +225 -0
  773. package/dist/sync/git-hooks.js.map +1 -0
  774. package/dist/sync/index.d.ts +19 -0
  775. package/dist/sync/index.d.ts.map +1 -0
  776. package/dist/sync/index.js +35 -0
  777. package/dist/sync/index.js.map +1 -0
  778. package/dist/sync/watch-policy.d.ts +48 -0
  779. package/dist/sync/watch-policy.d.ts.map +1 -0
  780. package/dist/sync/watch-policy.js +124 -0
  781. package/dist/sync/watch-policy.js.map +1 -0
  782. package/dist/sync/watcher.d.ts +350 -0
  783. package/dist/sync/watcher.d.ts.map +1 -0
  784. package/dist/sync/watcher.js +811 -0
  785. package/dist/sync/watcher.js.map +1 -0
  786. package/dist/sync/worktree.d.ts +54 -0
  787. package/dist/sync/worktree.d.ts.map +1 -0
  788. package/dist/sync/worktree.js +137 -0
  789. package/dist/sync/worktree.js.map +1 -0
  790. package/dist/telemetry/index.d.ts +143 -0
  791. package/dist/telemetry/index.d.ts.map +1 -0
  792. package/dist/telemetry/index.js +541 -0
  793. package/dist/telemetry/index.js.map +1 -0
  794. package/dist/timeline/bash-semantics.d.ts +52 -0
  795. package/dist/timeline/bash-semantics.d.ts.map +1 -0
  796. package/dist/timeline/bash-semantics.js +376 -0
  797. package/dist/timeline/bash-semantics.js.map +1 -0
  798. package/dist/timeline/cli.d.ts +50 -0
  799. package/dist/timeline/cli.d.ts.map +1 -0
  800. package/dist/timeline/cli.js +367 -0
  801. package/dist/timeline/cli.js.map +1 -0
  802. package/dist/timeline/constants.d.ts +62 -0
  803. package/dist/timeline/constants.d.ts.map +1 -0
  804. package/dist/timeline/constants.js +73 -0
  805. package/dist/timeline/constants.js.map +1 -0
  806. package/dist/timeline/errors.d.ts +27 -0
  807. package/dist/timeline/errors.d.ts.map +1 -0
  808. package/dist/timeline/errors.js +51 -0
  809. package/dist/timeline/errors.js.map +1 -0
  810. package/dist/timeline/hook-runner.d.ts +36 -0
  811. package/dist/timeline/hook-runner.d.ts.map +1 -0
  812. package/dist/timeline/hook-runner.js +61 -0
  813. package/dist/timeline/hook-runner.js.map +1 -0
  814. package/dist/timeline/hooks.d.ts +45 -0
  815. package/dist/timeline/hooks.d.ts.map +1 -0
  816. package/dist/timeline/hooks.js +364 -0
  817. package/dist/timeline/hooks.js.map +1 -0
  818. package/dist/timeline/index.d.ts +12 -0
  819. package/dist/timeline/index.d.ts.map +1 -0
  820. package/dist/timeline/index.js +28 -0
  821. package/dist/timeline/index.js.map +1 -0
  822. package/dist/timeline/indexer.d.ts +37 -0
  823. package/dist/timeline/indexer.d.ts.map +1 -0
  824. package/dist/timeline/indexer.js +76 -0
  825. package/dist/timeline/indexer.js.map +1 -0
  826. package/dist/timeline/installer.d.ts +33 -0
  827. package/dist/timeline/installer.d.ts.map +1 -0
  828. package/dist/timeline/installer.js +255 -0
  829. package/dist/timeline/installer.js.map +1 -0
  830. package/dist/timeline/payload.d.ts +31 -0
  831. package/dist/timeline/payload.d.ts.map +1 -0
  832. package/dist/timeline/payload.js +58 -0
  833. package/dist/timeline/payload.js.map +1 -0
  834. package/dist/timeline/post-tool-summary.d.ts +29 -0
  835. package/dist/timeline/post-tool-summary.d.ts.map +1 -0
  836. package/dist/timeline/post-tool-summary.js +190 -0
  837. package/dist/timeline/post-tool-summary.js.map +1 -0
  838. package/dist/timeline/recorder.d.ts +36 -0
  839. package/dist/timeline/recorder.d.ts.map +1 -0
  840. package/dist/timeline/recorder.js +42 -0
  841. package/dist/timeline/recorder.js.map +1 -0
  842. package/dist/timeline/schema-bootstrap.d.ts +42 -0
  843. package/dist/timeline/schema-bootstrap.d.ts.map +1 -0
  844. package/dist/timeline/schema-bootstrap.js +81 -0
  845. package/dist/timeline/schema-bootstrap.js.map +1 -0
  846. package/dist/timeline/schema.sql +37 -0
  847. package/dist/timeline/store.d.ts +69 -0
  848. package/dist/timeline/store.d.ts.map +1 -0
  849. package/dist/timeline/store.js +429 -0
  850. package/dist/timeline/store.js.map +1 -0
  851. package/dist/timeline/types.d.ts +78 -0
  852. package/dist/timeline/types.d.ts.map +1 -0
  853. package/dist/timeline/types.js +9 -0
  854. package/dist/timeline/types.js.map +1 -0
  855. package/dist/types.d.ts +392 -0
  856. package/dist/types.d.ts.map +1 -0
  857. package/dist/types.js +81 -0
  858. package/dist/types.js.map +1 -0
  859. package/dist/ui/glyphs.d.ts +42 -0
  860. package/dist/ui/glyphs.d.ts.map +1 -0
  861. package/dist/ui/glyphs.js +78 -0
  862. package/dist/ui/glyphs.js.map +1 -0
  863. package/dist/ui/shimmer-progress.d.ts +11 -0
  864. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  865. package/dist/ui/shimmer-progress.js +90 -0
  866. package/dist/ui/shimmer-progress.js.map +1 -0
  867. package/dist/ui/shimmer-worker.d.ts +2 -0
  868. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  869. package/dist/ui/shimmer-worker.js +118 -0
  870. package/dist/ui/shimmer-worker.js.map +1 -0
  871. package/dist/ui/types.d.ts +17 -0
  872. package/dist/ui/types.d.ts.map +1 -0
  873. package/dist/ui/types.js +3 -0
  874. package/dist/ui/types.js.map +1 -0
  875. package/dist/upgrade/index.d.ts +132 -0
  876. package/dist/upgrade/index.d.ts.map +1 -0
  877. package/dist/upgrade/index.js +498 -0
  878. package/dist/upgrade/index.js.map +1 -0
  879. package/dist/utils.d.ts +224 -0
  880. package/dist/utils.d.ts.map +1 -0
  881. package/dist/utils.js +583 -0
  882. package/dist/utils.js.map +1 -0
  883. package/package.json +60 -0
  884. package/scripts/add-lang/bench.sh +60 -0
  885. package/scripts/add-lang/check-grammar.mjs +75 -0
  886. package/scripts/add-lang/dump-ast.mjs +103 -0
  887. package/scripts/add-lang/verify-extraction.mjs +70 -0
  888. package/scripts/agent-eval/ab-adoption.sh +91 -0
  889. package/scripts/agent-eval/ab-hook.sh +86 -0
  890. package/scripts/agent-eval/ab-impl.sh +78 -0
  891. package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
  892. package/scripts/agent-eval/ab-sufficiency.sh +78 -0
  893. package/scripts/agent-eval/arms-F.sh +21 -0
  894. package/scripts/agent-eval/arms-matrix.sh +37 -0
  895. package/scripts/agent-eval/audit.sh +68 -0
  896. package/scripts/agent-eval/bench-readme.sh +28 -0
  897. package/scripts/agent-eval/bench-why-repo.sh +22 -0
  898. package/scripts/agent-eval/block-read-hook.sh +19 -0
  899. package/scripts/agent-eval/hook-settings.json +15 -0
  900. package/scripts/agent-eval/itrun.sh +120 -0
  901. package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
  902. package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
  903. package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
  904. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
  905. package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
  906. package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
  907. package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
  908. package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
  909. package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
  910. package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
  911. package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
  912. package/scripts/agent-eval/offload-eval-setup.sh +24 -0
  913. package/scripts/agent-eval/offload-eval-styles.sh +72 -0
  914. package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
  915. package/scripts/agent-eval/offload-eval.md +76 -0
  916. package/scripts/agent-eval/parse-arms.mjs +116 -0
  917. package/scripts/agent-eval/parse-bench-readme.mjs +84 -0
  918. package/scripts/agent-eval/parse-run.mjs +45 -0
  919. package/scripts/agent-eval/parse-session.mjs +93 -0
  920. package/scripts/agent-eval/probe-context.mjs +21 -0
  921. package/scripts/agent-eval/probe-explore.mjs +40 -0
  922. package/scripts/agent-eval/probe-node.mjs +20 -0
  923. package/scripts/agent-eval/probe-sweep.mjs +119 -0
  924. package/scripts/agent-eval/probe-trace.mjs +20 -0
  925. package/scripts/agent-eval/redirect-read-hook.sh +38 -0
  926. package/scripts/agent-eval/run-agent.sh +34 -0
  927. package/scripts/agent-eval/run-all.sh +69 -0
  928. package/scripts/agent-eval/run-arms.sh +56 -0
  929. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  930. package/scripts/build-bundle.sh +118 -0
  931. package/scripts/extract-release-notes.mjs +130 -0
  932. package/scripts/local-install.sh +41 -0
  933. package/scripts/npm-sdk.js +75 -0
  934. package/scripts/npm-shim.js +246 -0
  935. package/scripts/pack-npm.sh +118 -0
  936. package/scripts/prepare-release.mjs +270 -0
package/dist/index.js ADDED
@@ -0,0 +1,1041 @@
1
+ "use strict";
2
+ /**
3
+ * CodeGraph
4
+ *
5
+ * A local-first code intelligence system that builds a semantic
6
+ * knowledge graph from any codebase.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
20
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
21
+ }) : function(o, v) {
22
+ o["default"] = v;
23
+ });
24
+ var __importStar = (this && this.__importStar) || (function () {
25
+ var ownKeys = function(o) {
26
+ ownKeys = Object.getOwnPropertyNames || function (o) {
27
+ var ar = [];
28
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
29
+ return ar;
30
+ };
31
+ return ownKeys(o);
32
+ };
33
+ return function (mod) {
34
+ if (mod && mod.__esModule) return mod;
35
+ var result = {};
36
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
37
+ __setModuleDefault(result, mod);
38
+ return result;
39
+ };
40
+ })();
41
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
42
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
43
+ };
44
+ Object.defineProperty(exports, "__esModule", { value: true });
45
+ exports.CodeGraph = exports.MCPServer = exports.LockUnavailableError = exports.FileWatcher = exports.MemoryMonitor = exports.throttle = exports.debounce = exports.processInBatches = exports.FileLock = exports.Mutex = exports.defaultLogger = exports.silentLogger = exports.getLogger = exports.setLogger = exports.ConfigError = exports.VectorError = exports.SearchError = exports.DatabaseError = exports.ParseError = exports.FileError = exports.CodeGraphError = exports.loadAllGrammars = exports.loadGrammarsForLanguages = exports.initGrammars = exports.getSupportedLanguages = exports.isGrammarLoaded = exports.isLanguageSupported = exports.detectLanguage = exports.CGRAPHX_DIR = exports.findNearestCodeGraphRoot = exports.isInitialized = exports.getCodeGraphDir = exports.QueryBuilder = exports.DatabaseConnection = exports.getDatabasePath = void 0;
46
+ const path = __importStar(require("path"));
47
+ const db_1 = require("./db");
48
+ const queries_1 = require("./db/queries");
49
+ const directory_1 = require("./directory");
50
+ const extraction_1 = require("./extraction");
51
+ const resolution_1 = require("./resolution");
52
+ const graph_1 = require("./graph");
53
+ const context_1 = require("./context");
54
+ const utils_1 = require("./utils");
55
+ const sync_1 = require("./sync");
56
+ const extraction_version_1 = require("./extraction/extraction-version");
57
+ const directory_2 = require("./directory");
58
+ const query_utils_1 = require("./search/query-utils");
59
+ const version_1 = require("./mcp/version");
60
+ // Re-export types for consumers
61
+ __exportStar(require("./types"), exports);
62
+ // Storage building blocks for embedded/SDK consumers that drive the graph
63
+ // directly (open a DB, run prepared queries) rather than through the CodeGraph
64
+ // facade. Exposed from the package entry so they no longer require deep imports
65
+ // into dist/ (issue #354).
66
+ var db_2 = require("./db");
67
+ Object.defineProperty(exports, "getDatabasePath", { enumerable: true, get: function () { return db_2.getDatabasePath; } });
68
+ Object.defineProperty(exports, "DatabaseConnection", { enumerable: true, get: function () { return db_2.DatabaseConnection; } });
69
+ var queries_2 = require("./db/queries");
70
+ Object.defineProperty(exports, "QueryBuilder", { enumerable: true, get: function () { return queries_2.QueryBuilder; } });
71
+ var directory_3 = require("./directory");
72
+ Object.defineProperty(exports, "getCodeGraphDir", { enumerable: true, get: function () { return directory_3.getCodeGraphDir; } });
73
+ Object.defineProperty(exports, "isInitialized", { enumerable: true, get: function () { return directory_3.isInitialized; } });
74
+ Object.defineProperty(exports, "findNearestCodeGraphRoot", { enumerable: true, get: function () { return directory_3.findNearestCodeGraphRoot; } });
75
+ Object.defineProperty(exports, "CGRAPHX_DIR", { enumerable: true, get: function () { return directory_3.CGRAPHX_DIR; } });
76
+ var extraction_2 = require("./extraction");
77
+ Object.defineProperty(exports, "detectLanguage", { enumerable: true, get: function () { return extraction_2.detectLanguage; } });
78
+ Object.defineProperty(exports, "isLanguageSupported", { enumerable: true, get: function () { return extraction_2.isLanguageSupported; } });
79
+ Object.defineProperty(exports, "isGrammarLoaded", { enumerable: true, get: function () { return extraction_2.isGrammarLoaded; } });
80
+ Object.defineProperty(exports, "getSupportedLanguages", { enumerable: true, get: function () { return extraction_2.getSupportedLanguages; } });
81
+ Object.defineProperty(exports, "initGrammars", { enumerable: true, get: function () { return extraction_2.initGrammars; } });
82
+ Object.defineProperty(exports, "loadGrammarsForLanguages", { enumerable: true, get: function () { return extraction_2.loadGrammarsForLanguages; } });
83
+ Object.defineProperty(exports, "loadAllGrammars", { enumerable: true, get: function () { return extraction_2.loadAllGrammars; } });
84
+ var errors_1 = require("./errors");
85
+ Object.defineProperty(exports, "CodeGraphError", { enumerable: true, get: function () { return errors_1.CodeGraphError; } });
86
+ Object.defineProperty(exports, "FileError", { enumerable: true, get: function () { return errors_1.FileError; } });
87
+ Object.defineProperty(exports, "ParseError", { enumerable: true, get: function () { return errors_1.ParseError; } });
88
+ Object.defineProperty(exports, "DatabaseError", { enumerable: true, get: function () { return errors_1.DatabaseError; } });
89
+ Object.defineProperty(exports, "SearchError", { enumerable: true, get: function () { return errors_1.SearchError; } });
90
+ Object.defineProperty(exports, "VectorError", { enumerable: true, get: function () { return errors_1.VectorError; } });
91
+ Object.defineProperty(exports, "ConfigError", { enumerable: true, get: function () { return errors_1.ConfigError; } });
92
+ Object.defineProperty(exports, "setLogger", { enumerable: true, get: function () { return errors_1.setLogger; } });
93
+ Object.defineProperty(exports, "getLogger", { enumerable: true, get: function () { return errors_1.getLogger; } });
94
+ Object.defineProperty(exports, "silentLogger", { enumerable: true, get: function () { return errors_1.silentLogger; } });
95
+ Object.defineProperty(exports, "defaultLogger", { enumerable: true, get: function () { return errors_1.defaultLogger; } });
96
+ var utils_2 = require("./utils");
97
+ Object.defineProperty(exports, "Mutex", { enumerable: true, get: function () { return utils_2.Mutex; } });
98
+ Object.defineProperty(exports, "FileLock", { enumerable: true, get: function () { return utils_2.FileLock; } });
99
+ Object.defineProperty(exports, "processInBatches", { enumerable: true, get: function () { return utils_2.processInBatches; } });
100
+ Object.defineProperty(exports, "debounce", { enumerable: true, get: function () { return utils_2.debounce; } });
101
+ Object.defineProperty(exports, "throttle", { enumerable: true, get: function () { return utils_2.throttle; } });
102
+ Object.defineProperty(exports, "MemoryMonitor", { enumerable: true, get: function () { return utils_2.MemoryMonitor; } });
103
+ var sync_2 = require("./sync");
104
+ Object.defineProperty(exports, "FileWatcher", { enumerable: true, get: function () { return sync_2.FileWatcher; } });
105
+ Object.defineProperty(exports, "LockUnavailableError", { enumerable: true, get: function () { return sync_2.LockUnavailableError; } });
106
+ var mcp_1 = require("./mcp");
107
+ Object.defineProperty(exports, "MCPServer", { enumerable: true, get: function () { return mcp_1.MCPServer; } });
108
+ /**
109
+ * Main CodeGraph class
110
+ *
111
+ * Provides the primary interface for interacting with the code knowledge graph.
112
+ */
113
+ class CodeGraph {
114
+ db;
115
+ queries;
116
+ projectRoot;
117
+ // Assigned via wireLayers() from the constructor (and again on reopen) — the
118
+ // `!` tells TS these are definitely set even though the assignment is one
119
+ // method call away from the constructor body.
120
+ orchestrator;
121
+ resolver;
122
+ graphManager;
123
+ traverser;
124
+ contextBuilder;
125
+ // Mutex for preventing concurrent indexing operations (in-process)
126
+ indexMutex = new utils_1.Mutex();
127
+ // File lock for preventing concurrent writes across processes (CLI, MCP, git hooks)
128
+ fileLock;
129
+ // File watcher for auto-sync on file changes
130
+ watcher = null;
131
+ constructor(db, queries, projectRoot) {
132
+ this.db = db;
133
+ this.queries = queries;
134
+ this.projectRoot = projectRoot;
135
+ this.fileLock = new utils_1.FileLock(path.join((0, directory_2.getCodeGraphDir)(projectRoot), 'cgraphx.lock'));
136
+ this.wireLayers();
137
+ }
138
+ /**
139
+ * (Re)build the query/extraction/graph layers over the current `this.queries`
140
+ * (which wraps `this.db`). Factored out of the constructor so `reopenIfReplaced`
141
+ * can rebuild them against a fresh connection without duplicating the wiring.
142
+ * The path-based `fileLock` is independent of the DB handle, so it stays put.
143
+ */
144
+ wireLayers() {
145
+ // Down-weight the project name as a query term in search ranking — it names
146
+ // the whole repo, not a symbol, so it has no discriminative value (#720).
147
+ try {
148
+ this.queries.setProjectNameTokens((0, query_utils_1.deriveProjectNameTokens)(this.projectRoot));
149
+ }
150
+ catch {
151
+ // Best-effort: ranking still works without it.
152
+ }
153
+ this.orchestrator = new extraction_1.ExtractionOrchestrator(this.projectRoot, this.queries);
154
+ this.resolver = (0, resolution_1.createResolver)(this.projectRoot, this.queries);
155
+ this.graphManager = new graph_1.GraphQueryManager(this.queries);
156
+ this.traverser = new graph_1.GraphTraverser(this.queries);
157
+ this.contextBuilder = (0, context_1.createContextBuilder)(this.projectRoot, this.queries, this.traverser);
158
+ }
159
+ /**
160
+ * Heal a stale database handle in place. If `.cgraphx/` was removed and
161
+ * recreated at the SAME path while this instance held the DB open — a git
162
+ * worktree removed and re-added, or `rm -rf .cgraphx` + `cgraphx init` —
163
+ * our open fd points at the now-unlinked inode and can never see the new
164
+ * index, so every query returns the pre-removal snapshot until the process
165
+ * restarts (#925). When that's detected, open the live file at the same path,
166
+ * rebuild the query layers, and swap them IN PLACE, so every holder of this
167
+ * instance (the MCP daemon's default project, cached projectPath connections)
168
+ * heals without a restart. Returns true iff it reopened.
169
+ *
170
+ * POSIX-only in practice: `isReplacedOnDisk` never fires on Windows (an open
171
+ * file can't be unlinked there, and st_ino is unreliable).
172
+ */
173
+ reopenIfReplaced() {
174
+ if (!this.db.isReplacedOnDisk())
175
+ return false;
176
+ const dbPath = this.db.getPath();
177
+ // Open the live file FIRST — if that throws (e.g. mid-recreate), the old
178
+ // handle stays in place and the caller retries on the next query, rather
179
+ // than leaving this instance with no connection at all.
180
+ const fresh = db_1.DatabaseConnection.open(dbPath);
181
+ const stale = this.db;
182
+ this.db = fresh;
183
+ this.queries = new queries_1.QueryBuilder(fresh.getDb());
184
+ this.wireLayers();
185
+ // Releasing the dead handle also frees the leaked db/-wal/-shm fds that were
186
+ // pinning the unlinked inode (#925).
187
+ try {
188
+ stale.close();
189
+ }
190
+ catch { /* the old inode is gone; closing just frees fds */ }
191
+ return true;
192
+ }
193
+ // ===========================================================================
194
+ // Lifecycle Methods
195
+ // ===========================================================================
196
+ /**
197
+ * Initialize a new CodeGraph project
198
+ *
199
+ * Creates the .CodeGraph directory, database, and configuration.
200
+ *
201
+ * @param projectRoot - Path to the project root directory
202
+ * @param options - Initialization options
203
+ * @returns A new CodeGraph instance
204
+ */
205
+ static async init(projectRoot, options = {}) {
206
+ await (0, extraction_1.initGrammars)();
207
+ const resolvedRoot = path.resolve(projectRoot);
208
+ // Check if already initialized
209
+ if ((0, directory_1.isInitialized)(resolvedRoot)) {
210
+ throw new Error(`cgraphx already initialized in ${resolvedRoot}`);
211
+ }
212
+ // Create directory structure
213
+ (0, directory_1.createDirectory)(resolvedRoot);
214
+ // Initialize database
215
+ const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
216
+ const db = db_1.DatabaseConnection.initialize(dbPath);
217
+ const queries = new queries_1.QueryBuilder(db.getDb());
218
+ const instance = new CodeGraph(db, queries, resolvedRoot);
219
+ // Run initial indexing if requested
220
+ if (options.index) {
221
+ await instance.indexAll({ onProgress: options.onProgress });
222
+ }
223
+ return instance;
224
+ }
225
+ /**
226
+ * Initialize synchronously (without indexing)
227
+ */
228
+ static initSync(projectRoot) {
229
+ const resolvedRoot = path.resolve(projectRoot);
230
+ // Check if already initialized
231
+ if ((0, directory_1.isInitialized)(resolvedRoot)) {
232
+ throw new Error(`cgraphx already initialized in ${resolvedRoot}`);
233
+ }
234
+ // Create directory structure
235
+ (0, directory_1.createDirectory)(resolvedRoot);
236
+ // Initialize database
237
+ const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
238
+ const db = db_1.DatabaseConnection.initialize(dbPath);
239
+ const queries = new queries_1.QueryBuilder(db.getDb());
240
+ return new CodeGraph(db, queries, resolvedRoot);
241
+ }
242
+ /**
243
+ * Open an existing CodeGraph project
244
+ *
245
+ * @param projectRoot - Path to the project root directory
246
+ * @param options - Open options
247
+ * @returns A CodeGraph instance
248
+ */
249
+ static async open(projectRoot, options = {}) {
250
+ await (0, extraction_1.initGrammars)();
251
+ const resolvedRoot = path.resolve(projectRoot);
252
+ // Check if initialized
253
+ if (!(0, directory_1.isInitialized)(resolvedRoot)) {
254
+ throw new Error(`cgraphx not initialized in ${resolvedRoot}. Run init() first.`);
255
+ }
256
+ // Validate directory structure
257
+ const validation = (0, directory_1.validateDirectory)(resolvedRoot);
258
+ if (!validation.valid) {
259
+ throw new Error(`Invalid cgraphx directory: ${validation.errors.join(', ')}`);
260
+ }
261
+ // Open database
262
+ const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
263
+ const db = db_1.DatabaseConnection.open(dbPath);
264
+ const queries = new queries_1.QueryBuilder(db.getDb());
265
+ const instance = new CodeGraph(db, queries, resolvedRoot);
266
+ // Sync if requested
267
+ if (options.sync) {
268
+ await instance.sync();
269
+ }
270
+ return instance;
271
+ }
272
+ /**
273
+ * Open synchronously (without sync)
274
+ */
275
+ static openSync(projectRoot) {
276
+ const resolvedRoot = path.resolve(projectRoot);
277
+ // Check if initialized
278
+ if (!(0, directory_1.isInitialized)(resolvedRoot)) {
279
+ throw new Error(`cgraphx not initialized in ${resolvedRoot}. Run init() first.`);
280
+ }
281
+ // Validate directory structure
282
+ const validation = (0, directory_1.validateDirectory)(resolvedRoot);
283
+ if (!validation.valid) {
284
+ throw new Error(`Invalid cgraphx directory: ${validation.errors.join(', ')}`);
285
+ }
286
+ // Open database
287
+ const dbPath = (0, db_1.getDatabasePath)(resolvedRoot);
288
+ const db = db_1.DatabaseConnection.open(dbPath);
289
+ const queries = new queries_1.QueryBuilder(db.getDb());
290
+ return new CodeGraph(db, queries, resolvedRoot);
291
+ }
292
+ /**
293
+ * Check if a directory has been initialized as a CodeGraph project
294
+ */
295
+ static isInitialized(projectRoot) {
296
+ return (0, directory_1.isInitialized)(path.resolve(projectRoot));
297
+ }
298
+ /**
299
+ * Close the CodeGraph instance and release resources
300
+ */
301
+ close() {
302
+ this.unwatch();
303
+ // Release file lock if held
304
+ this.fileLock.release();
305
+ this.db.close();
306
+ }
307
+ /**
308
+ * Get the project root directory
309
+ */
310
+ getProjectRoot() {
311
+ return this.projectRoot;
312
+ }
313
+ // ===========================================================================
314
+ // Indexing
315
+ // ===========================================================================
316
+ /**
317
+ * Index all files in the project
318
+ *
319
+ * Uses a mutex to prevent concurrent indexing operations.
320
+ */
321
+ async indexAll(options = {}) {
322
+ return this.indexMutex.withLock(async () => {
323
+ try {
324
+ this.fileLock.acquire();
325
+ }
326
+ catch {
327
+ return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' }], durationMs: 0 };
328
+ }
329
+ try {
330
+ const before = this.queries.getNodeAndEdgeCount();
331
+ const result = await this.orchestrator.indexAll(options.onProgress, options.signal, options.verbose);
332
+ // Re-detect frameworks now that the index is populated. The resolver
333
+ // is constructed with createResolver() before any files exist, so
334
+ // framework resolvers whose detect() consults the indexed file list
335
+ // (e.g. UIKit/SwiftUI scanning for imports, swift-objc-bridge looking
336
+ // for both Swift and ObjC files) all return false on that initial pass
337
+ // and silently drop themselves. Re-initializing here gives them a
338
+ // chance to see the actual project before resolution runs.
339
+ if (result.success && result.filesIndexed > 0) {
340
+ this.resolver.initialize();
341
+ // Cross-file finalization (e.g. NestJS RouterModule prefixes). Runs
342
+ // before resolution so updated names show up in subsequent reads.
343
+ this.resolver.runPostExtract();
344
+ }
345
+ // Resolve references to create call/import/extends edges
346
+ if (result.success && result.filesIndexed > 0) {
347
+ // Get count without loading all refs into memory
348
+ const unresolvedCount = this.queries.getUnresolvedReferencesCount();
349
+ options.onProgress?.({
350
+ phase: 'resolving',
351
+ current: 0,
352
+ total: unresolvedCount,
353
+ });
354
+ await this.resolveReferencesBatched((current, total) => {
355
+ options.onProgress?.({
356
+ phase: 'resolving',
357
+ current,
358
+ total,
359
+ });
360
+ });
361
+ // Second pass: chained calls whose method lives on a supertype the
362
+ // receiver conforms to (protocol-extension / inherited / default-
363
+ // interface). Needs the implements/extends edges the main pass just
364
+ // built, so it runs after resolution (#750).
365
+ this.resolver.resolveChainedCallsViaConformance();
366
+ // Same lifecycle for `this.<member>` callback registrations whose
367
+ // member is inherited from a supertype (#808).
368
+ this.resolver.resolveDeferredThisMemberRefs();
369
+ }
370
+ // Refresh planner stats + checkpoint the WAL after bulk writes.
371
+ // Cheap and non-blocking; never load-bearing for correctness.
372
+ if (result.success && result.filesIndexed > 0) {
373
+ this.db.runMaintenance();
374
+ }
375
+ // The orchestrator only sees extraction-phase counts; resolution and
376
+ // synthesizer edges (often >50% of the graph on JVM repos) come later.
377
+ // Recompute against the DB so the CLI summary reports the true totals.
378
+ if (result.success && result.filesIndexed > 0) {
379
+ const after = this.queries.getNodeAndEdgeCount();
380
+ result.nodesCreated = after.nodes - before.nodes;
381
+ result.edgesCreated = after.edges - before.edges;
382
+ }
383
+ // Stamp the index with the engine that built it, so `cgraphx status`
384
+ // and `cgraphx upgrade` can recommend a re-index when the running
385
+ // engine produces richer extraction than the one on disk. Only on a
386
+ // real full index — a sync touches a subset, so it must NOT advance the
387
+ // extraction stamp (the bulk would still be stale). See extraction-version.ts.
388
+ if (result.success && result.filesIndexed > 0) {
389
+ try {
390
+ this.queries.setMetadata('indexed_with_version', version_1.CodeGraphPackageVersion);
391
+ this.queries.setMetadata('indexed_with_extraction_version', String(extraction_version_1.EXTRACTION_VERSION));
392
+ }
393
+ catch { /* metadata is advisory — never fail an index over it */ }
394
+ }
395
+ return result;
396
+ }
397
+ finally {
398
+ this.fileLock.release();
399
+ }
400
+ });
401
+ }
402
+ /**
403
+ * Index specific files
404
+ *
405
+ * Uses a mutex to prevent concurrent indexing operations.
406
+ */
407
+ async indexFiles(filePaths) {
408
+ return this.indexMutex.withLock(async () => {
409
+ try {
410
+ this.fileLock.acquire();
411
+ }
412
+ catch {
413
+ return { success: false, filesIndexed: 0, filesSkipped: 0, filesErrored: 0, nodesCreated: 0, edgesCreated: 0, errors: [{ message: 'Could not acquire file lock - another process may be indexing', severity: 'error' }], durationMs: 0 };
414
+ }
415
+ try {
416
+ return this.orchestrator.indexFiles(filePaths);
417
+ }
418
+ finally {
419
+ this.fileLock.release();
420
+ }
421
+ });
422
+ }
423
+ /**
424
+ * Sync with current file state (incremental update)
425
+ *
426
+ * Uses a mutex to prevent concurrent indexing operations.
427
+ */
428
+ async sync(options = {}) {
429
+ return this.indexMutex.withLock(async () => {
430
+ try {
431
+ this.fileLock.acquire();
432
+ }
433
+ catch {
434
+ return { filesChecked: 0, filesAdded: 0, filesModified: 0, filesRemoved: 0, nodesUpdated: 0, durationMs: 0 };
435
+ }
436
+ try {
437
+ const result = await this.orchestrator.sync(options.onProgress);
438
+ // Cross-file finalization (e.g. NestJS RouterModule prefixes). Run on
439
+ // every sync that touched files so edits to `app.module.ts` propagate
440
+ // to controllers in unchanged files. The pass is idempotent and cheap
441
+ // (regex over *.module.ts only).
442
+ if (result.filesAdded > 0 || result.filesModified > 0) {
443
+ this.resolver.runPostExtract();
444
+ }
445
+ // Resolve references if files were updated
446
+ if (result.filesAdded > 0 || result.filesModified > 0) {
447
+ if (result.changedFilePaths) {
448
+ // Scope resolution to changed files (git fast path — bounded set)
449
+ const unresolvedRefs = this.queries.getUnresolvedReferencesByFiles(result.changedFilePaths);
450
+ options.onProgress?.({
451
+ phase: 'resolving',
452
+ current: 0,
453
+ total: unresolvedRefs.length,
454
+ });
455
+ this.resolver.resolveAndPersist(unresolvedRefs, (current, total) => {
456
+ options.onProgress?.({
457
+ phase: 'resolving',
458
+ current,
459
+ total,
460
+ });
461
+ });
462
+ }
463
+ else {
464
+ // No git info — use batched resolution to avoid OOM
465
+ const unresolvedCount = this.queries.getUnresolvedReferencesCount();
466
+ options.onProgress?.({
467
+ phase: 'resolving',
468
+ current: 0,
469
+ total: unresolvedCount,
470
+ });
471
+ await this.resolveReferencesBatched((current, total) => {
472
+ options.onProgress?.({
473
+ phase: 'resolving',
474
+ current,
475
+ total,
476
+ });
477
+ });
478
+ }
479
+ // Second pass: chained calls whose method lives on a supertype the
480
+ // receiver conforms to (protocol-extension / inherited). Needs the
481
+ // implements/extends edges built above (#750).
482
+ this.resolver.resolveChainedCallsViaConformance();
483
+ // Same lifecycle for `this.<member>` callback registrations whose
484
+ // member is inherited from a supertype (#808).
485
+ this.resolver.resolveDeferredThisMemberRefs();
486
+ }
487
+ // Refresh planner stats + checkpoint the WAL after bulk writes.
488
+ if (result.filesAdded > 0 || result.filesModified > 0 || result.filesRemoved > 0) {
489
+ this.db.runMaintenance();
490
+ }
491
+ return result;
492
+ }
493
+ finally {
494
+ this.fileLock.release();
495
+ }
496
+ });
497
+ }
498
+ /**
499
+ * Check if an indexing operation is currently in progress
500
+ */
501
+ isIndexing() {
502
+ return this.indexMutex.isLocked();
503
+ }
504
+ // ===========================================================================
505
+ // File Watching
506
+ // ===========================================================================
507
+ /**
508
+ * Start watching for file changes and auto-syncing.
509
+ *
510
+ * Uses native OS file events (FSEvents on macOS, inotify on Linux 19+,
511
+ * ReadDirectoryChangesW on Windows) with debouncing to avoid thrashing.
512
+ *
513
+ * @param options - Watch options (debounce delay, callbacks)
514
+ * @returns true if watching started successfully
515
+ */
516
+ watch(options = {}) {
517
+ if (this.watcher?.isActive())
518
+ return true;
519
+ this.watcher = new sync_1.FileWatcher(this.projectRoot, async () => {
520
+ const result = await this.sync();
521
+ // sync() returns this exact zero-shape iff it failed to acquire the
522
+ // file lock (a real empty sync always has filesChecked > 0 because
523
+ // scanDirectory ran). Surface that to the watcher as a typed error
524
+ // so it keeps pendingFiles + reschedules instead of clearing them
525
+ // (#449).
526
+ if (result.filesChecked === 0 && result.durationMs === 0) {
527
+ throw new sync_1.LockUnavailableError();
528
+ }
529
+ const filesChanged = result.filesAdded + result.filesModified + result.filesRemoved;
530
+ return { filesChanged, durationMs: result.durationMs };
531
+ }, options);
532
+ return this.watcher.start();
533
+ }
534
+ /**
535
+ * Stop watching for file changes.
536
+ */
537
+ unwatch() {
538
+ if (this.watcher) {
539
+ this.watcher.stop();
540
+ this.watcher = null;
541
+ }
542
+ }
543
+ /**
544
+ * Check if the file watcher is active.
545
+ */
546
+ isWatching() {
547
+ return this.watcher?.isActive() ?? false;
548
+ }
549
+ /**
550
+ * True once live watching has permanently degraded (OS watch-resource
551
+ * exhaustion, or a write lock held past the retry budget) and auto-sync is
552
+ * disabled until the next {@link watch} call. Distinct from `!isWatching()`:
553
+ * a stopped/never-started watcher is inactive but NOT degraded. MCP tools use
554
+ * this to surface a whole-index "results may be stale" notice, since
555
+ * `getPendingFiles()` goes empty once watching stops (#876).
556
+ */
557
+ isWatcherDegraded() {
558
+ return this.watcher?.isDegraded() ?? false;
559
+ }
560
+ /** The reason live watching degraded, or null if it is healthy (#876). */
561
+ getWatcherDegradedReason() {
562
+ return this.watcher?.getDegradedReason() ?? null;
563
+ }
564
+ /**
565
+ * Files seen by the file watcher since the last successful sync —
566
+ * the per-file "stale" signal MCP tools attach to responses so an agent
567
+ * can fall back to {@link Read} for just the affected file without
568
+ * waiting for a debounced sync to complete (issue #403).
569
+ *
570
+ * Returns an empty list when the watcher isn't active, or no events have
571
+ * arrived. Each entry includes `firstSeenMs` and `lastSeenMs` (wall-clock
572
+ * `Date.now()` values) so callers can render "edited Nms ago", plus an
573
+ * `indexing` flag indicating whether the in-flight sync (if any) will
574
+ * absorb that file.
575
+ */
576
+ getPendingFiles() {
577
+ return this.watcher?.getPendingFiles() ?? [];
578
+ }
579
+ /**
580
+ * Resolves once the file watcher has installed its watch set. Useful for
581
+ * tests that need a deterministic boundary before asserting on
582
+ * `getPendingFiles()`. Resolves immediately when no watcher is active.
583
+ */
584
+ waitUntilWatcherReady(timeoutMs) {
585
+ return this.watcher ? this.watcher.waitUntilReady(timeoutMs) : Promise.resolve();
586
+ }
587
+ /**
588
+ * Get files that have changed since last index
589
+ */
590
+ getChangedFiles() {
591
+ return this.orchestrator.getChangedFiles();
592
+ }
593
+ /**
594
+ * Most recent index timestamp (ms since epoch) across all tracked files, or
595
+ * null when nothing is indexed yet. Lets library consumers check index
596
+ * freshness without shelling out to `cgraphx status --json`. (#329)
597
+ */
598
+ getLastIndexedAt() {
599
+ return this.queries.getLastIndexedAt();
600
+ }
601
+ /**
602
+ * Which engine built the current index: the package version + extraction
603
+ * version stamped at the last full `indexAll`. Either field is null for an
604
+ * index built before stamping existed (treated as stale). See
605
+ * `extraction-version.ts` and `isIndexStale()`.
606
+ */
607
+ getIndexBuildInfo() {
608
+ const version = this.queries.getMetadata('indexed_with_version');
609
+ const ev = this.queries.getMetadata('indexed_with_extraction_version');
610
+ const parsed = ev != null ? parseInt(ev, 10) : NaN;
611
+ return { version, extractionVersion: Number.isFinite(parsed) ? parsed : null };
612
+ }
613
+ /**
614
+ * True when the on-disk index was built by an engine whose extraction is
615
+ * older than the one now running — i.e. a re-index would add data a migration
616
+ * can't backfill. False when there's no index yet (nothing to refresh) or the
617
+ * stamp is current. This is the signal behind `cgraphx status`'s re-index
618
+ * hint and `cgraphx upgrade`'s reminder.
619
+ */
620
+ isIndexStale() {
621
+ if (this.queries.getLastIndexedAt() == null)
622
+ return false;
623
+ const { extractionVersion } = this.getIndexBuildInfo();
624
+ return extractionVersion == null || extractionVersion < extraction_version_1.EXTRACTION_VERSION;
625
+ }
626
+ /**
627
+ * Extract nodes and edges from source code (without storing)
628
+ */
629
+ extractFromSource(filePath, source) {
630
+ return (0, extraction_1.extractFromSource)(filePath, source);
631
+ }
632
+ // ===========================================================================
633
+ // Reference Resolution
634
+ // ===========================================================================
635
+ /**
636
+ * Resolve unresolved references and create edges
637
+ *
638
+ * This method takes unresolved references from extraction and attempts
639
+ * to resolve them using multiple strategies:
640
+ * - Framework-specific patterns (React, Express, Laravel)
641
+ * - Import-based resolution
642
+ * - Name-based symbol matching
643
+ */
644
+ resolveReferences(onProgress) {
645
+ // Get all unresolved references from the database
646
+ const unresolvedRefs = this.queries.getUnresolvedReferences();
647
+ return this.resolver.resolveAndPersist(unresolvedRefs, onProgress);
648
+ }
649
+ /**
650
+ * Resolve references in batches to keep memory bounded on large codebases.
651
+ * Processes chunks of unresolved refs, persisting results after each batch.
652
+ */
653
+ async resolveReferencesBatched(onProgress) {
654
+ return this.resolver.resolveAndPersistBatched(onProgress);
655
+ }
656
+ /**
657
+ * Get detected frameworks in the project
658
+ */
659
+ getDetectedFrameworks() {
660
+ return this.resolver.getDetectedFrameworks();
661
+ }
662
+ /**
663
+ * Re-initialize the resolver (useful after adding new files)
664
+ */
665
+ reinitializeResolver() {
666
+ this.resolver.initialize();
667
+ }
668
+ // ===========================================================================
669
+ // Graph Statistics
670
+ // ===========================================================================
671
+ /**
672
+ * Get statistics about the knowledge graph
673
+ */
674
+ getStats() {
675
+ const stats = this.queries.getStats();
676
+ stats.dbSizeBytes = this.db.getSize();
677
+ return stats;
678
+ }
679
+ /**
680
+ * Active SQLite backend for this project's connection (`node-sqlite` — Node's
681
+ * built-in real-SQLite module). Surfaced via `cgraphx status` and the
682
+ * `codegraph_status` MCP tool alongside the effective journal mode.
683
+ */
684
+ getBackend() {
685
+ return this.db.getBackend();
686
+ }
687
+ /**
688
+ * The journal mode actually in effect ('wal', 'delete', …). 'wal' means
689
+ * readers never block on a concurrent writer; anything else means they can,
690
+ * which is the precondition for the "database is locked" failures in issue
691
+ * #238. Surfaced via `codegraph status` and the `codegraph_status` MCP tool.
692
+ */
693
+ getJournalMode() {
694
+ return this.db.getJournalMode();
695
+ }
696
+ // ===========================================================================
697
+ // Node Operations
698
+ // ===========================================================================
699
+ /**
700
+ * Get a node by ID
701
+ */
702
+ getNode(id) {
703
+ return this.queries.getNodeById(id);
704
+ }
705
+ /**
706
+ * Get all nodes in a file
707
+ */
708
+ getNodesInFile(filePath) {
709
+ return this.queries.getNodesByFile(filePath);
710
+ }
711
+ /**
712
+ * Get all nodes of a specific kind
713
+ */
714
+ getNodesByKind(kind) {
715
+ return this.queries.getNodesByKind(kind);
716
+ }
717
+ /**
718
+ * Get ALL nodes with an exact name (direct index lookup, not FTS-ranked/capped).
719
+ * Used to enumerate every overload of a heavily-overloaded name so the specific
720
+ * definition the caller wants is never dropped below a search cut.
721
+ */
722
+ getNodesByName(name) {
723
+ return this.queries.getNodesByName(name);
724
+ }
725
+ /**
726
+ * Search nodes by text
727
+ */
728
+ searchNodes(query, options) {
729
+ return this.queries.searchNodes(query, options);
730
+ }
731
+ /**
732
+ * Normalized project-name tokens (go.mod / package.json / repo dir) used to
733
+ * down-weight the non-discriminative project name in search ranking (#720).
734
+ * Exposed so explore can exclude it from the PascalCase type-disambiguation
735
+ * bias, which would otherwise pull overloaded tokens toward whichever stack
736
+ * embeds the project name.
737
+ */
738
+ getProjectNameTokens() {
739
+ return this.queries.getProjectNameTokens();
740
+ }
741
+ /**
742
+ * Find the project's "primary route file" — the file with the densest
743
+ * concentration of framework-emitted `route` nodes (≥3 routes, ≥30%
744
+ * of all non-test routes). Used to inline the routing config in
745
+ * `codegraph_explore` responses on small realworld template repos
746
+ * (rails-realworld, laravel-realworld, drupal-admintoolbar, …) where
747
+ * Glob+Read of `routes.rb`/`urls.py`/etc. otherwise beats codegraph.
748
+ */
749
+ getTopRouteFile() {
750
+ return this.queries.getTopRouteFile();
751
+ }
752
+ /**
753
+ * Build a URL → handler routing manifest from the index. Each entry
754
+ * pairs a route node (URL + method) with its handler function/method
755
+ * via the `references` edge that framework resolvers emit. Returns
756
+ * null when fewer than 3 valid (non-test) routes exist.
757
+ */
758
+ getRoutingManifest(limit) {
759
+ return this.queries.getRoutingManifest(limit);
760
+ }
761
+ // ===========================================================================
762
+ // Edge Operations
763
+ // ===========================================================================
764
+ /**
765
+ * Get outgoing edges from a node
766
+ */
767
+ getOutgoingEdges(nodeId) {
768
+ return this.queries.getOutgoingEdges(nodeId);
769
+ }
770
+ /**
771
+ * Get incoming edges to a node
772
+ */
773
+ getIncomingEdges(nodeId) {
774
+ return this.queries.getIncomingEdges(nodeId);
775
+ }
776
+ // ===========================================================================
777
+ // File Operations
778
+ // ===========================================================================
779
+ /**
780
+ * Get a file record by path
781
+ */
782
+ getFile(filePath) {
783
+ return this.queries.getFileByPath(filePath);
784
+ }
785
+ /**
786
+ * Get all tracked files
787
+ */
788
+ getFiles() {
789
+ return this.queries.getAllFiles();
790
+ }
791
+ // ===========================================================================
792
+ // Graph Query Methods
793
+ // ===========================================================================
794
+ /**
795
+ * Get the context for a node (ancestors, children, references)
796
+ *
797
+ * Returns comprehensive context about a node including its containment
798
+ * hierarchy, children, incoming/outgoing references, type information,
799
+ * and relevant imports.
800
+ *
801
+ * @param nodeId - ID of the focal node
802
+ * @returns Context object with all related information
803
+ */
804
+ getContext(nodeId) {
805
+ return this.graphManager.getContext(nodeId);
806
+ }
807
+ /**
808
+ * Traverse the graph from a starting node
809
+ *
810
+ * Uses breadth-first search by default. Supports filtering by edge types,
811
+ * node types, and traversal direction.
812
+ *
813
+ * @param startId - Starting node ID
814
+ * @param options - Traversal options
815
+ * @returns Subgraph containing traversed nodes and edges
816
+ */
817
+ traverse(startId, options) {
818
+ return this.traverser.traverseBFS(startId, options);
819
+ }
820
+ /**
821
+ * Get the call graph for a function
822
+ *
823
+ * Returns both callers (functions that call this function) and
824
+ * callees (functions called by this function) up to the specified depth.
825
+ *
826
+ * @param nodeId - ID of the function/method node
827
+ * @param depth - Maximum depth in each direction (default: 2)
828
+ * @returns Subgraph containing the call graph
829
+ */
830
+ getCallGraph(nodeId, depth = 2) {
831
+ return this.traverser.getCallGraph(nodeId, depth);
832
+ }
833
+ /**
834
+ * Get the type hierarchy for a class/interface
835
+ *
836
+ * Returns both ancestors (types this extends/implements) and
837
+ * descendants (types that extend/implement this).
838
+ *
839
+ * @param nodeId - ID of the class/interface node
840
+ * @returns Subgraph containing the type hierarchy
841
+ */
842
+ getTypeHierarchy(nodeId) {
843
+ return this.traverser.getTypeHierarchy(nodeId);
844
+ }
845
+ /**
846
+ * Find all usages of a symbol
847
+ *
848
+ * Returns all nodes that reference the specified symbol through
849
+ * any edge type (calls, references, type_of, etc.).
850
+ *
851
+ * @param nodeId - ID of the symbol node
852
+ * @returns Array of nodes and edges that reference this symbol
853
+ */
854
+ findUsages(nodeId) {
855
+ return this.traverser.findUsages(nodeId);
856
+ }
857
+ /**
858
+ * Get callers of a function/method
859
+ *
860
+ * @param nodeId - ID of the function/method node
861
+ * @param maxDepth - Maximum depth to traverse (default: 1)
862
+ * @returns Array of nodes that call this function
863
+ */
864
+ getCallers(nodeId, maxDepth = 1) {
865
+ return this.traverser.getCallers(nodeId, maxDepth);
866
+ }
867
+ /**
868
+ * Get callees of a function/method
869
+ *
870
+ * @param nodeId - ID of the function/method node
871
+ * @param maxDepth - Maximum depth to traverse (default: 1)
872
+ * @returns Array of nodes called by this function
873
+ */
874
+ getCallees(nodeId, maxDepth = 1) {
875
+ return this.traverser.getCallees(nodeId, maxDepth);
876
+ }
877
+ /**
878
+ * Calculate the impact radius of a node
879
+ *
880
+ * Returns all nodes that could be affected by changes to this node.
881
+ *
882
+ * @param nodeId - ID of the node
883
+ * @param maxDepth - Maximum depth to traverse (default: 3)
884
+ * @returns Subgraph containing potentially impacted nodes
885
+ */
886
+ getImpactRadius(nodeId, maxDepth = 3) {
887
+ return this.traverser.getImpactRadius(nodeId, maxDepth);
888
+ }
889
+ /**
890
+ * Find the shortest path between two nodes
891
+ *
892
+ * @param fromId - Starting node ID
893
+ * @param toId - Target node ID
894
+ * @param edgeKinds - Edge types to consider (all if empty)
895
+ * @returns Array of nodes and edges forming the path, or null if no path exists
896
+ */
897
+ findPath(fromId, toId, edgeKinds) {
898
+ return this.traverser.findPath(fromId, toId, edgeKinds);
899
+ }
900
+ /**
901
+ * Get ancestors of a node in the containment hierarchy
902
+ *
903
+ * @param nodeId - ID of the node
904
+ * @returns Array of ancestor nodes from immediate parent to root
905
+ */
906
+ getAncestors(nodeId) {
907
+ return this.traverser.getAncestors(nodeId);
908
+ }
909
+ /**
910
+ * Get immediate children of a node
911
+ *
912
+ * @param nodeId - ID of the node
913
+ * @returns Array of child nodes
914
+ */
915
+ getChildren(nodeId) {
916
+ return this.traverser.getChildren(nodeId);
917
+ }
918
+ /**
919
+ * Get dependencies of a file
920
+ *
921
+ * @param filePath - Path to the file
922
+ * @returns Array of file paths this file depends on
923
+ */
924
+ getFileDependencies(filePath) {
925
+ return this.graphManager.getFileDependencies(filePath);
926
+ }
927
+ /**
928
+ * Get dependents of a file
929
+ *
930
+ * @param filePath - Path to the file
931
+ * @returns Array of file paths that depend on this file
932
+ */
933
+ getFileDependents(filePath) {
934
+ return this.graphManager.getFileDependents(filePath);
935
+ }
936
+ /**
937
+ * Find circular dependencies in the codebase
938
+ *
939
+ * @returns Array of cycles, each cycle is an array of file paths
940
+ */
941
+ findCircularDependencies() {
942
+ return this.graphManager.findCircularDependencies();
943
+ }
944
+ /**
945
+ * Find dead code (unreferenced symbols)
946
+ *
947
+ * @param kinds - Node kinds to check (default: functions, methods, classes)
948
+ * @returns Array of unreferenced nodes
949
+ */
950
+ findDeadCode(kinds) {
951
+ return this.graphManager.findDeadCode(kinds);
952
+ }
953
+ /**
954
+ * Get complexity metrics for a node
955
+ *
956
+ * @param nodeId - ID of the node
957
+ * @returns Object containing various complexity metrics
958
+ */
959
+ getNodeMetrics(nodeId) {
960
+ return this.graphManager.getNodeMetrics(nodeId);
961
+ }
962
+ // ===========================================================================
963
+ // Context Building
964
+ // ===========================================================================
965
+ /**
966
+ * Get the source code for a node
967
+ *
968
+ * Reads the file and extracts the code between startLine and endLine.
969
+ *
970
+ * @param nodeId - ID of the node
971
+ * @returns Code string or null if not found
972
+ */
973
+ async getCode(nodeId) {
974
+ return this.contextBuilder.getCode(nodeId);
975
+ }
976
+ /**
977
+ * Find relevant subgraph for a query
978
+ *
979
+ * Combines semantic search with graph traversal to find the most
980
+ * relevant nodes and their relationships for a given query.
981
+ *
982
+ * @param query - Natural language query describing the task
983
+ * @param options - Search and traversal options
984
+ * @returns Subgraph of relevant nodes and edges
985
+ */
986
+ async findRelevantContext(query, options) {
987
+ return this.contextBuilder.findRelevantContext(query, options);
988
+ }
989
+ /**
990
+ * Build context for a task
991
+ *
992
+ * Creates comprehensive context by:
993
+ * 1. Running FTS search to find entry points
994
+ * 2. Expanding the graph around entry points
995
+ * 3. Extracting code blocks for key nodes
996
+ * 4. Formatting output for Claude
997
+ *
998
+ * @param input - Task description (string or {title, description})
999
+ * @param options - Build options (maxNodes, includeCode, format, etc.)
1000
+ * @returns TaskContext object or formatted string (markdown/JSON)
1001
+ */
1002
+ async buildContext(input, options) {
1003
+ return this.contextBuilder.buildContext(input, options);
1004
+ }
1005
+ // ===========================================================================
1006
+ // Database Management
1007
+ // ===========================================================================
1008
+ /**
1009
+ * Optimize the database (vacuum and analyze)
1010
+ */
1011
+ optimize() {
1012
+ this.db.optimize();
1013
+ }
1014
+ /**
1015
+ * Clear all data from the graph
1016
+ */
1017
+ clear() {
1018
+ this.queries.clear();
1019
+ }
1020
+ /**
1021
+ * Alias for close() for backwards compatibility.
1022
+ * @deprecated Use close() instead
1023
+ */
1024
+ destroy() {
1025
+ this.close();
1026
+ }
1027
+ /**
1028
+ * Completely remove CodeGraph from the project.
1029
+ * This closes the database and deletes the .CodeGraph directory.
1030
+ *
1031
+ * WARNING: This permanently deletes all CodeGraph data for the project.
1032
+ */
1033
+ uninitialize() {
1034
+ this.close();
1035
+ (0, directory_1.removeDirectory)(this.projectRoot);
1036
+ }
1037
+ }
1038
+ exports.CodeGraph = CodeGraph;
1039
+ // Default export
1040
+ exports.default = CodeGraph;
1041
+ //# sourceMappingURL=index.js.map