@optave/codegraph 3.2.0 → 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 +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 +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/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 +1 -1
- 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 +84 -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 +22 -2
- 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 +70 -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 +255 -4
- 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/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
package/src/extractors/rust.js
CHANGED
|
@@ -10,9 +10,11 @@ export function extractRustSymbols(tree, _filePath) {
|
|
|
10
10
|
imports: [],
|
|
11
11
|
classes: [],
|
|
12
12
|
exports: [],
|
|
13
|
+
typeMap: new Map(),
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
walkRustNode(tree.rootNode, ctx);
|
|
17
|
+
extractRustTypeMap(tree.rootNode, ctx);
|
|
16
18
|
return ctx;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -257,6 +259,64 @@ function extractEnumVariants(enumNode) {
|
|
|
257
259
|
return variants;
|
|
258
260
|
}
|
|
259
261
|
|
|
262
|
+
function extractRustTypeMap(node, ctx) {
|
|
263
|
+
extractRustTypeMapDepth(node, ctx, 0);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function extractRustTypeMapDepth(node, ctx, depth) {
|
|
267
|
+
if (depth >= 200) return;
|
|
268
|
+
|
|
269
|
+
// let x: MyType = ...
|
|
270
|
+
if (node.type === 'let_declaration') {
|
|
271
|
+
const pattern = node.childForFieldName('pattern');
|
|
272
|
+
const typeNode = node.childForFieldName('type');
|
|
273
|
+
if (pattern && pattern.type === 'identifier' && typeNode) {
|
|
274
|
+
const typeName = extractRustTypeName(typeNode);
|
|
275
|
+
if (typeName) ctx.typeMap.set(pattern.text, { type: typeName, confidence: 0.9 });
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// fn foo(x: MyType) — parameter node has pattern + type fields
|
|
280
|
+
if (node.type === 'parameter') {
|
|
281
|
+
const pattern = node.childForFieldName('pattern');
|
|
282
|
+
const typeNode = node.childForFieldName('type');
|
|
283
|
+
if (pattern && typeNode) {
|
|
284
|
+
const name = pattern.type === 'identifier' ? pattern.text : null;
|
|
285
|
+
if (name && name !== 'self' && name !== '&self' && name !== '&mut self') {
|
|
286
|
+
const typeName = extractRustTypeName(typeNode);
|
|
287
|
+
if (typeName) ctx.typeMap.set(name, { type: typeName, confidence: 0.9 });
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
293
|
+
const child = node.child(i);
|
|
294
|
+
if (child) extractRustTypeMapDepth(child, ctx, depth + 1);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
function extractRustTypeName(typeNode) {
|
|
299
|
+
if (!typeNode) return null;
|
|
300
|
+
const t = typeNode.type;
|
|
301
|
+
if (t === 'type_identifier' || t === 'identifier') return typeNode.text;
|
|
302
|
+
if (t === 'scoped_type_identifier') return typeNode.text;
|
|
303
|
+
// Reference: &MyType or &mut MyType → MyType
|
|
304
|
+
if (t === 'reference_type') {
|
|
305
|
+
for (let i = 0; i < typeNode.childCount; i++) {
|
|
306
|
+
const child = typeNode.child(i);
|
|
307
|
+
if (child && (child.type === 'type_identifier' || child.type === 'scoped_type_identifier')) {
|
|
308
|
+
return child.text;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// Generic: Vec<T> → Vec
|
|
313
|
+
if (t === 'generic_type') {
|
|
314
|
+
const first = typeNode.child(0);
|
|
315
|
+
return first ? first.text : null;
|
|
316
|
+
}
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
|
|
260
320
|
function extractRustUsePath(node) {
|
|
261
321
|
if (!node) return [];
|
|
262
322
|
|
package/src/features/audit.js
CHANGED
|
@@ -100,7 +100,8 @@ function readPhase44(db, nodeId) {
|
|
|
100
100
|
|
|
101
101
|
export function auditData(target, customDbPath, opts = {}) {
|
|
102
102
|
const noTests = opts.noTests || false;
|
|
103
|
-
const
|
|
103
|
+
const config = opts.config || loadConfig();
|
|
104
|
+
const maxDepth = opts.depth || config.analysis?.auditDepth || 3;
|
|
104
105
|
const fileFilters = normalizeFileFilter(opts.file);
|
|
105
106
|
const kind = opts.kind;
|
|
106
107
|
|
|
@@ -2,6 +2,7 @@ import path from 'node:path';
|
|
|
2
2
|
import { openRepo } from '../db/index.js';
|
|
3
3
|
import { louvainCommunities } from '../graph/algorithms/louvain.js';
|
|
4
4
|
import { buildDependencyGraph } from '../graph/builders/dependency.js';
|
|
5
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
5
6
|
import { paginateResult } from '../shared/paginate.js';
|
|
6
7
|
|
|
7
8
|
// ─── Directory Helpers ────────────────────────────────────────────────
|
|
@@ -144,7 +145,8 @@ export function communitiesData(customDbPath, opts = {}) {
|
|
|
144
145
|
};
|
|
145
146
|
}
|
|
146
147
|
|
|
147
|
-
const
|
|
148
|
+
const config = opts.config || loadConfig();
|
|
149
|
+
const resolution = opts.resolution ?? config.community?.resolution ?? 1.0;
|
|
148
150
|
const { assignments, modularity } = louvainCommunities(graph, { resolution });
|
|
149
151
|
|
|
150
152
|
const { communities, communityDirs } = buildCommunityObjects(graph, assignments, opts);
|
|
@@ -162,7 +162,7 @@ function prepareFunctionLevelData(db, noTests, minConf, cfg) {
|
|
|
162
162
|
const community = communityMap.get(n.id) ?? null;
|
|
163
163
|
const directory = path.dirname(n.file);
|
|
164
164
|
const risk = [];
|
|
165
|
-
if (n.role
|
|
165
|
+
if (n.role?.startsWith('dead')) risk.push('dead-code');
|
|
166
166
|
if (fanIn >= (cfg.riskThresholds?.highBlastRadius ?? 10)) risk.push('high-blast-radius');
|
|
167
167
|
if (cx && cx.maintainabilityIndex < (cfg.riskThresholds?.lowMI ?? 40)) risk.push('low-mi');
|
|
168
168
|
|
package/src/features/sequence.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { openRepo } from '../db/index.js';
|
|
10
10
|
import { SqliteRepository } from '../db/repository/sqlite-repository.js';
|
|
11
11
|
import { findMatchingNodes } from '../domain/queries.js';
|
|
12
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
12
13
|
import { isTestFile } from '../infrastructure/test-filter.js';
|
|
13
14
|
import { paginateResult } from '../shared/paginate.js';
|
|
14
15
|
import { FRAMEWORK_ENTRY_PREFIXES } from './structure.js';
|
|
@@ -230,7 +231,8 @@ function buildParticipants(fileSet, entryFile) {
|
|
|
230
231
|
export function sequenceData(name, dbPath, opts = {}) {
|
|
231
232
|
const { repo, close } = openRepo(dbPath, opts);
|
|
232
233
|
try {
|
|
233
|
-
const
|
|
234
|
+
const config = opts.config || loadConfig();
|
|
235
|
+
const maxDepth = opts.depth || config.analysis?.sequenceDepth || 10;
|
|
234
236
|
const noTests = opts.noTests || false;
|
|
235
237
|
|
|
236
238
|
const matchNode = findEntryNode(repo, name, opts);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { getNodeId, openReadonlyOrFail, testFilterSQL } from '../db/index.js';
|
|
3
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
3
4
|
import { debug } from '../infrastructure/logger.js';
|
|
4
5
|
import { isTestFile } from '../infrastructure/test-filter.js';
|
|
5
6
|
import { normalizePath } from '../shared/constants.js';
|
|
@@ -349,7 +350,19 @@ export function classifyNodeRoles(db) {
|
|
|
349
350
|
.all();
|
|
350
351
|
|
|
351
352
|
if (rows.length === 0) {
|
|
352
|
-
return {
|
|
353
|
+
return {
|
|
354
|
+
entry: 0,
|
|
355
|
+
core: 0,
|
|
356
|
+
utility: 0,
|
|
357
|
+
adapter: 0,
|
|
358
|
+
dead: 0,
|
|
359
|
+
'dead-leaf': 0,
|
|
360
|
+
'dead-entry': 0,
|
|
361
|
+
'dead-ffi': 0,
|
|
362
|
+
'dead-unresolved': 0,
|
|
363
|
+
'test-only': 0,
|
|
364
|
+
leaf: 0,
|
|
365
|
+
};
|
|
353
366
|
}
|
|
354
367
|
|
|
355
368
|
const exportedIds = new Set(
|
|
@@ -385,6 +398,8 @@ export function classifyNodeRoles(db) {
|
|
|
385
398
|
const classifierInput = rows.map((r) => ({
|
|
386
399
|
id: String(r.id),
|
|
387
400
|
name: r.name,
|
|
401
|
+
kind: r.kind,
|
|
402
|
+
file: r.file,
|
|
388
403
|
fanIn: r.fan_in,
|
|
389
404
|
fanOut: r.fan_out,
|
|
390
405
|
isExported: exportedIds.has(r.id),
|
|
@@ -394,12 +409,25 @@ export function classifyNodeRoles(db) {
|
|
|
394
409
|
const roleMap = classifyRoles(classifierInput);
|
|
395
410
|
|
|
396
411
|
// Build summary and updates
|
|
397
|
-
const summary = {
|
|
412
|
+
const summary = {
|
|
413
|
+
entry: 0,
|
|
414
|
+
core: 0,
|
|
415
|
+
utility: 0,
|
|
416
|
+
adapter: 0,
|
|
417
|
+
dead: 0,
|
|
418
|
+
'dead-leaf': 0,
|
|
419
|
+
'dead-entry': 0,
|
|
420
|
+
'dead-ffi': 0,
|
|
421
|
+
'dead-unresolved': 0,
|
|
422
|
+
'test-only': 0,
|
|
423
|
+
leaf: 0,
|
|
424
|
+
};
|
|
398
425
|
const updates = [];
|
|
399
426
|
for (const row of rows) {
|
|
400
427
|
const role = roleMap.get(String(row.id)) || 'leaf';
|
|
401
428
|
updates.push({ id: row.id, role });
|
|
402
|
-
summary
|
|
429
|
+
if (role.startsWith('dead')) summary.dead++;
|
|
430
|
+
summary[role] = (summary[role] || 0) + 1;
|
|
403
431
|
}
|
|
404
432
|
|
|
405
433
|
const clearRoles = db.prepare('UPDATE nodes SET role = NULL');
|
|
@@ -609,7 +637,8 @@ export function hotspotsData(customDbPath, opts = {}) {
|
|
|
609
637
|
export function moduleBoundariesData(customDbPath, opts = {}) {
|
|
610
638
|
const db = openReadonlyOrFail(customDbPath);
|
|
611
639
|
try {
|
|
612
|
-
const
|
|
640
|
+
const config = opts.config || loadConfig();
|
|
641
|
+
const threshold = opts.threshold ?? config.structure?.cohesionThreshold ?? 0.3;
|
|
613
642
|
|
|
614
643
|
const dirs = db
|
|
615
644
|
.prepare(`
|
package/src/features/triage.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { openRepo } from '../db/index.js';
|
|
2
2
|
import { DEFAULT_WEIGHTS, scoreRisk } from '../graph/classifiers/risk.js';
|
|
3
|
+
import { loadConfig } from '../infrastructure/config.js';
|
|
3
4
|
import { warn } from '../infrastructure/logger.js';
|
|
4
5
|
import { isTestFile } from '../infrastructure/test-filter.js';
|
|
5
6
|
import { paginateResult } from '../shared/paginate.js';
|
|
@@ -94,7 +95,13 @@ export function triageData(customDbPath, opts = {}) {
|
|
|
94
95
|
const noTests = opts.noTests || false;
|
|
95
96
|
const minScore = opts.minScore != null ? Number(opts.minScore) : null;
|
|
96
97
|
const sort = opts.sort || 'risk';
|
|
97
|
-
const
|
|
98
|
+
const config = opts.config || loadConfig();
|
|
99
|
+
const riskConfig = config.risk || {};
|
|
100
|
+
const weights = { ...DEFAULT_WEIGHTS, ...(riskConfig.weights || {}), ...(opts.weights || {}) };
|
|
101
|
+
const riskOpts = {
|
|
102
|
+
roleWeights: riskConfig.roleWeights,
|
|
103
|
+
defaultRoleWeight: riskConfig.defaultRoleWeight,
|
|
104
|
+
};
|
|
98
105
|
|
|
99
106
|
let rows;
|
|
100
107
|
try {
|
|
@@ -114,7 +121,7 @@ export function triageData(customDbPath, opts = {}) {
|
|
|
114
121
|
return { items: [], summary: EMPTY_SUMMARY(weights) };
|
|
115
122
|
}
|
|
116
123
|
|
|
117
|
-
const riskMetrics = scoreRisk(filtered, weights);
|
|
124
|
+
const riskMetrics = scoreRisk(filtered, weights, riskOpts);
|
|
118
125
|
const items = buildTriageItems(filtered, riskMetrics);
|
|
119
126
|
|
|
120
127
|
const scored = minScore != null ? items.filter((it) => it.riskScore >= minScore) : items;
|
|
@@ -26,6 +26,10 @@ export const ROLE_WEIGHTS = {
|
|
|
26
26
|
leaf: 0.2,
|
|
27
27
|
'test-only': 0.1,
|
|
28
28
|
dead: 0.1,
|
|
29
|
+
'dead-leaf': 0.0,
|
|
30
|
+
'dead-entry': 0.3,
|
|
31
|
+
'dead-ffi': 0.05,
|
|
32
|
+
'dead-unresolved': 0.15,
|
|
29
33
|
};
|
|
30
34
|
|
|
31
35
|
const DEFAULT_ROLE_WEIGHT = 0.5;
|
|
@@ -48,11 +52,14 @@ function round4(n) {
|
|
|
48
52
|
*
|
|
49
53
|
* @param {{ fan_in: number, cognitive: number, churn: number, mi: number, role: string|null }[]} items
|
|
50
54
|
* @param {object} [weights] - Override DEFAULT_WEIGHTS
|
|
55
|
+
* @param {{ roleWeights?: object, defaultRoleWeight?: number }} [opts] - Optional role weight overrides
|
|
51
56
|
* @returns {{ normFanIn: number, normComplexity: number, normChurn: number, normMI: number, roleWeight: number, riskScore: number }[]}
|
|
52
57
|
* Parallel array with risk metrics for each input item.
|
|
53
58
|
*/
|
|
54
|
-
export function scoreRisk(items, weights = {}) {
|
|
59
|
+
export function scoreRisk(items, weights = {}, opts = {}) {
|
|
55
60
|
const w = { ...DEFAULT_WEIGHTS, ...weights };
|
|
61
|
+
const rw = opts.roleWeights || ROLE_WEIGHTS;
|
|
62
|
+
const drw = opts.defaultRoleWeight ?? DEFAULT_ROLE_WEIGHT;
|
|
56
63
|
|
|
57
64
|
const fanIns = items.map((r) => r.fan_in);
|
|
58
65
|
const cognitives = items.map((r) => r.cognitive);
|
|
@@ -66,7 +73,7 @@ export function scoreRisk(items, weights = {}) {
|
|
|
66
73
|
const normMIs = normMIsRaw.map((v) => round4(1 - v));
|
|
67
74
|
|
|
68
75
|
return items.map((r, i) => {
|
|
69
|
-
const roleWeight =
|
|
76
|
+
const roleWeight = rw[r.role] ?? drw;
|
|
70
77
|
const riskScore =
|
|
71
78
|
w.fanIn * normFanIns[i] +
|
|
72
79
|
w.complexity * normCognitives[i] +
|
|
@@ -1,11 +1,59 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Node role classification — pure logic, no DB.
|
|
3
3
|
*
|
|
4
|
-
* Roles: entry, core, utility, adapter, leaf, dead
|
|
4
|
+
* Roles: entry, core, utility, adapter, leaf, dead-*, test-only
|
|
5
|
+
*
|
|
6
|
+
* Dead sub-categories refine the coarse "dead" bucket:
|
|
7
|
+
* dead-leaf — parameters, properties, constants (leaf nodes by definition)
|
|
8
|
+
* dead-entry — framework dispatch: CLI commands, MCP tools, event handlers
|
|
9
|
+
* dead-ffi — cross-language FFI boundaries (e.g. Rust napi-rs bindings)
|
|
10
|
+
* dead-unresolved — genuinely unreferenced callables (the real dead code)
|
|
5
11
|
*/
|
|
6
12
|
|
|
7
13
|
export const FRAMEWORK_ENTRY_PREFIXES = ['route:', 'event:', 'command:'];
|
|
8
14
|
|
|
15
|
+
// ── Dead sub-classification helpers ────────────────────────────────
|
|
16
|
+
|
|
17
|
+
const LEAF_KINDS = new Set(['parameter', 'property', 'constant']);
|
|
18
|
+
|
|
19
|
+
const FFI_EXTENSIONS = new Set(['.rs', '.c', '.cpp', '.h', '.go', '.java', '.cs']);
|
|
20
|
+
|
|
21
|
+
/** Path patterns indicating framework-dispatched entry points. */
|
|
22
|
+
const ENTRY_PATH_PATTERNS = [
|
|
23
|
+
/cli[/\\]commands[/\\]/,
|
|
24
|
+
/mcp[/\\]/,
|
|
25
|
+
/routes?[/\\]/,
|
|
26
|
+
/handlers?[/\\]/,
|
|
27
|
+
/middleware[/\\]/,
|
|
28
|
+
];
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Refine a "dead" classification into a sub-category.
|
|
32
|
+
*
|
|
33
|
+
* @param {{ kind?: string, file?: string }} node
|
|
34
|
+
* @returns {'dead-leaf'|'dead-entry'|'dead-ffi'|'dead-unresolved'}
|
|
35
|
+
*/
|
|
36
|
+
function classifyDeadSubRole(node) {
|
|
37
|
+
// Leaf kinds are dead by definition — they can't have callers
|
|
38
|
+
if (node.kind && LEAF_KINDS.has(node.kind)) return 'dead-leaf';
|
|
39
|
+
|
|
40
|
+
if (node.file) {
|
|
41
|
+
// Cross-language FFI: compiled-language files in a JS/TS project
|
|
42
|
+
// Priority: dead-ffi is checked before dead-entry deliberately — an FFI
|
|
43
|
+
// boundary is a more fundamental classification than a path-based hint.
|
|
44
|
+
// A .so/.dll in a routes/ directory is still FFI, not an entry point.
|
|
45
|
+
const dotIdx = node.file.lastIndexOf('.');
|
|
46
|
+
if (dotIdx !== -1 && FFI_EXTENSIONS.has(node.file.slice(dotIdx))) return 'dead-ffi';
|
|
47
|
+
|
|
48
|
+
// Framework-dispatched entry points (CLI commands, MCP tools, routes)
|
|
49
|
+
if (ENTRY_PATH_PATTERNS.some((p) => p.test(node.file))) return 'dead-entry';
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return 'dead-unresolved';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// ── Helpers ────────────────────────────────────────────────────────
|
|
56
|
+
|
|
9
57
|
function median(sorted) {
|
|
10
58
|
if (sorted.length === 0) return 0;
|
|
11
59
|
const mid = Math.floor(sorted.length / 2);
|
|
@@ -15,7 +63,7 @@ function median(sorted) {
|
|
|
15
63
|
/**
|
|
16
64
|
* Classify nodes into architectural roles based on fan-in/fan-out metrics.
|
|
17
65
|
*
|
|
18
|
-
* @param {{ id: string, name: string, fanIn: number, fanOut: number, isExported: boolean, testOnlyFanIn?: number }[]} nodes
|
|
66
|
+
* @param {{ id: string, name: string, kind?: string, file?: string, fanIn: number, fanOut: number, isExported: boolean, testOnlyFanIn?: number }[]} nodes
|
|
19
67
|
* @returns {Map<string, string>} nodeId → role
|
|
20
68
|
*/
|
|
21
69
|
export function classifyRoles(nodes) {
|
|
@@ -45,7 +93,7 @@ export function classifyRoles(nodes) {
|
|
|
45
93
|
if (isFrameworkEntry) {
|
|
46
94
|
role = 'entry';
|
|
47
95
|
} else if (node.fanIn === 0 && !node.isExported) {
|
|
48
|
-
role = node.testOnlyFanIn > 0 ? 'test-only' :
|
|
96
|
+
role = node.testOnlyFanIn > 0 ? 'test-only' : classifyDeadSubRole(node);
|
|
49
97
|
} else if (node.fanIn === 0 && node.isExported) {
|
|
50
98
|
role = 'entry';
|
|
51
99
|
} else if (hasProdFanIn && node.fanIn > 0 && node.productionFanIn === 0) {
|
|
@@ -23,7 +23,7 @@ export const DEFAULTS = {
|
|
|
23
23
|
},
|
|
24
24
|
embeddings: { model: 'nomic-v1.5', llmProvider: null },
|
|
25
25
|
llm: { provider: null, model: null, baseUrl: null, apiKey: null, apiKeyCommand: null },
|
|
26
|
-
search: { defaultMinScore: 0.2, rrfK: 60, topK: 15 },
|
|
26
|
+
search: { defaultMinScore: 0.2, rrfK: 60, topK: 15, similarityWarnThreshold: 0.85 },
|
|
27
27
|
ci: { failOnCycles: false, impactThreshold: null },
|
|
28
28
|
manifesto: {
|
|
29
29
|
rules: {
|
|
@@ -54,6 +54,80 @@ export const DEFAULTS = {
|
|
|
54
54
|
minJaccard: 0.3,
|
|
55
55
|
maxFilesPerCommit: 50,
|
|
56
56
|
},
|
|
57
|
+
analysis: {
|
|
58
|
+
impactDepth: 3,
|
|
59
|
+
fnImpactDepth: 5,
|
|
60
|
+
auditDepth: 3,
|
|
61
|
+
sequenceDepth: 10,
|
|
62
|
+
falsePositiveCallers: 20,
|
|
63
|
+
briefCallerDepth: 5,
|
|
64
|
+
briefImporterDepth: 5,
|
|
65
|
+
briefHighRiskCallers: 10,
|
|
66
|
+
briefMediumRiskCallers: 3,
|
|
67
|
+
},
|
|
68
|
+
community: {
|
|
69
|
+
resolution: 1.0,
|
|
70
|
+
},
|
|
71
|
+
structure: {
|
|
72
|
+
cohesionThreshold: 0.3,
|
|
73
|
+
},
|
|
74
|
+
risk: {
|
|
75
|
+
weights: {
|
|
76
|
+
fanIn: 0.25,
|
|
77
|
+
complexity: 0.3,
|
|
78
|
+
churn: 0.2,
|
|
79
|
+
role: 0.15,
|
|
80
|
+
mi: 0.1,
|
|
81
|
+
},
|
|
82
|
+
roleWeights: {
|
|
83
|
+
core: 1.0,
|
|
84
|
+
utility: 0.9,
|
|
85
|
+
entry: 0.8,
|
|
86
|
+
adapter: 0.5,
|
|
87
|
+
leaf: 0.2,
|
|
88
|
+
'test-only': 0.1,
|
|
89
|
+
dead: 0.1,
|
|
90
|
+
'dead-leaf': 0.0,
|
|
91
|
+
'dead-entry': 0.3,
|
|
92
|
+
'dead-ffi': 0.05,
|
|
93
|
+
'dead-unresolved': 0.15,
|
|
94
|
+
},
|
|
95
|
+
defaultRoleWeight: 0.5,
|
|
96
|
+
},
|
|
97
|
+
display: {
|
|
98
|
+
maxColWidth: 40,
|
|
99
|
+
excerptLines: 50,
|
|
100
|
+
summaryMaxChars: 100,
|
|
101
|
+
jsdocEndScanLines: 10,
|
|
102
|
+
jsdocOpenScanLines: 20,
|
|
103
|
+
signatureGatherLines: 5,
|
|
104
|
+
},
|
|
105
|
+
mcp: {
|
|
106
|
+
defaults: {
|
|
107
|
+
list_functions: 100,
|
|
108
|
+
query: 10,
|
|
109
|
+
where: 50,
|
|
110
|
+
node_roles: 100,
|
|
111
|
+
export_graph: 500,
|
|
112
|
+
fn_impact: 5,
|
|
113
|
+
context: 5,
|
|
114
|
+
explain: 10,
|
|
115
|
+
file_deps: 20,
|
|
116
|
+
file_exports: 20,
|
|
117
|
+
diff_impact: 30,
|
|
118
|
+
impact_analysis: 20,
|
|
119
|
+
semantic_search: 20,
|
|
120
|
+
execution_flow: 50,
|
|
121
|
+
hotspots: 20,
|
|
122
|
+
co_changes: 20,
|
|
123
|
+
complexity: 30,
|
|
124
|
+
manifesto: 50,
|
|
125
|
+
communities: 20,
|
|
126
|
+
structure: 30,
|
|
127
|
+
triage: 20,
|
|
128
|
+
ast_query: 50,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
57
131
|
};
|
|
58
132
|
|
|
59
133
|
/**
|
|
@@ -120,7 +194,183 @@ export function resolveSecrets(config) {
|
|
|
120
194
|
return config;
|
|
121
195
|
}
|
|
122
196
|
|
|
123
|
-
|
|
197
|
+
// ── Monorepo workspace detection ─────────────────────────────────────
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Expand a workspace glob pattern into matching directories.
|
|
201
|
+
* Supports trailing `/*` or `/**` patterns (e.g. "packages/*").
|
|
202
|
+
* Does not depend on an external glob library — uses fs.readdirSync.
|
|
203
|
+
*/
|
|
204
|
+
function expandWorkspaceGlob(pattern, rootDir) {
|
|
205
|
+
// Strip trailing /*, /**, or just *
|
|
206
|
+
const clean = pattern.replace(/\/?\*\*?$/, '');
|
|
207
|
+
const baseDir = path.resolve(rootDir, clean);
|
|
208
|
+
if (!fs.existsSync(baseDir)) return [];
|
|
209
|
+
try {
|
|
210
|
+
const entries = fs.readdirSync(baseDir, { withFileTypes: true });
|
|
211
|
+
return entries
|
|
212
|
+
.filter((e) => e.isDirectory())
|
|
213
|
+
.map((e) => path.join(baseDir, e.name))
|
|
214
|
+
.filter((d) => fs.existsSync(path.join(d, 'package.json')));
|
|
215
|
+
} catch {
|
|
216
|
+
return [];
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Read a package.json and return its name field, or null.
|
|
222
|
+
*/
|
|
223
|
+
function readPackageName(pkgDir) {
|
|
224
|
+
try {
|
|
225
|
+
const raw = fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf-8');
|
|
226
|
+
const pkg = JSON.parse(raw);
|
|
227
|
+
return pkg.name || null;
|
|
228
|
+
} catch {
|
|
229
|
+
return null;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Resolve the entry-point source file for a workspace package.
|
|
235
|
+
* Checks exports → main → index file fallback.
|
|
236
|
+
*/
|
|
237
|
+
function resolveWorkspaceEntry(pkgDir) {
|
|
238
|
+
try {
|
|
239
|
+
const raw = fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf-8');
|
|
240
|
+
const pkg = JSON.parse(raw);
|
|
241
|
+
|
|
242
|
+
// Try "source" field first (common in monorepos for pre-built packages)
|
|
243
|
+
if (pkg.source) {
|
|
244
|
+
const s = path.resolve(pkgDir, pkg.source);
|
|
245
|
+
if (fs.existsSync(s)) return s;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Try "main" field
|
|
249
|
+
if (pkg.main) {
|
|
250
|
+
const m = path.resolve(pkgDir, pkg.main);
|
|
251
|
+
if (fs.existsSync(m)) return m;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Index file fallback
|
|
255
|
+
for (const idx of [
|
|
256
|
+
'index.ts',
|
|
257
|
+
'index.tsx',
|
|
258
|
+
'index.js',
|
|
259
|
+
'index.mjs',
|
|
260
|
+
'src/index.ts',
|
|
261
|
+
'src/index.tsx',
|
|
262
|
+
'src/index.js',
|
|
263
|
+
]) {
|
|
264
|
+
const candidate = path.resolve(pkgDir, idx);
|
|
265
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
266
|
+
}
|
|
267
|
+
} catch {
|
|
268
|
+
/* ignore */
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Detect monorepo workspace packages from workspace configuration files.
|
|
275
|
+
*
|
|
276
|
+
* Checks (in order):
|
|
277
|
+
* 1. pnpm-workspace.yaml — `packages:` array
|
|
278
|
+
* 2. package.json — `workspaces` field (npm/yarn)
|
|
279
|
+
* 3. lerna.json — `packages` array
|
|
280
|
+
*
|
|
281
|
+
* @param {string} rootDir - Project root directory
|
|
282
|
+
* @returns {Map<string, { dir: string, entry: string|null }>}
|
|
283
|
+
* Map of package name → { absolute dir, resolved entry file }
|
|
284
|
+
*/
|
|
285
|
+
export function detectWorkspaces(rootDir) {
|
|
286
|
+
const workspaces = new Map();
|
|
287
|
+
const patterns = [];
|
|
288
|
+
|
|
289
|
+
// 1. pnpm-workspace.yaml
|
|
290
|
+
const pnpmPath = path.join(rootDir, 'pnpm-workspace.yaml');
|
|
291
|
+
if (fs.existsSync(pnpmPath)) {
|
|
292
|
+
try {
|
|
293
|
+
const raw = fs.readFileSync(pnpmPath, 'utf-8');
|
|
294
|
+
// Simple YAML parse for `packages:` array — no dependency needed
|
|
295
|
+
const packagesMatch = raw.match(/^packages:\s*\n((?:\s+-\s+.+\n?)*)/m);
|
|
296
|
+
if (packagesMatch) {
|
|
297
|
+
const lines = packagesMatch[1].match(/^\s+-\s+['"]?([^'"#\n]+)['"]?\s*$/gm);
|
|
298
|
+
if (lines) {
|
|
299
|
+
for (const line of lines) {
|
|
300
|
+
const m = line.match(/^\s+-\s+['"]?([^'"#\n]+?)['"]?\s*$/);
|
|
301
|
+
if (m) patterns.push(m[1].trim());
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
} catch {
|
|
306
|
+
/* ignore */
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// 2. package.json workspaces (npm/yarn)
|
|
311
|
+
if (patterns.length === 0) {
|
|
312
|
+
const rootPkgPath = path.join(rootDir, 'package.json');
|
|
313
|
+
if (fs.existsSync(rootPkgPath)) {
|
|
314
|
+
try {
|
|
315
|
+
const raw = fs.readFileSync(rootPkgPath, 'utf-8');
|
|
316
|
+
const pkg = JSON.parse(raw);
|
|
317
|
+
const ws = pkg.workspaces;
|
|
318
|
+
if (Array.isArray(ws)) {
|
|
319
|
+
patterns.push(...ws);
|
|
320
|
+
} else if (ws && Array.isArray(ws.packages)) {
|
|
321
|
+
// Yarn classic format: { packages: [...], nohoist: [...] }
|
|
322
|
+
patterns.push(...ws.packages);
|
|
323
|
+
}
|
|
324
|
+
} catch {
|
|
325
|
+
/* ignore */
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// 3. lerna.json
|
|
331
|
+
if (patterns.length === 0) {
|
|
332
|
+
const lernaPath = path.join(rootDir, 'lerna.json');
|
|
333
|
+
if (fs.existsSync(lernaPath)) {
|
|
334
|
+
try {
|
|
335
|
+
const raw = fs.readFileSync(lernaPath, 'utf-8');
|
|
336
|
+
const lerna = JSON.parse(raw);
|
|
337
|
+
if (Array.isArray(lerna.packages)) {
|
|
338
|
+
patterns.push(...lerna.packages);
|
|
339
|
+
}
|
|
340
|
+
} catch {
|
|
341
|
+
/* ignore */
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if (patterns.length === 0) return workspaces;
|
|
347
|
+
|
|
348
|
+
// Expand glob patterns and collect packages
|
|
349
|
+
for (const pattern of patterns) {
|
|
350
|
+
// Check if pattern is a direct path (no glob) or a glob
|
|
351
|
+
if (pattern.includes('*')) {
|
|
352
|
+
for (const dir of expandWorkspaceGlob(pattern, rootDir)) {
|
|
353
|
+
const name = readPackageName(dir);
|
|
354
|
+
if (name) workspaces.set(name, { dir, entry: resolveWorkspaceEntry(dir) });
|
|
355
|
+
}
|
|
356
|
+
} else {
|
|
357
|
+
// Direct path like "packages/core"
|
|
358
|
+
const dir = path.resolve(rootDir, pattern);
|
|
359
|
+
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
360
|
+
const name = readPackageName(dir);
|
|
361
|
+
if (name) workspaces.set(name, { dir, entry: resolveWorkspaceEntry(dir) });
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (workspaces.size > 0) {
|
|
367
|
+
debug(`Detected ${workspaces.size} workspace packages: ${[...workspaces.keys()].join(', ')}`);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
return workspaces;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
export function mergeConfig(defaults, overrides) {
|
|
124
374
|
const result = { ...defaults };
|
|
125
375
|
for (const [key, value] of Object.entries(overrides)) {
|
|
126
376
|
if (
|
|
@@ -128,9 +378,10 @@ function mergeConfig(defaults, overrides) {
|
|
|
128
378
|
typeof value === 'object' &&
|
|
129
379
|
!Array.isArray(value) &&
|
|
130
380
|
defaults[key] &&
|
|
131
|
-
typeof defaults[key] === 'object'
|
|
381
|
+
typeof defaults[key] === 'object' &&
|
|
382
|
+
!Array.isArray(defaults[key])
|
|
132
383
|
) {
|
|
133
|
-
result[key] =
|
|
384
|
+
result[key] = mergeConfig(defaults[key], value);
|
|
134
385
|
} else {
|
|
135
386
|
result[key] = value;
|
|
136
387
|
}
|
package/src/mcp/middleware.js
CHANGED
|
@@ -2,10 +2,28 @@
|
|
|
2
2
|
* MCP middleware helpers — pagination defaults and limits.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { MCP_DEFAULTS, MCP_MAX_LIMIT } from '../shared/paginate.js';
|
|
5
|
+
import { getMcpDefaults, MCP_DEFAULTS, MCP_MAX_LIMIT } from '../shared/paginate.js';
|
|
6
6
|
|
|
7
7
|
export { MCP_DEFAULTS, MCP_MAX_LIMIT };
|
|
8
8
|
|
|
9
|
+
/** Resolved MCP defaults (may include config overrides). Set via initMcpDefaults(). */
|
|
10
|
+
let resolvedDefaults = MCP_DEFAULTS;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Initialize MCP defaults from config. Call once at server startup.
|
|
14
|
+
* @param {object} [configMcpDefaults] - config.mcp.defaults overrides
|
|
15
|
+
*/
|
|
16
|
+
export function initMcpDefaults(configMcpDefaults) {
|
|
17
|
+
resolvedDefaults = getMcpDefaults(configMcpDefaults);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Reset MCP defaults back to the base defaults. Useful for test isolation.
|
|
22
|
+
*/
|
|
23
|
+
export function resetMcpDefaults() {
|
|
24
|
+
resolvedDefaults = MCP_DEFAULTS;
|
|
25
|
+
}
|
|
26
|
+
|
|
9
27
|
/**
|
|
10
28
|
* Resolve effective limit for a tool call.
|
|
11
29
|
* @param {object} args - Tool arguments
|
|
@@ -13,7 +31,7 @@ export { MCP_DEFAULTS, MCP_MAX_LIMIT };
|
|
|
13
31
|
* @returns {number}
|
|
14
32
|
*/
|
|
15
33
|
export function effectiveLimit(args, toolName) {
|
|
16
|
-
return Math.min(args.limit ??
|
|
34
|
+
return Math.min(args.limit ?? resolvedDefaults[toolName] ?? 100, MCP_MAX_LIMIT);
|
|
17
35
|
}
|
|
18
36
|
|
|
19
37
|
/**
|