kirograph 0.12.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 (434) hide show
  1. package/README.md +1171 -0
  2. package/dist/architecture/index.d.ts +11 -0
  3. package/dist/architecture/index.d.ts.map +1 -0
  4. package/dist/architecture/index.js +207 -0
  5. package/dist/architecture/index.js.map +7 -0
  6. package/dist/architecture/layers/csharp.d.ts +6 -0
  7. package/dist/architecture/layers/csharp.d.ts.map +1 -0
  8. package/dist/architecture/layers/csharp.js +100 -0
  9. package/dist/architecture/layers/csharp.js.map +7 -0
  10. package/dist/architecture/layers/elixir.js +116 -0
  11. package/dist/architecture/layers/elixir.js.map +7 -0
  12. package/dist/architecture/layers/go.d.ts +7 -0
  13. package/dist/architecture/layers/go.d.ts.map +1 -0
  14. package/dist/architecture/layers/go.js +117 -0
  15. package/dist/architecture/layers/go.js.map +7 -0
  16. package/dist/architecture/layers/index.d.ts +30 -0
  17. package/dist/architecture/layers/index.d.ts.map +1 -0
  18. package/dist/architecture/layers/index.js +100 -0
  19. package/dist/architecture/layers/index.js.map +7 -0
  20. package/dist/architecture/layers/java.d.ts +7 -0
  21. package/dist/architecture/layers/java.d.ts.map +1 -0
  22. package/dist/architecture/layers/java.js +119 -0
  23. package/dist/architecture/layers/java.js.map +7 -0
  24. package/dist/architecture/layers/python.d.ts +7 -0
  25. package/dist/architecture/layers/python.d.ts.map +1 -0
  26. package/dist/architecture/layers/python.js +111 -0
  27. package/dist/architecture/layers/python.js.map +7 -0
  28. package/dist/architecture/layers/ruby.d.ts +6 -0
  29. package/dist/architecture/layers/ruby.d.ts.map +1 -0
  30. package/dist/architecture/layers/ruby.js +95 -0
  31. package/dist/architecture/layers/ruby.js.map +7 -0
  32. package/dist/architecture/layers/rust.d.ts +6 -0
  33. package/dist/architecture/layers/rust.d.ts.map +1 -0
  34. package/dist/architecture/layers/rust.js +98 -0
  35. package/dist/architecture/layers/rust.js.map +7 -0
  36. package/dist/architecture/layers/types.d.ts +2 -0
  37. package/dist/architecture/layers/types.d.ts.map +1 -0
  38. package/dist/architecture/layers/types.js +17 -0
  39. package/dist/architecture/layers/types.js.map +7 -0
  40. package/dist/architecture/layers/typescript.d.ts +9 -0
  41. package/dist/architecture/layers/typescript.d.ts.map +1 -0
  42. package/dist/architecture/layers/typescript.js +143 -0
  43. package/dist/architecture/layers/typescript.js.map +7 -0
  44. package/dist/architecture/manifest/cargo.d.ts +3 -0
  45. package/dist/architecture/manifest/cargo.d.ts.map +1 -0
  46. package/dist/architecture/manifest/cargo.js +94 -0
  47. package/dist/architecture/manifest/cargo.js.map +7 -0
  48. package/dist/architecture/manifest/csproj.d.ts +3 -0
  49. package/dist/architecture/manifest/csproj.d.ts.map +1 -0
  50. package/dist/architecture/manifest/csproj.js +75 -0
  51. package/dist/architecture/manifest/csproj.js.map +7 -0
  52. package/dist/architecture/manifest/go.d.ts +3 -0
  53. package/dist/architecture/manifest/go.d.ts.map +1 -0
  54. package/dist/architecture/manifest/go.js +85 -0
  55. package/dist/architecture/manifest/go.js.map +7 -0
  56. package/dist/architecture/manifest/gradle.d.ts +3 -0
  57. package/dist/architecture/manifest/gradle.d.ts.map +1 -0
  58. package/dist/architecture/manifest/gradle.js +80 -0
  59. package/dist/architecture/manifest/gradle.js.map +7 -0
  60. package/dist/architecture/manifest/index.d.ts +12 -0
  61. package/dist/architecture/manifest/index.d.ts.map +1 -0
  62. package/dist/architecture/manifest/index.js +130 -0
  63. package/dist/architecture/manifest/index.js.map +7 -0
  64. package/dist/architecture/manifest/maven.d.ts +3 -0
  65. package/dist/architecture/manifest/maven.d.ts.map +1 -0
  66. package/dist/architecture/manifest/maven.js +76 -0
  67. package/dist/architecture/manifest/maven.js.map +7 -0
  68. package/dist/architecture/manifest/npm.d.ts +3 -0
  69. package/dist/architecture/manifest/npm.d.ts.map +1 -0
  70. package/dist/architecture/manifest/npm.js +103 -0
  71. package/dist/architecture/manifest/npm.js.map +7 -0
  72. package/dist/architecture/manifest/python.d.ts +3 -0
  73. package/dist/architecture/manifest/python.d.ts.map +1 -0
  74. package/dist/architecture/manifest/python.js +105 -0
  75. package/dist/architecture/manifest/python.js.map +7 -0
  76. package/dist/architecture/manifest/types.d.ts +2 -0
  77. package/dist/architecture/manifest/types.d.ts.map +1 -0
  78. package/dist/architecture/manifest/types.js +17 -0
  79. package/dist/architecture/manifest/types.js.map +7 -0
  80. package/dist/architecture/types.d.ts +91 -0
  81. package/dist/architecture/types.d.ts.map +1 -0
  82. package/dist/architecture/types.js +17 -0
  83. package/dist/architecture/types.js.map +7 -0
  84. package/dist/assets/logo.png +0 -0
  85. package/dist/banner.d.ts +6 -0
  86. package/dist/banner.d.ts.map +1 -0
  87. package/dist/banner.js +67 -0
  88. package/dist/banner.js.map +1 -0
  89. package/dist/bin/banner.d.ts +6 -0
  90. package/dist/bin/banner.d.ts.map +1 -0
  91. package/dist/bin/banner.js +88 -0
  92. package/dist/bin/banner.js.map +7 -0
  93. package/dist/bin/commands/affected.d.ts +3 -0
  94. package/dist/bin/commands/affected.d.ts.map +1 -0
  95. package/dist/bin/commands/affected.js +78 -0
  96. package/dist/bin/commands/affected.js.map +7 -0
  97. package/dist/bin/commands/architecture.d.ts +3 -0
  98. package/dist/bin/commands/architecture.d.ts.map +1 -0
  99. package/dist/bin/commands/architecture.js +125 -0
  100. package/dist/bin/commands/architecture.js.map +7 -0
  101. package/dist/bin/commands/caveman.js +136 -0
  102. package/dist/bin/commands/caveman.js.map +7 -0
  103. package/dist/bin/commands/context.d.ts +3 -0
  104. package/dist/bin/commands/context.d.ts.map +1 -0
  105. package/dist/bin/commands/context.js +81 -0
  106. package/dist/bin/commands/context.js.map +7 -0
  107. package/dist/bin/commands/coupling.d.ts +3 -0
  108. package/dist/bin/commands/coupling.d.ts.map +1 -0
  109. package/dist/bin/commands/coupling.js +164 -0
  110. package/dist/bin/commands/coupling.js.map +7 -0
  111. package/dist/bin/commands/dashboard.d.ts +3 -0
  112. package/dist/bin/commands/dashboard.d.ts.map +1 -0
  113. package/dist/bin/commands/dashboard.js +209 -0
  114. package/dist/bin/commands/dashboard.js.map +7 -0
  115. package/dist/bin/commands/dead-code.js +77 -0
  116. package/dist/bin/commands/dead-code.js.map +7 -0
  117. package/dist/bin/commands/export.js +2620 -0
  118. package/dist/bin/commands/export.js.map +7 -0
  119. package/dist/bin/commands/files.d.ts +3 -0
  120. package/dist/bin/commands/files.d.ts.map +1 -0
  121. package/dist/bin/commands/files.js +104 -0
  122. package/dist/bin/commands/files.js.map +7 -0
  123. package/dist/bin/commands/help.d.ts +4 -0
  124. package/dist/bin/commands/help.d.ts.map +1 -0
  125. package/dist/bin/commands/help.js +212 -0
  126. package/dist/bin/commands/help.js.map +7 -0
  127. package/dist/bin/commands/hotspots.js +77 -0
  128. package/dist/bin/commands/hotspots.js.map +7 -0
  129. package/dist/bin/commands/index.d.ts +3 -0
  130. package/dist/bin/commands/index.d.ts.map +1 -0
  131. package/dist/bin/commands/index.js +58 -0
  132. package/dist/bin/commands/index.js.map +7 -0
  133. package/dist/bin/commands/init.d.ts +3 -0
  134. package/dist/bin/commands/init.d.ts.map +1 -0
  135. package/dist/bin/commands/init.js +68 -0
  136. package/dist/bin/commands/init.js.map +7 -0
  137. package/dist/bin/commands/install.d.ts +3 -0
  138. package/dist/bin/commands/install.d.ts.map +1 -0
  139. package/dist/bin/commands/install.js +34 -0
  140. package/dist/bin/commands/install.js.map +7 -0
  141. package/dist/bin/commands/mark-dirty.d.ts +3 -0
  142. package/dist/bin/commands/mark-dirty.d.ts.map +1 -0
  143. package/dist/bin/commands/mark-dirty.js +51 -0
  144. package/dist/bin/commands/mark-dirty.js.map +7 -0
  145. package/dist/bin/commands/package.d.ts +3 -0
  146. package/dist/bin/commands/package.d.ts.map +1 -0
  147. package/dist/bin/commands/package.js +139 -0
  148. package/dist/bin/commands/package.js.map +7 -0
  149. package/dist/bin/commands/path.js +93 -0
  150. package/dist/bin/commands/path.js.map +7 -0
  151. package/dist/bin/commands/qdrant.d.ts +3 -0
  152. package/dist/bin/commands/qdrant.d.ts.map +1 -0
  153. package/dist/bin/commands/qdrant.js +159 -0
  154. package/dist/bin/commands/qdrant.js.map +1 -0
  155. package/dist/bin/commands/query.d.ts +3 -0
  156. package/dist/bin/commands/query.d.ts.map +1 -0
  157. package/dist/bin/commands/query.js +47 -0
  158. package/dist/bin/commands/query.js.map +7 -0
  159. package/dist/bin/commands/serve.d.ts +3 -0
  160. package/dist/bin/commands/serve.d.ts.map +1 -0
  161. package/dist/bin/commands/serve.js +59 -0
  162. package/dist/bin/commands/serve.js.map +7 -0
  163. package/dist/bin/commands/snapshot.js +122 -0
  164. package/dist/bin/commands/snapshot.js.map +7 -0
  165. package/dist/bin/commands/status.d.ts +3 -0
  166. package/dist/bin/commands/status.d.ts.map +1 -0
  167. package/dist/bin/commands/status.js +107 -0
  168. package/dist/bin/commands/status.js.map +7 -0
  169. package/dist/bin/commands/stop.d.ts +3 -0
  170. package/dist/bin/commands/stop.d.ts.map +1 -0
  171. package/dist/bin/commands/stop.js +81 -0
  172. package/dist/bin/commands/stop.js.map +1 -0
  173. package/dist/bin/commands/surprising.js +79 -0
  174. package/dist/bin/commands/surprising.js.map +7 -0
  175. package/dist/bin/commands/sync-if-dirty.d.ts +3 -0
  176. package/dist/bin/commands/sync-if-dirty.d.ts.map +1 -0
  177. package/dist/bin/commands/sync-if-dirty.js +67 -0
  178. package/dist/bin/commands/sync-if-dirty.js.map +7 -0
  179. package/dist/bin/commands/sync.d.ts +3 -0
  180. package/dist/bin/commands/sync.d.ts.map +1 -0
  181. package/dist/bin/commands/sync.js +81 -0
  182. package/dist/bin/commands/sync.js.map +7 -0
  183. package/dist/bin/commands/typesense.d.ts +3 -0
  184. package/dist/bin/commands/typesense.d.ts.map +1 -0
  185. package/dist/bin/commands/typesense.js +126 -0
  186. package/dist/bin/commands/typesense.js.map +1 -0
  187. package/dist/bin/commands/uninit.d.ts +4 -0
  188. package/dist/bin/commands/uninit.d.ts.map +1 -0
  189. package/dist/bin/commands/uninit.js +123 -0
  190. package/dist/bin/commands/uninit.js.map +7 -0
  191. package/dist/bin/commands/unlock.d.ts +3 -0
  192. package/dist/bin/commands/unlock.d.ts.map +1 -0
  193. package/dist/bin/commands/unlock.js +53 -0
  194. package/dist/bin/commands/unlock.js.map +7 -0
  195. package/dist/bin/commands/utils.d.ts +12 -0
  196. package/dist/bin/commands/utils.d.ts.map +1 -0
  197. package/dist/bin/commands/utils.js +56 -0
  198. package/dist/bin/commands/utils.js.map +7 -0
  199. package/dist/bin/installer/archive.js +230 -0
  200. package/dist/bin/installer/archive.js.map +7 -0
  201. package/dist/bin/installer/caveman.js +57 -0
  202. package/dist/bin/installer/caveman.js.map +7 -0
  203. package/dist/bin/installer/cli-agent.d.ts +15 -0
  204. package/dist/bin/installer/cli-agent.d.ts.map +1 -0
  205. package/dist/bin/installer/cli-agent.js +89 -0
  206. package/dist/bin/installer/cli-agent.js.map +7 -0
  207. package/dist/bin/installer/config-prompt.d.ts +13 -0
  208. package/dist/bin/installer/config-prompt.d.ts.map +1 -0
  209. package/dist/bin/installer/config-prompt.js +158 -0
  210. package/dist/bin/installer/config-prompt.js.map +7 -0
  211. package/dist/bin/installer/dashboard.d.ts +3 -0
  212. package/dist/bin/installer/dashboard.d.ts.map +1 -0
  213. package/dist/bin/installer/dashboard.js +149 -0
  214. package/dist/bin/installer/dashboard.js.map +7 -0
  215. package/dist/bin/installer/hooks.d.ts +5 -0
  216. package/dist/bin/installer/hooks.d.ts.map +1 -0
  217. package/dist/bin/installer/hooks.js +155 -0
  218. package/dist/bin/installer/hooks.js.map +7 -0
  219. package/dist/bin/installer/index.d.ts +11 -0
  220. package/dist/bin/installer/index.d.ts.map +1 -0
  221. package/dist/bin/installer/index.js +228 -0
  222. package/dist/bin/installer/index.js.map +7 -0
  223. package/dist/bin/installer/mcp.d.ts +5 -0
  224. package/dist/bin/installer/mcp.d.ts.map +1 -0
  225. package/dist/bin/installer/mcp.js +80 -0
  226. package/dist/bin/installer/mcp.js.map +7 -0
  227. package/dist/bin/installer/prompts.d.ts +28 -0
  228. package/dist/bin/installer/prompts.d.ts.map +1 -0
  229. package/dist/bin/installer/prompts.js +134 -0
  230. package/dist/bin/installer/prompts.js.map +7 -0
  231. package/dist/bin/installer/qdrant-dashboard.d.ts +4 -0
  232. package/dist/bin/installer/qdrant-dashboard.d.ts.map +1 -0
  233. package/dist/bin/installer/qdrant-dashboard.js +115 -0
  234. package/dist/bin/installer/qdrant-dashboard.js.map +7 -0
  235. package/dist/bin/installer/steering.d.ts +5 -0
  236. package/dist/bin/installer/steering.d.ts.map +1 -0
  237. package/dist/bin/installer/steering.js +283 -0
  238. package/dist/bin/installer/steering.js.map +7 -0
  239. package/dist/bin/kirograph.d.ts +6 -0
  240. package/dist/bin/kirograph.d.ts.map +1 -0
  241. package/dist/bin/kirograph.js +95 -0
  242. package/dist/bin/kirograph.js.map +7 -0
  243. package/dist/bin/progress.d.ts +14 -0
  244. package/dist/bin/progress.d.ts.map +1 -0
  245. package/dist/bin/progress.js +201 -0
  246. package/dist/bin/progress.js.map +7 -0
  247. package/dist/bin/ui.d.ts +11 -0
  248. package/dist/bin/ui.d.ts.map +1 -0
  249. package/dist/bin/ui.js +71 -0
  250. package/dist/bin/ui.js.map +7 -0
  251. package/dist/config.d.ts +48 -0
  252. package/dist/config.d.ts.map +1 -0
  253. package/dist/config.js +273 -0
  254. package/dist/config.js.map +7 -0
  255. package/dist/context/index.d.ts +61 -0
  256. package/dist/context/index.d.ts.map +1 -0
  257. package/dist/context/index.js +224 -0
  258. package/dist/context/index.js.map +7 -0
  259. package/dist/core/file-tree.d.ts +15 -0
  260. package/dist/core/file-tree.d.ts.map +1 -0
  261. package/dist/core/file-tree.js +69 -0
  262. package/dist/core/file-tree.js.map +7 -0
  263. package/dist/core/lock-manager.d.ts +20 -0
  264. package/dist/core/lock-manager.d.ts.map +1 -0
  265. package/dist/core/lock-manager.js +120 -0
  266. package/dist/core/lock-manager.js.map +7 -0
  267. package/dist/core/pipeline.d.ts +37 -0
  268. package/dist/core/pipeline.d.ts.map +1 -0
  269. package/dist/core/pipeline.js +375 -0
  270. package/dist/core/pipeline.js.map +7 -0
  271. package/dist/core/snapshot.js +141 -0
  272. package/dist/core/snapshot.js.map +7 -0
  273. package/dist/db/database.d.ts +133 -0
  274. package/dist/db/database.d.ts.map +1 -0
  275. package/dist/db/database.js +929 -0
  276. package/dist/db/database.js.map +7 -0
  277. package/dist/db/schema.sql +174 -0
  278. package/dist/errors.d.ts +49 -0
  279. package/dist/errors.d.ts.map +1 -0
  280. package/dist/errors.js +160 -0
  281. package/dist/errors.js.map +7 -0
  282. package/dist/extraction/extractor.d.ts +29 -0
  283. package/dist/extraction/extractor.d.ts.map +1 -0
  284. package/dist/extraction/extractor.js +764 -0
  285. package/dist/extraction/extractor.js.map +7 -0
  286. package/dist/extraction/grammars.d.ts +48 -0
  287. package/dist/extraction/grammars.d.ts.map +1 -0
  288. package/dist/extraction/grammars.js +166 -0
  289. package/dist/extraction/grammars.js.map +7 -0
  290. package/dist/extraction/languages.d.ts +9 -0
  291. package/dist/extraction/languages.d.ts.map +1 -0
  292. package/dist/extraction/languages.js +103 -0
  293. package/dist/extraction/languages.js.map +7 -0
  294. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  295. package/dist/frameworks/csharp.d.ts +8 -0
  296. package/dist/frameworks/csharp.d.ts.map +1 -0
  297. package/dist/frameworks/csharp.js +93 -0
  298. package/dist/frameworks/csharp.js.map +7 -0
  299. package/dist/frameworks/elixir.js +142 -0
  300. package/dist/frameworks/elixir.js.map +7 -0
  301. package/dist/frameworks/express.d.ts +8 -0
  302. package/dist/frameworks/express.d.ts.map +1 -0
  303. package/dist/frameworks/express.js +143 -0
  304. package/dist/frameworks/express.js.map +7 -0
  305. package/dist/frameworks/go.d.ts +8 -0
  306. package/dist/frameworks/go.d.ts.map +1 -0
  307. package/dist/frameworks/go.js +85 -0
  308. package/dist/frameworks/go.js.map +7 -0
  309. package/dist/frameworks/index.d.ts +30 -0
  310. package/dist/frameworks/index.d.ts.map +1 -0
  311. package/dist/frameworks/index.js +243 -0
  312. package/dist/frameworks/index.js.map +7 -0
  313. package/dist/frameworks/java.d.ts +8 -0
  314. package/dist/frameworks/java.d.ts.map +1 -0
  315. package/dist/frameworks/java.js +87 -0
  316. package/dist/frameworks/java.js.map +7 -0
  317. package/dist/frameworks/laravel.d.ts +9 -0
  318. package/dist/frameworks/laravel.d.ts.map +1 -0
  319. package/dist/frameworks/laravel.js +115 -0
  320. package/dist/frameworks/laravel.js.map +7 -0
  321. package/dist/frameworks/python.d.ts +10 -0
  322. package/dist/frameworks/python.d.ts.map +1 -0
  323. package/dist/frameworks/python.js +158 -0
  324. package/dist/frameworks/python.js.map +7 -0
  325. package/dist/frameworks/react.d.ts +9 -0
  326. package/dist/frameworks/react.d.ts.map +1 -0
  327. package/dist/frameworks/react.js +230 -0
  328. package/dist/frameworks/react.js.map +7 -0
  329. package/dist/frameworks/ruby.d.ts +8 -0
  330. package/dist/frameworks/ruby.d.ts.map +1 -0
  331. package/dist/frameworks/ruby.js +136 -0
  332. package/dist/frameworks/ruby.js.map +7 -0
  333. package/dist/frameworks/rust.d.ts +8 -0
  334. package/dist/frameworks/rust.d.ts.map +1 -0
  335. package/dist/frameworks/rust.js +82 -0
  336. package/dist/frameworks/rust.js.map +7 -0
  337. package/dist/frameworks/svelte.d.ts +8 -0
  338. package/dist/frameworks/svelte.d.ts.map +1 -0
  339. package/dist/frameworks/svelte.js +174 -0
  340. package/dist/frameworks/svelte.js.map +7 -0
  341. package/dist/frameworks/swift.d.ts +10 -0
  342. package/dist/frameworks/swift.d.ts.map +1 -0
  343. package/dist/frameworks/swift.js +151 -0
  344. package/dist/frameworks/swift.js.map +7 -0
  345. package/dist/frameworks/types.d.ts +37 -0
  346. package/dist/frameworks/types.d.ts.map +1 -0
  347. package/dist/frameworks/types.js +17 -0
  348. package/dist/frameworks/types.js.map +7 -0
  349. package/dist/graph/queries.d.ts +53 -0
  350. package/dist/graph/queries.d.ts.map +1 -0
  351. package/dist/graph/queries.js +224 -0
  352. package/dist/graph/queries.js.map +7 -0
  353. package/dist/graph/traversal.d.ts +35 -0
  354. package/dist/graph/traversal.d.ts.map +1 -0
  355. package/dist/graph/traversal.js +148 -0
  356. package/dist/graph/traversal.js.map +7 -0
  357. package/dist/index.d.ts +102 -0
  358. package/dist/index.d.ts.map +1 -0
  359. package/dist/index.js +303 -0
  360. package/dist/index.js.map +7 -0
  361. package/dist/installer/index.d.ts +10 -0
  362. package/dist/installer/index.d.ts.map +1 -0
  363. package/dist/installer/index.js +526 -0
  364. package/dist/installer/index.js.map +1 -0
  365. package/dist/mcp/server.d.ts +16 -0
  366. package/dist/mcp/server.d.ts.map +1 -0
  367. package/dist/mcp/server.js +116 -0
  368. package/dist/mcp/server.js.map +7 -0
  369. package/dist/mcp/tools.d.ts +37 -0
  370. package/dist/mcp/tools.d.ts.map +1 -0
  371. package/dist/mcp/tools.js +779 -0
  372. package/dist/mcp/tools.js.map +7 -0
  373. package/dist/mcp/transport.d.ts +29 -0
  374. package/dist/mcp/transport.d.ts.map +1 -0
  375. package/dist/mcp/transport.js +70 -0
  376. package/dist/mcp/transport.js.map +7 -0
  377. package/dist/resolution/index.d.ts +56 -0
  378. package/dist/resolution/index.d.ts.map +1 -0
  379. package/dist/resolution/index.js +384 -0
  380. package/dist/resolution/index.js.map +7 -0
  381. package/dist/resolution/name-matcher.d.ts +25 -0
  382. package/dist/resolution/name-matcher.d.ts.map +1 -0
  383. package/dist/resolution/name-matcher.js +60 -0
  384. package/dist/resolution/name-matcher.js.map +7 -0
  385. package/dist/scripts/postinstall.js +64 -0
  386. package/dist/search/query-utils.d.ts +21 -0
  387. package/dist/search/query-utils.d.ts.map +1 -0
  388. package/dist/search/query-utils.js +219 -0
  389. package/dist/search/query-utils.js.map +7 -0
  390. package/dist/search/searcher.d.ts +15 -0
  391. package/dist/search/searcher.d.ts.map +1 -0
  392. package/dist/search/searcher.js +49 -0
  393. package/dist/search/searcher.js.map +7 -0
  394. package/dist/sync/index.d.ts +33 -0
  395. package/dist/sync/index.d.ts.map +1 -0
  396. package/dist/sync/index.js +200 -0
  397. package/dist/sync/index.js.map +7 -0
  398. package/dist/types.d.ts +131 -0
  399. package/dist/types.d.ts.map +1 -0
  400. package/dist/types.js +37 -0
  401. package/dist/types.js.map +7 -0
  402. package/dist/utils.d.ts +52 -0
  403. package/dist/utils.d.ts.map +1 -0
  404. package/dist/utils.js +254 -0
  405. package/dist/utils.js.map +7 -0
  406. package/dist/vectors/index.d.ts +71 -0
  407. package/dist/vectors/index.d.ts.map +1 -0
  408. package/dist/vectors/index.js +480 -0
  409. package/dist/vectors/index.js.map +7 -0
  410. package/dist/vectors/lancedb-index.d.ts +50 -0
  411. package/dist/vectors/lancedb-index.d.ts.map +1 -0
  412. package/dist/vectors/lancedb-index.js +153 -0
  413. package/dist/vectors/lancedb-index.js.map +7 -0
  414. package/dist/vectors/orama-index.d.ts +54 -0
  415. package/dist/vectors/orama-index.d.ts.map +1 -0
  416. package/dist/vectors/orama-index.js +213 -0
  417. package/dist/vectors/orama-index.js.map +7 -0
  418. package/dist/vectors/pglite-index.d.ts +53 -0
  419. package/dist/vectors/pglite-index.d.ts.map +1 -0
  420. package/dist/vectors/pglite-index.js +194 -0
  421. package/dist/vectors/pglite-index.js.map +7 -0
  422. package/dist/vectors/qdrant-index.d.ts +70 -0
  423. package/dist/vectors/qdrant-index.d.ts.map +1 -0
  424. package/dist/vectors/qdrant-index.js +364 -0
  425. package/dist/vectors/qdrant-index.js.map +7 -0
  426. package/dist/vectors/typesense-index.d.ts +75 -0
  427. package/dist/vectors/typesense-index.d.ts.map +1 -0
  428. package/dist/vectors/typesense-index.js +453 -0
  429. package/dist/vectors/typesense-index.js.map +7 -0
  430. package/dist/vectors/vec-index.d.ts +52 -0
  431. package/dist/vectors/vec-index.d.ts.map +1 -0
  432. package/dist/vectors/vec-index.js +198 -0
  433. package/dist/vectors/vec-index.js.map +7 -0
  434. package/package.json +67 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/extraction/extractor.ts"],
