homegraph 1.4.1 → 1.5.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 +305 -268
- package/dist/bin/command-supervision.d.ts.map +1 -1
- package/dist/bin/command-supervision.js +7 -4
- package/dist/bin/command-supervision.js.map +1 -1
- package/dist/bin/homegraph.js +304 -81
- package/dist/bin/homegraph.js.map +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +32 -11
- package/dist/context/index.js.map +1 -1
- package/dist/db/index.d.ts +143 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +305 -28
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.js +37 -37
- package/dist/db/queries.d.ts +43 -4
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +294 -170
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +203 -203
- package/dist/db/sqlite-adapter.d.ts +24 -17
- package/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/dist/db/sqlite-adapter.js +292 -36
- package/dist/db/sqlite-adapter.js.map +1 -1
- package/dist/db/wal-valve.d.ts +15 -2
- package/dist/db/wal-valve.d.ts.map +1 -1
- package/dist/db/wal-valve.js +88 -6
- package/dist/db/wal-valve.js.map +1 -1
- package/dist/directory.js +5 -5
- package/dist/extraction/arkts-batch-worker.js +3 -2
- package/dist/extraction/arkts-batch-worker.js.map +1 -1
- package/dist/extraction/default-ignore.d.ts +39 -0
- package/dist/extraction/default-ignore.d.ts.map +1 -0
- package/dist/extraction/default-ignore.js +221 -0
- package/dist/extraction/default-ignore.js.map +1 -0
- package/dist/extraction/index.d.ts +9 -10
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +227 -323
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.d.ts +2 -4
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.js +6 -21
- package/dist/extraction/languages/arkts-viewtree.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +100 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +1777 -173
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/store-worker.d.ts +20 -0
- package/dist/extraction/store-worker.d.ts.map +1 -0
- package/dist/extraction/store-worker.js +102 -0
- package/dist/extraction/store-worker.js.map +1 -0
- package/dist/extraction/store-writer.d.ts +48 -0
- package/dist/extraction/store-writer.d.ts.map +1 -0
- package/dist/extraction/store-writer.js +167 -0
- package/dist/extraction/store-writer.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +47 -0
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +14 -4
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -1
- package/dist/extraction/wasm-runtime-flags.js +55 -7
- package/dist/extraction/wasm-runtime-flags.js.map +1 -1
- package/dist/index.d.ts +16 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +135 -97
- package/dist/index.js.map +1 -1
- package/dist/installer/instructions-template.js +9 -9
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +185 -73
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/query-worker.d.ts +2 -2
- package/dist/mcp/query-worker.js +2 -2
- package/dist/mcp/server-instructions.js +47 -47
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +42 -26
- package/dist/mcp/tools.js.map +1 -1
- package/dist/reasoning/reasoner.js +32 -32
- package/dist/resolution/callback-synthesizer.d.ts +52 -16
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +234 -180
- package/dist/resolution/callback-synthesizer.js.map +1 -1
- package/dist/resolution/cooperative-yield.d.ts +10 -2
- package/dist/resolution/cooperative-yield.d.ts.map +1 -1
- package/dist/resolution/cooperative-yield.js +6 -4
- package/dist/resolution/cooperative-yield.js.map +1 -1
- package/dist/resolution/frameworks/go.d.ts.map +1 -1
- package/dist/resolution/frameworks/go.js +29 -6
- package/dist/resolution/frameworks/go.js.map +1 -1
- package/dist/resolution/import-resolver.d.ts +2 -3
- package/dist/resolution/import-resolver.d.ts.map +1 -1
- package/dist/resolution/import-resolver.js +166 -7
- package/dist/resolution/import-resolver.js.map +1 -1
- package/dist/resolution/index.d.ts +87 -2
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +739 -131
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/memory-budget.d.ts +48 -0
- package/dist/resolution/memory-budget.d.ts.map +1 -0
- package/dist/resolution/memory-budget.js +162 -0
- package/dist/resolution/memory-budget.js.map +1 -0
- package/dist/resolution/name-matcher.d.ts +12 -1
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +439 -97
- package/dist/resolution/name-matcher.js.map +1 -1
- package/dist/resolution/resolver-pool.d.ts +106 -0
- package/dist/resolution/resolver-pool.d.ts.map +1 -0
- package/dist/resolution/resolver-pool.js +344 -0
- package/dist/resolution/resolver-pool.js.map +1 -0
- package/dist/resolution/resolver-worker.d.ts +17 -0
- package/dist/resolution/resolver-worker.d.ts.map +1 -0
- package/dist/resolution/resolver-worker.js +141 -0
- package/dist/resolution/resolver-worker.js.map +1 -0
- package/dist/resolution/types.d.ts +3 -0
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/spec/build/diff-parser.d.ts +55 -0
- package/dist/spec/build/diff-parser.d.ts.map +1 -0
- package/dist/spec/build/diff-parser.js +205 -0
- package/dist/spec/build/diff-parser.js.map +1 -0
- package/dist/spec/build/pipeline.d.ts +54 -0
- package/dist/spec/build/pipeline.d.ts.map +1 -0
- package/dist/spec/build/pipeline.js +170 -0
- package/dist/spec/build/pipeline.js.map +1 -0
- package/dist/spec/build/scan.d.ts +48 -0
- package/dist/spec/build/scan.d.ts.map +1 -0
- package/dist/spec/build/scan.js +89 -0
- package/dist/spec/build/scan.js.map +1 -0
- package/dist/spec/build/scope-resolver.d.ts +50 -0
- package/dist/spec/build/scope-resolver.d.ts.map +1 -0
- package/dist/spec/build/scope-resolver.js +105 -0
- package/dist/spec/build/scope-resolver.js.map +1 -0
- package/dist/spec/build/spec-extractor.d.ts +74 -0
- package/dist/spec/build/spec-extractor.d.ts.map +1 -0
- package/dist/spec/build/spec-extractor.js +344 -0
- package/dist/spec/build/spec-extractor.js.map +1 -0
- package/dist/spec/config.d.ts +35 -1
- package/dist/spec/config.d.ts.map +1 -1
- package/dist/spec/config.js +30 -5
- package/dist/spec/config.js.map +1 -1
- package/dist/spec/db/commit-node.js +4 -4
- package/dist/spec/db/fragment-node.js +10 -10
- package/dist/spec/db/fts.d.ts.map +1 -1
- package/dist/spec/db/fts.js +27 -58
- package/dist/spec/db/fts.js.map +1 -1
- package/dist/spec/db/index.d.ts +5 -3
- package/dist/spec/db/index.d.ts.map +1 -1
- package/dist/spec/db/index.js +16 -1
- package/dist/spec/db/index.js.map +1 -1
- package/dist/spec/db/persist.d.ts +45 -0
- package/dist/spec/db/persist.d.ts.map +1 -0
- package/dist/spec/db/persist.js +66 -0
- package/dist/spec/db/persist.js.map +1 -0
- package/dist/spec/db/relations.d.ts +80 -1
- package/dist/spec/db/relations.d.ts.map +1 -1
- package/dist/spec/db/relations.js +218 -47
- package/dist/spec/db/relations.js.map +1 -1
- package/dist/spec/db/schema.d.ts +4 -0
- package/dist/spec/db/schema.d.ts.map +1 -1
- package/dist/spec/db/schema.js +10 -6
- package/dist/spec/db/schema.js.map +1 -1
- package/dist/spec/db/schema.sql +121 -117
- package/dist/spec/db/spec-node.d.ts +5 -0
- package/dist/spec/db/spec-node.d.ts.map +1 -1
- package/dist/spec/db/spec-node.js +15 -9
- package/dist/spec/db/spec-node.js.map +1 -1
- package/dist/spec/db/sql-utils.d.ts +11 -0
- package/dist/spec/db/sql-utils.d.ts.map +1 -0
- package/dist/spec/db/sql-utils.js +19 -0
- package/dist/spec/db/sql-utils.js.map +1 -0
- package/dist/spec/evolve/cluster-context.d.ts +30 -0
- package/dist/spec/evolve/cluster-context.d.ts.map +1 -0
- package/dist/spec/evolve/cluster-context.js +78 -0
- package/dist/spec/evolve/cluster-context.js.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts +51 -0
- package/dist/spec/evolve/commit-spec-analyzer.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-analyzer.js +88 -0
- package/dist/spec/evolve/commit-spec-analyzer.js.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts +53 -0
- package/dist/spec/evolve/commit-spec-persister.d.ts.map +1 -0
- package/dist/spec/evolve/commit-spec-persister.js +93 -0
- package/dist/spec/evolve/commit-spec-persister.js.map +1 -0
- package/dist/spec/evolve/impact-locator.d.ts +23 -7
- package/dist/spec/evolve/impact-locator.d.ts.map +1 -1
- package/dist/spec/evolve/impact-locator.js +58 -14
- package/dist/spec/evolve/impact-locator.js.map +1 -1
- package/dist/spec/evolve/pipeline.d.ts +62 -25
- package/dist/spec/evolve/pipeline.d.ts.map +1 -1
- package/dist/spec/evolve/pipeline.js +436 -457
- package/dist/spec/evolve/pipeline.js.map +1 -1
- package/dist/spec/evolve/spec-rewriter.d.ts +13 -13
- package/dist/spec/evolve/spec-rewriter.d.ts.map +1 -1
- package/dist/spec/evolve/spec-rewriter.js +45 -45
- package/dist/spec/evolve/spec-rewriter.js.map +1 -1
- package/dist/spec/git/commits.d.ts +85 -0
- package/dist/spec/git/commits.d.ts.map +1 -0
- package/dist/spec/git/commits.js +218 -0
- package/dist/spec/git/commits.js.map +1 -0
- package/dist/spec/git/exec.d.ts +13 -0
- package/dist/spec/git/exec.d.ts.map +1 -0
- package/dist/spec/git/exec.js +19 -0
- package/dist/spec/git/exec.js.map +1 -0
- package/dist/spec/git/index.d.ts +9 -0
- package/dist/spec/git/index.d.ts.map +1 -0
- package/dist/spec/git/index.js +22 -0
- package/dist/spec/git/index.js.map +1 -0
- package/dist/spec/graph/index.d.ts +8 -0
- package/dist/spec/graph/index.d.ts.map +1 -0
- package/dist/spec/graph/index.js +17 -0
- package/dist/spec/graph/index.js.map +1 -0
- package/dist/spec/graph/queries.d.ts +6 -35
- package/dist/spec/graph/queries.d.ts.map +1 -1
- package/dist/spec/graph/queries.js +71 -248
- package/dist/spec/graph/queries.js.map +1 -1
- package/dist/spec/llm/agent-client.d.ts +59 -0
- package/dist/spec/llm/agent-client.d.ts.map +1 -0
- package/dist/spec/llm/agent-client.js +213 -0
- package/dist/spec/llm/agent-client.js.map +1 -0
- package/dist/spec/llm/agents/claude-code.d.ts +32 -0
- package/dist/spec/llm/agents/claude-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/claude-code.js +125 -0
- package/dist/spec/llm/agents/claude-code.js.map +1 -0
- package/dist/spec/llm/agents/codex.d.ts +32 -0
- package/dist/spec/llm/agents/codex.d.ts.map +1 -0
- package/dist/spec/llm/agents/codex.js +145 -0
- package/dist/spec/llm/agents/codex.js.map +1 -0
- package/dist/spec/llm/agents/detect-utils.d.ts +28 -0
- package/dist/spec/llm/agents/detect-utils.d.ts.map +1 -0
- package/dist/spec/llm/agents/detect-utils.js +91 -0
- package/dist/spec/llm/agents/detect-utils.js.map +1 -0
- package/dist/spec/llm/agents/deveco-code.d.ts +33 -0
- package/dist/spec/llm/agents/deveco-code.d.ts.map +1 -0
- package/dist/spec/llm/agents/deveco-code.js +165 -0
- package/dist/spec/llm/agents/deveco-code.js.map +1 -0
- package/dist/spec/llm/agents/index.d.ts +31 -0
- package/dist/spec/llm/agents/index.d.ts.map +1 -0
- package/dist/spec/llm/agents/index.js +65 -0
- package/dist/spec/llm/agents/index.js.map +1 -0
- package/dist/spec/llm/agents/types.d.ts +76 -0
- package/dist/spec/llm/agents/types.d.ts.map +1 -0
- package/dist/spec/llm/agents/types.js +15 -0
- package/dist/spec/llm/agents/types.js.map +1 -0
- package/dist/spec/llm/client.d.ts +31 -11
- package/dist/spec/llm/client.d.ts.map +1 -1
- package/dist/spec/llm/client.js +143 -81
- package/dist/spec/llm/client.js.map +1 -1
- package/dist/spec/llm/factory.d.ts +41 -0
- package/dist/spec/llm/factory.d.ts.map +1 -0
- package/dist/spec/llm/factory.js +80 -0
- package/dist/spec/llm/factory.js.map +1 -0
- package/dist/spec/llm/prompts.d.ts +24 -8
- package/dist/spec/llm/prompts.d.ts.map +1 -1
- package/dist/spec/llm/prompts.js +112 -62
- package/dist/spec/llm/prompts.js.map +1 -1
- package/dist/spec/llm/retry.d.ts +53 -0
- package/dist/spec/llm/retry.d.ts.map +1 -0
- package/dist/spec/llm/retry.js +153 -0
- package/dist/spec/llm/retry.js.map +1 -0
- package/dist/spec/mine/clustering/features.d.ts +38 -0
- package/dist/spec/mine/clustering/features.d.ts.map +1 -0
- package/dist/spec/mine/clustering/features.js +108 -0
- package/dist/spec/mine/clustering/features.js.map +1 -0
- package/dist/spec/mine/clustering/index.d.ts +62 -0
- package/dist/spec/mine/clustering/index.d.ts.map +1 -0
- package/dist/spec/mine/clustering/index.js +259 -0
- package/dist/spec/mine/clustering/index.js.map +1 -0
- package/dist/spec/mine/clustering/leiden.d.ts +61 -0
- package/dist/spec/mine/clustering/leiden.d.ts.map +1 -0
- package/dist/spec/mine/clustering/leiden.js +489 -0
- package/dist/spec/mine/clustering/leiden.js.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts +22 -0
- package/dist/spec/mine/clustering/text-similarity.d.ts.map +1 -0
- package/dist/spec/mine/clustering/text-similarity.js +98 -0
- package/dist/spec/mine/clustering/text-similarity.js.map +1 -0
- package/dist/spec/mine/generator.d.ts +54 -0
- package/dist/spec/mine/generator.d.ts.map +1 -0
- package/dist/spec/mine/generator.js +267 -0
- package/dist/spec/mine/generator.js.map +1 -0
- package/dist/spec/mine/persist.d.ts +37 -0
- package/dist/spec/mine/persist.d.ts.map +1 -0
- package/dist/spec/mine/persist.js +170 -0
- package/dist/spec/mine/persist.js.map +1 -0
- package/dist/spec/mine/pipeline.d.ts +41 -0
- package/dist/spec/mine/pipeline.d.ts.map +1 -0
- package/dist/spec/mine/pipeline.js +236 -0
- package/dist/spec/mine/pipeline.js.map +1 -0
- package/dist/spec/mine/scanner.d.ts +59 -0
- package/dist/spec/mine/scanner.d.ts.map +1 -0
- package/dist/spec/mine/scanner.js +383 -0
- package/dist/spec/mine/scanner.js.map +1 -0
- package/dist/spec/types.d.ts +32 -0
- package/dist/spec/types.d.ts.map +1 -1
- package/dist/spec/ui/index.d.ts +9 -0
- package/dist/spec/ui/index.d.ts.map +1 -0
- package/dist/spec/ui/index.js +16 -0
- package/dist/spec/ui/index.js.map +1 -0
- package/dist/spec/ui/progress-handler.d.ts +33 -0
- package/dist/spec/ui/progress-handler.d.ts.map +1 -0
- package/dist/spec/ui/progress-handler.js +132 -0
- package/dist/spec/ui/progress-handler.js.map +1 -0
- package/dist/spec/ui/progress.d.ts +24 -0
- package/dist/spec/ui/progress.d.ts.map +1 -0
- package/dist/spec/ui/progress.js +13 -0
- package/dist/spec/ui/progress.js.map +1 -0
- package/dist/spec/utils/fs.d.ts +45 -0
- package/dist/spec/utils/fs.d.ts.map +1 -0
- package/dist/spec/utils/fs.js +163 -0
- package/dist/spec/utils/fs.js.map +1 -0
- package/dist/spec/utils/index.d.ts +12 -0
- package/dist/spec/utils/index.d.ts.map +1 -0
- package/dist/spec/utils/index.js +26 -0
- package/dist/spec/utils/index.js.map +1 -0
- package/dist/spec/utils/meta.d.ts +32 -0
- package/dist/spec/utils/meta.d.ts.map +1 -0
- package/dist/spec/utils/meta.js +122 -0
- package/dist/spec/utils/meta.js.map +1 -0
- package/dist/spec/utils/truncate.d.ts +86 -0
- package/dist/spec/utils/truncate.d.ts.map +1 -0
- package/dist/spec/utils/truncate.js +172 -0
- package/dist/spec/utils/truncate.js.map +1 -0
- package/dist/sync/watcher.d.ts +25 -1
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +76 -3
- package/dist/sync/watcher.js.map +1 -1
- package/dist/telemetry/index.js +3 -3
- package/dist/telemetry/index.js.map +1 -1
- package/dist/types.d.ts +3 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +62 -58
- package/scripts/_tmp-cfwk-resolve.log +0 -0
- package/scripts/_tmp-cfwk-sig.log +0 -0
- package/scripts/_tmp-cfwk-vt.log +0 -0
- 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 -91
- package/scripts/agent-eval/ab-hook.sh +86 -86
- package/scripts/agent-eval/ab-impl.sh +78 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -102
- package/scripts/agent-eval/ab-sufficiency.sh +78 -78
- 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 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -50
- package/scripts/agent-eval/offload-eval-setup.sh +24 -24
- package/scripts/agent-eval/offload-eval-styles.sh +71 -71
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -68
- package/scripts/agent-eval/offload-eval.md +76 -76
- 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 -38
- package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -119
- package/scripts/agent-eval/repro-daemon-clients.mjs +125 -125
- package/scripts/agent-eval/run-agent.sh +34 -34
- package/scripts/agent-eval/run-all.sh +75 -75
- package/scripts/agent-eval/run-arms.sh +56 -56
- package/scripts/agent-eval/seq-matrix.mjs +137 -137
- package/scripts/bench-arkts-init-rss.log +0 -0
- package/scripts/build-bundle.sh +123 -123
- package/scripts/exp_boundary_eval/README.md +247 -247
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/_test_mcp_chain.py +78 -78
- package/scripts/exp_boundary_eval/_test_stdin.py +8 -8
- package/scripts/exp_boundary_eval/_utils.py +1116 -1116
- package/scripts/exp_boundary_eval/analyze.py +1313 -1313
- package/scripts/exp_boundary_eval/deveco_arm.py +519 -519
- package/scripts/exp_boundary_eval/run_all.py +378 -378
- package/scripts/exp_boundary_eval/run_one.py +165 -165
- package/scripts/exp_boundary_eval/run_session.py +158 -158
- package/scripts/exp_boundary_eval/setup.py +120 -120
- package/scripts/exp_boundary_eval/win_mcp_launcher.py +73 -73
- package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +36 -36
- package/scripts/exp_boundary_eval/win_node_launcher.py +24 -24
- 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 +275 -275
- package/scripts/ohos-sdk-publish.mjs +133 -133
- package/scripts/pack-npm.sh +119 -119
- package/scripts/prepare-release.mjs +270 -270
- package/scripts/probe-arkts-mem-why-run.log +0 -0
- package/scripts/probe-banner-livecard-ir.log +0 -0
- package/scripts/probe-cfwk-ast.stderr.log +0 -0
- package/scripts/probe-cfwk-ast.stdout.log +0 -0
- package/scripts/probe-cfwk-attr-shape.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
- package/scripts/probe-cfwk-cvc.stderr.log +0 -0
- package/scripts/probe-cfwk-cvc.stdout.log +0 -0
- package/scripts/probe-cfwk-diag2.log +0 -0
- package/scripts/probe-cfwk-diag3.log +0 -0
- package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
- package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
- package/scripts/probe-cfwk-fileresult.log +0 -0
- package/scripts/probe-cfwk-fix.stderr.log +0 -0
- package/scripts/probe-cfwk-fix.stdout.log +0 -0
- package/scripts/probe-cfwk-fix2.stderr.log +0 -0
- package/scripts/probe-cfwk-fix2.stdout.log +0 -0
- package/scripts/probe-cfwk-fix3.stderr.log +0 -0
- package/scripts/probe-cfwk-fix3.stdout.log +0 -0
- package/scripts/probe-cfwk-foreach.log +0 -0
- package/scripts/probe-cfwk-getmethod-throw.log +0 -0
- package/scripts/probe-cfwk-hg-extract.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
- package/scripts/probe-cfwk-resolve-sim.log +0 -0
- package/scripts/probe-cfwk-tree-shape.log +0 -0
- package/scripts/probe-cfwk-walk-abort.log +0 -0
- package/scripts/probe-cfwk.log +0 -0
- package/scripts/probe-force-index.log +0 -0
- package/scripts/probe-no-force-index.log +0 -0
- package/scripts/probe-samefile-ir.stderr.log +0 -0
- package/scripts/probe-samefile-ir.stdout.log +224 -0
- package/scripts/probe-sdk-vs-project.log +0 -0
- package/scripts/probe-viewtree-downgrade.log +0 -0
- package/dist/arkts/ohos-api-index.d.ts +0 -15
- package/dist/arkts/ohos-api-index.d.ts.map +0 -1
- package/dist/arkts/ohos-api-index.js +0 -190
- package/dist/arkts/ohos-api-index.js.map +0 -1
- package/dist/arkts/ohos-sdk-input.d.ts +0 -36
- package/dist/arkts/ohos-sdk-input.d.ts.map +0 -1
- package/dist/arkts/ohos-sdk-input.js +0 -214
- package/dist/arkts/ohos-sdk-input.js.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.d.ts +0 -13
- package/dist/extraction/languages/arkts-state-decorators.d.ts.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.js +0 -26
- package/dist/extraction/languages/arkts-state-decorators.js.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.d.ts +0 -34
- package/dist/extraction/languages/ohos-api-consumer.d.ts.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.js +0 -283
- package/dist/extraction/languages/ohos-api-consumer.js.map +0 -1
|
@@ -37,6 +37,8 @@ exports.PROGRESS_CAP_MULTIPLIER = exports.DEFAULT_WATCHDOG_TIMEOUT_MS = void 0;
|
|
|
37
37
|
exports.parseWatchdogTimeoutMs = parseWatchdogTimeoutMs;
|
|
38
38
|
exports.deriveCheckIntervalMs = deriveCheckIntervalMs;
|
|
39
39
|
exports.installMainThreadWatchdog = installMainThreadWatchdog;
|
|
40
|
+
exports.suspendLivenessWatchdog = suspendLivenessWatchdog;
|
|
41
|
+
exports.runWithoutLivenessWatchdog = runWithoutLivenessWatchdog;
|
|
40
42
|
/**
|
|
41
43
|
* Main-thread liveness watchdog — belt-and-suspenders for #850.
|
|
42
44
|
*
|
|
@@ -88,6 +90,15 @@ exports.installMainThreadWatchdog = installMainThreadWatchdog;
|
|
|
88
90
|
* coinciding with unrelated file activity — or I/O hung beyond all reason —
|
|
89
91
|
* still dies. A true wedge with no disk progress dies at the base timeout,
|
|
90
92
|
* exactly as before.
|
|
93
|
+
*
|
|
94
|
+
* **Opaque native spans (`suspendLivenessWatchdog` / `runWithoutLivenessWatchdog`).**
|
|
95
|
+
* ArkAnalyzer Scene builds (`analyseByModule` / full Scene) run synchronous
|
|
96
|
+
* native work on this thread with no JS yield points — a single module's BODIES
|
|
97
|
+
* load can exceed the 60s window while the process is healthy. Cooperative
|
|
98
|
+
* yielding can't help (the stall is between callbacks, inside native code), and
|
|
99
|
+
* disk-progress deferral's hard cap is too short for multi-module Harmony
|
|
100
|
+
* indexes. Those spans suspend the watchdog for the duration and re-arm after;
|
|
101
|
+
* prefer yielding for any JS-owned loop.
|
|
91
102
|
*/
|
|
92
103
|
const fs = __importStar(require("fs"));
|
|
93
104
|
const os = __importStar(require("os"));
|
|
@@ -134,67 +145,95 @@ function debug(msg) {
|
|
|
134
145
|
* target pid + timeout from argv; an MSG built once at startup (the child is
|
|
135
146
|
* never wedged, so allocation here is fine).
|
|
136
147
|
*/
|
|
137
|
-
const CHILD_SOURCE = `
|
|
138
|
-
const fs = require('fs');
|
|
139
|
-
const parentPid = Number(process.argv[1]);
|
|
140
|
-
const timeoutMs = Number(process.argv[2]);
|
|
141
|
-
const capMs = Number(process.argv[3]);
|
|
142
|
-
const progressPaths = process.argv.slice(4);
|
|
143
|
-
const secs = Math.round(timeoutMs / 1000);
|
|
144
|
-
function kill(extra) {
|
|
145
|
-
try { fs.writeSync(2, Buffer.from('[HomeGraph] Main thread unresponsive for ~' + secs + 's' + (extra || '') + ' — killing the wedged process so a fresh one can start (#850). Disable with HOMEGRAPH_NO_WATCHDOG=1.\\n')); } catch (e) {}
|
|
146
|
-
try { process.kill(parentPid, 'SIGKILL'); } catch (e) {}
|
|
147
|
-
process.exit(0);
|
|
148
|
-
}
|
|
149
|
-
// Fingerprint of the watched files (size + mtime). A change between checks is
|
|
150
|
-
// forward disk progress — a slow synchronous SQLite statement, not a wedge.
|
|
151
|
-
function snap() {
|
|
152
|
-
let s = '';
|
|
153
|
-
for (const p of progressPaths) {
|
|
154
|
-
try { const st = fs.statSync(p); s += st.size + ':' + st.mtimeMs + ';'; } catch (e) { s += 'x;'; }
|
|
155
|
-
}
|
|
156
|
-
return s;
|
|
157
|
-
}
|
|
158
|
-
let lastSnap = progressPaths.length ? snap() : '';
|
|
159
|
-
let lastSnapAt = Date.now();
|
|
160
|
-
let silentSince = null; // start of the current continuous-silence episode
|
|
161
|
-
function onTimeout() {
|
|
162
|
-
if (!progressPaths.length) return kill('');
|
|
163
|
-
const now = Date.now();
|
|
164
|
-
if (silentSince === null) silentSince = now - timeoutMs; // silence began ~one timeout ago
|
|
165
|
-
const cur = snap();
|
|
166
|
-
if (cur !== lastSnap && now - silentSince < capMs) {
|
|
167
|
-
// The event loop is blocked but the DB files are advancing: a legitimate
|
|
168
|
-
// long store on slow storage. Defer, re-baseline, keep watching.
|
|
169
|
-
lastSnap = cur;
|
|
170
|
-
timer = setTimeout(onTimeout, timeoutMs);
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
kill(cur !== lastSnap ? ' despite ongoing disk activity (hard cap ' + Math.round(capMs / 1000) + 's reached)' : '');
|
|
174
|
-
}
|
|
175
|
-
let timer = setTimeout(onTimeout, timeoutMs);
|
|
176
|
-
process.stdin.on('data', () => {
|
|
177
|
-
silentSince = null;
|
|
178
|
-
// Keep the baseline fresh while healthy (throttled — a stat per second).
|
|
179
|
-
if (progressPaths.length) {
|
|
180
|
-
const t = Date.now();
|
|
181
|
-
if (t - lastSnapAt >= 1000) { lastSnap = snap(); lastSnapAt = t; }
|
|
182
|
-
}
|
|
183
|
-
clearTimeout(timer); timer = setTimeout(onTimeout, timeoutMs);
|
|
184
|
-
});
|
|
185
|
-
process.stdin.on('end', () => process.exit(0)); // parent closed the pipe (exited) -> no orphan
|
|
186
|
-
process.stdin.on('error', () => process.exit(0)); // pipe broke -> parent gone
|
|
187
|
-
process.stdin.resume();
|
|
148
|
+
const CHILD_SOURCE = `
|
|
149
|
+
const fs = require('fs');
|
|
150
|
+
const parentPid = Number(process.argv[1]);
|
|
151
|
+
const timeoutMs = Number(process.argv[2]);
|
|
152
|
+
const capMs = Number(process.argv[3]);
|
|
153
|
+
const progressPaths = process.argv.slice(4);
|
|
154
|
+
const secs = Math.round(timeoutMs / 1000);
|
|
155
|
+
function kill(extra) {
|
|
156
|
+
try { fs.writeSync(2, Buffer.from('[HomeGraph] Main thread unresponsive for ~' + secs + 's' + (extra || '') + ' — killing the wedged process so a fresh one can start (#850). Disable with HOMEGRAPH_NO_WATCHDOG=1.\\n')); } catch (e) {}
|
|
157
|
+
try { process.kill(parentPid, 'SIGKILL'); } catch (e) {}
|
|
158
|
+
process.exit(0);
|
|
159
|
+
}
|
|
160
|
+
// Fingerprint of the watched files (size + mtime). A change between checks is
|
|
161
|
+
// forward disk progress — a slow synchronous SQLite statement, not a wedge.
|
|
162
|
+
function snap() {
|
|
163
|
+
let s = '';
|
|
164
|
+
for (const p of progressPaths) {
|
|
165
|
+
try { const st = fs.statSync(p); s += st.size + ':' + st.mtimeMs + ';'; } catch (e) { s += 'x;'; }
|
|
166
|
+
}
|
|
167
|
+
return s;
|
|
168
|
+
}
|
|
169
|
+
let lastSnap = progressPaths.length ? snap() : '';
|
|
170
|
+
let lastSnapAt = Date.now();
|
|
171
|
+
let silentSince = null; // start of the current continuous-silence episode
|
|
172
|
+
function onTimeout() {
|
|
173
|
+
if (!progressPaths.length) return kill('');
|
|
174
|
+
const now = Date.now();
|
|
175
|
+
if (silentSince === null) silentSince = now - timeoutMs; // silence began ~one timeout ago
|
|
176
|
+
const cur = snap();
|
|
177
|
+
if (cur !== lastSnap && now - silentSince < capMs) {
|
|
178
|
+
// The event loop is blocked but the DB files are advancing: a legitimate
|
|
179
|
+
// long store on slow storage. Defer, re-baseline, keep watching.
|
|
180
|
+
lastSnap = cur;
|
|
181
|
+
timer = setTimeout(onTimeout, timeoutMs);
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
kill(cur !== lastSnap ? ' despite ongoing disk activity (hard cap ' + Math.round(capMs / 1000) + 's reached)' : '');
|
|
185
|
+
}
|
|
186
|
+
let timer = setTimeout(onTimeout, timeoutMs);
|
|
187
|
+
process.stdin.on('data', () => {
|
|
188
|
+
silentSince = null;
|
|
189
|
+
// Keep the baseline fresh while healthy (throttled — a stat per second).
|
|
190
|
+
if (progressPaths.length) {
|
|
191
|
+
const t = Date.now();
|
|
192
|
+
if (t - lastSnapAt >= 1000) { lastSnap = snap(); lastSnapAt = t; }
|
|
193
|
+
}
|
|
194
|
+
clearTimeout(timer); timer = setTimeout(onTimeout, timeoutMs);
|
|
195
|
+
});
|
|
196
|
+
process.stdin.on('end', () => process.exit(0)); // parent closed the pipe (exited) -> no orphan
|
|
197
|
+
process.stdin.on('error', () => process.exit(0)); // pipe broke -> parent gone
|
|
198
|
+
process.stdin.resume();
|
|
188
199
|
`;
|
|
189
200
|
/**
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
* (
|
|
193
|
-
*
|
|
201
|
+
* Process-wide armed watchdog. `install` / `suspend` / `stop` all mutate this
|
|
202
|
+
* so a handle returned before a suspend+re-arm still stops the *current*
|
|
203
|
+
* generation (CLI supervision and the MCP server hold the handle across
|
|
204
|
+
* ArkTS Scene builds that suspend).
|
|
194
205
|
*/
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
let active = null;
|
|
207
|
+
/** Nested `suspendLivenessWatchdog` depth; disarm only at 0→1, re-arm at 1→0. */
|
|
208
|
+
let suspendDepth = 0;
|
|
209
|
+
/** Options to re-arm with after the outermost resume; cleared by `stop()`. */
|
|
210
|
+
let optionsWhileSuspended = null;
|
|
211
|
+
/** Stable handle: always stops whatever generation is current (or pending re-arm). */
|
|
212
|
+
const SHARED_HANDLE = {
|
|
213
|
+
stop() {
|
|
214
|
+
suspendDepth = 0;
|
|
215
|
+
optionsWhileSuspended = null;
|
|
216
|
+
disarmActive();
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
function copyOptions(options) {
|
|
220
|
+
return {
|
|
221
|
+
progressPaths: options.progressPaths ? [...options.progressPaths] : undefined,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
function disarmActive() {
|
|
225
|
+
if (!active)
|
|
226
|
+
return;
|
|
227
|
+
try {
|
|
228
|
+
active.disarm();
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
/* best-effort teardown */
|
|
232
|
+
}
|
|
233
|
+
active = null;
|
|
234
|
+
}
|
|
235
|
+
/** Spawn the watchdog child; returns a disarm fn, or null on spawn failure. */
|
|
236
|
+
function armWatchdog(options) {
|
|
198
237
|
const timeoutMs = parseWatchdogTimeoutMs(process.env.HOMEGRAPH_WATCHDOG_TIMEOUT_MS);
|
|
199
238
|
const checkMs = deriveCheckIntervalMs(timeoutMs);
|
|
200
239
|
const capMs = timeoutMs * exports.PROGRESS_CAP_MULTIPLIER;
|
|
@@ -247,21 +286,94 @@ function installMainThreadWatchdog(options = {}) {
|
|
|
247
286
|
catch { /* ignore */ }
|
|
248
287
|
debug(`armed (child pid ${child.pid ?? '?'}): timeoutMs=${timeoutMs} checkMs=${checkMs} progressPaths=${progressPaths.length}`);
|
|
249
288
|
let stopped = false;
|
|
250
|
-
return {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
catch { /* ignore */ } // belt-and-suspenders
|
|
264
|
-
},
|
|
289
|
+
return () => {
|
|
290
|
+
if (stopped)
|
|
291
|
+
return;
|
|
292
|
+
stopped = true;
|
|
293
|
+
clearInterval(heartbeat);
|
|
294
|
+
try {
|
|
295
|
+
stdin.end();
|
|
296
|
+
}
|
|
297
|
+
catch { /* ignore */ } // EOF -> child exits cleanly
|
|
298
|
+
try {
|
|
299
|
+
child.kill();
|
|
300
|
+
}
|
|
301
|
+
catch { /* ignore */ } // belt-and-suspenders
|
|
265
302
|
};
|
|
266
303
|
}
|
|
304
|
+
function rearmFromOptions(options) {
|
|
305
|
+
const disarm = armWatchdog(options);
|
|
306
|
+
if (!disarm)
|
|
307
|
+
return;
|
|
308
|
+
active = { disarm, options: copyOptions(options) };
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Install the main-thread liveness watchdog for a long-lived process. Returns a
|
|
312
|
+
* handle to stop it, or `null` when disabled or when the child can't be spawned
|
|
313
|
+
* (degraded, never throws — a missing watchdog must never keep a process from
|
|
314
|
+
* starting).
|
|
315
|
+
*
|
|
316
|
+
* The returned handle is process-wide and stable across
|
|
317
|
+
* {@link suspendLivenessWatchdog} re-arms — `stop()` always tears down the
|
|
318
|
+
* current generation.
|
|
319
|
+
*/
|
|
320
|
+
function installMainThreadWatchdog(options = {}) {
|
|
321
|
+
if (isEnvTruthy(process.env.HOMEGRAPH_NO_WATCHDOG))
|
|
322
|
+
return null;
|
|
323
|
+
// Replace any prior generation (including a mid-suspend pending re-arm).
|
|
324
|
+
suspendDepth = 0;
|
|
325
|
+
optionsWhileSuspended = null;
|
|
326
|
+
disarmActive();
|
|
327
|
+
const disarm = armWatchdog(options);
|
|
328
|
+
if (!disarm)
|
|
329
|
+
return null;
|
|
330
|
+
active = { disarm, options: copyOptions(options) };
|
|
331
|
+
return SHARED_HANDLE;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Suspend the armed liveness watchdog for an opaque synchronous span that
|
|
335
|
+
* cannot cooperatively yield (ArkAnalyzer Scene builds). Returns an idempotent
|
|
336
|
+
* resume function. Nested calls refcount; a `stop()` while suspended cancels
|
|
337
|
+
* the pending re-arm.
|
|
338
|
+
*
|
|
339
|
+
* No-op when nothing is armed (tests, `HOMEGRAPH_NO_WATCHDOG`, library embeds).
|
|
340
|
+
*/
|
|
341
|
+
function suspendLivenessWatchdog() {
|
|
342
|
+
suspendDepth++;
|
|
343
|
+
if (suspendDepth === 1 && active) {
|
|
344
|
+
optionsWhileSuspended = active.options;
|
|
345
|
+
disarmActive();
|
|
346
|
+
debug('suspended for opaque sync span');
|
|
347
|
+
}
|
|
348
|
+
let resumed = false;
|
|
349
|
+
return () => {
|
|
350
|
+
if (resumed)
|
|
351
|
+
return;
|
|
352
|
+
resumed = true;
|
|
353
|
+
if (suspendDepth <= 0)
|
|
354
|
+
return;
|
|
355
|
+
suspendDepth--;
|
|
356
|
+
if (suspendDepth > 0)
|
|
357
|
+
return;
|
|
358
|
+
if (optionsWhileSuspended) {
|
|
359
|
+
const opts = optionsWhileSuspended;
|
|
360
|
+
optionsWhileSuspended = null;
|
|
361
|
+
rearmFromOptions(opts);
|
|
362
|
+
debug('resumed after opaque sync span');
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Run `fn` with the liveness watchdog suspended, then resume. Use for native
|
|
368
|
+
* spans with no JS yield points; prefer cooperative yielding for JS-owned loops.
|
|
369
|
+
*/
|
|
370
|
+
function runWithoutLivenessWatchdog(fn) {
|
|
371
|
+
const resume = suspendLivenessWatchdog();
|
|
372
|
+
try {
|
|
373
|
+
return fn();
|
|
374
|
+
}
|
|
375
|
+
finally {
|
|
376
|
+
resume();
|
|
377
|
+
}
|
|
378
|
+
}
|
|
267
379
|
//# sourceMappingURL=liveness-watchdog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liveness-watchdog.js","sourceRoot":"","sources":["../../src/mcp/liveness-watchdog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"liveness-watchdog.js","sourceRoot":"","sources":["../../src/mcp/liveness-watchdog.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmFA,wDAOC;AAGD,sDAEC;AA+MD,8DAYC;AAUD,0DAqBC;AAMD,gEAOC;AAtWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,uCAAyB;AACzB,uCAAyB;AACzB,iDAAoD;AAEpD,uGAAuG;AAC1F,QAAA,2BAA2B,GAAG,MAAM,CAAC;AAElD;;;;;GAKG;AACU,QAAA,uBAAuB,GAAG,EAAE,CAAC;AAE1C,wEAAwE;AACxE,SAAS,WAAW,CAAC,GAAuB;IAC1C,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACvE,CAAC;AAED,qFAAqF;AACrF,SAAgB,sBAAsB,CACpC,GAAuB,EACvB,WAAmB,mCAA2B;IAE9C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IACvC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpD,CAAC;AAED,qFAAqF;AACrF,SAAgB,qBAAqB,CAAC,SAAiB;IACrD,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,C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,IAAI,CAAC;YAC7B,gBAAgB,CAAC,IAAI,CAAC,CAAC;YACvB,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,0BAA0B,CAAI,EAAW;IACvD,MAAM,MAAM,GAAG,uBAAuB,EAAE,CAAC;IACzC,IAAI,CAAC;QACH,OAAO,EAAE,EAAE,CAAC;IACd,CAAC;YAAS,CAAC;QACT,MAAM,EAAE,CAAC;IACX,CAAC;AACH,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Query worker thread — issue: concurrent MCP tool calls starve the daemon.
|
|
3
3
|
*
|
|
4
4
|
* The shared daemon serves every session on ONE event loop with synchronous
|
|
5
|
-
*
|
|
5
|
+
* SQLite (better-sqlite3 / wasm). `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
|
|
6
6
|
* PageRank + impact + output building) stitched together by microtask `await`s,
|
|
7
7
|
* so N concurrent explores keep the microtask queue continuously full and
|
|
8
8
|
* starve the macrotask phases — timers AND socket I/O. The transport freezes:
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* ~10 subagents that routinely exceeds the MCP client's request timeout.
|
|
11
11
|
*
|
|
12
12
|
* This worker moves the heavy read-tool dispatch OFF the daemon's main loop.
|
|
13
|
-
* Each worker owns its OWN read connection (
|
|
13
|
+
* Each worker owns its OWN read connection (native WAL allows N concurrent
|
|
14
14
|
* readers across connections — verified: a worker reader sees the main writer's
|
|
15
15
|
* committed catch-up/watcher writes), so {@link QueryPool} runs N tool calls in
|
|
16
16
|
* true parallel up to core count while the main loop stays free for the MCP
|
package/dist/mcp/query-worker.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Query worker thread — issue: concurrent MCP tool calls starve the daemon.
|
|
4
4
|
*
|
|
5
5
|
* The shared daemon serves every session on ONE event loop with synchronous
|
|
6
|
-
*
|
|
6
|
+
* SQLite (better-sqlite3 / wasm). `codegraph_explore` is CPU-heavy (FTS + RWR/personalized-
|
|
7
7
|
* PageRank + impact + output building) stitched together by microtask `await`s,
|
|
8
8
|
* so N concurrent explores keep the microtask queue continuously full and
|
|
9
9
|
* starve the macrotask phases — timers AND socket I/O. The transport freezes:
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* ~10 subagents that routinely exceeds the MCP client's request timeout.
|
|
12
12
|
*
|
|
13
13
|
* This worker moves the heavy read-tool dispatch OFF the daemon's main loop.
|
|
14
|
-
* Each worker owns its OWN read connection (
|
|
14
|
+
* Each worker owns its OWN read connection (native WAL allows N concurrent
|
|
15
15
|
* readers across connections — verified: a worker reader sees the main writer's
|
|
16
16
|
* committed catch-up/watcher writes), so {@link QueryPool} runs N tool calls in
|
|
17
17
|
* true parallel up to core count while the main loop stays free for the MCP
|
|
@@ -7,53 +7,53 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = exports.SERVER_INSTRUCTIONS = void 0;
|
|
10
|
-
exports.SERVER_INSTRUCTIONS = `# HomeGraph — when to call
|
|
11
|
-
|
|
12
|
-
HomeGraph is a **local structural index of THIS repo**: symbols + call/import/extends edges + files. Use it only when the answer needs that graph.
|
|
13
|
-
|
|
14
|
-
## Call HomeGraph (closed set)
|
|
15
|
-
|
|
16
|
-
Use \`homegraph_explore\` (primary) when **all** of these hold:
|
|
17
|
-
|
|
18
|
-
1. The evidence lives **in this repository's source** (not an external SDK manual).
|
|
19
|
-
2. You need **structure**: definition location, who calls whom, how A reaches B, multi-file wiring, or in-repo import/usage of a named API/\`@kit\` module.
|
|
20
|
-
3. You can put **concrete names** in \`query\` — symbol, \`Type.member\`, file basename, or \`@kit…\` (skip \`homegraph_search\` when names are already known).
|
|
21
|
-
|
|
22
|
-
Typical fits:
|
|
23
|
-
|
|
24
|
-
- How a **feature in this repo** is wired (mechanism / cross-file / click→handler flow)
|
|
25
|
-
- Callers / callees / blast radius of a **named** symbol
|
|
26
|
-
- What a **named component/method** does (include the name; one explore is enough)
|
|
27
|
-
- In-repo usages of an imported API (not the official feature catalog)
|
|
28
|
-
|
|
29
|
-
**One explore with names** beats search→explore→node→grep→read. Treat returned line-numbered source as already Read. After a full explore — **answer**; do not re-verify with grep/read/node for the same symbols. Busy/partial → retry that **same** explore once.
|
|
30
|
-
|
|
31
|
-
## Do not call HomeGraph otherwise
|
|
32
|
-
|
|
33
|
-
If the question is **outside the set above**, do **not** open any \`homegraph_*\` tool — use Read / Grep / Glob / SDK docs. HomeGraph is not a general Q&A layer; forcing it on the wrong shape costs time and tokens and often lowers quality.
|
|
34
|
-
|
|
35
|
-
## Tool roles
|
|
36
|
-
|
|
37
|
-
| Tool | Role |
|
|
38
|
-
|------|------|
|
|
39
|
-
| **homegraph_explore** | Primary for the closed set above |
|
|
40
|
-
| homegraph_node | One known symbol body (or indexed file) after explore named it |
|
|
41
|
-
| homegraph_callers / callees | Compact edge lists for a named symbol |
|
|
42
|
-
| homegraph_search | Rare — unknown spelling only |
|
|
43
|
-
| homegraph_files | Folder tree only |
|
|
44
|
-
|
|
45
|
-
## Tips
|
|
46
|
-
|
|
47
|
-
- **Deadline / partial** — success-shaped; retry ONE explore with the same names. Do not abandon to grep for those symbols.
|
|
48
|
-
- **Staleness banner** — Read only the listed edited files.
|
|
49
|
-
- **Not indexed** — built-in tools; user runs \`homegraph init\` — you do not.
|
|
10
|
+
exports.SERVER_INSTRUCTIONS = `# HomeGraph — when to call
|
|
11
|
+
|
|
12
|
+
HomeGraph is a **local structural index of THIS repo**: symbols + call/import/extends edges + files. Use it only when the answer needs that graph.
|
|
13
|
+
|
|
14
|
+
## Call HomeGraph (closed set)
|
|
15
|
+
|
|
16
|
+
Use \`homegraph_explore\` (primary) when **all** of these hold:
|
|
17
|
+
|
|
18
|
+
1. The evidence lives **in this repository's source** (not an external SDK manual).
|
|
19
|
+
2. You need **structure**: definition location, who calls whom, how A reaches B, multi-file wiring, or in-repo import/usage of a named API/\`@kit\` module.
|
|
20
|
+
3. You can put **concrete names** in \`query\` — symbol, \`Type.member\`, file basename, or \`@kit…\` (skip \`homegraph_search\` when names are already known).
|
|
21
|
+
|
|
22
|
+
Typical fits:
|
|
23
|
+
|
|
24
|
+
- How a **feature in this repo** is wired (mechanism / cross-file / click→handler flow)
|
|
25
|
+
- Callers / callees / blast radius of a **named** symbol
|
|
26
|
+
- What a **named component/method** does (include the name; one explore is enough)
|
|
27
|
+
- In-repo usages of an imported API (not the official feature catalog)
|
|
28
|
+
|
|
29
|
+
**One explore with names** beats search→explore→node→grep→read. Treat returned line-numbered source as already Read. After a full explore — **answer**; do not re-verify with grep/read/node for the same symbols. Busy/partial → retry that **same** explore once.
|
|
30
|
+
|
|
31
|
+
## Do not call HomeGraph otherwise
|
|
32
|
+
|
|
33
|
+
If the question is **outside the set above**, do **not** open any \`homegraph_*\` tool — use Read / Grep / Glob / SDK docs. HomeGraph is not a general Q&A layer; forcing it on the wrong shape costs time and tokens and often lowers quality.
|
|
34
|
+
|
|
35
|
+
## Tool roles
|
|
36
|
+
|
|
37
|
+
| Tool | Role |
|
|
38
|
+
|------|------|
|
|
39
|
+
| **homegraph_explore** | Primary for the closed set above |
|
|
40
|
+
| homegraph_node | One known symbol body (or indexed file) after explore named it |
|
|
41
|
+
| homegraph_callers / callees | Compact edge lists for a named symbol |
|
|
42
|
+
| homegraph_search | Rare — unknown spelling only |
|
|
43
|
+
| homegraph_files | Folder tree only |
|
|
44
|
+
|
|
45
|
+
## Tips
|
|
46
|
+
|
|
47
|
+
- **Deadline / partial** — success-shaped; retry ONE explore with the same names. Do not abandon to grep for those symbols.
|
|
48
|
+
- **Staleness banner** — Read only the listed edited files.
|
|
49
|
+
- **Not indexed** — built-in tools; user runs \`homegraph init\` — you do not.
|
|
50
50
|
`;
|
|
51
|
-
exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — per-project (pass projectPath)
|
|
52
|
-
|
|
53
|
-
HomeGraph indexes a codebase into a symbol graph. Call it **only** for in-repo structural / flow / usage questions on a project that has \`.homegraph/\`. Pass that project as \`projectPath\`.
|
|
54
|
-
|
|
55
|
-
- Fits the closed set (structure, callers, wiring, named symbol/file) → \`homegraph_explore\`
|
|
56
|
-
- Anything else → Read/Grep/Glob — **do not call homegraph_***
|
|
57
|
-
- No index → Read/Grep/Glob; user runs \`homegraph init\` if they want indexing
|
|
51
|
+
exports.SERVER_INSTRUCTIONS_NO_ROOT_INDEX = `# HomeGraph — per-project (pass projectPath)
|
|
52
|
+
|
|
53
|
+
HomeGraph indexes a codebase into a symbol graph. Call it **only** for in-repo structural / flow / usage questions on a project that has \`.homegraph/\`. Pass that project as \`projectPath\`.
|
|
54
|
+
|
|
55
|
+
- Fits the closed set (structure, callers, wiring, named symbol/file) → \`homegraph_explore\`
|
|
56
|
+
- Anything else → Read/Grep/Glob — **do not call homegraph_***
|
|
57
|
+
- No index → Read/Grep/Glob; user runs \`homegraph init\` if they want indexing
|
|
58
58
|
`;
|
|
59
59
|
//# sourceMappingURL=server-instructions.js.map
|
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;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiB9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,SAAS,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAiB9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,S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7B,OAAO,CAAC,iBAAiB;IA8BzB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;CAMpB"}
|
package/dist/mcp/tools.js
CHANGED
|
@@ -40,6 +40,7 @@ const VIEWTREE_STRUCTURE_VIAS = new Set([
|
|
|
40
40
|
'builder',
|
|
41
41
|
'builder-param',
|
|
42
42
|
]);
|
|
43
|
+
const sqlite_adapter_1 = require("../db/sqlite-adapter");
|
|
43
44
|
/**
|
|
44
45
|
* An expected, recoverable "homegraph can't serve this" condition — most
|
|
45
46
|
* importantly a project with no index. The dispatch catch converts these to
|
|
@@ -713,10 +714,6 @@ exports.tools = [
|
|
|
713
714
|
description: 'Whether to include full code diffs per commit (default: true).',
|
|
714
715
|
default: true,
|
|
715
716
|
},
|
|
716
|
-
dbPath: {
|
|
717
|
-
type: 'string',
|
|
718
|
-
description: 'Explicit path to the Commit4Spec database. Overrides repoPath-based resolution.',
|
|
719
|
-
},
|
|
720
717
|
},
|
|
721
718
|
required: ['query'],
|
|
722
719
|
},
|
|
@@ -739,10 +736,6 @@ exports.tools = [
|
|
|
739
736
|
type: 'string',
|
|
740
737
|
description: 'Path to the repository root. Defaults to the current working directory.',
|
|
741
738
|
},
|
|
742
|
-
dbPath: {
|
|
743
|
-
type: 'string',
|
|
744
|
-
description: 'Explicit path to the Commit4Spec database. Overrides repoPath-based resolution.',
|
|
745
|
-
},
|
|
746
739
|
},
|
|
747
740
|
required: ['filePath'],
|
|
748
741
|
},
|
|
@@ -781,10 +774,6 @@ exports.tools = [
|
|
|
781
774
|
description: 'Maximum number of matching Specs to return (default: 10).',
|
|
782
775
|
default: 10,
|
|
783
776
|
},
|
|
784
|
-
dbPath: {
|
|
785
|
-
type: 'string',
|
|
786
|
-
description: 'Explicit path to the Commit4Spec database. Overrides repoPath-based resolution.',
|
|
787
|
-
},
|
|
788
777
|
},
|
|
789
778
|
required: ['symbol'],
|
|
790
779
|
},
|
|
@@ -4545,7 +4534,7 @@ class ToolHandler {
|
|
|
4545
4534
|
// homegraph_node's findSymbolMatches.) Qualified tokens keep findAllSymbols.
|
|
4546
4535
|
const isQual = /[.\/]|::/.test(t);
|
|
4547
4536
|
const raw = isQual ? this.findAllSymbols(cg, t).nodes : cg.getNodesByName(t);
|
|
4548
|
-
|
|
4537
|
+
let cands = raw
|
|
4549
4538
|
.filter((n) => SEED_KINDS.has(n.kind) && !isTestPath(n.filePath))
|
|
4550
4539
|
.sort((a, b) => {
|
|
4551
4540
|
// Prefer callables over types when both share a name, then body size.
|
|
@@ -4555,6 +4544,28 @@ class ToolHandler {
|
|
|
4555
4544
|
return bc - ac;
|
|
4556
4545
|
return (bodyLines(b) > 1 ? 1 : 0) - (bodyLines(a) > 1 ? 1 : 0) || bodyLines(b) - bodyLines(a);
|
|
4557
4546
|
});
|
|
4547
|
+
// Field-name seeding fallback (#1196): a camelCase token that names NO
|
|
4548
|
+
// definition of its own is usually an object-literal key / API field —
|
|
4549
|
+
// seed its camel-infix callable definers instead.
|
|
4550
|
+
if (cands.length === 0 && !isQual && /[a-z][A-Z]/.test(t)) {
|
|
4551
|
+
const lcToken = t.toLowerCase();
|
|
4552
|
+
cands = cg
|
|
4553
|
+
.getNodesByNameSubstring(t, {
|
|
4554
|
+
kinds: ['function', 'method', 'component'],
|
|
4555
|
+
limit: 60,
|
|
4556
|
+
})
|
|
4557
|
+
.filter((n) => CALLABLE.has(n.kind) && !isTestPath(n.filePath))
|
|
4558
|
+
.filter((n) => {
|
|
4559
|
+
const idx = n.name.toLowerCase().indexOf(lcToken);
|
|
4560
|
+
if (idx < 0)
|
|
4561
|
+
return false;
|
|
4562
|
+
if (idx === 0)
|
|
4563
|
+
return n.name.length > t.length;
|
|
4564
|
+
return /[A-Z]/.test(n.name.charAt(idx));
|
|
4565
|
+
})
|
|
4566
|
+
.sort((a, b) => a.name.length - b.name.length)
|
|
4567
|
+
.slice(0, 3);
|
|
4568
|
+
}
|
|
4558
4569
|
// A specific name (<=3 defs) injects all its defs. An overloaded name
|
|
4559
4570
|
// (`validate` = 10, `request` = 44) would flood the subgraph, so inject
|
|
4560
4571
|
// only: the overloads whose file/class the query ALSO names (the agent
|
|
@@ -6248,20 +6259,28 @@ class ToolHandler {
|
|
|
6248
6259
|
lines.push(`> ⚠ ${(0, worktree_1.worktreeMismatchWarning)(mismatch).replace(/\n/g, '\n> ')}`, '');
|
|
6249
6260
|
}
|
|
6250
6261
|
lines.push(`**Files indexed:** ${stats.fileCount}`, `**Total nodes:** ${stats.nodeCount}`, `**Total edges:** ${stats.edgeCount}`, `**Database size:** ${(stats.dbSizeBytes / 1024 / 1024).toFixed(2)} MB`);
|
|
6251
|
-
// Surface the active SQLite backend
|
|
6252
|
-
|
|
6253
|
-
|
|
6262
|
+
// Surface the active SQLite backend: node:sqlite → better-sqlite3 → wasm.
|
|
6263
|
+
const backend = cg.getBackend();
|
|
6264
|
+
if (backend === 'node-sqlite') {
|
|
6265
|
+
lines.push(`**Backend:** node-sqlite (built-in)`);
|
|
6266
|
+
}
|
|
6267
|
+
else if (backend === 'native') {
|
|
6268
|
+
lines.push(`**Backend:** native (better-sqlite3)`);
|
|
6269
|
+
}
|
|
6270
|
+
else {
|
|
6271
|
+
lines.push(`**Backend:** ⚠ wasm (no WAL backend available) — ` +
|
|
6272
|
+
`5-10x slower than WAL. Fix: ${sqlite_adapter_1.WASM_FALLBACK_FIX_RECIPE}`);
|
|
6273
|
+
}
|
|
6254
6274
|
// Effective journal mode. 'wal' ⇒ concurrent reads never block on a writer;
|
|
6255
|
-
// anything else ⇒ they can ("database is locked"). node:sqlite
|
|
6256
|
-
//
|
|
6257
|
-
// virtualized mounts, WSL2 /mnt). See issue #238.
|
|
6275
|
+
// anything else ⇒ they can ("database is locked"). node:sqlite / native
|
|
6276
|
+
// support WAL; wasm remaps to DELETE.
|
|
6258
6277
|
const journalMode = cg.getJournalMode();
|
|
6259
6278
|
if (journalMode === 'wal') {
|
|
6260
6279
|
lines.push(`**Journal mode:** wal (concurrent reads safe)`);
|
|
6261
6280
|
}
|
|
6262
6281
|
else {
|
|
6263
6282
|
lines.push(`**Journal mode:** ⚠ ${journalMode || 'unknown'} — WAL not active, so reads ` +
|
|
6264
|
-
`can block on a concurrent write
|
|
6283
|
+
`can block on a concurrent write`);
|
|
6265
6284
|
}
|
|
6266
6285
|
lines.push('', '**Nodes by Kind:**');
|
|
6267
6286
|
for (const [kind, count] of Object.entries(stats.nodesByKind)) {
|
|
@@ -6477,7 +6496,6 @@ class ToolHandler {
|
|
|
6477
6496
|
if (typeof query !== 'string')
|
|
6478
6497
|
return query;
|
|
6479
6498
|
const repoPath = args.repoPath;
|
|
6480
|
-
const explicitDbPath = args.dbPath;
|
|
6481
6499
|
const topKRaw = Number(args.topK);
|
|
6482
6500
|
const topK = Math.max(1, Math.min(isNaN(topKRaw) ? 5 : topKRaw, 50));
|
|
6483
6501
|
const includeFragments = args.includeFragments !== false;
|
|
@@ -6487,7 +6505,7 @@ class ToolHandler {
|
|
|
6487
6505
|
const { searchAndGetContext } = require('../spec/graph/queries');
|
|
6488
6506
|
const { truncateCodeDiff, truncateSubtitles, computeBudgetProfile, } = require('../spec/utils');
|
|
6489
6507
|
// Resolve the database path.
|
|
6490
|
-
const dbPath = resolveDbPath(repoPath || process.cwd()
|
|
6508
|
+
const dbPath = resolveDbPath(repoPath || process.cwd());
|
|
6491
6509
|
// Open the database.
|
|
6492
6510
|
let db;
|
|
6493
6511
|
try {
|
|
@@ -6587,13 +6605,12 @@ class ToolHandler {
|
|
|
6587
6605
|
if (typeof filePath !== 'string')
|
|
6588
6606
|
return filePath;
|
|
6589
6607
|
const repoPath = args.repoPath;
|
|
6590
|
-
const explicitDbPath = args.dbPath;
|
|
6591
6608
|
// Lazily require spec modules so the MCP startup path stays lean.
|
|
6592
6609
|
const { resolveDbPath } = require('../spec/utils');
|
|
6593
6610
|
const { createDatabase } = require('../db/sqlite-adapter');
|
|
6594
6611
|
const { findSpecsByFilePath } = require('../spec/graph/queries');
|
|
6595
6612
|
// Resolve the database path.
|
|
6596
|
-
const dbPath = resolveDbPath(repoPath || process.cwd()
|
|
6613
|
+
const dbPath = resolveDbPath(repoPath || process.cwd());
|
|
6597
6614
|
// Open the database.
|
|
6598
6615
|
let db;
|
|
6599
6616
|
try {
|
|
@@ -6654,7 +6671,6 @@ class ToolHandler {
|
|
|
6654
6671
|
const file = fileRaw;
|
|
6655
6672
|
const line = typeof args.line === 'number' ? args.line : undefined;
|
|
6656
6673
|
const repoPath = args.repoPath;
|
|
6657
|
-
const explicitDbPath = args.dbPath;
|
|
6658
6674
|
const topKRaw = Number(args.topK);
|
|
6659
6675
|
const topK = Math.max(1, Math.min(isNaN(topKRaw) ? 10 : topKRaw, 50));
|
|
6660
6676
|
// Lazily require all needed modules
|
|
@@ -6709,7 +6725,7 @@ class ToolHandler {
|
|
|
6709
6725
|
}, null, 2));
|
|
6710
6726
|
}
|
|
6711
6727
|
// Step 2: Resolve the Spec database path
|
|
6712
|
-
const dbPath = resolveDbPath(repoPath || process.cwd()
|
|
6728
|
+
const dbPath = resolveDbPath(repoPath || process.cwd());
|
|
6713
6729
|
// Step 3: Open the Spec database
|
|
6714
6730
|
let db;
|
|
6715
6731
|
try {
|