homegraph 1.5.7 → 1.5.8

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 (550) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +2 -2
  3. package/dist/bin/homegraph.js +16 -14
  4. package/dist/db/index.d.ts +1 -1
  5. package/dist/db/index.js +11 -25
  6. package/dist/db/queries.d.ts +5 -1
  7. package/dist/db/queries.js +31 -2
  8. package/dist/db/sqlite-adapter.d.ts +6 -12
  9. package/dist/db/sqlite-adapter.js +13 -41
  10. package/dist/directory.d.ts +1 -1
  11. package/dist/directory.js +25 -1
  12. package/dist/extraction/grammars.d.ts +2 -0
  13. package/dist/extraction/grammars.js +7 -7
  14. package/dist/graph/evidence-paths.d.ts +63 -0
  15. package/dist/graph/evidence-paths.js +245 -0
  16. package/dist/index.d.ts +6 -1
  17. package/dist/index.js +55 -17
  18. package/dist/mcp/arkts-evidence-packs.d.ts +67 -0
  19. package/dist/mcp/arkts-evidence-packs.js +352 -0
  20. package/dist/mcp/daemon.js +1 -1
  21. package/dist/mcp/engine.d.ts +20 -7
  22. package/dist/mcp/engine.js +113 -106
  23. package/dist/mcp/index-availability.d.ts +23 -0
  24. package/dist/mcp/index-availability.js +78 -0
  25. package/dist/mcp/index.js +5 -4
  26. package/dist/mcp/query-cache.d.ts +1 -1
  27. package/dist/mcp/query-cache.js +6 -2
  28. package/dist/mcp/query-worker.d.ts +1 -1
  29. package/dist/mcp/query-worker.js +1 -1
  30. package/dist/mcp/server-instructions.d.ts +4 -9
  31. package/dist/mcp/server-instructions.js +34 -74
  32. package/dist/mcp/session.js +12 -4
  33. package/dist/mcp/source-slice-identity.d.ts +3 -0
  34. package/dist/mcp/source-slice-identity.js +11 -0
  35. package/dist/mcp/tools.d.ts +24 -6
  36. package/dist/mcp/tools.js +201 -80
  37. package/dist/spec/llm/client.js +3 -15
  38. package/dist/spec/llm/openai-sdk.d.ts +14 -0
  39. package/dist/spec/llm/openai-sdk.js +37 -0
  40. package/dist/spec/llm/retry.js +8 -9
  41. package/dist/utils.d.ts +5 -0
  42. package/dist/utils.js +24 -0
  43. package/package.json +3 -5
  44. package/dist/addons/dynamic-import.d.ts.map +0 -1
  45. package/dist/addons/dynamic-import.js.map +0 -1
  46. package/dist/addons/init-template.d.ts.map +0 -1
  47. package/dist/addons/init-template.js.map +0 -1
  48. package/dist/addons/loader.d.ts.map +0 -1
  49. package/dist/addons/loader.js.map +0 -1
  50. package/dist/addons/manager.d.ts.map +0 -1
  51. package/dist/addons/manager.js.map +0 -1
  52. package/dist/addons/paths.d.ts.map +0 -1
  53. package/dist/addons/paths.js.map +0 -1
  54. package/dist/addons/registry.d.ts.map +0 -1
  55. package/dist/addons/registry.js.map +0 -1
  56. package/dist/addons/semver.d.ts.map +0 -1
  57. package/dist/addons/semver.js.map +0 -1
  58. package/dist/addons/types.d.ts.map +0 -1
  59. package/dist/addons/types.js.map +0 -1
  60. package/dist/addons/validate.d.ts.map +0 -1
  61. package/dist/addons/validate.js.map +0 -1
  62. package/dist/arkui/index.d.ts.map +0 -1
  63. package/dist/arkui/index.js.map +0 -1
  64. package/dist/arkui/migrate-passage.d.ts.map +0 -1
  65. package/dist/arkui/migrate-passage.js.map +0 -1
  66. package/dist/arkui/migrate-semantics.d.ts.map +0 -1
  67. package/dist/arkui/migrate-semantics.js.map +0 -1
  68. package/dist/arkui/migrate-snapshot.d.ts.map +0 -1
  69. package/dist/arkui/migrate-snapshot.js.map +0 -1
  70. package/dist/bin/addon-commands.d.ts.map +0 -1
  71. package/dist/bin/addon-commands.js.map +0 -1
  72. package/dist/bin/command-supervision.d.ts.map +0 -1
  73. package/dist/bin/command-supervision.js.map +0 -1
  74. package/dist/bin/fatal-handler.d.ts.map +0 -1
  75. package/dist/bin/fatal-handler.js.map +0 -1
  76. package/dist/bin/homegraph.d.ts.map +0 -1
  77. package/dist/bin/homegraph.js.map +0 -1
  78. package/dist/bin/node-version-check.d.ts.map +0 -1
  79. package/dist/bin/node-version-check.js.map +0 -1
  80. package/dist/bin/uninstall.d.ts.map +0 -1
  81. package/dist/bin/uninstall.js.map +0 -1
  82. package/dist/context/formatter.d.ts.map +0 -1
  83. package/dist/context/formatter.js.map +0 -1
  84. package/dist/context/index.d.ts.map +0 -1
  85. package/dist/context/index.js.map +0 -1
  86. package/dist/context/markers.d.ts.map +0 -1
  87. package/dist/context/markers.js.map +0 -1
  88. package/dist/db/index.d.ts.map +0 -1
  89. package/dist/db/index.js.map +0 -1
  90. package/dist/db/migrations.d.ts.map +0 -1
  91. package/dist/db/migrations.js.map +0 -1
  92. package/dist/db/queries.d.ts.map +0 -1
  93. package/dist/db/queries.js.map +0 -1
  94. package/dist/db/sqlite-adapter.d.ts.map +0 -1
  95. package/dist/db/sqlite-adapter.js.map +0 -1
  96. package/dist/db/wal-valve.d.ts.map +0 -1
  97. package/dist/db/wal-valve.js.map +0 -1
  98. package/dist/directory.d.ts.map +0 -1
  99. package/dist/directory.js.map +0 -1
  100. package/dist/errors.d.ts.map +0 -1
  101. package/dist/errors.js.map +0 -1
  102. package/dist/extraction/arkts-batch-worker.d.ts.map +0 -1
  103. package/dist/extraction/arkts-batch-worker.js.map +0 -1
  104. package/dist/extraction/astro-extractor.d.ts.map +0 -1
  105. package/dist/extraction/astro-extractor.js.map +0 -1
  106. package/dist/extraction/cfml-extractor.d.ts.map +0 -1
  107. package/dist/extraction/cfml-extractor.js.map +0 -1
  108. package/dist/extraction/context.d.ts.map +0 -1
  109. package/dist/extraction/context.js.map +0 -1
  110. package/dist/extraction/default-ignore.d.ts.map +0 -1
  111. package/dist/extraction/default-ignore.js.map +0 -1
  112. package/dist/extraction/dfm-extractor.d.ts.map +0 -1
  113. package/dist/extraction/dfm-extractor.js.map +0 -1
  114. package/dist/extraction/extraction-version.d.ts.map +0 -1
  115. package/dist/extraction/extraction-version.js.map +0 -1
  116. package/dist/extraction/function-ref.d.ts.map +0 -1
  117. package/dist/extraction/function-ref.js.map +0 -1
  118. package/dist/extraction/generated-detection.d.ts.map +0 -1
  119. package/dist/extraction/generated-detection.js.map +0 -1
  120. package/dist/extraction/grammars.d.ts.map +0 -1
  121. package/dist/extraction/grammars.js.map +0 -1
  122. package/dist/extraction/index.d.ts.map +0 -1
  123. package/dist/extraction/index.js.map +0 -1
  124. package/dist/extraction/languages/arkts.d.ts.map +0 -1
  125. package/dist/extraction/languages/arkts.js.map +0 -1
  126. package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
  127. package/dist/extraction/languages/c-cpp.js.map +0 -1
  128. package/dist/extraction/languages/cfquery.d.ts.map +0 -1
  129. package/dist/extraction/languages/cfquery.js.map +0 -1
  130. package/dist/extraction/languages/cfscript.d.ts.map +0 -1
  131. package/dist/extraction/languages/cfscript.js.map +0 -1
  132. package/dist/extraction/languages/cobol.d.ts.map +0 -1
  133. package/dist/extraction/languages/cobol.js.map +0 -1
  134. package/dist/extraction/languages/csharp.d.ts.map +0 -1
  135. package/dist/extraction/languages/csharp.js.map +0 -1
  136. package/dist/extraction/languages/dart.d.ts.map +0 -1
  137. package/dist/extraction/languages/dart.js.map +0 -1
  138. package/dist/extraction/languages/erlang.d.ts.map +0 -1
  139. package/dist/extraction/languages/erlang.js.map +0 -1
  140. package/dist/extraction/languages/go.d.ts.map +0 -1
  141. package/dist/extraction/languages/go.js.map +0 -1
  142. package/dist/extraction/languages/index.d.ts.map +0 -1
  143. package/dist/extraction/languages/index.js.map +0 -1
  144. package/dist/extraction/languages/java.d.ts.map +0 -1
  145. package/dist/extraction/languages/java.js.map +0 -1
  146. package/dist/extraction/languages/javascript.d.ts.map +0 -1
  147. package/dist/extraction/languages/javascript.js.map +0 -1
  148. package/dist/extraction/languages/kotlin.d.ts.map +0 -1
  149. package/dist/extraction/languages/kotlin.js.map +0 -1
  150. package/dist/extraction/languages/lua.d.ts.map +0 -1
  151. package/dist/extraction/languages/lua.js.map +0 -1
  152. package/dist/extraction/languages/luau.d.ts.map +0 -1
  153. package/dist/extraction/languages/luau.js.map +0 -1
  154. package/dist/extraction/languages/nix.d.ts.map +0 -1
  155. package/dist/extraction/languages/nix.js.map +0 -1
  156. package/dist/extraction/languages/objc.d.ts.map +0 -1
  157. package/dist/extraction/languages/objc.js.map +0 -1
  158. package/dist/extraction/languages/pascal.d.ts.map +0 -1
  159. package/dist/extraction/languages/pascal.js.map +0 -1
  160. package/dist/extraction/languages/php.d.ts.map +0 -1
  161. package/dist/extraction/languages/php.js.map +0 -1
  162. package/dist/extraction/languages/python.d.ts.map +0 -1
  163. package/dist/extraction/languages/python.js.map +0 -1
  164. package/dist/extraction/languages/r.d.ts.map +0 -1
  165. package/dist/extraction/languages/r.js.map +0 -1
  166. package/dist/extraction/languages/ruby.d.ts.map +0 -1
  167. package/dist/extraction/languages/ruby.js.map +0 -1
  168. package/dist/extraction/languages/rust.d.ts.map +0 -1
  169. package/dist/extraction/languages/rust.js.map +0 -1
  170. package/dist/extraction/languages/scala.d.ts.map +0 -1
  171. package/dist/extraction/languages/scala.js.map +0 -1
  172. package/dist/extraction/languages/solidity.d.ts.map +0 -1
  173. package/dist/extraction/languages/solidity.js.map +0 -1
  174. package/dist/extraction/languages/swift.d.ts.map +0 -1
  175. package/dist/extraction/languages/swift.js.map +0 -1
  176. package/dist/extraction/languages/terraform.d.ts.map +0 -1
  177. package/dist/extraction/languages/terraform.js.map +0 -1
  178. package/dist/extraction/languages/typescript.d.ts.map +0 -1
  179. package/dist/extraction/languages/typescript.js.map +0 -1
  180. package/dist/extraction/languages/vbnet.d.ts.map +0 -1
  181. package/dist/extraction/languages/vbnet.js.map +0 -1
  182. package/dist/extraction/liquid-extractor.d.ts.map +0 -1
  183. package/dist/extraction/liquid-extractor.js.map +0 -1
  184. package/dist/extraction/mybatis-extractor.d.ts.map +0 -1
  185. package/dist/extraction/mybatis-extractor.js.map +0 -1
  186. package/dist/extraction/parse-pool.d.ts.map +0 -1
  187. package/dist/extraction/parse-pool.js.map +0 -1
  188. package/dist/extraction/parse-worker.d.ts.map +0 -1
  189. package/dist/extraction/parse-worker.js.map +0 -1
  190. package/dist/extraction/razor-extractor.d.ts.map +0 -1
  191. package/dist/extraction/razor-extractor.js.map +0 -1
  192. package/dist/extraction/store-worker.d.ts.map +0 -1
  193. package/dist/extraction/store-worker.js.map +0 -1
  194. package/dist/extraction/store-writer.d.ts.map +0 -1
  195. package/dist/extraction/store-writer.js.map +0 -1
  196. package/dist/extraction/svelte-extractor.d.ts.map +0 -1
  197. package/dist/extraction/svelte-extractor.js.map +0 -1
  198. package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
  199. package/dist/extraction/tree-sitter-helpers.js.map +0 -1
  200. package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
  201. package/dist/extraction/tree-sitter-types.js.map +0 -1
  202. package/dist/extraction/tree-sitter.d.ts.map +0 -1
  203. package/dist/extraction/tree-sitter.js.map +0 -1
  204. package/dist/extraction/vue-extractor.d.ts.map +0 -1
  205. package/dist/extraction/vue-extractor.js.map +0 -1
  206. package/dist/extraction/wasm/tree-sitter-arkts.wasm +0 -0
  207. package/dist/extraction/wasm-runtime-flags.d.ts.map +0 -1
  208. package/dist/extraction/wasm-runtime-flags.js.map +0 -1
  209. package/dist/graph/index.d.ts.map +0 -1
  210. package/dist/graph/index.js.map +0 -1
  211. package/dist/graph/queries.d.ts.map +0 -1
  212. package/dist/graph/queries.js.map +0 -1
  213. package/dist/graph/traversal.d.ts.map +0 -1
  214. package/dist/graph/traversal.js.map +0 -1
  215. package/dist/graph-sources.d.ts.map +0 -1
  216. package/dist/graph-sources.js.map +0 -1
  217. package/dist/index.d.ts.map +0 -1
  218. package/dist/index.js.map +0 -1
  219. package/dist/installer/config-writer.d.ts.map +0 -1
  220. package/dist/installer/config-writer.js.map +0 -1
  221. package/dist/installer/index.d.ts.map +0 -1
  222. package/dist/installer/index.js.map +0 -1
  223. package/dist/installer/instructions-template.d.ts.map +0 -1
  224. package/dist/installer/instructions-template.js.map +0 -1
  225. package/dist/installer/targets/antigravity.d.ts.map +0 -1
  226. package/dist/installer/targets/antigravity.js.map +0 -1
  227. package/dist/installer/targets/claude.d.ts.map +0 -1
  228. package/dist/installer/targets/claude.js.map +0 -1
  229. package/dist/installer/targets/codebuddy.d.ts.map +0 -1
  230. package/dist/installer/targets/codebuddy.js.map +0 -1
  231. package/dist/installer/targets/codex.d.ts.map +0 -1
  232. package/dist/installer/targets/codex.js.map +0 -1
  233. package/dist/installer/targets/cursor.d.ts.map +0 -1
  234. package/dist/installer/targets/cursor.js.map +0 -1
  235. package/dist/installer/targets/deveco.d.ts.map +0 -1
  236. package/dist/installer/targets/deveco.js.map +0 -1
  237. package/dist/installer/targets/gemini.d.ts.map +0 -1
  238. package/dist/installer/targets/gemini.js.map +0 -1
  239. package/dist/installer/targets/hermes.d.ts.map +0 -1
  240. package/dist/installer/targets/hermes.js.map +0 -1
  241. package/dist/installer/targets/kiro.d.ts.map +0 -1
  242. package/dist/installer/targets/kiro.js.map +0 -1
  243. package/dist/installer/targets/opencode.d.ts.map +0 -1
  244. package/dist/installer/targets/opencode.js.map +0 -1
  245. package/dist/installer/targets/registry.d.ts.map +0 -1
  246. package/dist/installer/targets/registry.js.map +0 -1
  247. package/dist/installer/targets/shared.d.ts.map +0 -1
  248. package/dist/installer/targets/shared.js.map +0 -1
  249. package/dist/installer/targets/toml.d.ts.map +0 -1
  250. package/dist/installer/targets/toml.js.map +0 -1
  251. package/dist/installer/targets/types.d.ts.map +0 -1
  252. package/dist/installer/targets/types.js.map +0 -1
  253. package/dist/mcp/daemon-manager.d.ts.map +0 -1
  254. package/dist/mcp/daemon-manager.js.map +0 -1
  255. package/dist/mcp/daemon-paths.d.ts.map +0 -1
  256. package/dist/mcp/daemon-paths.js.map +0 -1
  257. package/dist/mcp/daemon-registry.d.ts.map +0 -1
  258. package/dist/mcp/daemon-registry.js.map +0 -1
  259. package/dist/mcp/daemon.d.ts.map +0 -1
  260. package/dist/mcp/daemon.js.map +0 -1
  261. package/dist/mcp/diff-impact.d.ts.map +0 -1
  262. package/dist/mcp/diff-impact.js.map +0 -1
  263. package/dist/mcp/dynamic-boundaries.d.ts.map +0 -1
  264. package/dist/mcp/dynamic-boundaries.js.map +0 -1
  265. package/dist/mcp/early-ppid.d.ts.map +0 -1
  266. package/dist/mcp/early-ppid.js.map +0 -1
  267. package/dist/mcp/engine.d.ts.map +0 -1
  268. package/dist/mcp/engine.js.map +0 -1
  269. package/dist/mcp/evidence-rendering.d.ts.map +0 -1
  270. package/dist/mcp/evidence-rendering.js.map +0 -1
  271. package/dist/mcp/explore-dedup.d.ts.map +0 -1
  272. package/dist/mcp/explore-dedup.js.map +0 -1
  273. package/dist/mcp/explore-repeat-guard.d.ts.map +0 -1
  274. package/dist/mcp/explore-repeat-guard.js.map +0 -1
  275. package/dist/mcp/explore-session-state.d.ts.map +0 -1
  276. package/dist/mcp/explore-session-state.js.map +0 -1
  277. package/dist/mcp/index.d.ts.map +0 -1
  278. package/dist/mcp/index.js.map +0 -1
  279. package/dist/mcp/liveness-watchdog.d.ts.map +0 -1
  280. package/dist/mcp/liveness-watchdog.js.map +0 -1
  281. package/dist/mcp/memory-budget.d.ts.map +0 -1
  282. package/dist/mcp/memory-budget.js.map +0 -1
  283. package/dist/mcp/ppid-watchdog.d.ts.map +0 -1
  284. package/dist/mcp/ppid-watchdog.js.map +0 -1
  285. package/dist/mcp/proxy.d.ts.map +0 -1
  286. package/dist/mcp/proxy.js.map +0 -1
  287. package/dist/mcp/query-cache.d.ts.map +0 -1
  288. package/dist/mcp/query-cache.js.map +0 -1
  289. package/dist/mcp/query-pool.d.ts.map +0 -1
  290. package/dist/mcp/query-pool.js.map +0 -1
  291. package/dist/mcp/query-worker.d.ts.map +0 -1
  292. package/dist/mcp/query-worker.js.map +0 -1
  293. package/dist/mcp/server-instructions.d.ts.map +0 -1
  294. package/dist/mcp/server-instructions.js.map +0 -1
  295. package/dist/mcp/session.d.ts.map +0 -1
  296. package/dist/mcp/session.js.map +0 -1
  297. package/dist/mcp/startup-handshake.d.ts.map +0 -1
  298. package/dist/mcp/startup-handshake.js.map +0 -1
  299. package/dist/mcp/stdin-teardown.d.ts.map +0 -1
  300. package/dist/mcp/stdin-teardown.js.map +0 -1
  301. package/dist/mcp/tools.d.ts.map +0 -1
  302. package/dist/mcp/tools.js.map +0 -1
  303. package/dist/mcp/transport.d.ts.map +0 -1
  304. package/dist/mcp/transport.js.map +0 -1
  305. package/dist/mcp/version.d.ts.map +0 -1
  306. package/dist/mcp/version.js.map +0 -1
  307. package/dist/project-config.d.ts.map +0 -1
  308. package/dist/project-config.js.map +0 -1
  309. package/dist/project-map/index.d.ts.map +0 -1
  310. package/dist/project-map/index.js.map +0 -1
  311. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +0 -1
  312. package/dist/resolution/c-fnptr-synthesizer.js.map +0 -1
  313. package/dist/resolution/callback-synthesizer.d.ts.map +0 -1
  314. package/dist/resolution/callback-synthesizer.js.map +0 -1
  315. package/dist/resolution/cooperative-yield.d.ts.map +0 -1
  316. package/dist/resolution/cooperative-yield.js.map +0 -1
  317. package/dist/resolution/frameworks/arkts-entry.d.ts.map +0 -1
  318. package/dist/resolution/frameworks/arkts-entry.js.map +0 -1
  319. package/dist/resolution/frameworks/arkts-napi.d.ts.map +0 -1
  320. package/dist/resolution/frameworks/arkts-napi.js.map +0 -1
  321. package/dist/resolution/frameworks/astro.d.ts.map +0 -1
  322. package/dist/resolution/frameworks/astro.js.map +0 -1
  323. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
  324. package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
  325. package/dist/resolution/frameworks/cics.d.ts.map +0 -1
  326. package/dist/resolution/frameworks/cics.js.map +0 -1
  327. package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
  328. package/dist/resolution/frameworks/csharp.js.map +0 -1
  329. package/dist/resolution/frameworks/drupal.d.ts.map +0 -1
  330. package/dist/resolution/frameworks/drupal.js.map +0 -1
  331. package/dist/resolution/frameworks/expo-modules.d.ts.map +0 -1
  332. package/dist/resolution/frameworks/expo-modules.js.map +0 -1
  333. package/dist/resolution/frameworks/express.d.ts.map +0 -1
  334. package/dist/resolution/frameworks/express.js.map +0 -1
  335. package/dist/resolution/frameworks/fabric.d.ts.map +0 -1
  336. package/dist/resolution/frameworks/fabric.js.map +0 -1
  337. package/dist/resolution/frameworks/go.d.ts.map +0 -1
  338. package/dist/resolution/frameworks/go.js.map +0 -1
  339. package/dist/resolution/frameworks/goframe.d.ts.map +0 -1
  340. package/dist/resolution/frameworks/goframe.js.map +0 -1
  341. package/dist/resolution/frameworks/index.d.ts.map +0 -1
  342. package/dist/resolution/frameworks/index.js.map +0 -1
  343. package/dist/resolution/frameworks/java.d.ts.map +0 -1
  344. package/dist/resolution/frameworks/java.js.map +0 -1
  345. package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
  346. package/dist/resolution/frameworks/laravel.js.map +0 -1
  347. package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
  348. package/dist/resolution/frameworks/nestjs.js.map +0 -1
  349. package/dist/resolution/frameworks/play.d.ts.map +0 -1
  350. package/dist/resolution/frameworks/play.js.map +0 -1
  351. package/dist/resolution/frameworks/python.d.ts.map +0 -1
  352. package/dist/resolution/frameworks/python.js.map +0 -1
  353. package/dist/resolution/frameworks/react-native.d.ts.map +0 -1
  354. package/dist/resolution/frameworks/react-native.js.map +0 -1
  355. package/dist/resolution/frameworks/react.d.ts.map +0 -1
  356. package/dist/resolution/frameworks/react.js.map +0 -1
  357. package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
  358. package/dist/resolution/frameworks/ruby.js.map +0 -1
  359. package/dist/resolution/frameworks/rust.d.ts.map +0 -1
  360. package/dist/resolution/frameworks/rust.js.map +0 -1
  361. package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
  362. package/dist/resolution/frameworks/svelte.js.map +0 -1
  363. package/dist/resolution/frameworks/swift-objc.d.ts.map +0 -1
  364. package/dist/resolution/frameworks/swift-objc.js.map +0 -1
  365. package/dist/resolution/frameworks/swift.d.ts.map +0 -1
  366. package/dist/resolution/frameworks/swift.js.map +0 -1
  367. package/dist/resolution/frameworks/terraform.d.ts.map +0 -1
  368. package/dist/resolution/frameworks/terraform.js.map +0 -1
  369. package/dist/resolution/frameworks/vue.d.ts.map +0 -1
  370. package/dist/resolution/frameworks/vue.js.map +0 -1
  371. package/dist/resolution/go-module.d.ts.map +0 -1
  372. package/dist/resolution/go-module.js.map +0 -1
  373. package/dist/resolution/goframe-synthesizer.d.ts.map +0 -1
  374. package/dist/resolution/goframe-synthesizer.js.map +0 -1
  375. package/dist/resolution/import-resolver.d.ts.map +0 -1
  376. package/dist/resolution/import-resolver.js.map +0 -1
  377. package/dist/resolution/index.d.ts.map +0 -1
  378. package/dist/resolution/index.js.map +0 -1
  379. package/dist/resolution/lru-cache.d.ts.map +0 -1
  380. package/dist/resolution/lru-cache.js.map +0 -1
  381. package/dist/resolution/memory-budget.d.ts.map +0 -1
  382. package/dist/resolution/memory-budget.js.map +0 -1
  383. package/dist/resolution/name-matcher.d.ts.map +0 -1
  384. package/dist/resolution/name-matcher.js.map +0 -1
  385. package/dist/resolution/path-aliases.d.ts.map +0 -1
  386. package/dist/resolution/path-aliases.js.map +0 -1
  387. package/dist/resolution/resolver-pool.d.ts.map +0 -1
  388. package/dist/resolution/resolver-pool.js.map +0 -1
  389. package/dist/resolution/resolver-worker.d.ts.map +0 -1
  390. package/dist/resolution/resolver-worker.js.map +0 -1
  391. package/dist/resolution/strip-comments.d.ts.map +0 -1
  392. package/dist/resolution/strip-comments.js.map +0 -1
  393. package/dist/resolution/swift-objc-bridge.d.ts.map +0 -1
  394. package/dist/resolution/swift-objc-bridge.js.map +0 -1
  395. package/dist/resolution/types.d.ts.map +0 -1
  396. package/dist/resolution/types.js.map +0 -1
  397. package/dist/resolution/workspace-packages.d.ts.map +0 -1
  398. package/dist/resolution/workspace-packages.js.map +0 -1
  399. package/dist/search/identifier-segments.d.ts.map +0 -1
  400. package/dist/search/identifier-segments.js.map +0 -1
  401. package/dist/search/literal-evidence.d.ts.map +0 -1
  402. package/dist/search/literal-evidence.js.map +0 -1
  403. package/dist/search/query-parser.d.ts.map +0 -1
  404. package/dist/search/query-parser.js.map +0 -1
  405. package/dist/search/query-plan-provider.d.ts.map +0 -1
  406. package/dist/search/query-plan-provider.js.map +0 -1
  407. package/dist/search/query-plan.d.ts.map +0 -1
  408. package/dist/search/query-plan.js.map +0 -1
  409. package/dist/search/query-utils.d.ts.map +0 -1
  410. package/dist/search/query-utils.js.map +0 -1
  411. package/dist/spec/build/diff-parser.d.ts.map +0 -1
  412. package/dist/spec/build/diff-parser.js.map +0 -1
  413. package/dist/spec/build/pipeline.d.ts.map +0 -1
  414. package/dist/spec/build/pipeline.js.map +0 -1
  415. package/dist/spec/build/scan.d.ts.map +0 -1
  416. package/dist/spec/build/scan.js.map +0 -1
  417. package/dist/spec/build/scope-resolver.d.ts.map +0 -1
  418. package/dist/spec/build/scope-resolver.js.map +0 -1
  419. package/dist/spec/build/spec-extractor.d.ts.map +0 -1
  420. package/dist/spec/build/spec-extractor.js.map +0 -1
  421. package/dist/spec/config.d.ts.map +0 -1
  422. package/dist/spec/config.js.map +0 -1
  423. package/dist/spec/db/commit-node.d.ts.map +0 -1
  424. package/dist/spec/db/commit-node.js.map +0 -1
  425. package/dist/spec/db/fragment-node.d.ts.map +0 -1
  426. package/dist/spec/db/fragment-node.js.map +0 -1
  427. package/dist/spec/db/fts.d.ts.map +0 -1
  428. package/dist/spec/db/fts.js.map +0 -1
  429. package/dist/spec/db/index.d.ts.map +0 -1
  430. package/dist/spec/db/index.js.map +0 -1
  431. package/dist/spec/db/persist.d.ts.map +0 -1
  432. package/dist/spec/db/persist.js.map +0 -1
  433. package/dist/spec/db/relations.d.ts.map +0 -1
  434. package/dist/spec/db/relations.js.map +0 -1
  435. package/dist/spec/db/schema.d.ts.map +0 -1
  436. package/dist/spec/db/schema.js.map +0 -1
  437. package/dist/spec/db/spec-node.d.ts.map +0 -1
  438. package/dist/spec/db/spec-node.js.map +0 -1
  439. package/dist/spec/db/sql-utils.d.ts.map +0 -1
  440. package/dist/spec/db/sql-utils.js.map +0 -1
  441. package/dist/spec/evolve/cluster-context.d.ts.map +0 -1
  442. package/dist/spec/evolve/cluster-context.js.map +0 -1
  443. package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +0 -1
  444. package/dist/spec/evolve/commit-spec-analyzer.js.map +0 -1
  445. package/dist/spec/evolve/commit-spec-persister.d.ts.map +0 -1
  446. package/dist/spec/evolve/commit-spec-persister.js.map +0 -1
  447. package/dist/spec/evolve/impact-locator.d.ts.map +0 -1
  448. package/dist/spec/evolve/impact-locator.js.map +0 -1
  449. package/dist/spec/evolve/pipeline.d.ts.map +0 -1
  450. package/dist/spec/evolve/pipeline.js.map +0 -1
  451. package/dist/spec/evolve/spec-rewriter.d.ts.map +0 -1
  452. package/dist/spec/evolve/spec-rewriter.js.map +0 -1
  453. package/dist/spec/git/commits.d.ts.map +0 -1
  454. package/dist/spec/git/commits.js.map +0 -1
  455. package/dist/spec/git/exec.d.ts.map +0 -1
  456. package/dist/spec/git/exec.js.map +0 -1
  457. package/dist/spec/git/index.d.ts.map +0 -1
  458. package/dist/spec/git/index.js.map +0 -1
  459. package/dist/spec/graph/index.d.ts.map +0 -1
  460. package/dist/spec/graph/index.js.map +0 -1
  461. package/dist/spec/graph/queries.d.ts.map +0 -1
  462. package/dist/spec/graph/queries.js.map +0 -1
  463. package/dist/spec/llm/agent-client.d.ts.map +0 -1
  464. package/dist/spec/llm/agent-client.js.map +0 -1
  465. package/dist/spec/llm/agents/claude-code.d.ts.map +0 -1
  466. package/dist/spec/llm/agents/claude-code.js.map +0 -1
  467. package/dist/spec/llm/agents/codex.d.ts.map +0 -1
  468. package/dist/spec/llm/agents/codex.js.map +0 -1
  469. package/dist/spec/llm/agents/detect-utils.d.ts.map +0 -1
  470. package/dist/spec/llm/agents/detect-utils.js.map +0 -1
  471. package/dist/spec/llm/agents/deveco-code.d.ts.map +0 -1
  472. package/dist/spec/llm/agents/deveco-code.js.map +0 -1
  473. package/dist/spec/llm/agents/index.d.ts.map +0 -1
  474. package/dist/spec/llm/agents/index.js.map +0 -1
  475. package/dist/spec/llm/agents/types.d.ts.map +0 -1
  476. package/dist/spec/llm/agents/types.js.map +0 -1
  477. package/dist/spec/llm/client.d.ts.map +0 -1
  478. package/dist/spec/llm/client.js.map +0 -1
  479. package/dist/spec/llm/factory.d.ts.map +0 -1
  480. package/dist/spec/llm/factory.js.map +0 -1
  481. package/dist/spec/llm/prompts.d.ts.map +0 -1
  482. package/dist/spec/llm/prompts.js.map +0 -1
  483. package/dist/spec/llm/retry.d.ts.map +0 -1
  484. package/dist/spec/llm/retry.js.map +0 -1
  485. package/dist/spec/mine/addon/adapter.d.ts.map +0 -1
  486. package/dist/spec/mine/addon/adapter.js.map +0 -1
  487. package/dist/spec/mine/addon/render.d.ts.map +0 -1
  488. package/dist/spec/mine/addon/render.js.map +0 -1
  489. package/dist/spec/mine/addon/types.d.ts.map +0 -1
  490. package/dist/spec/mine/addon/types.js.map +0 -1
  491. package/dist/spec/mine/clustering/features.d.ts.map +0 -1
  492. package/dist/spec/mine/clustering/features.js.map +0 -1
  493. package/dist/spec/mine/clustering/index.d.ts.map +0 -1
  494. package/dist/spec/mine/clustering/index.js.map +0 -1
  495. package/dist/spec/mine/clustering/leiden.d.ts.map +0 -1
  496. package/dist/spec/mine/clustering/leiden.js.map +0 -1
  497. package/dist/spec/mine/clustering/text-similarity.d.ts.map +0 -1
  498. package/dist/spec/mine/clustering/text-similarity.js.map +0 -1
  499. package/dist/spec/mine/generator.d.ts.map +0 -1
  500. package/dist/spec/mine/generator.js.map +0 -1
  501. package/dist/spec/mine/persist.d.ts.map +0 -1
  502. package/dist/spec/mine/persist.js.map +0 -1
  503. package/dist/spec/mine/pipeline.d.ts.map +0 -1
  504. package/dist/spec/mine/pipeline.js.map +0 -1
  505. package/dist/spec/mine/scanner.d.ts.map +0 -1
  506. package/dist/spec/mine/scanner.js.map +0 -1
  507. package/dist/spec/types.d.ts.map +0 -1
  508. package/dist/spec/types.js.map +0 -1
  509. package/dist/spec/ui/index.d.ts.map +0 -1
  510. package/dist/spec/ui/index.js.map +0 -1
  511. package/dist/spec/ui/progress-handler.d.ts.map +0 -1
  512. package/dist/spec/ui/progress-handler.js.map +0 -1
  513. package/dist/spec/ui/progress.d.ts.map +0 -1
  514. package/dist/spec/ui/progress.js.map +0 -1
  515. package/dist/spec/utils/fs.d.ts.map +0 -1
  516. package/dist/spec/utils/fs.js.map +0 -1
  517. package/dist/spec/utils/index.d.ts.map +0 -1
  518. package/dist/spec/utils/index.js.map +0 -1
  519. package/dist/spec/utils/meta.d.ts.map +0 -1
  520. package/dist/spec/utils/meta.js.map +0 -1
  521. package/dist/spec/utils/truncate.d.ts.map +0 -1
  522. package/dist/spec/utils/truncate.js.map +0 -1
  523. package/dist/sync/git-hooks.d.ts.map +0 -1
  524. package/dist/sync/git-hooks.js.map +0 -1
  525. package/dist/sync/index.d.ts.map +0 -1
  526. package/dist/sync/index.js.map +0 -1
  527. package/dist/sync/watch-policy.d.ts.map +0 -1
  528. package/dist/sync/watch-policy.js.map +0 -1
  529. package/dist/sync/watcher.d.ts.map +0 -1
  530. package/dist/sync/watcher.js.map +0 -1
  531. package/dist/sync/worktree.d.ts.map +0 -1
  532. package/dist/sync/worktree.js.map +0 -1
  533. package/dist/types.d.ts.map +0 -1
  534. package/dist/types.js.map +0 -1
  535. package/dist/ui/glyphs.d.ts.map +0 -1
  536. package/dist/ui/glyphs.js.map +0 -1
  537. package/dist/ui/shimmer-progress.d.ts.map +0 -1
  538. package/dist/ui/shimmer-progress.js.map +0 -1
  539. package/dist/ui/shimmer-worker.d.ts.map +0 -1
  540. package/dist/ui/shimmer-worker.js.map +0 -1
  541. package/dist/ui/types.d.ts.map +0 -1
  542. package/dist/ui/types.js.map +0 -1
  543. package/dist/upgrade/index.d.ts.map +0 -1
  544. package/dist/upgrade/index.js.map +0 -1
  545. package/dist/upgrade/remove-binary.d.ts.map +0 -1
  546. package/dist/upgrade/remove-binary.js.map +0 -1
  547. package/dist/upgrade/update-check.d.ts.map +0 -1
  548. package/dist/upgrade/update-check.js.map +0 -1
  549. package/dist/utils.d.ts.map +0 -1
  550. package/dist/utils.js.map +0 -1
