homegraph 1.2.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (560) hide show
  1. package/README.md +48 -11
  2. package/dist/bin/homegraph.js +298 -72
  3. package/dist/bin/homegraph.js.map +1 -1
  4. package/dist/context/index.d.ts.map +1 -1
  5. package/dist/context/index.js +117 -11
  6. package/dist/context/index.js.map +1 -1
  7. package/dist/db/index.d.ts +207 -6
  8. package/dist/db/index.d.ts.map +1 -1
  9. package/dist/db/index.js +461 -20
  10. package/dist/db/index.js.map +1 -1
  11. package/dist/db/migrations.d.ts +1 -1
  12. package/dist/db/migrations.d.ts.map +1 -1
  13. package/dist/db/migrations.js +19 -1
  14. package/dist/db/migrations.js.map +1 -1
  15. package/dist/db/queries.d.ts +157 -3
  16. package/dist/db/queries.d.ts.map +1 -1
  17. package/dist/db/queries.js +426 -9
  18. package/dist/db/queries.js.map +1 -1
  19. package/dist/db/schema.sql +32 -1
  20. package/dist/db/sqlite-adapter.d.ts +24 -17
  21. package/dist/db/sqlite-adapter.d.ts.map +1 -1
  22. package/dist/db/sqlite-adapter.js +292 -36
  23. package/dist/db/sqlite-adapter.js.map +1 -1
  24. package/dist/db/wal-valve.d.ts +119 -0
  25. package/dist/db/wal-valve.d.ts.map +1 -0
  26. package/dist/db/wal-valve.js +290 -0
  27. package/dist/db/wal-valve.js.map +1 -0
  28. package/dist/directory.d.ts +9 -5
  29. package/dist/directory.d.ts.map +1 -1
  30. package/dist/directory.js +210 -19
  31. package/dist/directory.js.map +1 -1
  32. package/dist/extraction/arkts-batch-worker.js +3 -2
  33. package/dist/extraction/arkts-batch-worker.js.map +1 -1
  34. package/dist/extraction/cfml-extractor.d.ts +107 -0
  35. package/dist/extraction/cfml-extractor.d.ts.map +1 -0
  36. package/dist/extraction/cfml-extractor.js +494 -0
  37. package/dist/extraction/cfml-extractor.js.map +1 -0
  38. package/dist/extraction/default-ignore.d.ts +39 -0
  39. package/dist/extraction/default-ignore.d.ts.map +1 -0
  40. package/dist/extraction/default-ignore.js +221 -0
  41. package/dist/extraction/default-ignore.js.map +1 -0
  42. package/dist/extraction/grammars.d.ts +25 -1
  43. package/dist/extraction/grammars.d.ts.map +1 -1
  44. package/dist/extraction/grammars.js +177 -24
  45. package/dist/extraction/grammars.js.map +1 -1
  46. package/dist/extraction/index.d.ts +52 -14
  47. package/dist/extraction/index.d.ts.map +1 -1
  48. package/dist/extraction/index.js +521 -314
  49. package/dist/extraction/index.js.map +1 -1
  50. package/dist/extraction/languages/arkts.d.ts +90 -6
  51. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  52. package/dist/extraction/languages/arkts.js +1579 -128
  53. package/dist/extraction/languages/arkts.js.map +1 -1
  54. package/dist/extraction/languages/c-cpp.d.ts +42 -0
  55. package/dist/extraction/languages/c-cpp.d.ts.map +1 -1
  56. package/dist/extraction/languages/c-cpp.js +369 -4
  57. package/dist/extraction/languages/c-cpp.js.map +1 -1
  58. package/dist/extraction/languages/cfquery.d.ts +12 -0
  59. package/dist/extraction/languages/cfquery.d.ts.map +1 -0
  60. package/dist/extraction/languages/cfquery.js +28 -0
  61. package/dist/extraction/languages/cfquery.js.map +1 -0
  62. package/dist/extraction/languages/cfscript.d.ts +3 -0
  63. package/dist/extraction/languages/cfscript.d.ts.map +1 -0
  64. package/dist/extraction/languages/cfscript.js +73 -0
  65. package/dist/extraction/languages/cfscript.js.map +1 -0
  66. package/dist/extraction/languages/cobol.d.ts +33 -0
  67. package/dist/extraction/languages/cobol.d.ts.map +1 -0
  68. package/dist/extraction/languages/cobol.js +499 -0
  69. package/dist/extraction/languages/cobol.js.map +1 -0
  70. package/dist/extraction/languages/erlang.d.ts +3 -0
  71. package/dist/extraction/languages/erlang.d.ts.map +1 -0
  72. package/dist/extraction/languages/erlang.js +350 -0
  73. package/dist/extraction/languages/erlang.js.map +1 -0
  74. package/dist/extraction/languages/index.d.ts.map +1 -1
  75. package/dist/extraction/languages/index.js +16 -0
  76. package/dist/extraction/languages/index.js.map +1 -1
  77. package/dist/extraction/languages/nix.d.ts +3 -0
  78. package/dist/extraction/languages/nix.d.ts.map +1 -0
  79. package/dist/extraction/languages/nix.js +294 -0
  80. package/dist/extraction/languages/nix.js.map +1 -0
  81. package/dist/extraction/languages/solidity.d.ts +3 -0
  82. package/dist/extraction/languages/solidity.d.ts.map +1 -0
  83. package/dist/extraction/languages/solidity.js +293 -0
  84. package/dist/extraction/languages/solidity.js.map +1 -0
  85. package/dist/extraction/languages/terraform.d.ts +3 -0
  86. package/dist/extraction/languages/terraform.d.ts.map +1 -0
  87. package/dist/extraction/languages/terraform.js +641 -0
  88. package/dist/extraction/languages/terraform.js.map +1 -0
  89. package/dist/extraction/languages/vbnet.d.ts +11 -0
  90. package/dist/extraction/languages/vbnet.d.ts.map +1 -0
  91. package/dist/extraction/languages/vbnet.js +141 -0
  92. package/dist/extraction/languages/vbnet.js.map +1 -0
  93. package/dist/extraction/mybatis-extractor.d.ts +30 -10
  94. package/dist/extraction/mybatis-extractor.d.ts.map +1 -1
  95. package/dist/extraction/mybatis-extractor.js +140 -38
  96. package/dist/extraction/mybatis-extractor.js.map +1 -1
  97. package/dist/extraction/parse-pool.d.ts +27 -1
  98. package/dist/extraction/parse-pool.d.ts.map +1 -1
  99. package/dist/extraction/parse-pool.js +75 -7
  100. package/dist/extraction/parse-pool.js.map +1 -1
  101. package/dist/extraction/parse-worker.js +9 -2
  102. package/dist/extraction/parse-worker.js.map +1 -1
  103. package/dist/extraction/store-worker.d.ts +20 -0
  104. package/dist/extraction/store-worker.d.ts.map +1 -0
  105. package/dist/extraction/store-worker.js +102 -0
  106. package/dist/extraction/store-worker.js.map +1 -0
  107. package/dist/extraction/store-writer.d.ts +48 -0
  108. package/dist/extraction/store-writer.d.ts.map +1 -0
  109. package/dist/extraction/store-writer.js +167 -0
  110. package/dist/extraction/store-writer.js.map +1 -0
  111. package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
  112. package/dist/extraction/tree-sitter-helpers.js +1 -0
  113. package/dist/extraction/tree-sitter-helpers.js.map +1 -1
  114. package/dist/extraction/tree-sitter-types.d.ts +3 -1
  115. package/dist/extraction/tree-sitter-types.d.ts.map +1 -1
  116. package/dist/extraction/tree-sitter.d.ts +38 -0
  117. package/dist/extraction/tree-sitter.d.ts.map +1 -1
  118. package/dist/extraction/tree-sitter.js +801 -10
  119. package/dist/extraction/tree-sitter.js.map +1 -1
  120. package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  121. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  122. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  123. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  124. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  125. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  126. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  127. package/dist/extraction/wasm/tree-sitter-terraform.wasm +0 -0
  128. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  129. package/dist/extraction/wasm-runtime-flags.d.ts +14 -4
  130. package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
  131. package/dist/extraction/wasm-runtime-flags.js +55 -7
  132. package/dist/extraction/wasm-runtime-flags.js.map +1 -1
  133. package/dist/graph/traversal.d.ts.map +1 -1
  134. package/dist/graph/traversal.js +1 -1
  135. package/dist/graph/traversal.js.map +1 -1
  136. package/dist/index.d.ts +74 -5
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +436 -55
  139. package/dist/index.js.map +1 -1
  140. package/dist/installer/index.d.ts +42 -0
  141. package/dist/installer/index.d.ts.map +1 -1
  142. package/dist/installer/index.js +97 -2
  143. package/dist/installer/index.js.map +1 -1
  144. package/dist/mcp/daemon.d.ts +25 -3
  145. package/dist/mcp/daemon.d.ts.map +1 -1
  146. package/dist/mcp/daemon.js +62 -8
  147. package/dist/mcp/daemon.js.map +1 -1
  148. package/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
  149. package/dist/mcp/dynamic-boundaries.js +2 -1
  150. package/dist/mcp/dynamic-boundaries.js.map +1 -1
  151. package/dist/mcp/early-ppid.d.ts +26 -0
  152. package/dist/mcp/early-ppid.d.ts.map +1 -0
  153. package/dist/mcp/early-ppid.js +29 -0
  154. package/dist/mcp/early-ppid.js.map +1 -0
  155. package/dist/mcp/engine.d.ts +4 -5
  156. package/dist/mcp/engine.d.ts.map +1 -1
  157. package/dist/mcp/engine.js +27 -1
  158. package/dist/mcp/engine.js.map +1 -1
  159. package/dist/mcp/index.d.ts.map +1 -1
  160. package/dist/mcp/index.js +41 -6
  161. package/dist/mcp/index.js.map +1 -1
  162. package/dist/mcp/liveness-watchdog.d.ts +18 -1
  163. package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
  164. package/dist/mcp/liveness-watchdog.js +73 -13
  165. package/dist/mcp/liveness-watchdog.js.map +1 -1
  166. package/dist/mcp/memory-budget.d.ts +30 -0
  167. package/dist/mcp/memory-budget.d.ts.map +1 -0
  168. package/dist/mcp/memory-budget.js +123 -0
  169. package/dist/mcp/memory-budget.js.map +1 -0
  170. package/dist/mcp/proxy.d.ts.map +1 -1
  171. package/dist/mcp/proxy.js +88 -4
  172. package/dist/mcp/proxy.js.map +1 -1
  173. package/dist/mcp/query-cache.d.ts +35 -4
  174. package/dist/mcp/query-cache.d.ts.map +1 -1
  175. package/dist/mcp/query-cache.js +89 -19
  176. package/dist/mcp/query-cache.js.map +1 -1
  177. package/dist/mcp/query-pool.d.ts +46 -12
  178. package/dist/mcp/query-pool.d.ts.map +1 -1
  179. package/dist/mcp/query-pool.js +100 -23
  180. package/dist/mcp/query-pool.js.map +1 -1
  181. package/dist/mcp/query-worker.d.ts +2 -2
  182. package/dist/mcp/query-worker.js +2 -2
  183. package/dist/mcp/server-instructions.d.ts +4 -27
  184. package/dist/mcp/server-instructions.d.ts.map +1 -1
  185. package/dist/mcp/server-instructions.js +39 -84
  186. package/dist/mcp/server-instructions.js.map +1 -1
  187. package/dist/mcp/session.d.ts +14 -0
  188. package/dist/mcp/session.d.ts.map +1 -1
  189. package/dist/mcp/session.js +28 -1
  190. package/dist/mcp/session.js.map +1 -1
  191. package/dist/mcp/startup-handshake.d.ts +44 -0
  192. package/dist/mcp/startup-handshake.d.ts.map +1 -0
  193. package/dist/mcp/startup-handshake.js +73 -0
  194. package/dist/mcp/startup-handshake.js.map +1 -0
  195. package/dist/mcp/tools.d.ts +104 -4
  196. package/dist/mcp/tools.d.ts.map +1 -1
  197. package/dist/mcp/tools.js +2432 -217
  198. package/dist/mcp/tools.js.map +1 -1
  199. package/dist/mcp/transport.d.ts.map +1 -1
  200. package/dist/mcp/transport.js +18 -0
  201. package/dist/mcp/transport.js.map +1 -1
  202. package/dist/project-config.d.ts +38 -0
  203. package/dist/project-config.d.ts.map +1 -1
  204. package/dist/project-config.js +101 -2
  205. package/dist/project-config.js.map +1 -1
  206. package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
  207. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
  208. package/dist/resolution/c-fnptr-synthesizer.js +178 -146
  209. package/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
  210. package/dist/resolution/callback-synthesizer.d.ts +54 -10
  211. package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  212. package/dist/resolution/callback-synthesizer.js +1299 -257
  213. package/dist/resolution/callback-synthesizer.js.map +1 -1
  214. package/dist/resolution/cooperative-yield.d.ts +10 -2
  215. package/dist/resolution/cooperative-yield.d.ts.map +1 -1
  216. package/dist/resolution/cooperative-yield.js +6 -4
  217. package/dist/resolution/cooperative-yield.js.map +1 -1
  218. package/dist/resolution/frameworks/cics.d.ts +20 -0
  219. package/dist/resolution/frameworks/cics.d.ts.map +1 -0
  220. package/dist/resolution/frameworks/cics.js +90 -0
  221. package/dist/resolution/frameworks/cics.js.map +1 -0
  222. package/dist/resolution/frameworks/go.d.ts.map +1 -1
  223. package/dist/resolution/frameworks/go.js +29 -6
  224. package/dist/resolution/frameworks/go.js.map +1 -1
  225. package/dist/resolution/frameworks/index.d.ts.map +1 -1
  226. package/dist/resolution/frameworks/index.js +3 -0
  227. package/dist/resolution/frameworks/index.js.map +1 -1
  228. package/dist/resolution/frameworks/java.d.ts.map +1 -1
  229. package/dist/resolution/frameworks/java.js +14 -6
  230. package/dist/resolution/frameworks/java.js.map +1 -1
  231. package/dist/resolution/frameworks/terraform.d.ts +38 -0
  232. package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
  233. package/dist/resolution/frameworks/terraform.js +277 -0
  234. package/dist/resolution/frameworks/terraform.js.map +1 -0
  235. package/dist/resolution/goframe-synthesizer.d.ts +2 -1
  236. package/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
  237. package/dist/resolution/goframe-synthesizer.js +8 -3
  238. package/dist/resolution/goframe-synthesizer.js.map +1 -1
  239. package/dist/resolution/import-resolver.d.ts +9 -3
  240. package/dist/resolution/import-resolver.d.ts.map +1 -1
  241. package/dist/resolution/import-resolver.js +295 -11
  242. package/dist/resolution/import-resolver.js.map +1 -1
  243. package/dist/resolution/index.d.ts +146 -8
  244. package/dist/resolution/index.d.ts.map +1 -1
  245. package/dist/resolution/index.js +1089 -131
  246. package/dist/resolution/index.js.map +1 -1
  247. package/dist/resolution/memory-budget.d.ts +48 -0
  248. package/dist/resolution/memory-budget.d.ts.map +1 -0
  249. package/dist/resolution/memory-budget.js +162 -0
  250. package/dist/resolution/memory-budget.js.map +1 -0
  251. package/dist/resolution/name-matcher.d.ts +12 -4
  252. package/dist/resolution/name-matcher.d.ts.map +1 -1
  253. package/dist/resolution/name-matcher.js +793 -130
  254. package/dist/resolution/name-matcher.js.map +1 -1
  255. package/dist/resolution/resolver-pool.d.ts +106 -0
  256. package/dist/resolution/resolver-pool.d.ts.map +1 -0
  257. package/dist/resolution/resolver-pool.js +344 -0
  258. package/dist/resolution/resolver-pool.js.map +1 -0
  259. package/dist/resolution/resolver-worker.d.ts +17 -0
  260. package/dist/resolution/resolver-worker.d.ts.map +1 -0
  261. package/dist/resolution/resolver-worker.js +141 -0
  262. package/dist/resolution/resolver-worker.js.map +1 -0
  263. package/dist/resolution/strip-comments.d.ts +1 -1
  264. package/dist/resolution/strip-comments.d.ts.map +1 -1
  265. package/dist/resolution/strip-comments.js +49 -0
  266. package/dist/resolution/strip-comments.js.map +1 -1
  267. package/dist/resolution/types.d.ts +32 -0
  268. package/dist/resolution/types.d.ts.map +1 -1
  269. package/dist/resolution/workspace-packages.d.ts +10 -0
  270. package/dist/resolution/workspace-packages.d.ts.map +1 -1
  271. package/dist/resolution/workspace-packages.js +142 -4
  272. package/dist/resolution/workspace-packages.js.map +1 -1
  273. package/dist/search/identifier-segments.d.ts +60 -0
  274. package/dist/search/identifier-segments.d.ts.map +1 -0
  275. package/dist/search/identifier-segments.js +176 -0
  276. package/dist/search/identifier-segments.js.map +1 -0
  277. package/dist/search/query-utils.d.ts +201 -0
  278. package/dist/search/query-utils.d.ts.map +1 -1
  279. package/dist/search/query-utils.js +919 -2
  280. package/dist/search/query-utils.js.map +1 -1
  281. package/dist/spec/build/diff-parser.d.ts +55 -0
  282. package/dist/spec/build/diff-parser.d.ts.map +1 -0
  283. package/dist/spec/build/diff-parser.js +205 -0
  284. package/dist/spec/build/diff-parser.js.map +1 -0
  285. package/dist/spec/build/git-scanner.d.ts +93 -0
  286. package/dist/spec/build/git-scanner.d.ts.map +1 -0
  287. package/dist/spec/build/git-scanner.js +254 -0
  288. package/dist/spec/build/git-scanner.js.map +1 -0
  289. package/dist/spec/build/pipeline.d.ts +54 -0
  290. package/dist/spec/build/pipeline.d.ts.map +1 -0
  291. package/dist/spec/build/pipeline.js +170 -0
  292. package/dist/spec/build/pipeline.js.map +1 -0
  293. package/dist/spec/build/scan.d.ts +48 -0
  294. package/dist/spec/build/scan.d.ts.map +1 -0
  295. package/dist/spec/build/scan.js +89 -0
  296. package/dist/spec/build/scan.js.map +1 -0
  297. package/dist/spec/build/scope-resolver.d.ts +50 -0
  298. package/dist/spec/build/scope-resolver.d.ts.map +1 -0
  299. package/dist/spec/build/scope-resolver.js +105 -0
  300. package/dist/spec/build/scope-resolver.js.map +1 -0
  301. package/dist/spec/build/spec-extractor.d.ts +74 -0
  302. package/dist/spec/build/spec-extractor.d.ts.map +1 -0
  303. package/dist/spec/build/spec-extractor.js +344 -0
  304. package/dist/spec/build/spec-extractor.js.map +1 -0
  305. package/dist/spec/config.d.ts +35 -1
  306. package/dist/spec/config.d.ts.map +1 -1
  307. package/dist/spec/config.js +30 -5
  308. package/dist/spec/config.js.map +1 -1
  309. package/dist/spec/db/fts.d.ts.map +1 -1
  310. package/dist/spec/db/fts.js +19 -50
  311. package/dist/spec/db/fts.js.map +1 -1
  312. package/dist/spec/db/index.d.ts +5 -3
  313. package/dist/spec/db/index.d.ts.map +1 -1
  314. package/dist/spec/db/index.js +16 -1
  315. package/dist/spec/db/index.js.map +1 -1
  316. package/dist/spec/db/persist.d.ts +45 -0
  317. package/dist/spec/db/persist.d.ts.map +1 -0
  318. package/dist/spec/db/persist.js +66 -0
  319. package/dist/spec/db/persist.js.map +1 -0
  320. package/dist/spec/db/relations.d.ts +80 -1
  321. package/dist/spec/db/relations.d.ts.map +1 -1
  322. package/dist/spec/db/relations.js +175 -4
  323. package/dist/spec/db/relations.js.map +1 -1
  324. package/dist/spec/db/schema.d.ts +4 -0
  325. package/dist/spec/db/schema.d.ts.map +1 -1
  326. package/dist/spec/db/schema.js +4 -0
  327. package/dist/spec/db/schema.js.map +1 -1
  328. package/dist/spec/db/schema.sql +5 -1
  329. package/dist/spec/db/spec-node.d.ts +5 -0
  330. package/dist/spec/db/spec-node.d.ts.map +1 -1
  331. package/dist/spec/db/spec-node.js +11 -5
  332. package/dist/spec/db/spec-node.js.map +1 -1
  333. package/dist/spec/db/sql-utils.d.ts +11 -0
  334. package/dist/spec/db/sql-utils.d.ts.map +1 -0
  335. package/dist/spec/db/sql-utils.js +19 -0
  336. package/dist/spec/db/sql-utils.js.map +1 -0
  337. package/dist/spec/evolve/cluster-context.d.ts +30 -0
  338. package/dist/spec/evolve/cluster-context.d.ts.map +1 -0
  339. package/dist/spec/evolve/cluster-context.js +78 -0
  340. package/dist/spec/evolve/cluster-context.js.map +1 -0
  341. package/dist/spec/evolve/commit-spec-analyzer.d.ts +51 -0
  342. package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +1 -0
  343. package/dist/spec/evolve/commit-spec-analyzer.js +88 -0
  344. package/dist/spec/evolve/commit-spec-analyzer.js.map +1 -0
  345. package/dist/spec/evolve/commit-spec-persister.d.ts +53 -0
  346. package/dist/spec/evolve/commit-spec-persister.d.ts.map +1 -0
  347. package/dist/spec/evolve/commit-spec-persister.js +93 -0
  348. package/dist/spec/evolve/commit-spec-persister.js.map +1 -0
  349. package/dist/spec/evolve/impact-locator.d.ts +23 -7
  350. package/dist/spec/evolve/impact-locator.d.ts.map +1 -1
  351. package/dist/spec/evolve/impact-locator.js +58 -14
  352. package/dist/spec/evolve/impact-locator.js.map +1 -1
  353. package/dist/spec/evolve/pipeline.d.ts +62 -25
  354. package/dist/spec/evolve/pipeline.d.ts.map +1 -1
  355. package/dist/spec/evolve/pipeline.js +436 -457
  356. package/dist/spec/evolve/pipeline.js.map +1 -1
  357. package/dist/spec/evolve/spec-rewriter.d.ts +13 -13
  358. package/dist/spec/evolve/spec-rewriter.d.ts.map +1 -1
  359. package/dist/spec/evolve/spec-rewriter.js +45 -45
  360. package/dist/spec/evolve/spec-rewriter.js.map +1 -1
  361. package/dist/spec/git/commits.d.ts +85 -0
  362. package/dist/spec/git/commits.d.ts.map +1 -0
  363. package/dist/spec/git/commits.js +218 -0
  364. package/dist/spec/git/commits.js.map +1 -0
  365. package/dist/spec/git/exec.d.ts +13 -0
  366. package/dist/spec/git/exec.d.ts.map +1 -0
  367. package/dist/spec/git/exec.js +19 -0
  368. package/dist/spec/git/exec.js.map +1 -0
  369. package/dist/spec/git/index.d.ts +9 -0
  370. package/dist/spec/git/index.d.ts.map +1 -0
  371. package/dist/spec/git/index.js +22 -0
  372. package/dist/spec/git/index.js.map +1 -0
  373. package/dist/spec/git-utils.d.ts +8 -0
  374. package/dist/spec/git-utils.d.ts.map +1 -0
  375. package/dist/spec/git-utils.js +14 -0
  376. package/dist/spec/git-utils.js.map +1 -0
  377. package/dist/spec/graph/index.d.ts +8 -0
  378. package/dist/spec/graph/index.d.ts.map +1 -0
  379. package/dist/spec/graph/index.js +17 -0
  380. package/dist/spec/graph/index.js.map +1 -0
  381. package/dist/spec/graph/queries.d.ts +6 -35
  382. package/dist/spec/graph/queries.d.ts.map +1 -1
  383. package/dist/spec/graph/queries.js +71 -248
  384. package/dist/spec/graph/queries.js.map +1 -1
  385. package/dist/spec/llm/agent-client.d.ts +59 -0
  386. package/dist/spec/llm/agent-client.d.ts.map +1 -0
  387. package/dist/spec/llm/agent-client.js +213 -0
  388. package/dist/spec/llm/agent-client.js.map +1 -0
  389. package/dist/spec/llm/agents/claude-code.d.ts +32 -0
  390. package/dist/spec/llm/agents/claude-code.d.ts.map +1 -0
  391. package/dist/spec/llm/agents/claude-code.js +125 -0
  392. package/dist/spec/llm/agents/claude-code.js.map +1 -0
  393. package/dist/spec/llm/agents/codex.d.ts +32 -0
  394. package/dist/spec/llm/agents/codex.d.ts.map +1 -0
  395. package/dist/spec/llm/agents/codex.js +145 -0
  396. package/dist/spec/llm/agents/codex.js.map +1 -0
  397. package/dist/spec/llm/agents/detect-utils.d.ts +28 -0
  398. package/dist/spec/llm/agents/detect-utils.d.ts.map +1 -0
  399. package/dist/spec/llm/agents/detect-utils.js +91 -0
  400. package/dist/spec/llm/agents/detect-utils.js.map +1 -0
  401. package/dist/spec/llm/agents/deveco-code.d.ts +33 -0
  402. package/dist/spec/llm/agents/deveco-code.d.ts.map +1 -0
  403. package/dist/spec/llm/agents/deveco-code.js +165 -0
  404. package/dist/spec/llm/agents/deveco-code.js.map +1 -0
  405. package/dist/spec/llm/agents/index.d.ts +31 -0
  406. package/dist/spec/llm/agents/index.d.ts.map +1 -0
  407. package/dist/spec/llm/agents/index.js +65 -0
  408. package/dist/spec/llm/agents/index.js.map +1 -0
  409. package/dist/spec/llm/agents/types.d.ts +76 -0
  410. package/dist/spec/llm/agents/types.d.ts.map +1 -0
  411. package/dist/spec/llm/agents/types.js +15 -0
  412. package/dist/spec/llm/agents/types.js.map +1 -0
  413. package/dist/spec/llm/client.d.ts +31 -11
  414. package/dist/spec/llm/client.d.ts.map +1 -1
  415. package/dist/spec/llm/client.js +143 -81
  416. package/dist/spec/llm/client.js.map +1 -1
  417. package/dist/spec/llm/factory.d.ts +41 -0
  418. package/dist/spec/llm/factory.d.ts.map +1 -0
  419. package/dist/spec/llm/factory.js +80 -0
  420. package/dist/spec/llm/factory.js.map +1 -0
  421. package/dist/spec/llm/prompts.d.ts +24 -8
  422. package/dist/spec/llm/prompts.d.ts.map +1 -1
  423. package/dist/spec/llm/prompts.js +100 -50
  424. package/dist/spec/llm/prompts.js.map +1 -1
  425. package/dist/spec/llm/retry.d.ts +53 -0
  426. package/dist/spec/llm/retry.d.ts.map +1 -0
  427. package/dist/spec/llm/retry.js +153 -0
  428. package/dist/spec/llm/retry.js.map +1 -0
  429. package/dist/spec/mine/clusterer.d.ts +63 -0
  430. package/dist/spec/mine/clusterer.d.ts.map +1 -0
  431. package/dist/spec/mine/clusterer.js +904 -0
  432. package/dist/spec/mine/clusterer.js.map +1 -0
  433. package/dist/spec/mine/clustering/features.d.ts +38 -0
  434. package/dist/spec/mine/clustering/features.d.ts.map +1 -0
  435. package/dist/spec/mine/clustering/features.js +108 -0
  436. package/dist/spec/mine/clustering/features.js.map +1 -0
  437. package/dist/spec/mine/clustering/index.d.ts +62 -0
  438. package/dist/spec/mine/clustering/index.d.ts.map +1 -0
  439. package/dist/spec/mine/clustering/index.js +259 -0
  440. package/dist/spec/mine/clustering/index.js.map +1 -0
  441. package/dist/spec/mine/clustering/leiden.d.ts +61 -0
  442. package/dist/spec/mine/clustering/leiden.d.ts.map +1 -0
  443. package/dist/spec/mine/clustering/leiden.js +489 -0
  444. package/dist/spec/mine/clustering/leiden.js.map +1 -0
  445. package/dist/spec/mine/clustering/text-similarity.d.ts +22 -0
  446. package/dist/spec/mine/clustering/text-similarity.d.ts.map +1 -0
  447. package/dist/spec/mine/clustering/text-similarity.js +98 -0
  448. package/dist/spec/mine/clustering/text-similarity.js.map +1 -0
  449. package/dist/spec/mine/generator.d.ts +54 -0
  450. package/dist/spec/mine/generator.d.ts.map +1 -0
  451. package/dist/spec/mine/generator.js +267 -0
  452. package/dist/spec/mine/generator.js.map +1 -0
  453. package/dist/spec/mine/persist.d.ts +37 -0
  454. package/dist/spec/mine/persist.d.ts.map +1 -0
  455. package/dist/spec/mine/persist.js +170 -0
  456. package/dist/spec/mine/persist.js.map +1 -0
  457. package/dist/spec/mine/pipeline.d.ts +41 -0
  458. package/dist/spec/mine/pipeline.d.ts.map +1 -0
  459. package/dist/spec/mine/pipeline.js +236 -0
  460. package/dist/spec/mine/pipeline.js.map +1 -0
  461. package/dist/spec/mine/progress-handler.d.ts +22 -0
  462. package/dist/spec/mine/progress-handler.d.ts.map +1 -0
  463. package/dist/spec/mine/progress-handler.js +108 -0
  464. package/dist/spec/mine/progress-handler.js.map +1 -0
  465. package/dist/spec/mine/progress.d.ts +23 -0
  466. package/dist/spec/mine/progress.d.ts.map +1 -0
  467. package/dist/spec/mine/progress.js +12 -0
  468. package/dist/spec/mine/progress.js.map +1 -0
  469. package/dist/spec/mine/scanner.d.ts +59 -0
  470. package/dist/spec/mine/scanner.d.ts.map +1 -0
  471. package/dist/spec/mine/scanner.js +383 -0
  472. package/dist/spec/mine/scanner.js.map +1 -0
  473. package/dist/spec/types.d.ts +32 -0
  474. package/dist/spec/types.d.ts.map +1 -1
  475. package/dist/spec/ui/index.d.ts +9 -0
  476. package/dist/spec/ui/index.d.ts.map +1 -0
  477. package/dist/spec/ui/index.js +16 -0
  478. package/dist/spec/ui/index.js.map +1 -0
  479. package/dist/spec/ui/progress-handler.d.ts +33 -0
  480. package/dist/spec/ui/progress-handler.d.ts.map +1 -0
  481. package/dist/spec/ui/progress-handler.js +132 -0
  482. package/dist/spec/ui/progress-handler.js.map +1 -0
  483. package/dist/spec/ui/progress.d.ts +24 -0
  484. package/dist/spec/ui/progress.d.ts.map +1 -0
  485. package/dist/spec/ui/progress.js +13 -0
  486. package/dist/spec/ui/progress.js.map +1 -0
  487. package/dist/spec/utils/fs.d.ts +45 -0
  488. package/dist/spec/utils/fs.d.ts.map +1 -0
  489. package/dist/spec/utils/fs.js +163 -0
  490. package/dist/spec/utils/fs.js.map +1 -0
  491. package/dist/spec/utils/index.d.ts +12 -0
  492. package/dist/spec/utils/index.d.ts.map +1 -0
  493. package/dist/spec/utils/index.js +26 -0
  494. package/dist/spec/utils/index.js.map +1 -0
  495. package/dist/spec/utils/meta.d.ts +32 -0
  496. package/dist/spec/utils/meta.d.ts.map +1 -0
  497. package/dist/spec/utils/meta.js +122 -0
  498. package/dist/spec/utils/meta.js.map +1 -0
  499. package/dist/spec/utils/truncate.d.ts +86 -0
  500. package/dist/spec/utils/truncate.d.ts.map +1 -0
  501. package/dist/spec/utils/truncate.js +172 -0
  502. package/dist/spec/utils/truncate.js.map +1 -0
  503. package/dist/spec/utils.d.ts +4 -16
  504. package/dist/spec/utils.d.ts.map +1 -1
  505. package/dist/spec/utils.js +6 -58
  506. package/dist/spec/utils.js.map +1 -1
  507. package/dist/sync/git-hooks.d.ts.map +1 -1
  508. package/dist/sync/git-hooks.js +2 -0
  509. package/dist/sync/git-hooks.js.map +1 -1
  510. package/dist/sync/watcher.d.ts +35 -6
  511. package/dist/sync/watcher.d.ts.map +1 -1
  512. package/dist/sync/watcher.js +127 -17
  513. package/dist/sync/watcher.js.map +1 -1
  514. package/dist/sync/worktree.d.ts.map +1 -1
  515. package/dist/sync/worktree.js +5 -0
  516. package/dist/sync/worktree.js.map +1 -1
  517. package/dist/telemetry/index.js +3 -3
  518. package/dist/telemetry/index.js.map +1 -1
  519. package/dist/types.d.ts +22 -1
  520. package/dist/types.d.ts.map +1 -1
  521. package/dist/types.js +10 -0
  522. package/dist/types.js.map +1 -1
  523. package/dist/upgrade/index.d.ts +32 -0
  524. package/dist/upgrade/index.d.ts.map +1 -1
  525. package/dist/upgrade/index.js +162 -14
  526. package/dist/upgrade/index.js.map +1 -1
  527. package/dist/upgrade/remove-binary.d.ts +87 -0
  528. package/dist/upgrade/remove-binary.d.ts.map +1 -0
  529. package/dist/upgrade/remove-binary.js +289 -0
  530. package/dist/upgrade/remove-binary.js.map +1 -0
  531. package/dist/upgrade/update-check.d.ts +92 -0
  532. package/dist/upgrade/update-check.d.ts.map +1 -0
  533. package/dist/upgrade/update-check.js +258 -0
  534. package/dist/upgrade/update-check.js.map +1 -0
  535. package/package.json +6 -2
  536. package/scripts/agent-eval/run-all.sh +6 -0
  537. package/scripts/build-bundle.sh +5 -0
  538. package/scripts/npm-shim.js +8 -1
  539. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
  540. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
  541. package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-310.pyc +0 -0
  542. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
  543. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
  544. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
  545. package/scripts/exp_boundary_eval/data/agents.json +0 -109
  546. package/scripts/exp_boundary_eval/data/experiments.json +0 -140
  547. package/scripts/qa_eval/README.md +0 -407
  548. package/scripts/qa_eval/_test_deveco_probe.py +0 -41
  549. package/scripts/qa_eval/agent_runner.py +0 -526
  550. package/scripts/qa_eval/data/.gitignore +0 -4
  551. package/scripts/qa_eval/data/test-set.jsonl +0 -2
  552. package/scripts/qa_eval/eval_metrics.py +0 -274
  553. package/scripts/qa_eval/external_agent.py +0 -976
  554. package/scripts/qa_eval/llm_config.py +0 -92
  555. package/scripts/qa_eval/memory_monitor.py +0 -132
  556. package/scripts/qa_eval/my_answer_accuracy.py +0 -187
  557. package/scripts/qa_eval/requirements.txt +0 -2
  558. package/scripts/qa_eval/run_pipeline.py +0 -804
  559. package/scripts/qa_eval/stats_efficiency.py +0 -279
  560. package/scripts/qa_eval/stats_scores.py +0 -207