4
+ "sourcesContent": ["/**\n * Symbol extractor using web-tree-sitter\n * Parses source files and extracts nodes + edges into the graph.\n * Handles functions, classes, methods, variables, constants, and imports.\n */\n\nimport * as path from 'path';\nimport * as fs from 'fs';\nimport * as crypto from 'crypto';\nimport type { Node, Edge, NodeKind, Language } from '../types';\nimport { detectLanguage, isSupportedLanguage } from './languages';\nimport { initGrammars, getParser, hasWasmGrammar } from './grammars';\n\nexport interface UnresolvedRef {\n sourceId: string;\n refName: string;\n refKind: 'function' | 'import' | 'extends' | 'implements';\n line: number;\n column: number;\n}\n\nexport interface ExtractedFile {\n filePath: string;\n language: Language;\n contentHash: string;\n fileSize: number;\n nodes: Node[];\n edges: Edge[];\n unresolvedRefs: UnresolvedRef[];\n}\n\nexport function makeNodeId(filePath: string, kind: string, name: string, line: number): string {\n const hash = crypto.createHash('sha256').update(`${filePath}:${kind}:${name}:${line}`).digest('hex').slice(0, 32);\n return `${kind}:${hash}`;\n}\n\n/** Validate that filePath stays within projectRoot to prevent path traversal. */\nfunction validatePath(filePath: string, projectRoot: string): boolean {\n try {\n const real = fs.realpathSync(filePath);\n const realRoot = fs.realpathSync(projectRoot);\n return real.startsWith(realRoot + path.sep) || real === realRoot;\n } catch {\n // If we can't resolve, check with normalize\n const normalized = path.resolve(filePath);\n return normalized.startsWith(path.resolve(projectRoot));\n }\n}\n\n/**\n * Extract symbols from a single file.\n * Optionally accepts pre-read content for batch I/O efficiency.\n */\nexport async function extractFile(filePath: string, projectRoot: string, content?: Buffer | string): Promise<ExtractedFile | null> {\n const language = detectLanguage(filePath);\n if (!isSupportedLanguage(language)) return null;\n\n // Path traversal protection\n if (!validatePath(filePath, projectRoot)) return null;\n\n let source: string;\n try {\n if (content !== undefined) {\n source = typeof content === 'string' ? content : content.toString('utf8');\n } else {\n source = fs.readFileSync(filePath, 'utf8');\n }\n } catch {\n return null;\n }\n\n const contentHash = crypto.createHash('sha256').update(source).digest('hex');\n const fileSize = Buffer.byteLength(source, 'utf8');\n const relPath = path.relative(projectRoot, filePath).replace(/\\\\/g, '/');\n\n await initGrammars();\n const parser = await getParser(language);\n if (!parser) {\n if (!hasWasmGrammar(language)) {\n // Language genuinely has no grammar (e.g. Liquid, unknown) \u2014 track file but no AST extraction\n return {\n filePath: relPath,\n language,\n contentHash,\n fileSize,\n nodes: [],\n edges: [],\n unresolvedRefs: [],\n };\n }\n // Grammar should exist but parser failed (likely WASM crash) \u2014 signal extraction failure\n throw new Error(`Parser unavailable for ${language} (WASM grammar exists but failed to load)`);\n }\n\n const tree = parser.parse(source);\n\n const nodes: Node[] = [];\n const edges: Edge[] = [];\n const unresolvedRefs: UnresolvedRef[] = [];\n const now = Date.now();\n\n walkTree(tree.rootNode, source, relPath, language, nodes, edges, unresolvedRefs, now);\n\n return { filePath: relPath, language, contentHash, fileSize, nodes, edges, unresolvedRefs };\n}\n\n// \u2500\u2500 Elixir helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ELIXIR_DEF_KINDS: Record<string, NodeKind> = {\n defmodule: 'module',\n def: 'function',\n defp: 'function',\n defmacro: 'function',\n defmacrop: 'function',\n defprotocol: 'interface',\n defimpl: 'class',\n defstruct: 'struct',\n};\n\nconst ELIXIR_IMPORT_TARGETS = new Set(['alias', 'import', 'require', 'use']);\n\nfunction elixirCallTarget(node: any, source: string): string | null {\n const target = node.childForFieldName?.('target') ?? node.child(0);\n if (!target) return null;\n return source.slice(target.startIndex, target.endIndex).trim() || null;\n}\n\nfunction elixirFirstArg(node: any): any | null {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'arguments') {\n return child.namedChild(0) ?? child.child(0) ?? null;\n }\n }\n return null;\n}\n\nfunction extractElixirName(node: any, source: string, kind: NodeKind): string | null {\n const firstArg = elixirFirstArg(node);\n if (!firstArg) return null;\n if (kind === 'module' || kind === 'interface' || kind === 'class') {\n return source.slice(firstArg.startIndex, firstArg.endIndex).trim();\n }\n if (kind === 'function') {\n if (firstArg.type === 'call') {\n const nameNode = firstArg.childForFieldName?.('target') ?? firstArg.child(0);\n if (nameNode) return source.slice(nameNode.startIndex, nameNode.endIndex).trim();\n }\n return source.slice(firstArg.startIndex, firstArg.endIndex).trim();\n }\n return null;\n}\n\nfunction extractElixirImportSource(node: any, source: string): string | null {\n const firstArg = elixirFirstArg(node);\n if (!firstArg) return null;\n return source.slice(firstArg.startIndex, firstArg.endIndex).trim() || null;\n}\n\nfunction walkElixirCall(\n node: any,\n source: string,\n filePath: string,\n language: Language,\n nodes: Node[],\n edges: Edge[],\n unresolvedRefs: UnresolvedRef[],\n now: number,\n parentId?: string\n): void {\n const targetText = elixirCallTarget(node, source);\n if (!targetText) {\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, parentId);\n }\n return;\n }\n\n if (ELIXIR_IMPORT_TARGETS.has(targetText)) {\n const modPath = extractElixirImportSource(node, source);\n if (modPath) {\n const id = makeNodeId(filePath, 'import', modPath, node.startPosition.row + 1);\n nodes.push({\n id, kind: 'import', name: modPath,\n qualifiedName: `${filePath}::import:${modPath}`,\n filePath, language,\n startLine: node.startPosition.row + 1,\n endLine: node.endPosition.row + 1,\n startColumn: node.startPosition.column,\n endColumn: node.endPosition.column,\n updatedAt: now,\n });\n unresolvedRefs.push({ sourceId: id, refName: modPath, refKind: 'import', line: node.startPosition.row + 1, column: node.startPosition.column });\n }\n return;\n }\n\n const defKind = ELIXIR_DEF_KINDS[targetText];\n if (defKind) {\n const name = extractElixirName(node, source, defKind);\n if (name) {\n const id = makeNodeId(filePath, defKind, name, node.startPosition.row + 1);\n const isPrivate = targetText === 'defp' || targetText === 'defmacrop';\n nodes.push({\n id, kind: defKind, name,\n qualifiedName: `${filePath}::${name}`,\n filePath, language,\n startLine: node.startPosition.row + 1,\n endLine: node.endPosition.row + 1,\n startColumn: node.startPosition.column,\n endColumn: node.endPosition.column,\n docstring: extractDocstring(node, source),\n signature: extractSignature(node, source, defKind),\n visibility: isPrivate ? 'private' : 'public',\n isExported: !isPrivate,\n updatedAt: now,\n });\n if (parentId) edges.push({ source: parentId, target: id, kind: 'contains' });\n collectCallRefs(node, source, id, unresolvedRefs);\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, id);\n }\n return;\n }\n }\n\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, parentId);\n }\n}\n\n// \u2500\u2500 Node type mappings \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/** AST node types that should be descended without creating a symbol node */\nconst TRANSPARENT_TYPES = new Set([\n 'export_statement', 'program', 'source_file', 'module', 'translation_unit',\n]);\n\n/** Mapping from tree-sitter node types to graph NodeKind */\nconst KIND_MAP: Record<string, NodeKind> = {\n // Functions\n function_declaration: 'function',\n function_expression: 'function',\n arrow_function: 'function',\n function_definition: 'function', // Python\n function_item: 'function', // Rust\n function_declaration_go: 'function',\n // Methods\n method_definition: 'method',\n method_declaration: 'method', // Go, Java, C#\n constructor_declaration: 'method', // Java, C#\n // Classes / structs\n class_declaration: 'class',\n class_expression: 'class',\n class_definition: 'class', // Python\n impl_item: 'class', // Rust (impl blocks)\n struct_item: 'struct', // Rust\n // Interfaces / traits\n interface_declaration: 'interface',\n trait_item: 'trait', // Rust\n protocol_declaration: 'interface', // Swift\n // Enums\n enum_declaration: 'enum',\n enum_item: 'enum', // Rust\n // Type aliases\n type_alias_declaration: 'type_alias',\n type_declaration: 'type_alias', // Go\n typealias_declaration: 'type_alias',// Swift\n type_item: 'type_alias', // Rust\n type_alias: 'type_alias', // Kotlin\n // Namespaces / modules\n namespace_declaration: 'namespace',\n // Variables / constants (language-specific, see extractVariableKind)\n lexical_declaration: 'variable', // TS/JS (const/let/var) \u2014 refined below\n variable_declaration: 'variable', // TS/JS (var)\n // Import statements (all handled via extractImport)\n};\n\n/** Refine variable declarations into 'variable' or 'constant' based on modifier */\nfunction extractVariableKind(node: any): NodeKind {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'const') return 'constant';\n }\n return 'variable';\n}\n\n/** Languages/node-types that represent import statements */\nconst IMPORT_NODE_TYPES = new Set([\n 'import_statement', // TS/JS\n 'import_from_statement', // Python\n 'import_declaration', // Go, Java\n 'use_declaration', // Rust\n 'using_directive', // C#\n 'namespace_use_declaration',// PHP\n 'import_header', // Kotlin\n 'import_or_export', // Dart\n 'include_statement', // Pascal\n 'preproc_include', // C/C++\n]);\n\n// \u2500\u2500 Main tree walker \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction walkTree(\n node: any,\n source: string,\n filePath: string,\n language: Language,\n nodes: Node[],\n edges: Edge[],\n unresolvedRefs: UnresolvedRef[],\n now: number,\n parentId?: string\n): void {\n if (TRANSPARENT_TYPES.has(node.type)) {\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, parentId);\n }\n return;\n }\n\n // Elixir: all definitions and imports are `call` nodes\n if (language === 'elixir' && node.type === 'call') {\n walkElixirCall(node, source, filePath, language, nodes, edges, unresolvedRefs, now, parentId);\n return;\n }\n\n // Handle import statements\n if (IMPORT_NODE_TYPES.has(node.type)) {\n const importNode = extractImport(node, source, filePath, language, unresolvedRefs, now, parentId);\n if (importNode) nodes.push(importNode);\n return; // Don't recurse into import nodes\n }\n\n let kind: NodeKind | null = KIND_MAP[node.type] ?? null;\n\n // Refine lexical_declaration into variable/constant\n if (node.type === 'lexical_declaration' || node.type === 'variable_declaration') {\n kind = extractVariableKind(node);\n }\n\n // Python/Go/Rust/Java/C# variable and constant types\n if (!kind) kind = getLanguageSpecificKind(node.type, language);\n\n if (kind) {\n const name = extractName(node, source, language, kind);\n if (name) {\n const id = makeNodeId(filePath, kind, name, node.startPosition.row + 1);\n const visibility = extractVisibility(node, source, language);\n const graphNode: Node = {\n id,\n kind,\n name,\n qualifiedName: `${filePath}::${name}`,\n filePath,\n language,\n startLine: node.startPosition.row + 1,\n endLine: node.endPosition.row + 1,\n startColumn: node.startPosition.column,\n endColumn: node.endPosition.column,\n docstring: extractDocstring(node, source),\n signature: extractSignature(node, source, kind),\n visibility,\n isExported: isExported(node),\n isAsync: isAsync(node),\n isStatic: isStatic(node),\n updatedAt: now,\n };\n nodes.push(graphNode);\n\n if (parentId) {\n edges.push({ source: parentId, target: id, kind: 'contains' });\n }\n\n // Collect call references within this symbol\n collectCallRefs(node, source, id, unresolvedRefs);\n\n // Extract inheritance edges for C# and Java class/interface nodes\n if ((kind === 'class' || kind === 'interface') && (language === 'csharp' || language === 'java')) {\n extractInheritance(node, source, language, id, unresolvedRefs);\n }\n\n // Recurse with this node as parent\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, id);\n }\n return;\n }\n }\n\n // No symbol \u2014 recurse without changing parent\n for (let i = 0; i < node.childCount; i++) {\n walkTree(node.child(i), source, filePath, language, nodes, edges, unresolvedRefs, now, parentId);\n }\n}\n\n// \u2500\u2500 Language-specific node kinds \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction getLanguageSpecificKind(type: string, lang: Language): NodeKind | null {\n switch (lang) {\n case 'python':\n if (type === 'assignment') return 'variable';\n break;\n case 'go':\n if (type === 'var_declaration' || type === 'short_var_declaration') return 'variable';\n if (type === 'const_declaration') return 'constant';\n if (type === 'type_spec') return 'type_alias';\n break;\n case 'rust':\n if (type === 'let_declaration') return 'variable';\n if (type === 'const_item') return 'constant';\n if (type === 'static_item') return 'variable';\n break;\n case 'java':\n if (type === 'field_declaration') return 'property';\n if (type === 'local_variable_declaration') return 'variable';\n break;\n case 'csharp':\n if (type === 'field_declaration') return 'property';\n break;\n case 'php':\n if (type === 'property_declaration') return 'property';\n if (type === 'const_declaration') return 'constant';\n break;\n case 'kotlin':\n if (type === 'property_declaration') return 'variable';\n break;\n case 'swift':\n if (type === 'property_declaration') return 'property';\n if (type === 'constant_declaration') return 'constant';\n break;\n case 'dart':\n if (type === 'function_signature') return 'function';\n if (type === 'method_signature') return 'method';\n break;\n case 'ruby':\n if (type === 'singleton_method') return 'method';\n break;\n }\n return null;\n}\n\n// \u2500\u2500 Import extraction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractImport(\n node: any,\n source: string,\n filePath: string,\n language: Language,\n unresolvedRefs: UnresolvedRef[],\n now: number,\n parentId?: string\n): Node | null {\n const modulePath = extractImportSource(node, source, language);\n if (!modulePath) return null;\n\n const id = makeNodeId(filePath, 'import', modulePath, node.startPosition.row + 1);\n const importNode: Node = {\n id,\n kind: 'import',\n name: modulePath,\n qualifiedName: `${filePath}::import:${modulePath}`,\n filePath,\n language,\n startLine: node.startPosition.row + 1,\n endLine: node.endPosition.row + 1,\n startColumn: node.startPosition.column,\n endColumn: node.endPosition.column,\n updatedAt: now,\n };\n\n // Register as unresolved import for later file-level resolution\n unresolvedRefs.push({\n sourceId: id,\n refName: modulePath,\n refKind: 'import',\n line: node.startPosition.row + 1,\n column: node.startPosition.column,\n });\n\n return importNode;\n}\n\n/** Extract the module path string from an import statement node */\nfunction extractImportSource(node: any, source: string, language: Language): string | null {\n // TS/JS/Svelte: import X from \"module\" \u2192 look for trailing string literal\n if (\n node.type === 'import_statement' ||\n (language === 'svelte' && node.type === 'import_statement')\n ) {\n for (let i = node.childCount - 1; i >= 0; i--) {\n const child = node.child(i);\n if (child.type === 'string') {\n return stripQuotes(source.slice(child.startIndex, child.endIndex));\n }\n }\n }\n\n // Python: from .module import X or import module\n if (node.type === 'import_from_statement') {\n // Look for dotted_name or relative_import after 'from'\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'dotted_name' || child.type === 'relative_import') {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n }\n if (node.type === 'import_statement' && language === 'python') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'dotted_name') {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n }\n\n // Go: import \"path\" or import ( \"path\" )\n if (node.type === 'import_declaration') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'string') {\n return stripQuotes(source.slice(child.startIndex, child.endIndex));\n }\n if (child.type === 'import_spec_list') {\n for (let j = 0; j < child.childCount; j++) {\n const spec = child.child(j);\n if (spec.type === 'import_spec') {\n for (let k = 0; k < spec.childCount; k++) {\n const s = spec.child(k);\n if (s.type === 'string') return stripQuotes(source.slice(s.startIndex, s.endIndex));\n }\n }\n }\n }\n }\n }\n\n // Rust: use path::to::module;\n if (node.type === 'use_declaration') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type !== 'use' && child.type !== ';') {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n }\n\n // C#: using Namespace.Name;\n if (node.type === 'using_directive') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'qualified_name' || child.type === 'identifier') {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n }\n\n // Java/Kotlin: import a.b.c\n if (node.type === 'import_declaration' || node.type === 'import_header') {\n const text = source.slice(node.startIndex, node.endIndex).trim();\n const m = text.match(/^import\\s+(.+?)[;\\s*]*$/);\n if (m) return m[1].trim();\n }\n\n // PHP: use Foo\\Bar\n if (node.type === 'namespace_use_declaration') {\n const text = source.slice(node.startIndex, node.endIndex).trim();\n const m = text.match(/^use\\s+(.+?)[;\\s]*$/);\n if (m) return m[1].trim();\n }\n\n // Swift/Dart: import SomeModule\n if (node.type === 'import_declaration' || node.type === 'import_or_export') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'identifier' || child.type === 'string') {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n }\n\n // C/C++: #include \"file.h\" or #include <lib.h>\n if (node.type === 'preproc_include') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'string_literal' || child.type === 'system_lib_string') {\n return source.slice(child.startIndex, child.endIndex).replace(/[<>\"]/g, '');\n }\n }\n }\n\n return null;\n}\n\nfunction stripQuotes(s: string): string {\n return s.replace(/^['\"`]|['\"`]$/g, '');\n}\n\n// \u2500\u2500 Name extraction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractName(node: any, source: string, _lang: Language, kind: NodeKind): string | null {\n // For variable/constant declarations (lexical_declaration, variable_declaration),\n // the identifier is inside a variable_declarator child\n if (kind === 'variable' || kind === 'constant') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'variable_declarator') {\n for (let j = 0; j < child.childCount; j++) {\n const gc = child.child(j);\n if (gc.type === 'identifier') return source.slice(gc.startIndex, gc.endIndex);\n }\n }\n }\n }\n\n // For Go const_declaration / var_declaration \u2192 look inside var_spec / const_spec\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'var_spec' || child.type === 'const_spec') {\n for (let j = 0; j < child.childCount; j++) {\n const gc = child.child(j);\n if (gc.type === 'identifier') return source.slice(gc.startIndex, gc.endIndex);\n }\n }\n }\n\n // Standard: look for first identifier/property_identifier/type_identifier child\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (\n child.type === 'identifier' ||\n child.type === 'property_identifier' ||\n child.type === 'type_identifier'\n ) {\n return source.slice(child.startIndex, child.endIndex);\n }\n }\n\n // Python assignment: the left side is the name\n if (node.type === 'assignment') {\n const left = node.child(0);\n if (left && left.type === 'identifier') {\n return source.slice(left.startIndex, left.endIndex);\n }\n }\n\n return null;\n}\n\n// \u2500\u2500 Signature extraction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractSignature(node: any, source: string, kind: NodeKind): string | undefined {\n // For functions/methods, try to get the meaningful header without the body\n if (kind === 'function' || kind === 'method') {\n // Try to find parameter list \u2014 stop before the body block\n const text = source.slice(node.startIndex, node.endIndex);\n // Find opening brace or colon (Python), take everything before it\n const bodyStart = text.search(/\\s*[\\{:]\\s*\\n|=>|{/);\n const header = bodyStart > 0 ? text.slice(0, bodyStart).trim() : text.split('\\n')[0].trim();\n return header.length > 150 ? header.slice(0, 150) + '\u2026' : header || undefined;\n }\n\n // Default: first line truncated\n const text = source.slice(node.startIndex, node.endIndex);\n const firstLine = text.split('\\n')[0].trim();\n return firstLine.length > 120 ? firstLine.slice(0, 120) + '\u2026' : firstLine || undefined;\n}\n\n// \u2500\u2500 Visibility extraction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractVisibility(node: any, source: string, language: Language): Node['visibility'] {\n // TypeScript / JavaScript: accessibility_modifier child\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'accessibility_modifier') {\n const mod = source.slice(child.startIndex, child.endIndex);\n if (mod === 'public') return 'public';\n if (mod === 'private') return 'private';\n if (mod === 'protected') return 'protected';\n }\n // Direct modifier keywords (Java, C#, PHP, Swift, Kotlin)\n if (child.type === 'public') return 'public';\n if (child.type === 'private') return 'private';\n if (child.type === 'protected') return 'protected';\n if (child.type === 'internal') return 'internal';\n }\n\n // Rust: no `pub` keyword = private, `pub` = public\n if (language === 'rust') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n if (child.type === 'visibility_modifier') {\n const v = source.slice(child.startIndex, child.endIndex);\n return v.startsWith('pub') ? 'public' : 'private';\n }\n }\n return 'private'; // Rust default\n }\n\n // C# default: private\n if (language === 'csharp') return 'private';\n\n // PHP default: public\n if (language === 'php') return 'public';\n\n // Swift: check for access modifiers\n if (language === 'swift') {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n const t = child.type;\n if (t === 'fileprivate') return 'private';\n }\n return 'internal'; // Swift default\n }\n\n // Python: underscore prefix convention\n if (language === 'python') {\n const name = extractName(node, source, language, 'function');\n if (name?.startsWith('_') && !name.startsWith('__')) return 'protected';\n if (name?.startsWith('__')) return 'private';\n return 'public';\n }\n\n return undefined;\n}\n\n// \u2500\u2500 Misc helpers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction extractDocstring(node: any, source: string): string | undefined {\n const commentTypes = new Set(['comment', 'block_comment', 'line_comment', 'documentation_comment']);\n const commentLines: string[] = [];\n\n let sibling = node.previousNamedSibling;\n while (sibling && commentTypes.has(sibling.type)) {\n commentLines.unshift(source.slice(sibling.startIndex, sibling.endIndex));\n sibling = sibling.previousNamedSibling;\n }\n\n if (commentLines.length === 0) return undefined;\n\n const cleaned = commentLines.join('\\n')\n .replace(/^\\/\\*+\\s*/gm, '')\n .replace(/\\s*\\*+\\/\\s*$/gm, '')\n .replace(/^\\s*\\*\\s?/gm, '')\n .replace(/^\\/\\/\\s?/gm, '')\n .trim();\n\n return cleaned.length > 0 ? cleaned : undefined;\n}\n\nfunction isExported(node: any): boolean {\n // Walk up the parent chain to find an export_statement ancestor\n let current = node.parent;\n while (current) {\n if (current.type === 'export_statement') return true;\n // Stop at scope boundaries\n if (current.type === 'function_body' || current.type === 'class_body' || current.type === 'statement_block') break;\n current = current.parent;\n }\n return false;\n}\n\nfunction isAsync(node: any): boolean {\n for (let i = 0; i < node.childCount; i++) {\n if (node.child(i).type === 'async') return true;\n }\n return false;\n}\n\nfunction isStatic(node: any): boolean {\n for (let i = 0; i < node.childCount; i++) {\n if (node.child(i).type === 'static') return true;\n }\n return false;\n}\n\n// \u2500\u2500 Call reference collection \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Node types that represent a function/method call across all supported languages.\n * Using a combined set avoids threading a language parameter through the recursive walker.\n */\nconst CALL_NODE_TYPES = new Set([\n 'call_expression', // JS/TS/Go/Rust/Swift/Kotlin/Dart/C/C++\n 'invocation_expression', // C#\n 'method_invocation', // Java\n 'call', // Python/Ruby/Elixir (function calls in bodies)\n 'function_call_expression', // PHP\n]);\n\n/**\n * Extract the callee name from a call node.\n * Uses named field lookup first (more precise), then falls back to first-child heuristic.\n */\nfunction extractCallName(node: any, source: string): string | null {\n // Named fields \u2014 Java uses 'name', Python/Ruby use 'function'/'method', Elixir uses 'target'\n for (const field of ['name', 'method', 'function', 'target']) {\n const f = node.childForFieldName?.(field);\n if (f) {\n const t = f.type;\n if (t === 'identifier' || t === 'name' || t === 'property_identifier' || t === 'type_identifier') {\n const text = source.slice(f.startIndex, f.endIndex).trim();\n if (text && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(text)) return text;\n }\n }\n }\n // Fallback: first child, take final segment of dotted access (covers JS/TS, C#, Go, Rust\u2026)\n const funcNode = node.child(0);\n if (funcNode) {\n const rawName = source.slice(funcNode.startIndex, funcNode.endIndex).split('(')[0].trim();\n if (rawName && rawName.length < 100) {\n const calleeName = rawName.split('.').pop()!.trim();\n if (calleeName && /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(calleeName)) return calleeName;\n }\n }\n return null;\n}\n\nfunction collectCallRefs(node: any, source: string, sourceId: string, unresolvedRefs: UnresolvedRef[]): void {\n walkForCalls(node, source, sourceId, unresolvedRefs);\n}\n\nfunction walkForCalls(node: any, source: string, sourceId: string, unresolvedRefs: UnresolvedRef[]): void {\n if (CALL_NODE_TYPES.has(node.type)) {\n const calleeName = extractCallName(node, source);\n if (calleeName) {\n unresolvedRefs.push({\n sourceId,\n refName: calleeName,\n refKind: 'function',\n line: node.startPosition.row + 1,\n column: node.startPosition.column,\n });\n }\n }\n for (let i = 0; i < node.childCount; i++) {\n walkForCalls(node.child(i), source, sourceId, unresolvedRefs);\n }\n}\n\n// \u2500\u2500 Inheritance extraction \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Extract the simple type name from an AST node representing a type reference.\n * Strips generic parameters (e.g. \"List<T>\" \u2192 \"List\").\n */\nfunction extractTypeName(node: any, source: string): string | null {\n const t = node.type;\n if (t === 'identifier' || t === 'type_identifier' || t === 'name') {\n return source.slice(node.startIndex, node.endIndex).trim() || null;\n }\n // qualified_name / generic_name: take the rightmost identifier\n if (t === 'qualified_name' || t === 'generic_name' || t === 'scoped_type_identifier') {\n for (let i = node.childCount - 1; i >= 0; i--) {\n const child = node.child(i);\n if (child.type === 'identifier' || child.type === 'type_identifier' || child.type === 'name') {\n return source.slice(child.startIndex, child.endIndex).trim() || null;\n }\n }\n }\n return null;\n}\n\n/**\n * Scan a class/interface AST node for its base types and add them as unresolved\n * extends/implements refs, which the resolver later turns into graph edges.\n *\n * C#: base_list children \u2192 all are either base class or interface (can't distinguish without types)\n * Java: superclass \u2192 extends; super_interfaces / extends_interfaces \u2192 implements / extends\n */\nfunction extractInheritance(\n node: any,\n source: string,\n language: Language,\n classNodeId: string,\n unresolvedRefs: UnresolvedRef[],\n): void {\n for (let i = 0; i < node.childCount; i++) {\n const child = node.child(i);\n\n if (language === 'csharp' && child.type === 'base_list') {\n for (let j = 0; j < child.childCount; j++) {\n const item = child.child(j);\n const name = extractTypeName(item, source);\n if (name) {\n unresolvedRefs.push({\n sourceId: classNodeId,\n refName: name,\n // In C# both classes and interfaces appear in the same base_list;\n // we emit 'extends' for all \u2014 the resolver maps it to the extends edge\n // which covers both parent classes and parent interfaces structurally.\n refKind: 'extends',\n line: item.startPosition.row + 1,\n column: item.startPosition.column,\n });\n }\n }\n }\n\n if (language === 'java') {\n if (child.type === 'superclass') {\n // superclass has a single type_identifier or scoped_type_identifier child\n const typeNode = child.namedChild?.(0);\n if (typeNode) {\n const name = extractTypeName(typeNode, source);\n if (name) unresolvedRefs.push({ sourceId: classNodeId, refName: name, refKind: 'extends', line: child.startPosition.row + 1, column: child.startPosition.column });\n }\n }\n if (child.type === 'super_interfaces' || child.type === 'extends_interfaces') {\n // contains a type_list with one or more types\n const typeList = child.namedChild?.(0);\n if (typeList) {\n const count = typeList.namedChildCount ?? 0;\n for (let j = 0; j < count; j++) {\n const typeNode = typeList.namedChild(j);\n if (typeNode) {\n const name = extractTypeName(typeNode, source);\n if (name) {\n unresolvedRefs.push({\n sourceId: classNodeId,\n refName: name,\n refKind: child.type === 'extends_interfaces' ? 'extends' : 'implements',\n line: typeNode.startPosition.row + 1,\n column: typeNode.startPosition.column,\n });\n }\n }\n }\n }\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,WAAsB;AACtB,SAAoB;AACpB,aAAwB;AAExB,uBAAoD;AACpD,sBAAwD;AAoBjD,SAAS,WAAW,UAAkB,MAAc,MAAc,MAAsB;AAC7F,QAAM,OAAO,OAAO,WAAW,QAAQ,EAAE,OAAO,GAAG,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,EAAE,OAAO,KAAK,EAAE,MAAM,GAAG,EAAE;AAChH,SAAO,GAAG,IAAI,IAAI,IAAI;AACxB;AAGA,SAAS,aAAa,UAAkB,aAA8B;AACpE,MAAI;AACF,UAAM,OAAO,GAAG,aAAa,QAAQ;AACrC,UAAM,WAAW,GAAG,aAAa,WAAW;AAC5C,WAAO,KAAK,WAAW,WAAW,KAAK,GAAG,KAAK,SAAS;AAAA,EAC1D,QAAQ;AAEN,UAAM,aAAa,KAAK,QAAQ,QAAQ;AACxC,WAAO,WAAW,WAAW,KAAK,QAAQ,WAAW,CAAC;AAAA,EACxD;AACF;AAMA,eAAsB,YAAY,UAAkB,aAAqB,SAA0D;AACjI,QAAM,eAAW,iCAAe,QAAQ;AACxC,MAAI,KAAC,sCAAoB,QAAQ,EAAG,QAAO;AAG3C,MAAI,CAAC,aAAa,UAAU,WAAW,EAAG,QAAO;AAEjD,MAAI;AACJ,MAAI;AACF,QAAI,YAAY,QAAW;AACzB,eAAS,OAAO,YAAY,WAAW,UAAU,QAAQ,SAAS,MAAM;AAAA,IAC1E,OAAO;AACL,eAAS,GAAG,aA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AAAA,YACT,MAAM,KAAK,cAAc,MAAM;AAAA,YAC/B,QAAQ,KAAK,cAAc;AAAA,UAC7B,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAEA,QAAI,aAAa,QAAQ;AACvB,UAAI,MAAM,SAAS,cAAc;AAE/B,cAAM,WAAW,MAAM,aAAa,CAAC;AACrC,YAAI,UAAU;AACZ,gBAAM,OAAO,gBAAgB,UAAU,MAAM;AAC7C,cAAI,KAAM,gBAAe,KAAK,EAAE,UAAU,aAAa,SAAS,MAAM,SAAS,WAAW,MAAM,MAAM,cAAc,MAAM,GAAG,QAAQ,MAAM,cAAc,OAAO,CAAC;AAAA,QACnK;AAAA,MACF;AACA,UAAI,MAAM,SAAS,sBAAsB,MAAM,SAAS,sBAAsB;AAE5E,cAAM,WAAW,MAAM,aAAa,CAAC;AACrC,YAAI,UAAU;AACZ,gBAAM,QAAQ,SAAS,mBAAmB;AAC1C,mBAAS,IAAI,GAAG,IAAI,OAAO,KAAK;AAC9B,kBAAM,WAAW,SAAS,WAAW,CAAC;AACtC,gBAAI,UAAU;AACZ,oBAAM,OAAO,gBAAgB,UAAU,MAAM;AAC7C,kBAAI,MAAM;AACR,+BAAe,KAAK;AAAA,kBAClB,UAAU;AAAA,kBACV,SAAS;AAAA,kBACT,SAAS,MAAM,SAAS,uBAAuB,YAAY;AAAA,kBAC3D,MAAM,SAAS,cAAc,MAAM;AAAA,kBACnC,QAAQ,SAAS,cAAc;AAAA,gBACjC,CAAC;AAAA,cACH;AAAA,YACF;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;",
6
+ "names": ["text"]
7
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Grammar Module — lazy WASM grammar loading for tree-sitter.
3
+ * Centralises all grammar management previously inline in extractor.ts.
4
+ * Sequential loading via grammarLoadChain prevents WASM race condition on Node 20+.
5
+ */
6
+ import type { Language } from '../types';
7
+ /**
8
+ * Maps each Language to its WASM file name (without .wasm extension).
9
+ * Empty string means no WASM is available for that language.
10
+ * Pascal is bundled separately; all others come from tree-sitter-wasms.
11
+ */
12
+ export declare const GRAMMAR_FILE_MAP: Record<Language, string>;
13
+ /**
14
+ * Initialises the tree-sitter Parser runtime without loading any language grammars.
15
+ * Safe to call multiple times — idempotent.
16
+ */
17
+ export declare function initGrammars(): Promise<void>;
18
+ /**
19
+ * Loads WASM grammars for the given languages sequentially.
20
+ * Already-loaded grammars are skipped.
21
+ * WASM load failures are swallowed silently — no throw.
22
+ */
23
+ export declare function loadGrammarsForLanguages(languages: Language[]): Promise<void>;
24
+ /**
25
+ * Returns a configured Parser instance for the given language.
26
+ * Loads the grammar on demand if not yet cached.
27
+ * Returns null if no grammar is available (unsupported/unknown language).
28
+ */
29
+ export declare function getParser(language: Language): Promise<any | null>;
30
+ /**
31
+ * Returns true when the grammar for the given language is already in the cache.
32
+ */
33
+ export declare function isGrammarLoaded(language: Language): boolean;
34
+ /**
35
+ * Returns the list of languages for which a WASM grammar file is known.
36
+ * Languages with an empty GRAMMAR_FILE_MAP entry are excluded.
37
+ */
38
+ export declare function getSupportedLanguages(): Language[];
39
+ /**
40
+ * Removes all cached grammars and resets the module to uninitialised state.
41
+ * Primarily for testing.
42
+ */
43
+ export declare function clearParserCache(): void;
44
+ /**
45
+ * Convenience wrapper — loads all known supported language grammars.
46
+ */
47
+ export declare function loadAllGrammars(): Promise<void>;
48
+ //# sourceMappingURL=grammars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grammars.d.ts","sourceRoot":"","sources":["../../src/extraction/grammars.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAWzC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAuBrD,CAAC;AAIF;;;GAGG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC,CAUlD;AAyBD;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,SAAS,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBnF;AAID;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAqBvE;AAID;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,QAAQ,EAAE,CAIlD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAKvC;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAErD"}
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var grammars_exports = {};
30
+ __export(grammars_exports, {
31
+ GRAMMAR_FILE_MAP: () => GRAMMAR_FILE_MAP,
32
+ clearParserCache: () => clearParserCache,
33
+ getParser: () => getParser,
34
+ getSupportedLanguages: () => getSupportedLanguages,
35
+ hasWasmGrammar: () => hasWasmGrammar,
36
+ initGrammars: () => initGrammars,
37
+ isGrammarLoaded: () => isGrammarLoaded,
38
+ loadAllGrammars: () => loadAllGrammars,
39
+ loadGrammarsForLanguages: () => loadGrammarsForLanguages
40
+ });
41
+ module.exports = __toCommonJS(grammars_exports);
42
+ var path = __toESM(require("path"));
43
+ let parserLib = null;
44
+ let parserInitPromise = null;
45
+ const loadedGrammars = /* @__PURE__ */ new Map();
46
+ let grammarLoadChain = Promise.resolve();
47
+ const GRAMMAR_FILE_MAP = {
48
+ typescript: "tree-sitter-typescript",
49
+ tsx: "tree-sitter-tsx",
50
+ javascript: "tree-sitter-javascript",
51
+ jsx: "tree-sitter-javascript",
52
+ python: "tree-sitter-python",
53
+ go: "tree-sitter-go",
54
+ rust: "tree-sitter-rust",
55
+ java: "tree-sitter-java",
56
+ c: "tree-sitter-c",
57
+ cpp: "tree-sitter-cpp",
58
+ csharp: "tree-sitter-c_sharp",
59
+ php: "tree-sitter-php",
60
+ ruby: "tree-sitter-ruby",
61
+ swift: "tree-sitter-swift",
62
+ kotlin: "tree-sitter-kotlin",
63
+ dart: "tree-sitter-dart",
64
+ svelte: "tree-sitter-svelte",
65
+ elixir: "tree-sitter-elixir",
66
+ // Pascal is bundled in src/extraction/wasm/ (not in tree-sitter-wasms)
67
+ pascal: "tree-sitter-pascal",
68
+ // No WASM available
69
+ liquid: "",
70
+ unknown: ""
71
+ };
72
+ async function initGrammars() {
73
+ if (parserLib) return;
74
+ if (parserInitPromise) return parserInitPromise;
75
+ parserInitPromise = (async () => {
76
+ const TreeSitter = require("web-tree-sitter");
77
+ await TreeSitter.Parser.init();
78
+ parserLib = TreeSitter;
79
+ })();
80
+ return parserInitPromise;
81
+ }
82
+ function resolveWasmPath(lang) {
83
+ if (lang === "pascal") {
84
+ return path.join(__dirname, "wasm", "tree-sitter-pascal.wasm");
85
+ }
86
+ const grammarFile = GRAMMAR_FILE_MAP[lang];
87
+ if (!grammarFile) return null;
88
+ try {
89
+ return require.resolve(`tree-sitter-wasms/out/${grammarFile}.wasm`);
90
+ } catch {
91
+ return null;
92
+ }
93
+ }
94
+ async function loadGrammarsForLanguages(languages) {
95
+ for (const lang of languages) {
96
+ if (loadedGrammars.has(lang)) continue;
97
+ await new Promise((resolve) => {
98
+ grammarLoadChain = grammarLoadChain.then(async () => {
99
+ if (loadedGrammars.has(lang)) {
100
+ resolve();
101
+ return;
102
+ }
103
+ const wasmPath = resolveWasmPath(lang);
104
+ if (!wasmPath) {
105
+ resolve();
106
+ return;
107
+ }
108
+ try {
109
+ await initGrammars();
110
+ const langObj = await parserLib.Language.load(wasmPath);
111
+ loadedGrammars.set(lang, langObj);
112
+ } catch {
113
+ }
114
+ resolve();
115
+ });
116
+ });
117
+ }
118
+ }
119
+ async function getParser(language) {
120
+ if (loadedGrammars.has(language)) {
121
+ await initGrammars();
122
+ const parser2 = new parserLib.Parser();
123
+ parser2.setLanguage(loadedGrammars.get(language));
124
+ return parser2;
125
+ }
126
+ if (!resolveWasmPath(language)) return null;
127
+ await loadGrammarsForLanguages([language]);
128
+ if (!loadedGrammars.has(language)) return null;
129
+ await initGrammars();
130
+ const parser = new parserLib.Parser();
131
+ parser.setLanguage(loadedGrammars.get(language));
132
+ return parser;
133
+ }
134
+ function isGrammarLoaded(language) {
135
+ return loadedGrammars.has(language);
136
+ }
137
+ function hasWasmGrammar(language) {
138
+ return resolveWasmPath(language) !== null;
139
+ }
140
+ function getSupportedLanguages() {
141
+ return Object.keys(GRAMMAR_FILE_MAP).filter(
142
+ (lang) => GRAMMAR_FILE_MAP[lang] !== ""
143
+ );
144
+ }
145
+ function clearParserCache() {
146
+ parserLib = null;
147
+ parserInitPromise = null;
148
+ loadedGrammars.clear();
149
+ grammarLoadChain = Promise.resolve();
150
+ }
151
+ async function loadAllGrammars() {
152
+ return loadGrammarsForLanguages(getSupportedLanguages());
153
+ }
154
+ // Annotate the CommonJS export names for ESM import in node:
155
+ 0 && (module.exports = {
156
+ GRAMMAR_FILE_MAP,
157
+ clearParserCache,
158
+ getParser,
159
+ getSupportedLanguages,
160
+ hasWasmGrammar,
161
+ initGrammars,
162
+ isGrammarLoaded,
163
+ loadAllGrammars,
164
+ loadGrammarsForLanguages
165
+ });
166
+ //# sourceMappingURL=grammars.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/extraction/grammars.ts"],
4
+ "sourcesContent": ["/**\n * Grammar Module \u2014 lazy WASM grammar loading for tree-sitter.\n * Centralises all grammar management previously inline in extractor.ts.\n * Sequential loading via grammarLoadChain prevents WASM race condition on Node 20+.\n */\n\nimport * as path from 'path';\nimport type { Language } from '../types';\n\n// \u2500\u2500 Module-level singletons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nlet parserLib: any = null;\nlet parserInitPromise: Promise<void> | null = null;\nconst loadedGrammars = new Map<Language, any>();\nlet grammarLoadChain = Promise.resolve();\n\n// \u2500\u2500 GRAMMAR_FILE_MAP \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Maps each Language to its WASM file name (without .wasm extension).\n * Empty string means no WASM is available for that language.\n * Pascal is bundled separately; all others come from tree-sitter-wasms.\n */\nexport const GRAMMAR_FILE_MAP: Record<Language, string> = {\n typescript: 'tree-sitter-typescript',\n tsx: 'tree-sitter-tsx',\n javascript: 'tree-sitter-javascript',\n jsx: 'tree-sitter-javascript',\n python: 'tree-sitter-python',\n go: 'tree-sitter-go',\n rust: 'tree-sitter-rust',\n java: 'tree-sitter-java',\n c: 'tree-sitter-c',\n cpp: 'tree-sitter-cpp',\n csharp: 'tree-sitter-c_sharp',\n php: 'tree-sitter-php',\n ruby: 'tree-sitter-ruby',\n swift: 'tree-sitter-swift',\n kotlin: 'tree-sitter-kotlin',\n dart: 'tree-sitter-dart',\n svelte: 'tree-sitter-svelte',\n elixir: 'tree-sitter-elixir',\n // Pascal is bundled in src/extraction/wasm/ (not in tree-sitter-wasms)\n pascal: 'tree-sitter-pascal',\n // No WASM available\n liquid: '',\n unknown: '',\n};\n\n// \u2500\u2500 initGrammars \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Initialises the tree-sitter Parser runtime without loading any language grammars.\n * Safe to call multiple times \u2014 idempotent.\n */\nexport async function initGrammars(): Promise<void> {\n if (parserLib) return;\n if (parserInitPromise) return parserInitPromise;\n parserInitPromise = (async () => {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const TreeSitter = require('web-tree-sitter');\n await TreeSitter.Parser.init();\n parserLib = TreeSitter;\n })();\n return parserInitPromise;\n}\n\n// \u2500\u2500 resolveWasmPath \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Resolves the filesystem path to the WASM file for a given language.\n * Pascal uses the bundled wasm in src/extraction/wasm/.\n * All others are resolved from the tree-sitter-wasms npm package.\n * Returns null if the file cannot be located.\n */\nfunction resolveWasmPath(lang: Language): string | null {\n if (lang === 'pascal') {\n return path.join(__dirname, 'wasm', 'tree-sitter-pascal.wasm');\n }\n const grammarFile = GRAMMAR_FILE_MAP[lang];\n if (!grammarFile) return null;\n try {\n return require.resolve(`tree-sitter-wasms/out/${grammarFile}.wasm`);\n } catch {\n return null;\n }\n}\n\n// \u2500\u2500 loadGrammarsForLanguages \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Loads WASM grammars for the given languages sequentially.\n * Already-loaded grammars are skipped.\n * WASM load failures are swallowed silently \u2014 no throw.\n */\nexport async function loadGrammarsForLanguages(languages: Language[]): Promise<void> {\n for (const lang of languages) {\n if (loadedGrammars.has(lang)) continue;\n\n await new Promise<void>((resolve) => {\n grammarLoadChain = grammarLoadChain.then(async () => {\n if (loadedGrammars.has(lang)) { resolve(); return; }\n const wasmPath = resolveWasmPath(lang);\n if (!wasmPath) { resolve(); return; }\n try {\n await initGrammars();\n const langObj = await parserLib.Language.load(wasmPath);\n loadedGrammars.set(lang, langObj);\n } catch {\n // Silently skip \u2014 no WASM or load failure\n }\n resolve();\n });\n });\n }\n}\n\n// \u2500\u2500 getParser \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Returns a configured Parser instance for the given language.\n * Loads the grammar on demand if not yet cached.\n * Returns null if no grammar is available (unsupported/unknown language).\n */\nexport async function getParser(language: Language): Promise<any | null> {\n // Fast path \u2014 already loaded\n if (loadedGrammars.has(language)) {\n await initGrammars();\n const parser = new parserLib.Parser();\n parser.setLanguage(loadedGrammars.get(language));\n return parser;\n }\n\n // No WASM available for this language\n if (!resolveWasmPath(language)) return null;\n\n // Load on demand\n await loadGrammarsForLanguages([language]);\n\n if (!loadedGrammars.has(language)) return null;\n\n await initGrammars();\n const parser = new parserLib.Parser();\n parser.setLanguage(loadedGrammars.get(language));\n return parser;\n}\n\n// \u2500\u2500 Remaining exports \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n/**\n * Returns true when the grammar for the given language is already in the cache.\n */\nexport function isGrammarLoaded(language: Language): boolean {\n return loadedGrammars.has(language);\n}\n\n/**\n * Returns true if a WASM grammar file exists for the given language,\n * regardless of whether it has been loaded yet.\n * Use this to distinguish \"language has no grammar\" from \"grammar failed to load\".\n */\nexport function hasWasmGrammar(language: Language): boolean {\n return resolveWasmPath(language) !== null;\n}\n\n/**\n * Returns the list of languages for which a WASM grammar file is known.\n * Languages with an empty GRAMMAR_FILE_MAP entry are excluded.\n */\nexport function getSupportedLanguages(): Language[] {\n return (Object.keys(GRAMMAR_FILE_MAP) as Language[]).filter(\n (lang) => GRAMMAR_FILE_MAP[lang] !== ''\n );\n}\n\n/**\n * Removes all cached grammars and resets the module to uninitialised state.\n * Primarily for testing.\n */\nexport function clearParserCache(): void {\n parserLib = null;\n parserInitPromise = null;\n loadedGrammars.clear();\n grammarLoadChain = Promise.resolve();\n}\n\n/**\n * Convenience wrapper \u2014 loads all known supported language grammars.\n */\nexport async function loadAllGrammars(): Promise<void> {\n return loadGrammarsForLanguages(getSupportedLanguages());\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,WAAsB;AAKtB,IAAI,YAAiB;AACrB,IAAI,oBAA0C;AAC9C,MAAM,iBAAiB,oBAAI,IAAmB;AAC9C,IAAI,mBAAmB,QAAQ,QAAQ;AAShC,MAAM,mBAA6C;AAAA,EACxD,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ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,UAAU,OAAO;AACpC,IAAAA,QAAO,YAAY,eAAe,IAAI,QAAQ,CAAC;AAC/C,WAAOA;AAAA,EACT;AAGA,MAAI,CAAC,gBAAgB,QAAQ,EAAG,QAAO;AAGvC,QAAM,yBAAyB,CAAC,QAAQ,CAAC;AAEzC,MAAI,CAAC,eAAe,IAAI,QAAQ,EAAG,QAAO;AAE1C,QAAM,aAAa;AACnB,QAAM,SAAS,IAAI,UAAU,OAAO;AACpC,SAAO,YAAY,eAAe,IAAI,QAAQ,CAAC;AAC/C,SAAO;AACT;AAOO,SAAS,gBAAgB,UAA6B;AAC3D,SAAO,eAAe,IAAI,QAAQ;AACpC;AAOO,SAAS,eAAe,UAA6B;AAC1D,SAAO,gBAAgB,QAAQ,MAAM;AACvC;AAMO,SAAS,wBAAoC;AAClD,SAAQ,OAAO,KAAK,gBAAgB,EAAiB;AAAA,IACnD,CAAC,SAAS,iBAAiB,IAAI,MAAM;AAAA,EACvC;AACF;AAMO,SAAS,mBAAyB;AACvC,cAAY;AACZ,sBAAoB;AACpB,iBAAe,MAAM;AACrB,qBAAmB,QAAQ,QAAQ;AACrC;AAKA,eAAsB,kBAAiC;AACrD,SAAO,yBAAyB,sBAAsB,CAAC;AACzD;",
6
+ "names": ["parser"]
7
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Language detection and tree-sitter grammar mapping
3
+ */
4
+ import type { Language } from '../types';
5
+ export declare const EXTENSION_MAP: Record<string, Language>;
6
+ export declare const GRAMMAR_MAP: Record<Language, string>;
7
+ export declare function detectLanguage(filePath: string): Language;
8
+ export declare function isSupportedLanguage(lang: Language): boolean;
9
+ //# sourceMappingURL=languages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.d.ts","sourceRoot":"","sources":["../../src/extraction/languages.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAmClD,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAsBhD,CAAC;AAEF,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAGzD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAK3D"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var languages_exports = {};
20
+ __export(languages_exports, {
21
+ EXTENSION_MAP: () => EXTENSION_MAP,
22
+ GRAMMAR_MAP: () => GRAMMAR_MAP,
23
+ detectLanguage: () => detectLanguage,
24
+ isSupportedLanguage: () => isSupportedLanguage
25
+ });
26
+ module.exports = __toCommonJS(languages_exports);
27
+ const EXTENSION_MAP = {
28
+ ".ts": "typescript",
29
+ ".tsx": "tsx",
30
+ ".js": "javascript",
31
+ ".jsx": "jsx",
32
+ ".mjs": "javascript",
33
+ ".cjs": "javascript",
34
+ ".py": "python",
35
+ ".pyw": "python",
36
+ ".go": "go",
37
+ ".rs": "rust",
38
+ ".java": "java",
39
+ ".c": "c",
40
+ ".h": "c",
41
+ ".cpp": "cpp",
42
+ ".cc": "cpp",
43
+ ".cxx": "cpp",
44
+ ".hxx": "cpp",
45
+ ".hpp": "cpp",
46
+ ".cs": "csharp",
47
+ ".php": "php",
48
+ ".rb": "ruby",
49
+ ".rake": "ruby",
50
+ ".swift": "swift",
51
+ ".kt": "kotlin",
52
+ ".kts": "kotlin",
53
+ ".dart": "dart",
54
+ ".svelte": "svelte",
55
+ ".pas": "pascal",
56
+ ".dpr": "pascal",
57
+ ".dpk": "pascal",
58
+ ".lpr": "pascal",
59
+ ".dfm": "pascal",
60
+ ".fmx": "pascal",
61
+ ".liquid": "liquid",
62
+ ".ex": "elixir",
63
+ ".exs": "elixir"
64
+ };
65
+ const GRAMMAR_MAP = {
66
+ typescript: "tree-sitter-typescript",
67
+ tsx: "tree-sitter-tsx",
68
+ javascript: "tree-sitter-javascript",
69
+ jsx: "tree-sitter-javascript",
70
+ python: "tree-sitter-python",
71
+ go: "tree-sitter-go",
72
+ rust: "tree-sitter-rust",
73
+ java: "tree-sitter-java",
74
+ c: "tree-sitter-c",
75
+ cpp: "tree-sitter-cpp",
76
+ csharp: "tree-sitter-c-sharp",
77
+ php: "tree-sitter-php",
78
+ ruby: "tree-sitter-ruby",
79
+ swift: "tree-sitter-swift",
80
+ kotlin: "tree-sitter-kotlin",
81
+ dart: "tree-sitter-dart",
82
+ svelte: "tree-sitter-svelte",
83
+ elixir: "tree-sitter-elixir",
84
+ // Pascal and Liquid require custom WASM not bundled in tree-sitter-wasms
85
+ pascal: "",
86
+ liquid: "",
87
+ unknown: ""
88
+ };
89
+ function detectLanguage(filePath) {
90
+ const ext = filePath.slice(filePath.lastIndexOf(".")).toLowerCase();
91
+ return EXTENSION_MAP[ext] ?? "unknown";
92
+ }
93
+ function isSupportedLanguage(lang) {
94
+ return lang !== "unknown";
95
+ }
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ EXTENSION_MAP,
99
+ GRAMMAR_MAP,
100
+ detectLanguage,
101
+ isSupportedLanguage
102
+ });
103
+ //# sourceMappingURL=languages.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/extraction/languages.ts"],
4
+ "sourcesContent": ["/**\n * Language detection and tree-sitter grammar mapping\n */\n\nimport type { Language } from '../types';\n\nexport const EXTENSION_MAP: Record<string, Language> = {\n '.ts': 'typescript',\n '.tsx': 'tsx',\n '.js': 'javascript',\n '.jsx': 'jsx',\n '.mjs': 'javascript',\n '.cjs': 'javascript',\n '.py': 'python',\n '.pyw': 'python',\n '.go': 'go',\n '.rs': 'rust',\n '.java': 'java',\n '.c': 'c',\n '.h': 'c',\n '.cpp': 'cpp',\n '.cc': 'cpp',\n '.cxx': 'cpp',\n '.hxx': 'cpp',\n '.hpp': 'cpp',\n '.cs': 'csharp',\n '.php': 'php',\n '.rb': 'ruby',\n '.rake': 'ruby',\n '.swift': 'swift',\n '.kt': 'kotlin',\n '.kts': 'kotlin',\n '.dart': 'dart',\n '.svelte': 'svelte',\n '.pas': 'pascal',\n '.dpr': 'pascal',\n '.dpk': 'pascal',\n '.lpr': 'pascal',\n '.dfm': 'pascal',\n '.fmx': 'pascal',\n '.liquid': 'liquid',\n '.ex': 'elixir',\n '.exs': 'elixir',\n};\n\nexport const GRAMMAR_MAP: Record<Language, string> = {\n typescript: 'tree-sitter-typescript',\n tsx: 'tree-sitter-tsx',\n javascript: 'tree-sitter-javascript',\n jsx: 'tree-sitter-javascript',\n python: 'tree-sitter-python',\n go: 'tree-sitter-go',\n rust: 'tree-sitter-rust',\n java: 'tree-sitter-java',\n c: 'tree-sitter-c',\n cpp: 'tree-sitter-cpp',\n csharp: 'tree-sitter-c-sharp',\n php: 'tree-sitter-php',\n ruby: 'tree-sitter-ruby',\n swift: 'tree-sitter-swift',\n kotlin: 'tree-sitter-kotlin',\n dart: 'tree-sitter-dart',\n svelte: 'tree-sitter-svelte',\n elixir: 'tree-sitter-elixir',\n // Pascal and Liquid require custom WASM not bundled in tree-sitter-wasms\n pascal: '',\n liquid: '',\n unknown: '',\n};\n\nexport function detectLanguage(filePath: string): Language {\n const ext = filePath.slice(filePath.lastIndexOf('.')).toLowerCase();\n return EXTENSION_MAP[ext] ?? 'unknown';\n}\n\nexport function isSupportedLanguage(lang: Language): boolean {\n // All known languages are \"supported\" for indexing purposes.\n // Pascal and Liquid don't have a grammar WASM, so they'll be indexed\n // with empty symbol lists (file tracked but no AST extraction).\n return lang !== 'unknown';\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,MAAM,gBAA0C;AAAA,EACrD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AAAA,EACT,UAAU;AAAA,EACV,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AACV;AAEO,MAAM,cAAwC;AAAA,EACnD,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,MAAM;AAAA,EACN,GAAG;AAAA,EACH,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA;AAAA,EAER,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AACX;AAEO,SAAS,eAAe,UAA4B;AACzD,QAAM,MAAM,SAAS,MAAM,SAAS,YAAY,GAAG,CAAC,EAAE,YAAY;AAClE,SAAO,cAAc,GAAG,KAAK;AAC/B;AAEO,SAAS,oBAAoB,MAAyB;AAI3D,SAAO,SAAS;AAClB;",
6
+ "names": []
7
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * C# / ASP.NET Core Framework Resolver
3
+ *
4
+ * Mirrors CodeGraph src/resolution/frameworks/csharp.ts
5
+ */
6
+ import type { FrameworkResolver } from './types';
7
+ export declare const aspnetResolver: FrameworkResolver;
8
+ //# sourceMappingURL=csharp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"csharp.d.ts","sourceRoot":"","sources":["../../src/frameworks/csharp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAiD,MAAM,SAAS,CAAC;AAEhG,eAAO,MAAM,cAAc,EAAE,iBAqD5B,CAAC"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var csharp_exports = {};
20
+ __export(csharp_exports, {
21
+ aspnetResolver: () => aspnetResolver
22
+ });
23
+ module.exports = __toCommonJS(csharp_exports);
24
+ const aspnetResolver = {
25
+ name: "aspnet",
26
+ detect(context) {
27
+ for (const file of context.getAllFiles()) {
28
+ if (file.endsWith(".csproj")) {
29
+ const content = context.readFile(file);
30
+ if (content && (content.includes("Microsoft.AspNetCore") || content.includes("Microsoft.NET.Sdk.Web") || content.includes("System.Web.Mvc"))) return true;
31
+ }
32
+ }
33
+ const programCs = context.readFile("Program.cs");
34
+ if (programCs && (programCs.includes("WebApplication") || programCs.includes("CreateHostBuilder") || programCs.includes("UseStartup"))) return true;
35
+ if (context.fileExists("Startup.cs")) return true;
36
+ return context.getAllFiles().some((f) => f.includes("/Controllers/") && f.endsWith("Controller.cs"));
37
+ },
38
+ resolve(ref, context) {
39
+ if (ref.referenceName.endsWith("Controller")) {
40
+ const id = resolveInDirs(ref.referenceName, ["Controllers"], ".cs", context);
41
+ if (id) return { original: ref, targetNodeId: id, confidence: 0.85, resolvedBy: "framework" };
42
+ }
43
+ if (ref.referenceName.endsWith("Service") || ref.referenceName.startsWith("I") && ref.referenceName.length > 1) {
44
+ const id = resolveInDirs(ref.referenceName, ["Services", "Service", "Application"], ".cs", context);
45
+ if (id) return { original: ref, targetNodeId: id, confidence: 0.85, resolvedBy: "framework" };
46
+ }
47
+ if (ref.referenceName.endsWith("Repository")) {
48
+ const id = resolveInDirs(ref.referenceName, ["Repositories", "Repository", "Data", "Infrastructure"], ".cs", context);
49
+ if (id) return { original: ref, targetNodeId: id, confidence: 0.85, resolvedBy: "framework" };
50
+ }
51
+ if (/^[A-Z][a-zA-Z]+$/.test(ref.referenceName)) {
52
+ const id = resolveInDirs(ref.referenceName, ["Models", "Model", "Entities", "Entity", "Domain"], ".cs", context);
53
+ if (id) return { original: ref, targetNodeId: id, confidence: 0.7, resolvedBy: "framework" };
54
+ }
55
+ return null;
56
+ },
57
+ extractNodes(filePath, content) {
58
+ const nodes = [];
59
+ const now = Date.now();
60
+ const httpPattern = /\[(Http(Get|Post|Put|Patch|Delete))\s*(?:\(\s*["']([^"']+)["']\s*\))?\]/g;
61
+ let match;
62
+ while ((match = httpPattern.exec(content)) !== null) {
63
+ const [, , method, path] = match;
64
+ const line = content.slice(0, match.index).split("\n").length;
65
+ if (path) {
66
+ nodes.push({ id: `route:${filePath}:${method.toUpperCase()}:${path}:${line}`, kind: "route", name: `${method.toUpperCase()} ${path}`, qualifiedName: `${filePath}::${method.toUpperCase()}:${path}`, filePath, startLine: line, endLine: line, startColumn: 0, endColumn: match[0].length, language: "csharp", updatedAt: now });
67
+ }
68
+ }
69
+ const minimalPattern = /\.Map(Get|Post|Put|Patch|Delete)\s*\(\s*["']([^"']+)["']/g;
70
+ while ((match = minimalPattern.exec(content)) !== null) {
71
+ const [, method, path] = match;
72
+ const line = content.slice(0, match.index).split("\n").length;
73
+ nodes.push({ id: `route:${filePath}:${method.toUpperCase()}:${path}:${line}`, kind: "route", name: `${method.toUpperCase()} ${path}`, qualifiedName: `${filePath}::${method.toUpperCase()}:${path}`, filePath, startLine: line, endLine: line, startColumn: 0, endColumn: match[0].length, language: "csharp", updatedAt: now });
74
+ }
75
+ return nodes;
76
+ }
77
+ };
78
+ function resolveInDirs(name, dirs, ext, context) {
79
+ for (const file of context.getAllFiles()) {
80
+ if (file.endsWith(ext) && dirs.some((d) => file.includes(`/${d}/`))) {
81
+ const node = context.getNodesInFile(file).find(
82
+ (n) => (n.kind === "class" || n.kind === "interface") && n.name === name
83
+ );
84
+ if (node) return node.id;
85
+ }
86
+ }
87
+ return null;
88
+ }
89
+ // Annotate the CommonJS export names for ESM import in node:
90
+ 0 && (module.exports = {
91
+ aspnetResolver
92
+ });
93
+ //# sourceMappingURL=csharp.js.map