@colbymchenry/codegraph-win32-arm64 1.6.0 → 1.6.2

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 (761) hide show
  1. package/bin/codegraph +5 -0
  2. package/lib/dist/.test-build-engine.json +1 -0
  3. package/lib/dist/.test-build-viewer.json +1 -0
  4. package/lib/dist/bin/codegraph.d.ts +1 -0
  5. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  6. package/lib/dist/bin/codegraph.js +605 -291
  7. package/lib/dist/bin/codegraph.js.map +1 -1
  8. package/lib/dist/bin/command-supervision.d.ts +7 -0
  9. package/lib/dist/bin/command-supervision.d.ts.map +1 -1
  10. package/lib/dist/bin/command-supervision.js +39 -27
  11. package/lib/dist/bin/command-supervision.js.map +1 -1
  12. package/lib/dist/bin/viewer-gate.d.ts +17 -0
  13. package/lib/dist/bin/viewer-gate.d.ts.map +1 -0
  14. package/lib/dist/bin/viewer-gate.js +31 -0
  15. package/lib/dist/bin/viewer-gate.js.map +1 -0
  16. package/lib/dist/context/index.d.ts.map +1 -1
  17. package/lib/dist/context/index.js +43 -2
  18. package/lib/dist/context/index.js.map +1 -1
  19. package/lib/dist/db/index.d.ts +21 -2
  20. package/lib/dist/db/index.d.ts.map +1 -1
  21. package/lib/dist/db/index.js +86 -31
  22. package/lib/dist/db/index.js.map +1 -1
  23. package/lib/dist/db/migrations.d.ts +1 -1
  24. package/lib/dist/db/migrations.d.ts.map +1 -1
  25. package/lib/dist/db/migrations.js +40 -1
  26. package/lib/dist/db/migrations.js.map +1 -1
  27. package/lib/dist/db/queries.d.ts +454 -10
  28. package/lib/dist/db/queries.d.ts.map +1 -1
  29. package/lib/dist/db/queries.js +1080 -41
  30. package/lib/dist/db/queries.js.map +1 -1
  31. package/lib/dist/db/schema.sql +11 -1
  32. package/lib/dist/db/sqlite-adapter.d.ts +2 -0
  33. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  34. package/lib/dist/db/sqlite-adapter.js +56 -7
  35. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  36. package/lib/dist/db/synthesis-stage.d.ts +12 -0
  37. package/lib/dist/db/synthesis-stage.d.ts.map +1 -0
  38. package/lib/dist/db/synthesis-stage.js +89 -0
  39. package/lib/dist/db/synthesis-stage.js.map +1 -0
  40. package/lib/dist/db/wal-valve.d.ts +32 -12
  41. package/lib/dist/db/wal-valve.d.ts.map +1 -1
  42. package/lib/dist/db/wal-valve.js +65 -22
  43. package/lib/dist/db/wal-valve.js.map +1 -1
  44. package/lib/dist/db/wsl-shared-index.d.ts +53 -0
  45. package/lib/dist/db/wsl-shared-index.d.ts.map +1 -0
  46. package/lib/dist/db/wsl-shared-index.js +121 -0
  47. package/lib/dist/db/wsl-shared-index.js.map +1 -0
  48. package/lib/dist/directory.d.ts +131 -2
  49. package/lib/dist/directory.d.ts.map +1 -1
  50. package/lib/dist/directory.js +299 -23
  51. package/lib/dist/directory.js.map +1 -1
  52. package/lib/dist/errors.d.ts +14 -0
  53. package/lib/dist/errors.d.ts.map +1 -1
  54. package/lib/dist/errors.js +16 -1
  55. package/lib/dist/errors.js.map +1 -1
  56. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
  57. package/lib/dist/extraction/astro-extractor.js +7 -35
  58. package/lib/dist/extraction/astro-extractor.js.map +1 -1
  59. package/lib/dist/extraction/cfml-extractor.d.ts +77 -10
  60. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  61. package/lib/dist/extraction/cfml-extractor.js +302 -71
  62. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  63. package/lib/dist/extraction/commonjs-requires.d.ts +23 -0
  64. package/lib/dist/extraction/commonjs-requires.d.ts.map +1 -0
  65. package/lib/dist/extraction/commonjs-requires.js +68 -0
  66. package/lib/dist/extraction/commonjs-requires.js.map +1 -0
  67. package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -1
  68. package/lib/dist/extraction/dfm-extractor.js +14 -10
  69. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  70. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  71. package/lib/dist/extraction/extraction-version.js +1 -1
  72. package/lib/dist/extraction/function-ref.d.ts +6 -4
  73. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  74. package/lib/dist/extraction/function-ref.js +35 -14
  75. package/lib/dist/extraction/function-ref.js.map +1 -1
  76. package/lib/dist/extraction/generated-detection.d.ts +9 -0
  77. package/lib/dist/extraction/generated-detection.d.ts.map +1 -1
  78. package/lib/dist/extraction/generated-detection.js +42 -2
  79. package/lib/dist/extraction/generated-detection.js.map +1 -1
  80. package/lib/dist/extraction/grammars.d.ts +40 -0
  81. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  82. package/lib/dist/extraction/grammars.js +171 -1
  83. package/lib/dist/extraction/grammars.js.map +1 -1
  84. package/lib/dist/extraction/index.d.ts +132 -19
  85. package/lib/dist/extraction/index.d.ts.map +1 -1
  86. package/lib/dist/extraction/index.js +825 -195
  87. package/lib/dist/extraction/index.js.map +1 -1
  88. package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
  89. package/lib/dist/extraction/kernel/index.js +6 -0
  90. package/lib/dist/extraction/kernel/index.js.map +1 -1
  91. package/lib/dist/extraction/languages/c-cpp.d.ts +73 -0
  92. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  93. package/lib/dist/extraction/languages/c-cpp.js +412 -16
  94. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  95. package/lib/dist/extraction/languages/csharp.d.ts.map +1 -1
  96. package/lib/dist/extraction/languages/csharp.js +14 -5
  97. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  98. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  99. package/lib/dist/extraction/languages/dart.js +16 -3
  100. package/lib/dist/extraction/languages/dart.js.map +1 -1
  101. package/lib/dist/extraction/languages/javascript.js +1 -1
  102. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  103. package/lib/dist/extraction/languages/kotlin.d.ts +4 -0
  104. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  105. package/lib/dist/extraction/languages/kotlin.js +237 -36
  106. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  107. package/lib/dist/extraction/languages/lua.d.ts.map +1 -1
  108. package/lib/dist/extraction/languages/lua.js +4 -1
  109. package/lib/dist/extraction/languages/lua.js.map +1 -1
  110. package/lib/dist/extraction/languages/python.d.ts.map +1 -1
  111. package/lib/dist/extraction/languages/python.js +71 -0
  112. package/lib/dist/extraction/languages/python.js.map +1 -1
  113. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  114. package/lib/dist/extraction/languages/rust.js +3 -0
  115. package/lib/dist/extraction/languages/rust.js.map +1 -1
  116. package/lib/dist/extraction/languages/scala.d.ts.map +1 -1
  117. package/lib/dist/extraction/languages/scala.js +18 -3
  118. package/lib/dist/extraction/languages/scala.js.map +1 -1
  119. package/lib/dist/extraction/languages/swift.d.ts +15 -0
  120. package/lib/dist/extraction/languages/swift.d.ts.map +1 -1
  121. package/lib/dist/extraction/languages/swift.js +50 -0
  122. package/lib/dist/extraction/languages/swift.js.map +1 -1
  123. package/lib/dist/extraction/languages/typescript.d.ts +7 -0
  124. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  125. package/lib/dist/extraction/languages/typescript.js +30 -2
  126. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  127. package/lib/dist/extraction/liquid-extractor.d.ts +18 -0
  128. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  129. package/lib/dist/extraction/liquid-extractor.js +98 -22
  130. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  131. package/lib/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  132. package/lib/dist/extraction/mybatis-extractor.js +6 -4
  133. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  134. package/lib/dist/extraction/parse-budget.d.ts +16 -0
  135. package/lib/dist/extraction/parse-budget.d.ts.map +1 -0
  136. package/lib/dist/extraction/parse-budget.js +24 -0
  137. package/lib/dist/extraction/parse-budget.js.map +1 -0
  138. package/lib/dist/extraction/parse-pool.d.ts +12 -0
  139. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  140. package/lib/dist/extraction/parse-pool.js +51 -3
  141. package/lib/dist/extraction/parse-pool.js.map +1 -1
  142. package/lib/dist/extraction/parse-worker.js +3 -1
  143. package/lib/dist/extraction/parse-worker.js.map +1 -1
  144. package/lib/dist/extraction/sfc-script.d.ts +43 -0
  145. package/lib/dist/extraction/sfc-script.d.ts.map +1 -0
  146. package/lib/dist/extraction/sfc-script.js +135 -0
  147. package/lib/dist/extraction/sfc-script.js.map +1 -0
  148. package/lib/dist/extraction/store-worker.js +5 -0
  149. package/lib/dist/extraction/store-worker.js.map +1 -1
  150. package/lib/dist/extraction/store-writer.d.ts +10 -2
  151. package/lib/dist/extraction/store-writer.d.ts.map +1 -1
  152. package/lib/dist/extraction/store-writer.js +12 -4
  153. package/lib/dist/extraction/store-writer.js.map +1 -1
  154. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  155. package/lib/dist/extraction/svelte-extractor.js +7 -37
  156. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  157. package/lib/dist/extraction/syntax-tokens.d.ts +103 -0
  158. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -0
  159. package/lib/dist/extraction/syntax-tokens.js +382 -0
  160. package/lib/dist/extraction/syntax-tokens.js.map +1 -0
  161. package/lib/dist/extraction/tree-sitter-helpers.d.ts +5 -0
  162. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  163. package/lib/dist/extraction/tree-sitter-helpers.js +17 -0
  164. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  165. package/lib/dist/extraction/tree-sitter-types.d.ts +29 -3
  166. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  167. package/lib/dist/extraction/tree-sitter.d.ts +104 -17
  168. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  169. package/lib/dist/extraction/tree-sitter.js +943 -88
  170. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  171. package/lib/dist/extraction/vue-extractor.d.ts +7 -0
  172. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  173. package/lib/dist/extraction/vue-extractor.js +73 -35
  174. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  175. package/lib/dist/extraction/vue-options-api.d.ts +28 -0
  176. package/lib/dist/extraction/vue-options-api.d.ts.map +1 -0
  177. package/lib/dist/extraction/vue-options-api.js +196 -0
  178. package/lib/dist/extraction/vue-options-api.js.map +1 -0
  179. package/lib/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  180. package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  181. package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  182. package/lib/dist/file-limits.d.ts +40 -0
  183. package/lib/dist/file-limits.d.ts.map +1 -0
  184. package/lib/dist/file-limits.js +147 -0
  185. package/lib/dist/file-limits.js.map +1 -0
  186. package/lib/dist/graph/branch-guards.d.ts +265 -0
  187. package/lib/dist/graph/branch-guards.d.ts.map +1 -0
  188. package/lib/dist/graph/branch-guards.js +2326 -0
  189. package/lib/dist/graph/branch-guards.js.map +1 -0
  190. package/lib/dist/graph/dead-code.d.ts +251 -0
  191. package/lib/dist/graph/dead-code.d.ts.map +1 -0
  192. package/lib/dist/graph/dead-code.js +776 -0
  193. package/lib/dist/graph/dead-code.js.map +1 -0
  194. package/lib/dist/graph/dynamic-boundary-report.d.ts +121 -0
  195. package/lib/dist/graph/dynamic-boundary-report.d.ts.map +1 -0
  196. package/lib/dist/graph/dynamic-boundary-report.js +283 -0
  197. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -0
  198. package/lib/dist/graph/index.d.ts +4 -0
  199. package/lib/dist/graph/index.d.ts.map +1 -1
  200. package/lib/dist/graph/index.js +16 -1
  201. package/lib/dist/graph/index.js.map +1 -1
  202. package/lib/dist/graph/named-symbol-flow.d.ts +125 -0
  203. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -0
  204. package/lib/dist/graph/named-symbol-flow.js +559 -0
  205. package/lib/dist/graph/named-symbol-flow.js.map +1 -0
  206. package/lib/dist/graph/symbol-lookup.d.ts +83 -0
  207. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -0
  208. package/lib/dist/graph/symbol-lookup.js +181 -0
  209. package/lib/dist/graph/symbol-lookup.js.map +1 -0
  210. package/lib/dist/graph/traversal.d.ts +9 -0
  211. package/lib/dist/graph/traversal.d.ts.map +1 -1
  212. package/lib/dist/graph/traversal.js +61 -35
  213. package/lib/dist/graph/traversal.js.map +1 -1
  214. package/lib/dist/graph/type-hierarchy.d.ts +155 -0
  215. package/lib/dist/graph/type-hierarchy.d.ts.map +1 -0
  216. package/lib/dist/graph/type-hierarchy.js +382 -0
  217. package/lib/dist/graph/type-hierarchy.js.map +1 -0
  218. package/lib/dist/index.d.ts +256 -11
  219. package/lib/dist/index.d.ts.map +1 -1
  220. package/lib/dist/index.js +402 -34
  221. package/lib/dist/index.js.map +1 -1
  222. package/lib/dist/installer/index.d.ts.map +1 -1
  223. package/lib/dist/installer/index.js +3 -2
  224. package/lib/dist/installer/index.js.map +1 -1
  225. package/lib/dist/installer/targets/antigravity.d.ts.map +1 -1
  226. package/lib/dist/installer/targets/antigravity.js +14 -2
  227. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  228. package/lib/dist/installer/targets/claude.d.ts +3 -0
  229. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  230. package/lib/dist/installer/targets/claude.js +35 -7
  231. package/lib/dist/installer/targets/claude.js.map +1 -1
  232. package/lib/dist/installer/targets/codex.d.ts +2 -1
  233. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  234. package/lib/dist/installer/targets/codex.js +14 -4
  235. package/lib/dist/installer/targets/codex.js.map +1 -1
  236. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  237. package/lib/dist/installer/targets/copilot-cli.js +7 -1
  238. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  239. package/lib/dist/installer/targets/opencode.d.ts +16 -5
  240. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  241. package/lib/dist/installer/targets/opencode.js +73 -22
  242. package/lib/dist/installer/targets/opencode.js.map +1 -1
  243. package/lib/dist/installer/targets/shared.d.ts +14 -3
  244. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  245. package/lib/dist/installer/targets/shared.js +39 -11
  246. package/lib/dist/installer/targets/shared.js.map +1 -1
  247. package/lib/dist/installer/targets/types.d.ts +7 -0
  248. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  249. package/lib/dist/mcp/answer-freshness.d.ts +10 -0
  250. package/lib/dist/mcp/answer-freshness.d.ts.map +1 -0
  251. package/lib/dist/mcp/answer-freshness.js +68 -0
  252. package/lib/dist/mcp/answer-freshness.js.map +1 -0
  253. package/lib/dist/mcp/daemon-manager.d.ts.map +1 -1
  254. package/lib/dist/mcp/daemon-manager.js +16 -0
  255. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  256. package/lib/dist/mcp/daemon-paths.d.ts +2 -0
  257. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  258. package/lib/dist/mcp/daemon-paths.js +20 -5
  259. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  260. package/lib/dist/mcp/daemon-registry.d.ts +11 -4
  261. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  262. package/lib/dist/mcp/daemon-registry.js +132 -36
  263. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  264. package/lib/dist/mcp/daemon.d.ts +17 -7
  265. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  266. package/lib/dist/mcp/daemon.js +116 -24
  267. package/lib/dist/mcp/daemon.js.map +1 -1
  268. package/lib/dist/mcp/dynamic-boundaries.d.ts +1 -10
  269. package/lib/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  270. package/lib/dist/mcp/dynamic-boundaries.js +46 -42
  271. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  272. package/lib/dist/mcp/engine.d.ts +30 -9
  273. package/lib/dist/mcp/engine.d.ts.map +1 -1
  274. package/lib/dist/mcp/engine.js +158 -66
  275. package/lib/dist/mcp/engine.js.map +1 -1
  276. package/lib/dist/mcp/explore-dedup.d.ts +5 -2
  277. package/lib/dist/mcp/explore-dedup.d.ts.map +1 -1
  278. package/lib/dist/mcp/explore-dedup.js +8 -5
  279. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  280. package/lib/dist/mcp/index-freshness-worker.d.ts +2 -0
  281. package/lib/dist/mcp/index-freshness-worker.d.ts.map +1 -0
  282. package/lib/dist/mcp/index-freshness-worker.js +36 -0
  283. package/lib/dist/mcp/index-freshness-worker.js.map +1 -0
  284. package/lib/dist/mcp/index-freshness.d.ts +13 -0
  285. package/lib/dist/mcp/index-freshness.d.ts.map +1 -0
  286. package/lib/dist/mcp/index-freshness.js +117 -0
  287. package/lib/dist/mcp/index-freshness.js.map +1 -0
  288. package/lib/dist/mcp/index.d.ts +3 -1
  289. package/lib/dist/mcp/index.d.ts.map +1 -1
  290. package/lib/dist/mcp/index.js +95 -11
  291. package/lib/dist/mcp/index.js.map +1 -1
  292. package/lib/dist/mcp/liveness-watchdog.d.ts +4 -1
  293. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  294. package/lib/dist/mcp/liveness-watchdog.js +11 -2
  295. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  296. package/lib/dist/mcp/project-lifecycle.d.ts +9 -0
  297. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -0
  298. package/lib/dist/mcp/project-lifecycle.js +182 -0
  299. package/lib/dist/mcp/project-lifecycle.js.map +1 -0
  300. package/lib/dist/mcp/proxy.d.ts +9 -2
  301. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  302. package/lib/dist/mcp/proxy.js +201 -32
  303. package/lib/dist/mcp/proxy.js.map +1 -1
  304. package/lib/dist/mcp/query-pool.d.ts +18 -3
  305. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  306. package/lib/dist/mcp/query-pool.js +67 -11
  307. package/lib/dist/mcp/query-pool.js.map +1 -1
  308. package/lib/dist/mcp/query-worker.js +2 -2
  309. package/lib/dist/mcp/query-worker.js.map +1 -1
  310. package/lib/dist/mcp/server-instructions.d.ts +1 -1
  311. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  312. package/lib/dist/mcp/server-instructions.js +6 -3
  313. package/lib/dist/mcp/server-instructions.js.map +1 -1
  314. package/lib/dist/mcp/startup-handshake.d.ts +3 -1
  315. package/lib/dist/mcp/startup-handshake.d.ts.map +1 -1
  316. package/lib/dist/mcp/startup-handshake.js +10 -2
  317. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  318. package/lib/dist/mcp/tools.d.ts +306 -36
  319. package/lib/dist/mcp/tools.d.ts.map +1 -1
  320. package/lib/dist/mcp/tools.js +2395 -966
  321. package/lib/dist/mcp/tools.js.map +1 -1
  322. package/lib/dist/mcp/writer-lock.d.ts +61 -0
  323. package/lib/dist/mcp/writer-lock.d.ts.map +1 -0
  324. package/lib/dist/mcp/writer-lock.js +260 -0
  325. package/lib/dist/mcp/writer-lock.js.map +1 -0
  326. package/lib/dist/resolution/alias-binding.d.ts +56 -0
  327. package/lib/dist/resolution/alias-binding.d.ts.map +1 -0
  328. package/lib/dist/resolution/alias-binding.js +143 -0
  329. package/lib/dist/resolution/alias-binding.js.map +1 -0
  330. package/lib/dist/resolution/angular-template-synthesizer.d.ts +49 -0
  331. package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -0
  332. package/lib/dist/resolution/angular-template-synthesizer.js +359 -0
  333. package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -0
  334. package/lib/dist/resolution/callback-synthesizer.d.ts +23 -1
  335. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  336. package/lib/dist/resolution/callback-synthesizer.js +460 -144
  337. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  338. package/lib/dist/resolution/cpp-constructor.d.ts +4 -0
  339. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -0
  340. package/lib/dist/resolution/cpp-constructor.js +123 -0
  341. package/lib/dist/resolution/cpp-constructor.js.map +1 -0
  342. package/lib/dist/resolution/cpp-macro-visibility.d.ts +12 -0
  343. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -0
  344. package/lib/dist/resolution/cpp-macro-visibility.js +392 -0
  345. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -0
  346. package/lib/dist/resolution/expo-router-synthesizer.d.ts +32 -0
  347. package/lib/dist/resolution/expo-router-synthesizer.d.ts.map +1 -0
  348. package/lib/dist/resolution/expo-router-synthesizer.js +189 -0
  349. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -0
  350. package/lib/dist/resolution/frameworks/angular-router.d.ts +142 -0
  351. package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -0
  352. package/lib/dist/resolution/frameworks/angular-router.js +1126 -0
  353. package/lib/dist/resolution/frameworks/angular-router.js.map +1 -0
  354. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
  355. package/lib/dist/resolution/frameworks/astro.js +32 -6
  356. package/lib/dist/resolution/frameworks/astro.js.map +1 -1
  357. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  358. package/lib/dist/resolution/frameworks/csharp.js +186 -24
  359. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  360. package/lib/dist/resolution/frameworks/expo-modules.d.ts +10 -0
  361. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  362. package/lib/dist/resolution/frameworks/expo-modules.js +95 -1
  363. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  364. package/lib/dist/resolution/frameworks/expo-router.d.ts +195 -0
  365. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -0
  366. package/lib/dist/resolution/frameworks/expo-router.js +847 -0
  367. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -0
  368. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  369. package/lib/dist/resolution/frameworks/express.js +339 -45
  370. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  371. package/lib/dist/resolution/frameworks/fabric.d.ts.map +1 -1
  372. package/lib/dist/resolution/frameworks/fabric.js +13 -11
  373. package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
  374. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
  375. package/lib/dist/resolution/frameworks/go.js +11 -28
  376. package/lib/dist/resolution/frameworks/go.js.map +1 -1
  377. package/lib/dist/resolution/frameworks/index.d.ts +8 -2
  378. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  379. package/lib/dist/resolution/frameworks/index.js +39 -1
  380. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  381. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  382. package/lib/dist/resolution/frameworks/java.js +88 -68
  383. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  384. package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  385. package/lib/dist/resolution/frameworks/laravel.js +369 -26
  386. package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
  387. package/lib/dist/resolution/frameworks/name-heuristic.d.ts +35 -0
  388. package/lib/dist/resolution/frameworks/name-heuristic.d.ts.map +1 -0
  389. package/lib/dist/resolution/frameworks/name-heuristic.js +45 -0
  390. package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -0
  391. package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -1
  392. package/lib/dist/resolution/frameworks/nestjs.js +288 -55
  393. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  394. package/lib/dist/resolution/frameworks/nextjs.d.ts +76 -0
  395. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -0
  396. package/lib/dist/resolution/frameworks/nextjs.js +329 -0
  397. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -0
  398. package/lib/dist/resolution/frameworks/object-literal.d.ts +32 -0
  399. package/lib/dist/resolution/frameworks/object-literal.d.ts.map +1 -0
  400. package/lib/dist/resolution/frameworks/object-literal.js +139 -0
  401. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -0
  402. package/lib/dist/resolution/frameworks/package-deps.d.ts +14 -0
  403. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -0
  404. package/lib/dist/resolution/frameworks/package-deps.js +78 -0
  405. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -0
  406. package/lib/dist/resolution/frameworks/page-component.d.ts +20 -0
  407. package/lib/dist/resolution/frameworks/page-component.d.ts.map +1 -0
  408. package/lib/dist/resolution/frameworks/page-component.js +45 -0
  409. package/lib/dist/resolution/frameworks/page-component.js.map +1 -0
  410. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
  411. package/lib/dist/resolution/frameworks/play.js +3 -1
  412. package/lib/dist/resolution/frameworks/play.js.map +1 -1
  413. package/lib/dist/resolution/frameworks/python.d.ts.map +1 -1
  414. package/lib/dist/resolution/frameworks/python.js +279 -26
  415. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  416. package/lib/dist/resolution/frameworks/react-native.d.ts +26 -0
  417. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  418. package/lib/dist/resolution/frameworks/react-native.js +153 -14
  419. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  420. package/lib/dist/resolution/frameworks/react-router.d.ts +47 -0
  421. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -0
  422. package/lib/dist/resolution/frameworks/react-router.js +201 -0
  423. package/lib/dist/resolution/frameworks/react-router.js.map +1 -0
  424. package/lib/dist/resolution/frameworks/react.d.ts +13 -2
  425. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  426. package/lib/dist/resolution/frameworks/react.js +542 -144
  427. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  428. package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -1
  429. package/lib/dist/resolution/frameworks/ruby.js +177 -17
  430. package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
  431. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
  432. package/lib/dist/resolution/frameworks/rust.js +24 -22
  433. package/lib/dist/resolution/frameworks/rust.js.map +1 -1
  434. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  435. package/lib/dist/resolution/frameworks/svelte.js +14 -6
  436. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  437. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts +36 -0
  438. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -0
  439. package/lib/dist/resolution/frameworks/sveltekit-router.js +156 -0
  440. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -0
  441. package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -1
  442. package/lib/dist/resolution/frameworks/swift.js +253 -124
  443. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  444. package/lib/dist/resolution/frameworks/tanstack-router.d.ts +84 -0
  445. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -0
  446. package/lib/dist/resolution/frameworks/tanstack-router.js +437 -0
  447. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -0
  448. package/lib/dist/resolution/frameworks/vue-router.d.ts +98 -0
  449. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -0
  450. package/lib/dist/resolution/frameworks/vue-router.js +500 -0
  451. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -0
  452. package/lib/dist/resolution/frameworks/vue.d.ts +9 -2
  453. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
  454. package/lib/dist/resolution/frameworks/vue.js +45 -11
  455. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  456. package/lib/dist/resolution/import-resolver.d.ts +66 -0
  457. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  458. package/lib/dist/resolution/import-resolver.js +643 -61
  459. package/lib/dist/resolution/import-resolver.js.map +1 -1
  460. package/lib/dist/resolution/index.d.ts +124 -25
  461. package/lib/dist/resolution/index.d.ts.map +1 -1
  462. package/lib/dist/resolution/index.js +769 -152
  463. package/lib/dist/resolution/index.js.map +1 -1
  464. package/lib/dist/resolution/js-builtins.d.ts +13 -0
  465. package/lib/dist/resolution/js-builtins.d.ts.map +1 -0
  466. package/lib/dist/resolution/js-builtins.js +48 -0
  467. package/lib/dist/resolution/js-builtins.js.map +1 -0
  468. package/lib/dist/resolution/name-matcher.d.ts +101 -22
  469. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  470. package/lib/dist/resolution/name-matcher.js +8267 -287
  471. package/lib/dist/resolution/name-matcher.js.map +1 -1
  472. package/lib/dist/resolution/next-router-synthesizer.d.ts +27 -0
  473. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -0
  474. package/lib/dist/resolution/next-router-synthesizer.js +113 -0
  475. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -0
  476. package/lib/dist/resolution/react-router-synthesizer.d.ts +35 -0
  477. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -0
  478. package/lib/dist/resolution/react-router-synthesizer.js +197 -0
  479. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -0
  480. package/lib/dist/resolution/resolver-pool.d.ts +22 -1
  481. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  482. package/lib/dist/resolution/resolver-pool.js +35 -5
  483. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  484. package/lib/dist/resolution/resolver-worker.js +3 -0
  485. package/lib/dist/resolution/resolver-worker.js.map +1 -1
  486. package/lib/dist/resolution/strip-comments.d.ts +6 -0
  487. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  488. package/lib/dist/resolution/strip-comments.js +58 -0
  489. package/lib/dist/resolution/strip-comments.js.map +1 -1
  490. package/lib/dist/resolution/sveltekit-synthesizer.d.ts +58 -0
  491. package/lib/dist/resolution/sveltekit-synthesizer.d.ts.map +1 -0
  492. package/lib/dist/resolution/sveltekit-synthesizer.js +173 -0
  493. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -0
  494. package/lib/dist/resolution/swift-type-visibility.d.ts +68 -0
  495. package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -0
  496. package/lib/dist/resolution/swift-type-visibility.js +454 -0
  497. package/lib/dist/resolution/swift-type-visibility.js.map +1 -0
  498. package/lib/dist/resolution/synth-utils.d.ts +26 -0
  499. package/lib/dist/resolution/synth-utils.d.ts.map +1 -0
  500. package/lib/dist/resolution/synth-utils.js +75 -0
  501. package/lib/dist/resolution/synth-utils.js.map +1 -0
  502. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts +31 -0
  503. package/lib/dist/resolution/tanstack-router-synthesizer.d.ts.map +1 -0
  504. package/lib/dist/resolution/tanstack-router-synthesizer.js +114 -0
  505. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -0
  506. package/lib/dist/resolution/tier-synthesizer.d.ts +54 -0
  507. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -0
  508. package/lib/dist/resolution/tier-synthesizer.js +1294 -0
  509. package/lib/dist/resolution/tier-synthesizer.js.map +1 -0
  510. package/lib/dist/resolution/type-parameters.d.ts +11 -0
  511. package/lib/dist/resolution/type-parameters.d.ts.map +1 -0
  512. package/lib/dist/resolution/type-parameters.js +287 -0
  513. package/lib/dist/resolution/type-parameters.js.map +1 -0
  514. package/lib/dist/resolution/types.d.ts +105 -2
  515. package/lib/dist/resolution/types.d.ts.map +1 -1
  516. package/lib/dist/resolution/types.js +64 -0
  517. package/lib/dist/resolution/types.js.map +1 -1
  518. package/lib/dist/resolution/vue-router-synthesizer.d.ts +30 -0
  519. package/lib/dist/resolution/vue-router-synthesizer.d.ts.map +1 -0
  520. package/lib/dist/resolution/vue-router-synthesizer.js +115 -0
  521. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -0
  522. package/lib/dist/search/query-paths.d.ts +50 -1
  523. package/lib/dist/search/query-paths.d.ts.map +1 -1
  524. package/lib/dist/search/query-paths.js +227 -12
  525. package/lib/dist/search/query-paths.js.map +1 -1
  526. package/lib/dist/search/query-utils.d.ts +15 -0
  527. package/lib/dist/search/query-utils.d.ts.map +1 -1
  528. package/lib/dist/search/query-utils.js +35 -7
  529. package/lib/dist/search/query-utils.js.map +1 -1
  530. package/lib/dist/sync/watch-policy.d.ts +14 -0
  531. package/lib/dist/sync/watch-policy.d.ts.map +1 -1
  532. package/lib/dist/sync/watch-policy.js +19 -0
  533. package/lib/dist/sync/watch-policy.js.map +1 -1
  534. package/lib/dist/sync/watcher.d.ts +52 -35
  535. package/lib/dist/sync/watcher.d.ts.map +1 -1
  536. package/lib/dist/sync/watcher.js +236 -100
  537. package/lib/dist/sync/watcher.js.map +1 -1
  538. package/lib/dist/sync/worktree.d.ts +22 -0
  539. package/lib/dist/sync/worktree.d.ts.map +1 -1
  540. package/lib/dist/sync/worktree.js +54 -0
  541. package/lib/dist/sync/worktree.js.map +1 -1
  542. package/lib/dist/telemetry/index.d.ts +4 -2
  543. package/lib/dist/telemetry/index.d.ts.map +1 -1
  544. package/lib/dist/telemetry/index.js +159 -66
  545. package/lib/dist/telemetry/index.js.map +1 -1
  546. package/lib/dist/types.d.ts +1 -1
  547. package/lib/dist/types.d.ts.map +1 -1
  548. package/lib/dist/types.js +1 -0
  549. package/lib/dist/types.js.map +1 -1
  550. package/lib/dist/ui-server/api/deadcode.d.ts +84 -0
  551. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -0
  552. package/lib/dist/ui-server/api/deadcode.js +136 -0
  553. package/lib/dist/ui-server/api/deadcode.js.map +1 -0
  554. package/lib/dist/ui-server/api/effects.d.ts +94 -0
  555. package/lib/dist/ui-server/api/effects.d.ts.map +1 -0
  556. package/lib/dist/ui-server/api/effects.js +527 -0
  557. package/lib/dist/ui-server/api/effects.js.map +1 -0
  558. package/lib/dist/ui-server/api/entrypoints.d.ts +92 -0
  559. package/lib/dist/ui-server/api/entrypoints.d.ts.map +1 -0
  560. package/lib/dist/ui-server/api/entrypoints.js +364 -0
  561. package/lib/dist/ui-server/api/entrypoints.js.map +1 -0
  562. package/lib/dist/ui-server/api/events.d.ts +183 -0
  563. package/lib/dist/ui-server/api/events.d.ts.map +1 -0
  564. package/lib/dist/ui-server/api/events.js +430 -0
  565. package/lib/dist/ui-server/api/events.js.map +1 -0
  566. package/lib/dist/ui-server/api/file.d.ts +66 -0
  567. package/lib/dist/ui-server/api/file.d.ts.map +1 -0
  568. package/lib/dist/ui-server/api/file.js +235 -0
  569. package/lib/dist/ui-server/api/file.js.map +1 -0
  570. package/lib/dist/ui-server/api/filecode.d.ts +126 -0
  571. package/lib/dist/ui-server/api/filecode.d.ts.map +1 -0
  572. package/lib/dist/ui-server/api/filecode.js +205 -0
  573. package/lib/dist/ui-server/api/filecode.js.map +1 -0
  574. package/lib/dist/ui-server/api/flow.d.ts +226 -0
  575. package/lib/dist/ui-server/api/flow.d.ts.map +1 -0
  576. package/lib/dist/ui-server/api/flow.js +612 -0
  577. package/lib/dist/ui-server/api/flow.js.map +1 -0
  578. package/lib/dist/ui-server/api/hierarchy.d.ts +81 -0
  579. package/lib/dist/ui-server/api/hierarchy.d.ts.map +1 -0
  580. package/lib/dist/ui-server/api/hierarchy.js +92 -0
  581. package/lib/dist/ui-server/api/hierarchy.js.map +1 -0
  582. package/lib/dist/ui-server/api/index.d.ts +90 -0
  583. package/lib/dist/ui-server/api/index.d.ts.map +1 -0
  584. package/lib/dist/ui-server/api/index.js +332 -0
  585. package/lib/dist/ui-server/api/index.js.map +1 -0
  586. package/lib/dist/ui-server/api/map.d.ts +273 -0
  587. package/lib/dist/ui-server/api/map.d.ts.map +1 -0
  588. package/lib/dist/ui-server/api/map.js +781 -0
  589. package/lib/dist/ui-server/api/map.js.map +1 -0
  590. package/lib/dist/ui-server/api/node.d.ts +81 -0
  591. package/lib/dist/ui-server/api/node.d.ts.map +1 -0
  592. package/lib/dist/ui-server/api/node.js +394 -0
  593. package/lib/dist/ui-server/api/node.js.map +1 -0
  594. package/lib/dist/ui-server/api/nodes.d.ts +25 -0
  595. package/lib/dist/ui-server/api/nodes.d.ts.map +1 -0
  596. package/lib/dist/ui-server/api/nodes.js +45 -0
  597. package/lib/dist/ui-server/api/nodes.js.map +1 -0
  598. package/lib/dist/ui-server/api/program.d.ts +139 -0
  599. package/lib/dist/ui-server/api/program.d.ts.map +1 -0
  600. package/lib/dist/ui-server/api/program.js +315 -0
  601. package/lib/dist/ui-server/api/program.js.map +1 -0
  602. package/lib/dist/ui-server/api/respond.d.ts +76 -0
  603. package/lib/dist/ui-server/api/respond.d.ts.map +1 -0
  604. package/lib/dist/ui-server/api/respond.js +186 -0
  605. package/lib/dist/ui-server/api/respond.js.map +1 -0
  606. package/lib/dist/ui-server/api/route-roots.d.ts +45 -0
  607. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -0
  608. package/lib/dist/ui-server/api/route-roots.js +117 -0
  609. package/lib/dist/ui-server/api/route-roots.js.map +1 -0
  610. package/lib/dist/ui-server/api/routes.d.ts +61 -0
  611. package/lib/dist/ui-server/api/routes.d.ts.map +1 -0
  612. package/lib/dist/ui-server/api/routes.js +164 -0
  613. package/lib/dist/ui-server/api/routes.js.map +1 -0
  614. package/lib/dist/ui-server/api/screens.d.ts +117 -0
  615. package/lib/dist/ui-server/api/screens.d.ts.map +1 -0
  616. package/lib/dist/ui-server/api/screens.js +626 -0
  617. package/lib/dist/ui-server/api/screens.js.map +1 -0
  618. package/lib/dist/ui-server/api/search.d.ts +29 -0
  619. package/lib/dist/ui-server/api/search.d.ts.map +1 -0
  620. package/lib/dist/ui-server/api/search.js +232 -0
  621. package/lib/dist/ui-server/api/search.js.map +1 -0
  622. package/lib/dist/ui-server/api/session.d.ts +52 -0
  623. package/lib/dist/ui-server/api/session.d.ts.map +1 -0
  624. package/lib/dist/ui-server/api/session.js +196 -0
  625. package/lib/dist/ui-server/api/session.js.map +1 -0
  626. package/lib/dist/ui-server/api/source.d.ts +200 -0
  627. package/lib/dist/ui-server/api/source.d.ts.map +1 -0
  628. package/lib/dist/ui-server/api/source.js +422 -0
  629. package/lib/dist/ui-server/api/source.js.map +1 -0
  630. package/lib/dist/ui-server/api/stats.d.ts +27 -0
  631. package/lib/dist/ui-server/api/stats.d.ts.map +1 -0
  632. package/lib/dist/ui-server/api/stats.js +164 -0
  633. package/lib/dist/ui-server/api/stats.js.map +1 -0
  634. package/lib/dist/ui-server/api/steps.d.ts +274 -0
  635. package/lib/dist/ui-server/api/steps.d.ts.map +1 -0
  636. package/lib/dist/ui-server/api/steps.js +1554 -0
  637. package/lib/dist/ui-server/api/steps.js.map +1 -0
  638. package/lib/dist/ui-server/api/trail-store.d.ts +142 -0
  639. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -0
  640. package/lib/dist/ui-server/api/trail-store.js +323 -0
  641. package/lib/dist/ui-server/api/trail-store.js.map +1 -0
  642. package/lib/dist/ui-server/api/trails.d.ts +163 -0
  643. package/lib/dist/ui-server/api/trails.d.ts.map +1 -0
  644. package/lib/dist/ui-server/api/trails.js +370 -0
  645. package/lib/dist/ui-server/api/trails.js.map +1 -0
  646. package/lib/dist/ui-server/api/when.d.ts +133 -0
  647. package/lib/dist/ui-server/api/when.d.ts.map +1 -0
  648. package/lib/dist/ui-server/api/when.js +275 -0
  649. package/lib/dist/ui-server/api/when.js.map +1 -0
  650. package/lib/dist/ui-server/api/wire.d.ts +179 -0
  651. package/lib/dist/ui-server/api/wire.d.ts.map +1 -0
  652. package/lib/dist/ui-server/api/wire.js +231 -0
  653. package/lib/dist/ui-server/api/wire.js.map +1 -0
  654. package/lib/dist/ui-server/assets.d.ts +40 -0
  655. package/lib/dist/ui-server/assets.d.ts.map +1 -0
  656. package/lib/dist/ui-server/assets.js +110 -0
  657. package/lib/dist/ui-server/assets.js.map +1 -0
  658. package/lib/dist/ui-server/constants.d.ts +32 -0
  659. package/lib/dist/ui-server/constants.d.ts.map +1 -0
  660. package/lib/dist/ui-server/constants.js +35 -0
  661. package/lib/dist/ui-server/constants.js.map +1 -0
  662. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts +28 -0
  663. package/lib/dist/ui-server/highlight/bounded-tokenize.d.ts.map +1 -0
  664. package/lib/dist/ui-server/highlight/bounded-tokenize.js +139 -0
  665. package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -0
  666. package/lib/dist/ui-server/highlight/index.d.ts +113 -0
  667. package/lib/dist/ui-server/highlight/index.d.ts.map +1 -0
  668. package/lib/dist/ui-server/highlight/index.js +312 -0
  669. package/lib/dist/ui-server/highlight/index.js.map +1 -0
  670. package/lib/dist/ui-server/highlight/languages.d.ts +36 -0
  671. package/lib/dist/ui-server/highlight/languages.d.ts.map +1 -0
  672. package/lib/dist/ui-server/highlight/languages.js +50 -0
  673. package/lib/dist/ui-server/highlight/languages.js.map +1 -0
  674. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts +7 -0
  675. package/lib/dist/ui-server/highlight/tokenize-worker.d.ts.map +1 -0
  676. package/lib/dist/ui-server/highlight/tokenize-worker.js +20 -0
  677. package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -0
  678. package/lib/dist/ui-server/index.d.ts +92 -0
  679. package/lib/dist/ui-server/index.d.ts.map +1 -0
  680. package/lib/dist/ui-server/index.js +399 -0
  681. package/lib/dist/ui-server/index.js.map +1 -0
  682. package/lib/dist/ui-server/open-browser.d.ts +31 -0
  683. package/lib/dist/ui-server/open-browser.d.ts.map +1 -0
  684. package/lib/dist/ui-server/open-browser.js +79 -0
  685. package/lib/dist/ui-server/open-browser.js.map +1 -0
  686. package/lib/dist/ui-server/security.d.ts +127 -0
  687. package/lib/dist/ui-server/security.d.ts.map +1 -0
  688. package/lib/dist/ui-server/security.js +332 -0
  689. package/lib/dist/ui-server/security.js.map +1 -0
  690. package/lib/dist/ui-server/static.d.ts +45 -0
  691. package/lib/dist/ui-server/static.d.ts.map +1 -0
  692. package/lib/dist/ui-server/static.js +165 -0
  693. package/lib/dist/ui-server/static.js.map +1 -0
  694. package/lib/dist/upgrade/index.d.ts +43 -5
  695. package/lib/dist/upgrade/index.d.ts.map +1 -1
  696. package/lib/dist/upgrade/index.js +157 -35
  697. package/lib/dist/upgrade/index.js.map +1 -1
  698. package/lib/dist/utils.d.ts +14 -2
  699. package/lib/dist/utils.d.ts.map +1 -1
  700. package/lib/dist/utils.js +25 -10
  701. package/lib/dist/utils.js.map +1 -1
  702. package/lib/dist/viewer/assets/archivo-latin-ext-wght-normal-C4zznr8T.woff2 +0 -0
  703. package/lib/dist/viewer/assets/archivo-latin-wght-normal-E0tuGl4L.woff2 +0 -0
  704. package/lib/dist/viewer/assets/archivo-vietnamese-wght-normal-XAtsl5Q_.woff2 +0 -0
  705. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-2syK4fUT.woff +0 -0
  706. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-italic-CBJ8pzag.woff2 +0 -0
  707. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-BSMlKf0J.woff2 +0 -0
  708. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-400-normal-CEL4l2ZJ.woff +0 -0
  709. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Ael50iVv.woff +0 -0
  710. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-500-normal-Bq9vWWag.woff2 +0 -0
  711. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-CTOM6hUh.woff2 +0 -0
  712. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-600-normal-fLZuRloM.woff +0 -0
  713. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-B4oTjJdl.woff +0 -0
  714. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-italic-CBjNughH.woff2 +0 -0
  715. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-DMdlQ8Kv.woff +0 -0
  716. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-400-normal-xuaO2J-f.woff2 +0 -0
  717. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BIfNGwUT.woff +0 -0
  718. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-500-normal-BqneJy0T.woff2 +0 -0
  719. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-9HEixskS.woff +0 -0
  720. package/lib/dist/viewer/assets/ibm-plex-mono-cyrillic-ext-600-normal-V-xxqcpd.woff2 +0 -0
  721. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-66oory27.woff +0 -0
  722. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-italic-BqAiT5Ww.woff2 +0 -0
  723. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-CvHOgSBP.woff +0 -0
  724. package/lib/dist/viewer/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  725. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-CB9ihrfo.woff +0 -0
  726. package/lib/dist/viewer/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  727. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  728. package/lib/dist/viewer/assets/ibm-plex-mono-latin-600-normal-DWFSQ4vo.woff +0 -0
  729. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-B7_fu1kp.woff2 +0 -0
  730. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-italic-Bg0ZHwF4.woff +0 -0
  731. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-BmRBH3aV.woff2 +0 -0
  732. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-400-normal-D3D2R8hC.woff +0 -0
  733. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CAhNIIs5.woff2 +0 -0
  734. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-500-normal-CZ70TYgx.woff +0 -0
  735. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-D38SheWl.woff2 +0 -0
  736. package/lib/dist/viewer/assets/ibm-plex-mono-latin-ext-600-normal-DmB0ttJJ.woff +0 -0
  737. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-D6eaYXMU.woff +0 -0
  738. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-italic-DRuN92E5.woff2 +0 -0
  739. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-BulugwFq.woff2 +0 -0
  740. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-400-normal-DDuiU_S-.woff +0 -0
  741. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-C8zxqsMH.woff +0 -0
  742. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-500-normal-DZ4AoWbu.woff2 +0 -0
  743. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-D2EvbN8M.woff2 +0 -0
  744. package/lib/dist/viewer/assets/ibm-plex-mono-vietnamese-600-normal-iLQfcSjf.woff +0 -0
  745. package/lib/dist/viewer/assets/index-BSGpxBr9.js +99 -0
  746. package/lib/dist/viewer/assets/index-CF9yvio6.css +1 -0
  747. package/lib/dist/viewer/index.html +16 -0
  748. package/lib/dist/worker-teardown.d.ts +48 -0
  749. package/lib/dist/worker-teardown.d.ts.map +1 -0
  750. package/lib/dist/worker-teardown.js +100 -0
  751. package/lib/dist/worker-teardown.js.map +1 -0
  752. package/lib/kernel/codegraph-kernel.node +2 -2
  753. package/lib/node_modules/.package-lock.json +4 -4
  754. package/lib/node_modules/picomatch/README.md +56 -51
  755. package/lib/node_modules/picomatch/lib/constants.js +4 -0
  756. package/lib/node_modules/picomatch/lib/parse.js +341 -1
  757. package/lib/node_modules/picomatch/lib/picomatch.js +25 -5
  758. package/lib/node_modules/picomatch/lib/scan.js +30 -18
  759. package/lib/node_modules/picomatch/package.json +4 -4
  760. package/lib/package.json +9 -2
  761. package/package.json +1 -1