@@ -1 +1 @@
1
- {"version":3,"file":"query-pool.js","sourceRoot":"","sources":["../../src/mcp/query-pool.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuFH,0CAOC;AA5FD,mDAAwC;AACxC,2CAA6B;AAC7B,uCAAyB;AAGzB,mFAAmF;AACnF,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;AAgB5D,0EAA0E;AAC1E,MAAM,uBAAuB,GAAG,MAAM,CAAC,CAAC,wCAAwC;AAEhF,gEAAgE;AAChE,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,YAAY,GAAG,EAAE,CAAC;AAExB;;;;;;;GAOG;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAkC/B;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,MAA0B,EAAE,QAAgB;IAC1E,IAAI,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,EAAE,EAAE,CAAC;QAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC;QAChF,uDAAuD;IACzD,CAAC;IACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC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I,CAAC,OAAO,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QACf,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,4CAA4C,EAAE,CAAC,EAAE,CAAC,CAAC;QACvH,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,MAAM,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;IACvG,CAAC;CACF;AAvND,8BAuNC"}
@@ -2,7 +2,7 @@
2
2
  * Query worker thread — issue: concurrent MCP tool calls starve the daemon.
3
3
  *
4
4
  * The shared daemon serves every session on ONE event loop with synchronous
5
- * `node:sqlite`. `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
5
+ * SQLite (better-sqlite3 / wasm). `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
6
6
  * PageRank + impact + output building) stitched together by microtask `await`s,
