@kkvcrobatz107/codegraph 0.9.6-pkm.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +595 -0
  3. package/dist/bin/codegraph.d.ts +25 -0
  4. package/dist/bin/codegraph.d.ts.map +1 -0
  5. package/dist/bin/codegraph.js +1563 -0
  6. package/dist/bin/codegraph.js.map +1 -0
  7. package/dist/bin/node-version-check.d.ts +37 -0
  8. package/dist/bin/node-version-check.d.ts.map +1 -0
  9. package/dist/bin/node-version-check.js +79 -0
  10. package/dist/bin/node-version-check.js.map +1 -0
  11. package/dist/bin/uninstall.d.ts +14 -0
  12. package/dist/bin/uninstall.d.ts.map +1 -0
  13. package/dist/bin/uninstall.js +36 -0
  14. package/dist/bin/uninstall.js.map +1 -0
  15. package/dist/context/formatter.d.ts +30 -0
  16. package/dist/context/formatter.d.ts.map +1 -0
  17. package/dist/context/formatter.js +244 -0
  18. package/dist/context/formatter.js.map +1 -0
  19. package/dist/context/index.d.ts +110 -0
  20. package/dist/context/index.d.ts.map +1 -0
  21. package/dist/context/index.js +1169 -0
  22. package/dist/context/index.js.map +1 -0
  23. package/dist/db/index.d.ts +101 -0
  24. package/dist/db/index.d.ts.map +1 -0
  25. package/dist/db/index.js +251 -0
  26. package/dist/db/index.js.map +1 -0
  27. package/dist/db/migrations.d.ts +44 -0
  28. package/dist/db/migrations.d.ts.map +1 -0
  29. package/dist/db/migrations.js +131 -0
  30. package/dist/db/migrations.js.map +1 -0
  31. package/dist/db/queries.d.ts +281 -0
  32. package/dist/db/queries.d.ts.map +1 -0
  33. package/dist/db/queries.js +1300 -0
  34. package/dist/db/queries.js.map +1 -0
  35. package/dist/db/schema.sql +151 -0
  36. package/dist/db/sqlite-adapter.d.ts +46 -0
  37. package/dist/db/sqlite-adapter.d.ts.map +1 -0
  38. package/dist/db/sqlite-adapter.js +114 -0
  39. package/dist/db/sqlite-adapter.js.map +1 -0
  40. package/dist/directory.d.ts +57 -0
  41. package/dist/directory.d.ts.map +1 -0
  42. package/dist/directory.js +264 -0
  43. package/dist/directory.js.map +1 -0
  44. package/dist/errors.d.ts +136 -0
  45. package/dist/errors.d.ts.map +1 -0
  46. package/dist/errors.js +219 -0
  47. package/dist/errors.js.map +1 -0
  48. package/dist/extraction/dfm-extractor.d.ts +31 -0
  49. package/dist/extraction/dfm-extractor.d.ts.map +1 -0
  50. package/dist/extraction/dfm-extractor.js +151 -0
  51. package/dist/extraction/dfm-extractor.js.map +1 -0
  52. package/dist/extraction/grammars.d.ts +90 -0
  53. package/dist/extraction/grammars.d.ts.map +1 -0
  54. package/dist/extraction/grammars.js +407 -0
  55. package/dist/extraction/grammars.js.map +1 -0
  56. package/dist/extraction/index.d.ts +138 -0
  57. package/dist/extraction/index.d.ts.map +1 -0
  58. package/dist/extraction/index.js +1378 -0
  59. package/dist/extraction/index.js.map +1 -0
  60. package/dist/extraction/languages/c-cpp.d.ts +4 -0
  61. package/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  62. package/dist/extraction/languages/c-cpp.js +171 -0
  63. package/dist/extraction/languages/c-cpp.js.map +1 -0
  64. package/dist/extraction/languages/csharp.d.ts +3 -0
  65. package/dist/extraction/languages/csharp.d.ts.map +1 -0
  66. package/dist/extraction/languages/csharp.js +73 -0
  67. package/dist/extraction/languages/csharp.js.map +1 -0
  68. package/dist/extraction/languages/dart.d.ts +3 -0
  69. package/dist/extraction/languages/dart.d.ts.map +1 -0
  70. package/dist/extraction/languages/dart.js +192 -0
  71. package/dist/extraction/languages/dart.js.map +1 -0
  72. package/dist/extraction/languages/go.d.ts +3 -0
  73. package/dist/extraction/languages/go.d.ts.map +1 -0
  74. package/dist/extraction/languages/go.js +70 -0
  75. package/dist/extraction/languages/go.js.map +1 -0
  76. package/dist/extraction/languages/index.d.ts +10 -0
  77. package/dist/extraction/languages/index.d.ts.map +1 -0
  78. package/dist/extraction/languages/index.js +51 -0
  79. package/dist/extraction/languages/index.js.map +1 -0
  80. package/dist/extraction/languages/java.d.ts +3 -0
  81. package/dist/extraction/languages/java.d.ts.map +1 -0
  82. package/dist/extraction/languages/java.js +70 -0
  83. package/dist/extraction/languages/java.js.map +1 -0
  84. package/dist/extraction/languages/javascript.d.ts +3 -0
  85. package/dist/extraction/languages/javascript.d.ts.map +1 -0
  86. package/dist/extraction/languages/javascript.js +90 -0
  87. package/dist/extraction/languages/javascript.js.map +1 -0
  88. package/dist/extraction/languages/kotlin.d.ts +3 -0
  89. package/dist/extraction/languages/kotlin.d.ts.map +1 -0
  90. package/dist/extraction/languages/kotlin.js +259 -0
  91. package/dist/extraction/languages/kotlin.js.map +1 -0
  92. package/dist/extraction/languages/lua.d.ts +3 -0
  93. package/dist/extraction/languages/lua.d.ts.map +1 -0
  94. package/dist/extraction/languages/lua.js +150 -0
  95. package/dist/extraction/languages/lua.js.map +1 -0
  96. package/dist/extraction/languages/luau.d.ts +3 -0
  97. package/dist/extraction/languages/luau.d.ts.map +1 -0
  98. package/dist/extraction/languages/luau.js +37 -0
  99. package/dist/extraction/languages/luau.js.map +1 -0
  100. package/dist/extraction/languages/objc.d.ts +3 -0
  101. package/dist/extraction/languages/objc.d.ts.map +1 -0
  102. package/dist/extraction/languages/objc.js +133 -0
  103. package/dist/extraction/languages/objc.js.map +1 -0
  104. package/dist/extraction/languages/pascal.d.ts +3 -0
  105. package/dist/extraction/languages/pascal.d.ts.map +1 -0
  106. package/dist/extraction/languages/pascal.js +66 -0
  107. package/dist/extraction/languages/pascal.js.map +1 -0
  108. package/dist/extraction/languages/php.d.ts +3 -0
  109. package/dist/extraction/languages/php.d.ts.map +1 -0
  110. package/dist/extraction/languages/php.js +107 -0
  111. package/dist/extraction/languages/php.js.map +1 -0
  112. package/dist/extraction/languages/python.d.ts +3 -0
  113. package/dist/extraction/languages/python.d.ts.map +1 -0
  114. package/dist/extraction/languages/python.js +56 -0
  115. package/dist/extraction/languages/python.js.map +1 -0
  116. package/dist/extraction/languages/ruby.d.ts +3 -0
  117. package/dist/extraction/languages/ruby.d.ts.map +1 -0
  118. package/dist/extraction/languages/ruby.js +114 -0
  119. package/dist/extraction/languages/ruby.js.map +1 -0
  120. package/dist/extraction/languages/rust.d.ts +3 -0
  121. package/dist/extraction/languages/rust.d.ts.map +1 -0
  122. package/dist/extraction/languages/rust.js +109 -0
  123. package/dist/extraction/languages/rust.js.map +1 -0
  124. package/dist/extraction/languages/scala.d.ts +3 -0
  125. package/dist/extraction/languages/scala.d.ts.map +1 -0
  126. package/dist/extraction/languages/scala.js +139 -0
  127. package/dist/extraction/languages/scala.js.map +1 -0
  128. package/dist/extraction/languages/swift.d.ts +3 -0
  129. package/dist/extraction/languages/swift.d.ts.map +1 -0
  130. package/dist/extraction/languages/swift.js +91 -0
  131. package/dist/extraction/languages/swift.js.map +1 -0
  132. package/dist/extraction/languages/typescript.d.ts +3 -0
  133. package/dist/extraction/languages/typescript.d.ts.map +1 -0
  134. package/dist/extraction/languages/typescript.js +129 -0
  135. package/dist/extraction/languages/typescript.js.map +1 -0
  136. package/dist/extraction/liquid-extractor.d.ts +52 -0
  137. package/dist/extraction/liquid-extractor.d.ts.map +1 -0
  138. package/dist/extraction/liquid-extractor.js +313 -0
  139. package/dist/extraction/liquid-extractor.js.map +1 -0
  140. package/dist/extraction/mybatis-extractor.d.ts +48 -0
  141. package/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  142. package/dist/extraction/mybatis-extractor.js +198 -0
  143. package/dist/extraction/mybatis-extractor.js.map +1 -0
  144. package/dist/extraction/parse-worker.d.ts +8 -0
  145. package/dist/extraction/parse-worker.d.ts.map +1 -0
  146. package/dist/extraction/parse-worker.js +94 -0
  147. package/dist/extraction/parse-worker.js.map +1 -0
  148. package/dist/extraction/svelte-extractor.d.ts +56 -0
  149. package/dist/extraction/svelte-extractor.d.ts.map +1 -0
  150. package/dist/extraction/svelte-extractor.js +272 -0
  151. package/dist/extraction/svelte-extractor.js.map +1 -0
  152. package/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  153. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  154. package/dist/extraction/tree-sitter-helpers.js +103 -0
  155. package/dist/extraction/tree-sitter-helpers.js.map +1 -0
  156. package/dist/extraction/tree-sitter-types.d.ts +193 -0
  157. package/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  158. package/dist/extraction/tree-sitter-types.js +10 -0
  159. package/dist/extraction/tree-sitter-types.js.map +1 -0
  160. package/dist/extraction/tree-sitter.d.ts +291 -0
  161. package/dist/extraction/tree-sitter.d.ts.map +1 -0
  162. package/dist/extraction/tree-sitter.js +2961 -0
  163. package/dist/extraction/tree-sitter.js.map +1 -0
  164. package/dist/extraction/vue-extractor.d.ts +36 -0
  165. package/dist/extraction/vue-extractor.d.ts.map +1 -0
  166. package/dist/extraction/vue-extractor.js +163 -0
  167. package/dist/extraction/vue-extractor.js.map +1 -0
  168. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  169. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  170. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  171. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  172. package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
  173. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  174. package/dist/extraction/wasm-runtime-flags.js +105 -0
  175. package/dist/extraction/wasm-runtime-flags.js.map +1 -0
  176. package/dist/graph/index.d.ts +8 -0
  177. package/dist/graph/index.d.ts.map +1 -0
  178. package/dist/graph/index.js +13 -0
  179. package/dist/graph/index.js.map +1 -0
  180. package/dist/graph/queries.d.ts +106 -0
  181. package/dist/graph/queries.d.ts.map +1 -0
  182. package/dist/graph/queries.js +366 -0
  183. package/dist/graph/queries.js.map +1 -0
  184. package/dist/graph/traversal.d.ts +127 -0
  185. package/dist/graph/traversal.d.ts.map +1 -0
  186. package/dist/graph/traversal.js +528 -0
  187. package/dist/graph/traversal.js.map +1 -0
  188. package/dist/index.d.ts +460 -0
  189. package/dist/index.d.ts.map +1 -0
  190. package/dist/index.js +863 -0
  191. package/dist/index.js.map +1 -0
  192. package/dist/installer/claude-md-template.d.ts +14 -0
  193. package/dist/installer/claude-md-template.d.ts.map +1 -0
  194. package/dist/installer/claude-md-template.js +21 -0
  195. package/dist/installer/claude-md-template.js.map +1 -0
  196. package/dist/installer/config-writer.d.ts +29 -0
  197. package/dist/installer/config-writer.d.ts.map +1 -0
  198. package/dist/installer/config-writer.js +111 -0
  199. package/dist/installer/config-writer.js.map +1 -0
  200. package/dist/installer/index.d.ts +117 -0
  201. package/dist/installer/index.d.ts.map +1 -0
  202. package/dist/installer/index.js +528 -0
  203. package/dist/installer/index.js.map +1 -0
  204. package/dist/installer/instructions-template.d.ts +28 -0
  205. package/dist/installer/instructions-template.d.ts.map +1 -0
  206. package/dist/installer/instructions-template.js +65 -0
  207. package/dist/installer/instructions-template.js.map +1 -0
  208. package/dist/installer/targets/antigravity.d.ts +57 -0
  209. package/dist/installer/targets/antigravity.d.ts.map +1 -0
  210. package/dist/installer/targets/antigravity.js +307 -0
  211. package/dist/installer/targets/antigravity.js.map +1 -0
  212. package/dist/installer/targets/claude.d.ts +47 -0
  213. package/dist/installer/targets/claude.d.ts.map +1 -0
  214. package/dist/installer/targets/claude.js +401 -0
  215. package/dist/installer/targets/claude.js.map +1 -0
  216. package/dist/installer/targets/codex.d.ts +18 -0
  217. package/dist/installer/targets/codex.d.ts.map +1 -0
  218. package/dist/installer/targets/codex.js +185 -0
  219. package/dist/installer/targets/codex.js.map +1 -0
  220. package/dist/installer/targets/cursor.d.ts +35 -0
  221. package/dist/installer/targets/cursor.d.ts.map +1 -0
  222. package/dist/installer/targets/cursor.js +283 -0
  223. package/dist/installer/targets/cursor.js.map +1 -0
  224. package/dist/installer/targets/gemini.d.ts +26 -0
  225. package/dist/installer/targets/gemini.d.ts.map +1 -0
  226. package/dist/installer/targets/gemini.js +165 -0
  227. package/dist/installer/targets/gemini.js.map +1 -0
  228. package/dist/installer/targets/hermes.d.ts +18 -0
  229. package/dist/installer/targets/hermes.d.ts.map +1 -0
  230. package/dist/installer/targets/hermes.js +359 -0
  231. package/dist/installer/targets/hermes.js.map +1 -0
  232. package/dist/installer/targets/kiro.d.ts +27 -0
  233. package/dist/installer/targets/kiro.d.ts.map +1 -0
  234. package/dist/installer/targets/kiro.js +196 -0
  235. package/dist/installer/targets/kiro.js.map +1 -0
  236. package/dist/installer/targets/opencode.d.ts +30 -0
  237. package/dist/installer/targets/opencode.d.ts.map +1 -0
  238. package/dist/installer/targets/opencode.js +235 -0
  239. package/dist/installer/targets/opencode.js.map +1 -0
  240. package/dist/installer/targets/registry.d.ts +35 -0
  241. package/dist/installer/targets/registry.d.ts.map +1 -0
  242. package/dist/installer/targets/registry.js +91 -0
  243. package/dist/installer/targets/registry.js.map +1 -0
  244. package/dist/installer/targets/shared.d.ts +77 -0
  245. package/dist/installer/targets/shared.d.ts.map +1 -0
  246. package/dist/installer/targets/shared.js +246 -0
  247. package/dist/installer/targets/shared.js.map +1 -0
  248. package/dist/installer/targets/toml.d.ts +52 -0
  249. package/dist/installer/targets/toml.d.ts.map +1 -0
  250. package/dist/installer/targets/toml.js +147 -0
  251. package/dist/installer/targets/toml.js.map +1 -0
  252. package/dist/installer/targets/types.d.ts +116 -0
  253. package/dist/installer/targets/types.d.ts.map +1 -0
  254. package/dist/installer/targets/types.js +16 -0
  255. package/dist/installer/targets/types.js.map +1 -0
  256. package/dist/mcp/daemon-paths.d.ts +46 -0
  257. package/dist/mcp/daemon-paths.d.ts.map +1 -0
  258. package/dist/mcp/daemon-paths.js +125 -0
  259. package/dist/mcp/daemon-paths.js.map +1 -0
  260. package/dist/mcp/daemon.d.ts +161 -0
  261. package/dist/mcp/daemon.d.ts.map +1 -0
  262. package/dist/mcp/daemon.js +403 -0
  263. package/dist/mcp/daemon.js.map +1 -0
  264. package/dist/mcp/engine.d.ts +100 -0
  265. package/dist/mcp/engine.d.ts.map +1 -0
  266. package/dist/mcp/engine.js +291 -0
  267. package/dist/mcp/engine.js.map +1 -0
  268. package/dist/mcp/index.d.ts +109 -0
  269. package/dist/mcp/index.d.ts.map +1 -0
  270. package/dist/mcp/index.js +470 -0
  271. package/dist/mcp/index.js.map +1 -0
  272. package/dist/mcp/proxy.d.ts +46 -0
  273. package/dist/mcp/proxy.d.ts.map +1 -0
  274. package/dist/mcp/proxy.js +276 -0
  275. package/dist/mcp/proxy.js.map +1 -0
  276. package/dist/mcp/server-instructions.d.ts +19 -0
  277. package/dist/mcp/server-instructions.d.ts.map +1 -0
  278. package/dist/mcp/server-instructions.js +73 -0
  279. package/dist/mcp/server-instructions.js.map +1 -0
  280. package/dist/mcp/session.d.ts +67 -0
  281. package/dist/mcp/session.d.ts.map +1 -0
  282. package/dist/mcp/session.js +276 -0
  283. package/dist/mcp/session.js.map +1 -0
  284. package/dist/mcp/tools.d.ts +385 -0
  285. package/dist/mcp/tools.d.ts.map +1 -0
  286. package/dist/mcp/tools.js +2545 -0
  287. package/dist/mcp/tools.js.map +1 -0
  288. package/dist/mcp/transport.d.ts +188 -0
  289. package/dist/mcp/transport.d.ts.map +1 -0
  290. package/dist/mcp/transport.js +343 -0
  291. package/dist/mcp/transport.js.map +1 -0
  292. package/dist/mcp/version.d.ts +19 -0
  293. package/dist/mcp/version.d.ts.map +1 -0
  294. package/dist/mcp/version.js +71 -0
  295. package/dist/mcp/version.js.map +1 -0
  296. package/dist/resolution/callback-synthesizer.d.ts +10 -0
  297. package/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  298. package/dist/resolution/callback-synthesizer.js +924 -0
  299. package/dist/resolution/callback-synthesizer.js.map +1 -0
  300. package/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  301. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  302. package/dist/resolution/frameworks/cargo-workspace.js +225 -0
  303. package/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  304. package/dist/resolution/frameworks/csharp.d.ts +8 -0
  305. package/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  306. package/dist/resolution/frameworks/csharp.js +241 -0
  307. package/dist/resolution/frameworks/csharp.js.map +1 -0
  308. package/dist/resolution/frameworks/drupal.d.ts +51 -0
  309. package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  310. package/dist/resolution/frameworks/drupal.js +367 -0
  311. package/dist/resolution/frameworks/drupal.js.map +1 -0
  312. package/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  313. package/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  314. package/dist/resolution/frameworks/expo-modules.js +143 -0
  315. package/dist/resolution/frameworks/expo-modules.js.map +1 -0
  316. package/dist/resolution/frameworks/express.d.ts +8 -0
  317. package/dist/resolution/frameworks/express.d.ts.map +1 -0
  318. package/dist/resolution/frameworks/express.js +308 -0
  319. package/dist/resolution/frameworks/express.js.map +1 -0
  320. package/dist/resolution/frameworks/fabric.d.ts +3 -0
  321. package/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  322. package/dist/resolution/frameworks/fabric.js +354 -0
  323. package/dist/resolution/frameworks/fabric.js.map +1 -0
  324. package/dist/resolution/frameworks/go.d.ts +8 -0
  325. package/dist/resolution/frameworks/go.d.ts.map +1 -0
  326. package/dist/resolution/frameworks/go.js +161 -0
  327. package/dist/resolution/frameworks/go.js.map +1 -0
  328. package/dist/resolution/frameworks/index.d.ts +48 -0
  329. package/dist/resolution/frameworks/index.d.ts.map +1 -0
  330. package/dist/resolution/frameworks/index.js +161 -0
  331. package/dist/resolution/frameworks/index.js.map +1 -0
  332. package/dist/resolution/frameworks/java.d.ts +8 -0
  333. package/dist/resolution/frameworks/java.d.ts.map +1 -0
  334. package/dist/resolution/frameworks/java.js +504 -0
  335. package/dist/resolution/frameworks/java.js.map +1 -0
  336. package/dist/resolution/frameworks/laravel.d.ts +13 -0
  337. package/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  338. package/dist/resolution/frameworks/laravel.js +257 -0
  339. package/dist/resolution/frameworks/laravel.js.map +1 -0
  340. package/dist/resolution/frameworks/nestjs.d.ts +26 -0
  341. package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  342. package/dist/resolution/frameworks/nestjs.js +698 -0
  343. package/dist/resolution/frameworks/nestjs.js.map +1 -0
  344. package/dist/resolution/frameworks/play.d.ts +19 -0
  345. package/dist/resolution/frameworks/play.d.ts.map +1 -0
  346. package/dist/resolution/frameworks/play.js +111 -0
  347. package/dist/resolution/frameworks/play.js.map +1 -0
  348. package/dist/resolution/frameworks/python.d.ts +10 -0
  349. package/dist/resolution/frameworks/python.d.ts.map +1 -0
  350. package/dist/resolution/frameworks/python.js +396 -0
  351. package/dist/resolution/frameworks/python.js.map +1 -0
  352. package/dist/resolution/frameworks/react-native.d.ts +3 -0
  353. package/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  354. package/dist/resolution/frameworks/react-native.js +360 -0
  355. package/dist/resolution/frameworks/react-native.js.map +1 -0
  356. package/dist/resolution/frameworks/react.d.ts +8 -0
  357. package/dist/resolution/frameworks/react.d.ts.map +1 -0
  358. package/dist/resolution/frameworks/react.js +365 -0
  359. package/dist/resolution/frameworks/react.js.map +1 -0
  360. package/dist/resolution/frameworks/ruby.d.ts +8 -0
  361. package/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  362. package/dist/resolution/frameworks/ruby.js +302 -0
  363. package/dist/resolution/frameworks/ruby.js.map +1 -0
  364. package/dist/resolution/frameworks/rust.d.ts +8 -0
  365. package/dist/resolution/frameworks/rust.d.ts.map +1 -0
  366. package/dist/resolution/frameworks/rust.js +304 -0
  367. package/dist/resolution/frameworks/rust.js.map +1 -0
  368. package/dist/resolution/frameworks/svelte.d.ts +9 -0
  369. package/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  370. package/dist/resolution/frameworks/svelte.js +249 -0
  371. package/dist/resolution/frameworks/svelte.js.map +1 -0
  372. package/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  373. package/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  374. package/dist/resolution/frameworks/swift-objc.js +252 -0
  375. package/dist/resolution/frameworks/swift-objc.js.map +1 -0
  376. package/dist/resolution/frameworks/swift.d.ts +10 -0
  377. package/dist/resolution/frameworks/swift.d.ts.map +1 -0
  378. package/dist/resolution/frameworks/swift.js +400 -0
  379. package/dist/resolution/frameworks/swift.js.map +1 -0
  380. package/dist/resolution/frameworks/vue.d.ts +9 -0
  381. package/dist/resolution/frameworks/vue.d.ts.map +1 -0
  382. package/dist/resolution/frameworks/vue.js +306 -0
  383. package/dist/resolution/frameworks/vue.js.map +1 -0
  384. package/dist/resolution/go-module.d.ts +26 -0
  385. package/dist/resolution/go-module.d.ts.map +1 -0
  386. package/dist/resolution/go-module.js +78 -0
  387. package/dist/resolution/go-module.js.map +1 -0
  388. package/dist/resolution/import-resolver.d.ts +68 -0
  389. package/dist/resolution/import-resolver.d.ts.map +1 -0
  390. package/dist/resolution/import-resolver.js +1231 -0
  391. package/dist/resolution/import-resolver.js.map +1 -0
  392. package/dist/resolution/index.d.ts +116 -0
  393. package/dist/resolution/index.d.ts.map +1 -0
  394. package/dist/resolution/index.js +878 -0
  395. package/dist/resolution/index.js.map +1 -0
  396. package/dist/resolution/lru-cache.d.ts +24 -0
  397. package/dist/resolution/lru-cache.d.ts.map +1 -0
  398. package/dist/resolution/lru-cache.js +62 -0
  399. package/dist/resolution/lru-cache.js.map +1 -0
  400. package/dist/resolution/name-matcher.d.ts +32 -0
  401. package/dist/resolution/name-matcher.d.ts.map +1 -0
  402. package/dist/resolution/name-matcher.js +596 -0
  403. package/dist/resolution/name-matcher.js.map +1 -0
  404. package/dist/resolution/path-aliases.d.ts +68 -0
  405. package/dist/resolution/path-aliases.d.ts.map +1 -0
  406. package/dist/resolution/path-aliases.js +238 -0
  407. package/dist/resolution/path-aliases.js.map +1 -0
  408. package/dist/resolution/strip-comments.d.ts +27 -0
  409. package/dist/resolution/strip-comments.d.ts.map +1 -0
  410. package/dist/resolution/strip-comments.js +441 -0
  411. package/dist/resolution/strip-comments.js.map +1 -0
  412. package/dist/resolution/swift-objc-bridge.d.ts +134 -0
  413. package/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  414. package/dist/resolution/swift-objc-bridge.js +256 -0
  415. package/dist/resolution/swift-objc-bridge.js.map +1 -0
  416. package/dist/resolution/types.d.ts +209 -0
  417. package/dist/resolution/types.d.ts.map +1 -0
  418. package/dist/resolution/types.js +8 -0
  419. package/dist/resolution/types.js.map +1 -0
  420. package/dist/search/query-parser.d.ts +57 -0
  421. package/dist/search/query-parser.d.ts.map +1 -0
  422. package/dist/search/query-parser.js +177 -0
  423. package/dist/search/query-parser.js.map +1 -0
  424. package/dist/search/query-utils.d.ts +53 -0
  425. package/dist/search/query-utils.d.ts.map +1 -0
  426. package/dist/search/query-utils.js +350 -0
  427. package/dist/search/query-utils.js.map +1 -0
  428. package/dist/sync/git-hooks.d.ts +45 -0
  429. package/dist/sync/git-hooks.d.ts.map +1 -0
  430. package/dist/sync/git-hooks.js +223 -0
  431. package/dist/sync/git-hooks.js.map +1 -0
  432. package/dist/sync/index.d.ts +19 -0
  433. package/dist/sync/index.d.ts.map +1 -0
  434. package/dist/sync/index.js +35 -0
  435. package/dist/sync/index.js.map +1 -0
  436. package/dist/sync/watch-policy.d.ts +48 -0
  437. package/dist/sync/watch-policy.d.ts.map +1 -0
  438. package/dist/sync/watch-policy.js +124 -0
  439. package/dist/sync/watch-policy.js.map +1 -0
  440. package/dist/sync/watcher.d.ts +191 -0
  441. package/dist/sync/watcher.d.ts.map +1 -0
  442. package/dist/sync/watcher.js +398 -0
  443. package/dist/sync/watcher.js.map +1 -0
  444. package/dist/sync/worktree.d.ts +54 -0
  445. package/dist/sync/worktree.d.ts.map +1 -0
  446. package/dist/sync/worktree.js +136 -0
  447. package/dist/sync/worktree.js.map +1 -0
  448. package/dist/types.d.ts +369 -0
  449. package/dist/types.d.ts.map +1 -0
  450. package/dist/types.js +78 -0
  451. package/dist/types.js.map +1 -0
  452. package/dist/ui/glyphs.d.ts +42 -0
  453. package/dist/ui/glyphs.d.ts.map +1 -0
  454. package/dist/ui/glyphs.js +78 -0
  455. package/dist/ui/glyphs.js.map +1 -0
  456. package/dist/ui/shimmer-progress.d.ts +11 -0
  457. package/dist/ui/shimmer-progress.d.ts.map +1 -0
  458. package/dist/ui/shimmer-progress.js +90 -0
  459. package/dist/ui/shimmer-progress.js.map +1 -0
  460. package/dist/ui/shimmer-worker.d.ts +2 -0
  461. package/dist/ui/shimmer-worker.d.ts.map +1 -0
  462. package/dist/ui/shimmer-worker.js +118 -0
  463. package/dist/ui/shimmer-worker.js.map +1 -0
  464. package/dist/ui/types.d.ts +17 -0
  465. package/dist/ui/types.d.ts.map +1 -0
  466. package/dist/ui/types.js +3 -0
  467. package/dist/ui/types.js.map +1 -0
  468. package/dist/utils.d.ts +205 -0
  469. package/dist/utils.d.ts.map +1 -0
  470. package/dist/utils.js +549 -0
  471. package/dist/utils.js.map +1 -0
  472. package/package.json +59 -0
  473. package/scripts/add-lang/bench.sh +60 -0
  474. package/scripts/add-lang/check-grammar.mjs +75 -0
  475. package/scripts/add-lang/dump-ast.mjs +103 -0
  476. package/scripts/add-lang/verify-extraction.mjs +70 -0
  477. package/scripts/agent-eval/arms-F.sh +21 -0
  478. package/scripts/agent-eval/arms-matrix.sh +37 -0
  479. package/scripts/agent-eval/audit.sh +68 -0
  480. package/scripts/agent-eval/bench-readme.sh +28 -0
  481. package/scripts/agent-eval/block-read-hook.sh +19 -0
  482. package/scripts/agent-eval/hook-settings.json +15 -0
  483. package/scripts/agent-eval/itrun.sh +107 -0
  484. package/scripts/agent-eval/parse-arms.mjs +116 -0
  485. package/scripts/agent-eval/parse-bench-readme.mjs +67 -0
  486. package/scripts/agent-eval/parse-run.mjs +45 -0
  487. package/scripts/agent-eval/parse-session.mjs +93 -0
  488. package/scripts/agent-eval/probe-context.mjs +21 -0
  489. package/scripts/agent-eval/probe-explore.mjs +40 -0
  490. package/scripts/agent-eval/probe-node.mjs +20 -0
  491. package/scripts/agent-eval/probe-trace.mjs +20 -0
  492. package/scripts/agent-eval/run-agent.sh +34 -0
  493. package/scripts/agent-eval/run-all.sh +67 -0
  494. package/scripts/agent-eval/run-arms.sh +56 -0
  495. package/scripts/agent-eval/seq-matrix.mjs +137 -0
  496. package/scripts/build-bundle.sh +118 -0
  497. package/scripts/extract-release-notes.mjs +130 -0
  498. package/scripts/local-install.sh +41 -0
  499. package/scripts/npm-shim.js +246 -0
  500. package/scripts/pack-npm.sh +95 -0
  501. package/scripts/prepare-release.mjs +270 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Colby Mchenry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,595 @@
