@optave/codegraph 3.1.5 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -56
- package/dist/ast-analysis/engine.d.ts +17 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +328 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +51 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +106 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +24 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +192 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +24 -0
- package/dist/ast-analysis/rules/go.d.ts.map +1 -0
- package/dist/ast-analysis/rules/go.js +173 -0
- package/dist/ast-analysis/rules/go.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts +31 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +72 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +24 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +166 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +31 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +235 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +24 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +210 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +24 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +188 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +24 -0
- package/dist/ast-analysis/rules/ruby.d.ts.map +1 -0
- package/dist/ast-analysis/rules/ruby.js +193 -0
- package/dist/ast-analysis/rules/ruby.js.map +1 -0
- package/dist/ast-analysis/rules/rust.d.ts +24 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +165 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +106 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +186 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +41 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +180 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +119 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +146 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +11 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +147 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +660 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +17 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +216 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +321 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +9 -0
- package/dist/cli/commands/ast.d.ts.map +1 -0
- package/dist/cli/commands/ast.js +23 -0
- package/dist/cli/commands/ast.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +46 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +9 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +70 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +7 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +22 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +7 -0
- package/dist/cli/commands/brief.d.ts.map +1 -0
- package/dist/cli/commands/brief.js +12 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/build.d.ts +7 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +26 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +10 -0
- package/dist/cli/commands/cfg.d.ts.map +1 -0
- package/dist/cli/commands/cfg.js +27 -0
- package/dist/cli/commands/cfg.js.map +1 -0
- package/dist/cli/commands/check.d.ts +8 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +65 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/children.d.ts +9 -0
- package/dist/cli/commands/children.d.ts.map +1 -0
- package/dist/cli/commands/children.js +33 -0
- package/dist/cli/commands/children.js.map +1 -0
- package/dist/cli/commands/co-change.d.ts +7 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +62 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +8 -0
- package/dist/cli/commands/communities.d.ts.map +1 -0
- package/dist/cli/commands/communities.js +20 -0
- package/dist/cli/commands/communities.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +9 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +47 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/context.d.ts +10 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +35 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +7 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +33 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/dataflow.d.ts +10 -0
- package/dist/cli/commands/dataflow.d.ts.map +1 -0
- package/dist/cli/commands/dataflow.js +29 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +8 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +18 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/diff-impact.d.ts +7 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +28 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +8 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +29 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +7 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +72 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/exports.d.ts +8 -0
- package/dist/cli/commands/exports.d.ts.map +1 -0
- package/dist/cli/commands/exports.js +14 -0
- package/dist/cli/commands/exports.js.map +1 -0
- package/dist/cli/commands/flow.d.ts +10 -0
- package/dist/cli/commands/flow.d.ts.map +1 -0
- package/dist/cli/commands/flow.js +32 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/fn-impact.d.ts +10 -0
- package/dist/cli/commands/fn-impact.d.ts.map +1 -0
- package/dist/cli/commands/fn-impact.js +33 -0
- package/dist/cli/commands/fn-impact.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +7 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +12 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/implementations.d.ts +10 -0
- package/dist/cli/commands/implementations.d.ts.map +1 -0
- package/dist/cli/commands/implementations.js +29 -0
- package/dist/cli/commands/implementations.js.map +1 -0
- package/dist/cli/commands/info.d.ts +6 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +66 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +10 -0
- package/dist/cli/commands/interfaces.d.ts.map +1 -0
- package/dist/cli/commands/interfaces.js +29 -0
- package/dist/cli/commands/interfaces.js.map +1 -0
- package/dist/cli/commands/map.d.ts +7 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +19 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +7 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +19 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +6 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +17 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +8 -0
- package/dist/cli/commands/owners.d.ts.map +1 -0
- package/dist/cli/commands/owners.js +27 -0
- package/dist/cli/commands/owners.js.map +1 -0
- package/dist/cli/commands/path.d.ts +8 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +36 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +7 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +94 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +10 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/registry.d.ts +16 -0
- package/dist/cli/commands/registry.d.ts.map +1 -0
- package/dist/cli/commands/registry.js +95 -0
- package/dist/cli/commands/registry.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +9 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +31 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +9 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +47 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +10 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +29 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +11 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +61 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +7 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +15 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/structure.d.ts +7 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +33 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +8 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +89 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +6 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +12 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +9 -0
- package/dist/cli/commands/where.d.ts.map +1 -0
- package/dist/cli/commands/where.js +20 -0
- package/dist/cli/commands/where.js.map +1 -0
- package/dist/cli/index.d.ts +31 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +109 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +14 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +13 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +31 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +58 -0
- package/dist/cli/shared/options.js.map +1 -0
- package/dist/cli/shared/output.d.ts +2 -0
- package/dist/cli/shared/output.d.ts.map +1 -0
- package/dist/cli/shared/output.js +2 -0
- package/dist/cli/shared/output.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +15 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/connection.d.ts +39 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +217 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +6 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +8 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +323 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +106 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +313 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +115 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +165 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +25 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +86 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +13 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +20 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +27 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +57 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +20 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +45 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +15 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +15 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +7 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +17 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +173 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +231 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +20 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +47 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +41 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +41 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +156 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +533 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +14 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +15 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +151 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +244 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +100 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +143 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +16 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +147 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +3 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +378 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +60 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +359 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +2 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +168 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +39 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +596 -0
- package/dist/domain/analysis/impact.js.map +1 -0
- package/dist/domain/analysis/implementations.d.ts +59 -0
- package/dist/domain/analysis/implementations.d.ts.map +1 -0
- package/dist/domain/analysis/implementations.js +93 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +64 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +334 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +2 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +50 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +12 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +202 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +91 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -0
- package/dist/domain/graph/builder/context.js +78 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +43 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +209 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +17 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +191 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +13 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +146 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +387 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +107 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +45 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +358 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +5 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +123 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +183 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +25 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +18 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +139 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +5 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +39 -0
- package/dist/domain/graph/builder/stages/run-analyses.js.map +1 -0
- package/dist/domain/graph/builder.d.ts +4 -0
- package/dist/domain/graph/builder.d.ts.map +1 -0
- package/dist/domain/graph/builder.js +6 -0
- package/dist/domain/graph/builder.js.map +1 -0
- package/dist/domain/graph/change-journal.d.ts +57 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +120 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +18 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +75 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +27 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +100 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +76 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +482 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +2 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +140 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +104 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +557 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +14 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +25 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +17 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +135 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +8 -0
- package/dist/domain/search/index.d.ts.map +1 -0
- package/dist/domain/search/index.js +13 -0
- package/dist/domain/search/index.js.map +1 -0
- package/dist/domain/search/models.d.ts +82 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +198 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +6 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +135 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +19 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +48 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +22 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +113 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +17 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +66 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +13 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +70 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +34 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +129 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +11 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +31 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +27 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +22 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +5 -0
- package/dist/domain/search/strategies/source.d.ts.map +1 -0
- package/dist/domain/search/strategies/source.js +14 -0
- package/dist/domain/search/strategies/source.js.map +1 -0
- package/dist/domain/search/strategies/structured.d.ts +6 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +40 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +11 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +47 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/extractors/csharp.d.ts +12 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +402 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/go.d.ts +12 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +381 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/hcl.d.ts +11 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +105 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +16 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +88 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +10 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +10 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +12 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +325 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +81 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +1232 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/php.d.ts +12 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +380 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +12 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +426 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/ruby.d.ts +11 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +284 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +12 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +366 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/features/ast.d.ts +30 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +242 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +6 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +283 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +110 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +138 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +69 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +344 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +52 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +425 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +51 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +372 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +99 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +296 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +119 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +425 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +40 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +163 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity.d.ts +127 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +683 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +72 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +483 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +29 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +336 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +49 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +203 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +54 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +297 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +46 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +398 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +123 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +289 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +33 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +269 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +11 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +27 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +64 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +132 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure.d.ts +42 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +596 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +13 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +133 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +13 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +47 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +11 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +17 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +6 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +6 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +5 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +22 -0
- package/dist/graph/algorithms/louvain.js.map +1 -0
- package/dist/graph/algorithms/shortest-path.d.ts +10 -0
- package/dist/graph/algorithms/shortest-path.d.ts.map +1 -0
- package/dist/graph/algorithms/shortest-path.js +41 -0
- package/dist/graph/algorithms/shortest-path.js.map +1 -0
- package/dist/graph/algorithms/tarjan.d.ts +9 -0
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -0
- package/dist/graph/algorithms/tarjan.js +48 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +15 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +99 -0
- package/dist/graph/builders/dependency.js.map +1 -0
- package/dist/graph/builders/index.d.ts +4 -0
- package/dist/graph/builders/index.d.ts.map +1 -0
- package/dist/graph/builders/index.js +4 -0
- package/dist/graph/builders/index.js.map +1 -0
- package/dist/graph/builders/structure.d.ts +7 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +32 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +10 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +31 -0
- package/dist/graph/builders/temporal.js.map +1 -0
- package/dist/graph/classifiers/index.d.ts +3 -0
- package/dist/graph/classifiers/index.d.ts.map +1 -0
- package/dist/graph/classifiers/index.js +3 -0
- package/dist/graph/classifiers/index.js.map +1 -0
- package/dist/graph/classifiers/risk.d.ts +49 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +84 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +29 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +109 -0
- package/dist/graph/classifiers/roles.js.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model.d.ts +53 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +210 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/config.d.ts +222 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +386 -0
- package/dist/infrastructure/config.js.map +1 -0
- package/dist/infrastructure/logger.d.ts +7 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/logger.js +21 -0
- package/dist/infrastructure/logger.js.map +1 -0
- package/dist/infrastructure/native.d.ts +19 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +105 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +57 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +157 -0
- package/dist/infrastructure/registry.js.map +1 -0
- package/dist/infrastructure/result-formatter.d.ts +2 -0
- package/dist/infrastructure/result-formatter.d.ts.map +1 -0
- package/dist/infrastructure/result-formatter.js +3 -0
- package/dist/infrastructure/result-formatter.js.map +1 -0
- package/dist/infrastructure/test-filter.d.ts +5 -0
- package/dist/infrastructure/test-filter.d.ts.map +1 -0
- package/dist/infrastructure/test-filter.js +7 -0
- package/dist/infrastructure/test-filter.js.map +1 -0
- package/dist/infrastructure/update-check.d.ts +24 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +150 -0
- package/dist/infrastructure/update-check.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/middleware.d.ts +26 -0
- package/dist/mcp/middleware.d.ts.map +1 -0
- package/dist/mcp/middleware.js +38 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +8 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +819 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +9 -0
- package/dist/mcp/tools/ast-query.d.ts.map +1 -0
- package/dist/mcp/tools/ast-query.js +13 -0
- package/dist/mcp/tools/ast-query.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts +3 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -0
- package/dist/mcp/tools/audit.js +20 -0
- package/dist/mcp/tools/audit.js.map +1 -0
- package/dist/mcp/tools/batch-query.d.ts +9 -0
- package/dist/mcp/tools/batch-query.d.ts.map +1 -0
- package/dist/mcp/tools/batch-query.js +11 -0
- package/dist/mcp/tools/batch-query.js.map +1 -0
- package/dist/mcp/tools/branch-compare.d.ts +3 -0
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -0
- package/dist/mcp/tools/branch-compare.js +10 -0
- package/dist/mcp/tools/branch-compare.js.map +1 -0
- package/dist/mcp/tools/brief.d.ts +3 -0
- package/dist/mcp/tools/brief.d.ts.map +1 -0
- package/dist/mcp/tools/brief.js +8 -0
- package/dist/mcp/tools/brief.js.map +1 -0
- package/dist/mcp/tools/cfg.d.ts +10 -0
- package/dist/mcp/tools/cfg.d.ts.map +1 -0
- package/dist/mcp/tools/cfg.js +20 -0
- package/dist/mcp/tools/cfg.js.map +1 -0
- package/dist/mcp/tools/check.d.ts +24 -0
- package/dist/mcp/tools/check.d.ts.map +1 -0
- package/dist/mcp/tools/check.js +39 -0
- package/dist/mcp/tools/check.js.map +1 -0
- package/dist/mcp/tools/co-changes.d.ts +10 -0
- package/dist/mcp/tools/co-changes.d.ts.map +1 -0
- package/dist/mcp/tools/co-changes.js +19 -0
- package/dist/mcp/tools/co-changes.js.map +1 -0
- package/dist/mcp/tools/code-owners.d.ts +48 -0
- package/dist/mcp/tools/code-owners.d.ts.map +1 -0
- package/dist/mcp/tools/code-owners.js +12 -0
- package/dist/mcp/tools/code-owners.js.map +1 -0
- package/dist/mcp/tools/communities.d.ts +8 -0
- package/dist/mcp/tools/communities.d.ts.map +1 -0
- package/dist/mcp/tools/communities.js +14 -0
- package/dist/mcp/tools/communities.js.map +1 -0
- package/dist/mcp/tools/complexity.d.ts +7 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +17 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.d.ts.map +1 -0
- package/dist/mcp/tools/context.js +16 -0
- package/dist/mcp/tools/context.js.map +1 -0
- package/dist/mcp/tools/dataflow.d.ts +6 -0
- package/dist/mcp/tools/dataflow.d.ts.map +1 -0
- package/dist/mcp/tools/dataflow.js +25 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/diff-impact.d.ts +3 -0
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -0
- package/dist/mcp/tools/diff-impact.js +23 -0
- package/dist/mcp/tools/diff-impact.js.map +1 -0
- package/dist/mcp/tools/execution-flow.d.ts +17 -0
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -0
- package/dist/mcp/tools/execution-flow.js +25 -0
- package/dist/mcp/tools/execution-flow.js.map +1 -0
- package/dist/mcp/tools/export-graph.d.ts +3 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +55 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +3 -0
- package/dist/mcp/tools/file-deps.d.ts.map +1 -0
- package/dist/mcp/tools/file-deps.js +11 -0
- package/dist/mcp/tools/file-deps.js.map +1 -0
- package/dist/mcp/tools/file-exports.d.ts +3 -0
- package/dist/mcp/tools/file-exports.d.ts.map +1 -0
- package/dist/mcp/tools/file-exports.js +12 -0
- package/dist/mcp/tools/file-exports.js.map +1 -0
- package/dist/mcp/tools/find-cycles.d.ts +6 -0
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -0
- package/dist/mcp/tools/find-cycles.js +15 -0
- package/dist/mcp/tools/find-cycles.js.map +1 -0
- package/dist/mcp/tools/fn-impact.d.ts +3 -0
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -0
- package/dist/mcp/tools/fn-impact.js +14 -0
- package/dist/mcp/tools/fn-impact.js.map +1 -0
- package/dist/mcp/tools/impact-analysis.d.ts +3 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +11 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +3 -0
- package/dist/mcp/tools/implementations.d.ts.map +1 -0
- package/dist/mcp/tools/implementations.js +13 -0
- package/dist/mcp/tools/implementations.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +76 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/interfaces.d.ts +3 -0
- package/dist/mcp/tools/interfaces.d.ts.map +1 -0
- package/dist/mcp/tools/interfaces.js +13 -0
- package/dist/mcp/tools/interfaces.js.map +1 -0
- package/dist/mcp/tools/list-functions.d.ts +3 -0
- package/dist/mcp/tools/list-functions.d.ts.map +1 -0
- package/dist/mcp/tools/list-functions.js +13 -0
- package/dist/mcp/tools/list-functions.js.map +1 -0
- package/dist/mcp/tools/list-repos.d.ts +11 -0
- package/dist/mcp/tools/list-repos.d.ts.map +1 -0
- package/dist/mcp/tools/list-repos.js +11 -0
- package/dist/mcp/tools/list-repos.js.map +1 -0
- package/dist/mcp/tools/module-map.d.ts +3 -0
- package/dist/mcp/tools/module-map.d.ts.map +1 -0
- package/dist/mcp/tools/module-map.js +6 -0
- package/dist/mcp/tools/module-map.js.map +1 -0
- package/dist/mcp/tools/node-roles.d.ts +3 -0
- package/dist/mcp/tools/node-roles.d.ts.map +1 -0
- package/dist/mcp/tools/node-roles.js +13 -0
- package/dist/mcp/tools/node-roles.js.map +1 -0
- package/dist/mcp/tools/path.d.ts +3 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +12 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +3 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +29 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/semantic-search.d.ts +3 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +61 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +18 -0
- package/dist/mcp/tools/sequence.d.ts.map +1 -0
- package/dist/mcp/tools/sequence.js +16 -0
- package/dist/mcp/tools/sequence.js.map +1 -0
- package/dist/mcp/tools/structure.d.ts +3 -0
- package/dist/mcp/tools/structure.d.ts.map +1 -0
- package/dist/mcp/tools/structure.js +14 -0
- package/dist/mcp/tools/structure.js.map +1 -0
- package/dist/mcp/tools/symbol-children.d.ts +3 -0
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -0
- package/dist/mcp/tools/symbol-children.js +13 -0
- package/dist/mcp/tools/symbol-children.js.map +1 -0
- package/dist/mcp/tools/triage.d.ts +3 -0
- package/dist/mcp/tools/triage.d.ts.map +1 -0
- package/dist/mcp/tools/triage.js +34 -0
- package/dist/mcp/tools/triage.js.map +1 -0
- package/dist/mcp/tools/where.d.ts +3 -0
- package/dist/mcp/tools/where.d.ts.map +1 -0
- package/dist/mcp/tools/where.js +12 -0
- package/dist/mcp/tools/where.js.map +1 -0
- package/dist/presentation/audit.d.ts +5 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +77 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +10 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +25 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +2 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +75 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +12 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +49 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +5 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +50 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +5 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +70 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +9 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +39 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +26 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +42 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +5 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +56 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +5 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +56 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +5 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +96 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/export.d.ts +137 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +374 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +5 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +64 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +5 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +56 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +5 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +45 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +2 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +94 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +6 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +196 -0
- package/dist/presentation/queries-cli/impact.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +6 -0
- package/dist/presentation/queries-cli/index.d.ts.map +1 -0
- package/dist/presentation/queries-cli/index.js +6 -0
- package/dist/presentation/queries-cli/index.js.map +1 -0
- package/dist/presentation/queries-cli/inspect.d.ts +8 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +353 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +4 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +163 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +2 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +51 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +2 -0
- package/dist/presentation/queries-cli.d.ts.map +1 -0
- package/dist/presentation/queries-cli.js +12 -0
- package/dist/presentation/queries-cli.js.map +1 -0
- package/dist/presentation/query.d.ts +2 -0
- package/dist/presentation/query.d.ts.map +1 -0
- package/dist/presentation/query.js +6 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +10 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +134 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +12 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +36 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +5 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +29 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +8 -0
- package/dist/presentation/structure.d.ts.map +1 -0
- package/dist/presentation/structure.js +50 -0
- package/dist/presentation/structure.js.map +1 -0
- package/dist/presentation/table.d.ts +28 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +39 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +5 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +37 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +85 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +621 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +11 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +35 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +47 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +69 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/file-utils.d.ts +14 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +165 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +62 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +120 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +2 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +27 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +11 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +56 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +19 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +59 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +80 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +111 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/types.d.ts +1322 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +21 -15
- package/src/ast-analysis/engine.js +252 -258
- package/src/ast-analysis/shared.js +0 -12
- package/src/ast-analysis/visitors/cfg-visitor.js +635 -649
- package/src/ast-analysis/visitors/complexity-visitor.js +135 -139
- package/src/ast-analysis/visitors/dataflow-visitor.js +230 -224
- package/src/cli/commands/ast.js +2 -1
- package/src/cli/commands/audit.js +2 -1
- package/src/cli/commands/batch.js +2 -1
- package/src/cli/commands/brief.js +12 -0
- package/src/cli/commands/cfg.js +2 -1
- package/src/cli/commands/check.js +20 -23
- package/src/cli/commands/children.js +6 -1
- package/src/cli/commands/complexity.js +2 -1
- package/src/cli/commands/context.js +6 -1
- package/src/cli/commands/dataflow.js +2 -1
- package/src/cli/commands/deps.js +8 -3
- package/src/cli/commands/diff-impact.js +2 -0
- package/src/cli/commands/flow.js +2 -1
- package/src/cli/commands/fn-impact.js +8 -1
- package/src/cli/commands/implementations.js +29 -0
- package/src/cli/commands/info.js +1 -1
- package/src/cli/commands/interfaces.js +29 -0
- package/src/cli/commands/owners.js +4 -2
- package/src/cli/commands/query.js +6 -1
- package/src/cli/commands/roles.js +4 -2
- package/src/cli/commands/search.js +8 -2
- package/src/cli/commands/sequence.js +2 -1
- package/src/cli/commands/triage.js +42 -28
- package/src/db/connection.js +18 -12
- package/src/db/index.js +2 -0
- package/src/db/migrations.js +41 -64
- package/src/db/query-builder.js +69 -8
- package/src/db/repository/edges.js +38 -0
- package/src/db/repository/in-memory-repository.js +38 -18
- package/src/db/repository/index.js +2 -0
- package/src/db/repository/nodes.js +8 -10
- package/src/domain/analysis/brief.js +161 -0
- package/src/domain/analysis/context.js +237 -199
- package/src/domain/analysis/dependencies.js +200 -146
- package/src/domain/analysis/exports.js +84 -12
- package/src/domain/analysis/impact.js +350 -157
- package/src/domain/analysis/implementations.js +98 -0
- package/src/domain/analysis/module-map.js +256 -221
- package/src/domain/analysis/roles.js +16 -7
- package/src/domain/analysis/symbol-lookup.js +7 -5
- package/src/domain/graph/builder/helpers.js +1 -1
- package/src/domain/graph/builder/incremental.js +136 -90
- package/src/domain/graph/builder/pipeline.js +114 -80
- package/src/domain/graph/builder/stages/build-edges.js +413 -237
- package/src/domain/graph/builder/stages/detect-changes.js +198 -177
- package/src/domain/graph/builder/stages/insert-nodes.js +147 -139
- package/src/domain/graph/resolve.js +315 -1
- package/src/domain/graph/watcher.js +2 -2
- package/src/domain/parser.js +90 -17
- package/src/domain/queries.js +2 -0
- package/src/domain/search/search/filters.js +9 -5
- package/src/domain/search/search/hybrid.js +7 -4
- package/src/domain/search/search/keyword.js +12 -5
- package/src/domain/search/search/prepare.js +13 -5
- package/src/domain/search/search/semantic.js +11 -6
- package/src/extractors/csharp.js +286 -207
- package/src/extractors/go.js +304 -159
- package/src/extractors/hcl.js +94 -78
- package/src/extractors/java.js +239 -207
- package/src/extractors/javascript.js +437 -305
- package/src/extractors/php.js +276 -220
- package/src/extractors/python.js +379 -247
- package/src/extractors/ruby.js +192 -185
- package/src/extractors/rust.js +243 -168
- package/src/features/ast.js +5 -3
- package/src/features/audit.js +6 -3
- package/src/features/boundaries.js +98 -83
- package/src/features/cfg.js +134 -143
- package/src/features/communities.js +70 -53
- package/src/features/complexity.js +143 -132
- package/src/features/dataflow.js +146 -149
- package/src/features/export.js +3 -3
- package/src/features/graph-enrichment.js +3 -3
- package/src/features/manifesto.js +9 -6
- package/src/features/owners.js +4 -3
- package/src/features/sequence.js +155 -142
- package/src/features/shared/find-nodes.js +31 -0
- package/src/features/structure.js +161 -101
- package/src/features/triage.js +93 -71
- package/src/graph/classifiers/risk.js +12 -4
- package/src/graph/classifiers/roles.js +54 -3
- package/src/index.js +1 -0
- package/src/infrastructure/config.js +255 -4
- package/src/mcp/middleware.js +20 -2
- package/src/mcp/server.js +71 -56
- package/src/mcp/tool-registry.js +53 -1
- package/src/mcp/tools/brief.js +8 -0
- package/src/mcp/tools/implementations.js +14 -0
- package/src/mcp/tools/index.js +6 -0
- package/src/mcp/tools/interfaces.js +14 -0
- package/src/presentation/brief.js +51 -0
- package/src/presentation/queries-cli/exports.js +72 -15
- package/src/presentation/queries-cli/impact.js +55 -39
- package/src/presentation/queries-cli/index.js +9 -1
- package/src/presentation/queries-cli/inspect.js +241 -182
- package/src/presentation/queries-cli/overview.js +57 -58
- package/src/presentation/queries-cli/path.js +36 -29
- package/src/presentation/queries-cli.js +3 -1
- package/src/presentation/result-formatter.js +9 -5
- package/src/presentation/table.js +0 -8
- package/src/shared/file-utils.js +20 -11
- package/src/shared/generators.js +7 -3
- package/src/shared/kinds.js +14 -1
- package/src/shared/paginate.js +10 -2
- package/src/types.ts +1609 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export function createParsers(): Promise<any>;
|
|
2
|
+
/**
|
|
3
|
+
* Dispose all cached WASM parsers and queries to free WASM linear memory.
|
|
4
|
+
* Call this between repeated builds in the same process (e.g. benchmarks)
|
|
5
|
+
* to prevent memory accumulation that can cause segfaults.
|
|
6
|
+
*/
|
|
7
|
+
export function disposeParsers(): void;
|
|
8
|
+
export function getParser(parsers: any, filePath: any): any;
|
|
9
|
+
/**
|
|
10
|
+
* Pre-parse files missing `_tree` via WASM so downstream phases (CFG, dataflow)
|
|
11
|
+
* don't each need to create parsers and re-parse independently.
|
|
12
|
+
* Only parses files whose extension is in SUPPORTED_EXTENSIONS.
|
|
13
|
+
*
|
|
14
|
+
* @param {Map<string, object>} fileSymbols - Map<relPath, { definitions, _tree, _langId, ... }>
|
|
15
|
+
* @param {string} rootDir - absolute project root
|
|
16
|
+
*/
|
|
17
|
+
export function ensureWasmTrees(fileSymbols: Map<string, object>, rootDir: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Check whether the required WASM grammar files exist on disk.
|
|
20
|
+
*/
|
|
21
|
+
export function isWasmAvailable(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Parse a single file and return normalized symbols.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} filePath Absolute path to the file.
|
|
26
|
+
* @param {string} source Source code string.
|
|
27
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
28
|
+
* @returns {Promise<{definitions, calls, imports, classes, exports}|null>}
|
|
29
|
+
*/
|
|
30
|
+
export function parseFileAuto(filePath: string, source: string, opts?: object): Promise<{
|
|
31
|
+
definitions: any;
|
|
32
|
+
calls: any;
|
|
33
|
+
imports: any;
|
|
34
|
+
classes: any;
|
|
35
|
+
exports: any;
|
|
36
|
+
} | null>;
|
|
37
|
+
/**
|
|
38
|
+
* Parse multiple files in bulk and return a Map<relPath, symbols>.
|
|
39
|
+
*
|
|
40
|
+
* @param {string[]} filePaths Absolute paths to files.
|
|
41
|
+
* @param {string} rootDir Project root for computing relative paths.
|
|
42
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
43
|
+
* @returns {Promise<Map<string, {definitions, calls, imports, classes, exports}>>}
|
|
44
|
+
*/
|
|
45
|
+
export function parseFilesAuto(filePaths: string[], rootDir: string, opts?: object): Promise<Map<string, {
|
|
46
|
+
definitions: any;
|
|
47
|
+
calls: any;
|
|
48
|
+
imports: any;
|
|
49
|
+
classes: any;
|
|
50
|
+
exports: any;
|
|
51
|
+
}>>;
|
|
52
|
+
/**
|
|
53
|
+
* Report which engine is active.
|
|
54
|
+
*
|
|
55
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
56
|
+
* @returns {{ name: 'native'|'wasm', version: string|null }}
|
|
57
|
+
*/
|
|
58
|
+
export function getActiveEngine(opts?: object): {
|
|
59
|
+
name: "native" | "wasm";
|
|
60
|
+
version: string | null;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Create a native ParseTreeCache for incremental parsing.
|
|
64
|
+
* Returns null if the native engine is unavailable (WASM fallback).
|
|
65
|
+
*/
|
|
66
|
+
export function createParseTreeCache(): any;
|
|
67
|
+
/**
|
|
68
|
+
* Parse a file incrementally using the cache, or fall back to full parse.
|
|
69
|
+
*
|
|
70
|
+
* @param {object|null} cache ParseTreeCache instance (or null for full parse)
|
|
71
|
+
* @param {string} filePath Absolute path to the file
|
|
72
|
+
* @param {string} source Source code string
|
|
73
|
+
* @param {object} [opts] Options forwarded to parseFileAuto on fallback
|
|
74
|
+
* @returns {Promise<{definitions, calls, imports, classes, exports}|null>}
|
|
75
|
+
*/
|
|
76
|
+
export function parseFileIncremental(cache: object | null, filePath: string, source: string, opts?: object): Promise<{
|
|
77
|
+
definitions: any;
|
|
78
|
+
calls: any;
|
|
79
|
+
imports: any;
|
|
80
|
+
classes: any;
|
|
81
|
+
exports: any;
|
|
82
|
+
} | null>;
|
|
83
|
+
/**
|
|
84
|
+
* Declarative registry of all supported languages.
|
|
85
|
+
* Adding a new language requires only a new entry here + its extractor function.
|
|
86
|
+
*/
|
|
87
|
+
export const LANGUAGE_REGISTRY: ({
|
|
88
|
+
id: string;
|
|
89
|
+
extensions: string[];
|
|
90
|
+
grammarFile: string;
|
|
91
|
+
extractor: typeof extractSymbols;
|
|
92
|
+
required: boolean;
|
|
93
|
+
} | {
|
|
94
|
+
id: string;
|
|
95
|
+
extensions: string[];
|
|
96
|
+
grammarFile: string;
|
|
97
|
+
extractor: typeof extractHCLSymbols;
|
|
98
|
+
required: boolean;
|
|
99
|
+
})[];
|
|
100
|
+
export const SUPPORTED_EXTENSIONS: Set<any>;
|
|
101
|
+
import { extractSymbols } from '../extractors/index.js';
|
|
102
|
+
import { extractHCLSymbols } from '../extractors/index.js';
|
|
103
|
+
export { extractCSharpSymbols, extractGoSymbols, extractHCLSymbols, extractJavaSymbols, extractPHPSymbols, extractPythonSymbols, extractRubySymbols, extractRustSymbols, extractSymbols } from "../extractors/index.js";
|
|
104
|
+
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/domain/parser.js"],"names":[],"mappings":"AAyEA,8CAoCC;AAED;;;;GAIG;AACH,uCAoCC;AAED,4DAKC;AAED;;;;;;;GAOG;AACH,6CAHW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,WACnB,MAAM,iBAyChB;AAED;;GAEG;AACH,2CAIC;AAmND;;;;;;;GAOG;AACH,wCALW,MAAM,UACN,MAAM,SACN,MAAM,GACJ,OAAO,CAAC;IAAC,WAAW,MAAC;IAAC,KAAK,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAA;CAAC,GAAC,IAAI,CAAC,CAqBzE;AAED;;;;;;;GAOG;AACH,0CALW,MAAM,EAAE,WACR,MAAM,SACN,MAAM,GACJ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE;IAAC,WAAW,MAAC;IAAC,KAAK,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAA;CAAC,CAAC,CAAC,CAkEjF;AAED;;;;;GAKG;AACH,uCAHW,MAAM,GACJ;IAAE,IAAI,EAAE,QAAQ,GAAC,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAC,IAAI,CAAA;CAAE,CAmB3D;AAED;;;GAGG;AACH,4CAIC;AAED;;;;;;;;GAQG;AACH,4CANW,MAAM,GAAC,IAAI,YACX,MAAM,UACN,MAAM,SACN,MAAM,GACJ,OAAO,CAAC;IAAC,WAAW,MAAC;IAAC,KAAK,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAC;IAAC,OAAO,MAAA;CAAC,GAAC,IAAI,CAAC,CAezE;AA7SD;;;GAGG;AACH;;;;;;;;;;;;KA8EE;AASF,4CAA+D;+BA5VxD,wBAAwB;kCAAxB,wBAAwB"}
|
|
@@ -0,0 +1,557 @@
|
|
|
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
|
+
// Re-export all extractors for backward compatibility
|
|
8
|
+
export { extractCSharpSymbols, extractGoSymbols, extractHCLSymbols, extractJavaSymbols, extractPHPSymbols, extractPythonSymbols, extractRubySymbols, extractRustSymbols, extractSymbols, } from '../extractors/index.js';
|
|
9
|
+
import { extractCSharpSymbols, extractGoSymbols, extractHCLSymbols, extractJavaSymbols, extractPHPSymbols, extractPythonSymbols, extractRubySymbols, extractRustSymbols, extractSymbols, } from '../extractors/index.js';
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
function grammarPath(name) {
|
|
12
|
+
return path.join(__dirname, '..', '..', 'grammars', name);
|
|
13
|
+
}
|
|
14
|
+
let _initialized = false;
|
|
15
|
+
// Memoized parsers — avoids reloading WASM grammars on every createParsers() call
|
|
16
|
+
let _cachedParsers = null;
|
|
17
|
+
// Cached Language objects — WASM-backed, must be .delete()'d explicitly
|
|
18
|
+
let _cachedLanguages = null;
|
|
19
|
+
// Query cache for JS/TS/TSX extractors (populated during createParsers)
|
|
20
|
+
const _queryCache = new Map();
|
|
21
|
+
// Shared patterns for all JS/TS/TSX (class_declaration excluded — name type differs)
|
|
22
|
+
const COMMON_QUERY_PATTERNS = [
|
|
23
|
+
'(function_declaration name: (identifier) @fn_name) @fn_node',
|
|
24
|
+
'(variable_declarator name: (identifier) @varfn_name value: (arrow_function) @varfn_value)',
|
|
25
|
+
'(variable_declarator name: (identifier) @varfn_name value: (function_expression) @varfn_value)',
|
|
26
|
+
'(method_definition name: (property_identifier) @meth_name) @meth_node',
|
|
27
|
+
'(import_statement source: (string) @imp_source) @imp_node',
|
|
28
|
+
'(export_statement) @exp_node',
|
|
29
|
+
'(call_expression function: (identifier) @callfn_name) @callfn_node',
|
|
30
|
+
'(call_expression function: (member_expression) @callmem_fn) @callmem_node',
|
|
31
|
+
'(call_expression function: (subscript_expression) @callsub_fn) @callsub_node',
|
|
32
|
+
'(expression_statement (assignment_expression left: (member_expression) @assign_left right: (_) @assign_right)) @assign_node',
|
|
33
|
+
];
|
|
34
|
+
// JS: class name is (identifier)
|
|
35
|
+
const JS_CLASS_PATTERN = '(class_declaration name: (identifier) @cls_name) @cls_node';
|
|
36
|
+
// TS/TSX: class name is (type_identifier), plus interface and type alias
|
|
37
|
+
const TS_EXTRA_PATTERNS = [
|
|
38
|
+
'(class_declaration name: (type_identifier) @cls_name) @cls_node',
|
|
39
|
+
'(interface_declaration name: (type_identifier) @iface_name) @iface_node',
|
|
40
|
+
'(type_alias_declaration name: (type_identifier) @type_name) @type_node',
|
|
41
|
+
];
|
|
42
|
+
export async function createParsers() {
|
|
43
|
+
if (_cachedParsers)
|
|
44
|
+
return _cachedParsers;
|
|
45
|
+
if (!_initialized) {
|
|
46
|
+
await Parser.init();
|
|
47
|
+
_initialized = true;
|
|
48
|
+
}
|
|
49
|
+
const parsers = new Map();
|
|
50
|
+
const languages = new Map();
|
|
51
|
+
for (const entry of LANGUAGE_REGISTRY) {
|
|
52
|
+
try {
|
|
53
|
+
const lang = await Language.load(grammarPath(entry.grammarFile));
|
|
54
|
+
const parser = new Parser();
|
|
55
|
+
parser.setLanguage(lang);
|
|
56
|
+
parsers.set(entry.id, parser);
|
|
57
|
+
languages.set(entry.id, lang);
|
|
58
|
+
// Compile and cache tree-sitter Query for JS/TS/TSX extractors
|
|
59
|
+
if (entry.extractor === extractSymbols && !_queryCache.has(entry.id)) {
|
|
60
|
+
const isTS = entry.id === 'typescript' || entry.id === 'tsx';
|
|
61
|
+
const patterns = isTS
|
|
62
|
+
? [...COMMON_QUERY_PATTERNS, ...TS_EXTRA_PATTERNS]
|
|
63
|
+
: [...COMMON_QUERY_PATTERNS, JS_CLASS_PATTERN];
|
|
64
|
+
_queryCache.set(entry.id, new Query(lang, patterns.join('\n')));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
if (entry.required)
|
|
69
|
+
throw e;
|
|
70
|
+
warn(`${entry.id} parser failed to initialize: ${e.message}. ${entry.id} files will be skipped.`);
|
|
71
|
+
parsers.set(entry.id, null);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
_cachedParsers = parsers;
|
|
75
|
+
_cachedLanguages = languages;
|
|
76
|
+
return parsers;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Dispose all cached WASM parsers and queries to free WASM linear memory.
|
|
80
|
+
* Call this between repeated builds in the same process (e.g. benchmarks)
|
|
81
|
+
* to prevent memory accumulation that can cause segfaults.
|
|
82
|
+
*/
|
|
83
|
+
export function disposeParsers() {
|
|
84
|
+
if (_cachedParsers) {
|
|
85
|
+
for (const [id, parser] of _cachedParsers) {
|
|
86
|
+
if (parser && typeof parser.delete === 'function') {
|
|
87
|
+
try {
|
|
88
|
+
parser.delete();
|
|
89
|
+
}
|
|
90
|
+
catch (e) {
|
|
91
|
+
debug(`Failed to dispose parser ${id}: ${e.message}`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
_cachedParsers = null;
|
|
96
|
+
}
|
|
97
|
+
for (const [id, query] of _queryCache) {
|
|
98
|
+
if (query && typeof query.delete === 'function') {
|
|
99
|
+
try {
|
|
100
|
+
query.delete();
|
|
101
|
+
}
|
|
102
|
+
catch (e) {
|
|
103
|
+
debug(`Failed to dispose query ${id}: ${e.message}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
_queryCache.clear();
|
|
108
|
+
if (_cachedLanguages) {
|
|
109
|
+
for (const [id, lang] of _cachedLanguages) {
|
|
110
|
+
if (lang && typeof lang.delete === 'function') {
|
|
111
|
+
try {
|
|
112
|
+
lang.delete();
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
debug(`Failed to dispose language ${id}: ${e.message}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
_cachedLanguages = null;
|
|
120
|
+
}
|
|
121
|
+
_initialized = false;
|
|
122
|
+
}
|
|
123
|
+
export function getParser(parsers, filePath) {
|
|
124
|
+
const ext = path.extname(filePath);
|
|
125
|
+
const entry = _extToLang.get(ext);
|
|
126
|
+
if (!entry)
|
|
127
|
+
return null;
|
|
128
|
+
return parsers.get(entry.id) || null;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Pre-parse files missing `_tree` via WASM so downstream phases (CFG, dataflow)
|
|
132
|
+
* don't each need to create parsers and re-parse independently.
|
|
133
|
+
* Only parses files whose extension is in SUPPORTED_EXTENSIONS.
|
|
134
|
+
*
|
|
135
|
+
* @param {Map<string, object>} fileSymbols - Map<relPath, { definitions, _tree, _langId, ... }>
|
|
136
|
+
* @param {string} rootDir - absolute project root
|
|
137
|
+
*/
|
|
138
|
+
export async function ensureWasmTrees(fileSymbols, rootDir) {
|
|
139
|
+
// Check if any file needs a tree
|
|
140
|
+
let needsParse = false;
|
|
141
|
+
for (const [relPath, symbols] of fileSymbols) {
|
|
142
|
+
if (!symbols._tree) {
|
|
143
|
+
const ext = path.extname(relPath).toLowerCase();
|
|
144
|
+
if (_extToLang.has(ext)) {
|
|
145
|
+
needsParse = true;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (!needsParse)
|
|
151
|
+
return;
|
|
152
|
+
const parsers = await createParsers();
|
|
153
|
+
for (const [relPath, symbols] of fileSymbols) {
|
|
154
|
+
if (symbols._tree)
|
|
155
|
+
continue;
|
|
156
|
+
const ext = path.extname(relPath).toLowerCase();
|
|
157
|
+
const entry = _extToLang.get(ext);
|
|
158
|
+
if (!entry)
|
|
159
|
+
continue;
|
|
160
|
+
const parser = parsers.get(entry.id);
|
|
161
|
+
if (!parser)
|
|
162
|
+
continue;
|
|
163
|
+
const absPath = path.join(rootDir, relPath);
|
|
164
|
+
let code;
|
|
165
|
+
try {
|
|
166
|
+
code = fs.readFileSync(absPath, 'utf-8');
|
|
167
|
+
}
|
|
168
|
+
catch (e) {
|
|
169
|
+
debug(`ensureWasmTrees: cannot read ${relPath}: ${e.message}`);
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
try {
|
|
173
|
+
symbols._tree = parser.parse(code);
|
|
174
|
+
symbols._langId = entry.id;
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
debug(`ensureWasmTrees: parse failed for ${relPath}: ${e.message}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Check whether the required WASM grammar files exist on disk.
|
|
183
|
+
*/
|
|
184
|
+
export function isWasmAvailable() {
|
|
185
|
+
return LANGUAGE_REGISTRY.filter((e) => e.required).every((e) => fs.existsSync(grammarPath(e.grammarFile)));
|
|
186
|
+
}
|
|
187
|
+
// ── Unified API ──────────────────────────────────────────────────────────────
|
|
188
|
+
function resolveEngine(opts = {}) {
|
|
189
|
+
const pref = opts.engine || 'auto';
|
|
190
|
+
if (pref === 'wasm')
|
|
191
|
+
return { name: 'wasm', native: null };
|
|
192
|
+
if (pref === 'native' || pref === 'auto') {
|
|
193
|
+
const native = loadNative();
|
|
194
|
+
if (native)
|
|
195
|
+
return { name: 'native', native };
|
|
196
|
+
if (pref === 'native') {
|
|
197
|
+
getNative(); // throws with detailed error + install instructions
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return { name: 'wasm', native: null };
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Patch native engine output in-place for the few remaining semantic transforms.
|
|
204
|
+
* With #[napi(js_name)] on Rust types, most fields already arrive as camelCase.
|
|
205
|
+
* This only handles:
|
|
206
|
+
* - _lineCount compat for builder.js
|
|
207
|
+
* - Backward compat for older native binaries missing js_name annotations
|
|
208
|
+
* - dataflow argFlows/mutations bindingType → binding wrapper
|
|
209
|
+
*/
|
|
210
|
+
function patchNativeResult(r) {
|
|
211
|
+
// lineCount: napi(js_name) emits "lineCount"; older binaries may emit "line_count"
|
|
212
|
+
r.lineCount = r.lineCount ?? r.line_count ?? null;
|
|
213
|
+
r._lineCount = r.lineCount;
|
|
214
|
+
// Backward compat for older binaries missing js_name annotations
|
|
215
|
+
if (r.definitions) {
|
|
216
|
+
for (const d of r.definitions) {
|
|
217
|
+
if (d.endLine === undefined && d.end_line !== undefined) {
|
|
218
|
+
d.endLine = d.end_line;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (r.imports) {
|
|
223
|
+
for (const i of r.imports) {
|
|
224
|
+
if (i.typeOnly === undefined)
|
|
225
|
+
i.typeOnly = i.type_only;
|
|
226
|
+
if (i.wildcardReexport === undefined)
|
|
227
|
+
i.wildcardReexport = i.wildcard_reexport;
|
|
228
|
+
if (i.pythonImport === undefined)
|
|
229
|
+
i.pythonImport = i.python_import;
|
|
230
|
+
if (i.goImport === undefined)
|
|
231
|
+
i.goImport = i.go_import;
|
|
232
|
+
if (i.rustUse === undefined)
|
|
233
|
+
i.rustUse = i.rust_use;
|
|
234
|
+
if (i.javaImport === undefined)
|
|
235
|
+
i.javaImport = i.java_import;
|
|
236
|
+
if (i.csharpUsing === undefined)
|
|
237
|
+
i.csharpUsing = i.csharp_using;
|
|
238
|
+
if (i.rubyRequire === undefined)
|
|
239
|
+
i.rubyRequire = i.ruby_require;
|
|
240
|
+
if (i.phpUse === undefined)
|
|
241
|
+
i.phpUse = i.php_use;
|
|
242
|
+
if (i.dynamicImport === undefined)
|
|
243
|
+
i.dynamicImport = i.dynamic_import;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
// dataflow: wrap bindingType into binding object for argFlows and mutations
|
|
247
|
+
if (r.dataflow) {
|
|
248
|
+
if (r.dataflow.argFlows) {
|
|
249
|
+
for (const f of r.dataflow.argFlows) {
|
|
250
|
+
f.binding = f.bindingType ? { type: f.bindingType } : null;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
if (r.dataflow.mutations) {
|
|
254
|
+
for (const m of r.dataflow.mutations) {
|
|
255
|
+
m.binding = m.bindingType ? { type: m.bindingType } : null;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return r;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Declarative registry of all supported languages.
|
|
263
|
+
* Adding a new language requires only a new entry here + its extractor function.
|
|
264
|
+
*/
|
|
265
|
+
export const LANGUAGE_REGISTRY = [
|
|
266
|
+
{
|
|
267
|
+
id: 'javascript',
|
|
268
|
+
extensions: ['.js', '.jsx', '.mjs', '.cjs'],
|
|
269
|
+
grammarFile: 'tree-sitter-javascript.wasm',
|
|
270
|
+
extractor: extractSymbols,
|
|
271
|
+
required: true,
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: 'typescript',
|
|
275
|
+
extensions: ['.ts'],
|
|
276
|
+
grammarFile: 'tree-sitter-typescript.wasm',
|
|
277
|
+
extractor: extractSymbols,
|
|
278
|
+
required: true,
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
id: 'tsx',
|
|
282
|
+
extensions: ['.tsx'],
|
|
283
|
+
grammarFile: 'tree-sitter-tsx.wasm',
|
|
284
|
+
extractor: extractSymbols,
|
|
285
|
+
required: true,
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 'hcl',
|
|
289
|
+
extensions: ['.tf', '.hcl'],
|
|
290
|
+
grammarFile: 'tree-sitter-hcl.wasm',
|
|
291
|
+
extractor: extractHCLSymbols,
|
|
292
|
+
required: false,
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
id: 'python',
|
|
296
|
+
extensions: ['.py', '.pyi'],
|
|
297
|
+
grammarFile: 'tree-sitter-python.wasm',
|
|
298
|
+
extractor: extractPythonSymbols,
|
|
299
|
+
required: false,
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: 'go',
|
|
303
|
+
extensions: ['.go'],
|
|
304
|
+
grammarFile: 'tree-sitter-go.wasm',
|
|
305
|
+
extractor: extractGoSymbols,
|
|
306
|
+
required: false,
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
id: 'rust',
|
|
310
|
+
extensions: ['.rs'],
|
|
311
|
+
grammarFile: 'tree-sitter-rust.wasm',
|
|
312
|
+
extractor: extractRustSymbols,
|
|
313
|
+
required: false,
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 'java',
|
|
317
|
+
extensions: ['.java'],
|
|
318
|
+
grammarFile: 'tree-sitter-java.wasm',
|
|
319
|
+
extractor: extractJavaSymbols,
|
|
320
|
+
required: false,
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
id: 'csharp',
|
|
324
|
+
extensions: ['.cs'],
|
|
325
|
+
grammarFile: 'tree-sitter-c_sharp.wasm',
|
|
326
|
+
extractor: extractCSharpSymbols,
|
|
327
|
+
required: false,
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: 'ruby',
|
|
331
|
+
extensions: ['.rb', '.rake', '.gemspec'],
|
|
332
|
+
grammarFile: 'tree-sitter-ruby.wasm',
|
|
333
|
+
extractor: extractRubySymbols,
|
|
334
|
+
required: false,
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
id: 'php',
|
|
338
|
+
extensions: ['.php', '.phtml'],
|
|
339
|
+
grammarFile: 'tree-sitter-php.wasm',
|
|
340
|
+
extractor: extractPHPSymbols,
|
|
341
|
+
required: false,
|
|
342
|
+
},
|
|
343
|
+
];
|
|
344
|
+
const _extToLang = new Map();
|
|
345
|
+
for (const entry of LANGUAGE_REGISTRY) {
|
|
346
|
+
for (const ext of entry.extensions) {
|
|
347
|
+
_extToLang.set(ext, entry);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
export const SUPPORTED_EXTENSIONS = new Set(_extToLang.keys());
|
|
351
|
+
/**
|
|
352
|
+
* WASM-based typeMap backfill for older native binaries that don't emit typeMap.
|
|
353
|
+
* Uses tree-sitter AST extraction instead of regex to avoid false positives from
|
|
354
|
+
* matches inside comments and string literals.
|
|
355
|
+
* TODO: Remove once all published native binaries include typeMap extraction (>= 3.2.0)
|
|
356
|
+
*/
|
|
357
|
+
async function backfillTypeMap(filePath, source) {
|
|
358
|
+
let code = source;
|
|
359
|
+
if (!code) {
|
|
360
|
+
try {
|
|
361
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
362
|
+
}
|
|
363
|
+
catch {
|
|
364
|
+
return { typeMap: [], backfilled: false };
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const parsers = await createParsers();
|
|
368
|
+
const extracted = wasmExtractSymbols(parsers, filePath, code);
|
|
369
|
+
if (!extracted?.symbols?.typeMap)
|
|
370
|
+
return { typeMap: [], backfilled: false };
|
|
371
|
+
const tm = extracted.symbols.typeMap;
|
|
372
|
+
return {
|
|
373
|
+
typeMap: tm instanceof Map ? tm : new Map(tm.map((e) => [e.name, e.typeName])),
|
|
374
|
+
backfilled: true,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* WASM extraction helper: picks the right extractor based on file extension.
|
|
379
|
+
*/
|
|
380
|
+
function wasmExtractSymbols(parsers, filePath, code) {
|
|
381
|
+
const parser = getParser(parsers, filePath);
|
|
382
|
+
if (!parser)
|
|
383
|
+
return null;
|
|
384
|
+
let tree;
|
|
385
|
+
try {
|
|
386
|
+
tree = parser.parse(code);
|
|
387
|
+
}
|
|
388
|
+
catch (e) {
|
|
389
|
+
warn(`Parse error in ${filePath}: ${e.message}`);
|
|
390
|
+
return null;
|
|
391
|
+
}
|
|
392
|
+
const ext = path.extname(filePath);
|
|
393
|
+
const entry = _extToLang.get(ext);
|
|
394
|
+
if (!entry)
|
|
395
|
+
return null;
|
|
396
|
+
const query = _queryCache.get(entry.id) || null;
|
|
397
|
+
const symbols = entry.extractor(tree, filePath, query);
|
|
398
|
+
return symbols ? { symbols, tree, langId: entry.id } : null;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Parse a single file and return normalized symbols.
|
|
402
|
+
*
|
|
403
|
+
* @param {string} filePath Absolute path to the file.
|
|
404
|
+
* @param {string} source Source code string.
|
|
405
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
406
|
+
* @returns {Promise<{definitions, calls, imports, classes, exports}|null>}
|
|
407
|
+
*/
|
|
408
|
+
export async function parseFileAuto(filePath, source, opts = {}) {
|
|
409
|
+
const { native } = resolveEngine(opts);
|
|
410
|
+
if (native) {
|
|
411
|
+
const result = native.parseFile(filePath, source, !!opts.dataflow, opts.ast !== false);
|
|
412
|
+
if (!result)
|
|
413
|
+
return null;
|
|
414
|
+
const patched = patchNativeResult(result);
|
|
415
|
+
if (!patched.typeMap || patched.typeMap.length === 0) {
|
|
416
|
+
const { typeMap, backfilled } = await backfillTypeMap(filePath, source);
|
|
417
|
+
patched.typeMap = typeMap;
|
|
418
|
+
if (backfilled)
|
|
419
|
+
patched._typeMapBackfilled = true;
|
|
420
|
+
}
|
|
421
|
+
return patched;
|
|
422
|
+
}
|
|
423
|
+
// WASM path
|
|
424
|
+
const parsers = await createParsers();
|
|
425
|
+
const extracted = wasmExtractSymbols(parsers, filePath, source);
|
|
426
|
+
return extracted ? extracted.symbols : null;
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Parse multiple files in bulk and return a Map<relPath, symbols>.
|
|
430
|
+
*
|
|
431
|
+
* @param {string[]} filePaths Absolute paths to files.
|
|
432
|
+
* @param {string} rootDir Project root for computing relative paths.
|
|
433
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
434
|
+
* @returns {Promise<Map<string, {definitions, calls, imports, classes, exports}>>}
|
|
435
|
+
*/
|
|
436
|
+
export async function parseFilesAuto(filePaths, rootDir, opts = {}) {
|
|
437
|
+
const { native } = resolveEngine(opts);
|
|
438
|
+
const result = new Map();
|
|
439
|
+
if (native) {
|
|
440
|
+
const nativeResults = native.parseFiles(filePaths, rootDir, !!opts.dataflow, opts.ast !== false);
|
|
441
|
+
const needsTypeMap = [];
|
|
442
|
+
for (const r of nativeResults) {
|
|
443
|
+
if (!r)
|
|
444
|
+
continue;
|
|
445
|
+
const patched = patchNativeResult(r);
|
|
446
|
+
const relPath = path.relative(rootDir, r.file).split(path.sep).join('/');
|
|
447
|
+
result.set(relPath, patched);
|
|
448
|
+
if (!patched.typeMap || patched.typeMap.length === 0) {
|
|
449
|
+
needsTypeMap.push({ filePath: r.file, relPath });
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
// Backfill typeMap via WASM for native binaries that predate the type-map feature
|
|
453
|
+
if (needsTypeMap.length > 0) {
|
|
454
|
+
const parsers = await createParsers();
|
|
455
|
+
for (const { filePath, relPath } of needsTypeMap) {
|
|
456
|
+
try {
|
|
457
|
+
const code = fs.readFileSync(filePath, 'utf-8');
|
|
458
|
+
const extracted = wasmExtractSymbols(parsers, filePath, code);
|
|
459
|
+
if (extracted?.symbols?.typeMap) {
|
|
460
|
+
const symbols = result.get(relPath);
|
|
461
|
+
symbols.typeMap =
|
|
462
|
+
extracted.symbols.typeMap instanceof Map
|
|
463
|
+
? extracted.symbols.typeMap
|
|
464
|
+
: new Map(extracted.symbols.typeMap.map((e) => [e.name, e.typeName]));
|
|
465
|
+
symbols._typeMapBackfilled = true;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
catch {
|
|
469
|
+
/* skip — typeMap is a best-effort backfill */
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
return result;
|
|
474
|
+
}
|
|
475
|
+
// WASM path
|
|
476
|
+
const parsers = await createParsers();
|
|
477
|
+
for (const filePath of filePaths) {
|
|
478
|
+
let code;
|
|
479
|
+
try {
|
|
480
|
+
code = fs.readFileSync(filePath, 'utf-8');
|
|
481
|
+
}
|
|
482
|
+
catch (err) {
|
|
483
|
+
warn(`Skipping ${path.relative(rootDir, filePath)}: ${err.message}`);
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
const extracted = wasmExtractSymbols(parsers, filePath, code);
|
|
487
|
+
if (extracted) {
|
|
488
|
+
const relPath = path.relative(rootDir, filePath).split(path.sep).join('/');
|
|
489
|
+
extracted.symbols._tree = extracted.tree;
|
|
490
|
+
extracted.symbols._langId = extracted.langId;
|
|
491
|
+
extracted.symbols._lineCount = code.split('\n').length;
|
|
492
|
+
result.set(relPath, extracted.symbols);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return result;
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Report which engine is active.
|
|
499
|
+
*
|
|
500
|
+
* @param {object} [opts] Options: { engine: 'native'|'wasm'|'auto' }
|
|
501
|
+
* @returns {{ name: 'native'|'wasm', version: string|null }}
|
|
502
|
+
*/
|
|
503
|
+
export function getActiveEngine(opts = {}) {
|
|
504
|
+
const { name, native } = resolveEngine(opts);
|
|
505
|
+
let version = native
|
|
506
|
+
? typeof native.engineVersion === 'function'
|
|
507
|
+
? native.engineVersion()
|
|
508
|
+
: null
|
|
509
|
+
: null;
|
|
510
|
+
// Prefer platform package.json version over binary-embedded version
|
|
511
|
+
// to handle stale binaries that weren't recompiled during a release
|
|
512
|
+
if (native) {
|
|
513
|
+
try {
|
|
514
|
+
version = getNativePackageVersion() ?? version;
|
|
515
|
+
}
|
|
516
|
+
catch (e) {
|
|
517
|
+
debug(`getNativePackageVersion failed: ${e.message}`);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return { name, version };
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Create a native ParseTreeCache for incremental parsing.
|
|
524
|
+
* Returns null if the native engine is unavailable (WASM fallback).
|
|
525
|
+
*/
|
|
526
|
+
export function createParseTreeCache() {
|
|
527
|
+
const native = loadNative();
|
|
528
|
+
if (!native || !native.ParseTreeCache)
|
|
529
|
+
return null;
|
|
530
|
+
return new native.ParseTreeCache();
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Parse a file incrementally using the cache, or fall back to full parse.
|
|
534
|
+
*
|
|
535
|
+
* @param {object|null} cache ParseTreeCache instance (or null for full parse)
|
|
536
|
+
* @param {string} filePath Absolute path to the file
|
|
537
|
+
* @param {string} source Source code string
|
|
538
|
+
* @param {object} [opts] Options forwarded to parseFileAuto on fallback
|
|
539
|
+
* @returns {Promise<{definitions, calls, imports, classes, exports}|null>}
|
|
540
|
+
*/
|
|
541
|
+
export async function parseFileIncremental(cache, filePath, source, opts = {}) {
|
|
542
|
+
if (cache) {
|
|
543
|
+
const result = cache.parseFile(filePath, source);
|
|
544
|
+
if (!result)
|
|
545
|
+
return null;
|
|
546
|
+
const patched = patchNativeResult(result);
|
|
547
|
+
if (!patched.typeMap || patched.typeMap.length === 0) {
|
|
548
|
+
const { typeMap, backfilled } = await backfillTypeMap(filePath, source);
|
|
549
|
+
patched.typeMap = typeMap;
|
|
550
|
+
if (backfilled)
|
|
551
|
+
patched._typeMapBackfilled = true;
|
|
552
|
+
}
|
|
553
|
+
return patched;
|
|
554
|
+
}
|
|
555
|
+
return parseFileAuto(filePath, source, opts);
|
|
556
|
+
}
|
|
557
|
+
//# sourceMappingURL=parser.js.map
|