@quolu/lattice 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (769) hide show
  1. package/LICENSE +25 -0
  2. package/README.md +20 -0
  3. package/bin/lattice-mcp.mjs +134 -0
  4. package/bin/lattice.mjs +78 -0
  5. package/package.json +47 -0
  6. package/sensor/LICENSE +21 -0
  7. package/sensor/NOTICE +30 -0
  8. package/sensor/dist/bin/codegraph.d.ts +26 -0
  9. package/sensor/dist/bin/codegraph.d.ts.map +1 -0
  10. package/sensor/dist/bin/codegraph.js +2279 -0
  11. package/sensor/dist/bin/codegraph.js.map +1 -0
  12. package/sensor/dist/bin/command-supervision.d.ts +49 -0
  13. package/sensor/dist/bin/command-supervision.d.ts.map +1 -0
  14. package/sensor/dist/bin/command-supervision.js +95 -0
  15. package/sensor/dist/bin/command-supervision.js.map +1 -0
  16. package/sensor/dist/bin/fatal-handler.d.ts +20 -0
  17. package/sensor/dist/bin/fatal-handler.d.ts.map +1 -0
  18. package/sensor/dist/bin/fatal-handler.js +118 -0
  19. package/sensor/dist/bin/fatal-handler.js.map +1 -0
  20. package/sensor/dist/bin/node-version-check.d.ts +37 -0
  21. package/sensor/dist/bin/node-version-check.d.ts.map +1 -0
  22. package/sensor/dist/bin/node-version-check.js +79 -0
  23. package/sensor/dist/bin/node-version-check.js.map +1 -0
  24. package/sensor/dist/bin/uninstall.d.ts +14 -0
  25. package/sensor/dist/bin/uninstall.d.ts.map +1 -0
  26. package/sensor/dist/bin/uninstall.js +36 -0
  27. package/sensor/dist/bin/uninstall.js.map +1 -0
  28. package/sensor/dist/context/formatter.d.ts +30 -0
  29. package/sensor/dist/context/formatter.d.ts.map +1 -0
  30. package/sensor/dist/context/formatter.js +263 -0
  31. package/sensor/dist/context/formatter.js.map +1 -0
  32. package/sensor/dist/context/index.d.ts +119 -0
  33. package/sensor/dist/context/index.d.ts.map +1 -0
  34. package/sensor/dist/context/index.js +1326 -0
  35. package/sensor/dist/context/index.js.map +1 -0
  36. package/sensor/dist/context/markers.d.ts +19 -0
  37. package/sensor/dist/context/markers.d.ts.map +1 -0
  38. package/sensor/dist/context/markers.js +22 -0
  39. package/sensor/dist/context/markers.js.map +1 -0
  40. package/sensor/dist/db/index.d.ts +264 -0
  41. package/sensor/dist/db/index.d.ts.map +1 -0
  42. package/sensor/dist/db/index.js +603 -0
  43. package/sensor/dist/db/index.js.map +1 -0
  44. package/sensor/dist/db/migrations.d.ts +44 -0
  45. package/sensor/dist/db/migrations.d.ts.map +1 -0
  46. package/sensor/dist/db/migrations.js +241 -0
  47. package/sensor/dist/db/migrations.js.map +1 -0
  48. package/sensor/dist/db/queries.d.ts +563 -0
  49. package/sensor/dist/db/queries.d.ts.map +1 -0
  50. package/sensor/dist/db/queries.js +2179 -0
  51. package/sensor/dist/db/queries.js.map +1 -0
  52. package/sensor/dist/db/schema.sql +196 -0
  53. package/sensor/dist/db/sqlite-adapter.d.ts +55 -0
  54. package/sensor/dist/db/sqlite-adapter.d.ts.map +1 -0
  55. package/sensor/dist/db/sqlite-adapter.js +135 -0
  56. package/sensor/dist/db/sqlite-adapter.js.map +1 -0
  57. package/sensor/dist/db/wal-valve.d.ts +106 -0
  58. package/sensor/dist/db/wal-valve.d.ts.map +1 -0
  59. package/sensor/dist/db/wal-valve.js +208 -0
  60. package/sensor/dist/db/wal-valve.js.map +1 -0
  61. package/sensor/dist/directory.d.ts +183 -0
  62. package/sensor/dist/directory.d.ts.map +1 -0
  63. package/sensor/dist/directory.js +797 -0
  64. package/sensor/dist/directory.js.map +1 -0
  65. package/sensor/dist/errors.d.ts +136 -0
  66. package/sensor/dist/errors.d.ts.map +1 -0
  67. package/sensor/dist/errors.js +219 -0
  68. package/sensor/dist/errors.js.map +1 -0
  69. package/sensor/dist/extraction/astro-extractor.d.ts +79 -0
  70. package/sensor/dist/extraction/astro-extractor.d.ts.map +1 -0
  71. package/sensor/dist/extraction/astro-extractor.js +320 -0
  72. package/sensor/dist/extraction/astro-extractor.js.map +1 -0
  73. package/sensor/dist/extraction/cfml-extractor.d.ts +107 -0
  74. package/sensor/dist/extraction/cfml-extractor.d.ts.map +1 -0
  75. package/sensor/dist/extraction/cfml-extractor.js +494 -0
  76. package/sensor/dist/extraction/cfml-extractor.js.map +1 -0
  77. package/sensor/dist/extraction/dfm-extractor.d.ts +31 -0
  78. package/sensor/dist/extraction/dfm-extractor.d.ts.map +1 -0
  79. package/sensor/dist/extraction/dfm-extractor.js +151 -0
  80. package/sensor/dist/extraction/dfm-extractor.js.map +1 -0
  81. package/sensor/dist/extraction/dynamic-import.d.ts +82 -0
  82. package/sensor/dist/extraction/dynamic-import.d.ts.map +1 -0
  83. package/sensor/dist/extraction/dynamic-import.js +313 -0
  84. package/sensor/dist/extraction/dynamic-import.js.map +1 -0
  85. package/sensor/dist/extraction/extraction-version.d.ts +25 -0
  86. package/sensor/dist/extraction/extraction-version.d.ts.map +1 -0
  87. package/sensor/dist/extraction/extraction-version.js +28 -0
  88. package/sensor/dist/extraction/extraction-version.js.map +1 -0
  89. package/sensor/dist/extraction/function-ref.d.ts +118 -0
  90. package/sensor/dist/extraction/function-ref.d.ts.map +1 -0
  91. package/sensor/dist/extraction/function-ref.js +727 -0
  92. package/sensor/dist/extraction/function-ref.js.map +1 -0
  93. package/sensor/dist/extraction/generated-detection.d.ts +30 -0
  94. package/sensor/dist/extraction/generated-detection.d.ts.map +1 -0
  95. package/sensor/dist/extraction/generated-detection.js +83 -0
  96. package/sensor/dist/extraction/generated-detection.js.map +1 -0
  97. package/sensor/dist/extraction/grammars.d.ts +138 -0
  98. package/sensor/dist/extraction/grammars.d.ts.map +1 -0
  99. package/sensor/dist/extraction/grammars.js +648 -0
  100. package/sensor/dist/extraction/grammars.js.map +1 -0
  101. package/sensor/dist/extraction/index.d.ts +251 -0
  102. package/sensor/dist/extraction/index.d.ts.map +1 -0
  103. package/sensor/dist/extraction/index.js +2563 -0
  104. package/sensor/dist/extraction/index.js.map +1 -0
  105. package/sensor/dist/extraction/kernel/decode.d.ts +9 -0
  106. package/sensor/dist/extraction/kernel/decode.d.ts.map +1 -0
  107. package/sensor/dist/extraction/kernel/decode.js +156 -0
  108. package/sensor/dist/extraction/kernel/decode.js.map +1 -0
  109. package/sensor/dist/extraction/kernel/index.d.ts +62 -0
  110. package/sensor/dist/extraction/kernel/index.d.ts.map +1 -0
  111. package/sensor/dist/extraction/kernel/index.js +165 -0
  112. package/sensor/dist/extraction/kernel/index.js.map +1 -0
  113. package/sensor/dist/extraction/kernel/layout.d.ts +92 -0
  114. package/sensor/dist/extraction/kernel/layout.d.ts.map +1 -0
  115. package/sensor/dist/extraction/kernel/layout.js +95 -0
  116. package/sensor/dist/extraction/kernel/layout.js.map +1 -0
  117. package/sensor/dist/extraction/kernel/loader.d.ts +61 -0
  118. package/sensor/dist/extraction/kernel/loader.d.ts.map +1 -0
  119. package/sensor/dist/extraction/kernel/loader.js +146 -0
  120. package/sensor/dist/extraction/kernel/loader.js.map +1 -0
  121. package/sensor/dist/extraction/languages/arkts.d.ts +3 -0
  122. package/sensor/dist/extraction/languages/arkts.d.ts.map +1 -0
  123. package/sensor/dist/extraction/languages/arkts.js +127 -0
  124. package/sensor/dist/extraction/languages/arkts.js.map +1 -0
  125. package/sensor/dist/extraction/languages/c-cpp.d.ts +111 -0
  126. package/sensor/dist/extraction/languages/c-cpp.d.ts.map +1 -0
  127. package/sensor/dist/extraction/languages/c-cpp.js +878 -0
  128. package/sensor/dist/extraction/languages/c-cpp.js.map +1 -0
  129. package/sensor/dist/extraction/languages/cfquery.d.ts +12 -0
  130. package/sensor/dist/extraction/languages/cfquery.d.ts.map +1 -0
  131. package/sensor/dist/extraction/languages/cfquery.js +28 -0
  132. package/sensor/dist/extraction/languages/cfquery.js.map +1 -0
  133. package/sensor/dist/extraction/languages/cfscript.d.ts +3 -0
  134. package/sensor/dist/extraction/languages/cfscript.d.ts.map +1 -0
  135. package/sensor/dist/extraction/languages/cfscript.js +73 -0
  136. package/sensor/dist/extraction/languages/cfscript.js.map +1 -0
  137. package/sensor/dist/extraction/languages/cobol.d.ts +33 -0
  138. package/sensor/dist/extraction/languages/cobol.d.ts.map +1 -0
  139. package/sensor/dist/extraction/languages/cobol.js +499 -0
  140. package/sensor/dist/extraction/languages/cobol.js.map +1 -0
  141. package/sensor/dist/extraction/languages/csharp.d.ts +25 -0
  142. package/sensor/dist/extraction/languages/csharp.d.ts.map +1 -0
  143. package/sensor/dist/extraction/languages/csharp.js +175 -0
  144. package/sensor/dist/extraction/languages/csharp.js.map +1 -0
  145. package/sensor/dist/extraction/languages/dart.d.ts +3 -0
  146. package/sensor/dist/extraction/languages/dart.d.ts.map +1 -0
  147. package/sensor/dist/extraction/languages/dart.js +374 -0
  148. package/sensor/dist/extraction/languages/dart.js.map +1 -0
  149. package/sensor/dist/extraction/languages/erlang.d.ts +3 -0
  150. package/sensor/dist/extraction/languages/erlang.d.ts.map +1 -0
  151. package/sensor/dist/extraction/languages/erlang.js +350 -0
  152. package/sensor/dist/extraction/languages/erlang.js.map +1 -0
  153. package/sensor/dist/extraction/languages/go.d.ts +3 -0
  154. package/sensor/dist/extraction/languages/go.d.ts.map +1 -0
  155. package/sensor/dist/extraction/languages/go.js +111 -0
  156. package/sensor/dist/extraction/languages/go.js.map +1 -0
  157. package/sensor/dist/extraction/languages/index.d.ts +10 -0
  158. package/sensor/dist/extraction/languages/index.d.ts.map +1 -0
  159. package/sensor/dist/extraction/languages/index.js +71 -0
  160. package/sensor/dist/extraction/languages/index.js.map +1 -0
  161. package/sensor/dist/extraction/languages/java.d.ts +3 -0
  162. package/sensor/dist/extraction/languages/java.d.ts.map +1 -0
  163. package/sensor/dist/extraction/languages/java.js +315 -0
  164. package/sensor/dist/extraction/languages/java.js.map +1 -0
  165. package/sensor/dist/extraction/languages/javascript.d.ts +3 -0
  166. package/sensor/dist/extraction/languages/javascript.d.ts.map +1 -0
  167. package/sensor/dist/extraction/languages/javascript.js +106 -0
  168. package/sensor/dist/extraction/languages/javascript.js.map +1 -0
  169. package/sensor/dist/extraction/languages/kotlin.d.ts +3 -0
  170. package/sensor/dist/extraction/languages/kotlin.d.ts.map +1 -0
  171. package/sensor/dist/extraction/languages/kotlin.js +379 -0
  172. package/sensor/dist/extraction/languages/kotlin.js.map +1 -0
  173. package/sensor/dist/extraction/languages/lua.d.ts +3 -0
  174. package/sensor/dist/extraction/languages/lua.d.ts.map +1 -0
  175. package/sensor/dist/extraction/languages/lua.js +150 -0
  176. package/sensor/dist/extraction/languages/lua.js.map +1 -0
  177. package/sensor/dist/extraction/languages/luau.d.ts +3 -0
  178. package/sensor/dist/extraction/languages/luau.d.ts.map +1 -0
  179. package/sensor/dist/extraction/languages/luau.js +37 -0
  180. package/sensor/dist/extraction/languages/luau.js.map +1 -0
  181. package/sensor/dist/extraction/languages/nix.d.ts +3 -0
  182. package/sensor/dist/extraction/languages/nix.d.ts.map +1 -0
  183. package/sensor/dist/extraction/languages/nix.js +294 -0
  184. package/sensor/dist/extraction/languages/nix.js.map +1 -0
  185. package/sensor/dist/extraction/languages/objc.d.ts +3 -0
  186. package/sensor/dist/extraction/languages/objc.d.ts.map +1 -0
  187. package/sensor/dist/extraction/languages/objc.js +175 -0
  188. package/sensor/dist/extraction/languages/objc.js.map +1 -0
  189. package/sensor/dist/extraction/languages/pascal.d.ts +3 -0
  190. package/sensor/dist/extraction/languages/pascal.d.ts.map +1 -0
  191. package/sensor/dist/extraction/languages/pascal.js +77 -0
  192. package/sensor/dist/extraction/languages/pascal.js.map +1 -0
  193. package/sensor/dist/extraction/languages/php.d.ts +3 -0
  194. package/sensor/dist/extraction/languages/php.d.ts.map +1 -0
  195. package/sensor/dist/extraction/languages/php.js +196 -0
  196. package/sensor/dist/extraction/languages/php.js.map +1 -0
  197. package/sensor/dist/extraction/languages/python.d.ts +3 -0
  198. package/sensor/dist/extraction/languages/python.d.ts.map +1 -0
  199. package/sensor/dist/extraction/languages/python.js +56 -0
  200. package/sensor/dist/extraction/languages/python.js.map +1 -0
  201. package/sensor/dist/extraction/languages/r.d.ts +3 -0
  202. package/sensor/dist/extraction/languages/r.d.ts.map +1 -0
  203. package/sensor/dist/extraction/languages/r.js +314 -0
  204. package/sensor/dist/extraction/languages/r.js.map +1 -0
  205. package/sensor/dist/extraction/languages/ruby.d.ts +3 -0
  206. package/sensor/dist/extraction/languages/ruby.d.ts.map +1 -0
  207. package/sensor/dist/extraction/languages/ruby.js +149 -0
  208. package/sensor/dist/extraction/languages/ruby.js.map +1 -0
  209. package/sensor/dist/extraction/languages/rust.d.ts +3 -0
  210. package/sensor/dist/extraction/languages/rust.d.ts.map +1 -0
  211. package/sensor/dist/extraction/languages/rust.js +142 -0
  212. package/sensor/dist/extraction/languages/rust.js.map +1 -0
  213. package/sensor/dist/extraction/languages/scala.d.ts +3 -0
  214. package/sensor/dist/extraction/languages/scala.d.ts.map +1 -0
  215. package/sensor/dist/extraction/languages/scala.js +209 -0
  216. package/sensor/dist/extraction/languages/scala.js.map +1 -0
  217. package/sensor/dist/extraction/languages/solidity.d.ts +3 -0
  218. package/sensor/dist/extraction/languages/solidity.d.ts.map +1 -0
  219. package/sensor/dist/extraction/languages/solidity.js +293 -0
  220. package/sensor/dist/extraction/languages/solidity.js.map +1 -0
  221. package/sensor/dist/extraction/languages/swift.d.ts +3 -0
  222. package/sensor/dist/extraction/languages/swift.d.ts.map +1 -0
  223. package/sensor/dist/extraction/languages/swift.js +152 -0
  224. package/sensor/dist/extraction/languages/swift.js.map +1 -0
  225. package/sensor/dist/extraction/languages/terraform.d.ts +3 -0
  226. package/sensor/dist/extraction/languages/terraform.d.ts.map +1 -0
  227. package/sensor/dist/extraction/languages/terraform.js +641 -0
  228. package/sensor/dist/extraction/languages/terraform.js.map +1 -0
  229. package/sensor/dist/extraction/languages/typescript.d.ts +16 -0
  230. package/sensor/dist/extraction/languages/typescript.d.ts.map +1 -0
  231. package/sensor/dist/extraction/languages/typescript.js +167 -0
  232. package/sensor/dist/extraction/languages/typescript.js.map +1 -0
  233. package/sensor/dist/extraction/languages/vbnet.d.ts +11 -0
  234. package/sensor/dist/extraction/languages/vbnet.d.ts.map +1 -0
  235. package/sensor/dist/extraction/languages/vbnet.js +141 -0
  236. package/sensor/dist/extraction/languages/vbnet.js.map +1 -0
  237. package/sensor/dist/extraction/liquid-extractor.d.ts +59 -0
  238. package/sensor/dist/extraction/liquid-extractor.d.ts.map +1 -0
  239. package/sensor/dist/extraction/liquid-extractor.js +357 -0
  240. package/sensor/dist/extraction/liquid-extractor.js.map +1 -0
  241. package/sensor/dist/extraction/mybatis-extractor.d.ts +68 -0
  242. package/sensor/dist/extraction/mybatis-extractor.d.ts.map +1 -0
  243. package/sensor/dist/extraction/mybatis-extractor.js +300 -0
  244. package/sensor/dist/extraction/mybatis-extractor.js.map +1 -0
  245. package/sensor/dist/extraction/parse-pool.d.ts +160 -0
  246. package/sensor/dist/extraction/parse-pool.d.ts.map +1 -0
  247. package/sensor/dist/extraction/parse-pool.js +402 -0
  248. package/sensor/dist/extraction/parse-pool.js.map +1 -0
  249. package/sensor/dist/extraction/parse-worker.d.ts +8 -0
  250. package/sensor/dist/extraction/parse-worker.d.ts.map +1 -0
  251. package/sensor/dist/extraction/parse-worker.js +138 -0
  252. package/sensor/dist/extraction/parse-worker.js.map +1 -0
  253. package/sensor/dist/extraction/razor-extractor.d.ts +42 -0
  254. package/sensor/dist/extraction/razor-extractor.d.ts.map +1 -0
  255. package/sensor/dist/extraction/razor-extractor.js +285 -0
  256. package/sensor/dist/extraction/razor-extractor.js.map +1 -0
  257. package/sensor/dist/extraction/spawn-invokes.d.ts +101 -0
  258. package/sensor/dist/extraction/spawn-invokes.d.ts.map +1 -0
  259. package/sensor/dist/extraction/spawn-invokes.js +327 -0
  260. package/sensor/dist/extraction/spawn-invokes.js.map +1 -0
  261. package/sensor/dist/extraction/store-worker.d.ts +24 -0
  262. package/sensor/dist/extraction/store-worker.d.ts.map +1 -0
  263. package/sensor/dist/extraction/store-worker.js +110 -0
  264. package/sensor/dist/extraction/store-worker.js.map +1 -0
  265. package/sensor/dist/extraction/store-writer.d.ts +63 -0
  266. package/sensor/dist/extraction/store-writer.d.ts.map +1 -0
  267. package/sensor/dist/extraction/store-writer.js +174 -0
  268. package/sensor/dist/extraction/store-writer.js.map +1 -0
  269. package/sensor/dist/extraction/svelte-extractor.d.ts +56 -0
  270. package/sensor/dist/extraction/svelte-extractor.d.ts.map +1 -0
  271. package/sensor/dist/extraction/svelte-extractor.js +275 -0
  272. package/sensor/dist/extraction/svelte-extractor.js.map +1 -0
  273. package/sensor/dist/extraction/tree-sitter-helpers.d.ts +28 -0
  274. package/sensor/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
  275. package/sensor/dist/extraction/tree-sitter-helpers.js +153 -0
  276. package/sensor/dist/extraction/tree-sitter-helpers.js.map +1 -0
  277. package/sensor/dist/extraction/tree-sitter-types.d.ts +258 -0
  278. package/sensor/dist/extraction/tree-sitter-types.d.ts.map +1 -0
  279. package/sensor/dist/extraction/tree-sitter-types.js +10 -0
  280. package/sensor/dist/extraction/tree-sitter-types.js.map +1 -0
  281. package/sensor/dist/extraction/tree-sitter.d.ts +724 -0
  282. package/sensor/dist/extraction/tree-sitter.d.ts.map +1 -0
  283. package/sensor/dist/extraction/tree-sitter.js +6721 -0
  284. package/sensor/dist/extraction/tree-sitter.js.map +1 -0
  285. package/sensor/dist/extraction/vue-extractor.d.ts +51 -0
  286. package/sensor/dist/extraction/vue-extractor.d.ts.map +1 -0
  287. package/sensor/dist/extraction/vue-extractor.js +254 -0
  288. package/sensor/dist/extraction/vue-extractor.js.map +1 -0
  289. package/sensor/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  290. package/sensor/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  291. package/sensor/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  292. package/sensor/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  293. package/sensor/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  294. package/sensor/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  295. package/sensor/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  296. package/sensor/dist/extraction/wasm/tree-sitter-go.wasm +0 -0
  297. package/sensor/dist/extraction/wasm/tree-sitter-java.wasm +0 -0
  298. package/sensor/dist/extraction/wasm/tree-sitter-javascript.wasm +0 -0
  299. package/sensor/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  300. package/sensor/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  301. package/sensor/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  302. package/sensor/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  303. package/sensor/dist/extraction/wasm/tree-sitter-python.wasm +0 -0
  304. package/sensor/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  305. package/sensor/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  306. package/sensor/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
  307. package/sensor/dist/extraction/wasm/tree-sitter-tsx.wasm +0 -0
  308. package/sensor/dist/extraction/wasm/tree-sitter-typescript.wasm +0 -0
  309. package/sensor/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  310. package/sensor/dist/extraction/wasm-runtime-flags.d.ts +53 -0
  311. package/sensor/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
  312. package/sensor/dist/extraction/wasm-runtime-flags.js +130 -0
  313. package/sensor/dist/extraction/wasm-runtime-flags.js.map +1 -0
  314. package/sensor/dist/graph/index.d.ts +8 -0
  315. package/sensor/dist/graph/index.d.ts.map +1 -0
  316. package/sensor/dist/graph/index.js +13 -0
  317. package/sensor/dist/graph/index.js.map +1 -0
  318. package/sensor/dist/graph/queries.d.ts +106 -0
  319. package/sensor/dist/graph/queries.d.ts.map +1 -0
  320. package/sensor/dist/graph/queries.js +339 -0
  321. package/sensor/dist/graph/queries.js.map +1 -0
  322. package/sensor/dist/graph/traversal.d.ts +127 -0
  323. package/sensor/dist/graph/traversal.d.ts.map +1 -0
  324. package/sensor/dist/graph/traversal.js +599 -0
  325. package/sensor/dist/graph/traversal.js.map +1 -0
  326. package/sensor/dist/index.d.ts +653 -0
  327. package/sensor/dist/index.d.ts.map +1 -0
  328. package/sensor/dist/index.js +1646 -0
  329. package/sensor/dist/index.js.map +1 -0
  330. package/sensor/dist/installer/beta-signup.d.ts +54 -0
  331. package/sensor/dist/installer/beta-signup.d.ts.map +1 -0
  332. package/sensor/dist/installer/beta-signup.js +178 -0
  333. package/sensor/dist/installer/beta-signup.js.map +1 -0
  334. package/sensor/dist/installer/config-writer.d.ts +28 -0
  335. package/sensor/dist/installer/config-writer.d.ts.map +1 -0
  336. package/sensor/dist/installer/config-writer.js +91 -0
  337. package/sensor/dist/installer/config-writer.js.map +1 -0
  338. package/sensor/dist/installer/index.d.ts +142 -0
  339. package/sensor/dist/installer/index.d.ts.map +1 -0
  340. package/sensor/dist/installer/index.js +622 -0
  341. package/sensor/dist/installer/index.js.map +1 -0
  342. package/sensor/dist/installer/instructions-template.d.ts +41 -0
  343. package/sensor/dist/installer/instructions-template.d.ts.map +1 -0
  344. package/sensor/dist/installer/instructions-template.js +53 -0
  345. package/sensor/dist/installer/instructions-template.js.map +1 -0
  346. package/sensor/dist/installer/targets/antigravity.d.ts +57 -0
  347. package/sensor/dist/installer/targets/antigravity.d.ts.map +1 -0
  348. package/sensor/dist/installer/targets/antigravity.js +308 -0
  349. package/sensor/dist/installer/targets/antigravity.js.map +1 -0
  350. package/sensor/dist/installer/targets/claude.d.ts +62 -0
  351. package/sensor/dist/installer/targets/claude.d.ts.map +1 -0
  352. package/sensor/dist/installer/targets/claude.js +454 -0
  353. package/sensor/dist/installer/targets/claude.js.map +1 -0
  354. package/sensor/dist/installer/targets/codex.d.ts +18 -0
  355. package/sensor/dist/installer/targets/codex.d.ts.map +1 -0
  356. package/sensor/dist/installer/targets/codex.js +185 -0
  357. package/sensor/dist/installer/targets/codex.js.map +1 -0
  358. package/sensor/dist/installer/targets/cursor.d.ts +35 -0
  359. package/sensor/dist/installer/targets/cursor.d.ts.map +1 -0
  360. package/sensor/dist/installer/targets/cursor.js +254 -0
  361. package/sensor/dist/installer/targets/cursor.js.map +1 -0
  362. package/sensor/dist/installer/targets/gemini.d.ts +26 -0
  363. package/sensor/dist/installer/targets/gemini.d.ts.map +1 -0
  364. package/sensor/dist/installer/targets/gemini.js +165 -0
  365. package/sensor/dist/installer/targets/gemini.js.map +1 -0
  366. package/sensor/dist/installer/targets/hermes.d.ts +18 -0
  367. package/sensor/dist/installer/targets/hermes.d.ts.map +1 -0
  368. package/sensor/dist/installer/targets/hermes.js +359 -0
  369. package/sensor/dist/installer/targets/hermes.js.map +1 -0
  370. package/sensor/dist/installer/targets/kiro.d.ts +27 -0
  371. package/sensor/dist/installer/targets/kiro.d.ts.map +1 -0
  372. package/sensor/dist/installer/targets/kiro.js +178 -0
  373. package/sensor/dist/installer/targets/kiro.js.map +1 -0
  374. package/sensor/dist/installer/targets/opencode.d.ts +38 -0
  375. package/sensor/dist/installer/targets/opencode.d.ts.map +1 -0
  376. package/sensor/dist/installer/targets/opencode.js +288 -0
  377. package/sensor/dist/installer/targets/opencode.js.map +1 -0
  378. package/sensor/dist/installer/targets/registry.d.ts +35 -0
  379. package/sensor/dist/installer/targets/registry.d.ts.map +1 -0
  380. package/sensor/dist/installer/targets/registry.js +91 -0
  381. package/sensor/dist/installer/targets/registry.js.map +1 -0
  382. package/sensor/dist/installer/targets/shared.d.ts +101 -0
  383. package/sensor/dist/installer/targets/shared.d.ts.map +1 -0
  384. package/sensor/dist/installer/targets/shared.js +264 -0
  385. package/sensor/dist/installer/targets/shared.js.map +1 -0
  386. package/sensor/dist/installer/targets/toml.d.ts +52 -0
  387. package/sensor/dist/installer/targets/toml.d.ts.map +1 -0
  388. package/sensor/dist/installer/targets/toml.js +147 -0
  389. package/sensor/dist/installer/targets/toml.js.map +1 -0
  390. package/sensor/dist/installer/targets/types.d.ts +108 -0
  391. package/sensor/dist/installer/targets/types.d.ts.map +1 -0
  392. package/sensor/dist/installer/targets/types.js +16 -0
  393. package/sensor/dist/installer/targets/types.js.map +1 -0
  394. package/sensor/dist/mcp/daemon-manager.d.ts +42 -0
  395. package/sensor/dist/mcp/daemon-manager.d.ts.map +1 -0
  396. package/sensor/dist/mcp/daemon-manager.js +129 -0
  397. package/sensor/dist/mcp/daemon-manager.js.map +1 -0
  398. package/sensor/dist/mcp/daemon-paths.d.ts +73 -0
  399. package/sensor/dist/mcp/daemon-paths.d.ts.map +1 -0
  400. package/sensor/dist/mcp/daemon-paths.js +170 -0
  401. package/sensor/dist/mcp/daemon-paths.js.map +1 -0
  402. package/sensor/dist/mcp/daemon-registry.d.ts +54 -0
  403. package/sensor/dist/mcp/daemon-registry.d.ts.map +1 -0
  404. package/sensor/dist/mcp/daemon-registry.js +241 -0
  405. package/sensor/dist/mcp/daemon-registry.js.map +1 -0
  406. package/sensor/dist/mcp/daemon.d.ts +290 -0
  407. package/sensor/dist/mcp/daemon.d.ts.map +1 -0
  408. package/sensor/dist/mcp/daemon.js +867 -0
  409. package/sensor/dist/mcp/daemon.js.map +1 -0
  410. package/sensor/dist/mcp/dynamic-boundaries.d.ts +41 -0
  411. package/sensor/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
  412. package/sensor/dist/mcp/dynamic-boundaries.js +360 -0
  413. package/sensor/dist/mcp/dynamic-boundaries.js.map +1 -0
  414. package/sensor/dist/mcp/early-ppid.d.ts +26 -0
  415. package/sensor/dist/mcp/early-ppid.d.ts.map +1 -0
  416. package/sensor/dist/mcp/early-ppid.js +29 -0
  417. package/sensor/dist/mcp/early-ppid.js.map +1 -0
  418. package/sensor/dist/mcp/engine.d.ts +130 -0
  419. package/sensor/dist/mcp/engine.d.ts.map +1 -0
  420. package/sensor/dist/mcp/engine.js +375 -0
  421. package/sensor/dist/mcp/engine.js.map +1 -0
  422. package/sensor/dist/mcp/index.d.ts +113 -0
  423. package/sensor/dist/mcp/index.d.ts.map +1 -0
  424. package/sensor/dist/mcp/index.js +551 -0
  425. package/sensor/dist/mcp/index.js.map +1 -0
  426. package/sensor/dist/mcp/liveness-watchdog.d.ts +35 -0
  427. package/sensor/dist/mcp/liveness-watchdog.d.ts.map +1 -0
  428. package/sensor/dist/mcp/liveness-watchdog.js +267 -0
  429. package/sensor/dist/mcp/liveness-watchdog.js.map +1 -0
  430. package/sensor/dist/mcp/ppid-watchdog.d.ts +62 -0
  431. package/sensor/dist/mcp/ppid-watchdog.d.ts.map +1 -0
  432. package/sensor/dist/mcp/ppid-watchdog.js +64 -0
  433. package/sensor/dist/mcp/ppid-watchdog.js.map +1 -0
  434. package/sensor/dist/mcp/proxy.d.ts +99 -0
  435. package/sensor/dist/mcp/proxy.d.ts.map +1 -0
  436. package/sensor/dist/mcp/proxy.js +737 -0
  437. package/sensor/dist/mcp/proxy.js.map +1 -0
  438. package/sensor/dist/mcp/query-pool.d.ts +108 -0
  439. package/sensor/dist/mcp/query-pool.d.ts.map +1 -0
  440. package/sensor/dist/mcp/query-pool.js +315 -0
  441. package/sensor/dist/mcp/query-pool.js.map +1 -0
  442. package/sensor/dist/mcp/query-worker.d.ts +24 -0
  443. package/sensor/dist/mcp/query-worker.d.ts.map +1 -0
  444. package/sensor/dist/mcp/query-worker.js +87 -0
  445. package/sensor/dist/mcp/query-worker.js.map +1 -0
  446. package/sensor/dist/mcp/server-instructions.d.ts +34 -0
  447. package/sensor/dist/mcp/server-instructions.d.ts.map +1 -0
  448. package/sensor/dist/mcp/server-instructions.js +106 -0
  449. package/sensor/dist/mcp/server-instructions.js.map +1 -0
  450. package/sensor/dist/mcp/session.d.ts +92 -0
  451. package/sensor/dist/mcp/session.d.ts.map +1 -0
  452. package/sensor/dist/mcp/session.js +355 -0
  453. package/sensor/dist/mcp/session.js.map +1 -0
  454. package/sensor/dist/mcp/startup-handshake.d.ts +44 -0
  455. package/sensor/dist/mcp/startup-handshake.d.ts.map +1 -0
  456. package/sensor/dist/mcp/startup-handshake.js +73 -0
  457. package/sensor/dist/mcp/startup-handshake.js.map +1 -0
  458. package/sensor/dist/mcp/stdin-teardown.d.ts +27 -0
  459. package/sensor/dist/mcp/stdin-teardown.d.ts.map +1 -0
  460. package/sensor/dist/mcp/stdin-teardown.js +49 -0
  461. package/sensor/dist/mcp/stdin-teardown.js.map +1 -0
  462. package/sensor/dist/mcp/tools.d.ts +651 -0
  463. package/sensor/dist/mcp/tools.d.ts.map +1 -0
  464. package/sensor/dist/mcp/tools.js +4574 -0
  465. package/sensor/dist/mcp/tools.js.map +1 -0
  466. package/sensor/dist/mcp/transport.d.ts +188 -0
  467. package/sensor/dist/mcp/transport.d.ts.map +1 -0
  468. package/sensor/dist/mcp/transport.js +377 -0
  469. package/sensor/dist/mcp/transport.js.map +1 -0
  470. package/sensor/dist/mcp/version.d.ts +30 -0
  471. package/sensor/dist/mcp/version.d.ts.map +1 -0
  472. package/sensor/dist/mcp/version.js +85 -0
  473. package/sensor/dist/mcp/version.js.map +1 -0
  474. package/sensor/dist/project-config.d.ts +94 -0
  475. package/sensor/dist/project-config.d.ts.map +1 -0
  476. package/sensor/dist/project-config.js +374 -0
  477. package/sensor/dist/project-config.js.map +1 -0
  478. package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts +6 -0
  479. package/sensor/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
  480. package/sensor/dist/resolution/c-fnptr-synthesizer.js +1070 -0
  481. package/sensor/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
  482. package/sensor/dist/resolution/callback-synthesizer.d.ts +59 -0
  483. package/sensor/dist/resolution/callback-synthesizer.d.ts.map +1 -0
  484. package/sensor/dist/resolution/callback-synthesizer.js +3961 -0
  485. package/sensor/dist/resolution/callback-synthesizer.js.map +1 -0
  486. package/sensor/dist/resolution/cooperative-yield.d.ts +40 -0
  487. package/sensor/dist/resolution/cooperative-yield.d.ts.map +1 -0
  488. package/sensor/dist/resolution/cooperative-yield.js +44 -0
  489. package/sensor/dist/resolution/cooperative-yield.js.map +1 -0
  490. package/sensor/dist/resolution/frameworks/astro.d.ts +9 -0
  491. package/sensor/dist/resolution/frameworks/astro.d.ts.map +1 -0
  492. package/sensor/dist/resolution/frameworks/astro.js +169 -0
  493. package/sensor/dist/resolution/frameworks/astro.js.map +1 -0
  494. package/sensor/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
  495. package/sensor/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
  496. package/sensor/dist/resolution/frameworks/cargo-workspace.js +225 -0
  497. package/sensor/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
  498. package/sensor/dist/resolution/frameworks/cics.d.ts +20 -0
  499. package/sensor/dist/resolution/frameworks/cics.d.ts.map +1 -0
  500. package/sensor/dist/resolution/frameworks/cics.js +90 -0
  501. package/sensor/dist/resolution/frameworks/cics.js.map +1 -0
  502. package/sensor/dist/resolution/frameworks/csharp.d.ts +8 -0
  503. package/sensor/dist/resolution/frameworks/csharp.d.ts.map +1 -0
  504. package/sensor/dist/resolution/frameworks/csharp.js +241 -0
  505. package/sensor/dist/resolution/frameworks/csharp.js.map +1 -0
  506. package/sensor/dist/resolution/frameworks/drupal.d.ts +51 -0
  507. package/sensor/dist/resolution/frameworks/drupal.d.ts.map +1 -0
  508. package/sensor/dist/resolution/frameworks/drupal.js +367 -0
  509. package/sensor/dist/resolution/frameworks/drupal.js.map +1 -0
  510. package/sensor/dist/resolution/frameworks/expo-modules.d.ts +3 -0
  511. package/sensor/dist/resolution/frameworks/expo-modules.d.ts.map +1 -0
  512. package/sensor/dist/resolution/frameworks/expo-modules.js +148 -0
  513. package/sensor/dist/resolution/frameworks/expo-modules.js.map +1 -0
  514. package/sensor/dist/resolution/frameworks/express.d.ts +8 -0
  515. package/sensor/dist/resolution/frameworks/express.d.ts.map +1 -0
  516. package/sensor/dist/resolution/frameworks/express.js +308 -0
  517. package/sensor/dist/resolution/frameworks/express.js.map +1 -0
  518. package/sensor/dist/resolution/frameworks/fabric.d.ts +3 -0
  519. package/sensor/dist/resolution/frameworks/fabric.d.ts.map +1 -0
  520. package/sensor/dist/resolution/frameworks/fabric.js +354 -0
  521. package/sensor/dist/resolution/frameworks/fabric.js.map +1 -0
  522. package/sensor/dist/resolution/frameworks/go.d.ts +8 -0
  523. package/sensor/dist/resolution/frameworks/go.d.ts.map +1 -0
  524. package/sensor/dist/resolution/frameworks/go.js +184 -0
  525. package/sensor/dist/resolution/frameworks/go.js.map +1 -0
  526. package/sensor/dist/resolution/frameworks/goframe.d.ts +41 -0
  527. package/sensor/dist/resolution/frameworks/goframe.d.ts.map +1 -0
  528. package/sensor/dist/resolution/frameworks/goframe.js +112 -0
  529. package/sensor/dist/resolution/frameworks/goframe.js.map +1 -0
  530. package/sensor/dist/resolution/frameworks/index.d.ts +50 -0
  531. package/sensor/dist/resolution/frameworks/index.d.ts.map +1 -0
  532. package/sensor/dist/resolution/frameworks/index.js +175 -0
  533. package/sensor/dist/resolution/frameworks/index.js.map +1 -0
  534. package/sensor/dist/resolution/frameworks/java.d.ts +8 -0
  535. package/sensor/dist/resolution/frameworks/java.d.ts.map +1 -0
  536. package/sensor/dist/resolution/frameworks/java.js +517 -0
  537. package/sensor/dist/resolution/frameworks/java.js.map +1 -0
  538. package/sensor/dist/resolution/frameworks/laravel.d.ts +13 -0
  539. package/sensor/dist/resolution/frameworks/laravel.d.ts.map +1 -0
  540. package/sensor/dist/resolution/frameworks/laravel.js +257 -0
  541. package/sensor/dist/resolution/frameworks/laravel.js.map +1 -0
  542. package/sensor/dist/resolution/frameworks/nestjs.d.ts +26 -0
  543. package/sensor/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
  544. package/sensor/dist/resolution/frameworks/nestjs.js +698 -0
  545. package/sensor/dist/resolution/frameworks/nestjs.js.map +1 -0
  546. package/sensor/dist/resolution/frameworks/play.d.ts +19 -0
  547. package/sensor/dist/resolution/frameworks/play.d.ts.map +1 -0
  548. package/sensor/dist/resolution/frameworks/play.js +111 -0
  549. package/sensor/dist/resolution/frameworks/play.js.map +1 -0
  550. package/sensor/dist/resolution/frameworks/python.d.ts +10 -0
  551. package/sensor/dist/resolution/frameworks/python.d.ts.map +1 -0
  552. package/sensor/dist/resolution/frameworks/python.js +400 -0
  553. package/sensor/dist/resolution/frameworks/python.js.map +1 -0
  554. package/sensor/dist/resolution/frameworks/react-native.d.ts +3 -0
  555. package/sensor/dist/resolution/frameworks/react-native.d.ts.map +1 -0
  556. package/sensor/dist/resolution/frameworks/react-native.js +410 -0
  557. package/sensor/dist/resolution/frameworks/react-native.js.map +1 -0
  558. package/sensor/dist/resolution/frameworks/react.d.ts +8 -0
  559. package/sensor/dist/resolution/frameworks/react.d.ts.map +1 -0
  560. package/sensor/dist/resolution/frameworks/react.js +334 -0
  561. package/sensor/dist/resolution/frameworks/react.js.map +1 -0
  562. package/sensor/dist/resolution/frameworks/ruby.d.ts +8 -0
  563. package/sensor/dist/resolution/frameworks/ruby.d.ts.map +1 -0
  564. package/sensor/dist/resolution/frameworks/ruby.js +302 -0
  565. package/sensor/dist/resolution/frameworks/ruby.js.map +1 -0
  566. package/sensor/dist/resolution/frameworks/rust.d.ts +8 -0
  567. package/sensor/dist/resolution/frameworks/rust.d.ts.map +1 -0
  568. package/sensor/dist/resolution/frameworks/rust.js +304 -0
  569. package/sensor/dist/resolution/frameworks/rust.js.map +1 -0
  570. package/sensor/dist/resolution/frameworks/svelte.d.ts +9 -0
  571. package/sensor/dist/resolution/frameworks/svelte.d.ts.map +1 -0
  572. package/sensor/dist/resolution/frameworks/svelte.js +253 -0
  573. package/sensor/dist/resolution/frameworks/svelte.js.map +1 -0
  574. package/sensor/dist/resolution/frameworks/swift-objc.d.ts +37 -0
  575. package/sensor/dist/resolution/frameworks/swift-objc.d.ts.map +1 -0
  576. package/sensor/dist/resolution/frameworks/swift-objc.js +252 -0
  577. package/sensor/dist/resolution/frameworks/swift-objc.js.map +1 -0
  578. package/sensor/dist/resolution/frameworks/swift.d.ts +10 -0
  579. package/sensor/dist/resolution/frameworks/swift.d.ts.map +1 -0
  580. package/sensor/dist/resolution/frameworks/swift.js +400 -0
  581. package/sensor/dist/resolution/frameworks/swift.js.map +1 -0
  582. package/sensor/dist/resolution/frameworks/terraform.d.ts +38 -0
  583. package/sensor/dist/resolution/frameworks/terraform.d.ts.map +1 -0
  584. package/sensor/dist/resolution/frameworks/terraform.js +277 -0
  585. package/sensor/dist/resolution/frameworks/terraform.js.map +1 -0
  586. package/sensor/dist/resolution/frameworks/vue.d.ts +9 -0
  587. package/sensor/dist/resolution/frameworks/vue.d.ts.map +1 -0
  588. package/sensor/dist/resolution/frameworks/vue.js +303 -0
  589. package/sensor/dist/resolution/frameworks/vue.js.map +1 -0
  590. package/sensor/dist/resolution/go-module.d.ts +26 -0
  591. package/sensor/dist/resolution/go-module.d.ts.map +1 -0
  592. package/sensor/dist/resolution/go-module.js +78 -0
  593. package/sensor/dist/resolution/go-module.js.map +1 -0
  594. package/sensor/dist/resolution/goframe-synthesizer.d.ts +29 -0
  595. package/sensor/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
  596. package/sensor/dist/resolution/goframe-synthesizer.js +163 -0
  597. package/sensor/dist/resolution/goframe-synthesizer.js.map +1 -0
  598. package/sensor/dist/resolution/import-resolver.d.ts +84 -0
  599. package/sensor/dist/resolution/import-resolver.d.ts.map +1 -0
  600. package/sensor/dist/resolution/import-resolver.js +2172 -0
  601. package/sensor/dist/resolution/import-resolver.js.map +1 -0
  602. package/sensor/dist/resolution/index.d.ts +309 -0
  603. package/sensor/dist/resolution/index.d.ts.map +1 -0
  604. package/sensor/dist/resolution/index.js +2050 -0
  605. package/sensor/dist/resolution/index.js.map +1 -0
  606. package/sensor/dist/resolution/lru-cache.d.ts +24 -0
  607. package/sensor/dist/resolution/lru-cache.d.ts.map +1 -0
  608. package/sensor/dist/resolution/lru-cache.js +62 -0
  609. package/sensor/dist/resolution/lru-cache.js.map +1 -0
  610. package/sensor/dist/resolution/name-matcher.d.ts +126 -0
  611. package/sensor/dist/resolution/name-matcher.d.ts.map +1 -0
  612. package/sensor/dist/resolution/name-matcher.js +1968 -0
  613. package/sensor/dist/resolution/name-matcher.js.map +1 -0
  614. package/sensor/dist/resolution/path-aliases.d.ts +68 -0
  615. package/sensor/dist/resolution/path-aliases.d.ts.map +1 -0
  616. package/sensor/dist/resolution/path-aliases.js +238 -0
  617. package/sensor/dist/resolution/path-aliases.js.map +1 -0
  618. package/sensor/dist/resolution/resolver-pool.d.ts +66 -0
  619. package/sensor/dist/resolution/resolver-pool.d.ts.map +1 -0
  620. package/sensor/dist/resolution/resolver-pool.js +244 -0
  621. package/sensor/dist/resolution/resolver-pool.js.map +1 -0
  622. package/sensor/dist/resolution/resolver-worker.d.ts +17 -0
  623. package/sensor/dist/resolution/resolver-worker.d.ts.map +1 -0
  624. package/sensor/dist/resolution/resolver-worker.js +114 -0
  625. package/sensor/dist/resolution/resolver-worker.js.map +1 -0
  626. package/sensor/dist/resolution/strip-comments.d.ts +27 -0
  627. package/sensor/dist/resolution/strip-comments.d.ts.map +1 -0
  628. package/sensor/dist/resolution/strip-comments.js +492 -0
  629. package/sensor/dist/resolution/strip-comments.js.map +1 -0
  630. package/sensor/dist/resolution/swift-objc-bridge.d.ts +134 -0
  631. package/sensor/dist/resolution/swift-objc-bridge.d.ts.map +1 -0
  632. package/sensor/dist/resolution/swift-objc-bridge.js +256 -0
  633. package/sensor/dist/resolution/swift-objc-bridge.js.map +1 -0
  634. package/sensor/dist/resolution/types.d.ts +265 -0
  635. package/sensor/dist/resolution/types.d.ts.map +1 -0
  636. package/sensor/dist/resolution/types.js +8 -0
  637. package/sensor/dist/resolution/types.js.map +1 -0
  638. package/sensor/dist/resolution/workspace-packages.d.ts +58 -0
  639. package/sensor/dist/resolution/workspace-packages.d.ts.map +1 -0
  640. package/sensor/dist/resolution/workspace-packages.js +346 -0
  641. package/sensor/dist/resolution/workspace-packages.js.map +1 -0
  642. package/sensor/dist/search/identifier-segments.d.ts +60 -0
  643. package/sensor/dist/search/identifier-segments.d.ts.map +1 -0
  644. package/sensor/dist/search/identifier-segments.js +176 -0
  645. package/sensor/dist/search/identifier-segments.js.map +1 -0
  646. package/sensor/dist/search/query-parser.d.ts +57 -0
  647. package/sensor/dist/search/query-parser.d.ts.map +1 -0
  648. package/sensor/dist/search/query-parser.js +177 -0
  649. package/sensor/dist/search/query-parser.js.map +1 -0
  650. package/sensor/dist/search/query-utils.d.ts +87 -0
  651. package/sensor/dist/search/query-utils.d.ts.map +1 -0
  652. package/sensor/dist/search/query-utils.js +449 -0
  653. package/sensor/dist/search/query-utils.js.map +1 -0
  654. package/sensor/dist/sync/git-hooks.d.ts +45 -0
  655. package/sensor/dist/sync/git-hooks.d.ts.map +1 -0
  656. package/sensor/dist/sync/git-hooks.js +227 -0
  657. package/sensor/dist/sync/git-hooks.js.map +1 -0
  658. package/sensor/dist/sync/index.d.ts +19 -0
  659. package/sensor/dist/sync/index.d.ts.map +1 -0
  660. package/sensor/dist/sync/index.js +35 -0
  661. package/sensor/dist/sync/index.js.map +1 -0
  662. package/sensor/dist/sync/watch-policy.d.ts +48 -0
  663. package/sensor/dist/sync/watch-policy.d.ts.map +1 -0
  664. package/sensor/dist/sync/watch-policy.js +124 -0
  665. package/sensor/dist/sync/watch-policy.js.map +1 -0
  666. package/sensor/dist/sync/watcher.d.ts +372 -0
  667. package/sensor/dist/sync/watcher.d.ts.map +1 -0
  668. package/sensor/dist/sync/watcher.js +879 -0
  669. package/sensor/dist/sync/watcher.js.map +1 -0
  670. package/sensor/dist/sync/worktree.d.ts +63 -0
  671. package/sensor/dist/sync/worktree.d.ts.map +1 -0
  672. package/sensor/dist/sync/worktree.js +182 -0
  673. package/sensor/dist/sync/worktree.js.map +1 -0
  674. package/sensor/dist/telemetry/index.d.ts +157 -0
  675. package/sensor/dist/telemetry/index.d.ts.map +1 -0
  676. package/sensor/dist/telemetry/index.js +556 -0
  677. package/sensor/dist/telemetry/index.js.map +1 -0
  678. package/sensor/dist/types.d.ts +458 -0
  679. package/sensor/dist/types.d.ts.map +1 -0
  680. package/sensor/dist/types.js +117 -0
  681. package/sensor/dist/types.js.map +1 -0
  682. package/sensor/dist/ui/color.d.ts +21 -0
  683. package/sensor/dist/ui/color.d.ts.map +1 -0
  684. package/sensor/dist/ui/color.js +42 -0
  685. package/sensor/dist/ui/color.js.map +1 -0
  686. package/sensor/dist/ui/glyphs.d.ts +67 -0
  687. package/sensor/dist/ui/glyphs.d.ts.map +1 -0
  688. package/sensor/dist/ui/glyphs.js +125 -0
  689. package/sensor/dist/ui/glyphs.js.map +1 -0
  690. package/sensor/dist/ui/shimmer-progress.d.ts +11 -0
  691. package/sensor/dist/ui/shimmer-progress.d.ts.map +1 -0
  692. package/sensor/dist/ui/shimmer-progress.js +164 -0
  693. package/sensor/dist/ui/shimmer-progress.js.map +1 -0
  694. package/sensor/dist/ui/shimmer-worker.d.ts +2 -0
  695. package/sensor/dist/ui/shimmer-worker.d.ts.map +1 -0
  696. package/sensor/dist/ui/shimmer-worker.js +126 -0
  697. package/sensor/dist/ui/shimmer-worker.js.map +1 -0
  698. package/sensor/dist/ui/types.d.ts +15 -0
  699. package/sensor/dist/ui/types.d.ts.map +1 -0
  700. package/sensor/dist/ui/types.js +3 -0
  701. package/sensor/dist/ui/types.js.map +1 -0
  702. package/sensor/dist/upgrade/index.d.ts +171 -0
  703. package/sensor/dist/upgrade/index.d.ts.map +1 -0
  704. package/sensor/dist/upgrade/index.js +659 -0
  705. package/sensor/dist/upgrade/index.js.map +1 -0
  706. package/sensor/dist/upgrade/remove-binary.d.ts +87 -0
  707. package/sensor/dist/upgrade/remove-binary.d.ts.map +1 -0
  708. package/sensor/dist/upgrade/remove-binary.js +289 -0
  709. package/sensor/dist/upgrade/remove-binary.js.map +1 -0
  710. package/sensor/dist/upgrade/update-check.d.ts +92 -0
  711. package/sensor/dist/upgrade/update-check.d.ts.map +1 -0
  712. package/sensor/dist/upgrade/update-check.js +258 -0
  713. package/sensor/dist/upgrade/update-check.js.map +1 -0
  714. package/sensor/dist/utils.d.ts +224 -0
  715. package/sensor/dist/utils.d.ts.map +1 -0
  716. package/sensor/dist/utils.js +583 -0
  717. package/sensor/dist/utils.js.map +1 -0
  718. package/sensor/package.json +61 -0
  719. package/src/artifact-contracts-v2.mjs +325 -0
  720. package/src/artifact-contracts.mjs +895 -0
  721. package/src/bootstrap.mjs +88 -0
  722. package/src/boundary-compiler.mjs +712 -0
  723. package/src/boundary-observation-compiler-v2.mjs +339 -0
  724. package/src/codegraph-adapter.mjs +422 -0
  725. package/src/control-compiler.mjs +532 -0
  726. package/src/factory-diagnostics.mjs +187 -0
  727. package/src/isolation-runner.mjs +333 -0
  728. package/src/node-version-guard.mjs +43 -0
  729. package/src/rc1-black-box-oracle.mjs +906 -0
  730. package/src/rc1-comparison.mjs +154 -0
  731. package/src/rc1-evidence-bundle.mjs +456 -0
  732. package/src/rc1-v4-campaign.mjs +707 -0
  733. package/src/rc1-v4-transform.mjs +467 -0
  734. package/src/rc1-v5-artifact-set.mjs +855 -0
  735. package/src/rc1-v5-behavior-evidence.mjs +594 -0
  736. package/src/rc1-v5-campaign.mjs +796 -0
  737. package/src/rc1-v5-transform.mjs +421 -0
  738. package/src/rc1-v6-artifact-set.mjs +807 -0
  739. package/src/rc1-v6-behavior-evidence.mjs +273 -0
  740. package/src/rc1-v6-campaign.mjs +623 -0
  741. package/src/rc1-v6-causal-binding.mjs +471 -0
  742. package/src/rc1-v6-measurement.mjs +331 -0
  743. package/src/rc2-artifact-set.mjs +1579 -0
  744. package/src/rc2-campaign.mjs +1520 -0
  745. package/src/rc2-delivery-policy-front-end.mjs +1079 -0
  746. package/src/rc2-delivery-policy-oracle.mjs +134 -0
  747. package/src/rc2-delivery-policy-transform.mjs +1127 -0
  748. package/src/rc2-rc1-transfer-front-end.mjs +511 -0
  749. package/src/rc3-actual-dogfood.mjs +648 -0
  750. package/src/rc3-dogfood-scaffold.mjs +310 -0
  751. package/src/rc3-scripted-campaign.mjs +1301 -0
  752. package/src/rc4-stage1-dogfood.mjs +652 -0
  753. package/src/runtime-cli.mjs +504 -0
  754. package/src/runtime-contracts.mjs +631 -0
  755. package/src/runtime-decision-verifier.mjs +607 -0
  756. package/src/runtime-diff-observer.mjs +265 -0
  757. package/src/runtime-engine.mjs +674 -0
  758. package/src/runtime-errors.mjs +356 -0
  759. package/src/runtime-event-store.mjs +217 -0
  760. package/src/runtime-front-end.mjs +764 -0
  761. package/src/runtime-hold-recompile.mjs +606 -0
  762. package/src/runtime-projection.mjs +180 -0
  763. package/src/runtime-scripted-executor.mjs +163 -0
  764. package/src/runtime-worktree-executor.mjs +199 -0
  765. package/src/schedulability-compiler-v2.mjs +303 -0
  766. package/src/schedulability-verifier-v2.mjs +317 -0
  767. package/src/seam-transform.mjs +554 -0
  768. package/src/treatment-compiler.mjs +728 -0
  769. package/src/treatment-runner.mjs +658 -0
