@optave/codegraph 3.12.0 → 3.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -46
- package/dist/ast-analysis/engine.d.ts.map +1 -1
- package/dist/ast-analysis/engine.js +38 -40
- package/dist/ast-analysis/engine.js.map +1 -1
- 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/index.d.ts.map +1 -1
- package/dist/ast-analysis/rules/index.js +34 -0
- package/dist/ast-analysis/rules/index.js.map +1 -1
- package/dist/ast-analysis/rules/javascript.d.ts.map +1 -1
- package/dist/ast-analysis/rules/javascript.js +3 -0
- package/dist/ast-analysis/rules/javascript.js.map +1 -1
- package/dist/ast-analysis/shared.d.ts.map +1 -1
- package/dist/ast-analysis/shared.js +2 -0
- package/dist/ast-analysis/shared.js.map +1 -1
- package/dist/ast-analysis/visitor-utils.d.ts +1 -0
- package/dist/ast-analysis/visitor-utils.d.ts.map +1 -1
- package/dist/ast-analysis/visitor-utils.js +5 -0
- package/dist/ast-analysis/visitor-utils.js.map +1 -1
- package/dist/ast-analysis/visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitor.js +60 -47
- package/dist/ast-analysis/visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/cfg-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/cfg-visitor.js +126 -76
- package/dist/ast-analysis/visitors/cfg-visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/complexity-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/complexity-visitor.js +27 -15
- package/dist/ast-analysis/visitors/complexity-visitor.js.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.d.ts.map +1 -1
- package/dist/ast-analysis/visitors/dataflow-visitor.js +54 -21
- package/dist/ast-analysis/visitors/dataflow-visitor.js.map +1 -1
- package/dist/cli/commands/audit.d.ts.map +1 -1
- package/dist/cli/commands/audit.js +2 -1
- package/dist/cli/commands/audit.js.map +1 -1
- package/dist/cli/commands/batch.d.ts.map +1 -1
- package/dist/cli/commands/batch.js +1 -0
- package/dist/cli/commands/batch.js.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +6 -1
- package/dist/cli/commands/build.js.map +1 -1
- 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/roles.d.ts.map +1 -1
- package/dist/cli/commands/roles.js +6 -1
- package/dist/cli/commands/roles.js.map +1 -1
- package/dist/cli/commands/triage.js +1 -1
- package/dist/cli/commands/triage.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +10 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/shared/options.d.ts +2 -1
- package/dist/cli/shared/options.d.ts.map +1 -1
- package/dist/cli/shared/options.js +11 -1
- package/dist/cli/shared/options.js.map +1 -1
- package/dist/cli/types.d.ts +2 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/db/better-sqlite3.d.ts +2 -1
- package/dist/db/better-sqlite3.d.ts.map +1 -1
- package/dist/db/better-sqlite3.js.map +1 -1
- package/dist/db/connection.d.ts +7 -1
- package/dist/db/connection.d.ts.map +1 -1
- package/dist/db/connection.js +20 -5
- package/dist/db/connection.js.map +1 -1
- package/dist/db/index.d.ts +1 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +1 -1
- package/dist/db/index.js.map +1 -1
- package/dist/db/migrations.d.ts.map +1 -1
- package/dist/db/migrations.js +69 -1
- package/dist/db/migrations.js.map +1 -1
- package/dist/db/repository/build-stmts.d.ts.map +1 -1
- package/dist/db/repository/build-stmts.js +18 -0
- package/dist/db/repository/build-stmts.js.map +1 -1
- package/dist/db/repository/dataflow.d.ts +5 -0
- package/dist/db/repository/dataflow.d.ts.map +1 -1
- package/dist/db/repository/dataflow.js +14 -0
- package/dist/db/repository/dataflow.js.map +1 -1
- package/dist/db/repository/index.d.ts +1 -1
- package/dist/db/repository/index.d.ts.map +1 -1
- package/dist/db/repository/index.js +1 -1
- package/dist/db/repository/index.js.map +1 -1
- package/dist/db/repository/native-repository.d.ts.map +1 -1
- package/dist/db/repository/native-repository.js +47 -34
- package/dist/db/repository/native-repository.js.map +1 -1
- package/dist/domain/analysis/context.d.ts +2 -2
- package/dist/domain/analysis/dependencies.d.ts +2 -2
- package/dist/domain/analysis/diff-impact.d.ts +2 -2
- package/dist/domain/analysis/fn-impact.d.ts +3 -1
- package/dist/domain/analysis/fn-impact.d.ts.map +1 -1
- package/dist/domain/analysis/fn-impact.js +4 -0
- package/dist/domain/analysis/fn-impact.js.map +1 -1
- package/dist/domain/analysis/implementations.d.ts +2 -2
- package/dist/domain/analysis/module-map.d.ts.map +1 -1
- package/dist/domain/analysis/module-map.js +32 -5
- package/dist/domain/analysis/module-map.js.map +1 -1
- package/dist/domain/analysis/roles.d.ts +7 -1
- package/dist/domain/analysis/roles.d.ts.map +1 -1
- package/dist/domain/analysis/roles.js +16 -0
- package/dist/domain/analysis/roles.js.map +1 -1
- package/dist/domain/analysis/symbol-lookup.d.ts +4 -4
- package/dist/domain/graph/builder/call-resolver.d.ts +29 -13
- package/dist/domain/graph/builder/call-resolver.d.ts.map +1 -1
- package/dist/domain/graph/builder/call-resolver.js +125 -205
- package/dist/domain/graph/builder/call-resolver.js.map +1 -1
- package/dist/domain/graph/builder/cha.d.ts +9 -1
- package/dist/domain/graph/builder/cha.d.ts.map +1 -1
- package/dist/domain/graph/builder/cha.js +17 -2
- package/dist/domain/graph/builder/cha.js.map +1 -1
- package/dist/domain/graph/builder/context.d.ts +1 -0
- package/dist/domain/graph/builder/context.d.ts.map +1 -1
- package/dist/domain/graph/builder/context.js.map +1 -1
- package/dist/domain/graph/builder/helpers.d.ts +24 -1
- package/dist/domain/graph/builder/helpers.d.ts.map +1 -1
- package/dist/domain/graph/builder/helpers.js +174 -65
- package/dist/domain/graph/builder/helpers.js.map +1 -1
- package/dist/domain/graph/builder/incremental.d.ts.map +1 -1
- package/dist/domain/graph/builder/incremental.js +166 -97
- package/dist/domain/graph/builder/incremental.js.map +1 -1
- package/dist/domain/graph/builder/pipeline.d.ts.map +1 -1
- package/dist/domain/graph/builder/pipeline.js +46 -5
- package/dist/domain/graph/builder/pipeline.js.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.d.ts +0 -2
- package/dist/domain/graph/builder/stages/build-edges.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/build-edges.js +554 -538
- package/dist/domain/graph/builder/stages/build-edges.js.map +1 -1
- package/dist/domain/graph/builder/stages/collect-files.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/collect-files.js +10 -7
- package/dist/domain/graph/builder/stages/collect-files.js.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/detect-changes.js +3 -2
- package/dist/domain/graph/builder/stages/detect-changes.js.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/finalize.js +4 -0
- package/dist/domain/graph/builder/stages/finalize.js.map +1 -1
- package/dist/domain/graph/builder/stages/native-orchestrator.d.ts.map +1 -1
- package/dist/domain/graph/builder/stages/native-orchestrator.js +952 -343
- package/dist/domain/graph/builder/stages/native-orchestrator.js.map +1 -1
- package/dist/domain/graph/builder/stages/resolve-imports.js +1 -1
- package/dist/domain/graph/builder/stages/resolve-imports.js.map +1 -1
- package/dist/domain/graph/resolver/points-to.d.ts.map +1 -1
- package/dist/domain/graph/resolver/points-to.js +105 -57
- package/dist/domain/graph/resolver/points-to.js.map +1 -1
- 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/watcher.d.ts.map +1 -1
- package/dist/domain/graph/watcher.js +16 -9
- package/dist/domain/graph/watcher.js.map +1 -1
- package/dist/domain/parser.d.ts +16 -5
- package/dist/domain/parser.d.ts.map +1 -1
- package/dist/domain/parser.js +58 -17
- package/dist/domain/parser.js.map +1 -1
- package/dist/domain/queries.d.ts +1 -1
- package/dist/domain/queries.d.ts.map +1 -1
- package/dist/domain/queries.js +1 -1
- package/dist/domain/queries.js.map +1 -1
- package/dist/domain/wasm-worker-entry.js +13 -2
- package/dist/domain/wasm-worker-entry.js.map +1 -1
- package/dist/domain/wasm-worker-pool.d.ts.map +1 -1
- package/dist/domain/wasm-worker-pool.js +26 -5
- package/dist/domain/wasm-worker-pool.js.map +1 -1
- package/dist/domain/wasm-worker-protocol.d.ts +8 -0
- package/dist/domain/wasm-worker-protocol.d.ts.map +1 -1
- package/dist/extractors/cpp.d.ts.map +1 -1
- package/dist/extractors/cpp.js +42 -1
- package/dist/extractors/cpp.js.map +1 -1
- package/dist/extractors/cuda.d.ts.map +1 -1
- package/dist/extractors/cuda.js +42 -1
- package/dist/extractors/cuda.js.map +1 -1
- package/dist/extractors/dart.js +48 -3
- package/dist/extractors/dart.js.map +1 -1
- package/dist/extractors/groovy.js +62 -3
- package/dist/extractors/groovy.js.map +1 -1
- package/dist/extractors/helpers.d.ts +15 -2
- package/dist/extractors/helpers.d.ts.map +1 -1
- package/dist/extractors/helpers.js +45 -1
- package/dist/extractors/helpers.js.map +1 -1
- package/dist/extractors/java.d.ts.map +1 -1
- package/dist/extractors/java.js +85 -8
- package/dist/extractors/java.js.map +1 -1
- package/dist/extractors/javascript.d.ts.map +1 -1
- package/dist/extractors/javascript.js +686 -169
- package/dist/extractors/javascript.js.map +1 -1
- package/dist/extractors/kotlin.js +58 -3
- package/dist/extractors/kotlin.js.map +1 -1
- package/dist/extractors/objc.js +25 -2
- package/dist/extractors/objc.js.map +1 -1
- package/dist/extractors/scala.js +62 -2
- package/dist/extractors/scala.js.map +1 -1
- package/dist/extractors/swift.js +52 -3
- package/dist/extractors/swift.js.map +1 -1
- package/dist/features/audit.js +26 -23
- package/dist/features/audit.js.map +1 -1
- package/dist/features/boundaries.d.ts.map +1 -1
- package/dist/features/boundaries.js +12 -9
- package/dist/features/boundaries.js.map +1 -1
- package/dist/features/cfg.d.ts.map +1 -1
- package/dist/features/cfg.js +25 -18
- package/dist/features/cfg.js.map +1 -1
- package/dist/features/check.d.ts.map +1 -1
- package/dist/features/check.js +18 -5
- package/dist/features/check.js.map +1 -1
- package/dist/features/communities.d.ts +4 -2
- package/dist/features/communities.d.ts.map +1 -1
- package/dist/features/communities.js +6 -4
- package/dist/features/communities.js.map +1 -1
- package/dist/features/dataflow.d.ts +60 -0
- package/dist/features/dataflow.d.ts.map +1 -1
- package/dist/features/dataflow.js +530 -6
- package/dist/features/dataflow.js.map +1 -1
- package/dist/features/manifesto.d.ts.map +1 -1
- package/dist/features/manifesto.js +59 -72
- package/dist/features/manifesto.js.map +1 -1
- package/dist/features/sequence.d.ts.map +1 -1
- package/dist/features/sequence.js +27 -22
- package/dist/features/sequence.js.map +1 -1
- package/dist/features/snapshot.d.ts.map +1 -1
- package/dist/features/snapshot.js +36 -28
- package/dist/features/snapshot.js.map +1 -1
- package/dist/features/structure-query.d.ts +1 -1
- package/dist/features/structure-query.d.ts.map +1 -1
- package/dist/features/structure-query.js +6 -6
- package/dist/features/structure-query.js.map +1 -1
- package/dist/features/structure.d.ts.map +1 -1
- package/dist/features/structure.js +150 -62
- package/dist/features/structure.js.map +1 -1
- package/dist/features/triage.d.ts.map +1 -1
- package/dist/features/triage.js +18 -11
- package/dist/features/triage.js.map +1 -1
- package/dist/graph/algorithms/bfs.d.ts +1 -1
- package/dist/graph/algorithms/bfs.d.ts.map +1 -1
- package/dist/graph/algorithms/bfs.js +14 -13
- package/dist/graph/algorithms/bfs.js.map +1 -1
- package/dist/graph/algorithms/tarjan.d.ts.map +1 -1
- package/dist/graph/algorithms/tarjan.js +5 -0
- package/dist/graph/algorithms/tarjan.js.map +1 -1
- package/dist/graph/builders/dependency.js +28 -22
- package/dist/graph/builders/dependency.js.map +1 -1
- package/dist/graph/classifiers/roles.d.ts +10 -1
- package/dist/graph/classifiers/roles.d.ts.map +1 -1
- package/dist/graph/classifiers/roles.js +60 -6
- package/dist/graph/classifiers/roles.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/infrastructure/config.d.ts +87 -4
- package/dist/infrastructure/config.d.ts.map +1 -1
- package/dist/infrastructure/config.js +424 -22
- package/dist/infrastructure/config.js.map +1 -1
- package/dist/infrastructure/registry.d.ts +27 -7
- package/dist/infrastructure/registry.d.ts.map +1 -1
- package/dist/infrastructure/registry.js +79 -5
- package/dist/infrastructure/registry.js.map +1 -1
- package/dist/infrastructure/update-check.d.ts.map +1 -1
- package/dist/infrastructure/update-check.js +49 -31
- package/dist/infrastructure/update-check.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -10
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/ast-query.d.ts +1 -1
- package/dist/mcp/tools/ast-query.d.ts.map +1 -1
- package/dist/mcp/tools/audit.d.ts +1 -1
- package/dist/mcp/tools/audit.d.ts.map +1 -1
- package/dist/mcp/tools/batch-query.d.ts +1 -1
- package/dist/mcp/tools/batch-query.d.ts.map +1 -1
- package/dist/mcp/tools/branch-compare.d.ts +1 -1
- package/dist/mcp/tools/branch-compare.d.ts.map +1 -1
- package/dist/mcp/tools/brief.d.ts +1 -1
- package/dist/mcp/tools/brief.d.ts.map +1 -1
- package/dist/mcp/tools/cfg.d.ts +1 -1
- package/dist/mcp/tools/cfg.d.ts.map +1 -1
- package/dist/mcp/tools/check.d.ts +1 -1
- package/dist/mcp/tools/check.d.ts.map +1 -1
- package/dist/mcp/tools/co-changes.d.ts +1 -1
- package/dist/mcp/tools/co-changes.d.ts.map +1 -1
- package/dist/mcp/tools/code-owners.d.ts +1 -1
- package/dist/mcp/tools/code-owners.d.ts.map +1 -1
- package/dist/mcp/tools/communities.d.ts +1 -1
- package/dist/mcp/tools/communities.d.ts.map +1 -1
- package/dist/mcp/tools/complexity.d.ts +1 -1
- package/dist/mcp/tools/complexity.d.ts.map +1 -1
- package/dist/mcp/tools/context.d.ts +1 -1
- package/dist/mcp/tools/context.d.ts.map +1 -1
- package/dist/mcp/tools/dataflow.d.ts +1 -1
- package/dist/mcp/tools/dataflow.d.ts.map +1 -1
- package/dist/mcp/tools/diff-impact.d.ts +1 -1
- package/dist/mcp/tools/diff-impact.d.ts.map +1 -1
- package/dist/mcp/tools/execution-flow.d.ts +1 -1
- package/dist/mcp/tools/execution-flow.d.ts.map +1 -1
- package/dist/mcp/tools/export-graph.d.ts +1 -1
- package/dist/mcp/tools/export-graph.d.ts.map +1 -1
- package/dist/mcp/tools/file-deps.d.ts +1 -1
- package/dist/mcp/tools/file-deps.d.ts.map +1 -1
- package/dist/mcp/tools/file-exports.d.ts +1 -1
- package/dist/mcp/tools/file-exports.d.ts.map +1 -1
- package/dist/mcp/tools/find-cycles.d.ts +1 -1
- package/dist/mcp/tools/find-cycles.d.ts.map +1 -1
- package/dist/mcp/tools/fn-impact.d.ts +1 -1
- package/dist/mcp/tools/fn-impact.d.ts.map +1 -1
- package/dist/mcp/tools/impact-analysis.d.ts +1 -1
- package/dist/mcp/tools/impact-analysis.d.ts.map +1 -1
- package/dist/mcp/tools/implementations.d.ts +1 -1
- package/dist/mcp/tools/implementations.d.ts.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -5
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/interfaces.d.ts +1 -1
- package/dist/mcp/tools/interfaces.d.ts.map +1 -1
- package/dist/mcp/tools/list-functions.d.ts +1 -1
- package/dist/mcp/tools/list-functions.d.ts.map +1 -1
- package/dist/mcp/tools/list-repos.d.ts +1 -1
- package/dist/mcp/tools/list-repos.d.ts.map +1 -1
- package/dist/mcp/tools/module-map.d.ts +1 -1
- package/dist/mcp/tools/module-map.d.ts.map +1 -1
- package/dist/mcp/tools/node-roles.d.ts +1 -1
- package/dist/mcp/tools/node-roles.d.ts.map +1 -1
- package/dist/mcp/tools/path.d.ts +1 -1
- package/dist/mcp/tools/path.d.ts.map +1 -1
- package/dist/mcp/tools/query.d.ts +1 -1
- package/dist/mcp/tools/query.d.ts.map +1 -1
- package/dist/mcp/tools/semantic-search.d.ts +1 -1
- package/dist/mcp/tools/semantic-search.d.ts.map +1 -1
- package/dist/mcp/tools/sequence.d.ts +1 -1
- package/dist/mcp/tools/sequence.d.ts.map +1 -1
- package/dist/mcp/tools/structure.d.ts +1 -1
- package/dist/mcp/tools/structure.d.ts.map +1 -1
- package/dist/mcp/tools/symbol-children.d.ts +1 -1
- package/dist/mcp/tools/symbol-children.d.ts.map +1 -1
- package/dist/mcp/tools/triage.d.ts +1 -1
- package/dist/mcp/tools/triage.d.ts.map +1 -1
- package/dist/mcp/tools/where.d.ts +1 -1
- package/dist/mcp/tools/where.d.ts.map +1 -1
- 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/queries-cli/index.d.ts +1 -1
- package/dist/presentation/queries-cli/index.d.ts.map +1 -1
- package/dist/presentation/queries-cli/index.js +1 -1
- package/dist/presentation/queries-cli/index.js.map +1 -1
- package/dist/presentation/queries-cli/overview.d.ts +1 -0
- package/dist/presentation/queries-cli/overview.d.ts.map +1 -1
- package/dist/presentation/queries-cli/overview.js +20 -1
- package/dist/presentation/queries-cli/overview.js.map +1 -1
- package/dist/presentation/queries-cli.d.ts +1 -1
- package/dist/presentation/queries-cli.d.ts.map +1 -1
- package/dist/presentation/queries-cli.js +1 -1
- package/dist/presentation/queries-cli.js.map +1 -1
- package/dist/presentation/structure.d.ts +1 -1
- package/dist/presentation/structure.d.ts.map +1 -1
- package/dist/presentation/structure.js +2 -2
- package/dist/presentation/structure.js.map +1 -1
- package/dist/presentation/viewer.d.ts.map +1 -1
- package/dist/presentation/viewer.js +45 -32
- package/dist/presentation/viewer.js.map +1 -1
- package/dist/shared/constants.d.ts +21 -0
- package/dist/shared/constants.d.ts.map +1 -1
- package/dist/shared/constants.js +25 -0
- package/dist/shared/constants.js.map +1 -1
- package/dist/shared/normalize.d.ts.map +1 -1
- package/dist/shared/normalize.js +12 -22
- package/dist/shared/normalize.js.map +1 -1
- package/dist/shared/paginate.d.ts +4 -17
- package/dist/shared/paginate.d.ts.map +1 -1
- package/dist/shared/paginate.js.map +1 -1
- package/dist/types.d.ts +113 -1
- package/dist/types.d.ts.map +1 -1
- package/grammars/tree-sitter-erlang.wasm +0 -0
- package/grammars/tree-sitter-gleam.wasm +0 -0
- package/package.json +7 -8
- package/src/ast-analysis/engine.ts +43 -63
- 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/index.ts +34 -0
- package/src/ast-analysis/rules/javascript.ts +3 -0
- package/src/ast-analysis/shared.ts +2 -0
- package/src/ast-analysis/visitor-utils.ts +5 -0
- package/src/ast-analysis/visitor.ts +82 -52
- package/src/ast-analysis/visitors/cfg-visitor.ts +198 -84
- package/src/ast-analysis/visitors/complexity-visitor.ts +44 -16
- package/src/ast-analysis/visitors/dataflow-visitor.ts +68 -29
- package/src/cli/commands/audit.ts +2 -1
- package/src/cli/commands/batch.ts +1 -0
- package/src/cli/commands/build.ts +6 -1
- package/src/cli/commands/config.ts +353 -0
- package/src/cli/commands/roles.ts +6 -1
- package/src/cli/commands/triage.ts +1 -1
- package/src/cli/index.ts +10 -0
- package/src/cli/shared/options.ts +11 -1
- package/src/cli/types.ts +2 -0
- package/src/db/better-sqlite3.ts +5 -4
- package/src/db/connection.ts +23 -5
- package/src/db/index.ts +1 -0
- package/src/db/migrations.ts +69 -1
- package/src/db/repository/build-stmts.ts +30 -0
- package/src/db/repository/dataflow.ts +16 -0
- package/src/db/repository/index.ts +1 -1
- package/src/db/repository/native-repository.ts +56 -40
- package/src/domain/analysis/fn-impact.ts +4 -0
- package/src/domain/analysis/module-map.ts +38 -6
- package/src/domain/analysis/roles.ts +23 -0
- package/src/domain/graph/builder/call-resolver.ts +156 -218
- package/src/domain/graph/builder/cha.ts +18 -1
- package/src/domain/graph/builder/context.ts +1 -0
- package/src/domain/graph/builder/helpers.ts +205 -67
- package/src/domain/graph/builder/incremental.ts +249 -119
- package/src/domain/graph/builder/pipeline.ts +59 -6
- package/src/domain/graph/builder/stages/build-edges.ts +783 -652
- package/src/domain/graph/builder/stages/collect-files.ts +12 -6
- package/src/domain/graph/builder/stages/detect-changes.ts +4 -2
- package/src/domain/graph/builder/stages/finalize.ts +4 -0
- package/src/domain/graph/builder/stages/native-orchestrator.ts +1214 -398
- package/src/domain/graph/builder/stages/resolve-imports.ts +1 -1
- package/src/domain/graph/resolver/points-to.ts +182 -59
- package/src/domain/graph/resolver/strategy.ts +265 -0
- package/src/domain/graph/watcher.ts +19 -9
- package/src/domain/parser.ts +57 -16
- package/src/domain/queries.ts +1 -1
- package/src/domain/wasm-worker-entry.ts +13 -2
- package/src/domain/wasm-worker-pool.ts +29 -4
- package/src/domain/wasm-worker-protocol.ts +5 -0
- package/src/extractors/cpp.ts +44 -1
- package/src/extractors/cuda.ts +44 -1
- package/src/extractors/dart.ts +48 -3
- package/src/extractors/groovy.ts +62 -2
- package/src/extractors/helpers.ts +48 -2
- package/src/extractors/java.ts +88 -8
- package/src/extractors/javascript.ts +693 -167
- package/src/extractors/kotlin.ts +57 -3
- package/src/extractors/objc.ts +25 -1
- package/src/extractors/scala.ts +63 -1
- package/src/extractors/swift.ts +46 -3
- package/src/features/audit.ts +43 -34
- package/src/features/boundaries.ts +17 -9
- package/src/features/cfg.ts +31 -22
- package/src/features/check.ts +21 -5
- package/src/features/communities.ts +28 -19
- package/src/features/dataflow.ts +755 -6
- package/src/features/manifesto.ts +76 -75
- package/src/features/sequence.ts +29 -23
- package/src/features/snapshot.ts +36 -25
- package/src/features/structure-query.ts +7 -7
- package/src/features/structure.ts +185 -55
- package/src/features/triage.ts +28 -15
- package/src/graph/algorithms/bfs.ts +13 -12
- package/src/graph/algorithms/tarjan.ts +5 -0
- package/src/graph/builders/dependency.ts +35 -23
- package/src/graph/classifiers/roles.ts +74 -7
- package/src/index.ts +5 -1
- package/src/infrastructure/config.ts +511 -23
- package/src/infrastructure/registry.ts +117 -12
- package/src/infrastructure/update-check.ts +55 -33
- package/src/mcp/server.ts +2 -8
- package/src/mcp/tools/ast-query.ts +1 -1
- package/src/mcp/tools/audit.ts +1 -1
- package/src/mcp/tools/batch-query.ts +1 -1
- package/src/mcp/tools/branch-compare.ts +1 -1
- package/src/mcp/tools/brief.ts +1 -1
- package/src/mcp/tools/cfg.ts +1 -1
- package/src/mcp/tools/check.ts +1 -1
- package/src/mcp/tools/co-changes.ts +1 -1
- package/src/mcp/tools/code-owners.ts +1 -1
- package/src/mcp/tools/communities.ts +1 -1
- package/src/mcp/tools/complexity.ts +1 -1
- package/src/mcp/tools/context.ts +1 -1
- package/src/mcp/tools/dataflow.ts +1 -1
- package/src/mcp/tools/diff-impact.ts +1 -1
- package/src/mcp/tools/execution-flow.ts +1 -1
- package/src/mcp/tools/export-graph.ts +1 -1
- package/src/mcp/tools/file-deps.ts +1 -1
- package/src/mcp/tools/file-exports.ts +1 -1
- package/src/mcp/tools/find-cycles.ts +1 -1
- package/src/mcp/tools/fn-impact.ts +1 -1
- package/src/mcp/tools/impact-analysis.ts +1 -1
- package/src/mcp/tools/implementations.ts +1 -1
- package/src/mcp/tools/index.ts +2 -5
- package/src/mcp/tools/interfaces.ts +1 -1
- package/src/mcp/tools/list-functions.ts +1 -1
- package/src/mcp/tools/list-repos.ts +1 -1
- package/src/mcp/tools/module-map.ts +1 -1
- package/src/mcp/tools/node-roles.ts +1 -1
- package/src/mcp/tools/path.ts +1 -1
- package/src/mcp/tools/query.ts +1 -1
- package/src/mcp/tools/semantic-search.ts +1 -1
- package/src/mcp/tools/sequence.ts +1 -1
- package/src/mcp/tools/structure.ts +1 -1
- package/src/mcp/tools/symbol-children.ts +1 -1
- package/src/mcp/tools/triage.ts +1 -1
- package/src/mcp/tools/where.ts +1 -1
- package/src/mcp/types.ts +21 -0
- package/src/presentation/queries-cli/index.ts +1 -1
- package/src/presentation/queries-cli/overview.ts +35 -1
- package/src/presentation/queries-cli.ts +1 -0
- package/src/presentation/structure.ts +3 -3
- package/src/presentation/viewer.ts +98 -87
- package/src/shared/constants.ts +26 -0
- package/src/shared/normalize.ts +13 -22
- package/src/shared/paginate.ts +4 -18
- package/src/types.ts +127 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
2
|
import os from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import type { ConsentDecision } from '../types.js';
|
|
4
5
|
import { debug, warn } from './logger.js';
|
|
5
6
|
|
|
6
7
|
export const REGISTRY_PATH: string =
|
|
@@ -16,8 +17,15 @@ interface RegistryEntry {
|
|
|
16
17
|
lastAccessedAt?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface UserConfigSection {
|
|
21
|
+
/** Per-repo consent decisions keyed by absolute repo path. */
|
|
22
|
+
consent: Record<string, ConsentDecision>;
|
|
23
|
+
}
|
|
24
|
+
|
|
19
25
|
interface Registry {
|
|
20
26
|
repos: Record<string, RegistryEntry>;
|
|
27
|
+
/** User-level global config consent store — separate from MCP repo listings. */
|
|
28
|
+
userConfig?: UserConfigSection;
|
|
21
29
|
}
|
|
22
30
|
|
|
23
31
|
/**
|
|
@@ -160,6 +168,67 @@ export function resolveRepoDbPath(
|
|
|
160
168
|
return entry.dbPath;
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
// ── User-config consent ────────────────────────────────────────────────
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Read the per-repo consent decision for the global user config.
|
|
175
|
+
* Returns `undefined` when the repo is undecided (no recorded decision).
|
|
176
|
+
*/
|
|
177
|
+
export function getUserConfigConsent(
|
|
178
|
+
rootDir: string,
|
|
179
|
+
registryPath: string = REGISTRY_PATH,
|
|
180
|
+
): ConsentDecision | undefined {
|
|
181
|
+
const registry = loadRegistry(registryPath);
|
|
182
|
+
const absRoot = path.resolve(rootDir);
|
|
183
|
+
return registry.userConfig?.consent?.[absRoot];
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Persist a per-repo consent decision. Atomic write via temp+rename.
|
|
188
|
+
*/
|
|
189
|
+
export function setUserConfigConsent(
|
|
190
|
+
rootDir: string,
|
|
191
|
+
decision: ConsentDecision,
|
|
192
|
+
registryPath: string = REGISTRY_PATH,
|
|
193
|
+
): void {
|
|
194
|
+
const registry = loadRegistry(registryPath);
|
|
195
|
+
const absRoot = path.resolve(rootDir);
|
|
196
|
+
if (!registry.userConfig) registry.userConfig = { consent: {} };
|
|
197
|
+
if (!registry.userConfig.consent) registry.userConfig.consent = {};
|
|
198
|
+
registry.userConfig.consent[absRoot] = decision;
|
|
199
|
+
saveRegistry(registry, registryPath);
|
|
200
|
+
debug(`User-config consent for "${absRoot}" set to "${decision}"`);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* List every repo with a recorded consent decision, sorted by path.
|
|
205
|
+
*/
|
|
206
|
+
export function listUserConfigConsent(
|
|
207
|
+
registryPath: string = REGISTRY_PATH,
|
|
208
|
+
): Array<{ path: string; decision: ConsentDecision }> {
|
|
209
|
+
const registry = loadRegistry(registryPath);
|
|
210
|
+
const consent = registry.userConfig?.consent ?? {};
|
|
211
|
+
return Object.entries(consent)
|
|
212
|
+
.map(([p, decision]) => ({ path: p, decision }))
|
|
213
|
+
.sort((a, b) => a.path.localeCompare(b.path));
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Revert a repo to undecided state. Returns true if a decision was removed.
|
|
218
|
+
*/
|
|
219
|
+
export function clearUserConfigConsent(
|
|
220
|
+
rootDir: string,
|
|
221
|
+
registryPath: string = REGISTRY_PATH,
|
|
222
|
+
): boolean {
|
|
223
|
+
const registry = loadRegistry(registryPath);
|
|
224
|
+
const absRoot = path.resolve(rootDir);
|
|
225
|
+
const consent = registry.userConfig?.consent;
|
|
226
|
+
if (!consent || !(absRoot in consent)) return false;
|
|
227
|
+
delete consent[absRoot];
|
|
228
|
+
saveRegistry(registry, registryPath);
|
|
229
|
+
return true;
|
|
230
|
+
}
|
|
231
|
+
|
|
163
232
|
interface PrunedEntry {
|
|
164
233
|
name: string;
|
|
165
234
|
path: string;
|
|
@@ -173,19 +242,18 @@ interface PrunedEntry {
|
|
|
173
242
|
*
|
|
174
243
|
* When `dryRun` is true, entries are identified but not removed from disk.
|
|
175
244
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
245
|
+
/**
|
|
246
|
+
* Walk `registry.repos`, identify entries that are missing on disk or have
|
|
247
|
+
* exceeded the TTL, and optionally delete them (when `dryRun` is false).
|
|
248
|
+
* Returns the list of entries that were (or would be) pruned.
|
|
249
|
+
*/
|
|
250
|
+
function pruneRepoEntries(
|
|
251
|
+
registry: Registry,
|
|
252
|
+
cutoff: number,
|
|
253
|
+
excludeSet: Set<string>,
|
|
254
|
+
dryRun: boolean,
|
|
181
255
|
): PrunedEntry[] {
|
|
182
|
-
const registry = loadRegistry(registryPath);
|
|
183
256
|
const pruned: PrunedEntry[] = [];
|
|
184
|
-
const cutoff = Date.now() - ttlDays * 24 * 60 * 60 * 1000;
|
|
185
|
-
const excludeSet = new Set(
|
|
186
|
-
excludeNames.filter((n) => typeof n === 'string' && n.trim().length > 0),
|
|
187
|
-
);
|
|
188
|
-
|
|
189
257
|
for (const [name, entry] of Object.entries(registry.repos)) {
|
|
190
258
|
if (excludeSet.has(name)) continue;
|
|
191
259
|
if (!fs.existsSync(entry.path)) {
|
|
@@ -199,8 +267,45 @@ export function pruneRegistry(
|
|
|
199
267
|
if (!dryRun) delete registry.repos[name];
|
|
200
268
|
}
|
|
201
269
|
}
|
|
270
|
+
return pruned;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Prune consent entries whose repo paths no longer exist on disk.
|
|
275
|
+
* Consent entries are TTL-exempt — only the missing-path rule applies.
|
|
276
|
+
* Returns true when at least one entry was removed.
|
|
277
|
+
*/
|
|
278
|
+
function pruneConsentEntries(consent: Record<string, ConsentDecision>): boolean {
|
|
279
|
+
let changed = false;
|
|
280
|
+
for (const p of Object.keys(consent)) {
|
|
281
|
+
if (!fs.existsSync(p)) {
|
|
282
|
+
delete consent[p];
|
|
283
|
+
changed = true;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return changed;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export function pruneRegistry(
|
|
290
|
+
registryPath: string = REGISTRY_PATH,
|
|
291
|
+
ttlDays: number = DEFAULT_TTL_DAYS,
|
|
292
|
+
excludeNames: string[] = [],
|
|
293
|
+
dryRun = false,
|
|
294
|
+
): PrunedEntry[] {
|
|
295
|
+
const registry = loadRegistry(registryPath);
|
|
296
|
+
const cutoff = Date.now() - ttlDays * 24 * 60 * 60 * 1000;
|
|
297
|
+
const excludeSet = new Set(
|
|
298
|
+
excludeNames.filter((n) => typeof n === 'string' && n.trim().length > 0),
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
const pruned = pruneRepoEntries(registry, cutoff, excludeSet, dryRun);
|
|
302
|
+
|
|
303
|
+
const consentChanged =
|
|
304
|
+
!dryRun && registry.userConfig?.consent
|
|
305
|
+
? pruneConsentEntries(registry.userConfig.consent)
|
|
306
|
+
: false;
|
|
202
307
|
|
|
203
|
-
if (!dryRun && pruned.length > 0) {
|
|
308
|
+
if (!dryRun && (pruned.length > 0 || consentChanged)) {
|
|
204
309
|
saveRegistry(registry, registryPath);
|
|
205
310
|
}
|
|
206
311
|
|
|
@@ -61,6 +61,33 @@ function saveCache(cache: UpdateCache, cachePath: string = CACHE_PATH): void {
|
|
|
61
61
|
fs.renameSync(tmp, cachePath);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Collect the full response body from an IncomingMessage stream.
|
|
66
|
+
* Resolves with the body string, or null on parse/status error.
|
|
67
|
+
*/
|
|
68
|
+
function collectResponseBody(res: import('node:http').IncomingMessage): Promise<string | null> {
|
|
69
|
+
return new Promise((resolve) => {
|
|
70
|
+
if (res.statusCode !== 200) {
|
|
71
|
+
res.resume();
|
|
72
|
+
resolve(null);
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
let body = '';
|
|
76
|
+
res.setEncoding('utf-8');
|
|
77
|
+
res.on('data', (chunk: string) => {
|
|
78
|
+
body += chunk;
|
|
79
|
+
});
|
|
80
|
+
res.on('end', () => {
|
|
81
|
+
try {
|
|
82
|
+
const data = JSON.parse(body);
|
|
83
|
+
resolve(typeof data.version === 'string' ? data.version : null);
|
|
84
|
+
} catch {
|
|
85
|
+
resolve(null);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
64
91
|
/**
|
|
65
92
|
* Fetch the latest version string from the npm registry.
|
|
66
93
|
* Returns the version string or null on failure.
|
|
@@ -71,24 +98,7 @@ function fetchLatestVersion(): Promise<string | null> {
|
|
|
71
98
|
REGISTRY_URL,
|
|
72
99
|
{ timeout: FETCH_TIMEOUT_MS, headers: { Accept: 'application/json' } },
|
|
73
100
|
(res) => {
|
|
74
|
-
|
|
75
|
-
res.resume();
|
|
76
|
-
resolve(null);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
let body = '';
|
|
80
|
-
res.setEncoding('utf-8');
|
|
81
|
-
res.on('data', (chunk: string) => {
|
|
82
|
-
body += chunk;
|
|
83
|
-
});
|
|
84
|
-
res.on('end', () => {
|
|
85
|
-
try {
|
|
86
|
-
const data = JSON.parse(body);
|
|
87
|
-
resolve(typeof data.version === 'string' ? data.version : null);
|
|
88
|
-
} catch {
|
|
89
|
-
resolve(null);
|
|
90
|
-
}
|
|
91
|
-
});
|
|
101
|
+
collectResponseBody(res).then(resolve);
|
|
92
102
|
},
|
|
93
103
|
);
|
|
94
104
|
req.on('error', () => resolve(null));
|
|
@@ -109,6 +119,32 @@ interface CheckForUpdatesOptions {
|
|
|
109
119
|
_fetchLatest?: () => Promise<string | null>;
|
|
110
120
|
}
|
|
111
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Return the latest version from cache if fresh, or fetch it from the registry.
|
|
124
|
+
* Persists the fetched version to the cache only when a network fetch occurs
|
|
125
|
+
* (i.e. the cache is stale or missing). Returns the cached value directly
|
|
126
|
+
* without updating the cache when the cache is still within `CACHE_TTL_MS`.
|
|
127
|
+
* Returns null when the network fetch fails or the cache is corrupt.
|
|
128
|
+
*/
|
|
129
|
+
async function resolveLatestVersion(
|
|
130
|
+
cachePath: string,
|
|
131
|
+
fetchFn: () => Promise<string | null>,
|
|
132
|
+
): Promise<string | null> {
|
|
133
|
+
const cache = loadCache(cachePath);
|
|
134
|
+
|
|
135
|
+
if (cache && Date.now() - cache.lastCheckedAt < CACHE_TTL_MS) {
|
|
136
|
+
// Cache is fresh — use stored value directly
|
|
137
|
+
return cache.latestVersion;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Cache is stale or missing — fetch from registry
|
|
141
|
+
const latest = await fetchFn();
|
|
142
|
+
if (!latest) return null;
|
|
143
|
+
|
|
144
|
+
saveCache({ lastCheckedAt: Date.now(), latestVersion: latest }, cachePath);
|
|
145
|
+
return latest;
|
|
146
|
+
}
|
|
147
|
+
|
|
112
148
|
/**
|
|
113
149
|
* Check whether a newer version of codegraph is available.
|
|
114
150
|
*
|
|
@@ -129,23 +165,9 @@ export async function checkForUpdates(
|
|
|
129
165
|
const fetchFn = options._fetchLatest || fetchLatestVersion;
|
|
130
166
|
|
|
131
167
|
try {
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
// Cache is fresh — use it
|
|
135
|
-
if (cache && Date.now() - cache.lastCheckedAt < CACHE_TTL_MS) {
|
|
136
|
-
if (semverCompare(currentVersion, cache.latestVersion) < 0) {
|
|
137
|
-
return { current: currentVersion, latest: cache.latestVersion };
|
|
138
|
-
}
|
|
139
|
-
return null;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Cache is stale or missing — fetch
|
|
143
|
-
const latest = await fetchFn();
|
|
168
|
+
const latest = await resolveLatestVersion(cachePath, fetchFn);
|
|
144
169
|
if (!latest) return null;
|
|
145
170
|
|
|
146
|
-
// Update cache regardless of result
|
|
147
|
-
saveCache({ lastCheckedAt: Date.now(), latestVersion: latest }, cachePath);
|
|
148
|
-
|
|
149
171
|
if (semverCompare(currentVersion, latest) < 0) {
|
|
150
172
|
return { current: currentVersion, latest };
|
|
151
173
|
}
|
package/src/mcp/server.ts
CHANGED
|
@@ -20,6 +20,7 @@ import type { CodegraphConfig, MCPServerOptions } from '../types.js';
|
|
|
20
20
|
import { initMcpDefaults } from './middleware.js';
|
|
21
21
|
import { buildToolList } from './tool-registry.js';
|
|
22
22
|
import { TOOL_HANDLERS } from './tools/index.js';
|
|
23
|
+
import type { McpToolContext } from './types.js';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* Module-level guard to register shutdown handlers only once per process.
|
|
@@ -28,14 +29,7 @@ import { TOOL_HANDLERS } from './tools/index.js';
|
|
|
28
29
|
*/
|
|
29
30
|
let _activeServer: any = null;
|
|
30
31
|
|
|
31
|
-
export
|
|
32
|
-
dbPath: string | undefined;
|
|
33
|
-
getQueries(): Promise<any>;
|
|
34
|
-
getDatabase(): any;
|
|
35
|
-
findDbPath: typeof findDbPath;
|
|
36
|
-
allowedRepos: string[] | undefined;
|
|
37
|
-
MCP_MAX_LIMIT: number;
|
|
38
|
-
}
|
|
32
|
+
export type { McpToolContext };
|
|
39
33
|
|
|
40
34
|
interface MCPServerOptionsInternal extends MCPServerOptions {
|
|
41
35
|
config?: CodegraphConfig;
|
package/src/mcp/tools/audit.ts
CHANGED
package/src/mcp/tools/brief.ts
CHANGED
package/src/mcp/tools/cfg.ts
CHANGED
package/src/mcp/tools/check.ts
CHANGED
package/src/mcp/tools/context.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { findDbPath } from '../../db/index.js';
|
|
2
2
|
import { effectiveOffset, MCP_DEFAULTS, MCP_MAX_LIMIT } from '../middleware.js';
|
|
3
|
-
import type { McpToolContext } from '../
|
|
3
|
+
import type { McpToolContext } from '../types.js';
|
|
4
4
|
|
|
5
5
|
export const name = 'export_graph';
|
|
6
6
|
|
package/src/mcp/tools/index.ts
CHANGED
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
* Barrel module — registers all MCP tool handlers.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import type {
|
|
5
|
+
import type { McpToolHandler } from '../types.js';
|
|
6
6
|
|
|
7
|
-
export
|
|
8
|
-
name: string;
|
|
9
|
-
handler(args: any, ctx: McpToolContext): Promise<unknown>;
|
|
10
|
-
}
|
|
7
|
+
export type { McpToolContext, McpToolHandler } from '../types.js';
|
|
11
8
|
|
|
12
9
|
import * as astQuery from './ast-query.js';
|
|
13
10
|
import * as audit from './audit.js';
|
package/src/mcp/tools/path.ts
CHANGED
package/src/mcp/tools/query.ts
CHANGED
package/src/mcp/tools/triage.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Role } from '../../types.js';
|
|
2
2
|
import { effectiveLimit, effectiveOffset, MCP_DEFAULTS, MCP_MAX_LIMIT } from '../middleware.js';
|
|
3
|
-
import type { McpToolContext } from '../
|
|
3
|
+
import type { McpToolContext } from '../types.js';
|
|
4
4
|
|
|
5
5
|
export const name = 'triage';
|
|
6
6
|
|
package/src/mcp/tools/where.ts
CHANGED
package/src/mcp/types.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared MCP types used by server.ts and all tool modules.
|
|
3
|
+
* Extracted here to break the circular dependency between server.ts and tools/index.ts.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type Database from 'better-sqlite3';
|
|
7
|
+
import type { findDbPath } from '../db/index.js';
|
|
8
|
+
|
|
9
|
+
export interface McpToolContext {
|
|
10
|
+
dbPath: string | undefined;
|
|
11
|
+
getQueries(): Promise<any>;
|
|
12
|
+
getDatabase(): typeof Database;
|
|
13
|
+
findDbPath: typeof findDbPath;
|
|
14
|
+
allowedRepos: string[] | undefined;
|
|
15
|
+
MCP_MAX_LIMIT: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface McpToolHandler {
|
|
19
|
+
name: string;
|
|
20
|
+
handler(args: any, ctx: McpToolContext): Promise<unknown>;
|
|
21
|
+
}
|