@optave/codegraph 3.2.0 → 3.3.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 +47 -54
- package/dist/ast-analysis/engine.d.ts +17 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +328 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +51 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +106 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +24 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +192 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +24 -0
- package/dist/ast-analysis/rules/go.d.ts.map +1 -0
- package/dist/ast-analysis/rules/go.js +173 -0
- package/dist/ast-analysis/rules/go.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts +31 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +72 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +24 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +166 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +31 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +235 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +24 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +210 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +24 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +188 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +24 -0
- package/dist/ast-analysis/rules/ruby.d.ts.map +1 -0
- package/dist/ast-analysis/rules/ruby.js +193 -0
- package/dist/ast-analysis/rules/ruby.js.map +1 -0
- package/dist/ast-analysis/rules/rust.d.ts +24 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +165 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +106 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +186 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +41 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +180 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +119 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +146 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +11 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +147 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +660 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +17 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +216 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +321 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +9 -0
- package/dist/cli/commands/ast.d.ts.map +1 -0
- package/dist/cli/commands/ast.js +23 -0
- package/dist/cli/commands/ast.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +46 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +9 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +70 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +7 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +22 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +7 -0
- package/dist/cli/commands/brief.d.ts.map +1 -0
- package/dist/cli/commands/brief.js +12 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/build.d.ts +7 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +26 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +10 -0
- package/dist/cli/commands/cfg.d.ts.map +1 -0
- package/dist/cli/commands/cfg.js +27 -0
- package/dist/cli/commands/cfg.js.map +1 -0
- package/dist/cli/commands/check.d.ts +8 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +65 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/children.d.ts +9 -0
- package/dist/cli/commands/children.d.ts.map +1 -0
- package/dist/cli/commands/children.js +33 -0
- package/dist/cli/commands/children.js.map +1 -0
- package/dist/cli/commands/co-change.d.ts +7 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +62 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +8 -0
- package/dist/cli/commands/communities.d.ts.map +1 -0
- package/dist/cli/commands/communities.js +20 -0
- package/dist/cli/commands/communities.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +9 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +47 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/context.d.ts +10 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +35 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +7 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +33 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/dataflow.d.ts +10 -0
- package/dist/cli/commands/dataflow.d.ts.map +1 -0
- package/dist/cli/commands/dataflow.js +29 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +8 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +18 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/diff-impact.d.ts +7 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +28 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +8 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +29 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +7 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +72 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/exports.d.ts +8 -0
- package/dist/cli/commands/exports.d.ts.map +1 -0
- package/dist/cli/commands/exports.js +14 -0
- package/dist/cli/commands/exports.js.map +1 -0
- package/dist/cli/commands/flow.d.ts +10 -0
- package/dist/cli/commands/flow.d.ts.map +1 -0
- package/dist/cli/commands/flow.js +32 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/fn-impact.d.ts +10 -0
- package/dist/cli/commands/fn-impact.d.ts.map +1 -0
- package/dist/cli/commands/fn-impact.js +33 -0
- package/dist/cli/commands/fn-impact.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +7 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +12 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/implementations.d.ts +10 -0
- package/dist/cli/commands/implementations.d.ts.map +1 -0
- package/dist/cli/commands/implementations.js +29 -0
- package/dist/cli/commands/implementations.js.map +1 -0
- package/dist/cli/commands/info.d.ts +6 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +66 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +10 -0
- package/dist/cli/commands/interfaces.d.ts.map +1 -0
- package/dist/cli/commands/interfaces.js +29 -0
- package/dist/cli/commands/interfaces.js.map +1 -0
- package/dist/cli/commands/map.d.ts +7 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +19 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +7 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +19 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +6 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +17 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +8 -0
- package/dist/cli/commands/owners.d.ts.map +1 -0
- package/dist/cli/commands/owners.js +27 -0
- package/dist/cli/commands/owners.js.map +1 -0
- package/dist/cli/commands/path.d.ts +8 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +36 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +7 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +94 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +10 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/registry.d.ts +16 -0
- package/dist/cli/commands/registry.d.ts.map +1 -0
- package/dist/cli/commands/registry.js +95 -0
- package/dist/cli/commands/registry.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +9 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +31 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +9 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +47 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +10 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +29 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +11 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +61 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +7 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +15 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/structure.d.ts +7 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +33 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +8 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +89 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +6 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +12 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +9 -0
- package/dist/cli/commands/where.d.ts.map +1 -0
- package/dist/cli/commands/where.js +20 -0
- package/dist/cli/commands/where.js.map +1 -0
- package/dist/cli/index.d.ts +31 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +109 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +14 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +13 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +31 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +58 -0
- package/dist/cli/shared/options.js.map +1 -0
- package/dist/cli/shared/output.d.ts +2 -0
- package/dist/cli/shared/output.d.ts.map +1 -0
- package/dist/cli/shared/output.js +2 -0
- package/dist/cli/shared/output.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +15 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/connection.d.ts +39 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +217 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +6 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +8 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +323 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +106 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +313 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +115 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +165 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +25 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +86 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +13 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +20 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +27 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +57 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +20 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +45 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +15 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +15 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +7 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +17 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +173 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +231 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +20 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +47 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +41 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +41 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +156 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +533 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +14 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +15 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +151 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +244 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +100 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +143 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +16 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +147 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +3 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +378 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +60 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +359 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +2 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +168 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +39 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +596 -0
- package/dist/domain/analysis/impact.js.map +1 -0
- package/dist/domain/analysis/implementations.d.ts +59 -0
- package/dist/domain/analysis/implementations.d.ts.map +1 -0
- package/dist/domain/analysis/implementations.js +93 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +64 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +334 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +2 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +50 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +12 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +202 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +91 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -0
- package/dist/domain/graph/builder/context.js +78 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +43 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +209 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +17 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +191 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +13 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +146 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +387 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +107 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +45 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +358 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +5 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +123 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +183 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +25 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +18 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +139 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +5 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +39 -0
- package/dist/domain/graph/builder/stages/run-analyses.js.map +1 -0
- package/dist/domain/graph/builder.d.ts +4 -0
- package/dist/domain/graph/builder.d.ts.map +1 -0
- package/dist/domain/graph/builder.js +6 -0
- package/dist/domain/graph/builder.js.map +1 -0
- package/dist/domain/graph/change-journal.d.ts +57 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +120 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +18 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +75 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +27 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +100 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +76 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +482 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +2 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +140 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +104 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +557 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +14 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +25 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +17 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +135 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +8 -0
- package/dist/domain/search/index.d.ts.map +1 -0
- package/dist/domain/search/index.js +13 -0
- package/dist/domain/search/index.js.map +1 -0
- package/dist/domain/search/models.d.ts +82 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +198 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +6 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +135 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +19 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +48 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +22 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +113 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +17 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +66 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +13 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +70 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +34 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +129 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +11 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +31 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +27 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +22 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +5 -0
- package/dist/domain/search/strategies/source.d.ts.map +1 -0
- package/dist/domain/search/strategies/source.js +14 -0
- package/dist/domain/search/strategies/source.js.map +1 -0
- package/dist/domain/search/strategies/structured.d.ts +6 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +40 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +11 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +47 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/extractors/csharp.d.ts +12 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +402 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/go.d.ts +12 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +381 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/hcl.d.ts +11 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +105 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +16 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +88 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +10 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +10 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +12 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +325 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +81 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +1232 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/php.d.ts +12 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +380 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +12 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +426 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/ruby.d.ts +11 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +284 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +12 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +366 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/features/ast.d.ts +30 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +242 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +6 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +283 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +110 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +138 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +69 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +344 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +52 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +425 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +51 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +372 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +99 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +296 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +119 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +425 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +40 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +163 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity.d.ts +127 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +683 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +72 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +483 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +29 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +336 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +49 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +203 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +54 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +297 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +46 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +398 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +123 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +289 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +33 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +269 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +11 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +27 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +64 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +132 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure.d.ts +42 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +596 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +13 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +133 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +13 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +47 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +11 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +17 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +6 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +6 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +5 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +22 -0
- package/dist/graph/algorithms/louvain.js.map +1 -0
- package/dist/graph/algorithms/shortest-path.d.ts +10 -0
- package/dist/graph/algorithms/shortest-path.d.ts.map +1 -0
- package/dist/graph/algorithms/shortest-path.js +41 -0
- package/dist/graph/algorithms/shortest-path.js.map +1 -0
- package/dist/graph/algorithms/tarjan.d.ts +9 -0
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -0
- package/dist/graph/algorithms/tarjan.js +48 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +15 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +99 -0
- package/dist/graph/builders/dependency.js.map +1 -0
- package/dist/graph/builders/index.d.ts +4 -0
- package/dist/graph/builders/index.d.ts.map +1 -0
- package/dist/graph/builders/index.js +4 -0
- package/dist/graph/builders/index.js.map +1 -0
- package/dist/graph/builders/structure.d.ts +7 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +32 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +10 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +31 -0
- package/dist/graph/builders/temporal.js.map +1 -0
- package/dist/graph/classifiers/index.d.ts +3 -0
- package/dist/graph/classifiers/index.d.ts.map +1 -0
- package/dist/graph/classifiers/index.js +3 -0
- package/dist/graph/classifiers/index.js.map +1 -0
- package/dist/graph/classifiers/risk.d.ts +49 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +84 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +29 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +109 -0
- package/dist/graph/classifiers/roles.js.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model.d.ts +53 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +210 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/config.d.ts +222 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +386 -0
- package/dist/infrastructure/config.js.map +1 -0
- package/dist/infrastructure/logger.d.ts +7 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/logger.js +21 -0
- package/dist/infrastructure/logger.js.map +1 -0
- package/dist/infrastructure/native.d.ts +19 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +105 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +57 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +157 -0
- package/dist/infrastructure/registry.js.map +1 -0
- package/dist/infrastructure/result-formatter.d.ts +2 -0
- package/dist/infrastructure/result-formatter.d.ts.map +1 -0
- package/dist/infrastructure/result-formatter.js +3 -0
- package/dist/infrastructure/result-formatter.js.map +1 -0
- package/dist/infrastructure/test-filter.d.ts +5 -0
- package/dist/infrastructure/test-filter.d.ts.map +1 -0
- package/dist/infrastructure/test-filter.js +7 -0
- package/dist/infrastructure/test-filter.js.map +1 -0
- package/dist/infrastructure/update-check.d.ts +24 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +150 -0
- package/dist/infrastructure/update-check.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/middleware.d.ts +26 -0
- package/dist/mcp/middleware.d.ts.map +1 -0
- package/dist/mcp/middleware.js +38 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +8 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +819 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +9 -0
- package/dist/mcp/tools/ast-query.d.ts.map +1 -0
- package/dist/mcp/tools/ast-query.js +13 -0
- package/dist/mcp/tools/ast-query.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts +3 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -0
- package/dist/mcp/tools/audit.js +20 -0
- package/dist/mcp/tools/audit.js.map +1 -0
- package/dist/mcp/tools/batch-query.d.ts +9 -0
- package/dist/mcp/tools/batch-query.d.ts.map +1 -0
- package/dist/mcp/tools/batch-query.js +11 -0
- package/dist/mcp/tools/batch-query.js.map +1 -0
- package/dist/mcp/tools/branch-compare.d.ts +3 -0
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -0
- package/dist/mcp/tools/branch-compare.js +10 -0
- package/dist/mcp/tools/branch-compare.js.map +1 -0
- package/dist/mcp/tools/brief.d.ts +3 -0
- package/dist/mcp/tools/brief.d.ts.map +1 -0
- package/dist/mcp/tools/brief.js +8 -0
- package/dist/mcp/tools/brief.js.map +1 -0
- package/dist/mcp/tools/cfg.d.ts +10 -0
- package/dist/mcp/tools/cfg.d.ts.map +1 -0
- package/dist/mcp/tools/cfg.js +20 -0
- package/dist/mcp/tools/cfg.js.map +1 -0
- package/dist/mcp/tools/check.d.ts +24 -0
- package/dist/mcp/tools/check.d.ts.map +1 -0
- package/dist/mcp/tools/check.js +39 -0
- package/dist/mcp/tools/check.js.map +1 -0
- package/dist/mcp/tools/co-changes.d.ts +10 -0
- package/dist/mcp/tools/co-changes.d.ts.map +1 -0
- package/dist/mcp/tools/co-changes.js +19 -0
- package/dist/mcp/tools/co-changes.js.map +1 -0
- package/dist/mcp/tools/code-owners.d.ts +48 -0
- package/dist/mcp/tools/code-owners.d.ts.map +1 -0
- package/dist/mcp/tools/code-owners.js +12 -0
- package/dist/mcp/tools/code-owners.js.map +1 -0
- package/dist/mcp/tools/communities.d.ts +8 -0
- package/dist/mcp/tools/communities.d.ts.map +1 -0
- package/dist/mcp/tools/communities.js +14 -0
- package/dist/mcp/tools/communities.js.map +1 -0
- package/dist/mcp/tools/complexity.d.ts +7 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +17 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.d.ts.map +1 -0
- package/dist/mcp/tools/context.js +16 -0
- package/dist/mcp/tools/context.js.map +1 -0
- package/dist/mcp/tools/dataflow.d.ts +6 -0
- package/dist/mcp/tools/dataflow.d.ts.map +1 -0
- package/dist/mcp/tools/dataflow.js +25 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/diff-impact.d.ts +3 -0
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -0
- package/dist/mcp/tools/diff-impact.js +23 -0
- package/dist/mcp/tools/diff-impact.js.map +1 -0
- package/dist/mcp/tools/execution-flow.d.ts +17 -0
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -0
- package/dist/mcp/tools/execution-flow.js +25 -0
- package/dist/mcp/tools/execution-flow.js.map +1 -0
- package/dist/mcp/tools/export-graph.d.ts +3 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +55 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +3 -0
- package/dist/mcp/tools/file-deps.d.ts.map +1 -0
- package/dist/mcp/tools/file-deps.js +11 -0
- package/dist/mcp/tools/file-deps.js.map +1 -0
- package/dist/mcp/tools/file-exports.d.ts +3 -0
- package/dist/mcp/tools/file-exports.d.ts.map +1 -0
- package/dist/mcp/tools/file-exports.js +12 -0
- package/dist/mcp/tools/file-exports.js.map +1 -0
- package/dist/mcp/tools/find-cycles.d.ts +6 -0
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -0
- package/dist/mcp/tools/find-cycles.js +15 -0
- package/dist/mcp/tools/find-cycles.js.map +1 -0
- package/dist/mcp/tools/fn-impact.d.ts +3 -0
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -0
- package/dist/mcp/tools/fn-impact.js +14 -0
- package/dist/mcp/tools/fn-impact.js.map +1 -0
- package/dist/mcp/tools/impact-analysis.d.ts +3 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +11 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +3 -0
- package/dist/mcp/tools/implementations.d.ts.map +1 -0
- package/dist/mcp/tools/implementations.js +13 -0
- package/dist/mcp/tools/implementations.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +76 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/interfaces.d.ts +3 -0
- package/dist/mcp/tools/interfaces.d.ts.map +1 -0
- package/dist/mcp/tools/interfaces.js +13 -0
- package/dist/mcp/tools/interfaces.js.map +1 -0
- package/dist/mcp/tools/list-functions.d.ts +3 -0
- package/dist/mcp/tools/list-functions.d.ts.map +1 -0
- package/dist/mcp/tools/list-functions.js +13 -0
- package/dist/mcp/tools/list-functions.js.map +1 -0
- package/dist/mcp/tools/list-repos.d.ts +11 -0
- package/dist/mcp/tools/list-repos.d.ts.map +1 -0
- package/dist/mcp/tools/list-repos.js +11 -0
- package/dist/mcp/tools/list-repos.js.map +1 -0
- package/dist/mcp/tools/module-map.d.ts +3 -0
- package/dist/mcp/tools/module-map.d.ts.map +1 -0
- package/dist/mcp/tools/module-map.js +6 -0
- package/dist/mcp/tools/module-map.js.map +1 -0
- package/dist/mcp/tools/node-roles.d.ts +3 -0
- package/dist/mcp/tools/node-roles.d.ts.map +1 -0
- package/dist/mcp/tools/node-roles.js +13 -0
- package/dist/mcp/tools/node-roles.js.map +1 -0
- package/dist/mcp/tools/path.d.ts +3 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +12 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +3 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +29 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/semantic-search.d.ts +3 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +61 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +18 -0
- package/dist/mcp/tools/sequence.d.ts.map +1 -0
- package/dist/mcp/tools/sequence.js +16 -0
- package/dist/mcp/tools/sequence.js.map +1 -0
- package/dist/mcp/tools/structure.d.ts +3 -0
- package/dist/mcp/tools/structure.d.ts.map +1 -0
- package/dist/mcp/tools/structure.js +14 -0
- package/dist/mcp/tools/structure.js.map +1 -0
- package/dist/mcp/tools/symbol-children.d.ts +3 -0
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -0
- package/dist/mcp/tools/symbol-children.js +13 -0
- package/dist/mcp/tools/symbol-children.js.map +1 -0
- package/dist/mcp/tools/triage.d.ts +3 -0
- package/dist/mcp/tools/triage.d.ts.map +1 -0
- package/dist/mcp/tools/triage.js +34 -0
- package/dist/mcp/tools/triage.js.map +1 -0
- package/dist/mcp/tools/where.d.ts +3 -0
- package/dist/mcp/tools/where.d.ts.map +1 -0
- package/dist/mcp/tools/where.js +12 -0
- package/dist/mcp/tools/where.js.map +1 -0
- package/dist/presentation/audit.d.ts +5 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +77 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +10 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +25 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +2 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +75 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +12 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +49 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +5 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +50 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +5 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +70 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +9 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +39 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +26 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +42 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +5 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +56 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +5 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +56 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +5 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +96 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/export.d.ts +137 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +374 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +5 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +64 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +5 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +56 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +5 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +45 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +2 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +94 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +6 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +196 -0
- package/dist/presentation/queries-cli/impact.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +6 -0
- package/dist/presentation/queries-cli/index.d.ts.map +1 -0
- package/dist/presentation/queries-cli/index.js +6 -0
- package/dist/presentation/queries-cli/index.js.map +1 -0
- package/dist/presentation/queries-cli/inspect.d.ts +8 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +353 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +4 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +163 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +2 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +51 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +2 -0
- package/dist/presentation/queries-cli.d.ts.map +1 -0
- package/dist/presentation/queries-cli.js +12 -0
- package/dist/presentation/queries-cli.js.map +1 -0
- package/dist/presentation/query.d.ts +2 -0
- package/dist/presentation/query.d.ts.map +1 -0
- package/dist/presentation/query.js +6 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +10 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +134 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +12 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +36 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +5 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +29 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +8 -0
- package/dist/presentation/structure.d.ts.map +1 -0
- package/dist/presentation/structure.js +50 -0
- package/dist/presentation/structure.js.map +1 -0
- package/dist/presentation/table.d.ts +28 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +39 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +5 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +37 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +85 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +621 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +11 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +35 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +47 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +69 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/file-utils.d.ts +14 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +165 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +62 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +120 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +2 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +27 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +11 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +56 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +19 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +59 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +80 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +111 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/types.d.ts +1322 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +21 -15
- package/src/cli/commands/diff-impact.js +2 -0
- package/src/cli/commands/fn-impact.js +2 -0
- package/src/cli/commands/implementations.js +29 -0
- package/src/cli/commands/info.js +1 -1
- package/src/cli/commands/interfaces.js +29 -0
- package/src/cli/commands/roles.js +2 -1
- package/src/cli/commands/triage.js +4 -1
- package/src/db/index.js +2 -0
- package/src/db/query-builder.js +9 -4
- package/src/db/repository/edges.js +38 -0
- package/src/db/repository/in-memory-repository.js +11 -2
- package/src/db/repository/index.js +2 -0
- package/src/domain/analysis/brief.js +12 -6
- package/src/domain/analysis/context.js +74 -20
- package/src/domain/analysis/exports.js +81 -10
- package/src/domain/analysis/impact.js +84 -6
- package/src/domain/analysis/implementations.js +98 -0
- package/src/domain/analysis/module-map.js +13 -4
- package/src/domain/analysis/roles.js +8 -2
- package/src/domain/graph/builder/incremental.js +22 -2
- package/src/domain/graph/builder/pipeline.js +9 -1
- package/src/domain/graph/builder/stages/build-edges.js +117 -20
- package/src/domain/graph/resolve.js +315 -1
- package/src/domain/parser.js +70 -6
- package/src/domain/queries.js +1 -0
- package/src/domain/search/search/hybrid.js +7 -4
- package/src/domain/search/search/semantic.js +11 -6
- package/src/extractors/csharp.js +62 -0
- package/src/extractors/go.js +141 -0
- package/src/extractors/java.js +29 -3
- package/src/extractors/javascript.js +163 -1
- package/src/extractors/php.js +43 -0
- package/src/extractors/python.js +130 -0
- package/src/extractors/rust.js +60 -0
- package/src/features/audit.js +2 -1
- package/src/features/communities.js +3 -1
- package/src/features/graph-enrichment.js +1 -1
- package/src/features/sequence.js +3 -1
- package/src/features/structure.js +33 -4
- package/src/features/triage.js +9 -2
- package/src/graph/classifiers/risk.js +9 -2
- package/src/graph/classifiers/roles.js +51 -3
- package/src/infrastructure/config.js +255 -4
- package/src/mcp/middleware.js +20 -2
- package/src/mcp/server.js +6 -0
- package/src/mcp/tool-registry.js +40 -1
- package/src/mcp/tools/implementations.js +14 -0
- package/src/mcp/tools/index.js +4 -0
- package/src/mcp/tools/interfaces.js +14 -0
- package/src/presentation/queries-cli/exports.js +54 -4
- package/src/presentation/queries-cli/index.js +9 -1
- package/src/presentation/queries-cli/inspect.js +64 -0
- package/src/presentation/queries-cli.js +3 -1
- package/src/presentation/result-formatter.js +9 -5
- package/src/shared/file-utils.js +20 -11
- package/src/shared/kinds.js +14 -1
- package/src/shared/paginate.js +10 -2
- package/src/types.ts +1609 -0
package/src/extractors/go.js
CHANGED
|
@@ -10,9 +10,11 @@ export function extractGoSymbols(tree, _filePath) {
|
|
|
10
10
|
imports: [],
|
|
11
11
|
classes: [],
|
|
12
12
|
exports: [],
|
|
13
|
+
typeMap: new Map(),
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
walkGoNode(tree.rootNode, ctx);
|
|
17
|
+
extractGoTypeMap(tree.rootNode, ctx);
|
|
16
18
|
return ctx;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -200,6 +202,145 @@ function handleGoCallExpr(node, ctx) {
|
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
204
|
|
|
205
|
+
// ── Type map extraction ─────────────────────────────────────────────────────
|
|
206
|
+
|
|
207
|
+
function extractGoTypeMap(node, ctx) {
|
|
208
|
+
extractGoTypeMapDepth(node, ctx, 0);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
function setIfHigher(typeMap, name, type, confidence) {
|
|
212
|
+
const existing = typeMap.get(name);
|
|
213
|
+
if (!existing || confidence > existing.confidence) {
|
|
214
|
+
typeMap.set(name, { type, confidence });
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function extractGoTypeMapDepth(node, ctx, depth) {
|
|
219
|
+
if (depth >= 200) return;
|
|
220
|
+
|
|
221
|
+
// var x MyType = ... or var x, y MyType → var_declaration > var_spec (confidence 0.9)
|
|
222
|
+
if (node.type === 'var_spec') {
|
|
223
|
+
const typeNode = node.childForFieldName('type');
|
|
224
|
+
if (typeNode) {
|
|
225
|
+
const typeName = extractGoTypeName(typeNode);
|
|
226
|
+
if (typeName) {
|
|
227
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
228
|
+
const child = node.child(i);
|
|
229
|
+
if (child && child.type === 'identifier') {
|
|
230
|
+
setIfHigher(ctx.typeMap, child.text, typeName, 0.9);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// Function/method parameter types: parameter_declaration (confidence 0.9)
|
|
238
|
+
if (node.type === 'parameter_declaration') {
|
|
239
|
+
const typeNode = node.childForFieldName('type');
|
|
240
|
+
if (typeNode) {
|
|
241
|
+
const typeName = extractGoTypeName(typeNode);
|
|
242
|
+
if (typeName) {
|
|
243
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
244
|
+
const child = node.child(i);
|
|
245
|
+
if (child && child.type === 'identifier') {
|
|
246
|
+
setIfHigher(ctx.typeMap, child.text, typeName, 0.9);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// short_var_declaration: x := Struct{}, x := &Struct{}, x := NewFoo()
|
|
254
|
+
// Handles multi-variable forms: x, y := A{}, B{}
|
|
255
|
+
if (node.type === 'short_var_declaration') {
|
|
256
|
+
const left = node.childForFieldName('left');
|
|
257
|
+
const right = node.childForFieldName('right');
|
|
258
|
+
if (left && right) {
|
|
259
|
+
const lefts =
|
|
260
|
+
left.type === 'expression_list'
|
|
261
|
+
? Array.from({ length: left.childCount }, (_, i) => left.child(i)).filter(
|
|
262
|
+
(c) => c?.type === 'identifier',
|
|
263
|
+
)
|
|
264
|
+
: left.type === 'identifier'
|
|
265
|
+
? [left]
|
|
266
|
+
: [];
|
|
267
|
+
const rights =
|
|
268
|
+
right.type === 'expression_list'
|
|
269
|
+
? Array.from({ length: right.childCount }, (_, i) => right.child(i)).filter(
|
|
270
|
+
(c) => c?.isNamed,
|
|
271
|
+
)
|
|
272
|
+
: [right];
|
|
273
|
+
|
|
274
|
+
for (let idx = 0; idx < lefts.length; idx++) {
|
|
275
|
+
const varNode = lefts[idx];
|
|
276
|
+
const rhs = rights[idx];
|
|
277
|
+
if (!varNode || !rhs) continue;
|
|
278
|
+
|
|
279
|
+
// x := Struct{...} — composite literal (confidence 1.0)
|
|
280
|
+
if (rhs.type === 'composite_literal') {
|
|
281
|
+
const typeNode = rhs.childForFieldName('type');
|
|
282
|
+
if (typeNode) {
|
|
283
|
+
const typeName = extractGoTypeName(typeNode);
|
|
284
|
+
if (typeName) setIfHigher(ctx.typeMap, varNode.text, typeName, 1.0);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
// x := &Struct{...} — address-of composite literal (confidence 1.0)
|
|
288
|
+
if (rhs.type === 'unary_expression') {
|
|
289
|
+
const operand = rhs.childForFieldName('operand');
|
|
290
|
+
if (operand && operand.type === 'composite_literal') {
|
|
291
|
+
const typeNode = operand.childForFieldName('type');
|
|
292
|
+
if (typeNode) {
|
|
293
|
+
const typeName = extractGoTypeName(typeNode);
|
|
294
|
+
if (typeName) setIfHigher(ctx.typeMap, varNode.text, typeName, 1.0);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// x := NewFoo() or x := pkg.NewFoo() — factory function (confidence 0.7)
|
|
299
|
+
if (rhs.type === 'call_expression') {
|
|
300
|
+
const fn = rhs.childForFieldName('function');
|
|
301
|
+
if (fn && fn.type === 'selector_expression') {
|
|
302
|
+
const field = fn.childForFieldName('field');
|
|
303
|
+
if (field?.text.startsWith('New')) {
|
|
304
|
+
const typeName = field.text.slice(3);
|
|
305
|
+
if (typeName) setIfHigher(ctx.typeMap, varNode.text, typeName, 0.7);
|
|
306
|
+
}
|
|
307
|
+
} else if (fn && fn.type === 'identifier' && fn.text.startsWith('New')) {
|
|
308
|
+
const typeName = fn.text.slice(3);
|
|
309
|
+
if (typeName) setIfHigher(ctx.typeMap, varNode.text, typeName, 0.7);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
317
|
+
const child = node.child(i);
|
|
318
|
+
if (child) extractGoTypeMapDepth(child, ctx, depth + 1);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function extractGoTypeName(typeNode) {
|
|
323
|
+
if (!typeNode) return null;
|
|
324
|
+
const t = typeNode.type;
|
|
325
|
+
if (t === 'type_identifier' || t === 'identifier') return typeNode.text;
|
|
326
|
+
if (t === 'qualified_type') return typeNode.text;
|
|
327
|
+
// pointer type: *MyType → MyType
|
|
328
|
+
if (t === 'pointer_type') {
|
|
329
|
+
for (let i = 0; i < typeNode.childCount; i++) {
|
|
330
|
+
const child = typeNode.child(i);
|
|
331
|
+
if (child && (child.type === 'type_identifier' || child.type === 'identifier')) {
|
|
332
|
+
return child.text;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
// generic type: MyType[T] → MyType
|
|
337
|
+
if (t === 'generic_type') {
|
|
338
|
+
const first = typeNode.child(0);
|
|
339
|
+
return first ? first.text : null;
|
|
340
|
+
}
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
|
|
203
344
|
// ── Child extraction helpers ────────────────────────────────────────────────
|
|
204
345
|
|
|
205
346
|
function extractGoParameters(paramListNode) {
|
package/src/extractors/java.js
CHANGED
|
@@ -10,6 +10,7 @@ export function extractJavaSymbols(tree, _filePath) {
|
|
|
10
10
|
imports: [],
|
|
11
11
|
classes: [],
|
|
12
12
|
exports: [],
|
|
13
|
+
typeMap: new Map(),
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
walkJavaNode(tree.rootNode, ctx);
|
|
@@ -42,6 +43,9 @@ function walkJavaNode(node, ctx) {
|
|
|
42
43
|
case 'object_creation_expression':
|
|
43
44
|
handleJavaObjectCreation(node, ctx);
|
|
44
45
|
break;
|
|
46
|
+
case 'local_variable_declaration':
|
|
47
|
+
handleJavaLocalVarDecl(node, ctx);
|
|
48
|
+
break;
|
|
45
49
|
}
|
|
46
50
|
|
|
47
51
|
for (let i = 0; i < node.childCount; i++) walkJavaNode(node.child(i), ctx);
|
|
@@ -166,7 +170,7 @@ function handleJavaMethodDecl(node, ctx) {
|
|
|
166
170
|
if (!nameNode) return;
|
|
167
171
|
const parentClass = findJavaParentClass(node);
|
|
168
172
|
const fullName = parentClass ? `${parentClass}.${nameNode.text}` : nameNode.text;
|
|
169
|
-
const params = extractJavaParameters(node.childForFieldName('parameters'));
|
|
173
|
+
const params = extractJavaParameters(node.childForFieldName('parameters'), ctx.typeMap);
|
|
170
174
|
ctx.definitions.push({
|
|
171
175
|
name: fullName,
|
|
172
176
|
kind: 'method',
|
|
@@ -182,7 +186,7 @@ function handleJavaConstructorDecl(node, ctx) {
|
|
|
182
186
|
if (!nameNode) return;
|
|
183
187
|
const parentClass = findJavaParentClass(node);
|
|
184
188
|
const fullName = parentClass ? `${parentClass}.${nameNode.text}` : nameNode.text;
|
|
185
|
-
const params = extractJavaParameters(node.childForFieldName('parameters'));
|
|
189
|
+
const params = extractJavaParameters(node.childForFieldName('parameters'), ctx.typeMap);
|
|
186
190
|
ctx.definitions.push({
|
|
187
191
|
name: fullName,
|
|
188
192
|
kind: 'method',
|
|
@@ -222,6 +226,20 @@ function handleJavaMethodInvocation(node, ctx) {
|
|
|
222
226
|
ctx.calls.push(call);
|
|
223
227
|
}
|
|
224
228
|
|
|
229
|
+
function handleJavaLocalVarDecl(node, ctx) {
|
|
230
|
+
const typeNode = node.childForFieldName('type');
|
|
231
|
+
if (!typeNode) return;
|
|
232
|
+
const typeName = typeNode.type === 'generic_type' ? typeNode.child(0)?.text : typeNode.text;
|
|
233
|
+
if (!typeName) return;
|
|
234
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
235
|
+
const child = node.child(i);
|
|
236
|
+
if (child?.type === 'variable_declarator') {
|
|
237
|
+
const nameNode = child.childForFieldName('name');
|
|
238
|
+
if (nameNode) ctx.typeMap.set(nameNode.text, { type: typeName, confidence: 0.9 });
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
225
243
|
function handleJavaObjectCreation(node, ctx) {
|
|
226
244
|
const typeNode = node.childForFieldName('type');
|
|
227
245
|
if (!typeNode) return;
|
|
@@ -247,7 +265,7 @@ function findJavaParentClass(node) {
|
|
|
247
265
|
|
|
248
266
|
// ── Child extraction helpers ────────────────────────────────────────────────
|
|
249
267
|
|
|
250
|
-
function extractJavaParameters(paramListNode) {
|
|
268
|
+
function extractJavaParameters(paramListNode, typeMap) {
|
|
251
269
|
const params = [];
|
|
252
270
|
if (!paramListNode) return params;
|
|
253
271
|
for (let i = 0; i < paramListNode.childCount; i++) {
|
|
@@ -257,6 +275,14 @@ function extractJavaParameters(paramListNode) {
|
|
|
257
275
|
const nameNode = param.childForFieldName('name');
|
|
258
276
|
if (nameNode) {
|
|
259
277
|
params.push({ name: nameNode.text, kind: 'parameter', line: param.startPosition.row + 1 });
|
|
278
|
+
if (typeMap) {
|
|
279
|
+
const typeNode = param.childForFieldName('type');
|
|
280
|
+
if (typeNode) {
|
|
281
|
+
const typeName =
|
|
282
|
+
typeNode.type === 'generic_type' ? typeNode.child(0)?.text : typeNode.text;
|
|
283
|
+
if (typeName) typeMap.set(nameNode.text, { type: typeName, confidence: 0.9 });
|
|
284
|
+
}
|
|
285
|
+
}
|
|
260
286
|
}
|
|
261
287
|
}
|
|
262
288
|
}
|
|
@@ -1,6 +1,63 @@
|
|
|
1
1
|
import { debug } from '../infrastructure/logger.js';
|
|
2
2
|
import { findChild, nodeEndLine } from './helpers.js';
|
|
3
3
|
|
|
4
|
+
/** Built-in globals that start with uppercase but are not user-defined types. */
|
|
5
|
+
const BUILTIN_GLOBALS = new Set([
|
|
6
|
+
'Math',
|
|
7
|
+
'JSON',
|
|
8
|
+
'Promise',
|
|
9
|
+
'Array',
|
|
10
|
+
'Object',
|
|
11
|
+
'Date',
|
|
12
|
+
'Error',
|
|
13
|
+
'Symbol',
|
|
14
|
+
'Map',
|
|
15
|
+
'Set',
|
|
16
|
+
'RegExp',
|
|
17
|
+
'Number',
|
|
18
|
+
'String',
|
|
19
|
+
'Boolean',
|
|
20
|
+
'WeakMap',
|
|
21
|
+
'WeakSet',
|
|
22
|
+
'WeakRef',
|
|
23
|
+
'Proxy',
|
|
24
|
+
'Reflect',
|
|
25
|
+
'Intl',
|
|
26
|
+
'ArrayBuffer',
|
|
27
|
+
'SharedArrayBuffer',
|
|
28
|
+
'DataView',
|
|
29
|
+
'Atomics',
|
|
30
|
+
'BigInt',
|
|
31
|
+
'Float32Array',
|
|
32
|
+
'Float64Array',
|
|
33
|
+
'Int8Array',
|
|
34
|
+
'Int16Array',
|
|
35
|
+
'Int32Array',
|
|
36
|
+
'Uint8Array',
|
|
37
|
+
'Uint16Array',
|
|
38
|
+
'Uint32Array',
|
|
39
|
+
'Uint8ClampedArray',
|
|
40
|
+
'URL',
|
|
41
|
+
'URLSearchParams',
|
|
42
|
+
'TextEncoder',
|
|
43
|
+
'TextDecoder',
|
|
44
|
+
'AbortController',
|
|
45
|
+
'AbortSignal',
|
|
46
|
+
'Headers',
|
|
47
|
+
'Request',
|
|
48
|
+
'Response',
|
|
49
|
+
'FormData',
|
|
50
|
+
'Blob',
|
|
51
|
+
'File',
|
|
52
|
+
'ReadableStream',
|
|
53
|
+
'WritableStream',
|
|
54
|
+
'TransformStream',
|
|
55
|
+
'console',
|
|
56
|
+
'Buffer',
|
|
57
|
+
'EventEmitter',
|
|
58
|
+
'Stream',
|
|
59
|
+
]);
|
|
60
|
+
|
|
4
61
|
/**
|
|
5
62
|
* Extract symbols from a JS/TS parsed AST.
|
|
6
63
|
* When a compiled tree-sitter Query is provided (from parser.js),
|
|
@@ -19,6 +76,7 @@ function extractSymbolsQuery(tree, query) {
|
|
|
19
76
|
const imports = [];
|
|
20
77
|
const classes = [];
|
|
21
78
|
const exps = [];
|
|
79
|
+
const typeMap = new Map();
|
|
22
80
|
|
|
23
81
|
const matches = query.matches(tree.rootNode);
|
|
24
82
|
|
|
@@ -179,7 +237,10 @@ function extractSymbolsQuery(tree, query) {
|
|
|
179
237
|
// Extract dynamic import() calls via targeted walk (query patterns don't match `import` function type)
|
|
180
238
|
extractDynamicImportsWalk(tree.rootNode, imports);
|
|
181
239
|
|
|
182
|
-
|
|
240
|
+
// Extract typeMap from type annotations and new expressions
|
|
241
|
+
extractTypeMapWalk(tree.rootNode, typeMap);
|
|
242
|
+
|
|
243
|
+
return { definitions, calls, imports, classes, exports: exps, typeMap };
|
|
183
244
|
}
|
|
184
245
|
|
|
185
246
|
/**
|
|
@@ -326,9 +387,12 @@ function extractSymbolsWalk(tree) {
|
|
|
326
387
|
imports: [],
|
|
327
388
|
classes: [],
|
|
328
389
|
exports: [],
|
|
390
|
+
typeMap: new Map(),
|
|
329
391
|
};
|
|
330
392
|
|
|
331
393
|
walkJavaScriptNode(tree.rootNode, ctx);
|
|
394
|
+
// Populate typeMap for variables and parameter type annotations
|
|
395
|
+
extractTypeMapWalk(tree.rootNode, ctx.typeMap);
|
|
332
396
|
return ctx;
|
|
333
397
|
}
|
|
334
398
|
|
|
@@ -472,6 +536,7 @@ function handleVariableDecl(node, ctx) {
|
|
|
472
536
|
if (declarator && declarator.type === 'variable_declarator') {
|
|
473
537
|
const nameN = declarator.childForFieldName('name');
|
|
474
538
|
const valueN = declarator.childForFieldName('value');
|
|
539
|
+
|
|
475
540
|
if (nameN && valueN) {
|
|
476
541
|
const valType = valueN.type;
|
|
477
542
|
if (
|
|
@@ -788,6 +853,103 @@ function extractImplementsFromNode(node) {
|
|
|
788
853
|
return result;
|
|
789
854
|
}
|
|
790
855
|
|
|
856
|
+
// ── Type inference helpers ───────────────────────────────────────────────
|
|
857
|
+
|
|
858
|
+
function extractSimpleTypeName(typeAnnotationNode) {
|
|
859
|
+
if (!typeAnnotationNode) return null;
|
|
860
|
+
for (let i = 0; i < typeAnnotationNode.childCount; i++) {
|
|
861
|
+
const child = typeAnnotationNode.child(i);
|
|
862
|
+
if (!child) continue;
|
|
863
|
+
const t = child.type;
|
|
864
|
+
if (t === 'type_identifier' || t === 'identifier') return child.text;
|
|
865
|
+
if (t === 'generic_type') return child.child(0)?.text || null;
|
|
866
|
+
if (t === 'parenthesized_type') return extractSimpleTypeName(child);
|
|
867
|
+
// Skip union, intersection, and array types — too ambiguous
|
|
868
|
+
}
|
|
869
|
+
return null;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
function extractNewExprTypeName(newExprNode) {
|
|
873
|
+
if (!newExprNode || newExprNode.type !== 'new_expression') return null;
|
|
874
|
+
const ctor = newExprNode.childForFieldName('constructor') || newExprNode.child(1);
|
|
875
|
+
if (!ctor) return null;
|
|
876
|
+
if (ctor.type === 'identifier') return ctor.text;
|
|
877
|
+
if (ctor.type === 'member_expression') {
|
|
878
|
+
const prop = ctor.childForFieldName('property');
|
|
879
|
+
return prop ? prop.text : null;
|
|
880
|
+
}
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* Extract variable-to-type assignments into a per-file type map.
|
|
886
|
+
*
|
|
887
|
+
* Values are `{ type: string, confidence: number }`:
|
|
888
|
+
* - 1.0: explicit constructor (`new Foo()`)
|
|
889
|
+
* - 0.9: type annotation (`: Foo`) or typed parameter
|
|
890
|
+
* - 0.7: factory method call (`Foo.create()` — uppercase-first heuristic)
|
|
891
|
+
*
|
|
892
|
+
* Higher-confidence entries take priority when the same variable is seen twice.
|
|
893
|
+
*/
|
|
894
|
+
function extractTypeMapWalk(rootNode, typeMap) {
|
|
895
|
+
function setIfHigher(name, type, confidence) {
|
|
896
|
+
const existing = typeMap.get(name);
|
|
897
|
+
if (!existing || confidence > existing.confidence) {
|
|
898
|
+
typeMap.set(name, { type, confidence });
|
|
899
|
+
}
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
function walk(node, depth) {
|
|
903
|
+
if (depth >= 200) return;
|
|
904
|
+
const t = node.type;
|
|
905
|
+
if (t === 'variable_declarator') {
|
|
906
|
+
const nameN = node.childForFieldName('name');
|
|
907
|
+
if (nameN && nameN.type === 'identifier') {
|
|
908
|
+
const typeAnno = findChild(node, 'type_annotation');
|
|
909
|
+
if (typeAnno) {
|
|
910
|
+
const typeName = extractSimpleTypeName(typeAnno);
|
|
911
|
+
if (typeName) setIfHigher(nameN.text, typeName, 0.9);
|
|
912
|
+
}
|
|
913
|
+
const valueN = node.childForFieldName('value');
|
|
914
|
+
if (valueN) {
|
|
915
|
+
// Constructor: const x = new Foo() → confidence 1.0
|
|
916
|
+
if (valueN.type === 'new_expression') {
|
|
917
|
+
const ctorType = extractNewExprTypeName(valueN);
|
|
918
|
+
if (ctorType) setIfHigher(nameN.text, ctorType, 1.0);
|
|
919
|
+
}
|
|
920
|
+
// Factory method: const x = Foo.create() → confidence 0.7
|
|
921
|
+
else if (valueN.type === 'call_expression') {
|
|
922
|
+
const fn = valueN.childForFieldName('function');
|
|
923
|
+
if (fn && fn.type === 'member_expression') {
|
|
924
|
+
const obj = fn.childForFieldName('object');
|
|
925
|
+
if (obj && obj.type === 'identifier') {
|
|
926
|
+
const objName = obj.text;
|
|
927
|
+
if (objName[0] !== objName[0].toLowerCase() && !BUILTIN_GLOBALS.has(objName)) {
|
|
928
|
+
setIfHigher(nameN.text, objName, 0.7);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
} else if (t === 'required_parameter' || t === 'optional_parameter') {
|
|
936
|
+
const nameNode =
|
|
937
|
+
node.childForFieldName('pattern') || node.childForFieldName('left') || node.child(0);
|
|
938
|
+
if (nameNode && nameNode.type === 'identifier') {
|
|
939
|
+
const typeAnno = findChild(node, 'type_annotation');
|
|
940
|
+
if (typeAnno) {
|
|
941
|
+
const typeName = extractSimpleTypeName(typeAnno);
|
|
942
|
+
if (typeName) setIfHigher(nameNode.text, typeName, 0.9);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
947
|
+
walk(node.child(i), depth + 1);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
walk(rootNode, 0);
|
|
951
|
+
}
|
|
952
|
+
|
|
791
953
|
function extractReceiverName(objNode) {
|
|
792
954
|
if (!objNode) return undefined;
|
|
793
955
|
const t = objNode.type;
|
package/src/extractors/php.js
CHANGED
|
@@ -82,9 +82,11 @@ export function extractPHPSymbols(tree, _filePath) {
|
|
|
82
82
|
imports: [],
|
|
83
83
|
classes: [],
|
|
84
84
|
exports: [],
|
|
85
|
+
typeMap: new Map(),
|
|
85
86
|
};
|
|
86
87
|
|
|
87
88
|
walkPhpNode(tree.rootNode, ctx);
|
|
89
|
+
extractPhpTypeMap(tree.rootNode, ctx);
|
|
88
90
|
return ctx;
|
|
89
91
|
}
|
|
90
92
|
|
|
@@ -320,6 +322,47 @@ function handlePhpObjectCreation(node, ctx) {
|
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
324
|
|
|
325
|
+
function extractPhpTypeMap(node, ctx) {
|
|
326
|
+
extractPhpTypeMapDepth(node, ctx, 0);
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
function extractPhpTypeMapDepth(node, ctx, depth) {
|
|
330
|
+
if (depth >= 200) return;
|
|
331
|
+
|
|
332
|
+
// Function/method parameters with type hints
|
|
333
|
+
if (
|
|
334
|
+
node.type === 'simple_parameter' ||
|
|
335
|
+
node.type === 'variadic_parameter' ||
|
|
336
|
+
node.type === 'property_promotion_parameter'
|
|
337
|
+
) {
|
|
338
|
+
const typeNode = node.childForFieldName('type');
|
|
339
|
+
const nameNode = node.childForFieldName('name') || findChild(node, 'variable_name');
|
|
340
|
+
if (typeNode && nameNode) {
|
|
341
|
+
const typeName = extractPhpTypeName(typeNode);
|
|
342
|
+
if (typeName) ctx.typeMap.set(nameNode.text, { type: typeName, confidence: 0.9 });
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
347
|
+
const child = node.child(i);
|
|
348
|
+
if (child) extractPhpTypeMapDepth(child, ctx, depth + 1);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function extractPhpTypeName(typeNode) {
|
|
353
|
+
if (!typeNode) return null;
|
|
354
|
+
const t = typeNode.type;
|
|
355
|
+
if (t === 'named_type' || t === 'name' || t === 'qualified_name') return typeNode.text;
|
|
356
|
+
// Nullable: ?MyType
|
|
357
|
+
if (t === 'optional_type') {
|
|
358
|
+
const inner = typeNode.child(1) || typeNode.child(0);
|
|
359
|
+
return inner ? extractPhpTypeName(inner) : null;
|
|
360
|
+
}
|
|
361
|
+
// Skip union types (too ambiguous)
|
|
362
|
+
if (t === 'union_type' || t === 'intersection_type') return null;
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
|
|
323
366
|
function findPHPParentClass(node) {
|
|
324
367
|
let current = node.parent;
|
|
325
368
|
while (current) {
|
package/src/extractors/python.js
CHANGED
|
@@ -1,5 +1,49 @@
|
|
|
1
1
|
import { findChild, nodeEndLine, pythonVisibility } from './helpers.js';
|
|
2
2
|
|
|
3
|
+
/** Built-in globals that start with uppercase but are not user-defined types. */
|
|
4
|
+
const BUILTIN_GLOBALS_PY = new Set([
|
|
5
|
+
// Uppercase builtins that would false-positive on the factory heuristic
|
|
6
|
+
'Exception',
|
|
7
|
+
'BaseException',
|
|
8
|
+
'ValueError',
|
|
9
|
+
'TypeError',
|
|
10
|
+
'KeyError',
|
|
11
|
+
'IndexError',
|
|
12
|
+
'AttributeError',
|
|
13
|
+
'RuntimeError',
|
|
14
|
+
'OSError',
|
|
15
|
+
'IOError',
|
|
16
|
+
'FileNotFoundError',
|
|
17
|
+
'PermissionError',
|
|
18
|
+
'NotImplementedError',
|
|
19
|
+
'StopIteration',
|
|
20
|
+
'GeneratorExit',
|
|
21
|
+
'SystemExit',
|
|
22
|
+
'KeyboardInterrupt',
|
|
23
|
+
'ArithmeticError',
|
|
24
|
+
'LookupError',
|
|
25
|
+
'UnicodeError',
|
|
26
|
+
'UnicodeDecodeError',
|
|
27
|
+
'UnicodeEncodeError',
|
|
28
|
+
'ImportError',
|
|
29
|
+
'ModuleNotFoundError',
|
|
30
|
+
'ConnectionError',
|
|
31
|
+
'TimeoutError',
|
|
32
|
+
'OverflowError',
|
|
33
|
+
'ZeroDivisionError',
|
|
34
|
+
'NameError',
|
|
35
|
+
'SyntaxError',
|
|
36
|
+
'RecursionError',
|
|
37
|
+
'MemoryError',
|
|
38
|
+
// Common standard library uppercase classes
|
|
39
|
+
'Path',
|
|
40
|
+
'PurePath',
|
|
41
|
+
'OrderedDict',
|
|
42
|
+
'Counter',
|
|
43
|
+
'Decimal',
|
|
44
|
+
'Fraction',
|
|
45
|
+
]);
|
|
46
|
+
|
|
3
47
|
/**
|
|
4
48
|
* Extract symbols from Python files.
|
|
5
49
|
*/
|
|
@@ -10,9 +54,11 @@ export function extractPythonSymbols(tree, _filePath) {
|
|
|
10
54
|
imports: [],
|
|
11
55
|
classes: [],
|
|
12
56
|
exports: [],
|
|
57
|
+
typeMap: new Map(),
|
|
13
58
|
};
|
|
14
59
|
|
|
15
60
|
walkPythonNode(tree.rootNode, ctx);
|
|
61
|
+
extractPythonTypeMap(tree.rootNode, ctx);
|
|
16
62
|
return ctx;
|
|
17
63
|
}
|
|
18
64
|
|
|
@@ -284,6 +330,90 @@ function walkInitBody(bodyNode, seen, props) {
|
|
|
284
330
|
}
|
|
285
331
|
}
|
|
286
332
|
|
|
333
|
+
function extractPythonTypeMap(node, ctx) {
|
|
334
|
+
extractPythonTypeMapDepth(node, ctx, 0);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function setIfHigherPy(typeMap, name, type, confidence) {
|
|
338
|
+
const existing = typeMap.get(name);
|
|
339
|
+
if (!existing || confidence > existing.confidence) {
|
|
340
|
+
typeMap.set(name, { type, confidence });
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function extractPythonTypeMapDepth(node, ctx, depth) {
|
|
345
|
+
if (depth >= 200) return;
|
|
346
|
+
|
|
347
|
+
// typed_parameter: identifier : type (confidence 0.9)
|
|
348
|
+
if (node.type === 'typed_parameter') {
|
|
349
|
+
const nameNode = node.child(0);
|
|
350
|
+
const typeNode = node.childForFieldName('type');
|
|
351
|
+
if (nameNode && nameNode.type === 'identifier' && typeNode) {
|
|
352
|
+
const typeName = extractPythonTypeName(typeNode);
|
|
353
|
+
if (typeName && nameNode.text !== 'self' && nameNode.text !== 'cls') {
|
|
354
|
+
setIfHigherPy(ctx.typeMap, nameNode.text, typeName, 0.9);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// typed_default_parameter: name : type = default (confidence 0.9)
|
|
360
|
+
if (node.type === 'typed_default_parameter') {
|
|
361
|
+
const nameNode = node.childForFieldName('name');
|
|
362
|
+
const typeNode = node.childForFieldName('type');
|
|
363
|
+
if (nameNode && nameNode.type === 'identifier' && typeNode) {
|
|
364
|
+
const typeName = extractPythonTypeName(typeNode);
|
|
365
|
+
if (typeName && nameNode.text !== 'self' && nameNode.text !== 'cls') {
|
|
366
|
+
setIfHigherPy(ctx.typeMap, nameNode.text, typeName, 0.9);
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
// assignment: x = SomeClass(...) → constructor (confidence 1.0)
|
|
372
|
+
// x = SomeClass.create(...) → factory (confidence 0.7)
|
|
373
|
+
if (node.type === 'assignment') {
|
|
374
|
+
const left = node.childForFieldName('left');
|
|
375
|
+
const right = node.childForFieldName('right');
|
|
376
|
+
if (left && left.type === 'identifier' && right && right.type === 'call') {
|
|
377
|
+
const fn = right.childForFieldName('function');
|
|
378
|
+
if (fn && fn.type === 'identifier') {
|
|
379
|
+
const name = fn.text;
|
|
380
|
+
if (name[0] !== name[0].toLowerCase()) {
|
|
381
|
+
setIfHigherPy(ctx.typeMap, left.text, name, 1.0);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
if (fn && fn.type === 'attribute') {
|
|
385
|
+
const obj = fn.childForFieldName('object');
|
|
386
|
+
if (obj && obj.type === 'identifier') {
|
|
387
|
+
const objName = obj.text;
|
|
388
|
+
if (objName[0] !== objName[0].toLowerCase() && !BUILTIN_GLOBALS_PY.has(objName)) {
|
|
389
|
+
setIfHigherPy(ctx.typeMap, left.text, objName, 0.7);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
397
|
+
const child = node.child(i);
|
|
398
|
+
if (child) extractPythonTypeMapDepth(child, ctx, depth + 1);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function extractPythonTypeName(typeNode) {
|
|
403
|
+
if (!typeNode) return null;
|
|
404
|
+
const t = typeNode.type;
|
|
405
|
+
if (t === 'identifier') return typeNode.text;
|
|
406
|
+
if (t === 'attribute') return typeNode.text; // module.Type
|
|
407
|
+
// Generic: List[int] → subscript → value is identifier
|
|
408
|
+
if (t === 'subscript') {
|
|
409
|
+
const value = typeNode.childForFieldName('value');
|
|
410
|
+
return value ? value.text : null;
|
|
411
|
+
}
|
|
412
|
+
// None type, string, etc → skip
|
|
413
|
+
if (t === 'none' || t === 'string') return null;
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
|
|
287
417
|
function findPythonParentClass(node) {
|
|
288
418
|
let current = node.parent;
|
|
289
419
|
while (current) {
|