@optave/codegraph 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +611 -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 +426 -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 +593 -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 +228 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +404 -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 +46 -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 +22 -15
- package/src/cli/commands/ast.js +1 -1
- 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 +2 -2
- 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 +100 -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 +317 -6
- 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 +107 -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 +278 -7
- 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/mcp/tools/semantic-search.js +3 -3
- 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
|
@@ -5,14 +5,17 @@ import {
|
|
|
5
5
|
findCrossFileCallTargets,
|
|
6
6
|
findDbPath,
|
|
7
7
|
findFileNodes,
|
|
8
|
+
findImplementors,
|
|
8
9
|
findImportSources,
|
|
9
10
|
findImportTargets,
|
|
11
|
+
findInterfaces,
|
|
10
12
|
findIntraFileCallEdges,
|
|
11
13
|
findNodeChildren,
|
|
12
14
|
findNodesByFile,
|
|
13
15
|
getComplexityForNode,
|
|
14
16
|
openReadonlyOrFail,
|
|
15
17
|
} from '../../db/index.js';
|
|
18
|
+
import { loadConfig } from '../../infrastructure/config.js';
|
|
16
19
|
import { debug } from '../../infrastructure/logger.js';
|
|
17
20
|
import { isTestFile } from '../../infrastructure/test-filter.js';
|
|
18
21
|
import {
|
|
@@ -28,16 +31,16 @@ import { paginateResult } from '../../shared/paginate.js';
|
|
|
28
31
|
import { findMatchingNodes } from './symbol-lookup.js';
|
|
29
32
|
|
|
30
33
|
function buildCallees(db, node, repoRoot, getFileLines, opts) {
|
|
31
|
-
const { noTests, depth } = opts;
|
|
34
|
+
const { noTests, depth, displayOpts } = opts;
|
|
32
35
|
const calleeRows = findCallees(db, node.id);
|
|
33
36
|
const filteredCallees = noTests ? calleeRows.filter((c) => !isTestFile(c.file)) : calleeRows;
|
|
34
37
|
|
|
35
38
|
const callees = filteredCallees.map((c) => {
|
|
36
39
|
const cLines = getFileLines(c.file);
|
|
37
|
-
const summary = cLines ? extractSummary(cLines, c.line) : null;
|
|
40
|
+
const summary = cLines ? extractSummary(cLines, c.line, displayOpts) : null;
|
|
38
41
|
let calleeSource = null;
|
|
39
42
|
if (depth >= 1) {
|
|
40
|
-
calleeSource = readSourceRange(repoRoot, c.file, c.line, c.end_line);
|
|
43
|
+
calleeSource = readSourceRange(repoRoot, c.file, c.line, c.end_line, displayOpts);
|
|
41
44
|
}
|
|
42
45
|
return {
|
|
43
46
|
name: c.name,
|
|
@@ -70,8 +73,8 @@ function buildCallees(db, node, repoRoot, getFileLines, opts) {
|
|
|
70
73
|
file: c.file,
|
|
71
74
|
line: c.line,
|
|
72
75
|
endLine: c.end_line || null,
|
|
73
|
-
summary: cLines ? extractSummary(cLines, c.line) : null,
|
|
74
|
-
source: readSourceRange(repoRoot, c.file, c.line, c.end_line),
|
|
76
|
+
summary: cLines ? extractSummary(cLines, c.line, displayOpts) : null,
|
|
77
|
+
source: readSourceRange(repoRoot, c.file, c.line, c.end_line, displayOpts),
|
|
75
78
|
});
|
|
76
79
|
}
|
|
77
80
|
}
|
|
@@ -107,6 +110,31 @@ function buildCallers(db, node, noTests) {
|
|
|
107
110
|
}));
|
|
108
111
|
}
|
|
109
112
|
|
|
113
|
+
const INTERFACE_LIKE_KINDS = new Set(['interface', 'trait']);
|
|
114
|
+
const IMPLEMENTOR_KINDS = new Set(['class', 'struct', 'record', 'enum']);
|
|
115
|
+
|
|
116
|
+
function buildImplementationInfo(db, node, noTests) {
|
|
117
|
+
// For interfaces/traits: show who implements them
|
|
118
|
+
if (INTERFACE_LIKE_KINDS.has(node.kind)) {
|
|
119
|
+
let impls = findImplementors(db, node.id);
|
|
120
|
+
if (noTests) impls = impls.filter((n) => !isTestFile(n.file));
|
|
121
|
+
return {
|
|
122
|
+
implementors: impls.map((n) => ({ name: n.name, kind: n.kind, file: n.file, line: n.line })),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// For classes/structs: show what they implement
|
|
126
|
+
if (IMPLEMENTOR_KINDS.has(node.kind)) {
|
|
127
|
+
let ifaces = findInterfaces(db, node.id);
|
|
128
|
+
if (noTests) ifaces = ifaces.filter((n) => !isTestFile(n.file));
|
|
129
|
+
if (ifaces.length > 0) {
|
|
130
|
+
return {
|
|
131
|
+
implements: ifaces.map((n) => ({ name: n.name, kind: n.kind, file: n.file, line: n.line })),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {};
|
|
136
|
+
}
|
|
137
|
+
|
|
110
138
|
function buildRelatedTests(db, node, getFileLines, includeTests) {
|
|
111
139
|
const testCallerRows = findCallers(db, node.id);
|
|
112
140
|
const testCallers = testCallerRows.filter((c) => isTestFile(c.file));
|
|
@@ -170,7 +198,7 @@ function getNodeChildrenSafe(db, nodeId) {
|
|
|
170
198
|
}
|
|
171
199
|
}
|
|
172
200
|
|
|
173
|
-
function explainFileImpl(db, target, getFileLines) {
|
|
201
|
+
function explainFileImpl(db, target, getFileLines, displayOpts) {
|
|
174
202
|
const fileNodes = findFileNodes(db, `%${target}%`);
|
|
175
203
|
if (fileNodes.length === 0) return [];
|
|
176
204
|
|
|
@@ -186,8 +214,8 @@ function explainFileImpl(db, target, getFileLines) {
|
|
|
186
214
|
kind: s.kind,
|
|
187
215
|
line: s.line,
|
|
188
216
|
role: s.role || null,
|
|
189
|
-
summary: fileLines ? extractSummary(fileLines, s.line) : null,
|
|
190
|
-
signature: fileLines ? extractSignature(fileLines, s.line) : null,
|
|
217
|
+
summary: fileLines ? extractSummary(fileLines, s.line, displayOpts) : null,
|
|
218
|
+
signature: fileLines ? extractSignature(fileLines, s.line, displayOpts) : null,
|
|
191
219
|
});
|
|
192
220
|
|
|
193
221
|
const publicApi = symbols.filter((s) => publicIds.has(s.id)).map(mapSymbol);
|
|
@@ -231,7 +259,7 @@ function explainFileImpl(db, target, getFileLines) {
|
|
|
231
259
|
});
|
|
232
260
|
}
|
|
233
261
|
|
|
234
|
-
function explainFunctionImpl(db, target, noTests, getFileLines) {
|
|
262
|
+
function explainFunctionImpl(db, target, noTests, getFileLines, displayOpts) {
|
|
235
263
|
let nodes = db
|
|
236
264
|
.prepare(
|
|
237
265
|
`SELECT * FROM nodes WHERE name LIKE ? AND kind IN ('function','method','class','interface','type','struct','enum','trait','record','module','constant') ORDER BY file, line`,
|
|
@@ -244,8 +272,8 @@ function explainFunctionImpl(db, target, noTests, getFileLines) {
|
|
|
244
272
|
return nodes.slice(0, 10).map((node) => {
|
|
245
273
|
const fileLines = getFileLines(node.file);
|
|
246
274
|
const lineCount = node.end_line ? node.end_line - node.line + 1 : null;
|
|
247
|
-
const summary = fileLines ? extractSummary(fileLines, node.line) : null;
|
|
248
|
-
const signature = fileLines ? extractSignature(fileLines, node.line) : null;
|
|
275
|
+
const summary = fileLines ? extractSummary(fileLines, node.line, displayOpts) : null;
|
|
276
|
+
const signature = fileLines ? extractSignature(fileLines, node.line, displayOpts) : null;
|
|
249
277
|
|
|
250
278
|
const callees = findCallees(db, node.id).map((c) => ({
|
|
251
279
|
name: c.name,
|
|
@@ -281,7 +309,15 @@ function explainFunctionImpl(db, target, noTests, getFileLines) {
|
|
|
281
309
|
});
|
|
282
310
|
}
|
|
283
311
|
|
|
284
|
-
function explainCallees(
|
|
312
|
+
function explainCallees(
|
|
313
|
+
parentResults,
|
|
314
|
+
currentDepth,
|
|
315
|
+
visited,
|
|
316
|
+
db,
|
|
317
|
+
noTests,
|
|
318
|
+
getFileLines,
|
|
319
|
+
displayOpts,
|
|
320
|
+
) {
|
|
285
321
|
if (currentDepth <= 0) return;
|
|
286
322
|
for (const r of parentResults) {
|
|
287
323
|
const newCallees = [];
|
|
@@ -289,7 +325,13 @@ function explainCallees(parentResults, currentDepth, visited, db, noTests, getFi
|
|
|
289
325
|
const key = `${callee.name}:${callee.file}:${callee.line}`;
|
|
290
326
|
if (visited.has(key)) continue;
|
|
291
327
|
visited.add(key);
|
|
292
|
-
const calleeResults = explainFunctionImpl(
|
|
328
|
+
const calleeResults = explainFunctionImpl(
|
|
329
|
+
db,
|
|
330
|
+
callee.name,
|
|
331
|
+
noTests,
|
|
332
|
+
getFileLines,
|
|
333
|
+
displayOpts,
|
|
334
|
+
);
|
|
293
335
|
const exact = calleeResults.find((cr) => cr.file === callee.file && cr.line === callee.line);
|
|
294
336
|
if (exact) {
|
|
295
337
|
exact._depth = (r._depth || 0) + 1;
|
|
@@ -298,7 +340,7 @@ function explainCallees(parentResults, currentDepth, visited, db, noTests, getFi
|
|
|
298
340
|
}
|
|
299
341
|
if (newCallees.length > 0) {
|
|
300
342
|
r.depDetails = newCallees;
|
|
301
|
-
explainCallees(newCallees, currentDepth - 1, visited, db, noTests, getFileLines);
|
|
343
|
+
explainCallees(newCallees, currentDepth - 1, visited, db, noTests, getFileLines, displayOpts);
|
|
302
344
|
}
|
|
303
345
|
}
|
|
304
346
|
}
|
|
@@ -313,6 +355,9 @@ export function contextData(name, customDbPath, opts = {}) {
|
|
|
313
355
|
const noTests = opts.noTests || false;
|
|
314
356
|
const includeTests = opts.includeTests || false;
|
|
315
357
|
|
|
358
|
+
const config = opts.config || loadConfig();
|
|
359
|
+
const displayOpts = config.display || {};
|
|
360
|
+
|
|
316
361
|
const dbPath = findDbPath(customDbPath);
|
|
317
362
|
const repoRoot = path.resolve(path.dirname(dbPath), '..');
|
|
318
363
|
|
|
@@ -328,15 +373,20 @@ export function contextData(name, customDbPath, opts = {}) {
|
|
|
328
373
|
|
|
329
374
|
const source = noSource
|
|
330
375
|
? null
|
|
331
|
-
: readSourceRange(repoRoot, node.file, node.line, node.end_line);
|
|
376
|
+
: readSourceRange(repoRoot, node.file, node.line, node.end_line, displayOpts);
|
|
332
377
|
|
|
333
|
-
const signature = fileLines ? extractSignature(fileLines, node.line) : null;
|
|
378
|
+
const signature = fileLines ? extractSignature(fileLines, node.line, displayOpts) : null;
|
|
334
379
|
|
|
335
|
-
const callees = buildCallees(db, node, repoRoot, getFileLines, {
|
|
380
|
+
const callees = buildCallees(db, node, repoRoot, getFileLines, {
|
|
381
|
+
noTests,
|
|
382
|
+
depth,
|
|
383
|
+
displayOpts,
|
|
384
|
+
});
|
|
336
385
|
const callers = buildCallers(db, node, noTests);
|
|
337
386
|
const relatedTests = buildRelatedTests(db, node, getFileLines, includeTests);
|
|
338
387
|
const complexityMetrics = getComplexityMetrics(db, node.id);
|
|
339
388
|
const nodeChildren = getNodeChildrenSafe(db, node.id);
|
|
389
|
+
const implInfo = buildImplementationInfo(db, node, noTests);
|
|
340
390
|
|
|
341
391
|
return {
|
|
342
392
|
name: node.name,
|
|
@@ -352,6 +402,7 @@ export function contextData(name, customDbPath, opts = {}) {
|
|
|
352
402
|
callees,
|
|
353
403
|
callers,
|
|
354
404
|
relatedTests,
|
|
405
|
+
...implInfo,
|
|
355
406
|
};
|
|
356
407
|
});
|
|
357
408
|
|
|
@@ -369,6 +420,9 @@ export function explainData(target, customDbPath, opts = {}) {
|
|
|
369
420
|
const depth = opts.depth || 0;
|
|
370
421
|
const kind = isFileLikeTarget(target) ? 'file' : 'function';
|
|
371
422
|
|
|
423
|
+
const config = opts.config || loadConfig();
|
|
424
|
+
const displayOpts = config.display || {};
|
|
425
|
+
|
|
372
426
|
const dbPath = findDbPath(customDbPath);
|
|
373
427
|
const repoRoot = path.resolve(path.dirname(dbPath), '..');
|
|
374
428
|
|
|
@@ -376,12 +430,12 @@ export function explainData(target, customDbPath, opts = {}) {
|
|
|
376
430
|
|
|
377
431
|
const results =
|
|
378
432
|
kind === 'file'
|
|
379
|
-
? explainFileImpl(db, target, getFileLines)
|
|
380
|
-
: explainFunctionImpl(db, target, noTests, getFileLines);
|
|
433
|
+
? explainFileImpl(db, target, getFileLines, displayOpts)
|
|
434
|
+
: explainFunctionImpl(db, target, noTests, getFileLines, displayOpts);
|
|
381
435
|
|
|
382
436
|
if (kind === 'function' && depth > 0 && results.length > 0) {
|
|
383
437
|
const visited = new Set(results.map((r) => `${r.name}:${r.file}:${r.line}`));
|
|
384
|
-
explainCallees(results, depth, visited, db, noTests, getFileLines);
|
|
438
|
+
explainCallees(results, depth, visited, db, noTests, getFileLines, displayOpts);
|
|
385
439
|
}
|
|
386
440
|
|
|
387
441
|
const base = { target, kind, results };
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
findNodesByFile,
|
|
7
7
|
openReadonlyOrFail,
|
|
8
8
|
} from '../../db/index.js';
|
|
9
|
+
import { loadConfig } from '../../infrastructure/config.js';
|
|
9
10
|
import { debug } from '../../infrastructure/logger.js';
|
|
10
11
|
import { isTestFile } from '../../infrastructure/test-filter.js';
|
|
11
12
|
import {
|
|
@@ -20,17 +21,30 @@ export function exportsData(file, customDbPath, opts = {}) {
|
|
|
20
21
|
try {
|
|
21
22
|
const noTests = opts.noTests || false;
|
|
22
23
|
|
|
24
|
+
const config = opts.config || loadConfig();
|
|
25
|
+
const displayOpts = config.display || {};
|
|
26
|
+
|
|
23
27
|
const dbFilePath = findDbPath(customDbPath);
|
|
24
28
|
const repoRoot = path.resolve(path.dirname(dbFilePath), '..');
|
|
25
29
|
|
|
26
30
|
const getFileLines = createFileLinesReader(repoRoot);
|
|
27
31
|
|
|
28
32
|
const unused = opts.unused || false;
|
|
29
|
-
const fileResults = exportsFileImpl(db, file, noTests, getFileLines, unused);
|
|
33
|
+
const fileResults = exportsFileImpl(db, file, noTests, getFileLines, unused, displayOpts);
|
|
30
34
|
|
|
31
35
|
if (fileResults.length === 0) {
|
|
32
36
|
return paginateResult(
|
|
33
|
-
{
|
|
37
|
+
{
|
|
38
|
+
file,
|
|
39
|
+
results: [],
|
|
40
|
+
reexports: [],
|
|
41
|
+
reexportedSymbols: [],
|
|
42
|
+
totalExported: 0,
|
|
43
|
+
totalInternal: 0,
|
|
44
|
+
totalUnused: 0,
|
|
45
|
+
totalReexported: 0,
|
|
46
|
+
totalReexportedUnused: 0,
|
|
47
|
+
},
|
|
34
48
|
'results',
|
|
35
49
|
{ limit: opts.limit, offset: opts.offset },
|
|
36
50
|
);
|
|
@@ -42,17 +56,34 @@ export function exportsData(file, customDbPath, opts = {}) {
|
|
|
42
56
|
file: first.file,
|
|
43
57
|
results: first.results,
|
|
44
58
|
reexports: first.reexports,
|
|
59
|
+
reexportedSymbols: first.reexportedSymbols,
|
|
45
60
|
totalExported: first.totalExported,
|
|
46
61
|
totalInternal: first.totalInternal,
|
|
47
62
|
totalUnused: first.totalUnused,
|
|
63
|
+
totalReexported: first.totalReexported,
|
|
64
|
+
totalReexportedUnused: first.totalReexportedUnused,
|
|
48
65
|
};
|
|
49
|
-
|
|
66
|
+
const paginated = paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
67
|
+
// Paginate reexportedSymbols with the same limit/offset (match paginateResult behaviour)
|
|
68
|
+
if (opts.limit != null) {
|
|
69
|
+
const off = opts.offset || 0;
|
|
70
|
+
paginated.reexportedSymbols = paginated.reexportedSymbols.slice(off, off + opts.limit);
|
|
71
|
+
// Update _pagination.hasMore to account for reexportedSymbols (barrel-only files
|
|
72
|
+
// have empty results[], so hasMore would always be false without this)
|
|
73
|
+
if (paginated._pagination) {
|
|
74
|
+
const reexTotal = opts.unused ? base.totalReexportedUnused : base.totalReexported;
|
|
75
|
+
const resultsHasMore = paginated._pagination.hasMore;
|
|
76
|
+
const reexHasMore = off + opts.limit < reexTotal;
|
|
77
|
+
paginated._pagination.hasMore = resultsHasMore || reexHasMore;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return paginated;
|
|
50
81
|
} finally {
|
|
51
82
|
db.close();
|
|
52
83
|
}
|
|
53
84
|
}
|
|
54
85
|
|
|
55
|
-
function exportsFileImpl(db, target, noTests, getFileLines, unused) {
|
|
86
|
+
function exportsFileImpl(db, target, noTests, getFileLines, unused, displayOpts) {
|
|
56
87
|
const fileNodes = findFileNodes(db, `%${target}%`);
|
|
57
88
|
if (fileNodes.length === 0) return [];
|
|
58
89
|
|
|
@@ -83,9 +114,7 @@ function exportsFileImpl(db, target, noTests, getFileLines, unused) {
|
|
|
83
114
|
}
|
|
84
115
|
const internalCount = symbols.length - exported.length;
|
|
85
116
|
|
|
86
|
-
const
|
|
87
|
-
const fileLines = getFileLines(fn.file);
|
|
88
|
-
|
|
117
|
+
const buildSymbolResult = (s, fileLines) => {
|
|
89
118
|
let consumers = db
|
|
90
119
|
.prepare(
|
|
91
120
|
`SELECT n.name, n.file, n.line FROM edges e JOIN nodes n ON e.source_id = n.id
|
|
@@ -100,12 +129,14 @@ function exportsFileImpl(db, target, noTests, getFileLines, unused) {
|
|
|
100
129
|
line: s.line,
|
|
101
130
|
endLine: s.end_line ?? null,
|
|
102
131
|
role: s.role || null,
|
|
103
|
-
signature: fileLines ? extractSignature(fileLines, s.line) : null,
|
|
104
|
-
summary: fileLines ? extractSummary(fileLines, s.line) : null,
|
|
132
|
+
signature: fileLines ? extractSignature(fileLines, s.line, displayOpts) : null,
|
|
133
|
+
summary: fileLines ? extractSummary(fileLines, s.line, displayOpts) : null,
|
|
105
134
|
consumers: consumers.map((c) => ({ name: c.name, file: c.file, line: c.line })),
|
|
106
135
|
consumerCount: consumers.length,
|
|
107
136
|
};
|
|
108
|
-
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const results = exported.map((s) => buildSymbolResult(s, getFileLines(fn.file)));
|
|
109
140
|
|
|
110
141
|
const totalUnused = results.filter((r) => r.consumerCount === 0).length;
|
|
111
142
|
|
|
@@ -118,18 +149,58 @@ function exportsFileImpl(db, target, noTests, getFileLines, unused) {
|
|
|
118
149
|
.all(fn.id)
|
|
119
150
|
.map((r) => ({ file: r.file }));
|
|
120
151
|
|
|
152
|
+
// For barrel files: gather symbols re-exported from target modules
|
|
153
|
+
const reexportTargets = db
|
|
154
|
+
.prepare(
|
|
155
|
+
`SELECT DISTINCT n.file FROM edges e JOIN nodes n ON e.target_id = n.id
|
|
156
|
+
WHERE e.source_id = ? AND e.kind = 'reexports'`,
|
|
157
|
+
)
|
|
158
|
+
.all(fn.id);
|
|
159
|
+
|
|
160
|
+
const reexportedSymbols = [];
|
|
161
|
+
for (const target of reexportTargets) {
|
|
162
|
+
let targetExported;
|
|
163
|
+
if (hasExportedCol) {
|
|
164
|
+
targetExported = db
|
|
165
|
+
.prepare(
|
|
166
|
+
"SELECT * FROM nodes WHERE file = ? AND kind != 'file' AND exported = 1 ORDER BY line",
|
|
167
|
+
)
|
|
168
|
+
.all(target.file);
|
|
169
|
+
} else {
|
|
170
|
+
// Fallback: same heuristic as direct exports — symbols called from other files
|
|
171
|
+
const targetSymbols = findNodesByFile(db, target.file);
|
|
172
|
+
const exportedIds = findCrossFileCallTargets(db, target.file);
|
|
173
|
+
targetExported = targetSymbols.filter((s) => exportedIds.has(s.id));
|
|
174
|
+
}
|
|
175
|
+
for (const s of targetExported) {
|
|
176
|
+
const fileLines = getFileLines(target.file);
|
|
177
|
+
reexportedSymbols.push({
|
|
178
|
+
...buildSymbolResult(s, fileLines),
|
|
179
|
+
originFile: target.file,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
121
184
|
let filteredResults = results;
|
|
185
|
+
let filteredReexported = reexportedSymbols;
|
|
122
186
|
if (unused) {
|
|
123
187
|
filteredResults = results.filter((r) => r.consumerCount === 0);
|
|
188
|
+
filteredReexported = reexportedSymbols.filter((r) => r.consumerCount === 0);
|
|
124
189
|
}
|
|
125
190
|
|
|
191
|
+
const totalReexported = reexportedSymbols.length;
|
|
192
|
+
const totalReexportedUnused = reexportedSymbols.filter((r) => r.consumerCount === 0).length;
|
|
193
|
+
|
|
126
194
|
return {
|
|
127
195
|
file: fn.file,
|
|
128
196
|
results: filteredResults,
|
|
129
197
|
reexports,
|
|
198
|
+
reexportedSymbols: filteredReexported,
|
|
130
199
|
totalExported: exported.length,
|
|
131
200
|
totalInternal: internalCount,
|
|
132
201
|
totalUnused,
|
|
202
|
+
totalReexported,
|
|
203
|
+
totalReexportedUnused,
|
|
133
204
|
};
|
|
134
205
|
});
|
|
135
206
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
findDbPath,
|
|
6
6
|
findDistinctCallers,
|
|
7
7
|
findFileNodes,
|
|
8
|
+
findImplementors,
|
|
8
9
|
findImportDependents,
|
|
9
10
|
findNodeById,
|
|
10
11
|
openReadonlyOrFail,
|
|
@@ -21,20 +22,74 @@ import { findMatchingNodes } from './symbol-lookup.js';
|
|
|
21
22
|
|
|
22
23
|
// ─── Shared BFS: transitive callers ────────────────────────────────────
|
|
23
24
|
|
|
25
|
+
const INTERFACE_LIKE_KINDS = new Set(['interface', 'trait']);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Check whether the graph contains any 'implements' edges.
|
|
29
|
+
* Cached per db handle so the query runs at most once per connection.
|
|
30
|
+
*/
|
|
31
|
+
const _hasImplementsCache = new WeakMap();
|
|
32
|
+
function hasImplementsEdges(db) {
|
|
33
|
+
if (_hasImplementsCache.has(db)) return _hasImplementsCache.get(db);
|
|
34
|
+
const row = db.prepare("SELECT 1 FROM edges WHERE kind = 'implements' LIMIT 1").get();
|
|
35
|
+
const result = !!row;
|
|
36
|
+
_hasImplementsCache.set(db, result);
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
|
|
24
40
|
/**
|
|
25
41
|
* BFS traversal to find transitive callers of a node.
|
|
42
|
+
* When an interface/trait node is encountered (either as the start node or
|
|
43
|
+
* during traversal), its concrete implementors are also added to the frontier
|
|
44
|
+
* so that changes to an interface signature propagate to all implementors.
|
|
26
45
|
*
|
|
27
46
|
* @param {import('better-sqlite3').Database} db - Open read-only SQLite database handle (not a Repository)
|
|
28
47
|
* @param {number} startId - Starting node ID
|
|
29
|
-
* @param {{ noTests?: boolean, maxDepth?: number, onVisit?: (caller: object, parentId: number, depth: number) => void }} options
|
|
48
|
+
* @param {{ noTests?: boolean, maxDepth?: number, includeImplementors?: boolean, onVisit?: (caller: object, parentId: number, depth: number) => void }} options
|
|
30
49
|
* @returns {{ totalDependents: number, levels: Record<number, Array<{name:string, kind:string, file:string, line:number}>> }}
|
|
31
50
|
*/
|
|
32
|
-
export function bfsTransitiveCallers(
|
|
51
|
+
export function bfsTransitiveCallers(
|
|
52
|
+
db,
|
|
53
|
+
startId,
|
|
54
|
+
{ noTests = false, maxDepth = 3, includeImplementors = true, onVisit } = {},
|
|
55
|
+
) {
|
|
56
|
+
// Skip all implementor lookups when the graph has no implements edges
|
|
57
|
+
const resolveImplementors = includeImplementors && hasImplementsEdges(db);
|
|
58
|
+
|
|
33
59
|
const visited = new Set([startId]);
|
|
34
60
|
const levels = {};
|
|
35
61
|
let frontier = [startId];
|
|
36
62
|
|
|
63
|
+
// Seed: if start node is an interface/trait, include its implementors at depth 1.
|
|
64
|
+
// Implementors go into a separate list so their callers appear at depth 2, not depth 1.
|
|
65
|
+
const implNextFrontier = [];
|
|
66
|
+
if (resolveImplementors) {
|
|
67
|
+
const startNode = findNodeById(db, startId);
|
|
68
|
+
if (startNode && INTERFACE_LIKE_KINDS.has(startNode.kind)) {
|
|
69
|
+
const impls = findImplementors(db, startId);
|
|
70
|
+
for (const impl of impls) {
|
|
71
|
+
if (!visited.has(impl.id) && (!noTests || !isTestFile(impl.file))) {
|
|
72
|
+
visited.add(impl.id);
|
|
73
|
+
implNextFrontier.push(impl.id);
|
|
74
|
+
if (!levels[1]) levels[1] = [];
|
|
75
|
+
levels[1].push({
|
|
76
|
+
name: impl.name,
|
|
77
|
+
kind: impl.kind,
|
|
78
|
+
file: impl.file,
|
|
79
|
+
line: impl.line,
|
|
80
|
+
viaImplements: true,
|
|
81
|
+
});
|
|
82
|
+
if (onVisit) onVisit({ ...impl, viaImplements: true }, startId, 1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
37
88
|
for (let d = 1; d <= maxDepth; d++) {
|
|
89
|
+
// On the first wave, merge seeded implementors so their callers appear at d=2
|
|
90
|
+
if (d === 1 && implNextFrontier.length > 0) {
|
|
91
|
+
frontier = [...frontier, ...implNextFrontier];
|
|
92
|
+
}
|
|
38
93
|
const nextFrontier = [];
|
|
39
94
|
for (const fid of frontier) {
|
|
40
95
|
const callers = findDistinctCallers(db, fid);
|
|
@@ -46,6 +101,28 @@ export function bfsTransitiveCallers(db, startId, { noTests = false, maxDepth =
|
|
|
46
101
|
levels[d].push({ name: c.name, kind: c.kind, file: c.file, line: c.line });
|
|
47
102
|
if (onVisit) onVisit(c, fid, d);
|
|
48
103
|
}
|
|
104
|
+
|
|
105
|
+
// If a caller is an interface/trait, also pull in its implementors
|
|
106
|
+
// Implementors are one extra hop away, so record at d+1
|
|
107
|
+
if (resolveImplementors && INTERFACE_LIKE_KINDS.has(c.kind)) {
|
|
108
|
+
const impls = findImplementors(db, c.id);
|
|
109
|
+
for (const impl of impls) {
|
|
110
|
+
if (!visited.has(impl.id) && (!noTests || !isTestFile(impl.file))) {
|
|
111
|
+
visited.add(impl.id);
|
|
112
|
+
nextFrontier.push(impl.id);
|
|
113
|
+
const implDepth = d + 1;
|
|
114
|
+
if (!levels[implDepth]) levels[implDepth] = [];
|
|
115
|
+
levels[implDepth].push({
|
|
116
|
+
name: impl.name,
|
|
117
|
+
kind: impl.kind,
|
|
118
|
+
file: impl.file,
|
|
119
|
+
line: impl.line,
|
|
120
|
+
viaImplements: true,
|
|
121
|
+
});
|
|
122
|
+
if (onVisit) onVisit({ ...impl, viaImplements: true }, c.id, implDepth);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
49
126
|
}
|
|
50
127
|
}
|
|
51
128
|
frontier = nextFrontier;
|
|
@@ -109,7 +186,8 @@ export function impactAnalysisData(file, customDbPath, opts = {}) {
|
|
|
109
186
|
export function fnImpactData(name, customDbPath, opts = {}) {
|
|
110
187
|
const db = openReadonlyOrFail(customDbPath);
|
|
111
188
|
try {
|
|
112
|
-
const
|
|
189
|
+
const config = opts.config || loadConfig();
|
|
190
|
+
const maxDepth = opts.depth || config.analysis?.fnImpactDepth || 5;
|
|
113
191
|
const noTests = opts.noTests || false;
|
|
114
192
|
const hc = new Map();
|
|
115
193
|
|
|
@@ -118,8 +196,14 @@ export function fnImpactData(name, customDbPath, opts = {}) {
|
|
|
118
196
|
return { name, results: [] };
|
|
119
197
|
}
|
|
120
198
|
|
|
199
|
+
const includeImplementors = opts.includeImplementors !== false;
|
|
200
|
+
|
|
121
201
|
const results = nodes.map((node) => {
|
|
122
|
-
const { levels, totalDependents } = bfsTransitiveCallers(db, node.id, {
|
|
202
|
+
const { levels, totalDependents } = bfsTransitiveCallers(db, node.id, {
|
|
203
|
+
noTests,
|
|
204
|
+
maxDepth,
|
|
205
|
+
includeImplementors,
|
|
206
|
+
});
|
|
123
207
|
return {
|
|
124
208
|
...normalizeSymbol(node, db, hc),
|
|
125
209
|
levels,
|
|
@@ -261,7 +345,13 @@ function findAffectedFunctions(db, changedRanges, noTests) {
|
|
|
261
345
|
* @param {number} maxDepth
|
|
262
346
|
* @returns {{ functionResults: Array<object>, allAffected: Set<string> }}
|
|
263
347
|
*/
|
|
264
|
-
function buildFunctionImpactResults(
|
|
348
|
+
function buildFunctionImpactResults(
|
|
349
|
+
db,
|
|
350
|
+
affectedFunctions,
|
|
351
|
+
noTests,
|
|
352
|
+
maxDepth,
|
|
353
|
+
includeImplementors = true,
|
|
354
|
+
) {
|
|
265
355
|
const allAffected = new Set();
|
|
266
356
|
const functionResults = affectedFunctions.map((fn) => {
|
|
267
357
|
const edges = [];
|
|
@@ -271,6 +361,7 @@ function buildFunctionImpactResults(db, affectedFunctions, noTests, maxDepth) {
|
|
|
271
361
|
const { levels, totalDependents } = bfsTransitiveCallers(db, fn.id, {
|
|
272
362
|
noTests,
|
|
273
363
|
maxDepth,
|
|
364
|
+
includeImplementors,
|
|
274
365
|
onVisit(c, parentId) {
|
|
275
366
|
allAffected.add(`${c.file}:${c.name}`);
|
|
276
367
|
const callerKey = `${c.file}::${c.name}:${c.line}`;
|
|
@@ -387,7 +478,8 @@ export function diffImpactData(customDbPath, opts = {}) {
|
|
|
387
478
|
const db = openReadonlyOrFail(customDbPath);
|
|
388
479
|
try {
|
|
389
480
|
const noTests = opts.noTests || false;
|
|
390
|
-
const
|
|
481
|
+
const config = opts.config || loadConfig();
|
|
482
|
+
const maxDepth = opts.depth || config.analysis?.impactDepth || 3;
|
|
391
483
|
|
|
392
484
|
const dbPath = findDbPath(customDbPath);
|
|
393
485
|
const repoRoot = path.resolve(path.dirname(dbPath), '..');
|
|
@@ -422,11 +514,13 @@ export function diffImpactData(customDbPath, opts = {}) {
|
|
|
422
514
|
}
|
|
423
515
|
|
|
424
516
|
const affectedFunctions = findAffectedFunctions(db, changedRanges, noTests);
|
|
517
|
+
const includeImplementors = opts.includeImplementors !== false;
|
|
425
518
|
const { functionResults, allAffected } = buildFunctionImpactResults(
|
|
426
519
|
db,
|
|
427
520
|
affectedFunctions,
|
|
428
521
|
noTests,
|
|
429
522
|
maxDepth,
|
|
523
|
+
includeImplementors,
|
|
430
524
|
);
|
|
431
525
|
|
|
432
526
|
const affectedFiles = new Set();
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { findImplementors, findInterfaces, openReadonlyOrFail } from '../../db/index.js';
|
|
2
|
+
import { isTestFile } from '../../infrastructure/test-filter.js';
|
|
3
|
+
import { CORE_SYMBOL_KINDS } from '../../shared/kinds.js';
|
|
4
|
+
import { normalizeSymbol } from '../../shared/normalize.js';
|
|
5
|
+
import { paginateResult } from '../../shared/paginate.js';
|
|
6
|
+
import { findMatchingNodes } from './symbol-lookup.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Find all concrete types implementing a given interface/trait.
|
|
10
|
+
*
|
|
11
|
+
* @param {string} name - Interface/trait name (partial match)
|
|
12
|
+
* @param {string|undefined} customDbPath
|
|
13
|
+
* @param {{ noTests?: boolean, file?: string, kind?: string, limit?: number, offset?: number }} opts
|
|
14
|
+
* @returns {{ name: string, results: Array<{ name: string, kind: string, file: string, line: number, implementors: Array<{ name: string, kind: string, file: string, line: number }> }> }}
|
|
15
|
+
*/
|
|
16
|
+
export function implementationsData(name, customDbPath, opts = {}) {
|
|
17
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
18
|
+
try {
|
|
19
|
+
const noTests = opts.noTests || false;
|
|
20
|
+
const hc = new Map();
|
|
21
|
+
|
|
22
|
+
const nodes = findMatchingNodes(db, name, {
|
|
23
|
+
noTests,
|
|
24
|
+
file: opts.file,
|
|
25
|
+
kind: opts.kind,
|
|
26
|
+
kinds: opts.kind ? undefined : CORE_SYMBOL_KINDS,
|
|
27
|
+
});
|
|
28
|
+
if (nodes.length === 0) {
|
|
29
|
+
return { name, results: [] };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const results = nodes.map((node) => {
|
|
33
|
+
let implementors = findImplementors(db, node.id);
|
|
34
|
+
if (noTests) implementors = implementors.filter((n) => !isTestFile(n.file));
|
|
35
|
+
|
|
36
|
+
return {
|
|
37
|
+
...normalizeSymbol(node, db, hc),
|
|
38
|
+
implementors: implementors.map((impl) => ({
|
|
39
|
+
name: impl.name,
|
|
40
|
+
kind: impl.kind,
|
|
41
|
+
file: impl.file,
|
|
42
|
+
line: impl.line,
|
|
43
|
+
})),
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const base = { name, results };
|
|
48
|
+
return paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
49
|
+
} finally {
|
|
50
|
+
db.close();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Find all interfaces/traits that a given class/struct implements.
|
|
56
|
+
*
|
|
57
|
+
* @param {string} name - Class/struct name (partial match)
|
|
58
|
+
* @param {string|undefined} customDbPath
|
|
59
|
+
* @param {{ noTests?: boolean, file?: string, kind?: string, limit?: number, offset?: number }} opts
|
|
60
|
+
* @returns {{ name: string, results: Array<{ name: string, kind: string, file: string, line: number, interfaces: Array<{ name: string, kind: string, file: string, line: number }> }> }}
|
|
61
|
+
*/
|
|
62
|
+
export function interfacesData(name, customDbPath, opts = {}) {
|
|
63
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
64
|
+
try {
|
|
65
|
+
const noTests = opts.noTests || false;
|
|
66
|
+
const hc = new Map();
|
|
67
|
+
|
|
68
|
+
const nodes = findMatchingNodes(db, name, {
|
|
69
|
+
noTests,
|
|
70
|
+
file: opts.file,
|
|
71
|
+
kind: opts.kind,
|
|
72
|
+
kinds: opts.kind ? undefined : CORE_SYMBOL_KINDS,
|
|
73
|
+
});
|
|
74
|
+
if (nodes.length === 0) {
|
|
75
|
+
return { name, results: [] };
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const results = nodes.map((node) => {
|
|
79
|
+
let interfaces = findInterfaces(db, node.id);
|
|
80
|
+
if (noTests) interfaces = interfaces.filter((n) => !isTestFile(n.file));
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
...normalizeSymbol(node, db, hc),
|
|
84
|
+
interfaces: interfaces.map((iface) => ({
|
|
85
|
+
name: iface.name,
|
|
86
|
+
kind: iface.kind,
|
|
87
|
+
file: iface.file,
|
|
88
|
+
line: iface.line,
|
|
89
|
+
})),
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const base = { name, results };
|
|
94
|
+
return paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
95
|
+
} finally {
|
|
96
|
+
db.close();
|
|
97
|
+
}
|
|
98
|
+
}
|