@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,173 @@
|
|
|
1
|
+
/** Fresh empty iterator per call — `[].values()` returns a new
|
|
2
|
+
* exhausted iterator each invocation, so empty-type lookups don't
|
|
3
|
+
* share a single already-exhausted iterator across callers. */
|
|
4
|
+
function emptyRelIter() {
|
|
5
|
+
return [].values();
|
|
6
|
+
}
|
|
7
|
+
export const createKnowledgeGraph = () => {
|
|
8
|
+
const nodeMap = new Map();
|
|
9
|
+
const relationshipMap = new Map();
|
|
10
|
+
// Per-type index maintained alongside `relationshipMap`. Bucket
|
|
11
|
+
// values are `Map<id, Relationship>` so per-type iteration is cheap
|
|
12
|
+
// and per-edge removal is O(1). See plan
|
|
13
|
+
// docs/plans/2026-04-20-002-perf-parse-heritage-mro-plan.md (Unit 1).
|
|
14
|
+
const relationshipsByType = new Map();
|
|
15
|
+
// Reverse-adjacency index: nodeId → Set<relId> of every edge where
|
|
16
|
+
// this node appears as source OR target. Maintained on writeRel /
|
|
17
|
+
// deleteRel so `removeNode` can delete a node's edges in
|
|
18
|
+
// O(edges-touching-node) instead of O(total-edges).
|
|
19
|
+
const edgeIdsByNode = new Map();
|
|
20
|
+
// File index: filePath → Set<nodeId>. Maintained on addNode /
|
|
21
|
+
// removeNode so `removeNodesByFile` reaches its file's nodes
|
|
22
|
+
// directly instead of scanning the whole node map.
|
|
23
|
+
const nodeIdsByFile = new Map();
|
|
24
|
+
// Private helpers that encode the dual-index invariants in one
|
|
25
|
+
// place. All mutation paths go through these — adding a new
|
|
26
|
+
// mutation method only needs to call the helper, not remember to
|
|
27
|
+
// touch every index.
|
|
28
|
+
const addToBucket = (map, key, value) => {
|
|
29
|
+
let bucket = map.get(key);
|
|
30
|
+
if (bucket === undefined) {
|
|
31
|
+
bucket = new Set();
|
|
32
|
+
map.set(key, bucket);
|
|
33
|
+
}
|
|
34
|
+
bucket.add(value);
|
|
35
|
+
};
|
|
36
|
+
const removeFromBucket = (map, key, value) => {
|
|
37
|
+
const bucket = map.get(key);
|
|
38
|
+
if (bucket === undefined)
|
|
39
|
+
return;
|
|
40
|
+
bucket.delete(value);
|
|
41
|
+
if (bucket.size === 0)
|
|
42
|
+
map.delete(key);
|
|
43
|
+
};
|
|
44
|
+
const writeRel = (rel) => {
|
|
45
|
+
relationshipMap.set(rel.id, rel);
|
|
46
|
+
let typeBucket = relationshipsByType.get(rel.type);
|
|
47
|
+
if (typeBucket === undefined) {
|
|
48
|
+
typeBucket = new Map();
|
|
49
|
+
relationshipsByType.set(rel.type, typeBucket);
|
|
50
|
+
}
|
|
51
|
+
typeBucket.set(rel.id, rel);
|
|
52
|
+
addToBucket(edgeIdsByNode, rel.sourceId, rel.id);
|
|
53
|
+
// Guard against a self-edge writing the same rel.id into the
|
|
54
|
+
// same Set twice — Set dedup handles it, but we skip explicitly
|
|
55
|
+
// for clarity.
|
|
56
|
+
if (rel.targetId !== rel.sourceId) {
|
|
57
|
+
addToBucket(edgeIdsByNode, rel.targetId, rel.id);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const deleteRel = (rel) => {
|
|
61
|
+
relationshipMap.delete(rel.id);
|
|
62
|
+
const typeBucket = relationshipsByType.get(rel.type);
|
|
63
|
+
if (typeBucket !== undefined) {
|
|
64
|
+
typeBucket.delete(rel.id);
|
|
65
|
+
if (typeBucket.size === 0)
|
|
66
|
+
relationshipsByType.delete(rel.type);
|
|
67
|
+
}
|
|
68
|
+
removeFromBucket(edgeIdsByNode, rel.sourceId, rel.id);
|
|
69
|
+
if (rel.targetId !== rel.sourceId) {
|
|
70
|
+
removeFromBucket(edgeIdsByNode, rel.targetId, rel.id);
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
const addNode = (node) => {
|
|
74
|
+
if (nodeMap.has(node.id))
|
|
75
|
+
return;
|
|
76
|
+
nodeMap.set(node.id, node);
|
|
77
|
+
const filePath = node.properties?.filePath;
|
|
78
|
+
if (typeof filePath === 'string' && filePath.length > 0) {
|
|
79
|
+
addToBucket(nodeIdsByFile, filePath, node.id);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const addRelationship = (relationship) => {
|
|
83
|
+
if (relationshipMap.has(relationship.id))
|
|
84
|
+
return;
|
|
85
|
+
writeRel(relationship);
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Remove a single node and all relationships involving it.
|
|
89
|
+
* O(edges-touching-node) via the reverse-adjacency index — no full
|
|
90
|
+
* relationshipMap scan.
|
|
91
|
+
*/
|
|
92
|
+
const removeNode = (nodeId) => {
|
|
93
|
+
const node = nodeMap.get(nodeId);
|
|
94
|
+
if (node === undefined)
|
|
95
|
+
return false;
|
|
96
|
+
nodeMap.delete(nodeId);
|
|
97
|
+
const filePath = node.properties?.filePath;
|
|
98
|
+
if (typeof filePath === 'string' && filePath.length > 0) {
|
|
99
|
+
removeFromBucket(nodeIdsByFile, filePath, nodeId);
|
|
100
|
+
}
|
|
101
|
+
const touchingEdgeIds = edgeIdsByNode.get(nodeId);
|
|
102
|
+
if (touchingEdgeIds !== undefined) {
|
|
103
|
+
// Snapshot the ids before iterating — deleteRel mutates the same
|
|
104
|
+
// Set via removeFromBucket, which would break mid-loop iteration.
|
|
105
|
+
for (const relId of [...touchingEdgeIds]) {
|
|
106
|
+
const rel = relationshipMap.get(relId);
|
|
107
|
+
if (rel !== undefined)
|
|
108
|
+
deleteRel(rel);
|
|
109
|
+
}
|
|
110
|
+
edgeIdsByNode.delete(nodeId);
|
|
111
|
+
}
|
|
112
|
+
return true;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Remove a single relationship by id.
|
|
116
|
+
* Returns true if the relationship existed and was removed, false otherwise.
|
|
117
|
+
*/
|
|
118
|
+
const removeRelationship = (relationshipId) => {
|
|
119
|
+
const rel = relationshipMap.get(relationshipId);
|
|
120
|
+
if (rel === undefined)
|
|
121
|
+
return false;
|
|
122
|
+
deleteRel(rel);
|
|
123
|
+
return true;
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Remove all nodes (and their relationships) belonging to a file.
|
|
127
|
+
* O(file-nodes × avg-edges-per-node) via the file index — no full
|
|
128
|
+
* node-map scan.
|
|
129
|
+
*/
|
|
130
|
+
const removeNodesByFile = (filePath) => {
|
|
131
|
+
const nodeIds = nodeIdsByFile.get(filePath);
|
|
132
|
+
if (nodeIds === undefined)
|
|
133
|
+
return 0;
|
|
134
|
+
// Snapshot before iterating — removeNode mutates nodeIdsByFile.
|
|
135
|
+
const snapshot = [...nodeIds];
|
|
136
|
+
for (const nodeId of snapshot)
|
|
137
|
+
removeNode(nodeId);
|
|
138
|
+
return snapshot.length;
|
|
139
|
+
};
|
|
140
|
+
return {
|
|
141
|
+
get nodes() {
|
|
142
|
+
return Array.from(nodeMap.values());
|
|
143
|
+
},
|
|
144
|
+
get relationships() {
|
|
145
|
+
return Array.from(relationshipMap.values());
|
|
146
|
+
},
|
|
147
|
+
iterNodes: () => nodeMap.values(),
|
|
148
|
+
iterRelationships: () => relationshipMap.values(),
|
|
149
|
+
iterRelationshipsByType: (type) => {
|
|
150
|
+
const bucket = relationshipsByType.get(type);
|
|
151
|
+
return bucket === undefined ? emptyRelIter() : bucket.values();
|
|
152
|
+
},
|
|
153
|
+
forEachNode(fn) {
|
|
154
|
+
nodeMap.forEach(fn);
|
|
155
|
+
},
|
|
156
|
+
forEachRelationship(fn) {
|
|
157
|
+
relationshipMap.forEach(fn);
|
|
158
|
+
},
|
|
159
|
+
getNode: (id) => nodeMap.get(id),
|
|
160
|
+
// O(1) count getters - avoid creating arrays just for length
|
|
161
|
+
get nodeCount() {
|
|
162
|
+
return nodeMap.size;
|
|
163
|
+
},
|
|
164
|
+
get relationshipCount() {
|
|
165
|
+
return relationshipMap.size;
|
|
166
|
+
},
|
|
167
|
+
addNode,
|
|
168
|
+
addRelationship,
|
|
169
|
+
removeNode,
|
|
170
|
+
removeNodesByFile,
|
|
171
|
+
removeRelationship,
|
|
172
|
+
};
|
|
173
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI-specific graph types.
|
|
3
|
+
*
|
|
4
|
+
* Shared types (NodeLabel, GraphNode, etc.) should be imported
|
|
5
|
+
* directly from '../../_shared/index.js' at call sites.
|
|
6
|
+
*
|
|
7
|
+
* This file only defines the CLI's KnowledgeGraph with mutation methods.
|
|
8
|
+
*/
|
|
9
|
+
import type { GraphNode, GraphRelationship, RelationshipType } from '../../_shared/index.js';
|
|
10
|
+
export interface KnowledgeGraph {
|
|
11
|
+
nodes: GraphNode[];
|
|
12
|
+
relationships: GraphRelationship[];
|
|
13
|
+
iterNodes: () => IterableIterator<GraphNode>;
|
|
14
|
+
iterRelationships: () => IterableIterator<GraphRelationship>;
|
|
15
|
+
/**
|
|
16
|
+
* Iterate ONLY relationships of the given type, backed by a per-type
|
|
17
|
+
* index maintained in `addRelationship` / `removeRelationship` /
|
|
18
|
+
* `removeNode` / `removeNodesByFile`. Returns an empty iterator when
|
|
19
|
+
* the graph contains no relationships of that type.
|
|
20
|
+
*
|
|
21
|
+
* Prefer this over `iterRelationships()` + per-edge type filtering
|
|
22
|
+
* for hot paths (MRO setup, heritage walks). Backwards-compatible:
|
|
23
|
+
* existing `iterRelationships()` callers keep working.
|
|
24
|
+
*/
|
|
25
|
+
iterRelationshipsByType: (type: RelationshipType) => IterableIterator<GraphRelationship>;
|
|
26
|
+
forEachNode: (fn: (node: GraphNode) => void) => void;
|
|
27
|
+
forEachRelationship: (fn: (rel: GraphRelationship) => void) => void;
|
|
28
|
+
getNode: (id: string) => GraphNode | undefined;
|
|
29
|
+
nodeCount: number;
|
|
30
|
+
relationshipCount: number;
|
|
31
|
+
addNode: (node: GraphNode) => void;
|
|
32
|
+
addRelationship: (relationship: GraphRelationship) => void;
|
|
33
|
+
removeNode: (nodeId: string) => boolean;
|
|
34
|
+
removeNodesByFile: (filePath: string) => number;
|
|
35
|
+
removeRelationship: (relationshipId: string) => boolean;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codragraph-side glue for the Phase 4 versioned graph store.
|
|
3
|
+
*
|
|
4
|
+
* The graphstore package itself is engine-agnostic; everything that
|
|
5
|
+
* touches LadybugDB lives here, in codragraph/. Best-effort by design:
|
|
6
|
+
* if any step fails the analyze flow continues and the user keeps a
|
|
7
|
+
* working index — versioning gracefully degrades to "no snapshot
|
|
8
|
+
* recorded for this run" rather than breaking unrelated paths.
|
|
9
|
+
*/
|
|
10
|
+
import { type ObjectId, type Snapshot, type SnapshotStats } from '@codragraph/graphstore';
|
|
11
|
+
/** Subdirectory of `<repo>/.codragraph` that holds versioning artifacts. */
|
|
12
|
+
export declare const GRAPHSTORE_SUBDIR = "graphstore";
|
|
13
|
+
export interface RecordAnalysisSnapshotOptions {
|
|
14
|
+
/** Absolute path of the repo's `.codragraph/` storage directory. */
|
|
15
|
+
readonly storagePath: string;
|
|
16
|
+
/** Git HEAD of the indexed repo, when known. */
|
|
17
|
+
readonly indexedRepoCommit?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Author for the implicit "analyze" commit. Defaults to a generic
|
|
20
|
+
* `@codragraph/cli` identity when callers don't have a real one to hand.
|
|
21
|
+
*/
|
|
22
|
+
readonly author?: {
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly email: string;
|
|
25
|
+
};
|
|
26
|
+
/** Override the commit message — defaults to a timestamped analyze marker. */
|
|
27
|
+
readonly message?: string;
|
|
28
|
+
/** Called with per-table failures so the analyze caller can log them. */
|
|
29
|
+
readonly onSkipTable?: (tableName: string, error: unknown) => void;
|
|
30
|
+
}
|
|
31
|
+
export interface RecordAnalysisSnapshotResult {
|
|
32
|
+
readonly snapshotId: ObjectId;
|
|
33
|
+
readonly commitId: ObjectId;
|
|
34
|
+
readonly snapshot: Snapshot;
|
|
35
|
+
readonly stats: SnapshotStats;
|
|
36
|
+
readonly branch: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Snapshot the currently-loaded LadybugDB into the content-addressed
|
|
40
|
+
* store and advance the active branch's HEAD to the new commit. Caller
|
|
41
|
+
* is expected to have already initialized lbug with `initLbug(...)`.
|
|
42
|
+
*
|
|
43
|
+
* Returns null if anything goes sideways (logged via `onSkipTable`); the
|
|
44
|
+
* analyze pipeline treats that as "no snapshot for this run".
|
|
45
|
+
*/
|
|
46
|
+
export declare const recordAnalysisSnapshot: (opts: RecordAnalysisSnapshotOptions) => Promise<RecordAnalysisSnapshotResult | null>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codragraph-side glue for the Phase 4 versioned graph store.
|
|
3
|
+
*
|
|
4
|
+
* The graphstore package itself is engine-agnostic; everything that
|
|
5
|
+
* touches LadybugDB lives here, in codragraph/. Best-effort by design:
|
|
6
|
+
* if any step fails the analyze flow continues and the user keeps a
|
|
7
|
+
* working index — versioning gracefully degrades to "no snapshot
|
|
8
|
+
* recorded for this run" rather than breaking unrelated paths.
|
|
9
|
+
*/
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
import { FsCAS, serializeSnapshot, createCommit, setHead, writeHeadBranch, resolveHeadCommit, DEFAULT_BRANCH, } from '@codragraph/graphstore';
|
|
12
|
+
import { createLbugRowSource } from './lbug-row-source.js';
|
|
13
|
+
/** Subdirectory of `<repo>/.codragraph` that holds versioning artifacts. */
|
|
14
|
+
export const GRAPHSTORE_SUBDIR = 'graphstore';
|
|
15
|
+
/**
|
|
16
|
+
* Snapshot the currently-loaded LadybugDB into the content-addressed
|
|
17
|
+
* store and advance the active branch's HEAD to the new commit. Caller
|
|
18
|
+
* is expected to have already initialized lbug with `initLbug(...)`.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if anything goes sideways (logged via `onSkipTable`); the
|
|
21
|
+
* analyze pipeline treats that as "no snapshot for this run".
|
|
22
|
+
*/
|
|
23
|
+
export const recordAnalysisSnapshot = async (opts) => {
|
|
24
|
+
const root = path.join(opts.storagePath, GRAPHSTORE_SUBDIR);
|
|
25
|
+
const cas = new FsCAS({ root });
|
|
26
|
+
let serialized;
|
|
27
|
+
try {
|
|
28
|
+
serialized = await serializeSnapshot({
|
|
29
|
+
source: createLbugRowSource({ onSkip: opts.onSkipTable }),
|
|
30
|
+
cas,
|
|
31
|
+
indexedRepoCommit: opts.indexedRepoCommit,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
opts.onSkipTable?.('<serialize>', err);
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
// Commit + branch wiring. If HEAD is unborn, we initialize the
|
|
39
|
+
// `main` branch pointing at this commit; otherwise we extend whatever
|
|
40
|
+
// branch is currently checked out.
|
|
41
|
+
const branch = await resolveCurrentBranch({ root });
|
|
42
|
+
let parents = [];
|
|
43
|
+
const previous = await resolveHeadCommit({ root });
|
|
44
|
+
if (previous !== null)
|
|
45
|
+
parents = [previous];
|
|
46
|
+
const commit = await createCommit({
|
|
47
|
+
cas,
|
|
48
|
+
snapshot: serialized.snapshotId,
|
|
49
|
+
parents,
|
|
50
|
+
author: opts.author ?? {
|
|
51
|
+
name: '@codragraph/cli',
|
|
52
|
+
email: 'noreply@codragraph.local',
|
|
53
|
+
},
|
|
54
|
+
message: opts.message ?? `analyze ${new Date().toISOString()}`,
|
|
55
|
+
});
|
|
56
|
+
await setHead({ root, branch, commit: commit.commitId });
|
|
57
|
+
if (parents.length === 0) {
|
|
58
|
+
// First-ever commit: anchor HEAD onto the new branch.
|
|
59
|
+
await writeHeadBranch({ root, branch });
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
snapshotId: serialized.snapshotId,
|
|
63
|
+
commitId: commit.commitId,
|
|
64
|
+
snapshot: serialized.snapshot,
|
|
65
|
+
stats: serialized.stats,
|
|
66
|
+
branch,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
/** Resolve which branch the next analyze commit should advance. */
|
|
70
|
+
const resolveCurrentBranch = async (opts) => {
|
|
71
|
+
// For Phase 4 we only support advancing the currently-checked-out
|
|
72
|
+
// branch; the CLI/MCP layer will introduce explicit `branch` /
|
|
73
|
+
// `checkout` commands later. If HEAD is unborn (first analyze ever)
|
|
74
|
+
// we default to DEFAULT_BRANCH.
|
|
75
|
+
const { readHead } = await import('@codragraph/graphstore');
|
|
76
|
+
const head = await readHead(opts);
|
|
77
|
+
if (head.kind === 'branch')
|
|
78
|
+
return head.branch;
|
|
79
|
+
return DEFAULT_BRANCH;
|
|
80
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter exposing a live LadybugDB instance as a `@codragraph/graphstore`
|
|
3
|
+
* `RowSource`. Used by the analyze pipeline (Phase 4) to snapshot the
|
|
4
|
+
* loaded graph into the content-addressed store.
|
|
5
|
+
*
|
|
6
|
+
* Best-effort by design: any table that errors at query time is skipped
|
|
7
|
+
* (with the failure surfaced through the optional `onSkip` callback) so
|
|
8
|
+
* the surrounding analyze flow never breaks because the versioning hook
|
|
9
|
+
* misbehaves.
|
|
10
|
+
*/
|
|
11
|
+
import type { RowSource } from '@codragraph/graphstore';
|
|
12
|
+
import { type NodeTableName } from '../../_shared/index.js';
|
|
13
|
+
export interface LbugRowSourceOptions {
|
|
14
|
+
/** Filter the node tables enumerated by `listNodeTables` — defaults to every NODE_TABLE. */
|
|
15
|
+
readonly nodeTables?: readonly NodeTableName[];
|
|
16
|
+
/** Called with `(table, error)` when a table query fails — defaults to a no-op. */
|
|
17
|
+
readonly onSkip?: (tableName: string, error: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
export declare const createLbugRowSource: (opts?: LbugRowSourceOptions) => RowSource;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapter exposing a live LadybugDB instance as a `@codragraph/graphstore`
|
|
3
|
+
* `RowSource`. Used by the analyze pipeline (Phase 4) to snapshot the
|
|
4
|
+
* loaded graph into the content-addressed store.
|
|
5
|
+
*
|
|
6
|
+
* Best-effort by design: any table that errors at query time is skipped
|
|
7
|
+
* (with the failure surfaced through the optional `onSkip` callback) so
|
|
8
|
+
* the surrounding analyze flow never breaks because the versioning hook
|
|
9
|
+
* misbehaves.
|
|
10
|
+
*/
|
|
11
|
+
import { NODE_TABLES, REL_TABLE_NAME } from '../../_shared/index.js';
|
|
12
|
+
import { executeQuery } from '../lbug/lbug-adapter.js';
|
|
13
|
+
export const createLbugRowSource = (opts = {}) => {
|
|
14
|
+
const onSkip = opts.onSkip ?? (() => { });
|
|
15
|
+
const tables = opts.nodeTables ?? NODE_TABLES;
|
|
16
|
+
const listNodeTables = async () => {
|
|
17
|
+
return [...tables];
|
|
18
|
+
};
|
|
19
|
+
const streamNodeTable = async function* (tableName) {
|
|
20
|
+
let rows;
|
|
21
|
+
try {
|
|
22
|
+
// `MATCH (n:T) RETURN n` returns one row per node. The node value
|
|
23
|
+
// is reachable as either `row.n` (named-column form) or `row[0]`
|
|
24
|
+
// (positional form) depending on the LadybugDB result-shape mode;
|
|
25
|
+
// we accept both, mirroring the resilient pattern used by
|
|
26
|
+
// `core/search/bm25-index.ts` for FTS results. Tables that do not
|
|
27
|
+
// exist on disk for a given repo throw here — we treat that as
|
|
28
|
+
// "no rows" via the onSkip callback rather than a hard failure.
|
|
29
|
+
rows = await executeQuery(`MATCH (n:${tableName}) RETURN n`);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
onSkip(tableName, err);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let yielded = 0;
|
|
36
|
+
for (const raw of rows) {
|
|
37
|
+
const node = unwrapNode(raw);
|
|
38
|
+
if (!node)
|
|
39
|
+
continue;
|
|
40
|
+
yield normalizeNodeRow(node);
|
|
41
|
+
yielded++;
|
|
42
|
+
}
|
|
43
|
+
// If the query reported rows but none unwrapped, surface that as a
|
|
44
|
+
// skip so the analyze log makes the silent-empty failure mode
|
|
45
|
+
// visible instead of producing a 0-row snapshot for the table.
|
|
46
|
+
if (rows.length > 0 && yielded === 0) {
|
|
47
|
+
onSkip(tableName, new Error(`lbug-row-source: query returned ${rows.length} row(s) for "${tableName}" but none had an unwrappable node — ` +
|
|
48
|
+
`result shape changed? expected row.n or row[0] to be the node`));
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
const streamEdges = async function* () {
|
|
52
|
+
let rows;
|
|
53
|
+
try {
|
|
54
|
+
// Project `from`/`to`/`type` as scalar columns and the full rel as
|
|
55
|
+
// `rel`. Scalars give us a deterministic edge id even if the rel
|
|
56
|
+
// payload's shape changes; `rel` carries any extra properties for
|
|
57
|
+
// hashing.
|
|
58
|
+
rows = await executeQuery(`MATCH (a)-[r:${REL_TABLE_NAME}]->(b) RETURN a.id AS \`from\`, b.id AS \`to\`, r.type AS type, r AS rel`);
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
onSkip(REL_TABLE_NAME, err);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
let yielded = 0;
|
|
65
|
+
for (const raw of rows) {
|
|
66
|
+
const r = raw;
|
|
67
|
+
const from = pickField(r, 'from', 0);
|
|
68
|
+
const to = pickField(r, 'to', 1);
|
|
69
|
+
const type = pickField(r, 'type', 2);
|
|
70
|
+
const rel = pickField(r, 'rel', 3);
|
|
71
|
+
if (typeof from !== 'string' || typeof to !== 'string')
|
|
72
|
+
continue;
|
|
73
|
+
yield normalizeEdgeRow({ from, to, type, rel: isPlainObject(rel) ? rel : null });
|
|
74
|
+
yielded++;
|
|
75
|
+
}
|
|
76
|
+
if (rows.length > 0 && yielded === 0) {
|
|
77
|
+
onSkip(REL_TABLE_NAME, new Error(`lbug-row-source: edges query returned ${rows.length} row(s) but none had a string from/to — ` +
|
|
78
|
+
`result shape changed?`));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
return { listNodeTables, streamNodeTable, streamEdges };
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Pull the node out of an executeQuery result row, accepting either the
|
|
85
|
+
* named-column form (`row.n`) or the positional form (`row[0]`). Returns
|
|
86
|
+
* null when the row is missing or the node value isn't an object — the
|
|
87
|
+
* caller treats that as "skip and surface".
|
|
88
|
+
*/
|
|
89
|
+
const unwrapNode = (raw) => {
|
|
90
|
+
if (!raw || typeof raw !== 'object')
|
|
91
|
+
return null;
|
|
92
|
+
const r = raw;
|
|
93
|
+
const candidate = r['n'] ?? r[0];
|
|
94
|
+
return isPlainObject(candidate) ? candidate : null;
|
|
95
|
+
};
|
|
96
|
+
/** Read a field from an executeQuery row, falling back to the positional index. */
|
|
97
|
+
const pickField = (row, named, positional) => {
|
|
98
|
+
if (!row)
|
|
99
|
+
return undefined;
|
|
100
|
+
return row[named] ?? row[positional];
|
|
101
|
+
};
|
|
102
|
+
const isPlainObject = (v) => typeof v === 'object' && v !== null && !Array.isArray(v);
|
|
103
|
+
/**
|
|
104
|
+
* Sanitize a node row for canonical hashing:
|
|
105
|
+
* - Drop LadybugDB-specific internal fields (`_id`, `_label`) that are
|
|
106
|
+
* not content-bearing — including them would make the hash sensitive
|
|
107
|
+
* to internal storage offsets and break dedup across snapshots.
|
|
108
|
+
* - Sort keys deterministically (canonical JSON in the serializer
|
|
109
|
+
* already does this, but doing it once here keeps the row payload
|
|
110
|
+
* stable when we ever swap engines).
|
|
111
|
+
*/
|
|
112
|
+
const normalizeNodeRow = (node) => {
|
|
113
|
+
const out = {};
|
|
114
|
+
for (const key of Object.keys(node).sort()) {
|
|
115
|
+
if (key === '_id' || key === '_label')
|
|
116
|
+
continue;
|
|
117
|
+
out[key] = node[key];
|
|
118
|
+
}
|
|
119
|
+
return out;
|
|
120
|
+
};
|
|
121
|
+
const normalizeEdgeRow = (r) => {
|
|
122
|
+
const props = {};
|
|
123
|
+
if (r.rel && typeof r.rel === 'object') {
|
|
124
|
+
for (const key of Object.keys(r.rel).sort()) {
|
|
125
|
+
// Skip the synthetic from/to/type that show up under `rel` too —
|
|
126
|
+
// we already project them as top-level columns and don't want
|
|
127
|
+
// duplication in the canonical row.
|
|
128
|
+
if (key === 'from' || key === 'to' || key === 'type')
|
|
129
|
+
continue;
|
|
130
|
+
if (key.startsWith('_'))
|
|
131
|
+
continue;
|
|
132
|
+
props[key] = r.rel[key];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
from: String(r.from),
|
|
137
|
+
to: String(r.to),
|
|
138
|
+
type: typeof r.type === 'string' ? r.type : String(r.type ?? ''),
|
|
139
|
+
...props,
|
|
140
|
+
};
|
|
141
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { LbugValue } from '@ladybugdb/core';
|
|
2
|
+
import type { BridgeHandle, BridgeMeta, StoredContract, CrossLink, RepoSnapshot } from './types.js';
|
|
3
|
+
export declare function contractNodeId(repo: string, contractId: string, role: string, filePath: string): string;
|
|
4
|
+
/**
|
|
5
|
+
* In-memory index of contract node IDs keyed three ways, mirroring the
|
|
6
|
+
* three-tier fallback lookup in {@link findContractNode}. Built once per
|
|
7
|
+
* `writeBridge` call after all contracts are successfully inserted, then
|
|
8
|
+
* consulted for every cross-link — which eliminates the former N+1 query
|
|
9
|
+
* pattern (up to `6 × cross-links` DB round-trips) and turns cross-link
|
|
10
|
+
* resolution into constant-time per link.
|
|
11
|
+
*
|
|
12
|
+
* Keys are deliberately flat strings (not tuples) so `Map<string, ...>`
|
|
13
|
+
* works; the separator `\0` can't occur in any legal repo path / file
|
|
14
|
+
* path / symbol identifier, which makes the encoding injection-safe.
|
|
15
|
+
*/
|
|
16
|
+
export interface ContractLookupIndex {
|
|
17
|
+
/** tier 1: `repo + role + symbolUid` → contract node id */
|
|
18
|
+
byUid: Map<string, string>;
|
|
19
|
+
/** tier 2: `repo + role + filePath + symbolName` → contract node id */
|
|
20
|
+
byRef: Map<string, string>;
|
|
21
|
+
/** tier 3: `repo + role + filePath` → list of contract node ids in that file */
|
|
22
|
+
byFile: Map<string, string[]>;
|
|
23
|
+
}
|
|
24
|
+
export declare function createContractLookupIndex(): ContractLookupIndex;
|
|
25
|
+
/**
|
|
26
|
+
* Add a successfully-inserted contract to the lookup index. Must be called
|
|
27
|
+
* AFTER the DB insert succeeds (not before) so failed inserts don't poison
|
|
28
|
+
* the index and cause cross-links to point at non-existent rows.
|
|
29
|
+
*/
|
|
30
|
+
export declare function indexContract(index: ContractLookupIndex, contract: StoredContract, nodeId: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Resolve a cross-link endpoint (consumer or provider reference) to an
|
|
33
|
+
* already-inserted contract node id. Returns `null` if no match — the
|
|
34
|
+
* caller is expected to count that as a dropped link in `WriteBridgeReport`.
|
|
35
|
+
*
|
|
36
|
+
* The resolution order matches the pre-cache DB-query behavior:
|
|
37
|
+
* 1. exact `symbolUid` match in the same `(repo, role)` scope
|
|
38
|
+
* 2. exact `(filePath, symbolName)` match
|
|
39
|
+
* 3. if exactly one contract lives in the file → that one (fallback for
|
|
40
|
+
* legacy graph-assisted extractors that couldn't resolve a symbol name)
|
|
41
|
+
*
|
|
42
|
+
* This is a pure function — no I/O, no DB — so it's trivial to unit-test
|
|
43
|
+
* in isolation (which was the reviewer's main clean-code concern on the
|
|
44
|
+
* original 35-line inner closure in `writeBridge`).
|
|
45
|
+
*/
|
|
46
|
+
export declare function findContractNode(index: ContractLookupIndex, repo: string, role: 'consumer' | 'provider', symbolUid: string, filePath: string, symbolName: string): string | null;
|
|
47
|
+
export declare function openBridgeDb(dbPath: string): Promise<BridgeHandle>;
|
|
48
|
+
export declare function ensureBridgeSchema(handle: BridgeHandle): Promise<void>;
|
|
49
|
+
export declare function queryBridge<T>(handle: BridgeHandle, cypher: string, params?: Record<string, LbugValue>): Promise<T[]>;
|
|
50
|
+
export declare function closeBridgeDb(handle: BridgeHandle): Promise<void>;
|
|
51
|
+
export declare function retryRename(src: string, dst: string, attempts?: number): Promise<void>;
|
|
52
|
+
export declare function writeBridgeMeta(groupDir: string, meta: BridgeMeta): Promise<void>;
|
|
53
|
+
export declare function readBridgeMeta(groupDir: string): Promise<BridgeMeta>;
|
|
54
|
+
export interface WriteBridgeInput {
|
|
55
|
+
contracts: StoredContract[];
|
|
56
|
+
crossLinks: CrossLink[];
|
|
57
|
+
repoSnapshots: Record<string, RepoSnapshot>;
|
|
58
|
+
missingRepos: string[];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Non-fatal issues encountered during writeBridge. Callers can log these to
|
|
62
|
+
* surface partial-success state without aborting the whole sync.
|
|
63
|
+
* `sampleErrors` is capped at MAX_SAMPLE_ERRORS per category to bound memory.
|
|
64
|
+
*/
|
|
65
|
+
export interface WriteBridgeReport {
|
|
66
|
+
contractsInserted: number;
|
|
67
|
+
contractsFailed: number;
|
|
68
|
+
snapshotsInserted: number;
|
|
69
|
+
snapshotsFailed: number;
|
|
70
|
+
linksInserted: number;
|
|
71
|
+
linksFailed: number;
|
|
72
|
+
/** Cross-links skipped because their from/to contract nodes weren't found. */
|
|
73
|
+
linksDroppedMissingNode: number;
|
|
74
|
+
sampleErrors: Array<{
|
|
75
|
+
kind: 'contract' | 'snapshot' | 'link';
|
|
76
|
+
id: string;
|
|
77
|
+
message: string;
|
|
78
|
+
}>;
|
|
79
|
+
}
|
|
80
|
+
export declare function writeBridge(groupDir: string, input: WriteBridgeInput): Promise<WriteBridgeReport>;
|
|
81
|
+
export declare function openBridgeDbReadOnly(groupDir: string): Promise<BridgeHandle | null>;
|
|
82
|
+
export declare function bridgeExists(groupDir: string): Promise<boolean>;
|