@@ -1,91 +1,51 @@
1
1
  "use strict";
2
2
  /**
3
- * Server-level instructions emitted in the MCP `initialize` response.
4
- *
5
- * Single source of truth for agent-facing tool guidance (issue #529).
6
- * Edit here — not installer prompts or eval harness prompts.
7
- *
8
- * Keep this short: long essays are low-salience and rarely change tool choice.
9
- * Prefer concrete habits (query shape, which tool, when to stop).
3
+ * MCP initialize 中的统一工具指引;工具描述必须遵守相同的按需策略。
4
+ * 仅调整检索选择,不改变索引、查询语义或编码任务的验收要求。
10
5
  */
11
6
  Object.defineProperty(exports, "__esModule", { value: true });
12
7
  exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = exports.SERVER_INSTRUCTIONS = void 0;
13
- exports.SERVER_INSTRUCTIONS = `# HomeGraph — structural locator for THIS repo
14
-
15
- Local symbol graph (defs / calls / imports / files). Use it to locate in-repo symbols (\`file:line\` + source), then continue the user's requested explanation, edits and validation. Retrieval completion is not task completion.
16
-
17
- ## When to call (path-first): choose exactly ONE first tool
18
-
19
- - User task already names an in-repo relative path to one source file and requests a code change → Read that file and edit (Skip HomeGraph).
20
- - Otherwise, use the narrow tool or explore below to locate the missing source evidence.
21
-
22
- Use the narrow tool when the task is exactly one of these inventories:
23
-
24
- - **Where is this named API/member/constant/field used?** → \`homegraph_usages\`
25
- - **How do these named modules depend on each other / is there a cycle?** → \`homegraph_modules\`
26
- - **Which NAPI/native exports or registration sites does this named path/Type expose?** → \`homegraph_native\`
27
-
28
- Otherwise, if you will **explain or edit in-repo code**, call \`homegraph_explore\` **once** with the user task as \`query\` (Chinese OK; add English Type / \`Type.member\` / \`@kit\` / \`@ohos\` tokens when known). Do not call explore after a focused tool already answered the inventory. Older clients that call explore still get the same focused handler through conservative compatibility routing.
29
-
30
- Engineering overview / module→file map (including while the full index is still building) → \`homegraph_project\`.
31
-
32
- Already know **one** exact symbol body or call direction? Prefer \`homegraph_callers\` / \`homegraph_callees\` / \`homegraph_node\`. Spelling unknown → \`homegraph_search\` last.
33
-
34
- **Prefer explore when locating (without a path-pinned single-file edit):** how/mechanism wiring, cross-Type/component behavior, \`.d.ts\` wrap flows, and general pre-edit orientation that is not one of the three narrow inventories above.
35
-
36
- ArkUI V1↔V2 / state-decorator migration on a named component → \`homegraph_arkui_migrate\` once (not explore stitching).
37
-
38
- ## How to write \`query\`
39
-
40
- - Preserve the task's intent, relation direction and scope; do not stuff keywords or invent symbols. For edits, include the requested action, target product/module, exclusions and acceptance requirements in query or optional taskContext. Do not replace a deletion/refactoring request with a bare component name. When optional query planning is enabled, explore can plan bounded dependent lookups internally; scoped natural-language queries can be planned even when a lexical route matches, while exact symbol/path lookups stay cheap. No extra tool or explicit depth tier is required. Planned subquestion evidence is not a completeness claim for the whole task.
41
- - Planned steps keep separate retrieval focuses. Located source candidates carry file/line identity, not proof that the intended business feature is correct; check them against the original task constraints before editing. A missing dependency is reported as unexecuted, not as evidence that the code does not exist.
42
- - Before editing, verify that the evidence belongs to the requested product/module and that referenced symbols actually exist. A project map is only navigation, not proof that a feature has been located. If source evidence is ambiguous or belongs to another product, use a bounded follow-up instead of editing that hit. Read-duplication guidance never forbids checks needed to avoid an incorrect edit.
43
- - Put **concrete anchors** in the bag: \`FooManager\`, \`BarEvent\`, \`Type.member\`, \`feature/foo\`, \`path/to/File.ets\`, \`@kit.X\`.
44
- - Map Chinese entities to English symbol stems when you can (\`设置\`→\`Setting\`, \`新建\`→\`New\`) — search/explore cluster \`Entity\` / \`EntityManager\` / \`EntityViewModel\`.
45
- - Keep **intent words** with the Type (\`来源\` / \`分发\` / \`依赖\` / \`NAPI\` / \`驱动\`) — bare Type alone may drop survey routing.
46
- - Multi-app monorepo: pass \`projectPath\` to the app root; ignore sibling-app paths as noise.
47
-
48
- ## After one explore
49
-
50
- - Digests concern named / hit files; unrelated neighboring pages are not required reading.
51
-
52
- - Reuse returned line-numbered source for the ranges actually shown. An outline, anchor, candidate list, truncated body or SDK declaration is not a substitute for missing business code.
53
- - Check source relevance and every requested change before editing. A retrieval status or completion banner never authorizes ending a coding task or skipping implementation and validation.
54
- - Empty, SDK-only or partial evidence → **one** bounded recovery aimed at the missing evidence. The suggested **Next anchor** is advisory; a newly scoped obligation may need another file or Type. One focused \`homegraph_node\`, \`homegraph_callers\` or \`homegraph_callees\` can recover a missing body or relation.
55
- - If evidence is still missing after the retrieval budget, inspect it with targeted Read/Grep and continue the requested work. Do not infer that the feature is absent or that the task is complete.
56
- - Busy/deadline → retry **once** tighter; then inspect the missing source directly.
57
-
58
- Prefer the smallest tool when the name is known and reuse unchanged evidence. Session budget: **≤2** \`homegraph_explore\` attempts per project, including empty responses; **≤1** focused depth recovery after incomplete evidence. Identical requests with usable evidence may be deduplicated; lexical overlap alone does not prove a new obligation was answered.
59
-
60
- ## Do not call HomeGraph
61
-
62
- Runtime Skip is a short blacklist (everything else is served if you call):
8
+ const SOURCE_AND_VALIDATION = `
9
+ - ArkTS evidence packs keep complete declarations and the source dependencies of displayed static relations together. Gaps identify omitted, stale or unindexed evidence; inspect only a gap relevant to the task. A static link does not prove runtime ordering or value propagation, and a complete declaration does not prove its enclosing call conditions.
10
+ - ArkTS path evidence follows typed, directed relations between named anchors within a bounded search. A provided path includes intermediate declarations and registration sites. Check its goal and stop reason; no path in scope does not prove no relationship. Qualify ambiguous symbols with their owning type or file.
11
+ - Reuse complete, unchanged, line-numbered source ranges already visible. An outline, path list, truncated body or SDK declaration cannot replace missing implementation evidence. A slice hash identifies that excerpt, not the whole file. Refresh affected ranges after edits.
12
+ - An empty edge set means the relation may be unindexed, not absent. For partial, stale or irrelevant results, inspect the exact missing source with scoped search/read. After a query adds no evidence, change the method or scope rather than paraphrasing the same explore.
13
+ - Retrieval completion is not task completion. Continue the requested edits and validation; check the original task's behavior and preservation constraints. Build success alone does not establish functional correctness.
14
+ `;
15
+ const ON_DEMAND = `## When to call (path-first, bash-first)
63
16
 
