@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
package/src/types.ts
ADDED
|
@@ -0,0 +1,1609 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for codegraph.
|
|
3
|
+
*
|
|
4
|
+
* These interfaces serve as the migration contract — each module is migrated
|
|
5
|
+
* to satisfy its interface. They capture every abstraction in the codebase:
|
|
6
|
+
* symbol/edge kinds, database shapes, repository contracts, extractors,
|
|
7
|
+
* parsers, builders, visitors, features, config, and the graph model.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
11
|
+
// §1 Symbol & Edge Kind Enumerations
|
|
12
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
13
|
+
|
|
14
|
+
/** The original 10 symbol kinds — default query scope. */
|
|
15
|
+
export type CoreSymbolKind =
|
|
16
|
+
| 'function'
|
|
17
|
+
| 'method'
|
|
18
|
+
| 'class'
|
|
19
|
+
| 'interface'
|
|
20
|
+
| 'type'
|
|
21
|
+
| 'struct'
|
|
22
|
+
| 'enum'
|
|
23
|
+
| 'trait'
|
|
24
|
+
| 'record'
|
|
25
|
+
| 'module';
|
|
26
|
+
|
|
27
|
+
/** Sub-declaration kinds (Phase 1). Includes 'method' for class child nodes. */
|
|
28
|
+
export type ExtendedSymbolKind = 'parameter' | 'property' | 'constant' | 'method';
|
|
29
|
+
|
|
30
|
+
/** All queryable symbol kinds. */
|
|
31
|
+
export type SymbolKind = CoreSymbolKind | ExtendedSymbolKind;
|
|
32
|
+
|
|
33
|
+
/** Special kind used for file-level nodes in the graph. */
|
|
34
|
+
export type FileNodeKind = 'file';
|
|
35
|
+
|
|
36
|
+
/** Union of every kind that can appear in a node row. */
|
|
37
|
+
export type AnyNodeKind = SymbolKind | FileNodeKind;
|
|
38
|
+
|
|
39
|
+
/** Coupling and dependency edge kinds. */
|
|
40
|
+
export type CoreEdgeKind =
|
|
41
|
+
| 'imports'
|
|
42
|
+
| 'imports-type'
|
|
43
|
+
| 'dynamic-imports'
|
|
44
|
+
| 'reexports'
|
|
45
|
+
| 'calls'
|
|
46
|
+
| 'extends'
|
|
47
|
+
| 'implements'
|
|
48
|
+
| 'contains';
|
|
49
|
+
|
|
50
|
+
/** Parent/child and type relationship edges. */
|
|
51
|
+
export type StructuralEdgeKind = 'parameter_of' | 'receiver';
|
|
52
|
+
|
|
53
|
+
/** Dataflow-specific edge kinds. */
|
|
54
|
+
export type DataflowEdgeKind = 'flows_to' | 'returns' | 'mutates';
|
|
55
|
+
|
|
56
|
+
/** All edge kinds that can appear in the graph. */
|
|
57
|
+
export type EdgeKind = CoreEdgeKind | StructuralEdgeKind;
|
|
58
|
+
|
|
59
|
+
/** Extended edge kinds including dataflow. */
|
|
60
|
+
export type AnyEdgeKind = EdgeKind | DataflowEdgeKind;
|
|
61
|
+
|
|
62
|
+
/** AST node kinds extracted during analysis. */
|
|
63
|
+
export type ASTNodeKind = 'call' | 'new' | 'string' | 'regex' | 'throw' | 'await';
|
|
64
|
+
|
|
65
|
+
/** Coarse role classifications for symbols based on connectivity. */
|
|
66
|
+
export type CoreRole = 'entry' | 'core' | 'utility' | 'adapter' | 'dead' | 'test-only' | 'leaf';
|
|
67
|
+
|
|
68
|
+
/** Dead sub-roles — refine the coarse "dead" bucket. */
|
|
69
|
+
export type DeadSubRole = 'dead-leaf' | 'dead-entry' | 'dead-ffi' | 'dead-unresolved';
|
|
70
|
+
|
|
71
|
+
/** Every valid role. */
|
|
72
|
+
export type Role = CoreRole | DeadSubRole;
|
|
73
|
+
|
|
74
|
+
/** Supported language identifiers (from LANGUAGE_REGISTRY). */
|
|
75
|
+
export type LanguageId =
|
|
76
|
+
| 'javascript'
|
|
77
|
+
| 'typescript'
|
|
78
|
+
| 'tsx'
|
|
79
|
+
| 'python'
|
|
80
|
+
| 'go'
|
|
81
|
+
| 'rust'
|
|
82
|
+
| 'java'
|
|
83
|
+
| 'csharp'
|
|
84
|
+
| 'ruby'
|
|
85
|
+
| 'php'
|
|
86
|
+
| 'hcl';
|
|
87
|
+
|
|
88
|
+
/** Engine mode selector. */
|
|
89
|
+
export type EngineMode = 'native' | 'wasm' | 'auto';
|
|
90
|
+
|
|
91
|
+
/** Graph export formats. */
|
|
92
|
+
export type ExportFormat = 'dot' | 'mermaid' | 'json' | 'graphml' | 'graphson' | 'neo4j-csv';
|
|
93
|
+
|
|
94
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
95
|
+
// §2 Database Row Shapes
|
|
96
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
97
|
+
|
|
98
|
+
/** A node row as stored in (and returned from) SQLite. */
|
|
99
|
+
export interface NodeRow {
|
|
100
|
+
id: number;
|
|
101
|
+
name: string;
|
|
102
|
+
kind: AnyNodeKind;
|
|
103
|
+
file: string;
|
|
104
|
+
line: number;
|
|
105
|
+
end_line: number | null;
|
|
106
|
+
parent_id: number | null;
|
|
107
|
+
exported: 0 | 1 | null;
|
|
108
|
+
qualified_name: string | null;
|
|
109
|
+
scope: string | null;
|
|
110
|
+
visibility: 'public' | 'private' | 'protected' | null;
|
|
111
|
+
role: Role | null;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** A node row augmented with fan-in count (from findNodesWithFanIn). */
|
|
115
|
+
export interface NodeRowWithFanIn extends NodeRow {
|
|
116
|
+
fan_in: number;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** Compact node ID row (from bulkNodeIdsByFile). */
|
|
120
|
+
export interface NodeIdRow {
|
|
121
|
+
id: number;
|
|
122
|
+
name: string;
|
|
123
|
+
kind: string;
|
|
124
|
+
line: number;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/** A child node row (from findNodeChildren). */
|
|
128
|
+
export interface ChildNodeRow {
|
|
129
|
+
name: string;
|
|
130
|
+
kind: SymbolKind;
|
|
131
|
+
line: number;
|
|
132
|
+
end_line: number | null;
|
|
133
|
+
qualified_name: string | null;
|
|
134
|
+
scope: string | null;
|
|
135
|
+
visibility: 'public' | 'private' | 'protected' | null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** An edge row as stored in SQLite. */
|
|
139
|
+
export interface EdgeRow {
|
|
140
|
+
id: number;
|
|
141
|
+
source_id: number;
|
|
142
|
+
target_id: number;
|
|
143
|
+
kind: EdgeKind;
|
|
144
|
+
confidence: number | null;
|
|
145
|
+
dynamic: 0 | 1;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/** Callee/caller node shape (from findCallees / findCallers). */
|
|
149
|
+
export interface RelatedNodeRow {
|
|
150
|
+
id: number;
|
|
151
|
+
name: string;
|
|
152
|
+
kind: string;
|
|
153
|
+
file: string;
|
|
154
|
+
line: number;
|
|
155
|
+
end_line?: number | null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** An incoming/outgoing edge with the related node info. */
|
|
159
|
+
export interface AdjacentEdgeRow {
|
|
160
|
+
name: string;
|
|
161
|
+
kind: string;
|
|
162
|
+
file: string;
|
|
163
|
+
line: number;
|
|
164
|
+
edge_kind: EdgeKind;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Import target/source row. */
|
|
168
|
+
export interface ImportEdgeRow {
|
|
169
|
+
file: string;
|
|
170
|
+
edge_kind: EdgeKind;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Intra-file call edge (from findIntraFileCallEdges). */
|
|
174
|
+
export interface IntraFileCallEdge {
|
|
175
|
+
caller_name: string;
|
|
176
|
+
callee_name: string;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Callable node row (for graph-read queries). */
|
|
180
|
+
export interface CallableNodeRow {
|
|
181
|
+
id: number;
|
|
182
|
+
name: string;
|
|
183
|
+
kind: string;
|
|
184
|
+
file: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** Call edge row (for graph-read queries). */
|
|
188
|
+
export interface CallEdgeRow {
|
|
189
|
+
source_id: number;
|
|
190
|
+
target_id: number;
|
|
191
|
+
confidence: number | null;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/** File node row (for graph-read queries). */
|
|
195
|
+
export interface FileNodeRow {
|
|
196
|
+
id: number;
|
|
197
|
+
name: string;
|
|
198
|
+
file: string;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Import edge row (for graph-read queries). */
|
|
202
|
+
export interface ImportGraphEdgeRow {
|
|
203
|
+
source_id: number;
|
|
204
|
+
target_id: number;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Complexity metrics (from getComplexityForNode). */
|
|
208
|
+
export interface ComplexityMetrics {
|
|
209
|
+
cognitive: number;
|
|
210
|
+
cyclomatic: number;
|
|
211
|
+
max_nesting: number;
|
|
212
|
+
maintainability_index: number | null;
|
|
213
|
+
halstead_volume: number | null;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
217
|
+
// §3 Repository Interface
|
|
218
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
219
|
+
|
|
220
|
+
/** Query options common across many repository methods. */
|
|
221
|
+
export interface QueryOpts {
|
|
222
|
+
kind?: SymbolKind;
|
|
223
|
+
kinds?: SymbolKind[];
|
|
224
|
+
file?: string;
|
|
225
|
+
noTests?: boolean;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/** Options for listFunctionNodes / iterateFunctionNodes. */
|
|
229
|
+
export interface ListFunctionOpts {
|
|
230
|
+
file?: string;
|
|
231
|
+
pattern?: string;
|
|
232
|
+
noTests?: boolean;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Options for findNodesForTriage. */
|
|
236
|
+
export interface TriageQueryOpts {
|
|
237
|
+
kind?: string;
|
|
238
|
+
role?: Role;
|
|
239
|
+
noTests?: boolean;
|
|
240
|
+
file?: string;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Abstract Repository contract — defines all graph data access methods.
|
|
245
|
+
* Concrete implementations: SqliteRepository, InMemoryRepository.
|
|
246
|
+
*/
|
|
247
|
+
export interface Repository {
|
|
248
|
+
// ── Node lookups ──────────────────────────────────────────────────
|
|
249
|
+
findNodeById(id: number): NodeRow | undefined;
|
|
250
|
+
findNodesByFile(file: string): NodeRow[];
|
|
251
|
+
findFileNodes(fileLike: string): NodeRow[];
|
|
252
|
+
findNodesWithFanIn(namePattern: string, opts?: QueryOpts): NodeRowWithFanIn[];
|
|
253
|
+
countNodes(): number;
|
|
254
|
+
countEdges(): number;
|
|
255
|
+
countFiles(): number;
|
|
256
|
+
getNodeId(name: string, kind: string, file: string, line: number): number | undefined;
|
|
257
|
+
getFunctionNodeId(name: string, file: string, line: number): number | undefined;
|
|
258
|
+
bulkNodeIdsByFile(file: string): NodeIdRow[];
|
|
259
|
+
findNodeChildren(parentId: number): ChildNodeRow[];
|
|
260
|
+
findNodesByScope(scopeName: string, opts?: QueryOpts): NodeRow[];
|
|
261
|
+
findNodeByQualifiedName(qualifiedName: string, opts?: { file?: string }): NodeRow[];
|
|
262
|
+
listFunctionNodes(opts?: ListFunctionOpts): NodeRow[];
|
|
263
|
+
iterateFunctionNodes(opts?: ListFunctionOpts): IterableIterator<NodeRow>;
|
|
264
|
+
findNodesForTriage(opts?: TriageQueryOpts): NodeRow[];
|
|
265
|
+
|
|
266
|
+
// ── Edge queries ──────────────────────────────────────────────────
|
|
267
|
+
findCallees(nodeId: number): RelatedNodeRow[];
|
|
268
|
+
findCallers(nodeId: number): RelatedNodeRow[];
|
|
269
|
+
findDistinctCallers(nodeId: number): RelatedNodeRow[];
|
|
270
|
+
findAllOutgoingEdges(nodeId: number): AdjacentEdgeRow[];
|
|
271
|
+
findAllIncomingEdges(nodeId: number): AdjacentEdgeRow[];
|
|
272
|
+
findCalleeNames(nodeId: number): string[];
|
|
273
|
+
findCallerNames(nodeId: number): string[];
|
|
274
|
+
findImportTargets(nodeId: number): ImportEdgeRow[];
|
|
275
|
+
findImportSources(nodeId: number): ImportEdgeRow[];
|
|
276
|
+
findImportDependents(nodeId: number): NodeRow[];
|
|
277
|
+
findCrossFileCallTargets(file: string): Set<number>;
|
|
278
|
+
countCrossFileCallers(nodeId: number, file: string): number;
|
|
279
|
+
getClassHierarchy(classNodeId: number): Set<number>;
|
|
280
|
+
findIntraFileCallEdges(file: string): IntraFileCallEdge[];
|
|
281
|
+
|
|
282
|
+
// ── Graph-read queries ────────────────────────────────────────────
|
|
283
|
+
getCallableNodes(): CallableNodeRow[];
|
|
284
|
+
getCallEdges(): CallEdgeRow[];
|
|
285
|
+
getFileNodesAll(): FileNodeRow[];
|
|
286
|
+
getImportEdges(): ImportGraphEdgeRow[];
|
|
287
|
+
|
|
288
|
+
// ── Optional table checks ─────────────────────────────────────────
|
|
289
|
+
hasCfgTables(): boolean;
|
|
290
|
+
hasEmbeddings(): boolean;
|
|
291
|
+
hasDataflowTable(): boolean;
|
|
292
|
+
getComplexityForNode(nodeId: number): ComplexityMetrics | undefined;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* In-memory repository — mutable, used for testing and incremental builds.
|
|
297
|
+
* Extends Repository with mutation methods.
|
|
298
|
+
*/
|
|
299
|
+
export interface MutableRepository extends Repository {
|
|
300
|
+
addNode(attrs: {
|
|
301
|
+
name: string;
|
|
302
|
+
kind: AnyNodeKind;
|
|
303
|
+
file: string;
|
|
304
|
+
line: number;
|
|
305
|
+
end_line?: number;
|
|
306
|
+
parent_id?: number;
|
|
307
|
+
exported?: 0 | 1;
|
|
308
|
+
qualified_name?: string;
|
|
309
|
+
scope?: string;
|
|
310
|
+
visibility?: 'public' | 'private' | 'protected';
|
|
311
|
+
role?: Role;
|
|
312
|
+
}): number;
|
|
313
|
+
|
|
314
|
+
addEdge(attrs: {
|
|
315
|
+
source_id: number;
|
|
316
|
+
target_id: number;
|
|
317
|
+
kind: AnyEdgeKind;
|
|
318
|
+
confidence?: number;
|
|
319
|
+
dynamic?: 0 | 1;
|
|
320
|
+
}): number;
|
|
321
|
+
|
|
322
|
+
addComplexity(
|
|
323
|
+
nodeId: number,
|
|
324
|
+
metrics: {
|
|
325
|
+
cognitive: number;
|
|
326
|
+
cyclomatic: number;
|
|
327
|
+
max_nesting: number;
|
|
328
|
+
maintainability_index?: number;
|
|
329
|
+
halstead_volume?: number;
|
|
330
|
+
},
|
|
331
|
+
): void;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
335
|
+
// §4 Extractor Types
|
|
336
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
337
|
+
|
|
338
|
+
/** A symbol definition produced by any extractor. */
|
|
339
|
+
export interface Definition {
|
|
340
|
+
name: string;
|
|
341
|
+
kind: SymbolKind;
|
|
342
|
+
line: number;
|
|
343
|
+
endLine?: number;
|
|
344
|
+
children?: SubDeclaration[];
|
|
345
|
+
visibility?: 'public' | 'private' | 'protected';
|
|
346
|
+
decorators?: string[];
|
|
347
|
+
/** Populated post-analysis by the complexity visitor. */
|
|
348
|
+
complexity?: DefinitionComplexity;
|
|
349
|
+
/** Populated post-analysis by the CFG visitor. */
|
|
350
|
+
cfg?: { blocks: CfgBlock[]; edges: CfgEdge[] } | null;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/** Sub-declaration (child) within a definition. */
|
|
354
|
+
export interface SubDeclaration {
|
|
355
|
+
name: string;
|
|
356
|
+
kind: 'parameter' | 'property' | 'constant' | 'method';
|
|
357
|
+
line: number;
|
|
358
|
+
endLine?: number;
|
|
359
|
+
visibility?: 'public' | 'private' | 'protected';
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/** Complexity metrics attached to a definition post-analysis. */
|
|
363
|
+
export interface DefinitionComplexity {
|
|
364
|
+
cognitive: number;
|
|
365
|
+
cyclomatic: number;
|
|
366
|
+
maxNesting: number;
|
|
367
|
+
halstead?: HalsteadMetrics;
|
|
368
|
+
loc?: LOCMetrics;
|
|
369
|
+
maintainabilityIndex?: number;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** Halstead software science metrics. */
|
|
373
|
+
export interface HalsteadMetrics {
|
|
374
|
+
volume: number;
|
|
375
|
+
difficulty: number;
|
|
376
|
+
effort: number;
|
|
377
|
+
bugs: number;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/** Lines-of-code metrics. */
|
|
381
|
+
export interface LOCMetrics {
|
|
382
|
+
loc: number;
|
|
383
|
+
sloc: number;
|
|
384
|
+
commentLines: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** A function/method call detected by an extractor. */
|
|
388
|
+
export interface Call {
|
|
389
|
+
name: string;
|
|
390
|
+
line: number;
|
|
391
|
+
receiver?: string;
|
|
392
|
+
dynamic?: boolean;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/** An import statement detected by an extractor. */
|
|
396
|
+
export interface Import {
|
|
397
|
+
source: string;
|
|
398
|
+
names: string[];
|
|
399
|
+
line: number;
|
|
400
|
+
// Standard flags
|
|
401
|
+
typeOnly?: boolean;
|
|
402
|
+
reexport?: boolean;
|
|
403
|
+
wildcardReexport?: boolean;
|
|
404
|
+
dynamicImport?: boolean;
|
|
405
|
+
// Language-specific flags (mutually exclusive at runtime)
|
|
406
|
+
pythonImport?: boolean;
|
|
407
|
+
goImport?: boolean;
|
|
408
|
+
rustUse?: boolean;
|
|
409
|
+
javaImport?: boolean;
|
|
410
|
+
csharpUsing?: boolean;
|
|
411
|
+
rubyRequire?: boolean;
|
|
412
|
+
phpUse?: boolean;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
/** A class/struct/trait relationship (extends or implements). */
|
|
416
|
+
export interface ClassRelation {
|
|
417
|
+
name: string;
|
|
418
|
+
extends?: string;
|
|
419
|
+
implements?: string;
|
|
420
|
+
line: number;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/** A named export from a module. */
|
|
424
|
+
export interface Export {
|
|
425
|
+
name: string;
|
|
426
|
+
kind: SymbolKind;
|
|
427
|
+
line: number;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/** A type-map entry for call resolution confidence scoring. */
|
|
431
|
+
export interface TypeMapEntry {
|
|
432
|
+
type: string;
|
|
433
|
+
confidence: number;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** The normalized output shape returned by every language extractor. */
|
|
437
|
+
export interface ExtractorOutput {
|
|
438
|
+
definitions: Definition[];
|
|
439
|
+
calls: Call[];
|
|
440
|
+
imports: Import[];
|
|
441
|
+
classes: ClassRelation[];
|
|
442
|
+
exports: Export[];
|
|
443
|
+
typeMap: Map<string, TypeMapEntry>;
|
|
444
|
+
/** WASM tree retained for downstream analysis (complexity, CFG, dataflow). */
|
|
445
|
+
_tree?: TreeSitterTree;
|
|
446
|
+
/** Language identifier. */
|
|
447
|
+
_langId?: LanguageId;
|
|
448
|
+
/** Line count for metrics. */
|
|
449
|
+
_lineCount?: number;
|
|
450
|
+
/** Dataflow results, populated post-analysis. */
|
|
451
|
+
dataflow?: DataflowResult;
|
|
452
|
+
/** AST node rows, populated post-analysis. */
|
|
453
|
+
astNodes?: ASTNodeRow[];
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** Extractor function signature. */
|
|
457
|
+
export type ExtractorFn = (
|
|
458
|
+
tree: TreeSitterTree,
|
|
459
|
+
filePath: string,
|
|
460
|
+
query?: TreeSitterQuery,
|
|
461
|
+
) => ExtractorOutput;
|
|
462
|
+
|
|
463
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
464
|
+
// §5 Parser & Language Registry
|
|
465
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
466
|
+
|
|
467
|
+
/** A single entry in the LANGUAGE_REGISTRY. */
|
|
468
|
+
export interface LanguageRegistryEntry {
|
|
469
|
+
id: LanguageId;
|
|
470
|
+
extensions: string[];
|
|
471
|
+
grammarFile: string;
|
|
472
|
+
extractor: ExtractorFn;
|
|
473
|
+
required: boolean;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/** tree-sitter opaque types (thin wrappers — real impl is WASM). */
|
|
477
|
+
export interface TreeSitterNode {
|
|
478
|
+
type: string;
|
|
479
|
+
text: string;
|
|
480
|
+
startPosition: { row: number; column: number };
|
|
481
|
+
endPosition: { row: number; column: number };
|
|
482
|
+
childCount: number;
|
|
483
|
+
namedChildCount: number;
|
|
484
|
+
child(index: number): TreeSitterNode | null;
|
|
485
|
+
namedChild(index: number): TreeSitterNode | null;
|
|
486
|
+
childForFieldName(name: string): TreeSitterNode | null;
|
|
487
|
+
parent: TreeSitterNode | null;
|
|
488
|
+
children: TreeSitterNode[];
|
|
489
|
+
namedChildren: TreeSitterNode[];
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
export interface TreeSitterTree {
|
|
493
|
+
rootNode: TreeSitterNode;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
export interface TreeSitterQuery {
|
|
497
|
+
matches(node: TreeSitterNode): TreeSitterQueryMatch[];
|
|
498
|
+
captures(node: TreeSitterNode): TreeSitterQueryCapture[];
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export interface TreeSitterQueryMatch {
|
|
502
|
+
pattern: number;
|
|
503
|
+
captures: TreeSitterQueryCapture[];
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
export interface TreeSitterQueryCapture {
|
|
507
|
+
name: string;
|
|
508
|
+
node: TreeSitterNode;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
512
|
+
// §6 Import Resolution
|
|
513
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
514
|
+
|
|
515
|
+
/** A single import to resolve. */
|
|
516
|
+
export interface ImportBatchItem {
|
|
517
|
+
fromFile: string;
|
|
518
|
+
importSource: string;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/** Batch of imports to resolve. */
|
|
522
|
+
export type ImportBatch = ImportBatchItem[];
|
|
523
|
+
|
|
524
|
+
/** Result of resolveImportsBatch: Map<"fromFile|importSource", resolvedPath>. */
|
|
525
|
+
export type BatchResolvedMap = Map<string, string>;
|
|
526
|
+
|
|
527
|
+
/** Path aliases from tsconfig/jsconfig. */
|
|
528
|
+
export interface PathAliases {
|
|
529
|
+
baseUrl: string | null;
|
|
530
|
+
paths: Record<string, string[]>;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/** Parsed bare specifier. */
|
|
534
|
+
export interface BareSpecifier {
|
|
535
|
+
packageName: string;
|
|
536
|
+
subpath: string;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
540
|
+
// §7 AST Visitor System
|
|
541
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
542
|
+
|
|
543
|
+
/** Shared context mutated during the DFS walk. */
|
|
544
|
+
export interface VisitorContext {
|
|
545
|
+
nestingLevel: number;
|
|
546
|
+
currentFunction: TreeSitterNode | null;
|
|
547
|
+
langId: string;
|
|
548
|
+
scopeStack: ScopeEntry[];
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/** An entry on the scope stack. */
|
|
552
|
+
export interface ScopeEntry {
|
|
553
|
+
funcName: string | null;
|
|
554
|
+
funcNode: TreeSitterNode;
|
|
555
|
+
params: Map<string, unknown>;
|
|
556
|
+
locals: Map<string, unknown>;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
/** Return value from enterNode — request skip of descendants. */
|
|
560
|
+
export interface EnterNodeResult {
|
|
561
|
+
skipChildren?: boolean;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/** A pluggable analysis visitor for the unified DFS walker. */
|
|
565
|
+
export interface Visitor {
|
|
566
|
+
name: string;
|
|
567
|
+
init?(langId: string): void;
|
|
568
|
+
enterNode?(node: TreeSitterNode, context: VisitorContext): EnterNodeResult | undefined;
|
|
569
|
+
exitNode?(node: TreeSitterNode, context: VisitorContext): void;
|
|
570
|
+
enterFunction?(funcNode: TreeSitterNode, funcName: string | null, context: VisitorContext): void;
|
|
571
|
+
exitFunction?(funcNode: TreeSitterNode, funcName: string | null, context: VisitorContext): void;
|
|
572
|
+
finish?(): unknown;
|
|
573
|
+
functionNodeTypes?: Set<string>;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/** Options for walkWithVisitors. */
|
|
577
|
+
export interface WalkOptions {
|
|
578
|
+
functionNodeTypes?: Set<string>;
|
|
579
|
+
nestingNodeTypes?: Set<string>;
|
|
580
|
+
getFunctionName?: (node: TreeSitterNode) => string | null;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/** Result of walkWithVisitors: Map of visitor.name → finish() result. */
|
|
584
|
+
export type WalkResults = Record<string, unknown>;
|
|
585
|
+
|
|
586
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
587
|
+
// §8 AST Analysis Engine
|
|
588
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
589
|
+
|
|
590
|
+
/** Toggles for runAnalyses. */
|
|
591
|
+
export interface AnalysisOpts {
|
|
592
|
+
ast?: boolean;
|
|
593
|
+
complexity?: boolean;
|
|
594
|
+
cfg?: boolean;
|
|
595
|
+
dataflow?: boolean;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/** Timing output from runAnalyses. */
|
|
599
|
+
export interface AnalysisTiming {
|
|
600
|
+
astMs: number;
|
|
601
|
+
complexityMs: number;
|
|
602
|
+
cfgMs: number;
|
|
603
|
+
dataflowMs: number;
|
|
604
|
+
_unifiedWalkMs?: number;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/** An AST node row stored in the database. */
|
|
608
|
+
export interface ASTNodeRow {
|
|
609
|
+
node_id: number;
|
|
610
|
+
kind: ASTNodeKind;
|
|
611
|
+
line: number;
|
|
612
|
+
text: string;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
/** AST type mapping: tree-sitter node type → analysis kind. */
|
|
616
|
+
export type ASTTypeMap = Map<string, ASTNodeKind>;
|
|
617
|
+
|
|
618
|
+
/** Complexity rules for a language. */
|
|
619
|
+
export interface ComplexityRules {
|
|
620
|
+
branchNodes: Set<string>;
|
|
621
|
+
nestingNodes: Set<string>;
|
|
622
|
+
functionNodes: Set<string>;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/** Halstead rules for a language. */
|
|
626
|
+
export interface HalsteadRules {
|
|
627
|
+
operators: Set<string>;
|
|
628
|
+
operands: Set<string>;
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
/** CFG rules for a language. */
|
|
632
|
+
export interface CfgRules {
|
|
633
|
+
controlFlowNodes: Set<string>;
|
|
634
|
+
functionNodes: Set<string>;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
/** Dataflow rules for a language. */
|
|
638
|
+
export interface DataflowRules {
|
|
639
|
+
variableDeclarators: Set<string>;
|
|
640
|
+
parameterNodes: Set<string>;
|
|
641
|
+
callNodes: Set<string>;
|
|
642
|
+
memberNodes: Set<string>;
|
|
643
|
+
returnNodes: Set<string>;
|
|
644
|
+
awaitNodes: Set<string>;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/** A basic block in a control flow graph. */
|
|
648
|
+
export interface CfgBlock {
|
|
649
|
+
id: number;
|
|
650
|
+
label: string;
|
|
651
|
+
startLine: number;
|
|
652
|
+
endLine: number;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** An edge in a control flow graph. */
|
|
656
|
+
export interface CfgEdge {
|
|
657
|
+
from: number;
|
|
658
|
+
to: number;
|
|
659
|
+
label?: string;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
/** Dataflow extraction result. */
|
|
663
|
+
export interface DataflowResult {
|
|
664
|
+
parameters: DataflowParam[];
|
|
665
|
+
returns: DataflowReturn[];
|
|
666
|
+
assignments: DataflowAssignment[];
|
|
667
|
+
argFlows: DataflowArgFlow[];
|
|
668
|
+
mutations: DataflowMutation[];
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
export interface DataflowParam {
|
|
672
|
+
name: string;
|
|
673
|
+
funcName: string;
|
|
674
|
+
line: number;
|
|
675
|
+
typeHint?: string;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface DataflowReturn {
|
|
679
|
+
funcName: string;
|
|
680
|
+
line: number;
|
|
681
|
+
expression: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
export interface DataflowAssignment {
|
|
685
|
+
name: string;
|
|
686
|
+
line: number;
|
|
687
|
+
expression: string;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
export interface DataflowArgFlow {
|
|
691
|
+
callerFunc: string;
|
|
692
|
+
callee: string;
|
|
693
|
+
argIndex: number;
|
|
694
|
+
binding: { name: string; type: 'param' | 'local' | 'unknown' };
|
|
695
|
+
line: number;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
export interface DataflowMutation {
|
|
699
|
+
binding: { name: string; type: 'param' | 'local' | 'unknown' };
|
|
700
|
+
mutatingExpr: string;
|
|
701
|
+
line: number;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
705
|
+
// §9 Graph Model (CodeGraph)
|
|
706
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
707
|
+
|
|
708
|
+
/** Node attributes stored in the in-memory graph. */
|
|
709
|
+
export interface GraphNodeAttrs {
|
|
710
|
+
label?: string;
|
|
711
|
+
kind?: string;
|
|
712
|
+
file?: string;
|
|
713
|
+
name?: string;
|
|
714
|
+
line?: number;
|
|
715
|
+
dbId?: number;
|
|
716
|
+
[key: string]: unknown;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/** Edge attributes stored in the in-memory graph. */
|
|
720
|
+
export interface GraphEdgeAttrs {
|
|
721
|
+
kind?: string;
|
|
722
|
+
confidence?: number;
|
|
723
|
+
weight?: number;
|
|
724
|
+
[key: string]: unknown;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
/** The unified in-memory graph model. */
|
|
728
|
+
export interface CodeGraph {
|
|
729
|
+
readonly directed: boolean;
|
|
730
|
+
readonly nodeCount: number;
|
|
731
|
+
readonly edgeCount: number;
|
|
732
|
+
|
|
733
|
+
// Node operations
|
|
734
|
+
addNode(id: string, attrs?: GraphNodeAttrs): CodeGraph;
|
|
735
|
+
hasNode(id: string): boolean;
|
|
736
|
+
getNodeAttrs(id: string): GraphNodeAttrs | undefined;
|
|
737
|
+
nodes(): IterableIterator<[string, GraphNodeAttrs]>;
|
|
738
|
+
nodeIds(): string[];
|
|
739
|
+
|
|
740
|
+
// Edge operations
|
|
741
|
+
addEdge(source: string, target: string, attrs?: GraphEdgeAttrs): CodeGraph;
|
|
742
|
+
hasEdge(source: string, target: string): boolean;
|
|
743
|
+
getEdgeAttrs(source: string, target: string): GraphEdgeAttrs | undefined;
|
|
744
|
+
edges(): Generator<[string, string, GraphEdgeAttrs]>;
|
|
745
|
+
|
|
746
|
+
// Adjacency
|
|
747
|
+
successors(id: string): string[];
|
|
748
|
+
predecessors(id: string): string[];
|
|
749
|
+
neighbors(id: string): string[];
|
|
750
|
+
outDegree(id: string): number;
|
|
751
|
+
inDegree(id: string): number;
|
|
752
|
+
|
|
753
|
+
// Filtering
|
|
754
|
+
subgraph(predicate: (id: string, attrs: GraphNodeAttrs) => boolean): CodeGraph;
|
|
755
|
+
filterEdges(predicate: (src: string, tgt: string, attrs: GraphEdgeAttrs) => boolean): CodeGraph;
|
|
756
|
+
|
|
757
|
+
// Conversion
|
|
758
|
+
toEdgeArray(): Array<{ source: string; target: string }>;
|
|
759
|
+
toGraphology(opts?: { type?: string }): unknown;
|
|
760
|
+
|
|
761
|
+
// Utilities
|
|
762
|
+
clone(): CodeGraph;
|
|
763
|
+
merge(other: CodeGraph): CodeGraph;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
767
|
+
// §10 Build Pipeline
|
|
768
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
769
|
+
|
|
770
|
+
/** Engine options for the build pipeline. */
|
|
771
|
+
export interface EngineOpts {
|
|
772
|
+
engine: EngineMode;
|
|
773
|
+
dataflow: boolean;
|
|
774
|
+
ast: boolean;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
/** A file change detected during incremental builds. */
|
|
778
|
+
export interface ParseChange {
|
|
779
|
+
file: string;
|
|
780
|
+
relPath?: string;
|
|
781
|
+
content?: string;
|
|
782
|
+
hash?: string;
|
|
783
|
+
stat?: { mtime: number; size: number };
|
|
784
|
+
_reverseDepOnly?: boolean;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
/** Metadata-only self-heal update. */
|
|
788
|
+
export interface MetadataUpdate {
|
|
789
|
+
relPath: string;
|
|
790
|
+
hash: string;
|
|
791
|
+
stat: { mtime: number; size: number };
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/** A file queued for parsing. */
|
|
795
|
+
export interface FileToParse {
|
|
796
|
+
file: string;
|
|
797
|
+
relPath?: string;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
/** Shared mutable state threaded through all build stages. */
|
|
801
|
+
export interface PipelineContext {
|
|
802
|
+
// Inputs (set during setup)
|
|
803
|
+
rootDir: string;
|
|
804
|
+
db: unknown; // better-sqlite3.Database
|
|
805
|
+
dbPath: string;
|
|
806
|
+
config: CodegraphConfig;
|
|
807
|
+
opts: BuildGraphOpts;
|
|
808
|
+
engineOpts: EngineOpts;
|
|
809
|
+
engineName: 'native' | 'wasm';
|
|
810
|
+
engineVersion: string | null;
|
|
811
|
+
aliases: PathAliases;
|
|
812
|
+
incremental: boolean;
|
|
813
|
+
forceFullRebuild: boolean;
|
|
814
|
+
schemaVersion: number;
|
|
815
|
+
|
|
816
|
+
// File collection
|
|
817
|
+
allFiles: string[];
|
|
818
|
+
discoveredDirs: Set<string>;
|
|
819
|
+
|
|
820
|
+
// Change detection
|
|
821
|
+
isFullBuild: boolean;
|
|
822
|
+
parseChanges: ParseChange[];
|
|
823
|
+
metadataUpdates: MetadataUpdate[];
|
|
824
|
+
removed: string[];
|
|
825
|
+
earlyExit: boolean;
|
|
826
|
+
|
|
827
|
+
// Parsing
|
|
828
|
+
allSymbols: Map<string, ExtractorOutput>;
|
|
829
|
+
fileSymbols: Map<string, ExtractorOutput>;
|
|
830
|
+
filesToParse: FileToParse[];
|
|
831
|
+
|
|
832
|
+
// Import resolution
|
|
833
|
+
batchResolved: BatchResolvedMap | null;
|
|
834
|
+
reexportMap: Map<string, unknown[]>;
|
|
835
|
+
barrelOnlyFiles: Set<string>;
|
|
836
|
+
|
|
837
|
+
// Node lookup
|
|
838
|
+
nodesByName: Map<string, NodeRow[]>;
|
|
839
|
+
nodesByNameAndFile: Map<string, NodeRow[]>;
|
|
840
|
+
|
|
841
|
+
// Misc state
|
|
842
|
+
hasEmbeddings: boolean;
|
|
843
|
+
lineCountMap: Map<string, number>;
|
|
844
|
+
|
|
845
|
+
// Phase timing
|
|
846
|
+
timing: Record<string, number>;
|
|
847
|
+
buildStart: number;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
/** Options for buildGraph. */
|
|
851
|
+
export interface BuildGraphOpts {
|
|
852
|
+
incremental?: boolean;
|
|
853
|
+
engine?: EngineMode;
|
|
854
|
+
dataflow?: boolean;
|
|
855
|
+
ast?: boolean;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
/** Build timing result from buildGraph. */
|
|
859
|
+
export interface BuildResult {
|
|
860
|
+
phases: {
|
|
861
|
+
setupMs: number;
|
|
862
|
+
parseMs: number;
|
|
863
|
+
insertMs: number;
|
|
864
|
+
resolveMs: number;
|
|
865
|
+
edgesMs: number;
|
|
866
|
+
structureMs: number;
|
|
867
|
+
rolesMs: number;
|
|
868
|
+
astMs: number;
|
|
869
|
+
complexityMs: number;
|
|
870
|
+
cfgMs: number;
|
|
871
|
+
dataflowMs: number;
|
|
872
|
+
finalizeMs: number;
|
|
873
|
+
};
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
/** A pipeline stage function. */
|
|
877
|
+
export type PipelineStage = (ctx: PipelineContext) => Promise<void>;
|
|
878
|
+
|
|
879
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
880
|
+
// §11 Configuration
|
|
881
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
882
|
+
|
|
883
|
+
export interface CodegraphConfig {
|
|
884
|
+
include: string[];
|
|
885
|
+
exclude: string[];
|
|
886
|
+
ignoreDirs: string[];
|
|
887
|
+
extensions: string[];
|
|
888
|
+
aliases: Record<string, unknown>;
|
|
889
|
+
|
|
890
|
+
build: {
|
|
891
|
+
incremental: boolean;
|
|
892
|
+
dbPath: string;
|
|
893
|
+
driftThreshold: number;
|
|
894
|
+
};
|
|
895
|
+
|
|
896
|
+
query: {
|
|
897
|
+
defaultDepth: number;
|
|
898
|
+
defaultLimit: number;
|
|
899
|
+
excludeTests: boolean;
|
|
900
|
+
};
|
|
901
|
+
|
|
902
|
+
embeddings: {
|
|
903
|
+
model: string;
|
|
904
|
+
llmProvider: string | null;
|
|
905
|
+
};
|
|
906
|
+
|
|
907
|
+
llm: {
|
|
908
|
+
provider: string | null;
|
|
909
|
+
model: string | null;
|
|
910
|
+
baseUrl: string | null;
|
|
911
|
+
apiKey: string | null;
|
|
912
|
+
apiKeyCommand: string | null;
|
|
913
|
+
};
|
|
914
|
+
|
|
915
|
+
search: {
|
|
916
|
+
defaultMinScore: number;
|
|
917
|
+
rrfK: number;
|
|
918
|
+
topK: number;
|
|
919
|
+
similarityWarnThreshold: number;
|
|
920
|
+
};
|
|
921
|
+
|
|
922
|
+
ci: {
|
|
923
|
+
failOnCycles: boolean;
|
|
924
|
+
impactThreshold: number | null;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
manifesto: {
|
|
928
|
+
rules: ManifestoRules;
|
|
929
|
+
boundaries: unknown | null;
|
|
930
|
+
};
|
|
931
|
+
|
|
932
|
+
check: {
|
|
933
|
+
cycles: boolean;
|
|
934
|
+
blastRadius: number | null;
|
|
935
|
+
signatures: boolean;
|
|
936
|
+
boundaries: boolean;
|
|
937
|
+
depth: number;
|
|
938
|
+
};
|
|
939
|
+
|
|
940
|
+
coChange: {
|
|
941
|
+
since: string;
|
|
942
|
+
minSupport: number;
|
|
943
|
+
minJaccard: number;
|
|
944
|
+
maxFilesPerCommit: number;
|
|
945
|
+
};
|
|
946
|
+
|
|
947
|
+
analysis: {
|
|
948
|
+
impactDepth: number;
|
|
949
|
+
fnImpactDepth: number;
|
|
950
|
+
auditDepth: number;
|
|
951
|
+
sequenceDepth: number;
|
|
952
|
+
falsePositiveCallers: number;
|
|
953
|
+
briefCallerDepth: number;
|
|
954
|
+
briefImporterDepth: number;
|
|
955
|
+
briefHighRiskCallers: number;
|
|
956
|
+
briefMediumRiskCallers: number;
|
|
957
|
+
};
|
|
958
|
+
|
|
959
|
+
community: { resolution: number };
|
|
960
|
+
structure: { cohesionThreshold: number };
|
|
961
|
+
|
|
962
|
+
risk: {
|
|
963
|
+
weights: RiskWeights;
|
|
964
|
+
roleWeights: Record<Role, number>;
|
|
965
|
+
defaultRoleWeight: number;
|
|
966
|
+
};
|
|
967
|
+
|
|
968
|
+
display: {
|
|
969
|
+
maxColWidth: number;
|
|
970
|
+
excerptLines: number;
|
|
971
|
+
summaryMaxChars: number;
|
|
972
|
+
jsdocEndScanLines: number;
|
|
973
|
+
jsdocOpenScanLines: number;
|
|
974
|
+
signatureGatherLines: number;
|
|
975
|
+
};
|
|
976
|
+
|
|
977
|
+
mcp: {
|
|
978
|
+
defaults: McpDefaults;
|
|
979
|
+
};
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
export interface ManifestoRules {
|
|
983
|
+
cognitive: ThresholdRule;
|
|
984
|
+
cyclomatic: ThresholdRule;
|
|
985
|
+
maxNesting: ThresholdRule;
|
|
986
|
+
maintainabilityIndex: ThresholdRule;
|
|
987
|
+
importCount: ThresholdRule;
|
|
988
|
+
exportCount: ThresholdRule;
|
|
989
|
+
lineCount: ThresholdRule;
|
|
990
|
+
fanIn: ThresholdRule;
|
|
991
|
+
fanOut: ThresholdRule;
|
|
992
|
+
noCycles: ThresholdRule;
|
|
993
|
+
boundaries: ThresholdRule;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
export interface ThresholdRule {
|
|
997
|
+
warn: number | null;
|
|
998
|
+
fail?: number | null;
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
export interface RiskWeights {
|
|
1002
|
+
fanIn: number;
|
|
1003
|
+
complexity: number;
|
|
1004
|
+
churn: number;
|
|
1005
|
+
role: number;
|
|
1006
|
+
mi: number;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
export interface McpDefaults {
|
|
1010
|
+
list_functions: number;
|
|
1011
|
+
query: number;
|
|
1012
|
+
where: number;
|
|
1013
|
+
node_roles: number;
|
|
1014
|
+
export_graph: number;
|
|
1015
|
+
fn_impact: number;
|
|
1016
|
+
context: number;
|
|
1017
|
+
explain: number;
|
|
1018
|
+
file_deps: number;
|
|
1019
|
+
file_exports: number;
|
|
1020
|
+
diff_impact: number;
|
|
1021
|
+
impact_analysis: number;
|
|
1022
|
+
semantic_search: number;
|
|
1023
|
+
execution_flow: number;
|
|
1024
|
+
hotspots: number;
|
|
1025
|
+
co_changes: number;
|
|
1026
|
+
complexity: number;
|
|
1027
|
+
manifesto: number;
|
|
1028
|
+
communities: number;
|
|
1029
|
+
structure: number;
|
|
1030
|
+
triage: number;
|
|
1031
|
+
ast_query: number;
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1035
|
+
// §12 Pagination
|
|
1036
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1037
|
+
|
|
1038
|
+
export interface PaginationOpts {
|
|
1039
|
+
limit?: number;
|
|
1040
|
+
offset?: number;
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1043
|
+
export interface PaginationMeta {
|
|
1044
|
+
total: number;
|
|
1045
|
+
offset: number;
|
|
1046
|
+
limit: number;
|
|
1047
|
+
hasMore: boolean;
|
|
1048
|
+
returned: number;
|
|
1049
|
+
}
|
|
1050
|
+
|
|
1051
|
+
export interface PaginatedItems<T> {
|
|
1052
|
+
items: T[];
|
|
1053
|
+
pagination?: PaginationMeta;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
/** A result object with optional _pagination metadata. */
|
|
1057
|
+
export type Paginated<T> = T & { _pagination?: PaginationMeta };
|
|
1058
|
+
|
|
1059
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1060
|
+
// §13 Error Hierarchy
|
|
1061
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1062
|
+
|
|
1063
|
+
export type ErrorCode =
|
|
1064
|
+
| 'CODEGRAPH_ERROR'
|
|
1065
|
+
| 'PARSE_FAILED'
|
|
1066
|
+
| 'DB_ERROR'
|
|
1067
|
+
| 'CONFIG_INVALID'
|
|
1068
|
+
| 'RESOLUTION_FAILED'
|
|
1069
|
+
| 'ENGINE_UNAVAILABLE'
|
|
1070
|
+
| 'ANALYSIS_FAILED'
|
|
1071
|
+
| 'BOUNDARY_VIOLATION';
|
|
1072
|
+
|
|
1073
|
+
export interface CodegraphErrorOpts {
|
|
1074
|
+
code?: ErrorCode;
|
|
1075
|
+
file?: string;
|
|
1076
|
+
cause?: Error;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1080
|
+
// §14 Feature Module Result Shapes
|
|
1081
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1082
|
+
|
|
1083
|
+
// ── Audit ────────────────────────────────────────────────────────────
|
|
1084
|
+
|
|
1085
|
+
export interface AuditResult {
|
|
1086
|
+
target: string;
|
|
1087
|
+
kind: 'function' | 'file';
|
|
1088
|
+
functions: AuditFunctionEntry[];
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
export interface AuditFunctionEntry {
|
|
1092
|
+
name: string;
|
|
1093
|
+
kind: SymbolKind;
|
|
1094
|
+
file: string;
|
|
1095
|
+
line: number;
|
|
1096
|
+
endLine: number | null;
|
|
1097
|
+
role: Role | null;
|
|
1098
|
+
lineCount: number;
|
|
1099
|
+
summary: string | null;
|
|
1100
|
+
signature: string | null;
|
|
1101
|
+
callees: string[];
|
|
1102
|
+
callers: string[];
|
|
1103
|
+
relatedTests: string[];
|
|
1104
|
+
impact: {
|
|
1105
|
+
totalDependents: number;
|
|
1106
|
+
levels: Record<number, ImpactLevelEntry[]>;
|
|
1107
|
+
};
|
|
1108
|
+
health: {
|
|
1109
|
+
cognitive: number;
|
|
1110
|
+
cyclomatic: number;
|
|
1111
|
+
maxNesting: number;
|
|
1112
|
+
maintainabilityIndex: number | null;
|
|
1113
|
+
halstead: HalsteadMetrics | null;
|
|
1114
|
+
loc: number;
|
|
1115
|
+
sloc: number;
|
|
1116
|
+
commentLines: number;
|
|
1117
|
+
thresholdBreaches: string[];
|
|
1118
|
+
};
|
|
1119
|
+
riskScore: number;
|
|
1120
|
+
complexityNotes: string[];
|
|
1121
|
+
sideEffects: string[];
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
export interface ImpactLevelEntry {
|
|
1125
|
+
name: string;
|
|
1126
|
+
kind: string;
|
|
1127
|
+
file: string;
|
|
1128
|
+
line: number;
|
|
1129
|
+
viaImplements?: boolean;
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
// ── Complexity ───────────────────────────────────────────────────────
|
|
1133
|
+
|
|
1134
|
+
export interface ComplexityResult {
|
|
1135
|
+
functions: ComplexityEntry[];
|
|
1136
|
+
summary: {
|
|
1137
|
+
analyzed: number;
|
|
1138
|
+
avgCognitive: number;
|
|
1139
|
+
maxCognitive: number;
|
|
1140
|
+
avgCyclomatic: number;
|
|
1141
|
+
maxCyclomatic: number;
|
|
1142
|
+
avgMI: number;
|
|
1143
|
+
minMI: number;
|
|
1144
|
+
aboveWarn: number;
|
|
1145
|
+
};
|
|
1146
|
+
thresholds: ManifestoRules;
|
|
1147
|
+
hasGraph: boolean;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
export interface ComplexityEntry {
|
|
1151
|
+
name: string;
|
|
1152
|
+
kind: SymbolKind;
|
|
1153
|
+
file: string;
|
|
1154
|
+
line: number;
|
|
1155
|
+
endLine: number | null;
|
|
1156
|
+
cognitive: number;
|
|
1157
|
+
cyclomatic: number;
|
|
1158
|
+
maxNesting: number;
|
|
1159
|
+
loc: number;
|
|
1160
|
+
sloc: number;
|
|
1161
|
+
maintainabilityIndex: number;
|
|
1162
|
+
halstead: HalsteadMetrics;
|
|
1163
|
+
exceeds?: Array<'cognitive' | 'cyclomatic' | 'maxNesting' | 'maintainabilityIndex'>;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
// ── Diff Impact ──────────────────────────────────────────────────────
|
|
1167
|
+
|
|
1168
|
+
export interface DiffImpactResult {
|
|
1169
|
+
error?: string;
|
|
1170
|
+
changedFiles: number;
|
|
1171
|
+
newFiles: string[];
|
|
1172
|
+
affectedFunctions: AffectedFunction[];
|
|
1173
|
+
affectedFiles: string[];
|
|
1174
|
+
historicallyCoupled?: CoChangeEntry[];
|
|
1175
|
+
ownership?: Record<string, string>;
|
|
1176
|
+
boundaryViolations?: BoundaryViolation[];
|
|
1177
|
+
boundaryViolationCount: number;
|
|
1178
|
+
summary?: DiffImpactSummary;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
export interface AffectedFunction {
|
|
1182
|
+
name: string;
|
|
1183
|
+
kind: string;
|
|
1184
|
+
file: string;
|
|
1185
|
+
line: number;
|
|
1186
|
+
totalDependents: number;
|
|
1187
|
+
levels: Record<number, ImpactLevelEntry[]>;
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
export interface CoChangeEntry {
|
|
1191
|
+
file: string;
|
|
1192
|
+
support: number;
|
|
1193
|
+
jaccard: number;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
export interface BoundaryViolation {
|
|
1197
|
+
from: string;
|
|
1198
|
+
to: string;
|
|
1199
|
+
rule: string;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
export interface DiffImpactSummary {
|
|
1203
|
+
changedFiles: number;
|
|
1204
|
+
newFiles: number;
|
|
1205
|
+
affectedFunctions: number;
|
|
1206
|
+
totalDependents: number;
|
|
1207
|
+
boundaryViolations: number;
|
|
1208
|
+
}
|
|
1209
|
+
|
|
1210
|
+
// ── Triage ───────────────────────────────────────────────────────────
|
|
1211
|
+
|
|
1212
|
+
export interface TriageResult {
|
|
1213
|
+
items: TriageEntry[];
|
|
1214
|
+
summary: {
|
|
1215
|
+
total: number;
|
|
1216
|
+
analyzed: number;
|
|
1217
|
+
avgScore: number;
|
|
1218
|
+
maxScore: number;
|
|
1219
|
+
weights: RiskWeights;
|
|
1220
|
+
signalCoverage: {
|
|
1221
|
+
complexity: number;
|
|
1222
|
+
churn: number;
|
|
1223
|
+
fanIn: number;
|
|
1224
|
+
mi: number;
|
|
1225
|
+
};
|
|
1226
|
+
};
|
|
1227
|
+
_pagination?: PaginationMeta;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
export interface TriageEntry {
|
|
1231
|
+
name: string;
|
|
1232
|
+
kind: SymbolKind;
|
|
1233
|
+
file: string;
|
|
1234
|
+
line: number;
|
|
1235
|
+
role: Role | null;
|
|
1236
|
+
fanIn: number;
|
|
1237
|
+
cognitive: number;
|
|
1238
|
+
churn: number;
|
|
1239
|
+
maintainabilityIndex: number;
|
|
1240
|
+
normFanIn: number;
|
|
1241
|
+
normComplexity: number;
|
|
1242
|
+
normChurn: number;
|
|
1243
|
+
normMI: number;
|
|
1244
|
+
roleWeight: number;
|
|
1245
|
+
riskScore: number;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// ── Communities ───────────────────────────────────────────────────────
|
|
1249
|
+
|
|
1250
|
+
export interface CommunitiesResult {
|
|
1251
|
+
communities: CommunityEntry[];
|
|
1252
|
+
modularity: number;
|
|
1253
|
+
drift: {
|
|
1254
|
+
splitCandidates: Array<{ directory: string; communityCount: number }>;
|
|
1255
|
+
mergeCandidates: Array<{
|
|
1256
|
+
communityId: number;
|
|
1257
|
+
size: number;
|
|
1258
|
+
directoryCount: number;
|
|
1259
|
+
directories: string[];
|
|
1260
|
+
}>;
|
|
1261
|
+
};
|
|
1262
|
+
summary: {
|
|
1263
|
+
communityCount: number;
|
|
1264
|
+
modularity: number;
|
|
1265
|
+
nodeCount: number;
|
|
1266
|
+
driftScore: number;
|
|
1267
|
+
};
|
|
1268
|
+
_pagination?: PaginationMeta;
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
export interface CommunityEntry {
|
|
1272
|
+
id: number;
|
|
1273
|
+
size: number;
|
|
1274
|
+
directories: Record<string, number>;
|
|
1275
|
+
members?: Array<{ name: string; file: string; kind?: string }>;
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// ── Check ────────────────────────────────────────────────────────────
|
|
1279
|
+
|
|
1280
|
+
export interface CheckResult {
|
|
1281
|
+
predicates: CheckPredicate[];
|
|
1282
|
+
summary: {
|
|
1283
|
+
total: number;
|
|
1284
|
+
passed: number;
|
|
1285
|
+
failed: number;
|
|
1286
|
+
changedFiles: number;
|
|
1287
|
+
newFiles: number;
|
|
1288
|
+
};
|
|
1289
|
+
passed: boolean;
|
|
1290
|
+
error?: string;
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
export interface CheckPredicate {
|
|
1294
|
+
name: string;
|
|
1295
|
+
passed: boolean;
|
|
1296
|
+
violations: unknown[];
|
|
1297
|
+
maxFound?: number;
|
|
1298
|
+
threshold?: number;
|
|
1299
|
+
note?: string;
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
// ── Batch ────────────────────────────────────────────────────────────
|
|
1303
|
+
|
|
1304
|
+
export type BatchCommand =
|
|
1305
|
+
| 'fn-impact'
|
|
1306
|
+
| 'context'
|
|
1307
|
+
| 'explain'
|
|
1308
|
+
| 'where'
|
|
1309
|
+
| 'query'
|
|
1310
|
+
| 'impact'
|
|
1311
|
+
| 'deps'
|
|
1312
|
+
| 'exports'
|
|
1313
|
+
| 'flow'
|
|
1314
|
+
| 'dataflow'
|
|
1315
|
+
| 'complexity';
|
|
1316
|
+
|
|
1317
|
+
export interface BatchResult {
|
|
1318
|
+
command: BatchCommand;
|
|
1319
|
+
total: number;
|
|
1320
|
+
succeeded: number;
|
|
1321
|
+
failed: number;
|
|
1322
|
+
results: BatchResultEntry[];
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
export interface BatchResultEntry {
|
|
1326
|
+
target: string;
|
|
1327
|
+
ok: boolean;
|
|
1328
|
+
data?: unknown;
|
|
1329
|
+
error?: string;
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
export interface MultiBatchItem {
|
|
1333
|
+
command: BatchCommand;
|
|
1334
|
+
target: string;
|
|
1335
|
+
opts?: Record<string, unknown>;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
export interface MultiBatchResult {
|
|
1339
|
+
mode: 'multi';
|
|
1340
|
+
total: number;
|
|
1341
|
+
succeeded: number;
|
|
1342
|
+
failed: number;
|
|
1343
|
+
results: BatchResultEntry[];
|
|
1344
|
+
}
|
|
1345
|
+
|
|
1346
|
+
// ── Flow ─────────────────────────────────────────────────────────────
|
|
1347
|
+
|
|
1348
|
+
export interface FlowResult {
|
|
1349
|
+
entry: FlowEntry | null;
|
|
1350
|
+
depth: number;
|
|
1351
|
+
steps: Array<{
|
|
1352
|
+
depth: number;
|
|
1353
|
+
nodes: Array<{ name: string; kind: string; file: string; line: number }>;
|
|
1354
|
+
}>;
|
|
1355
|
+
leaves: Array<{ name: string; kind: string; file: string; line: number; depth: number }>;
|
|
1356
|
+
cycles: Array<{ from: string; to: string; depth: number }>;
|
|
1357
|
+
totalReached: number;
|
|
1358
|
+
truncated: boolean;
|
|
1359
|
+
_pagination?: PaginationMeta;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
export interface FlowEntry {
|
|
1363
|
+
name: string;
|
|
1364
|
+
kind: string;
|
|
1365
|
+
file: string;
|
|
1366
|
+
line: number;
|
|
1367
|
+
type: string;
|
|
1368
|
+
role: Role | null;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// ── Manifesto ────────────────────────────────────────────────────────
|
|
1372
|
+
|
|
1373
|
+
export type ManifestoRuleLevel = 'function' | 'file' | 'graph';
|
|
1374
|
+
|
|
1375
|
+
export interface ManifestoRuleDef {
|
|
1376
|
+
name: string;
|
|
1377
|
+
level: ManifestoRuleLevel;
|
|
1378
|
+
metric: string;
|
|
1379
|
+
defaults: ThresholdRule;
|
|
1380
|
+
reportOnly?: boolean;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
export interface ManifestoResult {
|
|
1384
|
+
rules: ManifestoRuleStatus[];
|
|
1385
|
+
violations: ManifestoViolation[];
|
|
1386
|
+
summary: { total: number; passed: number; warned: number; failed: number };
|
|
1387
|
+
_pagination?: PaginationMeta;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
export interface ManifestoRuleStatus {
|
|
1391
|
+
name: string;
|
|
1392
|
+
level: ManifestoRuleLevel;
|
|
1393
|
+
status: 'pass' | 'warn' | 'fail';
|
|
1394
|
+
thresholds: ThresholdRule;
|
|
1395
|
+
violationCount: number;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
export interface ManifestoViolation {
|
|
1399
|
+
rule: string;
|
|
1400
|
+
level: ManifestoRuleLevel;
|
|
1401
|
+
value: number;
|
|
1402
|
+
threshold: number;
|
|
1403
|
+
name?: string;
|
|
1404
|
+
kind?: string;
|
|
1405
|
+
file?: string;
|
|
1406
|
+
line?: number;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
// ── Exports (file) ───────────────────────────────────────────────────
|
|
1410
|
+
|
|
1411
|
+
export interface FileExportsResult {
|
|
1412
|
+
file: string;
|
|
1413
|
+
results: FileExportEntry[];
|
|
1414
|
+
reexports: Array<{ file: string }>;
|
|
1415
|
+
totalExported: number;
|
|
1416
|
+
totalInternal: number;
|
|
1417
|
+
totalUnused: number;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
export interface FileExportEntry {
|
|
1421
|
+
name: string;
|
|
1422
|
+
kind: SymbolKind;
|
|
1423
|
+
line: number;
|
|
1424
|
+
endLine: number | null;
|
|
1425
|
+
role: Role | null;
|
|
1426
|
+
signature: string | null;
|
|
1427
|
+
summary: string | null;
|
|
1428
|
+
consumers: Array<{ name: string; file: string; line: number }>;
|
|
1429
|
+
consumerCount: number;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// ── Path ─────────────────────────────────────────────────────────────
|
|
1433
|
+
|
|
1434
|
+
export interface PathResult {
|
|
1435
|
+
from: string;
|
|
1436
|
+
to: string;
|
|
1437
|
+
fromCandidates: NodeRow[];
|
|
1438
|
+
toCandidates: NodeRow[];
|
|
1439
|
+
found: boolean;
|
|
1440
|
+
hops: number | null;
|
|
1441
|
+
path: PathStep[];
|
|
1442
|
+
alternateCount: number;
|
|
1443
|
+
edgeKinds: string[];
|
|
1444
|
+
reverse: boolean;
|
|
1445
|
+
maxDepth: number;
|
|
1446
|
+
}
|
|
1447
|
+
|
|
1448
|
+
export interface PathStep {
|
|
1449
|
+
name: string;
|
|
1450
|
+
kind: string;
|
|
1451
|
+
file: string;
|
|
1452
|
+
line: number;
|
|
1453
|
+
edgeKind: AnyEdgeKind | null;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
// ── Stats ────────────────────────────────────────────────────────────
|
|
1457
|
+
|
|
1458
|
+
export interface StatsResult {
|
|
1459
|
+
nodes: { total: number; byKind: Record<string, number> };
|
|
1460
|
+
edges: { total: number; byKind: Record<string, number> };
|
|
1461
|
+
files: Record<string, unknown>;
|
|
1462
|
+
cycles: { fileLevel: number; functionLevel: number };
|
|
1463
|
+
hotspots: unknown[];
|
|
1464
|
+
embeddings?: unknown;
|
|
1465
|
+
quality?: unknown;
|
|
1466
|
+
roles: Record<Role, number>;
|
|
1467
|
+
complexity?: unknown;
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
// ── Module Map ───────────────────────────────────────────────────────
|
|
1471
|
+
|
|
1472
|
+
export interface ModuleMapResult {
|
|
1473
|
+
limit: number;
|
|
1474
|
+
topNodes: ModuleMapEntry[];
|
|
1475
|
+
stats: { totalFiles: number; totalNodes: number; totalEdges: number };
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
export interface ModuleMapEntry {
|
|
1479
|
+
file: string;
|
|
1480
|
+
dir: string;
|
|
1481
|
+
inEdges: number;
|
|
1482
|
+
outEdges: number;
|
|
1483
|
+
coupling: number;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
// ── Roles ────────────────────────────────────────────────────────────
|
|
1487
|
+
|
|
1488
|
+
export interface RolesResult {
|
|
1489
|
+
count: number;
|
|
1490
|
+
summary: Record<Role, number>;
|
|
1491
|
+
symbols: NodeRow[];
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1495
|
+
// §15 Registry (Multi-repo)
|
|
1496
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1497
|
+
|
|
1498
|
+
export interface RegistryEntry {
|
|
1499
|
+
path: string;
|
|
1500
|
+
dbPath: string;
|
|
1501
|
+
addedAt: string;
|
|
1502
|
+
lastAccessedAt: string;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
export interface Registry {
|
|
1506
|
+
repos: Record<string, RegistryEntry>;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
export interface RegistryListItem {
|
|
1510
|
+
name: string;
|
|
1511
|
+
path: string;
|
|
1512
|
+
dbPath: string;
|
|
1513
|
+
addedAt: string;
|
|
1514
|
+
lastAccessedAt: string;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1518
|
+
// §16 MCP Server
|
|
1519
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1520
|
+
|
|
1521
|
+
export interface MCPServerOptions {
|
|
1522
|
+
multiRepo?: boolean;
|
|
1523
|
+
allowedRepos?: string[];
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1527
|
+
// §17 Command Interface (CLI)
|
|
1528
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1529
|
+
|
|
1530
|
+
export interface OptionDef {
|
|
1531
|
+
flags: string;
|
|
1532
|
+
description: string;
|
|
1533
|
+
default?: unknown;
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
export interface Command {
|
|
1537
|
+
name: string;
|
|
1538
|
+
description: string;
|
|
1539
|
+
options: OptionDef[];
|
|
1540
|
+
validate?(args: unknown, opts: unknown): void;
|
|
1541
|
+
execute(args: unknown, opts: unknown): Promise<void>;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1545
|
+
// §18 Risk Scoring
|
|
1546
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1547
|
+
|
|
1548
|
+
export interface RiskInput {
|
|
1549
|
+
fan_in: number;
|
|
1550
|
+
cognitive: number;
|
|
1551
|
+
churn: number;
|
|
1552
|
+
mi: number;
|
|
1553
|
+
role?: Role;
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
export interface RiskScored {
|
|
1557
|
+
normFanIn: number;
|
|
1558
|
+
normComplexity: number;
|
|
1559
|
+
normChurn: number;
|
|
1560
|
+
normMI: number;
|
|
1561
|
+
roleWeight: number;
|
|
1562
|
+
riskScore: number;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1566
|
+
// §19 Sequence Diagrams
|
|
1567
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1568
|
+
|
|
1569
|
+
export interface SequenceStep {
|
|
1570
|
+
caller: string;
|
|
1571
|
+
callee: string;
|
|
1572
|
+
depth: number;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
export interface SequenceResult {
|
|
1576
|
+
entry: string;
|
|
1577
|
+
steps: SequenceStep[];
|
|
1578
|
+
participants: string[];
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1582
|
+
// §20 Graph Export
|
|
1583
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
1584
|
+
|
|
1585
|
+
export interface ExportOpts {
|
|
1586
|
+
fileLevel?: boolean;
|
|
1587
|
+
noTests?: boolean;
|
|
1588
|
+
minConfidence?: number;
|
|
1589
|
+
limit?: number;
|
|
1590
|
+
offset?: number;
|
|
1591
|
+
direction?: string;
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
export interface ExportJSONResult {
|
|
1595
|
+
nodes: NodeRow[];
|
|
1596
|
+
edges: EdgeRow[];
|
|
1597
|
+
_pagination?: PaginationMeta;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
export interface ExportGraphSONResult {
|
|
1601
|
+
vertices: unknown[];
|
|
1602
|
+
edges: unknown[];
|
|
1603
|
+
_pagination?: PaginationMeta;
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
export interface ExportNeo4jCSVResult {
|
|
1607
|
+
nodes: string;
|
|
1608
|
+
relationships: string;
|
|
1609
|
+
}
|