optave-codegraph 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +984 -0
- package/dist/ast-analysis/engine.d.ts +19 -0
- package/dist/ast-analysis/engine.d.ts.map +1 -0
- package/dist/ast-analysis/engine.js +660 -0
- package/dist/ast-analysis/engine.js.map +1 -0
- package/dist/ast-analysis/metrics.d.ts +34 -0
- package/dist/ast-analysis/metrics.d.ts.map +1 -0
- package/dist/ast-analysis/metrics.js +123 -0
- package/dist/ast-analysis/metrics.js.map +1 -0
- package/dist/ast-analysis/rules/b2.d.ts +7 -0
- package/dist/ast-analysis/rules/b2.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b2.js +240 -0
- package/dist/ast-analysis/rules/b2.js.map +1 -0
- package/dist/ast-analysis/rules/b3.d.ts +6 -0
- package/dist/ast-analysis/rules/b3.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b3.js +105 -0
- package/dist/ast-analysis/rules/b3.js.map +1 -0
- package/dist/ast-analysis/rules/b4.d.ts +9 -0
- package/dist/ast-analysis/rules/b4.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b4.js +361 -0
- package/dist/ast-analysis/rules/b4.js.map +1 -0
- package/dist/ast-analysis/rules/b5.d.ts +4 -0
- package/dist/ast-analysis/rules/b5.d.ts.map +1 -0
- package/dist/ast-analysis/rules/b5.js +52 -0
- package/dist/ast-analysis/rules/b5.js.map +1 -0
- package/dist/ast-analysis/rules/c.d.ts +4 -0
- package/dist/ast-analysis/rules/c.d.ts.map +1 -0
- package/dist/ast-analysis/rules/c.js +143 -0
- package/dist/ast-analysis/rules/c.js.map +1 -0
- package/dist/ast-analysis/rules/csharp.d.ts +7 -0
- package/dist/ast-analysis/rules/csharp.d.ts.map +1 -0
- package/dist/ast-analysis/rules/csharp.js +196 -0
- package/dist/ast-analysis/rules/csharp.js.map +1 -0
- package/dist/ast-analysis/rules/go.d.ts +7 -0
- package/dist/ast-analysis/rules/go.d.ts.map +1 -0
- package/dist/ast-analysis/rules/go.js +173 -0
- package/dist/ast-analysis/rules/go.js.map +1 -0
- package/dist/ast-analysis/rules/index.d.ts +13 -0
- package/dist/ast-analysis/rules/index.d.ts.map +1 -0
- package/dist/ast-analysis/rules/index.js +325 -0
- package/dist/ast-analysis/rules/index.js.map +1 -0
- package/dist/ast-analysis/rules/java.d.ts +7 -0
- package/dist/ast-analysis/rules/java.d.ts.map +1 -0
- package/dist/ast-analysis/rules/java.js +167 -0
- package/dist/ast-analysis/rules/java.js.map +1 -0
- package/dist/ast-analysis/rules/javascript.d.ts +7 -0
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -0
- package/dist/ast-analysis/rules/javascript.js +233 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -0
- package/dist/ast-analysis/rules/php.d.ts +7 -0
- package/dist/ast-analysis/rules/php.d.ts.map +1 -0
- package/dist/ast-analysis/rules/php.js +212 -0
- package/dist/ast-analysis/rules/php.js.map +1 -0
- package/dist/ast-analysis/rules/python.d.ts +7 -0
- package/dist/ast-analysis/rules/python.d.ts.map +1 -0
- package/dist/ast-analysis/rules/python.js +189 -0
- package/dist/ast-analysis/rules/python.js.map +1 -0
- package/dist/ast-analysis/rules/ruby.d.ts +7 -0
- package/dist/ast-analysis/rules/ruby.d.ts.map +1 -0
- package/dist/ast-analysis/rules/ruby.js +193 -0
- package/dist/ast-analysis/rules/ruby.js.map +1 -0
- package/dist/ast-analysis/rules/rust.d.ts +7 -0
- package/dist/ast-analysis/rules/rust.d.ts.map +1 -0
- package/dist/ast-analysis/rules/rust.js +166 -0
- package/dist/ast-analysis/rules/rust.js.map +1 -0
- package/dist/ast-analysis/shared.d.ts +12 -0
- package/dist/ast-analysis/shared.d.ts.map +1 -0
- package/dist/ast-analysis/shared.js +166 -0
- package/dist/ast-analysis/shared.js.map +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts +70 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -0
- package/dist/ast-analysis/visitor-utils.js +235 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -0
- package/dist/ast-analysis/visitor.d.ts +27 -0
- package/dist/ast-analysis/visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitor.js +178 -0
- package/dist/ast-analysis/visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts +4 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js +288 -0
- package/dist/ast-analysis/visitors/ast-store-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.d.ts +5 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.js +166 -0
- package/dist/ast-analysis/visitors/cfg-conditionals.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-loops.d.ts +7 -0
- package/dist/ast-analysis/visitors/cfg-loops.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-loops.js +73 -0
- package/dist/ast-analysis/visitors/cfg-loops.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-shared.d.ts +56 -0
- package/dist/ast-analysis/visitors/cfg-shared.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-shared.js +107 -0
- package/dist/ast-analysis/visitors/cfg-shared.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.d.ts +4 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.js +100 -0
- package/dist/ast-analysis/visitors/cfg-try-catch.js.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts +5 -0
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js +231 -0
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts +8 -0
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js +233 -0
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts +5 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js +378 -0
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -0
- package/dist/cli/commands/ast.d.ts +3 -0
- package/dist/cli/commands/ast.d.ts.map +1 -0
- package/dist/cli/commands/ast.js +23 -0
- package/dist/cli/commands/ast.js.map +1 -0
- package/dist/cli/commands/audit.d.ts +3 -0
- package/dist/cli/commands/audit.d.ts.map +1 -0
- package/dist/cli/commands/audit.js +47 -0
- package/dist/cli/commands/audit.js.map +1 -0
- package/dist/cli/commands/batch.d.ts +3 -0
- package/dist/cli/commands/batch.d.ts.map +1 -0
- package/dist/cli/commands/batch.js +66 -0
- package/dist/cli/commands/batch.js.map +1 -0
- package/dist/cli/commands/branch-compare.d.ts +3 -0
- package/dist/cli/commands/branch-compare.d.ts.map +1 -0
- package/dist/cli/commands/branch-compare.js +26 -0
- package/dist/cli/commands/branch-compare.js.map +1 -0
- package/dist/cli/commands/brief.d.ts +3 -0
- package/dist/cli/commands/brief.d.ts.map +1 -0
- package/dist/cli/commands/brief.js +12 -0
- package/dist/cli/commands/brief.js.map +1 -0
- package/dist/cli/commands/build.d.ts +3 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/build.js +33 -0
- package/dist/cli/commands/build.js.map +1 -0
- package/dist/cli/commands/cfg.d.ts +3 -0
- package/dist/cli/commands/cfg.d.ts.map +1 -0
- package/dist/cli/commands/cfg.js +27 -0
- package/dist/cli/commands/cfg.js.map +1 -0
- package/dist/cli/commands/check.d.ts +3 -0
- package/dist/cli/commands/check.d.ts.map +1 -0
- package/dist/cli/commands/check.js +65 -0
- package/dist/cli/commands/check.js.map +1 -0
- package/dist/cli/commands/children.d.ts +3 -0
- package/dist/cli/commands/children.d.ts.map +1 -0
- package/dist/cli/commands/children.js +33 -0
- package/dist/cli/commands/children.js.map +1 -0
- package/dist/cli/commands/co-change.d.ts +3 -0
- package/dist/cli/commands/co-change.d.ts.map +1 -0
- package/dist/cli/commands/co-change.js +66 -0
- package/dist/cli/commands/co-change.js.map +1 -0
- package/dist/cli/commands/communities.d.ts +3 -0
- package/dist/cli/commands/communities.d.ts.map +1 -0
- package/dist/cli/commands/communities.js +20 -0
- package/dist/cli/commands/communities.js.map +1 -0
- package/dist/cli/commands/complexity.d.ts +3 -0
- package/dist/cli/commands/complexity.d.ts.map +1 -0
- package/dist/cli/commands/complexity.js +47 -0
- package/dist/cli/commands/complexity.js.map +1 -0
- package/dist/cli/commands/config.d.ts +3 -0
- package/dist/cli/commands/config.d.ts.map +1 -0
- package/dist/cli/commands/config.js +275 -0
- package/dist/cli/commands/config.js.map +1 -0
- package/dist/cli/commands/context.d.ts +3 -0
- package/dist/cli/commands/context.d.ts.map +1 -0
- package/dist/cli/commands/context.js +35 -0
- package/dist/cli/commands/context.js.map +1 -0
- package/dist/cli/commands/cycles.d.ts +3 -0
- package/dist/cli/commands/cycles.d.ts.map +1 -0
- package/dist/cli/commands/cycles.js +33 -0
- package/dist/cli/commands/cycles.js.map +1 -0
- package/dist/cli/commands/dataflow.d.ts +3 -0
- package/dist/cli/commands/dataflow.d.ts.map +1 -0
- package/dist/cli/commands/dataflow.js +29 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/deps.d.ts +3 -0
- package/dist/cli/commands/deps.d.ts.map +1 -0
- package/dist/cli/commands/deps.js +18 -0
- package/dist/cli/commands/deps.js.map +1 -0
- package/dist/cli/commands/diff-impact.d.ts +3 -0
- package/dist/cli/commands/diff-impact.d.ts.map +1 -0
- package/dist/cli/commands/diff-impact.js +29 -0
- package/dist/cli/commands/diff-impact.js.map +1 -0
- package/dist/cli/commands/embed.d.ts +3 -0
- package/dist/cli/commands/embed.d.ts.map +1 -0
- package/dist/cli/commands/embed.js +75 -0
- package/dist/cli/commands/embed.js.map +1 -0
- package/dist/cli/commands/export.d.ts +3 -0
- package/dist/cli/commands/export.d.ts.map +1 -0
- package/dist/cli/commands/export.js +72 -0
- package/dist/cli/commands/export.js.map +1 -0
- package/dist/cli/commands/exports.d.ts +3 -0
- package/dist/cli/commands/exports.d.ts.map +1 -0
- package/dist/cli/commands/exports.js +14 -0
- package/dist/cli/commands/exports.js.map +1 -0
- package/dist/cli/commands/flow.d.ts +3 -0
- package/dist/cli/commands/flow.d.ts.map +1 -0
- package/dist/cli/commands/flow.js +32 -0
- package/dist/cli/commands/flow.js.map +1 -0
- package/dist/cli/commands/fn-impact.d.ts +3 -0
- package/dist/cli/commands/fn-impact.d.ts.map +1 -0
- package/dist/cli/commands/fn-impact.js +33 -0
- package/dist/cli/commands/fn-impact.js.map +1 -0
- package/dist/cli/commands/impact.d.ts +3 -0
- package/dist/cli/commands/impact.d.ts.map +1 -0
- package/dist/cli/commands/impact.js +12 -0
- package/dist/cli/commands/impact.js.map +1 -0
- package/dist/cli/commands/implementations.d.ts +3 -0
- package/dist/cli/commands/implementations.d.ts.map +1 -0
- package/dist/cli/commands/implementations.js +29 -0
- package/dist/cli/commands/implementations.js.map +1 -0
- package/dist/cli/commands/info.d.ts +3 -0
- package/dist/cli/commands/info.d.ts.map +1 -0
- package/dist/cli/commands/info.js +67 -0
- package/dist/cli/commands/info.js.map +1 -0
- package/dist/cli/commands/interfaces.d.ts +3 -0
- package/dist/cli/commands/interfaces.d.ts.map +1 -0
- package/dist/cli/commands/interfaces.js +29 -0
- package/dist/cli/commands/interfaces.js.map +1 -0
- package/dist/cli/commands/map.d.ts +3 -0
- package/dist/cli/commands/map.d.ts.map +1 -0
- package/dist/cli/commands/map.js +19 -0
- package/dist/cli/commands/map.js.map +1 -0
- package/dist/cli/commands/mcp.d.ts +3 -0
- package/dist/cli/commands/mcp.d.ts.map +1 -0
- package/dist/cli/commands/mcp.js +18 -0
- package/dist/cli/commands/mcp.js.map +1 -0
- package/dist/cli/commands/models.d.ts +3 -0
- package/dist/cli/commands/models.d.ts.map +1 -0
- package/dist/cli/commands/models.js +19 -0
- package/dist/cli/commands/models.js.map +1 -0
- package/dist/cli/commands/owners.d.ts +3 -0
- package/dist/cli/commands/owners.d.ts.map +1 -0
- package/dist/cli/commands/owners.js +27 -0
- package/dist/cli/commands/owners.js.map +1 -0
- package/dist/cli/commands/path.d.ts +3 -0
- package/dist/cli/commands/path.d.ts.map +1 -0
- package/dist/cli/commands/path.js +41 -0
- package/dist/cli/commands/path.js.map +1 -0
- package/dist/cli/commands/plot.d.ts +3 -0
- package/dist/cli/commands/plot.d.ts.map +1 -0
- package/dist/cli/commands/plot.js +96 -0
- package/dist/cli/commands/plot.js.map +1 -0
- package/dist/cli/commands/query.d.ts +3 -0
- package/dist/cli/commands/query.d.ts.map +1 -0
- package/dist/cli/commands/query.js +51 -0
- package/dist/cli/commands/query.js.map +1 -0
- package/dist/cli/commands/registry.d.ts +3 -0
- package/dist/cli/commands/registry.d.ts.map +1 -0
- package/dist/cli/commands/registry.js +95 -0
- package/dist/cli/commands/registry.js.map +1 -0
- package/dist/cli/commands/roles.d.ts +3 -0
- package/dist/cli/commands/roles.d.ts.map +1 -0
- package/dist/cli/commands/roles.js +36 -0
- package/dist/cli/commands/roles.js.map +1 -0
- package/dist/cli/commands/search.d.ts +3 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +43 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/commands/sequence.d.ts +3 -0
- package/dist/cli/commands/sequence.d.ts.map +1 -0
- package/dist/cli/commands/sequence.js +29 -0
- package/dist/cli/commands/sequence.js.map +1 -0
- package/dist/cli/commands/snapshot.d.ts +3 -0
- package/dist/cli/commands/snapshot.d.ts.map +1 -0
- package/dist/cli/commands/snapshot.js +61 -0
- package/dist/cli/commands/snapshot.js.map +1 -0
- package/dist/cli/commands/stats.d.ts +3 -0
- package/dist/cli/commands/stats.d.ts.map +1 -0
- package/dist/cli/commands/stats.js +15 -0
- package/dist/cli/commands/stats.js.map +1 -0
- package/dist/cli/commands/structure.d.ts +3 -0
- package/dist/cli/commands/structure.d.ts.map +1 -0
- package/dist/cli/commands/structure.js +50 -0
- package/dist/cli/commands/structure.js.map +1 -0
- package/dist/cli/commands/triage.d.ts +3 -0
- package/dist/cli/commands/triage.d.ts.map +1 -0
- package/dist/cli/commands/triage.js +89 -0
- package/dist/cli/commands/triage.js.map +1 -0
- package/dist/cli/commands/watch.d.ts +3 -0
- package/dist/cli/commands/watch.d.ts.map +1 -0
- package/dist/cli/commands/watch.js +28 -0
- package/dist/cli/commands/watch.js.map +1 -0
- package/dist/cli/commands/where.d.ts +3 -0
- package/dist/cli/commands/where.d.ts.map +1 -0
- package/dist/cli/commands/where.js +20 -0
- package/dist/cli/commands/where.js.map +1 -0
- package/dist/cli/index.d.ts +22 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +139 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/shared/open-graph.d.ts +11 -0
- package/dist/cli/shared/open-graph.d.ts.map +1 -0
- package/dist/cli/shared/open-graph.js +9 -0
- package/dist/cli/shared/open-graph.js.map +1 -0
- package/dist/cli/shared/options.d.ts +25 -0
- package/dist/cli/shared/options.d.ts.map +1 -0
- package/dist/cli/shared/options.js +66 -0
- package/dist/cli/shared/options.js.map +1 -0
- package/dist/cli/shared/output.d.ts +2 -0
- package/dist/cli/shared/output.d.ts.map +1 -0
- package/dist/cli/shared/output.js +2 -0
- package/dist/cli/shared/output.js.map +1 -0
- package/dist/cli/types.d.ts +32 -0
- package/dist/cli/types.d.ts.map +1 -0
- package/dist/cli/types.js +2 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +38 -0
- package/dist/cli.js.map +1 -0
- package/dist/db/better-sqlite3.d.ts +4 -0
- package/dist/db/better-sqlite3.d.ts.map +1 -0
- package/dist/db/better-sqlite3.js +19 -0
- package/dist/db/better-sqlite3.js.map +1 -0
- package/dist/db/connection.d.ts +82 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +444 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/index.d.ts +6 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +6 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/migrations.d.ts +11 -0
- package/dist/db/migrations.d.ts.map +1 -0
- package/dist/db/migrations.js +416 -0
- package/dist/db/migrations.js.map +1 -0
- package/dist/db/query-builder.d.ts +88 -0
- package/dist/db/query-builder.d.ts.map +1 -0
- package/dist/db/query-builder.js +321 -0
- package/dist/db/query-builder.js.map +1 -0
- package/dist/db/repository/base.d.ts +103 -0
- package/dist/db/repository/base.d.ts.map +1 -0
- package/dist/db/repository/base.js +172 -0
- package/dist/db/repository/base.js.map +1 -0
- package/dist/db/repository/build-stmts.d.ts +16 -0
- package/dist/db/repository/build-stmts.d.ts.map +1 -0
- package/dist/db/repository/build-stmts.js +76 -0
- package/dist/db/repository/build-stmts.js.map +1 -0
- package/dist/db/repository/cached-stmt.d.ts +9 -0
- package/dist/db/repository/cached-stmt.d.ts.map +1 -0
- package/dist/db/repository/cached-stmt.js +15 -0
- package/dist/db/repository/cached-stmt.js.map +1 -0
- package/dist/db/repository/cfg.d.ts +34 -0
- package/dist/db/repository/cfg.d.ts.map +1 -0
- package/dist/db/repository/cfg.js +46 -0
- package/dist/db/repository/cfg.js.map +1 -0
- package/dist/db/repository/cochange.d.ts +14 -0
- package/dist/db/repository/cochange.d.ts.map +1 -0
- package/dist/db/repository/cochange.js +38 -0
- package/dist/db/repository/cochange.js.map +1 -0
- package/dist/db/repository/complexity.d.ts +7 -0
- package/dist/db/repository/complexity.d.ts.map +1 -0
- package/dist/db/repository/complexity.js +12 -0
- package/dist/db/repository/complexity.js.map +1 -0
- package/dist/db/repository/dataflow.d.ts +11 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -0
- package/dist/db/repository/dataflow.js +30 -0
- package/dist/db/repository/dataflow.js.map +1 -0
- package/dist/db/repository/edges.d.ts +66 -0
- package/dist/db/repository/edges.d.ts.map +1 -0
- package/dist/db/repository/edges.js +175 -0
- package/dist/db/repository/edges.js.map +1 -0
- package/dist/db/repository/embeddings.d.ts +14 -0
- package/dist/db/repository/embeddings.d.ts.map +1 -0
- package/dist/db/repository/embeddings.js +40 -0
- package/dist/db/repository/embeddings.js.map +1 -0
- package/dist/db/repository/graph-read.d.ts +18 -0
- package/dist/db/repository/graph-read.d.ts.map +1 -0
- package/dist/db/repository/graph-read.js +33 -0
- package/dist/db/repository/graph-read.js.map +1 -0
- package/dist/db/repository/in-memory-repository.d.ts +88 -0
- package/dist/db/repository/in-memory-repository.d.ts.map +1 -0
- package/dist/db/repository/in-memory-repository.js +541 -0
- package/dist/db/repository/in-memory-repository.js.map +1 -0
- package/dist/db/repository/index.d.ts +16 -0
- package/dist/db/repository/index.d.ts.map +1 -0
- package/dist/db/repository/index.js +16 -0
- package/dist/db/repository/index.js.map +1 -0
- package/dist/db/repository/native-repository.d.ts +70 -0
- package/dist/db/repository/native-repository.d.ts.map +1 -0
- package/dist/db/repository/native-repository.js +418 -0
- package/dist/db/repository/native-repository.js.map +1 -0
- package/dist/db/repository/nodes.d.ts +86 -0
- package/dist/db/repository/nodes.d.ts.map +1 -0
- package/dist/db/repository/nodes.js +203 -0
- package/dist/db/repository/nodes.js.map +1 -0
- package/dist/db/repository/sqlite-repository.d.ts +59 -0
- package/dist/db/repository/sqlite-repository.d.ts.map +1 -0
- package/dist/db/repository/sqlite-repository.js +199 -0
- package/dist/db/repository/sqlite-repository.js.map +1 -0
- package/dist/domain/analysis/brief.d.ts +25 -0
- package/dist/domain/analysis/brief.d.ts.map +1 -0
- package/dist/domain/analysis/brief.js +136 -0
- package/dist/domain/analysis/brief.js.map +1 -0
- package/dist/domain/analysis/context.d.ts +241 -0
- package/dist/domain/analysis/context.d.ts.map +1 -0
- package/dist/domain/analysis/context.js +361 -0
- package/dist/domain/analysis/context.js.map +1 -0
- package/dist/domain/analysis/dependencies.d.ts +158 -0
- package/dist/domain/analysis/dependencies.d.ts.map +1 -0
- package/dist/domain/analysis/dependencies.js +522 -0
- package/dist/domain/analysis/dependencies.js.map +1 -0
- package/dist/domain/analysis/diff-impact.d.ts +90 -0
- package/dist/domain/analysis/diff-impact.d.ts.map +1 -0
- package/dist/domain/analysis/diff-impact.js +301 -0
- package/dist/domain/analysis/diff-impact.js.map +1 -0
- package/dist/domain/analysis/exports.d.ts +8 -0
- package/dist/domain/analysis/exports.d.ts.map +1 -0
- package/dist/domain/analysis/exports.js +178 -0
- package/dist/domain/analysis/exports.js.map +1 -0
- package/dist/domain/analysis/fn-impact.d.ts +61 -0
- package/dist/domain/analysis/fn-impact.d.ts.map +1 -0
- package/dist/domain/analysis/fn-impact.js +190 -0
- package/dist/domain/analysis/fn-impact.js.map +1 -0
- package/dist/domain/analysis/impact.d.ts +11 -0
- package/dist/domain/analysis/impact.d.ts.map +1 -0
- package/dist/domain/analysis/impact.js +11 -0
- package/dist/domain/analysis/impact.js.map +1 -0
- package/dist/domain/analysis/implementations.d.ts +59 -0
- package/dist/domain/analysis/implementations.d.ts.map +1 -0
- package/dist/domain/analysis/implementations.js +65 -0
- package/dist/domain/analysis/implementations.js.map +1 -0
- package/dist/domain/analysis/module-map.d.ts +86 -0
- package/dist/domain/analysis/module-map.d.ts.map +1 -0
- package/dist/domain/analysis/module-map.js +468 -0
- package/dist/domain/analysis/module-map.js.map +1 -0
- package/dist/domain/analysis/query-helpers.d.ts +27 -0
- package/dist/domain/analysis/query-helpers.d.ts.map +1 -0
- package/dist/domain/analysis/query-helpers.js +41 -0
- package/dist/domain/analysis/query-helpers.js.map +1 -0
- package/dist/domain/analysis/roles.d.ts +20 -0
- package/dist/domain/analysis/roles.d.ts.map +1 -0
- package/dist/domain/analysis/roles.js +74 -0
- package/dist/domain/analysis/roles.js.map +1 -0
- package/dist/domain/analysis/symbol-lookup.d.ts +125 -0
- package/dist/domain/analysis/symbol-lookup.d.ts.map +1 -0
- package/dist/domain/analysis/symbol-lookup.js +206 -0
- package/dist/domain/analysis/symbol-lookup.js.map +1 -0
- package/dist/domain/graph/builder/call-resolver.d.ts +89 -0
- package/dist/domain/graph/builder/call-resolver.d.ts.map +1 -0
- package/dist/domain/graph/builder/call-resolver.js +212 -0
- package/dist/domain/graph/builder/call-resolver.js.map +1 -0
- package/dist/domain/graph/builder/cha.d.ts +69 -0
- package/dist/domain/graph/builder/cha.d.ts.map +1 -0
- package/dist/domain/graph/builder/cha.js +158 -0
- package/dist/domain/graph/builder/cha.js.map +1 -0
- package/dist/domain/graph/builder/context.d.ts +91 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -0
- package/dist/domain/graph/builder/context.js +66 -0
- package/dist/domain/graph/builder/context.js.map +1 -0
- package/dist/domain/graph/builder/helpers.d.ts +97 -0
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -0
- package/dist/domain/graph/builder/helpers.js +558 -0
- package/dist/domain/graph/builder/helpers.js.map +1 -0
- package/dist/domain/graph/builder/incremental.d.ts +53 -0
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -0
- package/dist/domain/graph/builder/incremental.js +647 -0
- package/dist/domain/graph/builder/incremental.js.map +1 -0
- package/dist/domain/graph/builder/native-db-proxy.d.ts +24 -0
- package/dist/domain/graph/builder/native-db-proxy.d.ts.map +1 -0
- package/dist/domain/graph/builder/native-db-proxy.js +91 -0
- package/dist/domain/graph/builder/native-db-proxy.js.map +1 -0
- package/dist/domain/graph/builder/pipeline.d.ts +9 -0
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -0
- package/dist/domain/graph/builder/pipeline.js +448 -0
- package/dist/domain/graph/builder/pipeline.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts +3 -0
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-edges.js +1425 -0
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts +3 -0
- package/dist/domain/graph/builder/stages/build-structure.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/build-structure.js +250 -0
- package/dist/domain/graph/builder/stages/build-structure.js.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts +3 -0
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/collect-files.js +161 -0
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts +27 -0
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/detect-changes.js +593 -0
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts +3 -0
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/finalize.js +274 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts +35 -0
- package/dist/domain/graph/builder/stages/insert-nodes.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js +351 -0
- package/dist/domain/graph/builder/stages/insert-nodes.js.map +1 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts +14 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js +77 -0
- package/dist/domain/graph/builder/stages/native-db-lifecycle.js.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts +62 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js +1763 -0
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts +3 -0
- package/dist/domain/graph/builder/stages/parse-files.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/parse-files.js +22 -0
- package/dist/domain/graph/builder/stages/parse-files.js.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts +7 -0
- package/dist/domain/graph/builder/stages/resolve-imports.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js +231 -0
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts +3 -0
- package/dist/domain/graph/builder/stages/run-analyses.d.ts.map +1 -0
- package/dist/domain/graph/builder/stages/run-analyses.js +23 -0
- package/dist/domain/graph/builder/stages/run-analyses.js.map +1 -0
- package/dist/domain/graph/builder.d.ts +4 -0
- package/dist/domain/graph/builder.d.ts.map +1 -0
- package/dist/domain/graph/builder.js +6 -0
- package/dist/domain/graph/builder.js.map +1 -0
- package/dist/domain/graph/change-journal.d.ts +50 -0
- package/dist/domain/graph/change-journal.d.ts.map +1 -0
- package/dist/domain/graph/change-journal.js +97 -0
- package/dist/domain/graph/change-journal.js.map +1 -0
- package/dist/domain/graph/cycles.d.ts +19 -0
- package/dist/domain/graph/cycles.d.ts.map +1 -0
- package/dist/domain/graph/cycles.js +142 -0
- package/dist/domain/graph/cycles.js.map +1 -0
- package/dist/domain/graph/journal.d.ts +30 -0
- package/dist/domain/graph/journal.d.ts.map +1 -0
- package/dist/domain/graph/journal.js +360 -0
- package/dist/domain/graph/journal.js.map +1 -0
- package/dist/domain/graph/resolve.d.ts +67 -0
- package/dist/domain/graph/resolve.d.ts.map +1 -0
- package/dist/domain/graph/resolve.js +521 -0
- package/dist/domain/graph/resolve.js.map +1 -0
- package/dist/domain/graph/resolver/points-to.d.ts +53 -0
- package/dist/domain/graph/resolver/points-to.d.ts.map +1 -0
- package/dist/domain/graph/resolver/points-to.js +261 -0
- package/dist/domain/graph/resolver/points-to.js.map +1 -0
- package/dist/domain/graph/resolver/strategy.d.ts +61 -0
- package/dist/domain/graph/resolver/strategy.d.ts.map +1 -0
- package/dist/domain/graph/resolver/strategy.js +222 -0
- package/dist/domain/graph/resolver/strategy.js.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts +9 -0
- package/dist/domain/graph/resolver/ts-resolver.d.ts.map +1 -0
- package/dist/domain/graph/resolver/ts-resolver.js +476 -0
- package/dist/domain/graph/resolver/ts-resolver.js.map +1 -0
- package/dist/domain/graph/watcher.d.ts +23 -0
- package/dist/domain/graph/watcher.d.ts.map +1 -0
- package/dist/domain/graph/watcher.js +272 -0
- package/dist/domain/graph/watcher.js.map +1 -0
- package/dist/domain/parser.d.ts +128 -0
- package/dist/domain/parser.d.ts.map +1 -0
- package/dist/domain/parser.js +1246 -0
- package/dist/domain/parser.js.map +1 -0
- package/dist/domain/queries.d.ts +22 -0
- package/dist/domain/queries.d.ts.map +1 -0
- package/dist/domain/queries.js +26 -0
- package/dist/domain/queries.js.map +1 -0
- package/dist/domain/search/generator.d.ts +16 -0
- package/dist/domain/search/generator.d.ts.map +1 -0
- package/dist/domain/search/generator.js +181 -0
- package/dist/domain/search/generator.js.map +1 -0
- package/dist/domain/search/index.d.ts +15 -0
- package/dist/domain/search/index.d.ts.map +1 -0
- package/dist/domain/search/index.js +13 -0
- package/dist/domain/search/index.js.map +1 -0
- package/dist/domain/search/models.d.ts +63 -0
- package/dist/domain/search/models.d.ts.map +1 -0
- package/dist/domain/search/models.js +303 -0
- package/dist/domain/search/models.js.map +1 -0
- package/dist/domain/search/search/cli-formatter.d.ts +10 -0
- package/dist/domain/search/search/cli-formatter.d.ts.map +1 -0
- package/dist/domain/search/search/cli-formatter.js +134 -0
- package/dist/domain/search/search/cli-formatter.js.map +1 -0
- package/dist/domain/search/search/filters.d.ts +9 -0
- package/dist/domain/search/search/filters.d.ts.map +1 -0
- package/dist/domain/search/search/filters.js +31 -0
- package/dist/domain/search/search/filters.js.map +1 -0
- package/dist/domain/search/search/hybrid.d.ts +21 -0
- package/dist/domain/search/search/hybrid.d.ts.map +1 -0
- package/dist/domain/search/search/hybrid.js +122 -0
- package/dist/domain/search/search/hybrid.js.map +1 -0
- package/dist/domain/search/search/keyword.d.ts +18 -0
- package/dist/domain/search/search/keyword.d.ts.map +1 -0
- package/dist/domain/search/search/keyword.js +58 -0
- package/dist/domain/search/search/keyword.js.map +1 -0
- package/dist/domain/search/search/prepare.d.ts +25 -0
- package/dist/domain/search/search/prepare.d.ts.map +1 -0
- package/dist/domain/search/search/prepare.js +63 -0
- package/dist/domain/search/search/prepare.js.map +1 -0
- package/dist/domain/search/search/semantic.d.ts +41 -0
- package/dist/domain/search/search/semantic.d.ts.map +1 -0
- package/dist/domain/search/search/semantic.js +135 -0
- package/dist/domain/search/search/semantic.js.map +1 -0
- package/dist/domain/search/stores/fts5.d.ts +10 -0
- package/dist/domain/search/stores/fts5.d.ts.map +1 -0
- package/dist/domain/search/stores/fts5.js +27 -0
- package/dist/domain/search/stores/fts5.js.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts +5 -0
- package/dist/domain/search/stores/sqlite-blob.d.ts.map +1 -0
- package/dist/domain/search/stores/sqlite-blob.js +16 -0
- package/dist/domain/search/stores/sqlite-blob.js.map +1 -0
- package/dist/domain/search/strategies/source.d.ts +6 -0
- package/dist/domain/search/strategies/source.d.ts.map +1 -0
- package/dist/domain/search/strategies/source.js +14 -0
- package/dist/domain/search/strategies/source.js.map +1 -0
- package/dist/domain/search/strategies/structured.d.ts +10 -0
- package/dist/domain/search/strategies/structured.d.ts.map +1 -0
- package/dist/domain/search/strategies/structured.js +35 -0
- package/dist/domain/search/strategies/structured.js.map +1 -0
- package/dist/domain/search/strategies/text-utils.d.ts +9 -0
- package/dist/domain/search/strategies/text-utils.d.ts.map +1 -0
- package/dist/domain/search/strategies/text-utils.js +45 -0
- package/dist/domain/search/strategies/text-utils.js.map +1 -0
- package/dist/domain/wasm-worker-entry.d.ts +24 -0
- package/dist/domain/wasm-worker-entry.d.ts.map +1 -0
- package/dist/domain/wasm-worker-entry.js +749 -0
- package/dist/domain/wasm-worker-entry.js.map +1 -0
- package/dist/domain/wasm-worker-pool.d.ts +59 -0
- package/dist/domain/wasm-worker-pool.d.ts.map +1 -0
- package/dist/domain/wasm-worker-pool.js +363 -0
- package/dist/domain/wasm-worker-pool.js.map +1 -0
- package/dist/domain/wasm-worker-protocol.d.ts +81 -0
- package/dist/domain/wasm-worker-protocol.d.ts.map +1 -0
- package/dist/domain/wasm-worker-protocol.js +13 -0
- package/dist/domain/wasm-worker-protocol.js.map +1 -0
- package/dist/extractors/bash.d.ts +6 -0
- package/dist/extractors/bash.d.ts.map +1 -0
- package/dist/extractors/bash.js +91 -0
- package/dist/extractors/bash.js.map +1 -0
- package/dist/extractors/c.d.ts +6 -0
- package/dist/extractors/c.d.ts.map +1 -0
- package/dist/extractors/c.js +223 -0
- package/dist/extractors/c.js.map +1 -0
- package/dist/extractors/clojure.d.ts +12 -0
- package/dist/extractors/clojure.d.ts.map +1 -0
- package/dist/extractors/clojure.js +245 -0
- package/dist/extractors/clojure.js.map +1 -0
- package/dist/extractors/cpp.d.ts +6 -0
- package/dist/extractors/cpp.d.ts.map +1 -0
- package/dist/extractors/cpp.js +365 -0
- package/dist/extractors/cpp.js.map +1 -0
- package/dist/extractors/csharp.d.ts +6 -0
- package/dist/extractors/csharp.d.ts.map +1 -0
- package/dist/extractors/csharp.js +430 -0
- package/dist/extractors/csharp.js.map +1 -0
- package/dist/extractors/cuda.d.ts +11 -0
- package/dist/extractors/cuda.d.ts.map +1 -0
- package/dist/extractors/cuda.js +419 -0
- package/dist/extractors/cuda.js.map +1 -0
- package/dist/extractors/dart.d.ts +6 -0
- package/dist/extractors/dart.d.ts.map +1 -0
- package/dist/extractors/dart.js +277 -0
- package/dist/extractors/dart.js.map +1 -0
- package/dist/extractors/elixir.d.ts +9 -0
- package/dist/extractors/elixir.d.ts.map +1 -0
- package/dist/extractors/elixir.js +327 -0
- package/dist/extractors/elixir.js.map +1 -0
- package/dist/extractors/erlang.d.ts +14 -0
- package/dist/extractors/erlang.d.ts.map +1 -0
- package/dist/extractors/erlang.js +275 -0
- package/dist/extractors/erlang.js.map +1 -0
- package/dist/extractors/fsharp.d.ts +20 -0
- package/dist/extractors/fsharp.d.ts.map +1 -0
- package/dist/extractors/fsharp.js +312 -0
- package/dist/extractors/fsharp.js.map +1 -0
- package/dist/extractors/gleam.d.ts +14 -0
- package/dist/extractors/gleam.d.ts.map +1 -0
- package/dist/extractors/gleam.js +225 -0
- package/dist/extractors/gleam.js.map +1 -0
- package/dist/extractors/go.d.ts +6 -0
- package/dist/extractors/go.d.ts.map +1 -0
- package/dist/extractors/go.js +460 -0
- package/dist/extractors/go.js.map +1 -0
- package/dist/extractors/groovy.d.ts +10 -0
- package/dist/extractors/groovy.d.ts.map +1 -0
- package/dist/extractors/groovy.js +403 -0
- package/dist/extractors/groovy.js.map +1 -0
- package/dist/extractors/haskell.d.ts +8 -0
- package/dist/extractors/haskell.d.ts.map +1 -0
- package/dist/extractors/haskell.js +261 -0
- package/dist/extractors/haskell.js.map +1 -0
- package/dist/extractors/hcl.d.ts +6 -0
- package/dist/extractors/hcl.d.ts.map +1 -0
- package/dist/extractors/hcl.js +114 -0
- package/dist/extractors/hcl.js.map +1 -0
- package/dist/extractors/helpers.d.ts +144 -0
- package/dist/extractors/helpers.d.ts.map +1 -0
- package/dist/extractors/helpers.js +360 -0
- package/dist/extractors/helpers.js.map +1 -0
- package/dist/extractors/index.d.ts +33 -0
- package/dist/extractors/index.d.ts.map +1 -0
- package/dist/extractors/index.js +33 -0
- package/dist/extractors/index.js.map +1 -0
- package/dist/extractors/java.d.ts +6 -0
- package/dist/extractors/java.d.ts.map +1 -0
- package/dist/extractors/java.js +390 -0
- package/dist/extractors/java.js.map +1 -0
- package/dist/extractors/javascript.d.ts +10 -0
- package/dist/extractors/javascript.d.ts.map +1 -0
- package/dist/extractors/javascript.js +3618 -0
- package/dist/extractors/javascript.js.map +1 -0
- package/dist/extractors/julia.d.ts +16 -0
- package/dist/extractors/julia.d.ts.map +1 -0
- package/dist/extractors/julia.js +411 -0
- package/dist/extractors/julia.js.map +1 -0
- package/dist/extractors/kotlin.d.ts +6 -0
- package/dist/extractors/kotlin.d.ts.map +1 -0
- package/dist/extractors/kotlin.js +340 -0
- package/dist/extractors/kotlin.js.map +1 -0
- package/dist/extractors/lua.d.ts +6 -0
- package/dist/extractors/lua.d.ts.map +1 -0
- package/dist/extractors/lua.js +162 -0
- package/dist/extractors/lua.js.map +1 -0
- package/dist/extractors/objc.d.ts +9 -0
- package/dist/extractors/objc.d.ts.map +1 -0
- package/dist/extractors/objc.js +543 -0
- package/dist/extractors/objc.js.map +1 -0
- package/dist/extractors/ocaml.d.ts +6 -0
- package/dist/extractors/ocaml.d.ts.map +1 -0
- package/dist/extractors/ocaml.js +310 -0
- package/dist/extractors/ocaml.js.map +1 -0
- package/dist/extractors/php.d.ts +6 -0
- package/dist/extractors/php.d.ts.map +1 -0
- package/dist/extractors/php.js +381 -0
- package/dist/extractors/php.js.map +1 -0
- package/dist/extractors/python.d.ts +6 -0
- package/dist/extractors/python.d.ts.map +1 -0
- package/dist/extractors/python.js +428 -0
- package/dist/extractors/python.js.map +1 -0
- package/dist/extractors/r.d.ts +13 -0
- package/dist/extractors/r.d.ts.map +1 -0
- package/dist/extractors/r.js +267 -0
- package/dist/extractors/r.js.map +1 -0
- package/dist/extractors/ruby.d.ts +6 -0
- package/dist/extractors/ruby.d.ts.map +1 -0
- package/dist/extractors/ruby.js +281 -0
- package/dist/extractors/ruby.js.map +1 -0
- package/dist/extractors/rust.d.ts +6 -0
- package/dist/extractors/rust.d.ts.map +1 -0
- package/dist/extractors/rust.js +354 -0
- package/dist/extractors/rust.js.map +1 -0
- package/dist/extractors/scala.d.ts +6 -0
- package/dist/extractors/scala.d.ts.map +1 -0
- package/dist/extractors/scala.js +315 -0
- package/dist/extractors/scala.js.map +1 -0
- package/dist/extractors/solidity.d.ts +9 -0
- package/dist/extractors/solidity.d.ts.map +1 -0
- package/dist/extractors/solidity.js +351 -0
- package/dist/extractors/solidity.js.map +1 -0
- package/dist/extractors/swift.d.ts +6 -0
- package/dist/extractors/swift.d.ts.map +1 -0
- package/dist/extractors/swift.js +326 -0
- package/dist/extractors/swift.js.map +1 -0
- package/dist/extractors/verilog.d.ts +9 -0
- package/dist/extractors/verilog.d.ts.map +1 -0
- package/dist/extractors/verilog.js +351 -0
- package/dist/extractors/verilog.js.map +1 -0
- package/dist/extractors/zig.d.ts +9 -0
- package/dist/extractors/zig.d.ts.map +1 -0
- package/dist/extractors/zig.js +274 -0
- package/dist/extractors/zig.js.map +1 -0
- package/dist/features/ast.d.ts +78 -0
- package/dist/features/ast.d.ts.map +1 -0
- package/dist/features/ast.js +228 -0
- package/dist/features/ast.js.map +1 -0
- package/dist/features/audit.d.ts +15 -0
- package/dist/features/audit.d.ts.map +1 -0
- package/dist/features/audit.js +275 -0
- package/dist/features/audit.js.map +1 -0
- package/dist/features/batch.d.ts +54 -0
- package/dist/features/batch.d.ts.map +1 -0
- package/dist/features/batch.js +97 -0
- package/dist/features/batch.js.map +1 -0
- package/dist/features/boundaries.d.ts +51 -0
- package/dist/features/boundaries.d.ts.map +1 -0
- package/dist/features/boundaries.js +248 -0
- package/dist/features/boundaries.js.map +1 -0
- package/dist/features/branch-compare.d.ts +71 -0
- package/dist/features/branch-compare.d.ts.map +1 -0
- package/dist/features/branch-compare.js +444 -0
- package/dist/features/branch-compare.js.map +1 -0
- package/dist/features/cfg.d.ts +79 -0
- package/dist/features/cfg.d.ts.map +1 -0
- package/dist/features/cfg.js +483 -0
- package/dist/features/cfg.js.map +1 -0
- package/dist/features/check.d.ts +84 -0
- package/dist/features/check.d.ts.map +1 -0
- package/dist/features/check.js +290 -0
- package/dist/features/check.js.map +1 -0
- package/dist/features/cochange.d.ts +68 -0
- package/dist/features/cochange.d.ts.map +1 -0
- package/dist/features/cochange.js +384 -0
- package/dist/features/cochange.js.map +1 -0
- package/dist/features/communities.d.ts +26 -0
- package/dist/features/communities.d.ts.map +1 -0
- package/dist/features/communities.js +149 -0
- package/dist/features/communities.js.map +1 -0
- package/dist/features/complexity-query.d.ts +37 -0
- package/dist/features/complexity-query.d.ts.map +1 -0
- package/dist/features/complexity-query.js +268 -0
- package/dist/features/complexity-query.js.map +1 -0
- package/dist/features/complexity.d.ts +52 -0
- package/dist/features/complexity.d.ts.map +1 -0
- package/dist/features/complexity.js +490 -0
- package/dist/features/complexity.js.map +1 -0
- package/dist/features/dataflow.d.ts +129 -0
- package/dist/features/dataflow.d.ts.map +1 -0
- package/dist/features/dataflow.js +1079 -0
- package/dist/features/dataflow.js.map +1 -0
- package/dist/features/export.d.ts +35 -0
- package/dist/features/export.d.ts.map +1 -0
- package/dist/features/export.js +340 -0
- package/dist/features/export.js.map +1 -0
- package/dist/features/flow.d.ts +21 -0
- package/dist/features/flow.d.ts.map +1 -0
- package/dist/features/flow.js +195 -0
- package/dist/features/flow.js.map +1 -0
- package/dist/features/graph-enrichment.d.ts +44 -0
- package/dist/features/graph-enrichment.d.ts.map +1 -0
- package/dist/features/graph-enrichment.js +312 -0
- package/dist/features/graph-enrichment.js.map +1 -0
- package/dist/features/manifesto.d.ts +23 -0
- package/dist/features/manifesto.d.ts.map +1 -0
- package/dist/features/manifesto.js +382 -0
- package/dist/features/manifesto.js.map +1 -0
- package/dist/features/owners.d.ts +60 -0
- package/dist/features/owners.d.ts.map +1 -0
- package/dist/features/owners.js +248 -0
- package/dist/features/owners.js.map +1 -0
- package/dist/features/sequence.d.ts +42 -0
- package/dist/features/sequence.d.ts.map +1 -0
- package/dist/features/sequence.js +271 -0
- package/dist/features/sequence.js.map +1 -0
- package/dist/features/shared/find-nodes.d.ts +7 -0
- package/dist/features/shared/find-nodes.d.ts.map +1 -0
- package/dist/features/shared/find-nodes.js +18 -0
- package/dist/features/shared/find-nodes.js.map +1 -0
- package/dist/features/snapshot.d.ts +25 -0
- package/dist/features/snapshot.d.ts.map +1 -0
- package/dist/features/snapshot.js +188 -0
- package/dist/features/snapshot.js.map +1 -0
- package/dist/features/structure-query.d.ts +76 -0
- package/dist/features/structure-query.d.ts.map +1 -0
- package/dist/features/structure-query.js +274 -0
- package/dist/features/structure-query.js.map +1 -0
- package/dist/features/structure.d.ts +39 -0
- package/dist/features/structure.d.ts.map +1 -0
- package/dist/features/structure.js +796 -0
- package/dist/features/structure.js.map +1 -0
- package/dist/features/triage.d.ts +47 -0
- package/dist/features/triage.d.ts.map +1 -0
- package/dist/features/triage.js +123 -0
- package/dist/features/triage.js.map +1 -0
- package/dist/graph/algorithms/bfs.d.ts +14 -0
- package/dist/graph/algorithms/bfs.d.ts.map +1 -0
- package/dist/graph/algorithms/bfs.js +72 -0
- package/dist/graph/algorithms/bfs.js.map +1 -0
- package/dist/graph/algorithms/centrality.d.ts +12 -0
- package/dist/graph/algorithms/centrality.d.ts.map +1 -0
- package/dist/graph/algorithms/centrality.js +42 -0
- package/dist/graph/algorithms/centrality.js.map +1 -0
- package/dist/graph/algorithms/index.d.ts +7 -0
- package/dist/graph/algorithms/index.d.ts.map +1 -0
- package/dist/graph/algorithms/index.js +7 -0
- package/dist/graph/algorithms/index.js.map +1 -0
- package/dist/graph/algorithms/leiden/adapter.d.ts +37 -0
- package/dist/graph/algorithms/leiden/adapter.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/adapter.js +173 -0
- package/dist/graph/algorithms/leiden/adapter.js.map +1 -0
- package/dist/graph/algorithms/leiden/cpm.d.ts +28 -0
- package/dist/graph/algorithms/leiden/cpm.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/cpm.js +48 -0
- package/dist/graph/algorithms/leiden/cpm.js.map +1 -0
- package/dist/graph/algorithms/leiden/index.d.ts +37 -0
- package/dist/graph/algorithms/leiden/index.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/index.js +157 -0
- package/dist/graph/algorithms/leiden/index.js.map +1 -0
- package/dist/graph/algorithms/leiden/modularity.d.ts +33 -0
- package/dist/graph/algorithms/leiden/modularity.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/modularity.js +80 -0
- package/dist/graph/algorithms/leiden/modularity.js.map +1 -0
- package/dist/graph/algorithms/leiden/optimiser.d.ts +62 -0
- package/dist/graph/algorithms/leiden/optimiser.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/optimiser.js +530 -0
- package/dist/graph/algorithms/leiden/optimiser.js.map +1 -0
- package/dist/graph/algorithms/leiden/partition.d.ts +44 -0
- package/dist/graph/algorithms/leiden/partition.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/partition.js +438 -0
- package/dist/graph/algorithms/leiden/partition.js.map +1 -0
- package/dist/graph/algorithms/leiden/rng.d.ts +9 -0
- package/dist/graph/algorithms/leiden/rng.d.ts.map +1 -0
- package/dist/graph/algorithms/leiden/rng.js +17 -0
- package/dist/graph/algorithms/leiden/rng.js.map +1 -0
- package/dist/graph/algorithms/louvain.d.ts +20 -0
- package/dist/graph/algorithms/louvain.d.ts.map +1 -0
- package/dist/graph/algorithms/louvain.js +52 -0
- package/dist/graph/algorithms/louvain.js.map +1 -0
- package/dist/graph/algorithms/shortest-path.d.ts +10 -0
- package/dist/graph/algorithms/shortest-path.d.ts.map +1 -0
- package/dist/graph/algorithms/shortest-path.js +55 -0
- package/dist/graph/algorithms/shortest-path.js.map +1 -0
- package/dist/graph/algorithms/tarjan.d.ts +9 -0
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -0
- package/dist/graph/algorithms/tarjan.js +52 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -0
- package/dist/graph/builders/dependency.d.ts +18 -0
- package/dist/graph/builders/dependency.d.ts.map +1 -0
- package/dist/graph/builders/dependency.js +101 -0
- package/dist/graph/builders/dependency.js.map +1 -0
- package/dist/graph/builders/index.d.ts +4 -0
- package/dist/graph/builders/index.d.ts.map +1 -0
- package/dist/graph/builders/index.js +4 -0
- package/dist/graph/builders/index.js.map +1 -0
- package/dist/graph/builders/structure.d.ts +10 -0
- package/dist/graph/builders/structure.d.ts.map +1 -0
- package/dist/graph/builders/structure.js +33 -0
- package/dist/graph/builders/structure.js.map +1 -0
- package/dist/graph/builders/temporal.d.ts +13 -0
- package/dist/graph/builders/temporal.d.ts.map +1 -0
- package/dist/graph/builders/temporal.js +29 -0
- package/dist/graph/builders/temporal.js.map +1 -0
- package/dist/graph/classifiers/index.d.ts +3 -0
- package/dist/graph/classifiers/index.d.ts.map +1 -0
- package/dist/graph/classifiers/index.js +3 -0
- package/dist/graph/classifiers/index.js.map +1 -0
- package/dist/graph/classifiers/risk.d.ts +39 -0
- package/dist/graph/classifiers/risk.d.ts.map +1 -0
- package/dist/graph/classifiers/risk.js +78 -0
- package/dist/graph/classifiers/risk.js.map +1 -0
- package/dist/graph/classifiers/roles.d.ts +48 -0
- package/dist/graph/classifiers/roles.d.ts.map +1 -0
- package/dist/graph/classifiers/roles.js +180 -0
- package/dist/graph/classifiers/roles.js.map +1 -0
- package/dist/graph/index.d.ts +5 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +6 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/model.d.ts +57 -0
- package/dist/graph/model.d.ts.map +1 -0
- package/dist/graph/model.js +205 -0
- package/dist/graph/model.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/config.d.ts +281 -0
- package/dist/infrastructure/config.d.ts.map +1 -0
- package/dist/infrastructure/config.js +857 -0
- package/dist/infrastructure/config.js.map +1 -0
- package/dist/infrastructure/logger.d.ts +7 -0
- package/dist/infrastructure/logger.d.ts.map +1 -0
- package/dist/infrastructure/logger.js +21 -0
- package/dist/infrastructure/logger.js.map +1 -0
- package/dist/infrastructure/native.d.ts +38 -0
- package/dist/infrastructure/native.d.ts.map +1 -0
- package/dist/infrastructure/native.js +182 -0
- package/dist/infrastructure/native.js.map +1 -0
- package/dist/infrastructure/registry.d.ts +81 -0
- package/dist/infrastructure/registry.d.ts.map +1 -0
- package/dist/infrastructure/registry.js +229 -0
- package/dist/infrastructure/registry.js.map +1 -0
- package/dist/infrastructure/result-formatter.d.ts +2 -0
- package/dist/infrastructure/result-formatter.d.ts.map +1 -0
- package/dist/infrastructure/result-formatter.js +3 -0
- package/dist/infrastructure/result-formatter.js.map +1 -0
- package/dist/infrastructure/suppress.d.ts +25 -0
- package/dist/infrastructure/suppress.d.ts.map +1 -0
- package/dist/infrastructure/suppress.js +43 -0
- package/dist/infrastructure/suppress.js.map +1 -0
- package/dist/infrastructure/test-filter.d.ts +5 -0
- package/dist/infrastructure/test-filter.d.ts.map +1 -0
- package/dist/infrastructure/test-filter.js +7 -0
- package/dist/infrastructure/test-filter.js.map +1 -0
- package/dist/infrastructure/update-check.d.ts +26 -0
- package/dist/infrastructure/update-check.d.ts.map +1 -0
- package/dist/infrastructure/update-check.js +164 -0
- package/dist/infrastructure/update-check.js.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/middleware.d.ts +26 -0
- package/dist/mcp/middleware.d.ts.map +1 -0
- package/dist/mcp/middleware.js +32 -0
- package/dist/mcp/middleware.js.map +1 -0
- package/dist/mcp/server.d.ts +14 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +193 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tool-registry.d.ts +21 -0
- package/dist/mcp/tool-registry.d.ts.map +1 -0
- package/dist/mcp/tool-registry.js +839 -0
- package/dist/mcp/tool-registry.js.map +1 -0
- package/dist/mcp/tools/ast-query.d.ts +14 -0
- package/dist/mcp/tools/ast-query.d.ts.map +1 -0
- package/dist/mcp/tools/ast-query.js +13 -0
- package/dist/mcp/tools/ast-query.js.map +1 -0
- package/dist/mcp/tools/audit.d.ts +15 -0
- package/dist/mcp/tools/audit.d.ts.map +1 -0
- package/dist/mcp/tools/audit.js +20 -0
- package/dist/mcp/tools/audit.js.map +1 -0
- package/dist/mcp/tools/batch-query.d.ts +13 -0
- package/dist/mcp/tools/batch-query.d.ts.map +1 -0
- package/dist/mcp/tools/batch-query.js +11 -0
- package/dist/mcp/tools/batch-query.js.map +1 -0
- package/dist/mcp/tools/branch-compare.d.ts +12 -0
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -0
- package/dist/mcp/tools/branch-compare.js +10 -0
- package/dist/mcp/tools/branch-compare.js.map +1 -0
- package/dist/mcp/tools/brief.d.ts +9 -0
- package/dist/mcp/tools/brief.d.ts.map +1 -0
- package/dist/mcp/tools/brief.js +8 -0
- package/dist/mcp/tools/brief.js.map +1 -0
- package/dist/mcp/tools/cfg.d.ts +14 -0
- package/dist/mcp/tools/cfg.d.ts.map +1 -0
- package/dist/mcp/tools/cfg.js +20 -0
- package/dist/mcp/tools/cfg.js.map +1 -0
- package/dist/mcp/tools/check.d.ts +20 -0
- package/dist/mcp/tools/check.d.ts.map +1 -0
- package/dist/mcp/tools/check.js +39 -0
- package/dist/mcp/tools/check.js.map +1 -0
- package/dist/mcp/tools/co-changes.d.ts +12 -0
- package/dist/mcp/tools/co-changes.d.ts.map +1 -0
- package/dist/mcp/tools/co-changes.js +19 -0
- package/dist/mcp/tools/co-changes.js.map +1 -0
- package/dist/mcp/tools/code-owners.d.ts +12 -0
- package/dist/mcp/tools/code-owners.d.ts.map +1 -0
- package/dist/mcp/tools/code-owners.js +12 -0
- package/dist/mcp/tools/code-owners.js.map +1 -0
- package/dist/mcp/tools/communities.d.ts +13 -0
- package/dist/mcp/tools/communities.d.ts.map +1 -0
- package/dist/mcp/tools/communities.js +14 -0
- package/dist/mcp/tools/communities.js.map +1 -0
- package/dist/mcp/tools/complexity.d.ts +16 -0
- package/dist/mcp/tools/complexity.d.ts.map +1 -0
- package/dist/mcp/tools/complexity.js +16 -0
- package/dist/mcp/tools/complexity.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +16 -0
- package/dist/mcp/tools/context.d.ts.map +1 -0
- package/dist/mcp/tools/context.js +16 -0
- package/dist/mcp/tools/context.js.map +1 -0
- package/dist/mcp/tools/dataflow.d.ts +15 -0
- package/dist/mcp/tools/dataflow.d.ts.map +1 -0
- package/dist/mcp/tools/dataflow.js +25 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/diff-impact.d.ts +14 -0
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -0
- package/dist/mcp/tools/diff-impact.js +23 -0
- package/dist/mcp/tools/diff-impact.js.map +1 -0
- package/dist/mcp/tools/execution-flow.d.ts +15 -0
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -0
- package/dist/mcp/tools/execution-flow.js +25 -0
- package/dist/mcp/tools/execution-flow.js.map +1 -0
- package/dist/mcp/tools/export-graph.d.ts +11 -0
- package/dist/mcp/tools/export-graph.d.ts.map +1 -0
- package/dist/mcp/tools/export-graph.js +57 -0
- package/dist/mcp/tools/export-graph.js.map +1 -0
- package/dist/mcp/tools/file-deps.d.ts +11 -0
- package/dist/mcp/tools/file-deps.d.ts.map +1 -0
- package/dist/mcp/tools/file-deps.js +11 -0
- package/dist/mcp/tools/file-deps.js.map +1 -0
- package/dist/mcp/tools/file-exports.d.ts +12 -0
- package/dist/mcp/tools/file-exports.d.ts.map +1 -0
- package/dist/mcp/tools/file-exports.js +12 -0
- package/dist/mcp/tools/file-exports.js.map +1 -0
- package/dist/mcp/tools/find-cycles.d.ts +7 -0
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -0
- package/dist/mcp/tools/find-cycles.js +15 -0
- package/dist/mcp/tools/find-cycles.js.map +1 -0
- package/dist/mcp/tools/fn-impact.d.ts +14 -0
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -0
- package/dist/mcp/tools/fn-impact.js +14 -0
- package/dist/mcp/tools/fn-impact.js.map +1 -0
- package/dist/mcp/tools/impact-analysis.d.ts +9 -0
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -0
- package/dist/mcp/tools/impact-analysis.js +8 -0
- package/dist/mcp/tools/impact-analysis.js.map +1 -0
- package/dist/mcp/tools/implementations.d.ts +13 -0
- package/dist/mcp/tools/implementations.d.ts.map +1 -0
- package/dist/mcp/tools/implementations.js +13 -0
- package/dist/mcp/tools/implementations.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +7 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +76 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/interfaces.d.ts +13 -0
- package/dist/mcp/tools/interfaces.d.ts.map +1 -0
- package/dist/mcp/tools/interfaces.js +13 -0
- package/dist/mcp/tools/interfaces.js.map +1 -0
- package/dist/mcp/tools/list-functions.d.ts +12 -0
- package/dist/mcp/tools/list-functions.d.ts.map +1 -0
- package/dist/mcp/tools/list-functions.js +13 -0
- package/dist/mcp/tools/list-functions.js.map +1 -0
- package/dist/mcp/tools/list-repos.d.ts +8 -0
- package/dist/mcp/tools/list-repos.d.ts.map +1 -0
- package/dist/mcp/tools/list-repos.js +11 -0
- package/dist/mcp/tools/list-repos.js.map +1 -0
- package/dist/mcp/tools/module-map.d.ts +9 -0
- package/dist/mcp/tools/module-map.d.ts.map +1 -0
- package/dist/mcp/tools/module-map.js +6 -0
- package/dist/mcp/tools/module-map.js.map +1 -0
- package/dist/mcp/tools/node-roles.d.ts +12 -0
- package/dist/mcp/tools/node-roles.d.ts.map +1 -0
- package/dist/mcp/tools/node-roles.js +13 -0
- package/dist/mcp/tools/node-roles.js.map +1 -0
- package/dist/mcp/tools/path.d.ts +15 -0
- package/dist/mcp/tools/path.d.ts.map +1 -0
- package/dist/mcp/tools/path.js +21 -0
- package/dist/mcp/tools/path.js.map +1 -0
- package/dist/mcp/tools/query.d.ts +20 -0
- package/dist/mcp/tools/query.d.ts.map +1 -0
- package/dist/mcp/tools/query.js +29 -0
- package/dist/mcp/tools/query.js.map +1 -0
- package/dist/mcp/tools/semantic-search.d.ts +13 -0
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -0
- package/dist/mcp/tools/semantic-search.js +62 -0
- package/dist/mcp/tools/semantic-search.js.map +1 -0
- package/dist/mcp/tools/sequence.d.ts +16 -0
- package/dist/mcp/tools/sequence.d.ts.map +1 -0
- package/dist/mcp/tools/sequence.js +16 -0
- package/dist/mcp/tools/sequence.js.map +1 -0
- package/dist/mcp/tools/structure.d.ts +13 -0
- package/dist/mcp/tools/structure.d.ts.map +1 -0
- package/dist/mcp/tools/structure.js +14 -0
- package/dist/mcp/tools/structure.js.map +1 -0
- package/dist/mcp/tools/symbol-children.d.ts +13 -0
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -0
- package/dist/mcp/tools/symbol-children.js +13 -0
- package/dist/mcp/tools/symbol-children.js.map +1 -0
- package/dist/mcp/tools/triage.d.ts +17 -0
- package/dist/mcp/tools/triage.d.ts.map +1 -0
- package/dist/mcp/tools/triage.js +34 -0
- package/dist/mcp/tools/triage.js.map +1 -0
- package/dist/mcp/tools/where.d.ts +12 -0
- package/dist/mcp/tools/where.d.ts.map +1 -0
- package/dist/mcp/tools/where.js +12 -0
- package/dist/mcp/tools/where.js.map +1 -0
- package/dist/mcp/types.d.ts +19 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +6 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/presentation/audit.d.ts +15 -0
- package/dist/presentation/audit.d.ts.map +1 -0
- package/dist/presentation/audit.js +78 -0
- package/dist/presentation/audit.js.map +1 -0
- package/dist/presentation/batch.d.ts +20 -0
- package/dist/presentation/batch.d.ts.map +1 -0
- package/dist/presentation/batch.js +21 -0
- package/dist/presentation/batch.js.map +1 -0
- package/dist/presentation/branch-compare.d.ts +13 -0
- package/dist/presentation/branch-compare.d.ts.map +1 -0
- package/dist/presentation/branch-compare.js +91 -0
- package/dist/presentation/branch-compare.js.map +1 -0
- package/dist/presentation/brief.d.ts +9 -0
- package/dist/presentation/brief.d.ts.map +1 -0
- package/dist/presentation/brief.js +39 -0
- package/dist/presentation/brief.js.map +1 -0
- package/dist/presentation/cfg.d.ts +13 -0
- package/dist/presentation/cfg.d.ts.map +1 -0
- package/dist/presentation/cfg.js +62 -0
- package/dist/presentation/cfg.js.map +1 -0
- package/dist/presentation/check.d.ts +19 -0
- package/dist/presentation/check.d.ts.map +1 -0
- package/dist/presentation/check.js +74 -0
- package/dist/presentation/check.js.map +1 -0
- package/dist/presentation/cochange.d.ts +32 -0
- package/dist/presentation/cochange.d.ts.map +1 -0
- package/dist/presentation/cochange.js +33 -0
- package/dist/presentation/cochange.js.map +1 -0
- package/dist/presentation/colors.d.ts +12 -0
- package/dist/presentation/colors.d.ts.map +1 -0
- package/dist/presentation/colors.js +47 -0
- package/dist/presentation/colors.js.map +1 -0
- package/dist/presentation/communities.d.ts +11 -0
- package/dist/presentation/communities.d.ts.map +1 -0
- package/dist/presentation/communities.js +57 -0
- package/dist/presentation/communities.js.map +1 -0
- package/dist/presentation/complexity.d.ts +17 -0
- package/dist/presentation/complexity.d.ts.map +1 -0
- package/dist/presentation/complexity.js +59 -0
- package/dist/presentation/complexity.js.map +1 -0
- package/dist/presentation/dataflow.d.ts +14 -0
- package/dist/presentation/dataflow.d.ts.map +1 -0
- package/dist/presentation/dataflow.js +100 -0
- package/dist/presentation/dataflow.js.map +1 -0
- package/dist/presentation/diff-impact-mermaid.d.ts +11 -0
- package/dist/presentation/diff-impact-mermaid.d.ts.map +1 -0
- package/dist/presentation/diff-impact-mermaid.js +114 -0
- package/dist/presentation/diff-impact-mermaid.js.map +1 -0
- package/dist/presentation/export.d.ts +130 -0
- package/dist/presentation/export.d.ts.map +1 -0
- package/dist/presentation/export.js +311 -0
- package/dist/presentation/export.js.map +1 -0
- package/dist/presentation/flow.d.ts +16 -0
- package/dist/presentation/flow.d.ts.map +1 -0
- package/dist/presentation/flow.js +85 -0
- package/dist/presentation/flow.js.map +1 -0
- package/dist/presentation/manifesto.d.ts +13 -0
- package/dist/presentation/manifesto.d.ts.map +1 -0
- package/dist/presentation/manifesto.js +51 -0
- package/dist/presentation/manifesto.js.map +1 -0
- package/dist/presentation/owners.d.ts +16 -0
- package/dist/presentation/owners.d.ts.map +1 -0
- package/dist/presentation/owners.js +42 -0
- package/dist/presentation/owners.js.map +1 -0
- package/dist/presentation/queries-cli/exports.d.ts +12 -0
- package/dist/presentation/queries-cli/exports.d.ts.map +1 -0
- package/dist/presentation/queries-cli/exports.js +100 -0
- package/dist/presentation/queries-cli/exports.js.map +1 -0
- package/dist/presentation/queries-cli/impact.d.ts +23 -0
- package/dist/presentation/queries-cli/impact.d.ts.map +1 -0
- package/dist/presentation/queries-cli/impact.js +208 -0
- package/dist/presentation/queries-cli/impact.js.map +1 -0
- package/dist/presentation/queries-cli/index.d.ts +6 -0
- package/dist/presentation/queries-cli/index.d.ts.map +1 -0
- package/dist/presentation/queries-cli/index.js +6 -0
- package/dist/presentation/queries-cli/index.js.map +1 -0
- package/dist/presentation/queries-cli/inspect.d.ts +23 -0
- package/dist/presentation/queries-cli/inspect.d.ts.map +1 -0
- package/dist/presentation/queries-cli/inspect.js +376 -0
- package/dist/presentation/queries-cli/inspect.js.map +1 -0
- package/dist/presentation/queries-cli/overview.d.ts +19 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -0
- package/dist/presentation/queries-cli/overview.js +196 -0
- package/dist/presentation/queries-cli/overview.js.map +1 -0
- package/dist/presentation/queries-cli/path.d.ts +15 -0
- package/dist/presentation/queries-cli/path.d.ts.map +1 -0
- package/dist/presentation/queries-cli/path.js +101 -0
- package/dist/presentation/queries-cli/path.js.map +1 -0
- package/dist/presentation/queries-cli.d.ts +12 -0
- package/dist/presentation/queries-cli.d.ts.map +1 -0
- package/dist/presentation/queries-cli.js +12 -0
- package/dist/presentation/queries-cli.js.map +1 -0
- package/dist/presentation/query.d.ts +2 -0
- package/dist/presentation/query.d.ts.map +1 -0
- package/dist/presentation/query.js +2 -0
- package/dist/presentation/query.js.map +1 -0
- package/dist/presentation/result-formatter.d.ts +23 -0
- package/dist/presentation/result-formatter.d.ts.map +1 -0
- package/dist/presentation/result-formatter.js +122 -0
- package/dist/presentation/result-formatter.js.map +1 -0
- package/dist/presentation/sequence-renderer.d.ts +19 -0
- package/dist/presentation/sequence-renderer.d.ts.map +1 -0
- package/dist/presentation/sequence-renderer.js +23 -0
- package/dist/presentation/sequence-renderer.js.map +1 -0
- package/dist/presentation/sequence.d.ts +15 -0
- package/dist/presentation/sequence.d.ts.map +1 -0
- package/dist/presentation/sequence.js +26 -0
- package/dist/presentation/sequence.js.map +1 -0
- package/dist/presentation/structure.d.ts +46 -0
- package/dist/presentation/structure.d.ts.map +1 -0
- package/dist/presentation/structure.js +50 -0
- package/dist/presentation/structure.js.map +1 -0
- package/dist/presentation/table.d.ts +24 -0
- package/dist/presentation/table.d.ts.map +1 -0
- package/dist/presentation/table.js +33 -0
- package/dist/presentation/table.js.map +1 -0
- package/dist/presentation/triage.d.ts +19 -0
- package/dist/presentation/triage.d.ts.map +1 -0
- package/dist/presentation/triage.js +34 -0
- package/dist/presentation/triage.js.map +1 -0
- package/dist/presentation/viewer.d.ts +102 -0
- package/dist/presentation/viewer.d.ts.map +1 -0
- package/dist/presentation/viewer.js +618 -0
- package/dist/presentation/viewer.js.map +1 -0
- package/dist/shared/constants.d.ts +33 -0
- package/dist/shared/constants.d.ts.map +1 -0
- package/dist/shared/constants.js +54 -0
- package/dist/shared/constants.js.map +1 -0
- package/dist/shared/errors.d.ts +46 -0
- package/dist/shared/errors.d.ts.map +1 -0
- package/dist/shared/errors.js +69 -0
- package/dist/shared/errors.js.map +1 -0
- package/dist/shared/file-utils.d.ts +27 -0
- package/dist/shared/file-utils.d.ts.map +1 -0
- package/dist/shared/file-utils.js +186 -0
- package/dist/shared/file-utils.js.map +1 -0
- package/dist/shared/generators.d.ts +57 -0
- package/dist/shared/generators.d.ts.map +1 -0
- package/dist/shared/generators.js +106 -0
- package/dist/shared/generators.js.map +1 -0
- package/dist/shared/globs.d.ts +40 -0
- package/dist/shared/globs.d.ts.map +1 -0
- package/dist/shared/globs.js +126 -0
- package/dist/shared/globs.js.map +1 -0
- package/dist/shared/hierarchy.d.ts +9 -0
- package/dist/shared/hierarchy.d.ts.map +1 -0
- package/dist/shared/hierarchy.js +68 -0
- package/dist/shared/hierarchy.js.map +1 -0
- package/dist/shared/kinds.d.ts +12 -0
- package/dist/shared/kinds.d.ts.map +1 -0
- package/dist/shared/kinds.js +67 -0
- package/dist/shared/kinds.js.map +1 -0
- package/dist/shared/normalize.d.ts +49 -0
- package/dist/shared/normalize.d.ts.map +1 -0
- package/dist/shared/normalize.js +57 -0
- package/dist/shared/normalize.js.map +1 -0
- package/dist/shared/paginate.d.ts +32 -0
- package/dist/shared/paginate.d.ts.map +1 -0
- package/dist/shared/paginate.js +82 -0
- package/dist/shared/paginate.js.map +1 -0
- package/dist/shared/version.d.ts +2 -0
- package/dist/shared/version.d.ts.map +1 -0
- package/dist/shared/version.js +5 -0
- package/dist/shared/version.js.map +1 -0
- package/dist/types.d.ts +2468 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +10 -0
- package/dist/types.js.map +1 -0
- package/grammars/tree-sitter-bash.wasm +0 -0
- package/grammars/tree-sitter-c.wasm +0 -0
- package/grammars/tree-sitter-c_sharp.wasm +0 -0
- package/grammars/tree-sitter-clojure.wasm +0 -0
- package/grammars/tree-sitter-cpp.wasm +0 -0
- package/grammars/tree-sitter-cuda.wasm +0 -0
- package/grammars/tree-sitter-dart.wasm +0 -0
- package/grammars/tree-sitter-elixir.wasm +0 -0
- package/grammars/tree-sitter-erlang.wasm +0 -0
- package/grammars/tree-sitter-fsharp.wasm +0 -0
- package/grammars/tree-sitter-fsharp_signature.wasm +0 -0
- package/grammars/tree-sitter-gleam.wasm +0 -0
- package/grammars/tree-sitter-go.wasm +0 -0
- package/grammars/tree-sitter-groovy.wasm +0 -0
- package/grammars/tree-sitter-haskell.wasm +0 -0
- package/grammars/tree-sitter-hcl.wasm +0 -0
- package/grammars/tree-sitter-java.wasm +0 -0
- package/grammars/tree-sitter-javascript.wasm +0 -0
- package/grammars/tree-sitter-julia.wasm +0 -0
- package/grammars/tree-sitter-kotlin.wasm +0 -0
- package/grammars/tree-sitter-lua.wasm +0 -0
- package/grammars/tree-sitter-objc.wasm +0 -0
- package/grammars/tree-sitter-ocaml.wasm +0 -0
- package/grammars/tree-sitter-ocaml_interface.wasm +0 -0
- package/grammars/tree-sitter-php.wasm +0 -0
- package/grammars/tree-sitter-python.wasm +0 -0
- package/grammars/tree-sitter-r.wasm +0 -0
- package/grammars/tree-sitter-ruby.wasm +0 -0
- package/grammars/tree-sitter-rust.wasm +0 -0
- package/grammars/tree-sitter-scala.wasm +0 -0
- package/grammars/tree-sitter-solidity.wasm +0 -0
- package/grammars/tree-sitter-swift.wasm +0 -0
- package/grammars/tree-sitter-tsx.wasm +0 -0
- package/grammars/tree-sitter-typescript.wasm +0 -0
- package/grammars/tree-sitter-verilog.wasm +0 -0
- package/grammars/tree-sitter-zig.wasm +0 -0
- package/package.json +188 -0
- package/src/ast-analysis/engine.ts +926 -0
- package/src/ast-analysis/metrics.ts +150 -0
- package/src/ast-analysis/rules/b2.ts +263 -0
- package/src/ast-analysis/rules/b3.ts +127 -0
- package/src/ast-analysis/rules/b4.ts +378 -0
- package/src/ast-analysis/rules/b5.ts +65 -0
- package/src/ast-analysis/rules/c.ts +157 -0
- package/src/ast-analysis/rules/csharp.ts +210 -0
- package/src/ast-analysis/rules/go.ts +187 -0
- package/src/ast-analysis/rules/index.ts +380 -0
- package/src/ast-analysis/rules/java.ts +181 -0
- package/src/ast-analysis/rules/javascript.ts +249 -0
- package/src/ast-analysis/rules/php.ts +226 -0
- package/src/ast-analysis/rules/python.ts +202 -0
- package/src/ast-analysis/rules/ruby.ts +209 -0
- package/src/ast-analysis/rules/rust.ts +179 -0
- package/src/ast-analysis/shared.ts +223 -0
- package/src/ast-analysis/visitor-utils.ts +278 -0
- package/src/ast-analysis/visitor.ts +266 -0
- package/src/ast-analysis/visitors/ast-store-visitor.ts +334 -0
- package/src/ast-analysis/visitors/cfg-conditionals.ts +227 -0
- package/src/ast-analysis/visitors/cfg-loops.ts +136 -0
- package/src/ast-analysis/visitors/cfg-shared.ts +196 -0
- package/src/ast-analysis/visitors/cfg-try-catch.ts +142 -0
- package/src/ast-analysis/visitors/cfg-visitor.ts +367 -0
- package/src/ast-analysis/visitors/complexity-visitor.ts +328 -0
- package/src/ast-analysis/visitors/dataflow-visitor.ts +571 -0
- package/src/cli/commands/ast.ts +24 -0
- package/src/cli/commands/audit.ts +48 -0
- package/src/cli/commands/batch.ts +66 -0
- package/src/cli/commands/branch-compare.ts +27 -0
- package/src/cli/commands/brief.ts +13 -0
- package/src/cli/commands/build.ts +35 -0
- package/src/cli/commands/cfg.ts +28 -0
- package/src/cli/commands/check.ts +72 -0
- package/src/cli/commands/children.ts +34 -0
- package/src/cli/commands/co-change.ts +72 -0
- package/src/cli/commands/communities.ts +21 -0
- package/src/cli/commands/complexity.ts +48 -0
- package/src/cli/commands/config.ts +353 -0
- package/src/cli/commands/context.ts +36 -0
- package/src/cli/commands/cycles.ts +33 -0
- package/src/cli/commands/dataflow.ts +30 -0
- package/src/cli/commands/deps.ts +18 -0
- package/src/cli/commands/diff-impact.ts +30 -0
- package/src/cli/commands/embed.ts +82 -0
- package/src/cli/commands/export.ts +79 -0
- package/src/cli/commands/exports.ts +15 -0
- package/src/cli/commands/flow.ts +34 -0
- package/src/cli/commands/fn-impact.ts +34 -0
- package/src/cli/commands/impact.ts +13 -0
- package/src/cli/commands/implementations.ts +30 -0
- package/src/cli/commands/info.ts +79 -0
- package/src/cli/commands/interfaces.ts +30 -0
- package/src/cli/commands/map.ts +20 -0
- package/src/cli/commands/mcp.ts +19 -0
- package/src/cli/commands/models.ts +29 -0
- package/src/cli/commands/owners.ts +28 -0
- package/src/cli/commands/path.ts +42 -0
- package/src/cli/commands/plot.ts +110 -0
- package/src/cli/commands/query.ts +51 -0
- package/src/cli/commands/registry.ts +106 -0
- package/src/cli/commands/roles.ts +38 -0
- package/src/cli/commands/search.ts +45 -0
- package/src/cli/commands/sequence.ts +30 -0
- package/src/cli/commands/snapshot.ts +67 -0
- package/src/cli/commands/stats.ts +16 -0
- package/src/cli/commands/structure.ts +55 -0
- package/src/cli/commands/triage.ts +93 -0
- package/src/cli/commands/watch.ts +29 -0
- package/src/cli/commands/where.ts +21 -0
- package/src/cli/index.ts +159 -0
- package/src/cli/shared/open-graph.ts +13 -0
- package/src/cli/shared/options.ts +69 -0
- package/src/cli/shared/output.ts +1 -0
- package/src/cli/types.ts +35 -0
- package/src/cli.ts +37 -0
- package/src/db/better-sqlite3.ts +21 -0
- package/src/db/connection.ts +478 -0
- package/src/db/index.ts +84 -0
- package/src/db/migrations.ts +440 -0
- package/src/db/query-builder.ts +371 -0
- package/src/db/repository/base.ts +269 -0
- package/src/db/repository/build-stmts.ts +126 -0
- package/src/db/repository/cached-stmt.ts +20 -0
- package/src/db/repository/cfg.ts +81 -0
- package/src/db/repository/cochange.ts +48 -0
- package/src/db/repository/complexity.ts +21 -0
- package/src/db/repository/dataflow.ts +35 -0
- package/src/db/repository/edges.ts +281 -0
- package/src/db/repository/embeddings.ts +47 -0
- package/src/db/repository/graph-read.ts +62 -0
- package/src/db/repository/in-memory-repository.ts +657 -0
- package/src/db/repository/index.ts +53 -0
- package/src/db/repository/native-repository.ts +546 -0
- package/src/db/repository/nodes.ts +322 -0
- package/src/db/repository/sqlite-repository.ts +303 -0
- package/src/domain/analysis/brief.ts +165 -0
- package/src/domain/analysis/context.ts +537 -0
- package/src/domain/analysis/dependencies.ts +738 -0
- package/src/domain/analysis/diff-impact.ts +381 -0
- package/src/domain/analysis/exports.ts +262 -0
- package/src/domain/analysis/fn-impact.ts +311 -0
- package/src/domain/analysis/impact.ts +11 -0
- package/src/domain/analysis/implementations.ts +81 -0
- package/src/domain/analysis/module-map.ts +576 -0
- package/src/domain/analysis/query-helpers.ts +52 -0
- package/src/domain/analysis/roles.ts +95 -0
- package/src/domain/analysis/symbol-lookup.ts +284 -0
- package/src/domain/graph/builder/call-resolver.ts +289 -0
- package/src/domain/graph/builder/cha.ts +192 -0
- package/src/domain/graph/builder/context.ts +120 -0
- package/src/domain/graph/builder/helpers.ts +665 -0
- package/src/domain/graph/builder/incremental.ts +987 -0
- package/src/domain/graph/builder/native-db-proxy.ts +104 -0
- package/src/domain/graph/builder/pipeline.ts +517 -0
- package/src/domain/graph/builder/stages/build-edges.ts +1986 -0
- package/src/domain/graph/builder/stages/build-structure.ts +330 -0
- package/src/domain/graph/builder/stages/collect-files.ts +175 -0
- package/src/domain/graph/builder/stages/detect-changes.ts +751 -0
- package/src/domain/graph/builder/stages/finalize.ts +321 -0
- package/src/domain/graph/builder/stages/insert-nodes.ts +489 -0
- package/src/domain/graph/builder/stages/native-db-lifecycle.ts +74 -0
- package/src/domain/graph/builder/stages/native-orchestrator.ts +2241 -0
- package/src/domain/graph/builder/stages/parse-files.ts +26 -0
- package/src/domain/graph/builder/stages/resolve-imports.ts +285 -0
- package/src/domain/graph/builder/stages/run-analyses.ts +26 -0
- package/src/domain/graph/builder.ts +11 -0
- package/src/domain/graph/change-journal.ts +141 -0
- package/src/domain/graph/cycles.ts +155 -0
- package/src/domain/graph/journal.ts +377 -0
- package/src/domain/graph/resolve.ts +579 -0
- package/src/domain/graph/resolver/points-to.ts +377 -0
- package/src/domain/graph/resolver/strategy.ts +265 -0
- package/src/domain/graph/resolver/ts-resolver.ts +536 -0
- package/src/domain/graph/watcher.ts +339 -0
- package/src/domain/parser.ts +1437 -0
- package/src/domain/queries.ts +50 -0
- package/src/domain/search/generator.ts +260 -0
- package/src/domain/search/index.ts +15 -0
- package/src/domain/search/models.ts +356 -0
- package/src/domain/search/search/cli-formatter.ts +179 -0
- package/src/domain/search/search/filters.ts +38 -0
- package/src/domain/search/search/hybrid.ts +197 -0
- package/src/domain/search/search/keyword.ts +101 -0
- package/src/domain/search/search/prepare.ts +95 -0
- package/src/domain/search/search/semantic.ts +226 -0
- package/src/domain/search/stores/fts5.ts +27 -0
- package/src/domain/search/stores/sqlite-blob.ts +15 -0
- package/src/domain/search/strategies/source.ts +19 -0
- package/src/domain/search/strategies/structured.ts +48 -0
- package/src/domain/search/strategies/text-utils.ts +41 -0
- package/src/domain/wasm-worker-entry.ts +921 -0
- package/src/domain/wasm-worker-pool.ts +375 -0
- package/src/domain/wasm-worker-protocol.ts +98 -0
- package/src/extractors/bash.ts +97 -0
- package/src/extractors/c.ts +231 -0
- package/src/extractors/clojure.ts +273 -0
- package/src/extractors/cpp.ts +383 -0
- package/src/extractors/csharp.ts +448 -0
- package/src/extractors/cuda.ts +433 -0
- package/src/extractors/dart.ts +304 -0
- package/src/extractors/elixir.ts +350 -0
- package/src/extractors/erlang.ts +295 -0
- package/src/extractors/fsharp.ts +357 -0
- package/src/extractors/gleam.ts +247 -0
- package/src/extractors/go.ts +512 -0
- package/src/extractors/groovy.ts +436 -0
- package/src/extractors/haskell.ts +276 -0
- package/src/extractors/hcl.ts +136 -0
- package/src/extractors/helpers.ts +449 -0
- package/src/extractors/index.ts +32 -0
- package/src/extractors/java.ts +439 -0
- package/src/extractors/javascript.ts +3844 -0
- package/src/extractors/julia.ts +432 -0
- package/src/extractors/kotlin.ts +358 -0
- package/src/extractors/lua.ts +169 -0
- package/src/extractors/objc.ts +555 -0
- package/src/extractors/ocaml.ts +337 -0
- package/src/extractors/php.ts +399 -0
- package/src/extractors/python.ts +439 -0
- package/src/extractors/r.ts +275 -0
- package/src/extractors/ruby.ts +292 -0
- package/src/extractors/rust.ts +371 -0
- package/src/extractors/scala.ts +335 -0
- package/src/extractors/solidity.ts +375 -0
- package/src/extractors/swift.ts +337 -0
- package/src/extractors/verilog.ts +383 -0
- package/src/extractors/zig.ts +291 -0
- package/src/features/ast.ts +405 -0
- package/src/features/audit.ts +446 -0
- package/src/features/batch.ts +182 -0
- package/src/features/boundaries.ts +345 -0
- package/src/features/branch-compare.ts +618 -0
- package/src/features/cfg.ts +750 -0
- package/src/features/check.ts +454 -0
- package/src/features/cochange.ts +506 -0
- package/src/features/communities.ts +232 -0
- package/src/features/complexity-query.ts +388 -0
- package/src/features/complexity.ts +753 -0
- package/src/features/dataflow.ts +1654 -0
- package/src/features/export.ts +486 -0
- package/src/features/flow.ts +307 -0
- package/src/features/graph-enrichment.ts +493 -0
- package/src/features/manifesto.ts +508 -0
- package/src/features/owners.ts +360 -0
- package/src/features/sequence.ts +410 -0
- package/src/features/shared/find-nodes.ts +28 -0
- package/src/features/snapshot.ts +221 -0
- package/src/features/structure-query.ts +456 -0
- package/src/features/structure.ts +1100 -0
- package/src/features/triage.ts +199 -0
- package/src/graph/algorithms/bfs.ts +92 -0
- package/src/graph/algorithms/centrality.ts +50 -0
- package/src/graph/algorithms/index.ts +6 -0
- package/src/graph/algorithms/leiden/LICENSE +24 -0
- package/src/graph/algorithms/leiden/adapter.ts +252 -0
- package/src/graph/algorithms/leiden/cpm.ts +77 -0
- package/src/graph/algorithms/leiden/index.ts +224 -0
- package/src/graph/algorithms/leiden/modularity.ts +122 -0
- package/src/graph/algorithms/leiden/optimiser.ts +706 -0
- package/src/graph/algorithms/leiden/partition.ts +577 -0
- package/src/graph/algorithms/leiden/rng.ts +20 -0
- package/src/graph/algorithms/louvain.ts +75 -0
- package/src/graph/algorithms/shortest-path.ts +59 -0
- package/src/graph/algorithms/tarjan.ts +55 -0
- package/src/graph/builders/dependency.ts +148 -0
- package/src/graph/builders/index.ts +3 -0
- package/src/graph/builders/structure.ts +58 -0
- package/src/graph/builders/temporal.ts +51 -0
- package/src/graph/classifiers/index.ts +2 -0
- package/src/graph/classifiers/risk.ts +123 -0
- package/src/graph/classifiers/roles.ts +226 -0
- package/src/graph/index.ts +13 -0
- package/src/graph/model.ts +238 -0
- package/src/index.cjs +16 -0
- package/src/index.ts +72 -0
- package/src/infrastructure/config.ts +954 -0
- package/src/infrastructure/logger.ts +24 -0
- package/src/infrastructure/native.ts +199 -0
- package/src/infrastructure/registry.ts +313 -0
- package/src/infrastructure/result-formatter.ts +2 -0
- package/src/infrastructure/suppress.ts +47 -0
- package/src/infrastructure/test-filter.ts +7 -0
- package/src/infrastructure/update-check.ts +196 -0
- package/src/mcp/index.ts +2 -0
- package/src/mcp/middleware.ts +38 -0
- package/src/mcp/server.ts +259 -0
- package/src/mcp/tool-registry.ts +890 -0
- package/src/mcp/tools/ast-query.ts +25 -0
- package/src/mcp/tools/audit.ts +33 -0
- package/src/mcp/tools/batch-query.ts +22 -0
- package/src/mcp/tools/branch-compare.ts +22 -0
- package/src/mcp/tools/brief.ts +15 -0
- package/src/mcp/tools/cfg.ts +32 -0
- package/src/mcp/tools/check.ts +60 -0
- package/src/mcp/tools/co-changes.ts +29 -0
- package/src/mcp/tools/code-owners.ts +22 -0
- package/src/mcp/tools/communities.ts +25 -0
- package/src/mcp/tools/complexity.ts +30 -0
- package/src/mcp/tools/context.ts +30 -0
- package/src/mcp/tools/dataflow.ts +38 -0
- package/src/mcp/tools/diff-impact.ts +35 -0
- package/src/mcp/tools/execution-flow.ts +38 -0
- package/src/mcp/tools/export-graph.ts +67 -0
- package/src/mcp/tools/file-deps.ts +20 -0
- package/src/mcp/tools/file-exports.ts +22 -0
- package/src/mcp/tools/find-cycles.ts +19 -0
- package/src/mcp/tools/fn-impact.ts +26 -0
- package/src/mcp/tools/impact-analysis.ts +15 -0
- package/src/mcp/tools/implementations.ts +24 -0
- package/src/mcp/tools/index.ts +81 -0
- package/src/mcp/tools/interfaces.ts +24 -0
- package/src/mcp/tools/list-functions.ts +23 -0
- package/src/mcp/tools/list-repos.ts +17 -0
- package/src/mcp/tools/module-map.ts +13 -0
- package/src/mcp/tools/node-roles.ts +23 -0
- package/src/mcp/tools/path.ts +34 -0
- package/src/mcp/tools/query.ts +47 -0
- package/src/mcp/tools/semantic-search.ts +76 -0
- package/src/mcp/tools/sequence.ts +30 -0
- package/src/mcp/tools/structure.ts +25 -0
- package/src/mcp/tools/symbol-children.ts +24 -0
- package/src/mcp/tools/triage.ts +50 -0
- package/src/mcp/tools/where.ts +22 -0
- package/src/mcp/types.ts +21 -0
- package/src/presentation/audit.ts +109 -0
- package/src/presentation/batch.ts +50 -0
- package/src/presentation/branch-compare.ts +148 -0
- package/src/presentation/brief.ts +63 -0
- package/src/presentation/cfg.ts +103 -0
- package/src/presentation/check.ts +138 -0
- package/src/presentation/cochange.ts +57 -0
- package/src/presentation/colors.ts +51 -0
- package/src/presentation/communities.ts +114 -0
- package/src/presentation/complexity.ts +127 -0
- package/src/presentation/dataflow.ts +179 -0
- package/src/presentation/diff-impact-mermaid.ts +169 -0
- package/src/presentation/export.ts +509 -0
- package/src/presentation/flow.ts +147 -0
- package/src/presentation/manifesto.ts +92 -0
- package/src/presentation/owners.ts +89 -0
- package/src/presentation/queries-cli/exports.ts +152 -0
- package/src/presentation/queries-cli/impact.ts +340 -0
- package/src/presentation/queries-cli/index.ts +13 -0
- package/src/presentation/queries-cli/inspect.ts +594 -0
- package/src/presentation/queries-cli/overview.ts +375 -0
- package/src/presentation/queries-cli/path.ts +187 -0
- package/src/presentation/queries-cli.ts +30 -0
- package/src/presentation/query.ts +17 -0
- package/src/presentation/result-formatter.ts +161 -0
- package/src/presentation/sequence-renderer.ts +46 -0
- package/src/presentation/sequence.ts +43 -0
- package/src/presentation/structure.ts +109 -0
- package/src/presentation/table.ts +45 -0
- package/src/presentation/triage.ts +84 -0
- package/src/presentation/viewer.ts +715 -0
- package/src/shared/constants.ts +70 -0
- package/src/shared/errors.ts +85 -0
- package/src/shared/file-utils.ts +233 -0
- package/src/shared/generators.ts +176 -0
- package/src/shared/globs.ts +121 -0
- package/src/shared/hierarchy.ts +81 -0
- package/src/shared/kinds.ts +85 -0
- package/src/shared/normalize.ts +106 -0
- package/src/shared/paginate.ts +93 -0
- package/src/shared/version.ts +10 -0
- package/src/types.ts +2871 -0
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { ConfigError, toErrorMessage } from '../shared/errors.js';
|
|
7
|
+
import { compileGlobs, matchesAny } from '../shared/globs.js';
|
|
8
|
+
import type { CodegraphConfig, ConfigSource, ConsentDecision } from '../types.js';
|
|
9
|
+
import { debug, warn } from './logger.js';
|
|
10
|
+
import { getUserConfigConsent, REGISTRY_PATH, setUserConfigConsent } from './registry.js';
|
|
11
|
+
|
|
12
|
+
export type { CodegraphConfig } from '../types.js';
|
|
13
|
+
|
|
14
|
+
export const CONFIG_FILES: readonly string[] = [
|
|
15
|
+
'.codegraphrc.json',
|
|
16
|
+
'.codegraphrc',
|
|
17
|
+
'codegraph.config.json',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
export const DEFAULTS = {
|
|
21
|
+
include: [] as string[],
|
|
22
|
+
exclude: [] as string[],
|
|
23
|
+
ignoreDirs: [] as string[],
|
|
24
|
+
extensions: [] as string[],
|
|
25
|
+
aliases: {} as Record<string, string>,
|
|
26
|
+
build: {
|
|
27
|
+
incremental: true,
|
|
28
|
+
dbPath: '.codegraph/graph.db',
|
|
29
|
+
driftThreshold: 0.2,
|
|
30
|
+
smallFilesThreshold: 5,
|
|
31
|
+
typescriptResolver: true,
|
|
32
|
+
engine: 'auto' as 'auto' | 'native' | 'wasm',
|
|
33
|
+
fastSkipDiag: false,
|
|
34
|
+
},
|
|
35
|
+
query: {
|
|
36
|
+
defaultDepth: 3,
|
|
37
|
+
defaultLimit: 20,
|
|
38
|
+
excludeTests: false,
|
|
39
|
+
},
|
|
40
|
+
embeddings: { model: null as string | null, llmProvider: null as string | null },
|
|
41
|
+
llm: {
|
|
42
|
+
provider: null as string | null,
|
|
43
|
+
model: null as string | null,
|
|
44
|
+
baseUrl: null as string | null,
|
|
45
|
+
apiKey: null as string | null,
|
|
46
|
+
apiKeyCommand: null as string | null,
|
|
47
|
+
},
|
|
48
|
+
search: { defaultMinScore: 0.2, rrfK: 60, topK: 15, similarityWarnThreshold: 0.85 },
|
|
49
|
+
ci: { failOnCycles: false, impactThreshold: null as number | null },
|
|
50
|
+
manifesto: {
|
|
51
|
+
rules: {
|
|
52
|
+
cognitive: { warn: 15 },
|
|
53
|
+
cyclomatic: { warn: 10 },
|
|
54
|
+
maxNesting: { warn: 4 },
|
|
55
|
+
maintainabilityIndex: { warn: 20, fail: null as number | null },
|
|
56
|
+
importCount: { warn: null as number | null, fail: null as number | null },
|
|
57
|
+
exportCount: { warn: null as number | null, fail: null as number | null },
|
|
58
|
+
lineCount: { warn: null as number | null, fail: null as number | null },
|
|
59
|
+
fanIn: { warn: null as number | null, fail: null as number | null },
|
|
60
|
+
fanOut: { warn: null as number | null, fail: null as number | null },
|
|
61
|
+
noCycles: { warn: null as number | null, fail: null as number | null },
|
|
62
|
+
boundaries: { warn: null as number | null, fail: null as number | null },
|
|
63
|
+
},
|
|
64
|
+
boundaries: null as unknown,
|
|
65
|
+
},
|
|
66
|
+
check: {
|
|
67
|
+
cycles: true,
|
|
68
|
+
blastRadius: null as number | null,
|
|
69
|
+
signatures: true,
|
|
70
|
+
boundaries: true,
|
|
71
|
+
depth: 3,
|
|
72
|
+
},
|
|
73
|
+
coChange: {
|
|
74
|
+
since: '1 year ago',
|
|
75
|
+
minSupport: 3,
|
|
76
|
+
minJaccard: 0.3,
|
|
77
|
+
maxFilesPerCommit: 50,
|
|
78
|
+
},
|
|
79
|
+
analysis: {
|
|
80
|
+
impactDepth: 3,
|
|
81
|
+
fnImpactDepth: 5,
|
|
82
|
+
auditDepth: 3,
|
|
83
|
+
sequenceDepth: 10,
|
|
84
|
+
falsePositiveCallers: 20,
|
|
85
|
+
briefCallerDepth: 5,
|
|
86
|
+
briefImporterDepth: 5,
|
|
87
|
+
briefHighRiskCallers: 10,
|
|
88
|
+
briefMediumRiskCallers: 3,
|
|
89
|
+
// TODO(Phase 8.3): wire these into the points-to solver and type-propagation path
|
|
90
|
+
// once config is threaded through to extractSymbols / buildPointsToMap. Currently
|
|
91
|
+
// controlled by hardcoded constants in src/extractors/javascript.ts
|
|
92
|
+
// (MAX_PROPAGATION_DEPTH, PROPAGATION_HOP_PENALTY, INFERRED_RETURN_TYPE_CONFIDENCE) and in
|
|
93
|
+
// src/domain/graph/resolver/points-to.ts (MAX_SOLVER_ITERATIONS).
|
|
94
|
+
typePropagationDepth: 3,
|
|
95
|
+
/**
|
|
96
|
+
* Confidence score assigned to a return type inferred from `return new Constructor()`
|
|
97
|
+
* when no explicit TypeScript annotation is present.
|
|
98
|
+
* Mirrors `INFERRED_RETURN_TYPE_CONFIDENCE` in `src/extractors/javascript.ts`.
|
|
99
|
+
* @reserved — not yet wired; see TODO above.
|
|
100
|
+
*/
|
|
101
|
+
typeInferenceConfidence: 0.85,
|
|
102
|
+
/**
|
|
103
|
+
* Maximum fixed-point iterations for the Phase 8.3 points-to solver.
|
|
104
|
+
* @reserved — currently not wired to either the WASM solver
|
|
105
|
+
* (`MAX_SOLVER_ITERATIONS` in `points-to.ts`) or the native Rust solver
|
|
106
|
+
* (`MAX_SOLVER_ITERATIONS` in `stages/build_edges.rs`), both of which use the
|
|
107
|
+
* same hardcoded value of 50. See the TODO comment above.
|
|
108
|
+
*/
|
|
109
|
+
pointsToMaxIterations: 50,
|
|
110
|
+
},
|
|
111
|
+
community: {
|
|
112
|
+
resolution: 1.0,
|
|
113
|
+
maxLevels: 50,
|
|
114
|
+
maxLocalPasses: 20,
|
|
115
|
+
refinementTheta: 1.0,
|
|
116
|
+
},
|
|
117
|
+
structure: {
|
|
118
|
+
cohesionThreshold: 0.3,
|
|
119
|
+
},
|
|
120
|
+
risk: {
|
|
121
|
+
weights: {
|
|
122
|
+
fanIn: 0.25,
|
|
123
|
+
complexity: 0.3,
|
|
124
|
+
churn: 0.2,
|
|
125
|
+
role: 0.15,
|
|
126
|
+
mi: 0.1,
|
|
127
|
+
},
|
|
128
|
+
roleWeights: {
|
|
129
|
+
core: 1.0,
|
|
130
|
+
utility: 0.9,
|
|
131
|
+
entry: 0.8,
|
|
132
|
+
adapter: 0.5,
|
|
133
|
+
leaf: 0.2,
|
|
134
|
+
'test-only': 0.1,
|
|
135
|
+
dead: 0.1,
|
|
136
|
+
'dead-leaf': 0.0,
|
|
137
|
+
'dead-entry': 0.3,
|
|
138
|
+
'dead-ffi': 0.05,
|
|
139
|
+
'dead-unresolved': 0.15,
|
|
140
|
+
} as Record<string, number>,
|
|
141
|
+
defaultRoleWeight: 0.5,
|
|
142
|
+
},
|
|
143
|
+
display: {
|
|
144
|
+
maxColWidth: 40,
|
|
145
|
+
excerptLines: 50,
|
|
146
|
+
summaryMaxChars: 100,
|
|
147
|
+
jsdocEndScanLines: 10,
|
|
148
|
+
jsdocOpenScanLines: 20,
|
|
149
|
+
signatureGatherLines: 5,
|
|
150
|
+
},
|
|
151
|
+
mcp: {
|
|
152
|
+
defaults: {
|
|
153
|
+
list_functions: 100,
|
|
154
|
+
query: 10,
|
|
155
|
+
where: 50,
|
|
156
|
+
node_roles: 100,
|
|
157
|
+
export_graph: 500,
|
|
158
|
+
fn_impact: 5,
|
|
159
|
+
context: 5,
|
|
160
|
+
explain: 10,
|
|
161
|
+
file_deps: 20,
|
|
162
|
+
file_exports: 20,
|
|
163
|
+
diff_impact: 30,
|
|
164
|
+
impact_analysis: 20,
|
|
165
|
+
semantic_search: 20,
|
|
166
|
+
execution_flow: 50,
|
|
167
|
+
hotspots: 20,
|
|
168
|
+
co_changes: 20,
|
|
169
|
+
complexity: 30,
|
|
170
|
+
manifesto: 50,
|
|
171
|
+
communities: 20,
|
|
172
|
+
structure: 30,
|
|
173
|
+
triage: 20,
|
|
174
|
+
ast_query: 50,
|
|
175
|
+
implementations: 50,
|
|
176
|
+
interfaces: 50,
|
|
177
|
+
},
|
|
178
|
+
disabledTools: [] as string[],
|
|
179
|
+
},
|
|
180
|
+
} satisfies CodegraphConfig;
|
|
181
|
+
|
|
182
|
+
// ── Per-process user-config override (set by CLI flags) ────────────────
|
|
183
|
+
// Set once by the preAction hook before any command runs; cleared when changed.
|
|
184
|
+
let _userConfigOverride: string | boolean | undefined;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Set the per-run user-config override from CLI flags.
|
|
188
|
+
* Called by the CLI preAction hook before any command executes.
|
|
189
|
+
* - false → --no-user-config
|
|
190
|
+
* - string → --user-config <path>
|
|
191
|
+
* - true → --user-config (bare, use default global file)
|
|
192
|
+
* - undefined → clear override, revert to consent-based resolution
|
|
193
|
+
*/
|
|
194
|
+
export function setUserConfigOverride(v: string | boolean | undefined): void {
|
|
195
|
+
_userConfigOverride = v;
|
|
196
|
+
_configCache.clear();
|
|
197
|
+
_globalConfigCache.clear();
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Per-cwd config cache — avoids re-reading the config file on every query call.
|
|
201
|
+
// Key includes the applied global path so toggled flags/consent are reflected.
|
|
202
|
+
const _configCache = new Map<string, CodegraphConfig>();
|
|
203
|
+
// Parallel cache for the sanitized global layer — needed so loadConfigWithProvenance
|
|
204
|
+
// can correctly attribute global-layer keys even on a _configCache hit.
|
|
205
|
+
const _globalConfigCache = new Map<string, Record<string, unknown> | null>();
|
|
206
|
+
|
|
207
|
+
// ── Global config file location ─────────────────────────────────────────
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Return the canonical path where a new global config file should be written.
|
|
211
|
+
*
|
|
212
|
+
* Uses the same priority logic as resolveUserConfigPath() but always returns a
|
|
213
|
+
* path — it does not check whether the file exists. Used by `--init` to know
|
|
214
|
+
* where to scaffold the file.
|
|
215
|
+
*
|
|
216
|
+
* Priority:
|
|
217
|
+
* 1. CODEGRAPH_USER_CONFIG env var (used as-is)
|
|
218
|
+
* 2. $XDG_CONFIG_HOME/codegraph/config.json
|
|
219
|
+
* %APPDATA%\codegraph\config.json (Windows)
|
|
220
|
+
* fallback: ~/.config/codegraph/config.json
|
|
221
|
+
*/
|
|
222
|
+
export function getDefaultUserConfigPath(): string {
|
|
223
|
+
const envPath = process.env.CODEGRAPH_USER_CONFIG;
|
|
224
|
+
if (envPath) return envPath;
|
|
225
|
+
|
|
226
|
+
const home = os.homedir();
|
|
227
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
228
|
+
if (xdgConfig) return path.join(xdgConfig, 'codegraph', 'config.json');
|
|
229
|
+
if (process.platform === 'win32') {
|
|
230
|
+
const appdata = process.env.APPDATA;
|
|
231
|
+
return appdata
|
|
232
|
+
? path.join(appdata, 'codegraph', 'config.json')
|
|
233
|
+
: path.join(home, '.config', 'codegraph', 'config.json');
|
|
234
|
+
}
|
|
235
|
+
return path.join(home, '.config', 'codegraph', 'config.json');
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* Resolve the absolute path to the user-level global config file.
|
|
240
|
+
*
|
|
241
|
+
* Priority:
|
|
242
|
+
* 1. CODEGRAPH_USER_CONFIG env var (location override only — not forced-on)
|
|
243
|
+
* 2. $XDG_CONFIG_HOME/codegraph/config.json (Unix/macOS)
|
|
244
|
+
* %APPDATA%\codegraph\config.json (Windows)
|
|
245
|
+
* fallback: ~/.config/codegraph/config.json
|
|
246
|
+
* 3. ~/.codegraph/config.json (legacy, next to registry.json)
|
|
247
|
+
*
|
|
248
|
+
* Returns the path of the first existing file, or null if none exist.
|
|
249
|
+
*/
|
|
250
|
+
export function resolveUserConfigPath(): string | null {
|
|
251
|
+
const envPath = process.env.CODEGRAPH_USER_CONFIG;
|
|
252
|
+
if (envPath) {
|
|
253
|
+
if (fs.existsSync(envPath)) return envPath;
|
|
254
|
+
debug(`CODEGRAPH_USER_CONFIG points to missing file: ${envPath}`);
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
const home = os.homedir();
|
|
259
|
+
|
|
260
|
+
// XDG_CONFIG_HOME takes priority on all platforms when explicitly set.
|
|
261
|
+
// Falls back to %APPDATA% on Windows, or ~/.config on Unix/macOS.
|
|
262
|
+
let platformDefault: string;
|
|
263
|
+
const xdgConfig = process.env.XDG_CONFIG_HOME;
|
|
264
|
+
if (xdgConfig) {
|
|
265
|
+
platformDefault = path.join(xdgConfig, 'codegraph', 'config.json');
|
|
266
|
+
} else if (process.platform === 'win32') {
|
|
267
|
+
const appdata = process.env.APPDATA;
|
|
268
|
+
platformDefault = appdata
|
|
269
|
+
? path.join(appdata, 'codegraph', 'config.json')
|
|
270
|
+
: path.join(home, '.config', 'codegraph', 'config.json');
|
|
271
|
+
} else {
|
|
272
|
+
platformDefault = path.join(home, '.config', 'codegraph', 'config.json');
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if (fs.existsSync(platformDefault)) return platformDefault;
|
|
276
|
+
|
|
277
|
+
const legacyPath = path.join(home, '.codegraph', 'config.json');
|
|
278
|
+
if (fs.existsSync(legacyPath)) return legacyPath;
|
|
279
|
+
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
// ── Global config file loading ──────────────────────────────────────────
|
|
284
|
+
|
|
285
|
+
interface ParsedUserConfig {
|
|
286
|
+
globalConfig: Record<string, unknown>;
|
|
287
|
+
appliesToGlobs: string[];
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Read and parse a user-level global config file.
|
|
292
|
+
* Handles both plain-config and appliesTo-wrapper formats.
|
|
293
|
+
* Returns null on missing or malformed files (never throws).
|
|
294
|
+
*/
|
|
295
|
+
function loadUserConfigFile(filePath: string): ParsedUserConfig | null {
|
|
296
|
+
try {
|
|
297
|
+
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
298
|
+
const parsed = JSON.parse(raw) as Record<string, unknown>;
|
|
299
|
+
// Wrapper format: { appliesTo: [...], config: {...} }
|
|
300
|
+
if ('appliesTo' in parsed && typeof parsed.config === 'object' && parsed.config !== null) {
|
|
301
|
+
const globs = Array.isArray(parsed.appliesTo)
|
|
302
|
+
? (parsed.appliesTo as unknown[]).filter((g): g is string => typeof g === 'string')
|
|
303
|
+
: [];
|
|
304
|
+
return { globalConfig: parsed.config as Record<string, unknown>, appliesToGlobs: globs };
|
|
305
|
+
}
|
|
306
|
+
// Plain config (no appliesTo wrapper)
|
|
307
|
+
return { globalConfig: parsed, appliesToGlobs: [] };
|
|
308
|
+
} catch (err) {
|
|
309
|
+
debug(`Failed to load user config at ${filePath}: ${toErrorMessage(err)}`);
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ── Safety sanitisation ─────────────────────────────────────────────────
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Drop any unsafe keys from the global layer before merging.
|
|
318
|
+
* Currently: absolute build.dbPath (would make all repos share one DB).
|
|
319
|
+
* Relative dbPaths resolve per-repo and are allowed through unchanged.
|
|
320
|
+
*/
|
|
321
|
+
function sanitizeUserLayer(raw: Record<string, unknown>): Record<string, unknown> {
|
|
322
|
+
const build = raw.build as Record<string, unknown> | undefined;
|
|
323
|
+
if (build && typeof build.dbPath === 'string' && path.isAbsolute(build.dbPath)) {
|
|
324
|
+
warn(
|
|
325
|
+
`User config: build.dbPath "${build.dbPath}" is absolute and was ignored ` +
|
|
326
|
+
'(an absolute dbPath would share one database across all repos).',
|
|
327
|
+
);
|
|
328
|
+
const sanitizedBuild = { ...build };
|
|
329
|
+
delete sanitizedBuild.dbPath;
|
|
330
|
+
return { ...raw, build: sanitizedBuild };
|
|
331
|
+
}
|
|
332
|
+
return raw;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// ── excludeTests shorthand (per-layer) ─────────────────────────────────
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Hoist a top-level `excludeTests` key from a raw layer into `query.excludeTests`.
|
|
339
|
+
* If the layer already has `query.excludeTests`, that value wins (no-op).
|
|
340
|
+
* Also removes any stale `excludeTests` key that may have leaked into `merged`.
|
|
341
|
+
*/
|
|
342
|
+
function applyExcludeTestsShorthand(
|
|
343
|
+
merged: Record<string, unknown>,
|
|
344
|
+
rawLayer: Record<string, unknown>,
|
|
345
|
+
): Record<string, unknown> {
|
|
346
|
+
if ('excludeTests' in rawLayer) {
|
|
347
|
+
// Only hoist if this layer doesn't also set query.excludeTests
|
|
348
|
+
if (!(rawLayer.query && 'excludeTests' in (rawLayer.query as object))) {
|
|
349
|
+
(merged.query as Record<string, unknown>).excludeTests = Boolean(rawLayer.excludeTests);
|
|
350
|
+
}
|
|
351
|
+
const result = { ...merged };
|
|
352
|
+
delete result.excludeTests;
|
|
353
|
+
return result;
|
|
354
|
+
}
|
|
355
|
+
if ('excludeTests' in merged) {
|
|
356
|
+
const result = { ...merged };
|
|
357
|
+
delete result.excludeTests;
|
|
358
|
+
return result;
|
|
359
|
+
}
|
|
360
|
+
return merged;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
// ── Consent resolution ──────────────────────────────────────────────────
|
|
364
|
+
|
|
365
|
+
interface ConsentResolutionResult {
|
|
366
|
+
applied: boolean;
|
|
367
|
+
globalPath: string | null;
|
|
368
|
+
consentDecision: ConsentDecision | undefined;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Resolve whether the global user config should be applied for a given repo.
|
|
373
|
+
* Implements the §4.1/§4.2 precedence chain from the spec.
|
|
374
|
+
*
|
|
375
|
+
* @param rootDir Absolute repo root.
|
|
376
|
+
* @param override Per-run override from CLI flags (_userConfigOverride).
|
|
377
|
+
* @param registryPath Optional registry path (for tests).
|
|
378
|
+
*/
|
|
379
|
+
function resolveConsent(
|
|
380
|
+
rootDir: string,
|
|
381
|
+
override: string | boolean | undefined,
|
|
382
|
+
registryPath: string = REGISTRY_PATH,
|
|
383
|
+
): ConsentResolutionResult {
|
|
384
|
+
// §4.1 step 1: --no-user-config
|
|
385
|
+
if (override === false) {
|
|
386
|
+
return { applied: false, globalPath: null, consentDecision: undefined };
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
// §4.1 steps 2–3: explicit path or bare --user-config
|
|
390
|
+
if (override !== undefined) {
|
|
391
|
+
const explicitPath = typeof override === 'string' ? override : resolveUserConfigPath();
|
|
392
|
+
if (explicitPath && fs.existsSync(explicitPath)) {
|
|
393
|
+
return { applied: true, globalPath: explicitPath, consentDecision: undefined };
|
|
394
|
+
}
|
|
395
|
+
if (typeof override === 'string') {
|
|
396
|
+
warn(`--user-config path "${override}" does not exist; skipping global layer.`);
|
|
397
|
+
}
|
|
398
|
+
return { applied: false, globalPath: null, consentDecision: undefined };
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
// §4.1 step 4: resolve global file — if none, NOT applied
|
|
402
|
+
const globalPath = resolveUserConfigPath();
|
|
403
|
+
if (!globalPath) {
|
|
404
|
+
return { applied: false, globalPath: null, consentDecision: undefined };
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
// §4.2: check per-repo decision
|
|
408
|
+
const consentDecision = getUserConfigConsent(rootDir, registryPath);
|
|
409
|
+
|
|
410
|
+
// §4.2 step 1: recorded disabled
|
|
411
|
+
if (consentDecision === 'disabled') {
|
|
412
|
+
return { applied: false, globalPath, consentDecision };
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// §4.2 step 2: recorded enabled
|
|
416
|
+
if (consentDecision === 'enabled') {
|
|
417
|
+
return { applied: true, globalPath, consentDecision };
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// §4.2 step 3: appliesTo glob match (dynamic, never persisted)
|
|
421
|
+
const parsed = loadUserConfigFile(globalPath);
|
|
422
|
+
if (parsed?.appliesToGlobs.length) {
|
|
423
|
+
const expanded = parsed.appliesToGlobs.map((g) =>
|
|
424
|
+
g.startsWith('~') ? path.join(os.homedir(), g.slice(1)) : g,
|
|
425
|
+
);
|
|
426
|
+
const regexes = compileGlobs(expanded);
|
|
427
|
+
const absRoot = path.resolve(rootDir);
|
|
428
|
+
if (matchesAny(regexes, absRoot)) {
|
|
429
|
+
return { applied: true, globalPath, consentDecision: undefined };
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
// §4.2 steps 4–5: undecided — caller decides whether to prompt
|
|
434
|
+
return { applied: false, globalPath, consentDecision: undefined };
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
// Last applied global path and parsed data — exposed so pipeline.ts and
|
|
438
|
+
// loadConfigWithProvenance can reuse the already-parsed file contents without a
|
|
439
|
+
// second disk read (eliminating the TOCTOU window between loadConfig and callers).
|
|
440
|
+
let _lastAppliedGlobalPath: string | null = null;
|
|
441
|
+
let _lastAppliedGlobalConfig: Record<string, unknown> | null = null;
|
|
442
|
+
export function getLastAppliedGlobalPath(): string | null {
|
|
443
|
+
return _lastAppliedGlobalPath;
|
|
444
|
+
}
|
|
445
|
+
export function getLastAppliedGlobalConfig(): Record<string, unknown> | null {
|
|
446
|
+
return _lastAppliedGlobalConfig;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// ── Build-relevant config hash ──────────────────────────────────────────
|
|
450
|
+
|
|
451
|
+
const BUILD_HASH_KEYS: ReadonlyArray<keyof CodegraphConfig> = [
|
|
452
|
+
'include',
|
|
453
|
+
'exclude',
|
|
454
|
+
'ignoreDirs',
|
|
455
|
+
'extensions',
|
|
456
|
+
'aliases',
|
|
457
|
+
'build',
|
|
458
|
+
];
|
|
459
|
+
|
|
460
|
+
/**
|
|
461
|
+
* Compute a short stable hash of the build-relevant config subset.
|
|
462
|
+
* Used by the pipeline to detect config changes that require a full rebuild.
|
|
463
|
+
*/
|
|
464
|
+
export function computeConfigHash(config: CodegraphConfig): string {
|
|
465
|
+
const subset: Partial<CodegraphConfig> = {};
|
|
466
|
+
for (const k of BUILD_HASH_KEYS) {
|
|
467
|
+
(subset as Record<string, unknown>)[k] = config[k];
|
|
468
|
+
}
|
|
469
|
+
return createHash('sha256').update(JSON.stringify(subset)).digest('hex').slice(0, 16);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// ── Interactive consent prompt ──────────────────────────────────────────
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* When called from the build command, check whether we should prompt the user
|
|
476
|
+
* for global-config consent and, if so, prompt and persist the answer.
|
|
477
|
+
*
|
|
478
|
+
* Only fires when ALL of:
|
|
479
|
+
* - A global config file exists
|
|
480
|
+
* - The repo is undecided (no recorded consent)
|
|
481
|
+
* - Not matched by appliesTo globs
|
|
482
|
+
* - process.stdin.isTTY && process.stdout.isTTY
|
|
483
|
+
* - CI env is not set
|
|
484
|
+
* - No per-run --user-config / --no-user-config flag is active
|
|
485
|
+
*/
|
|
486
|
+
export async function promptForConsentIfNeeded(
|
|
487
|
+
rootDir: string,
|
|
488
|
+
registryPath: string = REGISTRY_PATH,
|
|
489
|
+
): Promise<void> {
|
|
490
|
+
// No-op if per-run override is active
|
|
491
|
+
if (_userConfigOverride !== undefined) return;
|
|
492
|
+
|
|
493
|
+
const globalPath = resolveUserConfigPath();
|
|
494
|
+
if (!globalPath) return;
|
|
495
|
+
|
|
496
|
+
const consentDecision = getUserConfigConsent(rootDir, registryPath);
|
|
497
|
+
if (consentDecision !== undefined) return; // already decided
|
|
498
|
+
|
|
499
|
+
// Check appliesTo globs (dynamic consent — no prompt needed)
|
|
500
|
+
const parsed = loadUserConfigFile(globalPath);
|
|
501
|
+
if (parsed?.appliesToGlobs.length) {
|
|
502
|
+
const expanded = parsed.appliesToGlobs.map((g) =>
|
|
503
|
+
g.startsWith('~') ? path.join(os.homedir(), g.slice(1)) : g,
|
|
504
|
+
);
|
|
505
|
+
const regexes = compileGlobs(expanded);
|
|
506
|
+
const absRoot = path.resolve(rootDir);
|
|
507
|
+
if (matchesAny(regexes, absRoot)) return; // covered by appliesTo
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
// Only prompt in fully interactive sessions
|
|
511
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) return;
|
|
512
|
+
if (process.env.CI) return;
|
|
513
|
+
|
|
514
|
+
const { createInterface } = await import('node:readline');
|
|
515
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
516
|
+
|
|
517
|
+
const answer = await new Promise<string>((resolve) => {
|
|
518
|
+
rl.question(
|
|
519
|
+
`\nA global codegraph config was found at ${globalPath}.\n` +
|
|
520
|
+
`Apply settings not explicitly configured in this repo to ${path.resolve(rootDir)}? [y/N]\n` +
|
|
521
|
+
`(remembered per-repo; change later with \`codegraph config --enable-global|--disable-global\`)\n` +
|
|
522
|
+
`> `,
|
|
523
|
+
(ans) => {
|
|
524
|
+
rl.close();
|
|
525
|
+
resolve(ans.trim().toLowerCase());
|
|
526
|
+
},
|
|
527
|
+
);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
const decided = answer === 'y' || answer === 'yes' ? 'enabled' : 'disabled';
|
|
531
|
+
setUserConfigConsent(rootDir, decided, registryPath);
|
|
532
|
+
process.stderr.write(`Global config consent recorded: ${decided}\n`);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
// ── Main config loader ──────────────────────────────────────────────────
|
|
536
|
+
|
|
537
|
+
/** Options for loadConfig. */
|
|
538
|
+
export interface LoadConfigOpts {
|
|
539
|
+
/** Per-run user-config override (from CLI flags or programmatic call). */
|
|
540
|
+
userConfig?: string | boolean;
|
|
541
|
+
/** Registry path override (mainly for tests). */
|
|
542
|
+
registryPath?: string;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
* Load project configuration from a .codegraphrc.json or similar file.
|
|
547
|
+
* Returns merged config with defaults: defaults → global (if applied) → project → env → secrets.
|
|
548
|
+
* Results are cached per cwd + applied global path.
|
|
549
|
+
*/
|
|
550
|
+
export function loadConfig(cwd?: string, opts?: LoadConfigOpts): CodegraphConfig {
|
|
551
|
+
cwd = path.resolve(cwd || process.cwd());
|
|
552
|
+
|
|
553
|
+
// Determine effective override: explicit opts win over module-level variable
|
|
554
|
+
const override = opts?.userConfig !== undefined ? opts.userConfig : _userConfigOverride;
|
|
555
|
+
|
|
556
|
+
// Resolve consent and global path
|
|
557
|
+
const { applied, globalPath } = resolveConsent(cwd, override, opts?.registryPath);
|
|
558
|
+
|
|
559
|
+
// Cache key includes applied global path and override flag so toggled consent is reflected
|
|
560
|
+
const cacheKey = `${cwd}::${applied ? (globalPath ?? 'default') : 'none'}`;
|
|
561
|
+
// Always update _lastAppliedGlobalPath/_lastAppliedGlobalConfig before returning —
|
|
562
|
+
// on a cache hit the previous call may have been for a different repo or different
|
|
563
|
+
// opts, so stale values here would misbehave for programmatic callers making
|
|
564
|
+
// multiple buildGraph calls in the same process.
|
|
565
|
+
_lastAppliedGlobalPath = applied ? globalPath : null;
|
|
566
|
+
_lastAppliedGlobalConfig = null; // updated below if a global file is loaded
|
|
567
|
+
const cached = _configCache.get(cacheKey);
|
|
568
|
+
if (cached) {
|
|
569
|
+
// Restore global config so loadConfigWithProvenance gets correct provenance on cache hits.
|
|
570
|
+
_lastAppliedGlobalConfig = _globalConfigCache.get(cacheKey) ?? null;
|
|
571
|
+
return structuredClone(cached);
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// ── Layer 0: DEFAULTS ─────────────────────────────────────────────
|
|
575
|
+
let merged = DEFAULTS as unknown as Record<string, unknown>;
|
|
576
|
+
|
|
577
|
+
// ── Layer 1: global (if applied) ──────────────────────────────────
|
|
578
|
+
if (applied && globalPath) {
|
|
579
|
+
const userFileData = loadUserConfigFile(globalPath);
|
|
580
|
+
if (userFileData) {
|
|
581
|
+
debug(`Applying global user config from ${globalPath}`);
|
|
582
|
+
const sanitized = sanitizeUserLayer(userFileData.globalConfig);
|
|
583
|
+
// Cache the sanitized global data so pipeline.ts and loadConfigWithProvenance
|
|
584
|
+
// can use it without a second disk read (eliminates TOCTOU window).
|
|
585
|
+
_lastAppliedGlobalConfig = sanitized;
|
|
586
|
+
merged = mergeConfig(merged, sanitized);
|
|
587
|
+
merged = applyExcludeTestsShorthand(merged, sanitized);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// ── Layer 2: project ──────────────────────────────────────────────
|
|
592
|
+
for (const name of CONFIG_FILES) {
|
|
593
|
+
const filePath = path.join(cwd, name);
|
|
594
|
+
if (fs.existsSync(filePath)) {
|
|
595
|
+
try {
|
|
596
|
+
const raw = fs.readFileSync(filePath, 'utf-8');
|
|
597
|
+
const projectConfig = JSON.parse(raw) as Record<string, unknown>;
|
|
598
|
+
debug(`Loaded project config from ${filePath}`);
|
|
599
|
+
merged = mergeConfig(merged, projectConfig);
|
|
600
|
+
merged = applyExcludeTestsShorthand(merged, projectConfig);
|
|
601
|
+
break;
|
|
602
|
+
} catch (err: unknown) {
|
|
603
|
+
if (err instanceof ConfigError) throw err;
|
|
604
|
+
debug(`Failed to parse config ${filePath}: ${toErrorMessage(err)}`);
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
// ── Layers 3–4: env overrides + secret resolution ─────────────────
|
|
610
|
+
const result = resolveSecrets(applyEnvOverrides(merged as unknown as CodegraphConfig));
|
|
611
|
+
_configCache.set(cacheKey, structuredClone(result));
|
|
612
|
+
_globalConfigCache.set(cacheKey, _lastAppliedGlobalConfig);
|
|
613
|
+
return result;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/**
|
|
617
|
+
* Clear the config cache. Intended for long-running processes that need to
|
|
618
|
+
* pick up on-disk config changes, and for test isolation when tests share
|
|
619
|
+
* the same cwd.
|
|
620
|
+
*/
|
|
621
|
+
export function clearConfigCache(): void {
|
|
622
|
+
_configCache.clear();
|
|
623
|
+
_globalConfigCache.clear();
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
/**
|
|
627
|
+
* Load config and return it together with per-key provenance information.
|
|
628
|
+
* Used by `codegraph config --explain`.
|
|
629
|
+
*
|
|
630
|
+
* Calls loadConfig first so _lastAppliedGlobalConfig is populated, then uses
|
|
631
|
+
* that cached data for the global-layer provenance — avoiding a second disk
|
|
632
|
+
* read and eliminating the TOCTOU window between the two reads.
|
|
633
|
+
*/
|
|
634
|
+
export function loadConfigWithProvenance(
|
|
635
|
+
cwd?: string,
|
|
636
|
+
opts?: LoadConfigOpts,
|
|
637
|
+
): import('../types.js').ConfigWithProvenance {
|
|
638
|
+
cwd = path.resolve(cwd || process.cwd());
|
|
639
|
+
const override = opts?.userConfig !== undefined ? opts.userConfig : _userConfigOverride;
|
|
640
|
+
const { applied, globalPath, consentDecision } = resolveConsent(
|
|
641
|
+
cwd,
|
|
642
|
+
override,
|
|
643
|
+
opts?.registryPath,
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
// Load (or return from cache) the merged config first — this also populates
|
|
647
|
+
// _lastAppliedGlobalConfig with the already-parsed and sanitized global layer.
|
|
648
|
+
const config = loadConfig(cwd, opts);
|
|
649
|
+
|
|
650
|
+
// Build provenance by tracking which layer supplies each top-level key
|
|
651
|
+
const provenance: Record<string, ConfigSource> = {};
|
|
652
|
+
|
|
653
|
+
// Layer 0: defaults — everything starts as 'default'
|
|
654
|
+
for (const k of Object.keys(DEFAULTS)) provenance[k] = 'default';
|
|
655
|
+
|
|
656
|
+
// Layer 1: global — reuse the data loadConfig already parsed (no second disk read)
|
|
657
|
+
const globalRaw = applied && globalPath ? _lastAppliedGlobalConfig : null;
|
|
658
|
+
if (globalRaw) {
|
|
659
|
+
for (const k of Object.keys(globalRaw)) provenance[k] = 'user';
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
// Layer 2: project
|
|
663
|
+
for (const name of CONFIG_FILES) {
|
|
664
|
+
const filePath = path.join(cwd, name);
|
|
665
|
+
if (fs.existsSync(filePath)) {
|
|
666
|
+
try {
|
|
667
|
+
const raw = JSON.parse(fs.readFileSync(filePath, 'utf-8')) as Record<string, unknown>;
|
|
668
|
+
for (const k of Object.keys(raw)) provenance[k] = 'project';
|
|
669
|
+
break;
|
|
670
|
+
} catch (err) {
|
|
671
|
+
debug(`loadConfigWithProvenance: failed to parse ${filePath}: ${toErrorMessage(err)}`);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
// Layer 3+: env overrides (LLM keys)
|
|
677
|
+
const ENV_LLM_KEYS = ['CODEGRAPH_LLM_PROVIDER', 'CODEGRAPH_LLM_API_KEY', 'CODEGRAPH_LLM_MODEL'];
|
|
678
|
+
if (ENV_LLM_KEYS.some((k) => process.env[k] !== undefined)) {
|
|
679
|
+
provenance.llm = 'env';
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
return { config, provenance, appliedGlobalPath: applied ? globalPath : null, consentDecision };
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
const ENV_LLM_MAP: Record<string, string> = {
|
|
686
|
+
CODEGRAPH_LLM_PROVIDER: 'provider',
|
|
687
|
+
CODEGRAPH_LLM_API_KEY: 'apiKey',
|
|
688
|
+
CODEGRAPH_LLM_MODEL: 'model',
|
|
689
|
+
};
|
|
690
|
+
|
|
691
|
+
export function applyEnvOverrides(config: CodegraphConfig): CodegraphConfig {
|
|
692
|
+
for (const [envKey, field] of Object.entries(ENV_LLM_MAP)) {
|
|
693
|
+
if (process.env[envKey as keyof NodeJS.ProcessEnv] !== undefined) {
|
|
694
|
+
(config.llm as Record<string, unknown>)[field] =
|
|
695
|
+
process.env[envKey as keyof NodeJS.ProcessEnv];
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
// Engine selection: CODEGRAPH_ENGINE env always wins over config-file value.
|
|
699
|
+
if (process.env.CODEGRAPH_ENGINE !== undefined) {
|
|
700
|
+
const raw = process.env.CODEGRAPH_ENGINE;
|
|
701
|
+
const valid = ['auto', 'native', 'wasm'] as const;
|
|
702
|
+
if ((valid as readonly string[]).includes(raw)) {
|
|
703
|
+
(config.build as Record<string, unknown>).engine = raw as 'auto' | 'native' | 'wasm';
|
|
704
|
+
} else {
|
|
705
|
+
warn(
|
|
706
|
+
`CODEGRAPH_ENGINE="${raw}" is not a valid engine value (expected auto|native|wasm). Falling back to "auto".`,
|
|
707
|
+
);
|
|
708
|
+
(config.build as Record<string, unknown>).engine = 'auto';
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
// Fast-skip diagnostic flag.
|
|
712
|
+
if (process.env.CODEGRAPH_FAST_SKIP_DIAG !== undefined) {
|
|
713
|
+
(config.build as Record<string, unknown>).fastSkipDiag =
|
|
714
|
+
process.env.CODEGRAPH_FAST_SKIP_DIAG === '1';
|
|
715
|
+
}
|
|
716
|
+
return config;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export function resolveSecrets(config: CodegraphConfig): CodegraphConfig {
|
|
720
|
+
const cmd = config.llm.apiKeyCommand;
|
|
721
|
+
if (cmd == null) return config;
|
|
722
|
+
if (typeof cmd !== 'string') {
|
|
723
|
+
const actual = Array.isArray(cmd) ? 'array' : typeof cmd;
|
|
724
|
+
throw new ConfigError(
|
|
725
|
+
`llm.apiKeyCommand must be a string (received ${actual}). ` +
|
|
726
|
+
'The command is split on whitespace and executed without a shell. ' +
|
|
727
|
+
'Example: "apiKeyCommand": "op read op://vault/openai/api-key"',
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
if (cmd.trim() === '') return config;
|
|
731
|
+
|
|
732
|
+
const parts = cmd.trim().split(/\s+/);
|
|
733
|
+
const [executable, ...args] = parts;
|
|
734
|
+
try {
|
|
735
|
+
const result = execFileSync(executable!, args, {
|
|
736
|
+
encoding: 'utf-8',
|
|
737
|
+
timeout: 10_000,
|
|
738
|
+
maxBuffer: 64 * 1024,
|
|
739
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
740
|
+
}).trim();
|
|
741
|
+
if (result) {
|
|
742
|
+
(config.llm as Record<string, unknown>).apiKey = result;
|
|
743
|
+
}
|
|
744
|
+
} catch (err: unknown) {
|
|
745
|
+
warn(`apiKeyCommand failed: ${toErrorMessage(err)}`);
|
|
746
|
+
}
|
|
747
|
+
return config;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// ── Monorepo workspace detection ─────────────────────────────────────
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Expand a workspace glob pattern into matching directories.
|
|
754
|
+
* Supports trailing `/*` or `/**` patterns (e.g. "packages/*").
|
|
755
|
+
* Does not depend on an external glob library — uses fs.readdirSync.
|
|
756
|
+
*/
|
|
757
|
+
function expandWorkspaceGlob(pattern: string, rootDir: string): string[] {
|
|
758
|
+
// Strip trailing /*, /**, or just *
|
|
759
|
+
const clean = pattern.replace(/\/?\*\*?$/, '');
|
|
760
|
+
const baseDir = path.resolve(rootDir, clean);
|
|
761
|
+
if (!fs.existsSync(baseDir)) return [];
|
|
762
|
+
try {
|
|
763
|
+
const entries = fs.readdirSync(baseDir, { withFileTypes: true });
|
|
764
|
+
return entries
|
|
765
|
+
.filter((e) => e.isDirectory())
|
|
766
|
+
.map((e) => path.join(baseDir, e.name))
|
|
767
|
+
.filter((d) => fs.existsSync(path.join(d, 'package.json')));
|
|
768
|
+
} catch (e) {
|
|
769
|
+
debug(`expandGlobDirs: failed to read ${baseDir}: ${toErrorMessage(e)}`);
|
|
770
|
+
return [];
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Read a package.json and return its name field, or null.
|
|
776
|
+
*/
|
|
777
|
+
function readPackageName(pkgDir: string): string | null {
|
|
778
|
+
try {
|
|
779
|
+
const raw = fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf-8');
|
|
780
|
+
const pkg = JSON.parse(raw);
|
|
781
|
+
return pkg.name || null;
|
|
782
|
+
} catch (e) {
|
|
783
|
+
debug(`readPackageName: failed for ${pkgDir}: ${toErrorMessage(e)}`);
|
|
784
|
+
return null;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
interface WorkspaceEntry {
|
|
789
|
+
dir: string;
|
|
790
|
+
entry: string | null;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Resolve the entry-point source file for a workspace package.
|
|
795
|
+
* Checks exports → main → index file fallback.
|
|
796
|
+
*/
|
|
797
|
+
function resolveWorkspaceEntry(pkgDir: string): string | null {
|
|
798
|
+
try {
|
|
799
|
+
const raw = fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf-8');
|
|
800
|
+
const pkg = JSON.parse(raw);
|
|
801
|
+
|
|
802
|
+
// Try "source" field first (common in monorepos for pre-built packages)
|
|
803
|
+
if (pkg.source) {
|
|
804
|
+
const s = path.resolve(pkgDir, pkg.source);
|
|
805
|
+
if (fs.existsSync(s)) return s;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// Try "main" field
|
|
809
|
+
if (pkg.main) {
|
|
810
|
+
const m = path.resolve(pkgDir, pkg.main);
|
|
811
|
+
if (fs.existsSync(m)) return m;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
// Index file fallback
|
|
815
|
+
for (const idx of [
|
|
816
|
+
'index.ts',
|
|
817
|
+
'index.tsx',
|
|
818
|
+
'index.js',
|
|
819
|
+
'index.mjs',
|
|
820
|
+
'src/index.ts',
|
|
821
|
+
'src/index.tsx',
|
|
822
|
+
'src/index.js',
|
|
823
|
+
]) {
|
|
824
|
+
const candidate = path.resolve(pkgDir, idx);
|
|
825
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
826
|
+
}
|
|
827
|
+
} catch (e) {
|
|
828
|
+
debug(`resolveWorkspaceEntry: package.json probe failed for ${pkgDir}: ${toErrorMessage(e)}`);
|
|
829
|
+
}
|
|
830
|
+
return null;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Detect monorepo workspace packages from workspace configuration files.
|
|
835
|
+
*
|
|
836
|
+
* Checks (in order):
|
|
837
|
+
* 1. pnpm-workspace.yaml — `packages:` array
|
|
838
|
+
* 2. package.json — `workspaces` field (npm/yarn)
|
|
839
|
+
* 3. lerna.json — `packages` array
|
|
840
|
+
*/
|
|
841
|
+
/** Read pnpm-workspace.yaml and return workspace glob patterns. */
|
|
842
|
+
function readPnpmWorkspacePatterns(rootDir: string): string[] {
|
|
843
|
+
const pnpmPath = path.join(rootDir, 'pnpm-workspace.yaml');
|
|
844
|
+
if (!fs.existsSync(pnpmPath)) return [];
|
|
845
|
+
try {
|
|
846
|
+
const raw = fs.readFileSync(pnpmPath, 'utf-8');
|
|
847
|
+
const packagesMatch = raw.match(/^packages:\s*\n((?:\s+-\s+.+\n?)*)/m);
|
|
848
|
+
if (!packagesMatch) return [];
|
|
849
|
+
const lines = packagesMatch[1]!.match(/^\s+-\s+['"]?([^'"#\n]+)['"]?\s*$/gm);
|
|
850
|
+
if (!lines) return [];
|
|
851
|
+
const patterns: string[] = [];
|
|
852
|
+
for (const line of lines) {
|
|
853
|
+
const m = line.match(/^\s+-\s+['"]?([^'"#\n]+?)['"]?\s*$/);
|
|
854
|
+
if (m) patterns.push(m[1]!.trim());
|
|
855
|
+
}
|
|
856
|
+
return patterns;
|
|
857
|
+
} catch (e) {
|
|
858
|
+
debug(`detectWorkspaces: failed to parse pnpm-workspace.yaml: ${toErrorMessage(e)}`);
|
|
859
|
+
return [];
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/** Read package.json workspaces field (npm/yarn) and return glob patterns. */
|
|
864
|
+
function readNpmWorkspacePatterns(rootDir: string): string[] {
|
|
865
|
+
const rootPkgPath = path.join(rootDir, 'package.json');
|
|
866
|
+
if (!fs.existsSync(rootPkgPath)) return [];
|
|
867
|
+
try {
|
|
868
|
+
const raw = fs.readFileSync(rootPkgPath, 'utf-8');
|
|
869
|
+
const pkg = JSON.parse(raw);
|
|
870
|
+
const ws = pkg.workspaces;
|
|
871
|
+
if (Array.isArray(ws)) return ws;
|
|
872
|
+
if (ws && Array.isArray(ws.packages)) return ws.packages;
|
|
873
|
+
return [];
|
|
874
|
+
} catch (e) {
|
|
875
|
+
debug(`detectWorkspaces: failed to parse package.json workspaces: ${toErrorMessage(e)}`);
|
|
876
|
+
return [];
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** Read lerna.json packages field and return glob patterns. */
|
|
881
|
+
function readLernaPatterns(rootDir: string): string[] {
|
|
882
|
+
const lernaPath = path.join(rootDir, 'lerna.json');
|
|
883
|
+
if (!fs.existsSync(lernaPath)) return [];
|
|
884
|
+
try {
|
|
885
|
+
const raw = fs.readFileSync(lernaPath, 'utf-8');
|
|
886
|
+
const lerna = JSON.parse(raw);
|
|
887
|
+
if (Array.isArray(lerna.packages)) return lerna.packages;
|
|
888
|
+
return [];
|
|
889
|
+
} catch (e) {
|
|
890
|
+
debug(`detectWorkspaces: failed to parse lerna.json: ${toErrorMessage(e)}`);
|
|
891
|
+
return [];
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
/** Expand workspace patterns into concrete package entries. */
|
|
896
|
+
function expandWorkspacePatterns(patterns: string[], rootDir: string): Map<string, WorkspaceEntry> {
|
|
897
|
+
const workspaces = new Map<string, WorkspaceEntry>();
|
|
898
|
+
for (const pattern of patterns) {
|
|
899
|
+
if (pattern.includes('*')) {
|
|
900
|
+
for (const dir of expandWorkspaceGlob(pattern, rootDir)) {
|
|
901
|
+
const name = readPackageName(dir);
|
|
902
|
+
if (name) workspaces.set(name, { dir, entry: resolveWorkspaceEntry(dir) });
|
|
903
|
+
}
|
|
904
|
+
} else {
|
|
905
|
+
const dir = path.resolve(rootDir, pattern);
|
|
906
|
+
if (fs.existsSync(path.join(dir, 'package.json'))) {
|
|
907
|
+
const name = readPackageName(dir);
|
|
908
|
+
if (name) workspaces.set(name, { dir, entry: resolveWorkspaceEntry(dir) });
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
return workspaces;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
export function detectWorkspaces(rootDir: string): Map<string, WorkspaceEntry> {
|
|
916
|
+
// Try each package manager in priority order — first match wins
|
|
917
|
+
let patterns = readPnpmWorkspacePatterns(rootDir);
|
|
918
|
+
if (patterns.length === 0) patterns = readNpmWorkspacePatterns(rootDir);
|
|
919
|
+
if (patterns.length === 0) patterns = readLernaPatterns(rootDir);
|
|
920
|
+
if (patterns.length === 0) return new Map();
|
|
921
|
+
|
|
922
|
+
const workspaces = expandWorkspacePatterns(patterns, rootDir);
|
|
923
|
+
|
|
924
|
+
if (workspaces.size > 0) {
|
|
925
|
+
debug(`Detected ${workspaces.size} workspace packages: ${[...workspaces.keys()].join(', ')}`);
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return workspaces;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
export function mergeConfig(
|
|
932
|
+
defaults: Record<string, unknown>,
|
|
933
|
+
overrides: Record<string, unknown>,
|
|
934
|
+
): Record<string, unknown> {
|
|
935
|
+
const result: Record<string, unknown> = { ...defaults };
|
|
936
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
937
|
+
if (
|
|
938
|
+
value &&
|
|
939
|
+
typeof value === 'object' &&
|
|
940
|
+
!Array.isArray(value) &&
|
|
941
|
+
defaults[key] &&
|
|
942
|
+
typeof defaults[key] === 'object' &&
|
|
943
|
+
!Array.isArray(defaults[key])
|
|
944
|
+
) {
|
|
945
|
+
result[key] = mergeConfig(
|
|
946
|
+
defaults[key] as Record<string, unknown>,
|
|
947
|
+
value as Record<string, unknown>,
|
|
948
|
+
);
|
|
949
|
+
} else {
|
|
950
|
+
result[key] = value;
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
return result;
|
|
954
|
+
}
|