7
7
  * so N concurrent explores keep the microtask queue continuously full and
8
8
  * starve the macrotask phases — timers AND socket I/O. The transport freezes:
@@ -10,7 +10,7 @@
10
10
  * ~10 subagents that routinely exceeds the MCP client's request timeout.
11
11
  *
12
12
  * This worker moves the heavy read-tool dispatch OFF the daemon's main loop.
13
- * Each worker owns its OWN read connection (node:sqlite WAL allows N concurrent
13
+ * Each worker owns its OWN read connection (native WAL allows N concurrent
14
14
  * readers across connections — verified: a worker reader sees the main writer's
15
15
  * committed catch-up/watcher writes), so {@link QueryPool} runs N tool calls in
16
16
  * true parallel up to core count while the main loop stays free for the MCP
@@ -3,7 +3,7 @@
3
3
  * Query worker thread — issue: concurrent MCP tool calls starve the daemon.
4
4
  *
5
5
  * The shared daemon serves every session on ONE event loop with synchronous
6
- * `node:sqlite`. `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
6
+ * SQLite (better-sqlite3 / wasm). `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
7
7
  * PageRank + impact + output building) stitched together by microtask `await`s,
8
8
  * so N concurrent explores keep the microtask queue continuously full and
9
9
  * starve the macrotask phases — timers AND socket I/O. The transport freezes:
