homegraph 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +305 -305
  3. package/dist/bin/homegraph.js +9 -9
  4. package/dist/db/index.js +36 -36
  5. package/dist/db/migrations.js +37 -37
  6. package/dist/db/queries.js +156 -156
  7. package/dist/db/schema.sql +203 -203
  8. package/dist/directory.js +5 -5
  9. package/dist/extraction/index.d.ts +1 -1
  10. package/dist/extraction/index.d.ts.map +1 -1
  11. package/dist/extraction/index.js +54 -43
  12. package/dist/extraction/index.js.map +1 -1
  13. package/dist/extraction/languages/arkts.d.ts +53 -6
  14. package/dist/extraction/languages/arkts.d.ts.map +1 -1
  15. package/dist/extraction/languages/arkts.js +565 -65
  16. package/dist/extraction/languages/arkts.js.map +1 -1
  17. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  18. package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
  19. package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
  20. package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
  21. package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
  22. package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
  23. package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
  24. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  25. package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +3 -2
  28. package/dist/index.js.map +1 -1
  29. package/dist/installer/instructions-template.js +9 -9
  30. package/dist/mcp/diff-impact.d.ts +131 -0
  31. package/dist/mcp/diff-impact.d.ts.map +1 -0
  32. package/dist/mcp/diff-impact.js +385 -0
  33. package/dist/mcp/diff-impact.js.map +1 -0
  34. package/dist/mcp/liveness-watchdog.js +51 -51
  35. package/dist/mcp/server-instructions.d.ts +1 -1
  36. package/dist/mcp/server-instructions.d.ts.map +1 -1
  37. package/dist/mcp/server-instructions.js +49 -47
  38. package/dist/mcp/server-instructions.js.map +1 -1
  39. package/dist/mcp/tools.d.ts +21 -5
  40. package/dist/mcp/tools.d.ts.map +1 -1
  41. package/dist/mcp/tools.js +305 -55
  42. package/dist/mcp/tools.js.map +1 -1
  43. package/dist/resolution/callback-synthesizer.d.ts +2 -1
  44. package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
  45. package/dist/resolution/callback-synthesizer.js +153 -53
  46. package/dist/resolution/callback-synthesizer.js.map +1 -1
  47. package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -1
  48. package/dist/resolution/frameworks/arkts-entry.js +20 -9
  49. package/dist/resolution/frameworks/arkts-entry.js.map +1 -1
  50. package/dist/resolution/index.d.ts.map +1 -1
  51. package/dist/resolution/index.js +1 -1
  52. package/dist/resolution/index.js.map +1 -1
  53. package/dist/resolution/memory-budget.d.ts +33 -0
  54. package/dist/resolution/memory-budget.d.ts.map +1 -1
  55. package/dist/resolution/memory-budget.js +58 -0
  56. package/dist/resolution/memory-budget.js.map +1 -1
  57. package/dist/resolution/resolver-pool.d.ts +2 -0
  58. package/dist/resolution/resolver-pool.d.ts.map +1 -1
  59. package/dist/resolution/resolver-pool.js +4 -0
  60. package/dist/resolution/resolver-pool.js.map +1 -1
  61. package/dist/spec/db/commit-node.js +4 -4
  62. package/dist/spec/db/fragment-node.js +10 -10
  63. package/dist/spec/db/fts.js +8 -8
  64. package/dist/spec/db/relations.js +88 -88
  65. package/dist/spec/db/schema.js +6 -6
  66. package/dist/spec/db/schema.sql +121 -121
  67. package/dist/spec/db/spec-node.js +4 -4
  68. package/dist/spec/llm/prompts.js +53 -53
  69. package/dist/ui/shimmer-progress.d.ts.map +1 -1
  70. package/dist/ui/shimmer-progress.js +4 -1
  71. package/dist/ui/shimmer-progress.js.map +1 -1
  72. package/package.json +61 -62
  73. package/dist/extraction/languages/arkts-viewtree.d.ts +0 -22
  74. package/dist/extraction/languages/arkts-viewtree.d.ts.map +0 -1
  75. package/dist/extraction/languages/arkts-viewtree.js +0 -133
  76. package/dist/extraction/languages/arkts-viewtree.js.map +0 -1
  77. package/dist/reasoning/config.d.ts +0 -45
  78. package/dist/reasoning/config.d.ts.map +0 -1
  79. package/dist/reasoning/config.js +0 -171
  80. package/dist/reasoning/config.js.map +0 -1
  81. package/dist/reasoning/credentials.d.ts +0 -5
  82. package/dist/reasoning/credentials.d.ts.map +0 -1
  83. package/dist/reasoning/credentials.js +0 -83
  84. package/dist/reasoning/credentials.js.map +0 -1
  85. package/dist/reasoning/login.d.ts +0 -21
  86. package/dist/reasoning/login.d.ts.map +0 -1
  87. package/dist/reasoning/login.js +0 -85
  88. package/dist/reasoning/login.js.map +0 -1
  89. package/dist/reasoning/reasoner.d.ts +0 -43
  90. package/dist/reasoning/reasoner.d.ts.map +0 -1
  91. package/dist/reasoning/reasoner.js +0 -308
  92. package/dist/reasoning/reasoner.js.map +0 -1
  93. package/dist/spec/evolve/llm-client.d.ts +0 -50
  94. package/dist/spec/evolve/llm-client.d.ts.map +0 -1
  95. package/dist/spec/evolve/llm-client.js +0 -176
  96. package/dist/spec/evolve/llm-client.js.map +0 -1
  97. package/dist/spec/evolve/logic-checker.d.ts +0 -12
  98. package/dist/spec/evolve/logic-checker.d.ts.map +0 -1
  99. package/dist/spec/evolve/logic-checker.js +0 -24
  100. package/dist/spec/evolve/logic-checker.js.map +0 -1
  101. package/dist/spec/llm/index.d.ts +0 -3
  102. package/dist/spec/llm/index.d.ts.map +0 -1
  103. package/dist/spec/llm/index.js +0 -11
  104. package/dist/spec/llm/index.js.map +0 -1
  105. package/dist/spec/mining/diff-parser.d.ts +0 -33
  106. package/dist/spec/mining/diff-parser.d.ts.map +0 -1
  107. package/dist/spec/mining/diff-parser.js +0 -166
  108. package/dist/spec/mining/diff-parser.js.map +0 -1
  109. package/dist/spec/mining/git-scanner.d.ts +0 -103
  110. package/dist/spec/mining/git-scanner.d.ts.map +0 -1
  111. package/dist/spec/mining/git-scanner.js +0 -307
  112. package/dist/spec/mining/git-scanner.js.map +0 -1
  113. package/dist/spec/mining/pipeline.d.ts +0 -53
  114. package/dist/spec/mining/pipeline.d.ts.map +0 -1
  115. package/dist/spec/mining/pipeline.js +0 -178
  116. package/dist/spec/mining/pipeline.js.map +0 -1
  117. package/dist/spec/mining/scope-resolver.d.ts +0 -45
  118. package/dist/spec/mining/scope-resolver.d.ts.map +0 -1
  119. package/dist/spec/mining/scope-resolver.js +0 -103
  120. package/dist/spec/mining/scope-resolver.js.map +0 -1
  121. package/dist/spec/mining/spec-extractor.d.ts +0 -69
  122. package/dist/spec/mining/spec-extractor.d.ts.map +0 -1
  123. package/dist/spec/mining/spec-extractor.js +0 -369
  124. package/dist/spec/mining/spec-extractor.js.map +0 -1
  125. package/dist/spec/utils.d.ts +0 -167
  126. package/dist/spec/utils.d.ts.map +0 -1
  127. package/dist/spec/utils.js +0 -463
  128. package/dist/spec/utils.js.map +0 -1
  129. package/scripts/_tmp-cfwk-resolve.log +0 -0
  130. package/scripts/_tmp-cfwk-sig.log +0 -0
  131. package/scripts/_tmp-cfwk-vt.log +0 -0
  132. package/scripts/add-lang/bench.sh +0 -60
  133. package/scripts/add-lang/check-grammar.mjs +0 -75
  134. package/scripts/add-lang/dump-ast.mjs +0 -103
  135. package/scripts/add-lang/verify-extraction.mjs +0 -70
  136. package/scripts/agent-eval/ab-adoption.sh +0 -91
  137. package/scripts/agent-eval/ab-hook.sh +0 -86
  138. package/scripts/agent-eval/ab-impl.sh +0 -78
  139. package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
  140. package/scripts/agent-eval/ab-sufficiency.sh +0 -78
  141. package/scripts/agent-eval/arms-F.sh +0 -21
  142. package/scripts/agent-eval/arms-matrix.sh +0 -37
  143. package/scripts/agent-eval/audit.sh +0 -68
  144. package/scripts/agent-eval/bench-readme.sh +0 -28
  145. package/scripts/agent-eval/bench-why-repo.sh +0 -22
  146. package/scripts/agent-eval/block-read-hook.sh +0 -19
  147. package/scripts/agent-eval/hook-settings.json +0 -15
  148. package/scripts/agent-eval/itrun.sh +0 -120
  149. package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
  150. package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
  151. package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
  152. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
  153. package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
  154. package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
  155. package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
  156. package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
  157. package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
  158. package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
  159. package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
  160. package/scripts/agent-eval/offload-eval-setup.sh +0 -24
  161. package/scripts/agent-eval/offload-eval-styles.sh +0 -72
  162. package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
  163. package/scripts/agent-eval/offload-eval.md +0 -76
  164. package/scripts/agent-eval/parse-arms.mjs +0 -116
  165. package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
  166. package/scripts/agent-eval/parse-run.mjs +0 -45
  167. package/scripts/agent-eval/parse-session.mjs +0 -93
  168. package/scripts/agent-eval/probe-context.mjs +0 -21
  169. package/scripts/agent-eval/probe-explore.mjs +0 -40
  170. package/scripts/agent-eval/probe-node.mjs +0 -20
  171. package/scripts/agent-eval/probe-sweep.mjs +0 -119
  172. package/scripts/agent-eval/probe-trace.mjs +0 -20
  173. package/scripts/agent-eval/redirect-read-hook.sh +0 -38
  174. package/scripts/agent-eval/repro-concurrent-explore.mjs +0 -119
  175. package/scripts/agent-eval/repro-daemon-clients.mjs +0 -125
  176. package/scripts/agent-eval/run-agent.sh +0 -34
  177. package/scripts/agent-eval/run-all.sh +0 -75
  178. package/scripts/agent-eval/run-arms.sh +0 -56
  179. package/scripts/agent-eval/seq-matrix.mjs +0 -137
  180. package/scripts/bench-arkts-init-rss.log +0 -0
  181. package/scripts/build-bundle.sh +0 -123
  182. package/scripts/exp_boundary_eval/README.md +0 -247
  183. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
  184. package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
  185. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
  186. package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
  187. package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
  188. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
  189. package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
  190. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
  191. package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
  192. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
  193. package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
  194. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
  195. package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
  196. package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
  197. package/scripts/exp_boundary_eval/_test_mcp_chain.py +0 -78
  198. package/scripts/exp_boundary_eval/_test_stdin.py +0 -8
  199. package/scripts/exp_boundary_eval/_utils.py +0 -1116
  200. package/scripts/exp_boundary_eval/analyze.py +0 -1313
  201. package/scripts/exp_boundary_eval/deveco_arm.py +0 -519
  202. package/scripts/exp_boundary_eval/run_all.py +0 -378
  203. package/scripts/exp_boundary_eval/run_one.py +0 -165
  204. package/scripts/exp_boundary_eval/run_session.py +0 -158
  205. package/scripts/exp_boundary_eval/setup.py +0 -120
  206. package/scripts/exp_boundary_eval/win_mcp_launcher.py +0 -73
  207. package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +0 -36
  208. package/scripts/exp_boundary_eval/win_node_launcher.py +0 -24
  209. package/scripts/extract-release-notes.mjs +0 -130
  210. package/scripts/local-install.sh +0 -41
  211. package/scripts/npm-sdk.js +0 -75
  212. package/scripts/npm-shim.js +0 -275
  213. package/scripts/ohos-sdk-publish.mjs +0 -133
  214. package/scripts/pack-npm.sh +0 -119
  215. package/scripts/prepare-release.mjs +0 -270
  216. package/scripts/probe-arkts-mem-why-run.log +0 -0
  217. package/scripts/probe-banner-livecard-ir.log +0 -0
  218. package/scripts/probe-cfwk-ast.stderr.log +0 -0
  219. package/scripts/probe-cfwk-ast.stdout.log +0 -0
  220. package/scripts/probe-cfwk-attr-shape.log +0 -0
  221. package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
  222. package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
  223. package/scripts/probe-cfwk-cvc.stderr.log +0 -0
  224. package/scripts/probe-cfwk-cvc.stdout.log +0 -0
  225. package/scripts/probe-cfwk-diag2.log +0 -0
  226. package/scripts/probe-cfwk-diag3.log +0 -0
  227. package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
  228. package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
  229. package/scripts/probe-cfwk-fileresult.log +0 -0
  230. package/scripts/probe-cfwk-fix.stderr.log +0 -0
  231. package/scripts/probe-cfwk-fix.stdout.log +0 -0
  232. package/scripts/probe-cfwk-fix2.stderr.log +0 -0
  233. package/scripts/probe-cfwk-fix2.stdout.log +0 -0
  234. package/scripts/probe-cfwk-fix3.stderr.log +0 -0
  235. package/scripts/probe-cfwk-fix3.stdout.log +0 -0
  236. package/scripts/probe-cfwk-foreach.log +0 -0
  237. package/scripts/probe-cfwk-getmethod-throw.log +0 -0
  238. package/scripts/probe-cfwk-hg-extract.log +0 -0
  239. package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
  240. package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
  241. package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
  242. package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
  243. package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
  244. package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
  245. package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
  246. package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
  247. package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
  248. package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
  249. package/scripts/probe-cfwk-resolve-sim.log +0 -0
  250. package/scripts/probe-cfwk-tree-shape.log +0 -0
  251. package/scripts/probe-cfwk-walk-abort.log +0 -0
  252. package/scripts/probe-cfwk.log +0 -0
  253. package/scripts/probe-force-index.log +0 -0
  254. package/scripts/probe-no-force-index.log +0 -0
  255. package/scripts/probe-samefile-ir.stderr.log +0 -0
  256. package/scripts/probe-samefile-ir.stdout.log +0 -224
  257. package/scripts/probe-sdk-vs-project.log +0 -0
  258. package/scripts/probe-viewtree-downgrade.log +0 -0
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Colby Mchenry
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Colby Mchenry
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,305 +1,305 @@
1
- # HomeGraph
2
-
3
- 本地代码知识图谱工具,面向 AI 编程助手(Claude Code、Cursor、Codex 等)提供 MCP 服务。
4
-
5
- 在开源知识图谱能力之上,**HomeGraph 新增了对 ArkTS(HarmonyOS)的支持**,通过 [arkanalyzer](https://www.npmjs.com/package/arkanalyzer) 解析 `.ets` / `.ts` 工程中的符号、调用关系与模块结构。
6
-
7
- 数据全部保存在本机 `.homegraph/` 目录,不上传云端。
8
-
9
- [![npm version](https://img.shields.io/npm/v/homegraph.svg)](https://www.npmjs.com/package/homegraph)
10
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
-
12
- ---
13
-
14
- ## 快速开始
15
-
16
- ### 1. 安装 CLI
17
-
18
- 需要 **Node.js 20+**(推荐 22.5+ 或 24)。SQLite 优先用内置 `node:sqlite`(≥22.5),否则 `better-sqlite3`,再不行回退 `node-sqlite3-wasm`。
19
-
20
- ```bash
21
- npm install -g homegraph
22
- ```
23
-
24
- 若在 Linux/WSL 遇到 `EACCES` 权限错误,可任选其一:
25
-
26
- ```bash
27
- # 临时
28
- sudo npm install -g homegraph
29
-
30
- # 或把全局目录改到用户家目录(推荐)
31
- mkdir -p ~/.npm-global
32
- npm config set prefix ~/.npm-global
33
- echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
34
- source ~/.bashrc
35
- npm install -g homegraph
36
- ```
37
-
38
- 验证:
39
-
40
- ```bash
41
- homegraph --version
42
- ```
43
-
44
- ### 2. 接入 AI 助手
45
-
46
- 在新终端中运行交互式安装器,自动写入各 Agent 的 MCP 配置:
47
-
48
- ```bash
49
- homegraph install
50
- ```
51
-
52
- #### 支持的 Agent 与 `--target` 取值
53
-
54
- | Agent | `--target` |
55
- |-------|------------|
56
- | Claude Code | `claude` |
57
- | Cursor | `cursor` |
58
- | Codex CLI | `codex` |
59
- | opencode | `opencode` |
60
- | DevEco Code | `deveco` |
61
- | CodeBuddy | `codebuddy` |
62
- | Hermes Agent | `hermes` |
63
- | Gemini CLI | `gemini` |
64
- | Antigravity IDE | `antigravity` |
65
- | Kiro | `kiro` |
66
-
67
- `--target` 还支持特殊取值:
68
-
69
- | 取值 | 说明 |
70
- |------|------|
71
- | `auto` | 自动检测本机已安装的 Agent(`--yes` 默认值) |
72
- | `all` | 写入全部 Agent |
73
- | `none` | 不写入任何 Agent 配置 |
74
-
75
- 安装位置 `--location`:
76
-
77
- - `global` — 写入用户目录,对所有项目生效(`--yes` 默认值)
78
- - `local` — 仅写入当前项目目录
79
-
80
- > Codex CLI、Hermes Agent、Antigravity IDE **仅支持** `--location=global`;选 `local` 时会被跳过。
81
-
82
- #### 非交互式示例
83
-
84
- ```bash
85
- # 自动检测已安装 Agent 并全局安装
86
- homegraph install --yes
87
-
88
- # 同时为 Cursor 和 DevEco Code 写入全局 MCP 配置
89
- homegraph install --target=cursor,deveco --location=global --yes
90
-
91
- # 单个 Agent
92
- homegraph install --target=claude --location=global --yes # Claude Code
93
- homegraph install --target=cursor --location=global --yes # Cursor
94
- homegraph install --target=codex --location=global --yes # Codex CLI
95
- homegraph install --target=opencode --location=global --yes # opencode
96
- homegraph install --target=deveco --location=global --yes # DevEco Code
97
- homegraph install --target=codebuddy --location=global --yes # CodeBuddy
98
- homegraph install --target=hermes --location=global --yes # Hermes Agent
99
- homegraph install --target=gemini --location=global --yes # Gemini CLI
100
- homegraph install --target=antigravity --location=global --yes # Antigravity IDE
101
- homegraph install --target=kiro --location=global --yes # Kiro
102
-
103
- # 写入全部 Agent(全局)
104
- homegraph install --target=all --location=global --yes
105
-
106
- # 项目级安装(仅对当前项目生效,如 ./.cursor/mcp.json)
107
- homegraph install --target=cursor --location=local --yes
108
- homegraph install --target=claude,cursor --location=local --yes
109
- ```
110
-
111
- 安装完成后**重启对应 Agent**,使 MCP 配置生效。
112
-
113
- ### 3. 初始化项目
114
-
115
- ```bash
116
- cd your-project
117
- homegraph init -i
118
- ```
119
-
120
- - `homegraph init`:仅创建 `.homegraph/` 索引目录
121
- - `homegraph init -i`:创建目录并立即建立索引(推荐)
122
-
123
- 索引建立后,Agent 可通过 MCP 工具查询符号、调用链、影响范围等。
124
-
125
- ### 卸载
126
-
127
- ```bash
128
- homegraph uninstall # 从各 Agent 移除 MCP 配置
129
- homegraph uninit # 删除当前项目的 .homegraph/ 索引
130
- ```
131
-
132
- ---
133
-
134
- ## 常用命令
135
-
136
- ```bash
137
- homegraph install # 配置 AI 助手
138
- homegraph init -i [path] # 初始化并索引项目
139
- homegraph index [path] # 全量索引(--force 强制重建)
140
- homegraph sync [path] # 增量同步变更
141
- homegraph status [path] # 查看索引状态
142
- homegraph query <关键词> # 搜索符号
143
- homegraph explore <查询> # 探索区域(与 MCP homegraph_explore 相同输出)
144
- homegraph node <符号或文件> # 读取符号/文件(与 MCP homegraph_node 相同输出)
145
- homegraph files # 已索引文件树
146
- homegraph callers <符号> # 谁调用了它
147
- homegraph callees <符号> # 它调用了谁
148
- homegraph impact <符号> # 修改该符号的影响范围
149
- homegraph affected [files...] # 根据变更文件查找受影响的测试(支持 --stdin)
150
- homegraph spec build # 从已有 .spec 目录(或用户指定目录)构建Spec知识图谱(Commit4Spec)
151
- homegraph spec mine # 从 Git 历史挖掘设计Spec文档(AST 分析 + LLM 聚类生成)
152
- homegraph spec match <文本> # 全文搜索相似历史Spec
153
- homegraph spec find <文件> # 查找与指定文件关联的Spec
154
- homegraph spec trace <符号> # 追溯代码符号关联的Spec
155
- homegraph spec stats # 查看Spec知识图谱状态
156
- homegraph spec evolve install # 安装 post-commit 钩子(默认累计 3 次提交后触发演进)
157
- homegraph spec evolve uninstall# 移除 post-commit 钩子
158
- homegraph spec evolve process # 手动触发一次Spec演化
159
- homegraph serve --mcp # 启动 MCP 服务(一般由 Agent 自动拉起)
160
- ```
161
-
162
- `explore` / `node` 等命令与同名 MCP 工具共享同一套输出,适合没有 MCP 的子 Agent 或脚本直接调用。
163
-
164
- ---
165
-
166
- ## MCP 工具
167
-
168
- Agent 侧工具名前缀为 `homegraph_`。
169
-
170
- **暴露规则:** 默认注册全部工具。索引文件数 **少于 500** 的小项目会自动收缩为三个核心工具(`explore` / `search` / `node`)。可通过环境变量 `HOMEGRAPH_MCP_TOOLS`(逗号分隔短名,如 `explore,node`)自定义暴露列表。
171
-
172
- **跨项目查询:** 所有工具均支持可选参数 `projectPath`(绝对路径),用于在 monorepo 中查询子项目,或当 MCP 服务器根目录没有索引时指定目标项目。
173
-
174
- | 工具 | 用途 |
175
- |------|------|
176
- | `homegraph_explore` | **主工具**:一次调用返回相关符号的完整源码、调用路径与影响范围;支持自然语言问题或符号/文件名列表 |
177
- | `homegraph_search` | 按名称快速搜索符号(仅返回位置,不含源码) |
178
- | `homegraph_node` | 读取单个符号或整个文件的源码(带行号)及调用关系;可替代 Read 读文件 |
179
- | `homegraph_callers` / `homegraph_callees` | 查看调用方 / 被调用方 |
180
- | `homegraph_impact` | 变更影响分析(重构前使用) |
181
- | `homegraph_files` | 已索引的文件树(支持 glob 过滤、按语言分组) |
182
- | `homegraph_status` | 索引健康状态(调试用) |
183
- | `homegraph_spec_match` | 将新需求描述与 Commit4Spec 知识图谱做全文匹配,返回相似历史Spec及关联提交与代码片段 |
184
- | `homegraph_spec_find` | 根据文件路径反向查找关联的Spec |
185
- | `homegraph_spec_trace` | 根据代码符号追溯回关联的Spec |
186
-
187
- ### Commit4Spec(Spec知识图谱)
188
-
189
- Commit4Spec 提供两条互补路径将设计Spec与 Git 历史关联,存入 `.homegraph/commit4spec/commit4spec.db`:
190
-
191
- **路径 1:`spec build`(已有Spec导入)**
192
-
193
- 从项目已有的 `.spec` 目录(或用户指定目录)读取Spec文档,解析其中的 Git 引用和变更片段,直接构建知识图谱节点与关系。
194
-
195
- **路径 2:`spec mine`(Spec逆向挖掘)**
196
-
197
- 从 Git 历史中自动提取设计Spec,基于模型生成对应 `.spec` 文档,进而构建知识图谱节点与关系。
198
-
199
- 支持增量模式(`meta.json` 记录已处理范围)、commit过滤和聚类输出模式(`--skip-llm`)。
200
-
201
- `spec mine`逆向挖掘和`spec evolve process`演化更新涉及到模型访问,优先选择用户本地已有的Agent平台(Claude Code >> Codex >> 用户配置LLM),若未安装Claude Code或Codex,则需用户自主配置模型服务,编辑配置文件`.homegraph/commit4spec/configs.json`
202
-
203
- ```json
204
- // All available options (fields marked * are required):
205
- {
206
- "llm": {
207
- "provider": "openai", // * "openai" or "anthropic"
208
- "apiKey": "sk-...", // * API key string (plain text)
209
- "apiKeyEnv": "OPENAI_API_KEY", // or read from env var (takes precedence)
210
- "model": "gpt-4o", // * model name (e.g. gpt-4o, claude-3-5-sonnet)
211
- "baseUrl": "https://...", // custom endpoint (proxies / local models)
212
- "temperature": 0.2, // creativity control (default: 0.2)
213
- "maxTokens": 20000 // max output tokens (default: 20000)
214
- }
215
- }
216
- ```
217
-
218
- **查询与分析:**
219
-
220
- ```bash
221
- homegraph spec match "用户登录" # CLI/MCP 全文搜索
222
- homegraph spec find src/auth.ts # 哪些Spec涉及该文件
223
- homegraph spec trace UserService # 追溯符号关联的设计Spec
224
- ```
225
-
226
- ---
227
-
228
- ## 支持的语言
229
-
230
- 继承上游多语言 tree-sitter 解析,包括但不限于:
231
-
232
- TypeScript / JavaScript、Python、Go、Rust、Java、C#、PHP、Ruby、C / C++、Objective-C、Swift、Kotlin、Scala、Dart、Lua、Luau、R、Svelte、Vue、Astro、Liquid、Razor、Pascal / Delphi 等。
233
-
234
- **HomeGraph 新增:**
235
-
236
- | 语言 | 扩展名 | 说明 |
237
- |------|--------|------|
238
- | **ArkTS** | `.ets` 等 | 基于 arkanalyzer,支持 HarmonyOS 工程的类、方法、导入与调用关系提取 |
239
-
240
- ---
241
-
242
- ## 从源码构建
243
-
244
- 适用于开发或二次修改:
245
-
246
- ```bash
247
- git clone <your-repo-url>
248
- cd homegraph # 仓库目录名可仍为 homegraph
249
- npm install
250
- npm run build
251
- npm run cli -- --help # 或直接:node dist/bin/homegraph.js --help
252
- npm test # 运行测试
253
- ```
254
-
255
- 本地调试 CLI:
256
-
257
- ```bash
258
- npm run cli
259
- # 等价于 npm run build && node dist/bin/homegraph.js
260
- ```
261
-
262
- ---
263
-
264
- ## 手动配置 MCP(可选)
265
-
266
- 以 Claude Code 为例,在 `~/.claude.json` 中添加:
267
-
268
- ```json
269
- {
270
- "mcpServers": {
271
- "homegraph": {
272
- "type": "stdio",
273
- "command": "homegraph",
274
- "args": ["serve", "--mcp"]
275
- }
276
- }
277
- }
278
- ```
279
-
280
- Cursor 等项目级配置写入 `./.cursor/mcp.json`,格式相同。推荐使用 `homegraph install` 自动完成。
281
-
282
- ---
283
-
284
- ## 上游同步
285
-
286
- | 项目 | 说明 |
287
- |------|------|
288
- | 上游 | 持续同步 colbymchenry 开源知识图谱项目 main 分支 |
289
- | 包名 / CLI | `homegraph`(npm:`npm install -g homegraph`) |
290
- | 数据目录 | `.homegraph/` |
291
- | 主要差异 | 新增 **ArkTS** 语言支持与相关索引逻辑 |
292
-
293
- ---
294
-
295
- ## 环境要求
296
-
297
- - Node.js **20+**(推荐 22.5+ 或 24;SQLite:`node:sqlite` → better-sqlite3 → wasm)
298
- - 首次索引时会对项目源码做 AST 解析,大型仓库首次 `init -i` 可能需要数分钟
299
- - WSL2 下若项目位于 Windows 盘符(`/mnt/c` 等)且 MCP 连接不稳定,可设置 `HOMEGRAPH_NO_DAEMON=1` 跳过共享后台服务,每个会话独立运行
300
-
301
- ---
302
-
303
- ## 许可证
304
-
305
- MIT
1
+ # HomeGraph
2
+
3
+ 本地代码知识图谱工具,面向 AI 编程助手(Claude Code、Cursor、Codex 等)提供 MCP 服务。
4
+
5
+ 在开源知识图谱能力之上,**HomeGraph 新增了对 ArkTS(HarmonyOS)的支持**,通过 [arkanalyzer](https://www.npmjs.com/package/arkanalyzer) 解析 `.ets` / `.ts` 工程中的符号、调用关系与模块结构。
6
+
7
+ 数据全部保存在本机 `.homegraph/` 目录,不上传云端。
8
+
9
+ [![npm version](https://img.shields.io/npm/v/homegraph.svg)](https://www.npmjs.com/package/homegraph)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+
12
+ ---
13
+
14
+ ## 快速开始
15
+
16
+ ### 1. 安装 CLI
17
+
18
+ 需要 **Node.js 20+**(推荐 22.5+ 或 24)。SQLite 优先用内置 `node:sqlite`(≥22.5),否则 `better-sqlite3`,再不行回退 `node-sqlite3-wasm`。
19
+
20
+ ```bash
21
+ npm install -g homegraph
22
+ ```
23
+
24
+ 若在 Linux/WSL 遇到 `EACCES` 权限错误,可任选其一:
25
+
26
+ ```bash
27
+ # 临时
28
+ sudo npm install -g homegraph
29
+
30
+ # 或把全局目录改到用户家目录(推荐)
31
+ mkdir -p ~/.npm-global
32
+ npm config set prefix ~/.npm-global
33
+ echo 'export PATH="$HOME/.npm-global/bin:$PATH"' >> ~/.bashrc
34
+ source ~/.bashrc
35
+ npm install -g homegraph
36
+ ```
37
+
38
+ 验证:
39
+
40
+ ```bash
41
+ homegraph --version
42
+ ```
43
+
44
+ ### 2. 接入 AI 助手
45
+
46
+ 在新终端中运行交互式安装器,自动写入各 Agent 的 MCP 配置:
47
+
48
+ ```bash
49
+ homegraph install
50
+ ```
51
+
52
+ #### 支持的 Agent 与 `--target` 取值
53
+
54
+ | Agent | `--target` |
55
+ |-------|------------|
56
+ | Claude Code | `claude` |
57
+ | Cursor | `cursor` |
58
+ | Codex CLI | `codex` |
59
+ | opencode | `opencode` |
60
+ | DevEco Code | `deveco` |
61
+ | CodeBuddy | `codebuddy` |
62
+ | Hermes Agent | `hermes` |
63
+ | Gemini CLI | `gemini` |
64
+ | Antigravity IDE | `antigravity` |
65
+ | Kiro | `kiro` |
66
+
67
+ `--target` 还支持特殊取值:
68
+
69
+ | 取值 | 说明 |
70
+ |------|------|
71
+ | `auto` | 自动检测本机已安装的 Agent(`--yes` 默认值) |
72
+ | `all` | 写入全部 Agent |
73
+ | `none` | 不写入任何 Agent 配置 |
74
+
75
+ 安装位置 `--location`:
76
+
77
+ - `global` — 写入用户目录,对所有项目生效(`--yes` 默认值)
78
+ - `local` — 仅写入当前项目目录
79
+
80
+ > Codex CLI、Hermes Agent、Antigravity IDE **仅支持** `--location=global`;选 `local` 时会被跳过。
81
+
82
+ #### 非交互式示例
83
+
84
+ ```bash
85
+ # 自动检测已安装 Agent 并全局安装
86
+ homegraph install --yes
87
+
88
+ # 同时为 Cursor 和 DevEco Code 写入全局 MCP 配置
89
+ homegraph install --target=cursor,deveco --location=global --yes
90
+
91
+ # 单个 Agent
92
+ homegraph install --target=claude --location=global --yes # Claude Code
93
+ homegraph install --target=cursor --location=global --yes # Cursor
94
+ homegraph install --target=codex --location=global --yes # Codex CLI
95
+ homegraph install --target=opencode --location=global --yes # opencode
96
+ homegraph install --target=deveco --location=global --yes # DevEco Code
97
+ homegraph install --target=codebuddy --location=global --yes # CodeBuddy
98
+ homegraph install --target=hermes --location=global --yes # Hermes Agent
99
+ homegraph install --target=gemini --location=global --yes # Gemini CLI
100
+ homegraph install --target=antigravity --location=global --yes # Antigravity IDE
101
+ homegraph install --target=kiro --location=global --yes # Kiro
102
+
103
+ # 写入全部 Agent(全局)
104
+ homegraph install --target=all --location=global --yes
105
+
106
+ # 项目级安装(仅对当前项目生效,如 ./.cursor/mcp.json)
107
+ homegraph install --target=cursor --location=local --yes
108
+ homegraph install --target=claude,cursor --location=local --yes
109
+ ```
110
+
111
+ 安装完成后**重启对应 Agent**,使 MCP 配置生效。
112
+
113
+ ### 3. 初始化项目
114
+
115
+ ```bash
116
+ cd your-project
117
+ homegraph init -i
118
+ ```
119
+
120
+ - `homegraph init`:仅创建 `.homegraph/` 索引目录
121
+ - `homegraph init -i`:创建目录并立即建立索引(推荐)
122
+
123
+ 索引建立后,Agent 可通过 MCP 工具查询符号、调用链、影响范围等。
124
+
125
+ ### 卸载
126
+
127
+ ```bash
128
+ homegraph uninstall # 从各 Agent 移除 MCP 配置
129
+ homegraph uninit # 删除当前项目的 .homegraph/ 索引
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 常用命令
135
+
136
+ ```bash
137
+ homegraph install # 配置 AI 助手
138
+ homegraph init -i [path] # 初始化并索引项目
139
+ homegraph index [path] # 全量索引(--force 强制重建)
140
+ homegraph sync [path] # 增量同步变更
141
+ homegraph status [path] # 查看索引状态
142
+ homegraph query <关键词> # 搜索符号
143
+ homegraph explore <查询> # 探索区域(与 MCP homegraph_explore 相同输出)
144
+ homegraph node <符号或文件> # 读取符号/文件(与 MCP homegraph_node 相同输出)
145
+ homegraph files # 已索引文件树
146
+ homegraph callers <符号> # 谁调用了它
147
+ homegraph callees <符号> # 它调用了谁
148
+ homegraph impact <符号> # 修改该符号的影响范围
149
+ homegraph affected [files...] # 根据变更文件查找受影响的测试(支持 --stdin)
150
+ homegraph spec build # 从已有 .spec 目录(或用户指定目录)构建Spec知识图谱(Commit4Spec)
151
+ homegraph spec mine # 从 Git 历史挖掘设计Spec文档(AST 分析 + LLM 聚类生成)
152
+ homegraph spec match <文本> # 全文搜索相似历史Spec
153
+ homegraph spec find <文件> # 查找与指定文件关联的Spec
154
+ homegraph spec trace <符号> # 追溯代码符号关联的Spec
155
+ homegraph spec stats # 查看Spec知识图谱状态
156
+ homegraph spec evolve install # 安装 post-commit 钩子(默认累计 3 次提交后触发演进)
157
+ homegraph spec evolve uninstall# 移除 post-commit 钩子
158
+ homegraph spec evolve process # 手动触发一次Spec演化
159
+ homegraph serve --mcp # 启动 MCP 服务(一般由 Agent 自动拉起)
160
+ ```
161
+
162
+ `explore` / `node` 等命令与同名 MCP 工具共享同一套输出,适合没有 MCP 的子 Agent 或脚本直接调用。
163
+
164
+ ---
165
+
166
+ ## MCP 工具
167
+
168
+ Agent 侧工具名前缀为 `homegraph_`。
169
+
170
+ **暴露规则:** 默认注册全部工具。索引文件数 **少于 500** 的小项目会自动收缩为三个核心工具(`explore` / `search` / `node`)。可通过环境变量 `HOMEGRAPH_MCP_TOOLS`(逗号分隔短名,如 `explore,node`)自定义暴露列表。
171
+
172
+ **跨项目查询:** 所有工具均支持可选参数 `projectPath`(绝对路径),用于在 monorepo 中查询子项目,或当 MCP 服务器根目录没有索引时指定目标项目。
173
+
174
+ | 工具 | 用途 |
175
+ |------|------|
176
+ | `homegraph_explore` | **主工具**:一次调用返回相关符号的完整源码、调用路径与影响范围;支持自然语言问题或符号/文件名列表 |
177
+ | `homegraph_search` | 按名称快速搜索符号(仅返回位置,不含源码) |
178
+ | `homegraph_node` | 读取单个符号或整个文件的源码(带行号)及调用关系;可替代 Read 读文件 |
179
+ | `homegraph_callers` / `homegraph_callees` | 查看调用方 / 被调用方 |
180
+ | `homegraph_impact` | 变更影响分析(重构前使用) |
181
+ | `homegraph_files` | 已索引的文件树(支持 glob 过滤、按语言分组) |
182
+ | `homegraph_status` | 索引健康状态(调试用) |
183
+ | `homegraph_spec_match` | 将新需求描述与 Commit4Spec 知识图谱做全文匹配,返回相似历史Spec及关联提交与代码片段 |
184
+ | `homegraph_spec_find` | 根据文件路径反向查找关联的Spec |
185
+ | `homegraph_spec_trace` | 根据代码符号追溯回关联的Spec |
186
+
187
+ ### Commit4Spec(Spec知识图谱)
188
+
189
+ Commit4Spec 提供两条互补路径将设计Spec与 Git 历史关联,存入 `.homegraph/commit4spec/commit4spec.db`:
190
+
191
+ **路径 1:`spec build`(已有Spec导入)**
192
+
193
+ 从项目已有的 `.spec` 目录(或用户指定目录)读取Spec文档,解析其中的 Git 引用和变更片段,直接构建知识图谱节点与关系。
194
+
195
+ **路径 2:`spec mine`(Spec逆向挖掘)**
196
+
197
+ 从 Git 历史中自动提取设计Spec,基于模型生成对应 `.spec` 文档,进而构建知识图谱节点与关系。
198
+
199
+ 支持增量模式(`meta.json` 记录已处理范围)、commit过滤和聚类输出模式(`--skip-llm`)。
200
+
201
+ `spec mine`逆向挖掘和`spec evolve process`演化更新涉及到模型访问,优先选择用户本地已有的Agent平台(Claude Code >> Codex >> 用户配置LLM),若未安装Claude Code或Codex,则需用户自主配置模型服务,编辑配置文件`.homegraph/commit4spec/configs.json`
202
+
203
+ ```json
204
+ // All available options (fields marked * are required):
205
+ {
206
+ "llm": {
207
+ "provider": "openai", // * "openai" or "anthropic"
208
+ "apiKey": "sk-...", // * API key string (plain text)
209
+ "apiKeyEnv": "OPENAI_API_KEY", // or read from env var (takes precedence)
210
+ "model": "gpt-4o", // * model name (e.g. gpt-4o, claude-3-5-sonnet)
211
+ "baseUrl": "https://...", // custom endpoint (proxies / local models)
212
+ "temperature": 0.2, // creativity control (default: 0.2)
213
+ "maxTokens": 20000 // max output tokens (default: 20000)
214
+ }
215
+ }
216
+ ```
217
+
218
+ **查询与分析:**
219
+
220
+ ```bash
221
+ homegraph spec match "用户登录" # CLI/MCP 全文搜索
222
+ homegraph spec find src/auth.ts # 哪些Spec涉及该文件
223
+ homegraph spec trace UserService # 追溯符号关联的设计Spec
224
+ ```
225
+
226
+ ---
227
+
228
+ ## 支持的语言
229
+
230
+ 继承上游多语言 tree-sitter 解析,包括但不限于:
231
+
232
+ TypeScript / JavaScript、Python、Go、Rust、Java、C#、PHP、Ruby、C / C++、Objective-C、Swift、Kotlin、Scala、Dart、Lua、Luau、R、Svelte、Vue、Astro、Liquid、Razor、Pascal / Delphi 等。
233
+
234
+ **HomeGraph 新增:**
235
+
236
+ | 语言 | 扩展名 | 说明 |
237
+ |------|--------|------|
238
+ | **ArkTS** | `.ets` 等 | 基于 arkanalyzer,支持 HarmonyOS 工程的类、方法、导入与调用关系提取 |
239
+
240
+ ---
241
+
242
+ ## 从源码构建
243
+
244
+ 适用于开发或二次修改:
245
+
246
+ ```bash
247
+ git clone <your-repo-url>
248
+ cd homegraph # 仓库目录名可仍为 homegraph
249
+ npm install
250
+ npm run build
251
+ npm run cli -- --help # 或直接:node dist/bin/homegraph.js --help
252
+ npm test # 运行测试
253
+ ```
254
+
255
+ 本地调试 CLI:
256
+
257
+ ```bash
258
+ npm run cli
259
+ # 等价于 npm run build && node dist/bin/homegraph.js
260
+ ```
261
+
262
+ ---
263
+
264
+ ## 手动配置 MCP(可选)
265
+
266
+ 以 Claude Code 为例,在 `~/.claude.json` 中添加:
267
+
268
+ ```json
269
+ {
270
+ "mcpServers": {
271
+ "homegraph": {
272
+ "type": "stdio",
273
+ "command": "homegraph",
274
+ "args": ["serve", "--mcp"]
275
+ }
276
+ }
277
+ }
278
+ ```
279
+
280
+ Cursor 等项目级配置写入 `./.cursor/mcp.json`,格式相同。推荐使用 `homegraph install` 自动完成。
281
+
282
+ ---
283
+
284
+ ## 上游同步
285
+
286
+ | 项目 | 说明 |
287
+ |------|------|
288
+ | 上游 | 持续同步 colbymchenry 开源知识图谱项目 main 分支 |
289
+ | 包名 / CLI | `homegraph`(npm:`npm install -g homegraph`) |
290
+ | 数据目录 | `.homegraph/` |
291
+ | 主要差异 | 新增 **ArkTS** 语言支持与相关索引逻辑 |
292
+
293
+ ---
294
+
295
+ ## 环境要求
296
+
297
+ - Node.js **20+**(推荐 22.5+ 或 24;SQLite:`node:sqlite` → better-sqlite3 → wasm)
298
+ - 首次索引时会对项目源码做 AST 解析,大型仓库首次 `init -i` 可能需要数分钟
299
+ - WSL2 下若项目位于 Windows 盘符(`/mnt/c` 等)且 MCP 连接不稳定,可设置 `HOMEGRAPH_NO_DAEMON=1` 跳过共享后台服务,每个会话独立运行
300
+
301
+ ---
302
+
303
+ ## 许可证
304
+
305
+ MIT