@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,92 @@
1
+ /**
2
+ * The `codegraph ui` server.
3
+ *
4
+ * A loopback-only `node:http` server that hands the browser the built viewer
5
+ * (`dist/viewer/`) and, through the JSON API mounted on the `api` seam below
6
+ * (`./api`), a view of one indexed project. No framework, no new dependency: it
7
+ * answers GET, serves files, and refuses everything else.
8
+ *
9
+ * It is a reader with one exception, added deliberately and scoped as narrowly
10
+ * as it could be: `POST`/`DELETE /api/trails` saves and removes the reader's own
11
+ * named trails, as JSON files under `.codegraph/ui/trails/`. Nothing else it
12
+ * serves has a side effect, no other path accepts a write, and `--read-only`
13
+ * turns even that one off. See `security.ts` for what a write has to carry.
14
+ *
15
+ * The interesting part is not the routing, it is the boundary in `security.ts`.
16
+ * Read that first.
17
+ */
18
+ import * as http from 'http';
19
+ export { ViewerMissingError } from './assets';
20
+ export { BROWSER_ENV, DEFAULT_PORT_ATTEMPTS, DEFAULT_UI_PORT, LOOPBACK_ADDRESS, VIEWER_PATH_ENV, } from './constants';
21
+ export { ALLOWED_METHODS, READ_METHODS, WRITE_HEADER, WRITE_METHODS, PathRefusalError, isAllowedHost, isAllowedOrigin, isSafeRequestPath, isWriteMethod, isWriteRequest, resolveProjectFile, resolveStaticAsset, } from './security';
22
+ export { browserOpenCommand, openBrowser } from './open-browser';
23
+ export { contentTypeFor, cacheControlFor } from './static';
24
+ export { createGraphApi, GraphSession, ApiError } from './api';
25
+ export type { GraphApi, GraphApiOptions } from './api';
26
+ /**
27
+ * Everything a request handler needs, already validated.
28
+ */
29
+ export interface UiRequestContext {
30
+ /** Percent-decoded path portion of the request URL, always starting with `/`. */
31
+ pathname: string;
32
+ /** Parsed query string. */
33
+ query: URLSearchParams;
34
+ /** Absolute path of the indexed project this server is reading. */
35
+ projectRoot: string;
36
+ /**
37
+ * The request method. `GET` or `HEAD` for every read; `POST` or `DELETE`
38
+ * only for a request that already passed {@link isWriteRequest}, which is
39
+ * `/api/trails` and nothing else.
40
+ */
41
+ method: string;
42
+ }
43
+ /**
44
+ * A handler mounted under `/api/`. Returns `true` when it answered the request
45
+ * (i.e. wrote a response), `false` to fall through to a 404.
46
+ *
47
+ * This is the seam the JSON API plugs into. Everything it reads out of — or
48
+ * writes into — the user's repository must go through `resolveProjectFile`;
49
+ * see `security.ts`.
50
+ */
51
+ export type UiApiHandler = (req: http.IncomingMessage, res: http.ServerResponse, ctx: UiRequestContext) => boolean | Promise<boolean>;
52
+ export interface UiServerOptions {
53
+ /** Absolute path of the indexed project to read. */
54
+ projectRoot: string;
55
+ /**
56
+ * Port to bind. `0` lets the OS choose. Defaults to {@link DEFAULT_UI_PORT}.
57
+ */
58
+ port?: number;
59
+ /**
60
+ * Try the next port when the requested one is taken (default `true`).
61
+ *
62
+ * The CLI turns this OFF for an explicit `--port`: a scripted invocation that
63
+ * silently lands somewhere else is worse than one that says the port is busy.
64
+ */
65
+ portFallback?: boolean;
66
+ /** How many ports to try in total. Defaults to {@link DEFAULT_PORT_ATTEMPTS}. */
67
+ maxPortAttempts?: number;
68
+ /** Directory of built viewer assets. Defaults to the shipped `dist/viewer/`. */
69
+ viewerDir?: string;
70
+ /** Optional read-only JSON API mounted under `/api/`. */
71
+ api?: UiApiHandler;
72
+ }
73
+ export interface UiServerHandle {
74
+ /** The port actually bound (may differ from the requested one — see fallback). */
75
+ port: number;
76
+ /** The URL to open. */
77
+ url: string;
78
+ /** Directory being served as the viewer. */
79
+ viewerDir: string;
80
+ /** The underlying server, for tests and for callers that want raw events. */
81
+ server: http.Server;
82
+ /** Stop listening and drop live connections. Idempotent. */
83
+ close(): Promise<void>;
84
+ }
85
+ /**
86
+ * Start the viewer server.
87
+ *
88
+ * Resolves once the socket is bound, so the caller can print a URL that is
89
+ * already answering.
90
+ */
91
+ export declare function startUiServer(options: UiServerOptions): Promise<UiServerHandle>;
92
+ //# sourceMappingURL=index.d.ts.map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,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yDAAyD;IACzD,GAAG,CAAC,EAAE,YAAY,CAAC;CACpB;AAED,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC;IACpB,4DAA4D;IAC5D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAiCD;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC,CAsDrF"}
@@ -0,0 +1,399 @@
1
+ "use strict";
2
+ /**
3
+ * The `codegraph ui` server.
4
+ *
5
+ * A loopback-only `node:http` server that hands the browser the built viewer
6
+ * (`dist/viewer/`) and, through the JSON API mounted on the `api` seam below
7
+ * (`./api`), a view of one indexed project. No framework, no new dependency: it
8
+ * answers GET, serves files, and refuses everything else.
9
+ *
10
+ * It is a reader with one exception, added deliberately and scoped as narrowly
11
+ * as it could be: `POST`/`DELETE /api/trails` saves and removes the reader's own
12
+ * named trails, as JSON files under `.codegraph/ui/trails/`. Nothing else it
13
+ * serves has a side effect, no other path accepts a write, and `--read-only`
14
+ * turns even that one off. See `security.ts` for what a write has to carry.
15
+ *
16
+ * The interesting part is not the routing, it is the boundary in `security.ts`.
17
+ * Read that first.
18
+ */
19
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
20
+ if (k2 === undefined) k2 = k;
21
+ var desc = Object.getOwnPropertyDescriptor(m, k);
22
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
23
+ desc = { enumerable: true, get: function() { return m[k]; } };
24
+ }
25
+ Object.defineProperty(o, k2, desc);
26
+ }) : (function(o, m, k, k2) {
27
+ if (k2 === undefined) k2 = k;
28
+ o[k2] = m[k];
29
+ }));
30
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
31
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
32
+ }) : function(o, v) {
33
+ o["default"] = v;
34
+ });
35
+ var __importStar = (this && this.__importStar) || (function () {
36
+ var ownKeys = function(o) {
37
+ ownKeys = Object.getOwnPropertyNames || function (o) {
38
+ var ar = [];
39
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
40
+ return ar;
41
+ };
42
+ return ownKeys(o);
43
+ };
44
+ return function (mod) {
45
+ if (mod && mod.__esModule) return mod;
46
+ var result = {};
47
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
48
+ __setModuleDefault(result, mod);
49
+ return result;
50
+ };
51
+ })();
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ exports.ApiError = exports.GraphSession = exports.createGraphApi = exports.cacheControlFor = exports.contentTypeFor = exports.openBrowser = exports.browserOpenCommand = exports.resolveStaticAsset = exports.resolveProjectFile = exports.isWriteRequest = exports.isWriteMethod = exports.isSafeRequestPath = exports.isAllowedOrigin = exports.isAllowedHost = exports.PathRefusalError = exports.WRITE_METHODS = exports.WRITE_HEADER = exports.READ_METHODS = exports.ALLOWED_METHODS = exports.VIEWER_PATH_ENV = exports.LOOPBACK_ADDRESS = exports.DEFAULT_UI_PORT = exports.DEFAULT_PORT_ATTEMPTS = exports.BROWSER_ENV = exports.ViewerMissingError = void 0;
54
+ exports.startUiServer = startUiServer;
55
+ const fs = __importStar(require("fs"));
56
+ const http = __importStar(require("http"));
57
+ const path = __importStar(require("path"));
58
+ const assets_1 = require("./assets");
59
+ const security_1 = require("./security");
60
+ const static_1 = require("./static");
61
+ const constants_1 = require("./constants");
62
+ var assets_2 = require("./assets");
63
+ Object.defineProperty(exports, "ViewerMissingError", { enumerable: true, get: function () { return assets_2.ViewerMissingError; } });
64
+ var constants_2 = require("./constants");
65
+ Object.defineProperty(exports, "BROWSER_ENV", { enumerable: true, get: function () { return constants_2.BROWSER_ENV; } });
66
+ Object.defineProperty(exports, "DEFAULT_PORT_ATTEMPTS", { enumerable: true, get: function () { return constants_2.DEFAULT_PORT_ATTEMPTS; } });
67
+ Object.defineProperty(exports, "DEFAULT_UI_PORT", { enumerable: true, get: function () { return constants_2.DEFAULT_UI_PORT; } });
68
+ Object.defineProperty(exports, "LOOPBACK_ADDRESS", { enumerable: true, get: function () { return constants_2.LOOPBACK_ADDRESS; } });
69
+ Object.defineProperty(exports, "VIEWER_PATH_ENV", { enumerable: true, get: function () { return constants_2.VIEWER_PATH_ENV; } });
70
+ var security_2 = require("./security");
71
+ Object.defineProperty(exports, "ALLOWED_METHODS", { enumerable: true, get: function () { return security_2.ALLOWED_METHODS; } });
72
+ Object.defineProperty(exports, "READ_METHODS", { enumerable: true, get: function () { return security_2.READ_METHODS; } });
73
+ Object.defineProperty(exports, "WRITE_HEADER", { enumerable: true, get: function () { return security_2.WRITE_HEADER; } });
74
+ Object.defineProperty(exports, "WRITE_METHODS", { enumerable: true, get: function () { return security_2.WRITE_METHODS; } });
75
+ Object.defineProperty(exports, "PathRefusalError", { enumerable: true, get: function () { return security_2.PathRefusalError; } });
76
+ Object.defineProperty(exports, "isAllowedHost", { enumerable: true, get: function () { return security_2.isAllowedHost; } });
77
+ Object.defineProperty(exports, "isAllowedOrigin", { enumerable: true, get: function () { return security_2.isAllowedOrigin; } });
78
+ Object.defineProperty(exports, "isSafeRequestPath", { enumerable: true, get: function () { return security_2.isSafeRequestPath; } });
79
+ Object.defineProperty(exports, "isWriteMethod", { enumerable: true, get: function () { return security_2.isWriteMethod; } });
80
+ Object.defineProperty(exports, "isWriteRequest", { enumerable: true, get: function () { return security_2.isWriteRequest; } });
81
+ Object.defineProperty(exports, "resolveProjectFile", { enumerable: true, get: function () { return security_2.resolveProjectFile; } });
82
+ Object.defineProperty(exports, "resolveStaticAsset", { enumerable: true, get: function () { return security_2.resolveStaticAsset; } });
83
+ var open_browser_1 = require("./open-browser");
84
+ Object.defineProperty(exports, "browserOpenCommand", { enumerable: true, get: function () { return open_browser_1.browserOpenCommand; } });
85
+ Object.defineProperty(exports, "openBrowser", { enumerable: true, get: function () { return open_browser_1.openBrowser; } });
86
+ var static_2 = require("./static");
87
+ Object.defineProperty(exports, "contentTypeFor", { enumerable: true, get: function () { return static_2.contentTypeFor; } });
88
+ Object.defineProperty(exports, "cacheControlFor", { enumerable: true, get: function () { return static_2.cacheControlFor; } });
89
+ var api_1 = require("./api");
90
+ Object.defineProperty(exports, "createGraphApi", { enumerable: true, get: function () { return api_1.createGraphApi; } });
91
+ Object.defineProperty(exports, "GraphSession", { enumerable: true, get: function () { return api_1.GraphSession; } });
92
+ Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return api_1.ApiError; } });
93
+ /**
94
+ * Response headers sent on EVERY response.
95
+ *
96
+ * `frame-ancestors`/`X-Frame-Options` stop another page from framing the viewer
97
+ * and reading it by overlay; `nosniff` stops an asset with a surprising
98
+ * extension from being executed as script; the CSP pins every resource to this
99
+ * origin, so a future viewer change cannot start phoning out with what it read.
100
+ * `style-src` keeps `'unsafe-inline'` because the syntax highlighter emits
101
+ * inline `style=` attributes on code spans.
102
+ *
103
+ * Note what is NOT here: any `Access-Control-*` header. Their absence is what
104
+ * makes a cross-origin read of a response body impossible even if a request
105
+ * somehow gets past the `Host` check.
106
+ */
107
+ const SECURITY_HEADERS = {
108
+ 'X-Content-Type-Options': 'nosniff',
109
+ 'X-Frame-Options': 'DENY',
110
+ 'Referrer-Policy': 'no-referrer',
111
+ 'Content-Security-Policy': [
112
+ "default-src 'none'",
113
+ "script-src 'self'",
114
+ "style-src 'self' 'unsafe-inline'",
115
+ "img-src 'self' data:",
116
+ "font-src 'self'",
117
+ "connect-src 'self'",
118
+ "base-uri 'none'",
119
+ "form-action 'none'",
120
+ "frame-ancestors 'none'",
121
+ ].join('; '),
122
+ };
123
+ /**
124
+ * Start the viewer server.
125
+ *
126
+ * Resolves once the socket is bound, so the caller can print a URL that is
127
+ * already answering.
128
+ */
129
+ async function startUiServer(options) {
130
+ // realpath, not just resolve: `resolveStaticAsset` hands back realpaths (the
131
+ // symlink check in `validatePathWithinRoot` resolves them), so a viewerDir
132
+ // that still holds a symlink — every macOS `/var/folders` temp dir, plenty of
133
+ // package managers — would make `path.relative` between the two nonsense, and
134
+ // the cache policy that keys off it silently wrong.
135
+ const viewerDir = options.viewerDir ? realpath(options.viewerDir) : (0, assets_1.resolveViewerDir)();
136
+ const projectRoot = path.resolve(options.projectRoot);
137
+ const indexHtml = path.join(viewerDir, 'index.html');
138
+ // The bound port is needed by the Host check, but is only known after listen.
139
+ // Captured by reference so the handler always sees the real value.
140
+ let boundPort = 0;
141
+ const server = http.createServer((req, res) => {
142
+ handleRequest(req, res, {
143
+ viewerDir,
144
+ indexHtml,
145
+ projectRoot,
146
+ api: options.api,
147
+ port: () => boundPort,
148
+ }).catch(() => {
149
+ // handleRequest already answers every error it can; reaching here means
150
+ // the socket itself is gone. Never let it become an unhandled rejection,
151
+ // which the CLI's fatal handlers would turn into a process exit.
152
+ if (!res.writableEnded)
153
+ res.destroy();
154
+ });
155
+ });
156
+ // A browser holds keep-alive sockets open; without this, `close()` would wait
157
+ // for them and Ctrl-C would appear to hang.
158
+ server.keepAliveTimeout = 5_000;
159
+ boundPort = await listenWithFallback(server, {
160
+ port: options.port ?? constants_1.DEFAULT_UI_PORT,
161
+ fallback: options.portFallback ?? true,
162
+ attempts: options.maxPortAttempts ?? constants_1.DEFAULT_PORT_ATTEMPTS,
163
+ });
164
+ let closed = false;
165
+ return {
166
+ port: boundPort,
167
+ url: `http://${constants_1.LOOPBACK_ADDRESS}:${boundPort}`,
168
+ viewerDir,
169
+ server,
170
+ close() {
171
+ if (closed)
172
+ return Promise.resolve();
173
+ closed = true;
174
+ return new Promise((resolve) => {
175
+ server.closeAllConnections();
176
+ server.close(() => resolve());
177
+ });
178
+ },
179
+ };
180
+ }
181
+ /**
182
+ * One request, start to finish. Order matters: the cheap refusals (method,
183
+ * `Host`, `Origin`) run before anything touches the filesystem.
184
+ */
185
+ async function handleRequest(req, res, deps) {
186
+ const method = req.method ?? 'GET';
187
+ for (const [name, value] of Object.entries(SECURITY_HEADERS)) {
188
+ res.setHeader(name, value);
189
+ }
190
+ if (!security_1.ALLOWED_METHODS.includes(method)) {
191
+ res.setHeader('Allow', security_1.ALLOWED_METHODS.join(', '));
192
+ (0, static_1.sendText)(res, 405, `codegraph ui does not answer ${method}.`, method);
193
+ return;
194
+ }
195
+ const port = deps.port();
196
+ if (!(0, security_1.isAllowedHost)(req.headers.host, port)) {
197
+ // The DNS-rebinding refusal. Say why, since a human hitting this through a
198
+ // proxy or a container hostname needs to know what to change.
199
+ (0, static_1.sendText)(res, 403, 'Refused: codegraph ui only answers requests addressed to this machine ' +
200
+ `(localhost, 127.0.0.1 or [::1] on port ${port}).\n` +
201
+ `This request said Host: ${forEcho(req.headers.host)}`, method);
202
+ return;
203
+ }
204
+ if (!(0, security_1.isAllowedOrigin)(readHeader(req, 'origin'), port)) {
205
+ (0, static_1.sendText)(res, 403, 'Refused: cross-origin requests are not served.', method);
206
+ return;
207
+ }
208
+ // Checked on the RAW url, before WHATWG parsing folds `..` segments away.
209
+ const rawPath = (req.url ?? '/').split(/[?#]/)[0] ?? '/';
210
+ // The `/api/` namespace answers JSON for EVERY outcome, refusals included:
211
+ // the viewer parses these responses, and a text/plain body here would surface
212
+ // as a parse error instead of the refusal it actually is.
213
+ const jsonNamespace = rawPath === '/api' || rawPath.startsWith('/api/');
214
+ // The one place this server stops being a pure reader. A write has to be
215
+ // under /api/ and carry the marker header — see `isWriteRequest` for what
216
+ // that closes that Host and Origin do not.
217
+ if ((0, security_1.isWriteMethod)(method)) {
218
+ const verdict = (0, security_1.isWriteRequest)(rawPath, {
219
+ marker: readHeader(req, security_1.WRITE_HEADER),
220
+ contentType: readHeader(req, 'content-type'),
221
+ });
222
+ if (!verdict.ok) {
223
+ if (!jsonNamespace)
224
+ res.setHeader('Allow', security_1.READ_METHODS.join(', '));
225
+ const body = `Refused: ${verdict.reason}`;
226
+ if (jsonNamespace)
227
+ (0, static_1.sendJson)(res, 403, { error: body, code: 'refused' }, method);
228
+ else
229
+ (0, static_1.sendText)(res, 405, body, method);
230
+ return;
231
+ }
232
+ }
233
+ if (!(0, security_1.isSafeRequestPath)(rawPath)) {
234
+ if (jsonNamespace) {
235
+ (0, static_1.sendJson)(res, 404, { error: 'Not found', code: 'not-found' }, method);
236
+ }
237
+ else {
238
+ (0, static_1.sendText)(res, 404, 'Not found', method);
239
+ }
240
+ return;
241
+ }
242
+ let url;
243
+ try {
244
+ url = new URL(req.url ?? '/', `http://${constants_1.LOOPBACK_ADDRESS}:${port}`);
245
+ }
246
+ catch {
247
+ (0, static_1.sendText)(res, 400, 'Bad request URL.', method);
248
+ return;
249
+ }
250
+ // `/api/` is reserved — it must 404 as JSON rather than fall through to the
251
+ // SPA, or a typo'd endpoint returns 200 + HTML and the viewer parses the app
252
+ // shell as a payload.
253
+ if (url.pathname === '/api' || url.pathname.startsWith('/api/')) {
254
+ const ctx = {
255
+ pathname: safeDecode(url.pathname),
256
+ query: url.searchParams,
257
+ projectRoot: deps.projectRoot,
258
+ method,
259
+ };
260
+ if (deps.api) {
261
+ try {
262
+ if (await deps.api(req, res, ctx))
263
+ return;
264
+ }
265
+ catch (err) {
266
+ if (!res.headersSent) {
267
+ (0, static_1.sendJson)(res, 500, { error: err instanceof Error ? err.message : String(err) }, method);
268
+ }
269
+ else {
270
+ res.destroy();
271
+ }
272
+ return;
273
+ }
274
+ }
275
+ if (!res.headersSent)
276
+ (0, static_1.sendJson)(res, 404, { error: `No such endpoint: ${url.pathname}` }, method);
277
+ return;
278
+ }
279
+ const requested = url.pathname === '/' ? '/index.html' : url.pathname;
280
+ const file = (0, security_1.resolveStaticAsset)(deps.viewerDir, requested);
281
+ if (file) {
282
+ (0, static_1.sendFile)(res, file, { rootDir: deps.viewerDir, method });
283
+ return;
284
+ }
285
+ if ((0, static_1.shouldFallBackToIndex)(url.pathname)) {
286
+ (0, static_1.sendFile)(res, deps.indexHtml, { rootDir: deps.viewerDir, method });
287
+ return;
288
+ }
289
+ (0, static_1.sendText)(res, 404, 'Not found', method);
290
+ }
291
+ /** `path.resolve` + symlink resolution, falling back when the path is missing. */
292
+ function realpath(dir) {
293
+ const resolved = path.resolve(dir);
294
+ try {
295
+ return fs.realpathSync(resolved);
296
+ }
297
+ catch {
298
+ return resolved;
299
+ }
300
+ }
301
+ /**
302
+ * Bound and de-fang an attacker-supplied header before echoing it back.
303
+ *
304
+ * The refused `Host` is worth showing — a human hitting this through a proxy or
305
+ * a container hostname needs to know what was actually sent. But it is
306
+ * attacker-chosen text, so it goes out truncated and stripped of control bytes.
307
+ * (The response is `text/plain` + `nosniff`, so there is nothing to inject
308
+ * into; this is belt and braces.)
309
+ */
310
+ function forEcho(value) {
311
+ if (!value)
312
+ return '(none)';
313
+ // eslint-disable-next-line no-control-regex -- stripping raw control bytes IS the point
314
+ const clean = value.replace(/[\x00-\x1f\x7f]/g, '?');
315
+ return clean.length > 100 ? `${clean.slice(0, 100)}…` : clean;
316
+ }
317
+ /** Read a header as a single string (node gives arrays for some headers). */
318
+ function readHeader(req, name) {
319
+ const value = req.headers[name];
320
+ if (value === undefined)
321
+ return undefined;
322
+ return Array.isArray(value) ? value[0] : value;
323
+ }
324
+ /** Percent-decode for display; the raw value is used for anything security-relevant. */
325
+ function safeDecode(value) {
326
+ try {
327
+ return decodeURIComponent(value);
328
+ }
329
+ catch {
330
+ return value;
331
+ }
332
+ }
333
+ /**
334
+ * Bind the first free port at or after `port`, on loopback only.
335
+ *
336
+ * Only `EADDRINUSE` advances to the next port — a permission failure or a bad
337
+ * address will not get better one port over, and retrying twenty times would
338
+ * only bury the real error.
339
+ */
340
+ async function listenWithFallback(server, opts) {
341
+ // Port 0 means "any free port", so there is nothing to fall back from.
342
+ const attempts = opts.port === 0 || !opts.fallback ? 1 : Math.max(1, opts.attempts);
343
+ for (let i = 0; i < attempts; i++) {
344
+ const candidate = opts.port === 0 ? 0 : opts.port + i;
345
+ try {
346
+ await listenOnce(server, candidate);
347
+ const address = server.address();
348
+ if (address === null || typeof address === 'string') {
349
+ throw new Error('The UI server bound to an unexpected address.');
350
+ }
351
+ return address.port;
352
+ }
353
+ catch (err) {
354
+ const code = err.code;
355
+ if (code !== 'EADDRINUSE' || i === attempts - 1) {
356
+ throw describeBindFailure(err, candidate, opts);
357
+ }
358
+ }
359
+ }
360
+ /* istanbul ignore next — the loop either returns or throws */
361
+ throw new Error('The UI server could not bind a port.');
362
+ }
363
+ /**
364
+ * One `listen()` attempt, with both outcomes as a promise.
365
+ *
366
+ * The same `http.Server` is reused across attempts: a `listen()` that failed
367
+ * with EADDRINUSE never took a handle, so it can be listened on again directly
368
+ * (verified on Node 20 and 22 — `server.listening` is still `false` afterwards,
369
+ * and `close()` on a never-listening server would itself throw).
370
+ */
371
+ function listenOnce(server, port) {
372
+ return new Promise((resolve, reject) => {
373
+ const onError = (err) => {
374
+ server.removeListener('listening', onListening);
375
+ reject(err);
376
+ };
377
+ const onListening = () => {
378
+ server.removeListener('error', onError);
379
+ resolve();
380
+ };
381
+ server.once('error', onError);
382
+ server.once('listening', onListening);
383
+ server.listen(port, constants_1.LOOPBACK_ADDRESS);
384
+ });
385
+ }
386
+ /** Turn a bind failure into something a user can act on. */
387
+ function describeBindFailure(err, port, opts) {
388
+ const code = err.code;
389
+ if (code === 'EADDRINUSE') {
390
+ return opts.fallback
391
+ ? new Error(`Ports ${opts.port}–${port} are all in use. Free one, or pick another with --port.`)
392
+ : new Error(`Port ${port} is already in use. Pick another with --port, or omit --port to let CodeGraph find a free one.`);
393
+ }
394
+ if (code === 'EACCES') {
395
+ return new Error(`Not allowed to listen on port ${port}. Ports below 1024 usually need elevated privileges — pick a higher one with --port.`);
396
+ }
397
+ return err instanceof Error ? err : new Error(String(err));
398
+ }
399
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ui-server/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwJH,sCAsDC;AA5MD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA6B;AAC7B,qCAA4C;AAC5C,yCAUoB;AACpB,qCAA+E;AAC/E,2CAAuF;AAEvF,mCAA8C;AAArC,4GAAA,kBAAkB,OAAA;AAC3B,yCAMqB;AALnB,wGAAA,WAAW,OAAA;AACX,kHAAA,qBAAqB,OAAA;AACrB,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,4GAAA,eAAe,OAAA;AAEjB,uCAaoB;AAZlB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,wGAAA,YAAY,OAAA;AACZ,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,2GAAA,eAAe,OAAA;AACf,6GAAA,iBAAiB,OAAA;AACjB,yGAAA,aAAa,OAAA;AACb,0GAAA,cAAc,OAAA;AACd,8GAAA,kBAAkB,OAAA;AAClB,8GAAA,kBAAkB,OAAA;AAEpB,+CAAiE;AAAxD,kHAAA,kBAAkB,OAAA;AAAE,2GAAA,WAAW,OAAA;AACxC,mCAA2D;AAAlD,wGAAA,cAAc,OAAA;AAAE,yGAAA,eAAe,OAAA;AACxC,6BAA+D;AAAtD,qGAAA,cAAc,OAAA;AAAE,mGAAA,YAAY,OAAA;AAAE,+FAAA,QAAQ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S,IAAI,CAAC,IAAI,IAAI,IAAI,yDAAyD,CACpF;YACH,CAAC,CAAC,IAAI,KAAK,CAAC,QAAQ,IAAI,gGAAgG,CAAC,CAAC;IAC9H,CAAC;IACD,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACtB,OAAO,IAAI,KAAK,CAAC,iCAAiC,IAAI,sFAAsF,CAAC,CAAC;IAChJ,CAAC;IACD,OAAO,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AAC7D,CAAC"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Opening the user's browser at the viewer URL.
3
+ *
4
+ * No dependency: the three platform openers are one-liners, and pulling in a
5
+ * package to shell out to `open` would be the only runtime dependency the
6
+ * viewer adds to a CLI that currently has ten.
7
+ */
8
+ import { BROWSER_ENV } from './constants';
9
+ export { BROWSER_ENV };
10
+ export interface OpenCommand {
11
+ command: string;
12
+ args: string[];
13
+ }
14
+ /**
15
+ * The command that would open `url`, or `null` when opening is suppressed.
16
+ *
17
+ * Split out from {@link openBrowser} so the platform mapping is testable
18
+ * without launching anything.
19
+ */
20
+ export declare function browserOpenCommand(url: string, platform: NodeJS.Platform, override?: string): OpenCommand | null;
21
+ /**
22
+ * Open `url` in the user's default browser, best effort.
23
+ *
24
+ * Never throws and never keeps the CLI alive: the child is detached and
25
+ * unref'd, and a missing opener (a headless Linux box with no `xdg-open`) is
26
+ * swallowed — the URL is already printed, which is the part that matters.
27
+ *
28
+ * @returns `true` if a launch was attempted.
29
+ */
30
+ export declare function openBrowser(url: string, platform?: NodeJS.Platform): boolean;
31
+ //# sourceMappingURL=open-browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-browser.d.ts","sourceRoot":"","sources":["../../src/ui-server/open-browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,CAAC;AAIvB,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,QAAQ,CAAC,EAAE,MAAM,GAChB,WAAW,GAAG,IAAI,CAsBpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,CAAC,QAA2B,GAAG,OAAO,CAkB9F"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * Opening the user's browser at the viewer URL.
4
+ *
5
+ * No dependency: the three platform openers are one-liners, and pulling in a
6
+ * package to shell out to `open` would be the only runtime dependency the
7
+ * viewer adds to a CLI that currently has ten.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BROWSER_ENV = void 0;
11
+ exports.browserOpenCommand = browserOpenCommand;
12
+ exports.openBrowser = openBrowser;
13
+ const child_process_1 = require("child_process");
14
+ const constants_1 = require("./constants");
15
+ Object.defineProperty(exports, "BROWSER_ENV", { enumerable: true, get: function () { return constants_1.BROWSER_ENV; } });
16
+ const SUPPRESS_VALUES = new Set(['', 'none', '0', 'false', 'off']);
17
+ /**
18
+ * The command that would open `url`, or `null` when opening is suppressed.
19
+ *
20
+ * Split out from {@link openBrowser} so the platform mapping is testable
21
+ * without launching anything.
22
+ */
23
+ function browserOpenCommand(url, platform, override) {
24
+ if (override !== undefined) {
25
+ const trimmed = override.trim();
26
+ if (SUPPRESS_VALUES.has(trimmed.toLowerCase()))
27
+ return null;
28
+ // Windows: go through `cmd /c` rather than spawning the override directly.
29
+ // `spawn` there is CreateProcess, which only ever launches a real .exe — a
30
+ // `.cmd`/`.bat` browser shim (how most Windows wrappers are written) fails
31
+ // outright, and an extension-less name only resolves because CreateProcess
32
+ // appends `.exe`. Routing through cmd makes .exe, .cmd and .bat all work,
33
+ // and node quotes each argument, so a path with spaces survives. Caught on
34
+ // the Windows VM, where the direct spawn silently launched nothing.
35
+ if (platform === 'win32')
36
+ return { command: 'cmd', args: ['/c', trimmed, url] };
37
+ return { command: trimmed, args: [url] };
38
+ }
39
+ if (platform === 'darwin')
40
+ return { command: 'open', args: [url] };
41
+ if (platform === 'win32') {
42
+ // `start` is a cmd builtin, not an executable. The empty string is the
43
+ // window title — without it `start` treats a quoted URL as the title and
44
+ // opens a blank console instead.
45
+ return { command: 'cmd', args: ['/c', 'start', '', url] };
46
+ }
47
+ return { command: 'xdg-open', args: [url] };
48
+ }
49
+ /**
50
+ * Open `url` in the user's default browser, best effort.
51
+ *
52
+ * Never throws and never keeps the CLI alive: the child is detached and
53
+ * unref'd, and a missing opener (a headless Linux box with no `xdg-open`) is
54
+ * swallowed — the URL is already printed, which is the part that matters.
55
+ *
56
+ * @returns `true` if a launch was attempted.
57
+ */
58
+ function openBrowser(url, platform = process.platform) {
59
+ const open = browserOpenCommand(url, platform, process.env[constants_1.BROWSER_ENV]);
60
+ if (!open)
61
+ return false;
62
+ try {
63
+ const child = (0, child_process_1.spawn)(open.command, open.args, {
64
+ detached: true,
65
+ stdio: 'ignore',
66
+ // `start` is a shell builtin reached through `cmd /c`, so no shell here.
67
+ shell: false,
68
+ });
69
+ child.on('error', () => {
70
+ /* no opener installed — the printed URL is the fallback */
71
+ });
72
+ child.unref();
73
+ return true;
74
+ }
75
+ catch {
76
+ return false;
77
+ }
78
+ }
79
+ //# sourceMappingURL=open-browser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-browser.js","sourceRoot":"","sources":["../../src/ui-server/open-browser.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAoBH,gDA0BC;AAWD,kCAkBC;AAzED,iDAAsC;AACtC,2CAA0C;AAEjC,4FAFA,uBAAW,OAEA;AAE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