@codragraph/cli 1.6.2
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 +341 -0
- package/dist/_shared/graph/types.d.ts +81 -0
- package/dist/_shared/graph/types.d.ts.map +1 -0
- package/dist/_shared/graph/types.js +8 -0
- package/dist/_shared/graph/types.js.map +1 -0
- package/dist/_shared/index.d.ts +55 -0
- package/dist/_shared/index.d.ts.map +1 -0
- package/dist/_shared/index.js +39 -0
- package/dist/_shared/index.js.map +1 -0
- package/dist/_shared/language-detection.d.ts +23 -0
- package/dist/_shared/language-detection.d.ts.map +1 -0
- package/dist/_shared/language-detection.js +139 -0
- package/dist/_shared/language-detection.js.map +1 -0
- package/dist/_shared/languages.d.ts +26 -0
- package/dist/_shared/languages.d.ts.map +1 -0
- package/dist/_shared/languages.js +27 -0
- package/dist/_shared/languages.js.map +1 -0
- package/dist/_shared/lbug/schema-constants.d.ts +16 -0
- package/dist/_shared/lbug/schema-constants.d.ts.map +1 -0
- package/dist/_shared/lbug/schema-constants.js +67 -0
- package/dist/_shared/lbug/schema-constants.js.map +1 -0
- package/dist/_shared/mro-strategy.d.ts +41 -0
- package/dist/_shared/mro-strategy.d.ts.map +1 -0
- package/dist/_shared/mro-strategy.js +2 -0
- package/dist/_shared/mro-strategy.js.map +1 -0
- package/dist/_shared/pipeline.d.ts +16 -0
- package/dist/_shared/pipeline.d.ts.map +1 -0
- package/dist/_shared/pipeline.js +5 -0
- package/dist/_shared/pipeline.js.map +1 -0
- package/dist/_shared/scope-resolution/def-index.d.ts +36 -0
- package/dist/_shared/scope-resolution/def-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/def-index.js +51 -0
- package/dist/_shared/scope-resolution/def-index.js.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts +69 -0
- package/dist/_shared/scope-resolution/evidence-weights.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/evidence-weights.js +84 -0
- package/dist/_shared/scope-resolution/evidence-weights.js.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts +139 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js +479 -0
- package/dist/_shared/scope-resolution/finalize-algorithm.js.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts +26 -0
- package/dist/_shared/scope-resolution/language-classification.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/language-classification.js +44 -0
- package/dist/_shared/scope-resolution/language-classification.js.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts +80 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js +79 -0
- package/dist/_shared/scope-resolution/method-dispatch-index.js.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts +46 -0
- package/dist/_shared/scope-resolution/module-scope-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/module-scope-index.js +58 -0
- package/dist/_shared/scope-resolution/module-scope-index.js.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts +14 -0
- package/dist/_shared/scope-resolution/origin-priority.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/origin-priority.js +21 -0
- package/dist/_shared/scope-resolution/origin-priority.js.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts +76 -0
- package/dist/_shared/scope-resolution/parsed-file.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/parsed-file.js +54 -0
- package/dist/_shared/scope-resolution/parsed-file.js.map +1 -0
- package/dist/_shared/scope-resolution/position-index.d.ts +62 -0
- package/dist/_shared/scope-resolution/position-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/position-index.js +134 -0
- package/dist/_shared/scope-resolution/position-index.js.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts +44 -0
- package/dist/_shared/scope-resolution/qualified-name-index.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js +75 -0
- package/dist/_shared/scope-resolution/qualified-name-index.js.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts +75 -0
- package/dist/_shared/scope-resolution/reference-site.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/reference-site.js +24 -0
- package/dist/_shared/scope-resolution/reference-site.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts +27 -0
- package/dist/_shared/scope-resolution/registries/class-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js +30 -0
- package/dist/_shared/scope-resolution/registries/class-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts +69 -0
- package/dist/_shared/scope-resolution/registries/context.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/context.js +44 -0
- package/dist/_shared/scope-resolution/registries/context.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts +56 -0
- package/dist/_shared/scope-resolution/registries/evidence.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/evidence.js +150 -0
- package/dist/_shared/scope-resolution/registries/evidence.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts +26 -0
- package/dist/_shared/scope-resolution/registries/field-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js +31 -0
- package/dist/_shared/scope-resolution/registries/field-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts +81 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js +332 -0
- package/dist/_shared/scope-resolution/registries/lookup-core.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts +33 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js +56 -0
- package/dist/_shared/scope-resolution/registries/lookup-qualified.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts +36 -0
- package/dist/_shared/scope-resolution/registries/method-registry.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js +32 -0
- package/dist/_shared/scope-resolution/registries/method-registry.js.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts +43 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js +60 -0
- package/dist/_shared/scope-resolution/registries/tie-breaks.js.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts +53 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js +126 -0
- package/dist/_shared/scope-resolution/resolve-type-ref.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts +43 -0
- package/dist/_shared/scope-resolution/scope-id.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-id.js +46 -0
- package/dist/_shared/scope-resolution/scope-id.js.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts +61 -0
- package/dist/_shared/scope-resolution/scope-tree.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/scope-tree.js +186 -0
- package/dist/_shared/scope-resolution/scope-tree.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts +63 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js +122 -0
- package/dist/_shared/scope-resolution/shadow/aggregate.js.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts +59 -0
- package/dist/_shared/scope-resolution/shadow/diff.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/shadow/diff.js +79 -0
- package/dist/_shared/scope-resolution/shadow/diff.js.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts +34 -0
- package/dist/_shared/scope-resolution/symbol-definition.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/symbol-definition.js +12 -0
- package/dist/_shared/scope-resolution/symbol-definition.js.map +1 -0
- package/dist/_shared/scope-resolution/types.d.ts +356 -0
- package/dist/_shared/scope-resolution/types.d.ts.map +1 -0
- package/dist/_shared/scope-resolution/types.js +17 -0
- package/dist/_shared/scope-resolution/types.js.map +1 -0
- package/dist/cli/ai-context.d.ts +27 -0
- package/dist/cli/ai-context.js +270 -0
- package/dist/cli/analyze.d.ts +43 -0
- package/dist/cli/analyze.js +312 -0
- package/dist/cli/augment.d.ts +13 -0
- package/dist/cli/augment.js +33 -0
- package/dist/cli/clean.d.ts +10 -0
- package/dist/cli/clean.js +78 -0
- package/dist/cli/config.d.ts +27 -0
- package/dist/cli/config.js +106 -0
- package/dist/cli/eval-server.d.ts +37 -0
- package/dist/cli/eval-server.js +398 -0
- package/dist/cli/graphstore.d.ts +40 -0
- package/dist/cli/graphstore.js +639 -0
- package/dist/cli/group.d.ts +2 -0
- package/dist/cli/group.js +306 -0
- package/dist/cli/index-repo.d.ts +15 -0
- package/dist/cli/index-repo.js +120 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +236 -0
- package/dist/cli/lazy-action.d.ts +6 -0
- package/dist/cli/lazy-action.js +18 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +40 -0
- package/dist/cli/mcp.d.ts +8 -0
- package/dist/cli/mcp.js +36 -0
- package/dist/cli/remove.d.ts +30 -0
- package/dist/cli/remove.js +99 -0
- package/dist/cli/serve.d.ts +4 -0
- package/dist/cli/serve.js +37 -0
- package/dist/cli/setup.d.ts +8 -0
- package/dist/cli/setup.js +543 -0
- package/dist/cli/skill-gen.d.ts +26 -0
- package/dist/cli/skill-gen.js +555 -0
- package/dist/cli/status.d.ts +6 -0
- package/dist/cli/status.js +36 -0
- package/dist/cli/tool.d.ts +43 -0
- package/dist/cli/tool.js +168 -0
- package/dist/cli/wiki.d.ts +21 -0
- package/dist/cli/wiki.js +579 -0
- package/dist/config/ignore-service.d.ts +35 -0
- package/dist/config/ignore-service.js +436 -0
- package/dist/config/supported-languages.d.ts +13 -0
- package/dist/config/supported-languages.js +13 -0
- package/dist/core/augmentation/engine.d.ts +26 -0
- package/dist/core/augmentation/engine.js +252 -0
- package/dist/core/embeddings/ast-utils.d.ts +22 -0
- package/dist/core/embeddings/ast-utils.js +105 -0
- package/dist/core/embeddings/character-chunk.d.ts +12 -0
- package/dist/core/embeddings/character-chunk.js +43 -0
- package/dist/core/embeddings/chunker.d.ts +14 -0
- package/dist/core/embeddings/chunker.js +239 -0
- package/dist/core/embeddings/embedder.d.ts +65 -0
- package/dist/core/embeddings/embedder.js +320 -0
- package/dist/core/embeddings/embedding-pipeline.d.ts +62 -0
- package/dist/core/embeddings/embedding-pipeline.js +486 -0
- package/dist/core/embeddings/http-client.d.ts +31 -0
- package/dist/core/embeddings/http-client.js +179 -0
- package/dist/core/embeddings/index.d.ts +10 -0
- package/dist/core/embeddings/index.js +10 -0
- package/dist/core/embeddings/line-index.d.ts +7 -0
- package/dist/core/embeddings/line-index.js +42 -0
- package/dist/core/embeddings/server-mapping.d.ts +15 -0
- package/dist/core/embeddings/server-mapping.js +33 -0
- package/dist/core/embeddings/structural-extractor.d.ts +15 -0
- package/dist/core/embeddings/structural-extractor.js +58 -0
- package/dist/core/embeddings/text-generator.d.ts +31 -0
- package/dist/core/embeddings/text-generator.js +208 -0
- package/dist/core/embeddings/types.d.ts +207 -0
- package/dist/core/embeddings/types.js +200 -0
- package/dist/core/git-staleness.d.ts +31 -0
- package/dist/core/git-staleness.js +137 -0
- package/dist/core/graph/graph.d.ts +2 -0
- package/dist/core/graph/graph.js +173 -0
- package/dist/core/graph/types.d.ts +36 -0
- package/dist/core/graph/types.js +1 -0
- package/dist/core/graphstore/index.d.ts +46 -0
- package/dist/core/graphstore/index.js +80 -0
- package/dist/core/graphstore/lbug-row-source.d.ts +19 -0
- package/dist/core/graphstore/lbug-row-source.js +141 -0
- package/dist/core/group/bridge-db.d.ts +82 -0
- package/dist/core/group/bridge-db.js +460 -0
- package/dist/core/group/bridge-schema.d.ts +27 -0
- package/dist/core/group/bridge-schema.js +55 -0
- package/dist/core/group/config-parser.d.ts +7 -0
- package/dist/core/group/config-parser.js +100 -0
- package/dist/core/group/contract-extractor.d.ts +7 -0
- package/dist/core/group/contract-extractor.js +1 -0
- package/dist/core/group/cross-impact.d.ts +41 -0
- package/dist/core/group/cross-impact.js +441 -0
- package/dist/core/group/extractors/fs-utils.d.ts +10 -0
- package/dist/core/group/extractors/fs-utils.js +24 -0
- package/dist/core/group/extractors/grpc-extractor.d.ts +25 -0
- package/dist/core/group/extractors/grpc-extractor.js +401 -0
- package/dist/core/group/extractors/grpc-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/go.js +97 -0
- package/dist/core/group/extractors/grpc-patterns/index.d.ts +19 -0
- package/dist/core/group/extractors/grpc-patterns/index.js +46 -0
- package/dist/core/group/extractors/grpc-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/java.js +173 -0
- package/dist/core/group/extractors/grpc-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/grpc-patterns/node.js +290 -0
- package/dist/core/group/extractors/grpc-patterns/proto.d.ts +9 -0
- package/dist/core/group/extractors/grpc-patterns/proto.js +134 -0
- package/dist/core/group/extractors/grpc-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/grpc-patterns/python.js +67 -0
- package/dist/core/group/extractors/grpc-patterns/types.d.ts +50 -0
- package/dist/core/group/extractors/grpc-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/go.js +215 -0
- package/dist/core/group/extractors/http-patterns/index.d.ts +17 -0
- package/dist/core/group/extractors/http-patterns/index.js +44 -0
- package/dist/core/group/extractors/http-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/java.js +253 -0
- package/dist/core/group/extractors/http-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/http-patterns/node.js +484 -0
- package/dist/core/group/extractors/http-patterns/php.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/php.js +178 -0
- package/dist/core/group/extractors/http-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/http-patterns/python.js +133 -0
- package/dist/core/group/extractors/http-patterns/types.d.ts +61 -0
- package/dist/core/group/extractors/http-patterns/types.js +1 -0
- package/dist/core/group/extractors/http-route-extractor.d.ts +21 -0
- package/dist/core/group/extractors/http-route-extractor.js +421 -0
- package/dist/core/group/extractors/manifest-extractor.d.ts +54 -0
- package/dist/core/group/extractors/manifest-extractor.js +292 -0
- package/dist/core/group/extractors/topic-extractor.d.ts +8 -0
- package/dist/core/group/extractors/topic-extractor.js +97 -0
- package/dist/core/group/extractors/topic-patterns/go.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/go.js +120 -0
- package/dist/core/group/extractors/topic-patterns/index.d.ts +14 -0
- package/dist/core/group/extractors/topic-patterns/index.js +38 -0
- package/dist/core/group/extractors/topic-patterns/java.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/java.js +80 -0
- package/dist/core/group/extractors/topic-patterns/node.d.ts +4 -0
- package/dist/core/group/extractors/topic-patterns/node.js +155 -0
- package/dist/core/group/extractors/topic-patterns/python.d.ts +2 -0
- package/dist/core/group/extractors/topic-patterns/python.js +116 -0
- package/dist/core/group/extractors/topic-patterns/types.d.ts +25 -0
- package/dist/core/group/extractors/topic-patterns/types.js +10 -0
- package/dist/core/group/extractors/tree-sitter-scanner.d.ts +113 -0
- package/dist/core/group/extractors/tree-sitter-scanner.js +94 -0
- package/dist/core/group/group-path-utils.d.ts +17 -0
- package/dist/core/group/group-path-utils.js +40 -0
- package/dist/core/group/matching.d.ts +13 -0
- package/dist/core/group/matching.js +198 -0
- package/dist/core/group/normalization.d.ts +3 -0
- package/dist/core/group/normalization.js +115 -0
- package/dist/core/group/resolve-at-member.d.ts +10 -0
- package/dist/core/group/resolve-at-member.js +31 -0
- package/dist/core/group/service-boundary-detector.d.ts +8 -0
- package/dist/core/group/service-boundary-detector.js +155 -0
- package/dist/core/group/service.d.ts +55 -0
- package/dist/core/group/service.js +394 -0
- package/dist/core/group/storage.d.ts +9 -0
- package/dist/core/group/storage.js +91 -0
- package/dist/core/group/sync.d.ts +21 -0
- package/dist/core/group/sync.js +196 -0
- package/dist/core/group/types.d.ts +160 -0
- package/dist/core/group/types.js +1 -0
- package/dist/core/ingestion/ast-cache.d.ts +26 -0
- package/dist/core/ingestion/ast-cache.js +47 -0
- package/dist/core/ingestion/binding-accumulator.d.ts +212 -0
- package/dist/core/ingestion/binding-accumulator.js +336 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/c-cpp.js +8 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/csharp.js +6 -0
- package/dist/core/ingestion/call-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/dart.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/go.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/jvm.js +51 -0
- package/dist/core/ingestion/call-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/php.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/python.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/ruby.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/rust.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/call-extractors/configs/swift.js +5 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/call-extractors/configs/typescript-javascript.js +8 -0
- package/dist/core/ingestion/call-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/call-extractors/generic.js +59 -0
- package/dist/core/ingestion/call-processor.d.ts +235 -0
- package/dist/core/ingestion/call-processor.js +2639 -0
- package/dist/core/ingestion/call-routing.d.ts +55 -0
- package/dist/core/ingestion/call-routing.js +95 -0
- package/dist/core/ingestion/call-types.d.ts +135 -0
- package/dist/core/ingestion/call-types.js +2 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/c-cpp.js +11 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/csharp.js +21 -0
- package/dist/core/ingestion/class-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/dart.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/class-extractors/configs/jvm.js +35 -0
- package/dist/core/ingestion/class-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/php.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/python.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/ruby.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/rust.js +7 -0
- package/dist/core/ingestion/class-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/configs/swift.js +18 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.d.ts +4 -0
- package/dist/core/ingestion/class-extractors/configs/typescript-javascript.js +28 -0
- package/dist/core/ingestion/class-extractors/generic.d.ts +2 -0
- package/dist/core/ingestion/class-extractors/generic.js +135 -0
- package/dist/core/ingestion/class-types.d.ts +34 -0
- package/dist/core/ingestion/class-types.js +1 -0
- package/dist/core/ingestion/cluster-enricher.d.ts +38 -0
- package/dist/core/ingestion/cluster-enricher.js +168 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.d.ts +57 -0
- package/dist/core/ingestion/cobol/cobol-copy-expander.js +392 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.d.ts +210 -0
- package/dist/core/ingestion/cobol/cobol-preprocessor.js +1715 -0
- package/dist/core/ingestion/cobol/jcl-parser.d.ts +68 -0
- package/dist/core/ingestion/cobol/jcl-parser.js +217 -0
- package/dist/core/ingestion/cobol/jcl-processor.d.ts +33 -0
- package/dist/core/ingestion/cobol/jcl-processor.js +229 -0
- package/dist/core/ingestion/cobol-processor.d.ts +54 -0
- package/dist/core/ingestion/cobol-processor.js +1232 -0
- package/dist/core/ingestion/community-processor.d.ts +39 -0
- package/dist/core/ingestion/community-processor.js +318 -0
- package/dist/core/ingestion/constants.d.ts +16 -0
- package/dist/core/ingestion/constants.js +16 -0
- package/dist/core/ingestion/emit-references.d.ts +88 -0
- package/dist/core/ingestion/emit-references.js +229 -0
- package/dist/core/ingestion/entry-point-scoring.d.ts +58 -0
- package/dist/core/ingestion/entry-point-scoring.js +380 -0
- package/dist/core/ingestion/export-detection.d.ts +57 -0
- package/dist/core/ingestion/export-detection.js +233 -0
- package/dist/core/ingestion/field-extractor.d.ts +29 -0
- package/dist/core/ingestion/field-extractor.js +25 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/c-cpp.js +104 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/csharp.js +116 -0
- package/dist/core/ingestion/field-extractors/configs/dart.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/dart.js +78 -0
- package/dist/core/ingestion/field-extractors/configs/go.d.ts +11 -0
- package/dist/core/ingestion/field-extractors/configs/go.js +60 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.d.ts +53 -0
- package/dist/core/ingestion/field-extractors/configs/helpers.js +158 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/jvm.js +118 -0
- package/dist/core/ingestion/field-extractors/configs/php.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/php.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/python.d.ts +12 -0
- package/dist/core/ingestion/field-extractors/configs/python.js +91 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.d.ts +16 -0
- package/dist/core/ingestion/field-extractors/configs/ruby.js +76 -0
- package/dist/core/ingestion/field-extractors/configs/rust.d.ts +9 -0
- package/dist/core/ingestion/field-extractors/configs/rust.js +52 -0
- package/dist/core/ingestion/field-extractors/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/field-extractors/configs/swift.js +65 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/field-extractors/configs/typescript-javascript.js +56 -0
- package/dist/core/ingestion/field-extractors/generic.d.ts +49 -0
- package/dist/core/ingestion/field-extractors/generic.js +117 -0
- package/dist/core/ingestion/field-extractors/typescript.d.ts +77 -0
- package/dist/core/ingestion/field-extractors/typescript.js +291 -0
- package/dist/core/ingestion/field-types.d.ts +61 -0
- package/dist/core/ingestion/field-types.js +2 -0
- package/dist/core/ingestion/filesystem-walker.d.ts +28 -0
- package/dist/core/ingestion/filesystem-walker.js +91 -0
- package/dist/core/ingestion/finalize-orchestrator.d.ts +63 -0
- package/dist/core/ingestion/finalize-orchestrator.js +139 -0
- package/dist/core/ingestion/framework-detection.d.ts +150 -0
- package/dist/core/ingestion/framework-detection.js +786 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.d.ts +13 -0
- package/dist/core/ingestion/heritage-extractors/configs/go.js +20 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.d.ts +18 -0
- package/dist/core/ingestion/heritage-extractors/configs/ruby.js +65 -0
- package/dist/core/ingestion/heritage-extractors/generic.d.ts +23 -0
- package/dist/core/ingestion/heritage-extractors/generic.js +47 -0
- package/dist/core/ingestion/heritage-processor.d.ts +54 -0
- package/dist/core/ingestion/heritage-processor.js +360 -0
- package/dist/core/ingestion/heritage-types.d.ts +73 -0
- package/dist/core/ingestion/heritage-types.js +2 -0
- package/dist/core/ingestion/import-processor.d.ts +23 -0
- package/dist/core/ingestion/import-processor.js +373 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/import-resolvers/configs/c-cpp.js +14 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/csharp.js +27 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/configs/dart.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/go.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/go.js +26 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.d.ts +13 -0
- package/dist/core/ingestion/import-resolvers/configs/jvm.js +68 -0
- package/dist/core/ingestion/import-resolvers/configs/php.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/php.js +15 -0
- package/dist/core/ingestion/import-resolvers/configs/python.d.ts +12 -0
- package/dist/core/ingestion/import-resolvers/configs/python.js +41 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/ruby.js +16 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/rust.js +54 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.d.ts +8 -0
- package/dist/core/ingestion/import-resolvers/configs/swift.js +29 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.d.ts +9 -0
- package/dist/core/ingestion/import-resolvers/configs/typescript-javascript.js +23 -0
- package/dist/core/ingestion/import-resolvers/csharp.d.ts +18 -0
- package/dist/core/ingestion/import-resolvers/csharp.js +115 -0
- package/dist/core/ingestion/import-resolvers/go.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/go.js +46 -0
- package/dist/core/ingestion/import-resolvers/jvm.d.ts +27 -0
- package/dist/core/ingestion/import-resolvers/jvm.js +106 -0
- package/dist/core/ingestion/import-resolvers/php.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/php.js +77 -0
- package/dist/core/ingestion/import-resolvers/python.d.ts +22 -0
- package/dist/core/ingestion/import-resolvers/python.js +72 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.d.ts +24 -0
- package/dist/core/ingestion/import-resolvers/resolver-factory.js +33 -0
- package/dist/core/ingestion/import-resolvers/ruby.d.ts +14 -0
- package/dist/core/ingestion/import-resolvers/ruby.js +17 -0
- package/dist/core/ingestion/import-resolvers/rust.d.ts +17 -0
- package/dist/core/ingestion/import-resolvers/rust.js +75 -0
- package/dist/core/ingestion/import-resolvers/standard.d.ts +30 -0
- package/dist/core/ingestion/import-resolvers/standard.js +142 -0
- package/dist/core/ingestion/import-resolvers/types.d.ts +68 -0
- package/dist/core/ingestion/import-resolvers/types.js +6 -0
- package/dist/core/ingestion/import-resolvers/utils.d.ts +35 -0
- package/dist/core/ingestion/import-resolvers/utils.js +149 -0
- package/dist/core/ingestion/import-target-adapter.d.ts +73 -0
- package/dist/core/ingestion/import-target-adapter.js +95 -0
- package/dist/core/ingestion/language-config.d.ts +52 -0
- package/dist/core/ingestion/language-config.js +181 -0
- package/dist/core/ingestion/language-provider.d.ts +410 -0
- package/dist/core/ingestion/language-provider.js +24 -0
- package/dist/core/ingestion/languages/c-cpp.d.ts +12 -0
- package/dist/core/ingestion/languages/c-cpp.js +329 -0
- package/dist/core/ingestion/languages/cobol.d.ts +1 -0
- package/dist/core/ingestion/languages/cobol.js +26 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.d.ts +21 -0
- package/dist/core/ingestion/languages/csharp/accessor-unwrap.js +56 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.d.ts +26 -0
- package/dist/core/ingestion/languages/csharp/arity-metadata.js +46 -0
- package/dist/core/ingestion/languages/csharp/arity.d.ts +23 -0
- package/dist/core/ingestion/languages/csharp/arity.js +37 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/cache-stats.js +26 -0
- package/dist/core/ingestion/languages/csharp/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/captures.js +249 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.d.ts +19 -0
- package/dist/core/ingestion/languages/csharp/import-decomposer.js +93 -0
- package/dist/core/ingestion/languages/csharp/import-target.d.ts +25 -0
- package/dist/core/ingestion/languages/csharp/import-target.js +123 -0
- package/dist/core/ingestion/languages/csharp/index.d.ts +82 -0
- package/dist/core/ingestion/languages/csharp/index.js +82 -0
- package/dist/core/ingestion/languages/csharp/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/csharp/interpret.js +132 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.d.ts +27 -0
- package/dist/core/ingestion/languages/csharp/merge-bindings.js +55 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.d.ts +50 -0
- package/dist/core/ingestion/languages/csharp/namespace-siblings.js +374 -0
- package/dist/core/ingestion/languages/csharp/query.d.ts +35 -0
- package/dist/core/ingestion/languages/csharp/query.js +515 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.d.ts +31 -0
- package/dist/core/ingestion/languages/csharp/receiver-binding.js +135 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.d.ts +10 -0
- package/dist/core/ingestion/languages/csharp/scope-resolver.js +63 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.d.ts +53 -0
- package/dist/core/ingestion/languages/csharp/simple-hooks.js +76 -0
- package/dist/core/ingestion/languages/csharp.d.ts +8 -0
- package/dist/core/ingestion/languages/csharp.js +152 -0
- package/dist/core/ingestion/languages/dart.d.ts +12 -0
- package/dist/core/ingestion/languages/dart.js +102 -0
- package/dist/core/ingestion/languages/go.d.ts +11 -0
- package/dist/core/ingestion/languages/go.js +44 -0
- package/dist/core/ingestion/languages/index.d.ts +39 -0
- package/dist/core/ingestion/languages/index.js +64 -0
- package/dist/core/ingestion/languages/java.d.ts +9 -0
- package/dist/core/ingestion/languages/java.js +44 -0
- package/dist/core/ingestion/languages/kotlin.d.ts +9 -0
- package/dist/core/ingestion/languages/kotlin.js +123 -0
- package/dist/core/ingestion/languages/php.d.ts +8 -0
- package/dist/core/ingestion/languages/php.js +240 -0
- package/dist/core/ingestion/languages/python/arity-metadata.d.ts +24 -0
- package/dist/core/ingestion/languages/python/arity-metadata.js +45 -0
- package/dist/core/ingestion/languages/python/arity.d.ts +22 -0
- package/dist/core/ingestion/languages/python/arity.js +38 -0
- package/dist/core/ingestion/languages/python/cache-stats.d.ts +17 -0
- package/dist/core/ingestion/languages/python/cache-stats.js +28 -0
- package/dist/core/ingestion/languages/python/captures.d.ts +19 -0
- package/dist/core/ingestion/languages/python/captures.js +106 -0
- package/dist/core/ingestion/languages/python/import-decomposer.d.ts +15 -0
- package/dist/core/ingestion/languages/python/import-decomposer.js +112 -0
- package/dist/core/ingestion/languages/python/import-target.d.ts +21 -0
- package/dist/core/ingestion/languages/python/import-target.js +99 -0
- package/dist/core/ingestion/languages/python/index.d.ts +80 -0
- package/dist/core/ingestion/languages/python/index.js +80 -0
- package/dist/core/ingestion/languages/python/interpret.d.ts +15 -0
- package/dist/core/ingestion/languages/python/interpret.js +191 -0
- package/dist/core/ingestion/languages/python/merge-bindings.d.ts +16 -0
- package/dist/core/ingestion/languages/python/merge-bindings.js +44 -0
- package/dist/core/ingestion/languages/python/query.d.ts +9 -0
- package/dist/core/ingestion/languages/python/query.js +267 -0
- package/dist/core/ingestion/languages/python/receiver-binding.d.ts +21 -0
- package/dist/core/ingestion/languages/python/receiver-binding.js +116 -0
- package/dist/core/ingestion/languages/python/scope-resolver.d.ts +16 -0
- package/dist/core/ingestion/languages/python/scope-resolver.js +53 -0
- package/dist/core/ingestion/languages/python/simple-hooks.d.ts +23 -0
- package/dist/core/ingestion/languages/python/simple-hooks.js +35 -0
- package/dist/core/ingestion/languages/python.d.ts +12 -0
- package/dist/core/ingestion/languages/python.js +91 -0
- package/dist/core/ingestion/languages/ruby.d.ts +9 -0
- package/dist/core/ingestion/languages/ruby.js +210 -0
- package/dist/core/ingestion/languages/rust.d.ts +12 -0
- package/dist/core/ingestion/languages/rust.js +132 -0
- package/dist/core/ingestion/languages/swift.d.ts +12 -0
- package/dist/core/ingestion/languages/swift.js +244 -0
- package/dist/core/ingestion/languages/typescript.d.ts +11 -0
- package/dist/core/ingestion/languages/typescript.js +184 -0
- package/dist/core/ingestion/languages/vue.d.ts +13 -0
- package/dist/core/ingestion/languages/vue.js +77 -0
- package/dist/core/ingestion/markdown-processor.d.ts +17 -0
- package/dist/core/ingestion/markdown-processor.js +124 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/c-cpp.js +387 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/csharp.js +287 -0
- package/dist/core/ingestion/method-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/dart.js +376 -0
- package/dist/core/ingestion/method-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/go.js +176 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/jvm.js +336 -0
- package/dist/core/ingestion/method-extractors/configs/php.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/php.js +304 -0
- package/dist/core/ingestion/method-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/python.js +309 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/ruby.js +286 -0
- package/dist/core/ingestion/method-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/rust.js +195 -0
- package/dist/core/ingestion/method-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/method-extractors/configs/swift.js +277 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/method-extractors/configs/typescript-javascript.js +338 -0
- package/dist/core/ingestion/method-extractors/generic.d.ts +11 -0
- package/dist/core/ingestion/method-extractors/generic.js +204 -0
- package/dist/core/ingestion/method-types.d.ts +90 -0
- package/dist/core/ingestion/method-types.js +2 -0
- package/dist/core/ingestion/model/field-registry.d.ts +18 -0
- package/dist/core/ingestion/model/field-registry.js +22 -0
- package/dist/core/ingestion/model/heritage-map.d.ts +105 -0
- package/dist/core/ingestion/model/heritage-map.js +260 -0
- package/dist/core/ingestion/model/index.d.ts +20 -0
- package/dist/core/ingestion/model/index.js +43 -0
- package/dist/core/ingestion/model/method-registry.d.ts +71 -0
- package/dist/core/ingestion/model/method-registry.js +134 -0
- package/dist/core/ingestion/model/registration-table.d.ts +138 -0
- package/dist/core/ingestion/model/registration-table.js +224 -0
- package/dist/core/ingestion/model/resolution-context.d.ts +93 -0
- package/dist/core/ingestion/model/resolution-context.js +337 -0
- package/dist/core/ingestion/model/resolve.d.ts +61 -0
- package/dist/core/ingestion/model/resolve.js +381 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.d.ts +59 -0
- package/dist/core/ingestion/model/scope-resolution-indexes.js +42 -0
- package/dist/core/ingestion/model/semantic-model.d.ts +150 -0
- package/dist/core/ingestion/model/semantic-model.js +175 -0
- package/dist/core/ingestion/model/symbol-table.d.ts +200 -0
- package/dist/core/ingestion/model/symbol-table.js +206 -0
- package/dist/core/ingestion/model/type-registry.d.ts +39 -0
- package/dist/core/ingestion/model/type-registry.js +62 -0
- package/dist/core/ingestion/mro-processor.d.ts +46 -0
- package/dist/core/ingestion/mro-processor.js +597 -0
- package/dist/core/ingestion/named-bindings/csharp.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/csharp.js +37 -0
- package/dist/core/ingestion/named-bindings/java.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/java.js +29 -0
- package/dist/core/ingestion/named-bindings/kotlin.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/kotlin.js +36 -0
- package/dist/core/ingestion/named-bindings/php.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/php.js +61 -0
- package/dist/core/ingestion/named-bindings/python.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/python.js +49 -0
- package/dist/core/ingestion/named-bindings/rust.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/rust.js +66 -0
- package/dist/core/ingestion/named-bindings/types.d.ts +16 -0
- package/dist/core/ingestion/named-bindings/types.js +6 -0
- package/dist/core/ingestion/named-bindings/typescript.d.ts +3 -0
- package/dist/core/ingestion/named-bindings/typescript.js +58 -0
- package/dist/core/ingestion/parsing-processor.d.ts +40 -0
- package/dist/core/ingestion/parsing-processor.js +576 -0
- package/dist/core/ingestion/pipeline-phases/cobol.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/cobol.js +45 -0
- package/dist/core/ingestion/pipeline-phases/communities.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/communities.js +62 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/cross-file-impl.js +156 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.d.ts +37 -0
- package/dist/core/ingestion/pipeline-phases/cross-file.js +63 -0
- package/dist/core/ingestion/pipeline-phases/index.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/index.js +23 -0
- package/dist/core/ingestion/pipeline-phases/markdown.d.ts +17 -0
- package/dist/core/ingestion/pipeline-phases/markdown.js +33 -0
- package/dist/core/ingestion/pipeline-phases/mro.d.ts +18 -0
- package/dist/core/ingestion/pipeline-phases/mro.js +36 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/orm-extraction.js +92 -0
- package/dist/core/ingestion/pipeline-phases/orm.d.ts +15 -0
- package/dist/core/ingestion/pipeline-phases/orm.js +74 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.d.ts +58 -0
- package/dist/core/ingestion/pipeline-phases/parse-impl.js +458 -0
- package/dist/core/ingestion/pipeline-phases/parse.d.ts +74 -0
- package/dist/core/ingestion/pipeline-phases/parse.js +33 -0
- package/dist/core/ingestion/pipeline-phases/processes.d.ts +16 -0
- package/dist/core/ingestion/pipeline-phases/processes.js +143 -0
- package/dist/core/ingestion/pipeline-phases/routes.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/routes.js +243 -0
- package/dist/core/ingestion/pipeline-phases/runner.d.ts +22 -0
- package/dist/core/ingestion/pipeline-phases/runner.js +203 -0
- package/dist/core/ingestion/pipeline-phases/scan.d.ts +21 -0
- package/dist/core/ingestion/pipeline-phases/scan.js +46 -0
- package/dist/core/ingestion/pipeline-phases/structure.d.ts +27 -0
- package/dist/core/ingestion/pipeline-phases/structure.js +35 -0
- package/dist/core/ingestion/pipeline-phases/tools.d.ts +20 -0
- package/dist/core/ingestion/pipeline-phases/tools.js +79 -0
- package/dist/core/ingestion/pipeline-phases/types.d.ts +79 -0
- package/dist/core/ingestion/pipeline-phases/types.js +37 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.d.ts +70 -0
- package/dist/core/ingestion/pipeline-phases/wildcard-synthesis.js +312 -0
- package/dist/core/ingestion/pipeline.d.ts +36 -0
- package/dist/core/ingestion/pipeline.js +89 -0
- package/dist/core/ingestion/process-processor.d.ts +51 -0
- package/dist/core/ingestion/process-processor.js +317 -0
- package/dist/core/ingestion/registry-primary-flag.d.ts +86 -0
- package/dist/core/ingestion/registry-primary-flag.js +111 -0
- package/dist/core/ingestion/resolve-references.d.ts +63 -0
- package/dist/core/ingestion/resolve-references.js +175 -0
- package/dist/core/ingestion/route-extractors/expo.d.ts +1 -0
- package/dist/core/ingestion/route-extractors/expo.js +36 -0
- package/dist/core/ingestion/route-extractors/middleware.d.ts +47 -0
- package/dist/core/ingestion/route-extractors/middleware.js +167 -0
- package/dist/core/ingestion/route-extractors/nextjs.d.ts +3 -0
- package/dist/core/ingestion/route-extractors/nextjs.js +76 -0
- package/dist/core/ingestion/route-extractors/php.d.ts +7 -0
- package/dist/core/ingestion/route-extractors/php.js +22 -0
- package/dist/core/ingestion/route-extractors/response-shapes.d.ts +20 -0
- package/dist/core/ingestion/route-extractors/response-shapes.js +294 -0
- package/dist/core/ingestion/scope-extractor-bridge.d.ts +32 -0
- package/dist/core/ingestion/scope-extractor-bridge.js +44 -0
- package/dist/core/ingestion/scope-extractor.d.ts +86 -0
- package/dist/core/ingestion/scope-extractor.js +758 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.d.ts +372 -0
- package/dist/core/ingestion/scope-resolution/contract/scope-resolver.js +212 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.d.ts +43 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/edges.js +79 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.d.ts +57 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/ids.js +112 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/imports-to-edges.js +46 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.d.ts +19 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/method-dispatch.js +30 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.d.ts +37 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/node-lookup.js +113 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.d.ts +38 -0
- package/dist/core/ingestion/scope-resolution/graph-bridge/references-to-edges.js +73 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/compound-receiver.js +198 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.d.ts +27 -0
- package/dist/core/ingestion/scope-resolution/passes/free-call-fallback.js +131 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.d.ts +48 -0
- package/dist/core/ingestion/scope-resolution/passes/imported-return-types.js +130 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.d.ts +42 -0
- package/dist/core/ingestion/scope-resolution/passes/mro.js +99 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.d.ts +26 -0
- package/dist/core/ingestion/scope-resolution/passes/overload-narrowing.js +61 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.d.ts +46 -0
- package/dist/core/ingestion/scope-resolution/passes/receiver-bound-calls.js +327 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.d.ts +47 -0
- package/dist/core/ingestion/scope-resolution/pipeline/phase.js +130 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.d.ts +68 -0
- package/dist/core/ingestion/scope-resolution/pipeline/reconcile-ownership.js +125 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.d.ts +17 -0
- package/dist/core/ingestion/scope-resolution/pipeline/registry.js +21 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.d.ts +66 -0
- package/dist/core/ingestion/scope-resolution/pipeline/run.js +157 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.d.ts +36 -0
- package/dist/core/ingestion/scope-resolution/scope/namespace-targets.js +52 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.d.ts +127 -0
- package/dist/core/ingestion/scope-resolution/scope/walkers.js +349 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.d.ts +52 -0
- package/dist/core/ingestion/scope-resolution/workspace-index.js +61 -0
- package/dist/core/ingestion/shadow-harness.d.ts +113 -0
- package/dist/core/ingestion/shadow-harness.js +148 -0
- package/dist/core/ingestion/structure-processor.d.ts +2 -0
- package/dist/core/ingestion/structure-processor.js +36 -0
- package/dist/core/ingestion/tree-sitter-queries.d.ts +16 -0
- package/dist/core/ingestion/tree-sitter-queries.js +1338 -0
- package/dist/core/ingestion/type-env.d.ts +86 -0
- package/dist/core/ingestion/type-env.js +1128 -0
- package/dist/core/ingestion/type-extractors/c-cpp.d.ts +7 -0
- package/dist/core/ingestion/type-extractors/c-cpp.js +532 -0
- package/dist/core/ingestion/type-extractors/csharp.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/csharp.js +583 -0
- package/dist/core/ingestion/type-extractors/dart.d.ts +15 -0
- package/dist/core/ingestion/type-extractors/dart.js +369 -0
- package/dist/core/ingestion/type-extractors/go.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/go.js +513 -0
- package/dist/core/ingestion/type-extractors/jvm.d.ts +3 -0
- package/dist/core/ingestion/type-extractors/jvm.js +856 -0
- package/dist/core/ingestion/type-extractors/php.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/php.js +534 -0
- package/dist/core/ingestion/type-extractors/python.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/python.js +474 -0
- package/dist/core/ingestion/type-extractors/ruby.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/ruby.js +377 -0
- package/dist/core/ingestion/type-extractors/rust.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/rust.js +515 -0
- package/dist/core/ingestion/type-extractors/shared.d.ts +131 -0
- package/dist/core/ingestion/type-extractors/shared.js +796 -0
- package/dist/core/ingestion/type-extractors/swift.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/swift.js +484 -0
- package/dist/core/ingestion/type-extractors/types.d.ts +172 -0
- package/dist/core/ingestion/type-extractors/types.js +1 -0
- package/dist/core/ingestion/type-extractors/typescript.d.ts +2 -0
- package/dist/core/ingestion/type-extractors/typescript.js +661 -0
- package/dist/core/ingestion/utils/ast-helpers.d.ts +89 -0
- package/dist/core/ingestion/utils/ast-helpers.js +535 -0
- package/dist/core/ingestion/utils/call-analysis.d.ts +75 -0
- package/dist/core/ingestion/utils/call-analysis.js +574 -0
- package/dist/core/ingestion/utils/env.d.ts +10 -0
- package/dist/core/ingestion/utils/env.js +10 -0
- package/dist/core/ingestion/utils/event-loop.d.ts +5 -0
- package/dist/core/ingestion/utils/event-loop.js +5 -0
- package/dist/core/ingestion/utils/graph-sort.d.ts +58 -0
- package/dist/core/ingestion/utils/graph-sort.js +100 -0
- package/dist/core/ingestion/utils/max-file-size.d.ts +20 -0
- package/dist/core/ingestion/utils/max-file-size.js +52 -0
- package/dist/core/ingestion/utils/method-props.d.ts +32 -0
- package/dist/core/ingestion/utils/method-props.js +147 -0
- package/dist/core/ingestion/utils/ruby-self-call.d.ts +52 -0
- package/dist/core/ingestion/utils/ruby-self-call.js +59 -0
- package/dist/core/ingestion/utils/verbose.d.ts +1 -0
- package/dist/core/ingestion/utils/verbose.js +7 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/c-cpp.js +81 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.d.ts +9 -0
- package/dist/core/ingestion/variable-extractors/configs/csharp.js +63 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/dart.js +94 -0
- package/dist/core/ingestion/variable-extractors/configs/go.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/go.js +83 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.d.ts +18 -0
- package/dist/core/ingestion/variable-extractors/configs/jvm.js +115 -0
- package/dist/core/ingestion/variable-extractors/configs/php.d.ts +14 -0
- package/dist/core/ingestion/variable-extractors/configs/php.js +58 -0
- package/dist/core/ingestion/variable-extractors/configs/python.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/python.js +101 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.d.ts +11 -0
- package/dist/core/ingestion/variable-extractors/configs/ruby.js +52 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/rust.js +76 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.d.ts +2 -0
- package/dist/core/ingestion/variable-extractors/configs/swift.js +88 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.d.ts +3 -0
- package/dist/core/ingestion/variable-extractors/configs/typescript-javascript.js +83 -0
- package/dist/core/ingestion/variable-extractors/generic.d.ts +5 -0
- package/dist/core/ingestion/variable-extractors/generic.js +80 -0
- package/dist/core/ingestion/variable-types.d.ts +82 -0
- package/dist/core/ingestion/variable-types.js +2 -0
- package/dist/core/ingestion/vue-sfc-extractor.d.ts +44 -0
- package/dist/core/ingestion/vue-sfc-extractor.js +94 -0
- package/dist/core/ingestion/workers/parse-worker.d.ts +198 -0
- package/dist/core/ingestion/workers/parse-worker.js +1928 -0
- package/dist/core/ingestion/workers/worker-pool.d.ts +16 -0
- package/dist/core/ingestion/workers/worker-pool.js +126 -0
- package/dist/core/lbug/csv-generator.d.ts +33 -0
- package/dist/core/lbug/csv-generator.js +459 -0
- package/dist/core/lbug/lbug-adapter.d.ts +173 -0
- package/dist/core/lbug/lbug-adapter.js +1188 -0
- package/dist/core/lbug/pool-adapter.d.ts +93 -0
- package/dist/core/lbug/pool-adapter.js +543 -0
- package/dist/core/lbug/schema.d.ts +62 -0
- package/dist/core/lbug/schema.js +484 -0
- package/dist/core/run-analyze.d.ts +72 -0
- package/dist/core/run-analyze.js +315 -0
- package/dist/core/search/bm25-index.d.ts +41 -0
- package/dist/core/search/bm25-index.js +209 -0
- package/dist/core/search/hybrid-search.d.ts +49 -0
- package/dist/core/search/hybrid-search.js +118 -0
- package/dist/core/search/phase-timer.d.ts +72 -0
- package/dist/core/search/phase-timer.js +106 -0
- package/dist/core/tree-sitter/parser-loader.d.ts +8 -0
- package/dist/core/tree-sitter/parser-loader.js +84 -0
- package/dist/core/wiki/cursor-client.d.ts +31 -0
- package/dist/core/wiki/cursor-client.js +122 -0
- package/dist/core/wiki/generator.d.ts +129 -0
- package/dist/core/wiki/generator.js +898 -0
- package/dist/core/wiki/graph-queries.d.ts +84 -0
- package/dist/core/wiki/graph-queries.js +244 -0
- package/dist/core/wiki/html-viewer.d.ts +10 -0
- package/dist/core/wiki/html-viewer.js +303 -0
- package/dist/core/wiki/llm-client.d.ts +63 -0
- package/dist/core/wiki/llm-client.js +234 -0
- package/dist/core/wiki/prompts.d.ts +53 -0
- package/dist/core/wiki/prompts.js +181 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/lib/utils.js +3 -0
- package/dist/mcp/compatible-stdio-transport.d.ts +25 -0
- package/dist/mcp/compatible-stdio-transport.js +200 -0
- package/dist/mcp/core/embedder.d.ts +27 -0
- package/dist/mcp/core/embedder.js +122 -0
- package/dist/mcp/core/lbug-adapter.d.ts +5 -0
- package/dist/mcp/core/lbug-adapter.js +5 -0
- package/dist/mcp/local/graphstore-handler.d.ts +214 -0
- package/dist/mcp/local/graphstore-handler.js +272 -0
- package/dist/mcp/local/local-backend.d.ts +347 -0
- package/dist/mcp/local/local-backend.js +3218 -0
- package/dist/mcp/resources.d.ts +62 -0
- package/dist/mcp/resources.js +696 -0
- package/dist/mcp/server.d.ts +23 -0
- package/dist/mcp/server.js +533 -0
- package/dist/mcp/staleness.d.ts +5 -0
- package/dist/mcp/staleness.js +4 -0
- package/dist/mcp/tools.d.ts +27 -0
- package/dist/mcp/tools.js +823 -0
- package/dist/server/analyze-job.d.ts +55 -0
- package/dist/server/analyze-job.js +150 -0
- package/dist/server/analyze-worker.d.ts +13 -0
- package/dist/server/analyze-worker.js +59 -0
- package/dist/server/api.d.ts +47 -0
- package/dist/server/api.js +1727 -0
- package/dist/server/git-clone.d.ts +26 -0
- package/dist/server/git-clone.js +184 -0
- package/dist/server/mcp-http.d.ts +13 -0
- package/dist/server/mcp-http.js +100 -0
- package/dist/storage/git.d.ts +80 -0
- package/dist/storage/git.js +190 -0
- package/dist/storage/repo-manager.d.ts +458 -0
- package/dist/storage/repo-manager.js +766 -0
- package/dist/types/pipeline.d.ts +18 -0
- package/dist/types/pipeline.js +1 -0
- package/hooks/claude/codragraph-hook.cjs +268 -0
- package/hooks/claude/pre-tool-use.sh +79 -0
- package/hooks/claude/session-start.sh +42 -0
- package/package.json +127 -0
- package/scripts/bench-scope-resolution.ts +134 -0
- package/scripts/build-tree-sitter-proto.cjs +82 -0
- package/scripts/build.js +90 -0
- package/scripts/ci-list-migrated-languages.ts +24 -0
- package/scripts/patch-tree-sitter-swift.cjs +78 -0
- package/skills/codragraph-cli.md +82 -0
- package/skills/codragraph-debugging.md +89 -0
- package/skills/codragraph-exploring.md +78 -0
- package/skills/codragraph-guide.md +64 -0
- package/skills/codragraph-impact-analysis.md +97 -0
- package/skills/codragraph-pr-review.md +163 -0
- package/skills/codragraph-refactoring.md +121 -0
- package/vendor/leiden/index.cjs +355 -0
- package/vendor/leiden/utils.cjs +392 -0
- package/vendor/tree-sitter-proto/binding.gyp +30 -0
- package/vendor/tree-sitter-proto/bindings/node/binding.cc +20 -0
- package/vendor/tree-sitter-proto/bindings/node/index.d.ts +28 -0
- package/vendor/tree-sitter-proto/bindings/node/index.js +7 -0
- package/vendor/tree-sitter-proto/package.json +12 -0
- package/vendor/tree-sitter-proto/src/node-types.json +1145 -0
- package/vendor/tree-sitter-proto/src/parser.c +10149 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/alloc.h +54 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/array.h +291 -0
- package/vendor/tree-sitter-proto/src/tree_sitter/parser.h +266 -0
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Heap re-spawn removed — only analyze.ts needs the 8GB heap (via its own ensureHeap()).
|
|
3
|
+
// Removing it from here improves MCP server startup time significantly.
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { createRequire } from 'node:module';
|
|
6
|
+
import { createLazyAction } from './lazy-action.js';
|
|
7
|
+
import { registerGroupCommands } from './group.js';
|
|
8
|
+
const _require = createRequire(import.meta.url);
|
|
9
|
+
const pkg = _require('../../package.json');
|
|
10
|
+
const program = new Command();
|
|
11
|
+
program
|
|
12
|
+
.name('@codragraph/cli')
|
|
13
|
+
.description('CodraGraph local CLI and MCP server')
|
|
14
|
+
.version(pkg.version);
|
|
15
|
+
program
|
|
16
|
+
.command('setup')
|
|
17
|
+
.description('One-time setup: configure MCP for Cursor, Claude Code, OpenCode, Codex')
|
|
18
|
+
.action(createLazyAction(() => import('./setup.js'), 'setupCommand'));
|
|
19
|
+
program
|
|
20
|
+
.command('analyze [path]')
|
|
21
|
+
.description('Index a repository (full analysis)')
|
|
22
|
+
.option('-f, --force', 'Force full re-index even if up to date')
|
|
23
|
+
.option('--embeddings', 'Enable embedding generation for semantic search (off by default)')
|
|
24
|
+
.option('--skills', 'Generate repo-specific skill files from detected communities')
|
|
25
|
+
.option('--skip-agents-md', 'Skip updating the codragraph section in AGENTS.md and CLAUDE.md')
|
|
26
|
+
.option('--no-stats', 'Omit volatile file/symbol counts from AGENTS.md and CLAUDE.md')
|
|
27
|
+
.option('--skip-git', 'Index a folder without requiring a .git directory')
|
|
28
|
+
.option('--name <alias>', 'Register this repo under a custom name in ~/.codragraph/registry.json ' +
|
|
29
|
+
'(disambiguates repos whose paths share a basename, e.g. two different .../app folders)')
|
|
30
|
+
.option('--allow-duplicate-name', 'Register this repo even if another path already uses the same --name alias. ' +
|
|
31
|
+
'Leaves `-r <name>` ambiguous for the two paths; use -r <path> to disambiguate.')
|
|
32
|
+
.option('-v, --verbose', 'Enable verbose ingestion warnings (default: false)')
|
|
33
|
+
.option('--max-file-size <kb>', 'Skip files larger than this (KB). Default: 512. Hard cap: 32768 (tree-sitter limit).')
|
|
34
|
+
.addHelpText('after', '\nEnvironment variables:\n' +
|
|
35
|
+
' CODRAGRAPH_NO_GITIGNORE=1 Skip .gitignore parsing (still reads .codragraphignore)\n' +
|
|
36
|
+
' CODRAGRAPH_MAX_FILE_SIZE=N Override large-file skip threshold (KB). Default 512, max 32768.\n' +
|
|
37
|
+
'\nTip: `.codragraphignore` supports `.gitignore`-style negation. Add e.g.\n' +
|
|
38
|
+
' `!__tests__/` to index a directory that is auto-filtered by default (#771).')
|
|
39
|
+
.action(createLazyAction(() => import('./analyze.js'), 'analyzeCommand'));
|
|
40
|
+
program
|
|
41
|
+
.command('index [path...]')
|
|
42
|
+
.description('Register an existing .codragraph/ folder into the global registry (no re-analysis needed)')
|
|
43
|
+
.option('-f, --force', 'Register even if meta.json is missing (stats will be empty)')
|
|
44
|
+
.option('--allow-non-git', 'Allow registering folders that are not Git repositories')
|
|
45
|
+
.action(createLazyAction(() => import('./index-repo.js'), 'indexCommand'));
|
|
46
|
+
program
|
|
47
|
+
.command('serve')
|
|
48
|
+
.description('Start local HTTP server for web UI connection')
|
|
49
|
+
.option('-p, --port <port>', 'Port number', '4747')
|
|
50
|
+
.option('--host <host>', 'Bind address (default: 127.0.0.1, use 0.0.0.0 for remote access)')
|
|
51
|
+
.action(createLazyAction(() => import('./serve.js'), 'serveCommand'));
|
|
52
|
+
program
|
|
53
|
+
.command('mcp')
|
|
54
|
+
.description('Start MCP server (stdio) — serves all indexed repos')
|
|
55
|
+
.action(createLazyAction(() => import('./mcp.js'), 'mcpCommand'));
|
|
56
|
+
program
|
|
57
|
+
.command('list')
|
|
58
|
+
.description('List all indexed repositories')
|
|
59
|
+
.action(createLazyAction(() => import('./list.js'), 'listCommand'));
|
|
60
|
+
program
|
|
61
|
+
.command('status')
|
|
62
|
+
.description('Show index status for current repo')
|
|
63
|
+
.action(createLazyAction(() => import('./status.js'), 'statusCommand'));
|
|
64
|
+
program
|
|
65
|
+
.command('clean')
|
|
66
|
+
.description('Delete CodraGraph index for current repo')
|
|
67
|
+
.option('-f, --force', 'Skip confirmation prompt')
|
|
68
|
+
.option('--all', 'Clean all indexed repos')
|
|
69
|
+
.action(createLazyAction(() => import('./clean.js'), 'cleanCommand'));
|
|
70
|
+
program
|
|
71
|
+
.command('remove <target>')
|
|
72
|
+
.description('Delete the CodraGraph index for a registered repo (by alias, name, or absolute path). ' +
|
|
73
|
+
'Unlike `clean`, does not require being inside the repo. Idempotent on unknown targets.')
|
|
74
|
+
.option('-f, --force', 'Skip confirmation prompt')
|
|
75
|
+
.action(createLazyAction(() => import('./remove.js'), 'removeCommand'));
|
|
76
|
+
program
|
|
77
|
+
.command('wiki [path]')
|
|
78
|
+
.description('Generate repository wiki from knowledge graph')
|
|
79
|
+
.option('-f, --force', 'Force full regeneration even if up to date')
|
|
80
|
+
.option('--provider <provider>', 'LLM provider: openai or cursor (default: openai)')
|
|
81
|
+
.option('--model <model>', 'LLM model or Azure deployment name (default: minimax/minimax-m2.5)')
|
|
82
|
+
.option('--base-url <url>', 'LLM API base URL. Azure v1: https://{resource}.openai.azure.com/openai/v1')
|
|
83
|
+
.option('--api-key <key>', 'LLM API key or Azure api-key (saved to ~/.codragraph/config.json)')
|
|
84
|
+
.option('--api-version <version>', 'Azure api-version query param, e.g. 2024-10-21 (legacy Azure API only)')
|
|
85
|
+
.option('--reasoning-model', 'Mark deployment as reasoning model (o1/o3/o4-mini) — strips temperature, uses max_completion_tokens')
|
|
86
|
+
.option('--no-reasoning-model', 'Disable reasoning model mode (overrides saved config)')
|
|
87
|
+
.option('--concurrency <n>', 'Parallel LLM calls (default: 3)', '3')
|
|
88
|
+
.option('--gist', 'Publish wiki as a public GitHub Gist after generation')
|
|
89
|
+
.option('-v, --verbose', 'Enable verbose output (show LLM commands and responses)')
|
|
90
|
+
.option('--review', 'Stop after grouping to review module structure before generating pages')
|
|
91
|
+
.action(createLazyAction(() => import('./wiki.js'), 'wikiCommand'));
|
|
92
|
+
program
|
|
93
|
+
.command('augment <pattern>')
|
|
94
|
+
.description('Augment a search pattern with knowledge graph context (used by hooks)')
|
|
95
|
+
.action(createLazyAction(() => import('./augment.js'), 'augmentCommand'));
|
|
96
|
+
// ─── Direct Tool Commands (no MCP overhead) ────────────────────────
|
|
97
|
+
// These invoke LocalBackend directly for use in eval, scripts, and CI.
|
|
98
|
+
program
|
|
99
|
+
.command('query <search_query>')
|
|
100
|
+
.description('Search the knowledge graph for execution flows related to a concept')
|
|
101
|
+
.option('-r, --repo <name>', 'Target repository (omit if only one indexed)')
|
|
102
|
+
.option('-c, --context <text>', 'Task context to improve ranking')
|
|
103
|
+
.option('-g, --goal <text>', 'What you want to find')
|
|
104
|
+
.option('-l, --limit <n>', 'Max processes to return (default: 5)')
|
|
105
|
+
.option('--content', 'Include full symbol source code')
|
|
106
|
+
.action(createLazyAction(() => import('./tool.js'), 'queryCommand'));
|
|
107
|
+
program
|
|
108
|
+
.command('context [name]')
|
|
109
|
+
.description('360-degree view of a code symbol: callers, callees, processes')
|
|
110
|
+
.option('-r, --repo <name>', 'Target repository')
|
|
111
|
+
.option('-u, --uid <uid>', 'Direct symbol UID (zero-ambiguity lookup)')
|
|
112
|
+
.option('-f, --file <path>', 'File path to disambiguate common names')
|
|
113
|
+
.option('--content', 'Include full symbol source code')
|
|
114
|
+
.action(createLazyAction(() => import('./tool.js'), 'contextCommand'));
|
|
115
|
+
program
|
|
116
|
+
.command('impact <target>')
|
|
117
|
+
.description('Blast radius analysis: what breaks if you change a symbol')
|
|
118
|
+
.option('-d, --direction <dir>', 'upstream (dependants) or downstream (dependencies)', 'upstream')
|
|
119
|
+
.option('-r, --repo <name>', 'Target repository')
|
|
120
|
+
.option('--depth <n>', 'Max relationship depth (default: 3)')
|
|
121
|
+
.option('--include-tests', 'Include test files in results')
|
|
122
|
+
.action(createLazyAction(() => import('./tool.js'), 'impactCommand'));
|
|
123
|
+
program
|
|
124
|
+
.command('cypher <query>')
|
|
125
|
+
.description('Execute raw Cypher query against the knowledge graph')
|
|
126
|
+
.option('-r, --repo <name>', 'Target repository')
|
|
127
|
+
.action(createLazyAction(() => import('./tool.js'), 'cypherCommand'));
|
|
128
|
+
program
|
|
129
|
+
.command('detect-changes')
|
|
130
|
+
.alias('detect_changes')
|
|
131
|
+
.description('Map git diff hunks to indexed symbols and affected execution flows')
|
|
132
|
+
.option('-s, --scope <scope>', 'What to analyze: unstaged, staged, all, or compare', 'unstaged')
|
|
133
|
+
.option('-b, --base-ref <ref>', 'Branch/commit for compare scope (e.g. main)')
|
|
134
|
+
.option('-r, --repo <name>', 'Target repository')
|
|
135
|
+
.action(createLazyAction(() => import('./tool.js'), 'detectChangesCommand'));
|
|
136
|
+
// ─── Eval Server (persistent daemon for SWE-bench) ─────────────────
|
|
137
|
+
program
|
|
138
|
+
.command('eval-server')
|
|
139
|
+
.description('Start lightweight HTTP server for fast tool calls during evaluation')
|
|
140
|
+
.option('-p, --port <port>', 'Port number', '4848')
|
|
141
|
+
.option('--idle-timeout <seconds>', 'Auto-shutdown after N seconds idle (0 = disabled)', '0')
|
|
142
|
+
.action(createLazyAction(() => import('./eval-server.js'), 'evalServerCommand'));
|
|
143
|
+
registerGroupCommands(program);
|
|
144
|
+
// ─── Config: unified API-key model (~/.codragraph/config.json) ─────
|
|
145
|
+
const configCmd = program
|
|
146
|
+
.command('config')
|
|
147
|
+
.description('Manage codragraph CLI config — provider API keys, base URLs, models');
|
|
148
|
+
configCmd
|
|
149
|
+
.command('list', { isDefault: true })
|
|
150
|
+
.description('List configured providers (api keys redacted)')
|
|
151
|
+
.action(createLazyAction(() => import('./config.js'), 'configListCommand'));
|
|
152
|
+
configCmd
|
|
153
|
+
.command('get <provider>')
|
|
154
|
+
.description("Show a provider's settings (api key redacted). Provider: claude, openai, opencode, openrouter, azure, cursor, custom.")
|
|
155
|
+
.action(createLazyAction(() => import('./config.js'), 'configGetCommand'));
|
|
156
|
+
configCmd
|
|
157
|
+
.command('set <provider>')
|
|
158
|
+
.description('Set provider settings (writes ~/.codragraph/config.json with chmod 600 on POSIX).')
|
|
159
|
+
.option('-k, --api-key <key>', 'BYO API key for this provider')
|
|
160
|
+
.option('--base-url <url>', 'Override the default API base URL')
|
|
161
|
+
.option('--model <model>', 'Default model for this provider')
|
|
162
|
+
.option('--api-version <version>', 'Azure-only: api-version query param (e.g. 2024-10-21)')
|
|
163
|
+
.option('--reasoning-model', 'Mark deployment as reasoning model (o1/o3/o4-mini variants)')
|
|
164
|
+
.action(createLazyAction(() => import('./config.js'), 'configSetCommand'));
|
|
165
|
+
configCmd
|
|
166
|
+
.command('remove <provider>')
|
|
167
|
+
.alias('rm')
|
|
168
|
+
.description("Remove a provider's configuration")
|
|
169
|
+
.action(createLazyAction(() => import('./config.js'), 'configRemoveCommand'));
|
|
170
|
+
configCmd
|
|
171
|
+
.command('path')
|
|
172
|
+
.description('Print the canonical config-file path')
|
|
173
|
+
.action(createLazyAction(() => import('./config.js'), 'configPathCommand'));
|
|
174
|
+
// ─── Versioned-graph commands (Phase 4) ────────────────────────────
|
|
175
|
+
program
|
|
176
|
+
.command('log')
|
|
177
|
+
.description('Show the graph commit history for the current repo')
|
|
178
|
+
.option('-n, --limit <n>', 'Maximum number of commits to show', '50')
|
|
179
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'logCommand'));
|
|
180
|
+
const branchCmd = program.command('branch').description('Manage versioned-graph branches');
|
|
181
|
+
branchCmd
|
|
182
|
+
.command('list', { isDefault: true })
|
|
183
|
+
.description('List branches')
|
|
184
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'branchListCommand'));
|
|
185
|
+
branchCmd
|
|
186
|
+
.command('create <name>')
|
|
187
|
+
.description('Create a new branch at HEAD (or at --from <target>)')
|
|
188
|
+
.option('--from <target>', 'Branch / commit id to start from (defaults to HEAD)')
|
|
189
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'branchCreateCommand'));
|
|
190
|
+
branchCmd
|
|
191
|
+
.command('delete <name>')
|
|
192
|
+
.description('Delete a branch ref (refuses the currently checked-out branch)')
|
|
193
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'branchDeleteCommand'));
|
|
194
|
+
program
|
|
195
|
+
.command('diff <from> <to>')
|
|
196
|
+
.description('Structural diff between two graph commits or branches')
|
|
197
|
+
.option('--semantic', 'Use the semantic differ (added APIs, classified modifications, processes)')
|
|
198
|
+
.action(async (from, to, opts) => {
|
|
199
|
+
const mod = await import('./graphstore.js');
|
|
200
|
+
if (opts.semantic)
|
|
201
|
+
await mod.diffSemanticCommand(from, to);
|
|
202
|
+
else
|
|
203
|
+
await mod.diffCommand(from, to);
|
|
204
|
+
});
|
|
205
|
+
program
|
|
206
|
+
.command('merge <branch>')
|
|
207
|
+
.description('Three-way merge <branch> into the current branch')
|
|
208
|
+
.option('-m, --message <message>', 'Override the default merge commit message')
|
|
209
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'mergeCommand'));
|
|
210
|
+
program
|
|
211
|
+
.command('gc')
|
|
212
|
+
.description('Garbage-collect unreachable graphstore objects (mark-and-sweep)')
|
|
213
|
+
.option('--dry-run', 'List what would be deleted without removing anything')
|
|
214
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'gcCommand'));
|
|
215
|
+
program
|
|
216
|
+
.command('commit')
|
|
217
|
+
.description('Re-snapshot the live graph and create a labelled commit')
|
|
218
|
+
.requiredOption('-m, --message <message>', 'Commit message')
|
|
219
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'commitCommand'));
|
|
220
|
+
program
|
|
221
|
+
.command('checkout <target>')
|
|
222
|
+
.description('Move HEAD to a branch or commit; --materialize also rebuilds the live LadybugDB')
|
|
223
|
+
.option('--materialize', 'Rebuild the live LadybugDB from the target snapshot (destructive)')
|
|
224
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'checkoutCommand'));
|
|
225
|
+
program
|
|
226
|
+
.command('materialize <target>')
|
|
227
|
+
.description('Rebuild a target snapshot into a fresh LadybugDB at --into <path> (read-only inspection)')
|
|
228
|
+
.requiredOption('--into <path>', 'Output LadybugDB file path')
|
|
229
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'materializeCommand'));
|
|
230
|
+
program
|
|
231
|
+
.command('blame <symbolId>')
|
|
232
|
+
.description("Show every commit where a symbol's row hash changed")
|
|
233
|
+
.option('--table <name>', 'Restrict to a specific node table (Function, Class, …)')
|
|
234
|
+
.option('-n, --limit <n>', 'Maximum number of changes to show', '20')
|
|
235
|
+
.action(createLazyAction(() => import('./graphstore.js'), 'blameCommand'));
|
|
236
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a lazy-loaded CLI action that defers module import until invocation.
|
|
3
|
+
* The generic constraints ensure the export name is a valid key of the module
|
|
4
|
+
* at compile time — catching typos when used with concrete module imports.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createLazyAction<TModule extends Record<string, unknown>, TKey extends string & keyof TModule>(loader: () => Promise<TModule>, exportName: TKey): (...args: unknown[]) => Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a lazy-loaded CLI action that defers module import until invocation.
|
|
3
|
+
* The generic constraints ensure the export name is a valid key of the module
|
|
4
|
+
* at compile time — catching typos when used with concrete module imports.
|
|
5
|
+
*/
|
|
6
|
+
function isCallable(value) {
|
|
7
|
+
return typeof value === 'function';
|
|
8
|
+
}
|
|
9
|
+
export function createLazyAction(loader, exportName) {
|
|
10
|
+
return async (...args) => {
|
|
11
|
+
const module = await loader();
|
|
12
|
+
const action = module[exportName];
|
|
13
|
+
if (!isCallable(action)) {
|
|
14
|
+
throw new Error(`Lazy action export not found: ${exportName}`);
|
|
15
|
+
}
|
|
16
|
+
await action(...args);
|
|
17
|
+
};
|
|
18
|
+
}
|
package/dist/cli/list.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List Command
|
|
3
|
+
*
|
|
4
|
+
* Shows all indexed repositories from the global registry.
|
|
5
|
+
*/
|
|
6
|
+
import { listRegisteredRepos } from '../storage/repo-manager.js';
|
|
7
|
+
export const listCommand = async () => {
|
|
8
|
+
const entries = await listRegisteredRepos({ validate: true });
|
|
9
|
+
if (entries.length === 0) {
|
|
10
|
+
console.log('No indexed repositories found.');
|
|
11
|
+
console.log('Run `codragraph analyze` in a git repo to index it.');
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
console.log(`\n Indexed Repositories (${entries.length})\n`);
|
|
15
|
+
// Count occurrences of each name so colliding entries can be
|
|
16
|
+
// disambiguated in the header (#829). Unique-name entries render
|
|
17
|
+
// identically to pre-#829 output; only collisions gain a suffix.
|
|
18
|
+
const nameCounts = new Map();
|
|
19
|
+
for (const e of entries) {
|
|
20
|
+
const key = e.name.toLowerCase();
|
|
21
|
+
nameCounts.set(key, (nameCounts.get(key) ?? 0) + 1);
|
|
22
|
+
}
|
|
23
|
+
for (const entry of entries) {
|
|
24
|
+
const indexedDate = new Date(entry.indexedAt).toLocaleString();
|
|
25
|
+
const stats = entry.stats || {};
|
|
26
|
+
const commitShort = entry.lastCommit?.slice(0, 7) || 'unknown';
|
|
27
|
+
const hasCollision = (nameCounts.get(entry.name.toLowerCase()) ?? 0) > 1;
|
|
28
|
+
const header = hasCollision ? `${entry.name} (${entry.path})` : entry.name;
|
|
29
|
+
console.log(` ${header}`);
|
|
30
|
+
console.log(` Path: ${entry.path}`);
|
|
31
|
+
console.log(` Indexed: ${indexedDate}`);
|
|
32
|
+
console.log(` Commit: ${commitShort}`);
|
|
33
|
+
console.log(` Stats: ${stats.files ?? 0} files, ${stats.nodes ?? 0} symbols, ${stats.edges ?? 0} edges`);
|
|
34
|
+
if (stats.communities)
|
|
35
|
+
console.log(` Clusters: ${stats.communities}`);
|
|
36
|
+
if (stats.processes)
|
|
37
|
+
console.log(` Processes: ${stats.processes}`);
|
|
38
|
+
console.log('');
|
|
39
|
+
}
|
|
40
|
+
};
|
package/dist/cli/mcp.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Command
|
|
3
|
+
*
|
|
4
|
+
* Starts the MCP server in standalone mode.
|
|
5
|
+
* Loads all indexed repos from the global registry.
|
|
6
|
+
* No longer depends on cwd — works from any directory.
|
|
7
|
+
*/
|
|
8
|
+
import { startMCPServer } from '../mcp/server.js';
|
|
9
|
+
import { LocalBackend } from '../mcp/local/local-backend.js';
|
|
10
|
+
export const mcpCommand = async () => {
|
|
11
|
+
// Prevent unhandled errors from crashing the MCP server process.
|
|
12
|
+
// LadybugDB lock conflicts and transient errors should degrade gracefully.
|
|
13
|
+
process.on('uncaughtException', (err) => {
|
|
14
|
+
console.error(`CodraGraph MCP: uncaught exception — ${err.message}`);
|
|
15
|
+
// Process is in an undefined state after uncaughtException — exit after flushing
|
|
16
|
+
setTimeout(() => process.exit(1), 100);
|
|
17
|
+
});
|
|
18
|
+
process.on('unhandledRejection', (reason) => {
|
|
19
|
+
const msg = reason instanceof Error ? reason.message : String(reason);
|
|
20
|
+
console.error(`CodraGraph MCP: unhandled rejection — ${msg}`);
|
|
21
|
+
});
|
|
22
|
+
// Initialize multi-repo backend from registry.
|
|
23
|
+
// The server starts even with 0 repos — tools call refreshRepos() lazily,
|
|
24
|
+
// so repos indexed after the server starts are discovered automatically.
|
|
25
|
+
const backend = new LocalBackend();
|
|
26
|
+
await backend.init();
|
|
27
|
+
const repos = await backend.listRepos();
|
|
28
|
+
if (repos.length === 0) {
|
|
29
|
+
console.error('CodraGraph: No indexed repos yet. Run `codragraph analyze` in a git repo — the server will pick it up automatically.');
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.error(`CodraGraph: MCP server starting with ${repos.length} repo(s): ${repos.map((r) => r.name).join(', ')}`);
|
|
33
|
+
}
|
|
34
|
+
// Start MCP server (serves all repos, discovers new ones lazily)
|
|
35
|
+
await startMCPServer(backend);
|
|
36
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove Command (#664)
|
|
3
|
+
*
|
|
4
|
+
* Delete the `.codragraph/` index for a registered repo and unregister it
|
|
5
|
+
* from the global registry (~/.codragraph/registry.json). The target is
|
|
6
|
+
* identified by alias / basename-derived name / remote-inferred name /
|
|
7
|
+
* absolute path — no `--repo` flag, just a positional argument so the
|
|
8
|
+
* destructive-command ergonomics match `clean` (which is also
|
|
9
|
+
* destructive but scoped to `process.cwd()`).
|
|
10
|
+
*
|
|
11
|
+
* Compared to `clean`:
|
|
12
|
+
* - `clean` acts on the repo discovered by walking up from cwd.
|
|
13
|
+
* - `remove` acts on any registered repo identified by name or path.
|
|
14
|
+
*
|
|
15
|
+
* Behaviour notes:
|
|
16
|
+
* - Idempotent on unknown targets: exits 0 with a warning so that
|
|
17
|
+
* `remove X && analyze Y` keeps working in scripts. Per #664:
|
|
18
|
+
* "behave atomically and idempotently so retries are safe".
|
|
19
|
+
* - Atomic order mirrors `clean`: fs.rm FIRST, then unregister. A
|
|
20
|
+
* partial failure leaves the registry pointing at a missing dir
|
|
21
|
+
* (recoverable by `listRegisteredRepos({ validate: true })` on
|
|
22
|
+
* next read) rather than the opposite, which would orphan
|
|
23
|
+
* .codragraph/ directories on disk.
|
|
24
|
+
* - `-f` / `--force` matches the confirmation-skip semantics of
|
|
25
|
+
* `clean -f`. (Distinct from `analyze --force`, which re-indexes;
|
|
26
|
+
* here there is no pipeline, so no conflation.)
|
|
27
|
+
*/
|
|
28
|
+
export declare const removeCommand: (target: string, options?: {
|
|
29
|
+
force?: boolean;
|
|
30
|
+
}) => Promise<void>;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Remove Command (#664)
|
|
3
|
+
*
|
|
4
|
+
* Delete the `.codragraph/` index for a registered repo and unregister it
|
|
5
|
+
* from the global registry (~/.codragraph/registry.json). The target is
|
|
6
|
+
* identified by alias / basename-derived name / remote-inferred name /
|
|
7
|
+
* absolute path — no `--repo` flag, just a positional argument so the
|
|
8
|
+
* destructive-command ergonomics match `clean` (which is also
|
|
9
|
+
* destructive but scoped to `process.cwd()`).
|
|
10
|
+
*
|
|
11
|
+
* Compared to `clean`:
|
|
12
|
+
* - `clean` acts on the repo discovered by walking up from cwd.
|
|
13
|
+
* - `remove` acts on any registered repo identified by name or path.
|
|
14
|
+
*
|
|
15
|
+
* Behaviour notes:
|
|
16
|
+
* - Idempotent on unknown targets: exits 0 with a warning so that
|
|
17
|
+
* `remove X && analyze Y` keeps working in scripts. Per #664:
|
|
18
|
+
* "behave atomically and idempotently so retries are safe".
|
|
19
|
+
* - Atomic order mirrors `clean`: fs.rm FIRST, then unregister. A
|
|
20
|
+
* partial failure leaves the registry pointing at a missing dir
|
|
21
|
+
* (recoverable by `listRegisteredRepos({ validate: true })` on
|
|
22
|
+
* next read) rather than the opposite, which would orphan
|
|
23
|
+
* .codragraph/ directories on disk.
|
|
24
|
+
* - `-f` / `--force` matches the confirmation-skip semantics of
|
|
25
|
+
* `clean -f`. (Distinct from `analyze --force`, which re-indexes;
|
|
26
|
+
* here there is no pipeline, so no conflation.)
|
|
27
|
+
*/
|
|
28
|
+
import fs from 'fs/promises';
|
|
29
|
+
import { readRegistry, resolveRegistryEntry, assertSafeStoragePath, unregisterRepo, RegistryNotFoundError, RegistryAmbiguousTargetError, UnsafeStoragePathError, } from '../storage/repo-manager.js';
|
|
30
|
+
export const removeCommand = async (target, options) => {
|
|
31
|
+
// Read the registry snapshot once and pass it to the resolver — this
|
|
32
|
+
// lets us render the "before" state in the dry-run path without a
|
|
33
|
+
// second disk read.
|
|
34
|
+
const entries = await readRegistry();
|
|
35
|
+
let entry;
|
|
36
|
+
try {
|
|
37
|
+
entry = resolveRegistryEntry(entries, target);
|
|
38
|
+
}
|
|
39
|
+
catch (err) {
|
|
40
|
+
if (err instanceof RegistryNotFoundError) {
|
|
41
|
+
// Idempotent: missing target is a no-op warning, not an error.
|
|
42
|
+
// The `availableNames` hint comes from the error itself so users
|
|
43
|
+
// can see what they might have meant.
|
|
44
|
+
console.warn(`Nothing to remove: ${err.message}`);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (err instanceof RegistryAmbiguousTargetError) {
|
|
48
|
+
// Duplicate aliases are allowed via --allow-duplicate-name (#829);
|
|
49
|
+
// refuse to guess which one the user meant — surface the full list
|
|
50
|
+
// and exit non-zero so scripts don't silently pick the wrong repo.
|
|
51
|
+
console.error(`Error: ${err.message}`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
throw err;
|
|
55
|
+
}
|
|
56
|
+
// Confirmation gate — same shape as `clean`. Default is a dry-run
|
|
57
|
+
// that describes what would be deleted; `--force` actually deletes.
|
|
58
|
+
if (!options?.force) {
|
|
59
|
+
console.log(`This will delete the CodraGraph index for: ${entry.name}`);
|
|
60
|
+
console.log(` Path: ${entry.path}`);
|
|
61
|
+
console.log(` Storage: ${entry.storagePath}`);
|
|
62
|
+
console.log('\nRun with --force to confirm deletion.');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
// Safety guard (#1003 review — @magyargergo): refuse to proceed if
|
|
66
|
+
// the registry entry's `storagePath` isn't the canonical
|
|
67
|
+
// `<entry.path>/.codragraph` subfolder. `~/.codragraph/registry.json` is
|
|
68
|
+
// user-writable, so a corrupted or hand-edited entry could point
|
|
69
|
+
// storagePath at the repo root, an empty string (→ cwd), a parent
|
|
70
|
+
// dir, or anywhere else; `fs.rm(recursive: true, force: true)` on
|
|
71
|
+
// any of those would be a runtime disaster. Bail before touching
|
|
72
|
+
// disk, with an actionable hint for recovering a broken registry.
|
|
73
|
+
try {
|
|
74
|
+
assertSafeStoragePath(entry);
|
|
75
|
+
}
|
|
76
|
+
catch (err) {
|
|
77
|
+
if (err instanceof UnsafeStoragePathError) {
|
|
78
|
+
console.error(`Error: ${err.message}`);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
throw err;
|
|
82
|
+
}
|
|
83
|
+
// Deletion order: fs.rm first, then unregister. If fs.rm fails mid-way,
|
|
84
|
+
// the registry entry stays so the user can retry. If fs.rm succeeds but
|
|
85
|
+
// unregister throws (e.g. ENOSPC on registry write), the entry becomes
|
|
86
|
+
// orphaned — `listRegisteredRepos({ validate: true })` prunes those on
|
|
87
|
+
// next read, so the failure is self-healing.
|
|
88
|
+
try {
|
|
89
|
+
await fs.rm(entry.storagePath, { recursive: true, force: true });
|
|
90
|
+
await unregisterRepo(entry.path);
|
|
91
|
+
console.log(`Removed: ${entry.name}`);
|
|
92
|
+
console.log(` Path: ${entry.path}`);
|
|
93
|
+
console.log(` Storage: ${entry.storagePath}`);
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
console.error(`Failed to remove ${entry.name}:`, err);
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createServer } from '../server/api.js';
|
|
2
|
+
// Catch anything that would cause a silent exit
|
|
3
|
+
process.on('uncaughtException', (err) => {
|
|
4
|
+
console.error('\n[codragraph serve] Uncaught exception:', err.message);
|
|
5
|
+
if (process.env.DEBUG)
|
|
6
|
+
console.error(err.stack);
|
|
7
|
+
process.exit(1);
|
|
8
|
+
});
|
|
9
|
+
process.on('unhandledRejection', (reason) => {
|
|
10
|
+
console.error('\n[codragraph serve] Unhandled rejection:', reason?.message || reason);
|
|
11
|
+
if (process.env.DEBUG)
|
|
12
|
+
console.error(reason?.stack);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
15
|
+
export const serveCommand = async (options) => {
|
|
16
|
+
const port = Number(options?.port ?? 4747);
|
|
17
|
+
// Default to 'localhost' so the OS decides whether to bind to 127.0.0.1 or
|
|
18
|
+
// ::1 based on system configuration, avoiding spurious CORS errors when the
|
|
19
|
+
// hosted frontend at codragraph.vercel.app connects to localhost.
|
|
20
|
+
const host = options?.host ?? 'localhost';
|
|
21
|
+
try {
|
|
22
|
+
await createServer(port, host);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
console.error(`\nFailed to start CodraGraph server:\n`);
|
|
26
|
+
console.error(` ${err.message || err}\n`);
|
|
27
|
+
if (err.code === 'EADDRINUSE') {
|
|
28
|
+
console.error(` Port ${port} is already in use. Either:`);
|
|
29
|
+
console.error(` 1. Stop the other process using port ${port}`);
|
|
30
|
+
console.error(` 2. Use a different port: codragraph serve --port 4748\n`);
|
|
31
|
+
}
|
|
32
|
+
if (err.stack && process.env.DEBUG) {
|
|
33
|
+
console.error(err.stack);
|
|
34
|
+
}
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Setup Command
|
|
3
|
+
*
|
|
4
|
+
* One-time global MCP configuration writer.
|
|
5
|
+
* Detects installed AI editors and writes the appropriate MCP config
|
|
6
|
+
* so the CodraGraph MCP server is available in all projects.
|
|
7
|
+
*/
|
|
8
|
+
export declare const setupCommand: () => Promise<void>;
|