@@ -0,0 +1,186 @@
1
+ "use strict";
2
+ /**
3
+ * How the JSON API answers — success, refusal, and every failure in between.
4
+ *
5
+ * The viewer is the only client, and it runs on the same machine as the index,
6
+ * so an error here is a message to a developer looking at their own project,
7
+ * not information to withhold from a prober. Every failure therefore says what
8
+ * went wrong and — where there is one — what to do about it, exactly the way
9
+ * the CLI and the MCP tools do. What it never does is leak a stack trace.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MAX_QUERY_LENGTH = exports.MAX_BODY_BYTES = exports.ApiError = void 0;
13
+ exports.badRequest = badRequest;
14
+ exports.notFound = notFound;
15
+ exports.ok = ok;
16
+ exports.fail = fail;
17
+ exports.readJsonBody = readJsonBody;
18
+ exports.requiredParam = requiredParam;
19
+ exports.intParam = intParam;
20
+ exports.textParam = textParam;
21
+ exports.optionalTextParam = optionalTextParam;
22
+ const static_1 = require("../static");
23
+ const STATUS = {
24
+ 'bad-request': 400,
25
+ 'not-found': 404,
26
+ // A path refusal, not an authentication failure — the request asked for
27
+ // something outside the project (traversal, an absolute path, a sensitive
28
+ // directory) and there is no version of it we would serve.
29
+ refused: 403,
30
+ // The index is missing or unusable. 503 rather than 404: the endpoint is
31
+ // real, the data behind it is not there *yet* — `codegraph init` fixes it.
32
+ 'no-index': 503,
33
+ 'index-unusable': 503,
34
+ internal: 500,
35
+ };
36
+ /** An error that already carries a user-facing message and a status. */
37
+ class ApiError extends Error {
38
+ code;
39
+ /** Optional second line: what the user can do about it. */
40
+ hint;
41
+ constructor(code, message, hint) {
42
+ super(message);
43
+ this.name = 'ApiError';
44
+ this.code = code;
45
+ this.hint = hint;
46
+ }
47
+ }
48
+ exports.ApiError = ApiError;
49
+ function badRequest(message, hint) {
50
+ return new ApiError('bad-request', message, hint);
51
+ }
52
+ function notFound(message, hint) {
53
+ return new ApiError('not-found', message, hint);
54
+ }
55
+ /** Send a successful payload. */
56
+ function ok(res, payload, method) {
57
+ (0, static_1.sendJson)(res, 200, payload, method);
58
+ return true;
59
+ }
60
+ /** Send a failure. Anything that is not an {@link ApiError} becomes a 500. */
61
+ function fail(res, err, method) {
62
+ if (err instanceof ApiError) {
63
+ const body = {
64
+ error: err.message,
65
+ code: err.code,
66
+ };
67
+ if (err.hint)
68
+ body.hint = err.hint;
69
+ (0, static_1.sendJson)(res, STATUS[err.code], body, method);
70
+ return true;
71
+ }
72
+ (0, static_1.sendJson)(res, 500, {
73
+ error: err instanceof Error ? err.message : String(err),
74
+ code: 'internal',
75
+ }, method);
76
+ return true;
77
+ }
78
+ // =============================================================================
79
+ // Request bodies
80
+ // =============================================================================
81
+ /**
82
+ * Bytes a request body may carry.
83
+ *
84
+ * The only body this server reads is a saved trail: a name and up to 64 node
85
+ * ids. 64 KB is generous for that and small enough that a runaway client cannot
86
+ * make the process hold a megabyte per socket.
87
+ */
88
+ exports.MAX_BODY_BYTES = 64 * 1024;
89
+ /**
90
+ * Read a request body as JSON.
91
+ *
92
+ * Counts BYTES, not characters, and stops at the cap by destroying the socket
93
+ * rather than draining a body nobody is going to parse — a `Content-Length`
94
+ * header is a claim, and the only limit that holds is the one applied to what
95
+ * actually arrives.
96
+ *
97
+ * @throws {ApiError} `bad-request` for a body that is too large or is not JSON.
98
+ */
99
+ async function readJsonBody(req) {
100
+ const chunks = [];
101
+ let size = 0;
102
+ try {
103
+ for await (const chunk of req) {
104
+ const buf = chunk;
105
+ size += buf.length;
106
+ if (size > exports.MAX_BODY_BYTES) {
107
+ req.destroy();
108
+ throw badRequest(`That request body is too large (max ${exports.MAX_BODY_BYTES} bytes).`);
109
+ }
110
+ chunks.push(buf);
111
+ }
112
+ }
113
+ catch (err) {
114
+ if (err instanceof ApiError)
115
+ throw err;
116
+ throw badRequest('That request body could not be read.');
117
+ }
118
+ if (size === 0)
119
+ throw badRequest('That request needs a JSON body.');
120
+ try {
121
+ return JSON.parse(Buffer.concat(chunks).toString('utf-8'));
122
+ }
123
+ catch {
124
+ throw badRequest('That request body is not valid JSON.');
125
+ }
126
+ }
127
+ // =============================================================================
128
+ // Query parameters
129
+ // =============================================================================
130
+ /** A required, non-empty string parameter. */
131
+ function requiredParam(query, name) {
132
+ const raw = query.get(name);
133
+ if (raw === null || raw.trim() === '') {
134
+ throw badRequest(`Missing required parameter "${name}".`);
135
+ }
136
+ return raw;
137
+ }
138
+ /**
139
+ * A bounded integer parameter.
140
+ *
141
+ * Out-of-range values are an error rather than silently clamped: a viewer
142
+ * asking for line 10 000 000 of a 200-line file has a bug, and answering it
143
+ * with line 200 would hide that.
144
+ */
145
+ function intParam(query, name, opts) {
146
+ const raw = query.get(name);
147
+ if (raw === null || raw.trim() === '') {
148
+ if (opts.default !== undefined)
149
+ return opts.default;
150
+ throw badRequest(`Missing required parameter "${name}".`);
151
+ }
152
+ const value = Number(raw);
153
+ if (!Number.isInteger(value) || value < opts.min || value > opts.max) {
154
+ throw badRequest(`Parameter "${name}" must be a whole number between ${opts.min} and ${opts.max} (got "${raw}").`);
155
+ }
156
+ return value;
157
+ }
158
+ /**
159
+ * Free-form text input, bounded.
160
+ *
161
+ * The same reasoning as the MCP tools' input ceiling: a huge string is never a
162
+ * real query, and letting one through means a full-table LIKE scan or an FTS5
163
+ * parse over megabytes.
164
+ */
165
+ exports.MAX_QUERY_LENGTH = 2_000;
166
+ function textParam(query, name) {
167
+ const raw = requiredParam(query, name);
168
+ return boundLength(raw, name);
169
+ }
170
+ /**
171
+ * Text that must be PRESENT but may be empty — a search box the user has
172
+ * cleared. Absent is still an error; empty is a legitimate state.
173
+ */
174
+ function optionalTextParam(query, name) {
175
+ const raw = query.get(name);
176
+ if (raw === null)
177
+ throw badRequest(`Missing required parameter "${name}".`);
178
+ return boundLength(raw, name);
179
+ }
180
+ function boundLength(raw, name) {
181
+ if (raw.length > exports.MAX_QUERY_LENGTH) {
182
+ throw badRequest(`Parameter "${name}" is too long (max ${exports.MAX_QUERY_LENGTH} characters).`);
183
+ }
184
+ return raw;
185
+ }
186
+ //# sourceMappingURL=respond.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"respond.js","sourceRoot":"","sources":["../../../src/ui-server/api/respond.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA6CH,gCAEC;AAED,4BAEC;AAGD,gBAGC;AAGD,oBAoBC;AAyBD,oCAuBC;AAOD,sCAMC;AASD,4BAiBC;AAWD,8BAGC;AAMD,8CAIC;AA5LD,sCAAqC;AAcrC,MAAM,MAAM,GAAiC;IAC3C,aAAa,EAAE,GAAG;IAClB,WAAW,EAAE,GAAG;IAChB,wEAAwE;IACxE,0EAA0E;IAC1E,2DAA2D;IAC3D,OAAO,EAAE,GAAG;IACZ,yEAAyE;IACzE,2EAA2E;IAC3E,UAAU,EAAE,GAAG;IACf,gBAAgB,EAAE,GAAG;IACrB,QAAQ,EAAE,GAAG;CACd,CAAC;AAEF,wEAAwE;AACxE,MAAa,QAAS,SAAQ,KAAK;IACxB,IAAI,CAAe;IAC5B,2DAA2D;IAClD,IAAI,CAAqB;IAElC,YAAY,IAAkB,EAAE,OAAe,EAAE,IAAa;QAC5D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAXD,4BAWC;AAED,SAAgB,UAAU,CAAC,OAAe,EAAE,IAAa;IACvD,OAAO,IAAI,QAAQ,CAAC,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACpD,CAAC;AAED,SAAgB,QAAQ,CAAC,OAAe,EAAE,IAAa;IACrD,OAAO,IAAI,QAAQ,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,iCAAiC;AACjC,SAAgB,EAAE,CAAC,GA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OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Where a route's code starts — the symbol that runs when a request arrives
3
+ * at `POST /users`, or when a navigation lands on `/capture/review`.
4
+ *
5
+ * Every framework resolver binds a route node to what serves it, but not with
6
+ * the same edge: Expo Router and the React page routers draw a `calls` edge
7
+ * to the component the screen file exports; Express (named handler), NestJS,
8
+ * Spring, FastAPI / Flask / Django, ASP.NET, Vapor, Gin and the React Router
9
+ * draw a `references` edge to the handler; an Express route whose handler is
10
+ * an inline arrow has no handler node at all — the resolver attributes the
11
+ * body's calls to the route itself. The Steps and Screens pictures need ONE
12
+ * answer per route, so this is it, in order of evidence:
13
+ *
14
+ * 1. the target of a `references` edge that is a function, a method, or a
15
+ * class (a DRF ViewSet, a class-based view) — the handler the resolver
16
+ * named at the registration site;
17
+ * 2. the target of a `calls` / `instantiates` edge that is a component — the
18
+ * page a file-routed screen exports;
19
+ * 3. the route itself, when it carries `calls` edges and nothing else — the
20
+ * inline handler, walked as if the route were the function;
21
+ * 4. nothing: the route is drawn alone, and the picture says so.
22
+ *
23
+ * A route whose handler is a DIFFERENT symbol from what the routing manifest
24
+ * names would be a resolver bug, not a case to arbitrate here — both read the
25
+ * same edges.
26
+ */
27
+ import type CodeGraph from '../../index';
28
+ import type { Node } from '../../types';
29
+ export interface RouteRoot {
30
+ /** The symbol a walk from the route starts at; the route itself for an inline handler. */
31
+ node: Node;
32
+ /** The route's handler is an anonymous function at the registration site — the route node stands in for it. */
33
+ inline: boolean;
34
+ }
35
+ /** A React component, by the convention that names one: a PascalCase function in a JS-family file. */
36
+ export declare function looksLikeComponent(node: Node): boolean;
37
+ /**
38
+ * Route id → the layouts it renders inside, outermost first: an Angular
39
+ * parent route's component around its `<router-outlet>`. What happens in a
40
+ * layout — its tabs, its buttons — happens on every screen nested in it.
41
+ */
42
+ export declare function routeLayouts(cg: CodeGraph, routes: readonly Node[]): Map<string, string[]>;
43
+ /** Route id → where its code starts, for every route that has an answer. */
44
+ export declare function routeRoots(cg: CodeGraph, routes: readonly Node[]): Map<string, RouteRoot>;
45
+ //# sourceMappingURL=route-roots.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-roots.d.ts","sourceRoot":"","sources":["../../../src/ui-server/api/route-roots.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB,0FAA0F;IAC1F,IAAI,EAAE,IAAI,CAAC;IACX,+GAA+G;IAC/G,MAAM,EAAE,OAAO,CAAC;CACjB;AAYD,sGAAsG;AACtG,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAItD;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAU1F;AAED,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,IAAI,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CA4CzF"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ /**
3
+ * Where a route's code starts — the symbol that runs when a request arrives
4
+ * at `POST /users`, or when a navigation lands on `/capture/review`.
5
+ *
6
+ * Every framework resolver binds a route node to what serves it, but not with
7
+ * the same edge: Expo Router and the React page routers draw a `calls` edge
8
+ * to the component the screen file exports; Express (named handler), NestJS,
9
+ * Spring, FastAPI / Flask / Django, ASP.NET, Vapor, Gin and the React Router
10
+ * draw a `references` edge to the handler; an Express route whose handler is
11
+ * an inline arrow has no handler node at all — the resolver attributes the
12
+ * body's calls to the route itself. The Steps and Screens pictures need ONE
13
+ * answer per route, so this is it, in order of evidence:
14
+ *
15
+ * 1. the target of a `references` edge that is a function, a method, or a
16
+ * class (a DRF ViewSet, a class-based view) — the handler the resolver
17
+ * named at the registration site;
18
+ * 2. the target of a `calls` / `instantiates` edge that is a component — the
19
+ * page a file-routed screen exports;
20
+ * 3. the route itself, when it carries `calls` edges and nothing else — the
21
+ * inline handler, walked as if the route were the function;
22
+ * 4. nothing: the route is drawn alone, and the picture says so.
23
+ *
24
+ * A route whose handler is a DIFFERENT symbol from what the routing manifest
25
+ * names would be a resolver bug, not a case to arbitrate here — both read the
26
+ * same edges.
27
+ */
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.looksLikeComponent = looksLikeComponent;
30
+ exports.routeLayouts = routeLayouts;
31
+ exports.routeRoots = routeRoots;
32
+ /**
33
+ * What a resolver's `references` edge may name as the handler. A constant or
34
+ * a variable counts: `const authUser = asyncHandler(async (req, res) => …)` is
35
+ * how an Express handler is written with a wrapper, and the registration site
36
+ * named it — the arrow inside has no node of its own, so the binding is the
37
+ * handler, and the walk lends it the file-scope calls within its lines.
38
+ */
39
+ const HANDLER_KINDS = new Set(['function', 'method', 'class', 'component', 'constant', 'variable']);
40
+ const JS_FAMILY = new Set(['javascript', 'typescript', 'tsx', 'jsx']);
41
+ /** A React component, by the convention that names one: a PascalCase function in a JS-family file. */
42
+ function looksLikeComponent(node) {
43
+ if (node.kind === 'component')
44
+ return true;
45
+ if (node.kind !== 'function')
46
+ return false;
47
+ return JS_FAMILY.has(node.language) && /^[A-Z]/.test(node.name);
48
+ }
49
+ /**
50
+ * Route id → the layouts it renders inside, outermost first: an Angular
51
+ * parent route's component around its `<router-outlet>`. What happens in a
52
+ * layout — its tabs, its buttons — happens on every screen nested in it.
53
+ */
54
+ function routeLayouts(cg, routes) {
55
+ const out = new Map();
56
+ if (routes.length === 0)
57
+ return out;
58
+ for (const e of cg.getOutgoingEdgesFrom(routes.map((r) => r.id), ['references'])) {
59
+ if (e.metadata?.layout !== true)
60
+ continue;
61
+ const list = out.get(e.source) ?? [];
62
+ if (!list.includes(e.target))
63
+ list.push(e.target);
64
+ out.set(e.source, list);
65
+ }
66
+ return out;
67
+ }
68
+ /** Route id → where its code starts, for every route that has an answer. */
69
+ function routeRoots(cg, routes) {
70
+ const out = new Map();
71
+ if (routes.length === 0)
72
+ return out;
73
+ const ids = routes.map((r) => r.id);
74
+ const edges = cg.getOutgoingEdgesFrom(ids, ['references', 'calls', 'instantiates']);
75
+ if (edges.length === 0)
76
+ return out;
77
+ const targets = cg.getNodesByIds(edges.map((e) => e.target));
78
+ const byRoute = new Map();
79
+ for (const e of edges) {
80
+ const list = byRoute.get(e.source) ?? [];
81
+ list.push(e);
82
+ byRoute.set(e.source, list);
83
+ }
84
+ const rank = (n) => (n.kind === 'function' || n.kind === 'method' ? 0 : n.kind === 'component' ? 1 : n.kind === 'class' ? 2 : 3);
85
+ for (const route of routes) {
86
+ const list = byRoute.get(route.id);
87
+ if (!list || list.length === 0)
88
+ continue;
89
+ // 1. The handler the resolver named. A layout the screen renders inside
90
+ // (an Angular parent route's component) is not the screen's own.
91
+ const named = list
92
+ .filter((e) => e.kind === 'references' && e.metadata?.layout !== true)
93
+ .map((e) => targets.get(e.target))
94
+ .filter((n) => !!n && HANDLER_KINDS.has(n.kind) && n.id !== route.id)
95
+ .sort((a, b) => rank(a) - rank(b) || a.startLine - b.startLine);
96
+ if (named[0]) {
97
+ out.set(route.id, { node: named[0], inline: false });
98
+ continue;
99
+ }
100
+ // 2. The component a screen file exports.
101
+ const rendered = list
102
+ .filter((e) => e.kind === 'calls' || e.kind === 'instantiates')
103
+ .map((e) => targets.get(e.target))
104
+ .filter((n) => !!n && looksLikeComponent(n) && n.id !== route.id)
105
+ .sort((a, b) => a.startLine - b.startLine);
106
+ if (rendered[0]) {
107
+ out.set(route.id, { node: rendered[0], inline: false });
108
+ continue;
109
+ }
110
+ // 3. The inline handler: the route's own calls are the body's.
111
+ if (list.some((e) => e.kind === 'calls' && targets.get(e.target)?.kind !== 'file')) {
112
+ out.set(route.id, { node: route, inline: true });
113
+ }
114
+ }
115
+ return out;
116
+ }
117
+ //# sourceMappingURL=route-roots.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"route-roots.js","sourceRoot":"","sources":["../../../src/ui-server/api/route-roots.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;AAuBH,gDAIC;AAOD,oCAUC;AAGD,gCA4CC;AA/ED;;;;;;GAMG;AACH,MAAM,aAAa,GAA8B,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAC/H,MAAM,SAAS,GAAwB,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAE3F,sGAAsG;AACtG,SAAgB,kBAAkB,CAAC,IAAU;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC3C,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,EAAa,EAAE,MAAuB;IACjE,MAAM,GAAG,GAAG,IAAI,GAAG,EAAoB,CAAC;IACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,GAAG,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACjF,IAAK,CAAC,CAAC,Q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EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * `GET /api/routes` — the URL to handler map, when the project has one.
3
+ *
4
+ * The engine's routing manifest is a flat list of (url, handler, file, line)
5
+ * rows; it deliberately carries no node ids, because its own consumer (the MCP
6
+ * context builder) renders text. A reader needs to *navigate*, so each entry is
7
+ * matched back to its handler's node id here — batched by file, never a lookup
8
+ * per route.
9
+ *
10
+ * `null` from the engine means "fewer than three real routes", i.e. this
11
+ * project is not a routed app. That is reported as an empty manifest with
12
+ * `routed: false` rather than as an error: "this isn't a web app" is an
13
+ * answer, not a failure.
14
+ *
15
+ * Two things about the manifest shape the numbers here have to work around.
16
+ * Its `limit` is applied in SQL *before* the three-route test, so asking for
17
+ * fewer than three would make every routed project look unrouted — hence the
18
+ * floor on the parameter. And its own `totalRoutes` counts only the rows inside
19
+ * that window, so the headline count comes from the graph's `route` nodes
20
+ * instead, which is the number a reader means by "how many routes are there".
21
+ */
22
+ import type { CodeGraph } from '../../index';
23
+ /** One row of the URL → handler map. */
24
+ export interface WireRoute {
25
+ /** The route node's name, verbatim: "POST /v1/users/{id}". */
26
+ url: string;
27
+ /** The verb, when the name leads with one. Null for file-routed pages. */
28
+ method: string | null;
29
+ /** The URL without the verb — the same string as `url` when there is none. */
30
+ path: string;
31
+ handler: string;
32
+ handlerKind: string;
33
+ /** Where the request is SERVED. */
34
+ file: string;
35
+ line: number;
36
+ handlerId: string | null;
37
+ /** Where the URL is REGISTERED — the router file, which is how routes group. */
38
+ routeFile: string;
39
+ routeLine: number;
40
+ routeId: string;
41
+ /** The handler is written inline at the registration: the route stands in for it. */
42
+ inline: boolean;
43
+ }
44
+ export interface WireRoutes {
45
+ routed: boolean;
46
+ /** Every URL the index holds, whether or not its handler resolved. */
47
+ routeCount: number;
48
+ /** Rows in `entries` — the ones whose handler the manifest could name. */
49
+ shown: number;
50
+ truncated: boolean;
51
+ topHandlerFile: string | null;
52
+ topHandlerFileCount: number;
53
+ entries: WireRoute[];
54
+ }
55
+ /** "POST /v1/users" -> { method: 'POST', path: '/v1/users' }. */
56
+ export declare function splitRouteName(url: string): {
57
+ method: string | null;
58
+ path: string;
59
+ };
60
+ export declare function buildRoutes(cg: CodeGraph, query: URLSearchParams): WireRoutes;
61
+ //# sourceMappingURL=routes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/ui-server/api/routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoB7C,wCAAwC;AACxC,MAAM,WAAW,SAAS;IACxB,8DAA8D;IAC9D,GAAG,EAAE,MAAM,CAAC;IACZ,0EAA0E;IAC1E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,qFAAqF;IACrF,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AAED,iEAAiE;AACjE,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAMnF;AAuDD,wBAAgB,WAAW,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,eAAe,GAAG,UAAU,CAiE7E"}
@@ -0,0 +1,164 @@
1
+ "use strict";
2
+ /**
3
+ * `GET /api/routes` — the URL to handler map, when the project has one.
4
+ *
5
+ * The engine's routing manifest is a flat list of (url, handler, file, line)
6
+ * rows; it deliberately carries no node ids, because its own consumer (the MCP
7
+ * context builder) renders text. A reader needs to *navigate*, so each entry is
8
+ * matched back to its handler's node id here — batched by file, never a lookup
9
+ * per route.
10
+ *
11
+ * `null` from the engine means "fewer than three real routes", i.e. this
12
+ * project is not a routed app. That is reported as an empty manifest with
13
+ * `routed: false` rather than as an error: "this isn't a web app" is an
14
+ * answer, not a failure.
15
+ *
16
+ * Two things about the manifest shape the numbers here have to work around.
17
+ * Its `limit` is applied in SQL *before* the three-route test, so asking for
18
+ * fewer than three would make every routed project look unrouted — hence the
19
+ * floor on the parameter. And its own `totalRoutes` counts only the rows inside
20
+ * that window, so the headline count comes from the graph's `route` nodes
21
+ * instead, which is the number a reader means by "how many routes are there".
22
+ */
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ exports.splitRouteName = splitRouteName;
25
+ exports.buildRoutes = buildRoutes;
26
+ const respond_1 = require("./respond");
27
+ const wire_1 = require("./wire");
28
+ const route_roots_1 = require("./route-roots");
29
+ const query_utils_1 = require("../../search/query-utils");
30
+ /**
31
+ * HTTP verbs a route name may lead with, plus the two stand-ins the resolvers
32
+ * emit when the registration names no verb (`mux.Handle`, `app.use`).
33
+ *
34
+ * The split is done against this list rather than against "the first word" so
35
+ * a file-routed page (`/blog/[slug]`) or a message-bus subscription keeps its
36
+ * whole name in the URL column instead of losing its first segment to a
37
+ * method column that was never there.
38
+ */
39
+ const HTTP_METHODS = new Set([
40
+ 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT',
41
+ 'ANY', 'ALL', 'USE',
42
+ ]);
43
+ /** "POST /v1/users" -> { method: 'POST', path: '/v1/users' }. */
44
+ function splitRouteName(url) {
45
+ const space = url.indexOf(' ');
46
+ if (space <= 0)
47
+ return { method: null, path: url };
48
+ const head = url.slice(0, space);
49
+ if (!HTTP_METHODS.has(head.toUpperCase()))
50
+ return { method: null, path: url };
51
+ return { method: head.toUpperCase(), path: url.slice(space + 1).trimStart() };
52
+ }
53
+ /**
54
+ * The engine needs three surviving rows to call a project routed, and applies
55
+ * `limit` before that test — so anything below three is a question that cannot
56
+ * be answered truthfully rather than a small page.
57
+ */
58
+ const MIN_LIMIT = 3;
59
+ /** Manifest rows fetched per route shown, so folding repeats still fills the page. */
60
+ const ROWS_PER_ROUTE = 4;
61
+ /**
62
+ * The manifest's rows folded to one per route, in its order: the row naming
63
+ * the route's root (the handler a resolver bound, or the component a screen
64
+ * renders), else the route's first row. A route whose root is its own inline
65
+ * body is that route, labelled as an inline handler — not whichever call in
66
+ * the body sorted first — and is left out when it is written in a test, as
67
+ * the manifest leaves out test handlers.
68
+ */
69
+ function oneRowPerRoute(cg, entries) {
70
+ const byRoute = new Map();
71
+ for (const entry of entries) {
72
+ const list = byRoute.get(entry.routeId);
73
+ if (list)
74
+ list.push(entry);
75
+ else
76
+ byRoute.set(entry.routeId, [entry]);
77
+ }
78
+ const routes = [...cg.getNodesByIds([...byRoute.keys()]).values()];
79
+ const roots = (0, route_roots_1.routeRoots)(cg, routes);
80
+ const out = [];
81
+ for (const [routeId, list] of byRoute) {
82
+ const root = roots.get(routeId);
83
+ if (root?.inline) {
84
+ const first = list[0];
85
+ if ((0, query_utils_1.isTestFile)(first.routeFile))
86
+ continue;
87
+ out.push({
88
+ ...first,
89
+ handler: 'inline handler',
90
+ handlerKind: 'route',
91
+ handlerFile: first.routeFile,
92
+ handlerLine: first.routeLine,
93
+ inline: true,
94
+ });
95
+ continue;
96
+ }
97
+ const named = root
98
+ ? list.find((e) => e.handlerFile === root.node.filePath && e.handlerLine === root.node.startLine && e.handler === root.node.name)
99
+ : undefined;
100
+ out.push({ ...(named ?? list[0]), inline: false });
101
+ }
102
+ return out;
103
+ }
104
+ function buildRoutes(cg, query) {
105
+ const limit = (0, respond_1.intParam)(query, 'limit', { min: MIN_LIMIT, max: 500, default: 200 });
106
+ // The engine's manifest is a row per (route, edge): a route bound to two
107
+ // symbols, or an inline handler whose every call reads as a "handler"
108
+ // (hono's `GET /stream/text` came back three times, as `streamText`,
109
+ // `writeln` and `sleep`), repeats. A route has ONE answer to "what serves
110
+ // this" — route-roots.ts's — so rows are over-fetched and folded onto it.
111
+ const fetched = limit * ROWS_PER_ROUTE + 1;
112
+ const manifest = cg.getRoutingManifest(fetched);
113
+ const routeCount = cg.getStats().nodesByKind.route ?? 0;
114
+ if (!manifest) {
115
+ return {
116
+ routed: false,
117
+ routeCount,
118
+ shown: 0,
119
+ truncated: false,
120
+ topHandlerFile: null,
121
+ topHandlerFileCount: 0,
122
+ entries: [],
123
+ };
124
+ }
125
+ const folded = oneRowPerRoute(cg, manifest.entries);
126
+ const truncated = folded.length > limit || manifest.entries.length >= fetched;
127
+ const rows = folded.slice(0, limit);
128
+ // Every row's handler file in one batched query, so a project that scatters
129
+ // handlers across hundreds of files still costs one query per chunk, and no
130
+ // row past a cap is reported as "not in the index" (#1975).
131
+ const handlerFiles = [...new Set(rows.map((e) => e.handlerFile))];
132
+ const byFileLineName = new Map();
133
+ for (const node of cg.getNodesInFiles(handlerFiles)) {
134
+ // Keyed on what the manifest actually knows: file, line and name. Two
135
+ // symbols can share a line (a decorator and its method); the name breaks
136
+ // the tie, and a miss simply leaves that entry unlinked.
137
+ byFileLineName.set(`${node.filePath} ${node.startLine} ${node.name}`, node.id);
138
+ }
139
+ const entries = rows.map((entry) => ({
140
+ url: entry.url,
141
+ ...splitRouteName(entry.url),
142
+ handler: entry.handler,
143
+ handlerKind: entry.handlerKind,
144
+ file: (0, wire_1.toPosixPath)(entry.handlerFile),
145
+ line: entry.handlerLine,
146
+ handlerId: entry.inline
147
+ ? entry.routeId
148
+ : byFileLineName.get(`${entry.handlerFile} ${entry.handlerLine} ${entry.handler}`) ?? null,
149
+ routeFile: (0, wire_1.toPosixPath)(entry.routeFile),
150
+ routeLine: entry.routeLine,
151
+ routeId: entry.routeId,
152
+ inline: entry.inline,
153
+ }));
154
+ return {
155
+ routed: true,
156
+ routeCount,
157
+ shown: entries.length,
158
+ truncated,
159
+ topHandlerFile: manifest.topHandlerFile ? (0, wire_1.toPosixPath)(manifest.topHandlerFile) : null,
160
+ topHandlerFileCount: manifest.topHandlerFileCount,
161
+ entries,
162
+ };
163
+ }
164
+ //# sourceMappingURL=routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../src/ui-server/api/routes.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAyDH,wCAMC;AAuDD,kCAiEC;AApLD,uCAAqC;AACrC,iCAAqC;AACrC,+CAA2C;AAC3C,0DAAsD;AAEtD;;;;;;;;GAQG;AACH,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC;IAChD,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS;IAC9E,KAAK,EAAE,KAAK,EAAE,KAAK;CACpB,CAAC,CAAC;AAoCH,iEAAiE;AACjE,SAAgB,cAAc,CAAC,GAAW;IACxC,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,IAAI,CAAC;QAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,I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