homegraph 1.2.0 → 1.5.0
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/README.md +48 -11
- package/dist/bin/homegraph.js +298 -72
- package/dist/bin/homegraph.js.map +1 -1
- package/dist/context/index.d.ts.map +1 -1
- package/dist/context/index.js +117 -11
- package/dist/context/index.js.map +1 -1
- package/dist/db/index.d.ts +207 -6
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +461 -20
- 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 +19 -1
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/queries.d.ts +157 -3
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +426 -9
- package/dist/db/queries.js.map +1 -1
- package/dist/db/schema.sql +32 -1
- 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 +119 -0
- package/dist/db/wal-valve.d.ts.map +1 -0
- package/dist/db/wal-valve.js +290 -0
- package/dist/db/wal-valve.js.map +1 -0
- package/dist/directory.d.ts +9 -5
- package/dist/directory.d.ts.map +1 -1
- package/dist/directory.js +210 -19
- package/dist/directory.js.map +1 -1
- package/dist/extraction/arkts-batch-worker.js +3 -2
- package/dist/extraction/arkts-batch-worker.js.map +1 -1
- package/dist/extraction/cfml-extractor.d.ts +107 -0
- package/dist/extraction/cfml-extractor.d.ts.map +1 -0
- package/dist/extraction/cfml-extractor.js +494 -0
- package/dist/extraction/cfml-extractor.js.map +1 -0
- 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/grammars.d.ts +25 -1
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +177 -24
- package/dist/extraction/grammars.js.map +1 -1
- package/dist/extraction/index.d.ts +52 -14
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +521 -314
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +90 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +1579 -128
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/languages/c-cpp.d.ts +42 -0
- package/dist/extraction/languages/c-cpp.d.ts.map +1 -1
- package/dist/extraction/languages/c-cpp.js +369 -4
- package/dist/extraction/languages/c-cpp.js.map +1 -1
- package/dist/extraction/languages/cfquery.d.ts +12 -0
- package/dist/extraction/languages/cfquery.d.ts.map +1 -0
- package/dist/extraction/languages/cfquery.js +28 -0
- package/dist/extraction/languages/cfquery.js.map +1 -0
- package/dist/extraction/languages/cfscript.d.ts +3 -0
- package/dist/extraction/languages/cfscript.d.ts.map +1 -0
- package/dist/extraction/languages/cfscript.js +73 -0
- package/dist/extraction/languages/cfscript.js.map +1 -0
- package/dist/extraction/languages/cobol.d.ts +33 -0
- package/dist/extraction/languages/cobol.d.ts.map +1 -0
- package/dist/extraction/languages/cobol.js +499 -0
- package/dist/extraction/languages/cobol.js.map +1 -0
- package/dist/extraction/languages/erlang.d.ts +3 -0
- package/dist/extraction/languages/erlang.d.ts.map +1 -0
- package/dist/extraction/languages/erlang.js +350 -0
- package/dist/extraction/languages/erlang.js.map +1 -0
- package/dist/extraction/languages/index.d.ts.map +1 -1
- package/dist/extraction/languages/index.js +16 -0
- package/dist/extraction/languages/index.js.map +1 -1
- package/dist/extraction/languages/nix.d.ts +3 -0
- package/dist/extraction/languages/nix.d.ts.map +1 -0
- package/dist/extraction/languages/nix.js +294 -0
- package/dist/extraction/languages/nix.js.map +1 -0
- package/dist/extraction/languages/solidity.d.ts +3 -0
- package/dist/extraction/languages/solidity.d.ts.map +1 -0
- package/dist/extraction/languages/solidity.js +293 -0
- package/dist/extraction/languages/solidity.js.map +1 -0
- package/dist/extraction/languages/terraform.d.ts +3 -0
- package/dist/extraction/languages/terraform.d.ts.map +1 -0
- package/dist/extraction/languages/terraform.js +641 -0
- package/dist/extraction/languages/terraform.js.map +1 -0
- package/dist/extraction/languages/vbnet.d.ts +11 -0
- package/dist/extraction/languages/vbnet.d.ts.map +1 -0
- package/dist/extraction/languages/vbnet.js +141 -0
- package/dist/extraction/languages/vbnet.js.map +1 -0
- package/dist/extraction/mybatis-extractor.d.ts +30 -10
- package/dist/extraction/mybatis-extractor.d.ts.map +1 -1
- package/dist/extraction/mybatis-extractor.js +140 -38
- package/dist/extraction/mybatis-extractor.js.map +1 -1
- package/dist/extraction/parse-pool.d.ts +27 -1
- package/dist/extraction/parse-pool.d.ts.map +1 -1
- package/dist/extraction/parse-pool.js +75 -7
- package/dist/extraction/parse-pool.js.map +1 -1
- package/dist/extraction/parse-worker.js +9 -2
- package/dist/extraction/parse-worker.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-helpers.d.ts.map +1 -1
- package/dist/extraction/tree-sitter-helpers.js +1 -0
- package/dist/extraction/tree-sitter-helpers.js.map +1 -1
- package/dist/extraction/tree-sitter-types.d.ts +3 -1
- package/dist/extraction/tree-sitter-types.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.d.ts +38 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +801 -10
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-arkts.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-terraform.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/graph/traversal.d.ts.map +1 -1
- package/dist/graph/traversal.js +1 -1
- package/dist/graph/traversal.js.map +1 -1
- package/dist/index.d.ts +74 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +436 -55
- package/dist/index.js.map +1 -1
- package/dist/installer/index.d.ts +42 -0
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +97 -2
- package/dist/installer/index.js.map +1 -1
- package/dist/mcp/daemon.d.ts +25 -3
- package/dist/mcp/daemon.d.ts.map +1 -1
- package/dist/mcp/daemon.js +62 -8
- package/dist/mcp/daemon.js.map +1 -1
- package/dist/mcp/dynamic-boundaries.d.ts.map +1 -1
- package/dist/mcp/dynamic-boundaries.js +2 -1
- package/dist/mcp/dynamic-boundaries.js.map +1 -1
- package/dist/mcp/early-ppid.d.ts +26 -0
- package/dist/mcp/early-ppid.d.ts.map +1 -0
- package/dist/mcp/early-ppid.js +29 -0
- package/dist/mcp/early-ppid.js.map +1 -0
- package/dist/mcp/engine.d.ts +4 -5
- package/dist/mcp/engine.d.ts.map +1 -1
- package/dist/mcp/engine.js +27 -1
- package/dist/mcp/engine.js.map +1 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +41 -6
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/liveness-watchdog.d.ts +18 -1
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +73 -13
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/memory-budget.d.ts +30 -0
- package/dist/mcp/memory-budget.d.ts.map +1 -0
- package/dist/mcp/memory-budget.js +123 -0
- package/dist/mcp/memory-budget.js.map +1 -0
- package/dist/mcp/proxy.d.ts.map +1 -1
- package/dist/mcp/proxy.js +88 -4
- package/dist/mcp/proxy.js.map +1 -1
- package/dist/mcp/query-cache.d.ts +35 -4
- package/dist/mcp/query-cache.d.ts.map +1 -1
- package/dist/mcp/query-cache.js +89 -19
- package/dist/mcp/query-cache.js.map +1 -1
- package/dist/mcp/query-pool.d.ts +46 -12
- package/dist/mcp/query-pool.d.ts.map +1 -1
- package/dist/mcp/query-pool.js +100 -23
- package/dist/mcp/query-pool.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.d.ts +4 -27
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +39 -84
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/session.d.ts +14 -0
- package/dist/mcp/session.d.ts.map +1 -1
- package/dist/mcp/session.js +28 -1
- package/dist/mcp/session.js.map +1 -1
- package/dist/mcp/startup-handshake.d.ts +44 -0
- package/dist/mcp/startup-handshake.d.ts.map +1 -0
- package/dist/mcp/startup-handshake.js +73 -0
- package/dist/mcp/startup-handshake.js.map +1 -0
- package/dist/mcp/tools.d.ts +104 -4
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +2432 -217
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transport.d.ts.map +1 -1
- package/dist/mcp/transport.js +18 -0
- package/dist/mcp/transport.js.map +1 -1
- package/dist/project-config.d.ts +38 -0
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +101 -2
- package/dist/project-config.js.map +1 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts +2 -1
- package/dist/resolution/c-fnptr-synthesizer.d.ts.map +1 -1
- package/dist/resolution/c-fnptr-synthesizer.js +178 -146
- package/dist/resolution/c-fnptr-synthesizer.js.map +1 -1
- package/dist/resolution/callback-synthesizer.d.ts +54 -10
- package/dist/resolution/callback-synthesizer.d.ts.map +1 -1
- package/dist/resolution/callback-synthesizer.js +1299 -257
- 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/cics.d.ts +20 -0
- package/dist/resolution/frameworks/cics.d.ts.map +1 -0
- package/dist/resolution/frameworks/cics.js +90 -0
- package/dist/resolution/frameworks/cics.js.map +1 -0
- 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/frameworks/index.d.ts.map +1 -1
- package/dist/resolution/frameworks/index.js +3 -0
- package/dist/resolution/frameworks/index.js.map +1 -1
- package/dist/resolution/frameworks/java.d.ts.map +1 -1
- package/dist/resolution/frameworks/java.js +14 -6
- package/dist/resolution/frameworks/java.js.map +1 -1
- package/dist/resolution/frameworks/terraform.d.ts +38 -0
- package/dist/resolution/frameworks/terraform.d.ts.map +1 -0
- package/dist/resolution/frameworks/terraform.js +277 -0
- package/dist/resolution/frameworks/terraform.js.map +1 -0
- package/dist/resolution/goframe-synthesizer.d.ts +2 -1
- package/dist/resolution/goframe-synthesizer.d.ts.map +1 -1
- package/dist/resolution/goframe-synthesizer.js +8 -3
- package/dist/resolution/goframe-synthesizer.js.map +1 -1
- package/dist/resolution/import-resolver.d.ts +9 -3
- package/dist/resolution/import-resolver.d.ts.map +1 -1
- package/dist/resolution/import-resolver.js +295 -11
- package/dist/resolution/import-resolver.js.map +1 -1
- package/dist/resolution/index.d.ts +146 -8
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +1089 -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 -4
- package/dist/resolution/name-matcher.d.ts.map +1 -1
- package/dist/resolution/name-matcher.js +793 -130
- 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/strip-comments.d.ts +1 -1
- package/dist/resolution/strip-comments.d.ts.map +1 -1
- package/dist/resolution/strip-comments.js +49 -0
- package/dist/resolution/strip-comments.js.map +1 -1
- package/dist/resolution/types.d.ts +32 -0
- package/dist/resolution/types.d.ts.map +1 -1
- package/dist/resolution/workspace-packages.d.ts +10 -0
- package/dist/resolution/workspace-packages.d.ts.map +1 -1
- package/dist/resolution/workspace-packages.js +142 -4
- package/dist/resolution/workspace-packages.js.map +1 -1
- package/dist/search/identifier-segments.d.ts +60 -0
- package/dist/search/identifier-segments.d.ts.map +1 -0
- package/dist/search/identifier-segments.js +176 -0
- package/dist/search/identifier-segments.js.map +1 -0
- package/dist/search/query-utils.d.ts +201 -0
- package/dist/search/query-utils.d.ts.map +1 -1
- package/dist/search/query-utils.js +919 -2
- package/dist/search/query-utils.js.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/git-scanner.d.ts +93 -0
- package/dist/spec/build/git-scanner.d.ts.map +1 -0
- package/dist/spec/build/git-scanner.js +254 -0
- package/dist/spec/build/git-scanner.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/fts.d.ts.map +1 -1
- package/dist/spec/db/fts.js +19 -50
- 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 +175 -4
- 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 +4 -0
- package/dist/spec/db/schema.js.map +1 -1
- package/dist/spec/db/schema.sql +5 -1
- 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 +11 -5
- 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/git-utils.d.ts +8 -0
- package/dist/spec/git-utils.d.ts.map +1 -0
- package/dist/spec/git-utils.js +14 -0
- package/dist/spec/git-utils.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 +100 -50
- 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/clusterer.d.ts +63 -0
- package/dist/spec/mine/clusterer.d.ts.map +1 -0
- package/dist/spec/mine/clusterer.js +904 -0
- package/dist/spec/mine/clusterer.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/progress-handler.d.ts +22 -0
- package/dist/spec/mine/progress-handler.d.ts.map +1 -0
- package/dist/spec/mine/progress-handler.js +108 -0
- package/dist/spec/mine/progress-handler.js.map +1 -0
- package/dist/spec/mine/progress.d.ts +23 -0
- package/dist/spec/mine/progress.d.ts.map +1 -0
- package/dist/spec/mine/progress.js +12 -0
- package/dist/spec/mine/progress.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/spec/utils.d.ts +4 -16
- package/dist/spec/utils.d.ts.map +1 -1
- package/dist/spec/utils.js +6 -58
- package/dist/spec/utils.js.map +1 -1
- package/dist/sync/git-hooks.d.ts.map +1 -1
- package/dist/sync/git-hooks.js +2 -0
- package/dist/sync/git-hooks.js.map +1 -1
- package/dist/sync/watcher.d.ts +35 -6
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +127 -17
- package/dist/sync/watcher.js.map +1 -1
- package/dist/sync/worktree.d.ts.map +1 -1
- package/dist/sync/worktree.js +5 -0
- package/dist/sync/worktree.js.map +1 -1
- package/dist/telemetry/index.js +3 -3
- package/dist/telemetry/index.js.map +1 -1
- package/dist/types.d.ts +22 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -1
- package/dist/upgrade/index.d.ts +32 -0
- package/dist/upgrade/index.d.ts.map +1 -1
- package/dist/upgrade/index.js +162 -14
- package/dist/upgrade/index.js.map +1 -1
- package/dist/upgrade/remove-binary.d.ts +87 -0
- package/dist/upgrade/remove-binary.d.ts.map +1 -0
- package/dist/upgrade/remove-binary.js +289 -0
- package/dist/upgrade/remove-binary.js.map +1 -0
- package/dist/upgrade/update-check.d.ts +92 -0
- package/dist/upgrade/update-check.d.ts.map +1 -0
- package/dist/upgrade/update-check.js +258 -0
- package/dist/upgrade/update-check.js.map +1 -0
- package/package.json +6 -2
- package/scripts/agent-eval/run-all.sh +6 -0
- package/scripts/build-bundle.sh +5 -0
- package/scripts/npm-shim.js +8 -1
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/data/agents.json +0 -109
- package/scripts/exp_boundary_eval/data/experiments.json +0 -140
- package/scripts/qa_eval/README.md +0 -407
- package/scripts/qa_eval/_test_deveco_probe.py +0 -41
- package/scripts/qa_eval/agent_runner.py +0 -526
- package/scripts/qa_eval/data/.gitignore +0 -4
- package/scripts/qa_eval/data/test-set.jsonl +0 -2
- package/scripts/qa_eval/eval_metrics.py +0 -274
- package/scripts/qa_eval/external_agent.py +0 -976
- package/scripts/qa_eval/llm_config.py +0 -92
- package/scripts/qa_eval/memory_monitor.py +0 -132
- package/scripts/qa_eval/my_answer_accuracy.py +0 -187
- package/scripts/qa_eval/requirements.txt +0 -2
- package/scripts/qa_eval/run_pipeline.py +0 -804
- package/scripts/qa_eval/stats_efficiency.py +0 -279
- package/scripts/qa_eval/stats_scores.py +0 -207
|
@@ -38,10 +38,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
};
|
|
39
39
|
})();
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.isNixPathImportRef = isNixPathImportRef;
|
|
42
|
+
exports.clearImportResolverMemos = clearImportResolverMemos;
|
|
41
43
|
exports.resolveImportPath = resolveImportPath;
|
|
42
44
|
exports.clearCppIncludeDirCache = clearCppIncludeDirCache;
|
|
43
45
|
exports.loadCppIncludeDirs = loadCppIncludeDirs;
|
|
44
46
|
exports.isPhpIncludePathRef = isPhpIncludePathRef;
|
|
47
|
+
exports.isCobolCopybookRef = isCobolCopybookRef;
|
|
45
48
|
exports.extractImportMappings = extractImportMappings;
|
|
46
49
|
exports.clearImportMappingCache = clearImportMappingCache;
|
|
47
50
|
exports.extractReExports = extractReExports;
|
|
@@ -51,11 +54,17 @@ const fs = __importStar(require("fs"));
|
|
|
51
54
|
const path = __importStar(require("path"));
|
|
52
55
|
const path_aliases_1 = require("./path-aliases");
|
|
53
56
|
const workspace_packages_1 = require("./workspace-packages");
|
|
57
|
+
const name_matcher_1 = require("./name-matcher");
|
|
54
58
|
/**
|
|
55
59
|
* Extension resolution order by language
|
|
56
60
|
*/
|
|
57
61
|
const EXTENSION_RESOLUTION = {
|
|
58
62
|
typescript: ['.ts', '.tsx', '.d.ts', '.js', '.jsx', '/index.ts', '/index.tsx', '/index.js'],
|
|
63
|
+
// ArkTS imports both `.ets` components and plain `.ts` logic modules —
|
|
64
|
+
// HarmonyOS projects are always a mix. `/Index.ets` (capital I) is ohpm's
|
|
65
|
+
// module-entry convention, hit when a bare workspace import ("data") is
|
|
66
|
+
// rewritten to the member's directory; lowercase variants for safety.
|
|
67
|
+
arkts: ['.ets', '.ts', '.d.ts', '.js', '/Index.ets', '/index.ets', '/index.ts', '/index.js'],
|
|
59
68
|
javascript: ['.js', '.jsx', '.mjs', '.cjs', '/index.js', '/index.jsx'],
|
|
60
69
|
tsx: ['.tsx', '.ts', '.d.ts', '.js', '.jsx', '/index.tsx', '/index.ts', '/index.js'],
|
|
61
70
|
jsx: ['.jsx', '.js', '/index.jsx', '/index.js'],
|
|
@@ -75,11 +84,78 @@ const EXTENSION_RESOLUTION = {
|
|
|
75
84
|
php: ['.php'],
|
|
76
85
|
ruby: ['.rb'],
|
|
77
86
|
objc: ['.h', '.m', '.mm'],
|
|
87
|
+
nix: ['.nix', '/default.nix'],
|
|
78
88
|
};
|
|
89
|
+
function isNixPathImportRef(ref) {
|
|
90
|
+
return (ref.language === 'nix' &&
|
|
91
|
+
ref.referenceKind === 'imports' &&
|
|
92
|
+
(ref.referenceName.startsWith('./') || ref.referenceName.startsWith('../')) &&
|
|
93
|
+
!/[\s{}()[\];"'<>$]/.test(ref.referenceName));
|
|
94
|
+
}
|
|
79
95
|
/**
|
|
80
96
|
* Resolve an import path to an actual file
|
|
81
97
|
*/
|
|
98
|
+
// Per-context memos for the two hottest pure lookups on the resolution path:
|
|
99
|
+
// import-specifier → file resolution and exported-symbol lookup. Both are pure
|
|
100
|
+
// given a stable file set + node table, which is exactly the window between
|
|
101
|
+
// ReferenceResolver.clearCaches() calls — clearImportResolverMemos() is invoked
|
|
102
|
+
// there, so the staleness discipline matches the resolver's own caches.
|
|
103
|
+
const importPathMemos = new WeakMap();
|
|
104
|
+
const exportedSymbolMemos = new WeakMap();
|
|
105
|
+
const fileExportIndexes = new WeakMap();
|
|
106
|
+
function getFileExportIndex(filePath, context) {
|
|
107
|
+
let perFile = fileExportIndexes.get(context);
|
|
108
|
+
if (!perFile) {
|
|
109
|
+
perFile = new Map();
|
|
110
|
+
fileExportIndexes.set(context, perFile);
|
|
111
|
+
}
|
|
112
|
+
let idx = perFile.get(filePath);
|
|
113
|
+
if (!idx) {
|
|
114
|
+
idx = { byName: new Map(), defaultComponent: undefined, defaultFnClass: undefined };
|
|
115
|
+
for (const n of context.getNodesInFile(filePath)) {
|
|
116
|
+
if (!n.isExported)
|
|
117
|
+
continue;
|
|
118
|
+
if (!idx.byName.has(n.name))
|
|
119
|
+
idx.byName.set(n.name, n);
|
|
120
|
+
if (idx.defaultComponent === undefined && n.kind === 'component')
|
|
121
|
+
idx.defaultComponent = n;
|
|
122
|
+
if (idx.defaultFnClass === undefined && (n.kind === 'function' || n.kind === 'class'))
|
|
123
|
+
idx.defaultFnClass = n;
|
|
124
|
+
}
|
|
125
|
+
perFile.set(filePath, idx);
|
|
126
|
+
}
|
|
127
|
+
return idx;
|
|
128
|
+
}
|
|
129
|
+
/** Drop the per-context memo tables (see ReferenceResolver.clearCaches). */
|
|
130
|
+
function clearImportResolverMemos(context) {
|
|
131
|
+
importPathMemos.delete(context);
|
|
132
|
+
exportedSymbolMemos.delete(context);
|
|
133
|
+
fileExportIndexes.delete(context);
|
|
134
|
+
luaFileBasenameIndexes.delete(context);
|
|
135
|
+
cobolCopybookIndexes.delete(context);
|
|
136
|
+
}
|
|
82
137
|
function resolveImportPath(importPath, fromFile, language, context) {
|
|
138
|
+
let memo = importPathMemos.get(context);
|
|
139
|
+
if (!memo) {
|
|
140
|
+
memo = new Map();
|
|
141
|
+
importPathMemos.set(context, memo);
|
|
142
|
+
}
|
|
143
|
+
const key = `${language}\0${fromFile}\0${importPath}`;
|
|
144
|
+
const hit = memo.get(key);
|
|
145
|
+
if (hit !== undefined || memo.has(key))
|
|
146
|
+
return hit ?? null;
|
|
147
|
+
const resolved = resolveImportPathUncached(importPath, fromFile, language, context);
|
|
148
|
+
memo.set(key, resolved);
|
|
149
|
+
return resolved;
|
|
150
|
+
}
|
|
151
|
+
function resolveImportPathUncached(importPath, fromFile, language, context) {
|
|
152
|
+
// COBOL COPY/EXEC SQL INCLUDE names a copybook member, not a path — the
|
|
153
|
+
// compiler searches a library, so we match against indexed file basenames.
|
|
154
|
+
// Must run before isExternalImport: a bare member name would otherwise be
|
|
155
|
+
// misclassified as an external package.
|
|
156
|
+
if (language === 'cobol') {
|
|
157
|
+
return resolveCobolCopybook(importPath, fromFile, context);
|
|
158
|
+
}
|
|
83
159
|
// Skip external/npm packages — but pass the context so the
|
|
84
160
|
// bare-specifier heuristic can consult the project's tsconfig
|
|
85
161
|
// alias map first (custom prefixes like `@components/*` would
|
|
@@ -105,6 +181,81 @@ function resolveImportPath(importPath, fromFile, language, context) {
|
|
|
105
181
|
}
|
|
106
182
|
return null;
|
|
107
183
|
}
|
|
184
|
+
/**
|
|
185
|
+
* COBOL copybook lookup: `COPY CVACT01Y` (or `EXEC SQL INCLUDE X`) names a
|
|
186
|
+
* library member resolved by the compiler's copybook search path, so we match
|
|
187
|
+
* the member against indexed file basenames, case-insensitively. `.cpy` wins
|
|
188
|
+
* over a same-named program; a same-directory hit wins within a tier. The
|
|
189
|
+
* stem index is built once per resolution context (a per-ref scan of every
|
|
190
|
+
* file node would go quadratic on copybook-heavy repos).
|
|
191
|
+
*/
|
|
192
|
+
const cobolCopybookIndexes = new WeakMap();
|
|
193
|
+
/**
|
|
194
|
+
* Per-context basename → file-paths index for Lua/Luau require resolution
|
|
195
|
+
* (cobolCopybookIndexes pattern). resolveLuaRequire previously ran
|
|
196
|
+
* `getAllFiles().filter(endsWith)` FOUR times per require ref — ~7.5k string
|
|
197
|
+
* suffix scans each, measured at ~0.9ms/ref (2.7s combined on kong's 3k
|
|
198
|
+
* requires). Buckets preserve getAllFiles() iteration order so the per-suffix
|
|
199
|
+
* candidate list filters to exactly the array the full scan produced —
|
|
200
|
+
* identical matches, identical stable sort, identical winner.
|
|
201
|
+
*/
|
|
202
|
+
const luaFileBasenameIndexes = new WeakMap();
|
|
203
|
+
function luaBasenameIndex(context) {
|
|
204
|
+
let index = luaFileBasenameIndexes.get(context);
|
|
205
|
+
if (!index) {
|
|
206
|
+
index = new Map();
|
|
207
|
+
for (const f of context.getAllFiles()) {
|
|
208
|
+
const base = f.split('/').pop() ?? '';
|
|
209
|
+
const paths = index.get(base);
|
|
210
|
+
if (paths)
|
|
211
|
+
paths.push(f);
|
|
212
|
+
else
|
|
213
|
+
index.set(base, [f]);
|
|
214
|
+
}
|
|
215
|
+
luaFileBasenameIndexes.set(context, index);
|
|
216
|
+
}
|
|
217
|
+
return index;
|
|
218
|
+
}
|
|
219
|
+
function resolveCobolCopybook(member, fromFile, context) {
|
|
220
|
+
let index = cobolCopybookIndexes.get(context);
|
|
221
|
+
if (!index) {
|
|
222
|
+
index = new Map();
|
|
223
|
+
for (const fileNode of context.getNodesByKind('file')) {
|
|
224
|
+
const normalized = fileNode.filePath.replace(/\\/g, '/');
|
|
225
|
+
const base = normalized.split('/').pop() ?? '';
|
|
226
|
+
const dot = base.lastIndexOf('.');
|
|
227
|
+
const stem = (dot > 0 ? base.slice(0, dot) : base).toLowerCase();
|
|
228
|
+
const paths = index.get(stem);
|
|
229
|
+
if (paths)
|
|
230
|
+
paths.push(fileNode.filePath);
|
|
231
|
+
else
|
|
232
|
+
index.set(stem, [fileNode.filePath]);
|
|
233
|
+
}
|
|
234
|
+
cobolCopybookIndexes.set(context, index);
|
|
235
|
+
}
|
|
236
|
+
const candidates = index.get(member.toLowerCase());
|
|
237
|
+
if (!candidates || candidates.length === 0)
|
|
238
|
+
return null;
|
|
239
|
+
const fromDir = fromFile.replace(/\\/g, '/').split('/').slice(0, -1).join('/');
|
|
240
|
+
let best = null;
|
|
241
|
+
let bestScore = -1;
|
|
242
|
+
for (const candidate of candidates) {
|
|
243
|
+
const normalized = candidate.replace(/\\/g, '/');
|
|
244
|
+
const ext = normalized.slice(normalized.lastIndexOf('.')).toLowerCase();
|
|
245
|
+
let score = 0;
|
|
246
|
+
if (ext === '.cpy')
|
|
247
|
+
score += 4;
|
|
248
|
+
else if (ext === '.cbl' || ext === '.cob' || ext === '.cobol')
|
|
249
|
+
score += 2;
|
|
250
|
+
if (normalized.split('/').slice(0, -1).join('/') === fromDir)
|
|
251
|
+
score += 1;
|
|
252
|
+
if (score > bestScore) {
|
|
253
|
+
bestScore = score;
|
|
254
|
+
best = candidate;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return best;
|
|
258
|
+
}
|
|
108
259
|
/**
|
|
109
260
|
* C and C++ standard library header names (without delimiters).
|
|
110
261
|
* Used by isExternalImport to filter system includes from resolution.
|
|
@@ -163,7 +314,7 @@ function isExternalImport(importPath, language, context) {
|
|
|
163
314
|
return false;
|
|
164
315
|
}
|
|
165
316
|
// Common external patterns
|
|
166
|
-
if (language === 'typescript' || language === 'javascript' || language === 'tsx' || language === 'jsx') {
|
|
317
|
+
if (language === 'typescript' || language === 'javascript' || language === 'tsx' || language === 'jsx' || language === 'arkts') {
|
|
167
318
|
// Node built-ins
|
|
168
319
|
if (['fs', 'path', 'os', 'crypto', 'http', 'https', 'url', 'util', 'events', 'stream', 'child_process', 'buffer'].includes(importPath)) {
|
|
169
320
|
return true;
|
|
@@ -551,6 +702,14 @@ function isPhpIncludePathRef(ref) {
|
|
|
551
702
|
ref.referenceKind === 'imports' &&
|
|
552
703
|
(ref.referenceName.includes('/') || ref.referenceName.includes('.')));
|
|
553
704
|
}
|
|
705
|
+
/**
|
|
706
|
+
* Is this a COBOL COPY / EXEC SQL INCLUDE copybook reference? These resolve
|
|
707
|
+
* to files only (or stay unresolved for compiler-supplied members) — never
|
|
708
|
+
* to a same-named symbol via the name-matcher.
|
|
709
|
+
*/
|
|
710
|
+
function isCobolCopybookRef(ref) {
|
|
711
|
+
return ref.language === 'cobol' && ref.referenceKind === 'imports';
|
|
712
|
+
}
|
|
554
713
|
/**
|
|
555
714
|
* Resolve a PHP include/require path to a project-relative file path.
|
|
556
715
|
*
|
|
@@ -577,7 +736,7 @@ function resolvePhpIncludePath(includePath, fromFile, context) {
|
|
|
577
736
|
*/
|
|
578
737
|
function extractImportMappings(_filePath, content, language) {
|
|
579
738
|
const mappings = [];
|
|
580
|
-
if (language === 'typescript' || language === 'javascript' || language === 'tsx' || language === 'jsx') {
|
|
739
|
+
if (language === 'typescript' || language === 'javascript' || language === 'tsx' || language === 'jsx' || language === 'arkts') {
|
|
581
740
|
mappings.push(...extractJSImports(content));
|
|
582
741
|
}
|
|
583
742
|
else if (language === 'svelte' || language === 'vue' || language === 'astro') {
|
|
@@ -966,7 +1125,8 @@ function extractReExports(content, language) {
|
|
|
966
1125
|
if (language !== 'typescript' &&
|
|
967
1126
|
language !== 'javascript' &&
|
|
968
1127
|
language !== 'tsx' &&
|
|
969
|
-
language !== 'jsx'
|
|
1128
|
+
language !== 'jsx' &&
|
|
1129
|
+
language !== 'arkts') {
|
|
970
1130
|
return [];
|
|
971
1131
|
}
|
|
972
1132
|
const out = [];
|
|
@@ -1130,6 +1290,29 @@ function resolveViaImport(ref, context) {
|
|
|
1130
1290
|
}
|
|
1131
1291
|
return null;
|
|
1132
1292
|
}
|
|
1293
|
+
// COBOL COPY / EXEC SQL INCLUDE — resolve the copybook member to a
|
|
1294
|
+
// file→file edge, mirroring the C/C++ include branch above. A member that
|
|
1295
|
+
// matches no indexed file (compiler-supplied copybooks like SQLCA/DFHAID)
|
|
1296
|
+
// stays unresolved — callers must not fall back to the symbol name-matcher,
|
|
1297
|
+
// which would connect it to a same-named import symbol elsewhere.
|
|
1298
|
+
if (isCobolCopybookRef(ref)) {
|
|
1299
|
+
const resolvedPath = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
|
|
1300
|
+
if (!resolvedPath)
|
|
1301
|
+
return null;
|
|
1302
|
+
const basename = resolvedPath.split('/').pop();
|
|
1303
|
+
const fileNode = context
|
|
1304
|
+
.getNodesByName(basename)
|
|
1305
|
+
.find((n) => n.kind === 'file' && n.filePath === resolvedPath);
|
|
1306
|
+
if (fileNode) {
|
|
1307
|
+
return {
|
|
1308
|
+
original: ref,
|
|
1309
|
+
targetNodeId: fileNode.id,
|
|
1310
|
+
confidence: 0.9,
|
|
1311
|
+
resolvedBy: 'import',
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1314
|
+
return null;
|
|
1315
|
+
}
|
|
1133
1316
|
// PHP include/require — resolve the static string path to a file→file
|
|
1134
1317
|
// edge, mirroring the C/C++ branch above. Distinguish include PATHS from
|
|
1135
1318
|
// namespace `use` symbols by shape: an include path contains a slash or a
|
|
@@ -1159,6 +1342,28 @@ function resolveViaImport(ref, context) {
|
|
|
1159
1342
|
// db.php elsewhere in the tree — a wrong edge is worse than a missing one.
|
|
1160
1343
|
return null;
|
|
1161
1344
|
}
|
|
1345
|
+
// Nix static project-path imports (`import ./x.nix`, `builtins.import ./dir`,
|
|
1346
|
+
// `import ./x.nix {}`) resolve to file nodes only. Do not resolve
|
|
1347
|
+
// angle-bracket channels, attribute expressions, variables, or other dynamic
|
|
1348
|
+
// expressions as project files.
|
|
1349
|
+
if (isNixPathImportRef(ref)) {
|
|
1350
|
+
const resolvedPath = resolveImportPath(ref.referenceName, ref.filePath, ref.language, context);
|
|
1351
|
+
if (!resolvedPath)
|
|
1352
|
+
return null;
|
|
1353
|
+
const basename = resolvedPath.split('/').pop();
|
|
1354
|
+
const fileNode = context
|
|
1355
|
+
.getNodesByName(basename)
|
|
1356
|
+
.find((n) => n.kind === 'file' && n.filePath === resolvedPath);
|
|
1357
|
+
if (fileNode) {
|
|
1358
|
+
return {
|
|
1359
|
+
original: ref,
|
|
1360
|
+
targetNodeId: fileNode.id,
|
|
1361
|
+
confidence: 0.9,
|
|
1362
|
+
resolvedBy: 'import',
|
|
1363
|
+
};
|
|
1364
|
+
}
|
|
1365
|
+
return null;
|
|
1366
|
+
}
|
|
1162
1367
|
// Use cached import mappings (avoids re-reading and re-parsing per ref)
|
|
1163
1368
|
const imports = context.getImportMappings(ref.filePath, ref.language);
|
|
1164
1369
|
if (imports.length === 0 && !context.readFile(ref.filePath)) {
|
|
@@ -1227,7 +1432,8 @@ function resolveViaImport(ref, context) {
|
|
|
1227
1432
|
ref.language === 'typescript' ||
|
|
1228
1433
|
ref.language === 'tsx' ||
|
|
1229
1434
|
ref.language === 'javascript' ||
|
|
1230
|
-
ref.language === 'jsx'
|
|
1435
|
+
ref.language === 'jsx' ||
|
|
1436
|
+
ref.language === 'arkts') {
|
|
1231
1437
|
const moduleFile = resolveModuleImportToFile(ref, imports, context);
|
|
1232
1438
|
if (moduleFile)
|
|
1233
1439
|
return moduleFile;
|
|
@@ -1261,6 +1467,19 @@ function resolveViaImport(ref, context) {
|
|
|
1261
1467
|
resolvedBy: 'import',
|
|
1262
1468
|
};
|
|
1263
1469
|
}
|
|
1470
|
+
// An imported VALUE (singleton constant / shared instance) called
|
|
1471
|
+
// through a member: `reproStore.notifyJoinGuildStatus()` after
|
|
1472
|
+
// `import { reproStore } from './store'`. findExportedSymbol
|
|
1473
|
+
// resolved the CONSTANT itself; linking the CALL there hides the
|
|
1474
|
+
// real callee — callers of the method miss every cross-file use
|
|
1475
|
+
// and the method can look unused (#1292). Infer the value's type
|
|
1476
|
+
// from its own declaration in the exporting file and resolve the
|
|
1477
|
+
// member on that type. resolveMethodOnType VALIDATES the type
|
|
1478
|
+
// declares the method, so a mis-inference falls through to the
|
|
1479
|
+
// constant edge below rather than fabricating a wrong one.
|
|
1480
|
+
const instanceMember = resolveImportedInstanceMember(targetNode, ref, imp.localName, context);
|
|
1481
|
+
if (instanceMember)
|
|
1482
|
+
return instanceMember;
|
|
1264
1483
|
}
|
|
1265
1484
|
return {
|
|
1266
1485
|
original: ref,
|
|
@@ -1369,7 +1588,7 @@ function resolveLuaRequire(ref, context) {
|
|
|
1369
1588
|
return null;
|
|
1370
1589
|
const base = name.includes('.') ? name.replace(/\./g, '/') : name;
|
|
1371
1590
|
const suffixes = [`${base}.lua`, `${base}.luau`, `${base}/init.lua`, `${base}/init.luau`];
|
|
1372
|
-
const
|
|
1591
|
+
const byBasename = luaBasenameIndex(context);
|
|
1373
1592
|
const shared = (a, b) => {
|
|
1374
1593
|
let i = 0;
|
|
1375
1594
|
while (i < a.length && i < b.length && a[i] === b[i])
|
|
@@ -1377,7 +1596,11 @@ function resolveLuaRequire(ref, context) {
|
|
|
1377
1596
|
return i;
|
|
1378
1597
|
};
|
|
1379
1598
|
for (const suffix of suffixes) {
|
|
1380
|
-
|
|
1599
|
+
// Only files sharing the suffix's basename can match — the bucket is in
|
|
1600
|
+
// getAllFiles() order, so this filter yields exactly what the full-list
|
|
1601
|
+
// scan did.
|
|
1602
|
+
const candidates = byBasename.get(suffix.split('/').pop() ?? '') ?? [];
|
|
1603
|
+
const matches = candidates.filter((f) => f === suffix || f.endsWith('/' + suffix));
|
|
1381
1604
|
if (matches.length === 0)
|
|
1382
1605
|
continue;
|
|
1383
1606
|
matches.sort((x, y) => shared(y, ref.filePath) - shared(x, ref.filePath));
|
|
@@ -1742,12 +1965,33 @@ const REEXPORT_MAX_DEPTH = 8;
|
|
|
1742
1965
|
* resolved file, not declarations the file forwarded.
|
|
1743
1966
|
*/
|
|
1744
1967
|
function findExportedSymbol(filePath, want, language, context, visited, depth = 0) {
|
|
1968
|
+
// Memoize fresh (top-level) lookups only: recursive re-export steps carry a
|
|
1969
|
+
// populated `visited` set, whose contents change the reachable answer.
|
|
1970
|
+
// Every ref to the same imported symbol repeats this exact walk, so the
|
|
1971
|
+
// top-level memo removes the re-export chase + per-file linear scans from
|
|
1972
|
+
// all but the first occurrence.
|
|
1973
|
+
if (depth === 0 && visited.size === 0) {
|
|
1974
|
+
let memo = exportedSymbolMemos.get(context);
|
|
1975
|
+
if (!memo) {
|
|
1976
|
+
memo = new Map();
|
|
1977
|
+
exportedSymbolMemos.set(context, memo);
|
|
1978
|
+
}
|
|
1979
|
+
const key = `${filePath}\0${want.isDefault ? 1 : 0}${want.isNamespace ? 1 : 0}\0${want.exportedName}\0${want.memberName ?? ''}\0${language}`;
|
|
1980
|
+
if (memo.has(key))
|
|
1981
|
+
return memo.get(key);
|
|
1982
|
+
const result = findExportedSymbolWalk(filePath, want, language, context, visited, depth);
|
|
1983
|
+
memo.set(key, result);
|
|
1984
|
+
return result;
|
|
1985
|
+
}
|
|
1986
|
+
return findExportedSymbolWalk(filePath, want, language, context, visited, depth);
|
|
1987
|
+
}
|
|
1988
|
+
function findExportedSymbolWalk(filePath, want, language, context, visited, depth) {
|
|
1745
1989
|
if (depth > REEXPORT_MAX_DEPTH)
|
|
1746
1990
|
return undefined;
|
|
1747
1991
|
if (visited.has(filePath))
|
|
1748
1992
|
return undefined;
|
|
1749
1993
|
visited.add(filePath);
|
|
1750
|
-
const
|
|
1994
|
+
const exportIndex = getFileExportIndex(filePath, context);
|
|
1751
1995
|
// 1. Direct hit: the symbol is declared in this file.
|
|
1752
1996
|
if (want.isDefault) {
|
|
1753
1997
|
// Svelte/Vue single-file components ARE the module's default export,
|
|
@@ -1756,18 +2000,17 @@ function findExportedSymbol(filePath, want, language, context, visited, depth =
|
|
|
1756
2000
|
// `.ts`/`.tsx` `export default fn`/`class` case. Without the component
|
|
1757
2001
|
// branch, an `export { default as X } from './X.svelte'` barrel never
|
|
1758
2002
|
// resolves and the component shows a false 0 callers (#629).
|
|
1759
|
-
const direct =
|
|
1760
|
-
nodesInFile.find((n) => n.isExported && (n.kind === 'function' || n.kind === 'class'));
|
|
2003
|
+
const direct = exportIndex.defaultComponent ?? exportIndex.defaultFnClass;
|
|
1761
2004
|
if (direct)
|
|
1762
2005
|
return direct;
|
|
1763
2006
|
}
|
|
1764
2007
|
else if (want.isNamespace && want.memberName) {
|
|
1765
|
-
const direct =
|
|
2008
|
+
const direct = exportIndex.byName.get(want.memberName);
|
|
1766
2009
|
if (direct)
|
|
1767
2010
|
return direct;
|
|
1768
2011
|
}
|
|
1769
2012
|
else {
|
|
1770
|
-
const direct =
|
|
2013
|
+
const direct = exportIndex.byName.get(want.exportedName);
|
|
1771
2014
|
if (direct)
|
|
1772
2015
|
return direct;
|
|
1773
2016
|
}
|
|
@@ -1825,6 +2068,47 @@ const STATIC_MEMBER_CONTAINERS = new Set([
|
|
|
1825
2068
|
* languages whose members aren't `::`-qualified, and genuine class references,
|
|
1826
2069
|
* are unaffected. See #825.
|
|
1827
2070
|
*/
|
|
2071
|
+
/**
|
|
2072
|
+
* Resolve a CALL through an imported value to the method on the value's own
|
|
2073
|
+
* type: `reproStore.notifyJoinGuildStatus()` where `reproStore` is
|
|
2074
|
+
* `export const reproStore = new ReproStore()` in the imported file (#1292).
|
|
2075
|
+
* The same-file form of this call already resolves via local-variable
|
|
2076
|
+
* receiver inference (#1108); this is the cross-file/import half. The type is
|
|
2077
|
+
* recovered from the VALUE'S OWN declaration lines in the exporting file
|
|
2078
|
+
* (initializer `= new T(...)` or a type annotation, per the shared #1108
|
|
2079
|
+
* pattern table), then the member is resolved AND VALIDATED on that type by
|
|
2080
|
+
* resolveMethodOnType — a failed inference or validation returns null so the
|
|
2081
|
+
* caller keeps its existing constant-edge behavior.
|
|
2082
|
+
*/
|
|
2083
|
+
function resolveImportedInstanceMember(value, ref, localName, context) {
|
|
2084
|
+
if (ref.referenceKind !== 'calls')
|
|
2085
|
+
return null;
|
|
2086
|
+
if (value.kind !== 'constant' && value.kind !== 'variable')
|
|
2087
|
+
return null;
|
|
2088
|
+
const member = ref.referenceName.slice(localName.length + 1).split('.')[0];
|
|
2089
|
+
if (!member)
|
|
2090
|
+
return null;
|
|
2091
|
+
const source = context.readFile(value.filePath);
|
|
2092
|
+
if (!source)
|
|
2093
|
+
return null;
|
|
2094
|
+
// Only the value's own declaration lines — never the whole file, so a
|
|
2095
|
+
// same-named identifier elsewhere can't donate a type.
|
|
2096
|
+
const lines = source.split('\n');
|
|
2097
|
+
const declSlice = lines.slice(Math.max(0, value.startLine - 1), value.endLine).join('\n');
|
|
2098
|
+
const receiver = value.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
2099
|
+
for (const pattern of (0, name_matcher_1.localReceiverTypePatterns)(value.language, receiver)) {
|
|
2100
|
+
const m = declSlice.match(pattern);
|
|
2101
|
+
if (!m || !m[1])
|
|
2102
|
+
continue;
|
|
2103
|
+
const typeName = (0, name_matcher_1.normalizeInferredTypeName)(m[1]);
|
|
2104
|
+
if (!typeName)
|
|
2105
|
+
continue;
|
|
2106
|
+
const resolved = (0, name_matcher_1.resolveMethodOnType)(typeName, member, ref, context, 0.85, 'instance-method');
|
|
2107
|
+
if (resolved)
|
|
2108
|
+
return resolved;
|
|
2109
|
+
}
|
|
2110
|
+
return null;
|
|
2111
|
+
}
|
|
1828
2112
|
function resolveStaticMember(container, ref, localName, context) {
|
|
1829
2113
|
if (!STATIC_MEMBER_CONTAINERS.has(container.kind))
|
|
1830
2114
|
return undefined;
|