64
- - Single-file path pinned in a code-change task → Read + edit (Skip HomeGraph)
17
+ Use ordinary bash/search/read tools first for repository paths, symbols, literal strings and local changes. Skip HomeGraph when those tools provide sufficient evidence, including for difficult implementation tasks. A known path can be read directly; an adequate source result does not need a second graph lookup.
65
18
 
66
- - Topic → file list with no Type/file basename
67
- - Pure layout-copy or media hunts with no code behavior to locate
68
- - Pure existence / concept-compare with no graph anchors
69
- - Official website/docs only · scaffold empty project · git/blame/diff · media/binary inventories
19
+ HomeGraph is optional. Use it only for a concrete unresolved relationship that benefits from graph evidence: cross-file state/event propagation, callers/callees, module dependencies or ArkTS-to-native registration. Name the missing relation and use anchors from the current task or source. There is no mandatory number of bash searches before a useful graph query.
70
20
 
71
- \`@kit\` / OHOS **API usage in this repo** is not Skip: exact where-used → \`homegraph_usages\`; mechanism/API-symbol flow → \`homegraph_explore\`. Feature **catalogs** of an SDK → SDK docs, not HomeGraph.
21
+ Choose the smallest available tool for that gap:
22
+ - Exact usage/reference locations → \`homegraph_usages\`; callers/callees → the corresponding tool.
23
+ - Named module dependencies/cycles → \`homegraph_modules\`; native exports/registration → \`homegraph_native\`.
24
+ - One missing symbol body → \`homegraph_node\`; prefer direct read if its path is already known.
25
+ - An unresolved cross-symbol mechanism → \`homegraph_explore\`. Do not use it for routine pre-edit orientation, a literal search, or to re-confirm source already found with bash.
26
+ - ArkUI migration analysis → \`homegraph_arkui_migrate\` when that analysis is needed; SDK contracts → project declarations or SDK documentation.
72
27
 
73
- For UI behavior, preserve the verbatim label in the query: resource strings may lead to their source references, event handler and route. If a tool reports unsupported scope or an exhausted budget, use targeted built-ins for the missing evidence and continue the user's task.
28
+ Do not call explore after a focused tool already answered the relation. Keep working directly once the edit location and affected behavior are sufficiently supported. Task difficulty and file count alone do not require graph use.
29
+ `;
30
+ const QUERY = `## Query and recovery
74
31
 
75
- ## Tips
32
+ Write one focused sentence: requested action + target + known anchors + unresolved relation + preservation constraints. Use the full public task as \`taskContext\` when needed. Keep UI labels verbatim; use exact symbols from the task or source instead of inventing names or piling up generic keywords. Use returned repository-relative paths without reconstructing an experiment directory; a path refusal requires valid in-repo relocation, not broader permissions.
76
33
 
77
- - Empty callers/callees = **edges not indexed**, not “missing symbol” — use the definition anchor; narrow Grep for registration if needed.
78
- - **Staleness banner** — refresh the listed changed source before relying on it.
79
- - **Not indexed** — use built-ins; user runs \`homegraph init\` (you do not).
34
+ A project map is navigation, not proof of a located feature. Preserve requested product/module scope and verify each candidate before editing. Start with one focused graph request; recover only a named missing body/relation. Budget: ≤2 \`homegraph_explore\` attempts per project, ≤1 focused depth recovery; existing runtime budgets may be tighter. These are ceilings, never a required sequence. If evidence is still missing, use targeted bash/search/read and continue implementation. Do not expand into unrelated files merely to exhaust a budget.
80
35
  `;
