@colbymchenry/codegraph-win32-arm64 1.6.2 → 1.6.4

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 (1110) hide show
  1. package/bin/codegraph +1 -1
  2. package/bin/codegraph.cmd +1 -1
  3. package/lib/dist/.test-build-engine.json +1 -1
  4. package/lib/dist/.test-build-viewer.json +1 -1
  5. package/lib/dist/bin/codegraph.d.ts +3 -0
  6. package/lib/dist/bin/codegraph.d.ts.map +1 -1
  7. package/lib/dist/bin/codegraph.js +507 -702
  8. package/lib/dist/bin/codegraph.js.map +1 -1
  9. package/lib/dist/bin/command-supervision.js +1 -57
  10. package/lib/dist/bin/command-supervision.js.map +1 -1
  11. package/lib/dist/bin/fatal-handler.js +0 -46
  12. package/lib/dist/bin/fatal-handler.js.map +1 -1
  13. package/lib/dist/bin/node-version-check.js +0 -33
  14. package/lib/dist/bin/node-version-check.js.map +1 -1
  15. package/lib/dist/bin/uninstall.js +0 -19
  16. package/lib/dist/bin/uninstall.js.map +1 -1
  17. package/lib/dist/bin/viewer-gate.js +0 -14
  18. package/lib/dist/bin/viewer-gate.js.map +1 -1
  19. package/lib/dist/compile-cache.d.ts +2 -0
  20. package/lib/dist/compile-cache.d.ts.map +1 -0
  21. package/lib/dist/compile-cache.js +45 -0
  22. package/lib/dist/compile-cache.js.map +1 -0
  23. package/lib/dist/context/formatter.js +3 -66
  24. package/lib/dist/context/formatter.js.map +1 -1
  25. package/lib/dist/context/index.d.ts +44 -1
  26. package/lib/dist/context/index.d.ts.map +1 -1
  27. package/lib/dist/context/index.js +123 -430
  28. package/lib/dist/context/index.js.map +1 -1
  29. package/lib/dist/context/markers.js +0 -17
  30. package/lib/dist/context/markers.js.map +1 -1
  31. package/lib/dist/db/index.d.ts +44 -1
  32. package/lib/dist/db/index.d.ts.map +1 -1
  33. package/lib/dist/db/index.js +123 -395
  34. package/lib/dist/db/index.js.map +1 -1
  35. package/lib/dist/db/migrations.d.ts +11 -1
  36. package/lib/dist/db/migrations.d.ts.map +1 -1
  37. package/lib/dist/db/migrations.js +71 -79
  38. package/lib/dist/db/migrations.js.map +1 -1
  39. package/lib/dist/db/name-substring-index.d.ts +63 -0
  40. package/lib/dist/db/name-substring-index.d.ts.map +1 -0
  41. package/lib/dist/db/name-substring-index.js +151 -0
  42. package/lib/dist/db/name-substring-index.js.map +1 -0
  43. package/lib/dist/db/node-sqlite.d.ts +19 -0
  44. package/lib/dist/db/node-sqlite.d.ts.map +1 -0
  45. package/lib/dist/db/node-sqlite.js +23 -0
  46. package/lib/dist/db/node-sqlite.js.map +1 -0
  47. package/lib/dist/db/open-error.d.ts +36 -0
  48. package/lib/dist/db/open-error.d.ts.map +1 -0
  49. package/lib/dist/db/open-error.js +63 -0
  50. package/lib/dist/db/open-error.js.map +1 -0
  51. package/lib/dist/db/parameter-flow-queries.d.ts +120 -0
  52. package/lib/dist/db/parameter-flow-queries.d.ts.map +1 -0
  53. package/lib/dist/db/parameter-flow-queries.js +168 -0
  54. package/lib/dist/db/parameter-flow-queries.js.map +1 -0
  55. package/lib/dist/db/queries.d.ts +654 -34
  56. package/lib/dist/db/queries.d.ts.map +1 -1
  57. package/lib/dist/db/queries.js +1466 -1470
  58. package/lib/dist/db/queries.js.map +1 -1
  59. package/lib/dist/db/reference-tail.d.ts +83 -0
  60. package/lib/dist/db/reference-tail.d.ts.map +1 -0
  61. package/lib/dist/db/reference-tail.js +68 -0
  62. package/lib/dist/db/reference-tail.js.map +1 -0
  63. package/lib/dist/db/schema.sql +18 -2
  64. package/lib/dist/db/sqlite-adapter.d.ts +18 -1
  65. package/lib/dist/db/sqlite-adapter.d.ts.map +1 -1
  66. package/lib/dist/db/sqlite-adapter.js +12 -62
  67. package/lib/dist/db/sqlite-adapter.js.map +1 -1
  68. package/lib/dist/db/synthesis-stage.d.ts.map +1 -1
  69. package/lib/dist/db/synthesis-stage.js +2 -6
  70. package/lib/dist/db/synthesis-stage.js.map +1 -1
  71. package/lib/dist/db/wal-valve.js +1 -153
  72. package/lib/dist/db/wal-valve.js.map +1 -1
  73. package/lib/dist/db/wsl-shared-index.js +0 -37
  74. package/lib/dist/db/wsl-shared-index.js.map +1 -1
  75. package/lib/dist/directory.d.ts +51 -0
  76. package/lib/dist/directory.d.ts.map +1 -1
  77. package/lib/dist/directory.js +76 -530
  78. package/lib/dist/directory.js.map +1 -1
  79. package/lib/dist/engine.d.ts +15 -0
  80. package/lib/dist/engine.d.ts.map +1 -0
  81. package/lib/dist/engine.js +35 -0
  82. package/lib/dist/engine.js.map +1 -0
  83. package/lib/dist/errors.d.ts +10 -0
  84. package/lib/dist/errors.d.ts.map +1 -1
  85. package/lib/dist/errors.js +8 -101
  86. package/lib/dist/errors.js.map +1 -1
  87. package/lib/dist/extraction/astro-extractor.d.ts.map +1 -1
  88. package/lib/dist/extraction/astro-extractor.js +11 -101
  89. package/lib/dist/extraction/astro-extractor.js.map +1 -1
  90. package/lib/dist/extraction/cfml-extractor.d.ts +27 -1
  91. package/lib/dist/extraction/cfml-extractor.d.ts.map +1 -1
  92. package/lib/dist/extraction/cfml-extractor.js +70 -206
  93. package/lib/dist/extraction/cfml-extractor.js.map +1 -1
  94. package/lib/dist/extraction/commonjs-requires.js +0 -31
  95. package/lib/dist/extraction/commonjs-requires.js.map +1 -1
  96. package/lib/dist/extraction/dfm-extractor.js +0 -21
  97. package/lib/dist/extraction/dfm-extractor.js.map +1 -1
  98. package/lib/dist/extraction/extraction-version.d.ts +1 -1
  99. package/lib/dist/extraction/extraction-version.js +1 -24
  100. package/lib/dist/extraction/extraction-version.js.map +1 -1
  101. package/lib/dist/extraction/function-ref.d.ts +40 -0
  102. package/lib/dist/extraction/function-ref.d.ts.map +1 -1
  103. package/lib/dist/extraction/function-ref.js +157 -207
  104. package/lib/dist/extraction/function-ref.js.map +1 -1
  105. package/lib/dist/extraction/generated-detection.js +0 -165
  106. package/lib/dist/extraction/generated-detection.js.map +1 -1
  107. package/lib/dist/extraction/grammars.d.ts +73 -4
  108. package/lib/dist/extraction/grammars.d.ts.map +1 -1
  109. package/lib/dist/extraction/grammars.js +160 -431
  110. package/lib/dist/extraction/grammars.js.map +1 -1
  111. package/lib/dist/extraction/index.d.ts +208 -7
  112. package/lib/dist/extraction/index.d.ts.map +1 -1
  113. package/lib/dist/extraction/index.js +594 -1383
  114. package/lib/dist/extraction/index.js.map +1 -1
  115. package/lib/dist/extraction/kernel/decode.js +0 -16
  116. package/lib/dist/extraction/kernel/decode.js.map +1 -1
  117. package/lib/dist/extraction/kernel/index.d.ts +3 -1
  118. package/lib/dist/extraction/kernel/index.d.ts.map +1 -1
  119. package/lib/dist/extraction/kernel/index.js +48 -135
  120. package/lib/dist/extraction/kernel/index.js.map +1 -1
  121. package/lib/dist/extraction/kernel/layout.js +42 -76
  122. package/lib/dist/extraction/kernel/layout.js.map +1 -1
  123. package/lib/dist/extraction/kernel/loader.d.ts +5 -1
  124. package/lib/dist/extraction/kernel/loader.d.ts.map +1 -1
  125. package/lib/dist/extraction/kernel/loader.js +0 -37
  126. package/lib/dist/extraction/kernel/loader.js.map +1 -1
  127. package/lib/dist/extraction/languages/arkts.js +0 -59
  128. package/lib/dist/extraction/languages/arkts.js.map +1 -1
  129. package/lib/dist/extraction/languages/c-cpp.d.ts +125 -28
  130. package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  131. package/lib/dist/extraction/languages/c-cpp.js +789 -856
  132. package/lib/dist/extraction/languages/c-cpp.js.map +1 -1
  133. package/lib/dist/extraction/languages/cfquery.js +0 -9
  134. package/lib/dist/extraction/languages/cfquery.js.map +1 -1
  135. package/lib/dist/extraction/languages/cfscript.d.ts +20 -0
  136. package/lib/dist/extraction/languages/cfscript.d.ts.map +1 -1
  137. package/lib/dist/extraction/languages/cfscript.js +80 -9
  138. package/lib/dist/extraction/languages/cfscript.js.map +1 -1
  139. package/lib/dist/extraction/languages/cobol.js +0 -114
  140. package/lib/dist/extraction/languages/cobol.js.map +1 -1
  141. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts +66 -0
  142. package/lib/dist/extraction/languages/cpp-brace-scopes.d.ts.map +1 -0
  143. package/lib/dist/extraction/languages/cpp-brace-scopes.js +343 -0
  144. package/lib/dist/extraction/languages/cpp-brace-scopes.js.map +1 -0
  145. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts +41 -0
  146. package/lib/dist/extraction/languages/cpp-macro-methods.d.ts.map +1 -0
  147. package/lib/dist/extraction/languages/cpp-macro-methods.js +487 -0
  148. package/lib/dist/extraction/languages/cpp-macro-methods.js.map +1 -0
  149. package/lib/dist/extraction/languages/csharp.js +3 -55
  150. package/lib/dist/extraction/languages/csharp.js.map +1 -1
  151. package/lib/dist/extraction/languages/dart.d.ts +129 -0
  152. package/lib/dist/extraction/languages/dart.d.ts.map +1 -1
  153. package/lib/dist/extraction/languages/dart.js +517 -162
  154. package/lib/dist/extraction/languages/dart.js.map +1 -1
  155. package/lib/dist/extraction/languages/erlang.d.ts.map +1 -1
  156. package/lib/dist/extraction/languages/erlang.js +15 -102
  157. package/lib/dist/extraction/languages/erlang.js.map +1 -1
  158. package/lib/dist/extraction/languages/go.d.ts +48 -0
  159. package/lib/dist/extraction/languages/go.d.ts.map +1 -1
  160. package/lib/dist/extraction/languages/go.js +102 -31
  161. package/lib/dist/extraction/languages/go.js.map +1 -1
  162. package/lib/dist/extraction/languages/index.js +0 -6
  163. package/lib/dist/extraction/languages/index.js.map +1 -1
  164. package/lib/dist/extraction/languages/java.d.ts.map +1 -1
  165. package/lib/dist/extraction/languages/java.js +67 -78
  166. package/lib/dist/extraction/languages/java.js.map +1 -1
  167. package/lib/dist/extraction/languages/javascript.d.ts.map +1 -1
  168. package/lib/dist/extraction/languages/javascript.js +2 -12
  169. package/lib/dist/extraction/languages/javascript.js.map +1 -1
  170. package/lib/dist/extraction/languages/kotlin.d.ts +11 -0
  171. package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -1
  172. package/lib/dist/extraction/languages/kotlin.js +43 -197
  173. package/lib/dist/extraction/languages/kotlin.js.map +1 -1
  174. package/lib/dist/extraction/languages/lua.js +2 -39
  175. package/lib/dist/extraction/languages/lua.js.map +1 -1
  176. package/lib/dist/extraction/languages/luau.js +0 -14
  177. package/lib/dist/extraction/languages/luau.js.map +1 -1
  178. package/lib/dist/extraction/languages/nix.js +0 -16
  179. package/lib/dist/extraction/languages/nix.js.map +1 -1
  180. package/lib/dist/extraction/languages/objc.d.ts.map +1 -1
  181. package/lib/dist/extraction/languages/objc.js +5 -16
  182. package/lib/dist/extraction/languages/objc.js.map +1 -1
  183. package/lib/dist/extraction/languages/pascal-preparse.d.ts +66 -0
  184. package/lib/dist/extraction/languages/pascal-preparse.d.ts.map +1 -0
  185. package/lib/dist/extraction/languages/pascal-preparse.js +958 -0
  186. package/lib/dist/extraction/languages/pascal-preparse.js.map +1 -0
  187. package/lib/dist/extraction/languages/pascal-system.d.ts +11 -0
  188. package/lib/dist/extraction/languages/pascal-system.d.ts.map +1 -0
  189. package/lib/dist/extraction/languages/pascal-system.js +23 -0
  190. package/lib/dist/extraction/languages/pascal-system.js.map +1 -0
  191. package/lib/dist/extraction/languages/pascal.d.ts.map +1 -1
  192. package/lib/dist/extraction/languages/pascal.js +3 -4
  193. package/lib/dist/extraction/languages/pascal.js.map +1 -1
  194. package/lib/dist/extraction/languages/php.d.ts +9 -0
  195. package/lib/dist/extraction/languages/php.d.ts.map +1 -1
  196. package/lib/dist/extraction/languages/php.js +207 -44
  197. package/lib/dist/extraction/languages/php.js.map +1 -1
  198. package/lib/dist/extraction/languages/python.js +2 -20
  199. package/lib/dist/extraction/languages/python.js.map +1 -1
  200. package/lib/dist/extraction/languages/r.js +8 -78
  201. package/lib/dist/extraction/languages/r.js.map +1 -1
  202. package/lib/dist/extraction/languages/ruby.d.ts.map +1 -1
  203. package/lib/dist/extraction/languages/ruby.js +17 -25
  204. package/lib/dist/extraction/languages/ruby.js.map +1 -1
  205. package/lib/dist/extraction/languages/rust-macro-calls.d.ts +32 -0
  206. package/lib/dist/extraction/languages/rust-macro-calls.d.ts.map +1 -0
  207. package/lib/dist/extraction/languages/rust-macro-calls.js +306 -0
  208. package/lib/dist/extraction/languages/rust-macro-calls.js.map +1 -0
  209. package/lib/dist/extraction/languages/rust.d.ts +10 -0
  210. package/lib/dist/extraction/languages/rust.d.ts.map +1 -1
  211. package/lib/dist/extraction/languages/rust.js +15 -47
  212. package/lib/dist/extraction/languages/rust.js.map +1 -1
  213. package/lib/dist/extraction/languages/scala.js +5 -41
  214. package/lib/dist/extraction/languages/scala.js.map +1 -1
  215. package/lib/dist/extraction/languages/solidity.js +1 -82
  216. package/lib/dist/extraction/languages/solidity.js.map +1 -1
  217. package/lib/dist/extraction/languages/swift.js +3 -47
  218. package/lib/dist/extraction/languages/swift.js.map +1 -1
  219. package/lib/dist/extraction/languages/terraform.js +6 -152
  220. package/lib/dist/extraction/languages/terraform.js.map +1 -1
  221. package/lib/dist/extraction/languages/typescript.d.ts +64 -0
  222. package/lib/dist/extraction/languages/typescript.d.ts.map +1 -1
  223. package/lib/dist/extraction/languages/typescript.js +73 -49
  224. package/lib/dist/extraction/languages/typescript.js.map +1 -1
  225. package/lib/dist/extraction/languages/vbnet.d.ts.map +1 -1
  226. package/lib/dist/extraction/languages/vbnet.js +9 -42
  227. package/lib/dist/extraction/languages/vbnet.js.map +1 -1
  228. package/lib/dist/extraction/lazy-frameworks.d.ts +15 -0
  229. package/lib/dist/extraction/lazy-frameworks.d.ts.map +1 -0
  230. package/lib/dist/extraction/lazy-frameworks.js +8 -0
  231. package/lib/dist/extraction/lazy-frameworks.js.map +1 -0
  232. package/lib/dist/extraction/liquid-extractor.d.ts +29 -3
  233. package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -1
  234. package/lib/dist/extraction/liquid-extractor.js +89 -148
  235. package/lib/dist/extraction/liquid-extractor.js.map +1 -1
  236. package/lib/dist/extraction/mybatis-extractor.js +0 -78
  237. package/lib/dist/extraction/mybatis-extractor.js.map +1 -1
  238. package/lib/dist/extraction/parse-budget.d.ts +42 -7
  239. package/lib/dist/extraction/parse-budget.d.ts.map +1 -1
  240. package/lib/dist/extraction/parse-budget.js +39 -15
  241. package/lib/dist/extraction/parse-budget.js.map +1 -1
  242. package/lib/dist/extraction/parse-pool.d.ts +29 -17
  243. package/lib/dist/extraction/parse-pool.d.ts.map +1 -1
  244. package/lib/dist/extraction/parse-pool.js +49 -193
  245. package/lib/dist/extraction/parse-pool.js.map +1 -1
  246. package/lib/dist/extraction/parse-worker.d.ts +1 -1
  247. package/lib/dist/extraction/parse-worker.d.ts.map +1 -1
  248. package/lib/dist/extraction/parse-worker.js +5 -58
  249. package/lib/dist/extraction/parse-worker.js.map +1 -1
  250. package/lib/dist/extraction/razor-extractor.d.ts +9 -0
  251. package/lib/dist/extraction/razor-extractor.d.ts.map +1 -1
  252. package/lib/dist/extraction/razor-extractor.js +45 -69
  253. package/lib/dist/extraction/razor-extractor.js.map +1 -1
  254. package/lib/dist/extraction/razor-script.d.ts +23 -0
  255. package/lib/dist/extraction/razor-script.d.ts.map +1 -0
  256. package/lib/dist/extraction/razor-script.js +244 -0
  257. package/lib/dist/extraction/razor-script.js.map +1 -0
  258. package/lib/dist/extraction/sfc-script.d.ts +42 -0
  259. package/lib/dist/extraction/sfc-script.d.ts.map +1 -1
  260. package/lib/dist/extraction/sfc-script.js +32 -31
  261. package/lib/dist/extraction/sfc-script.js.map +1 -1
  262. package/lib/dist/extraction/store-worker.d.ts +1 -1
  263. package/lib/dist/extraction/store-worker.d.ts.map +1 -1
  264. package/lib/dist/extraction/store-worker.js +1 -38
  265. package/lib/dist/extraction/store-worker.js.map +1 -1
  266. package/lib/dist/extraction/store-writer.js +2 -34
  267. package/lib/dist/extraction/store-writer.js.map +1 -1
  268. package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -1
  269. package/lib/dist/extraction/svelte-extractor.js +11 -87
  270. package/lib/dist/extraction/svelte-extractor.js.map +1 -1
  271. package/lib/dist/extraction/syntax-tokens.d.ts +6 -5
  272. package/lib/dist/extraction/syntax-tokens.d.ts.map +1 -1
  273. package/lib/dist/extraction/syntax-tokens.js +4 -152
  274. package/lib/dist/extraction/syntax-tokens.js.map +1 -1
  275. package/lib/dist/extraction/tree-sitter-helpers.d.ts +37 -1
  276. package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  277. package/lib/dist/extraction/tree-sitter-helpers.js +76 -68
  278. package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -1
  279. package/lib/dist/extraction/tree-sitter-types.d.ts +102 -22
  280. package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  281. package/lib/dist/extraction/tree-sitter-types.js +0 -7
  282. package/lib/dist/extraction/tree-sitter-types.js.map +1 -1
  283. package/lib/dist/extraction/tree-sitter.d.ts +518 -10
  284. package/lib/dist/extraction/tree-sitter.d.ts.map +1 -1
  285. package/lib/dist/extraction/tree-sitter.js +2118 -2554
  286. package/lib/dist/extraction/tree-sitter.js.map +1 -1
  287. package/lib/dist/extraction/vue-extractor.d.ts +13 -0
  288. package/lib/dist/extraction/vue-extractor.d.ts.map +1 -1
  289. package/lib/dist/extraction/vue-extractor.js +52 -92
  290. package/lib/dist/extraction/vue-extractor.js.map +1 -1
  291. package/lib/dist/extraction/vue-options-api.js +0 -32
  292. package/lib/dist/extraction/vue-options-api.js.map +1 -1
  293. package/lib/dist/extraction/vue-template-calls.d.ts +37 -0
  294. package/lib/dist/extraction/vue-template-calls.d.ts.map +1 -0
  295. package/lib/dist/extraction/vue-template-calls.js +497 -0
  296. package/lib/dist/extraction/vue-template-calls.js.map +1 -0
  297. package/lib/dist/extraction/wasm/tree-sitter-dart.wasm +0 -0
  298. package/lib/dist/extraction/wasm/tree-sitter-kotlin.wasm +0 -0
  299. package/lib/dist/extraction/wasm/tree-sitter-swift.wasm +0 -0
  300. package/lib/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  301. package/lib/dist/extraction/wasm-runtime-flags.d.ts +15 -0
  302. package/lib/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  303. package/lib/dist/extraction/wasm-runtime-flags.js +18 -89
  304. package/lib/dist/extraction/wasm-runtime-flags.js.map +1 -1
  305. package/lib/dist/file-limits.d.ts +8 -0
  306. package/lib/dist/file-limits.d.ts.map +1 -1
  307. package/lib/dist/file-limits.js +13 -28
  308. package/lib/dist/file-limits.js.map +1 -1
  309. package/lib/dist/graph/branch-guards.d.ts.map +1 -1
  310. package/lib/dist/graph/branch-guards.js +4 -251
  311. package/lib/dist/graph/branch-guards.js.map +1 -1
  312. package/lib/dist/graph/call-sites.d.ts +12 -0
  313. package/lib/dist/graph/call-sites.d.ts.map +1 -0
  314. package/lib/dist/graph/call-sites.js +17 -0
  315. package/lib/dist/graph/call-sites.js.map +1 -0
  316. package/lib/dist/graph/cobol-copybooks.d.ts +75 -0
  317. package/lib/dist/graph/cobol-copybooks.d.ts.map +1 -0
  318. package/lib/dist/graph/cobol-copybooks.js +45 -0
  319. package/lib/dist/graph/cobol-copybooks.js.map +1 -0
  320. package/lib/dist/graph/dead-code.d.ts +26 -4
  321. package/lib/dist/graph/dead-code.d.ts.map +1 -1
  322. package/lib/dist/graph/dead-code.js +157 -311
  323. package/lib/dist/graph/dead-code.js.map +1 -1
  324. package/lib/dist/graph/dynamic-boundary-report.js +1 -88
  325. package/lib/dist/graph/dynamic-boundary-report.js.map +1 -1
  326. package/lib/dist/graph/file-cycles.d.ts +20 -0
  327. package/lib/dist/graph/file-cycles.d.ts.map +1 -0
  328. package/lib/dist/graph/file-cycles.js +79 -0
  329. package/lib/dist/graph/file-cycles.js.map +1 -0
  330. package/lib/dist/graph/file-drift.d.ts +35 -0
  331. package/lib/dist/graph/file-drift.d.ts.map +1 -0
  332. package/lib/dist/graph/file-drift.js +46 -0
  333. package/lib/dist/graph/file-drift.js.map +1 -0
  334. package/lib/dist/graph/go-package.d.ts +27 -0
  335. package/lib/dist/graph/go-package.d.ts.map +1 -0
  336. package/lib/dist/graph/go-package.js +49 -0
  337. package/lib/dist/graph/go-package.js.map +1 -0
  338. package/lib/dist/graph/index.d.ts +2 -0
  339. package/lib/dist/graph/index.d.ts.map +1 -1
  340. package/lib/dist/graph/index.js +4 -6
  341. package/lib/dist/graph/index.js.map +1 -1
  342. package/lib/dist/graph/named-symbol-flow.d.ts +5 -1
  343. package/lib/dist/graph/named-symbol-flow.d.ts.map +1 -1
  344. package/lib/dist/graph/named-symbol-flow.js +82 -223
  345. package/lib/dist/graph/named-symbol-flow.js.map +1 -1
  346. package/lib/dist/graph/owning-package.d.ts +59 -0
  347. package/lib/dist/graph/owning-package.d.ts.map +1 -0
  348. package/lib/dist/graph/owning-package.js +120 -0
  349. package/lib/dist/graph/owning-package.js.map +1 -0
  350. package/lib/dist/graph/queries.d.ts +6 -3
  351. package/lib/dist/graph/queries.d.ts.map +1 -1
  352. package/lib/dist/graph/queries.js +4 -137
  353. package/lib/dist/graph/queries.js.map +1 -1
  354. package/lib/dist/graph/symbol-lookup.d.ts +15 -3
  355. package/lib/dist/graph/symbol-lookup.d.ts.map +1 -1
  356. package/lib/dist/graph/symbol-lookup.js +47 -89
  357. package/lib/dist/graph/symbol-lookup.js.map +1 -1
  358. package/lib/dist/graph/symbol-references.d.ts +86 -0
  359. package/lib/dist/graph/symbol-references.d.ts.map +1 -0
  360. package/lib/dist/graph/symbol-references.js +304 -0
  361. package/lib/dist/graph/symbol-references.js.map +1 -0
  362. package/lib/dist/graph/synthesized-hop.d.ts +37 -0
  363. package/lib/dist/graph/synthesized-hop.d.ts.map +1 -0
  364. package/lib/dist/graph/synthesized-hop.js +62 -0
  365. package/lib/dist/graph/synthesized-hop.js.map +1 -0
  366. package/lib/dist/graph/test-code.d.ts +33 -0
  367. package/lib/dist/graph/test-code.d.ts.map +1 -0
  368. package/lib/dist/graph/test-code.js +104 -0
  369. package/lib/dist/graph/test-code.js.map +1 -0
  370. package/lib/dist/graph/traversal.d.ts +31 -2
  371. package/lib/dist/graph/traversal.d.ts.map +1 -1
  372. package/lib/dist/graph/traversal.js +96 -226
  373. package/lib/dist/graph/traversal.js.map +1 -1
  374. package/lib/dist/graph/type-hierarchy.js +0 -138
  375. package/lib/dist/graph/type-hierarchy.js.map +1 -1
  376. package/lib/dist/index.d.ts +214 -26
  377. package/lib/dist/index.d.ts.map +1 -1
  378. package/lib/dist/index.js +736 -1112
  379. package/lib/dist/index.js.map +1 -1
  380. package/lib/dist/installer/beta-signup.js +0 -39
  381. package/lib/dist/installer/beta-signup.js.map +1 -1
  382. package/lib/dist/installer/config-writer.js +0 -24
  383. package/lib/dist/installer/config-writer.js.map +1 -1
  384. package/lib/dist/installer/index.d.ts +13 -6
  385. package/lib/dist/installer/index.d.ts.map +1 -1
  386. package/lib/dist/installer/index.js +27 -160
  387. package/lib/dist/installer/index.js.map +1 -1
  388. package/lib/dist/installer/instructions-template.d.ts +16 -1
  389. package/lib/dist/installer/instructions-template.d.ts.map +1 -1
  390. package/lib/dist/installer/instructions-template.js +10 -38
  391. package/lib/dist/installer/instructions-template.js.map +1 -1
  392. package/lib/dist/installer/targets/antigravity.js +0 -113
  393. package/lib/dist/installer/targets/antigravity.js.map +1 -1
  394. package/lib/dist/installer/targets/bob.d.ts +20 -0
  395. package/lib/dist/installer/targets/bob.d.ts.map +1 -0
  396. package/lib/dist/installer/targets/bob.js +83 -0
  397. package/lib/dist/installer/targets/bob.js.map +1 -0
  398. package/lib/dist/installer/targets/claude.d.ts.map +1 -1
  399. package/lib/dist/installer/targets/claude.js +1 -185
  400. package/lib/dist/installer/targets/claude.js.map +1 -1
  401. package/lib/dist/installer/targets/codex.d.ts.map +1 -1
  402. package/lib/dist/installer/targets/codex.js +17 -109
  403. package/lib/dist/installer/targets/codex.js.map +1 -1
  404. package/lib/dist/installer/targets/copilot-cli.d.ts.map +1 -1
  405. package/lib/dist/installer/targets/copilot-cli.js +2 -54
  406. package/lib/dist/installer/targets/copilot-cli.js.map +1 -1
  407. package/lib/dist/installer/targets/copilot-jetbrains.js +0 -57
  408. package/lib/dist/installer/targets/copilot-jetbrains.js.map +1 -1
  409. package/lib/dist/installer/targets/copilot-vscode.js +0 -58
  410. package/lib/dist/installer/targets/copilot-vscode.js.map +1 -1
  411. package/lib/dist/installer/targets/cursor.js +7 -88
  412. package/lib/dist/installer/targets/cursor.js.map +1 -1
  413. package/lib/dist/installer/targets/droid.d.ts +18 -0
  414. package/lib/dist/installer/targets/droid.d.ts.map +1 -0
  415. package/lib/dist/installer/targets/droid.js +92 -0
  416. package/lib/dist/installer/targets/droid.js.map +1 -0
  417. package/lib/dist/installer/targets/dsh.d.ts +35 -0
  418. package/lib/dist/installer/targets/dsh.d.ts.map +1 -0
  419. package/lib/dist/installer/targets/dsh.js +267 -0
  420. package/lib/dist/installer/targets/dsh.js.map +1 -0
  421. package/lib/dist/installer/targets/gemini.js +0 -37
  422. package/lib/dist/installer/targets/gemini.js.map +1 -1
  423. package/lib/dist/installer/targets/grok.d.ts +25 -0
  424. package/lib/dist/installer/targets/grok.d.ts.map +1 -0
  425. package/lib/dist/installer/targets/grok.js +96 -0
  426. package/lib/dist/installer/targets/grok.js.map +1 -0
  427. package/lib/dist/installer/targets/hermes.d.ts +19 -7
  428. package/lib/dist/installer/targets/hermes.d.ts.map +1 -1
  429. package/lib/dist/installer/targets/hermes.js +218 -214
  430. package/lib/dist/installer/targets/hermes.js.map +1 -1
  431. package/lib/dist/installer/targets/json-config.d.ts +45 -0
  432. package/lib/dist/installer/targets/json-config.d.ts.map +1 -0
  433. package/lib/dist/installer/targets/json-config.js +128 -0
  434. package/lib/dist/installer/targets/json-config.js.map +1 -0
  435. package/lib/dist/installer/targets/kimi.d.ts +21 -0
  436. package/lib/dist/installer/targets/kimi.d.ts.map +1 -0
  437. package/lib/dist/installer/targets/kimi.js +97 -0
  438. package/lib/dist/installer/targets/kimi.js.map +1 -0
  439. package/lib/dist/installer/targets/kiro.js +1 -41
  440. package/lib/dist/installer/targets/kiro.js.map +1 -1
  441. package/lib/dist/installer/targets/opencode.d.ts.map +1 -1
  442. package/lib/dist/installer/targets/opencode.js +1 -103
  443. package/lib/dist/installer/targets/opencode.js.map +1 -1
  444. package/lib/dist/installer/targets/pi.d.ts +24 -0
  445. package/lib/dist/installer/targets/pi.d.ts.map +1 -0
  446. package/lib/dist/installer/targets/pi.js +100 -0
  447. package/lib/dist/installer/targets/pi.js.map +1 -0
  448. package/lib/dist/installer/targets/qoder.d.ts +23 -0
  449. package/lib/dist/installer/targets/qoder.d.ts.map +1 -0
  450. package/lib/dist/installer/targets/qoder.js +83 -0
  451. package/lib/dist/installer/targets/qoder.js.map +1 -0
  452. package/lib/dist/installer/targets/qwen.d.ts +21 -0
  453. package/lib/dist/installer/targets/qwen.d.ts.map +1 -0
  454. package/lib/dist/installer/targets/qwen.js +115 -0
  455. package/lib/dist/installer/targets/qwen.js.map +1 -0
  456. package/lib/dist/installer/targets/registry.d.ts.map +1 -1
  457. package/lib/dist/installer/targets/registry.js +18 -25
  458. package/lib/dist/installer/targets/registry.js.map +1 -1
  459. package/lib/dist/installer/targets/shared.d.ts +83 -13
  460. package/lib/dist/installer/targets/shared.d.ts.map +1 -1
  461. package/lib/dist/installer/targets/shared.js +201 -131
  462. package/lib/dist/installer/targets/shared.js.map +1 -1
  463. package/lib/dist/installer/targets/toml.d.ts +82 -6
  464. package/lib/dist/installer/targets/toml.d.ts.map +1 -1
  465. package/lib/dist/installer/targets/toml.js +318 -112
  466. package/lib/dist/installer/targets/toml.js.map +1 -1
  467. package/lib/dist/installer/targets/types.d.ts +1 -1
  468. package/lib/dist/installer/targets/types.d.ts.map +1 -1
  469. package/lib/dist/installer/targets/types.js +0 -13
  470. package/lib/dist/installer/targets/types.js.map +1 -1
  471. package/lib/dist/installer/targets/windsurf.d.ts +22 -0
  472. package/lib/dist/installer/targets/windsurf.d.ts.map +1 -0
  473. package/lib/dist/installer/targets/windsurf.js +90 -0
  474. package/lib/dist/installer/targets/windsurf.js.map +1 -0
  475. package/lib/dist/lazy-engine.d.ts +22 -0
  476. package/lib/dist/lazy-engine.d.ts.map +1 -0
  477. package/lib/dist/lazy-engine.js +16 -0
  478. package/lib/dist/lazy-engine.js.map +1 -0
  479. package/lib/dist/mcp/answer-freshness.js +0 -6
  480. package/lib/dist/mcp/answer-freshness.js.map +1 -1
  481. package/lib/dist/mcp/daemon-manager.js +2 -23
  482. package/lib/dist/mcp/daemon-manager.js.map +1 -1
  483. package/lib/dist/mcp/daemon-paths.d.ts +2 -0
  484. package/lib/dist/mcp/daemon-paths.d.ts.map +1 -1
  485. package/lib/dist/mcp/daemon-paths.js +9 -85
  486. package/lib/dist/mcp/daemon-paths.js.map +1 -1
  487. package/lib/dist/mcp/daemon-proof.d.ts +19 -0
  488. package/lib/dist/mcp/daemon-proof.d.ts.map +1 -0
  489. package/lib/dist/mcp/daemon-proof.js +126 -0
  490. package/lib/dist/mcp/daemon-proof.js.map +1 -0
  491. package/lib/dist/mcp/daemon-registry.d.ts +47 -2
  492. package/lib/dist/mcp/daemon-registry.d.ts.map +1 -1
  493. package/lib/dist/mcp/daemon-registry.js +188 -139
  494. package/lib/dist/mcp/daemon-registry.js.map +1 -1
  495. package/lib/dist/mcp/daemon.d.ts +69 -0
  496. package/lib/dist/mcp/daemon.d.ts.map +1 -1
  497. package/lib/dist/mcp/daemon.js +186 -376
  498. package/lib/dist/mcp/daemon.js.map +1 -1
  499. package/lib/dist/mcp/dynamic-boundaries.js +4 -78
  500. package/lib/dist/mcp/dynamic-boundaries.js.map +1 -1
  501. package/lib/dist/mcp/early-ppid.js +0 -24
  502. package/lib/dist/mcp/early-ppid.js.map +1 -1
  503. package/lib/dist/mcp/engine.d.ts +24 -0
  504. package/lib/dist/mcp/engine.d.ts.map +1 -1
  505. package/lib/dist/mcp/engine.js +47 -152
  506. package/lib/dist/mcp/engine.js.map +1 -1
  507. package/lib/dist/mcp/explore-dedup.js +0 -108
  508. package/lib/dist/mcp/explore-dedup.js.map +1 -1
  509. package/lib/dist/mcp/explore-diagnostics.d.ts +6 -0
  510. package/lib/dist/mcp/explore-diagnostics.d.ts.map +1 -1
  511. package/lib/dist/mcp/explore-diagnostics.js +8 -116
  512. package/lib/dist/mcp/explore-diagnostics.js.map +1 -1
  513. package/lib/dist/mcp/explore-one-symbol.d.ts +77 -0
  514. package/lib/dist/mcp/explore-one-symbol.d.ts.map +1 -0
  515. package/lib/dist/mcp/explore-one-symbol.js +431 -0
  516. package/lib/dist/mcp/explore-one-symbol.js.map +1 -0
  517. package/lib/dist/mcp/explore-session-state.js +0 -129
  518. package/lib/dist/mcp/explore-session-state.js.map +1 -1
  519. package/lib/dist/mcp/hook-client.d.ts +44 -0
  520. package/lib/dist/mcp/hook-client.d.ts.map +1 -0
  521. package/lib/dist/mcp/hook-client.js +202 -0
  522. package/lib/dist/mcp/hook-client.js.map +1 -0
  523. package/lib/dist/mcp/index-freshness-worker.js +1 -6
  524. package/lib/dist/mcp/index-freshness-worker.js.map +1 -1
  525. package/lib/dist/mcp/index-freshness.js +0 -15
  526. package/lib/dist/mcp/index-freshness.js.map +1 -1
  527. package/lib/dist/mcp/index-version-warning.d.ts +21 -0
  528. package/lib/dist/mcp/index-version-warning.d.ts.map +1 -0
  529. package/lib/dist/mcp/index-version-warning.js +38 -0
  530. package/lib/dist/mcp/index-version-warning.js.map +1 -0
  531. package/lib/dist/mcp/index.d.ts +29 -1
  532. package/lib/dist/mcp/index.d.ts.map +1 -1
  533. package/lib/dist/mcp/index.js +131 -300
  534. package/lib/dist/mcp/index.js.map +1 -1
  535. package/lib/dist/mcp/liveness-watchdog.d.ts +13 -3
  536. package/lib/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  537. package/lib/dist/mcp/liveness-watchdog.js +106 -121
  538. package/lib/dist/mcp/liveness-watchdog.js.map +1 -1
  539. package/lib/dist/mcp/opencode-tool-names.d.ts +32 -0
  540. package/lib/dist/mcp/opencode-tool-names.d.ts.map +1 -0
  541. package/lib/dist/mcp/opencode-tool-names.js +24 -0
  542. package/lib/dist/mcp/opencode-tool-names.js.map +1 -0
  543. package/lib/dist/mcp/ppid-watchdog.js +0 -24
  544. package/lib/dist/mcp/ppid-watchdog.js.map +1 -1
  545. package/lib/dist/mcp/process-identity.d.ts +42 -0
  546. package/lib/dist/mcp/process-identity.d.ts.map +1 -0
  547. package/lib/dist/mcp/process-identity.js +130 -0
  548. package/lib/dist/mcp/process-identity.js.map +1 -0
  549. package/lib/dist/mcp/project-lifecycle.d.ts +6 -0
  550. package/lib/dist/mcp/project-lifecycle.d.ts.map +1 -1
  551. package/lib/dist/mcp/project-lifecycle.js +70 -19
  552. package/lib/dist/mcp/project-lifecycle.js.map +1 -1
  553. package/lib/dist/mcp/prompt-explore.d.ts +19 -0
  554. package/lib/dist/mcp/prompt-explore.d.ts.map +1 -0
  555. package/lib/dist/mcp/prompt-explore.js +6 -0
  556. package/lib/dist/mcp/prompt-explore.js.map +1 -0
  557. package/lib/dist/mcp/proxy.d.ts +25 -7
  558. package/lib/dist/mcp/proxy.d.ts.map +1 -1
  559. package/lib/dist/mcp/proxy.js +145 -274
  560. package/lib/dist/mcp/proxy.js.map +1 -1
  561. package/lib/dist/mcp/query-pool.d.ts +52 -3
  562. package/lib/dist/mcp/query-pool.d.ts.map +1 -1
  563. package/lib/dist/mcp/query-pool.js +114 -123
  564. package/lib/dist/mcp/query-pool.js.map +1 -1
  565. package/lib/dist/mcp/query-worker.js +24 -36
  566. package/lib/dist/mcp/query-worker.js.map +1 -1
  567. package/lib/dist/mcp/server-instructions.d.ts +18 -0
  568. package/lib/dist/mcp/server-instructions.d.ts.map +1 -1
  569. package/lib/dist/mcp/server-instructions.js +12 -32
  570. package/lib/dist/mcp/server-instructions.js.map +1 -1
  571. package/lib/dist/mcp/session.d.ts +46 -0
  572. package/lib/dist/mcp/session.d.ts.map +1 -1
  573. package/lib/dist/mcp/session.js +70 -132
  574. package/lib/dist/mcp/session.js.map +1 -1
  575. package/lib/dist/mcp/startup-handshake.js +1 -48
  576. package/lib/dist/mcp/startup-handshake.js.map +1 -1
  577. package/lib/dist/mcp/stdin-teardown.js +0 -28
  578. package/lib/dist/mcp/stdin-teardown.js.map +1 -1
  579. package/lib/dist/mcp/stdout-teardown.d.ts +26 -0
  580. package/lib/dist/mcp/stdout-teardown.d.ts.map +1 -0
  581. package/lib/dist/mcp/stdout-teardown.js +20 -0
  582. package/lib/dist/mcp/stdout-teardown.js.map +1 -0
  583. package/lib/dist/mcp/tools.d.ts +157 -18
  584. package/lib/dist/mcp/tools.d.ts.map +1 -1
  585. package/lib/dist/mcp/tools.js +797 -3621
  586. package/lib/dist/mcp/tools.js.map +1 -1
  587. package/lib/dist/mcp/transport.d.ts.map +1 -1
  588. package/lib/dist/mcp/transport.js +4 -96
  589. package/lib/dist/mcp/transport.js.map +1 -1
  590. package/lib/dist/mcp/version.d.ts +13 -1
  591. package/lib/dist/mcp/version.d.ts.map +1 -1
  592. package/lib/dist/mcp/version.js +19 -21
  593. package/lib/dist/mcp/version.js.map +1 -1
  594. package/lib/dist/mcp/writer-lock.d.ts +11 -0
  595. package/lib/dist/mcp/writer-lock.d.ts.map +1 -1
  596. package/lib/dist/mcp/writer-lock.js +49 -46
  597. package/lib/dist/mcp/writer-lock.js.map +1 -1
  598. package/lib/dist/project-config.d.ts +20 -0
  599. package/lib/dist/project-config.d.ts.map +1 -1
  600. package/lib/dist/project-config.js +31 -140
  601. package/lib/dist/project-config.js.map +1 -1
  602. package/lib/dist/resolution/alias-binding.d.ts +7 -0
  603. package/lib/dist/resolution/alias-binding.d.ts.map +1 -1
  604. package/lib/dist/resolution/alias-binding.js +7 -56
  605. package/lib/dist/resolution/alias-binding.js.map +1 -1
  606. package/lib/dist/resolution/ambient-modules.d.ts +185 -0
  607. package/lib/dist/resolution/ambient-modules.d.ts.map +1 -0
  608. package/lib/dist/resolution/ambient-modules.js +732 -0
  609. package/lib/dist/resolution/ambient-modules.js.map +1 -0
  610. package/lib/dist/resolution/angular-template-synthesizer.d.ts +48 -1
  611. package/lib/dist/resolution/angular-template-synthesizer.d.ts.map +1 -1
  612. package/lib/dist/resolution/angular-template-synthesizer.js +401 -65
  613. package/lib/dist/resolution/angular-template-synthesizer.js.map +1 -1
  614. package/lib/dist/resolution/c-feature-variants.d.ts +40 -0
  615. package/lib/dist/resolution/c-feature-variants.d.ts.map +1 -0
  616. package/lib/dist/resolution/c-feature-variants.js +249 -0
  617. package/lib/dist/resolution/c-feature-variants.js.map +1 -0
  618. package/lib/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  619. package/lib/dist/resolution/c-fnptr-synthesizer.js +23 -391
  620. package/lib/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  621. package/lib/dist/resolution/c-macro-renames.d.ts +25 -0
  622. package/lib/dist/resolution/c-macro-renames.d.ts.map +1 -0
  623. package/lib/dist/resolution/c-macro-renames.js +95 -0
  624. package/lib/dist/resolution/c-macro-renames.js.map +1 -0
  625. package/lib/dist/resolution/callback-synthesizer.d.ts +19 -5
  626. package/lib/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  627. package/lib/dist/resolution/callback-synthesizer.js +1395 -1343
  628. package/lib/dist/resolution/callback-synthesizer.js.map +1 -1
  629. package/lib/dist/resolution/const-alias-synthesizer.d.ts +48 -0
  630. package/lib/dist/resolution/const-alias-synthesizer.d.ts.map +1 -0
  631. package/lib/dist/resolution/const-alias-synthesizer.js +234 -0
  632. package/lib/dist/resolution/const-alias-synthesizer.js.map +1 -0
  633. package/lib/dist/resolution/cooperative-yield.js +0 -27
  634. package/lib/dist/resolution/cooperative-yield.js.map +1 -1
  635. package/lib/dist/resolution/cpp-constructor.d.ts.map +1 -1
  636. package/lib/dist/resolution/cpp-constructor.js +15 -17
  637. package/lib/dist/resolution/cpp-constructor.js.map +1 -1
  638. package/lib/dist/resolution/cpp-includers.d.ts +46 -0
  639. package/lib/dist/resolution/cpp-includers.d.ts.map +1 -0
  640. package/lib/dist/resolution/cpp-includers.js +153 -0
  641. package/lib/dist/resolution/cpp-includers.js.map +1 -0
  642. package/lib/dist/resolution/cpp-macro-visibility.d.ts +16 -0
  643. package/lib/dist/resolution/cpp-macro-visibility.d.ts.map +1 -1
  644. package/lib/dist/resolution/cpp-macro-visibility.js +17 -68
  645. package/lib/dist/resolution/cpp-macro-visibility.js.map +1 -1
  646. package/lib/dist/resolution/cpp-namespaces.d.ts +54 -0
  647. package/lib/dist/resolution/cpp-namespaces.d.ts.map +1 -0
  648. package/lib/dist/resolution/cpp-namespaces.js +151 -0
  649. package/lib/dist/resolution/cpp-namespaces.js.map +1 -0
  650. package/lib/dist/resolution/cpp-raw-strings.d.ts +33 -0
  651. package/lib/dist/resolution/cpp-raw-strings.d.ts.map +1 -0
  652. package/lib/dist/resolution/cpp-raw-strings.js +167 -0
  653. package/lib/dist/resolution/cpp-raw-strings.js.map +1 -0
  654. package/lib/dist/resolution/cpp-supertypes.d.ts +118 -0
  655. package/lib/dist/resolution/cpp-supertypes.d.ts.map +1 -0
  656. package/lib/dist/resolution/cpp-supertypes.js +322 -0
  657. package/lib/dist/resolution/cpp-supertypes.js.map +1 -0
  658. package/lib/dist/resolution/cpp-template-instantiations.d.ts +83 -0
  659. package/lib/dist/resolution/cpp-template-instantiations.d.ts.map +1 -0
  660. package/lib/dist/resolution/cpp-template-instantiations.js +983 -0
  661. package/lib/dist/resolution/cpp-template-instantiations.js.map +1 -0
  662. package/lib/dist/resolution/cpp-type-aliases.d.ts +194 -0
  663. package/lib/dist/resolution/cpp-type-aliases.d.ts.map +1 -0
  664. package/lib/dist/resolution/cpp-type-aliases.js +648 -0
  665. package/lib/dist/resolution/cpp-type-aliases.js.map +1 -0
  666. package/lib/dist/resolution/dart-libraries.d.ts +75 -0
  667. package/lib/dist/resolution/dart-libraries.d.ts.map +1 -0
  668. package/lib/dist/resolution/dart-libraries.js +721 -0
  669. package/lib/dist/resolution/dart-libraries.js.map +1 -0
  670. package/lib/dist/resolution/dart-local-scope.d.ts +41 -0
  671. package/lib/dist/resolution/dart-local-scope.d.ts.map +1 -0
  672. package/lib/dist/resolution/dart-local-scope.js +565 -0
  673. package/lib/dist/resolution/dart-local-scope.js.map +1 -0
  674. package/lib/dist/resolution/event-emitter-synthesizer.d.ts +39 -0
  675. package/lib/dist/resolution/event-emitter-synthesizer.d.ts.map +1 -0
  676. package/lib/dist/resolution/event-emitter-synthesizer.js +656 -0
  677. package/lib/dist/resolution/event-emitter-synthesizer.js.map +1 -0
  678. package/lib/dist/resolution/expo-router-synthesizer.js +0 -52
  679. package/lib/dist/resolution/expo-router-synthesizer.js.map +1 -1
  680. package/lib/dist/resolution/frameworks/angular-router.d.ts.map +1 -1
  681. package/lib/dist/resolution/frameworks/angular-router.js +41 -208
  682. package/lib/dist/resolution/frameworks/angular-router.js.map +1 -1
  683. package/lib/dist/resolution/frameworks/aspnet-routes.d.ts +62 -0
  684. package/lib/dist/resolution/frameworks/aspnet-routes.d.ts.map +1 -0
  685. package/lib/dist/resolution/frameworks/aspnet-routes.js +382 -0
  686. package/lib/dist/resolution/frameworks/aspnet-routes.js.map +1 -0
  687. package/lib/dist/resolution/frameworks/astro.d.ts.map +1 -1
  688. package/lib/dist/resolution/frameworks/astro.js +4 -60
  689. package/lib/dist/resolution/frameworks/astro.js.map +1 -1
  690. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -1
  691. package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -1
  692. package/lib/dist/resolution/frameworks/cargo-workspace.js +65 -15
  693. package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -1
  694. package/lib/dist/resolution/frameworks/cics.d.ts.map +1 -1
  695. package/lib/dist/resolution/frameworks/cics.js +7 -33
  696. package/lib/dist/resolution/frameworks/cics.js.map +1 -1
  697. package/lib/dist/resolution/frameworks/codeigniter.d.ts +23 -0
  698. package/lib/dist/resolution/frameworks/codeigniter.d.ts.map +1 -0
  699. package/lib/dist/resolution/frameworks/codeigniter.js +271 -0
  700. package/lib/dist/resolution/frameworks/codeigniter.js.map +1 -0
  701. package/lib/dist/resolution/frameworks/component-folder.d.ts +17 -0
  702. package/lib/dist/resolution/frameworks/component-folder.d.ts.map +1 -0
  703. package/lib/dist/resolution/frameworks/component-folder.js +11 -0
  704. package/lib/dist/resolution/frameworks/component-folder.js.map +1 -0
  705. package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -1
  706. package/lib/dist/resolution/frameworks/csharp.js +85 -102
  707. package/lib/dist/resolution/frameworks/csharp.js.map +1 -1
  708. package/lib/dist/resolution/frameworks/drupal.d.ts +17 -8
  709. package/lib/dist/resolution/frameworks/drupal.d.ts.map +1 -1
  710. package/lib/dist/resolution/frameworks/drupal.js +377 -142
  711. package/lib/dist/resolution/frameworks/drupal.js.map +1 -1
  712. package/lib/dist/resolution/frameworks/elysia.d.ts +38 -0
  713. package/lib/dist/resolution/frameworks/elysia.d.ts.map +1 -0
  714. package/lib/dist/resolution/frameworks/elysia.js +683 -0
  715. package/lib/dist/resolution/frameworks/elysia.js.map +1 -0
  716. package/lib/dist/resolution/frameworks/expo-modules.d.ts.map +1 -1
  717. package/lib/dist/resolution/frameworks/expo-modules.js +8 -88
  718. package/lib/dist/resolution/frameworks/expo-modules.js.map +1 -1
  719. package/lib/dist/resolution/frameworks/expo-router.d.ts.map +1 -1
  720. package/lib/dist/resolution/frameworks/expo-router.js +9 -190
  721. package/lib/dist/resolution/frameworks/expo-router.js.map +1 -1
  722. package/lib/dist/resolution/frameworks/express.d.ts +48 -1
  723. package/lib/dist/resolution/frameworks/express.d.ts.map +1 -1
  724. package/lib/dist/resolution/frameworks/express.js +193 -199
  725. package/lib/dist/resolution/frameworks/express.js.map +1 -1
  726. package/lib/dist/resolution/frameworks/fabric.js +1 -104
  727. package/lib/dist/resolution/frameworks/fabric.js.map +1 -1
  728. package/lib/dist/resolution/frameworks/go.d.ts.map +1 -1
  729. package/lib/dist/resolution/frameworks/go.js +14 -43
  730. package/lib/dist/resolution/frameworks/go.js.map +1 -1
  731. package/lib/dist/resolution/frameworks/goframe.js +1 -55
  732. package/lib/dist/resolution/frameworks/goframe.js.map +1 -1
  733. package/lib/dist/resolution/frameworks/index.d.ts +14 -0
  734. package/lib/dist/resolution/frameworks/index.d.ts.map +1 -1
  735. package/lib/dist/resolution/frameworks/index.js +16 -50
  736. package/lib/dist/resolution/frameworks/index.js.map +1 -1
  737. package/lib/dist/resolution/frameworks/java.d.ts.map +1 -1
  738. package/lib/dist/resolution/frameworks/java.js +203 -129
  739. package/lib/dist/resolution/frameworks/java.js.map +1 -1
  740. package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -1
  741. package/lib/dist/resolution/frameworks/laravel.js +71 -136
  742. package/lib/dist/resolution/frameworks/laravel.js.map +1 -1
  743. package/lib/dist/resolution/frameworks/name-heuristic.js +0 -12
  744. package/lib/dist/resolution/frameworks/name-heuristic.js.map +1 -1
  745. package/lib/dist/resolution/frameworks/nestjs.js +2 -199
  746. package/lib/dist/resolution/frameworks/nestjs.js.map +1 -1
  747. package/lib/dist/resolution/frameworks/next-proxy.d.ts +67 -0
  748. package/lib/dist/resolution/frameworks/next-proxy.d.ts.map +1 -0
  749. package/lib/dist/resolution/frameworks/next-proxy.js +239 -0
  750. package/lib/dist/resolution/frameworks/next-proxy.js.map +1 -0
  751. package/lib/dist/resolution/frameworks/nextjs.d.ts.map +1 -1
  752. package/lib/dist/resolution/frameworks/nextjs.js +10 -66
  753. package/lib/dist/resolution/frameworks/nextjs.js.map +1 -1
  754. package/lib/dist/resolution/frameworks/object-literal.js +0 -21
  755. package/lib/dist/resolution/frameworks/object-literal.js.map +1 -1
  756. package/lib/dist/resolution/frameworks/package-deps.d.ts +11 -7
  757. package/lib/dist/resolution/frameworks/package-deps.d.ts.map +1 -1
  758. package/lib/dist/resolution/frameworks/package-deps.js +35 -26
  759. package/lib/dist/resolution/frameworks/package-deps.js.map +1 -1
  760. package/lib/dist/resolution/frameworks/page-component.js +0 -14
  761. package/lib/dist/resolution/frameworks/page-component.js.map +1 -1
  762. package/lib/dist/resolution/frameworks/play.d.ts.map +1 -1
  763. package/lib/dist/resolution/frameworks/play.js +26 -34
  764. package/lib/dist/resolution/frameworks/play.js.map +1 -1
  765. package/lib/dist/resolution/frameworks/python.js +5 -102
  766. package/lib/dist/resolution/frameworks/python.js.map +1 -1
  767. package/lib/dist/resolution/frameworks/react-native.d.ts.map +1 -1
  768. package/lib/dist/resolution/frameworks/react-native.js +1 -166
  769. package/lib/dist/resolution/frameworks/react-native.js.map +1 -1
  770. package/lib/dist/resolution/frameworks/react-router.d.ts +13 -4
  771. package/lib/dist/resolution/frameworks/react-router.d.ts.map +1 -1
  772. package/lib/dist/resolution/frameworks/react-router.js +10 -82
  773. package/lib/dist/resolution/frameworks/react-router.js.map +1 -1
  774. package/lib/dist/resolution/frameworks/react.d.ts +57 -0
  775. package/lib/dist/resolution/frameworks/react.d.ts.map +1 -1
  776. package/lib/dist/resolution/frameworks/react.js +1449 -191
  777. package/lib/dist/resolution/frameworks/react.js.map +1 -1
  778. package/lib/dist/resolution/frameworks/ruby.js +1 -61
  779. package/lib/dist/resolution/frameworks/ruby.js.map +1 -1
  780. package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -1
  781. package/lib/dist/resolution/frameworks/rust.js +35 -56
  782. package/lib/dist/resolution/frameworks/rust.js.map +1 -1
  783. package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -1
  784. package/lib/dist/resolution/frameworks/svelte.js +7 -75
  785. package/lib/dist/resolution/frameworks/svelte.js.map +1 -1
  786. package/lib/dist/resolution/frameworks/sveltekit-router.d.ts.map +1 -1
  787. package/lib/dist/resolution/frameworks/sveltekit-router.js +8 -46
  788. package/lib/dist/resolution/frameworks/sveltekit-router.js.map +1 -1
  789. package/lib/dist/resolution/frameworks/swift-objc.js +0 -97
  790. package/lib/dist/resolution/frameworks/swift-objc.js.map +1 -1
  791. package/lib/dist/resolution/frameworks/swift.js +0 -97
  792. package/lib/dist/resolution/frameworks/swift.js.map +1 -1
  793. package/lib/dist/resolution/frameworks/tanstack-router.d.ts.map +1 -1
  794. package/lib/dist/resolution/frameworks/tanstack-router.js +9 -130
  795. package/lib/dist/resolution/frameworks/tanstack-router.js.map +1 -1
  796. package/lib/dist/resolution/frameworks/terraform.js +1 -85
  797. package/lib/dist/resolution/frameworks/terraform.js.map +1 -1
  798. package/lib/dist/resolution/frameworks/vue-router.d.ts.map +1 -1
  799. package/lib/dist/resolution/frameworks/vue-router.js +11 -134
  800. package/lib/dist/resolution/frameworks/vue-router.js.map +1 -1
  801. package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -1
  802. package/lib/dist/resolution/frameworks/vue.js +42 -114
  803. package/lib/dist/resolution/frameworks/vue.js.map +1 -1
  804. package/lib/dist/resolution/go-func-field-synthesizer.d.ts +58 -0
  805. package/lib/dist/resolution/go-func-field-synthesizer.d.ts.map +1 -0
  806. package/lib/dist/resolution/go-func-field-synthesizer.js +696 -0
  807. package/lib/dist/resolution/go-func-field-synthesizer.js.map +1 -0
  808. package/lib/dist/resolution/go-module.d.ts +23 -7
  809. package/lib/dist/resolution/go-module.d.ts.map +1 -1
  810. package/lib/dist/resolution/go-module.js +21 -24
  811. package/lib/dist/resolution/go-module.js.map +1 -1
  812. package/lib/dist/resolution/go-stdlib-methods.d.ts +9 -0
  813. package/lib/dist/resolution/go-stdlib-methods.d.ts.map +1 -0
  814. package/lib/dist/resolution/go-stdlib-methods.js +224 -0
  815. package/lib/dist/resolution/go-stdlib-methods.js.map +1 -0
  816. package/lib/dist/resolution/goframe-synthesizer.js +2 -53
  817. package/lib/dist/resolution/goframe-synthesizer.js.map +1 -1
  818. package/lib/dist/resolution/import-resolver.d.ts +278 -29
  819. package/lib/dist/resolution/import-resolver.d.ts.map +1 -1
  820. package/lib/dist/resolution/import-resolver.js +1825 -1396
  821. package/lib/dist/resolution/import-resolver.js.map +1 -1
  822. package/lib/dist/resolution/index.d.ts +517 -6
  823. package/lib/dist/resolution/index.d.ts.map +1 -1
  824. package/lib/dist/resolution/index.js +1604 -1042
  825. package/lib/dist/resolution/index.js.map +1 -1
  826. package/lib/dist/resolution/js-builtins.d.ts +23 -0
  827. package/lib/dist/resolution/js-builtins.d.ts.map +1 -1
  828. package/lib/dist/resolution/js-builtins.js +34 -14
  829. package/lib/dist/resolution/js-builtins.js.map +1 -1
  830. package/lib/dist/resolution/js-class-expressions.d.ts +48 -0
  831. package/lib/dist/resolution/js-class-expressions.d.ts.map +1 -0
  832. package/lib/dist/resolution/js-class-expressions.js +25 -0
  833. package/lib/dist/resolution/js-class-expressions.js.map +1 -0
  834. package/lib/dist/resolution/js-super-calls.d.ts +18 -0
  835. package/lib/dist/resolution/js-super-calls.d.ts.map +1 -0
  836. package/lib/dist/resolution/js-super-calls.js +94 -0
  837. package/lib/dist/resolution/js-super-calls.js.map +1 -0
  838. package/lib/dist/resolution/jsx-code.d.ts +28 -0
  839. package/lib/dist/resolution/jsx-code.d.ts.map +1 -0
  840. package/lib/dist/resolution/jsx-code.js +459 -0
  841. package/lib/dist/resolution/jsx-code.js.map +1 -0
  842. package/lib/dist/resolution/lru-cache.d.ts +5 -13
  843. package/lib/dist/resolution/lru-cache.d.ts.map +1 -1
  844. package/lib/dist/resolution/lru-cache.js +43 -32
  845. package/lib/dist/resolution/lru-cache.js.map +1 -1
  846. package/lib/dist/resolution/memory-budget.js +0 -52
  847. package/lib/dist/resolution/memory-budget.js.map +1 -1
  848. package/lib/dist/resolution/module-importers.d.ts +210 -0
  849. package/lib/dist/resolution/module-importers.d.ts.map +1 -0
  850. package/lib/dist/resolution/module-importers.js +673 -0
  851. package/lib/dist/resolution/module-importers.js.map +1 -0
  852. package/lib/dist/resolution/name-matcher.d.ts +986 -7
  853. package/lib/dist/resolution/name-matcher.d.ts.map +1 -1
  854. package/lib/dist/resolution/name-matcher.js +24176 -6745
  855. package/lib/dist/resolution/name-matcher.js.map +1 -1
  856. package/lib/dist/resolution/next-router-synthesizer.d.ts +19 -0
  857. package/lib/dist/resolution/next-router-synthesizer.d.ts.map +1 -1
  858. package/lib/dist/resolution/next-router-synthesizer.js +46 -28
  859. package/lib/dist/resolution/next-router-synthesizer.js.map +1 -1
  860. package/lib/dist/resolution/override-parameters.d.ts +40 -0
  861. package/lib/dist/resolution/override-parameters.d.ts.map +1 -0
  862. package/lib/dist/resolution/override-parameters.js +339 -0
  863. package/lib/dist/resolution/override-parameters.js.map +1 -0
  864. package/lib/dist/resolution/parameter-flow.d.ts +218 -0
  865. package/lib/dist/resolution/parameter-flow.d.ts.map +1 -0
  866. package/lib/dist/resolution/parameter-flow.js +474 -0
  867. package/lib/dist/resolution/parameter-flow.js.map +1 -0
  868. package/lib/dist/resolution/pascal-scope.d.ts +91 -0
  869. package/lib/dist/resolution/pascal-scope.d.ts.map +1 -0
  870. package/lib/dist/resolution/pascal-scope.js +961 -0
  871. package/lib/dist/resolution/pascal-scope.js.map +1 -0
  872. package/lib/dist/resolution/path-aliases.d.ts +32 -4
  873. package/lib/dist/resolution/path-aliases.d.ts.map +1 -1
  874. package/lib/dist/resolution/path-aliases.js +43 -110
  875. package/lib/dist/resolution/path-aliases.js.map +1 -1
  876. package/lib/dist/resolution/php-web-root.d.ts +39 -0
  877. package/lib/dist/resolution/php-web-root.d.ts.map +1 -0
  878. package/lib/dist/resolution/php-web-root.js +141 -0
  879. package/lib/dist/resolution/php-web-root.js.map +1 -0
  880. package/lib/dist/resolution/project-scans.d.ts +38 -0
  881. package/lib/dist/resolution/project-scans.d.ts.map +1 -0
  882. package/lib/dist/resolution/project-scans.js +30 -0
  883. package/lib/dist/resolution/project-scans.js.map +1 -0
  884. package/lib/dist/resolution/python-overloads.d.ts +10 -0
  885. package/lib/dist/resolution/python-overloads.d.ts.map +1 -0
  886. package/lib/dist/resolution/python-overloads.js +75 -0
  887. package/lib/dist/resolution/python-overloads.js.map +1 -0
  888. package/lib/dist/resolution/react-router-synthesizer.d.ts.map +1 -1
  889. package/lib/dist/resolution/react-router-synthesizer.js +3 -55
  890. package/lib/dist/resolution/react-router-synthesizer.js.map +1 -1
  891. package/lib/dist/resolution/resolver-pool.d.ts +23 -2
  892. package/lib/dist/resolution/resolver-pool.d.ts.map +1 -1
  893. package/lib/dist/resolution/resolver-pool.js +43 -111
  894. package/lib/dist/resolution/resolver-pool.js.map +1 -1
  895. package/lib/dist/resolution/resolver-worker.d.ts +1 -1
  896. package/lib/dist/resolution/resolver-worker.d.ts.map +1 -1
  897. package/lib/dist/resolution/resolver-worker.js +8 -37
  898. package/lib/dist/resolution/resolver-worker.js.map +1 -1
  899. package/lib/dist/resolution/resurrect-ref.d.ts +25 -0
  900. package/lib/dist/resolution/resurrect-ref.d.ts.map +1 -0
  901. package/lib/dist/resolution/resurrect-ref.js +19 -0
  902. package/lib/dist/resolution/resurrect-ref.js.map +1 -0
  903. package/lib/dist/resolution/ruby-constant-paths.d.ts +56 -0
  904. package/lib/dist/resolution/ruby-constant-paths.d.ts.map +1 -0
  905. package/lib/dist/resolution/ruby-constant-paths.js +255 -0
  906. package/lib/dist/resolution/ruby-constant-paths.js.map +1 -0
  907. package/lib/dist/resolution/ruby-parameter-flow.d.ts +10 -0
  908. package/lib/dist/resolution/ruby-parameter-flow.d.ts.map +1 -0
  909. package/lib/dist/resolution/ruby-parameter-flow.js +801 -0
  910. package/lib/dist/resolution/ruby-parameter-flow.js.map +1 -0
  911. package/lib/dist/resolution/rust-scopes.d.ts +120 -0
  912. package/lib/dist/resolution/rust-scopes.d.ts.map +1 -0
  913. package/lib/dist/resolution/rust-scopes.js +730 -0
  914. package/lib/dist/resolution/rust-scopes.js.map +1 -0
  915. package/lib/dist/resolution/shopify-themes.d.ts +10 -0
  916. package/lib/dist/resolution/shopify-themes.d.ts.map +1 -0
  917. package/lib/dist/resolution/shopify-themes.js +19 -0
  918. package/lib/dist/resolution/shopify-themes.js.map +1 -0
  919. package/lib/dist/resolution/strip-comments.d.ts +20 -1
  920. package/lib/dist/resolution/strip-comments.d.ts.map +1 -1
  921. package/lib/dist/resolution/strip-comments.js +164 -119
  922. package/lib/dist/resolution/strip-comments.js.map +1 -1
  923. package/lib/dist/resolution/sveltekit-synthesizer.js +0 -64
  924. package/lib/dist/resolution/sveltekit-synthesizer.js.map +1 -1
  925. package/lib/dist/resolution/swift-objc-bridge.js +0 -160
  926. package/lib/dist/resolution/swift-objc-bridge.js.map +1 -1
  927. package/lib/dist/resolution/swift-type-visibility.d.ts.map +1 -1
  928. package/lib/dist/resolution/swift-type-visibility.js +62 -104
  929. package/lib/dist/resolution/swift-type-visibility.js.map +1 -1
  930. package/lib/dist/resolution/synth-utils.js +1 -22
  931. package/lib/dist/resolution/synth-utils.js.map +1 -1
  932. package/lib/dist/resolution/tanstack-router-synthesizer.js +0 -32
  933. package/lib/dist/resolution/tanstack-router-synthesizer.js.map +1 -1
  934. package/lib/dist/resolution/tauri-synthesizer.d.ts +37 -0
  935. package/lib/dist/resolution/tauri-synthesizer.d.ts.map +1 -0
  936. package/lib/dist/resolution/tauri-synthesizer.js +1038 -0
  937. package/lib/dist/resolution/tauri-synthesizer.js.map +1 -0
  938. package/lib/dist/resolution/tier-synthesizer.d.ts.map +1 -1
  939. package/lib/dist/resolution/tier-synthesizer.js +35 -177
  940. package/lib/dist/resolution/tier-synthesizer.js.map +1 -1
  941. package/lib/dist/resolution/type-parameters.d.ts +23 -0
  942. package/lib/dist/resolution/type-parameters.d.ts.map +1 -1
  943. package/lib/dist/resolution/type-parameters.js +52 -54
  944. package/lib/dist/resolution/type-parameters.js.map +1 -1
  945. package/lib/dist/resolution/types.d.ts +192 -11
  946. package/lib/dist/resolution/types.d.ts.map +1 -1
  947. package/lib/dist/resolution/types.js +0 -47
  948. package/lib/dist/resolution/types.js.map +1 -1
  949. package/lib/dist/resolution/vbnet-receivers.d.ts +92 -0
  950. package/lib/dist/resolution/vbnet-receivers.d.ts.map +1 -0
  951. package/lib/dist/resolution/vbnet-receivers.js +1482 -0
  952. package/lib/dist/resolution/vbnet-receivers.js.map +1 -0
  953. package/lib/dist/resolution/vue-router-synthesizer.js +0 -31
  954. package/lib/dist/resolution/vue-router-synthesizer.js.map +1 -1
  955. package/lib/dist/resolution/workspace-packages.d.ts +206 -15
  956. package/lib/dist/resolution/workspace-packages.d.ts.map +1 -1
  957. package/lib/dist/resolution/workspace-packages.js +573 -152
  958. package/lib/dist/resolution/workspace-packages.js.map +1 -1
  959. package/lib/dist/search/identifier-segments.js +2 -93
  960. package/lib/dist/search/identifier-segments.js.map +1 -1
  961. package/lib/dist/search/query-parser.js +0 -54
  962. package/lib/dist/search/query-parser.js.map +1 -1
  963. package/lib/dist/search/query-paths.js +0 -167
  964. package/lib/dist/search/query-paths.js.map +1 -1
  965. package/lib/dist/search/query-utils.d.ts +44 -0
  966. package/lib/dist/search/query-utils.d.ts.map +1 -1
  967. package/lib/dist/search/query-utils.js +120 -198
  968. package/lib/dist/search/query-utils.js.map +1 -1
  969. package/lib/dist/sync/git-hooks.d.ts +14 -5
  970. package/lib/dist/sync/git-hooks.d.ts.map +1 -1
  971. package/lib/dist/sync/git-hooks.js +118 -65
  972. package/lib/dist/sync/git-hooks.js.map +1 -1
  973. package/lib/dist/sync/index.js +0 -14
  974. package/lib/dist/sync/index.js.map +1 -1
  975. package/lib/dist/sync/watch-policy.js +0 -45
  976. package/lib/dist/sync/watch-policy.js.map +1 -1
  977. package/lib/dist/sync/watcher.d.ts +29 -11
  978. package/lib/dist/sync/watcher.d.ts.map +1 -1
  979. package/lib/dist/sync/watcher.js +83 -487
  980. package/lib/dist/sync/watcher.js.map +1 -1
  981. package/lib/dist/sync/worktree.d.ts +7 -2
  982. package/lib/dist/sync/worktree.d.ts.map +1 -1
  983. package/lib/dist/sync/worktree.js +24 -97
  984. package/lib/dist/sync/worktree.js.map +1 -1
  985. package/lib/dist/telemetry/index.d.ts.map +1 -1
  986. package/lib/dist/telemetry/index.js +15 -135
  987. package/lib/dist/telemetry/index.js.map +1 -1
  988. package/lib/dist/types.d.ts +46 -0
  989. package/lib/dist/types.d.ts.map +1 -1
  990. package/lib/dist/types.js +15 -44
  991. package/lib/dist/types.js.map +1 -1
  992. package/lib/dist/ui/color.js +0 -19
  993. package/lib/dist/ui/color.js.map +1 -1
  994. package/lib/dist/ui/glyphs.js +2 -45
  995. package/lib/dist/ui/glyphs.js.map +1 -1
  996. package/lib/dist/ui/shimmer-progress.js +0 -21
  997. package/lib/dist/ui/shimmer-progress.js.map +1 -1
  998. package/lib/dist/ui/shimmer-worker.js +0 -22
  999. package/lib/dist/ui/shimmer-worker.js.map +1 -1
  1000. package/lib/dist/ui-server/api/deadcode.d.ts.map +1 -1
  1001. package/lib/dist/ui-server/api/deadcode.js +2 -31
  1002. package/lib/dist/ui-server/api/deadcode.js.map +1 -1
  1003. package/lib/dist/ui-server/api/effects.js +0 -111
  1004. package/lib/dist/ui-server/api/effects.js.map +1 -1
  1005. package/lib/dist/ui-server/api/entrypoints.js +0 -142
  1006. package/lib/dist/ui-server/api/entrypoints.js.map +1 -1
  1007. package/lib/dist/ui-server/api/events.js +0 -145
  1008. package/lib/dist/ui-server/api/events.js.map +1 -1
  1009. package/lib/dist/ui-server/api/file.js +0 -80
  1010. package/lib/dist/ui-server/api/file.js.map +1 -1
  1011. package/lib/dist/ui-server/api/filecode.js +0 -95
  1012. package/lib/dist/ui-server/api/filecode.js.map +1 -1
  1013. package/lib/dist/ui-server/api/flow.js +0 -149
  1014. package/lib/dist/ui-server/api/flow.js.map +1 -1
  1015. package/lib/dist/ui-server/api/hierarchy.js +0 -28
  1016. package/lib/dist/ui-server/api/hierarchy.js.map +1 -1
  1017. package/lib/dist/ui-server/api/index.js +0 -88
  1018. package/lib/dist/ui-server/api/index.js.map +1 -1
  1019. package/lib/dist/ui-server/api/map.d.ts.map +1 -1
  1020. package/lib/dist/ui-server/api/map.js +4 -317
  1021. package/lib/dist/ui-server/api/map.js.map +1 -1
  1022. package/lib/dist/ui-server/api/node.js +0 -111
  1023. package/lib/dist/ui-server/api/node.js.map +1 -1
  1024. package/lib/dist/ui-server/api/nodes.js +0 -16
  1025. package/lib/dist/ui-server/api/nodes.js.map +1 -1
  1026. package/lib/dist/ui-server/api/program.js +0 -90
  1027. package/lib/dist/ui-server/api/program.js.map +1 -1
  1028. package/lib/dist/ui-server/api/respond.js +0 -60
  1029. package/lib/dist/ui-server/api/respond.js.map +1 -1
  1030. package/lib/dist/ui-server/api/route-roots.d.ts.map +1 -1
  1031. package/lib/dist/ui-server/api/route-roots.js +2 -44
  1032. package/lib/dist/ui-server/api/route-roots.js.map +1 -1
  1033. package/lib/dist/ui-server/api/routes.d.ts.map +1 -1
  1034. package/lib/dist/ui-server/api/routes.js +4 -60
  1035. package/lib/dist/ui-server/api/routes.js.map +1 -1
  1036. package/lib/dist/ui-server/api/screens.d.ts.map +1 -1
  1037. package/lib/dist/ui-server/api/screens.js +4 -174
  1038. package/lib/dist/ui-server/api/screens.js.map +1 -1
  1039. package/lib/dist/ui-server/api/search.js +0 -62
  1040. package/lib/dist/ui-server/api/search.js.map +1 -1
  1041. package/lib/dist/ui-server/api/session.js +0 -58
  1042. package/lib/dist/ui-server/api/session.js.map +1 -1
  1043. package/lib/dist/ui-server/api/source.d.ts.map +1 -1
  1044. package/lib/dist/ui-server/api/source.js +0 -161
  1045. package/lib/dist/ui-server/api/source.js.map +1 -1
  1046. package/lib/dist/ui-server/api/stats.js +0 -58
  1047. package/lib/dist/ui-server/api/stats.js.map +1 -1
  1048. package/lib/dist/ui-server/api/steps.d.ts.map +1 -1
  1049. package/lib/dist/ui-server/api/steps.js +5 -381
  1050. package/lib/dist/ui-server/api/steps.js.map +1 -1
  1051. package/lib/dist/ui-server/api/trail-store.d.ts +3 -3
  1052. package/lib/dist/ui-server/api/trail-store.d.ts.map +1 -1
  1053. package/lib/dist/ui-server/api/trail-store.js +24 -106
  1054. package/lib/dist/ui-server/api/trail-store.js.map +1 -1
  1055. package/lib/dist/ui-server/api/trails.d.ts.map +1 -1
  1056. package/lib/dist/ui-server/api/trails.js +19 -94
  1057. package/lib/dist/ui-server/api/trails.js.map +1 -1
  1058. package/lib/dist/ui-server/api/when.js +0 -36
  1059. package/lib/dist/ui-server/api/when.js.map +1 -1
  1060. package/lib/dist/ui-server/api/wire.js +0 -58
  1061. package/lib/dist/ui-server/api/wire.js.map +1 -1
  1062. package/lib/dist/ui-server/assets.js +0 -35
  1063. package/lib/dist/ui-server/assets.js.map +1 -1
  1064. package/lib/dist/ui-server/constants.js +0 -26
  1065. package/lib/dist/ui-server/constants.js.map +1 -1
  1066. package/lib/dist/ui-server/highlight/bounded-tokenize.js +0 -25
  1067. package/lib/dist/ui-server/highlight/bounded-tokenize.js.map +1 -1
  1068. package/lib/dist/ui-server/highlight/index.js +1 -132
  1069. package/lib/dist/ui-server/highlight/index.js.map +1 -1
  1070. package/lib/dist/ui-server/highlight/languages.d.ts +3 -3
  1071. package/lib/dist/ui-server/highlight/languages.js +0 -31
  1072. package/lib/dist/ui-server/highlight/languages.js.map +1 -1
  1073. package/lib/dist/ui-server/highlight/tokenize-worker.js +0 -5
  1074. package/lib/dist/ui-server/highlight/tokenize-worker.js.map +1 -1
  1075. package/lib/dist/ui-server/index.d.ts +25 -0
  1076. package/lib/dist/ui-server/index.d.ts.map +1 -1
  1077. package/lib/dist/ui-server/index.js +35 -103
  1078. package/lib/dist/ui-server/index.js.map +1 -1
  1079. package/lib/dist/ui-server/open-browser.js +0 -34
  1080. package/lib/dist/ui-server/open-browser.js.map +1 -1
  1081. package/lib/dist/ui-server/security.d.ts +5 -0
  1082. package/lib/dist/ui-server/security.d.ts.map +1 -1
  1083. package/lib/dist/ui-server/security.js +11 -147
  1084. package/lib/dist/ui-server/security.js.map +1 -1
  1085. package/lib/dist/ui-server/static.js +0 -41
  1086. package/lib/dist/ui-server/static.js.map +1 -1
  1087. package/lib/dist/upgrade/index.d.ts +18 -5
  1088. package/lib/dist/upgrade/index.d.ts.map +1 -1
  1089. package/lib/dist/upgrade/index.js +73 -229
  1090. package/lib/dist/upgrade/index.js.map +1 -1
  1091. package/lib/dist/upgrade/remove-binary.js +2 -67
  1092. package/lib/dist/upgrade/remove-binary.js.map +1 -1
  1093. package/lib/dist/upgrade/update-check.js +1 -81
  1094. package/lib/dist/upgrade/update-check.js.map +1 -1
  1095. package/lib/dist/utils.d.ts +69 -1
  1096. package/lib/dist/utils.d.ts.map +1 -1
  1097. package/lib/dist/utils.js +224 -266
  1098. package/lib/dist/utils.js.map +1 -1
  1099. package/lib/dist/worker-teardown.js +0 -47
  1100. package/lib/dist/worker-teardown.js.map +1 -1
  1101. package/lib/kernel/codegraph-kernel.node +2 -2
  1102. package/lib/node_modules/.package-lock.json +4 -4
  1103. package/lib/node_modules/ignore/README.md +138 -8
  1104. package/lib/node_modules/ignore/index.d.ts +56 -20
  1105. package/lib/node_modules/ignore/index.js +1033 -221
  1106. package/lib/node_modules/ignore/legacy.js +871 -178
  1107. package/lib/node_modules/ignore/package.json +10 -4
  1108. package/lib/package.json +14 -8
  1109. package/node.exe +2 -2
  1110. package/package.json +1 -1
