@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
@@ -0,0 +1,75 @@
1
+ #!/usr/bin/env node
2
+ // Verify a tree-sitter grammar wasm is HEALTHY under the project's web-tree-sitter
3
+ // runtime BEFORE writing an extractor. Prints the ABI version and parses a valid
4
+ // sample many times in a multi-grammar context, to catch heap-corruption bugs
5
+ // that silently drop nodes on every parse after the first.
6
+ //
7
+ // Why this exists: the tree-sitter-wasms Lua grammar is ABI 13 and corrupts the
8
+ // shared WASM heap under web-tree-sitter 0.25 — Lua extraction degraded on every
9
+ // file after the first (nested calls/imports vanished). The fix was to vendor the
10
+ // upstream ABI-15 wasm. Run this on any new grammar first; if it FAILs, vendor a
11
+ // newer build instead of using the tree-sitter-wasms one.
12
+ //
13
+ // Usage: node scripts/add-lang/check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]
14
+ // Exit: 0 healthy, 1 corruption / parse errors, 2 could not run.
15
+ // NOTE: the sample must be SYNTACTICALLY VALID — a broken sample fails for the
16
+ // wrong reason.
17
+
18
+ import { readFileSync, existsSync } from 'node:fs';
19
+ import { createRequire } from 'node:module';
20
+ import { Parser, Language } from 'web-tree-sitter';
21
+
22
+ const require = createRequire(import.meta.url);
23
+ const fail = (code, msg) => { console.error(`[check-grammar] ${msg}`); process.exit(code); };
24
+
25
+ const [token, sample, iterArg] = process.argv.slice(2);
26
+ if (!token || !sample) fail(2, 'usage: check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]');
27
+ if (!existsSync(sample)) fail(2, `sample not found: ${sample}`);
28
+ const iters = iterArg ? parseInt(iterArg, 10) : 20;
29
+
30
+ const SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
31
+ function resolveWasm(t) {
32
+ if (t.endsWith('.wasm')) return existsSync(t) ? t : fail(2, `wasm not found: ${t}`);
33
+ const base = SPECIAL[t.toLowerCase()] ?? t.toLowerCase();
34
+ try { return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`); } catch { /* try vendored */ }
35
+ const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
36
+ if (existsSync(vendored)) return vendored;
37
+ return fail(2, `no grammar for "${t}" — not in tree-sitter-wasms and not vendored`);
38
+ }
39
+
40
+ const wasmPath = resolveWasm(token);
41
+ const source = readFileSync(sample, 'utf8');
42
+
43
+ try { await Parser.init(); }
44
+ catch { await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') }); }
45
+
46
+ // Load a second, known-good grammar — the corruption surfaces under the
47
+ // multi-grammar runtime that real indexing uses, not a single grammar in isolation.
48
+ try { await Language.load(require.resolve('tree-sitter-wasms/out/tree-sitter-python.wasm')); } catch { /* ok */ }
49
+
50
+ let language;
51
+ try { language = await Language.load(wasmPath); }
52
+ catch (e) { fail(2, `failed to load ${wasmPath}: ${e.message}`); }
53
+
54
+ const parser = new Parser();
55
+ parser.setLanguage(language);
56
+
57
+ let ok = 0, err = 0;
58
+ for (let i = 0; i < iters; i++) {
59
+ const tree = parser.parse(source);
60
+ if (tree.rootNode.hasError) err++; else ok++;
61
+ }
62
+
63
+ console.log(`grammar: ${wasmPath.split('/').pop()}`);
64
+ console.log(` ABI version: ${language.abiVersion}`);
65
+ console.log(` parses: ${ok} clean / ${err} with errors (of ${iters})`);
66
+ if (err > 0) {
67
+ console.log(
68
+ `RESULT: FAIL — ${err}/${iters} parses produced ERROR trees on a valid sample. ` +
69
+ `This grammar corrupts under web-tree-sitter; vendor a newer (ABI 14/15) wasm ` +
70
+ `(see SKILL.md "Find a grammar"). Confirm your sample is syntactically valid first.`
71
+ );
72
+ process.exit(1);
73
+ }
74
+ console.log('RESULT: PASS — grammar parses cleanly and reuses safely.');
75
+ process.exit(0);
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env node
2
+ // Dump the tree-sitter AST for a sample file so you can write a LanguageExtractor
3
+ // mapping. Loads a grammar .wasm directly via web-tree-sitter (the same runtime
4
+ // codegraph uses) — you do NOT need to register the language first.
5
+ //
6
+ // Usage:
7
+ // node scripts/add-lang/dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]
8
+ // Examples:
9
+ // node scripts/add-lang/dump-ast.mjs lua sample.lua
10
+ // node scripts/add-lang/dump-ast.mjs src/extraction/wasm/tree-sitter-zig.wasm a.zig --depth=4
11
+ //
12
+ // Output: an indented AST (named nodes, with field names) followed by a
13
+ // node-type FREQUENCY table. The frequency table is the payoff — it tells you
14
+ // which node types to map to functionTypes / classTypes / importTypes / etc.
15
+
16
+ import { readFileSync, existsSync } from 'node:fs';
17
+ import { createRequire } from 'node:module';
18
+ import { Parser, Language } from 'web-tree-sitter';
19
+
20
+ const require = createRequire(import.meta.url);
21
+ const fail = (msg) => { console.error(`[dump-ast] ${msg}`); process.exit(1); };
22
+
23
+ const argv = process.argv.slice(2);
24
+ const positional = argv.filter((a) => !a.startsWith('--'));
25
+ const [langOrWasm, sampleFile] = positional;
26
+ const depthFlag = argv.find((a) => a.startsWith('--depth='));
27
+ const showAll = argv.includes('--full'); // also print anonymous (token) nodes
28
+ const maxDepth = depthFlag ? parseInt(depthFlag.split('=')[1], 10) : (showAll ? Infinity : 8);
29
+
30
+ if (!langOrWasm || !sampleFile) {
31
+ fail('usage: dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]');
32
+ }
33
+ if (!existsSync(sampleFile)) fail(`sample file not found: ${sampleFile}`);
34
+
35
+ // Language tokens whose tree-sitter-wasms filename differs from the token.
36
+ const WASM_SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
37
+
38
+ function resolveWasm(token) {
39
+ if (token.endsWith('.wasm')) {
40
+ if (!existsSync(token)) fail(`wasm not found: ${token}`);
41
+ return token;
42
+ }
43
+ const base = WASM_SPECIAL[token.toLowerCase()] ?? token.toLowerCase();
44
+ try {
45
+ return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`);
46
+ } catch {
47
+ /* not in tree-sitter-wasms — try a vendored copy */
48
+ }
49
+ const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
50
+ if (existsSync(vendored)) return vendored;
51
+ fail(
52
+ `no grammar for "${token}" — not in tree-sitter-wasms and not vendored at ` +
53
+ `${vendored}. Pass an explicit .wasm path, or vendor one (see SKILL.md "Find a grammar").`
54
+ );
55
+ }
56
+
57
+ const wasmPath = resolveWasm(langOrWasm);
58
+ const source = readFileSync(sampleFile, 'utf8');
59
+
60
+ try {
61
+ await Parser.init();
62
+ } catch {
63
+ await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') });
64
+ }
65
+
66
+ let language;
67
+ try {
68
+ language = await Language.load(wasmPath);
69
+ } catch (e) {
70
+ fail(`failed to load grammar ${wasmPath}: ${e.message}`);
71
+ }
72
+
73
+ const parser = new Parser();
74
+ parser.setLanguage(language);
75
+ const tree = parser.parse(source);
76
+
77
+ const freq = new Map();
78
+ const snippet = (node) => {
79
+ const t = node.text.replace(/\s+/g, ' ').trim();
80
+ return t.length > 48 ? `${t.slice(0, 48)}…` : t;
81
+ };
82
+
83
+ function walk(node, depth, fieldName) {
84
+ if (node.isNamed) freq.set(node.type, (freq.get(node.type) || 0) + 1);
85
+ if ((node.isNamed || showAll) && depth <= maxDepth) {
86
+ const field = fieldName ? `${fieldName}: ` : '';
87
+ const leaf = node.childCount === 0 ? ` "${snippet(node)}"` : '';
88
+ console.log(`${' '.repeat(depth)}${field}${node.type} @${node.startPosition.row + 1}:${node.startPosition.column}${leaf}`);
89
+ }
90
+ for (let i = 0; i < node.childCount; i++) {
91
+ const child = node.child(i);
92
+ if (child) walk(child, depth + 1, node.fieldNameForChild(i));
93
+ }
94
+ }
95
+
96
+ console.log(`\n# AST for ${sampleFile} (grammar: ${wasmPath.split('/').pop()})\n`);
97
+ walk(tree.rootNode, 0, null);
98
+
99
+ console.log('\n# Node-type frequency (named nodes) — map the relevant ones in your extractor:\n');
100
+ [...freq.entries()]
101
+ .sort((a, b) => b[1] - a[1])
102
+ .forEach(([type, n]) => console.log(` ${String(n).padStart(5)} ${type}`));
103
+ console.log();
@@ -0,0 +1,70 @@
1
+ #!/usr/bin/env node
2
+ // Sanity-check that codegraph extracted REAL symbols (not just file/import nodes)
3
+ // from a repo for a given language. Exits non-zero on a critical failure so it
4
+ // can drive a write-extractor -> build -> re-check loop.
5
+ //
6
+ // Usage: node scripts/add-lang/verify-extraction.mjs <repo-path> <lang>
7
+ // Reads `codegraph status <repo> --json` using whatever codegraph is on PATH,
8
+ // so it reflects the binary that built the index.
9
+ //
10
+ // Exit codes: 0 = pass or soft-warn, 1 = critical fail, 2 = could not run.
11
+
12
+ import { execFileSync } from 'node:child_process';
13
+
14
+ const [repo, lang] = process.argv.slice(2);
15
+ if (!repo || !lang) {
16
+ console.error('usage: verify-extraction.mjs <repo-path> <lang>');
17
+ process.exit(2);
18
+ }
19
+
20
+ let status;
21
+ try {
22
+ const out = execFileSync('codegraph', ['status', repo, '--json'], { encoding: 'utf8' });
23
+ status = JSON.parse(out);
24
+ } catch (e) {
25
+ console.error(`[verify] could not read codegraph status for ${repo}: ${e.message}`);
26
+ process.exit(2);
27
+ }
28
+
29
+ // Kinds that prove the extractor mapped AST node types (everything except
30
+ // 'file' and 'import', which codegraph creates structurally for any language).
31
+ const SYMBOL_KINDS = new Set([
32
+ 'module', 'class', 'struct', 'interface', 'trait', 'protocol', 'function',
33
+ 'method', 'property', 'field', 'variable', 'constant', 'enum', 'enum_member',
34
+ 'type_alias', 'namespace', 'route', 'component',
35
+ ]);
36
+
37
+ const byKind = status.nodesByKind || {};
38
+ const langs = status.languages || [];
39
+ const files = status.fileCount || 0;
40
+ const edges = status.edgeCount || 0;
41
+ const symbolKinds = Object.keys(byKind).filter((k) => SYMBOL_KINDS.has(k));
42
+ const symbolCount = symbolKinds.reduce((s, k) => s + byKind[k], 0);
43
+
44
+ const checks = [];
45
+ const add = (severity, ok, label, detail) => checks.push({ severity, ok, label, detail });
46
+
47
+ add('critical', status.initialized === true, 'index initialized', `initialized=${status.initialized}`);
48
+ add('critical', langs.includes(lang), `language "${lang}" detected`, `languages=[${langs.join(', ')}]`);
49
+ add('critical', symbolCount > 0, 'structural symbols extracted', `${symbolCount} symbols (${symbolKinds.join(', ') || 'NONE — only file/import nodes!'})`);
50
+ add('soft', symbolCount >= files, 'symbol density >= 1/file', `${symbolCount} symbols across ${files} files`);
51
+ add('soft', edges > files, 'edges resolved', `${edges} edges across ${files} files`);
52
+
53
+ console.log(`\n# Extraction check — ${repo} (lang=${lang}, backend=${status.backend})`);
54
+ console.log(` files=${files} nodes=${status.nodeCount} edges=${edges}`);
55
+ console.log(` nodesByKind: ${JSON.stringify(byKind)}\n`);
56
+ for (const c of checks) console.log(` ${c.ok ? '✓' : '✗'} ${c.label} — ${c.detail}`);
57
+
58
+ const critical = checks.filter((c) => !c.ok && c.severity === 'critical');
59
+ const soft = checks.filter((c) => !c.ok && c.severity === 'soft');
60
+ console.log();
61
+ if (critical.length) {
62
+ console.log(`RESULT: FAIL (${critical.length} critical) — extractor or grammar wiring is broken. Re-run dump-ast.mjs and fix the node-type mappings.`);
63
+ process.exit(1);
64
+ }
65
+ if (soft.length) {
66
+ console.log(`RESULT: WARN (${soft.length} soft) — extraction works but looks thin; inspect the counts above.`);
67
+ process.exit(0);
68
+ }
69
+ console.log('RESULT: PASS — extraction looks healthy.');
70
+ process.exit(0);
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env bash
2
+ # Arm F (body-inlining trace + trace-first steering) across the same 6 repos as
3
+ # arms-matrix.sh, so F vs B isolates the trace-enrichment effect (same surface,
4
+ # old thin trace in B vs body-inlining trace here).
5
+ set -uo pipefail
6
+ H="$(cd "$(dirname "$0")" && pwd)"; RUNS="${RUNS:-2}"; C="${CORPUS:-/tmp/codegraph-corpus}"
7
+ ROWS=(
8
+ "$C/flutter-samples/add_to_app/books/flutter_module_books|How does the books UI build and what child widgets does it show?"
9
+ "$C/aspnet-realworld|How is creating an article handled? Trace the controller to the service."
10
+ "$C/spring-mall|How is a product-list request handled? Trace the controller to the service."
11
+ "$C/vapor-spi|How is a package-show request handled? Name the route and controller."
12
+ "$C/excalidraw|How does updating an element re-render the canvas on screen? Trace the flow."
13
+ "$C/spring-halo|How is publishing a post handled? Trace the controller to the service."
14
+ )
15
+ ARM="${ARM:-F}"
16
+ echo "### ARM $ARM START $(date) RUNS=$RUNS"
17
+ for row in "${ROWS[@]}"; do
18
+ repo="${row%%|*}"; q="${row#*|}"
19
+ for r in $(seq 1 "$RUNS"); do bash "$H/run-arms.sh" "$repo" "$q" "$ARM" "$r"; done
20
+ done
21
+ echo "### ARM $ARM COMPLETE $(date)"
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env bash
2
+ # Drive the tool-surface ablation across the chosen repos × arms (A–E).
3
+ # Arms A–D ask the canonical FLOW question; arm E asks a NON-flow survey
4
+ # question (the control probe — should degrade without explore+context).
5
+ # Output: /tmp/arms/<repo>/<arm>-r<n>.jsonl (parse with parse-arms.mjs).
6
+ set -uo pipefail
7
+ HARNESS="$(cd "$(dirname "$0")" && pwd)"
8
+ RUNS="${RUNS:-2}"
9
+ C="${CORPUS:-/tmp/codegraph-corpus}"
10
+ NFQ='What are the main modules/components of this codebase and what does each one do? Give an overview of how it is organized.'
11
+
12
+ # repo-path|flow-question (2 small, 2 medium, 2 large — spans the size range)
13
+ ROWS=(
14
+ "$C/flutter-samples/add_to_app/books/flutter_module_books|How does the books UI build and what child widgets does it show?"
15
+ "$C/aspnet-realworld|How is creating an article handled? Trace the controller to the service."
16
+ "$C/spring-mall|How is a product-list request handled? Trace the controller to the service."
17
+ "$C/vapor-spi|How is a package-show request handled? Name the route and controller."
18
+ "$C/excalidraw|How does updating an element re-render the canvas on screen? Trace the flow."
19
+ "$C/spring-halo|How is publishing a post handled? Trace the controller to the service."
20
+ )
21
+
22
+ echo "### ARMS MATRIX START $(date) RUNS=$RUNS"
23
+ for row in "${ROWS[@]}"; do
24
+ repo="${row%%|*}"; q="${row#*|}"
25
+ for arm in A B C D; do
26
+ for r in $(seq 1 "$RUNS"); do
27
+ bash "$HARNESS/run-arms.sh" "$repo" "$q" "$arm" "$r"
28
+ done
29
+ done
30
+ done
31
+ # E: non-flow control probe on two repos (must degrade without explore+context)
32
+ for repo in "$C/excalidraw" "$C/spring-mall"; do
33
+ for r in $(seq 1 "$RUNS"); do
34
+ bash "$HARNESS/run-arms.sh" "$repo" "$NFQ" E "$r"
35
+ done
36
+ done
37
+ echo "### ARMS MATRIX COMPLETE $(date)"
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env bash
2
+ # One-shot CodeGraph quality audit:
3
+ # set version -> ensure corpus repo -> wipe+reindex with that version ->
4
+ # run with/without A/B -> restore the local dev link.
5
+ #
6
+ # Usage: audit.sh <version> <repo-name> <repo-url> "<question>" [headless|all]
7
+ # <version> "local" (build + npm link this repo) | "latest" | a version (e.g. 0.7.10)
8
+ # <repo-name> dir name under the corpus dir
9
+ # <repo-url> git URL (cloned --depth 1 when the repo dir is missing)
10
+ # [mode] headless (default) | all (also the interactive tmux arms)
11
+ # Env: CORPUS corpus dir (default: /tmp/codegraph-corpus)
12
+ set -uo pipefail
13
+
14
+ VERSION="${1:?usage: audit.sh <version> <repo-name> <repo-url> \"<question>\" [mode]}"
15
+ NAME="${2:?repo-name required}"
16
+ URL="${3:?repo-url required}"
17
+ Q="${4:?question required}"
18
+ MODE="${5:-headless}"
19
+
20
+ HARNESS="$(cd "$(dirname "$0")" && pwd)"
21
+ REPO_ROOT="$(cd "$HARNESS/../.." && pwd)" # codegraph repo root
22
+ CORPUS="${CORPUS:-/tmp/codegraph-corpus}"
23
+ REPO="$CORPUS/$NAME"
24
+ PKG="@colbymchenry/codegraph"
25
+
26
+ echo "==================== CodeGraph audit ===================="
27
+ echo "version=$VERSION repo=$NAME mode=$MODE corpus=$CORPUS"
28
+ echo
29
+
30
+ # 1. Set the codegraph version under test (mutates the global install).
31
+ if [ "$VERSION" = local ]; then
32
+ echo "→ [1/4] building + linking local dev build (local-install.sh)"
33
+ ( cd "$REPO_ROOT" && ./scripts/local-install.sh ) || { echo "local-install.sh failed"; exit 1; }
34
+ else
35
+ echo "→ [1/4] installing $PKG@$VERSION globally"
36
+ npm install -g "$PKG@$VERSION" || { echo "npm install -g $PKG@$VERSION failed"; exit 1; }
37
+ fi
38
+ ACTUAL="$(codegraph --version 2>/dev/null || echo '?')"
39
+ echo " codegraph on PATH: $(command -v codegraph) -> $ACTUAL"
40
+
41
+ # 2. Ensure the corpus repo exists (clone shallow if missing, reuse if present).
42
+ mkdir -p "$CORPUS"
43
+ if [ -d "$REPO/.git" ]; then
44
+ echo "→ [2/4] reusing existing checkout: $REPO"
45
+ else
46
+ echo "→ [2/4] cloning $URL"
47
+ git clone --depth 1 "$URL" "$REPO" || { echo "git clone failed"; exit 1; }
48
+ fi
49
+
50
+ # 3. Wipe + re-index with THIS version (the index must be built by the same
51
+ # binary that serves it — different versions extract differently).
52
+ echo "→ [3/4] wiping .codegraph and re-indexing with $ACTUAL"
53
+ rm -rf "$REPO/.codegraph"
54
+ ( cd "$REPO" && codegraph init -i ) || { echo "indexing failed"; exit 1; }
55
+
56
+ # 4. Run the with/without A/B.
57
+ echo "→ [4/4] running A/B harness (mode=$MODE)"
58
+ bash "$HARNESS/run-all.sh" "$REPO" "$Q" "$MODE"
59
+
60
+ # Restore the dev link (the normal working state in this repo).
61
+ echo
62
+ echo "→ restoring local dev link (local-install.sh)"
63
+ if ( cd "$REPO_ROOT" && ./scripts/local-install.sh >/dev/null 2>&1 ); then
64
+ echo " global codegraph restored to dev build"
65
+ else
66
+ echo " WARN: restore failed — run ./scripts/local-install.sh manually"
67
+ fi
68
+ echo "==================== audit complete ===================="
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env bash
2
+ # Re-run the README "Benchmark Results" A/B (with vs without codegraph) on the
3
+ # current build: the 7 README repos, same queries, RUNS per arm (default 4).
4
+ # Output → /tmp/ab-readme/<repo>/run<n>/run-headless-{with,without}.jsonl
5
+ # Aggregate with parse-bench-readme.mjs. Repos must be cloned + indexed under
6
+ # $CORPUS (default /tmp/codegraph-corpus) by the build under test.
7
+ set -uo pipefail
8
+ H="$(cd "$(dirname "$0")" && pwd)"
9
+ C="${CORPUS:-/tmp/codegraph-corpus}"
10
+ RUNS="${RUNS:-4}"
11
+ ROWS=(
12
+ "vscode|How does the extension host communicate with the main process?"
13
+ "excalidraw|How does Excalidraw render and update canvas elements?"
14
+ "django|How does Django's ORM build and execute a query from a QuerySet?"
15
+ "tokio|How does tokio schedule and run async tasks on its runtime?"
16
+ "okhttp|How does OkHttp process a request through its interceptor chain?"
17
+ "gin|How does gin route requests through its middleware chain?"
18
+ "alamofire|How does Alamofire build, send, and validate a request?"
19
+ )
20
+ echo "### README A/B START $(date) RUNS=$RUNS"
21
+ for row in "${ROWS[@]}"; do
22
+ repo="${row%%|*}"; q="${row#*|}"
23
+ echo "===== $repo ====="
24
+ for run in $(seq 1 "$RUNS"); do
25
+ AGENT_EVAL_OUT="/tmp/ab-readme/$repo/run$run" bash "$H/run-all.sh" "$C/$repo" "$q" headless 2>&1 | grep -E "exit [0-9]" || echo " run$run: (no exit line)"
26
+ done
27
+ done
28
+ echo "### README A/B DONE $(date)"
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env bash
2
+ # PreToolUse hook (experiment): deny Read of codegraph-indexed source files and
3
+ # steer the agent to codegraph_explore/codegraph_node instead. Tests whether
4
+ # codegraph can FULLY replace Read for code-understanding once the escape hatch
5
+ # is removed. Non-source reads (config, .env, markdown, new files) pass through.
6
+ #
7
+ # Wire via: claude ... --settings scripts/agent-eval/hook-settings.json
8
+ set -uo pipefail
9
+ input="$(cat)"
10
+ fp="$(printf '%s' "$input" | jq -r '.tool_input.file_path // empty' 2>/dev/null)"
11
+
12
+ case "$fp" in
13
+ *.ts|*.tsx|*.js|*.jsx|*.mjs|*.cjs|*.py|*.go|*.rs|*.java|*.rb|*.php|*.swift|*.kt|*.kts|*.c|*.cc|*.cpp|*.h|*.hpp|*.cs|*.lua|*.vue|*.svelte)
14
+ msg="Read is disabled for source files in this session — codegraph already has this file indexed (with line numbers, kept in sync on every change). Use codegraph_explore (several related symbols at once) or codegraph_node (one symbol's full source). If a symbol you need wasn't in a prior explore, run ANOTHER codegraph_explore with its exact name instead of reading the file."
15
+ jq -n --arg m "$msg" '{reason:$m, hookSpecificOutput:{hookEventName:"PreToolUse",permissionDecision:"deny",permissionDecisionReason:$m}}'
16
+ exit 0
17
+ ;;
18
+ esac
19
+ exit 0
@@ -0,0 +1,15 @@
1
+ {
2
+ "hooks": {
3
+ "PreToolUse": [
4
+ {
5
+ "matcher": "Read",
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash /Users/colby/Development/Personal/codegraph/scripts/agent-eval/block-read-hook.sh"
10
+ }
11
+ ]
12
+ }
13
+ ]
14
+ }
15
+ }
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env bash
2
+ # Drive an INTERACTIVE Claude Code session in tmux, send a prompt, wait for the
3
+ # agent to finish, then print the tool-call breakdown from the session logs.
4
+ #
5
+ # Why interactive (not `claude -p`): headless print-mode picks the
6
+ # general-purpose subagent, while real interactive sessions delegate to the
7
+ # Explore subagent (or drive codegraph from the main thread). Only the
8
+ # interactive TUI reproduces the behavior users actually see. (Idle-detection
9
+ # technique borrowed from devpit's WaitForIdle.)
10
+ #
11
+ # Usage: itrun.sh <repo-path> <label> "<prompt>"
12
+ # Output dir: $AGENT_EVAL_OUT (default /tmp/agent-eval)
13
+ # Requires: tmux 3.0+, a logged-in `claude` CLI, codegraph MCP configured.
14
+ set -uo pipefail
15
+ REPO="$1"; LABEL="$2"; PROMPT="$3"
16
+ SESSION="cgt_${LABEL}"
17
+ OUT_DIR="${AGENT_EVAL_OUT:-/tmp/agent-eval}"; mkdir -p "$OUT_DIR"
18
+ OUT="$OUT_DIR/itrun-${LABEL}.txt"
19
+ HERE="$(cd "$(dirname "$0")" && pwd)"
20
+
21
+ cap() { tmux capture-pane -p -t "$SESSION" -S -40; }
22
+
23
+ tmux kill-session -t "$SESSION" 2>/dev/null
24
+
25
+ # Wide pane so the TUI doesn't hard-wrap tool lines.
26
+ tmux new-session -d -s "$SESSION" -x 230 -y 60
27
+ tmux send-keys -t "$SESSION" "cd $REPO && claude --dangerously-skip-permissions ${CLAUDE_EXTRA_ARGS:-}" Enter
28
+
29
+ # Wait for the ❯ prompt (claude drew its UI), up to 60s. NOTE: ❯ appears on the
30
+ # welcome screen seconds before the input actually accepts keystrokes, so this is
31
+ # necessary but NOT sufficient — the type-and-verify loop below is what proves
32
+ # the input is live.
33
+ ready=0
34
+ for _ in $(seq 1 120); do
35
+ cap | grep -q "❯" && { ready=1; break; }
36
+ sleep 0.5
37
+ done
38
+ [ "$ready" = 1 ] || { echo "claude never drew its UI"; cap; tmux kill-session -t "$SESSION" 2>/dev/null; exit 1; }
39
+
40
+ # Accept the per-folder "Is this a project you trust?" dialog if it shows (first
41
+ # time claude opens a given repo). Option 1 ("Yes, I trust this folder") is
42
+ # pre-selected, so Enter accepts. This dialog also contains ❯, so it must be
43
+ # cleared before the type-and-verify loop or keystrokes land on the menu.
44
+ for _ in $(seq 1 20); do
45
+ cap | grep -q "trust this folder" || break
46
+ tmux send-keys -t "$SESSION" Enter
47
+ sleep 1
48
+ done
49
+
50
+ # Type-and-verify: send the prompt, confirm a distinctive chunk of it actually
51
+ # landed in the input box, retry if it didn't (handles the early-❯ race where
52
+ # the welcome screen shows the prompt glyph but MCP init is still eating keys).
53
+ needle="${PROMPT:0:24}"
54
+ typed=0
55
+ for _ in $(seq 1 30); do
56
+ tmux send-keys -l -t "$SESSION" "$PROMPT"
57
+ sleep 1
58
+ if cap | grep -Fq "$needle"; then typed=1; break; fi
59
+ # Clear whatever partial text may have landed, then retry.
60
+ tmux send-keys -t "$SESSION" C-u
61
+ sleep 1
62
+ done
63
+ [ "$typed" = 1 ] || { echo "prompt never landed in the input box"; cap; tmux kill-session -t "$SESSION" 2>/dev/null; exit 1; }
64
+ sleep 0.5
65
+ tmux send-keys -t "$SESSION" Enter
66
+
67
+ # Busy signals. The robust one is the spinner's elapsed-time-in-parens, which
68
+ # EVERY working state shows — both the pre-stream thinking phase
69
+ # "(8s · thinking with max effort)" and the streaming phase
70
+ # "(24s · ↑ 2.5k tokens · …)", and it survives the 32s→"1m 3s" rollover. We OR
71
+ # in the token arrows, "esc to interrupt", and "Initializing" as belt-and-braces
72
+ # (some TUI versions/states show one but not the others).
73
+ BUSY_RE='esc to interrupt|↓ [0-9]|↑ [0-9]|Initializing|\(([0-9]+m )?[0-9]+s ·'
74
+
75
+ # Wait for work to START (busy indicator appears), up to 60s. If it never starts,
76
+ # fail loudly rather than silently reporting an empty run.
77
+ started=0
78
+ for _ in $(seq 1 120); do
79
+ cap | grep -qE "$BUSY_RE" && { started=1; break; }
80
+ sleep 0.5
81
+ done
82
+ [ "$started" = 1 ] || { echo "agent never started working"; cap; tmux kill-session -t "$SESSION" 2>/dev/null; exit 1; }
83
+
84
+ # Poll for idle: not busy AND ❯ present, for 10 consecutive polls (~5s) to ride
85
+ # out mid-conversation thinking gaps that briefly drop the spinner. Up to ~15min.
86
+ consec=0
87
+ for _ in $(seq 1 1800); do
88
+ pane=$(cap)
89
+ if echo "$pane" | grep -qE "$BUSY_RE"; then
90
+ consec=0
91
+ elif echo "$pane" | grep -q "❯"; then
92
+ consec=$((consec+1)); [ "$consec" -ge 10 ] && break
93
+ else
94
+ consec=0
95
+ fi
96
+ sleep 0.5
97
+ done
98
+ sleep 1
99
+
100
+ tmux capture-pane -p -t "$SESSION" -S - > "$OUT"
101
+ echo "captured $(wc -l < "$OUT") lines -> $OUT"
102
+ grep -oE "Done \([^)]*\)" "$OUT" | tail -1
103
+ grep -oE "[0-9.]+k?/[0-9.]+M" "$OUT" | tail -1 | sed 's/^/Context /'
104
+ tmux kill-session -t "$SESSION" 2>/dev/null
105
+
106
+ # Clean tool breakdown from the session logs (main + subagents).
107
+ node "$HERE/parse-session.mjs" "$REPO" 2>/dev/null || true