1
+ <div align="center">
2
+
3
+ # CodeGraph
4
+
5
+ ### Supercharge Claude Code, Cursor, Codex, OpenCode, Hermes Agent, Gemini, Antigravity, and Kiro with Semantic Code Intelligence
6
+
7
+ **~35% cheaper · ~70% fewer tool calls · 100% local**
8
+
9
+ ### [Documentation & Website →](https://colbymchenry.github.io/codegraph/)
10
+
11
+ [![npm version](https://img.shields.io/npm/v/@colbymchenry/codegraph.svg)](https://www.npmjs.com/package/@colbymchenry/codegraph)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
+ [![Self-contained](https://img.shields.io/badge/Node.js-bundled%20%C2%B7%20none%20required-brightgreen.svg)](https://nodejs.org/)
14
+
15
+ [![Windows](https://img.shields.io/badge/Windows-supported-blue.svg)](#supported-platforms)
16
+ [![macOS](https://img.shields.io/badge/macOS-supported-blue.svg)](#supported-platforms)
17
+ [![Linux](https://img.shields.io/badge/Linux-supported-blue.svg)](#supported-platforms)
18
+
19
+ [![Claude Code](https://img.shields.io/badge/Claude_Code-supported-blueviolet.svg)](#supported-agents)
20
+ [![Cursor](https://img.shields.io/badge/Cursor-supported-blueviolet.svg)](#supported-agents)
21
+ [![Codex](https://img.shields.io/badge/Codex-supported-blueviolet.svg)](#supported-agents)
22
+ [![opencode](https://img.shields.io/badge/opencode-supported-blueviolet.svg)](#supported-agents)
23
+ [![Hermes Agent](https://img.shields.io/badge/Hermes_Agent-supported-blueviolet.svg)](#supported-agents)
24
+ [![Gemini](https://img.shields.io/badge/Gemini-supported-blueviolet.svg)](#supported-agents)
25
+ [![Antigravity](https://img.shields.io/badge/Antigravity-supported-blueviolet.svg)](#supported-agents)
26
+ [![Kiro](https://img.shields.io/badge/Kiro-supported-blueviolet.svg)](#supported-agents)
27
+
28
+ </div>
29
+
30
+ ## Get Started
31
+
32
+ **No Node.js required** — one command grabs the right build for your OS:
33
+
34
+ ```bash
35
+ # macOS / Linux
36
+ curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh
37
+
38
+ # Windows (PowerShell)
39
+ irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex
40
+ ```
41
+
42
+ Already have Node? Use npm instead (works on any version):
43
+
44
+ ```bash
45
+ npx @colbymchenry/codegraph # zero-install, or:
46
+ npm i -g @colbymchenry/codegraph
47
+ ```
48
+
49
+ <sub>CodeGraph bundles its own runtime — nothing to compile, no native build, works the same everywhere. The interactive installer auto-configures your agent(s) — Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, Kiro.</sub>
50
+
51
+ ### Initialize Projects
52
+
53
+ ```bash
54
+ cd your-project
55
+ codegraph init -i
56
+ ```
57
+
58
+ <div align="center">
59
+
60
+ ![1_C_VYnhpys0UHrOuOgpgoyw](https://github.com/user-attachments/assets/f168182f-4d9a-44e0-94d7-08d018cc8a3a)
61
+
62
+ </div>
63
+
64
+ ### Uninstall
65
+
66
+ Changed your mind? One command removes CodeGraph from every agent it configured:
67
+
68
+ ```bash
69
+ codegraph uninstall
70
+ ```
71
+
72
+ <sub>Reverses the installer — strips CodeGraph's MCP server config, instructions, and permissions from each configured agent. Your project indexes (`.codegraph/`) are left untouched; remove those per-project with `codegraph uninit`. Use `--target` to remove from specific agents, or `--yes` to run non-interactively.</sub>
73
+
74
+ ---
75
+
76
+ ## Why CodeGraph?
77
+
78
+ When Claude Code explores a codebase, it spawns **Explore agents** that scan files with grep, glob, and Read — consuming tokens on every tool call.
79
+
80
+ **CodeGraph gives those agents a pre-indexed knowledge graph** — symbol relationships, call graphs, and code structure. Agents query the graph instantly instead of scanning files.
81
+
82
+ ### Benchmark Results
83
+
84
+ Tested across **7 real-world open-source codebases** spanning 7 languages, comparing an agent (Claude Code, headless) answering one architecture question **with** and **without** CodeGraph. Each cell is the savings at the **median of 4 runs per arm**. _Re-validated on **v0.9.4** (2026-05-24)._
85
+
86
+ > **Average: 35% cheaper · 57% fewer tokens · 46% faster · 71% fewer tool calls**
87
+
88
+ | Codebase | Language | Cost | Tokens | Time | Tool calls |
89
+ |----------|----------|------|--------|------|------------|
90
+ | **VS Code** | TypeScript · ~10k files | 26% cheaper | 78% fewer | 52% faster | 85% fewer |
91
+ | **Excalidraw** | TypeScript · ~640 | 52% cheaper | 90% fewer | 73% faster | 96% fewer |
92
+ | **Django** | Python · ~3k | 12% cheaper | 36% fewer | 19% faster | 53% fewer |
93
+ | **Tokio** | Rust · ~790 | 82% cheaper | 86% fewer | 71% faster | 92% fewer |
94
+ | **OkHttp** | Java · ~645 | 2% cheaper | 13% fewer | 31% faster | 45% fewer |
95
+ | **Gin** | Go · ~110 | 21% cheaper | 34% fewer | 27% faster | 40% fewer |
96
+ | **Alamofire** | Swift · ~110 | 47% cheaper | 64% fewer | 48% faster | 83% fewer |
97
+
98
+ The gains scale with codebase size: on large repos the agent answers from the index in a handful of calls with **zero file reads**, while the no-CodeGraph agent fans out across grep/find/Read (and the sub-agents it spawns). On a small repo like Gin (~150 files) native search is already cheap, so the margin narrows.
99
+
100
+ <details>
101
+ <summary><strong>Full benchmark details</strong></summary>
102
+
103
+ **Methodology.** Each arm is `claude -p` (Claude Opus 4.7) run headlessly against the repo with `--strict-mcp-config`: **WITH** = CodeGraph's MCP server enabled, **WITHOUT** = an empty MCP config. Built-in Read/Grep/Bash stay available to both. Same question per repo, **4 runs per arm, median reported**. Cost = the run's `total_cost_usd`; Tokens = total tokens processed (input incl. cached + output); Time = wall-clock; Tool calls = every tool invocation, including those inside any sub-agents the model spawns. Repos cloned at `--depth 1` and indexed by the same CodeGraph build that served them. Re-validated on codegraph **v0.9.4** (2026-05-24); per-repo numbers move run-to-run with how hard the without-arm thrashes (the median-of-4 smooths it, but tails remain — e.g. Tokio's without-arm hit $2.41/3m one batch).
104
+
105
+ **Queries:**
106
+ | Codebase | Query |
107
+ |----------|-------|
108
+ | VS Code | "How does the extension host communicate with the main process?" |
109
+ | Excalidraw | "How does Excalidraw render and update canvas elements?" |
110
+ | Django | "How does Django's ORM build and execute a query from a QuerySet?" |
111
+ | Tokio | "How does tokio schedule and run async tasks on its runtime?" |
112
+ | OkHttp | "How does OkHttp process a request through its interceptor chain?" |
113
+ | Gin | "How does gin route requests through its middleware chain?" |
114
+ | Alamofire | "How does Alamofire build, send, and validate a request?" |
115
+
116
+ **Raw medians — WITH → WITHOUT:**
117
+ | Codebase | Cost | Tokens | Time | Tool calls |
118
+ |----------|------|--------|------|------------|
119
+ | VS Code | $0.60 → $0.80 | 601k → 2.8M | 1m 10s → 2m 26s | 8 → 55 |
120
+ | Excalidraw | $0.43 → $0.90 | 344k → 3.5M | 48s → 2m 58s | 3 → 79 |
121
+ | Django | $0.59 → $0.67 | 739k → 1.2M | 1m 19s → 1m 38s | 9 → 19 |
122
+ | Tokio | $0.42 → $2.41 | 379k → 2.6M | 53s → 3m 2s | 4 → 53 |
123
+ | OkHttp | $0.47 → $0.47 | 636k → 730k | 42s → 1m 1s | 6 → 11 |
124
+ | Gin | $0.37 → $0.47 | 444k → 675k | 44s → 1m 0s | 6 → 10 |
125
+ | Alamofire | $0.61 → $1.14 | 1.0M → 2.8M | 1m 17s → 2m 27s | 12 → 69 |
126
+
127
+ **Why CodeGraph wins:** with the index available, the agent answers directly — `codegraph_context` to map the area, then one `codegraph_explore` for the relevant source — and stops, usually with zero file reads. Without it, the agent (and the Explore sub-agents it spawns) spends most of its budget on discovery (find/ls/grep) before reading the right code. CodeGraph only helps when queried *directly*, so its instructions steer agents to answer directly rather than delegate exploration to file-reading sub-agents — otherwise a sub-agent reads files regardless and CodeGraph becomes overhead.
128
+
129
+ </details>
130
+
131
+ ---
132
+
133
+ ## Key Features
134
+
135
+ | | |
136
+ |---|---|
137
+ | **Smart Context Building** | One tool call returns entry points, related symbols, and code snippets — no expensive exploration agents |
138
+ | **Full-Text Search** | Find code by name instantly across your entire codebase, powered by FTS5 |
139
+ | **Impact Analysis** | Trace callers, callees, and the full impact radius of any symbol before making changes |
140
+ | **Always Fresh** | File watcher uses native OS events (FSEvents/inotify/ReadDirectoryChangesW) with debounced auto-sync — the graph stays current as you code, zero config |
141
+ | **20+ Languages** | TypeScript, JavaScript, Python, Go, Rust, Java, C#, PHP, Ruby, C, C++, Objective-C, Swift, Kotlin, Dart, Lua, Luau, Svelte, Liquid, Pascal/Delphi |
142
+ | **Framework-aware Routes** | Recognizes web-framework routing files and links URL patterns to their handlers across 14 frameworks |
143
+ | **Mixed iOS / React Native / Expo** | Closes cross-language flows that static parsing misses: Swift ↔ ObjC bridging, React Native legacy bridge + TurboModules + Fabric view components, native → JS event emitters, Expo Modules |
144
+ | **100% Local** | No data leaves your machine. No API keys. No external services. SQLite database only |
145
+
146
+ <details>
147
+ <summary><strong>How auto-syncing works — and why you don't need to run <code>codegraph sync</code> manually</strong></summary>
148
+
149
+ When your agent (Claude Code, Cursor, Codex, opencode) launches `codegraph serve --mcp`, three layers keep the index in step with your code — and make sure the agent never gets a silent wrong answer in the brief window between an edit and the next sync:
150
+
151
+ 1. **File watcher with debounced auto-sync.** A native FSEvents / inotify / ReadDirectoryChangesW watcher captures every source-file create / modify / delete and triggers a re-index after a debounce window (default `2000ms`, tunable via `CODEGRAPH_WATCH_DEBOUNCE_MS`, clamped to `[100ms, 60s]`). Bursts of edits collapse into a single sync.
152
+
153
+ 2. **Per-file staleness banner.** During the brief debounce window, MCP tool responses that would reference a still-pending file prepend a `⚠️` banner naming it and telling the agent to `Read` it directly. Pending files NOT referenced by the response surface as a small footer instead. Either way, the agent gets an explicit signal — validated with Claude Code, where the agent literally says "Reading the file directly for the live content" before opening it.
154
+
155
+ 3. **Connect-time catch-up.** When the MCP server (re)connects, codegraph runs a fast `(size, mtime)` + content-hash reconciliation against the working tree before answering the first query — so edits made while no MCP server was running (a `git pull` from the terminal, edits from another editor, a previous agent session that exited) get absorbed on the next session's first tool call.
156
+
157
+ ```
158
+ agent writes src/Widget.ts
159
+ → watcher fires (<100ms)
160
+ → debounce (default 2s)
161
+ → sync; Widget.ts is in the index
162
+ → next agent query sees it
163
+ ```
164
+
165
+ **Verify any time** with `codegraph_status` (via MCP) or `codegraph status` (CLI). If anything is pending, you'll see a `### Pending sync:` section naming the files and their edit age.
166
+
167
+ The handful of cases where manual `codegraph sync` makes sense: the watcher is disabled (sandboxed environments, or `CODEGRAPH_NO_DAEMON=1`), or you're scripting against the index outside an agent session and want a pre-flight sync at the start of your script.
168
+
169
+ → Full deep-dive in [Guides → Indexing a Project](https://colbymchenry.github.io/codegraph/guides/indexing/#stay-fresh-automatically).
170
+
171
+ </details>
172
+
173
+ ---
174
+
175
+ ## Framework-aware Routes
176
+
177
+ CodeGraph detects web-framework routing files and emits `route` nodes linked by `references` edges to their handler classes or functions. Querying callers of a view/controller now surfaces the URL pattern that binds it.
178
+
179
+ | Framework | Shapes recognized |
180
+ |---|---|
181
+ | **Django** | `path()`, `re_path()`, `url()`, `include()` in `urls.py` (CBV `.as_view()`, dotted paths) |
182
+ | **Flask** | `@app.route('/path', methods=[...])`, blueprint routes |
183
+ | **FastAPI** | `@app.get(...)`, `@router.post(...)`, all standard methods |
184
+ | **Express** | `app.get(...)`, `router.post(...)` with middleware chains |
185
+ | **NestJS** | `@Controller` + `@Get/@Post/...`, GraphQL `@Resolver` + `@Query/@Mutation`, `@MessagePattern`/`@EventPattern`, `@SubscribeMessage` |
186
+ | **Laravel** | `Route::get()`, `Route::resource()`, `Controller@action`, tuple syntax |
187
+ | **Drupal** | `*.routing.yml` routes (`_controller`, `_form`, entity handlers); `hook_*` implementations in `.module`/`.theme`/`.install`/`.inc` |
188
+ | **Rails** | `get '/x', to: 'users#index'`, hash-rocket `=>` syntax |
189
+ | **Spring** | `@GetMapping`, `@PostMapping`, `@RequestMapping` on methods |
190
+ | **Gin / chi / gorilla / mux** | `r.GET(...)`, `router.HandleFunc(...)` |
191
+ | **Axum / actix / Rocket** | `.route("/x", get(handler))` |
192
+ | **ASP.NET** | `[HttpGet("/x")]` attributes on action methods |
193
+ | **Vapor** | `app.get("x", use: handler)` |
194
+ | **React Router** / **SvelteKit** | Route component nodes |
195
+
196
+ ---
197
+
198
+ ## Mixed iOS / React Native / Expo bridging
199
+
200
+ Real iOS and React Native codebases live across multiple languages — a Swift caller invokes an Objective-C selector that's been auto-bridged, a JS file calls into a native module via the React Native bridge, a JSX component delegates to a native view manager. Static tree-sitter extraction stops at each language boundary. CodeGraph bridges them so `trace`, `callers`, `callees`, and `impact` connect end-to-end across the gap.
201
+
202
+ | Boundary | JS / Swift side | Native side | How |
203
+ |---|---|---|---|
204
+ | **Swift → ObjC** | Swift `obj.foo(bar:)` | ObjC selector `-fooWithBar:` | `@objc` auto-bridging rules (including init/property/protocol forms) + Cocoa preposition prefixes (`With`/`For`/`By`/`In`/`On`/`At`/…) |
205
+ | **ObjC → Swift** | ObjC `[obj fooWithBar:]` | Swift `@objc func foo(bar:)` | Reverse-bridge name candidates; verifies `@objc` exposure from source |
206
+ | **React Native legacy bridge** | JS `NativeModules.X.fn(...)` | ObjC `RCT_EXPORT_METHOD` / `RCT_REMAP_METHOD` · Java/Kotlin `@ReactMethod` | Parses macro/annotation declarations to build a JS-name → native-method map |
207
+ | **React Native TurboModules** | JS `import M from './NativeM'; M.fn(...)` | Native impl matching the Codegen spec | Treats the `Native<X>.ts` spec interface as ground truth |
208
+ | **RN native → JS events** | JS `new NativeEventEmitter(...).addListener('e', cb)` | ObjC `[self sendEventWithName:@"e" body:...]` · Swift `sendEvent(withName: "e", ...)` · Java/Kotlin `.emit("e", ...)` | Synthesized cross-language event channel keyed by literal event name |
209
+ | **Expo Modules** | JS `requireNativeModule('X').fn(...)` | Swift / Kotlin `Module { Name("X"); AsyncFunction("fn") { ... } }` | Parses the Expo DSL literals; synthetic method nodes resolve via existing name-match |
210
+ | **Fabric view components** | JSX `<MyView prop={v}/>` | TS Codegen spec + native impl class | Spec → `component` node; convention-based name+suffix lookup (`View`/`ComponentView`/`Manager`/`ViewManager`) bridges to native |
211
+ | **Legacy Paper view managers** | JSX `<MyView prop={v}/>` | ObjC `RCT_EXPORT_VIEW_PROPERTY` · Java/Kotlin `@ReactProp` | Same as Fabric — Paper-era declarations also produce `component` + `property` nodes |
212
+
213
+ **Validated on real codebases** (small + medium + large for each bridge):
214
+
215
+ | Bridge | Small | Medium | Large |
216
+ |---|---|---|---|
217
+ | Swift ↔ ObjC | [Charts](https://github.com/danielgindi/Charts) | [realm-swift](https://github.com/realm/realm-swift) | [Wikipedia-iOS](https://github.com/wikimedia/wikipedia-ios) |
218
+ | RN legacy bridge | [AsyncStorage](https://github.com/react-native-async-storage/async-storage) | [react-native-svg](https://github.com/software-mansion/react-native-svg) | [react-native-firebase](https://github.com/invertase/react-native-firebase) |
219
+ | RN native → JS events | [RNGeolocation](https://github.com/Agontuk/react-native-geolocation-service) | — | react-native-firebase |
220
+ | Expo Modules | expo-haptics | expo-camera | expo SDK sweep (7 packages) |
221
+ | Fabric / Paper views | [react-native-segmented-control](https://github.com/react-native-segmented-control/segmented-control) | [react-native-screens](https://github.com/software-mansion/react-native-screens) | [react-native-skia](https://github.com/Shopify/react-native-skia) |
222
+
223
+ Each bridge emits edges tagged `provenance:'heuristic'` with `metadata.synthesizedBy:` set to a stable channel name (e.g. `swift-objc-bridge`, `rn-event-channel`, `fabric-native-impl`, `expo-module-extract`), so the agent can tell at a glance how a hop got into the graph.
224
+
225
+ ---
226
+
227
+ ## Quick Start
228
+
229
+ ### 1. Run the Installer
230
+
231
+ ```bash
232
+ npx @colbymchenry/codegraph
233
+ ```
234
+
235
+ The installer will:
236
+ - Ask which agent(s) to configure — auto-detects installed ones from: **Claude Code**, **Cursor**, **Codex CLI**, **opencode**, **Hermes Agent**, **Gemini CLI**, **Antigravity IDE**, **Kiro**
237
+ - Prompt to install `codegraph` on your PATH (so agents can launch the MCP server)
238
+ - Ask whether configs apply to all your projects or just this one
239
+ - Write each chosen agent's MCP server config + an instructions file (e.g. `CLAUDE.md`, `.cursor/rules/codegraph.mdc`, `~/.codex/AGENTS.md`, `~/.gemini/GEMINI.md`)
240
+ - Set up auto-allow permissions when Claude Code is one of the targets
241
+ - Initialize your current project (local installs only)
242
+
243
+ **Non-interactive (scripting / CI):**
244
+
245
+ ```bash
246
+ codegraph install --yes # auto-detect agents, install global
247
+ codegraph install --target=cursor,claude --yes # explicit target list
248
+ codegraph install --target=auto --location=local # detected agents, project-local
249
+ codegraph install --print-config codex # print snippet, no file writes
250
+ ```
251
+
252
+ | Flag | Values | Default |
253
+ |---|---|---|
254
+ | `--target` | `auto`, `all`, `none`, or csv (`claude,cursor,...`) | prompt |
255
+ | `--location` | `global`, `local` | prompt |
256
+ | `--yes` | (boolean) | prompt every step |
257
+ | `--no-permissions` | (boolean) skip Claude auto-allow list | permissions on |
258
+ | `--print-config <id>` | dump snippet for one agent and exit | — |
259
+
260
+ ### 2. Restart Your Agent
261
+
262
+ Restart your agent (Claude Code / Cursor / Codex CLI / opencode / Hermes Agent / Gemini CLI / Antigravity IDE / Kiro) for the MCP server to load.
263
+
264
+ ### 3. Initialize Projects
265
+
266
+ ```bash
267
+ cd your-project
268
+ codegraph init -i
269
+ ```
270
+
271
+ Builds the per-project knowledge graph index. Also wires up any project-local agent surfaces (e.g. Cursor's `.cursor/rules/codegraph.mdc`) so a single global `codegraph install` works in every project you open — no need to re-run the installer per project.
272
+
273
+ That's it — your agent will use CodeGraph tools automatically when a `.codegraph/` directory exists.
274
+
275
+ <details>
276
+ <summary><strong>Manual Setup (Alternative)</strong></summary>
277
+
278
+ **Install globally:**
279
+ ```bash
280
+ npm install -g @colbymchenry/codegraph
281
+ ```
282
+
283
+ **Add to `~/.claude.json`:**
284
+ ```json
285
+ {
286
+ "mcpServers": {
287
+ "codegraph": {
288
+ "type": "stdio",
289
+ "command": "codegraph",
290
+ "args": ["serve", "--mcp"]
291
+ }
292
+ }
293
+ }
294
+ ```
295
+
296
+ **Add to `~/.claude/settings.json` (optional, for auto-allow):**
297
+ ```json
298
+ {
299
+ "permissions": {
300
+ "allow": [
301
+ "mcp__codegraph__codegraph_search",
302
+ "mcp__codegraph__codegraph_context",
303
+ "mcp__codegraph__codegraph_callers",
304
+ "mcp__codegraph__codegraph_callees",
305
+ "mcp__codegraph__codegraph_impact",
306
+ "mcp__codegraph__codegraph_node",
307
+ "mcp__codegraph__codegraph_status",
308
+ "mcp__codegraph__codegraph_files"
309
+ ]
310
+ }
311
+ }
312
+ ```
313
+
314
+ </details>
315
+
316
+ <details>
317
+ <summary><strong>Global Instructions Reference</strong></summary>
318
+
319
+ The installer automatically adds these instructions to `~/.claude/CLAUDE.md`:
320
+
321
+ ```markdown
322
+ ## CodeGraph
323
+
324
+ CodeGraph builds a semantic knowledge graph of codebases for faster, smarter code exploration.
325
+
326
+ ### If `.codegraph/` exists in the project
327
+
328
+ **Answer directly with CodeGraph — don't delegate exploration to a file-reading sub-agent or a grep/read loop.** CodeGraph *is* the pre-built search index; re-deriving its answers with grep + Read repeats work it already did and costs more for the same result. For "how does X work?", architecture, trace, or where-is-X questions, answer in a handful of CodeGraph calls and stop — typically with **zero file reads**. The returned source is complete and authoritative: treat it as already read and do not re-open those files. Reach for raw Read/Grep only to confirm a specific detail CodeGraph didn't cover.
329
+
330
+ **Tool selection by intent:**
331
+
332
+ | Tool | Use For |
333
+ |------|---------|
334
+ | `codegraph_context` | Map a task / feature / area first — composes search + node + callers + callees in one call |
335
+ | `codegraph_trace` | "How does X reach Y" — the call path, each hop's body inline (follows dynamic-dispatch hops grep can't) |
336
+ | `codegraph_explore` | Survey several related symbols' source in ONE budget-capped call |
337
+ | `codegraph_search` | Find a symbol by name |
338
+ | `codegraph_callers` / `codegraph_callees` | Walk call flow one hop at a time |
339
+ | `codegraph_impact` | Check what's affected before editing |
340
+ | `codegraph_node` | Get a single symbol's source / signature |
341
+
342
+ A direct CodeGraph answer is a handful of calls; a grep/read exploration is dozens.
343
+
344
+ ### If `.codegraph/` does NOT exist
345
+
346
+ At the start of a session, ask the user if they'd like to initialize CodeGraph:
347
+
348
+ "I notice this project doesn't have CodeGraph initialized. Would you like me to run `codegraph init -i` to build a code knowledge graph?"
349
+ ```
350
+
351
+ </details>
352
+
353
+ ---
354
+
355
+ ## How It Works
356
+
357
+ ```
358
+ ┌───────────────────────────────────────────────────────────────────┐
359
+ │ Claude Code │
360
+ │ │
361
+ │ "How does a request reach the database?" │
362
+ │ calls CodeGraph tools directly — no Explore sub-agent │
363
+ │ │ │
364
+ └─────────────────────────────────┬─────────────────────────────────┘
365
+
366
+
367
+ ┌───────────────────────────────────────────────────────────────────┐
368
+ │ CodeGraph MCP Server │
369
+ │ │
370
+ │ context · trace · explore · callers · callees · impact │
371
+ │ │ │
372
+ │ ▼ │
373
+ │ SQLite knowledge graph │
374
+ │ symbols · edges · files · FTS5 full-text search │
375
+ └───────────────────────────────────────────────────────────────────┘
376
+ ```
377
+
378
+ 1. **Extraction** — [tree-sitter](https://tree-sitter.github.io/) parses source code into ASTs. Language-specific queries extract nodes (functions, classes, methods) and edges (calls, imports, extends, implements).
379
+
380
+ 2. **Storage** — Everything goes into a local SQLite database (`.codegraph/codegraph.db`) with FTS5 full-text search.
381
+
382
+ 3. **Resolution** — After extraction, references are resolved: function calls → definitions, imports → source files, class inheritance, and framework-specific patterns.
383
+
384
+ 4. **Auto-Sync** — The MCP server watches your project using native OS file events. Changes are debounced (2-second quiet window), filtered to source files only, and incrementally synced. The graph stays fresh as you code — no configuration needed.
385
+
386
+ ---
387
+
388
+ ## CLI Reference
389
+
390
+ ```bash
391
+ codegraph # Run interactive installer
392
+ codegraph install # Run installer (explicit)
393
+ codegraph uninstall # Remove CodeGraph from your agents (inverse of install)
394
+ codegraph init [path] # Initialize in a project (--index to also index)
395
+ codegraph uninit [path] # Remove CodeGraph from a project (--force to skip prompt)
396
+ codegraph index [path] # Full index (--force to re-index, --quiet for less output)
397
+ codegraph sync [path] # Incremental update
398
+ codegraph status [path] # Show statistics
399
+ codegraph query <search> # Search symbols (--kind, --limit, --json)
400
+ codegraph files [path] # Show file structure (--format, --filter, --max-depth, --json)
401
+ codegraph context <task> # Build context for AI (--format, --max-nodes)
402
+ codegraph callers <symbol> # Find what calls a function/method (--limit, --json)
403
+ codegraph callees <symbol> # Find what a function/method calls (--limit, --json)
404
+ codegraph impact <symbol> # Analyze what code is affected by changing a symbol (--depth, --json)
405
+ codegraph affected [files...] # Find test files affected by changes (see below)
406
+ codegraph serve --mcp # Start MCP server
407
+ ```
408
+
409
+ ### `codegraph affected`
410
+
411
+ Traces import dependencies transitively to find which test files are affected by changed source files.
412
+
413
+ ```bash
414
+ codegraph affected src/utils.ts src/api.ts # Pass files as arguments
415
+ git diff --name-only | codegraph affected --stdin # Pipe from git diff
416
+ codegraph affected src/auth.ts --filter "e2e/*" # Custom test file pattern
417
+ ```
418
+
419
+ | Option | Description | Default |
420
+ |--------|-------------|---------|
421
+ | `--stdin` | Read file list from stdin | `false` |
422
+ | `-d, --depth <n>` | Max dependency traversal depth | `5` |
423
+ | `-f, --filter <glob>` | Custom glob to identify test files | auto-detect |
424
+ | `-j, --json` | Output as JSON | `false` |
425
+ | `-q, --quiet` | Output file paths only | `false` |
426
+
427
+ **CI/hook example:**
428
+
429
+ ```bash
430
+ #!/usr/bin/env bash
431
+ AFFECTED=$(git diff --name-only HEAD | codegraph affected --stdin --quiet)
432
+ if [ -n "$AFFECTED" ]; then
433
+ npx vitest run $AFFECTED
434
+ fi
435
+ ```
436
+
437
+ ---
438
+
439
+ ## MCP Tools
440
+
441
+ When running as an MCP server, CodeGraph exposes these tools to Claude Code:
442
+
443
+ | Tool | Purpose |
444
+ |------|---------|
445
+ | `codegraph_search` | Find symbols by name across the codebase |
446
+ | `codegraph_context` | Build relevant code context for a task |
447
+ | `codegraph_trace` | Trace the call path between two symbols ("how does X reach Y") in one call — each hop with its body inline, following dynamic-dispatch hops (callbacks, React re-render, interface→impl) that grep can't |
448
+ | `codegraph_callers` | Find what calls a function |
449
+ | `codegraph_callees` | Find what a function calls |
450
+ | `codegraph_impact` | Analyze what code is affected by changing a symbol |
451
+ | `codegraph_node` | Get details about a specific symbol (optionally with source code) |
452
+ | `codegraph_explore` | Return source for several related symbols grouped by file, plus a relationship map, in one call |
453
+ | `codegraph_files` | Get indexed file structure (faster than filesystem scanning) |
454
+ | `codegraph_status` | Check index health and statistics |
455
+
456
+ ---
457
+
458
+ ## Library Usage
459
+
460
+ ```typescript
461
+ import CodeGraph from '@colbymchenry/codegraph';
462
+
463
+ const cg = await CodeGraph.init('/path/to/project');
464
+ // Or: const cg = await CodeGraph.open('/path/to/project');
465
+
466
+ await cg.indexAll({
467
+ onProgress: (p) => console.log(`${p.phase}: ${p.current}/${p.total}`)
468
+ });
469
+
470
+ const results = cg.searchNodes('UserService');
471
+ const callers = cg.getCallers(results[0].node.id);
472
+ const context = await cg.buildContext('fix login bug', { maxNodes: 20, includeCode: true, format: 'markdown' });
473
+ const impact = cg.getImpactRadius(results[0].node.id, 2);
474
+
475
+ cg.watch(); // auto-sync on file changes
476
+ cg.unwatch(); // stop watching
477
+ cg.close();
478
+ ```
479
+
480
+ ---
481
+
482
+ ## Configuration
483
+
484
+ There isn't any — CodeGraph is zero-config, with **no config file** to write or
485
+ keep in sync. Language support is automatic from the file extension; there's
486
+ nothing to wire up per language.
487
+
488
+ What it skips out of the box:
489
+
490
+ - **Dependency, build, and cache directories** — `node_modules`, `vendor`,
491
+ `dist`, `build`, `target`, `.venv`, `Pods`, `.next`, and the like across every
492
+ [supported stack](#supported-languages) — so the graph is your code, not
493
+ third-party noise. This holds even with no `.gitignore`.
494
+ - **Anything in your `.gitignore`** — honored in git repos via git, and in
495
+ non-git projects by reading `.gitignore` directly (root and nested).
496
+ - **Files larger than 1 MB** — generated bundles, minified JS, vendored blobs.
497
+
498
+ To keep something else out, add it to `.gitignore`. To pull a default-excluded
499
+ directory back **in** (say you really do want a vendored dependency indexed),
500
+ add a negation — `!vendor/`. The defaults apply uniformly, so committing a
501
+ dependency or build directory doesn't force it into the graph; the `.gitignore`
502
+ negation is the explicit opt-in.
503
+
504
+ ## Supported Platforms
505
+
506
+ Every release ships a self-contained build (bundled Node runtime — nothing to
507
+ compile) for all three desktop OSes, on both Intel/AMD (x64) and ARM (arm64):
508
+
509
+ | Platform | Architectures | Install |
510
+ |----------|---------------|---------|
511
+ | Windows | x64, arm64 | PowerShell installer or npm |
512
+ | macOS | x64, arm64 | shell installer or npm |
513
+ | Linux | x64, arm64 | shell installer or npm |
514
+
515
+ See [Get Started](#get-started) for the one-line install commands.
516
+
517
+ ## Supported Agents
518
+
519
+ The interactive installer auto-detects and configures each of these — wiring up
520
+ the MCP server and writing its instructions file:
521
+
522
+ - **Claude Code**
523
+ - **Cursor**
524
+ - **Codex CLI**
525
+ - **opencode**
526
+ - **Hermes Agent**
527
+ - **Gemini CLI**
528
+ - **Antigravity IDE**
529
+ - **Kiro**
530
+
531
+ ## Supported Languages
532
+
533
+ | Language | Extension | Status |
534
+ |----------|-----------|--------|
535
+ | TypeScript | `.ts`, `.tsx` | Full support |
536
+ | JavaScript | `.js`, `.jsx`, `.mjs` | Full support |
537
+ | Python | `.py` | Full support |
538
+ | Go | `.go` | Full support |
539
+ | Rust | `.rs` | Full support |
540
+ | Java | `.java` | Full support |
541
+ | C# | `.cs` | Full support |
542
+ | PHP | `.php` | Full support |
543
+ | Ruby | `.rb` | Full support |
544
+ | C | `.c`, `.h` | Full support |
545
+ | C++ | `.cpp`, `.hpp`, `.cc` | Full support |
546
+ | Objective-C | `.m`, `.mm`, `.h` | Partial support (classes, protocols, methods, `@property`, `#import`, message sends; `.mm` ObjC++ may parse incompletely) |
547
+ | Swift | `.swift` | Full support |
548
+ | Kotlin | `.kt`, `.kts` | Full support |
549
+ | Scala | `.scala`, `.sc` | Full support (classes, traits, methods, type aliases, Scala 3 enums) |
550
+ | Dart | `.dart` | Full support |
551
+ | Svelte | `.svelte` | Full support (script extraction, Svelte 5 runes, SvelteKit routes) |
552
+ | Vue | `.vue` | Full support (script + script-setup extraction, Nuxt page/API/middleware routes) |
553
+ | Liquid | `.liquid` | Full support |
554
+ | Pascal / Delphi | `.pas`, `.dpr`, `.dpk`, `.lpr` | Full support (classes, records, interfaces, enums, DFM/FMX form files) |
555
+ | Lua | `.lua` | Full support (functions, methods with receivers, local variables, `require` imports, call edges) |
556
+ | Luau | `.luau` | Full support (everything in Lua, plus `type`/`export type` aliases, typed signatures, and Roblox instance-path `require`) |
557
+
558
+ ## Troubleshooting
559
+
560
+ **"CodeGraph not initialized"** — Run `codegraph init` in your project directory first.
561
+
562
+ **Indexing is slow** — Check that `node_modules` and other large directories are excluded. Use `--quiet` to reduce output overhead.
563
+
564
+ **MCP hits `database is locked`** — current builds shouldn't: CodeGraph bundles its own Node runtime and uses Node's built-in `node:sqlite` in WAL mode, where concurrent reads never block on a writer. If you still see it:
565
+
566
+ - **You're on an old (pre-0.9) install.** Reinstall to get the bundled runtime — `curl -fsSL https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.sh | sh` (macOS/Linux), `irm https://raw.githubusercontent.com/colbymchenry/codegraph/main/install.ps1 | iex` (Windows), or `npm i -g @colbymchenry/codegraph@latest`.
567
+ - **`codegraph status` shows `Journal:` other than `wal`** — WAL couldn't be enabled on this filesystem (common on network shares and WSL2 `/mnt`), so reads can block on writes. Move the project (with its `.codegraph/` folder) onto a local disk.
568
+
569
+ **MCP server not connecting** — Ensure the project is initialized/indexed, verify the path in your MCP config, and check that `codegraph serve --mcp` works from the command line.
570
+
571
+ **Missing symbols** — The MCP server auto-syncs on save (wait a couple seconds). Run `codegraph sync` manually if needed. Check that the file's language is supported and isn't inside a `.gitignore`d or default-excluded directory (e.g. `node_modules`, `dist`).
572
+
573
+ ## Star History
574
+
575
+ <a href="https://www.star-history.com/?repos=colbymchenry%2Fcodegraph&type=date&legend=top-left">
576
+ <picture>
577
+ <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&theme=dark&legend=top-left" />
578
+ <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&legend=top-left" />
579
+ <img alt="Star History Chart" src="https://api.star-history.com/chart?repos=colbymchenry/codegraph&type=date&legend=top-left" />
580
+ </picture>
581
+ </a>
582
+
583
+ ## License
584
+
585
+ MIT
586
+
587
+ ---
588
+
589
+ <div align="center">
590
+
591
+ **Made for AI coding agents — Claude Code, Cursor, Codex CLI, opencode, Hermes Agent, Gemini CLI, Antigravity IDE, and Kiro**
592
+
593
+ [Report Bug](https://github.com/colbymchenry/codegraph/issues) · [Request Feature](https://github.com/colbymchenry/codegraph/issues)
594
+
595
+ </div>
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * CodeGraph CLI
4
+ *
5
+ * Command-line interface for CodeGraph code intelligence.
6
+ *
7
+ * Usage:
8
+ * codegraph Run interactive installer (when no args)
9
+ * codegraph install Run interactive installer
10
+ * codegraph uninstall Remove CodeGraph from your agents
11
+ * codegraph init [path] Initialize CodeGraph in a project
12
+ * codegraph uninit [path] Remove CodeGraph from a project
13
+ * codegraph index [path] Index all files in the project
14
+ * codegraph sync [path] Sync changes since last index
15
+ * codegraph status [path] Show index status
16
+ * codegraph query <search> Search for symbols
17
+ * codegraph files [options] Show project file structure
18
+ * codegraph context <task> Build context for a task
19
+ * codegraph callers <symbol> Find what calls a function/method
20
+ * codegraph callees <symbol> Find what a function/method calls
21
+ * codegraph impact <symbol> Analyze what code is affected by changing a symbol
22
+ * codegraph affected [files] Find test files affected by changes
23
+ */
24
+ export {};
25
+ //# sourceMappingURL=codegraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codegraph.d.ts","sourceRoot":"","sources":["../../src/bin/codegraph.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;;;;;;;;;GAqBG"}