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
|
@@ -70,11 +70,67 @@ function getNodeText(node, source) {
|
|
|
70
70
|
function getChildByField(node, fieldName) {
|
|
71
71
|
return node.childForFieldName(fieldName);
|
|
72
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Node types that *wrap* a declaration so a leading comment is a sibling of the
|
|
75
|
+
* wrapper, not of the emitted (inner) declaration node. HomeGraph emits the
|
|
76
|
+
* inner node, so before looking for its preceding comment we climb out through
|
|
77
|
+
* these. Examples: `export class X {}` (export_statement), `@dec\ndef f()`
|
|
78
|
+
* (decorated_definition), `const f = () => {}` (lexical_declaration →
|
|
79
|
+
* variable_declarator). Each wraps exactly one declaration, so climbing can't
|
|
80
|
+
* mis-attribute a comment to a sibling. (#780)
|
|
81
|
+
*/
|
|
82
|
+
const DOCSTRING_WRAPPER_TYPES = new Set([
|
|
83
|
+
'export_statement', // JS/TS: export class/function/const ...
|
|
84
|
+
'decorated_definition', // Python: @decorator over def/class
|
|
85
|
+
'lexical_declaration', // JS/TS: const/let x = () => {}
|
|
86
|
+
'variable_declaration', // JS/TS: var x = ...
|
|
87
|
+
'variable_declarator', // JS/TS: the `x = () => {}` inside the declaration
|
|
88
|
+
'ambient_declaration', // TS: declare ...
|
|
89
|
+
]);
|
|
90
|
+
/**
|
|
91
|
+
* Strip comment-syntax markers from a raw comment so the stored docstring is
|
|
92
|
+
* just the prose. Covers the marker styles across every supported language:
|
|
93
|
+
* C-family line and block comments and their doc variants, Rust/Swift/Kotlin
|
|
94
|
+
* triple-slash and bang doc lines, hash lines (Python/Ruby/shell), Lua/Luau
|
|
95
|
+
* line and long-bracket comments, and Pascal brace and paren-star comments.
|
|
96
|
+
* (#780)
|
|
97
|
+
*
|
|
98
|
+
* Paired block delimiters are stripped only when the comment OPENS with one,
|
|
99
|
+
* so a line comment that merely happens to END with a closing delimiter is
|
|
100
|
+
* never truncated. The per-line markers are anchored at line start, so
|
|
101
|
+
* they're safe to apply to any comment.
|
|
102
|
+
*/
|
|
103
|
+
function cleanCommentMarkers(comment) {
|
|
104
|
+
let c = comment.trim();
|
|
105
|
+
if (c.startsWith('/*'))
|
|
106
|
+
c = c.replace(/^\/\*+!?/, '').replace(/\*+\/$/, '');
|
|
107
|
+
else if (c.startsWith('--['))
|
|
108
|
+
c = c.replace(/^--\[=*\[/, '').replace(/\]=*\]$/, '');
|
|
109
|
+
else if (c.startsWith('(*'))
|
|
110
|
+
c = c.replace(/^\(\*/, '').replace(/\*\)$/, '');
|
|
111
|
+
else if (c.startsWith('{'))
|
|
112
|
+
c = c.replace(/^\{/, '').replace(/\}$/, '');
|
|
113
|
+
return c
|
|
114
|
+
.replace(/^\/\/[/!]?\s?/gm, '') // // , and Rust/Swift doc lines /// //!
|
|
115
|
+
.replace(/^--\s?/gm, '') // Lua/Luau line comments
|
|
116
|
+
.replace(/^#\s?/gm, '') // Python/Ruby/shell line comments
|
|
117
|
+
.replace(/^\s*\*\s?/gm, '') // block-comment continuation (* foo)
|
|
118
|
+
.trim();
|
|
119
|
+
}
|
|
73
120
|
/**
|
|
74
121
|
* Get the docstring/comment preceding a node
|
|
75
122
|
*/
|
|
76
123
|
function getPrecedingDocstring(node, source) {
|
|
77
|
-
|
|
124
|
+
// Climb out of any wrapper(s) so a comment preceding the WHOLE construct
|
|
125
|
+
// (export-, decorator-, or const-arrow-wrapped) is reachable as a sibling.
|
|
126
|
+
// The emitted node's own `previousNamedSibling` is empty (export/const) or a
|
|
127
|
+
// decorator (Python) in those cases, so without this the docstring was
|
|
128
|
+
// dropped. (#780)
|
|
129
|
+
let anchor = node;
|
|
130
|
+
while (anchor.parent && DOCSTRING_WRAPPER_TYPES.has(anchor.parent.type)) {
|
|
131
|
+
anchor = anchor.parent;
|
|
132
|
+
}
|
|
133
|
+
let sibling = anchor.previousNamedSibling;
|
|
78
134
|
const comments = [];
|
|
79
135
|
while (sibling) {
|
|
80
136
|
if (sibling.type === 'comment' ||
|
|
@@ -90,14 +146,7 @@ function getPrecedingDocstring(node, source) {
|
|
|
90
146
|
}
|
|
91
147
|
if (comments.length === 0)
|
|
92
148
|
return undefined;
|
|
93
|
-
//
|
|
94
|
-
return comments
|
|
95
|
-
.map((c) => c
|
|
96
|
-
.replace(/^\/\*\*?|\*\/$/g, '')
|
|
97
|
-
.replace(/^\/\/\s?/gm, '')
|
|
98
|
-
.replace(/^\s*\*\s?/gm, '')
|
|
99
|
-
.trim())
|
|
100
|
-
.join('\n')
|
|
101
|
-
.trim();
|
|
149
|
+
// Strip each comment's syntax markers (language-aware), then join.
|
|
150
|
+
return comments.map(cleanCommentMarkers).join('\n').trim();
|
|
102
151
|
}
|
|
103
152
|
//# sourceMappingURL=tree-sitter-helpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-sitter-helpers.js","sourceRoot":"","sources":["../../src/extraction/tree-sitter-helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,wCAYC;AAKD,kCAEC;AAKD,0CAEC;
|
|
1
|
+
{"version":3,"file":"tree-sitter-helpers.js","sourceRoot":"","sources":["../../src/extraction/tree-sitter-helpers.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYH,wCAYC;AAKD,kCAEC;AAKD,0CAEC;AAkDD,sDAgCC;AArHD,+CAAiC;AAGjC;;;;;GAKG;AACH,SAAgB,cAAc,CAC5B,QAAgB,EAChB,IAAc,EACd,IAAY,EACZ,IAAY;IAEZ,MAAM,IAAI,GAAG,MAAM;SAChB,UAAU,CAAC,QAAQ,CAAC;SACpB,MAAM,CAAC,GAAG,QAAQ,IAAI,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;SAC7C,MAAM,CAAC,KAAK,CAAC;SACb,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACpB,OAAO,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,IAAgB,EAAE,MAAc;IAC1D,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC;AAED;;GAEG;AACH,SAAgB,eAAe,CAAC,IAAgB,EAAE,SAAiB;IACjE,OAAO,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;AAC3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,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,yCAAyC;SACpE,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CAAC,IAAgB,EAAE,MAAc;IACpE,yEAAyE;IACzE,2EAA2E;IAC3E,6EAA6E;IAC7E,uEAAuE;IACvE,kBAAkB;IAClB,IAAI,MAAM,GAAG,IAAI,CAAC;IAClB,OAAO,MAAM,CAAC,MAAM,IAAI,uBAAuB,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACxE,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IACzB,CAAC;IAED,IAAI,OAAO,GAAG,MAAM,CAAC,oBAAoB,CAAC;IAC1C,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,OAAO,OAAO,EAAE,CAAC;QACf,IACE,OAAO,CAAC,IAAI,KAAK,SAAS;YAC1B,OAAO,CAAC,IAAI,KAAK,cAAc;YAC/B,OAAO,CAAC,IAAI,KAAK,eAAe;YAChC,OAAO,CAAC,IAAI,KAAK,uBAAuB,EACxC,CAAC;YACD,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;YAC/C,OAAO,GAAG,OAAO,CAAC,oBAAoB,CAAC;QACzC,CAAC;aAAM,CAAC;YACN,MAAM;QACR,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAE5C,mEAAmE;IACnE,OAAO,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -147,11 +147,32 @@ export interface LanguageExtractor {
|
|
|
147
147
|
* Used by languages with fundamentally different AST structures (e.g. Pascal).
|
|
148
148
|
*/
|
|
149
149
|
visitNode?: (node: SyntaxNode, ctx: ExtractorContext) => boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Synthesize members that exist at compile time but not in the source AST,
|
|
152
|
+
* called at the end of class extraction with the class still on the scope
|
|
153
|
+
* stack (so `ctx.createNode` attaches containment + qualified names) and the
|
|
154
|
+
* class's real members already extracted (so the hook can skip a member the
|
|
155
|
+
* source explicitly declares). Used by Java for Lombok-generated accessors
|
|
156
|
+
* (`@Getter`/`@Setter`/`@Data`/`@Value`/`@Builder` → `getX`/`setX`/`builder`/
|
|
157
|
+
* `equals`/`hashCode`/`toString` + the `log` field), which are otherwise
|
|
158
|
+
* invisible and break call-chain analysis (#912). The created nodes carry a
|
|
159
|
+
* `lombok` decorator + a docstring naming the generating annotation, so an
|
|
160
|
+
* agent can tell them apart from hand-written code.
|
|
161
|
+
*/
|
|
162
|
+
synthesizeMembers?: (classNode: SyntaxNode, ctx: ExtractorContext) => void;
|
|
150
163
|
/**
|
|
151
164
|
* Classify a class_declaration node when the grammar reuses one node type
|
|
152
165
|
* for multiple concepts (e.g. Swift uses class_declaration for classes, structs, and enums).
|
|
153
166
|
*/
|
|
154
167
|
classifyClassNode?: (node: SyntaxNode) => 'class' | 'struct' | 'enum' | 'interface' | 'trait';
|
|
168
|
+
/**
|
|
169
|
+
* Classify a methodTypes node when the grammar reuses one node type for
|
|
170
|
+
* both callable and data members (#808): TS/JS class FIELDS
|
|
171
|
+
* (`public_field_definition` / `field_definition`) are methods only when
|
|
172
|
+
* their value is callable (`onClick = () => {}`); a plain field
|
|
173
|
+
* (`public fonts: Fonts;`, `count = 0`) is a property. Default: 'method'.
|
|
174
|
+
*/
|
|
175
|
+
classifyMethodNode?: (node: SyntaxNode) => 'method' | 'property';
|
|
155
176
|
/**
|
|
156
177
|
* Resolve the body node for a function/method/class when it's not a child field.
|
|
157
178
|
* (e.g. Dart puts function_body as a sibling, not a child.)
|
|
@@ -173,6 +194,14 @@ export interface LanguageExtractor {
|
|
|
173
194
|
* When present, the receiver type is included in the qualified name for better searchability.
|
|
174
195
|
*/
|
|
175
196
|
getReceiverType?: (node: SyntaxNode, source: string) => string | undefined;
|
|
197
|
+
/**
|
|
198
|
+
* Extract a function/method's normalized return type name (bare class name,
|
|
199
|
+
* smart-pointer pointee unwrapped), stored on the node as `returnType`. Used
|
|
200
|
+
* by C/C++ so resolution can infer a chained receiver's type from what the
|
|
201
|
+
* inner call returns (`Foo::instance().bar()` → resolve `bar` on `Foo`,
|
|
202
|
+
* issue #645). Return undefined for primitives / void / constructors.
|
|
203
|
+
*/
|
|
204
|
+
getReturnType?: (node: SyntaxNode, source: string) => string | undefined;
|
|
176
205
|
/**
|
|
177
206
|
* Resolve the actual node kind for a type alias declaration.
|
|
178
207
|
* Used by Go where `type_spec` is the named declaration wrapper for structs/interfaces:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-sitter-types.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EACL,IAAI,EACJ,QAAQ,EACR,mBAAmB,EACpB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,oBAAoB;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,IAAI,EAAE,QAAQ,CAAC;IACf,gCAAgC;IAChC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qFAAqF;IACrF,kBAAkB,CAAC,EAAE,UAAU,CAAC;IAChC,iFAAiF;IACjF,YAAY,CAAC,EAAE,UAAU,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,WAA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,CAAC;IAExE;;;;OAIG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE3E;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAEzE;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS,CAAC;IAElF;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,CAAC;IAElE;;;;;OAKG;IACH,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE3E;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,uEAAuE;IACvE,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACtE"}
|
|
@@ -16,15 +16,71 @@ export declare class TreeSitterExtractor {
|
|
|
16
16
|
private nodes;
|
|
17
17
|
private edges;
|
|
18
18
|
private unresolvedReferences;
|
|
19
|
+
private static readonly VALUE_REF_LANGS;
|
|
20
|
+
private static readonly MAX_VALUE_REF_NODES;
|
|
21
|
+
private readonly valueRefsEnabled;
|
|
22
|
+
private fileScopeValues;
|
|
23
|
+
private fileScopeValueCounts;
|
|
24
|
+
private valueRefScopes;
|
|
19
25
|
private errors;
|
|
20
26
|
private extractor;
|
|
21
27
|
private nodeStack;
|
|
22
28
|
private methodIndex;
|
|
29
|
+
private fnRefSpec;
|
|
30
|
+
private fnRefCandidates;
|
|
31
|
+
private vueStoreFile;
|
|
23
32
|
constructor(filePath: string, source: string, language?: Language);
|
|
24
33
|
/**
|
|
25
34
|
* Parse and extract from the source code
|
|
26
35
|
*/
|
|
27
36
|
extract(): ExtractionResult;
|
|
37
|
+
/**
|
|
38
|
+
* Function-as-value capture (#756): if this node is one of the language's
|
|
39
|
+
* value-position containers (call arguments, assignment RHS, struct/object
|
|
40
|
+
* initializer, array/table literal), collect candidate function names from
|
|
41
|
+
* it. Candidates are gated & flushed at end-of-file (flushFnRefCandidates).
|
|
42
|
+
*/
|
|
43
|
+
private maybeCaptureFnRefs;
|
|
44
|
+
/**
|
|
45
|
+
* Candidates-only scan of a subtree the main walkers won't traverse
|
|
46
|
+
* (top-level variable initializers). No extraction side effects. Halts at
|
|
47
|
+
* nested function definitions: their bodies are walked — and their
|
|
48
|
+
* candidates attributed — by extractFunction's own body walk.
|
|
49
|
+
*/
|
|
50
|
+
private scanFnRefSubtree;
|
|
51
|
+
/**
|
|
52
|
+
* Gate captured function-as-value candidates and push survivors as
|
|
53
|
+
* `function_ref` unresolved references.
|
|
54
|
+
*
|
|
55
|
+
* The gate bounds volume and protects precision: a candidate survives only
|
|
56
|
+
* if its name matches a function/method DEFINED IN THIS FILE or a name this
|
|
57
|
+
* file imports/references. Everything else (locals, params, fields passed
|
|
58
|
+
* as arguments) is dropped before it ever reaches the database. Resolution
|
|
59
|
+
* then matches survivors against function/method nodes only
|
|
60
|
+
* (matchFunctionRef) and emits `references` edges — which callers/impact
|
|
61
|
+
* already traverse.
|
|
62
|
+
*
|
|
63
|
+
* Known v1 limit, deliberate: a C/C++ callback registered in a DIFFERENT
|
|
64
|
+
* translation unit than its definition (extern, no symbol imports to match)
|
|
65
|
+
* is not captured. Same-file registration — the dominant C pattern (static
|
|
66
|
+
* callback + same-file ops struct) — is.
|
|
67
|
+
*/
|
|
68
|
+
private flushFnRefCandidates;
|
|
69
|
+
/**
|
|
70
|
+
* Record value-reference bookkeeping as nodes are created: file-scope const/var symbols with
|
|
71
|
+
* distinctive names become reference targets; function/method/const/var symbols become reader
|
|
72
|
+
* scopes whose bodies flushValueRefs scans.
|
|
73
|
+
*/
|
|
74
|
+
private captureValueRefScope;
|
|
75
|
+
/**
|
|
76
|
+
* Emit same-file `references` edges from a symbol to the file-scope const/var it reads (TS/JS).
|
|
77
|
+
* The engine doesn't edge const→consumer, so impact analysis misses "change this table, affect
|
|
78
|
+
* its readers" (the ReScript-PR false positive). Same-file only (resolution is unambiguous),
|
|
79
|
+
* distinctive target names only (dodges the local-shadowing precision trap documented on
|
|
80
|
+
* function_ref), deduped per (reader, target). Default on (HOMEGRAPH_VALUE_REFS=0 disables) +
|
|
81
|
+
* additive. Shadowed targets are pruned — see below.
|
|
82
|
+
*/
|
|
83
|
+
private flushValueRefs;
|
|
28
84
|
/**
|
|
29
85
|
* Visit a node and extract information
|
|
30
86
|
*/
|
|
@@ -58,10 +114,41 @@ export declare class TreeSitterExtractor {
|
|
|
58
114
|
* (class, struct, interface, trait). File nodes do not count as class-like.
|
|
59
115
|
*/
|
|
60
116
|
private isInsideClassLikeNode;
|
|
117
|
+
/**
|
|
118
|
+
* Ruby `CONST = …` assignment whose LHS is a `constant` node — a class/module
|
|
119
|
+
* (or top-level) constant worth extracting as a symbol even inside a class.
|
|
120
|
+
* Other languages don't give an assignment a `constant`-typed LHS, so this
|
|
121
|
+
* gate is effectively Ruby-only.
|
|
122
|
+
*/
|
|
123
|
+
private isClassScopeConstantAssignment;
|
|
61
124
|
/**
|
|
62
125
|
* Extract a function
|
|
63
126
|
*/
|
|
64
127
|
private extractFunction;
|
|
128
|
+
/**
|
|
129
|
+
* Detect a React component declared via an HOC wrapper whose result is itself a
|
|
130
|
+
* component: `forwardRef(...)`, `memo(...)`, `React.forwardRef/memo(...)`, and
|
|
131
|
+
* styled-components / emotion `styled.tag\`…\`` / `styled(Base)\`…\``. These
|
|
132
|
+
* initializers are a call / tagged-template (not a bare arrow), so the const is
|
|
133
|
+
* otherwise classified `constant` — and a constant is skipped by both the
|
|
134
|
+
* JSX-render edge synthesizer and component resolution, so `<Button/>` usages
|
|
135
|
+
* get no edge and callers/impact silently return empty (#841).
|
|
136
|
+
*
|
|
137
|
+
* Returns `{ inner }` — the inline render function to extract as the component
|
|
138
|
+
* body, or `null` when the wrapper has no inline function (`memo(Imported)`,
|
|
139
|
+
* `styled.button\`…\``) and only a bodyless component node is minted — or
|
|
140
|
+
* `undefined` when this initializer is not a recognized component wrapper.
|
|
141
|
+
*/
|
|
142
|
+
private reactComponentHoc;
|
|
143
|
+
/**
|
|
144
|
+
* Emit a `component` node for an HOC-wrapped React component declaration (see
|
|
145
|
+
* reactComponentHoc). Named by the declarator (`Button`) and located at it so
|
|
146
|
+
* the node range spans the body. When the wrapper has an inline render
|
|
147
|
+
* function, its body is walked so the component's callees (hooks, helpers) are
|
|
148
|
+
* captured under the component node — matching how a plain
|
|
149
|
+
* `const Foo = () => …` arrow component already behaves.
|
|
150
|
+
*/
|
|
151
|
+
private extractReactComponentNode;
|
|
65
152
|
/**
|
|
66
153
|
* Extract a class
|
|
67
154
|
*/
|
|
@@ -123,6 +210,72 @@ export declare class TreeSitterExtractor {
|
|
|
123
210
|
* `=> { return {...} }` block. Returns null for any other body shape.
|
|
124
211
|
*/
|
|
125
212
|
private functionReturnedObject;
|
|
213
|
+
/**
|
|
214
|
+
* RTK Query: from a `createApi({ ..., endpoints: build => ({...}) })` or a
|
|
215
|
+
* `baseApi.injectEndpoints({ endpoints: build => ({...}) })` call initializer,
|
|
216
|
+
* return the object literal of endpoint definitions (the object the `endpoints`
|
|
217
|
+
* arrow returns). Returns null for any other call — the common case — so this
|
|
218
|
+
* stays cheap and silent. Keyed on the RTK entry-point names (`createApi` /
|
|
219
|
+
* `injectEndpoints`) like the framework extractors key on their library APIs.
|
|
220
|
+
*/
|
|
221
|
+
private findRtkEndpointsObject;
|
|
222
|
+
/**
|
|
223
|
+
* Extract each RTK Query endpoint (`getX: build.query({...})` / `build.mutation`)
|
|
224
|
+
* as a function node named by the endpoint key, spanning its primary handler
|
|
225
|
+
* (the `queryFn`/`query` arrow) so the fetch logic's calls attribute to the
|
|
226
|
+
* endpoint. Without this an endpoint exists only as an object-literal property —
|
|
227
|
+
* never a node — so the generated `useXQuery` hook can't be bridged to it.
|
|
228
|
+
*/
|
|
229
|
+
private extractRtkEndpoints;
|
|
230
|
+
/**
|
|
231
|
+
* The primary handler arrow of a `build.query({ queryFn|query: (…) => … })`
|
|
232
|
+
* endpoint — prefers `queryFn`, then `query`, else the first function-valued
|
|
233
|
+
* property. Returns null when the endpoint is config-only (no handler arrow).
|
|
234
|
+
*/
|
|
235
|
+
private rtkEndpointHandler;
|
|
236
|
+
/**
|
|
237
|
+
* RTK Query generated-hook bindings. `export const { useGetXQuery,
|
|
238
|
+
* useUpdateYMutation } = someApi` destructures the hooks RTK generates per
|
|
239
|
+
* endpoint off a createApi result. They are real exported symbols that
|
|
240
|
+
* components import, but destructured bindings aren't otherwise extracted —
|
|
241
|
+
* mint a function node per binding matching the RTK hook convention so the hook
|
|
242
|
+
* resolves and the synthesizer can bridge it to its endpoint. Gated tight by the
|
|
243
|
+
* caller (object-pattern off a bare identifier) + the name convention here, so
|
|
244
|
+
* ordinary destructures stay unextracted.
|
|
245
|
+
*/
|
|
246
|
+
private extractRtkHookBindings;
|
|
247
|
+
/** Cheap per-file heuristic: the file carries ≥2 distinct Vue-store signals
|
|
248
|
+
* (defineStore/createStore/Vuex, or the actions/mutations/getters/namespaced
|
|
249
|
+
* vocabulary). Gates the non-exported `const actions = {…}` Vuex-module form so
|
|
250
|
+
* a stray `const actions` in unrelated code is never mistaken for a store. */
|
|
251
|
+
private looksLikeVueStoreFile;
|
|
252
|
+
/** True if an object literal has ≥1 inline function member (`key: () => …` /
|
|
253
|
+
* `method(){}`) — distinguishes an inline action map (zustand/SvelteKit form
|
|
254
|
+
* actions) from a Pinia SETUP store's all-shorthand `return { foo, bar }`
|
|
255
|
+
* (whose functions are body-local consts, walked normally instead). */
|
|
256
|
+
private objectHasInlineFunctions;
|
|
257
|
+
/** Vue store action/mutation/getter collections defined INLINE in a store call:
|
|
258
|
+
* `defineStore({ actions: {…}, getters: {…} })` (Pinia options form),
|
|
259
|
+
* `defineStore('id', { actions: {…} })`, `createStore({ mutations: {…} })`,
|
|
260
|
+
* `new Vuex.Store({ actions: {…} })`. Returns the object literals under those
|
|
261
|
+
* keys so their methods become nodes. Gated on the store-factory callee. */
|
|
262
|
+
private findVueStoreCollectionObjects;
|
|
263
|
+
/** Extract the methods of a store-config object's `actions`/`mutations`/`getters`
|
|
264
|
+
* properties. Used for the canonical Vuex MODULE shape `export default {
|
|
265
|
+
* namespaced, actions: {…}, mutations: {…} }` — object-literal methods aren't
|
|
266
|
+
* otherwise extracted, so the actions/mutations would never be nodes. */
|
|
267
|
+
private extractStoreCollectionMethods;
|
|
268
|
+
/** The SETUP function of a Pinia setup store (`defineStore('id', () => {…})`)
|
|
269
|
+
* — an arrow/function arg with a block body. Returns null for the options form
|
|
270
|
+
* (`defineStore({…})`) and for any non-defineStore call. The setup body's local
|
|
271
|
+
* function consts are the store's actions; the generic body walk doesn't reach
|
|
272
|
+
* them (nested functions are separate scopes), so they're extracted explicitly. */
|
|
273
|
+
private findPiniaSetupFn;
|
|
274
|
+
/** Extract a Pinia setup store's actions: the body-local `const foo = () => …`
|
|
275
|
+
* / `function foo(){}` declarations, named by the binding. (State refs and other
|
|
276
|
+
* consts are left to the normal value-extraction; only the functions matter as
|
|
277
|
+
* the store's callable surface.) */
|
|
278
|
+
private extractPiniaSetupBody;
|
|
126
279
|
/**
|
|
127
280
|
* Extract a variable declaration (const, let, var, etc.)
|
|
128
281
|
*
|
|
@@ -153,6 +306,34 @@ export declare class TreeSitterExtractor {
|
|
|
153
306
|
* don't produce phantom members.
|
|
154
307
|
*/
|
|
155
308
|
private extractTsTypeAliasMembers;
|
|
309
|
+
/**
|
|
310
|
+
* Surface the string-literal "names" of a TypeScript service/contract
|
|
311
|
+
* registry written as a tuple of generic instantiations:
|
|
312
|
+
*
|
|
313
|
+
* type MyServiceList = [
|
|
314
|
+
* Service<'query_apply_record', Req, Resp>,
|
|
315
|
+
* Service<'apply_confirm', Req, Resp>,
|
|
316
|
+
* ];
|
|
317
|
+
*
|
|
318
|
+
* Each `Service<'name', …>` tags an entry with a string-literal name that a
|
|
319
|
+
* dynamic factory (`createService<MyServiceList>()`) turns into a callable
|
|
320
|
+
* property (`api.query_apply_record(…)`). Static extraction otherwise never
|
|
321
|
+
* sees that name — it's a type argument, not a declaration — so
|
|
322
|
+
* `homegraph query query_apply_record` returned nothing (issue #634). We emit
|
|
323
|
+
* each name as a `method` node under the type alias (qualifiedName
|
|
324
|
+
* `MyServiceList::query_apply_record`) so it's searchable and resolvable as a
|
|
325
|
+
* symbol. (A call through the proxy, `api.query_apply_record(…)`, still
|
|
326
|
+
* resolves to the imported `api` binding — the receiver's type isn't known —
|
|
327
|
+
* so this fixes discoverability, not the per-method call edge.)
|
|
328
|
+
*
|
|
329
|
+
* Scope is deliberately narrow to avoid noise: only a string literal that is
|
|
330
|
+
* a DIRECT type argument of a `generic_type` that is itself a DIRECT element
|
|
331
|
+
* of a `tuple_type`. This excludes utility types (`Pick`/`Omit`/`Record` are
|
|
332
|
+
* never written as tuples) and string args nested deeper
|
|
333
|
+
* (`Service<'a', Pick<U, 'id'>>` yields only `a`, never `id`). Names must be
|
|
334
|
+
* valid identifiers, which also rules out route paths / arbitrary strings.
|
|
335
|
+
*/
|
|
336
|
+
private extractTsTupleContractNames;
|
|
156
337
|
/**
|
|
157
338
|
* `foo: () => T` → property_signature whose type_annotation contains a
|
|
158
339
|
* `function_type`. Treat that as a method-shaped contract member, since
|
|
@@ -439,6 +620,17 @@ export declare class TreeSitterExtractor {
|
|
|
439
620
|
* Extract function calls from a Pascal expression
|
|
440
621
|
*/
|
|
441
622
|
private extractPascalCall;
|
|
623
|
+
/**
|
|
624
|
+
* Extract a PAREN-LESS Pascal method/procedure call (`Obj.Method;`,
|
|
625
|
+
* `TFoo.GetInstance.DoIt;`). Pascal lets a no-arg method drop its parens, so it
|
|
626
|
+
* parses as a bare `exprDot` (not an `exprCall`). A bare `exprDot` is
|
|
627
|
+
* syntactically identical to a field/property access, so this is only ever
|
|
628
|
+
* called for a STATEMENT-level exprDot (caller-gated): a bare `Obj.Field;`
|
|
629
|
+
* statement is a no-op, so a statement-level dot expression is a call. (An
|
|
630
|
+
* exprDot in assignment LHS/RHS or a condition is left alone — there it really
|
|
631
|
+
* can be a field/property read.)
|
|
632
|
+
*/
|
|
633
|
+
private extractPascalParenlessCall;
|
|
442
634
|
/**
|
|
443
635
|
* Recursively visit a Pascal block/statement tree for call expressions
|
|
444
636
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree-sitter.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,QAAQ,EAIR,gBAAgB,EAGjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tree-sitter.d.ts","sourceRoot":"","sources":["../../src/extraction/tree-sitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EACL,QAAQ,EAIR,gBAAgB,EAGjB,MAAM,UAAU,CAAC;AAqBlB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoRvD;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAW;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,KAAK,CAAc;IAC3B,OAAO,CAAC,oBAAoB,CAA6B;IAIzD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAoK;IAC3M,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,mBAAmB,CAAU;IACrD,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA4C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