@@ -0,0 +1,878 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cppExtractor = exports.cExtractor = void 0;
4
+ exports.normalizeCppReturnType = normalizeCppReturnType;
5
+ exports.stripCppTemplateArgs = stripCppTemplateArgs;
6
+ exports.blankCppExportMacros = blankCppExportMacros;
7
+ exports.blankCppInlineMacros = blankCppInlineMacros;
8
+ exports.recoverMangledCppName = recoverMangledCppName;
9
+ exports.blankMetalAttributes = blankMetalAttributes;
10
+ exports.blankCppAnnotationMacroCalls = blankCppAnnotationMacroCalls;
11
+ exports.blankCppApiPrefixMacros = blankCppApiPrefixMacros;
12
+ exports.blankCppInlineAnnotationMacros = blankCppInlineAnnotationMacros;
13
+ exports.blankCudaConstructs = blankCudaConstructs;
14
+ exports.blankCLeadingAttrMacros = blankCLeadingAttrMacros;
15
+ const tree_sitter_helpers_1 = require("../tree-sitter-helpers");
16
+ /**
17
+ * Find the function NAME's `qualified_identifier` (`Foo::bar`) inside a
18
+ * declarator, skipping the `parameter_list` — a parameter with a qualified type
19
+ * (`const std::string& x`) must NOT be mistaken for the method name. Without the
20
+ * skip, a plain free function `std::string TableFileName(const std::string&...)`
21
+ * was named `string` (from the parameter type), so calls to it never resolved
22
+ * and its file looked like nothing depended on it.
23
+ */
24
+ function findDeclaratorQualifiedId(declarator) {
25
+ const queue = [declarator];
26
+ while (queue.length > 0) {
27
+ const current = queue.shift();
28
+ if (current.type === 'qualified_identifier')
29
+ return current;
30
+ for (let i = 0; i < current.namedChildCount; i++) {
31
+ const child = current.namedChild(i);
32
+ // Don't descend into parameters or the trailing return type — their types
33
+ // (`const std::string&`, `-> std::string`) aren't the function name.
34
+ if (child && child.type !== 'parameter_list' && child.type !== 'trailing_return_type') {
35
+ queue.push(child);
36
+ }
37
+ }
38
+ }
39
+ return undefined;
40
+ }
41
+ /**
42
+ * Recover the real function name from the macro-definition idiom
43
+ * `MACRO_NAME(real_name, typed args…) { body }` — flash-attention's
44
+ * `DEFINE_FLASH_FORWARD_KERNEL(flash_fwd_kernel, bool Is_dropout, …) { … }`
45
+ * being the motivating case: tree-sitter parses the invocation as a
46
+ * function_definition NAMED after the macro, so every such kernel shared one
47
+ * name (`DEFINE_FLASH_FORWARD_KERNEL`) and the launch sites' calls to the real
48
+ * names (`flash_fwd_kernel<…><<<…>>>`) could never resolve.
49
+ *
50
+ * Deliberately narrow so name-in-first-arg is unambiguous — ALL of:
51
+ * - the parsed name is macro-shaped: ALL-CAPS with at least one underscore
52
+ * (`TEST` never matches; K&R C definitions have lowercase names);
53
+ * - the first "parameter" is a LONE identifier (no type, no declarator)
54
+ * containing a lowercase letter — the name being defined;
55
+ * - at least one more parameter follows and NONE of them is another lone
56
+ * identifier — a second bare arg means the first isn't the name (gtest's
57
+ * `TEST_F(Fixture, Name)`, `PYBIND11_MODULE(ext, m)`,
58
+ * google-benchmark's `BENCHMARK_DEFINE_F(Fix, name)` all bail here).
59
+ */
60
+ function recoverCppMacroDefinedName(node, source) {
61
+ if (node.type !== 'function_definition')
62
+ return undefined;
63
+ const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
64
+ if (declarator?.type !== 'function_declarator')
65
+ return undefined;
66
+ const inner = (0, tree_sitter_helpers_1.getChildByField)(declarator, 'declarator');
67
+ if (inner?.type !== 'identifier')
68
+ return undefined;
69
+ const macroName = (0, tree_sitter_helpers_1.getNodeText)(inner, source);
70
+ if (!/^[A-Z][A-Z0-9]*(?:_[A-Z0-9]+)+$/.test(macroName))
71
+ return undefined;
72
+ const params = (0, tree_sitter_helpers_1.getChildByField)(declarator, 'parameters');
73
+ if (!params || params.namedChildCount < 2)
74
+ return undefined;
75
+ const loneIdentText = (p) => p.type === 'parameter_declaration' &&
76
+ p.namedChildCount === 1 &&
77
+ p.namedChild(0)?.type === 'type_identifier'
78
+ ? (0, tree_sitter_helpers_1.getNodeText)(p.namedChild(0), source)
79
+ : null;
80
+ const first = params.namedChild(0);
81
+ const name = first ? loneIdentText(first) : null;
82
+ if (!name || !/[a-z]/.test(name))
83
+ return undefined;
84
+ for (let i = 1; i < params.namedChildCount; i++) {
85
+ const p = params.namedChild(i);
86
+ if (p && loneIdentText(p) !== null)
87
+ return undefined;
88
+ }
89
+ return name;
90
+ }
91
+ function extractCppQualifiedMethodName(node, source) {
92
+ const macroDefined = recoverCppMacroDefinedName(node, source);
93
+ if (macroDefined)
94
+ return macroDefined;
95
+ const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
96
+ if (!declarator)
97
+ return undefined;
98
+ const qid = findDeclaratorQualifiedId(declarator);
99
+ if (!qid)
100
+ return undefined;
101
+ const parts = (0, tree_sitter_helpers_1.getNodeText)(qid, source).trim().split('::').filter(Boolean);
102
+ return parts[parts.length - 1];
103
+ }
104
+ function extractCppReceiverType(node, source) {
105
+ const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
106
+ if (!declarator)
107
+ return undefined;
108
+ const qid = findDeclaratorQualifiedId(declarator);
109
+ if (!qid)
110
+ return undefined;
111
+ const parts = (0, tree_sitter_helpers_1.getNodeText)(qid, source).trim().split('::').filter(Boolean);
112
+ if (parts.length <= 1)
113
+ return undefined;
114
+ // An out-of-line template method definition carries the class's template
115
+ // parameter list in the qualifier (`template<typename T> T Box<T>::get()`),
116
+ // but the class node is indexed as bare `Box` — strip `<…>` so the receiver
117
+ // matches it, the same normalization #1043 applies to base-class refs.
118
+ // Multi-line parameter lists otherwise leak whole `<…>` blocks (newlines
119
+ // included) into qualified_name, which can exceed NAME_MAX (#1286).
120
+ const receiver = stripCppTemplateArgs(parts.slice(0, -1).join('::'));
121
+ return receiver || undefined;
122
+ }
123
+ /**
124
+ * Built-in / non-class return types that can never be a method receiver. We
125
+ * store no `returnType` for these so resolution never tries to resolve a method
126
+ * on `void` / `int` / etc.
127
+ */
128
+ const CPP_NON_CLASS_RETURN = new Set([
129
+ 'void', 'bool', 'char', 'short', 'int', 'long', 'float', 'double', 'unsigned',
130
+ 'signed', 'size_t', 'ssize_t', 'auto', 'wchar_t', 'char8_t', 'char16_t',
131
+ 'char32_t', 'int8_t', 'int16_t', 'int32_t', 'int64_t', 'uint8_t', 'uint16_t',
132
+ 'uint32_t', 'uint64_t', 'intptr_t', 'uintptr_t', 'nullptr_t',
133
+ ]);
134
+ /**
135
+ * Normalize a C++ return type to the bare class name a method could be called
136
+ * on. Unwraps smart-pointer / optional wrappers to their element type
137
+ * (`std::unique_ptr<Widget>` → `Widget`) so a factory's `->method()` resolves on
138
+ * the pointee. Strips cv-qualifiers, `&`/`*`, namespace qualifiers, and other
139
+ * template args. Returns undefined for primitives / void / `auto` / empty.
140
+ */
141
+ function normalizeCppReturnType(raw) {
142
+ let t = raw.trim();
143
+ if (!t)
144
+ return undefined;
145
+ // Unwrap smart pointers / optional to their pointee (the thing you call `->` on).
146
+ const wrapper = t.match(/\b(?:std\s*::\s*)?(?:unique_ptr|shared_ptr|weak_ptr|optional)\s*<\s*([^,>]+?)\s*>/);
147
+ if (wrapper && wrapper[1])
148
+ t = wrapper[1];
149
+ t = t
150
+ .replace(/\b(?:const|volatile|typename|struct|class|enum)\b/g, ' ')
151
+ .replace(/<[^>]*>/g, ' ')
152
+ .replace(/[*&]+/g, ' ')
153
+ .replace(/\s+/g, ' ')
154
+ .trim();
155
+ if (!t)
156
+ return undefined;
157
+ const last = t.split('::').filter(Boolean).pop();
158
+ if (!last)
159
+ return undefined;
160
+ if (CPP_NON_CLASS_RETURN.has(last))
161
+ return undefined;
162
+ if (!/^[A-Za-z_]\w*$/.test(last))
163
+ return undefined;
164
+ return last;
165
+ }
166
+ /**
167
+ * Strip C++ template arguments from a base-type reference name so it matches the
168
+ * bare class/struct the template was DEFINED as. `template<typename T> class
169
+ * Base { … }` is indexed as a node named `Base`, but a derived class
170
+ * `class D : public Base<int>` records its base as the full `Base<int>` (and
171
+ * `class Q : public ns::Tpl<int>` as `ns::Tpl<int>`) — neither name-matches
172
+ * `Base` / `ns::Tpl`, so the `extends` edge never resolves and the derived class
173
+ * looks like it inherits from nothing (#1043).
174
+ *
175
+ * Removes every balanced `<…>` group regardless of nesting or position, so
176
+ * `Base<int>` → `Base`, `ns::Tpl<Foo<int>>` → `ns::Tpl`, and the rare
177
+ * `Outer<int>::Inner` → `Outer::Inner`. The remaining qualified head is exactly
178
+ * what the non-templated base case already produces, so resolution treats them
179
+ * identically. A name with no template args passes through unchanged.
180
+ */
181
+ function stripCppTemplateArgs(name) {
182
+ if (!name.includes('<'))
183
+ return name;
184
+ let out = '';
185
+ let depth = 0;
186
+ for (const ch of name) {
187
+ if (ch === '<')
188
+ depth++;
189
+ else if (ch === '>') {
190
+ if (depth > 0)
191
+ depth--;
192
+ }
193
+ else if (depth === 0)
194
+ out += ch;
195
+ }
196
+ return out.trim();
197
+ }
198
+ /**
199
+ * A function/method's return type lives in the `function_definition`'s `type`
200
+ * field (`Metrics& Metrics::instance()` → `Metrics`). Constructors, destructors,
201
+ * and conversion operators have no `type` field → undefined.
202
+ */
203
+ function extractCppReturnType(node, source) {
204
+ const typeNode = (0, tree_sitter_helpers_1.getChildByField)(node, 'type');
205
+ if (!typeNode)
206
+ return undefined;
207
+ return normalizeCppReturnType((0, tree_sitter_helpers_1.getNodeText)(typeNode, source));
208
+ }
209
+ exports.cExtractor = {
210
+ // CUDA in C-detected headers (content-gated blank; see preParseCSource).
211
+ preParse: preParseCSource,
212
+ // Universal net: recover a real name from any macro-mangled function name.
213
+ recoverMangledName: recoverMangledCppName,
214
+ functionTypes: ['function_definition'],
215
+ classTypes: [],
216
+ methodTypes: [],
217
+ interfaceTypes: [],
218
+ structTypes: ['struct_specifier'],
219
+ enumTypes: ['enum_specifier'],
220
+ enumMemberTypes: ['enumerator'],
221
+ typeAliasTypes: ['type_definition'], // typedef
222
+ importTypes: ['preproc_include'],
223
+ callTypes: ['call_expression'],
224
+ variableTypes: ['declaration'],
225
+ nameField: 'declarator',
226
+ bodyField: 'body',
227
+ paramsField: 'parameters',
228
+ // A `const`/`static const` file-scope declaration carries a `type_qualifier`
229
+ // child reading "const" — extract those as `constant`, plain globals as
230
+ // `variable`.
231
+ isConst: (node) => node.namedChildren.some((c) => c.type === 'type_qualifier' && c.text === 'const'),
232
+ getReturnType: extractCppReturnType,
233
+ resolveTypeAliasKind: (node, _source) => {
234
+ // C typedef: `typedef enum { ... } name;` or `typedef struct { ... } name;`
235
+ // The inner enum_specifier/struct_specifier is anonymous, but we want the typedef name
236
+ // to become the enum/struct node name.
237
+ for (let i = 0; i < node.namedChildCount; i++) {
238
+ const child = node.namedChild(i);
239
+ if (!child)
240
+ continue;
241
+ if (child.type === 'enum_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
242
+ return 'enum';
243
+ if (child.type === 'struct_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
244
+ return 'struct';
245
+ }
246
+ return undefined;
247
+ },
248
+ extractImport: (node, source) => {
249
+ const importText = source.substring(node.startIndex, node.endIndex).trim();
250
+ // C includes: #include <stdio.h>, #include "myheader.h"
251
+ const systemLib = node.namedChildren.find((c) => c.type === 'system_lib_string');
252
+ if (systemLib) {
253
+ return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(systemLib, source).replace(/^<|>$/g, ''), signature: importText };
254
+ }
255
+ const stringLiteral = node.namedChildren.find((c) => c.type === 'string_literal');
256
+ if (stringLiteral) {
257
+ const stringContent = stringLiteral.namedChildren.find((c) => c.type === 'string_content');
258
+ if (stringContent) {
259
+ return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(stringContent, source), signature: importText };
260
+ }
261
+ }
262
+ return null;
263
+ },
264
+ };
265
+ /**
266
+ * Detect tree-sitter's misparse of a macro-annotated class/struct, e.g.
267
+ * `class MACRO Name { … }` or `class MACRO Name : public Base { … }` (#946).
268
+ * Not knowing `MACRO` is a macro, tree-sitter reads `class MACRO` as an
269
+ * *elaborated type specifier* (a bodyless `class_specifier`/`struct_specifier`
270
+ * whose "type name" is the macro) and the rest as a function: `Name` becomes the
271
+ * declarator and the `{ … }` a function body — so the whole declaration surfaces
272
+ * as a `function_definition` named after the class, with a line range spanning
273
+ * the entire class body. (A base clause, when present, additionally lands in an
274
+ * `ERROR` node, but it isn't required — the leading macro alone triggers this.)
275
+ *
276
+ * Two structural signals pin it down with no risk to genuine code:
277
+ * - the `type` field is a *bodyless* class/struct specifier — an elaborated
278
+ * type, not a real inline-defined return type like
279
+ * `struct P { int x; } makeP() { … }` (which carries a field list); and
280
+ * - the declarator is not a `function_declarator` — a real function definition
281
+ * always has one, which also leaves the legal-but-rare `class Foo f() { … }`
282
+ * (an elaborated return type on a genuine function) alone.
283
+ *
284
+ * The class body is mangled by the same misparse and is unrecoverable, so —
285
+ * matching how macro-prefixed C prototypes are handled — we drop the spurious
286
+ * node rather than mint a misleading whole-body `function` that pollutes
287
+ * callers/impact and skews kind statistics.
288
+ */
289
+ function isMacroMisparsedTypeDecl(node) {
290
+ const typeNode = (0, tree_sitter_helpers_1.getChildByField)(node, 'type');
291
+ if (!typeNode)
292
+ return false;
293
+ if (typeNode.type !== 'class_specifier' && typeNode.type !== 'struct_specifier')
294
+ return false;
295
+ if (typeNode.namedChildren.some((c) => c.type === 'field_declaration_list'))
296
+ return false;
297
+ const declarator = (0, tree_sitter_helpers_1.getChildByField)(node, 'declarator');
298
+ if (declarator && declarator.type === 'function_declarator')
299
+ return false;
300
+ return true;
301
+ }
302
+ /**
303
+ * Blank an export/visibility macro in a `class/struct EXPORT_MACRO Name …`
304
+ * *definition* header before parsing. Not knowing the macro, tree-sitter reads
305
+ * `class EXPORT_MACRO` as an elaborated type specifier and the rest as a
306
+ * function, so the whole class — its name, base clause, and members — drops out
307
+ * of the index (#946 catches the resulting phantom function but can't recover
308
+ * the class), which silently breaks type-hierarchy / inheritance-impact queries
309
+ * for effectively every Unreal-Engine (`*_API`), Qt/Boost (`*_EXPORT`), LLVM
310
+ * (`*_ABI`), … class. Replacing the macro with equal-length spaces preserves
311
+ * every byte offset (and thus line/column), so the declaration then parses as a
312
+ * normal class_specifier and the existing extraction emits the node, members,
313
+ * and `extends` edge. (#1061, follow-up to #946.)
314
+ *
315
+ * Matched tightly so it can't touch the same macro used as an ordinary value
316
+ * elsewhere (`int x = SOME_API;`): the macro is the ALL-CAPS token sitting
317
+ * *between* `class`/`struct` and the type name, and the trailing `[:{]`
318
+ * definition-guard fires only when a base clause or body follows — the only
319
+ * shape that misparses. That guard also leaves elaborated-type variable
320
+ * declarations (`struct FOO var;`, `class FOO obj = …`) untouched, since those
321
+ * end in `;` / `=` / `[`, never `:` / `{`. C++-only (wired into cppExtractor),
322
+ * so C's heavier use of `struct TAG var;` never reaches it.
323
+ */
324
+ function blankCppExportMacros(source) {
325
+ if (source.indexOf('class') === -1 && source.indexOf('struct') === -1)
326
+ return source;
327
+ return source.replace(/\b(class|struct)(\s+)([A-Z][A-Z0-9_]+)(?=\s+[A-Za-z_]\w*(?:\s+final)?\s*[:{])/g, (_m, kw, ws, macro) => kw + ws + ' '.repeat(macro.length));
328
+ }
329
+ /**
330
+ * Blank a known inline-specifier macro sitting in front of a function's return
331
+ * type (`FORCEINLINE FString GetName(…)`), before parsing. Not knowing the
332
+ * macro, tree-sitter can't reconcile `MACRO <return-type> <name>(` — an extra
333
+ * type-like token before the name — and drops into error recovery: the macro
334
+ * becomes the return type and, for a non-primitive return, the return type gets
335
+ * glued onto the name (`GetName` → `"FString GetName"`), so the function can't
336
+ * be found by name and its callers don't link. This is pervasive in Unreal
337
+ * Engine (`FORCEINLINE <ret> <name>(…)`) and in vendored third-party libraries
338
+ * that define their own inline macro (pugixml's `PUGI__FN`, Godot's
339
+ * `_FORCE_INLINE_`, Boost's `BOOST_FORCEINLINE`, …). Replacing the macro with
340
+ * equal-length spaces preserves every byte offset (so line/column stay exact)
341
+ * and the declaration then parses as an ordinary function — recovering the real
342
+ * name AND the return type — mirroring how `blankCppExportMacros` recovers
343
+ * macro-annotated classes (#946/#1061).
344
+ *
345
+ * Matched tightly so it can't touch an ordinary identifier: only the exact,
346
+ * curated inline-specifier tokens below (never an arbitrary all-caps token, so a
347
+ * real return type like `HRESULT DoIt()` is untouched), and only in specifier
348
+ * position — immediately followed by whitespace and the identifier that starts
349
+ * the return type or name. That lookahead leaves value/expression uses
350
+ * (`x = FORCEINLINE ? …`), string literals, and longer words
351
+ * (`FORCEINLINE_SOMETHINGELSE`, word-boundary) alone. To cover a new codebase's
352
+ * inline macro, add its exact token to the list.
353
+ */
354
+ const CPP_INLINE_MACROS = [
355
+ // Unreal Engine
356
+ 'FORCEINLINE_DEBUGGABLE', 'FORCENOINLINE', 'FORCEINLINE',
357
+ // pugixml (ubiquitous vendored XML parser): `#define PUGI__FN inline` before
358
+ // the return type, plus `PUGIXML_FUNCTION` (linkage macro) between the return
359
+ // type and the name — the blank mechanism handles both positions.
360
+ 'PUGI__FN_NO_INLINE', 'PUGI__FN', 'PUGIXML_FUNCTION',
361
+ // Godot
362
+ '_ALWAYS_INLINE_', '_FORCE_INLINE_',
363
+ // Boost
364
+ 'BOOST_FORCEINLINE', 'BOOST_NOINLINE',
365
+ // Qt (per-method markers + inline)
366
+ 'Q_INVOKABLE', 'Q_SCRIPTABLE', 'Q_ALWAYS_INLINE', 'Q_SLOT', 'Q_SIGNAL',
367
+ // Folly / Abseil / LLVM / V8 / Eigen / rapidjson
368
+ 'FOLLY_ALWAYS_INLINE', 'FOLLY_NOINLINE',
369
+ 'ABSL_ATTRIBUTE_ALWAYS_INLINE', 'ABSL_ATTRIBUTE_NOINLINE',
370
+ 'LLVM_ATTRIBUTE_ALWAYS_INLINE', 'LLVM_ATTRIBUTE_NOINLINE',
371
+ 'V8_INLINE', 'V8_NOINLINE',
372
+ 'EIGEN_STRONG_INLINE', 'EIGEN_ALWAYS_INLINE', 'EIGEN_DEVICE_FUNC',
373
+ 'RAPIDJSON_FORCEINLINE',
374
+ // Mozilla / SpiderMonkey
375
+ 'MOZ_ALWAYS_INLINE', 'MOZ_NEVER_INLINE',
376
+ // Protocol Buffers
377
+ 'PROTOBUF_ALWAYS_INLINE', 'PROTOBUF_NOINLINE',
378
+ // {fmt} / spdlog
379
+ 'FMT_CONSTEXPR20', 'FMT_CONSTEXPR', 'FMT_INLINE',
380
+ // Hedley + nlohmann/json (bundles Hedley)
381
+ 'JSON_HEDLEY_ALWAYS_INLINE', 'JSON_HEDLEY_NEVER_INLINE',
382
+ 'HEDLEY_ALWAYS_INLINE', 'HEDLEY_NEVER_INLINE',
383
+ // GLM (graphics math — pervasive in games/rendering)
384
+ 'GLM_FUNC_QUALIFIER', 'GLM_FUNC_DECL', 'GLM_CONSTEXPR', 'GLM_INLINE',
385
+ // Bullet Physics / Skia / OpenCV / EASTL / Cocos2d-x / Chromium-WebKit
386
+ 'SIMD_FORCE_INLINE',
387
+ 'SK_ALWAYS_INLINE',
388
+ 'CV_ALWAYS_INLINE', 'CV_INLINE',
389
+ 'EA_FORCE_INLINE', 'EA_NOINLINE',
390
+ 'CC_INLINE',
391
+ 'NEVER_INLINE',
392
+ // C libraries: GLib, SQLite (internal linkage)
393
+ 'G_INLINE_FUNC', 'SQLITE_PRIVATE', 'SQLITE_API',
394
+ // Windows calling conventions (linkage position — recover the return type; the
395
+ // name is salvaged regardless). Only the unambiguous, non-word-like ones.
396
+ 'STDMETHODCALLTYPE', 'WINAPIV', 'WINAPI', 'APIENTRY',
397
+ // Common cross-ecosystem inline/attribute hints
398
+ 'ALWAYS_INLINE', 'FORCE_INLINE', 'NOINLINE',
399
+ ];
400
+ // One alternation, longest token first so a longer macro wins over a prefix.
401
+ const CPP_INLINE_MACRO_RE = new RegExp(`\\b(${[...CPP_INLINE_MACROS].sort((a, b) => b.length - a.length).join('|')})\\b(?=\\s+[A-Za-z_])`, 'g');
402
+ function blankCppInlineMacros(source) {
403
+ if (!CPP_INLINE_MACROS.some((m) => source.indexOf(m) !== -1))
404
+ return source;
405
+ return source.replace(CPP_INLINE_MACRO_RE, (m) => ' '.repeat(m.length));
406
+ }
407
+ // Bare C/C++ type/qualifier tokens that must never be taken as a recovered
408
+ // function name (guards `recoverMangledCppName` against the `Ret (name)` idiom,
409
+ // where the token before the params is the return type, not the name).
410
+ const CPP_PRIMITIVE_NAMES = new Set([
411
+ 'bool', 'void', 'int', 'char', 'short', 'long', 'float', 'double', 'unsigned',
412
+ 'signed', 'wchar_t', 'char8_t', 'char16_t', 'char32_t', 'char_t', 'size_t',
413
+ 'auto', 'const', 'struct', 'class', 'enum', 'union', 'typename',
414
+ ]);
415
+ /**
416
+ * Universal fallback (any macro, no list) for a C/C++ function name still mangled
417
+ * because a macro we don't blank sat in front of the return type: `MACRO Ret
418
+ * name(…)` / `Ret MACRO name(…)` misparse so the return type is glued onto the
419
+ * name ("Ret name", "char_t* to_str(double v)"). Recover the real identifier —
420
+ * the token immediately before the parameter list (or the last token). This runs
421
+ * AFTER the curated pre-parse blank, so it only ever sees the residual tail that
422
+ * blanking didn't already fix cleanly (which also recovers the return type).
423
+ *
424
+ * Safe by construction: only touches an ALREADY-mangled name — one with an
425
+ * internal space that isn't a legit `operator …`/destructor — so a well-formed
426
+ * name is returned unchanged. Guarded against the two ways it could mis-pick:
427
+ * the `Ret (name)` parenthesized-name idiom (left as-is, ambiguous), and a token
428
+ * that is a bare primitive/keyword rather than a real identifier.
429
+ */
430
+ function recoverMangledCppName(name) {
431
+ if (!/\s/.test(name) || name.startsWith('operator') || name.startsWith('~'))
432
+ return name;
433
+ if (/^\S+\s+\([A-Za-z_]\w*\)/.test(name))
434
+ return name; // `Ret (name)` idiom — leave alone
435
+ const beforeParams = name.includes('(') ? name.slice(0, name.indexOf('(')) : name;
436
+ const tokens = beforeParams.trim().split(/\s+/);
437
+ const candidate = tokens[tokens.length - 1];
438
+ if (!candidate || !/^[A-Za-z_]\w*$/.test(candidate) || CPP_PRIMITIVE_NAMES.has(candidate))
439
+ return name;
440
+ return candidate;
441
+ }
442
+ /**
443
+ * Blank Metal Shading Language `[[attribute]]` annotations before parsing.
444
+ * MSL (≈ C++14) puts attributes AFTER the declarator — `float4 position
445
+ * [[position]];`, `constant Uniforms &u [[buffer(0)]]` — a position
446
+ * tree-sitter-cpp can't reconcile: a struct field with a trailing attribute
447
+ * misparses into a shape that emits a spurious `extends` reference from the
448
+ * struct to the field's *type* (`VertexIn extends float3`), which becomes a
449
+ * wrong inheritance edge whenever the repo defines that type itself (simd
450
+ * typedefs in a shared ShaderTypes.h are common). Replacing the attribute with
451
+ * equal-length spaces preserves every byte offset and lets fields and
452
+ * parameters parse as ordinary declarations, mirroring the macro blanks above.
453
+ *
454
+ * Matched tightly to the attribute shape — `[[ident]]`, `[[ident(args)]]`, and
455
+ * comma-separated lists (`[[buffer(0), raster_order_group(0)]]`) — so a
456
+ * subscripted lambda call (`arr[[]{ … }()]`, the only other way `[[` appears in
457
+ * C++-family source) can never match: after `[[` a lambda continues with `]`,
458
+ * never an identifier followed by `]]`. Applied ONLY to `.metal` files — in
459
+ * regular C++ the pre-declarator attribute position (`[[nodiscard]] int f()`)
460
+ * is legal syntax the grammar parses natively, and blanking it would be pure
461
+ * blast radius. (#1121)
462
+ */
463
+ const METAL_ATTRIBUTE_RE = /\[\[\s*[A-Za-z_]\w*(?:\s*\([^()\n]*\))?(?:\s*,\s*[A-Za-z_]\w*(?:\s*\([^()\n]*\))?)*\s*\]\]/g;
464
+ function blankMetalAttributes(source) {
465
+ if (source.indexOf('[[') === -1)
466
+ return source;
467
+ return source.replace(METAL_ATTRIBUTE_RE, (m) => ' '.repeat(m.length));
468
+ }
469
+ /**
470
+ * Blank annotation-style macro invocations that decorate a declaration but carry
471
+ * NO terminating semicolon — the pervasive Unreal-Engine reflection markup
472
+ * (`UPROPERTY(...)`, `UFUNCTION(...)`, `UCLASS(...)`, `GENERATED_BODY()`,
473
+ * `UE_DEPRECATED_FORGAME(...)`, `DECLARE_DELEGATE_*(...)`, …) that sits on its
474
+ * own line right before a member/type. tree-sitter's C++ grammar doesn't know
475
+ * these are macros, so each one drops into error recovery; in a big reflected
476
+ * class (`CharacterMovementComponent.h` has ~240 of them) the errors accumulate
477
+ * until the enclosing `class_specifier` can't close and collapses into an ERROR
478
+ * node — the whole class definition, its members, and its `extends` edges vanish
479
+ * from the graph. Neither `blankCppExportMacros` (class-header export macros) nor
480
+ * `blankCppInlineMacros` (return-type inline specifiers) touches these in-body
481
+ * markup macros. Replacing each with equal-length spaces preserves every byte
482
+ * offset (so line/column stay exact) and the class then parses normally.
483
+ *
484
+ * Deliberately name-list-FREE — UE alone has hundreds of such macros and projects
485
+ * add their own — so it keys on structure, not a curated list, matched tightly to
486
+ * avoid touching legitimate C++:
487
+ * - the macro must be the FIRST non-whitespace token on its line (`^[ \t]*`),
488
+ * which is where declaration markup lives — so a macro used inside an
489
+ * expression or condition (`if (CHECK(x))`, `x = MACRO(a) + b`) is never
490
+ * matched (it isn't line-leading);
491
+ * - the name must be ALL-CAPS (`[A-Z][A-Z0-9_]{2,}`), since ordinary
492
+ * function/type names called at line start are lower/mixed case;
493
+ * - the char after the balanced `(...)` must START A DECLARATION — a letter,
494
+ * `_`, `~` (destructor), or `#` (a following directive). Declaration markup is
495
+ * always followed by the thing it decorates (`UPROPERTY(...)\n float X;`,
496
+ * `UE_DEPRECATED(...) UPROPERTY(...)`), whereas a statement call is followed by
497
+ * `;` (`FOO(x);`), an init-list item by `,`/`{`, and an expression fragment by
498
+ * an operator (`MAKE(a) + 1`) — all rejected. String/char literals inside the
499
+ * args are skipped so an embedded `)` can't mis-close the balance.
500
+ *
501
+ * C++-only (wired into cppExtractor). A blanked macro inside a block comment is
502
+ * harmless (comments don't parse), and the rare line-leading no-semicolon
503
+ * ALL-CAPS call that isn't markup only loses that one annotation, never a whole
504
+ * class.
505
+ */
506
+ function blankCppAnnotationMacroCalls(source) {
507
+ if (!/^[ \t]*[A-Z][A-Z0-9_]{2,}\s*\(/m.test(source))
508
+ return source;
509
+ const chars = source.split('');
510
+ const re = /^([ \t]*)([A-Z][A-Z0-9_]{2,})(\s*)\(/gm;
511
+ let m;
512
+ while ((m = re.exec(source)) !== null) {
513
+ const macroStart = m.index + (m[1] ?? '').length; // skip leading indent
514
+ let i = m.index + m[0].length - 1; // index of the opening '('
515
+ let depth = 0;
516
+ let end = -1;
517
+ for (; i < source.length; i++) {
518
+ const c = source[i];
519
+ if (c === '"' || c === "'") {
520
+ const quote = c;
521
+ i++;
522
+ while (i < source.length && source[i] !== quote) {
523
+ if (source[i] === '\\')
524
+ i++;
525
+ i++;
526
+ }
527
+ continue;
528
+ }
529
+ if (c === '(')
530
+ depth++;
531
+ else if (c === ')') {
532
+ depth--;
533
+ if (depth === 0) {
534
+ end = i + 1;
535
+ break;
536
+ }
537
+ }
538
+ }
539
+ if (end < 0)
540
+ continue;
541
+ let j = end;
542
+ while (j < source.length && /\s/.test(source[j]))
543
+ j++;
544
+ const after = source[j];
545
+ // Only markup is followed by the declaration it decorates; a statement call
546
+ // (`;`), init-list item (`,`/`{`), or expression fragment (operator) is not.
547
+ if (!after || !/[A-Za-z_~#]/.test(after))
548
+ continue;
549
+ for (let k = macroStart; k < end; k++) {
550
+ if (chars[k] !== '\n' && chars[k] !== '\r')
551
+ chars[k] = ' ';
552
+ }
553
+ re.lastIndex = end;
554
+ }
555
+ return chars.join('');
556
+ }
557
+ /**
558
+ * Blank an export/visibility macro sitting in front of a *member* or *method*
559
+ * declaration inside a class/namespace (`ENGINE_API virtual void Tick(…)`,
560
+ * `static ENGINE_API void AddReferencedObjects(…)`, `UE_API FVector GetVel()
561
+ * const`), before parsing. `blankCppExportMacros` only recovers the macro in a
562
+ * `class MACRO Name` *header*; the very same macro also prefixes almost every
563
+ * exported member of a big Unreal-Engine class, and tree-sitter — not knowing
564
+ * it's a macro — reads `MACRO <return-type> <name>(` as an extra type token and
565
+ * drops each such declaration into error recovery. In a heavily-exported header
566
+ * (`Actor.h`, `World.h`, …) hundreds of these accumulate: the return types pile
567
+ * up as orphan ERROR tokens and, combined with other markup, can still tip the
568
+ * enclosing class into collapse. Replacing the macro with equal-length spaces
569
+ * preserves every byte offset (line/column stay exact) and each member parses
570
+ * as an ordinary declaration.
571
+ *
572
+ * Matched tightly so it can't touch the same token used as a value
573
+ * (`int x = SOME_API;`, `if (mode == FOO_API)`): the token must be ALL-CAPS AND
574
+ * end in the conventional visibility-macro suffix `_API` / `_EXPORT` / `_ABI`
575
+ * (Unreal `*_API`, Qt/Boost `*_EXPORT`, LLVM `*_ABI`) — ordinary identifiers
576
+ * effectively never carry these suffixes — and must be immediately followed by
577
+ * whitespace then a declaration token (`\s+[A-Za-z_]`: a type, `virtual`,
578
+ * `static`, or the name). A value use is instead followed by `;`, `)`, `,`,
579
+ * `=`, `::`, or an operator, all of which fail the look-ahead. C++-only (wired
580
+ * into cppExtractor).
581
+ */
582
+ const CPP_API_PREFIX_RE = /\b[A-Z][A-Z0-9_]*(?:_API|_EXPORT|_ABI)\b(?=\s+[A-Za-z_])/g;
583
+ function blankCppApiPrefixMacros(source) {
584
+ if (!/_(?:API|EXPORT|ABI)\b/.test(source))
585
+ return source;
586
+ return source.replace(CPP_API_PREFIX_RE, (m) => ' '.repeat(m.length));
587
+ }
588
+ /**
589
+ * Blank an Unreal-Engine annotation macro that appears MID-LINE (not
590
+ * line-leading, so `blankCppAnnotationMacroCalls` never sees it) inside a
591
+ * declaration: an enum value's `UMETA(DisplayName="…")`, a parameter's
592
+ * `UPARAM(ref)`, or a deprecation tag wedged into a `using`/member declaration
593
+ * (`using FOnNetTick UE_DEPRECATED(5.5, "…") = TMulticastDelegate<void(float)>;`
594
+ * in `World.h`, which otherwise collapses `UWorld`). tree-sitter can't reconcile
595
+ * these embedded macro calls and drops into error recovery, and a mid-line one
596
+ * inside a big enum or a class-scope `using` can cascade into the whole enum /
597
+ * class being lost. Replacing the entire `MACRO(...)` (balanced parens, string
598
+ * literals skipped so an embedded `)` can't mis-close) with equal-length spaces
599
+ * preserves every byte offset and the declaration parses normally.
600
+ *
601
+ * Keyed on an explicit UE-only name list (`UMETA`, `UPARAM`, and the
602
+ * `UE_DEPRECATED*` family) — these identifiers are exclusive to Unreal's
603
+ * reflection layer and appear in no standard-C++ or other-library code, so
604
+ * blanking them is zero-risk to non-UE sources. (The line-LEADING forms of
605
+ * `UE_DEPRECATED(...)` are already handled by `blankCppAnnotationMacroCalls`;
606
+ * this covers the mid-line forms it structurally can't.) C++-only.
607
+ */
608
+ const CPP_INLINE_ANNOTATION_RE = /\b(?:UMETA|UPARAM|UE_DEPRECATED\w*)\s*\(/g;
609
+ function blankCppInlineAnnotationMacros(source) {
610
+ if (!/\b(?:UMETA|UPARAM|UE_DEPRECATED)/.test(source))
611
+ return source;
612
+ const chars = source.split('');
613
+ const re = new RegExp(CPP_INLINE_ANNOTATION_RE.source, 'g');
614
+ let m;
615
+ while ((m = re.exec(source)) !== null) {
616
+ let i = m.index + m[0].length - 1; // index of the opening '('
617
+ let depth = 0;
618
+ let end = -1;
619
+ for (; i < source.length; i++) {
620
+ const c = source[i];
621
+ if (c === '"' || c === "'") {
622
+ const quote = c;
623
+ i++;
624
+ while (i < source.length && source[i] !== quote) {
625
+ if (source[i] === '\\')
626
+ i++;
627
+ i++;
628
+ }
629
+ continue;
630
+ }
631
+ if (c === '(')
632
+ depth++;
633
+ else if (c === ')') {
634
+ depth--;
635
+ if (depth === 0) {
636
+ end = i + 1;
637
+ break;
638
+ }
639
+ }
640
+ }
641
+ if (end < 0)
642
+ continue;
643
+ for (let k = m.index; k < end; k++) {
644
+ if (chars[k] !== '\n' && chars[k] !== '\r')
645
+ chars[k] = ' ';
646
+ }
647
+ re.lastIndex = end;
648
+ }
649
+ return chars.join('');
650
+ }
651
+ /**
652
+ * Blank CUDA-specific constructs before parsing `.cu`/`.cuh` files (parsed with
653
+ * the C++ grammar). Three shapes tree-sitter-cpp can't reconcile, each replaced
654
+ * with equal-length whitespace so every byte offset survives (#387):
655
+ *
656
+ * 1. Execution-space / storage specifiers: in `__global__ void step(…)` or
657
+ * `__shared__ float tile[256]` the specifier parses as the declaration's
658
+ * TYPE and shunts the real return/value type into an ERROR node — mangling
659
+ * signatures and, for `__shared__` arrays, the declared name itself. Blanked
660
+ * unconditionally (no following-token lookahead) so extended lambdas
661
+ * (`[=] __device__ (int i) { … }`) recover too. `__restrict__` is deliberately
662
+ * absent: the grammar already parses it natively as a type_qualifier.
663
+ * 2. `__launch_bounds__(…)` between specifier and declarator — same misparse.
664
+ * The parenthesized form is blanked first; a bare leftover token is caught
665
+ * by the specifier list.
666
+ * 3. Kernel-launch configs `step<<<grid, block, smem, stream>>>(args)`: the
667
+ * chevrons lex as shift operators around an empty-named template, so no
668
+ * call_expression exists and the host→kernel call edge — the main reason to
669
+ * index CUDA at all — is lost. Blanking the `<<<…>>>` span leaves
670
+ * `step (args)`, a plain call the grammar
671
+ * parses natively (templated launches `k<T, 256><<<…>>>(…)` included).
672
+ *
673
+ * The launch-config match is deliberately bounded — statement/brace characters
674
+ * excluded, span capped, newlines preserved by the replacer — so a stray `<<<`
675
+ * (a committed merge-conflict marker, a string literal) can never blank a run
676
+ * of real code: an unmatched launch degrades to the status quo for that call
677
+ * site (no call edge), never to corruption. Applied to `.cu`/`.cuh` files and —
678
+ * because much real CUDA lives in extension-less headers (cutlass launches the
679
+ * majority of its kernels from `.h`; flash-attention's launch templates are
680
+ * `.h`; llm.c keeps device helpers in C-detected `.h`) — to any C/C++-family
681
+ * file whose CONTENT carries a strong CUDA marker (`looksLikeCudaSource`).
682
+ * Unlike Metal's `[[attribute]]` (legal C++ syntax elsewhere, hence Metal's
683
+ * strict extension gate), no CUDA marker is valid C++ anywhere: `<<<` isn't
684
+ * legal syntax and the dunder specifiers are implementation-reserved names no
685
+ * real codebase defines — so a content-triggered blank on a non-CUDA file can
686
+ * only ever whitespace tokens inside comments or strings, which parse the same.
687
+ */
688
+ const CUDA_LAUNCH_BOUNDS_RE = /\b__launch_bounds__\s*\([^()\n]*\)/g;
689
+ const CUDA_SPECIFIER_RE = /\b__(?:global|device|host|constant|shared|managed|grid_constant|forceinline|noinline|launch_bounds)__\b/g;
690
+ // `;` stays excluded (launch configs are expressions; a stray `<<<` spanning
691
+ // real statements always crosses one) and the span is capped. Braces are
692
+ // allowed through the regex — `k<<<dim3{1,1,1}, dim3{256,1,1}>>>(…)` is a real
693
+ // launch shape — but the replacer only blanks a BALANCED match: a merge
694
+ // conflict's `<<<<<<< … >>>>>>>` region that dodges every `;` still opens
695
+ // braces it never closes, so it fails the balance check and stays untouched.
696
+ const CUDA_LAUNCH_CONFIG_RE = /<<<[^;]{0,400}?>>>/g;
697
+ function blankCudaConstructs(source) {
698
+ let out = source;
699
+ if (out.indexOf('__') !== -1) {
700
+ out = out
701
+ .replace(CUDA_LAUNCH_BOUNDS_RE, (m) => ' '.repeat(m.length))
702
+ .replace(CUDA_SPECIFIER_RE, (m) => ' '.repeat(m.length));
703
+ }
704
+ if (out.indexOf('<<<') !== -1) {
705
+ out = out.replace(CUDA_LAUNCH_CONFIG_RE, (m) => {
706
+ let depth = 0;
707
+ for (let i = 0; i < m.length; i++) {
708
+ const ch = m.charCodeAt(i);
709
+ if (ch === 0x7b /* { */)
710
+ depth++;
711
+ else if (ch === 0x7d /* } */ && --depth < 0)
712
+ return m;
713
+ }
714
+ return depth === 0 ? m.replace(/[^\n]/g, ' ') : m;
715
+ });
716
+ }
717
+ return out;
718
+ }
719
+ /** Strong content markers for CUDA source in files without a CUDA extension
720
+ * (headers). The dunders are execution-space specifiers that only nvcc defines;
721
+ * `cudaStream_t` is the runtime's stream handle, pervasive in launcher headers
722
+ * that themselves declare no kernel. Deliberately excludes weak markers (`dim3`,
723
+ * `<<<`) that could plausibly appear in non-CUDA text. */
724
+ function looksLikeCudaSource(source) {
725
+ return (source.indexOf('__global__') !== -1 ||
726
+ source.indexOf('__device__') !== -1 ||
727
+ source.indexOf('__constant__') !== -1 ||
728
+ source.indexOf('cudaStream_t') !== -1);
729
+ }
730
+ /** C/C++ source pre-processing before tree-sitter: recover macro-annotated class
731
+ * definitions, macro-prefixed function definitions, macro-prefixed members, and
732
+ * macro-decorated members (Unreal-Engine reflection markup) — plus the non-C++
733
+ * surface of the dialects parsed with the C++ grammar: `.metal` MSL attribute
734
+ * annotations, and CUDA specifiers + launch syntax (by `.cu`/`.cuh` extension
735
+ * or by content, for CUDA living in `.h`/`.hpp` headers). Offset-preserving. */
736
+ function preParseCppSource(source, filePath) {
737
+ const blanked = blankCppAnnotationMacroCalls(blankCppInlineAnnotationMacros(blankCppApiPrefixMacros(blankCppInlineMacros(blankCppExportMacros(source)))));
738
+ const lower = filePath ? filePath.toLowerCase() : '';
739
+ if (lower.endsWith('.metal'))
740
+ return blankMetalAttributes(blanked);
741
+ if (lower.endsWith('.cu') || lower.endsWith('.cuh') || looksLikeCudaSource(source)) {
742
+ return blankCudaConstructs(blanked);
743
+ }
744
+ return blanked;
745
+ }
746
+ /**
747
+ * Blank an unknown attribute macro sitting in front of a C function
748
+ * definition's return type: `SEC_ATTR UINT32 LostName(VOID) { … }` (macro
749
+ * wrapping `__attribute__((…))`, common in embedded/kernel C). tree-sitter's
750
+ * C grammar reads the macro as the declaration's type, the real return type
751
+ * as the declarator, and stores the PARAMETER LIST as the function name —
752
+ * `LostName` indexes as `"(VOID)"` and is unfindable (#1211). The C++ grammar
753
+ * recovers this shape differently (glued name, salvaged post-hoc by
754
+ * `recoverMangledCppName`), but in C the real name never reaches the mangled
755
+ * string, so only a pre-parse blank can recover it.
756
+ *
757
+ * Attribute macros are project-specific (`SEC_ATTR`, `INIT_TEXT`, …), so this
758
+ * keys on structure, not a curated list, matched tightly:
759
+ * - line-leading (`^[ \t]*`) — declaration position, never an expression use;
760
+ * - ALL-CAPS token of ≥3 chars (`[A-Z][A-Z0-9_]{2,}`) — ordinary C types in
761
+ * definitions are rarely spelled this way, and when they are (`UINT32 f()`)
762
+ * they're followed by ONE identifier + `(`, which the lookahead rejects;
763
+ * - followed by TWO identifier tokens (return type, then name — `*` allowed
764
+ * for pointer returns) and then `(` — i.e. exactly the
765
+ * `MACRO Ret name(` definition shape. `MACRO name(` calls, `#define`
766
+ * lines (start with `#`), and multi-word builtin returns
767
+ * (`MACRO unsigned int f(` — where the C grammar already keeps the name)
768
+ * are all left untouched.
769
+ * Equal-length spaces preserve every byte offset, like the C++ blanks above.
770
+ */
771
+ const C_LEADING_ATTR_MACRO_RE = /^([ \t]*)([A-Z][A-Z0-9_]{2,})(?=\s+[A-Za-z_]\w*[\s*]+[A-Za-z_]\w*\s*\()/gm;
772
+ function blankCLeadingAttrMacros(source) {
773
+ return source.replace(C_LEADING_ATTR_MACRO_RE, (_m, ws, macro) => ws + ' '.repeat(macro.length));
774
+ }
775
+ /** C source pre-processing: recover functions hidden behind a leading
776
+ * attribute macro (#1211), then — for C-detected headers in CUDA projects
777
+ * (llm.c keeps `__device__` helpers and kernel prototypes in plain `.h`) —
778
+ * the same content-gated CUDA blank as C++. Offset-preserving. */
779
+ function preParseCSource(source) {
780
+ const blanked = blankCLeadingAttrMacros(source);
781
+ return looksLikeCudaSource(blanked) ? blankCudaConstructs(blanked) : blanked;
782
+ }
783
+ exports.cppExtractor = {
784
+ // Recover macro-annotated class/struct definitions (`class MYMODULE_API Foo : Base`,
785
+ // #1061/#946) and macro-prefixed functions (`FORCEINLINE FString Foo()`, #1093
786
+ // follow-up) that tree-sitter otherwise misparses.
787
+ preParse: preParseCppSource,
788
+ // Universal net for any macro the curated blank list misses.
789
+ recoverMangledName: recoverMangledCppName,
790
+ functionTypes: ['function_definition'],
791
+ classTypes: ['class_specifier'],
792
+ // A bodiless `class_specifier` is a forward declaration (`class Foo;`) or an
793
+ // elaborated type reference, not a definition. Skip it so dozens of forward
794
+ // decls across headers don't mint phantom `class` nodes that crowd out — and
795
+ // get picked as the blast-radius representative over — the single real
796
+ // definition, exactly as bodiless struct/enum specifiers are already skipped. (#1093)
797
+ skipBodilessClass: true,
798
+ methodTypes: ['function_definition'],
799
+ interfaceTypes: [],
800
+ structTypes: ['struct_specifier'],
801
+ enumTypes: ['enum_specifier'],
802
+ enumMemberTypes: ['enumerator'],
803
+ typeAliasTypes: ['type_definition', 'alias_declaration'], // typedef and using
804
+ importTypes: ['preproc_include'],
805
+ callTypes: ['call_expression'],
806
+ variableTypes: ['declaration'],
807
+ nameField: 'declarator',
808
+ bodyField: 'body',
809
+ paramsField: 'parameters',
810
+ resolveName: extractCppQualifiedMethodName,
811
+ getReceiverType: extractCppReceiverType,
812
+ getReturnType: extractCppReturnType,
813
+ getVisibility: (node) => {
814
+ // Check for access specifier in parent
815
+ const parent = node.parent;
816
+ if (parent) {
817
+ for (let i = 0; i < parent.childCount; i++) {
818
+ const child = parent.child(i);
819
+ if (child?.type === 'access_specifier') {
820
+ const text = child.text;
821
+ if (text.includes('public'))
822
+ return 'public';
823
+ if (text.includes('private'))
824
+ return 'private';
825
+ if (text.includes('protected'))
826
+ return 'protected';
827
+ }
828
+ }
829
+ }
830
+ return undefined;
831
+ },
832
+ resolveTypeAliasKind: (node, _source) => {
833
+ // C++ typedef: `typedef enum { ... } name;` or `typedef struct { ... } name;`
834
+ for (let i = 0; i < node.namedChildCount; i++) {
835
+ const child = node.namedChild(i);
836
+ if (!child)
837
+ continue;
838
+ if (child.type === 'enum_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
839
+ return 'enum';
840
+ if (child.type === 'struct_specifier' && (0, tree_sitter_helpers_1.getChildByField)(child, 'body'))
841
+ return 'struct';
842
+ }
843
+ return undefined;
844
+ },
845
+ isMisparsedFunction: (name, node) => {
846
+ // C++ macros like NLOHMANN_JSON_NAMESPACE_BEGIN cause tree-sitter to misparse
847
+ // namespace blocks as function_definitions (e.g. name = "namespace detail").
848
+ // Also filter C++ keywords that tree-sitter occasionally misinterprets as
849
+ // function/method names (e.g. switch statements inside macro-confused scopes).
850
+ if (name.startsWith('namespace'))
851
+ return true;
852
+ const cppKeywords = ['switch', 'if', 'for', 'while', 'do', 'case', 'return'];
853
+ if (cppKeywords.includes(name))
854
+ return true;
855
+ // `class MACRO Name : public Base { … }` misparses to a function_definition
856
+ // named after the class. `blankCppExportMacros` (preParse) recovers the
857
+ // common ALL-CAPS export-macro shape; this drop is the fallback for any
858
+ // residual misparse it doesn't blank — still no phantom function (#1061/#946).
859
+ return isMacroMisparsedTypeDecl(node);
860
+ },
861
+ extractImport: (node, source) => {
862
+ const importText = source.substring(node.startIndex, node.endIndex).trim();
863
+ // C++ includes: #include <iostream>, #include "myheader.h"
864
+ const systemLib = node.namedChildren.find((c) => c.type === 'system_lib_string');
865
+ if (systemLib) {
866
+ return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(systemLib, source).replace(/^<|>$/g, ''), signature: importText };
867
+ }
868
+ const stringLiteral = node.namedChildren.find((c) => c.type === 'string_literal');
869
+ if (stringLiteral) {
870
+ const stringContent = stringLiteral.namedChildren.find((c) => c.type === 'string_content');
871
+ if (stringContent) {
872
+ return { moduleName: (0, tree_sitter_helpers_1.getNodeText)(stringContent, source), signature: importText };
873
+ }
874
+ }
875
+ return null;
876
+ },
877
+ };
878
+ //# sourceMappingURL=c-cpp.js.map