optave-codegraph 3.13.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/LICENSE +190 -0
- package/README.md +984 -0
- package/dist/ast-analysis/engine.d.ts +19 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +660 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +34 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +123 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/b2.d.ts +7 -0
- package/dist/ast-analysis/rules/b2.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b2.js +240 -0
- package/dist/ast-analysis/rules/b2.js.map +1 -0
- package/dist/ast-analysis/rules/b3.d.ts +6 -0
- package/dist/ast-analysis/rules/b3.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b3.js +105 -0
- package/dist/ast-analysis/rules/b3.js.map +1 -0
- package/dist/ast-analysis/rules/b4.d.ts +9 -0
- package/dist/ast-analysis/rules/b4.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b4.js +361 -0
- package/dist/ast-analysis/rules/b4.js.map +1 -0
- package/dist/ast-analysis/rules/b5.d.ts +4 -0
- package/dist/ast-analysis/rules/b5.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b5.js +52 -0
- package/dist/ast-analysis/rules/b5.js.map +1 -0
- package/dist/ast-analysis/rules/c.d.ts +4 -0
- package/dist/ast-analysis/rules/c.d.ts.map +1 -0
- package/dist/ast-analysis/rules/c.js +143 -0
- package/dist/ast-analysis/rules/c.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +7 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +196 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +7 -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 +13 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +325 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +7 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +167 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +7 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +233 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +7 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +212 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +7 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +189 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +7 -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 +7 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +166 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +12 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +166 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +70 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +235 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +27 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +178 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +4 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +288 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.d.ts +5 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.js +166 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-loops.d.ts +7 -0
- package/dist/ast-analysis/visitors/cfg-loops.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-loops.js +73 -0
- package/dist/ast-analysis/visitors/cfg-loops.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-shared.d.ts +56 -0
- package/dist/ast-analysis/visitors/cfg-shared.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-shared.js +107 -0
- package/dist/ast-analysis/visitors/cfg-shared.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.d.ts +4 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.js +100 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +5 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +231 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +233 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +5 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +378 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +3 -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 +3 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +47 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +3 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +66 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +3 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +26 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +3 -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 +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +33 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +3 -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 +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +66 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +3 -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 +3 -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/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +275 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/context.d.ts +3 -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 +3 -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 +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +29 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +3 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +75 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +67 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +18 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +3 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +19 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +3 -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 +3 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +41 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +3 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +96 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +36 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +3 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +43 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +3 -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 +3 -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 +3 -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 +3 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +50 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +3 -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 +3 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +28 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +3 -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 +22 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +139 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +11 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +9 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +25 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +66 -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/types.d.ts +32 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +38 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/better-sqlite3.d.ts +4 -0
- package/dist/db/better-sqlite3.d.ts.map +1 -0
- package/dist/db/better-sqlite3.js +19 -0
- package/dist/db/better-sqlite3.js.map +1 -0
- package/dist/db/connection.d.ts +82 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +444 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +6 -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 +11 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +416 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +88 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +321 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +103 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +172 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +16 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +76 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +9 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +15 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +34 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +46 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +14 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +38 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +7 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +12 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +11 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +30 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +66 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +175 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +14 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +40 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +18 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +33 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +88 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +541 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +16 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +16 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/native-repository.d.ts +70 -0
- package/dist/db/repository/native-repository.d.ts.map +1 -0
- package/dist/db/repository/native-repository.js +418 -0
- package/dist/db/repository/native-repository.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +86 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +203 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +59 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +199 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +25 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +136 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +241 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +361 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +158 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +522 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/diff-impact.d.ts +90 -0
- package/dist/domain/analysis/diff-impact.d.ts.map +1 -0
- package/dist/domain/analysis/diff-impact.js +301 -0
- package/dist/domain/analysis/diff-impact.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +8 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +178 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/fn-impact.d.ts +61 -0
- package/dist/domain/analysis/fn-impact.d.ts.map +1 -0
- package/dist/domain/analysis/fn-impact.js +190 -0
- package/dist/domain/analysis/fn-impact.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +11 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +11 -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 +65 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +86 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +468 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/query-helpers.d.ts +27 -0
- package/dist/domain/analysis/query-helpers.d.ts.map +1 -0
- package/dist/domain/analysis/query-helpers.js +41 -0
- package/dist/domain/analysis/query-helpers.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +20 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +74 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +125 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +206 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/call-resolver.d.ts +89 -0
- package/dist/domain/graph/builder/call-resolver.d.ts.map +1 -0
- package/dist/domain/graph/builder/call-resolver.js +212 -0
- package/dist/domain/graph/builder/call-resolver.js.map +1 -0
- package/dist/domain/graph/builder/cha.d.ts +69 -0
- package/dist/domain/graph/builder/cha.d.ts.map +1 -0
- package/dist/domain/graph/builder/cha.js +158 -0
- package/dist/domain/graph/builder/cha.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 +66 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +97 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +558 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +53 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +647 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/native-db-proxy.d.ts +24 -0
- package/dist/domain/graph/builder/native-db-proxy.d.ts.map +1 -0
- package/dist/domain/graph/builder/native-db-proxy.js +91 -0
- package/dist/domain/graph/builder/native-db-proxy.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +9 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +448 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +3 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +1425 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +3 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +250 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +3 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +161 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +27 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +593 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +3 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +274 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +35 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +351 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts +14 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js +77 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts +62 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js +1763 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +3 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +22 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +7 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +231 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +3 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +23 -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 +50 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +97 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +19 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +142 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +30 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +360 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +67 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +521 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/resolver/points-to.d.ts +53 -0
- package/dist/domain/graph/resolver/points-to.d.ts.map +1 -0
- package/dist/domain/graph/resolver/points-to.js +261 -0
- package/dist/domain/graph/resolver/points-to.js.map +1 -0
- package/dist/domain/graph/resolver/strategy.d.ts +61 -0
- package/dist/domain/graph/resolver/strategy.d.ts.map +1 -0
- package/dist/domain/graph/resolver/strategy.js +222 -0
- package/dist/domain/graph/resolver/strategy.js.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts +9 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.js +476 -0
- package/dist/domain/graph/resolver/ts-resolver.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +23 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +272 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +128 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +1246 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +22 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +26 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +16 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +181 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +15 -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 +63 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +303 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +10 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +134 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +9 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +31 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +21 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +122 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +18 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +58 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +25 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +63 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +41 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +135 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +10 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +27 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +5 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +16 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +6 -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 +10 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +35 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +9 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +45 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/domain/wasm-worker-entry.d.ts +24 -0
- package/dist/domain/wasm-worker-entry.d.ts.map +1 -0
- package/dist/domain/wasm-worker-entry.js +749 -0
- package/dist/domain/wasm-worker-entry.js.map +1 -0
- package/dist/domain/wasm-worker-pool.d.ts +59 -0
- package/dist/domain/wasm-worker-pool.d.ts.map +1 -0
- package/dist/domain/wasm-worker-pool.js +363 -0
- package/dist/domain/wasm-worker-pool.js.map +1 -0
- package/dist/domain/wasm-worker-protocol.d.ts +81 -0
- package/dist/domain/wasm-worker-protocol.d.ts.map +1 -0
- package/dist/domain/wasm-worker-protocol.js +13 -0
- package/dist/domain/wasm-worker-protocol.js.map +1 -0
- package/dist/extractors/bash.d.ts +6 -0
- package/dist/extractors/bash.d.ts.map +1 -0
- package/dist/extractors/bash.js +91 -0
- package/dist/extractors/bash.js.map +1 -0
- package/dist/extractors/c.d.ts +6 -0
- package/dist/extractors/c.d.ts.map +1 -0
- package/dist/extractors/c.js +223 -0
- package/dist/extractors/c.js.map +1 -0
- package/dist/extractors/clojure.d.ts +12 -0
- package/dist/extractors/clojure.d.ts.map +1 -0
- package/dist/extractors/clojure.js +245 -0
- package/dist/extractors/clojure.js.map +1 -0
- package/dist/extractors/cpp.d.ts +6 -0
- package/dist/extractors/cpp.d.ts.map +1 -0
- package/dist/extractors/cpp.js +365 -0
- package/dist/extractors/cpp.js.map +1 -0
- package/dist/extractors/csharp.d.ts +6 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +430 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/cuda.d.ts +11 -0
- package/dist/extractors/cuda.d.ts.map +1 -0
- package/dist/extractors/cuda.js +419 -0
- package/dist/extractors/cuda.js.map +1 -0
- package/dist/extractors/dart.d.ts +6 -0
- package/dist/extractors/dart.d.ts.map +1 -0
- package/dist/extractors/dart.js +277 -0
- package/dist/extractors/dart.js.map +1 -0
- package/dist/extractors/elixir.d.ts +9 -0
- package/dist/extractors/elixir.d.ts.map +1 -0
- package/dist/extractors/elixir.js +327 -0
- package/dist/extractors/elixir.js.map +1 -0
- package/dist/extractors/erlang.d.ts +14 -0
- package/dist/extractors/erlang.d.ts.map +1 -0
- package/dist/extractors/erlang.js +275 -0
- package/dist/extractors/erlang.js.map +1 -0
- package/dist/extractors/fsharp.d.ts +20 -0
- package/dist/extractors/fsharp.d.ts.map +1 -0
- package/dist/extractors/fsharp.js +312 -0
- package/dist/extractors/fsharp.js.map +1 -0
- package/dist/extractors/gleam.d.ts +14 -0
- package/dist/extractors/gleam.d.ts.map +1 -0
- package/dist/extractors/gleam.js +225 -0
- package/dist/extractors/gleam.js.map +1 -0
- package/dist/extractors/go.d.ts +6 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +460 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/groovy.d.ts +10 -0
- package/dist/extractors/groovy.d.ts.map +1 -0
- package/dist/extractors/groovy.js +403 -0
- package/dist/extractors/groovy.js.map +1 -0
- package/dist/extractors/haskell.d.ts +8 -0
- package/dist/extractors/haskell.d.ts.map +1 -0
- package/dist/extractors/haskell.js +261 -0
- package/dist/extractors/haskell.js.map +1 -0
- package/dist/extractors/hcl.d.ts +6 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +114 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +144 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +360 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +33 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +33 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +6 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +390 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +10 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +3618 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/julia.d.ts +16 -0
- package/dist/extractors/julia.d.ts.map +1 -0
- package/dist/extractors/julia.js +411 -0
- package/dist/extractors/julia.js.map +1 -0
- package/dist/extractors/kotlin.d.ts +6 -0
- package/dist/extractors/kotlin.d.ts.map +1 -0
- package/dist/extractors/kotlin.js +340 -0
- package/dist/extractors/kotlin.js.map +1 -0
- package/dist/extractors/lua.d.ts +6 -0
- package/dist/extractors/lua.d.ts.map +1 -0
- package/dist/extractors/lua.js +162 -0
- package/dist/extractors/lua.js.map +1 -0
- package/dist/extractors/objc.d.ts +9 -0
- package/dist/extractors/objc.d.ts.map +1 -0
- package/dist/extractors/objc.js +543 -0
- package/dist/extractors/objc.js.map +1 -0
- package/dist/extractors/ocaml.d.ts +6 -0
- package/dist/extractors/ocaml.d.ts.map +1 -0
- package/dist/extractors/ocaml.js +310 -0
- package/dist/extractors/ocaml.js.map +1 -0
- package/dist/extractors/php.d.ts +6 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +381 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +6 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +428 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/r.d.ts +13 -0
- package/dist/extractors/r.d.ts.map +1 -0
- package/dist/extractors/r.js +267 -0
- package/dist/extractors/r.js.map +1 -0
- package/dist/extractors/ruby.d.ts +6 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +281 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +6 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +354 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/extractors/scala.d.ts +6 -0
- package/dist/extractors/scala.d.ts.map +1 -0
- package/dist/extractors/scala.js +315 -0
- package/dist/extractors/scala.js.map +1 -0
- package/dist/extractors/solidity.d.ts +9 -0
- package/dist/extractors/solidity.d.ts.map +1 -0
- package/dist/extractors/solidity.js +351 -0
- package/dist/extractors/solidity.js.map +1 -0
- package/dist/extractors/swift.d.ts +6 -0
- package/dist/extractors/swift.d.ts.map +1 -0
- package/dist/extractors/swift.js +326 -0
- package/dist/extractors/swift.js.map +1 -0
- package/dist/extractors/verilog.d.ts +9 -0
- package/dist/extractors/verilog.d.ts.map +1 -0
- package/dist/extractors/verilog.js +351 -0
- package/dist/extractors/verilog.js.map +1 -0
- package/dist/extractors/zig.d.ts +9 -0
- package/dist/extractors/zig.d.ts.map +1 -0
- package/dist/extractors/zig.js +274 -0
- package/dist/extractors/zig.js.map +1 -0
- package/dist/features/ast.d.ts +78 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +228 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +15 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +275 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +54 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +97 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +51 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +248 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +71 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +444 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +79 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +483 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +84 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +290 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +68 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +384 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +26 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +149 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity-query.d.ts +37 -0
- package/dist/features/complexity-query.d.ts.map +1 -0
- package/dist/features/complexity-query.js +268 -0
- package/dist/features/complexity-query.js.map +1 -0
- package/dist/features/complexity.d.ts +52 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +490 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +129 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +1079 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +35 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +340 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +21 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +195 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +44 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +312 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +23 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +382 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +60 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +248 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +42 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +271 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +7 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +18 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +25 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +188 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure-query.d.ts +76 -0
- package/dist/features/structure-query.d.ts.map +1 -0
- package/dist/features/structure-query.js +274 -0
- package/dist/features/structure-query.js.map +1 -0
- package/dist/features/structure.d.ts +39 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +796 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +47 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +123 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +14 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +72 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +12 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +42 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +7 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +7 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/leiden/adapter.d.ts +37 -0
- package/dist/graph/algorithms/leiden/adapter.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/adapter.js +173 -0
- package/dist/graph/algorithms/leiden/adapter.js.map +1 -0
- package/dist/graph/algorithms/leiden/cpm.d.ts +28 -0
- package/dist/graph/algorithms/leiden/cpm.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/cpm.js +48 -0
- package/dist/graph/algorithms/leiden/cpm.js.map +1 -0
- package/dist/graph/algorithms/leiden/index.d.ts +37 -0
- package/dist/graph/algorithms/leiden/index.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/index.js +157 -0
- package/dist/graph/algorithms/leiden/index.js.map +1 -0
- package/dist/graph/algorithms/leiden/modularity.d.ts +33 -0
- package/dist/graph/algorithms/leiden/modularity.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/modularity.js +80 -0
- package/dist/graph/algorithms/leiden/modularity.js.map +1 -0
- package/dist/graph/algorithms/leiden/optimiser.d.ts +62 -0
- package/dist/graph/algorithms/leiden/optimiser.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/optimiser.js +530 -0
- package/dist/graph/algorithms/leiden/optimiser.js.map +1 -0
- package/dist/graph/algorithms/leiden/partition.d.ts +44 -0
- package/dist/graph/algorithms/leiden/partition.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/partition.js +438 -0
- package/dist/graph/algorithms/leiden/partition.js.map +1 -0
- package/dist/graph/algorithms/leiden/rng.d.ts +9 -0
- package/dist/graph/algorithms/leiden/rng.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/rng.js +17 -0
- package/dist/graph/algorithms/leiden/rng.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +20 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +52 -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 +55 -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 +52 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +18 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +101 -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 +10 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +33 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +13 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +29 -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 +39 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +78 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +48 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +180 -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 +57 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +205 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.ts +37 -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 +281 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +857 -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 +38 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +182 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +81 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +229 -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/suppress.d.ts +25 -0
- package/dist/infrastructure/suppress.d.ts.map +1 -0
- package/dist/infrastructure/suppress.js +43 -0
- package/dist/infrastructure/suppress.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 +26 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +164 -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 +32 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +193 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +21 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +839 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +14 -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 +15 -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 +13 -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 +12 -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 +9 -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 +14 -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 +20 -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 +12 -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 +12 -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 +13 -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 +16 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +16 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +16 -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 +15 -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 +14 -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 +15 -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 +11 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +57 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +11 -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 +12 -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 +7 -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 +14 -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 +9 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +8 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +13 -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 +7 -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 +13 -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 +12 -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 +8 -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 +9 -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 +12 -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 +15 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +21 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +20 -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 +13 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +62 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +16 -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 +13 -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 +13 -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 +17 -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 +12 -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/mcp/types.d.ts +19 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/presentation/audit.d.ts +15 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +78 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +20 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +21 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +13 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +91 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +9 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +39 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +13 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +62 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +19 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +74 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +32 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +33 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +12 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +47 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +11 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +57 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +17 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +59 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +14 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +100 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/diff-impact-mermaid.d.ts +11 -0
- package/dist/presentation/diff-impact-mermaid.d.ts.map +1 -0
- package/dist/presentation/diff-impact-mermaid.js +114 -0
- package/dist/presentation/diff-impact-mermaid.js.map +1 -0
- package/dist/presentation/export.d.ts +130 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +311 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +16 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +85 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +13 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +51 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +16 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +42 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +12 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +100 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +23 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +208 -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 +23 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +376 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +19 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +196 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +15 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +101 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +12 -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 +2 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +23 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +122 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +19 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +23 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +15 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +26 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +46 -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 +24 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +33 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +19 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +34 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +102 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +618 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +33 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +54 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +46 -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 +27 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +186 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +57 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +106 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/globs.d.ts +40 -0
- package/dist/shared/globs.d.ts.map +1 -0
- package/dist/shared/globs.js +126 -0
- package/dist/shared/globs.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +9 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +68 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +12 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +67 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +49 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +57 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +32 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +82 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/shared/version.d.ts +2 -0
- package/dist/shared/version.d.ts.map +1 -0
- package/dist/shared/version.js +5 -0
- package/dist/shared/version.js.map +1 -0
- package/dist/types.d.ts +2468 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/grammars/tree-sitter-bash.wasm +0 -0
- package/grammars/tree-sitter-c.wasm +0 -0
- package/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/grammars/tree-sitter-clojure.wasm +0 -0
- package/grammars/tree-sitter-cpp.wasm +0 -0
- package/grammars/tree-sitter-cuda.wasm +0 -0
- package/grammars/tree-sitter-dart.wasm +0 -0
- package/grammars/tree-sitter-elixir.wasm +0 -0
- package/grammars/tree-sitter-erlang.wasm +0 -0
- package/grammars/tree-sitter-fsharp.wasm +0 -0
- package/grammars/tree-sitter-fsharp_signature.wasm +0 -0
- package/grammars/tree-sitter-gleam.wasm +0 -0
- package/grammars/tree-sitter-go.wasm +0 -0
- package/grammars/tree-sitter-groovy.wasm +0 -0
- package/grammars/tree-sitter-haskell.wasm +0 -0
- package/grammars/tree-sitter-hcl.wasm +0 -0
- package/grammars/tree-sitter-java.wasm +0 -0
- package/grammars/tree-sitter-javascript.wasm +0 -0
- package/grammars/tree-sitter-julia.wasm +0 -0
- package/grammars/tree-sitter-kotlin.wasm +0 -0
- package/grammars/tree-sitter-lua.wasm +0 -0
- package/grammars/tree-sitter-objc.wasm +0 -0
- package/grammars/tree-sitter-ocaml.wasm +0 -0
- package/grammars/tree-sitter-ocaml_interface.wasm +0 -0
- package/grammars/tree-sitter-php.wasm +0 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-r.wasm +0 -0
- package/grammars/tree-sitter-ruby.wasm +0 -0
- package/grammars/tree-sitter-rust.wasm +0 -0
- package/grammars/tree-sitter-scala.wasm +0 -0
- package/grammars/tree-sitter-solidity.wasm +0 -0
- package/grammars/tree-sitter-swift.wasm +0 -0
- package/grammars/tree-sitter-tsx.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/grammars/tree-sitter-verilog.wasm +0 -0
- package/grammars/tree-sitter-zig.wasm +0 -0
- package/package.json +188 -0
- package/src/ast-analysis/engine.ts +926 -0
- package/src/ast-analysis/metrics.ts +150 -0
- package/src/ast-analysis/rules/b2.ts +263 -0
- package/src/ast-analysis/rules/b3.ts +127 -0
- package/src/ast-analysis/rules/b4.ts +378 -0
- package/src/ast-analysis/rules/b5.ts +65 -0
- package/src/ast-analysis/rules/c.ts +157 -0
- package/src/ast-analysis/rules/csharp.ts +210 -0
- package/src/ast-analysis/rules/go.ts +187 -0
- package/src/ast-analysis/rules/index.ts +380 -0
- package/src/ast-analysis/rules/java.ts +181 -0
- package/src/ast-analysis/rules/javascript.ts +249 -0
- package/src/ast-analysis/rules/php.ts +226 -0
- package/src/ast-analysis/rules/python.ts +202 -0
- package/src/ast-analysis/rules/ruby.ts +209 -0
- package/src/ast-analysis/rules/rust.ts +179 -0
- package/src/ast-analysis/shared.ts +223 -0
- package/src/ast-analysis/visitor-utils.ts +278 -0
- package/src/ast-analysis/visitor.ts +266 -0
- package/src/ast-analysis/visitors/ast-store-visitor.ts +334 -0
- package/src/ast-analysis/visitors/cfg-conditionals.ts +227 -0
- package/src/ast-analysis/visitors/cfg-loops.ts +136 -0
- package/src/ast-analysis/visitors/cfg-shared.ts +196 -0
- package/src/ast-analysis/visitors/cfg-try-catch.ts +142 -0
- package/src/ast-analysis/visitors/cfg-visitor.ts +367 -0
- package/src/ast-analysis/visitors/complexity-visitor.ts +328 -0
- package/src/ast-analysis/visitors/dataflow-visitor.ts +571 -0
- package/src/cli/commands/ast.ts +24 -0
- package/src/cli/commands/audit.ts +48 -0
- package/src/cli/commands/batch.ts +66 -0
- package/src/cli/commands/branch-compare.ts +27 -0
- package/src/cli/commands/brief.ts +13 -0
- package/src/cli/commands/build.ts +35 -0
- package/src/cli/commands/cfg.ts +28 -0
- package/src/cli/commands/check.ts +72 -0
- package/src/cli/commands/children.ts +34 -0
- package/src/cli/commands/co-change.ts +72 -0
- package/src/cli/commands/communities.ts +21 -0
- package/src/cli/commands/complexity.ts +48 -0
- package/src/cli/commands/config.ts +353 -0
- package/src/cli/commands/context.ts +36 -0
- package/src/cli/commands/cycles.ts +33 -0
- package/src/cli/commands/dataflow.ts +30 -0
- package/src/cli/commands/deps.ts +18 -0
- package/src/cli/commands/diff-impact.ts +30 -0
- package/src/cli/commands/embed.ts +82 -0
- package/src/cli/commands/export.ts +79 -0
- package/src/cli/commands/exports.ts +15 -0
- package/src/cli/commands/flow.ts +34 -0
- package/src/cli/commands/fn-impact.ts +34 -0
- package/src/cli/commands/impact.ts +13 -0
- package/src/cli/commands/implementations.ts +30 -0
- package/src/cli/commands/info.ts +79 -0
- package/src/cli/commands/interfaces.ts +30 -0
- package/src/cli/commands/map.ts +20 -0
- package/src/cli/commands/mcp.ts +19 -0
- package/src/cli/commands/models.ts +29 -0
- package/src/cli/commands/owners.ts +28 -0
- package/src/cli/commands/path.ts +42 -0
- package/src/cli/commands/plot.ts +110 -0
- package/src/cli/commands/query.ts +51 -0
- package/src/cli/commands/registry.ts +106 -0
- package/src/cli/commands/roles.ts +38 -0
- package/src/cli/commands/search.ts +45 -0
- package/src/cli/commands/sequence.ts +30 -0
- package/src/cli/commands/snapshot.ts +67 -0
- package/src/cli/commands/stats.ts +16 -0
- package/src/cli/commands/structure.ts +55 -0
- package/src/cli/commands/triage.ts +93 -0
- package/src/cli/commands/watch.ts +29 -0
- package/src/cli/commands/where.ts +21 -0
- package/src/cli/index.ts +159 -0
- package/src/cli/shared/open-graph.ts +13 -0
- package/src/cli/shared/options.ts +69 -0
- package/src/cli/shared/output.ts +1 -0
- package/src/cli/types.ts +35 -0
- package/src/cli.ts +37 -0
- package/src/db/better-sqlite3.ts +21 -0
- package/src/db/connection.ts +478 -0
- package/src/db/index.ts +84 -0
- package/src/db/migrations.ts +440 -0
- package/src/db/query-builder.ts +371 -0
- package/src/db/repository/base.ts +269 -0
- package/src/db/repository/build-stmts.ts +126 -0
- package/src/db/repository/cached-stmt.ts +20 -0
- package/src/db/repository/cfg.ts +81 -0
- package/src/db/repository/cochange.ts +48 -0
- package/src/db/repository/complexity.ts +21 -0
- package/src/db/repository/dataflow.ts +35 -0
- package/src/db/repository/edges.ts +281 -0
- package/src/db/repository/embeddings.ts +47 -0
- package/src/db/repository/graph-read.ts +62 -0
- package/src/db/repository/in-memory-repository.ts +657 -0
- package/src/db/repository/index.ts +53 -0
- package/src/db/repository/native-repository.ts +546 -0
- package/src/db/repository/nodes.ts +322 -0
- package/src/db/repository/sqlite-repository.ts +303 -0
- package/src/domain/analysis/brief.ts +165 -0
- package/src/domain/analysis/context.ts +537 -0
- package/src/domain/analysis/dependencies.ts +738 -0
- package/src/domain/analysis/diff-impact.ts +381 -0
- package/src/domain/analysis/exports.ts +262 -0
- package/src/domain/analysis/fn-impact.ts +311 -0
- package/src/domain/analysis/impact.ts +11 -0
- package/src/domain/analysis/implementations.ts +81 -0
- package/src/domain/analysis/module-map.ts +576 -0
- package/src/domain/analysis/query-helpers.ts +52 -0
- package/src/domain/analysis/roles.ts +95 -0
- package/src/domain/analysis/symbol-lookup.ts +284 -0
- package/src/domain/graph/builder/call-resolver.ts +289 -0
- package/src/domain/graph/builder/cha.ts +192 -0
- package/src/domain/graph/builder/context.ts +120 -0
- package/src/domain/graph/builder/helpers.ts +665 -0
- package/src/domain/graph/builder/incremental.ts +987 -0
- package/src/domain/graph/builder/native-db-proxy.ts +104 -0
- package/src/domain/graph/builder/pipeline.ts +517 -0
- package/src/domain/graph/builder/stages/build-edges.ts +1986 -0
- package/src/domain/graph/builder/stages/build-structure.ts +330 -0
- package/src/domain/graph/builder/stages/collect-files.ts +175 -0
- package/src/domain/graph/builder/stages/detect-changes.ts +751 -0
- package/src/domain/graph/builder/stages/finalize.ts +321 -0
- package/src/domain/graph/builder/stages/insert-nodes.ts +489 -0
- package/src/domain/graph/builder/stages/native-db-lifecycle.ts +74 -0
- package/src/domain/graph/builder/stages/native-orchestrator.ts +2241 -0
- package/src/domain/graph/builder/stages/parse-files.ts +26 -0
- package/src/domain/graph/builder/stages/resolve-imports.ts +285 -0
- package/src/domain/graph/builder/stages/run-analyses.ts +26 -0
- package/src/domain/graph/builder.ts +11 -0
- package/src/domain/graph/change-journal.ts +141 -0
- package/src/domain/graph/cycles.ts +155 -0
- package/src/domain/graph/journal.ts +377 -0
- package/src/domain/graph/resolve.ts +579 -0
- package/src/domain/graph/resolver/points-to.ts +377 -0
- package/src/domain/graph/resolver/strategy.ts +265 -0
- package/src/domain/graph/resolver/ts-resolver.ts +536 -0
- package/src/domain/graph/watcher.ts +339 -0
- package/src/domain/parser.ts +1437 -0
- package/src/domain/queries.ts +50 -0
- package/src/domain/search/generator.ts +260 -0
- package/src/domain/search/index.ts +15 -0
- package/src/domain/search/models.ts +356 -0
- package/src/domain/search/search/cli-formatter.ts +179 -0
- package/src/domain/search/search/filters.ts +38 -0
- package/src/domain/search/search/hybrid.ts +197 -0
- package/src/domain/search/search/keyword.ts +101 -0
- package/src/domain/search/search/prepare.ts +95 -0
- package/src/domain/search/search/semantic.ts +226 -0
- package/src/domain/search/stores/fts5.ts +27 -0
- package/src/domain/search/stores/sqlite-blob.ts +15 -0
- package/src/domain/search/strategies/source.ts +19 -0
- package/src/domain/search/strategies/structured.ts +48 -0
- package/src/domain/search/strategies/text-utils.ts +41 -0
- package/src/domain/wasm-worker-entry.ts +921 -0
- package/src/domain/wasm-worker-pool.ts +375 -0
- package/src/domain/wasm-worker-protocol.ts +98 -0
- package/src/extractors/bash.ts +97 -0
- package/src/extractors/c.ts +231 -0
- package/src/extractors/clojure.ts +273 -0
- package/src/extractors/cpp.ts +383 -0
- package/src/extractors/csharp.ts +448 -0
- package/src/extractors/cuda.ts +433 -0
- package/src/extractors/dart.ts +304 -0
- package/src/extractors/elixir.ts +350 -0
- package/src/extractors/erlang.ts +295 -0
- package/src/extractors/fsharp.ts +357 -0
- package/src/extractors/gleam.ts +247 -0
- package/src/extractors/go.ts +512 -0
- package/src/extractors/groovy.ts +436 -0
- package/src/extractors/haskell.ts +276 -0
- package/src/extractors/hcl.ts +136 -0
- package/src/extractors/helpers.ts +449 -0
- package/src/extractors/index.ts +32 -0
- package/src/extractors/java.ts +439 -0
- package/src/extractors/javascript.ts +3844 -0
- package/src/extractors/julia.ts +432 -0
- package/src/extractors/kotlin.ts +358 -0
- package/src/extractors/lua.ts +169 -0
- package/src/extractors/objc.ts +555 -0
- package/src/extractors/ocaml.ts +337 -0
- package/src/extractors/php.ts +399 -0
- package/src/extractors/python.ts +439 -0
- package/src/extractors/r.ts +275 -0
- package/src/extractors/ruby.ts +292 -0
- package/src/extractors/rust.ts +371 -0
- package/src/extractors/scala.ts +335 -0
- package/src/extractors/solidity.ts +375 -0
- package/src/extractors/swift.ts +337 -0
- package/src/extractors/verilog.ts +383 -0
- package/src/extractors/zig.ts +291 -0
- package/src/features/ast.ts +405 -0
- package/src/features/audit.ts +446 -0
- package/src/features/batch.ts +182 -0
- package/src/features/boundaries.ts +345 -0
- package/src/features/branch-compare.ts +618 -0
- package/src/features/cfg.ts +750 -0
- package/src/features/check.ts +454 -0
- package/src/features/cochange.ts +506 -0
- package/src/features/communities.ts +232 -0
- package/src/features/complexity-query.ts +388 -0
- package/src/features/complexity.ts +753 -0
- package/src/features/dataflow.ts +1654 -0
- package/src/features/export.ts +486 -0
- package/src/features/flow.ts +307 -0
- package/src/features/graph-enrichment.ts +493 -0
- package/src/features/manifesto.ts +508 -0
- package/src/features/owners.ts +360 -0
- package/src/features/sequence.ts +410 -0
- package/src/features/shared/find-nodes.ts +28 -0
- package/src/features/snapshot.ts +221 -0
- package/src/features/structure-query.ts +456 -0
- package/src/features/structure.ts +1100 -0
- package/src/features/triage.ts +199 -0
- package/src/graph/algorithms/bfs.ts +92 -0
- package/src/graph/algorithms/centrality.ts +50 -0
- package/src/graph/algorithms/index.ts +6 -0
- package/src/graph/algorithms/leiden/LICENSE +24 -0
- package/src/graph/algorithms/leiden/adapter.ts +252 -0
- package/src/graph/algorithms/leiden/cpm.ts +77 -0
- package/src/graph/algorithms/leiden/index.ts +224 -0
- package/src/graph/algorithms/leiden/modularity.ts +122 -0
- package/src/graph/algorithms/leiden/optimiser.ts +706 -0
- package/src/graph/algorithms/leiden/partition.ts +577 -0
- package/src/graph/algorithms/leiden/rng.ts +20 -0
- package/src/graph/algorithms/louvain.ts +75 -0
- package/src/graph/algorithms/shortest-path.ts +59 -0
- package/src/graph/algorithms/tarjan.ts +55 -0
- package/src/graph/builders/dependency.ts +148 -0
- package/src/graph/builders/index.ts +3 -0
- package/src/graph/builders/structure.ts +58 -0
- package/src/graph/builders/temporal.ts +51 -0
- package/src/graph/classifiers/index.ts +2 -0
- package/src/graph/classifiers/risk.ts +123 -0
- package/src/graph/classifiers/roles.ts +226 -0
- package/src/graph/index.ts +13 -0
- package/src/graph/model.ts +238 -0
- package/src/index.cjs +16 -0
- package/src/index.ts +72 -0
- package/src/infrastructure/config.ts +954 -0
- package/src/infrastructure/logger.ts +24 -0
- package/src/infrastructure/native.ts +199 -0
- package/src/infrastructure/registry.ts +313 -0
- package/src/infrastructure/result-formatter.ts +2 -0
- package/src/infrastructure/suppress.ts +47 -0
- package/src/infrastructure/test-filter.ts +7 -0
- package/src/infrastructure/update-check.ts +196 -0
- package/src/mcp/index.ts +2 -0
- package/src/mcp/middleware.ts +38 -0
- package/src/mcp/server.ts +259 -0
- package/src/mcp/tool-registry.ts +890 -0
- package/src/mcp/tools/ast-query.ts +25 -0
- package/src/mcp/tools/audit.ts +33 -0
- package/src/mcp/tools/batch-query.ts +22 -0
- package/src/mcp/tools/branch-compare.ts +22 -0
- package/src/mcp/tools/brief.ts +15 -0
- package/src/mcp/tools/cfg.ts +32 -0
- package/src/mcp/tools/check.ts +60 -0
- package/src/mcp/tools/co-changes.ts +29 -0
- package/src/mcp/tools/code-owners.ts +22 -0
- package/src/mcp/tools/communities.ts +25 -0
- package/src/mcp/tools/complexity.ts +30 -0
- package/src/mcp/tools/context.ts +30 -0
- package/src/mcp/tools/dataflow.ts +38 -0
- package/src/mcp/tools/diff-impact.ts +35 -0
- package/src/mcp/tools/execution-flow.ts +38 -0
- package/src/mcp/tools/export-graph.ts +67 -0
- package/src/mcp/tools/file-deps.ts +20 -0
- package/src/mcp/tools/file-exports.ts +22 -0
- package/src/mcp/tools/find-cycles.ts +19 -0
- package/src/mcp/tools/fn-impact.ts +26 -0
- package/src/mcp/tools/impact-analysis.ts +15 -0
- package/src/mcp/tools/implementations.ts +24 -0
- package/src/mcp/tools/index.ts +81 -0
- package/src/mcp/tools/interfaces.ts +24 -0
- package/src/mcp/tools/list-functions.ts +23 -0
- package/src/mcp/tools/list-repos.ts +17 -0
- package/src/mcp/tools/module-map.ts +13 -0
- package/src/mcp/tools/node-roles.ts +23 -0
- package/src/mcp/tools/path.ts +34 -0
- package/src/mcp/tools/query.ts +47 -0
- package/src/mcp/tools/semantic-search.ts +76 -0
- package/src/mcp/tools/sequence.ts +30 -0
- package/src/mcp/tools/structure.ts +25 -0
- package/src/mcp/tools/symbol-children.ts +24 -0
- package/src/mcp/tools/triage.ts +50 -0
- package/src/mcp/tools/where.ts +22 -0
- package/src/mcp/types.ts +21 -0
- package/src/presentation/audit.ts +109 -0
- package/src/presentation/batch.ts +50 -0
- package/src/presentation/branch-compare.ts +148 -0
- package/src/presentation/brief.ts +63 -0
- package/src/presentation/cfg.ts +103 -0
- package/src/presentation/check.ts +138 -0
- package/src/presentation/cochange.ts +57 -0
- package/src/presentation/colors.ts +51 -0
- package/src/presentation/communities.ts +114 -0
- package/src/presentation/complexity.ts +127 -0
- package/src/presentation/dataflow.ts +179 -0
- package/src/presentation/diff-impact-mermaid.ts +169 -0
- package/src/presentation/export.ts +509 -0
- package/src/presentation/flow.ts +147 -0
- package/src/presentation/manifesto.ts +92 -0
- package/src/presentation/owners.ts +89 -0
- package/src/presentation/queries-cli/exports.ts +152 -0
- package/src/presentation/queries-cli/impact.ts +340 -0
- package/src/presentation/queries-cli/index.ts +13 -0
- package/src/presentation/queries-cli/inspect.ts +594 -0
- package/src/presentation/queries-cli/overview.ts +375 -0
- package/src/presentation/queries-cli/path.ts +187 -0
- package/src/presentation/queries-cli.ts +30 -0
- package/src/presentation/query.ts +17 -0
- package/src/presentation/result-formatter.ts +161 -0
- package/src/presentation/sequence-renderer.ts +46 -0
- package/src/presentation/sequence.ts +43 -0
- package/src/presentation/structure.ts +109 -0
- package/src/presentation/table.ts +45 -0
- package/src/presentation/triage.ts +84 -0
- package/src/presentation/viewer.ts +715 -0
- package/src/shared/constants.ts +70 -0
- package/src/shared/errors.ts +85 -0
- package/src/shared/file-utils.ts +233 -0
- package/src/shared/generators.ts +176 -0
- package/src/shared/globs.ts +121 -0
- package/src/shared/hierarchy.ts +81 -0
- package/src/shared/kinds.ts +85 -0
- package/src/shared/normalize.ts +106 -0
- package/src/shared/paginate.ts +93 -0
- package/src/shared/version.ts +10 -0
- package/src/types.ts +2871 -0
|
@@ -0,0 +1,987 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Incremental single-file rebuild — used by watch mode.
|
|
3
|
+
*
|
|
4
|
+
* Reuses pipeline helpers instead of duplicating node insertion and edge building
|
|
5
|
+
* logic from the main builder. This eliminates the watcher.js divergence (ROADMAP 3.9).
|
|
6
|
+
*
|
|
7
|
+
* Reverse-dep cascade: when a file changes, files that have edges targeting it
|
|
8
|
+
* must have their outgoing edges rebuilt (since the changed file's node IDs change).
|
|
9
|
+
*/
|
|
10
|
+
import fs from 'node:fs';
|
|
11
|
+
import path from 'node:path';
|
|
12
|
+
import { bulkNodeIdsByFile, purgeFileData } from '../../../db/index.js';
|
|
13
|
+
import { debug, warn } from '../../../infrastructure/logger.js';
|
|
14
|
+
import { normalizePath } from '../../../shared/constants.js';
|
|
15
|
+
import type {
|
|
16
|
+
BetterSqlite3Database,
|
|
17
|
+
EngineOpts,
|
|
18
|
+
ExtractorOutput,
|
|
19
|
+
PathAliases,
|
|
20
|
+
SqliteStatement,
|
|
21
|
+
} from '../../../types.js';
|
|
22
|
+
import { parseFileIncremental } from '../../parser.js';
|
|
23
|
+
import { computeConfidence, resolveImportPath } from '../resolve.js';
|
|
24
|
+
import {
|
|
25
|
+
type CallNodeLookup,
|
|
26
|
+
findCaller,
|
|
27
|
+
resolveCallTargets,
|
|
28
|
+
resolveReceiverEdge,
|
|
29
|
+
} from './call-resolver.js';
|
|
30
|
+
import { BUILTIN_RECEIVERS, readFileSafe } from './helpers.js';
|
|
31
|
+
|
|
32
|
+
// ── Local types ─────────────────────────────────────────────────────────
|
|
33
|
+
|
|
34
|
+
export interface IncrementalStmts {
|
|
35
|
+
insertNode: { run: (...params: unknown[]) => unknown };
|
|
36
|
+
insertEdge: { run: (...params: unknown[]) => unknown };
|
|
37
|
+
getNodeId: { get: (...params: unknown[]) => { id: number } | undefined };
|
|
38
|
+
countNodes: { get: (...params: unknown[]) => { c: number } | undefined };
|
|
39
|
+
countEdges: { get: (...params: unknown[]) => { c: number } | undefined };
|
|
40
|
+
listSymbols: { all: (...params: unknown[]) => unknown[] };
|
|
41
|
+
findNodeInFile: { all: (...params: unknown[]) => unknown[] };
|
|
42
|
+
findNodeByName: { all: (...params: unknown[]) => unknown[] };
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface RebuildResult {
|
|
46
|
+
file: string;
|
|
47
|
+
nodesAdded: number;
|
|
48
|
+
nodesRemoved: number;
|
|
49
|
+
edgesAdded: number;
|
|
50
|
+
edgesBefore: number;
|
|
51
|
+
deleted?: boolean;
|
|
52
|
+
event?: string;
|
|
53
|
+
symbolDiff?: unknown;
|
|
54
|
+
nodesBefore?: number;
|
|
55
|
+
nodesAfter?: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// ── Node insertion ──────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
function insertFileNodes(stmts: IncrementalStmts, relPath: string, symbols: ExtractorOutput): void {
|
|
61
|
+
stmts.insertNode.run(relPath, 'file', relPath, 0, null);
|
|
62
|
+
for (const def of symbols.definitions) {
|
|
63
|
+
stmts.insertNode.run(def.name, def.kind, relPath, def.line, def.endLine || null);
|
|
64
|
+
if (def.children?.length) {
|
|
65
|
+
for (const child of def.children) {
|
|
66
|
+
stmts.insertNode.run(child.name, child.kind, relPath, child.line, child.endLine || null);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
for (const exp of symbols.exports) {
|
|
71
|
+
stmts.insertNode.run(exp.name, exp.kind, relPath, exp.line, null);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// ── Containment edges ──────────────────────────────────────────────────
|
|
76
|
+
|
|
77
|
+
function buildContainmentEdges(
|
|
78
|
+
db: BetterSqlite3Database,
|
|
79
|
+
stmts: IncrementalStmts,
|
|
80
|
+
relPath: string,
|
|
81
|
+
symbols: ExtractorOutput,
|
|
82
|
+
): number {
|
|
83
|
+
const nodeIdMap = new Map<string, number>();
|
|
84
|
+
for (const row of bulkNodeIdsByFile(db, relPath)) {
|
|
85
|
+
nodeIdMap.set(`${row.name}|${row.kind}|${row.line}`, row.id);
|
|
86
|
+
}
|
|
87
|
+
const fileId = nodeIdMap.get(`${relPath}|file|0`);
|
|
88
|
+
let edgesAdded = 0;
|
|
89
|
+
for (const def of symbols.definitions) {
|
|
90
|
+
const defId = nodeIdMap.get(`${def.name}|${def.kind}|${def.line}`);
|
|
91
|
+
if (fileId && defId) {
|
|
92
|
+
stmts.insertEdge.run(fileId, defId, 'contains', 1.0, 0);
|
|
93
|
+
edgesAdded++;
|
|
94
|
+
}
|
|
95
|
+
if (def.children?.length && defId) {
|
|
96
|
+
for (const child of def.children) {
|
|
97
|
+
const childId = nodeIdMap.get(`${child.name}|${child.kind}|${child.line}`);
|
|
98
|
+
if (childId) {
|
|
99
|
+
stmts.insertEdge.run(defId, childId, 'contains', 1.0, 0);
|
|
100
|
+
edgesAdded++;
|
|
101
|
+
if (child.kind === 'parameter') {
|
|
102
|
+
stmts.insertEdge.run(childId, defId, 'parameter_of', 1.0, 0);
|
|
103
|
+
edgesAdded++;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return edgesAdded;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ── Reverse-dep cascade ────────────────────────────────────────────────
|
|
113
|
+
|
|
114
|
+
// Lazily-cached prepared statements for reverse-dep operations
|
|
115
|
+
let _revDepDb: BetterSqlite3Database | null = null;
|
|
116
|
+
let _findRevDepsStmt: SqliteStatement | null = null;
|
|
117
|
+
let _deleteDataflowByCallEdgeStmt: SqliteStatement | null | undefined; // undefined = not yet tried
|
|
118
|
+
let _deleteOutEdgesStmt: SqliteStatement | null = null;
|
|
119
|
+
|
|
120
|
+
function getRevDepStmts(db: BetterSqlite3Database): {
|
|
121
|
+
findRevDepsStmt: SqliteStatement;
|
|
122
|
+
deleteDataflowByCallEdgeStmt: SqliteStatement | null;
|
|
123
|
+
deleteOutEdgesStmt: SqliteStatement;
|
|
124
|
+
} {
|
|
125
|
+
if (_revDepDb !== db) {
|
|
126
|
+
_revDepDb = db;
|
|
127
|
+
_findRevDepsStmt = db.prepare(
|
|
128
|
+
`SELECT DISTINCT n_src.file FROM edges e
|
|
129
|
+
JOIN nodes n_src ON e.source_id = n_src.id
|
|
130
|
+
JOIN nodes n_tgt ON e.target_id = n_tgt.id
|
|
131
|
+
WHERE n_tgt.file = ? AND n_src.file != ? AND n_src.kind != 'directory'`,
|
|
132
|
+
);
|
|
133
|
+
// Delete inter-procedural dataflow rows whose call_edge_id references an
|
|
134
|
+
// outgoing edge from this file. Must run before deleteOutEdgesStmt to avoid
|
|
135
|
+
// SQLITE_CONSTRAINT_FOREIGNKEY: dataflow.call_edge_id REFERENCES edges(id).
|
|
136
|
+
try {
|
|
137
|
+
_deleteDataflowByCallEdgeStmt = db.prepare(
|
|
138
|
+
`DELETE FROM dataflow WHERE call_edge_id IN
|
|
139
|
+
(SELECT id FROM edges WHERE source_id IN (SELECT id FROM nodes WHERE file = ?))`,
|
|
140
|
+
);
|
|
141
|
+
} catch {
|
|
142
|
+
_deleteDataflowByCallEdgeStmt = null; // dataflow table or call_edge_id column absent
|
|
143
|
+
}
|
|
144
|
+
_deleteOutEdgesStmt = db.prepare(
|
|
145
|
+
'DELETE FROM edges WHERE source_id IN (SELECT id FROM nodes WHERE file = ?)',
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
return {
|
|
149
|
+
findRevDepsStmt: _findRevDepsStmt!,
|
|
150
|
+
deleteDataflowByCallEdgeStmt: _deleteDataflowByCallEdgeStmt ?? null,
|
|
151
|
+
deleteOutEdgesStmt: _deleteOutEdgesStmt!,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function findReverseDeps(db: BetterSqlite3Database, relPath: string): string[] {
|
|
156
|
+
const { findRevDepsStmt } = getRevDepStmts(db);
|
|
157
|
+
return (findRevDepsStmt.all(relPath, relPath) as Array<{ file: string }>).map((r) => r.file);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function deleteOutgoingEdges(db: BetterSqlite3Database, relPath: string): void {
|
|
161
|
+
const { deleteDataflowByCallEdgeStmt, deleteOutEdgesStmt } = getRevDepStmts(db);
|
|
162
|
+
// Clear any inter-procedural dataflow rows that reference outgoing edges via
|
|
163
|
+
// call_edge_id before deleting those edges (FK: dataflow.call_edge_id → edges.id).
|
|
164
|
+
deleteDataflowByCallEdgeStmt?.run(relPath);
|
|
165
|
+
deleteOutEdgesStmt.run(relPath);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
async function parseReverseDep(
|
|
169
|
+
rootDir: string,
|
|
170
|
+
depRelPath: string,
|
|
171
|
+
engineOpts: EngineOpts,
|
|
172
|
+
cache: unknown,
|
|
173
|
+
): Promise<ExtractorOutput | null> {
|
|
174
|
+
const absPath = path.join(rootDir, depRelPath);
|
|
175
|
+
if (!fs.existsSync(absPath)) return null;
|
|
176
|
+
|
|
177
|
+
let code: string;
|
|
178
|
+
try {
|
|
179
|
+
code = readFileSafe(absPath);
|
|
180
|
+
} catch (e: unknown) {
|
|
181
|
+
debug(`parseReverseDep: cannot read ${absPath}: ${e instanceof Error ? e.message : String(e)}`);
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return parseFileIncremental(cache, absPath, code, engineOpts);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function rebuildReverseDepEdges(
|
|
189
|
+
db: BetterSqlite3Database,
|
|
190
|
+
rootDir: string,
|
|
191
|
+
depRelPath: string,
|
|
192
|
+
symbols: ExtractorOutput,
|
|
193
|
+
stmts: IncrementalStmts,
|
|
194
|
+
skipBarrel: boolean,
|
|
195
|
+
): number {
|
|
196
|
+
const fileNodeRow = stmts.getNodeId.get(depRelPath, 'file', depRelPath, 0);
|
|
197
|
+
if (!fileNodeRow) return 0;
|
|
198
|
+
|
|
199
|
+
const aliases: PathAliases = { baseUrl: null, paths: {} };
|
|
200
|
+
let edgesAdded = buildContainmentEdges(db, stmts, depRelPath, symbols);
|
|
201
|
+
// Don't rebuild dir->file containment for reverse-deps (it was never deleted)
|
|
202
|
+
edgesAdded += buildImportEdges(
|
|
203
|
+
stmts,
|
|
204
|
+
depRelPath,
|
|
205
|
+
symbols,
|
|
206
|
+
rootDir,
|
|
207
|
+
fileNodeRow.id,
|
|
208
|
+
aliases,
|
|
209
|
+
skipBarrel ? null : db,
|
|
210
|
+
);
|
|
211
|
+
const importedNames = buildImportedNamesMap(symbols, rootDir, depRelPath, aliases, db);
|
|
212
|
+
edgesAdded += buildCallEdges(db, stmts, depRelPath, symbols, fileNodeRow, importedNames);
|
|
213
|
+
edgesAdded += buildClassHierarchyEdges(stmts, depRelPath, symbols);
|
|
214
|
+
return edgesAdded;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// ── Directory containment edges ────────────────────────────────────────
|
|
218
|
+
|
|
219
|
+
function rebuildDirContainment(
|
|
220
|
+
_db: BetterSqlite3Database,
|
|
221
|
+
stmts: IncrementalStmts,
|
|
222
|
+
relPath: string,
|
|
223
|
+
): number {
|
|
224
|
+
const dir = normalizePath(path.dirname(relPath));
|
|
225
|
+
if (!dir || dir === '.') return 0;
|
|
226
|
+
const dirRow = stmts.getNodeId.get(dir, 'directory', dir, 0);
|
|
227
|
+
const fileRow = stmts.getNodeId.get(relPath, 'file', relPath, 0);
|
|
228
|
+
if (dirRow && fileRow) {
|
|
229
|
+
stmts.insertEdge.run(dirRow.id, fileRow.id, 'contains', 1.0, 0);
|
|
230
|
+
return 1;
|
|
231
|
+
}
|
|
232
|
+
return 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ── Import edge building ────────────────────────────────────────────────
|
|
236
|
+
|
|
237
|
+
// Lazily-cached prepared statements for barrel resolution (avoid re-preparing in hot loops)
|
|
238
|
+
let _barrelDb: BetterSqlite3Database | null = null;
|
|
239
|
+
let _isBarrelStmt: SqliteStatement | null = null;
|
|
240
|
+
let _reexportTargetsStmt: SqliteStatement | null = null;
|
|
241
|
+
let _hasDefStmt: SqliteStatement | null = null;
|
|
242
|
+
|
|
243
|
+
function getBarrelStmts(db: BetterSqlite3Database): {
|
|
244
|
+
isBarrelStmt: SqliteStatement;
|
|
245
|
+
reexportTargetsStmt: SqliteStatement;
|
|
246
|
+
hasDefStmt: SqliteStatement;
|
|
247
|
+
} {
|
|
248
|
+
if (_barrelDb !== db) {
|
|
249
|
+
_barrelDb = db;
|
|
250
|
+
_isBarrelStmt = db.prepare(
|
|
251
|
+
`SELECT COUNT(*) as c FROM edges e
|
|
252
|
+
JOIN nodes n ON e.source_id = n.id
|
|
253
|
+
WHERE e.kind = 'reexports' AND n.file = ? AND n.kind = 'file'`,
|
|
254
|
+
);
|
|
255
|
+
_reexportTargetsStmt = db.prepare(
|
|
256
|
+
`SELECT DISTINCT n2.file FROM edges e
|
|
257
|
+
JOIN nodes n1 ON e.source_id = n1.id
|
|
258
|
+
JOIN nodes n2 ON e.target_id = n2.id
|
|
259
|
+
WHERE e.kind = 'reexports' AND n1.file = ? AND n1.kind = 'file'`,
|
|
260
|
+
);
|
|
261
|
+
_hasDefStmt = db.prepare(
|
|
262
|
+
`SELECT 1 FROM nodes WHERE name = ? AND file = ? AND kind != 'file' AND kind != 'directory' LIMIT 1`,
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
return {
|
|
266
|
+
isBarrelStmt: _isBarrelStmt!,
|
|
267
|
+
reexportTargetsStmt: _reexportTargetsStmt!,
|
|
268
|
+
hasDefStmt: _hasDefStmt!,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
function isBarrelFile(db: BetterSqlite3Database, relPath: string): boolean {
|
|
273
|
+
const { isBarrelStmt } = getBarrelStmts(db);
|
|
274
|
+
const reexportCount = (isBarrelStmt.get(relPath) as { c: number } | undefined)?.c;
|
|
275
|
+
return (reexportCount || 0) > 0;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
function resolveBarrelTarget(
|
|
279
|
+
db: BetterSqlite3Database,
|
|
280
|
+
barrelPath: string,
|
|
281
|
+
symbolName: string,
|
|
282
|
+
visited: Set<string> = new Set(),
|
|
283
|
+
): string | null {
|
|
284
|
+
if (visited.has(barrelPath)) return null;
|
|
285
|
+
visited.add(barrelPath);
|
|
286
|
+
|
|
287
|
+
const { reexportTargetsStmt, hasDefStmt } = getBarrelStmts(db);
|
|
288
|
+
|
|
289
|
+
// Find re-export targets from this barrel
|
|
290
|
+
const reexportTargets = reexportTargetsStmt.all(barrelPath) as Array<{ file: string }>;
|
|
291
|
+
|
|
292
|
+
for (const { file: targetFile } of reexportTargets) {
|
|
293
|
+
// Check if the symbol is defined in this target file
|
|
294
|
+
const hasDef = hasDefStmt.get(symbolName, targetFile);
|
|
295
|
+
if (hasDef) return targetFile;
|
|
296
|
+
|
|
297
|
+
// Recurse through barrel chains
|
|
298
|
+
if (isBarrelFile(db, targetFile)) {
|
|
299
|
+
const deeper = resolveBarrelTarget(db, targetFile, symbolName, visited);
|
|
300
|
+
if (deeper) return deeper;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Resolve barrel imports for a single import statement and create edges to actual source files.
|
|
308
|
+
* Shared by buildImportEdges (primary file) and Pass 2 of the reverse-dep cascade.
|
|
309
|
+
*/
|
|
310
|
+
function resolveBarrelImportEdges(
|
|
311
|
+
db: BetterSqlite3Database,
|
|
312
|
+
stmts: IncrementalStmts,
|
|
313
|
+
fileNodeId: number,
|
|
314
|
+
resolvedPath: string,
|
|
315
|
+
imp: ExtractorOutput['imports'][number],
|
|
316
|
+
): number {
|
|
317
|
+
let edgesAdded = 0;
|
|
318
|
+
if (!isBarrelFile(db, resolvedPath)) return edgesAdded;
|
|
319
|
+
const resolvedSources = new Set<string>();
|
|
320
|
+
for (const name of imp.names) {
|
|
321
|
+
const cleanName = name.replace(/^\*\s+as\s+/, '');
|
|
322
|
+
const actualSource = resolveBarrelTarget(db, resolvedPath, cleanName);
|
|
323
|
+
if (actualSource && actualSource !== resolvedPath && !resolvedSources.has(actualSource)) {
|
|
324
|
+
resolvedSources.add(actualSource);
|
|
325
|
+
const actualRow = stmts.getNodeId.get(actualSource, 'file', actualSource, 0);
|
|
326
|
+
if (actualRow) {
|
|
327
|
+
const kind = imp.typeOnly ? 'imports-type' : 'imports';
|
|
328
|
+
stmts.insertEdge.run(fileNodeId, actualRow.id, kind, 0.9, 0);
|
|
329
|
+
edgesAdded++;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return edgesAdded;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/** Emit symbol-level `imports-type` edges for a single `import type` statement. */
|
|
337
|
+
function emitTypeOnlySymbolEdges(
|
|
338
|
+
db: BetterSqlite3Database | null,
|
|
339
|
+
stmts: IncrementalStmts,
|
|
340
|
+
imp: ExtractorOutput['imports'][number],
|
|
341
|
+
resolvedPath: string,
|
|
342
|
+
fileNodeId: number,
|
|
343
|
+
): number {
|
|
344
|
+
let edgesAdded = 0;
|
|
345
|
+
for (const name of imp.names) {
|
|
346
|
+
const cleanName = name.replace(/^\*\s+as\s+/, '');
|
|
347
|
+
let targetFile = resolvedPath;
|
|
348
|
+
if (db && isBarrelFile(db, resolvedPath)) {
|
|
349
|
+
const actual = resolveBarrelTarget(db, resolvedPath, cleanName);
|
|
350
|
+
if (actual) targetFile = actual;
|
|
351
|
+
}
|
|
352
|
+
const candidates = stmts.findNodeInFile.all(cleanName, targetFile) as Array<{
|
|
353
|
+
id: number;
|
|
354
|
+
file: string;
|
|
355
|
+
}>;
|
|
356
|
+
if (candidates.length === 0) continue;
|
|
357
|
+
stmts.insertEdge.run(fileNodeId, candidates[0]!.id, 'imports-type', 1.0, 0);
|
|
358
|
+
edgesAdded++;
|
|
359
|
+
}
|
|
360
|
+
return edgesAdded;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Process a single import statement: emit the file→file edge, any
|
|
365
|
+
* symbol-level type-only edges, and barrel re-export edges.
|
|
366
|
+
*/
|
|
367
|
+
function emitEdgesForImport(
|
|
368
|
+
stmts: IncrementalStmts,
|
|
369
|
+
imp: ExtractorOutput['imports'][number],
|
|
370
|
+
fileNodeId: number,
|
|
371
|
+
relPath: string,
|
|
372
|
+
rootDir: string,
|
|
373
|
+
aliases: PathAliases,
|
|
374
|
+
db: BetterSqlite3Database | null,
|
|
375
|
+
): number {
|
|
376
|
+
const resolvedPath = resolveImportPath(path.join(rootDir, relPath), imp.source, rootDir, aliases);
|
|
377
|
+
const targetRow = stmts.getNodeId.get(resolvedPath, 'file', resolvedPath, 0);
|
|
378
|
+
if (!targetRow) return 0;
|
|
379
|
+
|
|
380
|
+
const edgeKind = imp.reexport
|
|
381
|
+
? 'reexports'
|
|
382
|
+
: imp.typeOnly
|
|
383
|
+
? 'imports-type'
|
|
384
|
+
: imp.dynamicImport
|
|
385
|
+
? 'dynamic-imports'
|
|
386
|
+
: 'imports';
|
|
387
|
+
stmts.insertEdge.run(fileNodeId, targetRow.id, edgeKind, 1.0, 0);
|
|
388
|
+
let edgesAdded = 1;
|
|
389
|
+
|
|
390
|
+
if (imp.typeOnly) {
|
|
391
|
+
edgesAdded += emitTypeOnlySymbolEdges(db, stmts, imp, resolvedPath, fileNodeId);
|
|
392
|
+
}
|
|
393
|
+
if (!imp.reexport && db) {
|
|
394
|
+
edgesAdded += resolveBarrelImportEdges(db, stmts, fileNodeId, resolvedPath, imp);
|
|
395
|
+
}
|
|
396
|
+
return edgesAdded;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
function buildImportEdges(
|
|
400
|
+
stmts: IncrementalStmts,
|
|
401
|
+
relPath: string,
|
|
402
|
+
symbols: ExtractorOutput,
|
|
403
|
+
rootDir: string,
|
|
404
|
+
fileNodeId: number,
|
|
405
|
+
aliases: PathAliases,
|
|
406
|
+
db: BetterSqlite3Database | null,
|
|
407
|
+
): number {
|
|
408
|
+
let edgesAdded = 0;
|
|
409
|
+
for (const imp of symbols.imports) {
|
|
410
|
+
edgesAdded += emitEdgesForImport(stmts, imp, fileNodeId, relPath, rootDir, aliases, db);
|
|
411
|
+
}
|
|
412
|
+
return edgesAdded;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function buildImportedNamesMap(
|
|
416
|
+
symbols: ExtractorOutput,
|
|
417
|
+
rootDir: string,
|
|
418
|
+
relPath: string,
|
|
419
|
+
aliases: PathAliases,
|
|
420
|
+
db: BetterSqlite3Database,
|
|
421
|
+
): Map<string, string> {
|
|
422
|
+
const importedNames = new Map<string, string>();
|
|
423
|
+
for (const imp of symbols.imports) {
|
|
424
|
+
const resolvedPath = resolveImportPath(
|
|
425
|
+
path.join(rootDir, relPath),
|
|
426
|
+
imp.source,
|
|
427
|
+
rootDir,
|
|
428
|
+
aliases,
|
|
429
|
+
);
|
|
430
|
+
for (const name of imp.names) {
|
|
431
|
+
const cleanName = name.replace(/^\*\s+as\s+/, '');
|
|
432
|
+
// Mirror full-build's `buildImportedNamesMap`: follow barrel re-exports so
|
|
433
|
+
// `importedNames` maps to the *defining* file, not the barrel. This ensures
|
|
434
|
+
// `computeConfidence` gets `importedFrom === targetFile` and returns 1.0
|
|
435
|
+
// instead of the cross-directory fallback (0.3).
|
|
436
|
+
let targetFile = resolvedPath;
|
|
437
|
+
if (isBarrelFile(db, resolvedPath)) {
|
|
438
|
+
const actual = resolveBarrelTarget(db, resolvedPath, cleanName);
|
|
439
|
+
if (actual) targetFile = actual;
|
|
440
|
+
}
|
|
441
|
+
importedNames.set(cleanName, targetFile);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return importedNames;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// ── Class hierarchy edges ───────────────────────────────────────────────
|
|
448
|
+
|
|
449
|
+
type NodeWithKind = { id: number; kind: string; file: string };
|
|
450
|
+
|
|
451
|
+
const HIERARCHY_SOURCE_KINDS = new Set(['class', 'struct', 'record', 'enum']);
|
|
452
|
+
const EXTENDS_TARGET_KINDS = new Set(['class', 'struct', 'trait', 'record']);
|
|
453
|
+
const IMPLEMENTS_TARGET_KINDS = new Set(['interface', 'trait', 'class']);
|
|
454
|
+
|
|
455
|
+
function buildClassHierarchyEdges(
|
|
456
|
+
stmts: IncrementalStmts,
|
|
457
|
+
relPath: string,
|
|
458
|
+
symbols: ExtractorOutput,
|
|
459
|
+
): number {
|
|
460
|
+
let edgesAdded = 0;
|
|
461
|
+
for (const cls of symbols.classes) {
|
|
462
|
+
const sourceRow = (stmts.findNodeInFile.all(cls.name, relPath) as NodeWithKind[]).find((n) =>
|
|
463
|
+
HIERARCHY_SOURCE_KINDS.has(n.kind),
|
|
464
|
+
);
|
|
465
|
+
if (!sourceRow) continue;
|
|
466
|
+
|
|
467
|
+
if (cls.extends) {
|
|
468
|
+
for (const t of (stmts.findNodeByName.all(cls.extends) as NodeWithKind[]).filter((n) =>
|
|
469
|
+
EXTENDS_TARGET_KINDS.has(n.kind),
|
|
470
|
+
)) {
|
|
471
|
+
stmts.insertEdge.run(sourceRow.id, t.id, 'extends', 1.0, 0);
|
|
472
|
+
edgesAdded++;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
if (cls.implements) {
|
|
476
|
+
for (const t of (stmts.findNodeByName.all(cls.implements) as NodeWithKind[]).filter((n) =>
|
|
477
|
+
IMPLEMENTS_TARGET_KINDS.has(n.kind),
|
|
478
|
+
)) {
|
|
479
|
+
stmts.insertEdge.run(sourceRow.id, t.id, 'implements', 1.0, 0);
|
|
480
|
+
edgesAdded++;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return edgesAdded;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
// ── Call edge building ──────────────────────────────────────────────────
|
|
488
|
+
|
|
489
|
+
function makeIncrementalLookup(db: BetterSqlite3Database, stmts: IncrementalStmts): CallNodeLookup {
|
|
490
|
+
return {
|
|
491
|
+
byNameAndFile: (name, file) =>
|
|
492
|
+
stmts.findNodeInFile.all(name, file) as Array<{ id: number; file: string; kind?: string }>,
|
|
493
|
+
byName: (name) =>
|
|
494
|
+
stmts.findNodeByName.all(name) as Array<{ id: number; file: string; kind?: string }>,
|
|
495
|
+
isBarrel: (file) => isBarrelFile(db, file),
|
|
496
|
+
resolveBarrel: (barrelFile, symbolName) => resolveBarrelTarget(db, barrelFile, symbolName),
|
|
497
|
+
nodeId: (name, kind, file, line) =>
|
|
498
|
+
stmts.getNodeId.get(name, kind, file, line) as { id: number } | undefined,
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
/** Coerce symbols.typeMap (Map, Array, or undefined) to a canonical Map. */
|
|
503
|
+
function coerceTypeMap(symbols: ExtractorOutput): Map<string, unknown> {
|
|
504
|
+
const rawTM: unknown = symbols.typeMap;
|
|
505
|
+
if (rawTM instanceof Map) return rawTM;
|
|
506
|
+
if (Array.isArray(rawTM) && rawTM.length > 0) {
|
|
507
|
+
return new Map(
|
|
508
|
+
(rawTM as Array<{ name: string; typeName?: string; type?: string }>).map((e) => [
|
|
509
|
+
e.name,
|
|
510
|
+
e.typeName ?? e.type ?? null,
|
|
511
|
+
]),
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
return new Map();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* Seed scoped rest-param keys into typeMap (Phase 8.3f).
|
|
519
|
+
* Mirrors buildObjectRestParamPostPass in the full build.
|
|
520
|
+
*
|
|
521
|
+
* Scoped keys (`callee::restName`) prevent same-name rest-param collisions
|
|
522
|
+
* when two functions in the same file both use `...rest` (#1358). The
|
|
523
|
+
* unscoped key is also seeded when only one callee uses a given rest name,
|
|
524
|
+
* preserving resolution when callerName is null.
|
|
525
|
+
*/
|
|
526
|
+
function seedRestParamTypeMap(typeMap: Map<string, unknown>, symbols: ExtractorOutput): void {
|
|
527
|
+
if (!symbols.objectRestParamBindings?.length || !symbols.paramBindings?.length) return;
|
|
528
|
+
|
|
529
|
+
const restNameCallees = new Map<string, Set<string>>();
|
|
530
|
+
for (const orpb of symbols.objectRestParamBindings) {
|
|
531
|
+
if (!restNameCallees.has(orpb.restName)) restNameCallees.set(orpb.restName, new Set());
|
|
532
|
+
restNameCallees.get(orpb.restName)!.add(orpb.callee);
|
|
533
|
+
}
|
|
534
|
+
for (const orpb of symbols.objectRestParamBindings) {
|
|
535
|
+
for (const pb of symbols.paramBindings) {
|
|
536
|
+
if (pb.callee === orpb.callee && pb.argIndex === orpb.argIndex) {
|
|
537
|
+
const scopedKey = `${orpb.callee}::${orpb.restName}`;
|
|
538
|
+
if (!typeMap.has(scopedKey)) {
|
|
539
|
+
typeMap.set(scopedKey, { type: pb.argName, confidence: 0.65 });
|
|
540
|
+
if (restNameCallees.get(orpb.restName)!.size === 1 && !typeMap.has(orpb.restName)) {
|
|
541
|
+
typeMap.set(orpb.restName, { type: pb.argName, confidence: 0.65 });
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Normalize symbols.typeMap into a canonical Map and seed scoped rest-param
|
|
551
|
+
* keys (Phase 8.3f). Mirrors buildObjectRestParamPostPass in the full build.
|
|
552
|
+
*/
|
|
553
|
+
function buildIncrementalTypeMap(symbols: ExtractorOutput): Map<string, unknown> {
|
|
554
|
+
const typeMap = coerceTypeMap(symbols);
|
|
555
|
+
seedRestParamTypeMap(typeMap, symbols);
|
|
556
|
+
return typeMap;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Strategy 1 — same-class `this.method()` fallback.
|
|
561
|
+
* Derives the enclosing class name from callerName by extracting the segment
|
|
562
|
+
* immediately before the final dot (e.g. `MyClass.method` → `MyClass`,
|
|
563
|
+
* `Namespace.MyClass.method` → `MyClass`), then retries with the qualified
|
|
564
|
+
* method name `MyClass.callName`.
|
|
565
|
+
*
|
|
566
|
+
* Uses lastIndexOf to match the full-build counterpart in resolveFallbackTargets
|
|
567
|
+
* (build-edges.ts) — indexOf would extract `Namespace` instead of `MyClass` for
|
|
568
|
+
* deeply-qualified caller names like `Namespace.MyClass.method`.
|
|
569
|
+
*/
|
|
570
|
+
function resolveThisSameClassTarget(
|
|
571
|
+
callName: string,
|
|
572
|
+
callerName: string,
|
|
573
|
+
relPath: string,
|
|
574
|
+
lookup: CallNodeLookup,
|
|
575
|
+
): Array<{ id: number; file: string; kind?: string }> {
|
|
576
|
+
const lastDot = callerName.lastIndexOf('.');
|
|
577
|
+
if (lastDot <= 0) return [];
|
|
578
|
+
const prevDot = callerName.lastIndexOf('.', lastDot - 1);
|
|
579
|
+
const className = callerName.slice(prevDot + 1, lastDot);
|
|
580
|
+
return lookup
|
|
581
|
+
.byNameAndFile(`${className}.${callName}`, relPath)
|
|
582
|
+
.filter((n) => n.kind === 'method');
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
/**
|
|
586
|
+
* Strategy 2 — Object.defineProperty accessor fallback.
|
|
587
|
+
* When a function is registered as a getter/setter via
|
|
588
|
+
* `Object.defineProperty(obj, "bar", { get: getter })`, calls to `this.X()`
|
|
589
|
+
* inside `getter` resolve against `obj`. Looks up the receiver var in the
|
|
590
|
+
* typeMap for its type, then falls back to any same-file definition named
|
|
591
|
+
* `callName` with function or method kind.
|
|
592
|
+
*/
|
|
593
|
+
function resolveDefinePropertyTarget(
|
|
594
|
+
callName: string,
|
|
595
|
+
callerName: string,
|
|
596
|
+
relPath: string,
|
|
597
|
+
typeMap: Map<string, unknown>,
|
|
598
|
+
lookup: CallNodeLookup,
|
|
599
|
+
definePropertyReceivers: Map<string, string>,
|
|
600
|
+
): Array<{ id: number; file: string; kind?: string }> {
|
|
601
|
+
const receiverVarName = definePropertyReceivers.get(callerName);
|
|
602
|
+
if (!receiverVarName) return [];
|
|
603
|
+
|
|
604
|
+
const typeEntry = typeMap.get(receiverVarName);
|
|
605
|
+
const typeName = typeEntry
|
|
606
|
+
? typeof typeEntry === 'string'
|
|
607
|
+
? typeEntry
|
|
608
|
+
: (typeEntry as { type?: string }).type
|
|
609
|
+
: null;
|
|
610
|
+
if (typeName) {
|
|
611
|
+
const qualified = lookup.byNameAndFile(`${typeName}.${callName}`, relPath);
|
|
612
|
+
if (qualified.length > 0) return [...qualified];
|
|
613
|
+
}
|
|
614
|
+
// Narrow to function/method kinds only to avoid matching unrelated
|
|
615
|
+
// variables or classes that share a name in the same file.
|
|
616
|
+
return lookup
|
|
617
|
+
.byNameAndFile(callName, relPath)
|
|
618
|
+
.filter((n) => n.kind === 'function' || n.kind === 'method');
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/**
|
|
622
|
+
* Apply `this`-receiver fallback resolution strategies for a single call site
|
|
623
|
+
* when the primary resolveCallTargets pass returned no targets.
|
|
624
|
+
*/
|
|
625
|
+
function applyThisReceiverFallbacks(
|
|
626
|
+
call: { name: string; receiver?: string | null },
|
|
627
|
+
callerName: string | null,
|
|
628
|
+
relPath: string,
|
|
629
|
+
typeMap: Map<string, unknown>,
|
|
630
|
+
lookup: CallNodeLookup,
|
|
631
|
+
definePropertyReceivers: Map<string, string> | undefined,
|
|
632
|
+
initialTargets: Array<{ id: number; file: string; kind?: string }>,
|
|
633
|
+
): Array<{ id: number; file: string; kind?: string }> {
|
|
634
|
+
if (initialTargets.length > 0) return initialTargets;
|
|
635
|
+
|
|
636
|
+
// Strategy 1: same-class `this.method()` fallback.
|
|
637
|
+
if (call.receiver === 'this' && callerName != null) {
|
|
638
|
+
const s1 = resolveThisSameClassTarget(call.name, callerName, relPath, lookup);
|
|
639
|
+
if (s1.length > 0) return s1;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
// Strategy 2: Object.defineProperty accessor fallback.
|
|
643
|
+
if (call.receiver === 'this' && callerName != null && definePropertyReceivers) {
|
|
644
|
+
return resolveDefinePropertyTarget(
|
|
645
|
+
call.name,
|
|
646
|
+
callerName,
|
|
647
|
+
relPath,
|
|
648
|
+
typeMap,
|
|
649
|
+
lookup,
|
|
650
|
+
definePropertyReceivers,
|
|
651
|
+
);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
return initialTargets;
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
/**
|
|
658
|
+
* Emit direct `calls` edges for the resolved targets of a single call site,
|
|
659
|
+
* then emit a `receiver` edge when the call has a non-this/self/super receiver.
|
|
660
|
+
* Returns the number of edges inserted.
|
|
661
|
+
*/
|
|
662
|
+
function emitIncrementalCallEdges(
|
|
663
|
+
call: { name: string; receiver?: string | null; dynamic?: boolean },
|
|
664
|
+
caller: { id: number; callerName: string | null },
|
|
665
|
+
targets: Array<{ id: number; file: string; kind?: string }>,
|
|
666
|
+
importedFrom: string | null | undefined,
|
|
667
|
+
relPath: string,
|
|
668
|
+
typeMap: Map<string, unknown>,
|
|
669
|
+
lookup: CallNodeLookup,
|
|
670
|
+
importedNames: Map<string, string>,
|
|
671
|
+
seenCallEdges: Set<string>,
|
|
672
|
+
stmts: IncrementalStmts,
|
|
673
|
+
): number {
|
|
674
|
+
let edgesAdded = 0;
|
|
675
|
+
|
|
676
|
+
for (const t of targets) {
|
|
677
|
+
const edgeKey = `${caller.id}|${t.id}`;
|
|
678
|
+
if (t.id !== caller.id && !seenCallEdges.has(edgeKey)) {
|
|
679
|
+
seenCallEdges.add(edgeKey);
|
|
680
|
+
const confidence = computeConfidence(relPath, t.file, importedFrom ?? null);
|
|
681
|
+
stmts.insertEdge.run(caller.id, t.id, 'calls', confidence, call.dynamic ? 1 : 0);
|
|
682
|
+
edgesAdded++;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if (
|
|
687
|
+
call.receiver &&
|
|
688
|
+
!BUILTIN_RECEIVERS.has(call.receiver) &&
|
|
689
|
+
call.receiver !== 'this' &&
|
|
690
|
+
call.receiver !== 'self' &&
|
|
691
|
+
call.receiver !== 'super'
|
|
692
|
+
) {
|
|
693
|
+
const recv = resolveReceiverEdge(
|
|
694
|
+
lookup,
|
|
695
|
+
{ name: call.name, receiver: call.receiver },
|
|
696
|
+
caller,
|
|
697
|
+
relPath,
|
|
698
|
+
typeMap,
|
|
699
|
+
seenCallEdges,
|
|
700
|
+
importedNames,
|
|
701
|
+
);
|
|
702
|
+
if (recv) {
|
|
703
|
+
stmts.insertEdge.run(recv.callerId, recv.receiverId, 'receiver', recv.confidence, 0);
|
|
704
|
+
edgesAdded++;
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
return edgesAdded;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
function buildCallEdges(
|
|
712
|
+
db: BetterSqlite3Database,
|
|
713
|
+
stmts: IncrementalStmts,
|
|
714
|
+
relPath: string,
|
|
715
|
+
symbols: ExtractorOutput,
|
|
716
|
+
fileNodeRow: { id: number },
|
|
717
|
+
importedNames: Map<string, string>,
|
|
718
|
+
): number {
|
|
719
|
+
const typeMap = buildIncrementalTypeMap(symbols);
|
|
720
|
+
const seenCallEdges = new Set<string>();
|
|
721
|
+
const lookup = makeIncrementalLookup(db, stmts);
|
|
722
|
+
let edgesAdded = 0;
|
|
723
|
+
|
|
724
|
+
for (const call of symbols.calls) {
|
|
725
|
+
if (call.receiver && BUILTIN_RECEIVERS.has(call.receiver)) continue;
|
|
726
|
+
|
|
727
|
+
const caller = findCaller(lookup, call, symbols.definitions, relPath, fileNodeRow);
|
|
728
|
+
const { targets: initialTargets, importedFrom } = resolveCallTargets(
|
|
729
|
+
lookup,
|
|
730
|
+
call,
|
|
731
|
+
relPath,
|
|
732
|
+
importedNames,
|
|
733
|
+
typeMap,
|
|
734
|
+
caller.callerName,
|
|
735
|
+
);
|
|
736
|
+
|
|
737
|
+
const targets = applyThisReceiverFallbacks(
|
|
738
|
+
call,
|
|
739
|
+
caller.callerName,
|
|
740
|
+
relPath,
|
|
741
|
+
typeMap,
|
|
742
|
+
lookup,
|
|
743
|
+
symbols.definePropertyReceivers,
|
|
744
|
+
initialTargets,
|
|
745
|
+
);
|
|
746
|
+
|
|
747
|
+
edgesAdded += emitIncrementalCallEdges(
|
|
748
|
+
call,
|
|
749
|
+
caller,
|
|
750
|
+
targets,
|
|
751
|
+
importedFrom,
|
|
752
|
+
relPath,
|
|
753
|
+
typeMap,
|
|
754
|
+
lookup,
|
|
755
|
+
importedNames,
|
|
756
|
+
seenCallEdges,
|
|
757
|
+
stmts,
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
return edgesAdded;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
// ── Main entry point ────────────────────────────────────────────────────
|
|
764
|
+
|
|
765
|
+
/** Build the "this file was deleted" result returned by `rebuildFile`. */
|
|
766
|
+
function buildDeletionResult(
|
|
767
|
+
relPath: string,
|
|
768
|
+
oldNodes: number,
|
|
769
|
+
edgesBefore: number,
|
|
770
|
+
oldSymbols: unknown[],
|
|
771
|
+
diffSymbols: ((old: unknown[], new_: unknown[]) => unknown) | undefined,
|
|
772
|
+
): RebuildResult {
|
|
773
|
+
const symbolDiff = diffSymbols ? diffSymbols(oldSymbols, []) : null;
|
|
774
|
+
return {
|
|
775
|
+
file: relPath,
|
|
776
|
+
nodesAdded: 0,
|
|
777
|
+
nodesRemoved: oldNodes,
|
|
778
|
+
edgesAdded: 0,
|
|
779
|
+
edgesBefore,
|
|
780
|
+
deleted: true,
|
|
781
|
+
event: 'deleted',
|
|
782
|
+
symbolDiff,
|
|
783
|
+
nodesBefore: oldNodes,
|
|
784
|
+
nodesAfter: 0,
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/** Rebuild all edges originating in the single (just-parsed) target file. */
|
|
789
|
+
function rebuildEdgesForTargetFile(
|
|
790
|
+
db: BetterSqlite3Database,
|
|
791
|
+
stmts: IncrementalStmts,
|
|
792
|
+
relPath: string,
|
|
793
|
+
symbols: ExtractorOutput,
|
|
794
|
+
fileNodeRow: { id: number },
|
|
795
|
+
rootDir: string,
|
|
796
|
+
): number {
|
|
797
|
+
const aliases: PathAliases = { baseUrl: null, paths: {} };
|
|
798
|
+
let edgesAdded = buildContainmentEdges(db, stmts, relPath, symbols);
|
|
799
|
+
edgesAdded += rebuildDirContainment(db, stmts, relPath);
|
|
800
|
+
edgesAdded += buildImportEdges(stmts, relPath, symbols, rootDir, fileNodeRow.id, aliases, db);
|
|
801
|
+
const importedNames = buildImportedNamesMap(symbols, rootDir, relPath, aliases, db);
|
|
802
|
+
edgesAdded += buildCallEdges(db, stmts, relPath, symbols, fileNodeRow, importedNames);
|
|
803
|
+
edgesAdded += buildClassHierarchyEdges(stmts, relPath, symbols);
|
|
804
|
+
return edgesAdded;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
/**
|
|
808
|
+
* Re-parse the reverse-deps and delete their outgoing edges so the cascade
|
|
809
|
+
* can rebuild them. Returns the parsed symbols map together with the total
|
|
810
|
+
* edge count across all deps measured *before* deletion — callers add this
|
|
811
|
+
* to their own `edgesBefore` so the net delta stays correct even when the
|
|
812
|
+
* reverse-dep cascade re-inserts edges.
|
|
813
|
+
*/
|
|
814
|
+
async function parseReverseDeps(
|
|
815
|
+
db: BetterSqlite3Database,
|
|
816
|
+
rootDir: string,
|
|
817
|
+
reverseDeps: string[],
|
|
818
|
+
stmts: IncrementalStmts,
|
|
819
|
+
engineOpts: EngineOpts,
|
|
820
|
+
cache: unknown,
|
|
821
|
+
): Promise<{ depSymbols: Map<string, ExtractorOutput>; reverseDepsEdgesBefore: number }> {
|
|
822
|
+
const depSymbols = new Map<string, ExtractorOutput>();
|
|
823
|
+
let reverseDepsEdgesBefore = 0;
|
|
824
|
+
for (const depRelPath of reverseDeps) {
|
|
825
|
+
const symbols_ = await parseReverseDep(rootDir, depRelPath, engineOpts, cache);
|
|
826
|
+
if (symbols_) {
|
|
827
|
+
reverseDepsEdgesBefore += stmts.countEdges.get(depRelPath)?.c ?? 0;
|
|
828
|
+
deleteOutgoingEdges(db, depRelPath);
|
|
829
|
+
depSymbols.set(depRelPath, symbols_);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return { depSymbols, reverseDepsEdgesBefore };
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Pass 2 of the reverse-dep cascade: now that the changed file's `reexports`
|
|
837
|
+
* edges exist, resolve barrel imports for every reverse-dep so transitive
|
|
838
|
+
* call edges through the barrel still find their targets.
|
|
839
|
+
*/
|
|
840
|
+
function emitBarrelImportEdgesForReverseDeps(
|
|
841
|
+
db: BetterSqlite3Database,
|
|
842
|
+
stmts: IncrementalStmts,
|
|
843
|
+
depSymbols: Map<string, ExtractorOutput>,
|
|
844
|
+
rootDir: string,
|
|
845
|
+
): number {
|
|
846
|
+
let edgesAdded = 0;
|
|
847
|
+
for (const [depRelPath, symbols_] of depSymbols) {
|
|
848
|
+
const fileNodeRow_ = stmts.getNodeId.get(depRelPath, 'file', depRelPath, 0);
|
|
849
|
+
if (!fileNodeRow_) continue;
|
|
850
|
+
const aliases_: PathAliases = { baseUrl: null, paths: {} };
|
|
851
|
+
for (const imp of symbols_.imports) {
|
|
852
|
+
if (imp.reexport) continue;
|
|
853
|
+
const resolvedPath = resolveImportPath(
|
|
854
|
+
path.join(rootDir, depRelPath),
|
|
855
|
+
imp.source,
|
|
856
|
+
rootDir,
|
|
857
|
+
aliases_,
|
|
858
|
+
);
|
|
859
|
+
edgesAdded += resolveBarrelImportEdges(db, stmts, fileNodeRow_.id, resolvedPath, imp);
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
return edgesAdded;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/**
|
|
866
|
+
* Two-pass reverse-dep cascade:
|
|
867
|
+
* 1. Rebuild direct edges (creating `reexports` edges for barrels).
|
|
868
|
+
* 2. Add barrel import edges (which need `reexports` edges to exist).
|
|
869
|
+
* Returns both the gross edges-added count and the pre-deletion edge count
|
|
870
|
+
* for all reverse deps so callers can compute a true net delta.
|
|
871
|
+
*/
|
|
872
|
+
async function runReverseDepCascade(
|
|
873
|
+
db: BetterSqlite3Database,
|
|
874
|
+
rootDir: string,
|
|
875
|
+
reverseDeps: string[],
|
|
876
|
+
stmts: IncrementalStmts,
|
|
877
|
+
engineOpts: EngineOpts,
|
|
878
|
+
cache: unknown,
|
|
879
|
+
): Promise<{ edgesAdded: number; reverseDepsEdgesBefore: number }> {
|
|
880
|
+
const { depSymbols, reverseDepsEdgesBefore } = await parseReverseDeps(
|
|
881
|
+
db,
|
|
882
|
+
rootDir,
|
|
883
|
+
reverseDeps,
|
|
884
|
+
stmts,
|
|
885
|
+
engineOpts,
|
|
886
|
+
cache,
|
|
887
|
+
);
|
|
888
|
+
|
|
889
|
+
let edgesAdded = 0;
|
|
890
|
+
// Pass 1: direct edges only (no barrel resolution) — creates reexports edges
|
|
891
|
+
for (const [depRelPath, symbols_] of depSymbols) {
|
|
892
|
+
edgesAdded += rebuildReverseDepEdges(db, rootDir, depRelPath, symbols_, stmts, true);
|
|
893
|
+
}
|
|
894
|
+
// Pass 2: add barrel import edges (reexports edges now exist)
|
|
895
|
+
edgesAdded += emitBarrelImportEdgesForReverseDeps(db, stmts, depSymbols, rootDir);
|
|
896
|
+
return { edgesAdded, reverseDepsEdgesBefore };
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Parse a single file and update the database incrementally.
|
|
901
|
+
*/
|
|
902
|
+
export async function rebuildFile(
|
|
903
|
+
db: BetterSqlite3Database,
|
|
904
|
+
rootDir: string,
|
|
905
|
+
filePath: string,
|
|
906
|
+
stmts: IncrementalStmts,
|
|
907
|
+
engineOpts: EngineOpts,
|
|
908
|
+
cache: unknown,
|
|
909
|
+
options: { diffSymbols?: (old: unknown[], new_: unknown[]) => unknown } = {},
|
|
910
|
+
): Promise<RebuildResult | null> {
|
|
911
|
+
const { diffSymbols } = options;
|
|
912
|
+
const relPath = normalizePath(path.relative(rootDir, filePath));
|
|
913
|
+
const oldNodes = stmts.countNodes.get(relPath)?.c || 0;
|
|
914
|
+
const edgesBefore = stmts.countEdges.get(relPath)?.c || 0;
|
|
915
|
+
const oldSymbols: unknown[] = diffSymbols ? stmts.listSymbols.all(relPath) : [];
|
|
916
|
+
|
|
917
|
+
// Find reverse-deps BEFORE purging (edges still reference the old nodes)
|
|
918
|
+
const reverseDeps = findReverseDeps(db, relPath);
|
|
919
|
+
|
|
920
|
+
// Purge ancillary tables (incl. embeddings), edges, and nodes in one pass.
|
|
921
|
+
// Embeddings must be purged before nodes — better-sqlite3 enforces foreign
|
|
922
|
+
// keys by default, and `embeddings.node_id` references `nodes.id`. Issue #1176.
|
|
923
|
+
// `purgeHashes: false` preserves file_hashes for the next incremental build.
|
|
924
|
+
purgeFileData(db, relPath, { purgeHashes: false });
|
|
925
|
+
|
|
926
|
+
if (!fs.existsSync(filePath)) {
|
|
927
|
+
if (cache) (cache as { remove(p: string): void }).remove(filePath);
|
|
928
|
+
return buildDeletionResult(relPath, oldNodes, edgesBefore, oldSymbols, diffSymbols);
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
let code: string;
|
|
932
|
+
try {
|
|
933
|
+
code = readFileSafe(filePath);
|
|
934
|
+
} catch (err) {
|
|
935
|
+
warn(`Cannot read ${relPath}: ${(err as Error).message}`);
|
|
936
|
+
return null;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
const symbols = await parseFileIncremental(cache, filePath, code, engineOpts);
|
|
940
|
+
if (!symbols) return null;
|
|
941
|
+
|
|
942
|
+
insertFileNodes(stmts, relPath, symbols);
|
|
943
|
+
|
|
944
|
+
const newNodes = stmts.countNodes.get(relPath)?.c || 0;
|
|
945
|
+
const newSymbols: unknown[] = diffSymbols ? stmts.listSymbols.all(relPath) : [];
|
|
946
|
+
|
|
947
|
+
const fileNodeRow = stmts.getNodeId.get(relPath, 'file', relPath, 0);
|
|
948
|
+
if (!fileNodeRow)
|
|
949
|
+
return {
|
|
950
|
+
file: relPath,
|
|
951
|
+
nodesAdded: newNodes,
|
|
952
|
+
nodesRemoved: oldNodes,
|
|
953
|
+
edgesAdded: 0,
|
|
954
|
+
edgesBefore,
|
|
955
|
+
};
|
|
956
|
+
|
|
957
|
+
let edgesAdded = rebuildEdgesForTargetFile(db, stmts, relPath, symbols, fileNodeRow, rootDir);
|
|
958
|
+
const { edgesAdded: cascadeEdges, reverseDepsEdgesBefore } = await runReverseDepCascade(
|
|
959
|
+
db,
|
|
960
|
+
rootDir,
|
|
961
|
+
reverseDeps,
|
|
962
|
+
stmts,
|
|
963
|
+
engineOpts,
|
|
964
|
+
cache,
|
|
965
|
+
);
|
|
966
|
+
edgesAdded += cascadeEdges;
|
|
967
|
+
// Include pre-deletion edge counts from reverse deps so the net delta
|
|
968
|
+
// (edgesAdded - edgesBefore) is correct even when the cascade re-inserts
|
|
969
|
+
// their edges unchanged.
|
|
970
|
+
const totalEdgesBefore = edgesBefore + reverseDepsEdgesBefore;
|
|
971
|
+
|
|
972
|
+
const symbolDiff = diffSymbols ? diffSymbols(oldSymbols, newSymbols) : null;
|
|
973
|
+
const event = oldNodes === 0 ? 'added' : 'modified';
|
|
974
|
+
|
|
975
|
+
return {
|
|
976
|
+
file: relPath,
|
|
977
|
+
nodesAdded: newNodes,
|
|
978
|
+
nodesRemoved: oldNodes,
|
|
979
|
+
edgesAdded,
|
|
980
|
+
edgesBefore: totalEdgesBefore,
|
|
981
|
+
deleted: false,
|
|
982
|
+
event,
|
|
983
|
+
symbolDiff,
|
|
984
|
+
nodesBefore: oldNodes,
|
|
985
|
+
nodesAfter: newNodes,
|
|
986
|
+
};
|
|
987
|
+
}
|