81
- exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — per-project (pass projectPath)
36
+ exports.SERVER_INSTRUCTIONS = `# HomeGraph — optional structural evidence for this repo
82
37
 
83
- Pass \`projectPath\` to a folder that has \`.homegraph/\`.
84
-
85
- **When to call (path-first):** a single-file path-pinned edit → Read + edit (Skip HomeGraph). Otherwise choose exactly one first tool: named where-used → \`homegraph_usages\`; named module deps/cycles → \`homegraph_modules\`; named NAPI/native exports → \`homegraph_native\`; every other in-repo explanation/edit → \`homegraph_explore\`. Pass the same \`projectPath\`. Do not call explore after a focused inventory already answered.
38
+ ${ON_DEMAND}
39
+ ${QUERY}
40
+ ${SOURCE_AND_VALIDATION}
41
+ No index → use ordinary tools; indexing is managed by the host. Do not run HomeGraph initialization as part of solving the task.
42
+ `;
43
+ exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — optional per-project evidence
86
44
 
87
- **Skip:** path-pinned single-file edits, topic file-lists, concept compares, git history, media. No index → Read/Grep/Glob; user runs \`homegraph init\`.
45
+ Pass \`projectPath\` to an already indexed folder with \`.homegraph/\`. No index → use ordinary tools; indexing is managed by the host.
88
46
 
89
- **Query habit:** Chinese OK; keep UI labels verbatim and add English Type/\`@kit\` tokens only when known. Preserve requested edits and scope. Empty/SDK-only/partial evidence permits one focused recovery, then targeted source inspection. Retrieval completion is not task completion: continue the requested edits and validation.
47
+ ${ON_DEMAND}
48
+ ${QUERY}
49
+ ${SOURCE_AND_VALIDATION}
90
50
  `;
