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,1246 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { Language, Parser, Query } from 'web-tree-sitter';
|
|
5
|
+
import { debug, warn } from '../infrastructure/logger.js';
|
|
6
|
+
import { getNative, getNativePackageVersion, loadNative } from '../infrastructure/native.js';
|
|
7
|
+
import { ParseError, toErrorMessage } from '../shared/errors.js';
|
|
8
|
+
import { disposeWasmWorkerPool, getWasmWorkerPool } from './wasm-worker-pool.js';
|
|
9
|
+
/** Default worker opts: run all analyses so output matches parseFilesFull. */
|
|
10
|
+
const FULL_ANALYSIS = {
|
|
11
|
+
ast: true,
|
|
12
|
+
complexity: true,
|
|
13
|
+
cfg: true,
|
|
14
|
+
dataflow: true,
|
|
15
|
+
};
|
|
16
|
+
/** Extract-only opts: skip visitor walk for typeMap backfill / similar fast paths. */
|
|
17
|
+
const EXTRACT_ONLY = {
|
|
18
|
+
ast: false,
|
|
19
|
+
complexity: false,
|
|
20
|
+
cfg: false,
|
|
21
|
+
dataflow: false,
|
|
22
|
+
};
|
|
23
|
+
// Re-export all extractors for backward compatibility
|
|
24
|
+
export { extractBashSymbols, extractClojureSymbols, extractCppSymbols, extractCSharpSymbols, extractCSymbols, extractCudaSymbols, extractDartSymbols, extractElixirSymbols, extractErlangSymbols, extractFSharpSymbols, extractGleamSymbols, extractGoSymbols, extractGroovySymbols, extractHaskellSymbols, extractHCLSymbols, extractJavaSymbols, extractJuliaSymbols, extractKotlinSymbols, extractLuaSymbols, extractObjCSymbols, extractOCamlSymbols, extractPHPSymbols, extractPythonSymbols, extractRSymbols, extractRubySymbols, extractRustSymbols, extractScalaSymbols, extractSoliditySymbols, extractSwiftSymbols, extractSymbols, extractVerilogSymbols, extractZigSymbols, } from '../extractors/index.js';
|
|
25
|
+
import { extractBashSymbols, extractClojureSymbols, extractCppSymbols, extractCSharpSymbols, extractCSymbols, extractCudaSymbols, extractDartSymbols, extractElixirSymbols, extractErlangSymbols, extractFSharpSymbols, extractGleamSymbols, extractGoSymbols, extractGroovySymbols, extractHaskellSymbols, extractHCLSymbols, extractJavaSymbols, extractJuliaSymbols, extractKotlinSymbols, extractLuaSymbols, extractObjCSymbols, extractOCamlSymbols, extractPHPSymbols, extractPythonSymbols, extractRSymbols, extractRubySymbols, extractRustSymbols, extractScalaSymbols, extractSoliditySymbols, extractSwiftSymbols, extractSymbols, extractVerilogSymbols, extractZigSymbols, } from '../extractors/index.js';
|
|
26
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
27
|
+
function grammarPath(name) {
|
|
28
|
+
return path.join(__dirname, '..', '..', 'grammars', name);
|
|
29
|
+
}
|
|
30
|
+
let _initialized = false;
|
|
31
|
+
// Memoized parsers — avoids reloading WASM grammars on every createParsers() call
|
|
32
|
+
let _cachedParsers = null;
|
|
33
|
+
// Cached Language objects — WASM-backed, must be .delete()'d explicitly
|
|
34
|
+
let _cachedLanguages = null;
|
|
35
|
+
// Query cache for JS/TS/TSX extractors (populated during createParsers)
|
|
36
|
+
const _queryCache = new Map();
|
|
37
|
+
// Tracks whether ALL grammars have been loaded (vs. a lazy subset)
|
|
38
|
+
let _allParsersLoaded = false;
|
|
39
|
+
// In-flight grammar loads keyed by language id — prevents concurrent duplicate loads
|
|
40
|
+
const _loadingPromises = new Map();
|
|
41
|
+
// Extensions that need typeMap backfill (type annotations only exist in TS/TSX)
|
|
42
|
+
const TS_BACKFILL_EXTS = new Set(['.ts', '.tsx']);
|
|
43
|
+
// Shared patterns for all JS/TS/TSX (class_declaration excluded — name type differs)
|
|
44
|
+
const COMMON_QUERY_PATTERNS = [
|
|
45
|
+
'(function_declaration name: (identifier) @fn_name) @fn_node',
|
|
46
|
+
'(generator_function_declaration name: (identifier) @fn_name) @fn_node',
|
|
47
|
+
'(variable_declarator name: (identifier) @varfn_name value: (arrow_function) @varfn_value)',
|
|
48
|
+
'(variable_declarator name: (identifier) @varfn_name value: (function_expression) @varfn_value)',
|
|
49
|
+
'(variable_declarator name: (identifier) @varfn_name value: (generator_function) @varfn_value)',
|
|
50
|
+
'(method_definition name: (property_identifier) @meth_name) @meth_node',
|
|
51
|
+
'(method_definition name: (private_property_identifier) @meth_name) @meth_node',
|
|
52
|
+
'(method_definition name: (computed_property_name) @meth_name) @meth_node',
|
|
53
|
+
'(import_statement source: (string) @imp_source) @imp_node',
|
|
54
|
+
'(export_statement) @exp_node',
|
|
55
|
+
'(call_expression function: (identifier) @callfn_name) @callfn_node',
|
|
56
|
+
'(call_expression function: (member_expression) @callmem_fn) @callmem_node',
|
|
57
|
+
'(call_expression function: (subscript_expression) @callsub_fn) @callsub_node',
|
|
58
|
+
'(new_expression constructor: (identifier) @newfn_name) @newfn_node',
|
|
59
|
+
'(new_expression constructor: (member_expression) @newmem_fn) @newmem_node',
|
|
60
|
+
'(expression_statement (assignment_expression left: (member_expression) @assign_left right: (_) @assign_right)) @assign_node',
|
|
61
|
+
];
|
|
62
|
+
// JS: class name is (identifier) — declarations and expressions
|
|
63
|
+
const JS_CLASS_PATTERNS = [
|
|
64
|
+
'(class_declaration name: (identifier) @cls_name) @cls_node',
|
|
65
|
+
// class expressions: `return class Foo extends Bar { ... }` or `const X = class Foo { ... }`
|
|
66
|
+
'(class name: (identifier) @cls_name) @cls_node',
|
|
67
|
+
];
|
|
68
|
+
// TS/TSX: class name is (type_identifier), plus interface and type alias
|
|
69
|
+
// abstract_class_declaration is a separate node type in tree-sitter-typescript
|
|
70
|
+
const TS_EXTRA_PATTERNS = [
|
|
71
|
+
'(class_declaration name: (type_identifier) @cls_name) @cls_node',
|
|
72
|
+
'(abstract_class_declaration name: (type_identifier) @cls_name) @cls_node',
|
|
73
|
+
// class expressions: `return class Foo extends Bar { ... }`
|
|
74
|
+
'(class name: (type_identifier) @cls_name) @cls_node',
|
|
75
|
+
'(interface_declaration name: (type_identifier) @iface_name) @iface_node',
|
|
76
|
+
'(type_alias_declaration name: (type_identifier) @type_name) @type_node',
|
|
77
|
+
];
|
|
78
|
+
/**
|
|
79
|
+
* Load a single language grammar and cache the parser + language + query.
|
|
80
|
+
* Uses in-flight deduplication so concurrent callers awaiting the same grammar
|
|
81
|
+
* share a single load rather than producing orphaned WASM instances.
|
|
82
|
+
* Assumes Parser.init() has already been called and _cachedParsers/_cachedLanguages exist.
|
|
83
|
+
*/
|
|
84
|
+
async function loadLanguage(entry) {
|
|
85
|
+
if (_cachedParsers.has(entry.id))
|
|
86
|
+
return;
|
|
87
|
+
const inflight = _loadingPromises.get(entry.id);
|
|
88
|
+
if (inflight)
|
|
89
|
+
return inflight;
|
|
90
|
+
const p = doLoadLanguage(entry).finally(() => _loadingPromises.delete(entry.id));
|
|
91
|
+
_loadingPromises.set(entry.id, p);
|
|
92
|
+
return p;
|
|
93
|
+
}
|
|
94
|
+
async function doLoadLanguage(entry) {
|
|
95
|
+
try {
|
|
96
|
+
const lang = await Language.load(grammarPath(entry.grammarFile));
|
|
97
|
+
const parser = new Parser();
|
|
98
|
+
parser.setLanguage(lang);
|
|
99
|
+
_cachedParsers.set(entry.id, parser);
|
|
100
|
+
_cachedLanguages.set(entry.id, lang);
|
|
101
|
+
if (entry.extractor === extractSymbols && !_queryCache.has(entry.id)) {
|
|
102
|
+
const isTS = entry.id === 'typescript' || entry.id === 'tsx';
|
|
103
|
+
const patterns = isTS
|
|
104
|
+
? [...COMMON_QUERY_PATTERNS, ...TS_EXTRA_PATTERNS]
|
|
105
|
+
: [...COMMON_QUERY_PATTERNS, ...JS_CLASS_PATTERNS];
|
|
106
|
+
_queryCache.set(entry.id, new Query(lang, patterns.join('\n')));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (e) {
|
|
110
|
+
if (entry.required)
|
|
111
|
+
throw new ParseError(`Required parser ${entry.id} failed to initialize`, {
|
|
112
|
+
file: entry.grammarFile,
|
|
113
|
+
cause: e,
|
|
114
|
+
});
|
|
115
|
+
const isEnoent = e.code === 'ENOENT';
|
|
116
|
+
const log = isEnoent ? debug : warn;
|
|
117
|
+
log(`${entry.id} parser failed to initialize: ${e.message}. ${entry.id} files will be skipped.`);
|
|
118
|
+
_cachedParsers.set(entry.id, null);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async function initParserRuntime() {
|
|
122
|
+
if (!_initialized) {
|
|
123
|
+
await Parser.init();
|
|
124
|
+
_initialized = true;
|
|
125
|
+
}
|
|
126
|
+
if (!_cachedParsers)
|
|
127
|
+
_cachedParsers = new Map();
|
|
128
|
+
if (!_cachedLanguages)
|
|
129
|
+
_cachedLanguages = new Map();
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Load only the WASM grammars needed for the given file paths.
|
|
133
|
+
* Grammars already in cache are reused. This avoids the ~500ms cold-start
|
|
134
|
+
* penalty of loading all 23+ grammars when only 1-2 are needed (e.g. incremental rebuilds).
|
|
135
|
+
*/
|
|
136
|
+
async function ensureParsersForFiles(filePaths) {
|
|
137
|
+
await initParserRuntime();
|
|
138
|
+
const needed = new Set();
|
|
139
|
+
for (const fp of filePaths) {
|
|
140
|
+
const ext = path.extname(fp).toLowerCase();
|
|
141
|
+
const entry = _extToLang.get(ext);
|
|
142
|
+
if (entry && !_cachedParsers.has(entry.id))
|
|
143
|
+
needed.add(entry);
|
|
144
|
+
}
|
|
145
|
+
for (const entry of needed) {
|
|
146
|
+
await loadLanguage(entry);
|
|
147
|
+
}
|
|
148
|
+
return _cachedParsers;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Load ALL WASM grammars. Used by full builds and feature modules (CFG, dataflow, complexity)
|
|
152
|
+
* that may process files of any language.
|
|
153
|
+
*/
|
|
154
|
+
export async function createParsers() {
|
|
155
|
+
if (_cachedParsers && _allParsersLoaded)
|
|
156
|
+
return _cachedParsers;
|
|
157
|
+
await initParserRuntime();
|
|
158
|
+
for (const entry of LANGUAGE_REGISTRY) {
|
|
159
|
+
if (!_cachedParsers.has(entry.id)) {
|
|
160
|
+
await loadLanguage(entry);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
_allParsersLoaded = true;
|
|
164
|
+
return _cachedParsers;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Dispose all cached WASM parsers and queries to free WASM linear memory.
|
|
168
|
+
* Call this between repeated builds in the same process (e.g. benchmarks)
|
|
169
|
+
* to prevent memory accumulation that can cause segfaults.
|
|
170
|
+
*/
|
|
171
|
+
function disposeMapEntries(entries, label) {
|
|
172
|
+
for (const [id, item] of entries) {
|
|
173
|
+
if (item && typeof item.delete === 'function') {
|
|
174
|
+
try {
|
|
175
|
+
item.delete();
|
|
176
|
+
}
|
|
177
|
+
catch (e) {
|
|
178
|
+
debug(`Failed to dispose ${label} ${id}: ${e.message}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export async function disposeParsers() {
|
|
184
|
+
if (_cachedParsers) {
|
|
185
|
+
disposeMapEntries(_cachedParsers, 'parser');
|
|
186
|
+
_cachedParsers = null;
|
|
187
|
+
}
|
|
188
|
+
disposeMapEntries(_queryCache, 'query');
|
|
189
|
+
_queryCache.clear();
|
|
190
|
+
if (_cachedLanguages) {
|
|
191
|
+
disposeMapEntries(_cachedLanguages, 'language');
|
|
192
|
+
_cachedLanguages = null;
|
|
193
|
+
}
|
|
194
|
+
_initialized = false;
|
|
195
|
+
_allParsersLoaded = false;
|
|
196
|
+
_loadingPromises.clear();
|
|
197
|
+
await disposeWasmWorkerPool();
|
|
198
|
+
}
|
|
199
|
+
export function getParser(parsers, filePath) {
|
|
200
|
+
const ext = path.extname(filePath);
|
|
201
|
+
const entry = _extToLang.get(ext);
|
|
202
|
+
if (!entry)
|
|
203
|
+
return null;
|
|
204
|
+
return parsers.get(entry.id) || null;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Backfill missing AST-analysis data (astNodes, dataflow, def.complexity,
|
|
208
|
+
* def.cfg) via the WASM worker pool for files that were parsed by the native
|
|
209
|
+
* engine but are missing one or more analyses.
|
|
210
|
+
*
|
|
211
|
+
* Historically this function populated `symbols._tree` so the main-thread
|
|
212
|
+
* visitor walk in `ast-analysis/engine.ts` could run. After the worker-isolation
|
|
213
|
+
* refactor (#965), the worker runs every visitor itself and returns pre-computed
|
|
214
|
+
* analysis data — `_tree` is never set on the main thread.
|
|
215
|
+
*
|
|
216
|
+
* Name is preserved for caller compatibility; the function now ensures
|
|
217
|
+
* *analysis data* rather than *trees*.
|
|
218
|
+
*
|
|
219
|
+
* `needsFn` (optional): when provided, only files for which it returns true are
|
|
220
|
+
* re-parsed. Without it the function falls back to "any WASM-parseable file
|
|
221
|
+
* without _tree", which was the source of #1036 — a single file missing one
|
|
222
|
+
* analysis triggered a full-build re-parse of every WASM-parseable file.
|
|
223
|
+
*/
|
|
224
|
+
/**
|
|
225
|
+
* Select files from `fileSymbols` that still need analysis data and are
|
|
226
|
+
* parseable by an installed WASM grammar. Pure (no I/O) — safe to unit-test.
|
|
227
|
+
*/
|
|
228
|
+
function collectBackfillPending(fileSymbols, rootDir, needsFn) {
|
|
229
|
+
const pending = [];
|
|
230
|
+
for (const [relPath, symbols] of fileSymbols) {
|
|
231
|
+
if (symbols._tree)
|
|
232
|
+
continue; // legacy path — leave existing trees alone
|
|
233
|
+
if (!_extToLang.has(path.extname(relPath).toLowerCase()))
|
|
234
|
+
continue;
|
|
235
|
+
if (needsFn && !needsFn(relPath, symbols))
|
|
236
|
+
continue;
|
|
237
|
+
pending.push({ relPath, absPath: path.join(rootDir, relPath), symbols });
|
|
238
|
+
}
|
|
239
|
+
return pending;
|
|
240
|
+
}
|
|
241
|
+
export async function ensureWasmTrees(fileSymbols, rootDir, needsFn) {
|
|
242
|
+
const pending = collectBackfillPending(fileSymbols, rootDir, needsFn);
|
|
243
|
+
if (pending.length === 0)
|
|
244
|
+
return;
|
|
245
|
+
const pool = getWasmWorkerPool();
|
|
246
|
+
for (const { relPath, absPath, symbols } of pending) {
|
|
247
|
+
let code;
|
|
248
|
+
try {
|
|
249
|
+
code = fs.readFileSync(absPath, 'utf-8');
|
|
250
|
+
}
|
|
251
|
+
catch (e) {
|
|
252
|
+
debug(`ensureWasmTrees: cannot read ${relPath}: ${e.message}`);
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
const output = await pool.parse(absPath, code, FULL_ANALYSIS);
|
|
256
|
+
if (!output)
|
|
257
|
+
continue; // worker crashed or returned null — skip silently
|
|
258
|
+
mergeAnalysisData(symbols, output);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
/** Fill gap-only scalar metadata (`_langId`, `_lineCount`) from the worker output. */
|
|
262
|
+
function mergeScalarMetadata(symbols, worker) {
|
|
263
|
+
if (!symbols._langId && worker._langId)
|
|
264
|
+
symbols._langId = worker._langId;
|
|
265
|
+
if (!symbols._lineCount && worker._lineCount)
|
|
266
|
+
symbols._lineCount = worker._lineCount;
|
|
267
|
+
}
|
|
268
|
+
/** Fill gap-only analysis arrays (`astNodes`, `dataflow`) from the worker output. */
|
|
269
|
+
function mergeAnalysisArrays(symbols, worker) {
|
|
270
|
+
if (!Array.isArray(symbols.astNodes) && Array.isArray(worker.astNodes)) {
|
|
271
|
+
symbols.astNodes = worker.astNodes;
|
|
272
|
+
}
|
|
273
|
+
if (!symbols.dataflow && worker.dataflow)
|
|
274
|
+
symbols.dataflow = worker.dataflow;
|
|
275
|
+
}
|
|
276
|
+
/** Merge worker typeMap into existing symbols.typeMap with first-wins semantics. */
|
|
277
|
+
function mergeTypeMap(symbols, worker) {
|
|
278
|
+
if (!worker.typeMap || worker.typeMap.size === 0)
|
|
279
|
+
return;
|
|
280
|
+
if (!symbols.typeMap || !(symbols.typeMap instanceof Map)) {
|
|
281
|
+
symbols.typeMap = new Map(worker.typeMap);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
for (const [k, v] of worker.typeMap) {
|
|
285
|
+
if (!symbols.typeMap.has(k))
|
|
286
|
+
symbols.typeMap.set(k, v);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
/** Patch existing definitions with worker complexity/cfg when absent. */
|
|
290
|
+
function mergeDefinitionAnalysis(symbols, worker) {
|
|
291
|
+
const existingDefs = Array.isArray(symbols.definitions) ? symbols.definitions : [];
|
|
292
|
+
const workerDefs = Array.isArray(worker.definitions) ? worker.definitions : [];
|
|
293
|
+
if (existingDefs.length === 0 || workerDefs.length === 0)
|
|
294
|
+
return;
|
|
295
|
+
// Index existing defs by (kind, name, line) — mirrors engine.ts matching key.
|
|
296
|
+
const byKey = new Map();
|
|
297
|
+
for (const d of existingDefs)
|
|
298
|
+
byKey.set(`${d.kind}|${d.name}|${d.line}`, d);
|
|
299
|
+
for (const wd of workerDefs) {
|
|
300
|
+
const existing = byKey.get(`${wd.kind}|${wd.name}|${wd.line}`);
|
|
301
|
+
if (!existing)
|
|
302
|
+
continue;
|
|
303
|
+
if (!existing.complexity && wd.complexity)
|
|
304
|
+
existing.complexity = wd.complexity;
|
|
305
|
+
if ((!existing.cfg || !Array.isArray(existing.cfg.blocks)) && wd.cfg?.blocks) {
|
|
306
|
+
existing.cfg = wd.cfg;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Merge pre-computed analysis data from a worker result onto existing symbols.
|
|
312
|
+
* Only fills gaps — never overwrites fields the caller already populated.
|
|
313
|
+
* Used to patch native-parsed symbols with worker-produced astNodes / dataflow /
|
|
314
|
+
* per-definition complexity and cfg.
|
|
315
|
+
*/
|
|
316
|
+
function mergeAnalysisData(symbols, worker) {
|
|
317
|
+
mergeScalarMetadata(symbols, worker);
|
|
318
|
+
mergeAnalysisArrays(symbols, worker);
|
|
319
|
+
mergeTypeMap(symbols, worker);
|
|
320
|
+
mergeDefinitionAnalysis(symbols, worker);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Check whether the required WASM grammar files exist on disk.
|
|
324
|
+
*/
|
|
325
|
+
export function isWasmAvailable() {
|
|
326
|
+
return LANGUAGE_REGISTRY.filter((e) => e.required).every((e) => fs.existsSync(grammarPath(e.grammarFile)));
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Return the set of lowercase file extensions whose WASM grammar is actually
|
|
330
|
+
* installed on disk. Used to scope engine-parity backfill to files that WASM
|
|
331
|
+
* can recover — languages without an installed grammar are skipped by both
|
|
332
|
+
* engines, so they don't represent a native-engine drop.
|
|
333
|
+
*
|
|
334
|
+
* Cached on first call; the grammars directory is shipped immutable.
|
|
335
|
+
*/
|
|
336
|
+
let _installedWasmExts = null;
|
|
337
|
+
export function getInstalledWasmExtensions() {
|
|
338
|
+
if (_installedWasmExts)
|
|
339
|
+
return _installedWasmExts;
|
|
340
|
+
const exts = new Set();
|
|
341
|
+
for (const entry of LANGUAGE_REGISTRY) {
|
|
342
|
+
if (fs.existsSync(grammarPath(entry.grammarFile))) {
|
|
343
|
+
for (const ext of entry.extensions)
|
|
344
|
+
exts.add(ext.toLowerCase());
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
_installedWasmExts = exts;
|
|
348
|
+
return exts;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Lowercase file extensions covered by the native Rust addon.
|
|
352
|
+
*
|
|
353
|
+
* Mirrors `LanguageKind::from_extension` in
|
|
354
|
+
* `crates/codegraph-core/src/domain/parser.rs`. Used to classify why the
|
|
355
|
+
* native orchestrator dropped a file: extensions outside this set are a
|
|
356
|
+
* legitimate parser limit (no Rust extractor exists), while extensions inside
|
|
357
|
+
* it indicate a real native bug (parse/read/extract failure).
|
|
358
|
+
*
|
|
359
|
+
* Keep this list in sync with the Rust enum — the native addon is a separate
|
|
360
|
+
* npm package, so JS has no runtime way to discover its language coverage.
|
|
361
|
+
*/
|
|
362
|
+
export const NATIVE_SUPPORTED_EXTENSIONS = new Set([
|
|
363
|
+
'.js',
|
|
364
|
+
'.jsx',
|
|
365
|
+
'.mjs',
|
|
366
|
+
'.cjs',
|
|
367
|
+
'.ts',
|
|
368
|
+
'.tsx',
|
|
369
|
+
'.py',
|
|
370
|
+
'.pyi',
|
|
371
|
+
'.tf',
|
|
372
|
+
'.hcl',
|
|
373
|
+
'.go',
|
|
374
|
+
'.rs',
|
|
375
|
+
'.java',
|
|
376
|
+
'.cs',
|
|
377
|
+
'.rb',
|
|
378
|
+
'.rake',
|
|
379
|
+
'.gemspec',
|
|
380
|
+
'.php',
|
|
381
|
+
'.phtml',
|
|
382
|
+
'.c',
|
|
383
|
+
'.h',
|
|
384
|
+
'.cpp',
|
|
385
|
+
'.cc',
|
|
386
|
+
'.cxx',
|
|
387
|
+
'.hpp',
|
|
388
|
+
'.cu',
|
|
389
|
+
'.cuh',
|
|
390
|
+
'.kt',
|
|
391
|
+
'.kts',
|
|
392
|
+
'.swift',
|
|
393
|
+
'.scala',
|
|
394
|
+
'.sh',
|
|
395
|
+
'.bash',
|
|
396
|
+
'.ex',
|
|
397
|
+
'.exs',
|
|
398
|
+
'.lua',
|
|
399
|
+
'.dart',
|
|
400
|
+
'.zig',
|
|
401
|
+
'.hs',
|
|
402
|
+
'.ml',
|
|
403
|
+
'.mli',
|
|
404
|
+
'.fs',
|
|
405
|
+
'.fsx',
|
|
406
|
+
'.fsi',
|
|
407
|
+
'.m',
|
|
408
|
+
'.gleam',
|
|
409
|
+
'.jl',
|
|
410
|
+
'.clj',
|
|
411
|
+
'.cljs',
|
|
412
|
+
'.cljc',
|
|
413
|
+
'.erl',
|
|
414
|
+
'.hrl',
|
|
415
|
+
'.groovy',
|
|
416
|
+
'.gvy',
|
|
417
|
+
'.r',
|
|
418
|
+
'.sol',
|
|
419
|
+
'.v',
|
|
420
|
+
'.sv',
|
|
421
|
+
]);
|
|
422
|
+
/**
|
|
423
|
+
* Group the missing files (relative paths) by drop reason and extension so the
|
|
424
|
+
* caller can log per-extension counts and a sample path. Pure function — no
|
|
425
|
+
* I/O, safe to unit-test independently of the build pipeline.
|
|
426
|
+
*/
|
|
427
|
+
export function classifyNativeDrops(relPaths) {
|
|
428
|
+
const byReason = {
|
|
429
|
+
'unsupported-by-native': new Map(),
|
|
430
|
+
'native-extractor-failure': new Map(),
|
|
431
|
+
};
|
|
432
|
+
const totals = {
|
|
433
|
+
'unsupported-by-native': 0,
|
|
434
|
+
'native-extractor-failure': 0,
|
|
435
|
+
};
|
|
436
|
+
for (const rel of relPaths) {
|
|
437
|
+
const ext = path.extname(rel).toLowerCase();
|
|
438
|
+
const reason = NATIVE_SUPPORTED_EXTENSIONS.has(ext)
|
|
439
|
+
? 'native-extractor-failure'
|
|
440
|
+
: 'unsupported-by-native';
|
|
441
|
+
const bucket = byReason[reason];
|
|
442
|
+
let list = bucket.get(ext);
|
|
443
|
+
if (!list) {
|
|
444
|
+
list = [];
|
|
445
|
+
bucket.set(ext, list);
|
|
446
|
+
}
|
|
447
|
+
list.push(rel);
|
|
448
|
+
totals[reason]++;
|
|
449
|
+
}
|
|
450
|
+
return { byReason, totals };
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Render `{ ext → paths[] }` as a multi-line tabular breakdown for log lines.
|
|
454
|
+
* Each extension occupies its own line so a long warning scans like a table
|
|
455
|
+
* instead of a wall of semicolon-separated slices. Caps at 3 sample paths per
|
|
456
|
+
* extension and 6 extensions total to keep output bounded when many languages
|
|
457
|
+
* are dropped at once. Extensions are sorted by descending file count so the
|
|
458
|
+
* loudest offender shows up first; ties keep insertion order.
|
|
459
|
+
*
|
|
460
|
+
* Returns the empty string for empty input, and otherwise a string that
|
|
461
|
+
* begins with `\n` so callers can append it directly after the header line
|
|
462
|
+
* (`"Backfilling via WASM:" + formatDropExtensionSummary(...)`).
|
|
463
|
+
*
|
|
464
|
+
* Pure function — safe to unit-test independently.
|
|
465
|
+
*/
|
|
466
|
+
export function formatDropExtensionSummary(buckets) {
|
|
467
|
+
const MAX_EXTS = 6;
|
|
468
|
+
const MAX_SAMPLES = 3;
|
|
469
|
+
const entries = Array.from(buckets.entries()).sort((a, b) => b[1].length - a[1].length);
|
|
470
|
+
if (entries.length === 0)
|
|
471
|
+
return '';
|
|
472
|
+
const shown = entries.slice(0, MAX_EXTS);
|
|
473
|
+
const extWidth = Math.max(...shown.map(([ext]) => ext.length));
|
|
474
|
+
const countWidth = Math.max(...shown.map(([, paths]) => String(paths.length).length));
|
|
475
|
+
const lines = shown.map(([ext, paths]) => {
|
|
476
|
+
const sample = paths.slice(0, MAX_SAMPLES).join(', ');
|
|
477
|
+
const more = paths.length > MAX_SAMPLES ? ` (+${paths.length - MAX_SAMPLES} more)` : '';
|
|
478
|
+
return ` ${ext.padEnd(extWidth)} ${String(paths.length).padStart(countWidth)} ${sample}${more}`;
|
|
479
|
+
});
|
|
480
|
+
if (entries.length > MAX_EXTS) {
|
|
481
|
+
lines.push(` (+${entries.length - MAX_EXTS} more extension(s))`);
|
|
482
|
+
}
|
|
483
|
+
return `\n${lines.join('\n')}`;
|
|
484
|
+
}
|
|
485
|
+
// ── Unified API ──────────────────────────────────────────────────────────────
|
|
486
|
+
function resolveEngine(opts = {}) {
|
|
487
|
+
const pref = opts.engine || 'auto';
|
|
488
|
+
if (pref === 'wasm')
|
|
489
|
+
return { name: 'wasm', native: null };
|
|
490
|
+
if (pref === 'native' || pref === 'auto') {
|
|
491
|
+
const native = loadNative();
|
|
492
|
+
if (native)
|
|
493
|
+
return { name: 'native', native };
|
|
494
|
+
if (pref === 'native') {
|
|
495
|
+
getNative(); // throws with detailed error + install instructions
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return { name: 'wasm', native: null };
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Patch native engine output in-place for the few remaining semantic transforms.
|
|
502
|
+
* With #[napi(js_name)] on Rust types, most fields already arrive as camelCase.
|
|
503
|
+
* This only handles:
|
|
504
|
+
* - _lineCount compat for builder.js
|
|
505
|
+
* - Backward compat for older native binaries missing js_name annotations
|
|
506
|
+
* - dataflow argFlows/mutations bindingType -> binding wrapper
|
|
507
|
+
*/
|
|
508
|
+
/** Patch definition fields for backward compat with older native binaries. */
|
|
509
|
+
function patchDefinitions(definitions) {
|
|
510
|
+
for (const d of definitions) {
|
|
511
|
+
if (d.endLine === undefined && d.end_line !== undefined) {
|
|
512
|
+
d.endLine = d.end_line;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Field renames applied to each import record to bridge older native binaries
|
|
518
|
+
* that emit snake_case names. Each `[camel, snake]` pair becomes:
|
|
519
|
+
* `if (imp[camel] === undefined) imp[camel] = imp[snake];`
|
|
520
|
+
* Defined as data so the loop body stays trivially linear in cognitive complexity.
|
|
521
|
+
*/
|
|
522
|
+
const IMPORT_FIELD_RENAMES = [
|
|
523
|
+
['typeOnly', 'type_only'],
|
|
524
|
+
['wildcardReexport', 'wildcard_reexport'],
|
|
525
|
+
['pythonImport', 'python_import'],
|
|
526
|
+
['goImport', 'go_import'],
|
|
527
|
+
['rustUse', 'rust_use'],
|
|
528
|
+
['javaImport', 'java_import'],
|
|
529
|
+
['csharpUsing', 'csharp_using'],
|
|
530
|
+
['rubyRequire', 'ruby_require'],
|
|
531
|
+
['phpUse', 'php_use'],
|
|
532
|
+
['cInclude', 'c_include'],
|
|
533
|
+
['kotlinImport', 'kotlin_import'],
|
|
534
|
+
['swiftImport', 'swift_import'],
|
|
535
|
+
['scalaImport', 'scala_import'],
|
|
536
|
+
['bashSource', 'bash_source'],
|
|
537
|
+
['dynamicImport', 'dynamic_import'],
|
|
538
|
+
];
|
|
539
|
+
/** Patch import fields for backward compat with older native binaries. */
|
|
540
|
+
function patchImports(imports) {
|
|
541
|
+
for (const i of imports) {
|
|
542
|
+
for (const [camel, snake] of IMPORT_FIELD_RENAMES) {
|
|
543
|
+
if (i[camel] === undefined)
|
|
544
|
+
i[camel] = i[snake];
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
/** Normalize native typeMap array to a Map instance.
|
|
549
|
+
* Uses first-wins semantics at equal confidence to match the WASM/JS extractor. */
|
|
550
|
+
function patchTypeMap(r) {
|
|
551
|
+
if (!r.typeMap) {
|
|
552
|
+
r.typeMap = new Map();
|
|
553
|
+
}
|
|
554
|
+
else if (!(r.typeMap instanceof Map)) {
|
|
555
|
+
const map = new Map();
|
|
556
|
+
for (const e of r.typeMap) {
|
|
557
|
+
if (!map.has(e.name)) {
|
|
558
|
+
map.set(e.name, { type: e.typeName, confidence: e.confidence ?? 0.9 });
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
r.typeMap = map;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
/** Normalize native returnTypeMap array to a Map instance, keeping highest-confidence entry per key. */
|
|
565
|
+
function patchReturnTypeMap(r) {
|
|
566
|
+
if (!r.returnTypeMap || r.returnTypeMap instanceof Map)
|
|
567
|
+
return;
|
|
568
|
+
const map = new Map();
|
|
569
|
+
for (const e of r.returnTypeMap) {
|
|
570
|
+
const conf = e.confidence ?? 1.0;
|
|
571
|
+
const existing = map.get(e.name);
|
|
572
|
+
if (!existing || conf > existing.confidence) {
|
|
573
|
+
map.set(e.name, { type: e.typeName, confidence: conf });
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
r.returnTypeMap = map.size > 0 ? map : new Map();
|
|
577
|
+
}
|
|
578
|
+
/** Wrap bindingType into binding object for dataflow argFlows and mutations. */
|
|
579
|
+
/**
|
|
580
|
+
* Normalise a DataflowResult from the native Rust extractor to the VisitorArgFlow
|
|
581
|
+
* shape expected by the TypeScript dataflow analysis layer.
|
|
582
|
+
*
|
|
583
|
+
* The Rust `DataflowArgFlow` emits `bindingType: string | null` as a flat field.
|
|
584
|
+
* The TS analysis layer (`buildDataflowVerticesAndEdges`, `collectCallerStitchCandidates`)
|
|
585
|
+
* expects `binding: { type: string; index?: number }` on each argFlow/mutation entry.
|
|
586
|
+
* This normalisation must be applied whenever `extractDataflowAnalysis` is called
|
|
587
|
+
* outside the standard `patchNativeResult` pipeline.
|
|
588
|
+
*/
|
|
589
|
+
export function patchDataflowResult(dataflow) {
|
|
590
|
+
if (dataflow.argFlows) {
|
|
591
|
+
for (const f of dataflow.argFlows) {
|
|
592
|
+
f.binding = f.bindingType ? { type: f.bindingType } : null;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
if (dataflow.mutations) {
|
|
596
|
+
for (const m of dataflow.mutations) {
|
|
597
|
+
m.binding = m.bindingType ? { type: m.bindingType } : null;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
function patchNativeResult(r) {
|
|
602
|
+
// lineCount: napi(js_name) emits "lineCount"; older binaries may emit "line_count"
|
|
603
|
+
r.lineCount = r.lineCount ?? r.line_count ?? null;
|
|
604
|
+
r._lineCount = r.lineCount;
|
|
605
|
+
if (r.definitions)
|
|
606
|
+
patchDefinitions(r.definitions);
|
|
607
|
+
if (r.imports)
|
|
608
|
+
patchImports(r.imports);
|
|
609
|
+
patchTypeMap(r);
|
|
610
|
+
patchReturnTypeMap(r);
|
|
611
|
+
if (r.dataflow)
|
|
612
|
+
patchDataflowResult(r.dataflow);
|
|
613
|
+
return r;
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Declarative registry of all supported languages.
|
|
617
|
+
* Adding a new language requires only a new entry here + its extractor function.
|
|
618
|
+
*/
|
|
619
|
+
export const LANGUAGE_REGISTRY = [
|
|
620
|
+
{
|
|
621
|
+
id: 'javascript',
|
|
622
|
+
extensions: ['.js', '.jsx', '.mjs', '.cjs'],
|
|
623
|
+
grammarFile: 'tree-sitter-javascript.wasm',
|
|
624
|
+
extractor: extractSymbols,
|
|
625
|
+
required: true,
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
id: 'typescript',
|
|
629
|
+
extensions: ['.ts'],
|
|
630
|
+
grammarFile: 'tree-sitter-typescript.wasm',
|
|
631
|
+
extractor: extractSymbols,
|
|
632
|
+
required: true,
|
|
633
|
+
},
|
|
634
|
+
{
|
|
635
|
+
id: 'tsx',
|
|
636
|
+
extensions: ['.tsx'],
|
|
637
|
+
grammarFile: 'tree-sitter-tsx.wasm',
|
|
638
|
+
extractor: extractSymbols,
|
|
639
|
+
required: true,
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
id: 'hcl',
|
|
643
|
+
extensions: ['.tf', '.hcl'],
|
|
644
|
+
grammarFile: 'tree-sitter-hcl.wasm',
|
|
645
|
+
extractor: extractHCLSymbols,
|
|
646
|
+
required: false,
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
id: 'python',
|
|
650
|
+
extensions: ['.py', '.pyi'],
|
|
651
|
+
grammarFile: 'tree-sitter-python.wasm',
|
|
652
|
+
extractor: extractPythonSymbols,
|
|
653
|
+
required: false,
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
id: 'go',
|
|
657
|
+
extensions: ['.go'],
|
|
658
|
+
grammarFile: 'tree-sitter-go.wasm',
|
|
659
|
+
extractor: extractGoSymbols,
|
|
660
|
+
required: false,
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
id: 'rust',
|
|
664
|
+
extensions: ['.rs'],
|
|
665
|
+
grammarFile: 'tree-sitter-rust.wasm',
|
|
666
|
+
extractor: extractRustSymbols,
|
|
667
|
+
required: false,
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
id: 'java',
|
|
671
|
+
extensions: ['.java'],
|
|
672
|
+
grammarFile: 'tree-sitter-java.wasm',
|
|
673
|
+
extractor: extractJavaSymbols,
|
|
674
|
+
required: false,
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
id: 'csharp',
|
|
678
|
+
extensions: ['.cs'],
|
|
679
|
+
grammarFile: 'tree-sitter-c_sharp.wasm',
|
|
680
|
+
extractor: extractCSharpSymbols,
|
|
681
|
+
required: false,
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
id: 'ruby',
|
|
685
|
+
extensions: ['.rb', '.rake', '.gemspec'],
|
|
686
|
+
grammarFile: 'tree-sitter-ruby.wasm',
|
|
687
|
+
extractor: extractRubySymbols,
|
|
688
|
+
required: false,
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
id: 'php',
|
|
692
|
+
extensions: ['.php', '.phtml'],
|
|
693
|
+
grammarFile: 'tree-sitter-php.wasm',
|
|
694
|
+
extractor: extractPHPSymbols,
|
|
695
|
+
required: false,
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
id: 'c',
|
|
699
|
+
extensions: ['.c', '.h'],
|
|
700
|
+
grammarFile: 'tree-sitter-c.wasm',
|
|
701
|
+
extractor: extractCSymbols,
|
|
702
|
+
required: false,
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
id: 'cpp',
|
|
706
|
+
extensions: ['.cpp', '.cc', '.cxx', '.hpp'],
|
|
707
|
+
grammarFile: 'tree-sitter-cpp.wasm',
|
|
708
|
+
extractor: extractCppSymbols,
|
|
709
|
+
required: false,
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
id: 'kotlin',
|
|
713
|
+
extensions: ['.kt', '.kts'],
|
|
714
|
+
grammarFile: 'tree-sitter-kotlin.wasm',
|
|
715
|
+
extractor: extractKotlinSymbols,
|
|
716
|
+
required: false,
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
id: 'swift',
|
|
720
|
+
extensions: ['.swift'],
|
|
721
|
+
grammarFile: 'tree-sitter-swift.wasm',
|
|
722
|
+
extractor: extractSwiftSymbols,
|
|
723
|
+
required: false,
|
|
724
|
+
},
|
|
725
|
+
{
|
|
726
|
+
id: 'scala',
|
|
727
|
+
extensions: ['.scala'],
|
|
728
|
+
grammarFile: 'tree-sitter-scala.wasm',
|
|
729
|
+
extractor: extractScalaSymbols,
|
|
730
|
+
required: false,
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
id: 'bash',
|
|
734
|
+
extensions: ['.sh', '.bash'],
|
|
735
|
+
grammarFile: 'tree-sitter-bash.wasm',
|
|
736
|
+
extractor: extractBashSymbols,
|
|
737
|
+
required: false,
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
id: 'elixir',
|
|
741
|
+
extensions: ['.ex', '.exs'],
|
|
742
|
+
grammarFile: 'tree-sitter-elixir.wasm',
|
|
743
|
+
extractor: extractElixirSymbols,
|
|
744
|
+
required: false,
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
id: 'lua',
|
|
748
|
+
extensions: ['.lua'],
|
|
749
|
+
grammarFile: 'tree-sitter-lua.wasm',
|
|
750
|
+
extractor: extractLuaSymbols,
|
|
751
|
+
required: false,
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
id: 'dart',
|
|
755
|
+
extensions: ['.dart'],
|
|
756
|
+
grammarFile: 'tree-sitter-dart.wasm',
|
|
757
|
+
extractor: extractDartSymbols,
|
|
758
|
+
required: false,
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
id: 'zig',
|
|
762
|
+
extensions: ['.zig'],
|
|
763
|
+
grammarFile: 'tree-sitter-zig.wasm',
|
|
764
|
+
extractor: extractZigSymbols,
|
|
765
|
+
required: false,
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
id: 'haskell',
|
|
769
|
+
extensions: ['.hs'],
|
|
770
|
+
grammarFile: 'tree-sitter-haskell.wasm',
|
|
771
|
+
extractor: extractHaskellSymbols,
|
|
772
|
+
required: false,
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: 'ocaml',
|
|
776
|
+
extensions: ['.ml'],
|
|
777
|
+
grammarFile: 'tree-sitter-ocaml.wasm',
|
|
778
|
+
extractor: extractOCamlSymbols,
|
|
779
|
+
required: false,
|
|
780
|
+
},
|
|
781
|
+
{
|
|
782
|
+
id: 'ocaml-interface',
|
|
783
|
+
extensions: ['.mli'],
|
|
784
|
+
grammarFile: 'tree-sitter-ocaml_interface.wasm',
|
|
785
|
+
extractor: extractOCamlSymbols,
|
|
786
|
+
required: false,
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
id: 'fsharp',
|
|
790
|
+
extensions: ['.fs', '.fsx'],
|
|
791
|
+
grammarFile: 'tree-sitter-fsharp.wasm',
|
|
792
|
+
extractor: extractFSharpSymbols,
|
|
793
|
+
required: false,
|
|
794
|
+
},
|
|
795
|
+
{
|
|
796
|
+
id: 'fsharp-signature',
|
|
797
|
+
extensions: ['.fsi'],
|
|
798
|
+
grammarFile: 'tree-sitter-fsharp_signature.wasm',
|
|
799
|
+
extractor: extractFSharpSymbols,
|
|
800
|
+
required: false,
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
id: 'gleam',
|
|
804
|
+
extensions: ['.gleam'],
|
|
805
|
+
grammarFile: 'tree-sitter-gleam.wasm',
|
|
806
|
+
extractor: extractGleamSymbols,
|
|
807
|
+
required: false,
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
id: 'clojure',
|
|
811
|
+
extensions: ['.clj', '.cljs', '.cljc'],
|
|
812
|
+
grammarFile: 'tree-sitter-clojure.wasm',
|
|
813
|
+
extractor: extractClojureSymbols,
|
|
814
|
+
required: false,
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
id: 'julia',
|
|
818
|
+
extensions: ['.jl'],
|
|
819
|
+
grammarFile: 'tree-sitter-julia.wasm',
|
|
820
|
+
extractor: extractJuliaSymbols,
|
|
821
|
+
required: false,
|
|
822
|
+
},
|
|
823
|
+
{
|
|
824
|
+
id: 'r',
|
|
825
|
+
extensions: ['.r', '.R'],
|
|
826
|
+
grammarFile: 'tree-sitter-r.wasm',
|
|
827
|
+
extractor: extractRSymbols,
|
|
828
|
+
required: false,
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
id: 'erlang',
|
|
832
|
+
extensions: ['.erl', '.hrl'],
|
|
833
|
+
grammarFile: 'tree-sitter-erlang.wasm',
|
|
834
|
+
extractor: extractErlangSymbols,
|
|
835
|
+
required: false,
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
id: 'solidity',
|
|
839
|
+
extensions: ['.sol'],
|
|
840
|
+
grammarFile: 'tree-sitter-solidity.wasm',
|
|
841
|
+
extractor: extractSoliditySymbols,
|
|
842
|
+
required: false,
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
id: 'objc',
|
|
846
|
+
extensions: ['.m'],
|
|
847
|
+
grammarFile: 'tree-sitter-objc.wasm',
|
|
848
|
+
extractor: extractObjCSymbols,
|
|
849
|
+
required: false,
|
|
850
|
+
},
|
|
851
|
+
{
|
|
852
|
+
id: 'cuda',
|
|
853
|
+
extensions: ['.cu', '.cuh'],
|
|
854
|
+
grammarFile: 'tree-sitter-cuda.wasm',
|
|
855
|
+
extractor: extractCudaSymbols,
|
|
856
|
+
required: false,
|
|
857
|
+
},
|
|
858
|
+
{
|
|
859
|
+
id: 'groovy',
|
|
860
|
+
extensions: ['.groovy', '.gvy'],
|
|
861
|
+
grammarFile: 'tree-sitter-groovy.wasm',
|
|
862
|
+
extractor: extractGroovySymbols,
|
|
863
|
+
required: false,
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
id: 'verilog',
|
|
867
|
+
extensions: ['.v', '.sv'],
|
|
868
|
+
grammarFile: 'tree-sitter-verilog.wasm',
|
|
869
|
+
extractor: extractVerilogSymbols,
|
|
870
|
+
required: false,
|
|
871
|
+
},
|
|
872
|
+
];
|
|
873
|
+
const _extToLang = new Map();
|
|
874
|
+
for (const entry of LANGUAGE_REGISTRY) {
|
|
875
|
+
for (const ext of entry.extensions) {
|
|
876
|
+
_extToLang.set(ext, entry);
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
export const SUPPORTED_EXTENSIONS = new Set(_extToLang.keys());
|
|
880
|
+
/**
|
|
881
|
+
* WASM-based typeMap backfill for TS/TSX files parsed by the native engine.
|
|
882
|
+
* Serves two purposes:
|
|
883
|
+
* 1. Compatibility with older native binaries that don't emit typeMap (< 3.2.0).
|
|
884
|
+
* 2. Workaround for native parser scope-collision bugs — when the same variable
|
|
885
|
+
* name appears at multiple scopes, native type extraction can produce
|
|
886
|
+
* incorrect results. WASM's JS-based extractor handles scope traversal
|
|
887
|
+
* more accurately. TODO: Remove purpose (2) once the Rust extractor handles
|
|
888
|
+
* nested scopes correctly.
|
|
889
|
+
*
|
|
890
|
+
* Uses tree-sitter AST extraction instead of regex to avoid false positives from
|
|
891
|
+
* matches inside comments and string literals.
|
|
892
|
+
*/
|
|
893
|
+
async function backfillTypeMap(filePath, source) {
|
|
894
|
+
let code = source;
|
|
895
|
+
if (!code) {
|
|
896
|
+
try {
|
|
897
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
898
|
+
}
|
|
899
|
+
catch (e) {
|
|
900
|
+
debug(`backfillTypeMap: failed to read ${filePath}: ${toErrorMessage(e)}`);
|
|
901
|
+
return { typeMap: new Map(), backfilled: false };
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
const pool = getWasmWorkerPool();
|
|
905
|
+
// Extract-only — no visitor walk, we only need the typeMap from this pass.
|
|
906
|
+
const output = await pool.parse(filePath, code, EXTRACT_ONLY);
|
|
907
|
+
if (!output || output.typeMap.size === 0) {
|
|
908
|
+
return { typeMap: new Map(), backfilled: false };
|
|
909
|
+
}
|
|
910
|
+
return { typeMap: output.typeMap, backfilled: true };
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* WASM extraction helper: picks the right extractor based on file extension.
|
|
914
|
+
*/
|
|
915
|
+
function wasmExtractSymbols(parsers, filePath, code) {
|
|
916
|
+
const parser = getParser(parsers, filePath);
|
|
917
|
+
if (!parser)
|
|
918
|
+
return null;
|
|
919
|
+
let tree;
|
|
920
|
+
try {
|
|
921
|
+
tree = parser.parse(code);
|
|
922
|
+
}
|
|
923
|
+
catch (e) {
|
|
924
|
+
warn(`Parse error in ${filePath}: ${e.message}`);
|
|
925
|
+
return null;
|
|
926
|
+
}
|
|
927
|
+
if (!tree)
|
|
928
|
+
return null;
|
|
929
|
+
const ext = path.extname(filePath);
|
|
930
|
+
const entry = _extToLang.get(ext);
|
|
931
|
+
if (!entry)
|
|
932
|
+
return null;
|
|
933
|
+
const query = _queryCache.get(entry.id) ?? undefined;
|
|
934
|
+
// Query (web-tree-sitter) is structurally compatible with TreeSitterQuery at runtime
|
|
935
|
+
let symbols;
|
|
936
|
+
try {
|
|
937
|
+
symbols = entry.extractor(tree, filePath, query);
|
|
938
|
+
}
|
|
939
|
+
catch (e) {
|
|
940
|
+
warn(`Extractor error in ${filePath}: ${e.message}`);
|
|
941
|
+
// Free WASM tree to prevent memory leak — web-tree-sitter trees are backed
|
|
942
|
+
// by WASM linear memory and are not garbage-collected automatically.
|
|
943
|
+
if (typeof tree.delete === 'function')
|
|
944
|
+
tree.delete();
|
|
945
|
+
return null;
|
|
946
|
+
}
|
|
947
|
+
return symbols ? { symbols, tree, langId: entry.id } : null;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Parse a single file and return normalized symbols.
|
|
951
|
+
*/
|
|
952
|
+
export async function parseFileAuto(filePath, source, opts = {}) {
|
|
953
|
+
const { native } = resolveEngine(opts);
|
|
954
|
+
if (native) {
|
|
955
|
+
const result = native.parseFile(filePath, source, true, true);
|
|
956
|
+
if (!result)
|
|
957
|
+
return null;
|
|
958
|
+
const patched = patchNativeResult(result);
|
|
959
|
+
// Always backfill typeMap for TS/TSX from WASM — native parser's type
|
|
960
|
+
// extraction can produce incorrect scope-collision results. Non-TS files
|
|
961
|
+
// are skipped to stay consistent with the batch path (backfillTypeMapBatch).
|
|
962
|
+
if (TS_BACKFILL_EXTS.has(path.extname(filePath))) {
|
|
963
|
+
const { typeMap, backfilled } = await backfillTypeMap(filePath, source);
|
|
964
|
+
if (backfilled) {
|
|
965
|
+
patched.typeMap = typeMap;
|
|
966
|
+
patched._typeMapBackfilled = true;
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
return patched;
|
|
970
|
+
}
|
|
971
|
+
// WASM path — dispatch to isolated worker
|
|
972
|
+
const pool = getWasmWorkerPool();
|
|
973
|
+
return pool.parse(filePath, source, FULL_ANALYSIS);
|
|
974
|
+
}
|
|
975
|
+
/** Backfill typeMap via WASM for TS/TSX files parsed by the native engine. */
|
|
976
|
+
async function backfillTypeMapBatch(needsTypeMap, result) {
|
|
977
|
+
const tsFiles = needsTypeMap.filter(({ filePath }) => TS_BACKFILL_EXTS.has(path.extname(filePath)));
|
|
978
|
+
if (tsFiles.length === 0)
|
|
979
|
+
return;
|
|
980
|
+
const pool = getWasmWorkerPool();
|
|
981
|
+
for (const { filePath, relPath } of tsFiles) {
|
|
982
|
+
let code;
|
|
983
|
+
try {
|
|
984
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
985
|
+
}
|
|
986
|
+
catch (e) {
|
|
987
|
+
debug(`batchExtract: cannot read ${filePath}: ${toErrorMessage(e)}`);
|
|
988
|
+
continue;
|
|
989
|
+
}
|
|
990
|
+
const output = await pool.parse(filePath, code, EXTRACT_ONLY);
|
|
991
|
+
if (!output || output.typeMap.size === 0)
|
|
992
|
+
continue;
|
|
993
|
+
const symbols = result.get(relPath);
|
|
994
|
+
if (!symbols)
|
|
995
|
+
continue;
|
|
996
|
+
symbols.typeMap = output.typeMap;
|
|
997
|
+
symbols._typeMapBackfilled = true;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
/**
|
|
1001
|
+
* Parse files via WASM engine, returning a Map<relPath, symbols>.
|
|
1002
|
+
*
|
|
1003
|
+
* Each file is dispatched to the WASM worker pool. The worker parses, extracts,
|
|
1004
|
+
* and runs all AST analyses (complexity, CFG, dataflow, ast-store) in its own
|
|
1005
|
+
* thread, returning fully pre-computed ExtractorOutput. V8 fatal errors from
|
|
1006
|
+
* tree-sitter WASM (#965) kill only the worker — the pool skips the file and
|
|
1007
|
+
* restarts the worker for the next one.
|
|
1008
|
+
*
|
|
1009
|
+
* `_tree` is NEVER set by this path. All downstream analyses operate on the
|
|
1010
|
+
* pre-computed `astNodes` / `dataflow` / `def.complexity` / `def.cfg` fields.
|
|
1011
|
+
*/
|
|
1012
|
+
async function parseFilesWasm(filePaths, rootDir, analysis = FULL_ANALYSIS) {
|
|
1013
|
+
const result = new Map();
|
|
1014
|
+
const pool = getWasmWorkerPool();
|
|
1015
|
+
for (const filePath of filePaths) {
|
|
1016
|
+
if (!_extToLang.has(path.extname(filePath).toLowerCase()))
|
|
1017
|
+
continue;
|
|
1018
|
+
let code;
|
|
1019
|
+
try {
|
|
1020
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
1021
|
+
}
|
|
1022
|
+
catch (err) {
|
|
1023
|
+
warn(`Skipping ${path.relative(rootDir, filePath)}: ${err.message}`);
|
|
1024
|
+
continue;
|
|
1025
|
+
}
|
|
1026
|
+
const output = await pool.parse(filePath, code, analysis);
|
|
1027
|
+
if (output) {
|
|
1028
|
+
const relPath = path.relative(rootDir, filePath).split(path.sep).join('/');
|
|
1029
|
+
result.set(relPath, output);
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
return result;
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Files at or below this count use the inline parse path (no worker spawn).
|
|
1036
|
+
*
|
|
1037
|
+
* The worker pool exists for crash safety (#965): exotic (non-required) WASM
|
|
1038
|
+
* grammars can trigger uncatchable V8 fatal errors that would kill the main
|
|
1039
|
+
* process. Running them in a worker means only the worker dies; the pool
|
|
1040
|
+
* detects the exit, skips the file, respawns, and continues.
|
|
1041
|
+
*
|
|
1042
|
+
* JS/TS/TSX are required-tier grammars — they have never triggered the V8
|
|
1043
|
+
* fatal crash class and are safe to run inline. The primary hot caller
|
|
1044
|
+
* (this/super dispatch post-pass) exclusively handles JS/TS/TSX files and
|
|
1045
|
+
* measured ~55–64ms/file through the pool vs ~8–10ms/file inline (#1435);
|
|
1046
|
+
* IPC overhead scales linearly with file count, not amortised.
|
|
1047
|
+
*
|
|
1048
|
+
* The threshold is set high enough to keep typical this-dispatch batches
|
|
1049
|
+
* (≤ 18 files on the codegraph corpus) on the inline path, while still
|
|
1050
|
+
* routing truly large exotic-language drops (rare; typical HCL case is 4
|
|
1051
|
+
* files) through the pool for crash isolation. Exotic-language drops are
|
|
1052
|
+
* almost always well under this limit anyway, so they benefit from the
|
|
1053
|
+
* inline fast path too without meaningful crash risk increase.
|
|
1054
|
+
*/
|
|
1055
|
+
const INLINE_BACKFILL_THRESHOLD = 32;
|
|
1056
|
+
/**
|
|
1057
|
+
* Inline WASM parse (no worker) for small file batches.
|
|
1058
|
+
*
|
|
1059
|
+
* Used by the engine-parity backfill path when the native engine drops a
|
|
1060
|
+
* handful of files (typically test fixtures). The worker pool's per-call
|
|
1061
|
+
* IPC + grammar-init overhead can cost 1–2s on slow CI runners — for a
|
|
1062
|
+
* 4-file backfill, that dwarfs the ~10ms of actual parse work.
|
|
1063
|
+
*
|
|
1064
|
+
* Returns symbols with `_tree` set so `runAnalyses` can run AST/CFG/dataflow
|
|
1065
|
+
* visitors via the unified walker (mirrors how WASM-engine results behaved
|
|
1066
|
+
* before the worker pool was introduced), unless `symbolsOnly` is true — in
|
|
1067
|
+
* that case `_tree` is not set, skipping all analysis visitor walks. Use
|
|
1068
|
+
* `symbolsOnly` when only definitions/calls/typeMap are needed (e.g. the
|
|
1069
|
+
* this/super dispatch post-pass) to avoid the analysis overhead on the inline
|
|
1070
|
+
* path, matching the optimization already applied to the worker-pool path.
|
|
1071
|
+
*/
|
|
1072
|
+
async function parseFilesWasmInline(filePaths, rootDir, symbolsOnly = false) {
|
|
1073
|
+
const result = new Map();
|
|
1074
|
+
if (filePaths.length === 0)
|
|
1075
|
+
return result;
|
|
1076
|
+
const parsers = await ensureParsersForFiles(filePaths);
|
|
1077
|
+
for (const filePath of filePaths) {
|
|
1078
|
+
if (!_extToLang.has(path.extname(filePath).toLowerCase()))
|
|
1079
|
+
continue;
|
|
1080
|
+
let code;
|
|
1081
|
+
try {
|
|
1082
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
1083
|
+
}
|
|
1084
|
+
catch (err) {
|
|
1085
|
+
warn(`Skipping ${path.relative(rootDir, filePath)}: ${err.message}`);
|
|
1086
|
+
continue;
|
|
1087
|
+
}
|
|
1088
|
+
const extracted = wasmExtractSymbols(parsers, filePath, code);
|
|
1089
|
+
if (!extracted)
|
|
1090
|
+
continue;
|
|
1091
|
+
const relPath = path.relative(rootDir, filePath).split(path.sep).join('/');
|
|
1092
|
+
const symbols = extracted.symbols;
|
|
1093
|
+
// When symbolsOnly=true, skip setting _tree so runAnalyses does not run
|
|
1094
|
+
// AST/complexity/CFG/dataflow visitor walks — only definitions/calls/typeMap
|
|
1095
|
+
// are needed by callers like the this/super dispatch post-pass.
|
|
1096
|
+
if (!symbolsOnly) {
|
|
1097
|
+
symbols._tree = extracted.tree;
|
|
1098
|
+
}
|
|
1099
|
+
else if (typeof extracted.tree?.delete === 'function') {
|
|
1100
|
+
// Free the WASM-backed tree immediately — web-tree-sitter trees are backed
|
|
1101
|
+
// by WASM linear memory and require explicit disposal. When symbolsOnly is
|
|
1102
|
+
// true the tree is never stored anywhere, so we must delete it here to
|
|
1103
|
+
// avoid leaking WASM heap on every incremental rebuild.
|
|
1104
|
+
extracted.tree.delete();
|
|
1105
|
+
}
|
|
1106
|
+
symbols._langId = extracted.langId;
|
|
1107
|
+
result.set(relPath, symbols);
|
|
1108
|
+
}
|
|
1109
|
+
return result;
|
|
1110
|
+
}
|
|
1111
|
+
/**
|
|
1112
|
+
* Backfill helper: small batches use the inline (main-thread) path; larger
|
|
1113
|
+
* batches keep the worker-pool isolation against tree-sitter WASM crashes
|
|
1114
|
+
* (#965). See INLINE_BACKFILL_THRESHOLD for threshold rationale.
|
|
1115
|
+
*
|
|
1116
|
+
* `opts.symbolsOnly` skips the AST/complexity/CFG/dataflow visitors in the
|
|
1117
|
+
* worker (and their result serialization across the thread boundary) for
|
|
1118
|
+
* callers that only consume definitions/calls/typeMap — the native
|
|
1119
|
+
* orchestrator's this-dispatch post-pass. Callers that ingest the files into
|
|
1120
|
+
* the DB (dropped-language backfill) must keep
|
|
1121
|
+
* the default full analysis.
|
|
1122
|
+
*/
|
|
1123
|
+
export async function parseFilesWasmForBackfill(filePaths, rootDir, opts = {}) {
|
|
1124
|
+
if (filePaths.length <= INLINE_BACKFILL_THRESHOLD) {
|
|
1125
|
+
return parseFilesWasmInline(filePaths, rootDir, opts.symbolsOnly);
|
|
1126
|
+
}
|
|
1127
|
+
return parseFilesWasm(filePaths, rootDir, opts.symbolsOnly ? EXTRACT_ONLY : FULL_ANALYSIS);
|
|
1128
|
+
}
|
|
1129
|
+
/**
|
|
1130
|
+
* Run the native engine over `filePaths` and ingest the results into `result`.
|
|
1131
|
+
* Returns the set of file paths the native engine successfully parsed and the
|
|
1132
|
+
* TS/TSX files that need a typeMap backfill pass.
|
|
1133
|
+
*/
|
|
1134
|
+
function ingestNativeResults(native, filePaths, rootDir, result) {
|
|
1135
|
+
// Always extract all analysis data (dataflow + AST nodes) during native parse.
|
|
1136
|
+
// This eliminates the need for any downstream WASM re-parse or native standalone calls.
|
|
1137
|
+
const nativeResults = native.parseFilesFull
|
|
1138
|
+
? native.parseFilesFull(filePaths, rootDir)
|
|
1139
|
+
: native.parseFiles(filePaths, rootDir, true, true);
|
|
1140
|
+
const needsTypeMap = [];
|
|
1141
|
+
const nativeParsed = new Set();
|
|
1142
|
+
for (const r of nativeResults) {
|
|
1143
|
+
if (!r)
|
|
1144
|
+
continue;
|
|
1145
|
+
nativeParsed.add(r.file);
|
|
1146
|
+
const patched = patchNativeResult(r);
|
|
1147
|
+
const relPath = path.relative(rootDir, r.file).split(path.sep).join('/');
|
|
1148
|
+
result.set(relPath, patched);
|
|
1149
|
+
// Always backfill TS/TSX type maps from WASM — the native parser's type
|
|
1150
|
+
// extraction can produce incorrect results when the same variable name
|
|
1151
|
+
// appears at multiple scopes (e.g. `node: TreeSitterNode` in one function
|
|
1152
|
+
// vs `node: NodeRow` in another). The WASM JS extractor handles scope
|
|
1153
|
+
// traversal order more accurately.
|
|
1154
|
+
if (TS_BACKFILL_EXTS.has(path.extname(r.file))) {
|
|
1155
|
+
needsTypeMap.push({ filePath: r.file, relPath });
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
return { nativeParsed, needsTypeMap };
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Engine parity: native may silently drop files whose extensions are in
|
|
1162
|
+
* SUPPORTED_EXTENSIONS (because a WASM grammar exists) but whose Rust
|
|
1163
|
+
* extractor/grammar is missing or fails. WASM handles these — fall back so
|
|
1164
|
+
* both engines process the same file set (#967). Restrict to installed WASM
|
|
1165
|
+
* grammars so we don't warn about files that neither engine can parse.
|
|
1166
|
+
*/
|
|
1167
|
+
async function backfillNativeDrops(filePaths, nativeParsed, rootDir, result) {
|
|
1168
|
+
const installedExts = getInstalledWasmExtensions();
|
|
1169
|
+
const dropped = filePaths.filter((f) => !nativeParsed.has(f) && installedExts.has(path.extname(f).toLowerCase()));
|
|
1170
|
+
if (dropped.length === 0)
|
|
1171
|
+
return;
|
|
1172
|
+
warn(`Native engine dropped ${dropped.length} file(s); falling back to WASM for parity`);
|
|
1173
|
+
const wasmResults = await parseFilesWasmForBackfill(dropped, rootDir);
|
|
1174
|
+
for (const [relPath, symbols] of wasmResults) {
|
|
1175
|
+
result.set(relPath, symbols);
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Parse multiple files in bulk and return a Map<relPath, symbols>.
|
|
1180
|
+
*/
|
|
1181
|
+
export async function parseFilesAuto(filePaths, rootDir, opts = {}) {
|
|
1182
|
+
const { native } = resolveEngine(opts);
|
|
1183
|
+
if (!native)
|
|
1184
|
+
return parseFilesWasm(filePaths, rootDir);
|
|
1185
|
+
const result = new Map();
|
|
1186
|
+
const { nativeParsed, needsTypeMap } = ingestNativeResults(native, filePaths, rootDir, result);
|
|
1187
|
+
if (needsTypeMap.length > 0) {
|
|
1188
|
+
await backfillTypeMapBatch(needsTypeMap, result);
|
|
1189
|
+
}
|
|
1190
|
+
await backfillNativeDrops(filePaths, nativeParsed, rootDir, result);
|
|
1191
|
+
return result;
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Report which engine is active.
|
|
1195
|
+
*/
|
|
1196
|
+
export function getActiveEngine(opts = {}) {
|
|
1197
|
+
const { name, native } = resolveEngine(opts);
|
|
1198
|
+
const binaryVersion = native && typeof native.engineVersion === 'function' ? native.engineVersion() : null;
|
|
1199
|
+
// The display version prefers the platform package.json so the "Using native
|
|
1200
|
+
// engine (vX)" log matches the npm release the user installed. The Rust
|
|
1201
|
+
// orchestrator's check_version_mismatch compares against CARGO_PKG_VERSION
|
|
1202
|
+
// (the binary's own value), so build_meta writes must use `binaryVersion`,
|
|
1203
|
+
// not this display value — see pipeline.ts and finalize.ts (#1066).
|
|
1204
|
+
let version = binaryVersion;
|
|
1205
|
+
if (native) {
|
|
1206
|
+
try {
|
|
1207
|
+
version = getNativePackageVersion() ?? version;
|
|
1208
|
+
}
|
|
1209
|
+
catch (e) {
|
|
1210
|
+
debug(`getNativePackageVersion failed: ${e.message}`);
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
return { name, version, binaryVersion };
|
|
1214
|
+
}
|
|
1215
|
+
/**
|
|
1216
|
+
* Create a native ParseTreeCache for incremental parsing.
|
|
1217
|
+
* Returns null if the native engine is unavailable (WASM fallback).
|
|
1218
|
+
*/
|
|
1219
|
+
export function createParseTreeCache() {
|
|
1220
|
+
const native = loadNative();
|
|
1221
|
+
if (!native?.ParseTreeCache)
|
|
1222
|
+
return null;
|
|
1223
|
+
return new native.ParseTreeCache();
|
|
1224
|
+
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Parse a file incrementally using the cache, or fall back to full parse.
|
|
1227
|
+
*/
|
|
1228
|
+
export async function parseFileIncremental(cache, filePath, source, opts = {}) {
|
|
1229
|
+
if (cache) {
|
|
1230
|
+
const result = cache.parseFile(filePath, source);
|
|
1231
|
+
if (!result)
|
|
1232
|
+
return null;
|
|
1233
|
+
const patched = patchNativeResult(result);
|
|
1234
|
+
// Always backfill typeMap for TS/TSX from WASM (see parseFileAuto comment).
|
|
1235
|
+
if (TS_BACKFILL_EXTS.has(path.extname(filePath))) {
|
|
1236
|
+
const { typeMap, backfilled } = await backfillTypeMap(filePath, source);
|
|
1237
|
+
if (backfilled) {
|
|
1238
|
+
patched.typeMap = typeMap;
|
|
1239
|
+
patched._typeMapBackfilled = true;
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
return patched;
|
|
1243
|
+
}
|
|
1244
|
+
return parseFileAuto(filePath, source, opts);
|
|
1245
|
+
}
|
|
1246
|
+
//# sourceMappingURL=parser.js.map
|