@optave/codegraph 3.2.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -54
- package/dist/ast-analysis/engine.d.ts +17 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +328 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +51 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +106 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +24 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +192 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +24 -0
- package/dist/ast-analysis/rules/go.d.ts.map +1 -0
- package/dist/ast-analysis/rules/go.js +173 -0
- package/dist/ast-analysis/rules/go.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts +31 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +72 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +24 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +166 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +31 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +235 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +24 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +210 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +24 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +188 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +24 -0
- package/dist/ast-analysis/rules/ruby.d.ts.map +1 -0
- package/dist/ast-analysis/rules/ruby.js +193 -0
- package/dist/ast-analysis/rules/ruby.js.map +1 -0
- package/dist/ast-analysis/rules/rust.d.ts +24 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +165 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +106 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +186 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +41 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +180 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +119 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +146 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +11 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +147 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +660 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +17 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +216 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +321 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +9 -0
- package/dist/cli/commands/ast.d.ts.map +1 -0
- package/dist/cli/commands/ast.js +23 -0
- package/dist/cli/commands/ast.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +9 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +46 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +9 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +70 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +7 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +22 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +7 -0
- package/dist/cli/commands/brief.d.ts.map +1 -0
- package/dist/cli/commands/brief.js +12 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/build.d.ts +7 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +26 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +10 -0
- package/dist/cli/commands/cfg.d.ts.map +1 -0
- package/dist/cli/commands/cfg.js +27 -0
- package/dist/cli/commands/cfg.js.map +1 -0
- package/dist/cli/commands/check.d.ts +8 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +65 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/children.d.ts +9 -0
- package/dist/cli/commands/children.d.ts.map +1 -0
- package/dist/cli/commands/children.js +33 -0
- package/dist/cli/commands/children.js.map +1 -0
- package/dist/cli/commands/co-change.d.ts +7 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +62 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +8 -0
- package/dist/cli/commands/communities.d.ts.map +1 -0
- package/dist/cli/commands/communities.js +20 -0
- package/dist/cli/commands/communities.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +9 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +47 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/context.d.ts +10 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +35 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +7 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +33 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/dataflow.d.ts +10 -0
- package/dist/cli/commands/dataflow.d.ts.map +1 -0
- package/dist/cli/commands/dataflow.js +29 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +8 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +18 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/diff-impact.d.ts +7 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +28 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +8 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +29 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +7 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +72 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/exports.d.ts +8 -0
- package/dist/cli/commands/exports.d.ts.map +1 -0
- package/dist/cli/commands/exports.js +14 -0
- package/dist/cli/commands/exports.js.map +1 -0
- package/dist/cli/commands/flow.d.ts +10 -0
- package/dist/cli/commands/flow.d.ts.map +1 -0
- package/dist/cli/commands/flow.js +32 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/fn-impact.d.ts +10 -0
- package/dist/cli/commands/fn-impact.d.ts.map +1 -0
- package/dist/cli/commands/fn-impact.js +33 -0
- package/dist/cli/commands/fn-impact.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +7 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +12 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/implementations.d.ts +10 -0
- package/dist/cli/commands/implementations.d.ts.map +1 -0
- package/dist/cli/commands/implementations.js +29 -0
- package/dist/cli/commands/implementations.js.map +1 -0
- package/dist/cli/commands/info.d.ts +6 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +66 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +10 -0
- package/dist/cli/commands/interfaces.d.ts.map +1 -0
- package/dist/cli/commands/interfaces.js +29 -0
- package/dist/cli/commands/interfaces.js.map +1 -0
- package/dist/cli/commands/map.d.ts +7 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +19 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +7 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +19 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +6 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +17 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +8 -0
- package/dist/cli/commands/owners.d.ts.map +1 -0
- package/dist/cli/commands/owners.js +27 -0
- package/dist/cli/commands/owners.js.map +1 -0
- package/dist/cli/commands/path.d.ts +8 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +36 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +7 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +94 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +10 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/registry.d.ts +16 -0
- package/dist/cli/commands/registry.d.ts.map +1 -0
- package/dist/cli/commands/registry.js +95 -0
- package/dist/cli/commands/registry.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +9 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +31 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +9 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +47 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +10 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +29 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +11 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +61 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +7 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +15 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/structure.d.ts +7 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +33 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +8 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +89 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +6 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +12 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +9 -0
- package/dist/cli/commands/where.d.ts.map +1 -0
- package/dist/cli/commands/where.js +20 -0
- package/dist/cli/commands/where.js.map +1 -0
- package/dist/cli/index.d.ts +31 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +109 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +14 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +13 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +31 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +58 -0
- package/dist/cli/shared/options.js.map +1 -0
- package/dist/cli/shared/output.d.ts +2 -0
- package/dist/cli/shared/output.d.ts.map +1 -0
- package/dist/cli/shared/output.js +2 -0
- package/dist/cli/shared/output.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +15 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/connection.d.ts +39 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +217 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +5 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +6 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +8 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +323 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +106 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +313 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +115 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +165 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +25 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +86 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +13 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +20 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +27 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +57 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +20 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +45 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +15 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +15 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +7 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +17 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +173 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +231 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +20 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +47 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +41 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +41 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +156 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +533 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +14 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +15 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +151 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +244 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +100 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +143 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +16 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +147 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +3 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +378 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +60 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +359 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +2 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +168 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +39 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +611 -0
- package/dist/domain/analysis/impact.js.map +1 -0
- package/dist/domain/analysis/implementations.d.ts +59 -0
- package/dist/domain/analysis/implementations.d.ts.map +1 -0
- package/dist/domain/analysis/implementations.js +93 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +64 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +334 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +2 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +50 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +12 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +202 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +91 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -0
- package/dist/domain/graph/builder/context.js +78 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +43 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +209 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +17 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +426 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +13 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +146 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +387 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +5 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +107 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +45 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +358 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +5 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +123 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +5 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +183 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +5 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +25 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +18 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +139 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +5 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +39 -0
- package/dist/domain/graph/builder/stages/run-analyses.js.map +1 -0
- package/dist/domain/graph/builder.d.ts +4 -0
- package/dist/domain/graph/builder.d.ts.map +1 -0
- package/dist/domain/graph/builder.js +6 -0
- package/dist/domain/graph/builder.js.map +1 -0
- package/dist/domain/graph/change-journal.d.ts +57 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +120 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +18 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +75 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +27 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +100 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +76 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +482 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +2 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +140 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +104 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +593 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +14 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +25 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +17 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +135 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +8 -0
- package/dist/domain/search/index.d.ts.map +1 -0
- package/dist/domain/search/index.js +13 -0
- package/dist/domain/search/index.js.map +1 -0
- package/dist/domain/search/models.d.ts +82 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +198 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +6 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +135 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +19 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +48 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +22 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +113 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +17 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +66 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +13 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +70 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +34 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +129 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +11 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +31 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +27 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +22 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +5 -0
- package/dist/domain/search/strategies/source.d.ts.map +1 -0
- package/dist/domain/search/strategies/source.js +14 -0
- package/dist/domain/search/strategies/source.js.map +1 -0
- package/dist/domain/search/strategies/structured.d.ts +6 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +40 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +11 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +47 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/extractors/csharp.d.ts +12 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +402 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/go.d.ts +12 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +381 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/hcl.d.ts +11 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +105 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +16 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +88 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +10 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +10 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +12 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +325 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +81 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +1232 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/php.d.ts +12 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +380 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +12 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +426 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/ruby.d.ts +11 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +284 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +12 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +366 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/features/ast.d.ts +30 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +242 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +6 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +283 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +110 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +138 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +69 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +344 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +52 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +425 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +51 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +372 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +99 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +296 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +119 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +425 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +40 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +163 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity.d.ts +127 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +683 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +72 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +483 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +29 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +336 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +49 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +203 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +54 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +297 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +46 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +398 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +123 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +289 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +33 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +269 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +11 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +27 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +64 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +132 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure.d.ts +42 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +596 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +13 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +133 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +13 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +47 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +11 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +17 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +6 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +6 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +5 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +22 -0
- package/dist/graph/algorithms/louvain.js.map +1 -0
- package/dist/graph/algorithms/shortest-path.d.ts +10 -0
- package/dist/graph/algorithms/shortest-path.d.ts.map +1 -0
- package/dist/graph/algorithms/shortest-path.js +41 -0
- package/dist/graph/algorithms/shortest-path.js.map +1 -0
- package/dist/graph/algorithms/tarjan.d.ts +9 -0
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -0
- package/dist/graph/algorithms/tarjan.js +48 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +15 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +99 -0
- package/dist/graph/builders/dependency.js.map +1 -0
- package/dist/graph/builders/index.d.ts +4 -0
- package/dist/graph/builders/index.d.ts.map +1 -0
- package/dist/graph/builders/index.js +4 -0
- package/dist/graph/builders/index.js.map +1 -0
- package/dist/graph/builders/structure.d.ts +7 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +32 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +10 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +31 -0
- package/dist/graph/builders/temporal.js.map +1 -0
- package/dist/graph/classifiers/index.d.ts +3 -0
- package/dist/graph/classifiers/index.d.ts.map +1 -0
- package/dist/graph/classifiers/index.js +3 -0
- package/dist/graph/classifiers/index.js.map +1 -0
- package/dist/graph/classifiers/risk.d.ts +49 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +84 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +29 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +109 -0
- package/dist/graph/classifiers/roles.js.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model.d.ts +53 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +210 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +18 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/config.d.ts +228 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +404 -0
- package/dist/infrastructure/config.js.map +1 -0
- package/dist/infrastructure/logger.d.ts +7 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/logger.js +21 -0
- package/dist/infrastructure/logger.js.map +1 -0
- package/dist/infrastructure/native.d.ts +19 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +105 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +57 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +157 -0
- package/dist/infrastructure/registry.js.map +1 -0
- package/dist/infrastructure/result-formatter.d.ts +2 -0
- package/dist/infrastructure/result-formatter.d.ts.map +1 -0
- package/dist/infrastructure/result-formatter.js +3 -0
- package/dist/infrastructure/result-formatter.js.map +1 -0
- package/dist/infrastructure/test-filter.d.ts +5 -0
- package/dist/infrastructure/test-filter.d.ts.map +1 -0
- package/dist/infrastructure/test-filter.js +7 -0
- package/dist/infrastructure/test-filter.js.map +1 -0
- package/dist/infrastructure/update-check.d.ts +24 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +150 -0
- package/dist/infrastructure/update-check.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/middleware.d.ts +26 -0
- package/dist/mcp/middleware.d.ts.map +1 -0
- package/dist/mcp/middleware.js +38 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +120 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +8 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +819 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +9 -0
- package/dist/mcp/tools/ast-query.d.ts.map +1 -0
- package/dist/mcp/tools/ast-query.js +13 -0
- package/dist/mcp/tools/ast-query.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts +3 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -0
- package/dist/mcp/tools/audit.js +20 -0
- package/dist/mcp/tools/audit.js.map +1 -0
- package/dist/mcp/tools/batch-query.d.ts +9 -0
- package/dist/mcp/tools/batch-query.d.ts.map +1 -0
- package/dist/mcp/tools/batch-query.js +11 -0
- package/dist/mcp/tools/batch-query.js.map +1 -0
- package/dist/mcp/tools/branch-compare.d.ts +3 -0
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -0
- package/dist/mcp/tools/branch-compare.js +10 -0
- package/dist/mcp/tools/branch-compare.js.map +1 -0
- package/dist/mcp/tools/brief.d.ts +3 -0
- package/dist/mcp/tools/brief.d.ts.map +1 -0
- package/dist/mcp/tools/brief.js +8 -0
- package/dist/mcp/tools/brief.js.map +1 -0
- package/dist/mcp/tools/cfg.d.ts +10 -0
- package/dist/mcp/tools/cfg.d.ts.map +1 -0
- package/dist/mcp/tools/cfg.js +20 -0
- package/dist/mcp/tools/cfg.js.map +1 -0
- package/dist/mcp/tools/check.d.ts +24 -0
- package/dist/mcp/tools/check.d.ts.map +1 -0
- package/dist/mcp/tools/check.js +39 -0
- package/dist/mcp/tools/check.js.map +1 -0
- package/dist/mcp/tools/co-changes.d.ts +10 -0
- package/dist/mcp/tools/co-changes.d.ts.map +1 -0
- package/dist/mcp/tools/co-changes.js +19 -0
- package/dist/mcp/tools/co-changes.js.map +1 -0
- package/dist/mcp/tools/code-owners.d.ts +48 -0
- package/dist/mcp/tools/code-owners.d.ts.map +1 -0
- package/dist/mcp/tools/code-owners.js +12 -0
- package/dist/mcp/tools/code-owners.js.map +1 -0
- package/dist/mcp/tools/communities.d.ts +8 -0
- package/dist/mcp/tools/communities.d.ts.map +1 -0
- package/dist/mcp/tools/communities.js +14 -0
- package/dist/mcp/tools/communities.js.map +1 -0
- package/dist/mcp/tools/complexity.d.ts +7 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +17 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.d.ts.map +1 -0
- package/dist/mcp/tools/context.js +16 -0
- package/dist/mcp/tools/context.js.map +1 -0
- package/dist/mcp/tools/dataflow.d.ts +6 -0
- package/dist/mcp/tools/dataflow.d.ts.map +1 -0
- package/dist/mcp/tools/dataflow.js +25 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/diff-impact.d.ts +3 -0
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -0
- package/dist/mcp/tools/diff-impact.js +23 -0
- package/dist/mcp/tools/diff-impact.js.map +1 -0
- package/dist/mcp/tools/execution-flow.d.ts +17 -0
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -0
- package/dist/mcp/tools/execution-flow.js +25 -0
- package/dist/mcp/tools/execution-flow.js.map +1 -0
- package/dist/mcp/tools/export-graph.d.ts +3 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +55 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +3 -0
- package/dist/mcp/tools/file-deps.d.ts.map +1 -0
- package/dist/mcp/tools/file-deps.js +11 -0
- package/dist/mcp/tools/file-deps.js.map +1 -0
- package/dist/mcp/tools/file-exports.d.ts +3 -0
- package/dist/mcp/tools/file-exports.d.ts.map +1 -0
- package/dist/mcp/tools/file-exports.js +12 -0
- package/dist/mcp/tools/file-exports.js.map +1 -0
- package/dist/mcp/tools/find-cycles.d.ts +6 -0
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -0
- package/dist/mcp/tools/find-cycles.js +15 -0
- package/dist/mcp/tools/find-cycles.js.map +1 -0
- package/dist/mcp/tools/fn-impact.d.ts +3 -0
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -0
- package/dist/mcp/tools/fn-impact.js +14 -0
- package/dist/mcp/tools/fn-impact.js.map +1 -0
- package/dist/mcp/tools/impact-analysis.d.ts +3 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +11 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +3 -0
- package/dist/mcp/tools/implementations.d.ts.map +1 -0
- package/dist/mcp/tools/implementations.js +13 -0
- package/dist/mcp/tools/implementations.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +3 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +76 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/interfaces.d.ts +3 -0
- package/dist/mcp/tools/interfaces.d.ts.map +1 -0
- package/dist/mcp/tools/interfaces.js +13 -0
- package/dist/mcp/tools/interfaces.js.map +1 -0
- package/dist/mcp/tools/list-functions.d.ts +3 -0
- package/dist/mcp/tools/list-functions.d.ts.map +1 -0
- package/dist/mcp/tools/list-functions.js +13 -0
- package/dist/mcp/tools/list-functions.js.map +1 -0
- package/dist/mcp/tools/list-repos.d.ts +11 -0
- package/dist/mcp/tools/list-repos.d.ts.map +1 -0
- package/dist/mcp/tools/list-repos.js +11 -0
- package/dist/mcp/tools/list-repos.js.map +1 -0
- package/dist/mcp/tools/module-map.d.ts +3 -0
- package/dist/mcp/tools/module-map.d.ts.map +1 -0
- package/dist/mcp/tools/module-map.js +6 -0
- package/dist/mcp/tools/module-map.js.map +1 -0
- package/dist/mcp/tools/node-roles.d.ts +3 -0
- package/dist/mcp/tools/node-roles.d.ts.map +1 -0
- package/dist/mcp/tools/node-roles.js +13 -0
- package/dist/mcp/tools/node-roles.js.map +1 -0
- package/dist/mcp/tools/path.d.ts +3 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +12 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +3 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +29 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/semantic-search.d.ts +46 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +61 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +18 -0
- package/dist/mcp/tools/sequence.d.ts.map +1 -0
- package/dist/mcp/tools/sequence.js +16 -0
- package/dist/mcp/tools/sequence.js.map +1 -0
- package/dist/mcp/tools/structure.d.ts +3 -0
- package/dist/mcp/tools/structure.d.ts.map +1 -0
- package/dist/mcp/tools/structure.js +14 -0
- package/dist/mcp/tools/structure.js.map +1 -0
- package/dist/mcp/tools/symbol-children.d.ts +3 -0
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -0
- package/dist/mcp/tools/symbol-children.js +13 -0
- package/dist/mcp/tools/symbol-children.js.map +1 -0
- package/dist/mcp/tools/triage.d.ts +3 -0
- package/dist/mcp/tools/triage.d.ts.map +1 -0
- package/dist/mcp/tools/triage.js +34 -0
- package/dist/mcp/tools/triage.js.map +1 -0
- package/dist/mcp/tools/where.d.ts +3 -0
- package/dist/mcp/tools/where.d.ts.map +1 -0
- package/dist/mcp/tools/where.js +12 -0
- package/dist/mcp/tools/where.js.map +1 -0
- package/dist/presentation/audit.d.ts +5 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +77 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +10 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +25 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +2 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +75 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +12 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +49 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +5 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +50 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +5 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +70 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +9 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +39 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +26 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +42 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +5 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +56 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +5 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +56 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +5 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +96 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/export.d.ts +137 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +374 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +5 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +64 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +5 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +56 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +5 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +45 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +2 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +94 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +6 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +196 -0
- package/dist/presentation/queries-cli/impact.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +6 -0
- package/dist/presentation/queries-cli/index.d.ts.map +1 -0
- package/dist/presentation/queries-cli/index.js +6 -0
- package/dist/presentation/queries-cli/index.js.map +1 -0
- package/dist/presentation/queries-cli/inspect.d.ts +8 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +353 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +4 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +163 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +2 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +51 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +2 -0
- package/dist/presentation/queries-cli.d.ts.map +1 -0
- package/dist/presentation/queries-cli.js +12 -0
- package/dist/presentation/queries-cli.js.map +1 -0
- package/dist/presentation/query.d.ts +2 -0
- package/dist/presentation/query.d.ts.map +1 -0
- package/dist/presentation/query.js +6 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +10 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +134 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +12 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +36 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +5 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +29 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +8 -0
- package/dist/presentation/structure.d.ts.map +1 -0
- package/dist/presentation/structure.js +50 -0
- package/dist/presentation/structure.js.map +1 -0
- package/dist/presentation/table.d.ts +28 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +39 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +5 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +37 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +85 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +621 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +11 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +35 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +47 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +69 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/file-utils.d.ts +14 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +165 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +62 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +120 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +2 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +27 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +11 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +56 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +19 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +59 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +80 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +111 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/types.d.ts +1322 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/package.json +22 -15
- package/src/cli/commands/ast.js +1 -1
- package/src/cli/commands/diff-impact.js +2 -0
- package/src/cli/commands/fn-impact.js +2 -0
- package/src/cli/commands/implementations.js +29 -0
- package/src/cli/commands/info.js +2 -2
- package/src/cli/commands/interfaces.js +29 -0
- package/src/cli/commands/roles.js +2 -1
- package/src/cli/commands/triage.js +4 -1
- package/src/db/index.js +2 -0
- package/src/db/query-builder.js +9 -4
- package/src/db/repository/edges.js +38 -0
- package/src/db/repository/in-memory-repository.js +11 -2
- package/src/db/repository/index.js +2 -0
- package/src/domain/analysis/brief.js +12 -6
- package/src/domain/analysis/context.js +74 -20
- package/src/domain/analysis/exports.js +81 -10
- package/src/domain/analysis/impact.js +100 -6
- package/src/domain/analysis/implementations.js +98 -0
- package/src/domain/analysis/module-map.js +13 -4
- package/src/domain/analysis/roles.js +8 -2
- package/src/domain/graph/builder/incremental.js +317 -6
- package/src/domain/graph/builder/pipeline.js +9 -1
- package/src/domain/graph/builder/stages/build-edges.js +117 -20
- package/src/domain/graph/resolve.js +315 -1
- package/src/domain/parser.js +107 -6
- package/src/domain/queries.js +1 -0
- package/src/domain/search/search/hybrid.js +7 -4
- package/src/domain/search/search/semantic.js +11 -6
- package/src/extractors/csharp.js +62 -0
- package/src/extractors/go.js +141 -0
- package/src/extractors/java.js +29 -3
- package/src/extractors/javascript.js +163 -1
- package/src/extractors/php.js +43 -0
- package/src/extractors/python.js +130 -0
- package/src/extractors/rust.js +60 -0
- package/src/features/audit.js +2 -1
- package/src/features/communities.js +3 -1
- package/src/features/graph-enrichment.js +1 -1
- package/src/features/sequence.js +3 -1
- package/src/features/structure.js +33 -4
- package/src/features/triage.js +9 -2
- package/src/graph/classifiers/risk.js +9 -2
- package/src/graph/classifiers/roles.js +51 -3
- package/src/infrastructure/config.js +278 -7
- package/src/mcp/middleware.js +20 -2
- package/src/mcp/server.js +6 -0
- package/src/mcp/tool-registry.js +40 -1
- package/src/mcp/tools/implementations.js +14 -0
- package/src/mcp/tools/index.js +4 -0
- package/src/mcp/tools/interfaces.js +14 -0
- package/src/mcp/tools/semantic-search.js +3 -3
- package/src/presentation/queries-cli/exports.js +54 -4
- package/src/presentation/queries-cli/index.js +9 -1
- package/src/presentation/queries-cli/inspect.js +64 -0
- package/src/presentation/queries-cli.js +3 -1
- package/src/presentation/result-formatter.js +9 -5
- package/src/shared/file-utils.js +20 -11
- package/src/shared/kinds.js +14 -1
- package/src/shared/paginate.js +10 -2
- package/src/types.ts +1609 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-lookup.d.ts","sourceRoot":"","sources":["../../../src/domain/analysis/symbol-lookup.js"],"names":[],"mappings":"AAwBA;;;;;GAKG;AACH,4CAFW,MAAM,kCAkChB;AAED,+EA6CC;AAqDD,6EAaC;AAED,wEAgBC;AAED,8EA4CC"}
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
import { countCrossFileCallers, findAllIncomingEdges, findAllOutgoingEdges, findCallers, findCrossFileCallTargets, findFileNodes, findImportSources, findImportTargets, findNodeChildren, findNodesByFile, findNodesWithFanIn, listFunctionNodes, openReadonlyOrFail, Repository, } from '../../db/index.js';
|
|
2
|
+
import { debug } from '../../infrastructure/logger.js';
|
|
3
|
+
import { isTestFile } from '../../infrastructure/test-filter.js';
|
|
4
|
+
import { EVERY_SYMBOL_KIND } from '../../shared/kinds.js';
|
|
5
|
+
import { getFileHash, normalizeSymbol } from '../../shared/normalize.js';
|
|
6
|
+
import { paginateResult } from '../../shared/paginate.js';
|
|
7
|
+
const FUNCTION_KINDS = ['function', 'method', 'class', 'constant'];
|
|
8
|
+
/**
|
|
9
|
+
* Find nodes matching a name query, ranked by relevance.
|
|
10
|
+
* Scoring: exact=100, prefix=60, word-boundary=40, substring=10, plus fan-in tiebreaker.
|
|
11
|
+
*
|
|
12
|
+
* @param {object} dbOrRepo - A better-sqlite3 Database or a Repository instance
|
|
13
|
+
*/
|
|
14
|
+
export function findMatchingNodes(dbOrRepo, name, opts = {}) {
|
|
15
|
+
const kinds = opts.kind ? [opts.kind] : opts.kinds?.length ? opts.kinds : FUNCTION_KINDS;
|
|
16
|
+
const isRepo = dbOrRepo instanceof Repository;
|
|
17
|
+
const rows = isRepo
|
|
18
|
+
? dbOrRepo.findNodesWithFanIn(`%${name}%`, { kinds, file: opts.file })
|
|
19
|
+
: findNodesWithFanIn(dbOrRepo, `%${name}%`, { kinds, file: opts.file });
|
|
20
|
+
const nodes = opts.noTests ? rows.filter((n) => !isTestFile(n.file)) : rows;
|
|
21
|
+
const lowerQuery = name.toLowerCase();
|
|
22
|
+
for (const node of nodes) {
|
|
23
|
+
const lowerName = node.name.toLowerCase();
|
|
24
|
+
const bareName = lowerName.includes('.') ? lowerName.split('.').pop() : lowerName;
|
|
25
|
+
let matchScore;
|
|
26
|
+
if (lowerName === lowerQuery || bareName === lowerQuery) {
|
|
27
|
+
matchScore = 100;
|
|
28
|
+
}
|
|
29
|
+
else if (lowerName.startsWith(lowerQuery) || bareName.startsWith(lowerQuery)) {
|
|
30
|
+
matchScore = 60;
|
|
31
|
+
}
|
|
32
|
+
else if (lowerName.includes(`.${lowerQuery}`) || lowerName.includes(`${lowerQuery}.`)) {
|
|
33
|
+
matchScore = 40;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
matchScore = 10;
|
|
37
|
+
}
|
|
38
|
+
const fanInBonus = Math.min(Math.log2(node.fan_in + 1) * 5, 25);
|
|
39
|
+
node._relevance = matchScore + fanInBonus;
|
|
40
|
+
}
|
|
41
|
+
nodes.sort((a, b) => b._relevance - a._relevance);
|
|
42
|
+
return nodes;
|
|
43
|
+
}
|
|
44
|
+
export function queryNameData(name, customDbPath, opts = {}) {
|
|
45
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
46
|
+
try {
|
|
47
|
+
const noTests = opts.noTests || false;
|
|
48
|
+
let nodes = db.prepare(`SELECT * FROM nodes WHERE name LIKE ?`).all(`%${name}%`);
|
|
49
|
+
if (noTests)
|
|
50
|
+
nodes = nodes.filter((n) => !isTestFile(n.file));
|
|
51
|
+
if (nodes.length === 0) {
|
|
52
|
+
return { query: name, results: [] };
|
|
53
|
+
}
|
|
54
|
+
const hc = new Map();
|
|
55
|
+
const results = nodes.map((node) => {
|
|
56
|
+
let callees = findAllOutgoingEdges(db, node.id);
|
|
57
|
+
let callers = findAllIncomingEdges(db, node.id);
|
|
58
|
+
if (noTests) {
|
|
59
|
+
callees = callees.filter((c) => !isTestFile(c.file));
|
|
60
|
+
callers = callers.filter((c) => !isTestFile(c.file));
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
...normalizeSymbol(node, db, hc),
|
|
64
|
+
callees: callees.map((c) => ({
|
|
65
|
+
name: c.name,
|
|
66
|
+
kind: c.kind,
|
|
67
|
+
file: c.file,
|
|
68
|
+
line: c.line,
|
|
69
|
+
edgeKind: c.edge_kind,
|
|
70
|
+
})),
|
|
71
|
+
callers: callers.map((c) => ({
|
|
72
|
+
name: c.name,
|
|
73
|
+
kind: c.kind,
|
|
74
|
+
file: c.file,
|
|
75
|
+
line: c.line,
|
|
76
|
+
edgeKind: c.edge_kind,
|
|
77
|
+
})),
|
|
78
|
+
};
|
|
79
|
+
});
|
|
80
|
+
const base = { query: name, results };
|
|
81
|
+
return paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
82
|
+
}
|
|
83
|
+
finally {
|
|
84
|
+
db.close();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function whereSymbolImpl(db, target, noTests) {
|
|
88
|
+
const placeholders = EVERY_SYMBOL_KIND.map(() => '?').join(', ');
|
|
89
|
+
let nodes = db
|
|
90
|
+
.prepare(`SELECT * FROM nodes WHERE name LIKE ? AND kind IN (${placeholders}) ORDER BY file, line`)
|
|
91
|
+
.all(`%${target}%`, ...EVERY_SYMBOL_KIND);
|
|
92
|
+
if (noTests)
|
|
93
|
+
nodes = nodes.filter((n) => !isTestFile(n.file));
|
|
94
|
+
const hc = new Map();
|
|
95
|
+
return nodes.map((node) => {
|
|
96
|
+
const crossCount = countCrossFileCallers(db, node.id, node.file);
|
|
97
|
+
const exported = crossCount > 0;
|
|
98
|
+
let uses = findCallers(db, node.id);
|
|
99
|
+
if (noTests)
|
|
100
|
+
uses = uses.filter((u) => !isTestFile(u.file));
|
|
101
|
+
return {
|
|
102
|
+
...normalizeSymbol(node, db, hc),
|
|
103
|
+
exported,
|
|
104
|
+
uses: uses.map((u) => ({ name: u.name, file: u.file, line: u.line })),
|
|
105
|
+
};
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function whereFileImpl(db, target) {
|
|
109
|
+
const fileNodes = findFileNodes(db, `%${target}%`);
|
|
110
|
+
if (fileNodes.length === 0)
|
|
111
|
+
return [];
|
|
112
|
+
return fileNodes.map((fn) => {
|
|
113
|
+
const symbols = findNodesByFile(db, fn.file);
|
|
114
|
+
const imports = findImportTargets(db, fn.id).map((r) => r.file);
|
|
115
|
+
const importedBy = findImportSources(db, fn.id).map((r) => r.file);
|
|
116
|
+
const exportedIds = findCrossFileCallTargets(db, fn.file);
|
|
117
|
+
const exported = symbols.filter((s) => exportedIds.has(s.id)).map((s) => s.name);
|
|
118
|
+
return {
|
|
119
|
+
file: fn.file,
|
|
120
|
+
fileHash: getFileHash(db, fn.file),
|
|
121
|
+
symbols: symbols.map((s) => ({ name: s.name, kind: s.kind, line: s.line })),
|
|
122
|
+
imports,
|
|
123
|
+
importedBy,
|
|
124
|
+
exported,
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
export function whereData(target, customDbPath, opts = {}) {
|
|
129
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
130
|
+
try {
|
|
131
|
+
const noTests = opts.noTests || false;
|
|
132
|
+
const fileMode = opts.file || false;
|
|
133
|
+
const results = fileMode ? whereFileImpl(db, target) : whereSymbolImpl(db, target, noTests);
|
|
134
|
+
const base = { target, mode: fileMode ? 'file' : 'symbol', results };
|
|
135
|
+
return paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
136
|
+
}
|
|
137
|
+
finally {
|
|
138
|
+
db.close();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
export function listFunctionsData(customDbPath, opts = {}) {
|
|
142
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
143
|
+
try {
|
|
144
|
+
const noTests = opts.noTests || false;
|
|
145
|
+
let rows = listFunctionNodes(db, { file: opts.file, pattern: opts.pattern });
|
|
146
|
+
if (noTests)
|
|
147
|
+
rows = rows.filter((r) => !isTestFile(r.file));
|
|
148
|
+
const hc = new Map();
|
|
149
|
+
const functions = rows.map((r) => normalizeSymbol(r, db, hc));
|
|
150
|
+
const base = { count: functions.length, functions };
|
|
151
|
+
return paginateResult(base, 'functions', { limit: opts.limit, offset: opts.offset });
|
|
152
|
+
}
|
|
153
|
+
finally {
|
|
154
|
+
db.close();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export function childrenData(name, customDbPath, opts = {}) {
|
|
158
|
+
const db = openReadonlyOrFail(customDbPath);
|
|
159
|
+
try {
|
|
160
|
+
const noTests = opts.noTests || false;
|
|
161
|
+
const nodes = findMatchingNodes(db, name, { noTests, file: opts.file, kind: opts.kind });
|
|
162
|
+
if (nodes.length === 0) {
|
|
163
|
+
return { name, results: [] };
|
|
164
|
+
}
|
|
165
|
+
const results = nodes.map((node) => {
|
|
166
|
+
let children;
|
|
167
|
+
try {
|
|
168
|
+
children = findNodeChildren(db, node.id);
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
debug(`findNodeChildren failed for node ${node.id}: ${e.message}`);
|
|
172
|
+
children = [];
|
|
173
|
+
}
|
|
174
|
+
if (noTests)
|
|
175
|
+
children = children.filter((c) => !isTestFile(c.file || node.file));
|
|
176
|
+
return {
|
|
177
|
+
name: node.name,
|
|
178
|
+
kind: node.kind,
|
|
179
|
+
file: node.file,
|
|
180
|
+
line: node.line,
|
|
181
|
+
scope: node.scope || null,
|
|
182
|
+
visibility: node.visibility || null,
|
|
183
|
+
qualifiedName: node.qualified_name || null,
|
|
184
|
+
children: children.map((c) => ({
|
|
185
|
+
name: c.name,
|
|
186
|
+
kind: c.kind,
|
|
187
|
+
line: c.line,
|
|
188
|
+
endLine: c.end_line || null,
|
|
189
|
+
qualifiedName: c.qualified_name || null,
|
|
190
|
+
scope: c.scope || null,
|
|
191
|
+
visibility: c.visibility || null,
|
|
192
|
+
})),
|
|
193
|
+
};
|
|
194
|
+
});
|
|
195
|
+
const base = { name, results };
|
|
196
|
+
return paginateResult(base, 'results', { limit: opts.limit, offset: opts.offset });
|
|
197
|
+
}
|
|
198
|
+
finally {
|
|
199
|
+
db.close();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
//# sourceMappingURL=symbol-lookup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol-lookup.js","sourceRoot":"","sources":["../../../src/domain/analysis/symbol-lookup.js"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,wBAAwB,EACxB,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,EA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AAC,UAAU,IAAI,IAAI;gBACnC,aAAa,EAAE,IAAI,CAAC,cAAc,IAAI,IAAI;gBAC1C,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;oBAC7B,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,OAAO,EAAE,CAAC,CAAC,QAAQ,IAAI,IAAI;oBAC3B,aAAa,EAAE,CAAC,CAAC,cAAc,IAAI,IAAI;oBACvC,KAAK,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI;oBACtB,UAAU,EAAE,CAAC,CAAC,UAAU,IAAI,IAAI;iBACjC,CAAC,CAAC;aACJ,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAC/B,OAAO,cAAc,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;IACrF,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PipelineContext — shared mutable state threaded through all build stages.
|
|
3
|
+
*
|
|
4
|
+
* Each stage reads what it needs and writes what it produces.
|
|
5
|
+
* This replaces the closure-captured locals in the old monolithic buildGraph().
|
|
6
|
+
*/
|
|
7
|
+
export class PipelineContext {
|
|
8
|
+
/** @type {string} Absolute root directory */
|
|
9
|
+
rootDir: string;
|
|
10
|
+
/** @type {import('better-sqlite3').Database} */
|
|
11
|
+
db: any;
|
|
12
|
+
/** @type {string} Absolute path to the database file */
|
|
13
|
+
dbPath: string;
|
|
14
|
+
/** @type {object} From loadConfig() */
|
|
15
|
+
config: object;
|
|
16
|
+
/** @type {object} Original buildGraph opts */
|
|
17
|
+
opts: object;
|
|
18
|
+
/** @type {{ engine: string, dataflow: boolean, ast: boolean }} */
|
|
19
|
+
engineOpts: {
|
|
20
|
+
engine: string;
|
|
21
|
+
dataflow: boolean;
|
|
22
|
+
ast: boolean;
|
|
23
|
+
};
|
|
24
|
+
/** @type {string} 'native' | 'wasm' */
|
|
25
|
+
engineName: string;
|
|
26
|
+
/** @type {string|null} */
|
|
27
|
+
engineVersion: string | null;
|
|
28
|
+
/** @type {{ baseUrl: string|null, paths: object }} */
|
|
29
|
+
aliases: {
|
|
30
|
+
baseUrl: string | null;
|
|
31
|
+
paths: object;
|
|
32
|
+
};
|
|
33
|
+
/** @type {boolean} Whether incremental mode is enabled */
|
|
34
|
+
incremental: boolean;
|
|
35
|
+
/** @type {boolean} Force full rebuild (engine/schema mismatch) */
|
|
36
|
+
forceFullRebuild: boolean;
|
|
37
|
+
/** @type {number} Current schema version */
|
|
38
|
+
schemaVersion: number;
|
|
39
|
+
/** @type {string[]} Absolute file paths */
|
|
40
|
+
allFiles: string[];
|
|
41
|
+
/** @type {Set<string>} Absolute directory paths */
|
|
42
|
+
discoveredDirs: Set<string>;
|
|
43
|
+
/** @type {boolean} */
|
|
44
|
+
isFullBuild: boolean;
|
|
45
|
+
/** @type {Array<{ file: string, relPath?: string, content?: string, hash?: string, stat?: object, _reverseDepOnly?: boolean }>} */
|
|
46
|
+
parseChanges: Array<{
|
|
47
|
+
file: string;
|
|
48
|
+
relPath?: string;
|
|
49
|
+
content?: string;
|
|
50
|
+
hash?: string;
|
|
51
|
+
stat?: object;
|
|
52
|
+
_reverseDepOnly?: boolean;
|
|
53
|
+
}>;
|
|
54
|
+
/** @type {Array<{ relPath: string, hash: string, stat: object }>} Metadata-only self-heal updates */
|
|
55
|
+
metadataUpdates: Array<{
|
|
56
|
+
relPath: string;
|
|
57
|
+
hash: string;
|
|
58
|
+
stat: object;
|
|
59
|
+
}>;
|
|
60
|
+
/** @type {string[]} Relative paths of deleted files */
|
|
61
|
+
removed: string[];
|
|
62
|
+
/** @type {boolean} True when no changes detected — skip remaining stages */
|
|
63
|
+
earlyExit: boolean;
|
|
64
|
+
/** @type {Map<string, object>} relPath → symbols from parseFilesAuto */
|
|
65
|
+
allSymbols: Map<string, object>;
|
|
66
|
+
/** @type {Map<string, object>} relPath → symbols (includes incrementally loaded) */
|
|
67
|
+
fileSymbols: Map<string, object>;
|
|
68
|
+
/** @type {Array<{ file: string, relPath?: string }>} Files to parse this build */
|
|
69
|
+
filesToParse: Array<{
|
|
70
|
+
file: string;
|
|
71
|
+
relPath?: string;
|
|
72
|
+
}>;
|
|
73
|
+
/** @type {Map<string, string>|null} "absFile|source" → resolved path */
|
|
74
|
+
batchResolved: Map<string, string> | null;
|
|
75
|
+
/** @type {Map<string, Array>} relPath → re-export descriptors */
|
|
76
|
+
reexportMap: Map<string, any[]>;
|
|
77
|
+
/** @type {Set<string>} Files loaded only for barrel resolution (don't rebuild edges) */
|
|
78
|
+
barrelOnlyFiles: Set<string>;
|
|
79
|
+
/** @type {Map<string, Array>} name → node rows */
|
|
80
|
+
nodesByName: Map<string, any[]>;
|
|
81
|
+
/** @type {Map<string, Array>} "name|file" → node rows */
|
|
82
|
+
nodesByNameAndFile: Map<string, any[]>;
|
|
83
|
+
/** @type {boolean} Whether embeddings table exists */
|
|
84
|
+
hasEmbeddings: boolean;
|
|
85
|
+
/** @type {Map<string, number>} relPath → line count */
|
|
86
|
+
lineCountMap: Map<string, number>;
|
|
87
|
+
timing: {};
|
|
88
|
+
/** @type {number} performance.now() at build start */
|
|
89
|
+
buildStart: number;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/domain/graph/builder/context.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH;IAEE,6CAA6C;IAC7C,SADW,MAAM,CACT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EAAE,MAAM,CAAC,CACnB;IACX,oFAAoF;IACpF,aADW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAClB;IACZ,kFAAkF;IAClF,cADW,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CACvC;IAGb,wEAAwE;IACxE,eADW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAC,IAAI,CACrB;IACd,iEAAiE;IACjE,aADW,GAAG,CAAC,MAAM,QAAQ,CACjB;IACZ,wFAAwF;IACxF,iBADW,GAAG,CAAC,MAAM,CAAC,CACN;IAGhB,kDAAkD;IAClD,aADW,GAAG,CAAC,MAAM,QAAQ,CACjB;IACZ,yDAAyD;IACzD,oBADW,GAAG,CAAC,MAAM,QAAQ,CACV;IAGnB,sDAAsD;IACtD,eADW,OAAO,CACI;IACtB,uDAAuD;IACvD,cADW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CACjB;IAGb,WAAY;IAEZ,sDAAsD;IACtD,YADW,MAAM,CACN;CACZ"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PipelineContext — shared mutable state threaded through all build stages.
|
|
3
|
+
*
|
|
4
|
+
* Each stage reads what it needs and writes what it produces.
|
|
5
|
+
* This replaces the closure-captured locals in the old monolithic buildGraph().
|
|
6
|
+
*/
|
|
7
|
+
export class PipelineContext {
|
|
8
|
+
// ── Inputs (set during setup) ──────────────────────────────────────
|
|
9
|
+
/** @type {string} Absolute root directory */
|
|
10
|
+
rootDir;
|
|
11
|
+
/** @type {import('better-sqlite3').Database} */
|
|
12
|
+
db;
|
|
13
|
+
/** @type {string} Absolute path to the database file */
|
|
14
|
+
dbPath;
|
|
15
|
+
/** @type {object} From loadConfig() */
|
|
16
|
+
config;
|
|
17
|
+
/** @type {object} Original buildGraph opts */
|
|
18
|
+
opts;
|
|
19
|
+
/** @type {{ engine: string, dataflow: boolean, ast: boolean }} */
|
|
20
|
+
engineOpts;
|
|
21
|
+
/** @type {string} 'native' | 'wasm' */
|
|
22
|
+
engineName;
|
|
23
|
+
/** @type {string|null} */
|
|
24
|
+
engineVersion;
|
|
25
|
+
/** @type {{ baseUrl: string|null, paths: object }} */
|
|
26
|
+
aliases;
|
|
27
|
+
/** @type {boolean} Whether incremental mode is enabled */
|
|
28
|
+
incremental;
|
|
29
|
+
/** @type {boolean} Force full rebuild (engine/schema mismatch) */
|
|
30
|
+
forceFullRebuild = false;
|
|
31
|
+
/** @type {number} Current schema version */
|
|
32
|
+
schemaVersion;
|
|
33
|
+
// ── File collection (set by collectFiles stage) ────────────────────
|
|
34
|
+
/** @type {string[]} Absolute file paths */
|
|
35
|
+
allFiles;
|
|
36
|
+
/** @type {Set<string>} Absolute directory paths */
|
|
37
|
+
discoveredDirs;
|
|
38
|
+
// ── Change detection (set by detectChanges stage) ──────────────────
|
|
39
|
+
/** @type {boolean} */
|
|
40
|
+
isFullBuild;
|
|
41
|
+
/** @type {Array<{ file: string, relPath?: string, content?: string, hash?: string, stat?: object, _reverseDepOnly?: boolean }>} */
|
|
42
|
+
parseChanges;
|
|
43
|
+
/** @type {Array<{ relPath: string, hash: string, stat: object }>} Metadata-only self-heal updates */
|
|
44
|
+
metadataUpdates;
|
|
45
|
+
/** @type {string[]} Relative paths of deleted files */
|
|
46
|
+
removed;
|
|
47
|
+
/** @type {boolean} True when no changes detected — skip remaining stages */
|
|
48
|
+
earlyExit = false;
|
|
49
|
+
// ── Parsing (set by parseFiles stage) ──────────────────────────────
|
|
50
|
+
/** @type {Map<string, object>} relPath → symbols from parseFilesAuto */
|
|
51
|
+
allSymbols;
|
|
52
|
+
/** @type {Map<string, object>} relPath → symbols (includes incrementally loaded) */
|
|
53
|
+
fileSymbols;
|
|
54
|
+
/** @type {Array<{ file: string, relPath?: string }>} Files to parse this build */
|
|
55
|
+
filesToParse;
|
|
56
|
+
// ── Import resolution (set by resolveImports stage) ────────────────
|
|
57
|
+
/** @type {Map<string, string>|null} "absFile|source" → resolved path */
|
|
58
|
+
batchResolved;
|
|
59
|
+
/** @type {Map<string, Array>} relPath → re-export descriptors */
|
|
60
|
+
reexportMap;
|
|
61
|
+
/** @type {Set<string>} Files loaded only for barrel resolution (don't rebuild edges) */
|
|
62
|
+
barrelOnlyFiles;
|
|
63
|
+
// ── Node lookup (set by insertNodes / buildEdges stages) ───────────
|
|
64
|
+
/** @type {Map<string, Array>} name → node rows */
|
|
65
|
+
nodesByName;
|
|
66
|
+
/** @type {Map<string, Array>} "name|file" → node rows */
|
|
67
|
+
nodesByNameAndFile;
|
|
68
|
+
// ── Misc state ─────────────────────────────────────────────────────
|
|
69
|
+
/** @type {boolean} Whether embeddings table exists */
|
|
70
|
+
hasEmbeddings = false;
|
|
71
|
+
/** @type {Map<string, number>} relPath → line count */
|
|
72
|
+
lineCountMap;
|
|
73
|
+
// ── Phase timing ───────────────────────────────────────────────────
|
|
74
|
+
timing = {};
|
|
75
|
+
/** @type {number} performance.now() at build start */
|
|
76
|
+
buildStart;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/domain/graph/builder/context.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,OAAO,eAAe;IAC1B,sEAAsE;IACtE,6CAA6C;IAC7C,OAAO,CAAC;IACR,gDAAgD;IAChD,EAAE,CAAC;IACH,wDAAwD;IACxD,MAAM,CAAC;IACP,uCAAuC;IACvC,MAAM,CAAC;IACP,8CAA8C;IAC9C,IAAI,CAAC;IACL,kEAAkE;IAClE,UAAU,CAAC;IACX,uCAAuC;IACvC,UAAU,CAAC;IACX,0BAA0B;IAC1B,aAAa,CAAC;IACd,sDAAsD;IACtD,OAAO,CAAC;IACR,0DAA0D;IAC1D,WAAW,CAAC;IACZ,kEAAkE;IAClE,gBAAgB,GAAG,KAAK,CAAC;IACzB,4CAA4C;IAC5C,aAAa,CAAC;IAEd,sEAAsE;IACtE,2CAA2C;IAC3C,QAAQ,CAAC;IACT,mDAAmD;IACnD,cAAc,CAAC;IAEf,sEAAsE;IACtE,sBAAsB;IACtB,WAAW,CAAC;IACZ,mIAAmI;IACnI,YAAY,CAAC;IACb,qGAAqG;IACrG,eAAe,CAAC;IAChB,uDAAuD;IACvD,OAAO,CAAC;IACR,4EAA4E;IAC5E,SAAS,GAAG,KAAK,CAAC;IAElB,sEAAsE;IACtE,wEAAwE;IACxE,UAAU,CAAC;IACX,oFAAoF;IACpF,WAAW,CAAC;IACZ,kFAAkF;IAClF,YAAY,CAAC;IAEb,sEAAsE;IACtE,wEAAwE;IACxE,aAAa,CAAC;IACd,iEAAiE;IACjE,WAAW,CAAC;IACZ,wFAAwF;IACxF,eAAe,CAAC;IAEhB,sEAAsE;IACtE,kDAAkD;IAClD,WAAW,CAAC;IACZ,yDAAyD;IACzD,kBAAkB,CAAC;IAEnB,sEAAsE;IACtE,sDAAsD;IACtD,aAAa,GAAG,KAAK,CAAC;IACtB,uDAAuD;IACvD,YAAY,CAAC;IAEb,sEAAsE;IACtE,MAAM,GAAG,EAAE,CAAC;IAEZ,sDAAsD;IACtD,UAAU,CAAC;CACZ"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively collect all source files under `dir`.
|
|
3
|
+
* When `directories` is a Set, also tracks which directories contain files.
|
|
4
|
+
*/
|
|
5
|
+
export function collectFiles(dir: any, files?: any[], config?: {}, directories?: null, _visited?: Set<any>): any[] | {
|
|
6
|
+
files: any[];
|
|
7
|
+
directories: never;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Load path aliases from tsconfig.json / jsconfig.json.
|
|
11
|
+
*/
|
|
12
|
+
export function loadPathAliases(rootDir: any): {
|
|
13
|
+
baseUrl: null;
|
|
14
|
+
paths: {};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Compute MD5 hash of file contents for incremental builds.
|
|
18
|
+
*/
|
|
19
|
+
export function fileHash(content: any): string;
|
|
20
|
+
/**
|
|
21
|
+
* Stat a file, returning { mtimeMs, size } or null on error.
|
|
22
|
+
*/
|
|
23
|
+
export function fileStat(filePath: any): {
|
|
24
|
+
mtimeMs: number;
|
|
25
|
+
size: number;
|
|
26
|
+
} | null;
|
|
27
|
+
export function readFileSafe(filePath: any, retries?: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* Purge all graph data for the specified files.
|
|
30
|
+
*/
|
|
31
|
+
export function purgeFilesFromGraph(db: any, files: any, options?: {}): void;
|
|
32
|
+
/**
|
|
33
|
+
* Batch-insert node rows via multi-value INSERT statements.
|
|
34
|
+
* Each row: [name, kind, file, line, end_line, parent_id, qualified_name, scope, visibility]
|
|
35
|
+
*/
|
|
36
|
+
export function batchInsertNodes(db: any, rows: any): void;
|
|
37
|
+
/**
|
|
38
|
+
* Batch-insert edge rows via multi-value INSERT statements.
|
|
39
|
+
* Each row: [source_id, target_id, kind, confidence, dynamic]
|
|
40
|
+
*/
|
|
41
|
+
export function batchInsertEdges(db: any, rows: any): void;
|
|
42
|
+
export const BUILTIN_RECEIVERS: Set<string>;
|
|
43
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../src/domain/graph/builder/helpers.js"],"names":[],"mappings":"AA2CA;;;GAGG;AACH;;;EAsDC;AAED;;GAEG;AACH;;;EAyBC;AAED;;GAEG;AACH,+CAEC;AAED;;GAEG;AACH;;;SAOC;AAQD,sEAaC;AAED;;GAEG;AACH,6EAEC;AAKD;;;GAGG;AACH,2DAYC;AAED;;;GAGG;AACH,2DAYC;AA7MD,4CA6BG"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builder helper functions — shared utilities used across pipeline stages.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the monolithic builder.js so stages can import individually.
|
|
5
|
+
*/
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { purgeFilesData } from '../../../db/index.js';
|
|
10
|
+
import { warn } from '../../../infrastructure/logger.js';
|
|
11
|
+
import { EXTENSIONS, IGNORE_DIRS } from '../../../shared/constants.js';
|
|
12
|
+
export const BUILTIN_RECEIVERS = new Set([
|
|
13
|
+
'console',
|
|
14
|
+
'Math',
|
|
15
|
+
'JSON',
|
|
16
|
+
'Object',
|
|
17
|
+
'Array',
|
|
18
|
+
'String',
|
|
19
|
+
'Number',
|
|
20
|
+
'Boolean',
|
|
21
|
+
'Date',
|
|
22
|
+
'RegExp',
|
|
23
|
+
'Map',
|
|
24
|
+
'Set',
|
|
25
|
+
'WeakMap',
|
|
26
|
+
'WeakSet',
|
|
27
|
+
'Promise',
|
|
28
|
+
'Symbol',
|
|
29
|
+
'Error',
|
|
30
|
+
'TypeError',
|
|
31
|
+
'RangeError',
|
|
32
|
+
'Proxy',
|
|
33
|
+
'Reflect',
|
|
34
|
+
'Intl',
|
|
35
|
+
'globalThis',
|
|
36
|
+
'window',
|
|
37
|
+
'document',
|
|
38
|
+
'process',
|
|
39
|
+
'Buffer',
|
|
40
|
+
'require',
|
|
41
|
+
]);
|
|
42
|
+
/**
|
|
43
|
+
* Recursively collect all source files under `dir`.
|
|
44
|
+
* When `directories` is a Set, also tracks which directories contain files.
|
|
45
|
+
*/
|
|
46
|
+
export function collectFiles(dir, files = [], config = {}, directories = null, _visited = new Set()) {
|
|
47
|
+
const trackDirs = directories instanceof Set;
|
|
48
|
+
let hasFiles = false;
|
|
49
|
+
// Merge config ignoreDirs with defaults
|
|
50
|
+
const extraIgnore = config.ignoreDirs ? new Set(config.ignoreDirs) : null;
|
|
51
|
+
// Detect symlink loops (before I/O to avoid wasted readdirSync)
|
|
52
|
+
let realDir;
|
|
53
|
+
try {
|
|
54
|
+
realDir = fs.realpathSync(dir);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return trackDirs ? { files, directories } : files;
|
|
58
|
+
}
|
|
59
|
+
if (_visited.has(realDir)) {
|
|
60
|
+
warn(`Symlink loop detected, skipping: ${dir}`);
|
|
61
|
+
return trackDirs ? { files, directories } : files;
|
|
62
|
+
}
|
|
63
|
+
_visited.add(realDir);
|
|
64
|
+
let entries;
|
|
65
|
+
try {
|
|
66
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
warn(`Cannot read directory ${dir}: ${err.message}`);
|
|
70
|
+
return trackDirs ? { files, directories } : files;
|
|
71
|
+
}
|
|
72
|
+
for (const entry of entries) {
|
|
73
|
+
if (entry.name.startsWith('.') && entry.name !== '.') {
|
|
74
|
+
if (IGNORE_DIRS.has(entry.name))
|
|
75
|
+
continue;
|
|
76
|
+
if (entry.isDirectory())
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
if (IGNORE_DIRS.has(entry.name))
|
|
80
|
+
continue;
|
|
81
|
+
if (extraIgnore?.has(entry.name))
|
|
82
|
+
continue;
|
|
83
|
+
const full = path.join(dir, entry.name);
|
|
84
|
+
if (entry.isDirectory()) {
|
|
85
|
+
collectFiles(full, files, config, directories, _visited);
|
|
86
|
+
}
|
|
87
|
+
else if (EXTENSIONS.has(path.extname(entry.name))) {
|
|
88
|
+
files.push(full);
|
|
89
|
+
hasFiles = true;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (trackDirs && hasFiles) {
|
|
93
|
+
directories.add(dir);
|
|
94
|
+
}
|
|
95
|
+
return trackDirs ? { files, directories } : files;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Load path aliases from tsconfig.json / jsconfig.json.
|
|
99
|
+
*/
|
|
100
|
+
export function loadPathAliases(rootDir) {
|
|
101
|
+
const aliases = { baseUrl: null, paths: {} };
|
|
102
|
+
for (const configName of ['tsconfig.json', 'jsconfig.json']) {
|
|
103
|
+
const configPath = path.join(rootDir, configName);
|
|
104
|
+
if (!fs.existsSync(configPath))
|
|
105
|
+
continue;
|
|
106
|
+
try {
|
|
107
|
+
const raw = fs
|
|
108
|
+
.readFileSync(configPath, 'utf-8')
|
|
109
|
+
.replace(/\/\/.*$/gm, '')
|
|
110
|
+
.replace(/\/\*[\s\S]*?\*\//g, '')
|
|
111
|
+
.replace(/,\s*([\]}])/g, '$1');
|
|
112
|
+
const config = JSON.parse(raw);
|
|
113
|
+
const opts = config.compilerOptions || {};
|
|
114
|
+
if (opts.baseUrl)
|
|
115
|
+
aliases.baseUrl = path.resolve(rootDir, opts.baseUrl);
|
|
116
|
+
if (opts.paths) {
|
|
117
|
+
for (const [pattern, targets] of Object.entries(opts.paths)) {
|
|
118
|
+
aliases.paths[pattern] = targets.map((t) => path.resolve(aliases.baseUrl || rootDir, t));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
catch (err) {
|
|
124
|
+
warn(`Failed to parse ${configName}: ${err.message}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return aliases;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Compute MD5 hash of file contents for incremental builds.
|
|
131
|
+
*/
|
|
132
|
+
export function fileHash(content) {
|
|
133
|
+
return createHash('md5').update(content).digest('hex');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Stat a file, returning { mtimeMs, size } or null on error.
|
|
137
|
+
*/
|
|
138
|
+
export function fileStat(filePath) {
|
|
139
|
+
try {
|
|
140
|
+
const s = fs.statSync(filePath);
|
|
141
|
+
return { mtimeMs: s.mtimeMs, size: s.size };
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Read a file with retry on transient errors (EBUSY/EACCES/EPERM).
|
|
149
|
+
*/
|
|
150
|
+
const TRANSIENT_CODES = new Set(['EBUSY', 'EACCES', 'EPERM']);
|
|
151
|
+
const RETRY_DELAY_MS = 50;
|
|
152
|
+
export function readFileSafe(filePath, retries = 2) {
|
|
153
|
+
for (let attempt = 0;; attempt++) {
|
|
154
|
+
try {
|
|
155
|
+
return fs.readFileSync(filePath, 'utf-8');
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
if (attempt < retries && TRANSIENT_CODES.has(err.code)) {
|
|
159
|
+
const end = Date.now() + RETRY_DELAY_MS;
|
|
160
|
+
while (Date.now() < end) { }
|
|
161
|
+
continue;
|
|
162
|
+
}
|
|
163
|
+
throw err;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Purge all graph data for the specified files.
|
|
169
|
+
*/
|
|
170
|
+
export function purgeFilesFromGraph(db, files, options = {}) {
|
|
171
|
+
purgeFilesData(db, files, options);
|
|
172
|
+
}
|
|
173
|
+
/** Batch INSERT chunk size for multi-value INSERTs. */
|
|
174
|
+
const BATCH_CHUNK = 200;
|
|
175
|
+
/**
|
|
176
|
+
* Batch-insert node rows via multi-value INSERT statements.
|
|
177
|
+
* Each row: [name, kind, file, line, end_line, parent_id, qualified_name, scope, visibility]
|
|
178
|
+
*/
|
|
179
|
+
export function batchInsertNodes(db, rows) {
|
|
180
|
+
if (!rows.length)
|
|
181
|
+
return;
|
|
182
|
+
const ph = '(?,?,?,?,?,?,?,?,?)';
|
|
183
|
+
for (let i = 0; i < rows.length; i += BATCH_CHUNK) {
|
|
184
|
+
const chunk = rows.slice(i, i + BATCH_CHUNK);
|
|
185
|
+
const vals = [];
|
|
186
|
+
for (const r of chunk)
|
|
187
|
+
vals.push(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8]);
|
|
188
|
+
db.prepare('INSERT OR IGNORE INTO nodes (name,kind,file,line,end_line,parent_id,qualified_name,scope,visibility) VALUES ' +
|
|
189
|
+
chunk.map(() => ph).join(',')).run(...vals);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Batch-insert edge rows via multi-value INSERT statements.
|
|
194
|
+
* Each row: [source_id, target_id, kind, confidence, dynamic]
|
|
195
|
+
*/
|
|
196
|
+
export function batchInsertEdges(db, rows) {
|
|
197
|
+
if (!rows.length)
|
|
198
|
+
return;
|
|
199
|
+
const ph = '(?,?,?,?,?)';
|
|
200
|
+
for (let i = 0; i < rows.length; i += BATCH_CHUNK) {
|
|
201
|
+
const chunk = rows.slice(i, i + BATCH_CHUNK);
|
|
202
|
+
const vals = [];
|
|
203
|
+
for (const r of chunk)
|
|
204
|
+
vals.push(r[0], r[1], r[2], r[3], r[4]);
|
|
205
|
+
db.prepare('INSERT INTO edges (source_id,target_id,kind,confidence,dynamic) VALUES ' +
|
|
206
|
+
chunk.map(() => ph).join(',')).run(...vals);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=helpers.js.map
|