91
51
  //# sourceMappingURL=server-instructions.js.map
@@ -253,7 +253,10 @@ class MCPSession {
253
253
  // Kick off engine init in the background. If another session in the
254
254
  // same daemon already opened the project, `ensureInitialized` is a
255
255
  // ~free no-op — N concurrent clients pay exactly one open.
256
- this.resolvePromise = this.engine.ensureInitialized(explicitPath);
256
+ // explicitPath is a DECLARED root (rootUri / workspaceFolders / --path),
257
+ // so it also bounds the walk-up (spec 0028): a stray ancestor .homegraph
258
+ // must not hijack the session.
259
+ this.resolvePromise = this.engine.ensureInitialized(explicitPath, explicitPath);
257
260
  }
258
261
  }
259
262
  async handleToolsList(request) {
@@ -329,9 +332,10 @@ class MCPSession {
329
332
  return;
330
333
  }
331
334
  // Last resort: walk from the best candidate (sync open). Picks up
332
- // projects that appeared after the server started.
335
+ // projects that appeared after the server started. The hint (server
336
+ // --path) is a declaration → floor; bare cwd is not.
333
337
  const candidate = hint ?? process.cwd();
334
- this.engine.retryInitializeSync(candidate);
338
+ this.engine.retryInitializeSync(candidate, hint ?? undefined);
335
339
  }