@@ -1,45 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * Shared MCP daemon — issue #411.
4
- *
5
- * One detached `codegraph serve --mcp` daemon process per project root,
6
- * accepting N concurrent MCP clients over a Unix-domain socket (or named pipe
7
- * on Windows). Each incoming connection gets its own {@link MCPSession}; all
8
- * sessions share a single {@link MCPEngine}, which means a single file watcher
9
- * (one inotify set), a single SQLite connection (one WAL writer), and a single
10
- * tree-sitter warm-up — paid once, amortized across every agent talking to the
11
- * project.
12
- *
13
- * Lifecycle (see also `./index.ts` and `./proxy.ts`):
14
- * - The daemon is spawned **detached** (its own session/process group, stdio
15
- * decoupled) by the first launcher that finds no daemon running. It is NOT
16
- * a child of any MCP host, so closing one terminal / Ctrl-C'ing one session
17
- * can't take it down and sever the others. That's why this process has no
18
- * PPID watchdog: it deliberately outlives every individual client.
19
- * - Every MCP host talks to the daemon through a thin `proxy` process (the
20
- * thing the host actually spawned). The proxy keeps the #277 PPID watchdog,
21
- * so a SIGKILL'd host still reaps its proxy promptly; the proxy's socket
22
- * close then decrements the daemon's refcount.
23
- * - When the last client disconnects the daemon lingers for
24
- * `CODEGRAPH_DAEMON_IDLE_TIMEOUT_MS` (default 300s) so back-to-back agent
25
- * runs in the same project don't repay startup, then exits cleanly. This is
26
- * what keeps a single-agent session from leaking a daemon forever (#277).
27
- *
28
- * What this file owns:
29
- * - Listening on the daemon socket and spawning per-connection sessions.
30
- * - The handshake "hello" line that lets a proxy verify it found a
31
- * same-version daemon before piping any JSON-RPC through it.
32
- * - The lockfile (`.codegraph/daemon.pid`) competing daemons arbitrate
33
- * against — atomic `O_EXCL` create with the full record written in the same
34
- * breath (no empty-file window) + cleanup on exit.
35
- * - Reference counting + idle timeout.
36
- * - Graceful shutdown on SIGTERM/SIGINT and idle exit.
37
- *
38
- * What this file does NOT own:
39
- * - The proxy side (`./proxy.ts`).
40
- * - The decision of *whether* to run as daemon at all — that's `MCPServer`.
41
- * - The MCP protocol state machine — that's `./session.ts`.
42
- */
43
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
44
3
  if (k2 === undefined) k2 = k;
45
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -76,6 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
76
35
  Object.defineProperty(exports, "__esModule", { value: true });
77
36
  exports.MAX_HELLO_LINE_BYTES = exports.Daemon = void 0;
78
37
  exports.finalizeDaemonExit = finalizeDaemonExit;
38
+ exports.projectGoneReason = projectGoneReason;
39
+ exports.installChangedReason = installChangedReason;
79
40
  exports.refreshDaemonLock = refreshDaemonLock;
80
41
  exports.tryAcquireDaemonLock = tryAcquireDaemonLock;
81
42
  exports.acquireLockViaExclusiveOpen = acquireLockViaExclusiveOpen;
@@ -92,78 +53,78 @@ const session_1 = require("./session");
92
53
  const transport_1 = require("./transport");
93
54
  const daemon_paths_1 = require("./daemon-paths");
94
55
  const version_1 = require("./version");
56
+ const daemon_proof_1 = require("./daemon-proof");
95
57
  const writer_lock_1 = require("./writer-lock");
96
58
  const daemon_registry_1 = require("./daemon-registry");
97
- /** Default idle linger after the last client disconnects. */
98
59
  const DEFAULT_IDLE_TIMEOUT_MS = 300_000;
99
- /**
100
- * Hard ceiling on how long the daemon stays up with clients connected but no
101
- * inbound traffic. A backstop (#692): if a client's socket-close is never
102
- * delivered (a Windows named-pipe hazard) it stays counted forever and the
103
- * normal idle timer — which only arms at zero clients — never fires. A phantom
104
- * client sends no traffic, so bounding on inactivity reaps the daemon anyway.
105
- * Set generously so a real but momentarily-idle session isn't reaped mid-use.
106
- */
107
- const DEFAULT_MAX_IDLE_MS = 1_800_000; // 30 min
108
- /**
109
- * Windows-only shutdown backstop. On Windows, calling `process.exit()` while a
110
- * recursive `fs.watch` handle is still tearing down aborts the process with a
111
- * libuv `UV_HANDLE_CLOSING` assertion (`0xC0000409`) — reproducible whenever the
112
- * watched tree contains a nested repo (submodule / embedded clone), since that's
113
- * what keeps a watch active at shutdown. The fix is to let the event loop drain
114
- * so libuv finishes closing those handles, then exit naturally; this timer only
115
- * force-exits if some unexpected handle keeps the loop alive past the grace
116
- * window. Kept short so shutdown stays snappy in that fallback. See
117
- * `finalizeDaemonExit`.
118
- */
60
+ const DEFAULT_MAX_IDLE_MS = 1_800_000;
119
61
  const DAEMON_SHUTDOWN_BACKSTOP_MS = 2_000;
120
- /**
121
- * Finalize daemon shutdown. On POSIX, exit immediately — it's clean and fast.
122
- * On Windows, do NOT force an exit while watchers may still be closing (that
123
- * trips the libuv assertion above); instead mark success and let the loop drain
124
- * to a natural exit, with an UNREF'd backstop that force-exits only if a stray
125
- * handle would otherwise hang shutdown. Pure and platform-injected so both
126
- * branches are unit-testable off-Windows. Returns the backstop timer (Windows)
127
- * so callers/tests can clear it.
128
- */
129
62
  function finalizeDaemonExit(platform, exit) {
130
63
  if (platform === 'win32') {
131
64
  process.exitCode = 0;
132
65
  const backstop = setTimeout(() => exit(0), DAEMON_SHUTDOWN_BACKSTOP_MS);
133
- // Unref so it never keeps the loop alive: a natural drain (watchers closed,
134
- // nothing else pending) exits before it fires; it only fires when some other
135
- // handle is keeping the loop running, which is exactly when we need it.
136
66
  backstop.unref?.();
137
67
  return backstop;
138
68
  }
139
69
  exit(0);
140
70
  return null;
141
71
  }
142
- /** How often the daemon sweeps connected clients for a dead peer process (#692). */
143
72
  const DEFAULT_CLIENT_SWEEP_MS = 30_000;
144
- /** How long the daemon waits for the optional client-hello before proceeding without it. */
73
+ const DEFAULT_INSTALL_CHECK_MS = 30_000;
74
+ const DEFAULT_ROOT_CHECK_MS = 5_000;
75
+ const DEFAULT_ROOT_GONE_GRACE_MS = 30_000;
76
+ function isMissing(err) {
77
+ const code = err.code;
78
+ return code === 'ENOENT' || code === 'ENOTDIR';
79
+ }
80
+ function projectGoneReason(projectRoot, pidPath, pid) {
81
+ for (const dir of [projectRoot, path.dirname(pidPath)]) {
82
+ try {
83
+ if (!fs.statSync(dir).isDirectory())
84
+ return `${dir} is no longer a folder`;
85
+ }
86
+ catch (err) {
87
+ return isMissing(err) ? `${dir} was removed` : null;
88
+ }
89
+ }
90
+ let raw;
91
+ try {
92
+ raw = fs.readFileSync(pidPath, 'utf8');
93
+ }
94
+ catch (err) {
95
+ return isMissing(err) ? `its lock file ${pidPath} was removed` : null;
96
+ }
97
+ const holder = (0, daemon_paths_1.decodeLockInfo)(raw)?.pid;
98
+ return holder === undefined || holder === pid ? null : `its lock file ${pidPath} now names pid ${holder}`;
99
+ }
100
+ function installChangedReason(packageJsonPath, runningVersion) {
101
+ let raw;
102
+ try {
103
+ raw = fs.readFileSync(packageJsonPath, 'utf8');
104
+ }
105
+ catch (err) {
106
+ const code = err.code;
107
+ return code === 'ENOENT' || code === 'ENOTDIR' ? `Install removed (${packageJsonPath} is gone)` : null;
108
+ }
109
+ let version;
110
+ try {
111
+ version = JSON.parse(raw)?.version;
112
+ }
113
+ catch {
114
+ return null;
115
+ }
116
+ return typeof version === 'string' && version !== runningVersion
117
+ ? `Install replaced by v${version} (this daemon is v${runningVersion})`
118
+ : null;
119
+ }
145
120
  const CLIENT_HELLO_TIMEOUT_MS = 3_000;
146
- /** Bytes/parse-window for an oversized hello line — bounded against a malicious peer. */
147
121
  const MAX_HELLO_LINE_BYTES = 4096;
148
122
  exports.MAX_HELLO_LINE_BYTES = MAX_HELLO_LINE_BYTES;
149
- /**
150
- * Run as the shared daemon for `projectRoot`. Resolves once the socket is
151
- * listening. The Daemon owns the socket, the engine, and the lockfile until
152
- * `stop()` is called or it exits on idle/signal.
153
- *
154
- * Race-safe: callers must first call `tryAcquireDaemonLock(projectRoot)` and
155
- * only construct a Daemon if they got the lock (`kind: 'acquired'`). The atomic
156
- * create/link inside the acquire helper elects one candidate. The project
157
- * writer lock then fences bind/ownership refresh against stale-artifact cleanup.
158
- */
159
123
  class Daemon {
160
124
  projectRoot;
161
125
  server = null;
162
- // Includes sockets waiting for the optional client hello, before a session
163
- // exists. server.close() waits for these too, so stop must destroy them.
164
126
  acceptedSockets = new Set();
165
127
  clients = new Set();
166
- /** Per-client peer pids from the optional client-hello, for the liveness sweep. */
167
128
  clientPeers = new Map();
168
129
  idleTimer = null;
169
130
  idleTimeoutMs;
@@ -171,34 +132,37 @@ class Daemon {
171
132
  lastActivityAt = Date.now();
172
133
  maxIdleTimer = null;
173
134
  clientSweepTimer = null;
135
+ installCheckTimer = null;
136
+ rootCheckTimer = null;
137
+ projectGoneSince = null;
138
+ rootGoneGraceMs;
174
139
  engine;
175
140
  stopping = false;
176
141
  socketPath;
177
142
  pidPath;
143
+ handoverFrom;
178
144
  constructor(projectRoot, opts = {}) {
179
145
  this.projectRoot = projectRoot;
180
146
  this.socketPath = (0, daemon_paths_1.getDaemonSocketPath)(projectRoot);
181
147
  this.pidPath = (0, daemon_paths_1.getDaemonPidPath)(projectRoot);
182
148
  this.idleTimeoutMs = opts.idleTimeoutMs ?? resolveIdleTimeoutMs();
183
149
  this.maxIdleMs = opts.maxIdleMs ?? resolveMaxIdleMs();
184
- // Daemon mode serves many concurrent clients on one event loop, so off-load
185
- // read-tool dispatch to a worker pool — otherwise concurrent explores
186
- // serialize and starve the MCP transport (clients time out). Direct mode
187
- // (one stdio client) leaves the pool off; `CODEGRAPH_QUERY_POOL_SIZE=0`
188
- // disables it here too.
150
+ this.handoverFrom = opts.handoverFrom ?? null;
151
+ this.rootGoneGraceMs = opts.rootGoneGraceMs ?? resolveRootGoneGraceMs();
189
152
  this.engine = new engine_1.MCPEngine({ queryPool: true });
190
153
  this.engine.setProjectPathHint(projectRoot);
191
154
  }
192
- /**
193
- * Bind the socket, refresh the ownership record, kick off engine init, and
194
- * register signal handlers. The promise resolves once the server is listening
195
- * — the daemon then sticks around until idle/shutdown.
196
- */
197
155
  async start() {
198
- // #1740: claim the project writer lock before opening/watching so a
199
- // concurrent direct-mode serve --mcp cannot start a second watcher.
200
156
  (0, writer_lock_1.assertNoRebuild)(this.projectRoot);
201
- const writer = (0, writer_lock_1.tryAcquireWriterLock)(this.projectRoot, 'daemon');
157
+ let writer = (0, writer_lock_1.tryAcquireWriterLock)(this.projectRoot, 'daemon');
158
+ if (writer.kind === 'taken' && this.handoverFrom !== null &&
159
+ writer.existing?.pid === this.handoverFrom && writer.existing.mode === 'handover') {
160
+ const info = { pid: process.pid, mode: 'daemon', startedAt: Date.now(), ready: false };
161
+ if ((0, writer_lock_1.swapWriterLock)(this.projectRoot, this.handoverFrom, info)) {
162
+ writer = { kind: 'acquired', pidPath: writer.pidPath, info };
163
+ process.stderr.write(`[CodeGraph daemon] Took over the writer lock from launcher pid ${this.handoverFrom}, which stopped an older daemon.\n`);
164
+ }
165
+ }
202
166
  if (writer.kind === 'taken') {
203
167
  const msg = (0, writer_lock_1.writerLockHeldMessage)(writer.existing, writer.pidPath);
204
168
  process.stderr.write(`[CodeGraph daemon] ${msg}\n`);
@@ -216,31 +180,22 @@ class Daemon {
216
180
  (0, writer_lock_1.releaseWriterLock)(this.projectRoot);
217
181
  throw new Error('Lost daemon lock ownership before startup.');
218
182
  }
219
- // Walk the ordered socket candidates and bind the first that works. The
220
- // in-project path comes first; the deterministic tmpdir path is the fallback
221
- // for a filesystem that can't host an AF_UNIX node at all (ExFAT/FAT external
222
- // volumes, some network mounts, WSL2 DrvFs → ENOTSUP/EACCES; #997, #974). The
223
- // `listen` closure clears a stale socket (left by a SIGKILL'd previous daemon)
224
- // before each attempt — safe because we hold the lockfile, so no live daemon
225
- // owns it; without it `listen` would wedge on EADDRINUSE.
226
183
  const candidates = (0, daemon_paths_1.getDaemonSocketCandidates)(this.projectRoot);
227
184
  const listen = (socketPath) => new Promise((resolve, reject) => {
228
185
  if (process.platform !== 'win32') {
229
186
  try {
230
187
  fs.unlinkSync(socketPath);
231
188
  }
232
- catch { /* not-exists is fine */ }
189
+ catch { }
233
190
  }
234
191
  const server = net.createServer((socket) => this.handleConnection(socket));
235
192
  server.once('error', reject);
236
193
  server.listen(socketPath, () => {
237
- // POSIX: tighten permissions to user-only — the socket lives under
238
- // `.codegraph/` (git-ignored, maybe a shared FS) or tmpdir.
239
194
  if (process.platform !== 'win32') {
240
195
  try {
241
196
  fs.chmodSync(socketPath, 0o600);
242
197
  }
243
- catch { /* best-effort */ }
198
+ catch { }
244
199
  }
245
200
  resolve(server);
246
201
  });
@@ -252,27 +207,18 @@ class Daemon {
252
207
  });
253
208
  }
254
209
  catch (err) {
255
- // Every candidate failed (the last one, or a non-relocatable error like a
256
- // racing EADDRINUSE). We already hold the lockfile `tryAcquireDaemonLock`
257
- // wrote; release it and any partial sockets so the NEXT launcher doesn't
258
- // spin respawning us on a stale lock pointing at our now-dying pid. Then
259
- // re-throw so the caller (the bin's try/catch) exits this detached daemon
260
- // cleanly and every launcher falls back to direct mode (#974).
261
210
  this.cleanupLockfile();
262
211
  if (process.platform !== 'win32') {
263
212
  for (const candidate of candidates) {
264
213
  try {
265
214
  fs.unlinkSync(candidate);
266
215
  }
267
- catch { /* may not exist */ }
216
+ catch { }
268
217
  }
269
218
  }
270
219
  throw err;
271
220
  }
272
221
  this.server = bound.server;
273
- // Adopt the path we ACTUALLY bound — it may be a tmpdir fallback past an
274
- // unusable in-project location. Everything downstream (lockfile, registry,
275
- // chmod, cleanup, status) keys off this real path, not the preferred guess.
276
222
  this.socketPath = bound.socketPath;
277
223
  const lock = {
278
224
  pid: process.pid,
@@ -280,9 +226,6 @@ class Daemon {
280
226
  socketPath: this.socketPath,
281
227
  startedAt: Date.now(),
282
228
  };
283
- // Refresh the lock on every successful bind, not only relocation. The
284
- // writer lock prevents stale-artifact cleanup from racing this ownership
285
- // check, and the exact snapshot prevents overwriting a replacement record.
286
229
  try {
287
230
  refreshDaemonLock(this.pidPath, initialLockContents, lock);
288
231
  }
@@ -290,36 +233,25 @@ class Daemon {
290
233
  try {
291
234
  bound.server.close();
292
235
  }
293
- catch { /* best-effort */ }
236
+ catch { }
294
237
  this.cleanupLockfile();
295
238
  throw err;
296
239
  }
297
- // Engine init is deliberately backgrounded — see #172. It starts only
298
- // after bind and ownership refresh, so a delayed daemon that lost election
299
- // can never open a second watcher or writer.
300
240
  void this.engine.ensureInitialized(this.projectRoot);
301
- // Drop a discovery record so `codegraph list` / `stop --all` can find us.
302
- // Best-effort; a missing record only means list's liveness prune covers it.
303
241
  (0, daemon_registry_1.registerDaemon)({ root: this.projectRoot, ...lock });
304
242
  process.stderr.write(`[CodeGraph daemon] Listening on ${this.socketPath} (pid ${process.pid}, v${version_1.CodeGraphPackageVersion}). Idle timeout ${this.idleTimeoutMs}ms.\n`);
305
- // No clients yet: arm the idle timer immediately so a daemon that nobody
306
- // ever connects to (e.g. spawned then abandoned because the launcher died)
307
- // doesn't pin resources forever.
308
243
  this.armIdleTimer();
309
244
  this.startLivenessTimers();
310
245
  process.on('SIGINT', () => this.stop('SIGINT'));
311
246
  process.on('SIGTERM', () => this.stop('SIGTERM'));
312
247
  return { socketPath: this.socketPath, lock };
313
248
  }
314
- /** Currently-connected client count. Exposed for tests / status output. */
315
249
  getClientCount() {
316
250
  return this.clients.size;
317
251
  }
318
- /** The socket path the daemon is (or will be) listening on. */
319
252
  getSocketPath() {
320
253
  return this.socketPath;
321
254
  }
322
- /** Graceful shutdown: close all sessions, the engine, and clean up the lock. */
323
255
  async stop(reason = 'stop') {
324
256
  if (this.stopping)
325
257
  return;
@@ -336,12 +268,20 @@ class Daemon {
336
268
  clearInterval(this.clientSweepTimer);
337
269
  this.clientSweepTimer = null;
338
270
  }
271
+ if (this.installCheckTimer) {
272
+ clearInterval(this.installCheckTimer);
273
+ this.installCheckTimer = null;
274
+ }
275
+ if (this.rootCheckTimer) {
276
+ clearInterval(this.rootCheckTimer);
277
+ this.rootCheckTimer = null;
278
+ }
339
279
  process.stderr.write(`[CodeGraph daemon] Shutting down (${reason}; clients=${this.clients.size}).\n`);
340
280
  for (const session of [...this.clients]) {
341
281
  try {
342
282
  session.stop();
343
283
  }
344
- catch { /* best-effort */ }
284
+ catch { }
345
285
  }
346
286
  this.clients.clear();
347
287
  for (const socket of this.acceptedSockets)
@@ -353,16 +293,13 @@ class Daemon {
353
293
  }
354
294
  await this.engine.stop();
355
295
  this.cleanupLockfile();
356
- (0, daemon_registry_1.deregisterDaemon)(this.projectRoot);
296
+ (0, daemon_registry_1.deregisterDaemon)(this.projectRoot, process.pid);
357
297
  if (process.platform !== 'win32') {
358
298
  try {
359
299
  fs.unlinkSync(this.socketPath);
360
300
  }
361
- catch { /* may already be gone */ }
301
+ catch { }
362
302
  }
363
- // POSIX exits here; Windows drains first (engine.stop() above began closing
364
- // the file watcher, and exiting mid-teardown aborts the process). See
365
- // finalizeDaemonExit / DAEMON_SHUTDOWN_BACKSTOP_MS.
366
303
  finalizeDaemonExit(process.platform, (code) => process.exit(code));
367
304
  }
368
305
  handleConnection(socket) {
@@ -372,8 +309,6 @@ class Daemon {
372
309
  }
373
310
  this.acceptedSockets.add(socket);
374
311
  socket.once('close', () => this.acceptedSockets.delete(socket));
375
- // Hello first so the proxy can verify versions before piping any
376
- // application bytes. The proxy reads exactly one line, then forwards.
377
312
  const hello = {
378
313
  codegraph: version_1.CodeGraphPackageVersion,
379
314
  pid: process.pid,
@@ -381,15 +316,13 @@ class Daemon {
381
316
  protocol: 1,
382
317
  };
383
318
  socket.write(JSON.stringify(hello) + '\n');
384
- // Read the optional client-hello (proxy → daemon) to learn the client's
385
- // peer pids, then hand the socket to the session. Fail-safe: any problem —
386
- // timeout, a non-hello first line, an early close — yields null pids and we
387
- // fall back to the socket-close lifecycle exactly as before (#692).
388
- void readClientHello(socket).then((peers) => {
319
+ void readClientHello(socket).then(({ challenge, ...peers }) => {
389
320
  if (this.stopping || socket.destroyed) {
390
321
  socket.destroy();
391
322
  return;
392
323
  }
324
+ if (challenge !== undefined)
325
+ this.answerChallenge(socket, challenge);
393
326
  const transport = new transport_1.SocketTransport(socket);
394
327
  const session = new session_1.MCPSession(transport, this.engine, {
395
328
  explicitProjectPath: this.projectRoot,
@@ -399,12 +332,17 @@ class Daemon {
399
332
  this.clientPeers.set(session, peers);
400
333
  this.disarmIdleTimer();
401
334
  session.start();
402
- // Observe inbound bytes purely to feed the inactivity backstop — a second
403
- // 'data' listener that reads nothing, added AFTER the transport's so the
404
- // unshifted client-hello tail reaches the transport intact.
405
335
  socket.on('data', () => { this.lastActivityAt = Date.now(); });
406
336
  });
407
337
  }
338
+ answerChallenge(socket, challenge) {
339
+ const key = (0, daemon_proof_1.daemonKey)();
340
+ const proof = key ? (0, daemon_proof_1.daemonProof)(key, challenge, this.socketPath) : null;
341
+ try {
342
+ socket.write(JSON.stringify({ codegraph_proof: proof }) + '\n');
343
+ }
344
+ catch { }
345
+ }
408
346
  dropClient(session) {
409
347
  if (!this.clients.delete(session))
410
348
  return;
@@ -416,21 +354,15 @@ class Daemon {
416
354
  if (this.idleTimer || this.stopping)
417
355
  return;
418
356
  if (this.idleTimeoutMs <= 0)
419
- return; // 0 = never idle-exit
357
+ return;
420
358
  this.idleTimer = setTimeout(() => {
421
359
  this.idleTimer = null;
422
- // Last-second sanity check: if a connection landed between the timer
423
- // firing and now, don't exit. (setImmediate-ordering is the only way
424
- // this races; cheap to defend against.)
425
360
  if (this.clients.size > 0) {
426
361
  this.armIdleTimer();
427
362
  return;
428
363
  }
429
364
  void this.stop('idle timeout');
430
365
  }, this.idleTimeoutMs);
431
- // Don't keep the event loop alive just for this — the net.Server keeps the
432
- // loop alive while listening, so the timer still fires; once we stop() the
433
- // loop should drain naturally.
434
366
  this.idleTimer.unref?.();
435
367
  }
436
368
  disarmIdleTimer() {
@@ -439,21 +371,6 @@ class Daemon {
439
371
  clearTimeout(this.idleTimer);
440
372
  this.idleTimer = null;
441
373
  }
442
- /**
443
- * Defense-in-depth against a daemon that outlives its clients (#692), for the
444
- * cases the refcount + idle timer miss because a socket close never arrives:
445
- * - **Inactivity backstop:** after `maxIdleMs` with no inbound traffic, reap
446
- * the daemon — but ONLY if no connected client can be proven alive (see
447
- * {@link backstopShouldExit}). This is the sole phantom class the sweep
448
- * below can't catch: a client whose client-hello never arrived, so we have
449
- * no pid to check.
450
- * - **Liveness sweep:** drop any client whose peer process has died (per the
451
- * client-hello pids), which re-arms the idle timer once the last real
452
- * client is gone. Catches a dead peer within one sweep instead of waiting
453
- * out the whole backstop.
454
- * Both timers are unref'd — the listening server keeps the loop alive, and
455
- * neither should hold it open on its own.
456
- */
457
374
  startLivenessTimers() {
458
375
  if (this.maxIdleMs > 0) {
459
376
  const tick = Math.min(this.maxIdleMs, 60_000);
@@ -468,45 +385,59 @@ class Daemon {
468
385
  this.clientSweepTimer = setInterval(() => this.reapDeadClients(isProcessAlive), sweepMs);
469
386
  this.clientSweepTimer.unref?.();
470
387
  }
388
+ const installMs = resolveInstallCheckMs();
389
+ if (installMs > 0 && version_1.CodeGraphPackageVersion !== '0.0.0-unknown') {
390
+ this.installCheckTimer = setInterval(() => { this.checkInstall(); }, installMs);
391
+ this.installCheckTimer.unref?.();
392
+ }
393
+ const rootMs = resolveRootCheckMs();
394
+ if (rootMs > 0) {
395
+ this.rootCheckTimer = setInterval(() => { this.checkProject(); }, rootMs);
396
+ this.rootCheckTimer.unref?.();
397
+ }
398
+ }
399
+ checkProject(gone = () => projectGoneReason(this.projectRoot, this.pidPath, process.pid), now = Date.now()) {
400
+ if (this.stopping)
401
+ return false;
402
+ const reason = gone();
403
+ if (!reason) {
404
+ this.projectGoneSince = null;
405
+ return false;
406
+ }
407
+ if (this.projectGoneSince === null) {
408
+ this.projectGoneSince = now;
409
+ process.stderr.write(`[CodeGraph daemon] The project looks gone (${reason}); exiting if it is still gone in ${Math.round(this.rootGoneGraceMs / 1000)}s.\n`);
410
+ }
411
+ if (now - this.projectGoneSince < this.rootGoneGraceMs)
412
+ return false;
413
+ process.stderr.write(`[CodeGraph daemon] The project is gone (${reason}); exiting.\n`);
414
+ void this.stop('project removed');
415
+ return true;
416
+ }
417
+ checkInstall(changed = () => installChangedReason(version_1.CodeGraphPackageJsonPath, version_1.CodeGraphPackageVersion)) {
418
+ if (this.stopping)
419
+ return false;
420
+ const reason = changed();
421
+ if (!reason)
422
+ return false;
423
+ process.stderr.write(`[CodeGraph daemon] ${reason}; exiting so the next session starts a daemon from the current install.\n`);
424
+ void this.stop('install changed');
425
+ return true;
471
426
  }
472
- /**
473
- * Decide whether the inactivity backstop should reap the daemon right now.
474
- * Public + `isAlive`-injected for deterministic tests; the timer calls it each
475
- * tick with the real liveness probe.
476
- *
477
- * The backstop exists ONLY to catch a **phantom** client (#692) — one counted
478
- * but actually gone, whose socket-close was never delivered. It must never
479
- * reap a **live-but-quiet** session (connected, alive peer, just not querying):
480
- * doing so silently severed the shared daemon and degraded that session — and
481
- * any others sharing it — to an in-process engine. `lastActivityAt` only tracks
482
- * inbound query bytes, and MCP has no keepalive, so a genuinely-live session
483
- * trips the raw inactivity window after ~30 min of not being queried.
484
- *
485
- * So: once the inactivity window elapses, drop provably-dead peers (the same
486
- * check the periodic sweep runs), then reap the daemon only when NOT ONE
487
- * remaining client can be proven alive — i.e. every client left is an
488
- * unknown-pid connection the sweep can't verify. A single provably-alive
489
- * client keeps the daemon up. Has the sweep's side effect (drops dead peers).
490
- */
491
427
  backstopShouldExit(isAlive) {
492
428
  if (this.stopping || this.clients.size === 0)
493
- return false; // idle timer owns the no-client case
429
+ return false;
494
430
  if (Date.now() - this.lastActivityAt < this.maxIdleMs)
495
- return false; // still within the window
431
+ return false;
496
432
  this.reapDeadClients(isAlive);
497
433
  if (this.clients.size === 0)
498
- return false; // sweep cleared them — idle timer takes over
434
+ return false;
499
435
  const anyProvablyAlive = [...this.clients].some((session) => {
500
436
  const peers = this.clientPeers.get(session);
501
437
  return peers != null && peers.pid !== null && !peerIsDead(peers, isAlive);
502
438
  });
503
439
  return !anyProvablyAlive;
504
440
  }
505
- /**
506
- * Drop every connected client whose peer process is gone. Returns the count
507
- * reaped. `isAlive` is injected for testing. Clients with unknown pids (no
508
- * client-hello) are skipped — they rely on the socket-close path.
509
- */
510
441
  reapDeadClients(isAlive) {
511
442
  if (this.clients.size === 0)
512
443
  return 0;
@@ -519,7 +450,7 @@ class Daemon {
519
450
  try {
520
451
  session.stop();
521
452
  }
522
- catch { /* best-effort */ }
453
+ catch { }
523
454
  this.dropClient(session);
524
455
  reaped++;
525
456
  }
@@ -529,8 +460,6 @@ class Daemon {
529
460
  (0, writer_lock_1.releaseWriterLock)(this.projectRoot);
530
461
  try {
531
462
  if (fs.existsSync(this.pidPath)) {
532
- // Only remove if it still belongs to us — another daemon may have
533
- // already taken over while we were shutting down (extremely rare).
534
463
  const raw = fs.readFileSync(this.pidPath, 'utf8');
535
464
  const info = (0, daemon_paths_1.decodeLockInfo)(raw);
536
465
  if (info && info.pid === process.pid) {
@@ -538,32 +467,16 @@ class Daemon {
538
467
  }
539
468
  }
540
469
  }
541
- catch { /* best-effort; we're exiting anyway */ }
470
+ catch { }
542
471
  }
543
472
  }
544
473
  exports.Daemon = Daemon;
545
- /**
546
- * Waits between retries of the pid-file replace on Windows, doubling to a cap:
547
- * eight attempts wait about 1.6s in all. Windows refuses to replace a file
548
- * while any handle to it is open, so an antivirus scan, an indexer, or another
549
- * session reading the lock can each hold it for a moment, and for longer on a
550
- * loaded machine (#1773). The total stays well inside a launcher's ~6s connect
551
- * window.
552
- */
553
474
  const LOCK_REFRESH_RETRY_DELAYS_MS = [25, 50, 100, 200, 400, 400, 400];
554
- /**
555
- * Publish the bound socket without abandoning a live daemon on a transient
556
- * Windows sharing violation. Keep this startup step synchronous: accepting a
557
- * client before ownership is refreshed could initialize an engine too early.
558
- * Retries wait per {@link LOCK_REFRESH_RETRY_DELAYS_MS}; permanent failures
559
- * still abort startup.
560
- */
561
475
  function refreshDaemonLock(pidPath, initialContents, lock, platform = process.platform) {
562
476
  const tmpPid = `${pidPath}.${process.pid}.bound`;
563
477
  try {
564
478
  fs.writeFileSync(tmpPid, (0, daemon_paths_1.encodeLockInfo)(lock), { mode: 0o600 });
565
479
  for (let attempt = 0;; attempt++) {
566
- // A retry must never replace a record whose owner changed while waiting.
567
480
  if (fs.readFileSync(pidPath, 'utf8') !== initialContents) {
568
481
  throw new Error('Lost daemon lock ownership after binding.');
569
482
  }
@@ -585,44 +498,11 @@ function refreshDaemonLock(pidPath, initialContents, lock, platform = process.pl
585
498
  try {
586
499
  fs.unlinkSync(tmpPid);
587
500
  }
588
- catch { /* renamed, or best-effort cleanup */ }
501
+ catch { }
589
502
  }
590
503
  }
591
- /**
592
- * Atomically create the daemon pidfile with its full record already in place.
593
- * Returns either an `acquired` result (the caller is the daemon-elect and may
594
- * construct a {@link Daemon}) or a `taken` result.
595
- *
596
- * must-fix 1 (issue #411 review): the lockfile must appear in ONE atomic step,
597
- * already complete — never empty, even momentarily. The first attempt at this
598
- * (`O_EXCL` create then a separate `writeSync`) left a microsecond window where
599
- * the file existed but was empty; under concurrent daemon startup a third
600
- * candidate could read that empty file, decode it as `null`, and `unlink` the
601
- * winner's lock → two daemons (two watchers, two writers). The window was
602
- * normally too small to hit, but the file watcher's extra startup time made
603
- * concurrent daemons overlap enough to reproduce it reliably.
604
- *
605
- * The fix writes the complete record to a private temp file, then hard-links it
606
- * into place: `link()` is atomic AND exclusive (EEXIST if the target exists), so
607
- * the pidfile becomes visible in one step already containing a full record.
608
- * Whoever links first wins; everyone else gets EEXIST and reads a complete file.
609
- * There is no empty-file window at all.
610
- *
611
- * Filesystems without hard links (#997): ExFAT/FAT external volumes and some
612
- * network mounts can't `link()` at all — it throws ENOTSUP/EPERM, which would
613
- * otherwise kill the daemon before it ever reaches the socket bind. There we
614
- * fall back to an O_EXCL create (`acquireLockViaExclusiveOpen`): still exclusive
615
- * ("first writer wins"), but the full record is written through the fd in a
616
- * second step, so the empty-file window the link approach removed is reopened —
617
- * only on these filesystems, only for the microseconds between create and write
618
- * (far narrower than the original bug, which the file watcher's startup latency
619
- * widened). The race's worst case is two daemons briefly; on a single external
620
- * drive that's strictly better than the daemon never starting at all.
621
- */
622
504
  function tryAcquireDaemonLock(projectRoot) {
623
505
  const pidPath = (0, daemon_paths_1.getDaemonPidPath)(projectRoot);
624
- // Make sure the .codegraph/ directory exists — the daemon may be the first
625
- // thing to touch it on a fresh-clone-but-already-initialized checkout.
626
506
  fs.mkdirSync(path.dirname(pidPath), { recursive: true });
627
507
  const info = {
628
508
  pid: process.pid,
@@ -630,27 +510,18 @@ function tryAcquireDaemonLock(projectRoot) {
630
510
  socketPath: (0, daemon_paths_1.getDaemonSocketPath)(projectRoot),
631
511
  startedAt: Date.now(),
632
512
  };
633
- // Temp name is pid-scoped so racing candidates never collide on it.
634
513
  const tmp = `${pidPath}.${process.pid}.tmp`;
635
514
  let acquired = false;
636
515
  try {
637
516
  fs.writeFileSync(tmp, (0, daemon_paths_1.encodeLockInfo)(info), { mode: 0o600 });
638
517
  try {
639
- fs.linkSync(tmp, pidPath); // atomic + exclusive (race-free; see must-fix 1)
518
+ fs.linkSync(tmp, pidPath);
640
519
  acquired = true;
641
520
  }
642
521
  catch (err) {
643
522
  if (err.code === 'EEXIST') {
644
- // Lost the race — another candidate already holds it. Fall through to read.
645
523
  }
646
524
  else {
647
- // link() failed for a non-conflict reason — nearly always "this filesystem
648
- // has no hard links" (ExFAT/FAT external volumes, some network mounts),
649
- // which surfaces as a DIFFERENT errno on every OS: ENOTSUP on macOS, EPERM
650
- // on Linux, EISDIR on Windows (#997). Enumerating them is whack-a-mole and
651
- // unnecessary: the `tmp` write above already proved this directory is
652
- // writable, so an O_EXCL create is a valid atomic+exclusive substitute. If
653
- // IT fails too, that's a genuine error and propagates. EEXIST ⇒ taken.
654
525
  acquired = acquireLockViaExclusiveOpen(pidPath, info);
655
526
  }
656
527
  }
@@ -659,35 +530,23 @@ function tryAcquireDaemonLock(projectRoot) {
659
530
  try {
660
531
  fs.unlinkSync(tmp);
661
532
  }
662
- catch { /* temp already gone */ }
533
+ catch { }
663
534
  }
664
535
  if (acquired)
665
536
  return { kind: 'acquired', pidPath, info };
666
- // Taken. Because the pidfile was link'd atomically it always holds a complete
667
- // record — `existing` is null only for a genuinely corrupt leftover, never a
668
- // mid-write race.
669
537
  let existing = null;
670
538
  let lockContents = null;
671
539
  try {
672
540
  lockContents = fs.readFileSync(pidPath, 'utf8');
673
541
  existing = (0, daemon_paths_1.decodeLockInfo)(lockContents);
674
542
  }
675
- catch { /* unreadable lockfile — treat as malformed */ }
543
+ catch { }
676
544
  return { kind: 'taken', existing, lockContents, pidPath };
677
545
  }
678
- /**
679
- * Exclusive-create the pidfile (O_CREAT|O_EXCL via the `wx` flag) and write the
680
- * full record through the same fd — the hard-link-free fallback used by
681
- * {@link tryAcquireDaemonLock} on filesystems without `link()`. Returns true if
682
- * we created it (acquired the lock), false on EEXIST (another candidate holds
683
- * it). Any other error propagates. Still exclusive, so "first writer wins" holds
684
- * exactly as the link path does; the only difference is the brief empty-file
685
- * window between create and write. Exported for testing.
686
- */
687
546
  function acquireLockViaExclusiveOpen(pidPath, info) {
688
547
  let fd;
689
548
  try {
690
- fd = fs.openSync(pidPath, 'wx', 0o600); // O_CREAT | O_EXCL | O_WRONLY
549
+ fd = fs.openSync(pidPath, 'wx', 0o600);
691
550
  }
692
551
  catch (err) {
693
552
  if (err.code === 'EEXIST')
@@ -702,33 +561,15 @@ function acquireLockViaExclusiveOpen(pidPath, info) {
702
561
  }
703
562
  return true;
704
563
  }
705
- /**
706
- * Remove a stale pidfile. Re-reads the file immediately before unlinking so a
707
- * different daemon that acquired the lock in the meantime is never disturbed.
708
- *
709
- * must-fix 1 (issue #411 review): the original unconditionally `unlink`'d,
710
- * which let a racing candidate delete a healthy daemon's lock. Passing
711
- * `expectedDeadPid` (the pid the caller believed was dead) makes the clear a
712
- * compare-and-delete: bail if the file now holds a different pid. By default a
713
- * live pid is also preserved; `allowLivePid` is reserved for callers that have
714
- * already disproved daemon identity with the socket hello (#1553). Returns true
715
- * when the stale lock is gone (or was already gone).
716
- */
717
564
  function clearStaleDaemonLock(pidPath, expectedDeadPid, opts = {}) {
718
565
  try {
719
566
  const raw = fs.readFileSync(pidPath, 'utf8');
720
- // The identity record changed after the caller inspected it. Even the same
721
- // PID may now advertise a newly-bound socket, so this snapshot was never
722
- // disproved and must not be deleted.
723
567
  if (opts.expectedLockContents !== undefined && raw !== opts.expectedLockContents)
724
568
  return false;
725
569
  const info = (0, daemon_paths_1.decodeLockInfo)(raw);
726
570
  if (info) {
727
- // A different pid took over since we read it — not ours to clear.
728
571
  if (expectedDeadPid !== undefined && info.pid !== expectedDeadPid)
729
572
  return false;
730
- // PID liveness is normally sufficient. The takeover caller may override
731
- // it only after a failed identity handshake proves PID reuse.
732
573
  if (!opts.allowLivePid && info.pid > 0 && isProcessAlive(info.pid))
733
574
  return false;
734
575
  }
@@ -738,15 +579,10 @@ function clearStaleDaemonLock(pidPath, expectedDeadPid, opts = {}) {
738
579
  catch (err) {
739
580
  const e = err;
740
581
  if (e.code === 'ENOENT')
741
- return true; // already gone
582
+ return true;
742
583
  return false;
743
584
  }
744
585
  }
745
- /**
746
- * Probe whether `pid` is currently alive (signal-0). Treats EPERM as alive on
747
- * every platform (the process exists, it's just not ours to signal) so we never
748
- * mistake a live daemon for a dead one and clear its lock.
749
- */
750
586
  function isProcessAlive(pid) {
751
587
  try {
752
588
  process.kill(pid, 0);
@@ -755,39 +591,15 @@ function isProcessAlive(pid) {
755
591
  catch (err) {
756
592
  const e = err;
757
593
  if (e.code === 'EPERM')
758
- return true; // exists, just not ours to signal
594
+ return true;
759
595
  return false;
760
596
  }
761
597
  }
762
- /**
763
- * The one `listen()` error we must NOT relocate past. EADDRINUSE means the path
764
- * is genuinely occupied — a racing daemon that legitimately owns it, or a
765
- * leftover node we couldn't clear (the #974 planted-dir case) — so relocating
766
- * would abandon a path another daemon owns; the caller instead releases its lock
767
- * and falls back to direct mode. EVERY OTHER bind error just means "this path
768
- * didn't work," almost always a filesystem that can't host an AF_UNIX node at all
769
- * (ExFAT/FAT, network mounts, WSL2 DrvFs), which reports a DIFFERENT errno per OS
770
- * (ENOTSUP macOS, EPERM Linux; #997). Enumerating the "unsupported" codes is
771
- * whack-a-mole, so we relocate on anything-but-conflict instead — robust and
772
- * self-correcting: if the deterministic tmpdir fallback ALSO fails, that error
773
- * propagates from the last candidate. (ENAMETOOLONG never reaches here — the
774
- * candidate list already routes over-long paths straight to tmpdir.)
775
- */
776
598
  const SOCKET_BIND_CONFLICT_CODE = 'EADDRINUSE';
777
- /**
778
- * Bind the first usable socket from an ordered candidate list, relocating past
779
- * any path that fails to bind for a non-conflict reason (see {@link
780
- * SOCKET_BIND_CONFLICT_CODE}). The injected `listen` does the real
781
- * `net.Server.listen` (and stale-socket clear); abstracted so the relocation
782
- * policy is unit-testable without a real unsupported filesystem. Returns the
783
- * server plus the path actually bound. An EADDRINUSE, or any error on the LAST
784
- * candidate, propagates — the caller releases the lockfile and falls back to
785
- * direct mode (#974). Exported for testing.
786
- */
787
599
  async function bindFirstUsableSocket(candidates, listen, opts = {}) {
788
600
  let lastErr;
789
601
  for (let i = 0; i < candidates.length; i++) {
790
- const socketPath = candidates[i]; // i < length, so always defined
602
+ const socketPath = candidates[i];
791
603
  const isLast = i === candidates.length - 1;
792
604
  try {
793
605
  const server = await listen(socketPath);
@@ -797,13 +609,12 @@ async function bindFirstUsableSocket(candidates, listen, opts = {}) {
797
609
  lastErr = err;
798
610
  const code = err.code;
799
611
  if (!isLast && code !== SOCKET_BIND_CONFLICT_CODE) {
800
- opts.onRelocate?.(socketPath, candidates[i + 1], code ?? ''); // !isLast ⇒ i+1 in range
612
+ opts.onRelocate?.(socketPath, candidates[i + 1], code ?? '');
801
613
  continue;
802
614
  }
803
615
  throw err;
804
616
  }
805
617
  }
806
- // Only reachable with an empty candidate list — a programmer error.
807
618
  throw lastErr ?? new Error('no socket candidates to bind');
808
619
  }
809
620
  function resolveIdleTimeoutMs() {
@@ -822,7 +633,7 @@ function resolveMaxIdleMs() {
822
633
  const parsed = Number(raw);
823
634
  if (!Number.isFinite(parsed) || parsed < 0)
824
635
  return DEFAULT_MAX_IDLE_MS;
825
- return Math.floor(parsed); // 0 disables the backstop
636
+ return Math.floor(parsed);
826
637
  }
827
638
  function resolveClientSweepMs() {
828
639
  const raw = process.env.CODEGRAPH_DAEMON_CLIENT_SWEEP_MS;
@@ -831,13 +642,35 @@ function resolveClientSweepMs() {
831
642
  const parsed = Number(raw);
832
643
  if (!Number.isFinite(parsed) || parsed < 0)
833
644
  return DEFAULT_CLIENT_SWEEP_MS;
834
- return Math.floor(parsed); // 0 disables the sweep
645
+ return Math.floor(parsed);
646
+ }
647
+ function resolveInstallCheckMs() {
648
+ const raw = process.env.CODEGRAPH_DAEMON_INSTALL_CHECK_MS;
649
+ if (raw === undefined || raw === '')
650
+ return DEFAULT_INSTALL_CHECK_MS;
651
+ const parsed = Number(raw);
652
+ if (!Number.isFinite(parsed) || parsed < 0)
653
+ return DEFAULT_INSTALL_CHECK_MS;
654
+ return Math.floor(parsed);
655
+ }
656
+ function resolveRootCheckMs() {
657
+ const raw = process.env.CODEGRAPH_DAEMON_ROOT_CHECK_MS;
658
+ if (raw === undefined || raw === '')
659
+ return DEFAULT_ROOT_CHECK_MS;
660
+ const parsed = Number(raw);
661
+ if (!Number.isFinite(parsed) || parsed < 0)
662
+ return DEFAULT_ROOT_CHECK_MS;
663
+ return Math.floor(parsed);
664
+ }
665
+ function resolveRootGoneGraceMs() {
666
+ const raw = process.env.CODEGRAPH_DAEMON_ROOT_GRACE_MS;
667
+ if (raw === undefined || raw === '')
668
+ return DEFAULT_ROOT_GONE_GRACE_MS;
669
+ const parsed = Number(raw);
670
+ if (!Number.isFinite(parsed) || parsed < 0)
671
+ return DEFAULT_ROOT_GONE_GRACE_MS;
672
+ return Math.floor(parsed);
835
673
  }
836
- /**
837
- * Parse one client-hello line. Returns the peer pids if `line` is a well-formed
838
- * client-hello (carries the `codegraph_client` marker), or null otherwise — in
839
- * which case the caller treats the bytes as ordinary JSON-RPC.
840
- */
841
674
  function parseClientHelloLine(line) {
842
675
  let parsed;
843
676
  try {
@@ -851,13 +684,15 @@ function parseClientHelloLine(line) {
851
684
  const o = parsed;
852
685
  if (o.codegraph_client !== 1 || typeof o.pid !== 'number')
853
686
  return null;
854
- return { pid: o.pid, hostPid: typeof o.hostPid === 'number' ? o.hostPid : null };
687
+ const peers = {
688
+ pid: o.pid,
689
+ hostPid: typeof o.hostPid === 'number' ? o.hostPid : null,
690
+ };
691
+ if (typeof o.challenge === 'string' && o.challenge.length > 0 && o.challenge.length <= daemon_proof_1.MAX_CHALLENGE_LENGTH) {
692
+ peers.challenge = o.challenge;
693
+ }
694
+ return peers;
855
695
  }
856
- /**
857
- * A client's peer is dead when its proxy process is gone, or when its known
858
- * host process is gone. Unknown pid (no client-hello) is never "dead" on this
859
- * basis — those clients rely on the socket-close path. Exported for testing.
860
- */
861
696
  function peerIsDead(peers, isAlive) {
862
697
  if (peers.pid === null)
863
698
  return false;
@@ -867,15 +702,6 @@ function peerIsDead(peers, isAlive) {
867
702
  return true;
868
703
  return false;
869
704
  }
870
- /**
871
- * Read the optional client-hello line a proxy sends after the daemon hello.
872
- * Always resolves (never rejects) — fail-safe by design, since every connection
873
- * funnels through here. Resolves with the peer pids when the first line is a
874
- * client-hello; otherwise resolves with null pids and unshifts the already-read
875
- * bytes so the transport parses them as the client's first JSON-RPC message(s).
876
- * Accumulates as Buffers and splits on the newline byte so a UTF-8 sequence
877
- * straddling a chunk boundary in the unshifted tail is never corrupted.
878
- */
879
705
  function readClientHello(socket) {
880
706
  return new Promise((resolve) => {
881
707
  let chunks = [];
@@ -885,20 +711,10 @@ function readClientHello(socket) {
885
711
  if (settled)
886
712
  return;
887
713
  settled = true;
888
- // PAUSE before detaching: removing the last 'data' listener does NOT
889
- // stop a flowing stream, so bytes arriving (or unshifted) in the gap
890
- // between this handler and the session transport attaching were emitted
891
- // to zero listeners and silently DISCARDED — and the listener swap left
892
- // the socket's flow state wedged, never delivering to the new listener.
893
- // A proxy whose client-hello arrived glued to the initialize hit this
894
- // ~1-in-5 under load: the daemon answered nothing for the whole session
895
- // (the #662 test flake, and real dead sessions behind it). Paused, the
896
- // unshifted tail and any new bytes buffer; SocketTransport.start()
897
- // resumes explicitly.
898
714
  try {
899
715
  socket.pause();
900
716
  }
901
- catch { /* stream already gone */ }
717
+ catch { }
902
718
  socket.removeListener('data', onData);
903
719
  socket.removeListener('error', onEnd);
904
720
  socket.removeListener('close', onEnd);
@@ -910,7 +726,7 @@ function readClientHello(socket) {
910
726
  try {
911
727
  socket.unshift(putBack);
912
728
  }
913
- catch { /* stream already gone */ }
729
+ catch { }
914
730
  }
915
731
  resolve(peers);
916
732
  };
@@ -919,10 +735,8 @@ function readClientHello(socket) {
919
735
  chunks.push(buf);
920
736
  total += buf.length;
921
737
  const all = chunks.length === 1 ? buf : Buffer.concat(chunks, total);
922
- const nl = all.indexOf(0x0a); // '\n'
738
+ const nl = all.indexOf(0x0a);
923
739
  if (nl === -1) {
924
- // No newline yet. If it's already too long to be a hello, it isn't one —
925
- // hand the bytes back as data; otherwise keep accumulating.
926
740
  if (total > MAX_HELLO_LINE_BYTES)
927
741
  finish({ pid: null, hostPid: null }, all);
928
742
  else
@@ -935,14 +749,10 @@ function readClientHello(socket) {
935
749
  finish(peers, tail.length > 0 ? tail : undefined);
936
750
  }
937
751
  else {
938
- // First line is not a client-hello (legacy/direct client) — hand the
939
- // whole buffer back so the transport sees the message verbatim.
940
752
  finish({ pid: null, hostPid: null }, all);
941
753
  }
942
754
  };
943
755
  const onEnd = () => finish({ pid: null, hostPid: null });
944
- // On timeout, hand back whatever partial bytes accumulated — discarding
945
- // them would tear the first message the transport parses.
946
756
  const timer = setTimeout(() => {
947
757
  const partial = chunks.length === 0 ? undefined : (chunks.length === 1 ? chunks[0] : Buffer.concat(chunks, total));
948
758
  finish({ pid: null, hostPid: null }, partial);