homegraph 0.9.10 → 1.1.1
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.
- package/LICENSE +21 -21
- package/README.md +243 -193
- package/dist/bin/fatal-handler.d.ts +20 -0
- package/dist/bin/fatal-handler.d.ts.map +1 -0
- package/dist/bin/fatal-handler.js +118 -0
- package/dist/bin/fatal-handler.js.map +1 -0
- package/dist/bin/homegraph.d.ts +6 -6
- package/dist/bin/homegraph.js +532 -109
- package/dist/bin/homegraph.js.map +1 -1
- package/dist/bin/node-version-check.d.ts +4 -4
- package/dist/bin/node-version-check.js +12 -12
- package/dist/bin/uninstall.d.ts +1 -1
- package/dist/bin/uninstall.js +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +8 -1
- package/dist/context/index.js.map +1 -1
- package/dist/db/index.d.ts +22 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +48 -2
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.d.ts +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +26 -17
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/queries.d.ts +21 -1
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +180 -137
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +152 -151
- package/dist/db/sqlite-adapter.d.ts +1 -1
- package/dist/db/sqlite-adapter.js +3 -3
- package/dist/directory.d.ts +87 -6
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +319 -57
- package/dist/directory.js.map +1 -1
- package/dist/errors.d.ts +15 -15
- package/dist/errors.js +20 -20
- package/dist/extraction/astro-extractor.d.ts +79 -0
- package/dist/extraction/astro-extractor.d.ts.map +1 -0
- package/dist/extraction/astro-extractor.js +320 -0
- package/dist/extraction/astro-extractor.js.map +1 -0
- package/dist/extraction/context.d.ts +1 -1
- package/dist/extraction/context.js +1 -1
- package/dist/extraction/extraction-version.d.ts +2 -2
- package/dist/extraction/extraction-version.d.ts.map +1 -1
- package/dist/extraction/extraction-version.js +2 -2
- package/dist/extraction/extraction-version.js.map +1 -1
- package/dist/extraction/function-ref.d.ts +118 -0
- package/dist/extraction/function-ref.d.ts.map +1 -0
- package/dist/extraction/function-ref.js +727 -0
- package/dist/extraction/function-ref.js.map +1 -0
- package/dist/extraction/generated-detection.d.ts.map +1 -1
- package/dist/extraction/generated-detection.js +3 -0
- package/dist/extraction/generated-detection.js.map +1 -1
- package/dist/extraction/grammars.d.ts +15 -5
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +44 -10
- package/dist/extraction/grammars.js.map +1 -1
- package/dist/extraction/index.d.ts +37 -0
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +562 -70
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.d.ts +22 -0
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -0
- package/dist/extraction/languages/arkts-viewtree.js +133 -0
- package/dist/extraction/languages/arkts-viewtree.js.map +1 -0
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +211 -20
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/languages/c-cpp.d.ts +8 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/dist/extraction/languages/c-cpp.js +104 -2
- package/dist/extraction/languages/c-cpp.js.map +1 -1
- package/dist/extraction/languages/csharp.d.ts.map +1 -1
- package/dist/extraction/languages/csharp.js +58 -3
- package/dist/extraction/languages/csharp.js.map +1 -1
- package/dist/extraction/languages/dart.d.ts.map +1 -1
- package/dist/extraction/languages/dart.js +183 -1
- package/dist/extraction/languages/dart.js.map +1 -1
- package/dist/extraction/languages/go.d.ts.map +1 -1
- package/dist/extraction/languages/go.js +37 -0
- package/dist/extraction/languages/go.js.map +1 -1
- package/dist/extraction/languages/index.d.ts.map +1 -1
- package/dist/extraction/languages/index.js +2 -0
- package/dist/extraction/languages/index.js.map +1 -1
- package/dist/extraction/languages/java.d.ts.map +1 -1
- package/dist/extraction/languages/java.js +241 -0
- package/dist/extraction/languages/java.js.map +1 -1
- package/dist/extraction/languages/javascript.d.ts.map +1 -1
- package/dist/extraction/languages/javascript.js +16 -0
- package/dist/extraction/languages/javascript.js.map +1 -1
- package/dist/extraction/languages/kotlin.d.ts.map +1 -1
- package/dist/extraction/languages/kotlin.js +94 -0
- package/dist/extraction/languages/kotlin.js.map +1 -1
- package/dist/extraction/languages/objc.d.ts.map +1 -1
- package/dist/extraction/languages/objc.js +42 -0
- package/dist/extraction/languages/objc.js.map +1 -1
- package/dist/extraction/languages/pascal.d.ts.map +1 -1
- package/dist/extraction/languages/pascal.js +11 -0
- package/dist/extraction/languages/pascal.js.map +1 -1
- package/dist/extraction/languages/php.d.ts.map +1 -1
- package/dist/extraction/languages/php.js +77 -1
- package/dist/extraction/languages/php.js.map +1 -1
- package/dist/extraction/languages/r.d.ts +3 -0
- package/dist/extraction/languages/r.d.ts.map +1 -0
- package/dist/extraction/languages/r.js +314 -0
- package/dist/extraction/languages/r.js.map +1 -0
- package/dist/extraction/languages/rust.d.ts.map +1 -1
- package/dist/extraction/languages/rust.js +29 -0
- package/dist/extraction/languages/rust.js.map +1 -1
- package/dist/extraction/languages/scala.d.ts.map +1 -1
- package/dist/extraction/languages/scala.js +44 -9
- package/dist/extraction/languages/scala.js.map +1 -1
- package/dist/extraction/languages/swift.d.ts.map +1 -1
- package/dist/extraction/languages/swift.js +61 -0
- package/dist/extraction/languages/swift.js.map +1 -1
- package/dist/extraction/languages/typescript.d.ts +13 -0
- package/dist/extraction/languages/typescript.d.ts.map +1 -1
- package/dist/extraction/languages/typescript.js +38 -0
- package/dist/extraction/languages/typescript.js.map +1 -1
- package/dist/extraction/liquid-extractor.d.ts.map +1 -1
- package/dist/extraction/liquid-extractor.js +4 -1
- package/dist/extraction/liquid-extractor.js.map +1 -1
- package/dist/extraction/parse-worker.js +4 -1
- package/dist/extraction/parse-worker.js.map +1 -1
- package/dist/extraction/svelte-extractor.d.ts.map +1 -1
- package/dist/extraction/svelte-extractor.js +6 -3
- package/dist/extraction/svelte-extractor.js.map +1 -1
- package/dist/extraction/tree-sitter-helpers.d.ts.map +1 -1
- package/dist/extraction/tree-sitter-helpers.js +59 -10
- package/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/dist/extraction/tree-sitter-types.d.ts +29 -0
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.d.ts +192 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +1553 -45
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/extraction/vue-extractor.d.ts.map +1 -1
- package/dist/extraction/vue-extractor.js +6 -3
- package/dist/extraction/vue-extractor.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
- package/dist/graph/traversal.d.ts.map +1 -1
- package/dist/graph/traversal.js +11 -2
- package/dist/graph/traversal.js.map +1 -1
- package/dist/index.d.ts +64 -23
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +137 -41
- package/dist/index.js.map +1 -1
- package/dist/installer/config-writer.d.ts +1 -1
- package/dist/installer/config-writer.js +1 -1
- package/dist/installer/index.d.ts +4 -4
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +100 -73
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/instructions-template.d.ts +34 -11
- package/dist/installer/instructions-template.d.ts.map +1 -1
- package/dist/installer/instructions-template.js +44 -12
- package/dist/installer/instructions-template.js.map +1 -1
- package/dist/installer/targets/antigravity.d.ts +6 -6
- package/dist/installer/targets/antigravity.js +14 -14
- package/dist/installer/targets/claude.d.ts +19 -13
- package/dist/installer/targets/claude.d.ts.map +1 -1
- package/dist/installer/targets/claude.js +97 -29
- package/dist/installer/targets/claude.js.map +1 -1
- package/dist/installer/targets/codebuddy.d.ts +17 -0
- package/dist/installer/targets/codebuddy.d.ts.map +1 -0
- package/dist/installer/targets/codebuddy.js +150 -0
- package/dist/installer/targets/codebuddy.js.map +1 -0
- package/dist/installer/targets/codex.js +5 -7
- package/dist/installer/targets/codex.js.map +1 -1
- package/dist/installer/targets/cursor.d.ts +1 -1
- package/dist/installer/targets/cursor.js +7 -7
- package/dist/installer/targets/deveco.d.ts +23 -0
- package/dist/installer/targets/deveco.d.ts.map +1 -0
- package/dist/installer/targets/deveco.js +217 -0
- package/dist/installer/targets/deveco.js.map +1 -0
- package/dist/installer/targets/gemini.js +5 -7
- package/dist/installer/targets/gemini.js.map +1 -1
- package/dist/installer/targets/hermes.js +15 -15
- package/dist/installer/targets/kiro.d.ts +1 -1
- package/dist/installer/targets/kiro.js +4 -4
- package/dist/installer/targets/opencode.d.ts +9 -1
- package/dist/installer/targets/opencode.d.ts.map +1 -1
- package/dist/installer/targets/opencode.js +92 -41
- package/dist/installer/targets/opencode.js.map +1 -1
- package/dist/installer/targets/registry.d.ts.map +1 -1
- package/dist/installer/targets/registry.js +4 -0
- package/dist/installer/targets/registry.js.map +1 -1
- package/dist/installer/targets/shared.d.ts +28 -4
- package/dist/installer/targets/shared.d.ts.map +1 -1
- package/dist/installer/targets/shared.js +32 -15
- package/dist/installer/targets/shared.js.map +1 -1
- package/dist/installer/targets/types.d.ts +9 -2
- package/dist/installer/targets/types.d.ts.map +1 -1
- package/dist/mcp/daemon-manager.d.ts +42 -0
- package/dist/mcp/daemon-manager.d.ts.map +1 -0
- package/dist/mcp/daemon-manager.js +129 -0
- package/dist/mcp/daemon-manager.js.map +1 -0
- package/dist/mcp/daemon-paths.d.ts +1 -1
- package/dist/mcp/daemon-paths.js +3 -3
- package/dist/mcp/daemon-registry.d.ts +47 -0
- package/dist/mcp/daemon-registry.d.ts.map +1 -0
- package/dist/mcp/daemon-registry.js +229 -0
- package/dist/mcp/daemon-registry.js.map +1 -0
- package/dist/mcp/daemon.d.ts.map +1 -1
- package/dist/mcp/daemon.js +27 -6
- package/dist/mcp/daemon.js.map +1 -1
- package/dist/mcp/dynamic-boundaries.d.ts +41 -0
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -0
- package/dist/mcp/dynamic-boundaries.js +359 -0
- package/dist/mcp/dynamic-boundaries.js.map +1 -0
- package/dist/mcp/engine.d.ts +4 -4
- package/dist/mcp/engine.d.ts.map +1 -1
- package/dist/mcp/engine.js +32 -24
- package/dist/mcp/engine.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -7
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +39 -18
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -0
- package/dist/mcp/liveness-watchdog.js +207 -0
- package/dist/mcp/liveness-watchdog.js.map +1 -0
- package/dist/mcp/proxy.d.ts +6 -0
- package/dist/mcp/proxy.d.ts.map +1 -1
- package/dist/mcp/proxy.js +75 -18
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/server-instructions.d.ts +22 -7
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +91 -59
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/session.d.ts +3 -1
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +43 -7
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/stdin-teardown.d.ts +27 -0
- package/dist/mcp/stdin-teardown.d.ts.map +1 -0
- package/dist/mcp/stdin-teardown.js +49 -0
- package/dist/mcp/stdin-teardown.js.map +1 -0
- package/dist/mcp/tools.d.ts +137 -16
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +1271 -219
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transport.d.ts +1 -1
- package/dist/mcp/transport.d.ts.map +1 -1
- package/dist/mcp/transport.js +20 -4
- package/dist/mcp/transport.js.map +1 -1
- package/dist/mcp/version.d.ts +1 -1
- package/dist/mcp/version.js +2 -2
- package/dist/project-config.d.ts +36 -0
- package/dist/project-config.d.ts.map +1 -0
- package/dist/project-config.js +235 -0
- package/dist/project-config.js.map +1 -0
- package/dist/reasoning/config.d.ts +45 -0
- package/dist/reasoning/config.d.ts.map +1 -0
- package/dist/reasoning/config.js +171 -0
- package/dist/reasoning/config.js.map +1 -0
- package/dist/reasoning/credentials.d.ts +5 -0
- package/dist/reasoning/credentials.d.ts.map +1 -0
- package/dist/reasoning/credentials.js +83 -0
- package/dist/reasoning/credentials.js.map +1 -0
- package/dist/reasoning/login.d.ts +21 -0
- package/dist/reasoning/login.d.ts.map +1 -0
- package/dist/reasoning/login.js +85 -0
- package/dist/reasoning/login.js.map +1 -0
- package/dist/reasoning/reasoner.d.ts +43 -0
- package/dist/reasoning/reasoner.d.ts.map +1 -0
- package/dist/reasoning/reasoner.js +308 -0
- package/dist/reasoning/reasoner.js.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts +33 -0
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -0
- package/dist/resolution/c-fnptr-synthesizer.js +352 -0
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -0
- package/dist/resolution/callback-synthesizer.d.ts +6 -1
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +1197 -1
- package/dist/resolution/callback-synthesizer.js.map +1 -1
- package/dist/resolution/frameworks/arkts-entry.d.ts +12 -0
- package/dist/resolution/frameworks/arkts-entry.d.ts.map +1 -0
- package/dist/resolution/frameworks/arkts-entry.js +214 -0
- package/dist/resolution/frameworks/arkts-entry.js.map +1 -0
- package/dist/resolution/frameworks/arkts-napi.d.ts +3 -0
- package/dist/resolution/frameworks/arkts-napi.d.ts.map +1 -0
- package/dist/resolution/frameworks/arkts-napi.js +166 -0
- package/dist/resolution/frameworks/arkts-napi.js.map +1 -0
- package/dist/resolution/frameworks/astro.d.ts +9 -0
- package/dist/resolution/frameworks/astro.d.ts.map +1 -0
- package/dist/resolution/frameworks/astro.js +169 -0
- package/dist/resolution/frameworks/astro.js.map +1 -0
- package/dist/resolution/frameworks/goframe.d.ts +41 -0
- package/dist/resolution/frameworks/goframe.d.ts.map +1 -0
- package/dist/resolution/frameworks/goframe.js +112 -0
- package/dist/resolution/frameworks/goframe.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +3 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/dist/resolution/frameworks/index.js +17 -1
- package/dist/resolution/frameworks/index.js.map +1 -1
- package/dist/resolution/frameworks/java.js +6 -1
- package/dist/resolution/frameworks/java.js.map +1 -1
- package/dist/resolution/frameworks/react.d.ts.map +1 -1
- package/dist/resolution/frameworks/react.js +32 -63
- package/dist/resolution/frameworks/react.js.map +1 -1
- package/dist/resolution/frameworks/svelte.js +6 -2
- package/dist/resolution/frameworks/svelte.js.map +1 -1
- package/dist/resolution/frameworks/vue.js +24 -27
- package/dist/resolution/frameworks/vue.js.map +1 -1
- package/dist/resolution/goframe-synthesizer.d.ts +28 -0
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -0
- package/dist/resolution/goframe-synthesizer.js +158 -0
- package/dist/resolution/goframe-synthesizer.js.map +1 -0
- package/dist/resolution/import-resolver.d.ts +10 -0
- package/dist/resolution/import-resolver.d.ts.map +1 -1
- package/dist/resolution/import-resolver.js +125 -2
- package/dist/resolution/import-resolver.js.map +1 -1
- package/dist/resolution/index.d.ts +37 -0
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +306 -3
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/name-matcher.d.ts +41 -0
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +519 -14
- package/dist/resolution/name-matcher.js.map +1 -1
- package/dist/resolution/strip-comments.d.ts +1 -1
- package/dist/resolution/strip-comments.d.ts.map +1 -1
- package/dist/resolution/strip-comments.js +2 -0
- package/dist/resolution/strip-comments.js.map +1 -1
- package/dist/resolution/types.d.ts +20 -3
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/search/query-utils.d.ts +17 -1
- package/dist/search/query-utils.d.ts.map +1 -1
- package/dist/search/query-utils.js +79 -10
- package/dist/search/query-utils.js.map +1 -1
- package/dist/sync/git-hooks.d.ts +4 -4
- package/dist/sync/git-hooks.js +5 -5
- package/dist/sync/watcher.d.ts +69 -2
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +226 -21
- package/dist/sync/watcher.js.map +1 -1
- package/dist/sync/worktree.d.ts +3 -3
- package/dist/sync/worktree.js +5 -5
- package/dist/telemetry/index.d.ts +143 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +541 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/types.d.ts +18 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/upgrade/index.d.ts.map +1 -1
- package/dist/upgrade/index.js +46 -10
- package/dist/upgrade/index.js.map +1 -1
- package/dist/utils.d.ts +46 -27
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +87 -53
- package/dist/utils.js.map +1 -1
- package/package.json +57 -57
- package/scripts/add-lang/bench.sh +60 -60
- package/scripts/add-lang/check-grammar.mjs +75 -75
- package/scripts/add-lang/dump-ast.mjs +103 -103
- package/scripts/add-lang/verify-extraction.mjs +70 -70
- package/scripts/agent-eval/ab-adoption.sh +91 -0
- package/scripts/agent-eval/ab-hook.sh +86 -0
- package/scripts/agent-eval/ab-impl.sh +78 -0
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -0
- package/scripts/agent-eval/ab-sufficiency.sh +78 -0
- package/scripts/agent-eval/arms-F.sh +21 -21
- package/scripts/agent-eval/arms-matrix.sh +37 -37
- package/scripts/agent-eval/audit.sh +68 -68
- package/scripts/agent-eval/bench-readme.sh +28 -28
- package/scripts/agent-eval/bench-why-repo.sh +22 -22
- package/scripts/agent-eval/block-read-hook.sh +19 -19
- package/scripts/agent-eval/hook-settings.json +15 -15
- package/scripts/agent-eval/itrun.sh +120 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -0
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -0
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -0
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -0
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -0
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -0
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -0
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -0
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -0
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -0
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -0
- package/scripts/agent-eval/offload-eval-setup.sh +24 -0
- package/scripts/agent-eval/offload-eval-styles.sh +72 -0
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -0
- package/scripts/agent-eval/offload-eval.md +76 -0
- package/scripts/agent-eval/parse-arms.mjs +116 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -84
- package/scripts/agent-eval/parse-run.mjs +45 -45
- package/scripts/agent-eval/parse-session.mjs +93 -93
- package/scripts/agent-eval/probe-context.mjs +21 -21
- package/scripts/agent-eval/probe-explore.mjs +40 -40
- package/scripts/agent-eval/probe-node.mjs +20 -20
- package/scripts/agent-eval/probe-sweep.mjs +119 -119
- package/scripts/agent-eval/probe-trace.mjs +20 -20
- package/scripts/agent-eval/redirect-read-hook.sh +38 -0
- package/scripts/agent-eval/run-agent.sh +34 -34
- package/scripts/agent-eval/run-all.sh +69 -67
- package/scripts/agent-eval/run-arms.sh +56 -56
- package/scripts/agent-eval/seq-matrix.mjs +137 -137
- package/scripts/build-bundle.sh +118 -118
- package/scripts/extract-release-notes.mjs +130 -130
- package/scripts/local-install.sh +41 -41
- package/scripts/npm-sdk.js +75 -75
- package/scripts/npm-shim.js +246 -246
- package/scripts/pack-npm.sh +119 -119
- package/scripts/prepare-release.mjs +270 -270
- package/scripts/qa_eval/README.md +400 -0
- package/scripts/qa_eval/agent_runner.py +526 -0
- package/scripts/qa_eval/data/.gitignore +4 -0
- package/scripts/qa_eval/data/test-set.jsonl +22 -0
- package/scripts/qa_eval/eval_metrics.py +233 -0
- package/scripts/qa_eval/external_agent.py +577 -0
- package/scripts/qa_eval/llm_config.py +92 -0
- package/scripts/qa_eval/memory_monitor.py +132 -0
- package/scripts/qa_eval/my_answer_accuracy.py +187 -0
- package/scripts/qa_eval/requirements.txt +2 -0
- package/scripts/qa_eval/run_pipeline.py +702 -0
- package/scripts/qa_eval/stats_efficiency.py +279 -0
- package/scripts/qa_eval/stats_scores.py +207 -0
- package/dist/bin/codegraph.d.ts +0 -26
- package/dist/bin/codegraph.d.ts.map +0 -1
- package/dist/bin/codegraph.js +0 -1572
- package/dist/bin/codegraph.js.map +0 -1
- package/dist/extraction/arkanalyzer-extractor.d.ts +0 -6
- package/dist/extraction/arkanalyzer-extractor.d.ts.map +0 -1
- package/dist/extraction/arkanalyzer-extractor.js +0 -11
- package/dist/extraction/arkanalyzer-extractor.js.map +0 -1
- package/dist/extraction/arkanalyzer-project.d.ts +0 -20
- package/dist/extraction/arkanalyzer-project.d.ts.map +0 -1
- package/dist/extraction/arkanalyzer-project.js +0 -596
- package/dist/extraction/arkanalyzer-project.js.map +0 -1
|
@@ -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;
|
|
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;;;OAGG;IACH,KAAK,IAAI,IAAI;IAIb;;;OAGG;IACH,IAAI,IAAI,IAAI;IAIZ,kEAAkE;IAClE,YAAY,IAAI,gBAAgB;YAIlB,aAAa;YA0Cb,gBAAgB;YA0DhB,eAAe;YAkBf,eAAe;IAiC7B;;;;;;;OAOG;YACW,iBAAiB;IAyB/B;;;OAGG;YACW,aAAa;CAgB5B"}
|
package/dist/mcp/session.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* tools/list, tools/call) over a single {@link JsonRpcTransport}. It owns
|
|
5
5
|
* per-client state only (which protocol version the client asked for, whether
|
|
6
6
|
* it advertised `roots`, the one-shot roots/list latch); the heavyweight
|
|
7
|
-
* resources (
|
|
7
|
+
* resources (HomeGraph, watcher, ToolHandler) live in the shared
|
|
8
8
|
* {@link MCPEngine} so daemon mode can collapse N inotify sets / DB handles
|
|
9
9
|
* to one.
|
|
10
10
|
*
|
|
@@ -52,6 +52,8 @@ const transport_1 = require("./transport");
|
|
|
52
52
|
const tools_1 = require("./tools");
|
|
53
53
|
const server_instructions_1 = require("./server-instructions");
|
|
54
54
|
const version_1 = require("./version");
|
|
55
|
+
const directory_1 = require("../directory");
|
|
56
|
+
const telemetry_1 = require("../telemetry");
|
|
55
57
|
/**
|
|
56
58
|
* MCP Server Info — kept on the session because some clients log it. The
|
|
57
59
|
* version tracks the real package version (was a hard-coded '0.1.0').
|
|
@@ -60,7 +62,7 @@ const version_1 = require("./version");
|
|
|
60
62
|
// payload the daemon would send — no drift between the two handshake paths.
|
|
61
63
|
exports.SERVER_INFO = {
|
|
62
64
|
name: 'homegraph',
|
|
63
|
-
version: version_1.
|
|
65
|
+
version: version_1.HomeGraphPackageVersion,
|
|
64
66
|
};
|
|
65
67
|
/** MCP Protocol Version (latest the server claims). */
|
|
66
68
|
exports.PROTOCOL_VERSION = '2024-11-05';
|
|
@@ -106,6 +108,8 @@ class MCPSession {
|
|
|
106
108
|
transport;
|
|
107
109
|
engine;
|
|
108
110
|
clientSupportsRoots = false;
|
|
111
|
+
/** From the initialize handshake — attributes usage rollups to the agent host. */
|
|
112
|
+
clientInfo;
|
|
109
113
|
rootsAttempted = false;
|
|
110
114
|
resolvePromise = null;
|
|
111
115
|
explicitProjectPath;
|
|
@@ -179,6 +183,12 @@ class MCPSession {
|
|
|
179
183
|
async handleInitialize(request) {
|
|
180
184
|
const params = request.params;
|
|
181
185
|
this.clientSupportsRoots = !!params?.capabilities?.roots;
|
|
186
|
+
if (params?.clientInfo) {
|
|
187
|
+
this.clientInfo = {
|
|
188
|
+
name: typeof params.clientInfo.name === 'string' ? params.clientInfo.name : undefined,
|
|
189
|
+
version: typeof params.clientInfo.version === 'string' ? params.clientInfo.version : undefined,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
182
192
|
// Explicit project signal, strongest first: client-provided rootUri /
|
|
183
193
|
// workspaceFolders (LSP-style), else the --path the server was launched
|
|
184
194
|
// with. cwd is NOT used here — we defer it so a roots/list answer can
|
|
@@ -193,12 +203,24 @@ class MCPSession {
|
|
|
193
203
|
else if (this.explicitProjectPath) {
|
|
194
204
|
explicitPath = this.explicitProjectPath;
|
|
195
205
|
}
|
|
206
|
+
// Pick the instructions variant by the root's index state — a cheap
|
|
207
|
+
// synchronous walk-up (existsSync loop only, no DB open, so the #172
|
|
208
|
+
// respond-fast contract holds). When the root IS indexed, send the full
|
|
209
|
+
// single-project playbook. When it ISN'T, send the per-project variant
|
|
210
|
+
// (tools are still exposed — see handleToolsList): it tells the agent there
|
|
211
|
+
// is no default project and to pass `projectPath` to any project that has a
|
|
212
|
+
// `.homegraph/`. Gating tool AVAILABILITY on whether `./` is indexed was the
|
|
213
|
+
// #964 bug — it broke monorepos (only sub-projects indexed) and never
|
|
214
|
+
// surfaced the tools after a mid-session `homegraph init`. When no explicit
|
|
215
|
+
// path is known yet (roots/list dance pending), cwd is the best predictor of
|
|
216
|
+
// where the default project will resolve.
|
|
217
|
+
const indexed = (0, directory_1.findNearestHomeGraphRoot)(explicitPath ?? process.cwd()) !== null;
|
|
196
218
|
// Respond to the handshake BEFORE doing any heavy init — see issue #172.
|
|
197
219
|
this.transport.sendResult(request.id, {
|
|
198
220
|
protocolVersion: exports.PROTOCOL_VERSION,
|
|
199
221
|
capabilities: { tools: {} },
|
|
200
222
|
serverInfo: exports.SERVER_INFO,
|
|
201
|
-
instructions: server_instructions_1.SERVER_INSTRUCTIONS,
|
|
223
|
+
instructions: indexed ? server_instructions_1.SERVER_INSTRUCTIONS : server_instructions_1.SERVER_INSTRUCTIONS_NO_ROOT_INDEX,
|
|
202
224
|
});
|
|
203
225
|
if (explicitPath) {
|
|
204
226
|
// Kick off engine init in the background. If another session in the
|
|
@@ -209,6 +231,17 @@ class MCPSession {
|
|
|
209
231
|
}
|
|
210
232
|
async handleToolsList(request) {
|
|
211
233
|
await this.retryInitIfNeeded();
|
|
234
|
+
// Always expose the tools — even when the server root has no index. Gating
|
|
235
|
+
// availability on whether `./` is indexed (the old behavior) breaks the
|
|
236
|
+
// monorepo case where only sub-projects carry a `.homegraph/` (the agent
|
|
237
|
+
// saw zero tools and couldn't even reach an indexed sub-project by
|
|
238
|
+
// `projectPath`), and it hides the tools from a session that started before
|
|
239
|
+
// the user ran `homegraph init` (most hosts request the list once, so the
|
|
240
|
+
// freshly-built index never surfaces). #964. The not-indexed case is still
|
|
241
|
+
// safe: a call against an un-indexed path returns SUCCESS-shaped guidance
|
|
242
|
+
// ("pass projectPath / run homegraph init"), never `isError`, so it can't
|
|
243
|
+
// teach the agent to abandon homegraph. `getTools()` returns the default
|
|
244
|
+
// surface even before a project is open.
|
|
212
245
|
this.transport.sendResult(request.id, {
|
|
213
246
|
tools: this.engine.getToolHandler().getTools(),
|
|
214
247
|
});
|
|
@@ -229,6 +262,9 @@ class MCPSession {
|
|
|
229
262
|
await this.retryInitIfNeeded();
|
|
230
263
|
const result = await this.engine.getToolHandler().execute(toolName, toolArgs);
|
|
231
264
|
this.transport.sendResult(request.id, result);
|
|
265
|
+
// After the reply is on the wire — telemetry must never delay a tool
|
|
266
|
+
// response (in-memory increment only; see src/telemetry).
|
|
267
|
+
(0, telemetry_1.getTelemetry)().recordUsage('mcp_tool', toolName, !result.isError, this.clientInfo);
|
|
232
268
|
}
|
|
233
269
|
/**
|
|
234
270
|
* Lazy default-project resolution. Three layers:
|
|
@@ -246,7 +282,7 @@ class MCPSession {
|
|
|
246
282
|
catch { /* fall through to retry */ }
|
|
247
283
|
this.resolvePromise = null;
|
|
248
284
|
}
|
|
249
|
-
if (this.engine.
|
|
285
|
+
if (this.engine.hasDefaultHomeGraph())
|
|
250
286
|
return;
|
|
251
287
|
const hint = this.explicitProjectPath ?? this.engine.getProjectPath();
|
|
252
288
|
if (!hint && !this.rootsAttempted) {
|
|
@@ -259,7 +295,7 @@ class MCPSession {
|
|
|
259
295
|
}
|
|
260
296
|
catch { /* fall through */ }
|
|
261
297
|
this.resolvePromise = null;
|
|
262
|
-
if (this.engine.
|
|
298
|
+
if (this.engine.hasDefaultHomeGraph())
|
|
263
299
|
return;
|
|
264
300
|
}
|
|
265
301
|
// Last resort: walk from the best candidate (sync open). Picks up
|
|
@@ -280,12 +316,12 @@ class MCPSession {
|
|
|
280
316
|
target = rootPath;
|
|
281
317
|
}
|
|
282
318
|
else {
|
|
283
|
-
process.stderr.write('[
|
|
319
|
+
process.stderr.write('[HomeGraph MCP] Client returned no workspace roots; falling back to process cwd.\n');
|
|
284
320
|
}
|
|
285
321
|
}
|
|
286
322
|
catch (err) {
|
|
287
323
|
const msg = err instanceof Error ? err.message : String(err);
|
|
288
|
-
process.stderr.write(`[
|
|
324
|
+
process.stderr.write(`[HomeGraph MCP] roots/list request failed (${msg}); falling back to process cwd.\n`);
|
|
289
325
|
}
|
|
290
326
|
await this.engine.ensureInitialized(target);
|
|
291
327
|
}
|
package/dist/mcp/session.js.map
CHANGED
|
@@ -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,+
|
|
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,4CAAwD;AAExD;;;GAGG;AACH,2EAA2E;AAC3E,4EAA4E;AAC/D,QAAA,WAAW,GAAG;IACzB,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,iCAAuB;CACjC,CAAC;AAEF,uDAAuD;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AAI,CAAC,MAAM,CAAC,mBAAmB,EAAE;gBAAE,OAAO;QAChD,CAAC;QAED,kEAAkE;QAClE,mDAAmD;QACnD,MAAM,SAAS,GAAG,IAAI,IAAI,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;AAjPD,gCAiPC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Treat a stdin failure as a shutdown signal — issue #799.
|
|
3
|
+
*
|
|
4
|
+
* An MCP stdio server's lifeline is its stdin: when the host/client goes away,
|
|
5
|
+
* stdin should end and the server should exit. The server paths listened for
|
|
6
|
+
* `'end'` and `'close'` — but NOT `'error'`.
|
|
7
|
+
*
|
|
8
|
+
* That gap bites with a socket-backed stdin, which is the shape VS Code /
|
|
9
|
+
* Claude Code use (a socketpair, not a pipe). When the client dies, the socket
|
|
10
|
+
* can surface as an `'error'` (ECONNRESET / hangup) rather than a clean
|
|
11
|
+
* `'close'`. With no `'error'` listener, Node escalates it to the process-wide
|
|
12
|
+
* `uncaughtException` handler, which logs and keeps running — so the server
|
|
13
|
+
* orphans instead of exiting. Worse, on Linux a `POLLHUP` socket fd left
|
|
14
|
+
* registered in epoll wakes the event loop continuously, pinning a core at
|
|
15
|
+
* 100% CPU (the spin reported in #799); once the main thread spins, the
|
|
16
|
+
* `setInterval` PPID watchdog can't even fire, so the orphan runs forever.
|
|
17
|
+
*
|
|
18
|
+
* Fix: listen for `'error'` as well, and DESTROY the stdin stream on any
|
|
19
|
+
* terminal event so the fd leaves epoll and can't keep churning, then run the
|
|
20
|
+
* caller's shutdown. Fires `onTerminal` at most once — callers' shutdowns are
|
|
21
|
+
* already re-entry-guarded, but the single-shot guard also keeps `destroy()`'s
|
|
22
|
+
* follow-on `'close'` from re-invoking it.
|
|
23
|
+
*
|
|
24
|
+
* `stream` is injectable for tests; it defaults to `process.stdin`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function treatStdinFailureAsShutdown(onTerminal: () => void, stream?: NodeJS.ReadableStream): void;
|
|
27
|
+
//# sourceMappingURL=stdin-teardown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin-teardown.d.ts","sourceRoot":"","sources":["../../src/mcp/stdin-teardown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,IAAI,EACtB,MAAM,GAAE,MAAM,CAAC,cAA8B,GAC5C,IAAI,CAiBN"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.treatStdinFailureAsShutdown = treatStdinFailureAsShutdown;
|
|
4
|
+
/**
|
|
5
|
+
* Treat a stdin failure as a shutdown signal — issue #799.
|
|
6
|
+
*
|
|
7
|
+
* An MCP stdio server's lifeline is its stdin: when the host/client goes away,
|
|
8
|
+
* stdin should end and the server should exit. The server paths listened for
|
|
9
|
+
* `'end'` and `'close'` — but NOT `'error'`.
|
|
10
|
+
*
|
|
11
|
+
* That gap bites with a socket-backed stdin, which is the shape VS Code /
|
|
12
|
+
* Claude Code use (a socketpair, not a pipe). When the client dies, the socket
|
|
13
|
+
* can surface as an `'error'` (ECONNRESET / hangup) rather than a clean
|
|
14
|
+
* `'close'`. With no `'error'` listener, Node escalates it to the process-wide
|
|
15
|
+
* `uncaughtException` handler, which logs and keeps running — so the server
|
|
16
|
+
* orphans instead of exiting. Worse, on Linux a `POLLHUP` socket fd left
|
|
17
|
+
* registered in epoll wakes the event loop continuously, pinning a core at
|
|
18
|
+
* 100% CPU (the spin reported in #799); once the main thread spins, the
|
|
19
|
+
* `setInterval` PPID watchdog can't even fire, so the orphan runs forever.
|
|
20
|
+
*
|
|
21
|
+
* Fix: listen for `'error'` as well, and DESTROY the stdin stream on any
|
|
22
|
+
* terminal event so the fd leaves epoll and can't keep churning, then run the
|
|
23
|
+
* caller's shutdown. Fires `onTerminal` at most once — callers' shutdowns are
|
|
24
|
+
* already re-entry-guarded, but the single-shot guard also keeps `destroy()`'s
|
|
25
|
+
* follow-on `'close'` from re-invoking it.
|
|
26
|
+
*
|
|
27
|
+
* `stream` is injectable for tests; it defaults to `process.stdin`.
|
|
28
|
+
*/
|
|
29
|
+
function treatStdinFailureAsShutdown(onTerminal, stream = process.stdin) {
|
|
30
|
+
let fired = false;
|
|
31
|
+
const fire = () => {
|
|
32
|
+
if (fired)
|
|
33
|
+
return;
|
|
34
|
+
fired = true;
|
|
35
|
+
// Drop the fd from epoll so a hung/half-closed socket can't keep waking
|
|
36
|
+
// the loop. Best-effort: the stream may already be torn down.
|
|
37
|
+
try {
|
|
38
|
+
stream.destroy?.();
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
/* already gone */
|
|
42
|
+
}
|
|
43
|
+
onTerminal();
|
|
44
|
+
};
|
|
45
|
+
stream.on('end', fire);
|
|
46
|
+
stream.on('close', fire);
|
|
47
|
+
stream.on('error', fire);
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=stdin-teardown.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stdin-teardown.js","sourceRoot":"","sources":["../../src/mcp/stdin-teardown.ts"],"names":[],"mappings":";;AAyBA,kEAoBC;AA7CD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,2BAA2B,CACzC,UAAsB,EACtB,SAAgC,OAAO,CAAC,KAAK;IAE7C,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,MAAM,IAAI,GAAG,GAAS,EAAE;QACtB,IAAI,KAAK;YAAE,OAAO;QAClB,KAAK,GAAG,IAAI,CAAC;QACb,wEAAwE;QACxE,8DAA8D;QAC9D,IAAI,CAAC;YACF,MAAuC,CAAC,OAAO,EAAE,EAAE,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,kBAAkB;QACpB,CAAC;QACD,UAAU,EAAE,CAAC;IACf,CAAC,CAAC;IACF,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
package/dist/mcp/tools.d.ts
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* MCP Tool Definitions
|
|
3
3
|
*
|
|
4
|
-
* Defines the tools exposed by the
|
|
4
|
+
* Defines the tools exposed by the HomeGraph MCP server.
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
6
|
+
import type HomeGraph from '../index';
|
|
7
7
|
import type { PendingFile } from '../sync';
|
|
8
|
+
/**
|
|
9
|
+
* An expected, recoverable "homegraph can't serve this" condition — most
|
|
10
|
+
* importantly a project with no index. The dispatch catch converts these to
|
|
11
|
+
* SUCCESS-shaped responses (guidance text, NO isError): an `isError: true`
|
|
12
|
+
* early in a session teaches the agent the toolset is broken and it stops
|
|
13
|
+
* calling homegraph entirely (observed repeatedly), which is exactly wrong
|
|
14
|
+
* for conditions the agent can simply work around (use built-in tools for
|
|
15
|
+
* that codebase / pass projectPath). isError is reserved for "stop trying"
|
|
16
|
+
* cases: security refusals ({@link PathRefusalError}) and genuine
|
|
17
|
+
* malfunctions.
|
|
18
|
+
*/
|
|
19
|
+
export declare class NotIndexedError extends Error {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A security refusal (sensitive system path). Stays `isError: true` WITHOUT
|
|
23
|
+
* retry guidance — abandoning this path is the desired agent reaction.
|
|
24
|
+
*/
|
|
25
|
+
export declare class PathRefusalError extends Error {
|
|
26
|
+
}
|
|
8
27
|
/**
|
|
9
28
|
* Calculate the recommended number of homegraph_explore calls based on project size.
|
|
10
29
|
* Larger codebases need more exploration calls to cover their surface area,
|
|
@@ -38,7 +57,7 @@ export interface ExploreOutputBudget {
|
|
|
38
57
|
maxCharsPerFile: number;
|
|
39
58
|
/** Cluster gap threshold in lines — tighter clustering on small projects. */
|
|
40
59
|
gapThreshold: number;
|
|
41
|
-
/** Max symbols listed in the per-file header (
|
|
60
|
+
/** Max symbols listed in the per-file header (``**`path`** — sym(kind), ...``). */
|
|
42
61
|
maxSymbolsInFileHeader: number;
|
|
43
62
|
/** Max edges shown per relationship kind in the Relationships section. */
|
|
44
63
|
maxEdgesPerRelationshipKind: number;
|
|
@@ -74,6 +93,15 @@ export declare function formatStaleBanner(stale: PendingFile[]): string;
|
|
|
74
93
|
* without bloating the main banner.
|
|
75
94
|
*/
|
|
76
95
|
export declare function formatStaleFooter(stale: PendingFile[]): string;
|
|
96
|
+
/**
|
|
97
|
+
* Whole-index degradation banner (issue #876). Emitted at the top of a read
|
|
98
|
+
* tool response when live watching has permanently stopped — at which point
|
|
99
|
+
* `getPendingFiles()` is empty, so the per-file banner above can't fire even
|
|
100
|
+
* though the index is now FROZEN and silently drifting stale. Leads with the
|
|
101
|
+
* agent-actionable instruction (Read directly) and carries the reason, which
|
|
102
|
+
* already names the operator remedy (`homegraph sync` / git hooks).
|
|
103
|
+
*/
|
|
104
|
+
export declare function formatDegradedBanner(reason: string | null): string;
|
|
77
105
|
/**
|
|
78
106
|
* MCP Tool definition
|
|
79
107
|
*/
|
|
@@ -103,7 +131,7 @@ export interface ToolResult {
|
|
|
103
131
|
isError?: boolean;
|
|
104
132
|
}
|
|
105
133
|
/**
|
|
106
|
-
* All
|
|
134
|
+
* All HomeGraph MCP tools
|
|
107
135
|
*
|
|
108
136
|
* Designed for minimal context usage - use homegraph_explore as the primary tool
|
|
109
137
|
* (one call usually answers the whole question), and only use other tools for
|
|
@@ -115,12 +143,12 @@ export declare const tools: ToolDefinition[];
|
|
|
115
143
|
/**
|
|
116
144
|
* Allowlist-filtered tool definitions WITHOUT an engine — the static surface the
|
|
117
145
|
* proxy answers `tools/list` with before any project is open. Mirrors
|
|
118
|
-
* `ToolHandler.getTools()` in the no-
|
|
146
|
+
* `ToolHandler.getTools()` in the no-HomeGraph case (the dynamic per-repo budget
|
|
119
147
|
* note in a description only adds once `cg` is loaded; the schemas are static).
|
|
120
148
|
*/
|
|
121
149
|
export declare function getStaticTools(): ToolDefinition[];
|
|
122
150
|
/**
|
|
123
|
-
* Tool handler that executes tools against a
|
|
151
|
+
* Tool handler that executes tools against a HomeGraph instance
|
|
124
152
|
*
|
|
125
153
|
* Supports cross-project queries via the projectPath parameter.
|
|
126
154
|
* Other projects are opened on-demand and cached for performance.
|
|
@@ -131,11 +159,11 @@ export declare class ToolHandler {
|
|
|
131
159
|
private defaultProjectHint;
|
|
132
160
|
private worktreeMismatchCache;
|
|
133
161
|
private catchUpGate;
|
|
134
|
-
constructor(cg:
|
|
162
|
+
constructor(cg: HomeGraph | null);
|
|
135
163
|
/**
|
|
136
|
-
* Update the default
|
|
164
|
+
* Update the default HomeGraph instance (e.g. after lazy initialization)
|
|
137
165
|
*/
|
|
138
|
-
|
|
166
|
+
setDefaultHomeGraph(cg: HomeGraph): void;
|
|
139
167
|
/**
|
|
140
168
|
* Engine-only: register the catch-up sync promise so the next `execute()`
|
|
141
169
|
* call awaits it before serving. The handler swallows rejections (the
|
|
@@ -144,15 +172,25 @@ export declare class ToolHandler {
|
|
|
144
172
|
* stale data, which is what would have happened without the gate.
|
|
145
173
|
*/
|
|
146
174
|
setCatchUpGate(p: Promise<void> | null): void;
|
|
175
|
+
/**
|
|
176
|
+
* Await the catch-up gate, but no longer than the configured timeout (#905).
|
|
177
|
+
* If the reconcile settles first, we got the fully-reconciled answer. If the
|
|
178
|
+
* timeout wins, we serve the call now and let the reconcile finish in the
|
|
179
|
+
* background — it yields to the event loop (see SYNC_RECONCILE_YIELD_INTERVAL),
|
|
180
|
+
* so a concurrent read still runs against the same connection. Never throws:
|
|
181
|
+
* a failed reconcile is logged by the engine, and we serve best-effort over
|
|
182
|
+
* the same potentially-stale data the un-gated path would have.
|
|
183
|
+
*/
|
|
184
|
+
private awaitCatchUpGate;
|
|
147
185
|
/**
|
|
148
186
|
* Record the directory the server tried to resolve the default project from.
|
|
149
187
|
* Used only to make the "no default project" error actionable.
|
|
150
188
|
*/
|
|
151
189
|
setDefaultProjectHint(searchedPath: string): void;
|
|
152
190
|
/**
|
|
153
|
-
* Whether a default
|
|
191
|
+
* Whether a default HomeGraph instance is available
|
|
154
192
|
*/
|
|
155
|
-
|
|
193
|
+
hasDefaultHomeGraph(): boolean;
|
|
156
194
|
/**
|
|
157
195
|
* Optional allowlist of exposed tools, parsed from the HOMEGRAPH_MCP_TOOLS
|
|
158
196
|
* env var (comma-separated short names, e.g. "trace,search,node,context").
|
|
@@ -172,15 +210,26 @@ export declare class ToolHandler {
|
|
|
172
210
|
*/
|
|
173
211
|
getTools(): ToolDefinition[];
|
|
174
212
|
/**
|
|
175
|
-
* Get
|
|
213
|
+
* Get HomeGraph instance for a project
|
|
176
214
|
*
|
|
177
|
-
* If projectPath is provided, opens that project's
|
|
178
|
-
* Otherwise returns the default
|
|
215
|
+
* If projectPath is provided, opens that project's HomeGraph (cached).
|
|
216
|
+
* Otherwise returns the default HomeGraph instance.
|
|
179
217
|
*
|
|
180
218
|
* Walks up parent directories to find the nearest .homegraph/ folder,
|
|
181
219
|
* similar to how git finds .git/ directories.
|
|
182
220
|
*/
|
|
183
|
-
private
|
|
221
|
+
private getHomeGraph;
|
|
222
|
+
/**
|
|
223
|
+
* Heal a long-lived connection whose `.homegraph/` was removed and recreated
|
|
224
|
+
* at the same path (a worktree recreated, or `rm -rf .homegraph` + re-init)
|
|
225
|
+
* before handing it to a tool. Otherwise the daemon keeps serving the
|
|
226
|
+
* pre-removal snapshot from its now-unlinked file handle until restart — and
|
|
227
|
+
* because the daemon registry is keyed by path, a same-path recreate routes
|
|
228
|
+
* new clients straight back to this same stale daemon (#925). The check is one
|
|
229
|
+
* stat() and a no-op unless the inode actually changed; it never throws into a
|
|
230
|
+
* tool call.
|
|
231
|
+
*/
|
|
232
|
+
private freshen;
|
|
184
233
|
/**
|
|
185
234
|
* Close all cached project connections
|
|
186
235
|
*/
|
|
@@ -241,6 +290,16 @@ export declare class ToolHandler {
|
|
|
241
290
|
* Handle homegraph_search
|
|
242
291
|
*/
|
|
243
292
|
private handleSearch;
|
|
293
|
+
/**
|
|
294
|
+
* Group symbol matches into DISTINCT DEFINITIONS — one group per
|
|
295
|
+
* (filePath, qualifiedName), so same-file overloads stay together while
|
|
296
|
+
* unrelated same-named classes across a monorepo's apps (#764: one
|
|
297
|
+
* `UserService` per NestJS app) are kept apart. Optionally narrowed by a
|
|
298
|
+
* `file` path/suffix first.
|
|
299
|
+
*/
|
|
300
|
+
private groupDefinitions;
|
|
301
|
+
/** Section heading for one distinct definition in grouped output. */
|
|
302
|
+
private definitionHeading;
|
|
244
303
|
/**
|
|
245
304
|
* Handle homegraph_callers
|
|
246
305
|
*/
|
|
@@ -275,6 +334,47 @@ export declare class ToolHandler {
|
|
|
275
334
|
* dropping unrelated `OmsOrderService::list`.
|
|
276
335
|
*/
|
|
277
336
|
private buildFlowFromNamedSymbols;
|
|
337
|
+
/**
|
|
338
|
+
* Dynamic-boundary surfacing (#687): when the flow among the agent's named
|
|
339
|
+
* symbols does not fully connect, scan the disconnected symbols' bodies for
|
|
340
|
+
* dynamic-dispatch sites (computed member calls, getattr, reflection, typed
|
|
341
|
+
* message buses, runtime-keyed emits) and ANNOUNCE the boundary — the exact
|
|
342
|
+
* site, the form, and (when a key is statically visible) candidate targets —
|
|
343
|
+
* instead of guessing edges. The answer to "how does A reach B" when no
|
|
344
|
+
* static path exists IS the dispatch site: that's where the flow continues
|
|
345
|
+
* at runtime. Query-time, deterministic, zero graph mutation; a fully
|
|
346
|
+
* connected flow never reaches this method.
|
|
347
|
+
*/
|
|
348
|
+
private buildDynamicBoundaries;
|
|
349
|
+
/**
|
|
350
|
+
* Interface/registry-dispatch announcement — #687 extended to GRAPH-visible
|
|
351
|
+
* polymorphism (the body-scan can't see it: `nodeType.execute()` is textually
|
|
352
|
+
* an ordinary call; the polymorphism lives in the `implements`/`extends` edges).
|
|
353
|
+
*
|
|
354
|
+
* A method the agent named that resolves to a large same-name family whose
|
|
355
|
+
* definers overwhelmingly implement/extend ONE supertype is a runtime dispatch:
|
|
356
|
+
* the concrete target is chosen at runtime from N implementations, so no single
|
|
357
|
+
* static edge is "the answer" — the implementations ARE the continuations. We
|
|
358
|
+
* announce the supertype, its TRUE implementer count, and a few concrete targets,
|
|
359
|
+
* then steer to homegraph_explore. Graph-only, query-time, zero mutation; the
|
|
360
|
+
* caller fires it ONLY for an UNCOVERED named token, so a connected flow is silent.
|
|
361
|
+
*
|
|
362
|
+
* Robust to FTS sampling bias: the same-name family is a capped FTS sample that
|
|
363
|
+
* over-represents whatever FTS ranks first (n8n: DB `TableOperation.execute`
|
|
364
|
+
* outnumbered `INodeType.execute` in the sample 7:6 even though INodeType has
|
|
365
|
+
* 611 implementers vs a handful). So candidate supertypes are ranked by their
|
|
366
|
+
* TRUE graph-wide implementer count, NOT their frequency in the sample.
|
|
367
|
+
*/
|
|
368
|
+
private buildPolymorphicBoundaries;
|
|
369
|
+
/**
|
|
370
|
+
* Shortlist candidate runtime targets for a dispatch key surfaced by
|
|
371
|
+
* {@link buildDynamicBoundaries}. Exact conventional names first (`save` →
|
|
372
|
+
* `onSave`/`handleSave`; `CreateCmd` → `CreateCmdHandler`), then FTS, with a
|
|
373
|
+
* normalized-containment post-filter (FTS camel-splitting is fuzzier than a
|
|
374
|
+
* candidate list should be). Symbols the agent already named sort first and
|
|
375
|
+
* are marked — that's the "you were right, here's the wiring" case.
|
|
376
|
+
*/
|
|
377
|
+
private boundaryCandidates;
|
|
278
378
|
/**
|
|
279
379
|
* Compact "blast radius" for the entry symbols of an explore result: who
|
|
280
380
|
* depends on each (callers) and which test files cover it — LOCATIONS ONLY,
|
|
@@ -289,7 +389,7 @@ export declare class ToolHandler {
|
|
|
289
389
|
* PageRank) from the query's matched SEED nodes over the call/reference graph.
|
|
290
390
|
*
|
|
291
391
|
* This is the ranking signal text search (FTS/bm25) CANNOT provide, and it's
|
|
292
|
-
*
|
|
392
|
+
* homegraph's home turf: relevance by STRUCTURE, not words. A file whose
|
|
293
393
|
* symbols are call-connected to the matched cluster accrues walk mass and
|
|
294
394
|
* ranks high; a lone TEXT match — e.g. `LensSwitcher.swift` matched the word
|
|
295
395
|
* "switch" from `switchOrganization`, but calls none of `setUser`/`fetchUser`
|
|
@@ -317,6 +417,20 @@ export declare class ToolHandler {
|
|
|
317
417
|
* Handle homegraph_node
|
|
318
418
|
*/
|
|
319
419
|
private handleNode;
|
|
420
|
+
/**
|
|
421
|
+
* FILE READ MODE: resolve `fileArg` (path or basename) to an indexed file and
|
|
422
|
+
* read it like the Read tool — its current on-disk source with line numbers,
|
|
423
|
+
* narrowable with `offset`/`limit` exactly as Read's are — preceded by a
|
|
424
|
+
* one-line blast-radius header (which files depend on it). `symbolsOnly`
|
|
425
|
+
* returns just the structural map (symbols + dependents) instead of source.
|
|
426
|
+
*
|
|
427
|
+
* Parity goal: the numbered source block is byte-for-byte the shape Read
|
|
428
|
+
* returns (`<n>\t<line>`, no padding), so the agent treats it as a Read — only
|
|
429
|
+
* faster (served from the index) and with the blast radius attached. Security:
|
|
430
|
+
* yaml/properties files are summarized by key, never dumped (#383); reads go
|
|
431
|
+
* through validatePathWithinRoot (#527).
|
|
432
|
+
*/
|
|
433
|
+
private handleFileView;
|
|
320
434
|
/** Render one symbol: details + (optional) body/outline + its caller/callee trail. */
|
|
321
435
|
private renderNodeSection;
|
|
322
436
|
/**
|
|
@@ -396,6 +510,13 @@ export declare class ToolHandler {
|
|
|
396
510
|
private truncateOutput;
|
|
397
511
|
private formatSearchResults;
|
|
398
512
|
private formatNodeList;
|
|
513
|
+
/**
|
|
514
|
+
* Relationship label for a non-`calls` edge in callers/callees lists. A
|
|
515
|
+
* function-as-value edge (#756) is the high-signal one: `callers(cb)`
|
|
516
|
+
* showing "via callback registration" tells the agent this is where the
|
|
517
|
+
* callback is WIRED, not where it's invoked.
|
|
518
|
+
*/
|
|
519
|
+
private edgeLabel;
|
|
399
520
|
private formatImpact;
|
|
400
521
|
/**
|
|
401
522
|
* Build a compact structural outline of a container symbol from its
|
package/dist/mcp/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AAetC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file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