336
340
  /**
337
341
  * Ask the client for its workspace root via `roots/list` and open the
@@ -339,11 +343,15 @@ class MCPSession {
339
343
  */
340
344
  async initFromRoots() {
341
345
  let target = process.cwd();
346
+ // Only a real roots/list answer is a client DECLARATION of the workspace
347
+ // root — the cwd fallbacks are not, and keep the git-style walk-up.
348
+ let declared = false;
342
349
  try {
343
350
  const result = await this.transport.request('roots/list', undefined, ROOTS_LIST_TIMEOUT_MS);
344
351
  const rootPath = firstRootPath(result);
345
352
  if (rootPath) {
346
353
  target = rootPath;
354
+ declared = true;
347
355
  }
348
356
  else {
349
357
  process.stderr.write('[HomeGraph MCP] Client returned no workspace roots; falling back to process cwd.\n');
@@ -353,7 +361,7 @@ class MCPSession {
353
361
  const msg = err instanceof Error ? err.message : String(err);
354
362
  process.stderr.write(`[HomeGraph MCP] roots/list request failed (${msg}); falling back to process cwd.\n`);
355
363
  }
356
- await this.engine.ensureInitialized(target);
364
+ await this.engine.ensureInitialized(target, declared ? target : undefined);
357
365
  }
358
366
  }
359
367
  exports.MCPSession = MCPSession;
@@ -0,0 +1,3 @@
1
+ /** 只标识实际返回的片段,不冒充整个文件版本或任务覆盖率。 */
2
+ export declare function sourceSliceIdentity(path: string, start: number, source: string): string;
3
+ //# sourceMappingURL=source-slice-identity.d.ts.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sourceSliceIdentity = sourceSliceIdentity;
4
+ const node_crypto_1 = require("node:crypto");
5
+ /** 只标识实际返回的片段,不冒充整个文件版本或任务覆盖率。 */
6
+ function sourceSliceIdentity(path, start, source) {
7
+ const end = start + source.split('\n').length - 1;
8
+ const digest = (0, node_crypto_1.createHash)('sha256').update(source, 'utf8').digest('hex').slice(0, 16);
9
+ return `Source slice: ${path}:${start}-${end}; excerpt-sha256=${digest}. Excerpt only; refresh after edits.`;
10
+ }
11
+ //# sourceMappingURL=source-slice-identity.js.map
@@ -317,6 +317,23 @@ export declare class ToolHandler {
317
317
  * allowlist so a trimmed surface is reflected in ListTools.
318
318
  */
319
319
  getTools(): ToolDefinition[];
320
+ /**
321
+ * Per-repo suffix appended to homegraph_explore's description (Spec 0027).
322
+ *
323
+ * fileCount === 0 must not read as "this project is empty": hosts snapshot
324
+ * tools/list once at connect (#964), and an auto-init that is still building
325
+ * reports 0 at that instant. Field evidence (DevEco Code bench, 3 sessions,
326
+ * zero homegraph calls): agents read "make at most 1 calls for this project
327
+ * (0 files indexed)" as terminal — "homegraph isn't indexed for this
328
+ * project" — and permanently fell back to Read/Grep even though the index
329
+ * completed seconds later. Mirror maybeDeepToolPhaseGate's success-shaped
330
+ * guidance so the frozen description and the live call-time response tell
331
+ * the same story: failed build → say so (indexing is the user's call, so
332
+ * the agent relays it); still building → point at homegraph_project and
333
+ * retry; genuinely empty → honest empty note. Only fileCount > 0 carries a
334
+ * call budget — there is nothing to budget over an unbuilt index.
335
+ */
336
+ private exploreSuffix;
320
337
  /**
321
338
  * Get HomeGraph instance for a project
322
339
  *
@@ -426,6 +443,8 @@ export declare class ToolHandler {
426
443
  private tryDepthToolFuse;
427
444
  /** A repeated query is duplicate evidence only while its source is unchanged. */
428
445
  private shouldRefuseRepeatedEvidence;
446
+ /** Same bounded fingerprint check for repeat protection and cached source packs. */
447
+ private areEvidenceFilesCurrent;
429
448
  /** Count a successful depth-tool call when the latest explore was Partial. */
430
449
  private noteDepthToolUse;
431
450
  /**
@@ -478,9 +497,8 @@ export declare class ToolHandler {
478
497
  */
479
498
  private dispatchTool;
480
499
  /**
481
- * Gate symbol/graph tools while auto-init is still on the fast map or
482
- * background full index (and no nodes exist yet). Success-shaped guidance —
483
- * never isError — so agents keep using HomeGraph.
500
+ * Gate symbol/graph tools by product index state (Spec 0032).
501
+ * Success-shaped guidance — never isError — so agents keep using HomeGraph.
484
502
  */
485
503
  private maybeDeepToolPhaseGate;
486
504
  private handleSearch;
@@ -644,9 +662,9 @@ export declare class ToolHandler {
644
662
  * Fast inventory-only explore — skips findRelevantContext for survey/caller/dependency queries.
645
663
  */
646
664
  private tryFastInventoryExplore;
647
- /**
648
- * Render a compact symbol-bounded slice of one file (lightweight mechanism path).
649
- */
665
+ /** Pack already-located ArkTS evidence before legacy windowing can cut it. */
666
+ private tryArktsEvidenceExplore;
667
+ /** Render a compact symbol-bounded slice on the legacy mechanism path. */
650
668
  private renderLightMechanismSource;
651
669
  /**
652
670
  * Lightweight mechanism explore — seed entry symbols + flow spine, skip