@@ -11,7 +11,7 @@
11
11
  * ~10 subagents that routinely exceeds the MCP client's request timeout.
12
12
  *
13
13
  * This worker moves the heavy read-tool dispatch OFF the daemon's main loop.
14
- * Each worker owns its OWN read connection (node:sqlite WAL allows N concurrent
14
+ * Each worker owns its OWN read connection (native WAL allows N concurrent
15
15
  * readers across connections — verified: a worker reader sees the main writer's
16
16
  * committed catch-up/watcher writes), so {@link QueryPool} runs N tool calls in
17
17
  * true parallel up to core count while the main loop stays free for the MCP
@@ -1,32 +1,9 @@
1
1
  /**
2
2
  * Server-level instructions emitted in the MCP `initialize` response.
3
3
  *
4
- * MCP clients (Claude Code, Cursor, opencode, LangChain, OpenAI Agent
5
- * SDK, …) surface this text in the agent's system prompt automatically,
6
- * giving the agent a high-level playbook for the homegraph toolset
7
- * before it sees individual tool descriptions.
8
- *
9
- * Goals when editing this:
10
- * - Lead the agent to homegraph_explore for any structural/flow question
11
- * - Reinforce "explore instead of Read/Grep" for indexed code
12
- * - Anti-patterns (don't re-verify with grep; don't hand-reconstruct flows)
13
- *
14
- * HomeGraph exposes the full tool surface by default (search, node, explore,
15
- * spec tools, …). Lead with homegraph_explore for structural questions; the
16
- * other tools are available when a narrower step helps.
17
- */
18
- export declare const SERVER_INSTRUCTIONS = "# HomeGraph \u2014 code intelligence over an indexed knowledge graph\n\nHomeGraph is a SQLite knowledge graph of every symbol, edge, and file in\nthe workspace \u2014 pre-computed structure you would otherwise re-derive by\nreading files (cached intelligence: thousands of parse/trace decisions you\ndon't pay to re-reason each run). Reads are sub-millisecond; the index lags\nwrites by ~1s through the file watcher. Reach for it BEFORE *and* while\nwriting or editing code \u2014 not just for questions: one call returns the\nverbatim source PLUS who calls it and what it affects, so you edit with the\nblast radius in view. More accurate context, in far fewer tokens and\nround-trips than reading files yourself.\n\n## Primary tool: homegraph_explore \u2014 use it instead of reading files\n\nFor structural and flow questions, `homegraph_explore` is Read-equivalent. It\ntakes either a natural-language question or a bag of symbol/file names and\nreturns the **verbatim, line-numbered source** of the relevant symbols\ngrouped by file \u2014 the same `<n>\\t<line>` shape `Read` gives you, safe to\n`Edit` from \u2014 PLUS the call path among them (including dynamic-dispatch hops\nlike callbacks, React re-render, and JSX children that grep can't follow) and\na blast-radius summary of what depends on them.\n\nWhether you're answering \"how does X work\" or implementing a change (fixing a\nbug, adding a feature), call `homegraph_explore` before you Read. ONE call\nusually answers the whole question. HomeGraph IS the pre-built search index \u2014\nso running your own grep + read loop, or delegating the lookup to a separate\nfile-reading sub-task/agent, repeats work homegraph already did and costs more\nfor the same answer. A direct homegraph answer is typically one to a few\ncalls; a grep/read exploration is dozens.\n\n## How to query\n\n- **Almost any question \u2014 \"how does X work\", architecture, a bug, \"what/where is X\", or surveying an area** \u2192 `homegraph_explore` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.\n- **\"How does X reach/become Y? / the flow / the path from X to Y\"** \u2192 `homegraph_explore`, naming the symbols that span the flow (e.g. `mutateElement renderScene`) \u2014 it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.\n- **Reading or editing a file/symbol you can name** \u2192 put its name or file path in the `homegraph_explore` query \u2014 it returns that current line-numbered source (safe to `Edit` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.\n- **Need more?** Call `homegraph_explore` again with more specific names \u2014 treat the source it returns as already Read.\n\n## Anti-patterns\n\n- **Trust homegraph's results \u2014 don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.\n- **Don't grep or Read first** to find or understand indexed code \u2014 ONE `homegraph_explore` returns the relevant symbols' source together in a single round-trip. Reach for raw `Read`/`Grep` only to confirm a specific detail homegraph didn't cover, or for what homegraph doesn't index (configs, docs).\n- **Don't reconstruct a flow by hand** \u2014 name the endpoints in one `homegraph_explore` and it surfaces the path between them, dynamic-dispatch hops included.\n- **After editing, check the staleness banner.** When a tool response starts with \"\u26A0\uFE0F Some files referenced below were edited since the last index sync\u2026\", the listed files are pending re-index \u2014 Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust homegraph. A different, rarer banner \u2014 \"\u26A0\uFE0F HomeGraph auto-sync is DISABLED\u2026\" \u2014 means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.\n\n## Limitations\n\n- If a tool reports a project isn't indexed (no `.homegraph/`), stop calling homegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision \u2014 mention they can run `homegraph init` if it comes up, but don't run it yourself.\n- Index lags file writes by ~1 second.\n- Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.\n- No live correctness validation \u2014 that's still the TypeScript compiler / test suite / linter's job. HomeGraph supplements those with structural context they don't have.\n";
19
- /**
20
- * Instructions variant sent when the server's own root has NO homegraph index.
21
- *
22
- * The tools are still exposed (gating tool availability on whether `./` has an
23
- * index is the bug behind #964: it breaks monorepos where only sub-projects are
24
- * indexed, and a server that started before `homegraph init` never surfaces the
25
- * tools afterward). Instead of an "inactive" note, this variant tells the agent
26
- * homegraph works **per project**: there's no default project to query, so pass
27
- * a `projectPath` to any project that HAS a `.homegraph/`. The full single-
28
- * project playbook ({@link SERVER_INSTRUCTIONS}) is sent instead when the root
29
- * IS indexed, so the common case stays tight.
4
+ * Single source of truth for agent-facing tool guidance (issue #529).
5
+ * Edit here not installer prompts or eval harness prompts.
30
6
  */
31
- export declare const SERVER_INSTRUCTIONS_NO_ROOT_INDEX = "# HomeGraph \u2014 available (per-project; pass projectPath)\n\nHomeGraph is a SQLite knowledge graph of a codebase's symbols, edges, and\nfiles: one `homegraph_explore` call returns the verbatim, line-numbered source\nof the relevant symbols PLUS the call paths between them and a blast-radius\nsummary \u2014 replacing a grep + Read loop with one round-trip.\n\nThis server started somewhere with no `.homegraph/` of its own, so there is no\ndefault project \u2014 but the tools are available and work **per project**:\n\n- To query a project that HAS a `.homegraph/` index (e.g. a service inside a\n monorepo, or a second repo), pass its path as `projectPath` to\n `homegraph_explore` (and any other homegraph tool). HomeGraph resolves the\n nearest `.homegraph/` at or above that path and answers from it \u2014 for as many\n projects as you like in one session.\n- For a project with no `.homegraph/`, use your built-in tools (Read/Grep/Glob)\n for that project. Indexing is the user's decision \u2014 don't run it yourself, but\n if it comes up they can run `homegraph init` in a project to enable homegraph\n there (a new index is picked up live, no restart).\n";
7
+ export declare const SERVER_INSTRUCTIONS = "# HomeGraph \u2014 when to call\n\nHomeGraph is a **local structural index of THIS repo**: symbols + call/import/extends edges + files. Use it only when the answer needs that graph.\n\n## Call HomeGraph (closed set)\n\nUse `homegraph_explore` (primary) when **all** of these hold:\n\n1. The evidence lives **in this repository's source** (not an external SDK manual).\n2. You need **structure**: definition location, who calls whom, how A reaches B, multi-file wiring, or in-repo import/usage of a named API/`@kit` module.\n3. You can put **concrete names** in `query` \u2014 symbol, `Type.member`, file basename, or `@kit\u2026` (skip `homegraph_search` when names are already known).\n\nTypical fits:\n\n- How a **feature in this repo** is wired (mechanism / cross-file / click\u2192handler flow)\n- Callers / callees / blast radius of a **named** symbol\n- What a **named component/method** does (include the name; one explore is enough)\n- In-repo usages of an imported API (not the official feature catalog)\n\n**One explore with names** beats search\u2192explore\u2192node\u2192grep\u2192read. Treat returned line-numbered source as already Read. After a full explore \u2014 **answer**; do not re-verify with grep/read/node for the same symbols. Busy/partial \u2192 retry that **same** explore once.\n\n## Do not call HomeGraph otherwise\n\nIf the question is **outside the set above**, do **not** open any `homegraph_*` tool \u2014 use Read / Grep / Glob / SDK docs. HomeGraph is not a general Q&A layer; forcing it on the wrong shape costs time and tokens and often lowers quality.\n\n## Tool roles\n\n| Tool | Role |\n|------|------|\n| **homegraph_explore** | Primary for the closed set above |\n| homegraph_node | One known symbol body (or indexed file) after explore named it |\n| homegraph_callers / callees | Compact edge lists for a named symbol |\n| homegraph_search | Rare \u2014 unknown spelling only |\n| homegraph_files | Folder tree only |\n\n## Tips\n\n- **Deadline / partial** \u2014 success-shaped; retry ONE explore with the same names. Do not abandon to grep for those symbols.\n- **Staleness banner** \u2014 Read only the listed edited files.\n- **Not indexed** \u2014 built-in tools; user runs `homegraph init` \u2014 you do not.\n";
8
+ export declare const SERVER_INSTRUCTIONS_NO_ROOT_INDEX = "# HomeGraph \u2014 per-project (pass projectPath)\n\nHomeGraph indexes a codebase into a symbol graph. Call it **only** for in-repo structural / flow / usage questions on a project that has `.homegraph/`. Pass that project as `projectPath`.\n\n- Fits the closed set (structure, callers, wiring, named symbol/file) \u2192 `homegraph_explore`\n- Anything else \u2192 Read/Grep/Glob \u2014 **do not call homegraph_***\n- No index \u2192 Read/Grep/Glob; user runs `homegraph init` if they want indexing\n";
32
9
  //# sourceMappingURL=server-instructions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,mBAAmB,4sJAkD/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iCAAiC,4pCAmB7C,CAAC"}
1
+ {"version":3,"file":"server-instructions.d.ts","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,mBAAmB,wtEAwC/B,CAAC;AAEF,eAAO,MAAM,iCAAiC,yfAO7C,CAAC"}
@@ -1,104 +1,59 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = exports.SERVER_INSTRUCTIONS = void 0;
4
2
  /**
5
3
  * Server-level instructions emitted in the MCP `initialize` response.
6
4
  *
7
- * MCP clients (Claude Code, Cursor, opencode, LangChain, OpenAI Agent
8
- * SDK, …) surface this text in the agent's system prompt automatically,
9
- * giving the agent a high-level playbook for the homegraph toolset
10
- * before it sees individual tool descriptions.
11
- *
12
- * Goals when editing this:
13
- * - Lead the agent to homegraph_explore for any structural/flow question
14
- * - Reinforce "explore instead of Read/Grep" for indexed code
15
- * - Anti-patterns (don't re-verify with grep; don't hand-reconstruct flows)
16
- *
17
- * HomeGraph exposes the full tool surface by default (search, node, explore,
18
- * spec tools, …). Lead with homegraph_explore for structural questions; the
19
- * other tools are available when a narrower step helps.
5
+ * Single source of truth for agent-facing tool guidance (issue #529).
6
+ * Edit here not installer prompts or eval harness prompts.
20
7
  */
21
- exports.SERVER_INSTRUCTIONS = `# HomeGraph code intelligence over an indexed knowledge graph
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = exports.SERVER_INSTRUCTIONS = void 0;
10
+ exports.SERVER_INSTRUCTIONS = `# HomeGraph — when to call
22
11
 
23
- HomeGraph is a SQLite knowledge graph of every symbol, edge, and file in
24
- the workspace — pre-computed structure you would otherwise re-derive by
25
- reading files (cached intelligence: thousands of parse/trace decisions you
26
- don't pay to re-reason each run). Reads are sub-millisecond; the index lags
27
- writes by ~1s through the file watcher. Reach for it BEFORE *and* while
28
- writing or editing code — not just for questions: one call returns the
29
- verbatim source PLUS who calls it and what it affects, so you edit with the
30
- blast radius in view. More accurate context, in far fewer tokens and
31
- round-trips than reading files yourself.
12
+ HomeGraph is a **local structural index of THIS repo**: symbols + call/import/extends edges + files. Use it only when the answer needs that graph.
32
13
 
33
- ## Primary tool: homegraph_explore — use it instead of reading files
14
+ ## Call HomeGraph (closed set)
34
15
 
35
- For structural and flow questions, \`homegraph_explore\` is Read-equivalent. It
36
- takes either a natural-language question or a bag of symbol/file names and
37
- returns the **verbatim, line-numbered source** of the relevant symbols
38
- grouped by file — the same \`<n>\\t<line>\` shape \`Read\` gives you, safe to
39
- \`Edit\` from — PLUS the call path among them (including dynamic-dispatch hops
40
- like callbacks, React re-render, and JSX children that grep can't follow) and
41
- a blast-radius summary of what depends on them.
16
+ Use \`homegraph_explore\` (primary) when **all** of these hold:
42
17
 
43
- Whether you're answering "how does X work" or implementing a change (fixing a
44
- bug, adding a feature), call \`homegraph_explore\` before you Read. ONE call
45
- usually answers the whole question. HomeGraph IS the pre-built search index
46
- so running your own grep + read loop, or delegating the lookup to a separate
47
- file-reading sub-task/agent, repeats work homegraph already did and costs more
48
- for the same answer. A direct homegraph answer is typically one to a few
49
- calls; a grep/read exploration is dozens.
18
+ 1. The evidence lives **in this repository's source** (not an external SDK manual).
19
+ 2. You need **structure**: definition location, who calls whom, how A reaches B, multi-file wiring, or in-repo import/usage of a named API/\`@kit\` module.
20
+ 3. You can put **concrete names** in \`query\` — symbol, \`Type.member\`, file basename, or \`@kit…\` (skip \`homegraph_search\` when names are already known).
50
21
 
51
- ## How to query
22
+ Typical fits:
52
23
 
53
- - **Almost any question — "how does X work", architecture, a bug, "what/where is X", or surveying an area** \`homegraph_explore\` with a natural-language question or the relevant names. ONE capped call returns the verbatim source grouped by file; most often the ONLY call you need.
54
- - **"How does X reach/become Y? / the flow / the path from X to Y"** → \`homegraph_explore\`, naming the symbols that span the flow (e.g. \`mutateElement renderScene\`) — it surfaces the call path among them, riding dynamic-dispatch hops, and returns their source.
55
- - **Reading or editing a file/symbol you can name** put its name or file path in the \`homegraph_explore\` query — it returns that current line-numbered source (safe to \`Edit\` from) with the call path and blast radius attached, so you don't Read it separately. For an overloaded name it returns every matching definition's body in one call.
56
- - **Need more?** Call \`homegraph_explore\` again with more specific names — treat the source it returns as already Read.
24
+ - How a **feature in this repo** is wired (mechanism / cross-file / click→handler flow)
25
+ - Callers / callees / blast radius of a **named** symbol
26
+ - What a **named component/method** does (include the name; one explore is enough)
27
+ - In-repo usages of an imported API (not the official feature catalog)
57
28
 
58
- ## Anti-patterns
29
+ **One explore with names** beats search→explore→node→grep→read. Treat returned line-numbered source as already Read. After a full explore — **answer**; do not re-verify with grep/read/node for the same symbols. Busy/partial → retry that **same** explore once.
59
30
 
60
- - **Trust homegraph's results don't re-verify them with grep.** They come from a full AST parse; re-checking with grep is slower, less accurate, and wastes context.
61
- - **Don't grep or Read first** to find or understand indexed code — ONE \`homegraph_explore\` returns the relevant symbols' source together in a single round-trip. Reach for raw \`Read\`/\`Grep\` only to confirm a specific detail homegraph didn't cover, or for what homegraph doesn't index (configs, docs).
62
- - **Don't reconstruct a flow by hand** — name the endpoints in one \`homegraph_explore\` and it surfaces the path between them, dynamic-dispatch hops included.
63
- - **After editing, check the staleness banner.** When a tool response starts with "⚠️ Some files referenced below were edited since the last index sync…", the listed files are pending re-index — Read those specific files for accurate content. Every file NOT in that banner is fresh, so still trust homegraph. A different, rarer banner — "⚠️ HomeGraph auto-sync is DISABLED…" — means live watching stopped entirely (the whole index is frozen, not just a few files); until it's resolved, Read files directly to confirm anything that may have changed.
31
+ ## Do not call HomeGraph otherwise
64
32
 
65
- ## Limitations
33
+ If the question is **outside the set above**, do **not** open any \`homegraph_*\` tool — use Read / Grep / Glob / SDK docs. HomeGraph is not a general Q&A layer; forcing it on the wrong shape costs time and tokens and often lowers quality.
66
34
 
67
- - If a tool reports a project isn't indexed (no \`.homegraph/\`), stop calling homegraph tools for that project for the rest of the session and use your built-in tools there instead. Indexing is the user's decision — mention they can run \`homegraph init\` if it comes up, but don't run it yourself.
68
- - Index lags file writes by ~1 second.
69
- - Cross-file resolution is best-effort name matching; ambiguous calls may return multiple candidates.
70
- - No live correctness validation — that's still the TypeScript compiler / test suite / linter's job. HomeGraph supplements those with structural context they don't have.
71
- `;
72
- /**
73
- * Instructions variant sent when the server's own root has NO homegraph index.
74
- *
75
- * The tools are still exposed (gating tool availability on whether `./` has an
76
- * index is the bug behind #964: it breaks monorepos where only sub-projects are
77
- * indexed, and a server that started before `homegraph init` never surfaces the
78
- * tools afterward). Instead of an "inactive" note, this variant tells the agent
79
- * homegraph works **per project**: there's no default project to query, so pass
80
- * a `projectPath` to any project that HAS a `.homegraph/`. The full single-
81
- * project playbook ({@link SERVER_INSTRUCTIONS}) is sent instead when the root
82
- * IS indexed, so the common case stays tight.
83
- */
84
- exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — available (per-project; pass projectPath)
35
+ ## Tool roles
85
36
 
86
- HomeGraph is a SQLite knowledge graph of a codebase's symbols, edges, and
87
- files: one \`homegraph_explore\` call returns the verbatim, line-numbered source
88
- of the relevant symbols PLUS the call paths between them and a blast-radius
89
- summary replacing a grep + Read loop with one round-trip.
37
+ | Tool | Role |
38
+ |------|------|
39
+ | **homegraph_explore** | Primary for the closed set above |
40
+ | homegraph_node | One known symbol body (or indexed file) after explore named it |
41
+ | homegraph_callers / callees | Compact edge lists for a named symbol |
42
+ | homegraph_search | Rare — unknown spelling only |
43
+ | homegraph_files | Folder tree only |
44
+
45
+ ## Tips
46
+
47
+ - **Deadline / partial** — success-shaped; retry ONE explore with the same names. Do not abandon to grep for those symbols.
48
+ - **Staleness banner** — Read only the listed edited files.
49
+ - **Not indexed** — built-in tools; user runs \`homegraph init\` — you do not.
50
+ `;
51
+ exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — per-project (pass projectPath)
90
52
 
91
- This server started somewhere with no \`.homegraph/\` of its own, so there is no
92
- default project — but the tools are available and work **per project**:
53
+ HomeGraph indexes a codebase into a symbol graph. Call it **only** for in-repo structural / flow / usage questions on a project that has \`.homegraph/\`. Pass that project as \`projectPath\`.
93
54
 
94
- - To query a project that HAS a \`.homegraph/\` index (e.g. a service inside a
95
- monorepo, or a second repo), pass its path as \`projectPath\` to
96
- \`homegraph_explore\` (and any other homegraph tool). HomeGraph resolves the
97
- nearest \`.homegraph/\` at or above that path and answers from it — for as many
98
- projects as you like in one session.
99
- - For a project with no \`.homegraph/\`, use your built-in tools (Read/Grep/Glob)
100
- for that project. Indexing is the user's decision — don't run it yourself, but
101
- if it comes up they can run \`homegraph init\` in a project to enable homegraph
102
- there (a new index is picked up live, no restart).
55
+ - Fits the closed set (structure, callers, wiring, named symbol/file) \`homegraph_explore\`
56
+ - Anything else Read/Grep/Glob **do not call homegraph_***
57
+ - No index Read/Grep/Glob; user runs \`homegraph init\` if they want indexing
103
58
  `;
104
59
  //# sourceMappingURL=server-instructions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDlC,CAAC;AAEF;;;;;;;;;;;GAWG;AACU,QAAA,iCAAiC,GAAG;;;;;;;;;;;;;;;;;;;CAmBhD,CAAC"}
1
+ {"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../../src/mcp/server-instructions.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEU,QAAA,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwClC,CAAC;AAEW,QAAA,iCAAiC,GAAG;;;;;;;CAOhD,CAAC"}
@@ -21,6 +21,20 @@ export declare const SERVER_INFO: {
21
21
  name: string;
22
22
  version: string;
23
23
  };
24
+ /**
25
+ * Instructions for the `initialize` response, with the update-availability
26
+ * notice appended when one is known (#1243). Exported so the proxy's local
27
+ * handshake sends the IDENTICAL payload — same convention as SERVER_INFO.
28
+ * `getUpdateNotice` is a memoized synchronous cache read, so the #172
29
+ * respond-fast contract holds; when no notice exists the instructions are
30
+ * byte-identical to the bare constants.
31
+ *
32
+ * Test-authoring note: on a machine whose real `~/.homegraph` cache knows a
33
+ * newer release, spawned servers append the notice — a test asserting exact
34
+ * instructions equality must set `HOMEGRAPH_NO_UPDATE_CHECK=1` in the spawn
35
+ * env or it will fail only in the weeks after a release ships.
36
+ */
37
+ export declare function initializeInstructions(base: string, notice?: string | null): string;
24
38
  /** MCP Protocol Version (latest the server claims). */
25
39
  export declare const PROTOCOL_VERSION = "2024-11-05";
26
40
  export interface MCPSessionOptions {
@@ -1 +1 @@
1
- {"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAuC,gBAAgB,EAAc,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAOrC;;;GAGG;AAGH,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAmC7C,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AAED;;;GAGG;AACH,qBAAa,UAAU;IASnB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,MAAM;IAThB,OAAO,CAAC,mBAAmB,CAAS;IACpC,kFAAkF;IAClF,OAAO,CAAC,UAAU,CAAyB;IAC3C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,mBAAmB,CAAgB;gBAGjC,SAAS,EAAE,gBAAgB,EAC3B,MAAM,EAAE,SAAS,EACzB,IAAI,GAAE,iBAAsB;IAK9B;;;OAG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;YA0Cb,gBAAgB;YA0DhB,eAAe;YAkBf,eAAe;IAoC7B;;;;;;;OAOG;YACW,iBAAiB;IAyB/B;;;OAGG;YACW,aAAa;CAgB5B"}
@@ -47,6 +47,7 @@ var __importStar = (this && this.__importStar) || (function () {
47
47
  })();
48
48
  Object.defineProperty(exports, "__esModule", { value: true });
49
49
  exports.MCPSession = exports.PROTOCOL_VERSION = exports.SERVER_INFO = void 0;
50
+ exports.initializeInstructions = initializeInstructions;
50
51
  const path = __importStar(require("path"));
51
52
  const transport_1 = require("./transport");
52
53
  const tools_1 = require("./tools");
@@ -54,6 +55,7 @@ const server_instructions_1 = require("./server-instructions");
54
55
  const version_1 = require("./version");
55
56
  const directory_1 = require("../directory");
56
57
  const telemetry_1 = require("../telemetry");
58
+ const update_check_1 = require("../upgrade/update-check");
57
59
  /**
58
60
  * MCP Server Info — kept on the session because some clients log it. The
59
61
  * version tracks the real package version (was a hard-coded '0.1.0').
@@ -64,6 +66,25 @@ exports.SERVER_INFO = {
64
66
  name: 'homegraph',
65
67
  version: version_1.HomeGraphPackageVersion,
66
68
  };
69
+ /**
70
+ * Instructions for the `initialize` response, with the update-availability
71
+ * notice appended when one is known (#1243). Exported so the proxy's local
72
+ * handshake sends the IDENTICAL payload — same convention as SERVER_INFO.
73
+ * `getUpdateNotice` is a memoized synchronous cache read, so the #172
74
+ * respond-fast contract holds; when no notice exists the instructions are
75
+ * byte-identical to the bare constants.
76
+ *
77
+ * Test-authoring note: on a machine whose real `~/.homegraph` cache knows a
78
+ * newer release, spawned servers append the notice — a test asserting exact
79
+ * instructions equality must set `HOMEGRAPH_NO_UPDATE_CHECK=1` in the spawn
80
+ * env or it will fail only in the weeks after a release ships.
81
+ */
82
+ function initializeInstructions(base, notice = (0, update_check_1.getUpdateNotice)()) {
83
+ if (!notice)
84
+ return base;
85
+ return (`${base}\n\n---\n${notice} This server keeps running the old version until ` +
86
+ `the user upgrades — mention it when convenient; do not run the upgrade yourself.`);
87
+ }
67
88
  /** MCP Protocol Version (latest the server claims). */
68
89
  exports.PROTOCOL_VERSION = '2024-11-05';
69
90
  /**
@@ -220,7 +241,7 @@ class MCPSession {
220
241
  protocolVersion: exports.PROTOCOL_VERSION,
221
242
  capabilities: { tools: {} },
222
243
  serverInfo: exports.SERVER_INFO,
223
- instructions: indexed ? server_instructions_1.SERVER_INSTRUCTIONS : server_instructions_1.SERVER_INSTRUCTIONS_NO_ROOT_INDEX,
244
+ instructions: initializeInstructions(indexed ? server_instructions_1.SERVER_INSTRUCTIONS : server_instructions_1.SERVER_INSTRUCTIONS_NO_ROOT_INDEX),
224
245
  });
225
246
  if (explicitPath) {
226
247
  // Kick off engine init in the background. If another session in the
@@ -259,8 +280,14 @@ class MCPSession {
259
280
  this.transport.sendError(request.id, transport_1.ErrorCodes.InvalidParams, `Unknown tool: ${toolName}`);
260
281
  return;
261
282
  }
283
+ if (process.env.HOMEGRAPH_MCP_DEBUG)
284
+ process.stderr.write(`[mcp-debug] toolsCall ${toolName} id=${String(request.id)} pre-init\n`);
262
285
  await this.retryInitIfNeeded();
286
+ if (process.env.HOMEGRAPH_MCP_DEBUG)
287
+ process.stderr.write(`[mcp-debug] toolsCall ${toolName} id=${String(request.id)} dispatch\n`);
263
288
  const result = await this.engine.getToolHandler().execute(toolName, toolArgs);
289
+ if (process.env.HOMEGRAPH_MCP_DEBUG)
290
+ process.stderr.write(`[mcp-debug] toolsCall ${toolName} id=${String(request.id)} done\n`);
264
291
  this.transport.sendResult(request.id, result);
265
292
  // After the reply is on the wire — telemetry must never delay a tool
266
293
  // response (in-memory increment only; see src/telemetry).
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/mcp/session.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAC7B,2CAAgG;AAEhG,mCAAgC;AAChC,+DAA+F;AAC/F,uCAAoD;AACpD,4CAAwD;AACxD,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,OAAO,CAAC,GAAG,EAAE,CAAC;QACxC,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC;IAED;;;OAGG;IACK,KAAK,CAAC,aAAa;QACzB,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC3B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,YAAY,EAAE,SAAS,EAAE,qBAAqB,CAAC,CAAC;YAC5F,MAAM,QAAQ,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;YACvC,IAAI,QAAQ,EAAE,CAAC;gBACb,MAAM,GAAG,QAAQ,CAAC;YACpB,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;YAC7G,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8CAA8C,GAAG,mCAAmC,CAAC,CAAC;QAC7G,CAAC;QACD,MAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC9C,CAAC;CACF;AApPD,gCAoPC"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Never-initialized backstop for `serve --mcp` (#1185).
3
+ *
4
+ * Every real MCP host sends `initialize` immediately after spawning a server.
5
+ * A server that has received NO bytes at all for many minutes is not serving
6
+ * anyone — it is the residue of an abandoned launch: the host killed the
7
+ * launcher chain during startup (config probe, instant cancel, initialize
8
+ * timeout) but kept our stdio pipe fds open, so stdin never EOFs. If the kill
9
+ * landed before {@link ../mcp/early-ppid} could observe the real parent, the
10
+ * PPID watchdog is blind too (baseline `1`), and — pre-#1185 — the orphan
11
+ * lived until the HOST process exited, accumulating one ~30MB node process
12
+ * per occurrence.
13
+ *
14
+ * This backstop closes that last hole: arm a one-shot timer at serve start
15
+ * and disarm it on the first byte of client traffic. If the timer fires, the
16
+ * caller shuts the server down. The default is deliberately generous (15
17
+ * minutes) — hosts initialize within milliseconds, so the only processes this
18
+ * ever reaps are ones nobody is talking to. It never affects a session that
19
+ * spoke even once: after the first byte the timer is gone for good (a
20
+ * quiet-but-live session is the PPID watchdog's / stdin teardown's job).
21
+ *
22
+ * IMPORTANT (callers): attaching a `'data'` listener switches the stream into
23
+ * flowing mode. Arm this AFTER the real stdin consumer is attached, in the
24
+ * same synchronous block, so no early bytes are emitted while only our
25
+ * listener exists. The detached daemon must never arm this — its stdin is
26
+ * `'ignore'` and its lifecycle is refcount/idle-based.
27
+ *
28
+ * Tune with `HOMEGRAPH_STARTUP_HANDSHAKE_TIMEOUT_MS`; `0` disables.
29
+ */
30
+ /** Default wait for the first byte of MCP traffic before assuming orphaned. */
31
+ export declare const DEFAULT_STARTUP_HANDSHAKE_TIMEOUT_MS = 900000;
32
+ export declare const STARTUP_HANDSHAKE_TIMEOUT_ENV = "HOMEGRAPH_STARTUP_HANDSHAKE_TIMEOUT_MS";
33
+ /**
34
+ * Parse the timeout env override. Missing/invalid → default; `<= 0` → `0`
35
+ * (disabled), the same disable convention as `HOMEGRAPH_PPID_POLL_MS`.
36
+ */
37
+ export declare function parseStartupHandshakeTimeoutMs(raw: string | undefined): number;
38
+ /**
39
+ * Arm the backstop. `onAbandoned` runs at most once, only if no `'data'` event
40
+ * arrives on `stream` within the timeout. Returns a disarm function (idempotent;
41
+ * also detaches the listener). `stream`/`timeoutMs` are injectable for tests.
42
+ */
43
+ export declare function armStartupHandshakeTimeout(onAbandoned: () => void, stream?: NodeJS.ReadableStream, timeoutMs?: number): () => void;
44
+ //# sourceMappingURL=startup-handshake.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup-handshake.d.ts","sourceRoot":"","sources":["../../src/mcp/startup-handshake.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,+EAA+E;AAC/E,eAAO,MAAM,oCAAoC,SAAU,CAAC;AAE5D,eAAO,MAAM,6BAA6B,2CAA2C,CAAC;AAEtF;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAM9E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,IAAI,EACvB,MAAM,GAAE,MAAM,CAAC,cAA8B,EAC7C,SAAS,GAAE,MAAmF,GAC7F,MAAM,IAAI,CAcZ"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * Never-initialized backstop for `serve --mcp` (#1185).
4
+ *
5
+ * Every real MCP host sends `initialize` immediately after spawning a server.
6
+ * A server that has received NO bytes at all for many minutes is not serving
7
+ * anyone — it is the residue of an abandoned launch: the host killed the
8
+ * launcher chain during startup (config probe, instant cancel, initialize
9
+ * timeout) but kept our stdio pipe fds open, so stdin never EOFs. If the kill
10
+ * landed before {@link ../mcp/early-ppid} could observe the real parent, the
11
+ * PPID watchdog is blind too (baseline `1`), and — pre-#1185 — the orphan
12
+ * lived until the HOST process exited, accumulating one ~30MB node process
13
+ * per occurrence.
14
+ *
15
+ * This backstop closes that last hole: arm a one-shot timer at serve start
16
+ * and disarm it on the first byte of client traffic. If the timer fires, the
17
+ * caller shuts the server down. The default is deliberately generous (15
18
+ * minutes) — hosts initialize within milliseconds, so the only processes this
19
+ * ever reaps are ones nobody is talking to. It never affects a session that
20
+ * spoke even once: after the first byte the timer is gone for good (a
21
+ * quiet-but-live session is the PPID watchdog's / stdin teardown's job).
22
+ *
23
+ * IMPORTANT (callers): attaching a `'data'` listener switches the stream into
24
+ * flowing mode. Arm this AFTER the real stdin consumer is attached, in the
25
+ * same synchronous block, so no early bytes are emitted while only our
26
+ * listener exists. The detached daemon must never arm this — its stdin is
27
+ * `'ignore'` and its lifecycle is refcount/idle-based.
28
+ *
29
+ * Tune with `HOMEGRAPH_STARTUP_HANDSHAKE_TIMEOUT_MS`; `0` disables.
30
+ */
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ exports.STARTUP_HANDSHAKE_TIMEOUT_ENV = exports.DEFAULT_STARTUP_HANDSHAKE_TIMEOUT_MS = void 0;
33
+ exports.parseStartupHandshakeTimeoutMs = parseStartupHandshakeTimeoutMs;
34
+ exports.armStartupHandshakeTimeout = armStartupHandshakeTimeout;
35
+ /** Default wait for the first byte of MCP traffic before assuming orphaned. */
36
+ exports.DEFAULT_STARTUP_HANDSHAKE_TIMEOUT_MS = 900_000; // 15 min
37
+ exports.STARTUP_HANDSHAKE_TIMEOUT_ENV = 'HOMEGRAPH_STARTUP_HANDSHAKE_TIMEOUT_MS';
38
+ /**
39
+ * Parse the timeout env override. Missing/invalid → default; `<= 0` → `0`
40
+ * (disabled), the same disable convention as `HOMEGRAPH_PPID_POLL_MS`.
41
+ */
42
+ function parseStartupHandshakeTimeoutMs(raw) {
43
+ if (raw === undefined || raw === '')
44
+ return exports.DEFAULT_STARTUP_HANDSHAKE_TIMEOUT_MS;
45
+ const parsed = Number(raw);
46
+ if (!Number.isFinite(parsed))
47
+ return exports.DEFAULT_STARTUP_HANDSHAKE_TIMEOUT_MS;
48
+ if (parsed <= 0)
49
+ return 0;
50
+ return Math.floor(parsed);
51
+ }
52
+ /**
53
+ * Arm the backstop. `onAbandoned` runs at most once, only if no `'data'` event
54
+ * arrives on `stream` within the timeout. Returns a disarm function (idempotent;
55
+ * also detaches the listener). `stream`/`timeoutMs` are injectable for tests.
56
+ */
57
+ function armStartupHandshakeTimeout(onAbandoned, stream = process.stdin, timeoutMs = parseStartupHandshakeTimeoutMs(process.env[exports.STARTUP_HANDSHAKE_TIMEOUT_ENV])) {
58
+ if (timeoutMs <= 0)
59
+ return () => { };
60
+ const onFirstData = () => { clearTimeout(timer); };
61
+ const timer = setTimeout(() => {
62
+ stream.removeListener('data', onFirstData);
63
+ onAbandoned();
64
+ }, timeoutMs);
65
+ // Never let the backstop itself keep an otherwise-finished process alive.
66
+ timer.unref?.();
67
+ stream.once('data', onFirstData);
68
+ return () => {
69
+ stream.removeListener('data', onFirstData);
70
+ clearTimeout(timer);
71
+ };
72
+ }
73
+ //# sourceMappingURL=startup-handshake.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startup-handshake.js","sourceRoot":"","sources":["../../src/mcp/startup-handshake.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;AAWH,wEAMC;AAOD,gEAkBC;AAxCD,+EAA+E;AAClE,QAAA,oCAAoC,GAAG,OAAO,CAAC,CAAC,SAAS;AAEzD,QAAA,6BAA6B,GAAG,wCAAwC,CAAC;AAEtF;;;GAGG;AACH,SAAgB,8BAA8B,CAAC,GAAuB;IACpE,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,4CAAoC,CAAC;IACjF,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,4CAAoC,CAAC;IAC1E,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AAED;;;;GAIG;AACH,SAAgB,0BAA0B,CACxC,WAAuB,EACvB,SAAgC,OAAO,CAAC,KAAK,EAC7C,YAAoB,8BAA8B,CAAC,OAAO,CAAC,GAAG,CAAC,qCAA6B,CAAC,CAAC;IAE9F,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,GAAG,EAAE,GAAkB,CAAC,CAAC;IACpD,MAAM,WAAW,GAAG,GAAS,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAA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